From 1acc4e7d8c77c8ef0608a898683977b50347d1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Tue, 30 Sep 2025 15:13:01 +0200 Subject: [PATCH 1/3] Implement extended AWS metadata service options support --- pkg/actuators/machine/instances.go | 39 +++++++++- pkg/actuators/machine/instances_test.go | 98 +++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/pkg/actuators/machine/instances.go b/pkg/actuators/machine/instances.go index 1d6450d65..091d9a893 100644 --- a/pkg/actuators/machine/instances.go +++ b/pkg/actuators/machine/instances.go @@ -809,6 +809,7 @@ func isAWSDualStack(infra *configv1.Infrastructure) bool { func getInstanceMetadataOptionsRequest(providerConfig *machinev1beta1.AWSMachineProviderConfig, infra *configv1.Infrastructure) *ec2.InstanceMetadataOptionsRequest { imdsOptions := &ec2.InstanceMetadataOptionsRequest{} + // Handle Authentication (HttpTokens) switch providerConfig.MetadataServiceOptions.Authentication { case "": // not set, let aws to pick a default. `optional` at this point. @@ -819,8 +820,42 @@ func getInstanceMetadataOptionsRequest(providerConfig *machinev1beta1.AWSMachine imdsOptions.HttpTokens = aws.String(ec2.HttpTokensStateRequired) } - if isAWSDualStack(infra) { - imdsOptions.HttpProtocolIpv6 = ptr.To("enabled") + // Handle HTTPEndpoint + if providerConfig.MetadataServiceOptions.HTTPEndpoint != nil { + switch *providerConfig.MetadataServiceOptions.HTTPEndpoint { + case machinev1beta1.HTTPEndpointEnabled: + imdsOptions.HttpEndpoint = aws.String(ec2.InstanceMetadataEndpointStateEnabled) + case machinev1beta1.HTTPEndpointDisabled: + imdsOptions.HttpEndpoint = aws.String(ec2.InstanceMetadataEndpointStateDisabled) + } + } + + // Handle HTTPProtocolIPv6. Explicit providerSpec wins; otherwise enable for dual-stack clusters. + switch { + case providerConfig.MetadataServiceOptions.HTTPProtocolIPv6 != nil: + switch *providerConfig.MetadataServiceOptions.HTTPProtocolIPv6 { + case machinev1beta1.HTTPProtocolIPv6Enabled: + imdsOptions.HttpProtocolIpv6 = aws.String(ec2.InstanceMetadataProtocolStateEnabled) + case machinev1beta1.HTTPProtocolIPv6Disabled: + imdsOptions.HttpProtocolIpv6 = aws.String(ec2.InstanceMetadataProtocolStateDisabled) + } + case isAWSDualStack(infra): + imdsOptions.HttpProtocolIpv6 = aws.String(ec2.InstanceMetadataProtocolStateEnabled) + } + + // Handle HTTPPutResponseHopLimit + if providerConfig.MetadataServiceOptions.HTTPPutResponseHopLimit != nil { + imdsOptions.HttpPutResponseHopLimit = providerConfig.MetadataServiceOptions.HTTPPutResponseHopLimit + } + + // Handle InstanceMetadataTags + if providerConfig.MetadataServiceOptions.InstanceMetadataTags != nil { + switch *providerConfig.MetadataServiceOptions.InstanceMetadataTags { + case machinev1beta1.InstanceMetadataTagsEnabled: + imdsOptions.InstanceMetadataTags = aws.String(ec2.InstanceMetadataTagsStateEnabled) + case machinev1beta1.InstanceMetadataTagsDisabled: + imdsOptions.InstanceMetadataTags = aws.String(ec2.InstanceMetadataTagsStateDisabled) + } } if *imdsOptions == (ec2.InstanceMetadataOptionsRequest{}) { diff --git a/pkg/actuators/machine/instances_test.go b/pkg/actuators/machine/instances_test.go index 7645e5a0c..c3982e4a6 100644 --- a/pkg/actuators/machine/instances_test.go +++ b/pkg/actuators/machine/instances_test.go @@ -1571,6 +1571,104 @@ func TestGetInstanceMetadataOptionsRequest(t *testing.T) { }, expected: nil, }, + { + name: "http endpoint enabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPEndpoint: ptr.To(machinev1beta1.HTTPEndpointEnabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpEndpoint: aws.String(ec2.InstanceMetadataEndpointStateEnabled), + }, + }, + { + name: "http endpoint disabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPEndpoint: ptr.To(machinev1beta1.HTTPEndpointDisabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpEndpoint: aws.String(ec2.InstanceMetadataEndpointStateDisabled), + }, + }, + { + name: "http put response hop limit set to 1", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPPutResponseHopLimit: aws.Int64(1), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpPutResponseHopLimit: aws.Int64(1), + }, + }, + { + name: "http put response hop limit set to 64", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPPutResponseHopLimit: aws.Int64(64), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpPutResponseHopLimit: aws.Int64(64), + }, + }, + { + name: "instance metadata tags enabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + InstanceMetadataTags: ptr.To(machinev1beta1.InstanceMetadataTagsEnabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + InstanceMetadataTags: aws.String(ec2.InstanceMetadataTagsStateEnabled), + }, + }, + { + name: "instance metadata tags disabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + InstanceMetadataTags: ptr.To(machinev1beta1.InstanceMetadataTagsDisabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + InstanceMetadataTags: aws.String(ec2.InstanceMetadataTagsStateDisabled), + }, + }, + { + name: "all options set", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + Authentication: machinev1beta1.MetadataServiceAuthenticationRequired, + HTTPEndpoint: ptr.To(machinev1beta1.HTTPEndpointEnabled), + HTTPPutResponseHopLimit: aws.Int64(32), + InstanceMetadataTags: ptr.To(machinev1beta1.InstanceMetadataTagsEnabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpTokens: aws.String(ec2.HttpTokensStateRequired), + HttpEndpoint: aws.String(ec2.InstanceMetadataEndpointStateEnabled), + HttpPutResponseHopLimit: aws.Int64(32), + InstanceMetadataTags: aws.String(ec2.InstanceMetadataTagsStateEnabled), + }, + }, + { + name: "mixed authentication and new fields", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + Authentication: machinev1beta1.MetadataServiceAuthenticationOptional, + HTTPPutResponseHopLimit: aws.Int64(5), + InstanceMetadataTags: ptr.To(machinev1beta1.InstanceMetadataTagsEnabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpTokens: aws.String(ec2.HttpTokensStateOptional), + HttpPutResponseHopLimit: aws.Int64(5), + InstanceMetadataTags: aws.String(ec2.InstanceMetadataTagsStateEnabled), + }, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { From 471e3f39edb8b86c12e8a67db8a7db3e292f7ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Mon, 13 Jul 2026 18:43:41 +0200 Subject: [PATCH 2/3] Add HTTPProtocolIPv6 coverage for IMDS options Cover explicit enable/disable and precedence over the dual-stack default. --- pkg/actuators/machine/instances_test.go | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pkg/actuators/machine/instances_test.go b/pkg/actuators/machine/instances_test.go index c3982e4a6..25318bd5a 100644 --- a/pkg/actuators/machine/instances_test.go +++ b/pkg/actuators/machine/instances_test.go @@ -1593,6 +1593,48 @@ func TestGetInstanceMetadataOptionsRequest(t *testing.T) { HttpEndpoint: aws.String(ec2.InstanceMetadataEndpointStateDisabled), }, }, + { + name: "http protocol ipv6 enabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPProtocolIPv6: ptr.To(machinev1beta1.HTTPProtocolIPv6Enabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpProtocolIpv6: aws.String(ec2.InstanceMetadataProtocolStateEnabled), + }, + }, + { + name: "http protocol ipv6 disabled", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPProtocolIPv6: ptr.To(machinev1beta1.HTTPProtocolIPv6Disabled), + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpProtocolIpv6: aws.String(ec2.InstanceMetadataProtocolStateDisabled), + }, + }, + { + name: "explicit http protocol ipv6 disabled overrides dual-stack default", + providerConfig: &machinev1beta1.AWSMachineProviderConfig{ + MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ + HTTPProtocolIPv6: ptr.To(machinev1beta1.HTTPProtocolIPv6Disabled), + }, + }, + infra: &configv1.Infrastructure{ + Status: configv1.InfrastructureStatus{ + PlatformStatus: &configv1.PlatformStatus{ + AWS: &configv1.AWSPlatformStatus{ + IPFamily: configv1.DualStackIPv6Primary, + }, + }, + }, + }, + expected: &ec2.InstanceMetadataOptionsRequest{ + HttpProtocolIpv6: aws.String(ec2.InstanceMetadataProtocolStateDisabled), + }, + }, { name: "http put response hop limit set to 1", providerConfig: &machinev1beta1.AWSMachineProviderConfig{ @@ -1643,6 +1685,7 @@ func TestGetInstanceMetadataOptionsRequest(t *testing.T) { MetadataServiceOptions: machinev1beta1.MetadataServiceOptions{ Authentication: machinev1beta1.MetadataServiceAuthenticationRequired, HTTPEndpoint: ptr.To(machinev1beta1.HTTPEndpointEnabled), + HTTPProtocolIPv6: ptr.To(machinev1beta1.HTTPProtocolIPv6Enabled), HTTPPutResponseHopLimit: aws.Int64(32), InstanceMetadataTags: ptr.To(machinev1beta1.InstanceMetadataTagsEnabled), }, @@ -1650,6 +1693,7 @@ func TestGetInstanceMetadataOptionsRequest(t *testing.T) { expected: &ec2.InstanceMetadataOptionsRequest{ HttpTokens: aws.String(ec2.HttpTokensStateRequired), HttpEndpoint: aws.String(ec2.InstanceMetadataEndpointStateEnabled), + HttpProtocolIpv6: aws.String(ec2.InstanceMetadataProtocolStateEnabled), HttpPutResponseHopLimit: aws.Int64(32), InstanceMetadataTags: aws.String(ec2.InstanceMetadataTagsStateEnabled), }, From b73bc9b58b1e660ed8b14964ef7e63aa64177729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Mon, 13 Jul 2026 18:43:42 +0200 Subject: [PATCH 3/3] DNM: Vendor local API changes for OCPCLOUD-2710 Temporary replace of github.com/openshift/api to the local workspace checkout so MAPA can build and test against the IMDS API PR. --- go.mod | 39 +- go.sum | 82 +- vendor/cel.dev/expr/.bazelversion | 2 - vendor/cel.dev/expr/.gitattributes | 2 - vendor/cel.dev/expr/.gitignore | 2 - vendor/cel.dev/expr/BUILD.bazel | 33 - vendor/cel.dev/expr/CODE_OF_CONDUCT.md | 25 - vendor/cel.dev/expr/CONTRIBUTING.md | 32 - vendor/cel.dev/expr/GOVERNANCE.md | 43 - vendor/cel.dev/expr/MAINTAINERS.md | 13 - vendor/cel.dev/expr/MODULE.bazel | 56 - vendor/cel.dev/expr/README.md | 71 - vendor/cel.dev/expr/WORKSPACE | 145 - vendor/cel.dev/expr/WORKSPACE.bzlmod | 0 vendor/cel.dev/expr/checked.pb.go | 1231 - vendor/cel.dev/expr/cloudbuild.yaml | 9 - vendor/cel.dev/expr/eval.pb.go | 468 - vendor/cel.dev/expr/explain.pb.go | 195 - vendor/cel.dev/expr/regen_go_proto.sh | 9 - .../expr/regen_go_proto_canonical_protos.sh | 10 - vendor/cel.dev/expr/syntax.pb.go | 1394 - vendor/cel.dev/expr/value.pb.go | 575 - .../github.com/antlr4-go/antlr/v4/.gitignore | 18 - vendor/github.com/antlr4-go/antlr/v4/LICENSE | 28 - .../github.com/antlr4-go/antlr/v4/README.md | 54 - .../github.com/antlr4-go/antlr/v4/antlrdoc.go | 102 - vendor/github.com/antlr4-go/antlr/v4/atn.go | 179 - .../antlr4-go/antlr/v4/atn_config.go | 335 - .../antlr4-go/antlr/v4/atn_config_set.go | 301 - .../antlr/v4/atn_deserialization_options.go | 62 - .../antlr4-go/antlr/v4/atn_deserializer.go | 684 - .../antlr4-go/antlr/v4/atn_simulator.go | 41 - .../antlr4-go/antlr/v4/atn_state.go | 461 - .../github.com/antlr4-go/antlr/v4/atn_type.go | 11 - .../antlr4-go/antlr/v4/char_stream.go | 12 - .../antlr/v4/common_token_factory.go | 56 - .../antlr4-go/antlr/v4/common_token_stream.go | 450 - .../antlr4-go/antlr/v4/comparators.go | 150 - .../antlr4-go/antlr/v4/configuration.go | 214 - vendor/github.com/antlr4-go/antlr/v4/dfa.go | 175 - .../antlr4-go/antlr/v4/dfa_serializer.go | 158 - .../antlr4-go/antlr/v4/dfa_state.go | 170 - .../antlr/v4/diagnostic_error_listener.go | 110 - .../antlr4-go/antlr/v4/error_listener.go | 100 - .../antlr4-go/antlr/v4/error_strategy.go | 702 - .../github.com/antlr4-go/antlr/v4/errors.go | 259 - .../antlr4-go/antlr/v4/file_stream.go | 67 - .../antlr4-go/antlr/v4/input_stream.go | 157 - .../antlr4-go/antlr/v4/int_stream.go | 16 - .../antlr4-go/antlr/v4/interval_set.go | 330 - .../github.com/antlr4-go/antlr/v4/jcollect.go | 685 - vendor/github.com/antlr4-go/antlr/v4/lexer.go | 426 - .../antlr4-go/antlr/v4/lexer_action.go | 452 - .../antlr/v4/lexer_action_executor.go | 173 - .../antlr4-go/antlr/v4/lexer_atn_simulator.go | 677 - .../antlr4-go/antlr/v4/ll1_analyzer.go | 218 - .../antlr4-go/antlr/v4/nostatistics.go | 47 - .../github.com/antlr4-go/antlr/v4/parser.go | 700 - .../antlr/v4/parser_atn_simulator.go | 1668 - .../antlr4-go/antlr/v4/parser_rule_context.go | 421 - .../antlr4-go/antlr/v4/prediction_context.go | 727 - .../antlr/v4/prediction_context_cache.go | 48 - .../antlr4-go/antlr/v4/prediction_mode.go | 536 - .../antlr4-go/antlr/v4/recognizer.go | 241 - .../antlr4-go/antlr/v4/rule_context.go | 40 - .../antlr4-go/antlr/v4/semantic_context.go | 464 - .../antlr4-go/antlr/v4/statistics.go | 281 - .../antlr4-go/antlr/v4/stats_data.go | 23 - vendor/github.com/antlr4-go/antlr/v4/token.go | 213 - .../antlr4-go/antlr/v4/token_source.go | 17 - .../antlr4-go/antlr/v4/token_stream.go | 21 - .../antlr/v4/tokenstream_rewriter.go | 662 - .../antlr4-go/antlr/v4/trace_listener.go | 32 - .../antlr4-go/antlr/v4/transition.go | 439 - vendor/github.com/antlr4-go/antlr/v4/tree.go | 304 - vendor/github.com/antlr4-go/antlr/v4/trees.go | 142 - vendor/github.com/antlr4-go/antlr/v4/utils.go | 328 - .../github.com/aws/aws-sdk-go-v2/LICENSE.txt | 202 - .../github.com/aws/aws-sdk-go-v2/NOTICE.txt | 3 - .../aws/accountid_endpoint_mode.go | 18 - .../aws/aws-sdk-go-v2/aws/checksum.go | 33 - .../aws/aws-sdk-go-v2/aws/config.go | 250 - .../aws/aws-sdk-go-v2/aws/context.go | 22 - .../aws/aws-sdk-go-v2/aws/credential_cache.go | 235 - .../aws/aws-sdk-go-v2/aws/credentials.go | 230 - .../aws/aws-sdk-go-v2/aws/defaults/auto.go | 38 - .../aws/defaults/configuration.go | 43 - .../aws-sdk-go-v2/aws/defaults/defaults.go | 50 - .../aws/aws-sdk-go-v2/aws/defaults/doc.go | 2 - .../aws/aws-sdk-go-v2/aws/defaultsmode.go | 95 - .../github.com/aws/aws-sdk-go-v2/aws/doc.go | 62 - .../aws/aws-sdk-go-v2/aws/endpoints.go | 247 - .../aws/aws-sdk-go-v2/aws/errors.go | 9 - .../aws/aws-sdk-go-v2/aws/from_ptr.go | 365 - .../aws-sdk-go-v2/aws/go_module_metadata.go | 6 - .../aws/aws-sdk-go-v2/aws/logging.go | 119 - .../aws/aws-sdk-go-v2/aws/logging_generate.go | 95 - .../aws-sdk-go-v2/aws/middleware/metadata.go | 213 - .../aws/middleware/middleware.go | 168 - .../aws-sdk-go-v2/aws/middleware/osname.go | 24 - .../aws/middleware/osname_go115.go | 24 - .../aws/middleware/recursion_detection.go | 94 - .../aws/middleware/request_id.go | 27 - .../aws/middleware/request_id_retriever.go | 57 - .../aws/middleware/user_agent.go | 393 - .../aws/protocol/ec2query/error_utils.go | 24 - .../aws-sdk-go-v2/aws/protocol/query/array.go | 61 - .../aws/protocol/query/encoder.go | 80 - .../aws-sdk-go-v2/aws/protocol/query/map.go | 78 - .../aws/protocol/query/middleware.go | 62 - .../aws/protocol/query/object.go | 68 - .../aws-sdk-go-v2/aws/protocol/query/value.go | 117 - .../aws/protocol/restjson/decoder_util.go | 85 - .../aws/protocol/xml/error_utils.go | 48 - .../aws/aws-sdk-go-v2/aws/ratelimit/none.go | 20 - .../aws/ratelimit/token_bucket.go | 96 - .../aws/ratelimit/token_rate_limit.go | 83 - .../aws/aws-sdk-go-v2/aws/request.go | 25 - .../aws/aws-sdk-go-v2/aws/retry/adaptive.go | 156 - .../aws/retry/adaptive_ratelimit.go | 158 - .../aws/retry/adaptive_token_bucket.go | 83 - .../aws/retry/attempt_metrics.go | 51 - .../aws/aws-sdk-go-v2/aws/retry/doc.go | 80 - .../aws/aws-sdk-go-v2/aws/retry/errors.go | 20 - .../aws-sdk-go-v2/aws/retry/jitter_backoff.go | 49 - .../aws/aws-sdk-go-v2/aws/retry/metadata.go | 52 - .../aws/aws-sdk-go-v2/aws/retry/middleware.go | 418 - .../aws/aws-sdk-go-v2/aws/retry/retry.go | 90 - .../aws/retry/retryable_error.go | 228 - .../aws/aws-sdk-go-v2/aws/retry/standard.go | 269 - .../aws-sdk-go-v2/aws/retry/throttle_error.go | 60 - .../aws-sdk-go-v2/aws/retry/timeout_error.go | 52 - .../aws/aws-sdk-go-v2/aws/retryer.go | 127 - .../aws/aws-sdk-go-v2/aws/runtime.go | 14 - .../aws/signer/internal/v4/cache.go | 115 - .../aws/signer/internal/v4/const.go | 40 - .../aws/signer/internal/v4/header_rules.go | 82 - .../aws/signer/internal/v4/headers.go | 70 - .../aws/signer/internal/v4/hmac.go | 13 - .../aws/signer/internal/v4/host.go | 75 - .../aws/signer/internal/v4/scope.go | 13 - .../aws/signer/internal/v4/time.go | 36 - .../aws/signer/internal/v4/util.go | 80 - .../aws-sdk-go-v2/aws/signer/v4/middleware.go | 420 - .../aws/signer/v4/presign_middleware.go | 127 - .../aws/aws-sdk-go-v2/aws/signer/v4/stream.go | 86 - .../aws/aws-sdk-go-v2/aws/signer/v4/v4.go | 564 - .../aws/aws-sdk-go-v2/aws/to_ptr.go | 297 - .../aws/transport/http/client.go | 342 - .../aws/transport/http/content_type.go | 42 - .../aws/transport/http/response_error.go | 33 - .../http/response_error_middleware.go | 56 - .../aws/transport/http/timeout_read_closer.go | 104 - .../github.com/aws/aws-sdk-go-v2/aws/types.go | 42 - .../aws/aws-sdk-go-v2/aws/version.go | 8 - .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 945 - .../aws/aws-sdk-go-v2/config/LICENSE.txt | 202 - .../config/auth_scheme_preference.go | 19 - .../aws/aws-sdk-go-v2/config/config.go | 235 - .../aws/aws-sdk-go-v2/config/defaultsmode.go | 47 - .../aws/aws-sdk-go-v2/config/doc.go | 20 - .../aws/aws-sdk-go-v2/config/env_config.go | 932 - .../aws/aws-sdk-go-v2/config/generate.go | 4 - .../config/go_module_metadata.go | 6 - .../aws/aws-sdk-go-v2/config/load_options.go | 1355 - .../aws/aws-sdk-go-v2/config/local.go | 51 - .../aws/aws-sdk-go-v2/config/provider.go | 786 - .../aws/aws-sdk-go-v2/config/resolve.go | 444 - .../config/resolve_bearer_token.go | 122 - .../config/resolve_credentials.go | 627 - .../aws/aws-sdk-go-v2/config/shared_config.go | 1696 - .../aws-sdk-go-v2/credentials/CHANGELOG.md | 843 - .../aws/aws-sdk-go-v2/credentials/LICENSE.txt | 202 - .../aws/aws-sdk-go-v2/credentials/doc.go | 4 - .../credentials/ec2rolecreds/doc.go | 58 - .../credentials/ec2rolecreds/provider.go | 241 - .../endpointcreds/internal/client/auth.go | 48 - .../endpointcreds/internal/client/client.go | 165 - .../internal/client/endpoints.go | 20 - .../internal/client/middleware.go | 164 - .../credentials/endpointcreds/provider.go | 207 - .../credentials/go_module_metadata.go | 6 - .../credentials/processcreds/doc.go | 92 - .../credentials/processcreds/provider.go | 296 - .../aws-sdk-go-v2/credentials/ssocreds/doc.go | 81 - .../credentials/ssocreds/sso_cached_token.go | 233 - .../ssocreds/sso_credentials_provider.go | 165 - .../ssocreds/sso_token_provider.go | 147 - .../credentials/static_provider.go | 63 - .../stscreds/assume_role_provider.go | 338 - .../stscreds/web_identity_provider.go | 181 - .../feature/ec2/imds/CHANGELOG.md | 494 - .../feature/ec2/imds/LICENSE.txt | 202 - .../feature/ec2/imds/api_client.go | 358 - .../feature/ec2/imds/api_op_GetDynamicData.go | 77 - .../feature/ec2/imds/api_op_GetIAMInfo.go | 103 - .../api_op_GetInstanceIdentityDocument.go | 110 - .../feature/ec2/imds/api_op_GetMetadata.go | 77 - .../feature/ec2/imds/api_op_GetRegion.go | 73 - .../feature/ec2/imds/api_op_GetToken.go | 119 - .../feature/ec2/imds/api_op_GetUserData.go | 61 - .../aws-sdk-go-v2/feature/ec2/imds/auth.go | 48 - .../aws/aws-sdk-go-v2/feature/ec2/imds/doc.go | 12 - .../feature/ec2/imds/endpoints.go | 20 - .../feature/ec2/imds/go_module_metadata.go | 6 - .../ec2/imds/internal/config/resolvers.go | 114 - .../feature/ec2/imds/request_middleware.go | 313 - .../feature/ec2/imds/token_provider.go | 261 - .../aws/aws-sdk-go-v2/internal/auth/auth.go | 45 - .../aws/aws-sdk-go-v2/internal/auth/scheme.go | 191 - .../auth/smithy/bearer_token_adapter.go | 43 - .../smithy/bearer_token_signer_adapter.go | 35 - .../auth/smithy/credentials_adapter.go | 46 - .../internal/auth/smithy/smithy.go | 2 - .../internal/auth/smithy/v4signer_adapter.go | 57 - .../internal/configsources/CHANGELOG.md | 455 - .../internal/configsources/LICENSE.txt | 202 - .../internal/configsources/config.go | 65 - .../internal/configsources/endpoints.go | 57 - .../configsources/go_module_metadata.go | 6 - .../aws-sdk-go-v2/internal/context/context.go | 52 - .../internal/endpoints/awsrulesfn/arn.go | 94 - .../internal/endpoints/awsrulesfn/doc.go | 3 - .../internal/endpoints/awsrulesfn/generate.go | 7 - .../internal/endpoints/awsrulesfn/host.go | 51 - .../endpoints/awsrulesfn/partition.go | 76 - .../endpoints/awsrulesfn/partitions.go | 489 - .../endpoints/awsrulesfn/partitions.json | 264 - .../internal/endpoints/endpoints.go | 201 - .../internal/endpoints/v2/CHANGELOG.md | 430 - .../internal/endpoints/v2/LICENSE.txt | 202 - .../internal/endpoints/v2/endpoints.go | 302 - .../endpoints/v2/go_module_metadata.go | 6 - .../aws-sdk-go-v2/internal/ini/CHANGELOG.md | 283 - .../aws-sdk-go-v2/internal/ini/LICENSE.txt | 202 - .../aws/aws-sdk-go-v2/internal/ini/errors.go | 22 - .../internal/ini/go_module_metadata.go | 6 - .../aws/aws-sdk-go-v2/internal/ini/ini.go | 56 - .../aws/aws-sdk-go-v2/internal/ini/parse.go | 109 - .../aws-sdk-go-v2/internal/ini/sections.go | 157 - .../aws/aws-sdk-go-v2/internal/ini/strings.go | 89 - .../aws/aws-sdk-go-v2/internal/ini/token.go | 32 - .../aws-sdk-go-v2/internal/ini/tokenize.go | 92 - .../aws/aws-sdk-go-v2/internal/ini/value.go | 93 - .../internal/middleware/middleware.go | 42 - .../aws/aws-sdk-go-v2/internal/rand/rand.go | 33 - .../aws-sdk-go-v2/internal/sdk/interfaces.go | 9 - .../aws/aws-sdk-go-v2/internal/sdk/time.go | 74 - .../aws/aws-sdk-go-v2/internal/sdkio/byte.go | 12 - .../internal/shareddefaults/shared_config.go | 47 - .../aws-sdk-go-v2/internal/strings/strings.go | 11 - .../internal/sync/singleflight/LICENSE | 28 - .../internal/sync/singleflight/docs.go | 7 - .../sync/singleflight/singleflight.go | 210 - .../internal/timeconv/duration.go | 13 - .../aws-sdk-go-v2/service/ec2/CHANGELOG.md | 1387 - .../aws/aws-sdk-go-v2/service/ec2/LICENSE.txt | 202 - .../aws-sdk-go-v2/service/ec2/api_client.go | 1111 - .../ec2/api_op_AcceptAddressTransfer.go | 175 - ...ceptCapacityReservationBillingOwnership.go | 168 - ...op_AcceptReservedInstancesExchangeQuote.go | 173 - ...ansitGatewayMulticastDomainAssociations.go | 167 - ...p_AcceptTransitGatewayPeeringAttachment.go | 167 - ...pi_op_AcceptTransitGatewayVpcAttachment.go | 169 - .../api_op_AcceptVpcEndpointConnections.go | 171 - .../ec2/api_op_AcceptVpcPeeringConnection.go | 172 - .../service/ec2/api_op_AdvertiseByoipCidr.go | 205 - .../service/ec2/api_op_AllocateAddress.go | 235 - .../service/ec2/api_op_AllocateHosts.go | 242 - .../ec2/api_op_AllocateIpamPoolCidr.go | 259 - ...ySecurityGroupsToClientVpnTargetNetwork.go | 178 - .../service/ec2/api_op_AssignIpv6Addresses.go | 200 - .../ec2/api_op_AssignPrivateIpAddresses.go | 217 - .../api_op_AssignPrivateNatGatewayAddress.go | 179 - .../service/ec2/api_op_AssociateAddress.go | 206 - ...ssociateCapacityReservationBillingOwner.go | 174 - .../api_op_AssociateClientVpnTargetNetwork.go | 225 - .../ec2/api_op_AssociateDhcpOptions.go | 178 - ...i_op_AssociateEnclaveCertificateIamRole.go | 197 - .../ec2/api_op_AssociateIamInstanceProfile.go | 166 - .../api_op_AssociateInstanceEventWindow.go | 177 - .../service/ec2/api_op_AssociateIpamByoasn.go | 180 - .../api_op_AssociateIpamResourceDiscovery.go | 216 - .../ec2/api_op_AssociateNatGatewayAddress.go | 195 - .../ec2/api_op_AssociateRouteServer.go | 178 - .../service/ec2/api_op_AssociateRouteTable.go | 185 - .../ec2/api_op_AssociateSecurityGroupVpc.go | 185 - .../ec2/api_op_AssociateSubnetCidrBlock.go | 173 - ..._AssociateTransitGatewayMulticastDomain.go | 183 - ...i_op_AssociateTransitGatewayPolicyTable.go | 174 - ...pi_op_AssociateTransitGatewayRouteTable.go | 172 - .../ec2/api_op_AssociateTrunkInterface.go | 232 - .../ec2/api_op_AssociateVpcCidrBlock.go | 230 - .../ec2/api_op_AttachClassicLinkVpc.go | 189 - .../ec2/api_op_AttachInternetGateway.go | 170 - .../ec2/api_op_AttachNetworkInterface.go | 193 - ...pi_op_AttachVerifiedAccessTrustProvider.go | 217 - .../service/ec2/api_op_AttachVolume.go | 239 - .../service/ec2/api_op_AttachVpnGateway.go | 179 - .../ec2/api_op_AuthorizeClientVpnIngress.go | 230 - .../api_op_AuthorizeSecurityGroupEgress.go | 216 - .../api_op_AuthorizeSecurityGroupIngress.go | 261 - .../service/ec2/api_op_BundleInstance.go | 183 - .../service/ec2/api_op_CancelBundleTask.go | 168 - .../ec2/api_op_CancelCapacityReservation.go | 187 - .../api_op_CancelCapacityReservationFleets.go | 179 - .../ec2/api_op_CancelConversionTask.go | 168 - .../api_op_CancelDeclarativePoliciesReport.go | 172 - .../service/ec2/api_op_CancelExportTask.go | 159 - .../ec2/api_op_CancelImageLaunchPermission.go | 168 - .../service/ec2/api_op_CancelImportTask.go | 169 - .../api_op_CancelReservedInstancesListing.go | 167 - .../ec2/api_op_CancelSpotFleetRequests.go | 195 - .../ec2/api_op_CancelSpotInstanceRequests.go | 171 - .../ec2/api_op_ConfirmProductInstance.go | 177 - .../service/ec2/api_op_CopyFpgaImage.go | 182 - .../service/ec2/api_op_CopyImage.go | 329 - .../service/ec2/api_op_CopySnapshot.go | 384 - .../ec2/api_op_CreateCapacityReservation.go | 346 - ...op_CreateCapacityReservationBySplitting.go | 227 - .../api_op_CreateCapacityReservationFleet.go | 299 - .../ec2/api_op_CreateCarrierGateway.go | 214 - .../ec2/api_op_CreateClientVpnEndpoint.go | 328 - .../ec2/api_op_CreateClientVpnRoute.go | 236 - .../service/ec2/api_op_CreateCoipCidr.go | 171 - .../service/ec2/api_op_CreateCoipPool.go | 169 - .../ec2/api_op_CreateCustomerGateway.go | 222 - .../service/ec2/api_op_CreateDefaultSubnet.go | 175 - .../service/ec2/api_op_CreateDefaultVpc.go | 166 - ...op_CreateDelegateMacVolumeOwnershipTask.go | 239 - .../service/ec2/api_op_CreateDhcpOptions.go | 213 - .../api_op_CreateEgressOnlyInternetGateway.go | 182 - .../service/ec2/api_op_CreateFleet.go | 305 - .../service/ec2/api_op_CreateFlowLogs.go | 285 - .../service/ec2/api_op_CreateFpgaImage.go | 197 - .../service/ec2/api_op_CreateImage.go | 261 - .../api_op_CreateInstanceConnectEndpoint.go | 252 - .../ec2/api_op_CreateInstanceEventWindow.go | 216 - .../ec2/api_op_CreateInstanceExportTask.go | 183 - .../ec2/api_op_CreateInternetGateway.go | 166 - .../service/ec2/api_op_CreateIpam.go | 253 - ...teIpamExternalResourceVerificationToken.go | 215 - .../service/ec2/api_op_CreateIpamPool.go | 310 - .../ec2/api_op_CreateIpamResourceDiscovery.go | 211 - .../service/ec2/api_op_CreateIpamScope.go | 226 - .../service/ec2/api_op_CreateKeyPair.go | 214 - .../ec2/api_op_CreateLaunchTemplate.go | 250 - .../ec2/api_op_CreateLaunchTemplateVersion.go | 269 - .../ec2/api_op_CreateLocalGatewayRoute.go | 186 - .../api_op_CreateLocalGatewayRouteTable.go | 172 - ...teTableVirtualInterfaceGroupAssociation.go | 176 - ...ateLocalGatewayRouteTableVpcAssociation.go | 174 - ...i_op_CreateLocalGatewayVirtualInterface.go | 200 - ...CreateLocalGatewayVirtualInterfaceGroup.go | 176 - ...stemIntegrityProtectionModificationTask.go | 282 - .../ec2/api_op_CreateManagedPrefixList.go | 232 - .../service/ec2/api_op_CreateNatGateway.go | 277 - .../service/ec2/api_op_CreateNetworkAcl.go | 220 - .../ec2/api_op_CreateNetworkAclEntry.go | 227 - ...api_op_CreateNetworkInsightsAccessScope.go | 224 - .../ec2/api_op_CreateNetworkInsightsPath.go | 248 - .../ec2/api_op_CreateNetworkInterface.go | 330 - ...api_op_CreateNetworkInterfacePermission.go | 183 - .../ec2/api_op_CreatePlacementGroup.go | 192 - .../ec2/api_op_CreatePublicIpv4Pool.go | 177 - .../ec2/api_op_CreateReplaceRootVolumeTask.go | 268 - .../api_op_CreateReservedInstancesListing.go | 207 - .../ec2/api_op_CreateRestoreImageTask.go | 195 - .../service/ec2/api_op_CreateRoute.go | 237 - .../service/ec2/api_op_CreateRouteServer.go | 256 - .../ec2/api_op_CreateRouteServerEndpoint.go | 222 - .../ec2/api_op_CreateRouteServerPeer.go | 195 - .../service/ec2/api_op_CreateRouteTable.go | 220 - .../service/ec2/api_op_CreateSecurityGroup.go | 212 - .../service/ec2/api_op_CreateSnapshot.go | 342 - .../service/ec2/api_op_CreateSnapshots.go | 219 - .../api_op_CreateSpotDatafeedSubscription.go | 178 - .../ec2/api_op_CreateStoreImageTask.go | 185 - .../service/ec2/api_op_CreateSubnet.go | 244 - .../ec2/api_op_CreateSubnetCidrReservation.go | 192 - .../service/ec2/api_op_CreateTags.go | 184 - .../ec2/api_op_CreateTrafficMirrorFilter.go | 221 - .../api_op_CreateTrafficMirrorFilterRule.go | 265 - .../ec2/api_op_CreateTrafficMirrorSession.go | 273 - .../ec2/api_op_CreateTrafficMirrorTarget.go | 234 - .../ec2/api_op_CreateTransitGateway.go | 185 - .../ec2/api_op_CreateTransitGatewayConnect.go | 180 - .../api_op_CreateTransitGatewayConnectPeer.go | 201 - ..._op_CreateTransitGatewayMulticastDomain.go | 177 - ...p_CreateTransitGatewayPeeringAttachment.go | 192 - .../api_op_CreateTransitGatewayPolicyTable.go | 170 - ...CreateTransitGatewayPrefixListReference.go | 178 - .../ec2/api_op_CreateTransitGatewayRoute.go | 178 - .../api_op_CreateTransitGatewayRouteTable.go | 169 - ...ateTransitGatewayRouteTableAnnouncement.go | 174 - ...pi_op_CreateTransitGatewayVpcAttachment.go | 192 - .../api_op_CreateVerifiedAccessEndpoint.go | 261 - .../ec2/api_op_CreateVerifiedAccessGroup.go | 225 - .../api_op_CreateVerifiedAccessInstance.go | 215 - ...pi_op_CreateVerifiedAccessTrustProvider.go | 244 - .../service/ec2/api_op_CreateVolume.go | 451 - .../service/ec2/api_op_CreateVpc.go | 247 - ..._op_CreateVpcBlockPublicAccessExclusion.go | 192 - .../service/ec2/api_op_CreateVpcEndpoint.go | 243 - ...CreateVpcEndpointConnectionNotification.go | 195 - ...p_CreateVpcEndpointServiceConfiguration.go | 209 - .../ec2/api_op_CreateVpcPeeringConnection.go | 200 - .../service/ec2/api_op_CreateVpnConnection.go | 212 - .../ec2/api_op_CreateVpnConnectionRoute.go | 169 - .../service/ec2/api_op_CreateVpnGateway.go | 188 - .../ec2/api_op_DeleteCarrierGateway.go | 172 - .../ec2/api_op_DeleteClientVpnEndpoint.go | 167 - .../ec2/api_op_DeleteClientVpnRoute.go | 178 - .../service/ec2/api_op_DeleteCoipCidr.go | 171 - .../service/ec2/api_op_DeleteCoipPool.go | 166 - .../ec2/api_op_DeleteCustomerGateway.go | 163 - .../service/ec2/api_op_DeleteDhcpOptions.go | 164 - .../api_op_DeleteEgressOnlyInternetGateway.go | 165 - .../service/ec2/api_op_DeleteFleets.go | 216 - .../service/ec2/api_op_DeleteFlowLogs.go | 168 - .../service/ec2/api_op_DeleteFpgaImage.go | 165 - .../api_op_DeleteInstanceConnectEndpoint.go | 166 - .../ec2/api_op_DeleteInstanceEventWindow.go | 174 - .../ec2/api_op_DeleteInternetGateway.go | 162 - .../service/ec2/api_op_DeleteIpam.go | 192 - ...teIpamExternalResourceVerificationToken.go | 170 - .../service/ec2/api_op_DeleteIpamPool.go | 184 - .../ec2/api_op_DeleteIpamResourceDiscovery.go | 168 - .../service/ec2/api_op_DeleteIpamScope.go | 170 - .../service/ec2/api_op_DeleteKeyPair.go | 166 - .../ec2/api_op_DeleteLaunchTemplate.go | 171 - .../api_op_DeleteLaunchTemplateVersions.go | 195 - .../ec2/api_op_DeleteLocalGatewayRoute.go | 173 - .../api_op_DeleteLocalGatewayRouteTable.go | 166 - ...teTableVirtualInterfaceGroupAssociation.go | 166 - ...eteLocalGatewayRouteTableVpcAssociation.go | 166 - ...i_op_DeleteLocalGatewayVirtualInterface.go | 166 - ...DeleteLocalGatewayVirtualInterfaceGroup.go | 166 - .../ec2/api_op_DeleteManagedPrefixList.go | 167 - .../service/ec2/api_op_DeleteNatGateway.go | 168 - .../service/ec2/api_op_DeleteNetworkAcl.go | 162 - .../ec2/api_op_DeleteNetworkAclEntry.go | 172 - ...api_op_DeleteNetworkInsightsAccessScope.go | 165 - ...eleteNetworkInsightsAccessScopeAnalysis.go | 165 - .../api_op_DeleteNetworkInsightsAnalysis.go | 165 - .../ec2/api_op_DeleteNetworkInsightsPath.go | 165 - .../ec2/api_op_DeleteNetworkInterface.go | 163 - ...api_op_DeleteNetworkInterfacePermission.go | 174 - .../ec2/api_op_DeletePlacementGroup.go | 165 - .../ec2/api_op_DeletePublicIpv4Pool.go | 176 - .../api_op_DeleteQueuedReservedInstances.go | 169 - .../service/ec2/api_op_DeleteRoute.go | 172 - .../service/ec2/api_op_DeleteRouteServer.go | 190 - .../ec2/api_op_DeleteRouteServerEndpoint.go | 172 - .../ec2/api_op_DeleteRouteServerPeer.go | 177 - .../service/ec2/api_op_DeleteRouteTable.go | 162 - .../service/ec2/api_op_DeleteSecurityGroup.go | 172 - .../service/ec2/api_op_DeleteSnapshot.go | 176 - .../api_op_DeleteSpotDatafeedSubscription.go | 154 - .../service/ec2/api_op_DeleteSubnet.go | 162 - .../ec2/api_op_DeleteSubnetCidrReservation.go | 166 - .../service/ec2/api_op_DeleteTags.go | 182 - .../ec2/api_op_DeleteTrafficMirrorFilter.go | 168 - .../api_op_DeleteTrafficMirrorFilterRule.go | 165 - .../ec2/api_op_DeleteTrafficMirrorSession.go | 165 - .../ec2/api_op_DeleteTrafficMirrorTarget.go | 168 - .../ec2/api_op_DeleteTransitGateway.go | 166 - .../ec2/api_op_DeleteTransitGatewayConnect.go | 167 - .../api_op_DeleteTransitGatewayConnectPeer.go | 166 - ..._op_DeleteTransitGatewayMulticastDomain.go | 166 - ...p_DeleteTransitGatewayPeeringAttachment.go | 166 - .../api_op_DeleteTransitGatewayPolicyTable.go | 166 - ...DeleteTransitGatewayPrefixListReference.go | 172 - .../ec2/api_op_DeleteTransitGatewayRoute.go | 171 - .../api_op_DeleteTransitGatewayRouteTable.go | 169 - ...eteTransitGatewayRouteTableAnnouncement.go | 166 - ...pi_op_DeleteTransitGatewayVpcAttachment.go | 166 - .../api_op_DeleteVerifiedAccessEndpoint.go | 208 - .../ec2/api_op_DeleteVerifiedAccessGroup.go | 208 - .../api_op_DeleteVerifiedAccessInstance.go | 208 - ...pi_op_DeleteVerifiedAccessTrustProvider.go | 208 - .../service/ec2/api_op_DeleteVolume.go | 168 - .../service/ec2/api_op_DeleteVpc.go | 170 - ..._op_DeleteVpcBlockPublicAccessExclusion.go | 173 - ...eleteVpcEndpointConnectionNotifications.go | 166 - ..._DeleteVpcEndpointServiceConfigurations.go | 170 - .../service/ec2/api_op_DeleteVpcEndpoints.go | 176 - .../ec2/api_op_DeleteVpcPeeringConnection.go | 169 - .../service/ec2/api_op_DeleteVpnConnection.go | 175 - .../ec2/api_op_DeleteVpnConnectionRoute.go | 164 - .../service/ec2/api_op_DeleteVpnGateway.go | 165 - .../ec2/api_op_DeprovisionByoipCidr.go | 172 - .../ec2/api_op_DeprovisionIpamByoasn.go | 177 - .../ec2/api_op_DeprovisionIpamPoolCidr.go | 173 - .../api_op_DeprovisionPublicIpv4PoolCidr.go | 173 - .../service/ec2/api_op_DeregisterImage.go | 208 - ...sterInstanceEventNotificationAttributes.go | 167 - ...sterTransitGatewayMulticastGroupMembers.go | 168 - ...sterTransitGatewayMulticastGroupSources.go | 168 - .../ec2/api_op_DescribeAccountAttributes.go | 185 - .../ec2/api_op_DescribeAddressTransfers.go | 279 - .../service/ec2/api_op_DescribeAddresses.go | 197 - .../ec2/api_op_DescribeAddressesAttribute.go | 275 - .../ec2/api_op_DescribeAggregateIdFormat.go | 177 - .../ec2/api_op_DescribeAvailabilityZones.go | 220 - ...wsNetworkPerformanceMetricSubscriptions.go | 270 - .../service/ec2/api_op_DescribeBundleTasks.go | 415 - .../service/ec2/api_op_DescribeByoipCidrs.go | 272 - ...p_DescribeCapacityBlockExtensionHistory.go | 294 - ...DescribeCapacityBlockExtensionOfferings.go | 286 - .../api_op_DescribeCapacityBlockOfferings.go | 307 - .../ec2/api_op_DescribeCapacityBlockStatus.go | 282 - .../ec2/api_op_DescribeCapacityBlocks.go | 296 - ...cribeCapacityReservationBillingRequests.go | 307 - ...pi_op_DescribeCapacityReservationFleets.go | 289 - .../api_op_DescribeCapacityReservations.go | 355 - .../ec2/api_op_DescribeCarrierGateways.go | 289 - .../api_op_DescribeClassicLinkInstances.go | 302 - ..._op_DescribeClientVpnAuthorizationRules.go | 287 - .../api_op_DescribeClientVpnConnections.go | 285 - .../ec2/api_op_DescribeClientVpnEndpoints.go | 278 - .../ec2/api_op_DescribeClientVpnRoutes.go | 285 - .../api_op_DescribeClientVpnTargetNetworks.go | 288 - .../service/ec2/api_op_DescribeCoipPools.go | 275 - .../ec2/api_op_DescribeConversionTasks.go | 784 - .../ec2/api_op_DescribeCustomerGateways.go | 442 - ...i_op_DescribeDeclarativePoliciesReports.go | 188 - .../service/ec2/api_op_DescribeDhcpOptions.go | 301 - ...i_op_DescribeEgressOnlyInternetGateways.go | 290 - .../service/ec2/api_op_DescribeElasticGpus.go | 198 - .../ec2/api_op_DescribeExportImageTasks.go | 270 - .../service/ec2/api_op_DescribeExportTasks.go | 546 - .../ec2/api_op_DescribeFastLaunchImages.go | 285 - .../api_op_DescribeFastSnapshotRestores.go | 286 - .../ec2/api_op_DescribeFleetHistory.go | 212 - .../ec2/api_op_DescribeFleetInstances.go | 197 - .../service/ec2/api_op_DescribeFleets.go | 301 - .../service/ec2/api_op_DescribeFlowLogs.go | 303 - .../ec2/api_op_DescribeFpgaImageAttribute.go | 171 - .../service/ec2/api_op_DescribeFpgaImages.go | 302 - ...api_op_DescribeHostReservationOfferings.go | 298 - .../ec2/api_op_DescribeHostReservations.go | 285 - .../service/ec2/api_op_DescribeHosts.go | 294 - ..._DescribeIamInstanceProfileAssociations.go | 278 - .../service/ec2/api_op_DescribeIdFormat.go | 181 - .../ec2/api_op_DescribeIdentityIdFormat.go | 189 - .../ec2/api_op_DescribeImageAttribute.go | 240 - .../service/ec2/api_op_DescribeImages.go | 848 - .../ec2/api_op_DescribeImportImageTasks.go | 272 - .../ec2/api_op_DescribeImportSnapshotTasks.go | 497 - .../ec2/api_op_DescribeInstanceAttribute.go | 228 - ...api_op_DescribeInstanceConnectEndpoints.go | 303 - ...op_DescribeInstanceCreditSpecifications.go | 315 - ...ribeInstanceEventNotificationAttributes.go | 159 - .../api_op_DescribeInstanceEventWindows.go | 317 - .../api_op_DescribeInstanceImageMetadata.go | 348 - .../ec2/api_op_DescribeInstanceStatus.go | 772 - .../ec2/api_op_DescribeInstanceTopology.go | 327 - .../api_op_DescribeInstanceTypeOfferings.go | 300 - .../ec2/api_op_DescribeInstanceTypes.go | 432 - .../service/ec2/api_op_DescribeInstances.go | 1772 - .../ec2/api_op_DescribeInternetGateways.go | 507 - .../service/ec2/api_op_DescribeIpamByoasn.go | 173 - ...eIpamExternalResourceVerificationTokens.go | 200 - .../service/ec2/api_op_DescribeIpamPools.go | 269 - .../api_op_DescribeIpamResourceDiscoveries.go | 273 - ...scribeIpamResourceDiscoveryAssociations.go | 275 - .../service/ec2/api_op_DescribeIpamScopes.go | 270 - .../service/ec2/api_op_DescribeIpams.go | 272 - .../service/ec2/api_op_DescribeIpv6Pools.go | 277 - .../service/ec2/api_op_DescribeKeyPairs.go | 405 - .../api_op_DescribeLaunchTemplateVersions.go | 359 - .../ec2/api_op_DescribeLaunchTemplates.go | 288 - ...eTableVirtualInterfaceGroupAssociations.go | 295 - ...beLocalGatewayRouteTableVpcAssociations.go | 289 - .../api_op_DescribeLocalGatewayRouteTables.go | 287 - ...cribeLocalGatewayVirtualInterfaceGroups.go | 282 - ...p_DescribeLocalGatewayVirtualInterfaces.go | 290 - .../ec2/api_op_DescribeLocalGateways.go | 280 - .../ec2/api_op_DescribeLockedSnapshots.go | 182 - .../service/ec2/api_op_DescribeMacHosts.go | 272 - .../api_op_DescribeMacModificationTasks.go | 293 - .../ec2/api_op_DescribeManagedPrefixLists.go | 281 - .../ec2/api_op_DescribeMovingAddresses.go | 286 - .../service/ec2/api_op_DescribeNatGateways.go | 762 - .../service/ec2/api_op_DescribeNetworkAcls.go | 330 - ...cribeNetworkInsightsAccessScopeAnalyses.go | 284 - ..._op_DescribeNetworkInsightsAccessScopes.go | 272 - .../api_op_DescribeNetworkInsightsAnalyses.go | 288 - .../api_op_DescribeNetworkInsightsPaths.go | 300 - ...pi_op_DescribeNetworkInterfaceAttribute.go | 189 - ..._op_DescribeNetworkInterfacePermissions.go | 291 - .../ec2/api_op_DescribeNetworkInterfaces.go | 604 - .../service/ec2/api_op_DescribeOutpostLags.go | 204 - .../ec2/api_op_DescribePlacementGroups.go | 203 - .../service/ec2/api_op_DescribePrefixLists.go | 278 - .../ec2/api_op_DescribePrincipalIdFormat.go | 290 - .../ec2/api_op_DescribePublicIpv4Pools.go | 273 - .../service/ec2/api_op_DescribeRegions.go | 189 - .../api_op_DescribeReplaceRootVolumeTasks.go | 285 - .../ec2/api_op_DescribeReservedInstances.go | 230 - ...pi_op_DescribeReservedInstancesListings.go | 197 - ..._DescribeReservedInstancesModifications.go | 295 - ...i_op_DescribeReservedInstancesOfferings.go | 384 - .../api_op_DescribeRouteServerEndpoints.go | 279 - .../ec2/api_op_DescribeRouteServerPeers.go | 284 - .../ec2/api_op_DescribeRouteServers.go | 292 - .../service/ec2/api_op_DescribeRouteTables.go | 352 - ...p_DescribeScheduledInstanceAvailability.go | 310 - .../ec2/api_op_DescribeScheduledInstances.go | 285 - .../api_op_DescribeSecurityGroupReferences.go | 168 - .../ec2/api_op_DescribeSecurityGroupRules.go | 290 - ...op_DescribeSecurityGroupVpcAssociations.go | 781 - .../ec2/api_op_DescribeSecurityGroups.go | 569 - ...op_DescribeServiceLinkVirtualInterfaces.go | 193 - .../ec2/api_op_DescribeSnapshotAttribute.go | 183 - .../ec2/api_op_DescribeSnapshotTierStatus.go | 286 - .../service/ec2/api_op_DescribeSnapshots.go | 584 - ...api_op_DescribeSpotDatafeedSubscription.go | 163 - .../ec2/api_op_DescribeSpotFleetInstances.go | 187 - .../api_op_DescribeSpotFleetRequestHistory.go | 215 - .../ec2/api_op_DescribeSpotFleetRequests.go | 280 - .../api_op_DescribeSpotInstanceRequests.go | 756 - .../ec2/api_op_DescribeSpotPriceHistory.go | 319 - .../ec2/api_op_DescribeStaleSecurityGroups.go | 289 - .../ec2/api_op_DescribeStoreImageTasks.go | 548 - .../service/ec2/api_op_DescribeSubnets.go | 553 - .../service/ec2/api_op_DescribeTags.go | 298 - ...api_op_DescribeTrafficMirrorFilterRules.go | 202 - .../api_op_DescribeTrafficMirrorFilters.go | 276 - .../api_op_DescribeTrafficMirrorSessions.go | 293 - .../api_op_DescribeTrafficMirrorTargets.go | 284 - ...pi_op_DescribeTransitGatewayAttachments.go | 299 - ...i_op_DescribeTransitGatewayConnectPeers.go | 279 - .../api_op_DescribeTransitGatewayConnects.go | 285 - ..._DescribeTransitGatewayMulticastDomains.go | 280 - ...escribeTransitGatewayPeeringAttachments.go | 293 - ...i_op_DescribeTransitGatewayPolicyTables.go | 271 - ...beTransitGatewayRouteTableAnnouncements.go | 271 - ...pi_op_DescribeTransitGatewayRouteTables.go | 286 - ...op_DescribeTransitGatewayVpcAttachments.go | 283 - .../ec2/api_op_DescribeTransitGateways.go | 312 - ...i_op_DescribeTrunkInterfaceAssociations.go | 276 - .../api_op_DescribeVerifiedAccessEndpoints.go | 278 - .../api_op_DescribeVerifiedAccessGroups.go | 275 - ...fiedAccessInstanceLoggingConfigurations.go | 273 - .../api_op_DescribeVerifiedAccessInstances.go | 272 - ...op_DescribeVerifiedAccessTrustProviders.go | 272 - .../ec2/api_op_DescribeVolumeAttribute.go | 182 - .../ec2/api_op_DescribeVolumeStatus.go | 348 - .../service/ec2/api_op_DescribeVolumes.go | 957 - .../api_op_DescribeVolumesModifications.go | 309 - .../ec2/api_op_DescribeVpcAttribute.go | 185 - ..._DescribeVpcBlockPublicAccessExclusions.go | 207 - ..._op_DescribeVpcBlockPublicAccessOptions.go | 164 - .../ec2/api_op_DescribeVpcClassicLink.go | 177 - ...api_op_DescribeVpcClassicLinkDnsSupport.go | 276 - .../api_op_DescribeVpcEndpointAssociations.go | 192 - ...cribeVpcEndpointConnectionNotifications.go | 286 - .../api_op_DescribeVpcEndpointConnections.go | 289 - ...escribeVpcEndpointServiceConfigurations.go | 294 - ...p_DescribeVpcEndpointServicePermissions.go | 287 - .../ec2/api_op_DescribeVpcEndpointServices.go | 211 - .../ec2/api_op_DescribeVpcEndpoints.go | 301 - .../api_op_DescribeVpcPeeringConnections.go | 714 - .../service/ec2/api_op_DescribeVpcs.go | 690 - .../ec2/api_op_DescribeVpnConnections.go | 660 - .../service/ec2/api_op_DescribeVpnGateways.go | 200 - .../ec2/api_op_DetachClassicLinkVpc.go | 174 - .../ec2/api_op_DetachInternetGateway.go | 168 - .../ec2/api_op_DetachNetworkInterface.go | 179 - ...pi_op_DetachVerifiedAccessTrustProvider.go | 217 - .../service/ec2/api_op_DetachVolume.go | 233 - .../service/ec2/api_op_DetachVpnGateway.go | 174 - .../ec2/api_op_DisableAddressTransfer.go | 169 - .../api_op_DisableAllowedImagesSettings.go | 170 - ...AwsNetworkPerformanceMetricSubscription.go | 172 - .../api_op_DisableEbsEncryptionByDefault.go | 167 - .../service/ec2/api_op_DisableFastLaunch.go | 206 - .../ec2/api_op_DisableFastSnapshotRestores.go | 177 - .../service/ec2/api_op_DisableImage.go | 182 - .../api_op_DisableImageBlockPublicAccess.go | 170 - .../ec2/api_op_DisableImageDeprecation.go | 169 - ...op_DisableImageDeregistrationProtection.go | 174 - ..._op_DisableIpamOrganizationAdminAccount.go | 168 - .../api_op_DisableRouteServerPropagation.go | 199 - .../ec2/api_op_DisableSerialConsoleAccess.go | 163 - ...api_op_DisableSnapshotBlockPublicAccess.go | 173 - ...ableTransitGatewayRouteTablePropagation.go | 173 - .../ec2/api_op_DisableVgwRoutePropagation.go | 168 - .../ec2/api_op_DisableVpcClassicLink.go | 168 - .../api_op_DisableVpcClassicLinkDnsSupport.go | 160 - .../service/ec2/api_op_DisassociateAddress.go | 172 - ...ssociateCapacityReservationBillingOwner.go | 174 - ...i_op_DisassociateClientVpnTargetNetwork.go | 183 - ...p_DisassociateEnclaveCertificateIamRole.go | 175 - .../api_op_DisassociateIamInstanceProfile.go | 162 - .../api_op_DisassociateInstanceEventWindow.go | 175 - .../ec2/api_op_DisassociateIpamByoasn.go | 176 - ...pi_op_DisassociateIpamResourceDiscovery.go | 168 - .../api_op_DisassociateNatGatewayAddress.go | 192 - .../ec2/api_op_DisassociateRouteServer.go | 178 - .../ec2/api_op_DisassociateRouteTable.go | 168 - .../api_op_DisassociateSecurityGroupVpc.go | 178 - .../ec2/api_op_DisassociateSubnetCidrBlock.go | 165 - ...sassociateTransitGatewayMulticastDomain.go | 176 - ...p_DisassociateTransitGatewayPolicyTable.go | 171 - ...op_DisassociateTransitGatewayRouteTable.go | 171 - .../ec2/api_op_DisassociateTrunkInterface.go | 214 - .../ec2/api_op_DisassociateVpcCidrBlock.go | 172 - .../ec2/api_op_EnableAddressTransfer.go | 174 - .../ec2/api_op_EnableAllowedImagesSettings.go | 194 - ...AwsNetworkPerformanceMetricSubscription.go | 174 - .../api_op_EnableEbsEncryptionByDefault.go | 173 - .../service/ec2/api_op_EnableFastLaunch.go | 224 - .../ec2/api_op_EnableFastSnapshotRestores.go | 187 - .../service/ec2/api_op_EnableImage.go | 175 - .../api_op_EnableImageBlockPublicAccess.go | 180 - .../ec2/api_op_EnableImageDeprecation.go | 181 - ..._op_EnableImageDeregistrationProtection.go | 177 - ...i_op_EnableIpamOrganizationAdminAccount.go | 169 - ...ReachabilityAnalyzerOrganizationSharing.go | 163 - .../api_op_EnableRouteServerPropagation.go | 179 - .../ec2/api_op_EnableSerialConsoleAccess.go | 163 - .../api_op_EnableSnapshotBlockPublicAccess.go | 198 - ...ableTransitGatewayRouteTablePropagation.go | 173 - .../ec2/api_op_EnableVgwRoutePropagation.go | 171 - .../service/ec2/api_op_EnableVolumeIO.go | 162 - .../ec2/api_op_EnableVpcClassicLink.go | 172 - .../api_op_EnableVpcClassicLinkDnsSupport.go | 162 - ...lientVpnClientCertificateRevocationList.go | 170 - ...i_op_ExportClientVpnClientConfiguration.go | 168 - .../service/ec2/api_op_ExportImage.go | 259 - .../ec2/api_op_ExportTransitGatewayRoutes.go | 206 - ...rifiedAccessInstanceClientConfiguration.go | 181 - .../ec2/api_op_GetActiveVpnTunnelStatus.go | 172 - .../ec2/api_op_GetAllowedImagesSettings.go | 191 - ...GetAssociatedEnclaveCertificateIamRoles.go | 171 - .../ec2/api_op_GetAssociatedIpv6PoolCidrs.go | 275 - .../api_op_GetAwsNetworkPerformanceData.go | 278 - .../ec2/api_op_GetCapacityReservationUsage.go | 240 - .../service/ec2/api_op_GetCoipPoolUsage.go | 196 - .../service/ec2/api_op_GetConsoleOutput.go | 185 - .../ec2/api_op_GetConsoleScreenshot.go | 179 - ..._op_GetDeclarativePoliciesReportSummary.go | 210 - .../api_op_GetDefaultCreditSpecification.go | 171 - .../ec2/api_op_GetEbsDefaultKmsKeyId.go | 163 - .../ec2/api_op_GetEbsEncryptionByDefault.go | 166 - .../api_op_GetFlowLogsIntegrationTemplate.go | 193 - .../api_op_GetGroupsForCapacityReservation.go | 283 - ...pi_op_GetHostReservationPurchasePreview.go | 181 - .../api_op_GetImageBlockPublicAccessState.go | 180 - .../ec2/api_op_GetInstanceMetadataDefaults.go | 163 - .../service/ec2/api_op_GetInstanceTpmEkPub.go | 187 - ...etInstanceTypesFromInstanceRequirements.go | 308 - .../service/ec2/api_op_GetInstanceUefiData.go | 182 - .../ec2/api_op_GetIpamAddressHistory.go | 296 - .../ec2/api_op_GetIpamDiscoveredAccounts.go | 284 - ...api_op_GetIpamDiscoveredPublicAddresses.go | 189 - .../api_op_GetIpamDiscoveredResourceCidrs.go | 286 - .../ec2/api_op_GetIpamPoolAllocations.go | 287 - .../service/ec2/api_op_GetIpamPoolCidrs.go | 274 - .../ec2/api_op_GetIpamResourceCidrs.go | 294 - .../ec2/api_op_GetLaunchTemplateData.go | 174 - ...api_op_GetManagedPrefixListAssociations.go | 275 - .../ec2/api_op_GetManagedPrefixListEntries.go | 278 - ...workInsightsAccessScopeAnalysisFindings.go | 280 - ...op_GetNetworkInsightsAccessScopeContent.go | 166 - .../service/ec2/api_op_GetPasswordData.go | 389 - ...pi_op_GetReservedInstancesExchangeQuote.go | 200 - .../ec2/api_op_GetRouteServerAssociations.go | 173 - .../ec2/api_op_GetRouteServerPropagations.go | 194 - .../api_op_GetRouteServerRoutingDatabase.go | 209 - .../ec2/api_op_GetSecurityGroupsForVpc.go | 295 - .../api_op_GetSerialConsoleAccessStatus.go | 172 - ...pi_op_GetSnapshotBlockPublicAccessState.go | 183 - .../ec2/api_op_GetSpotPlacementScores.go | 336 - .../ec2/api_op_GetSubnetCidrReservations.go | 195 - ...GetTransitGatewayAttachmentPropagations.go | 280 - ...ansitGatewayMulticastDomainAssociations.go | 289 - ...etTransitGatewayPolicyTableAssociations.go | 276 - ..._op_GetTransitGatewayPolicyTableEntries.go | 176 - ...p_GetTransitGatewayPrefixListReferences.go | 295 - ...GetTransitGatewayRouteTableAssociations.go | 285 - ...GetTransitGatewayRouteTablePropagations.go | 285 - .../api_op_GetVerifiedAccessEndpointPolicy.go | 168 - ...api_op_GetVerifiedAccessEndpointTargets.go | 177 - .../api_op_GetVerifiedAccessGroupPolicy.go | 168 - ...tVpnConnectionDeviceSampleConfiguration.go | 181 - .../ec2/api_op_GetVpnConnectionDeviceTypes.go | 288 - .../api_op_GetVpnTunnelReplacementStatus.go | 186 - ...lientVpnClientCertificateRevocationList.go | 179 - .../service/ec2/api_op_ImportImage.go | 325 - .../service/ec2/api_op_ImportInstance.go | 189 - .../service/ec2/api_op_ImportKeyPair.go | 196 - .../service/ec2/api_op_ImportSnapshot.go | 228 - .../service/ec2/api_op_ImportVolume.go | 188 - .../ec2/api_op_ListImagesInRecycleBin.go | 278 - .../ec2/api_op_ListSnapshotsInRecycleBin.go | 276 - .../service/ec2/api_op_LockSnapshot.go | 284 - .../ec2/api_op_ModifyAddressAttribute.go | 172 - .../ec2/api_op_ModifyAvailabilityZoneGroup.go | 174 - .../ec2/api_op_ModifyCapacityReservation.go | 234 - .../api_op_ModifyCapacityReservationFleet.go | 200 - .../ec2/api_op_ModifyClientVpnEndpoint.go | 248 - ...api_op_ModifyDefaultCreditSpecification.go | 188 - .../ec2/api_op_ModifyEbsDefaultKmsKeyId.go | 200 - .../service/ec2/api_op_ModifyFleet.go | 211 - .../ec2/api_op_ModifyFpgaImageAttribute.go | 193 - .../service/ec2/api_op_ModifyHosts.go | 206 - .../service/ec2/api_op_ModifyIdFormat.go | 194 - .../ec2/api_op_ModifyIdentityIdFormat.go | 200 - .../ec2/api_op_ModifyImageAttribute.go | 224 - .../ec2/api_op_ModifyInstanceAttribute.go | 281 - ...fyInstanceCapacityReservationAttributes.go | 174 - .../ec2/api_op_ModifyInstanceCpuOptions.go | 195 - ...pi_op_ModifyInstanceCreditSpecification.go | 182 - .../api_op_ModifyInstanceEventStartTime.go | 177 - .../ec2/api_op_ModifyInstanceEventWindow.go | 208 - ...api_op_ModifyInstanceMaintenanceOptions.go | 214 - .../api_op_ModifyInstanceMetadataDefaults.go | 192 - .../api_op_ModifyInstanceMetadataOptions.go | 230 - ...ModifyInstanceNetworkPerformanceOptions.go | 186 - .../ec2/api_op_ModifyInstancePlacement.go | 219 - .../service/ec2/api_op_ModifyIpam.go | 209 - .../service/ec2/api_op_ModifyIpamPool.go | 215 - .../ec2/api_op_ModifyIpamResourceCidr.go | 200 - .../ec2/api_op_ModifyIpamResourceDiscovery.go | 209 - .../service/ec2/api_op_ModifyIpamScope.go | 169 - .../ec2/api_op_ModifyLaunchTemplate.go | 222 - .../ec2/api_op_ModifyLocalGatewayRoute.go | 181 - .../ec2/api_op_ModifyManagedPrefixList.go | 192 - .../api_op_ModifyNetworkInterfaceAttribute.go | 216 - .../ec2/api_op_ModifyPrivateDnsNameOptions.go | 180 - .../api_op_ModifyPublicIpDnsNameOptions.go | 192 - .../ec2/api_op_ModifyReservedInstances.go | 180 - .../service/ec2/api_op_ModifyRouteServer.go | 221 - .../ec2/api_op_ModifySecurityGroupRules.go | 171 - .../ec2/api_op_ModifySnapshotAttribute.go | 192 - .../service/ec2/api_op_ModifySnapshotTier.go | 179 - .../ec2/api_op_ModifySpotFleetRequest.go | 213 - .../ec2/api_op_ModifySubnetAttribute.go | 241 - ...odifyTrafficMirrorFilterNetworkServices.go | 179 - .../api_op_ModifyTrafficMirrorFilterRule.go | 206 - .../ec2/api_op_ModifyTrafficMirrorSession.go | 203 - .../ec2/api_op_ModifyTransitGateway.go | 174 - ...ModifyTransitGatewayPrefixListReference.go | 178 - ...pi_op_ModifyTransitGatewayVpcAttachment.go | 176 - .../api_op_ModifyVerifiedAccessEndpoint.go | 228 - ...i_op_ModifyVerifiedAccessEndpointPolicy.go | 223 - .../ec2/api_op_ModifyVerifiedAccessGroup.go | 214 - .../api_op_ModifyVerifiedAccessGroupPolicy.go | 223 - .../api_op_ModifyVerifiedAccessInstance.go | 215 - ...ifiedAccessInstanceLoggingConfiguration.go | 214 - ...pi_op_ModifyVerifiedAccessTrustProvider.go | 225 - .../service/ec2/api_op_ModifyVolume.go | 251 - .../ec2/api_op_ModifyVolumeAttribute.go | 175 - .../service/ec2/api_op_ModifyVpcAttribute.go | 177 - ..._op_ModifyVpcBlockPublicAccessExclusion.go | 183 - ...pi_op_ModifyVpcBlockPublicAccessOptions.go | 184 - .../service/ec2/api_op_ModifyVpcEndpoint.go | 214 - ...ModifyVpcEndpointConnectionNotification.go | 174 - ...p_ModifyVpcEndpointServiceConfiguration.go | 208 - ...fyVpcEndpointServicePayerResponsibility.go | 173 - ..._op_ModifyVpcEndpointServicePermissions.go | 186 - ...pi_op_ModifyVpcPeeringConnectionOptions.go | 188 - .../service/ec2/api_op_ModifyVpcTenancy.go | 181 - .../service/ec2/api_op_ModifyVpnConnection.go | 217 - .../ec2/api_op_ModifyVpnConnectionOptions.go | 191 - .../ec2/api_op_ModifyVpnTunnelCertificate.go | 171 - .../ec2/api_op_ModifyVpnTunnelOptions.go | 192 - .../service/ec2/api_op_MonitorInstances.go | 172 - .../service/ec2/api_op_MoveAddressToVpc.go | 177 - .../service/ec2/api_op_MoveByoipCidrToIpam.go | 183 - ...api_op_MoveCapacityReservationInstances.go | 241 - .../service/ec2/api_op_ProvisionByoipCidr.go | 227 - .../service/ec2/api_op_ProvisionIpamByoasn.go | 181 - .../ec2/api_op_ProvisionIpamPoolCidr.go | 239 - .../ec2/api_op_ProvisionPublicIpv4PoolCidr.go | 192 - .../ec2/api_op_PurchaseCapacityBlock.go | 179 - .../api_op_PurchaseCapacityBlockExtension.go | 172 - .../ec2/api_op_PurchaseHostReservation.go | 205 - ...pi_op_PurchaseReservedInstancesOffering.go | 199 - .../ec2/api_op_PurchaseScheduledInstances.go | 220 - .../service/ec2/api_op_RebootInstances.go | 171 - .../service/ec2/api_op_RegisterImage.go | 345 - ...sterInstanceEventNotificationAttributes.go | 171 - ...sterTransitGatewayMulticastGroupMembers.go | 184 - ...sterTransitGatewayMulticastGroupSources.go | 186 - ...jectCapacityReservationBillingOwnership.go | 168 - ...ansitGatewayMulticastDomainAssociations.go | 168 - ...p_RejectTransitGatewayPeeringAttachment.go | 166 - ...pi_op_RejectTransitGatewayVpcAttachment.go | 169 - .../api_op_RejectVpcEndpointConnections.go | 171 - .../ec2/api_op_RejectVpcPeeringConnection.go | 168 - .../service/ec2/api_op_ReleaseAddress.go | 183 - .../service/ec2/api_op_ReleaseHosts.go | 174 - .../ec2/api_op_ReleaseIpamPoolAllocation.go | 186 - ...op_ReplaceIamInstanceProfileAssociation.go | 169 - ...aceImageCriteriaInAllowedImagesSettings.go | 171 - .../api_op_ReplaceNetworkAclAssociation.go | 177 - .../ec2/api_op_ReplaceNetworkAclEntry.go | 209 - .../service/ec2/api_op_ReplaceRoute.go | 219 - .../api_op_ReplaceRouteTableAssociation.go | 183 - .../ec2/api_op_ReplaceTransitGatewayRoute.go | 178 - .../service/ec2/api_op_ReplaceVpnTunnel.go | 173 - .../ec2/api_op_ReportInstanceStatus.go | 210 - .../service/ec2/api_op_RequestSpotFleet.go | 198 - .../ec2/api_op_RequestSpotInstances.go | 266 - .../ec2/api_op_ResetAddressAttribute.go | 173 - .../ec2/api_op_ResetEbsDefaultKmsKeyId.go | 165 - .../ec2/api_op_ResetFpgaImageAttribute.go | 170 - .../service/ec2/api_op_ResetImageAttribute.go | 169 - .../ec2/api_op_ResetInstanceAttribute.go | 178 - .../api_op_ResetNetworkInterfaceAttribute.go | 166 - .../ec2/api_op_ResetSnapshotAttribute.go | 173 - .../ec2/api_op_RestoreAddressToClassic.go | 174 - .../ec2/api_op_RestoreImageFromRecycleBin.go | 168 - .../api_op_RestoreManagedPrefixListVersion.go | 177 - .../api_op_RestoreSnapshotFromRecycleBin.go | 203 - .../service/ec2/api_op_RestoreSnapshotTier.go | 197 - .../ec2/api_op_RevokeClientVpnIngress.go | 182 - .../ec2/api_op_RevokeSecurityGroupEgress.go | 221 - .../ec2/api_op_RevokeSecurityGroupIngress.go | 232 - .../service/ec2/api_op_RunInstances.go | 566 - .../ec2/api_op_RunScheduledInstances.go | 229 - .../ec2/api_op_SearchLocalGatewayRoutes.go | 295 - ..._op_SearchTransitGatewayMulticastGroups.go | 299 - .../ec2/api_op_SearchTransitGatewayRoutes.go | 205 - .../ec2/api_op_SendDiagnosticInterrupt.go | 178 - .../api_op_StartDeclarativePoliciesReport.go | 226 - .../service/ec2/api_op_StartInstances.go | 192 - ...StartNetworkInsightsAccessScopeAnalysis.go | 213 - .../api_op_StartNetworkInsightsAnalysis.go | 223 - ...pcEndpointServicePrivateDnsVerification.go | 172 - .../service/ec2/api_op_StopInstances.go | 226 - .../api_op_TerminateClientVpnConnections.go | 182 - .../service/ec2/api_op_TerminateInstances.go | 224 - .../ec2/api_op_UnassignIpv6Addresses.go | 172 - .../ec2/api_op_UnassignPrivateIpAddresses.go | 164 - ...api_op_UnassignPrivateNatGatewayAddress.go | 192 - .../service/ec2/api_op_UnlockSnapshot.go | 167 - .../service/ec2/api_op_UnmonitorInstances.go | 169 - ...dateSecurityGroupRuleDescriptionsEgress.go | 178 - ...ateSecurityGroupRuleDescriptionsIngress.go | 179 - .../service/ec2/api_op_WithdrawByoipCidr.go | 172 - .../aws/aws-sdk-go-v2/service/ec2/auth.go | 313 - .../service/ec2/deserializers.go | 194326 --------------- .../aws/aws-sdk-go-v2/service/ec2/doc.go | 12 - .../aws-sdk-go-v2/service/ec2/endpoints.go | 556 - .../aws-sdk-go-v2/service/ec2/generated.json | 723 - .../service/ec2/go_module_metadata.go | 6 - .../ec2/internal/endpoints/endpoints.go | 700 - .../aws/aws-sdk-go-v2/service/ec2/options.go | 236 - .../aws-sdk-go-v2/service/ec2/serializers.go | 81072 ------ .../aws-sdk-go-v2/service/ec2/types/enums.go | 10741 - .../aws-sdk-go-v2/service/ec2/types/types.go | 23428 -- .../aws-sdk-go-v2/service/ec2/validators.go | 20632 -- .../internal/accept-encoding/CHANGELOG.md | 176 - .../internal/accept-encoding/LICENSE.txt | 202 - .../accept-encoding/accept_encoding_gzip.go | 176 - .../service/internal/accept-encoding/doc.go | 22 - .../accept-encoding/go_module_metadata.go | 6 - .../internal/presigned-url/CHANGELOG.md | 482 - .../internal/presigned-url/LICENSE.txt | 202 - .../service/internal/presigned-url/context.go | 56 - .../service/internal/presigned-url/doc.go | 3 - .../presigned-url/go_module_metadata.go | 6 - .../internal/presigned-url/middleware.go | 110 - .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 675 - .../aws/aws-sdk-go-v2/service/sso/LICENSE.txt | 202 - .../aws-sdk-go-v2/service/sso/api_client.go | 1019 - .../service/sso/api_op_GetRoleCredentials.go | 201 - .../service/sso/api_op_ListAccountRoles.go | 299 - .../service/sso/api_op_ListAccounts.go | 297 - .../service/sso/api_op_Logout.go | 200 - .../aws/aws-sdk-go-v2/service/sso/auth.go | 363 - .../service/sso/deserializers.go | 1172 - .../aws/aws-sdk-go-v2/service/sso/doc.go | 27 - .../aws-sdk-go-v2/service/sso/endpoints.go | 558 - .../aws-sdk-go-v2/service/sso/generated.json | 36 - .../service/sso/go_module_metadata.go | 6 - .../sso/internal/endpoints/endpoints.go | 603 - .../aws/aws-sdk-go-v2/service/sso/options.go | 239 - .../aws-sdk-go-v2/service/sso/serializers.go | 309 - .../aws-sdk-go-v2/service/sso/types/errors.go | 115 - .../aws-sdk-go-v2/service/sso/types/types.go | 63 - .../aws-sdk-go-v2/service/sso/validators.go | 175 - .../service/ssooidc/CHANGELOG.md | 671 - .../aws-sdk-go-v2/service/ssooidc/LICENSE.txt | 202 - .../service/ssooidc/api_client.go | 1019 - .../service/ssooidc/api_op_CreateToken.go | 271 - .../ssooidc/api_op_CreateTokenWithIAM.go | 318 - .../service/ssooidc/api_op_RegisterClient.go | 242 - .../api_op_StartDeviceAuthorization.go | 224 - .../aws/aws-sdk-go-v2/service/ssooidc/auth.go | 357 - .../service/ssooidc/deserializers.go | 2244 - .../aws/aws-sdk-go-v2/service/ssooidc/doc.go | 49 - .../service/ssooidc/endpoints.go | 558 - .../service/ssooidc/generated.json | 37 - .../service/ssooidc/go_module_metadata.go | 6 - .../ssooidc/internal/endpoints/endpoints.go | 603 - .../aws-sdk-go-v2/service/ssooidc/options.go | 239 - .../service/ssooidc/serializers.go | 512 - .../service/ssooidc/types/enums.go | 44 - .../service/ssooidc/types/errors.go | 430 - .../service/ssooidc/types/types.go | 25 - .../service/ssooidc/validators.go | 184 - .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 710 - .../aws/aws-sdk-go-v2/service/sts/LICENSE.txt | 202 - .../aws-sdk-go-v2/service/sts/api_client.go | 1171 - .../service/sts/api_op_AssumeRole.go | 580 - .../service/sts/api_op_AssumeRoleWithSAML.go | 488 - .../sts/api_op_AssumeRoleWithWebIdentity.go | 508 - .../service/sts/api_op_AssumeRoot.go | 253 - .../sts/api_op_DecodeAuthorizationMessage.go | 225 - .../service/sts/api_op_GetAccessKeyInfo.go | 216 - .../service/sts/api_op_GetCallerIdentity.go | 228 - .../service/sts/api_op_GetFederationToken.go | 429 - .../service/sts/api_op_GetSessionToken.go | 275 - .../aws/aws-sdk-go-v2/service/sts/auth.go | 351 - .../service/sts/deserializers.go | 2710 - .../aws/aws-sdk-go-v2/service/sts/doc.go | 13 - .../aws-sdk-go-v2/service/sts/endpoints.go | 1139 - .../aws-sdk-go-v2/service/sts/generated.json | 43 - .../service/sts/go_module_metadata.go | 6 - .../sts/internal/endpoints/endpoints.go | 563 - .../aws/aws-sdk-go-v2/service/sts/options.go | 239 - .../aws-sdk-go-v2/service/sts/serializers.go | 1005 - .../aws-sdk-go-v2/service/sts/types/errors.go | 248 - .../aws-sdk-go-v2/service/sts/types/types.go | 144 - .../aws-sdk-go-v2/service/sts/validators.go | 347 - vendor/github.com/aws/smithy-go/.gitignore | 29 - vendor/github.com/aws/smithy-go/.travis.yml | 28 - vendor/github.com/aws/smithy-go/CHANGELOG.md | 330 - .../aws/smithy-go/CODE_OF_CONDUCT.md | 4 - .../github.com/aws/smithy-go/CONTRIBUTING.md | 90 - vendor/github.com/aws/smithy-go/LICENSE | 175 - vendor/github.com/aws/smithy-go/Makefile | 125 - vendor/github.com/aws/smithy-go/NOTICE | 1 - vendor/github.com/aws/smithy-go/README.md | 100 - vendor/github.com/aws/smithy-go/auth/auth.go | 3 - .../aws/smithy-go/auth/bearer/docs.go | 3 - .../aws/smithy-go/auth/bearer/middleware.go | 104 - .../aws/smithy-go/auth/bearer/token.go | 50 - .../aws/smithy-go/auth/bearer/token_cache.go | 208 - .../github.com/aws/smithy-go/auth/identity.go | 47 - .../github.com/aws/smithy-go/auth/option.go | 25 - .../aws/smithy-go/auth/scheme_id.go | 20 - .../aws/smithy-go/changelog-template.json | 9 - .../aws/smithy-go/context/suppress_expired.go | 81 - vendor/github.com/aws/smithy-go/doc.go | 2 - vendor/github.com/aws/smithy-go/document.go | 10 - .../github.com/aws/smithy-go/document/doc.go | 12 - .../aws/smithy-go/document/document.go | 153 - .../aws/smithy-go/document/errors.go | 75 - .../github.com/aws/smithy-go/encoding/doc.go | 4 - .../aws/smithy-go/encoding/encoding.go | 40 - .../smithy-go/encoding/httpbinding/encode.go | 123 - .../smithy-go/encoding/httpbinding/header.go | 122 - .../encoding/httpbinding/path_replace.go | 108 - .../smithy-go/encoding/httpbinding/query.go | 107 - .../aws/smithy-go/encoding/httpbinding/uri.go | 111 - .../aws/smithy-go/encoding/json/array.go | 35 - .../aws/smithy-go/encoding/json/constants.go | 15 - .../smithy-go/encoding/json/decoder_util.go | 139 - .../aws/smithy-go/encoding/json/encoder.go | 30 - .../aws/smithy-go/encoding/json/escape.go | 198 - .../aws/smithy-go/encoding/json/object.go | 40 - .../aws/smithy-go/encoding/json/value.go | 149 - .../aws/smithy-go/encoding/xml/array.go | 49 - .../aws/smithy-go/encoding/xml/constants.go | 10 - .../aws/smithy-go/encoding/xml/doc.go | 49 - .../aws/smithy-go/encoding/xml/element.go | 91 - .../aws/smithy-go/encoding/xml/encoder.go | 51 - .../aws/smithy-go/encoding/xml/error_utils.go | 51 - .../aws/smithy-go/encoding/xml/escape.go | 137 - .../aws/smithy-go/encoding/xml/map.go | 53 - .../aws/smithy-go/encoding/xml/value.go | 302 - .../aws/smithy-go/encoding/xml/xml_decoder.go | 154 - .../aws/smithy-go/endpoints/endpoint.go | 23 - vendor/github.com/aws/smithy-go/errors.go | 137 - .../aws/smithy-go/go_module_metadata.go | 6 - .../internal/sync/singleflight/LICENSE | 28 - .../internal/sync/singleflight/docs.go | 8 - .../sync/singleflight/singleflight.go | 210 - vendor/github.com/aws/smithy-go/io/byte.go | 12 - vendor/github.com/aws/smithy-go/io/doc.go | 2 - vendor/github.com/aws/smithy-go/io/reader.go | 16 - .../github.com/aws/smithy-go/io/ringbuffer.go | 94 - .../aws/smithy-go/local-mod-replace.sh | 39 - .../aws/smithy-go/logging/logger.go | 82 - .../aws/smithy-go/metrics/metrics.go | 136 - .../github.com/aws/smithy-go/metrics/nop.go | 67 - .../aws/smithy-go/middleware/context.go | 41 - .../aws/smithy-go/middleware/doc.go | 67 - .../aws/smithy-go/middleware/logging.go | 46 - .../aws/smithy-go/middleware/metadata.go | 65 - .../aws/smithy-go/middleware/middleware.go | 71 - .../aws/smithy-go/middleware/ordered_group.go | 268 - .../aws/smithy-go/middleware/stack.go | 209 - .../aws/smithy-go/middleware/stack_values.go | 100 - .../aws/smithy-go/middleware/step_build.go | 211 - .../smithy-go/middleware/step_deserialize.go | 217 - .../aws/smithy-go/middleware/step_finalize.go | 211 - .../smithy-go/middleware/step_initialize.go | 211 - .../smithy-go/middleware/step_serialize.go | 219 - vendor/github.com/aws/smithy-go/modman.toml | 9 - .../private/requestcompression/gzip.go | 30 - .../middleware_capture_request_compression.go | 52 - .../requestcompression/request_compression.go | 103 - vendor/github.com/aws/smithy-go/properties.go | 69 - vendor/github.com/aws/smithy-go/ptr/doc.go | 5 - .../github.com/aws/smithy-go/ptr/from_ptr.go | 601 - .../aws/smithy-go/ptr/gen_scalars.go | 83 - vendor/github.com/aws/smithy-go/ptr/to_ptr.go | 499 - vendor/github.com/aws/smithy-go/rand/doc.go | 3 - vendor/github.com/aws/smithy-go/rand/rand.go | 31 - vendor/github.com/aws/smithy-go/rand/uuid.go | 87 - vendor/github.com/aws/smithy-go/time/time.go | 134 - .../aws/smithy-go/tracing/context.go | 96 - .../github.com/aws/smithy-go/tracing/nop.go | 32 - .../aws/smithy-go/tracing/tracing.go | 95 - .../aws/smithy-go/transport/http/auth.go | 21 - .../smithy-go/transport/http/auth_schemes.go | 45 - .../transport/http/checksum_middleware.go | 70 - .../aws/smithy-go/transport/http/client.go | 161 - .../aws/smithy-go/transport/http/doc.go | 5 - .../smithy-go/transport/http/headerlist.go | 163 - .../aws/smithy-go/transport/http/host.go | 89 - .../smithy-go/transport/http/interceptor.go | 321 - .../transport/http/interceptor_middleware.go | 325 - .../transport/http/internal/io/safe.go | 75 - .../smithy-go/transport/http/md5_checksum.go | 25 - .../aws/smithy-go/transport/http/metrics.go | 198 - .../http/middleware_close_response_body.go | 79 - .../http/middleware_content_length.go | 84 - .../http/middleware_header_comment.go | 81 - .../transport/http/middleware_headers.go | 167 - .../transport/http/middleware_http_logging.go | 75 - .../transport/http/middleware_metadata.go | 51 - .../transport/http/middleware_min_proto.go | 79 - .../smithy-go/transport/http/properties.go | 80 - .../aws/smithy-go/transport/http/request.go | 188 - .../aws/smithy-go/transport/http/response.go | 34 - .../aws/smithy-go/transport/http/time.go | 13 - .../aws/smithy-go/transport/http/url.go | 44 - .../smithy-go/transport/http/user_agent.go | 37 - vendor/github.com/aws/smithy-go/validation.go | 140 - .../github.com/aws/smithy-go/waiter/logger.go | 36 - .../github.com/aws/smithy-go/waiter/waiter.go | 66 - .../github.com/cenkalti/backoff/v4/.gitignore | 25 - vendor/github.com/cenkalti/backoff/v4/LICENSE | 20 - .../github.com/cenkalti/backoff/v4/README.md | 30 - .../github.com/cenkalti/backoff/v4/backoff.go | 66 - .../github.com/cenkalti/backoff/v4/context.go | 62 - .../cenkalti/backoff/v4/exponential.go | 216 - .../github.com/cenkalti/backoff/v4/retry.go | 146 - .../github.com/cenkalti/backoff/v4/ticker.go | 97 - .../github.com/cenkalti/backoff/v4/timer.go | 35 - .../github.com/cenkalti/backoff/v4/tries.go | 38 - .../distribution/reference/.gitattributes | 1 - .../distribution/reference/.gitignore | 2 - .../distribution/reference/.golangci.yml | 18 - .../distribution/reference/CODE-OF-CONDUCT.md | 5 - .../distribution/reference/CONTRIBUTING.md | 114 - .../distribution/reference/GOVERNANCE.md | 144 - .../github.com/distribution/reference/LICENSE | 202 - .../distribution/reference/MAINTAINERS | 26 - .../distribution/reference/Makefile | 25 - .../distribution/reference/README.md | 30 - .../distribution/reference/SECURITY.md | 7 - .../reference/distribution-logo.svg | 1 - .../distribution/reference/helpers.go | 42 - .../distribution/reference/normalize.go | 255 - .../distribution/reference/reference.go | 432 - .../distribution/reference/regexp.go | 163 - .../github.com/distribution/reference/sort.go | 75 - .../emicklei/go-restful/v3/.travis.yml | 13 - .../emicklei/go-restful/v3/CHANGES.md | 4 + .../emicklei/go-restful/v3/README.md | 1 + .../emicklei/go-restful/v3/curly.go | 50 +- .../emicklei/go-restful/v3/custom_verb.go | 34 +- .../github.com/emicklei/go-restful/v3/doc.go | 42 +- .../github.com/felixge/httpsnoop/.gitignore | 0 .../github.com/felixge/httpsnoop/LICENSE.txt | 19 - vendor/github.com/felixge/httpsnoop/Makefile | 10 - vendor/github.com/felixge/httpsnoop/README.md | 95 - .../felixge/httpsnoop/capture_metrics.go | 86 - vendor/github.com/felixge/httpsnoop/docs.go | 10 - .../httpsnoop/wrap_generated_gteq_1.8.go | 436 - .../httpsnoop/wrap_generated_lt_1.8.go | 278 - vendor/github.com/go-logr/stdr/LICENSE | 201 - vendor/github.com/go-logr/stdr/README.md | 6 - vendor/github.com/go-logr/stdr/stdr.go | 170 - .../github.com/go-openapi/swag/.codecov.yml | 4 + .../github.com/go-openapi/swag/.golangci.yml | 122 +- .../github.com/go-openapi/swag/.mockery.yml | 30 + vendor/github.com/go-openapi/swag/README.md | 238 +- vendor/github.com/go-openapi/swag/SECURITY.md | 19 + .../go-openapi/swag/cmdutils}/LICENSE | 0 .../go-openapi/swag/cmdutils/cmd_utils.go | 13 + .../go-openapi/swag/cmdutils/doc.go | 5 + .../go-openapi/swag/cmdutils_iface.go | 11 + .../swag/conv}/LICENSE | 0 .../go-openapi/swag/conv/convert.go | 161 + .../go-openapi/swag/conv/convert_types.go | 72 + vendor/github.com/go-openapi/swag/conv/doc.go | 15 + .../github.com/go-openapi/swag/conv/format.go | 28 + .../github.com/go-openapi/swag/conv/sizeof.go | 20 + .../go-openapi/swag/conv/type_constraints.go | 29 + .../github.com/go-openapi/swag/conv_iface.go | 486 + vendor/github.com/go-openapi/swag/convert.go | 208 - .../go-openapi/swag/convert_types.go | 730 - vendor/github.com/go-openapi/swag/doc.go | 70 +- vendor/github.com/go-openapi/swag/file.go | 33 - .../swag/fileutils}/LICENSE | 0 .../go-openapi/swag/fileutils/doc.go | 10 + .../go-openapi/swag/fileutils/file.go | 22 + .../go-openapi/swag/{ => fileutils}/path.go | 29 +- .../go-openapi/swag/fileutils_iface.go | 33 + .../go-openapi/swag/initialism_index.go | 202 - vendor/github.com/go-openapi/swag/json.go | 312 - .../go-openapi/swag/jsonname}/LICENSE | 0 .../go-openapi/swag/jsonname/doc.go | 5 + .../go-openapi/swag/jsonname/name_provider.go | 138 + .../go-openapi/swag/jsonname_iface.go | 24 + .../go-openapi/swag/jsonutils}/LICENSE | 0 .../go-openapi/swag/jsonutils/README.md | 108 + .../go-openapi/swag/jsonutils/adapters/doc.go | 8 + .../swag/jsonutils/adapters/ifaces/doc.go | 5 + .../swag/jsonutils/adapters/ifaces/ifaces.go | 84 + .../adapters/ifaces/registry_iface.go | 91 + .../swag/jsonutils/adapters/registry.go | 229 + .../jsonutils/adapters/stdlib/json/adapter.go | 115 + .../jsonutils/adapters/stdlib/json/doc.go | 5 + .../jsonutils/adapters/stdlib/json/lexer.go | 320 + .../adapters/stdlib/json/ordered_map.go | 266 + .../jsonutils/adapters/stdlib/json/pool.go | 143 + .../adapters/stdlib/json/register.go | 26 + .../jsonutils/adapters/stdlib/json/writer.go | 75 + .../go-openapi/swag/jsonutils/concat.go | 92 + .../go-openapi/swag/jsonutils/doc.go | 7 + .../go-openapi/swag/jsonutils/json.go | 116 + .../go-openapi/swag/jsonutils/ordered_map.go | 114 + .../go-openapi/swag/jsonutils_iface.go | 65 + .../go-openapi/swag/loading}/LICENSE | 0 .../github.com/go-openapi/swag/loading/doc.go | 5 + .../go-openapi/swag/loading/errors.go | 15 + .../go-openapi/swag/loading/json.go | 25 + .../go-openapi/swag/{ => loading}/loading.go | 90 +- .../go-openapi/swag/loading/options.go | 125 + .../go-openapi/swag/loading/yaml.go | 37 + .../go-openapi/swag/loading_iface.go | 91 + .../swag/{ => mangling}/BENCHMARK.md | 48 +- .../go-openapi/swag/mangling}/LICENSE | 0 .../go-openapi/swag/mangling/doc.go | 25 + .../swag/mangling/initialism_index.go | 270 + .../go-openapi/swag/mangling/name_lexem.go | 186 + .../go-openapi/swag/mangling/name_mangler.go | 370 + .../go-openapi/swag/mangling/options.go | 150 + .../go-openapi/swag/mangling/pools.go | 123 + .../go-openapi/swag/mangling/split.go | 341 + .../swag/{ => mangling}/string_bytes.go | 5 +- .../go-openapi/swag/mangling/util.go | 118 + .../go-openapi/swag/mangling_iface.go | 69 + .../github.com/go-openapi/swag/name_lexem.go | 93 - vendor/github.com/go-openapi/swag/net.go | 38 - .../go-openapi/swag/netutils}/LICENSE | 0 .../go-openapi/swag/netutils/doc.go | 5 + .../go-openapi/swag/netutils/net.go | 31 + .../go-openapi/swag/netutils_iface.go | 13 + vendor/github.com/go-openapi/swag/split.go | 508 - .../go-openapi/swag/stringutils}/LICENSE | 0 .../swag/stringutils/collection_formats.go | 74 + .../go-openapi/swag/stringutils/doc.go | 5 + .../go-openapi/swag/stringutils/strings.go | 23 + .../go-openapi/swag/stringutils_iface.go | 34 + .../go-openapi/swag/typeutils}/LICENSE | 0 .../go-openapi/swag/typeutils/doc.go | 5 + .../go-openapi/swag/typeutils/types.go | 80 + .../go-openapi/swag/typeutils_iface.go | 12 + vendor/github.com/go-openapi/swag/util.go | 364 - vendor/github.com/go-openapi/swag/yaml.go | 481 - .../go-openapi/swag/yamlutils}/LICENSE | 0 .../go-openapi/swag/yamlutils/doc.go | 13 + .../go-openapi/swag/yamlutils/errors.go | 15 + .../go-openapi/swag/yamlutils/ordered_map.go | 316 + .../go-openapi/swag/yamlutils/yaml.go | 211 + .../go-openapi/swag/yamlutils_iface.go | 20 + vendor/github.com/google/cel-go/LICENSE | 233 - .../github.com/google/cel-go/cel/BUILD.bazel | 98 - vendor/github.com/google/cel-go/cel/cel.go | 19 - vendor/github.com/google/cel-go/cel/decls.go | 428 - vendor/github.com/google/cel-go/cel/env.go | 1039 - .../github.com/google/cel-go/cel/folding.go | 603 - .../github.com/google/cel-go/cel/inlining.go | 228 - vendor/github.com/google/cel-go/cel/io.go | 349 - .../github.com/google/cel-go/cel/library.go | 871 - vendor/github.com/google/cel-go/cel/macro.go | 590 - .../github.com/google/cel-go/cel/optimizer.go | 535 - .../github.com/google/cel-go/cel/options.go | 886 - .../github.com/google/cel-go/cel/program.go | 495 - vendor/github.com/google/cel-go/cel/prompt.go | 155 - .../cel-go/cel/templates/authoring.tmpl | 56 - .../github.com/google/cel-go/cel/validator.go | 439 - .../google/cel-go/checker/BUILD.bazel | 64 - .../google/cel-go/checker/checker.go | 728 - .../github.com/google/cel-go/checker/cost.go | 1042 - .../google/cel-go/checker/decls/BUILD.bazel | 19 - .../google/cel-go/checker/decls/decls.go | 254 - .../github.com/google/cel-go/checker/env.go | 284 - .../google/cel-go/checker/errors.go | 92 - .../google/cel-go/checker/format.go | 216 - .../google/cel-go/checker/mapping.go | 49 - .../google/cel-go/checker/options.go | 42 - .../google/cel-go/checker/printer.go | 74 - .../google/cel-go/checker/scopes.go | 147 - .../github.com/google/cel-go/checker/types.go | 314 - .../google/cel-go/common/BUILD.bazel | 36 - .../google/cel-go/common/ast/BUILD.bazel | 57 - .../google/cel-go/common/ast/ast.go | 535 - .../google/cel-go/common/ast/conversion.go | 659 - .../google/cel-go/common/ast/expr.go | 884 - .../google/cel-go/common/ast/factory.go | 332 - .../google/cel-go/common/ast/navigable.go | 665 - .../cel-go/common/containers/BUILD.bazel | 31 - .../cel-go/common/containers/container.go | 328 - .../github.com/google/cel-go/common/cost.go | 40 - .../google/cel-go/common/debug/BUILD.bazel | 20 - .../google/cel-go/common/debug/debug.go | 314 - .../google/cel-go/common/decls/BUILD.bazel | 41 - .../google/cel-go/common/decls/decls.go | 1129 - vendor/github.com/google/cel-go/common/doc.go | 171 - .../google/cel-go/common/env/BUILD.bazel | 50 - .../google/cel-go/common/env/env.go | 887 - .../github.com/google/cel-go/common/error.go | 74 - .../github.com/google/cel-go/common/errors.go | 112 - .../cel-go/common/functions/BUILD.bazel | 17 - .../cel-go/common/functions/functions.go | 61 - .../google/cel-go/common/location.go | 51 - .../cel-go/common/operators/BUILD.bazel | 14 - .../cel-go/common/operators/operators.go | 157 - .../cel-go/common/overloads/BUILD.bazel | 14 - .../cel-go/common/overloads/overloads.go | 327 - .../google/cel-go/common/runes/BUILD.bazel | 25 - .../google/cel-go/common/runes/buffer.go | 242 - .../github.com/google/cel-go/common/source.go | 173 - .../google/cel-go/common/stdlib/BUILD.bazel | 24 - .../google/cel-go/common/stdlib/standard.go | 1058 - .../google/cel-go/common/types/BUILD.bazel | 93 - .../google/cel-go/common/types/any_value.go | 24 - .../google/cel-go/common/types/bool.go | 150 - .../google/cel-go/common/types/bytes.go | 155 - .../google/cel-go/common/types/compare.go | 97 - .../google/cel-go/common/types/doc.go | 17 - .../google/cel-go/common/types/double.go | 233 - .../google/cel-go/common/types/duration.go | 227 - .../google/cel-go/common/types/err.go | 175 - .../google/cel-go/common/types/format.go | 42 - .../google/cel-go/common/types/int.go | 308 - .../google/cel-go/common/types/iterator.go | 55 - .../google/cel-go/common/types/json_value.go | 29 - .../google/cel-go/common/types/list.go | 590 - .../google/cel-go/common/types/map.go | 1038 - .../google/cel-go/common/types/null.go | 124 - .../google/cel-go/common/types/object.go | 194 - .../google/cel-go/common/types/optional.go | 119 - .../google/cel-go/common/types/overflow.go | 429 - .../google/cel-go/common/types/pb/BUILD.bazel | 53 - .../google/cel-go/common/types/pb/checked.go | 93 - .../google/cel-go/common/types/pb/enum.go | 44 - .../google/cel-go/common/types/pb/equal.go | 206 - .../google/cel-go/common/types/pb/file.go | 202 - .../google/cel-go/common/types/pb/pb.go | 258 - .../google/cel-go/common/types/pb/type.go | 614 - .../google/cel-go/common/types/provider.go | 766 - .../cel-go/common/types/ref/BUILD.bazel | 20 - .../cel-go/common/types/ref/provider.go | 102 - .../cel-go/common/types/ref/reference.go | 63 - .../google/cel-go/common/types/string.go | 230 - .../google/cel-go/common/types/timestamp.go | 315 - .../cel-go/common/types/traits/BUILD.bazel | 29 - .../cel-go/common/types/traits/comparer.go | 33 - .../cel-go/common/types/traits/container.go | 23 - .../common/types/traits/field_tester.go | 30 - .../cel-go/common/types/traits/indexer.go | 25 - .../cel-go/common/types/traits/iterator.go | 49 - .../cel-go/common/types/traits/lister.go | 36 - .../cel-go/common/types/traits/mapper.go | 48 - .../cel-go/common/types/traits/matcher.go | 23 - .../google/cel-go/common/types/traits/math.go | 62 - .../cel-go/common/types/traits/receiver.go | 24 - .../cel-go/common/types/traits/sizer.go | 25 - .../cel-go/common/types/traits/traits.go | 79 - .../cel-go/common/types/traits/zeroer.go | 21 - .../google/cel-go/common/types/types.go | 884 - .../google/cel-go/common/types/uint.go | 262 - .../google/cel-go/common/types/unknown.go | 326 - .../google/cel-go/common/types/util.go | 48 - .../github.com/google/cel-go/ext/BUILD.bazel | 86 - vendor/github.com/google/cel-go/ext/README.md | 947 - .../github.com/google/cel-go/ext/bindings.go | 336 - .../google/cel-go/ext/comprehensions.go | 428 - .../github.com/google/cel-go/ext/encoders.go | 112 - .../cel-go/ext/extension_option_factory.go | 75 - .../google/cel-go/ext/formatting.go | 927 - .../google/cel-go/ext/formatting_v2.go | 788 - vendor/github.com/google/cel-go/ext/guards.go | 67 - vendor/github.com/google/cel-go/ext/lists.go | 779 - vendor/github.com/google/cel-go/ext/math.go | 948 - vendor/github.com/google/cel-go/ext/native.go | 796 - vendor/github.com/google/cel-go/ext/protos.go | 159 - vendor/github.com/google/cel-go/ext/regex.go | 332 - vendor/github.com/google/cel-go/ext/sets.go | 278 - .../github.com/google/cel-go/ext/strings.go | 796 - .../google/cel-go/interpreter/BUILD.bazel | 74 - .../google/cel-go/interpreter/activation.go | 192 - .../cel-go/interpreter/attribute_patterns.go | 386 - .../google/cel-go/interpreter/attributes.go | 1436 - .../google/cel-go/interpreter/decorators.go | 272 - .../google/cel-go/interpreter/dispatcher.go | 100 - .../google/cel-go/interpreter/evalstate.go | 79 - .../cel-go/interpreter/functions/BUILD.bazel | 17 - .../cel-go/interpreter/functions/functions.go | 39 - .../cel-go/interpreter/interpretable.go | 1473 - .../google/cel-go/interpreter/interpreter.go | 273 - .../cel-go/interpreter/optimizations.go | 46 - .../google/cel-go/interpreter/planner.go | 767 - .../google/cel-go/interpreter/prune.go | 574 - .../google/cel-go/interpreter/runtimecost.go | 415 - .../google/cel-go/parser/BUILD.bazel | 58 - .../github.com/google/cel-go/parser/errors.go | 41 - .../google/cel-go/parser/gen/BUILD.bazel | 26 - .../google/cel-go/parser/gen/CEL.g4 | 207 - .../google/cel-go/parser/gen/CEL.interp | 102 - .../google/cel-go/parser/gen/CEL.tokens | 65 - .../google/cel-go/parser/gen/CELLexer.interp | 139 - .../google/cel-go/parser/gen/CELLexer.tokens | 65 - .../cel-go/parser/gen/cel_base_listener.go | 237 - .../cel-go/parser/gen/cel_base_visitor.go | 152 - .../google/cel-go/parser/gen/cel_lexer.go | 351 - .../google/cel-go/parser/gen/cel_listener.go | 225 - .../google/cel-go/parser/gen/cel_parser.go | 6197 - .../google/cel-go/parser/gen/cel_visitor.go | 117 - .../google/cel-go/parser/gen/doc.go | 16 - .../google/cel-go/parser/gen/generate.sh | 35 - .../github.com/google/cel-go/parser/helper.go | 515 - .../github.com/google/cel-go/parser/input.go | 129 - .../github.com/google/cel-go/parser/macro.go | 603 - .../google/cel-go/parser/options.go | 163 - .../github.com/google/cel-go/parser/parser.go | 1065 - .../google/cel-go/parser/unescape.go | 237 - .../google/cel-go/parser/unparser.go | 663 - .../github.com/gorilla/websocket/.gitignore | 25 - vendor/github.com/gorilla/websocket/AUTHORS | 9 - vendor/github.com/gorilla/websocket/LICENSE | 22 - vendor/github.com/gorilla/websocket/README.md | 32 - vendor/github.com/gorilla/websocket/client.go | 517 - .../gorilla/websocket/compression.go | 152 - vendor/github.com/gorilla/websocket/conn.go | 1246 - vendor/github.com/gorilla/websocket/doc.go | 227 - vendor/github.com/gorilla/websocket/join.go | 42 - vendor/github.com/gorilla/websocket/json.go | 60 - vendor/github.com/gorilla/websocket/mask.go | 55 - .../github.com/gorilla/websocket/mask_safe.go | 16 - .../github.com/gorilla/websocket/prepared.go | 102 - vendor/github.com/gorilla/websocket/proxy.go | 104 - vendor/github.com/gorilla/websocket/server.go | 373 - vendor/github.com/gorilla/websocket/util.go | 298 - .../grpc-ecosystem/grpc-gateway/v2/LICENSE | 27 - .../v2/internal/httprule/BUILD.bazel | 35 - .../v2/internal/httprule/compile.go | 121 - .../grpc-gateway/v2/internal/httprule/fuzz.go | 11 - .../v2/internal/httprule/parse.go | 368 - .../v2/internal/httprule/types.go | 60 - .../grpc-gateway/v2/runtime/BUILD.bazel | 97 - .../grpc-gateway/v2/runtime/context.go | 417 - .../grpc-gateway/v2/runtime/convert.go | 318 - .../grpc-gateway/v2/runtime/doc.go | 5 - .../grpc-gateway/v2/runtime/errors.go | 204 - .../grpc-gateway/v2/runtime/fieldmask.go | 168 - .../grpc-gateway/v2/runtime/handler.go | 251 - .../v2/runtime/marshal_httpbodyproto.go | 32 - .../grpc-gateway/v2/runtime/marshal_json.go | 50 - .../grpc-gateway/v2/runtime/marshal_jsonpb.go | 349 - .../grpc-gateway/v2/runtime/marshal_proto.go | 60 - .../grpc-gateway/v2/runtime/marshaler.go | 58 - .../v2/runtime/marshaler_registry.go | 109 - .../grpc-gateway/v2/runtime/mux.go | 545 - .../grpc-gateway/v2/runtime/pattern.go | 381 - .../grpc-gateway/v2/runtime/proto2_convert.go | 80 - .../grpc-gateway/v2/runtime/query.go | 378 - .../grpc-gateway/v2/utilities/BUILD.bazel | 31 - .../grpc-gateway/v2/utilities/doc.go | 2 - .../grpc-gateway/v2/utilities/pattern.go | 22 - .../v2/utilities/readerfactory.go | 19 - .../v2/utilities/string_array_flag.go | 33 - .../grpc-gateway/v2/utilities/trie.go | 174 - vendor/github.com/josharian/intern/README.md | 5 - vendor/github.com/josharian/intern/intern.go | 44 - vendor/github.com/josharian/intern/license.md | 21 - vendor/github.com/mailru/easyjson/LICENSE | 7 - .../github.com/mailru/easyjson/buffer/pool.go | 278 - .../mailru/easyjson/jlexer/bytestostr.go | 21 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1257 - .../mailru/easyjson/jwriter/writer.go | 417 - .../moby/spdystream/CONTRIBUTING.md | 13 - vendor/github.com/moby/spdystream/MAINTAINERS | 40 - vendor/github.com/moby/spdystream/NOTICE | 5 - vendor/github.com/moby/spdystream/README.md | 77 - .../github.com/moby/spdystream/connection.go | 991 - vendor/github.com/moby/spdystream/handlers.go | 52 - vendor/github.com/moby/spdystream/priority.go | 114 - .../moby/spdystream/spdy/dictionary.go | 203 - .../github.com/moby/spdystream/spdy/read.go | 364 - .../github.com/moby/spdystream/spdy/types.go | 291 - .../github.com/moby/spdystream/spdy/write.go | 334 - vendor/github.com/moby/spdystream/stream.go | 345 - vendor/github.com/moby/spdystream/utils.go | 32 - vendor/github.com/mxk/go-flowrate/LICENSE | 29 - .../mxk/go-flowrate/flowrate/flowrate.go | 267 - .../github.com/mxk/go-flowrate/flowrate/io.go | 133 - .../mxk/go-flowrate/flowrate/util.go | 67 - vendor/github.com/onsi/ginkgo/v2/OWNERS | 4 - .../onsi/ginkgo/v2/core_dsl_patch.go | 33 - .../v2/internal/output_interceptor_unix.go | 18 - .../v2/internal/output_interceptor_wasm.go | 7 - .../v2/internal/output_interceptor_win.go | 9 - .../onsi/ginkgo/v2/internal/spec_patch.go | 22 - .../onsi/ginkgo/v2/internal/suite.go | 7 - .../onsi/ginkgo/v2/internal/suite_patch.go | 142 - .../onsi/ginkgo/v2/types/types_patch.go | 8 - .../onsi/gomega/gcustom/make_matcher.go | 270 - .../opencontainers/go-digest/.mailmap | 4 - .../opencontainers/go-digest/.pullapprove.yml | 28 - .../opencontainers/go-digest/.travis.yml | 5 - .../opencontainers/go-digest/CONTRIBUTING.md | 72 - .../opencontainers/go-digest/LICENSE | 192 - .../opencontainers/go-digest/LICENSE.docs | 425 - .../opencontainers/go-digest/MAINTAINERS | 5 - .../opencontainers/go-digest/README.md | 96 - .../opencontainers/go-digest/algorithm.go | 193 - .../opencontainers/go-digest/digest.go | 157 - .../opencontainers/go-digest/digester.go | 40 - .../opencontainers/go-digest/doc.go | 62 - .../opencontainers/go-digest/verifiers.go | 46 - .../openshift-tests-extension/LICENSE | 201 - .../openshift-tests-extension/pkg/cmd/cmd.go | 23 - .../pkg/cmd/cmdimages/cmdimages.go | 36 - .../pkg/cmd/cmdinfo/info.go | 38 - .../pkg/cmd/cmdlist/list.go | 133 - .../pkg/cmd/cmdrun/runsuite.go | 153 - .../pkg/cmd/cmdrun/runtest.go | 113 - .../pkg/cmd/cmdupdate/update.go | 84 - .../pkg/dbtime/time.go | 26 - .../pkg/extension/extension.go | 165 - .../extension/extensiontests/environment.go | 92 - .../pkg/extension/extensiontests/result.go | 125 - .../extension/extensiontests/result_writer.go | 213 - .../pkg/extension/extensiontests/spec.go | 621 - .../pkg/extension/extensiontests/task.go | 31 - .../pkg/extension/extensiontests/types.go | 119 - .../pkg/extension/extensiontests/viewer.html | 1520 - .../pkg/extension/registry.go | 39 - .../pkg/extension/types.go | 94 - .../pkg/flags/component.go | 25 - .../pkg/flags/concurrency.go | 23 - .../pkg/flags/environment.go | 114 - .../pkg/flags/names.go | 24 - .../pkg/flags/output.go | 95 - .../pkg/flags/suite.go | 21 - .../pkg/ginkgo/logging.go | 25 - .../pkg/ginkgo/parallel.go | 139 - .../pkg/ginkgo/util.go | 229 - .../pkg/junit/types.go | 104 - .../pkg/util/sets/README.md | 3 - .../pkg/util/sets/byte.go | 137 - .../pkg/util/sets/doc.go | 19 - .../pkg/util/sets/empty.go | 21 - .../pkg/util/sets/int.go | 137 - .../pkg/util/sets/int32.go | 137 - .../pkg/util/sets/int64.go | 137 - .../pkg/util/sets/set.go | 236 - .../pkg/util/sets/string.go | 137 - .../pkg/version/version.go | 11 - .../github.com/openshift/api/config/v1/doc.go | 1 + .../openshift/api/config/v1/register.go | 2 + .../openshift/api/config/v1/types.go | 5 + .../api/config/v1/types_apiserver.go | 70 +- .../api/config/v1/types_authentication.go | 400 +- .../api/config/v1/types_cluster_operator.go | 5 +- .../api/config/v1/types_cluster_version.go | 25 +- .../types_crio_credential_provider_config.go | 186 + .../openshift/api/config/v1/types_dns.go | 9 +- .../openshift/api/config/v1/types_image.go | 30 + .../api/config/v1/types_infrastructure.go | 44 +- .../openshift/api/config/v1/types_ingress.go | 36 + .../api/config/v1/types_kmsencryption.go | 264 +- .../openshift/api/config/v1/types_network.go | 33 + .../api/config/v1/types_tlssecurityprofile.go | 122 +- ...1_clusterversions-CustomNoUpgrade.crd.yaml | 15 + ...usterversions-DevPreviewNoUpgrade.crd.yaml | 15 + ...sterversions-TechPreviewNoUpgrade.crd.yaml | 15 + ...tor_01_apiservers-CustomNoUpgrade.crd.yaml | 395 +- ...ig-operator_01_apiservers-Default.crd.yaml | 36 +- ...01_apiservers-DevPreviewNoUpgrade.crd.yaml | 395 +- ...config-operator_01_apiservers-OKD.crd.yaml | 36 +- ...1_apiservers-TechPreviewNoUpgrade.crd.yaml | 391 +- ...1_authentications-CustomNoUpgrade.crd.yaml | 445 +- ...erator_01_authentications-Default.crd.yaml | 7 +- ...thentications-DevPreviewNoUpgrade.crd.yaml | 445 +- ...g-operator_01_authentications-OKD.crd.yaml | 7 +- ...hentications-TechPreviewNoUpgrade.crd.yaml | 445 +- ..._01_criocredentialproviderconfigs.crd.yaml | 409 + ...operator_01_dnses-CustomNoUpgrade.crd.yaml | 198 + ..._config-operator_01_dnses-Default.crd.yaml | 198 + ...ator_01_dnses-DevPreviewNoUpgrade.crd.yaml | 198 + ..._10_config-operator_01_dnses-OKD.crd.yaml} | 11 +- ...tor_01_dnses-TechPreviewNoUpgrade.crd.yaml | 198 + ...0000_10_config-operator_01_images.crd.yaml | 43 +- ...erator_01_infrastructures-Default.crd.yaml | 242 +- ...ctures-Hypershift-CustomNoUpgrade.crd.yaml | 2798 + ...s-Hypershift-DevPreviewNoUpgrade.crd.yaml} | 32 +- ...-Hypershift-TechPreviewNoUpgrade.crd.yaml} | 34 +- ...g-operator_01_infrastructures-OKD.crd.yaml | 242 +- ...res-SelfManagedHA-CustomNoUpgrade.crd.yaml | 2798 + ...SelfManagedHA-DevPreviewNoUpgrade.crd.yaml | 2798 + ...lfManagedHA-TechPreviewNoUpgrade.crd.yaml} | 32 +- ...ator_01_ingresses-CustomNoUpgrade.crd.yaml | 593 + ...fig-operator_01_ingresses-Default.crd.yaml | 546 + ..._01_ingresses-DevPreviewNoUpgrade.crd.yaml | 593 + ...config-operator_01_ingresses-OKD.crd.yaml} | 3 + ...01_ingresses-TechPreviewNoUpgrade.crd.yaml | 593 + ...rator_01_networks-CustomNoUpgrade.crd.yaml | 470 + ...nfig-operator_01_networks-Default.crd.yaml | 448 + ...r_01_networks-DevPreviewNoUpgrade.crd.yaml | 470 + ..._config-operator_01_networks-OKD.crd.yaml} | 1 + ..._01_networks-TechPreviewNoUpgrade.crd.yaml | 470 + .../api/config/v1/zz_generated.deepcopy.go | 455 +- ..._generated.featuregated-crd-manifests.yaml | 45 +- .../api/config/v1/zz_generated.model_name.go | 1566 + .../v1/zz_generated.swagger_doc_generated.go | 269 +- .../openshift/api/config/v1alpha1/doc.go | 1 + .../openshift/api/config/v1alpha1/register.go | 4 - .../v1alpha1/types_cluster_image_policy.go | 80 - .../v1alpha1/types_cluster_monitoring.go | 2754 +- .../api/config/v1alpha1/types_image_policy.go | 289 - .../config/v1alpha1/zz_generated.deepcopy.go | 1426 +- ..._generated.featuregated-crd-manifests.yaml | 48 - .../v1alpha1/zz_generated.model_name.go | 461 + .../zz_generated.swagger_doc_generated.go | 672 +- .../openshift/api/config/v1alpha2/doc.go | 1 + .../v1alpha2/zz_generated.model_name.go | 61 + .../openshift/api/features/features.go | 287 +- .../openshift/api/machine/v1/doc.go | 1 + .../api/machine/v1/zz_generated.model_name.go | 211 + .../openshift/api/machine/v1beta1/doc.go | 1 + .../api/machine/v1beta1/types_awsprovider.go | 81 +- .../api/machine/v1beta1/types_machineset.go | 8 + ...pi_01_machinesets-CustomNoUpgrade.crd.yaml | 9 + ...achine-api_01_machinesets-Default.crd.yaml | 9 + ...1_machinesets-DevPreviewNoUpgrade.crd.yaml | 9 + ...10_machine-api_01_machinesets-OKD.crd.yaml | 9 + ..._machinesets-TechPreviewNoUpgrade.crd.yaml | 9 + .../machine/v1beta1/zz_generated.deepcopy.go | 22 +- .../v1beta1/zz_generated.model_name.go | 376 + .../zz_generated.swagger_doc_generated.go | 9 +- .../config/v1alpha1/alertmanagerconfig.go | 48 - .../v1alpha1/alertmanagercustomconfig.go | 179 - .../config/v1alpha1/audit.go | 38 - .../config/v1alpha1/backup.go | 277 - .../config/v1alpha1/backupspec.go | 24 - .../config/v1alpha1/clusterimagepolicy.go | 277 - .../config/v1alpha1/clusterimagepolicyspec.go | 53 - .../v1alpha1/clusterimagepolicystatus.go | 33 - .../config/v1alpha1/clustermonitoring.go | 277 - .../config/v1alpha1/clustermonitoringspec.go | 82 - .../config/v1alpha1/containerresource.go | 57 - .../v1alpha1/criocredentialproviderconfig.go | 285 - .../criocredentialproviderconfigspec.go | 72 - .../criocredentialproviderconfigstatus.go | 41 - .../config/v1alpha1/etcdbackupspec.go | 66 - .../config/v1alpha1/gatherconfig.go | 65 - .../config/v1alpha1/imagepolicy.go | 279 - ...imagepolicyfulciocawithrekorrootoftrust.go | 52 - .../v1alpha1/imagepolicypkirootoftrust.go | 51 - .../imagepolicypublickeyrootoftrust.go | 42 - .../config/v1alpha1/imagepolicyspec.go | 53 - .../config/v1alpha1/imagepolicystatus.go | 33 - .../imagesigstoreverificationpolicy.go | 36 - .../config/v1alpha1/insightsdatagather.go | 277 - .../config/v1alpha1/insightsdatagatherspec.go | 24 - .../config/v1alpha1/metricsserverconfig.go | 147 - .../persistentvolumeclaimreference.go | 27 - .../config/v1alpha1/persistentvolumeconfig.go | 40 - .../config/v1alpha1/pkicertificatesubject.go | 39 - .../config/v1alpha1/policyfulciosubject.go | 38 - .../config/v1alpha1/policyidentity.go | 57 - .../v1alpha1/policymatchexactrepository.go | 29 - .../v1alpha1/policymatchremapidentity.go | 45 - .../config/v1alpha1/policyrootoftrust.go | 65 - ...rometheusoperatoradmissionwebhookconfig.go | 78 - .../v1alpha1/prometheusoperatorconfig.go | 136 - .../config/v1alpha1/retentionnumberconfig.go | 28 - .../config/v1alpha1/retentionpolicy.go | 54 - .../config/v1alpha1/retentionsizeconfig.go | 28 - .../config/v1alpha1/storage.go | 46 - .../config/v1alpha1/userdefinedmonitoring.go | 34 - .../config/v1alpha2/custom.go | 36 - .../config/v1alpha2/gatherconfig.go | 58 - .../config/v1alpha2/gathererconfig.go | 49 - .../config/v1alpha2/gatherers.go | 44 - .../config/v1alpha2/insightsdatagather.go | 277 - .../config/v1alpha2/insightsdatagatherspec.go | 24 - .../persistentvolumeclaimreference.go | 27 - .../config/v1alpha2/persistentvolumeconfig.go | 40 - .../config/v1alpha2/storage.go | 46 - .../config/clientset/versioned/clientset.go | 130 - .../versioned/typed/config/v1alpha1/backup.go | 58 - .../config/v1alpha1/clusterimagepolicy.go | 58 - .../config/v1alpha1/clustermonitoring.go | 58 - .../typed/config/v1alpha1/config_client.go | 110 - .../v1alpha1/criocredentialproviderconfig.go | 62 - .../versioned/typed/config/v1alpha1/doc.go | 4 - .../config/v1alpha1/generated_expansion.go | 15 - .../typed/config/v1alpha1/imagepolicy.go | 58 - .../config/v1alpha1/insightsdatagather.go | 58 - .../typed/config/v1alpha2/config_client.go | 85 - .../versioned/typed/config/v1alpha2/doc.go | 4 - .../config/v1alpha2/generated_expansion.go | 5 - .../config/v1alpha2/insightsdatagather.go | 58 - .../machine-api-operator/test/e2e/util.go | 304 - vendor/github.com/pkg/errors/.gitignore | 24 - vendor/github.com/pkg/errors/.travis.yml | 10 - vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/Makefile | 44 - vendor/github.com/pkg/errors/README.md | 59 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/pkg/errors/errors.go | 288 - vendor/github.com/pkg/errors/go113.go | 38 - vendor/github.com/pkg/errors/stack.go | 177 - vendor/github.com/robfig/cron/v3/.gitignore | 22 - vendor/github.com/robfig/cron/v3/.travis.yml | 1 - vendor/github.com/robfig/cron/v3/LICENSE | 21 - vendor/github.com/robfig/cron/v3/README.md | 125 - vendor/github.com/robfig/cron/v3/chain.go | 92 - .../robfig/cron/v3/constantdelay.go | 27 - vendor/github.com/robfig/cron/v3/cron.go | 355 - vendor/github.com/robfig/cron/v3/doc.go | 231 - vendor/github.com/robfig/cron/v3/logger.go | 86 - vendor/github.com/robfig/cron/v3/option.go | 45 - vendor/github.com/robfig/cron/v3/parser.go | 434 - vendor/github.com/robfig/cron/v3/spec.go | 188 - .../github.com/stoewer/go-strcase/.gitignore | 17 - .../stoewer/go-strcase/.golangci.yml | 26 - vendor/github.com/stoewer/go-strcase/LICENSE | 21 - .../github.com/stoewer/go-strcase/README.md | 50 - vendor/github.com/stoewer/go-strcase/camel.go | 40 - vendor/github.com/stoewer/go-strcase/doc.go | 8 - .../github.com/stoewer/go-strcase/helper.go | 71 - vendor/github.com/stoewer/go-strcase/kebab.go | 14 - vendor/github.com/stoewer/go-strcase/snake.go | 58 - .../auto/sdk/CONTRIBUTING.md | 27 - vendor/go.opentelemetry.io/auto/sdk/LICENSE | 201 - .../auto/sdk/VERSIONING.md | 15 - vendor/go.opentelemetry.io/auto/sdk/doc.go | 14 - .../auto/sdk/internal/telemetry/attr.go | 58 - .../auto/sdk/internal/telemetry/doc.go | 8 - .../auto/sdk/internal/telemetry/id.go | 103 - .../auto/sdk/internal/telemetry/number.go | 67 - .../auto/sdk/internal/telemetry/resource.go | 66 - .../auto/sdk/internal/telemetry/scope.go | 67 - .../auto/sdk/internal/telemetry/span.go | 472 - .../auto/sdk/internal/telemetry/status.go | 42 - .../auto/sdk/internal/telemetry/traces.go | 189 - .../auto/sdk/internal/telemetry/value.go | 450 - vendor/go.opentelemetry.io/auto/sdk/limit.go | 94 - vendor/go.opentelemetry.io/auto/sdk/span.go | 447 - vendor/go.opentelemetry.io/auto/sdk/tracer.go | 141 - .../auto/sdk/tracer_provider.go | 33 - .../instrumentation/net/http/otelhttp/LICENSE | 201 - .../net/http/otelhttp/client.go | 50 - .../net/http/otelhttp/common.go | 27 - .../net/http/otelhttp/config.go | 211 - .../instrumentation/net/http/otelhttp/doc.go | 7 - .../net/http/otelhttp/handler.go | 238 - .../otelhttp/internal/request/body_wrapper.go | 80 - .../net/http/otelhttp/internal/request/gen.go | 10 - .../internal/request/resp_writer_wrapper.go | 122 - .../net/http/otelhttp/internal/semconv/env.go | 323 - .../net/http/otelhttp/internal/semconv/gen.go | 14 - .../otelhttp/internal/semconv/httpconv.go | 573 - .../http/otelhttp/internal/semconv/util.go | 127 - .../http/otelhttp/internal/semconv/v1.20.0.go | 273 - .../http/otelhttp/internal/semconvutil/gen.go | 10 - .../otelhttp/internal/semconvutil/httpconv.go | 594 - .../otelhttp/internal/semconvutil/netconv.go | 214 - .../net/http/otelhttp/labeler.go | 58 - .../net/http/otelhttp/start_time_context.go | 29 - .../net/http/otelhttp/transport.go | 265 - .../net/http/otelhttp/version.go | 10 - .../go.opentelemetry.io/otel/.clomonitor.yml | 3 - .../go.opentelemetry.io/otel/.codespellignore | 11 - vendor/go.opentelemetry.io/otel/.codespellrc | 10 - .../go.opentelemetry.io/otel/.gitattributes | 3 - vendor/go.opentelemetry.io/otel/.gitignore | 15 - vendor/go.opentelemetry.io/otel/.golangci.yml | 267 - vendor/go.opentelemetry.io/otel/.lycheeignore | 13 - .../otel/.markdownlint.yaml | 29 - vendor/go.opentelemetry.io/otel/CHANGELOG.md | 3651 - vendor/go.opentelemetry.io/otel/CODEOWNERS | 17 - .../go.opentelemetry.io/otel/CONTRIBUTING.md | 1157 - vendor/go.opentelemetry.io/otel/Makefile | 327 - vendor/go.opentelemetry.io/otel/README.md | 115 - vendor/go.opentelemetry.io/otel/RELEASING.md | 181 - .../otel/SECURITY-INSIGHTS.yml | 203 - vendor/go.opentelemetry.io/otel/VERSIONING.md | 224 - .../otel/baggage/README.md | 3 - .../otel/baggage/baggage.go | 1018 - .../otel/baggage/context.go | 28 - .../go.opentelemetry.io/otel/baggage/doc.go | 9 - .../otel/dependencies.Dockerfile | 4 - vendor/go.opentelemetry.io/otel/doc.go | 25 - .../go.opentelemetry.io/otel/error_handler.go | 27 - .../otel/exporters/otlp/otlptrace/LICENSE | 201 - .../otel/exporters/otlp/otlptrace/README.md | 3 - .../otel/exporters/otlp/otlptrace/clients.go | 43 - .../otel/exporters/otlp/otlptrace/doc.go | 10 - .../otel/exporters/otlp/otlptrace/exporter.go | 105 - .../internal/tracetransform/attribute.go | 147 - .../tracetransform/instrumentation.go | 20 - .../internal/tracetransform/resource.go | 17 - .../otlptrace/internal/tracetransform/span.go | 219 - .../otlp/otlptrace/otlptracegrpc/LICENSE | 201 - .../otlp/otlptrace/otlptracegrpc/README.md | 3 - .../otlp/otlptrace/otlptracegrpc/client.go | 300 - .../otlp/otlptrace/otlptracegrpc/doc.go | 65 - .../otlp/otlptrace/otlptracegrpc/exporter.go | 20 - .../internal/envconfig/envconfig.go | 215 - .../otlptrace/otlptracegrpc/internal/gen.go | 24 - .../internal/otlpconfig/envconfig.go | 142 - .../internal/otlpconfig/options.go | 351 - .../internal/otlpconfig/optiontypes.go | 40 - .../otlptracegrpc/internal/otlpconfig/tls.go | 26 - .../otlptracegrpc/internal/partialsuccess.go | 56 - .../otlptracegrpc/internal/retry/retry.go | 145 - .../otlp/otlptrace/otlptracegrpc/options.go | 210 - .../otel/exporters/otlp/otlptrace/version.go | 9 - vendor/go.opentelemetry.io/otel/handler.go | 33 - .../otel/internal/baggage/baggage.go | 32 - .../otel/internal/baggage/context.go | 81 - .../otel/internal/global/handler.go | 37 - .../otel/internal/global/instruments.go | 468 - .../otel/internal/global/internal_logging.go | 62 - .../otel/internal/global/meter.go | 625 - .../otel/internal/global/propagator.go | 71 - .../otel/internal/global/state.go | 199 - .../otel/internal/global/trace.go | 232 - .../otel/internal_logging.go | 15 - vendor/go.opentelemetry.io/otel/metric.go | 42 - .../go.opentelemetry.io/otel/metric/LICENSE | 231 - .../go.opentelemetry.io/otel/metric/README.md | 3 - .../otel/metric/asyncfloat64.go | 270 - .../otel/metric/asyncint64.go | 266 - .../go.opentelemetry.io/otel/metric/config.go | 111 - vendor/go.opentelemetry.io/otel/metric/doc.go | 177 - .../otel/metric/embedded/README.md | 3 - .../otel/metric/embedded/embedded.go | 243 - .../otel/metric/instrument.go | 376 - .../go.opentelemetry.io/otel/metric/meter.go | 288 - .../otel/metric/noop/README.md | 3 - .../otel/metric/noop/noop.go | 320 - .../otel/metric/syncfloat64.go | 250 - .../otel/metric/syncint64.go | 250 - .../go.opentelemetry.io/otel/propagation.go | 20 - .../otel/propagation/README.md | 3 - .../otel/propagation/baggage.go | 77 - .../otel/propagation/doc.go | 13 - .../otel/propagation/propagation.go | 168 - .../otel/propagation/trace_context.go | 156 - vendor/go.opentelemetry.io/otel/renovate.json | 35 - .../go.opentelemetry.io/otel/requirements.txt | 1 - vendor/go.opentelemetry.io/otel/sdk/LICENSE | 231 - vendor/go.opentelemetry.io/otel/sdk/README.md | 3 - .../otel/sdk/instrumentation/README.md | 3 - .../otel/sdk/instrumentation/doc.go | 13 - .../otel/sdk/instrumentation/library.go | 9 - .../otel/sdk/instrumentation/scope.go | 19 - .../otel/sdk/internal/x/README.md | 46 - .../otel/sdk/internal/x/features.go | 39 - .../otel/sdk/internal/x/x.go | 58 - .../otel/sdk/resource/README.md | 3 - .../otel/sdk/resource/auto.go | 92 - .../otel/sdk/resource/builtin.go | 116 - .../otel/sdk/resource/config.go | 195 - .../otel/sdk/resource/container.go | 89 - .../otel/sdk/resource/doc.go | 20 - .../otel/sdk/resource/env.go | 95 - .../otel/sdk/resource/host_id.go | 108 - .../otel/sdk/resource/host_id_bsd.go | 11 - .../otel/sdk/resource/host_id_darwin.go | 8 - .../otel/sdk/resource/host_id_exec.go | 18 - .../otel/sdk/resource/host_id_linux.go | 10 - .../otel/sdk/resource/host_id_readfile.go | 17 - .../otel/sdk/resource/host_id_unsupported.go | 18 - .../otel/sdk/resource/host_id_windows.go | 35 - .../otel/sdk/resource/os.go | 89 - .../otel/sdk/resource/os_release_darwin.go | 92 - .../otel/sdk/resource/os_release_unix.go | 142 - .../otel/sdk/resource/os_unix.go | 78 - .../otel/sdk/resource/os_unsupported.go | 14 - .../otel/sdk/resource/os_windows.go | 89 - .../otel/sdk/resource/process.go | 173 - .../otel/sdk/resource/resource.go | 309 - .../otel/sdk/trace/README.md | 3 - .../otel/sdk/trace/batch_span_processor.go | 445 - .../go.opentelemetry.io/otel/sdk/trace/doc.go | 13 - .../otel/sdk/trace/event.go | 26 - .../otel/sdk/trace/evictedqueue.go | 64 - .../otel/sdk/trace/id_generator.go | 69 - .../otel/sdk/trace/internal/env/env.go | 168 - .../internal/observ/batch_span_processor.go | 119 - .../otel/sdk/trace/internal/observ/doc.go | 6 - .../internal/observ/simple_span_processor.go | 97 - .../otel/sdk/trace/internal/observ/tracer.go | 223 - .../otel/sdk/trace/link.go | 23 - .../otel/sdk/trace/provider.go | 510 - .../otel/sdk/trace/sampler_env.go | 96 - .../otel/sdk/trace/sampling.go | 310 - .../otel/sdk/trace/simple_span_processor.go | 150 - .../otel/sdk/trace/snapshot.go | 133 - .../otel/sdk/trace/span.go | 959 - .../otel/sdk/trace/span_exporter.go | 36 - .../otel/sdk/trace/span_limits.go | 114 - .../otel/sdk/trace/span_processor.go | 61 - .../otel/sdk/trace/tracer.go | 188 - .../go.opentelemetry.io/otel/sdk/version.go | 10 - .../otel/semconv/v1.17.0/README.md | 3 - .../otel/semconv/v1.17.0/doc.go | 9 - .../otel/semconv/v1.17.0/event.go | 188 - .../otel/semconv/v1.17.0/exception.go | 9 - .../otel/semconv/v1.17.0/http.go | 10 - .../otel/semconv/v1.17.0/resource.go | 1999 - .../otel/semconv/v1.17.0/schema.go | 9 - .../otel/semconv/v1.17.0/trace.go | 3364 - .../otel/semconv/v1.20.0/README.md | 3 - .../otel/semconv/v1.20.0/attribute_group.go | 1198 - .../otel/semconv/v1.20.0/doc.go | 9 - .../otel/semconv/v1.20.0/event.go | 188 - .../otel/semconv/v1.20.0/exception.go | 9 - .../otel/semconv/v1.20.0/http.go | 10 - .../otel/semconv/v1.20.0/resource.go | 2060 - .../otel/semconv/v1.20.0/schema.go | 9 - .../otel/semconv/v1.20.0/trace.go | 2599 - .../otel/semconv/v1.26.0/README.md | 3 - .../otel/semconv/v1.26.0/attribute_group.go | 8996 - .../otel/semconv/v1.26.0/doc.go | 9 - .../otel/semconv/v1.26.0/exception.go | 9 - .../otel/semconv/v1.26.0/metric.go | 1307 - .../otel/semconv/v1.26.0/schema.go | 9 - .../otel/semconv/v1.37.0/MIGRATION.md | 41 - .../otel/semconv/v1.37.0/README.md | 3 - .../otel/semconv/v1.37.0/attribute_group.go | 15193 -- .../otel/semconv/v1.37.0/doc.go | 9 - .../otel/semconv/v1.37.0/error_type.go | 56 - .../otel/semconv/v1.37.0/exception.go | 9 - .../otel/semconv/v1.37.0/schema.go | 9 - .../otel/semconv/v1.39.0/otelconv/metric.go | 2222 - vendor/go.opentelemetry.io/otel/trace.go | 36 - .../otel/trace/noop/README.md | 3 - .../otel/trace/noop/noop.go | 112 - .../otel/verify_released_changelog.sh | 42 - vendor/go.opentelemetry.io/otel/version.go | 9 - vendor/go.opentelemetry.io/otel/versions.yaml | 66 - vendor/go.opentelemetry.io/proto/otlp/LICENSE | 201 - .../collector/trace/v1/trace_service.pb.go | 367 - .../collector/trace/v1/trace_service.pb.gw.go | 171 - .../trace/v1/trace_service_grpc.pb.go | 109 - .../proto/otlp/common/v1/common.pb.go | 630 - .../proto/otlp/resource/v1/resource.pb.go | 193 - .../proto/otlp/trace/v1/trace.pb.go | 1283 - vendor/golang.org/x/crypto/LICENSE | 27 - vendor/golang.org/x/crypto/PATENTS | 22 - vendor/golang.org/x/crypto/blowfish/block.go | 159 - vendor/golang.org/x/crypto/blowfish/cipher.go | 99 - vendor/golang.org/x/crypto/blowfish/const.go | 199 - .../x/crypto/chacha20/chacha_arm64.go | 16 - .../x/crypto/chacha20/chacha_arm64.s | 307 - .../x/crypto/chacha20/chacha_generic.go | 398 - .../x/crypto/chacha20/chacha_noasm.go | 13 - .../x/crypto/chacha20/chacha_ppc64x.go | 16 - .../x/crypto/chacha20/chacha_ppc64x.s | 501 - .../x/crypto/chacha20/chacha_s390x.go | 27 - .../x/crypto/chacha20/chacha_s390x.s | 224 - vendor/golang.org/x/crypto/chacha20/xor.go | 42 - .../x/crypto/curve25519/curve25519.go | 93 - .../x/crypto/internal/alias/alias.go | 31 - .../x/crypto/internal/alias/alias_purego.go | 34 - .../x/crypto/internal/poly1305/mac_noasm.go | 9 - .../x/crypto/internal/poly1305/poly1305.go | 99 - .../x/crypto/internal/poly1305/sum_amd64.s | 93 - .../x/crypto/internal/poly1305/sum_asm.go | 47 - .../x/crypto/internal/poly1305/sum_generic.go | 312 - .../x/crypto/internal/poly1305/sum_loong64.s | 123 - .../x/crypto/internal/poly1305/sum_ppc64x.s | 187 - .../x/crypto/internal/poly1305/sum_s390x.go | 76 - .../x/crypto/internal/poly1305/sum_s390x.s | 503 - vendor/golang.org/x/crypto/ssh/buffer.go | 97 - vendor/golang.org/x/crypto/ssh/certs.go | 624 - vendor/golang.org/x/crypto/ssh/channel.go | 645 - vendor/golang.org/x/crypto/ssh/cipher.go | 789 - vendor/golang.org/x/crypto/ssh/client.go | 283 - vendor/golang.org/x/crypto/ssh/client_auth.go | 788 - vendor/golang.org/x/crypto/ssh/common.go | 727 - vendor/golang.org/x/crypto/ssh/connection.go | 155 - vendor/golang.org/x/crypto/ssh/doc.go | 34 - vendor/golang.org/x/crypto/ssh/handshake.go | 847 - .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 93 - vendor/golang.org/x/crypto/ssh/kex.go | 807 - vendor/golang.org/x/crypto/ssh/keys.go | 1823 - vendor/golang.org/x/crypto/ssh/mac.go | 84 - vendor/golang.org/x/crypto/ssh/messages.go | 893 - vendor/golang.org/x/crypto/ssh/mlkem.go | 168 - vendor/golang.org/x/crypto/ssh/mux.go | 357 - vendor/golang.org/x/crypto/ssh/server.go | 955 - vendor/golang.org/x/crypto/ssh/session.go | 647 - vendor/golang.org/x/crypto/ssh/ssh_gss.go | 145 - vendor/golang.org/x/crypto/ssh/streamlocal.go | 116 - vendor/golang.org/x/crypto/ssh/tcpip.go | 545 - vendor/golang.org/x/crypto/ssh/transport.go | 377 - vendor/golang.org/x/exp/LICENSE | 27 - vendor/golang.org/x/exp/PATENTS | 22 - .../x/exp/constraints/constraints.go | 50 - vendor/golang.org/x/exp/slices/cmp.go | 44 - vendor/golang.org/x/exp/slices/slices.go | 515 - vendor/golang.org/x/exp/slices/sort.go | 197 - .../golang.org/x/exp/slices/zsortanyfunc.go | 479 - .../golang.org/x/exp/slices/zsortordered.go | 481 - vendor/golang.org/x/mod/modfile/print.go | 2 +- vendor/golang.org/x/mod/modfile/read.go | 2 +- vendor/golang.org/x/mod/modfile/rule.go | 8 +- vendor/golang.org/x/mod/module/module.go | 4 +- vendor/golang.org/x/net/html/node.go | 1 + .../golang.org/x/net/html/nodetype_string.go | 31 + .../x/net/http2/client_priority_go126.go | 20 + .../x/net/http2/client_priority_go127.go | 13 + vendor/golang.org/x/net/http2/frame.go | 184 +- vendor/golang.org/x/net/http2/http2.go | 2 + vendor/golang.org/x/net/http2/server.go | 86 +- vendor/golang.org/x/net/http2/transport.go | 7 +- .../net/http2/writesched_priority_rfc7540.go | 4 + .../net/http2/writesched_priority_rfc9218.go | 15 + .../x/net/internal/httpsfv/httpsfv.go | 665 + .../golang.org/x/net/internal/socks/client.go | 168 - .../golang.org/x/net/internal/socks/socks.go | 317 - .../x/net/internal/timeseries/timeseries.go | 525 - vendor/golang.org/x/net/proxy/dial.go | 54 - vendor/golang.org/x/net/proxy/direct.go | 31 - vendor/golang.org/x/net/proxy/per_host.go | 153 - vendor/golang.org/x/net/proxy/proxy.go | 149 - vendor/golang.org/x/net/proxy/socks5.go | 42 - vendor/golang.org/x/net/trace/events.go | 532 - vendor/golang.org/x/net/trace/histogram.go | 365 - vendor/golang.org/x/net/trace/trace.go | 1130 - vendor/golang.org/x/net/websocket/client.go | 139 - vendor/golang.org/x/net/websocket/dial.go | 29 - vendor/golang.org/x/net/websocket/hybi.go | 582 - vendor/golang.org/x/net/websocket/server.go | 113 - .../golang.org/x/net/websocket/websocket.go | 449 - .../x/sync/singleflight/singleflight.go | 214 - vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 17 - .../golang.org/x/sys/cpu/asm_darwin_x86_gc.s | 17 - vendor/golang.org/x/sys/cpu/byteorder.go | 66 - vendor/golang.org/x/sys/cpu/cpu.go | 338 - vendor/golang.org/x/sys/cpu/cpu_aix.go | 33 - vendor/golang.org/x/sys/cpu/cpu_arm.go | 73 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 194 - vendor/golang.org/x/sys/cpu/cpu_arm64.s | 35 - vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go | 61 - vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 12 - vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 21 - vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 15 - vendor/golang.org/x/sys/cpu/cpu_gc_x86.s | 26 - .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 11 - .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 22 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c | 37 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 25 - vendor/golang.org/x/sys/cpu/cpu_linux.go | 15 - vendor/golang.org/x/sys/cpu/cpu_linux_arm.go | 39 - .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 120 - .../golang.org/x/sys/cpu/cpu_linux_loong64.go | 22 - .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 22 - .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 9 - .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 30 - .../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 160 - .../golang.org/x/sys/cpu/cpu_linux_s390x.go | 40 - vendor/golang.org/x/sys/cpu/cpu_loong64.go | 50 - vendor/golang.org/x/sys/cpu/cpu_loong64.s | 13 - vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 15 - vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 11 - .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 173 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 - vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 9 - .../golang.org/x/sys/cpu/cpu_other_arm64.go | 9 - .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 11 - .../golang.org/x/sys/cpu/cpu_other_ppc64x.go | 12 - .../golang.org/x/sys/cpu/cpu_other_riscv64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_other_x86.go | 11 - vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 16 - vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 32 - vendor/golang.org/x/sys/cpu/cpu_s390x.go | 172 - vendor/golang.org/x/sys/cpu/cpu_s390x.s | 57 - vendor/golang.org/x/sys/cpu/cpu_wasm.go | 17 - vendor/golang.org/x/sys/cpu/cpu_x86.go | 236 - vendor/golang.org/x/sys/cpu/cpu_zos.go | 10 - vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go | 25 - vendor/golang.org/x/sys/cpu/endian_big.go | 10 - vendor/golang.org/x/sys/cpu/endian_little.go | 10 - vendor/golang.org/x/sys/cpu/hwcap_linux.go | 71 - vendor/golang.org/x/sys/cpu/parse.go | 43 - .../x/sys/cpu/proc_cpuinfo_linux.go | 53 - vendor/golang.org/x/sys/cpu/runtime_auxv.go | 16 - .../x/sys/cpu/runtime_auxv_go121.go | 18 - .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 26 - .../x/sys/cpu/syscall_aix_ppc64_gc.go | 35 - .../x/sys/cpu/syscall_darwin_x86_gc.go | 98 - vendor/golang.org/x/sys/unix/ioctl_signed.go | 11 +- .../golang.org/x/sys/unix/ioctl_unsigned.go | 11 +- .../golang.org/x/sys/unix/syscall_solaris.go | 8 - vendor/golang.org/x/sys/unix/syscall_unix.go | 10 +- .../golang.org/x/sys/windows/registry/key.go | 214 - .../x/sys/windows/registry/mksyscall.go | 9 - .../x/sys/windows/registry/syscall.go | 32 - .../x/sys/windows/registry/value.go | 390 - .../sys/windows/registry/zsyscall_windows.go | 117 - .../x/sys/windows/syscall_windows.go | 1 + .../golang.org/x/sys/windows/types_windows.go | 85 + .../x/sys/windows/zsyscall_windows.go | 7 + vendor/golang.org/x/term/terminal.go | 28 +- .../golang.org/x/text/cases/tables10.0.0.go | 2255 - .../golang.org/x/text/cases/tables11.0.0.go | 2316 - .../golang.org/x/text/cases/tables12.0.0.go | 2359 - .../golang.org/x/text/cases/tables15.0.0.go | 2 +- .../{tables13.0.0.go => tables17.0.0.go} | 1473 +- vendor/golang.org/x/text/cases/tables9.0.0.go | 2215 - .../x/text/feature/plural/common.go | 70 - .../x/text/feature/plural/message.go | 244 - .../x/text/feature/plural/plural.go | 262 - .../x/text/feature/plural/tables.go | 552 - .../x/text/internal/catmsg/catmsg.go | 417 - .../x/text/internal/catmsg/codec.go | 407 - .../x/text/internal/catmsg/varint.go | 62 - .../x/text/internal/format/format.go | 41 - .../x/text/internal/format/parser.go | 358 - .../x/text/internal/number/common.go | 55 - .../x/text/internal/number/decimal.go | 500 - .../x/text/internal/number/format.go | 533 - .../x/text/internal/number/number.go | 152 - .../x/text/internal/number/pattern.go | 485 - .../internal/number/roundingmode_string.go | 30 - .../x/text/internal/number/tables.go | 1219 - .../x/text/internal/stringset/set.go | 86 - vendor/golang.org/x/text/message/catalog.go | 36 - .../x/text/message/catalog/catalog.go | 365 - .../golang.org/x/text/message/catalog/dict.go | 129 - .../golang.org/x/text/message/catalog/go19.go | 15 - .../x/text/message/catalog/gopre19.go | 23 - vendor/golang.org/x/text/message/doc.go | 99 - vendor/golang.org/x/text/message/format.go | 510 - vendor/golang.org/x/text/message/message.go | 192 - vendor/golang.org/x/text/message/print.go | 984 - .../x/text/secure/bidirule/bidirule.go | 4 + .../x/text/secure/bidirule/bidirule10.0.0.go | 11 - .../x/text/secure/bidirule/bidirule9.0.0.go | 14 - .../x/text/unicode/bidi/tables10.0.0.go | 1815 - .../x/text/unicode/bidi/tables11.0.0.go | 1887 - .../x/text/unicode/bidi/tables12.0.0.go | 1923 - .../x/text/unicode/bidi/tables13.0.0.go | 1955 - .../x/text/unicode/bidi/tables15.0.0.go | 2 +- .../x/text/unicode/bidi/tables17.0.0.go | 2135 + .../x/text/unicode/bidi/tables9.0.0.go | 1781 - .../x/text/unicode/norm/forminfo.go | 26 +- .../x/text/unicode/norm/tables10.0.0.go | 7657 - .../x/text/unicode/norm/tables11.0.0.go | 7693 - .../x/text/unicode/norm/tables12.0.0.go | 7710 - .../x/text/unicode/norm/tables15.0.0.go | 2820 +- .../norm/{tables13.0.0.go => tables17.0.0.go} | 6716 +- .../x/text/unicode/norm/tables9.0.0.go | 7637 - .../x/tools/go/ast/astutil/imports.go | 19 +- .../x/tools/go/ast/inspector/cursor.go | 44 +- .../x/tools/go/ast/inspector/inspector.go | 4 +- .../x/tools/go/ast/inspector/iter.go | 36 +- .../x/tools/go/packages/packages.go | 56 +- .../x/tools/go/types/objectpath/objectpath.go | 16 +- .../x/tools/go/types/typeutil/callee.go | 1 + .../x/tools/internal/aliases/aliases.go | 30 +- .../x/tools/internal/aliases/aliases_go122.go | 80 - .../x/tools/internal/event/core/event.go | 23 +- .../x/tools/internal/event/core/export.go | 15 +- .../x/tools/internal/event/keys/keys.go | 439 +- .../x/tools/internal/event/label/label.go | 23 +- .../x/tools/internal/gcimporter/iexport.go | 11 +- .../x/tools/internal/gcimporter/iimport.go | 4 +- .../tools/internal/gcimporter/ureader_yes.go | 4 +- .../x/tools/internal/imports/sortimports.go | 23 +- .../x/tools/internal/modindex/index.go | 11 +- .../x/tools/internal/modindex/lookup.go | 8 +- .../x/tools/internal/stdlib/deps.go | 630 +- .../x/tools/internal/stdlib/manifest.go | 615 +- .../x/tools/internal/stdlib/stdlib.go | 2 +- .../x/tools/internal/typeparams/free.go | 4 +- .../internal/typesinternal/classify_call.go | 2 +- .../x/tools/internal/typesinternal/types.go | 7 +- .../x/tools/internal/versions/features.go | 1 + .../api/expr/v1alpha1/checked.pb.go | 1664 - .../googleapis/api/expr/v1alpha1/eval.pb.go | 580 - .../api/expr/v1alpha1/explain.pb.go | 275 - .../googleapis/api/expr/v1alpha1/syntax.pb.go | 2040 - .../googleapis/api/expr/v1alpha1/value.pb.go | 721 - .../googleapis/api/httpbody/httpbody.pb.go | 235 - .../rpc/errdetails/error_details.pb.go | 1473 - .../googleapis/rpc/status/status.pb.go | 203 - vendor/google.golang.org/grpc/AUTHORS | 1 - .../google.golang.org/grpc/CODE-OF-CONDUCT.md | 3 - vendor/google.golang.org/grpc/CONTRIBUTING.md | 159 - vendor/google.golang.org/grpc/GOVERNANCE.md | 1 - vendor/google.golang.org/grpc/MAINTAINERS.md | 36 - vendor/google.golang.org/grpc/Makefile | 49 - vendor/google.golang.org/grpc/NOTICE.txt | 13 - vendor/google.golang.org/grpc/README.md | 108 - vendor/google.golang.org/grpc/SECURITY.md | 3 - .../grpc/attributes/attributes.go | 141 - vendor/google.golang.org/grpc/backoff.go | 61 - .../google.golang.org/grpc/backoff/backoff.go | 52 - .../grpc/balancer/balancer.go | 392 - .../grpc/balancer/base/balancer.go | 262 - .../grpc/balancer/base/base.go | 71 - .../grpc/balancer/conn_state_evaluator.go | 74 - .../endpointsharding/endpointsharding.go | 389 - .../grpc/balancer/grpclb/state/state.go | 51 - .../balancer/pickfirst/internal/internal.go | 37 - .../grpc/balancer/pickfirst/pickfirst.go | 961 - .../grpc/balancer/roundrobin/roundrobin.go | 72 - .../grpc/balancer/subconn.go | 120 - .../grpc/balancer_wrapper.go | 517 - .../grpc_binarylog_v1/binarylog.pb.go | 1004 - vendor/google.golang.org/grpc/call.go | 74 - .../grpc/channelz/channelz.go | 36 - vendor/google.golang.org/grpc/clientconn.go | 1951 - vendor/google.golang.org/grpc/codec.go | 105 - .../grpc/codes/code_string.go | 111 - vendor/google.golang.org/grpc/codes/codes.go | 250 - .../grpc/connectivity/connectivity.go | 94 - .../grpc/credentials/credentials.go | 337 - .../grpc/credentials/insecure/insecure.go | 104 - .../google.golang.org/grpc/credentials/tls.go | 324 - vendor/google.golang.org/grpc/dialoptions.go | 797 - vendor/google.golang.org/grpc/doc.go | 26 - .../grpc/encoding/encoding.go | 147 - .../grpc/encoding/encoding_v2.go | 81 - .../grpc/encoding/gzip/gzip.go | 120 - .../grpc/encoding/internal/internal.go | 28 - .../grpc/encoding/proto/proto.go | 112 - .../grpc/experimental/stats/metricregistry.go | 342 - .../grpc/experimental/stats/metrics.go | 131 - .../grpc/grpclog/component.go | 115 - .../google.golang.org/grpc/grpclog/grpclog.go | 186 - .../grpc/grpclog/internal/grpclog.go | 26 - .../grpc/grpclog/internal/logger.go | 87 - .../grpc/grpclog/internal/loggerv2.go | 267 - .../google.golang.org/grpc/grpclog/logger.go | 34 - .../grpc/grpclog/loggerv2.go | 97 - .../grpc/health/grpc_health_v1/health.pb.go | 350 - .../health/grpc_health_v1/health_grpc.pb.go | 290 - vendor/google.golang.org/grpc/interceptor.go | 108 - .../grpc/internal/backoff/backoff.go | 109 - .../balancer/gracefulswitch/config.go | 84 - .../balancer/gracefulswitch/gracefulswitch.go | 421 - .../grpc/internal/balancer/weight/weight.go | 66 - .../grpc/internal/balancerload/load.go | 46 - .../grpc/internal/binarylog/binarylog.go | 192 - .../internal/binarylog/binarylog_testutil.go | 42 - .../grpc/internal/binarylog/env_config.go | 208 - .../grpc/internal/binarylog/method_logger.go | 446 - .../grpc/internal/binarylog/sink.go | 170 - .../grpc/internal/buffer/unbounded.go | 117 - .../grpc/internal/channelz/channel.go | 270 - .../grpc/internal/channelz/channelmap.go | 395 - .../grpc/internal/channelz/funcs.go | 230 - .../grpc/internal/channelz/logging.go | 75 - .../grpc/internal/channelz/server.go | 121 - .../grpc/internal/channelz/socket.go | 137 - .../grpc/internal/channelz/subchannel.go | 153 - .../grpc/internal/channelz/syscall_linux.go | 65 - .../internal/channelz/syscall_nonlinux.go | 47 - .../grpc/internal/channelz/trace.go | 213 - .../grpc/internal/credentials/credentials.go | 35 - .../grpc/internal/credentials/spiffe.go | 75 - .../grpc/internal/credentials/syscallconn.go | 58 - .../grpc/internal/credentials/util.go | 52 - .../grpc/internal/envconfig/envconfig.go | 130 - .../grpc/internal/envconfig/observability.go | 42 - .../grpc/internal/envconfig/xds.go | 82 - .../grpc/internal/experimental.go | 35 - .../grpc/internal/grpclog/prefix_logger.go | 79 - .../internal/grpcsync/callback_serializer.go | 98 - .../grpc/internal/grpcsync/event.go | 58 - .../grpc/internal/grpcsync/pubsub.go | 121 - .../grpc/internal/grpcutil/compressor.go | 42 - .../grpc/internal/grpcutil/encode_duration.go | 63 - .../grpc/internal/grpcutil/grpcutil.go | 20 - .../grpc/internal/grpcutil/metadata.go | 40 - .../grpc/internal/grpcutil/method.go | 88 - .../grpc/internal/grpcutil/regex.go | 31 - .../grpc/internal/idle/idle.go | 289 - .../grpc/internal/internal.go | 300 - .../grpc/internal/metadata/metadata.go | 144 - .../grpc/internal/pretty/pretty.go | 73 - .../proxyattributes/proxyattributes.go | 54 - .../grpc/internal/resolver/config_selector.go | 167 - .../delegatingresolver/delegatingresolver.go | 477 - .../internal/resolver/dns/dns_resolver.go | 472 - .../resolver/dns/internal/internal.go | 77 - .../resolver/passthrough/passthrough.go | 64 - .../grpc/internal/resolver/unix/unix.go | 78 - .../grpc/internal/serviceconfig/duration.go | 130 - .../internal/serviceconfig/serviceconfig.go | 180 - .../grpc/internal/stats/labels.go | 42 - .../internal/stats/metrics_recorder_list.go | 175 - .../grpc/internal/stats/stats.go | 70 - .../grpc/internal/status/status.go | 246 - .../grpc/internal/syscall/syscall_linux.go | 112 - .../grpc/internal/syscall/syscall_nonlinux.go | 77 - .../grpc/internal/tcp_keepalive_others.go | 29 - .../grpc/internal/tcp_keepalive_unix.go | 54 - .../grpc/internal/tcp_keepalive_windows.go | 54 - .../grpc/internal/transport/bdp_estimator.go | 141 - .../grpc/internal/transport/client_stream.go | 156 - .../grpc/internal/transport/controlbuf.go | 1057 - .../grpc/internal/transport/defaults.go | 55 - .../grpc/internal/transport/flowcontrol.go | 213 - .../grpc/internal/transport/handler_server.go | 506 - .../grpc/internal/transport/http2_client.go | 1847 - .../grpc/internal/transport/http2_server.go | 1498 - .../grpc/internal/transport/http_util.go | 624 - .../grpc/internal/transport/logging.go | 40 - .../transport/networktype/networktype.go | 46 - .../grpc/internal/transport/proxy.go | 116 - .../grpc/internal/transport/server_stream.go | 189 - .../grpc/internal/transport/transport.go | 754 - .../grpc/keepalive/keepalive.go | 99 - .../google.golang.org/grpc/mem/buffer_pool.go | 205 - .../grpc/mem/buffer_slice.go | 345 - vendor/google.golang.org/grpc/mem/buffers.go | 277 - .../grpc/metadata/metadata.go | 295 - vendor/google.golang.org/grpc/peer/peer.go | 83 - .../google.golang.org/grpc/picker_wrapper.go | 219 - vendor/google.golang.org/grpc/preloader.go | 82 - .../grpc/resolver/dns/dns_resolver.go | 60 - vendor/google.golang.org/grpc/resolver/map.go | 247 - .../grpc/resolver/resolver.go | 359 - .../grpc/resolver_wrapper.go | 222 - vendor/google.golang.org/grpc/rpc_util.go | 1167 - vendor/google.golang.org/grpc/server.go | 2258 - .../google.golang.org/grpc/service_config.go | 360 - .../grpc/serviceconfig/serviceconfig.go | 44 - .../google.golang.org/grpc/stats/handlers.go | 72 - .../google.golang.org/grpc/stats/metrics.go | 81 - vendor/google.golang.org/grpc/stats/stats.go | 318 - .../google.golang.org/grpc/status/status.go | 162 - vendor/google.golang.org/grpc/stream.go | 1903 - .../grpc/stream_interfaces.go | 238 - vendor/google.golang.org/grpc/tap/tap.go | 62 - vendor/google.golang.org/grpc/trace.go | 143 - .../google.golang.org/grpc/trace_notrace.go | 52 - .../google.golang.org/grpc/trace_withtrace.go | 39 - vendor/google.golang.org/grpc/version.go | 22 - .../protobuf/encoding/protojson/decode.go | 680 - .../protobuf/encoding/protojson/doc.go | 11 - .../protobuf/encoding/protojson/encode.go | 380 - .../encoding/protojson/well_known_types.go | 880 - .../internal/editionssupport/editions.go | 18 - .../protobuf/internal/encoding/json/decode.go | 340 - .../internal/encoding/json/decode_number.go | 254 - .../internal/encoding/json/decode_string.go | 91 - .../internal/encoding/json/decode_token.go | 192 - .../protobuf/internal/encoding/json/encode.go | 278 - .../protobuf/protoadapt/convert.go | 31 - .../protobuf/reflect/protodesc/desc.go | 308 - .../protobuf/reflect/protodesc/desc_init.go | 290 - .../reflect/protodesc/desc_resolve.go | 291 - .../reflect/protodesc/desc_validate.go | 359 - .../protobuf/reflect/protodesc/editions.go | 181 - .../protobuf/reflect/protodesc/proto.go | 298 - .../protobuf/types/dynamicpb/dynamic.go | 718 - .../protobuf/types/dynamicpb/types.go | 180 - .../types/gofeaturespb/go_features.pb.go | 311 - .../types/known/durationpb/duration.pb.go | 346 - .../protobuf/types/known/emptypb/empty.pb.go | 142 - .../types/known/fieldmaskpb/field_mask.pb.go | 560 - .../types/known/structpb/struct.pb.go | 767 - .../types/known/wrapperspb/wrappers.pb.go | 648 - .../pkg/features/OWNERS | 4 - .../pkg/features/kube_features.go | 79 - .../pkg/api/validation/path/name.go | 68 - .../apimachinery/pkg/util/httpstream/doc.go | 19 - .../pkg/util/httpstream/httpstream.go | 201 - .../pkg/util/httpstream/spdy/connection.go | 204 - .../pkg/util/httpstream/spdy/roundtripper.go | 399 - .../pkg/util/httpstream/spdy/upgrade.go | 120 - .../pkg/util/httpstream/wsstream/conn.go | 452 - .../pkg/util/httpstream/wsstream/doc.go | 69 - .../pkg/util/httpstream/wsstream/stream.go | 177 - .../pkg/util/portforward/constants.go | 24 - .../apimachinery/pkg/util/proxy/dial.go | 122 - .../k8s.io/apimachinery/pkg/util/proxy/doc.go | 18 - .../apimachinery/pkg/util/proxy/transport.go | 272 - .../pkg/util/proxy/upgradeaware.go | 558 - .../pkg/util/remotecommand/constants.go | 67 - .../third_party/forked/golang/netutil/addr.go | 28 - .../apiserver/pkg/admission/attributes.go | 211 - .../k8s.io/apiserver/pkg/admission/audit.go | 102 - .../k8s.io/apiserver/pkg/admission/chain.go | 70 - .../k8s.io/apiserver/pkg/admission/config.go | 174 - .../configuration/configuration_manager.go | 166 - .../configuration/mutating_webhook_manager.go | 157 - .../validating_webhook_manager.go | 155 - .../apiserver/pkg/admission/conversion.go | 136 - .../apiserver/pkg/admission/decorator.go | 39 - .../k8s.io/apiserver/pkg/admission/errors.go | 72 - .../k8s.io/apiserver/pkg/admission/handler.go | 79 - .../pkg/admission/initializer/initializer.go | 102 - .../pkg/admission/initializer/interfaces.go | 106 - .../apiserver/pkg/admission/interfaces.go | 172 - .../pkg/admission/metrics/metrics.go | 361 - .../apiserver/pkg/admission/plugin/cel/OWNERS | 10 - .../pkg/admission/plugin/cel/activation.go | 190 - .../pkg/admission/plugin/cel/compile.go | 301 - .../pkg/admission/plugin/cel/composition.go | 276 - .../pkg/admission/plugin/cel/condition.go | 216 - .../pkg/admission/plugin/cel/interface.go | 120 - .../pkg/admission/plugin/cel/mutation.go | 73 - .../pkg/admission/plugin/webhook/accessors.go | 376 - .../config/apis/webhookadmission/doc.go | 19 - .../config/apis/webhookadmission/register.go | 53 - .../config/apis/webhookadmission/types.go | 29 - .../config/apis/webhookadmission/v1/doc.go | 23 - .../apis/webhookadmission/v1/register.go | 50 - .../config/apis/webhookadmission/v1/types.go | 29 - .../v1/zz_generated.conversion.go | 68 - .../v1/zz_generated.deepcopy.go | 51 - .../v1/zz_generated.defaults.go | 33 - .../apis/webhookadmission/v1alpha1/doc.go | 23 - .../webhookadmission/v1alpha1/register.go | 50 - .../apis/webhookadmission/v1alpha1/types.go | 29 - .../v1alpha1/zz_generated.conversion.go | 68 - .../v1alpha1/zz_generated.deepcopy.go | 51 - .../v1alpha1/zz_generated.defaults.go | 33 - .../webhookadmission/zz_generated.deepcopy.go | 51 - .../plugin/webhook/config/kubeconfig.go | 70 - .../admission/plugin/webhook/errors/doc.go | 18 - .../plugin/webhook/errors/statuserror.go | 63 - .../plugin/webhook/generic/interfaces.go | 53 - .../plugin/webhook/generic/webhook.go | 262 - .../webhook/matchconditions/interface.go | 37 - .../plugin/webhook/matchconditions/matcher.go | 144 - .../plugin/webhook/mutating/dispatcher.go | 496 - .../admission/plugin/webhook/mutating/doc.go | 19 - .../plugin/webhook/mutating/plugin.go | 76 - .../webhook/mutating/reinvocationcontext.go | 68 - .../webhook/predicates/namespace/doc.go | 20 - .../webhook/predicates/namespace/matcher.go | 136 - .../plugin/webhook/predicates/object/doc.go | 20 - .../webhook/predicates/object/matcher.go | 61 - .../plugin/webhook/predicates/rules/rules.go | 129 - .../plugin/webhook/request/admissionreview.go | 284 - .../admission/plugin/webhook/request/doc.go | 18 - .../k8s.io/apiserver/pkg/admission/plugins.go | 207 - .../apiserver/pkg/admission/reinvocation.go | 64 - vendor/k8s.io/apiserver/pkg/admission/util.go | 47 - .../apiserver/pkg/apis/apiserver/doc.go | 21 - .../pkg/apis/apiserver/install/install.go | 43 - .../apiserver/pkg/apis/apiserver/register.go | 53 - .../apiserver/pkg/apis/apiserver/types.go | 432 - .../pkg/apis/apiserver/types_encryption.go | 149 - .../pkg/apis/apiserver/v1/defaults.go | 66 - .../apiserver/pkg/apis/apiserver/v1/doc.go | 23 - .../pkg/apis/apiserver/v1/register.go | 59 - .../apiserver/pkg/apis/apiserver/v1/types.go | 565 - .../pkg/apis/apiserver/v1/types_encryption.go | 149 - .../apiserver/v1/zz_generated.conversion.go | 1031 - .../apiserver/v1/zz_generated.deepcopy.go | 669 - .../apiserver/v1/zz_generated.defaults.go | 56 - .../pkg/apis/apiserver/v1alpha1/conversion.go | 32 - .../pkg/apis/apiserver/v1alpha1/defaults.go | 43 - .../pkg/apis/apiserver/v1alpha1/doc.go | 24 - .../pkg/apis/apiserver/v1alpha1/register.go | 63 - .../pkg/apis/apiserver/v1alpha1/types.go | 664 - .../v1alpha1/zz_generated.conversion.go | 1014 - .../v1alpha1/zz_generated.deepcopy.go | 616 - .../v1alpha1/zz_generated.defaults.go | 43 - .../pkg/apis/apiserver/v1beta1/conversion.go | 32 - .../pkg/apis/apiserver/v1beta1/defaults.go | 43 - .../pkg/apis/apiserver/v1beta1/doc.go | 23 - .../pkg/apis/apiserver/v1beta1/register.go | 61 - .../pkg/apis/apiserver/v1beta1/types.go | 635 - .../v1beta1/zz_generated.conversion.go | 950 - .../v1beta1/zz_generated.deepcopy.go | 563 - .../v1beta1/zz_generated.defaults.go | 43 - .../apis/apiserver/zz_generated.deepcopy.go | 803 - vendor/k8s.io/apiserver/pkg/apis/audit/OWNERS | 8 - vendor/k8s.io/apiserver/pkg/apis/audit/doc.go | 20 - .../apiserver/pkg/apis/audit/helpers.go | 38 - .../apiserver/pkg/apis/audit/register.go | 53 - .../k8s.io/apiserver/pkg/apis/audit/types.go | 323 - .../k8s.io/apiserver/pkg/apis/audit/v1/doc.go | 26 - .../pkg/apis/audit/v1/generated.pb.go | 3124 - .../pkg/apis/audit/v1/generated.proto | 298 - .../audit/v1/generated.protomessage.pb.go | 38 - .../apiserver/pkg/apis/audit/v1/register.go | 58 - .../apiserver/pkg/apis/audit/v1/types.go | 328 - .../apis/audit/v1/zz_generated.conversion.go | 359 - .../apis/audit/v1/zz_generated.deepcopy.go | 318 - .../apis/audit/v1/zz_generated.defaults.go | 33 - .../apis/audit/v1/zz_generated.model_name.go | 62 - .../pkg/apis/audit/zz_generated.deepcopy.go | 318 - .../k8s.io/apiserver/pkg/apis/cel/config.go | 45 - vendor/k8s.io/apiserver/pkg/audit/OWNERS | 8 - vendor/k8s.io/apiserver/pkg/audit/context.go | 421 - .../k8s.io/apiserver/pkg/audit/evaluator.go | 45 - vendor/k8s.io/apiserver/pkg/audit/format.go | 73 - vendor/k8s.io/apiserver/pkg/audit/metrics.go | 111 - vendor/k8s.io/apiserver/pkg/audit/request.go | 297 - vendor/k8s.io/apiserver/pkg/audit/scheme.go | 38 - vendor/k8s.io/apiserver/pkg/audit/types.go | 46 - vendor/k8s.io/apiserver/pkg/audit/union.go | 71 - .../pkg/authentication/serviceaccount/util.go | 184 - .../apiserver/pkg/authentication/user/doc.go | 19 - .../apiserver/pkg/authentication/user/user.go | 88 - .../authorization/authorizer/interfaces.go | 198 - .../pkg/authorization/authorizer/rule.go | 73 - vendor/k8s.io/apiserver/pkg/cel/OWNERS | 11 - vendor/k8s.io/apiserver/pkg/cel/cidr.go | 87 - .../apiserver/pkg/cel/common/adaptor.go | 106 - .../apiserver/pkg/cel/common/equality.go | 334 - .../apiserver/pkg/cel/common/maplist.go | 177 - .../apiserver/pkg/cel/common/schemas.go | 288 - .../apiserver/pkg/cel/common/typeprovider.go | 117 - .../apiserver/pkg/cel/common/valuesreflect.go | 678 - .../pkg/cel/common/valuesunstructured.go | 723 - .../apiserver/pkg/cel/environment/base.go | 279 - .../pkg/cel/environment/environment.go | 298 - vendor/k8s.io/apiserver/pkg/cel/errors.go | 124 - vendor/k8s.io/apiserver/pkg/cel/escaping.go | 170 - vendor/k8s.io/apiserver/pkg/cel/format.go | 73 - vendor/k8s.io/apiserver/pkg/cel/ip.go | 86 - vendor/k8s.io/apiserver/pkg/cel/lazy/lazy.go | 191 - .../k8s.io/apiserver/pkg/cel/library/authz.go | 790 - .../k8s.io/apiserver/pkg/cel/library/cidr.go | 292 - .../k8s.io/apiserver/pkg/cel/library/cost.go | 640 - .../apiserver/pkg/cel/library/format.go | 285 - vendor/k8s.io/apiserver/pkg/cel/library/ip.go | 335 - .../apiserver/pkg/cel/library/jsonpatch.go | 89 - .../apiserver/pkg/cel/library/libraries.go | 61 - .../k8s.io/apiserver/pkg/cel/library/lists.go | 324 - .../apiserver/pkg/cel/library/quantity.go | 386 - .../k8s.io/apiserver/pkg/cel/library/regex.go | 201 - .../apiserver/pkg/cel/library/semverlib.go | 343 - .../k8s.io/apiserver/pkg/cel/library/test.go | 83 - .../k8s.io/apiserver/pkg/cel/library/urls.go | 248 - vendor/k8s.io/apiserver/pkg/cel/limits.go | 54 - .../pkg/cel/mutation/dynamic/objects.go | 249 - .../apiserver/pkg/cel/mutation/jsonpatch.go | 185 - .../pkg/cel/mutation/typeresolver.go | 47 - .../pkg/cel/openapi/resolver/combined.go | 45 - .../pkg/cel/openapi/resolver/definitions.go | 112 - .../pkg/cel/openapi/resolver/discovery.go | 104 - .../pkg/cel/openapi/resolver/refs.go | 122 - .../pkg/cel/openapi/resolver/resolver.go | 39 - vendor/k8s.io/apiserver/pkg/cel/quantity.go | 76 - vendor/k8s.io/apiserver/pkg/cel/semver.go | 73 - vendor/k8s.io/apiserver/pkg/cel/types.go | 598 - vendor/k8s.io/apiserver/pkg/cel/url.go | 80 - vendor/k8s.io/apiserver/pkg/cel/value.go | 769 - .../pkg/endpoints/openapi/openapi.go | 175 - .../apiserver/pkg/endpoints/request/OWNERS | 4 - .../pkg/endpoints/request/context.go | 78 - .../apiserver/pkg/endpoints/request/doc.go | 20 - .../pkg/endpoints/request/methods.go | 37 - .../pkg/endpoints/request/received_time.go | 45 - .../pkg/endpoints/request/requestinfo.go | 305 - .../request/server_shutdown_signal.go | 55 - .../pkg/endpoints/request/webhook_duration.go | 343 - vendor/k8s.io/apiserver/pkg/features/OWNERS | 4 - .../apiserver/pkg/features/kube_features.go | 510 - vendor/k8s.io/apiserver/pkg/quota/v1/OWNERS | 13 - .../apiserver/pkg/quota/v1/interfaces.go | 88 - .../apiserver/pkg/quota/v1/resources.go | 304 - .../pkg/server/egressselector/config.go | 247 - .../server/egressselector/egress_selector.go | 414 - .../server/egressselector/metrics/metrics.go | 133 - .../pkg/util/compatibility/registry.go | 53 - .../pkg/util/compatibility/version.go | 65 - .../pkg/util/webhook/authentication.go | 276 - .../apiserver/pkg/util/webhook/client.go | 257 - .../apiserver/pkg/util/webhook/error.go | 48 - .../apiserver/pkg/util/webhook/gencerts.sh | 148 - .../apiserver/pkg/util/webhook/metrics.go | 52 - .../pkg/util/webhook/serviceresolver.go | 48 - .../apiserver/pkg/util/webhook/validation.go | 115 - .../apiserver/pkg/util/webhook/webhook.go | 171 - .../x509metrics/server_cert_deprecations.go | 225 - .../k8s.io/apiserver/pkg/warning/context.go | 60 - .../k8s.io/client-go/tools/portforward/OWNERS | 10 - .../k8s.io/client-go/tools/portforward/doc.go | 19 - .../tools/portforward/fallback_dialer.go | 57 - .../tools/portforward/portforward.go | 454 - .../tools/portforward/tunneling_connection.go | 158 - .../tools/portforward/tunneling_dialer.go | 93 - .../client-go/tools/remotecommand/OWNERS | 10 - .../client-go/tools/remotecommand/doc.go | 20 - .../tools/remotecommand/errorstream.go | 54 - .../client-go/tools/remotecommand/fallback.go | 60 - .../client-go/tools/remotecommand/reader.go | 41 - .../tools/remotecommand/remotecommand.go | 58 - .../client-go/tools/remotecommand/resize.go | 34 - .../client-go/tools/remotecommand/spdy.go | 175 - .../client-go/tools/remotecommand/v1.go | 164 - .../client-go/tools/remotecommand/v2.go | 204 - .../client-go/tools/remotecommand/v3.go | 116 - .../client-go/tools/remotecommand/v4.go | 124 - .../client-go/tools/remotecommand/v5.go | 35 - .../tools/remotecommand/websocket.go | 530 - .../client-go/tools/watch/informerwatcher.go | 166 - .../client-go/tools/watch/retrywatcher.go | 327 - vendor/k8s.io/client-go/tools/watch/until.go | 168 - .../k8s.io/client-go/transport/spdy/spdy.go | 107 - .../transport/websocket/roundtripper.go | 224 - vendor/k8s.io/client-go/util/exec/exec.go | 52 - .../component-base/compatibility/OWNERS | 14 - .../component-base/compatibility/registry.go | 491 - .../component-base/compatibility/version.go | 239 - vendor/k8s.io/component-base/logs/OWNERS | 12 - .../k8s.io/component-base/logs/api/v1/doc.go | 33 - .../logs/api/v1/kube_features.go | 82 - .../component-base/logs/api/v1/options.go | 452 - .../logs/api/v1/options_no_slog.go | 24 - .../logs/api/v1/options_slog.go | 37 - .../component-base/logs/api/v1/pflags.go | 113 - .../component-base/logs/api/v1/registry.go | 135 - .../k8s.io/component-base/logs/api/v1/text.go | 142 - .../component-base/logs/api/v1/types.go | 146 - .../logs/api/v1/zz_generated.deepcopy.go | 167 - .../logs/api/v1/zz_generated.model_name.go | 67 - .../setverbositylevel/setverbositylevel.go | 34 - .../logs/klogflags/klogflags.go | 41 - vendor/k8s.io/component-base/logs/logs.go | 209 - .../component-base/logs/testinit/testinit.go | 32 - .../prometheus/compatversion/metrics.go | 50 - vendor/k8s.io/component-base/tracing/OWNERS | 8 - .../component-base/tracing/api/v1/config.go | 88 - .../component-base/tracing/api/v1/doc.go | 31 - .../component-base/tracing/api/v1/types.go | 32 - .../tracing/api/v1/zz_generated.deepcopy.go | 48 - .../tracing/api/v1/zz_generated.model_name.go | 27 - .../k8s.io/component-base/tracing/tracing.go | 98 - vendor/k8s.io/component-base/tracing/utils.go | 134 - .../component-base/zpages/features/doc.go | 22 - .../zpages/features/kube_features.go | 52 - .../node/util/sysctl/namespace.go | 104 - .../node/util/sysctl/sysctl.go | 131 - .../k8s.io/component-helpers/resource/OWNERS | 13 - .../component-helpers/resource/helpers.go | 507 - .../scheduling/corev1/doc.go | 23 - .../scheduling/corev1/helpers.go | 102 - .../corev1/nodeaffinity/nodeaffinity.go | 333 - vendor/k8s.io/controller-manager/LICENSE | 201 - .../controller-manager/pkg/features/OWNERS | 4 - .../pkg/features/kube_features.go | 58 - vendor/k8s.io/klog/v2/README.md | 2 - .../klog/v2/internal/serialize/keyvalues.go | 232 +- .../internal/serialize/keyvalues_no_slog.go | 10 +- .../v2/internal/serialize/keyvalues_slog.go | 12 +- .../klog/v2/internal/verbosity/verbosity.go | 303 - vendor/k8s.io/klog/v2/klog.go | 87 +- vendor/k8s.io/klog/v2/klogr.go | 4 +- vendor/k8s.io/klog/v2/klogr/klogr.go | 8 +- vendor/k8s.io/klog/v2/klogr_slog.go | 11 +- vendor/k8s.io/klog/v2/textlogger/options.go | 154 - .../k8s.io/klog/v2/textlogger/textlogger.go | 187 - .../klog/v2/textlogger/textlogger_slog.go | 52 - .../pkg/internal/serialization.go | 2 +- .../go-json-experiment/json/README.md | 246 +- .../go-json-experiment/json/alias.go | 967 + .../go-json-experiment/json/arshal.go | 523 +- .../go-json-experiment/json/arshal_any.go | 283 +- .../go-json-experiment/json/arshal_default.go | 1469 +- .../go-json-experiment/json/arshal_funcs.go | 209 +- .../go-json-experiment/json/arshal_inlined.go | 123 +- .../go-json-experiment/json/arshal_methods.go | 328 +- .../go-json-experiment/json/arshal_time.go | 846 +- .../go-json-experiment/json/decode.go | 1655 - .../go-json-experiment/json/doc.go | 228 +- .../go-json-experiment/json/encode.go | 1170 - .../go-json-experiment/json/errors.go | 409 +- .../go-json-experiment/json/fields.go | 503 +- .../go-json-experiment/json/fold.go | 2 + .../go-json-experiment/json/intern.go | 8 +- .../json/internal/internal.go | 42 + .../json/internal/jsonflags/flags.go | 215 + .../json/internal/jsonopts/options.go | 202 + .../json/internal/jsonwire/decode.go | 629 + .../json/internal/jsonwire/encode.go | 290 + .../json/internal/jsonwire/wire.go | 217 + .../go-json-experiment/json/jsontext/alias.go | 536 + .../json/jsontext/decode.go | 1179 + .../go-json-experiment/json/jsontext/doc.go | 111 + .../json/jsontext/encode.go | 977 + .../json/jsontext/errors.go | 182 + .../json/jsontext/export.go | 77 + .../json/jsontext/options.go | 304 + .../json/{ => jsontext}/pools.go | 92 +- .../go-json-experiment/json/jsontext/quote.go | 41 + .../json/{ => jsontext}/state.go | 447 +- .../json/{ => jsontext}/token.go | 87 +- .../go-json-experiment/json/jsontext/value.go | 395 + .../go-json-experiment/json/migrate.sh | 48 + .../go-json-experiment/json/options.go | 289 + .../go-json-experiment/json/value.go | 381 - .../internal/third_party/govalidator/LICENSE | 21 - .../third_party/govalidator/patterns.go | 26 - .../third_party/govalidator/validator.go | 181 - .../kube-openapi/pkg/schemaconv/openapi.go | 6 +- .../pkg/schemaconv/proto_models.go | 10 +- .../k8s.io/kube-openapi/pkg/spec3/encoding.go | 13 +- .../k8s.io/kube-openapi/pkg/spec3/example.go | 13 +- .../pkg/spec3/external_documentation.go | 13 +- .../k8s.io/kube-openapi/pkg/spec3/header.go | 13 +- .../kube-openapi/pkg/spec3/media_type.go | 13 +- .../kube-openapi/pkg/spec3/operation.go | 13 +- .../kube-openapi/pkg/spec3/parameter.go | 13 +- vendor/k8s.io/kube-openapi/pkg/spec3/path.go | 25 +- .../kube-openapi/pkg/spec3/request_body.go | 13 +- .../k8s.io/kube-openapi/pkg/spec3/response.go | 47 +- .../kube-openapi/pkg/spec3/security_scheme.go | 7 +- .../k8s.io/kube-openapi/pkg/spec3/server.go | 25 +- vendor/k8s.io/kube-openapi/pkg/spec3/spec.go | 5 +- .../pkg/validation/errors/.gitignore | 2 - .../kube-openapi/pkg/validation/errors/api.go | 46 - .../kube-openapi/pkg/validation/errors/doc.go | 26 - .../pkg/validation/errors/headers.go | 44 - .../pkg/validation/errors/schema.go | 573 - .../pkg/validation/spec/header.go | 13 +- .../kube-openapi/pkg/validation/spec/info.go | 13 +- .../kube-openapi/pkg/validation/spec/items.go | 13 +- .../pkg/validation/spec/operation.go | 13 +- .../pkg/validation/spec/parameter.go | 13 +- .../pkg/validation/spec/path_item.go | 15 +- .../kube-openapi/pkg/validation/spec/paths.go | 11 +- .../kube-openapi/pkg/validation/spec/ref.go | 50 - .../pkg/validation/spec/response.go | 15 +- .../pkg/validation/spec/responses.go | 17 +- .../pkg/validation/spec/schema.go | 13 +- .../pkg/validation/spec/security_scheme.go | 13 +- .../pkg/validation/spec/swagger.go | 59 +- .../kube-openapi/pkg/validation/spec/tag.go | 13 +- .../pkg/validation/strfmt/.gitignore | 2 - .../pkg/validation/strfmt/bson.go | 103 - .../pkg/validation/strfmt/bson/objectid.go | 122 - .../pkg/validation/strfmt/date.go | 103 - .../pkg/validation/strfmt/default.go | 1272 - .../kube-openapi/pkg/validation/strfmt/doc.go | 18 - .../pkg/validation/strfmt/duration.go | 163 - .../pkg/validation/strfmt/format.go | 257 - .../strfmt/kubernetes-extensions.go | 143 - .../pkg/validation/strfmt/time.go | 152 - vendor/k8s.io/kubectl/pkg/scale/scale.go | 213 - .../kubectl/pkg/util/podutils/podutils.go | 281 - vendor/k8s.io/kubelet/pkg/apis/OWNERS | 10 - .../kubelet/pkg/apis/well_known_labels.go | 87 - .../pkg/apis/well_known_openshift_labels.go | 45 - .../kubernetes/pkg/api/legacyscheme/scheme.go | 37 - .../k8s.io/kubernetes/pkg/api/service/OWNERS | 5 - .../k8s.io/kubernetes/pkg/api/service/util.go | 93 - .../kubernetes/pkg/api/service/warnings.go | 84 - .../k8s.io/kubernetes/pkg/api/v1/pod/util.go | 546 - .../kubernetes/pkg/api/v1/service/util.go | 99 - vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS | 8 - vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go | 19 - .../kubernetes/pkg/apis/apps/register.go | 66 - .../k8s.io/kubernetes/pkg/apis/apps/types.go | 939 - .../pkg/apis/apps/zz_generated.deepcopy.go | 858 - .../kubernetes/pkg/apis/autoscaling/OWNERS | 12 - .../pkg/apis/autoscaling/annotations.go | 46 - .../kubernetes/pkg/apis/autoscaling/doc.go | 19 - .../pkg/apis/autoscaling/helpers.go | 64 - .../pkg/apis/autoscaling/register.go | 55 - .../kubernetes/pkg/apis/autoscaling/types.go | 582 - .../apis/autoscaling/zz_generated.deepcopy.go | 675 - .../k8s.io/kubernetes/pkg/apis/batch/OWNERS | 8 - .../k8s.io/kubernetes/pkg/apis/batch/doc.go | 19 - .../kubernetes/pkg/apis/batch/register.go | 56 - .../k8s.io/kubernetes/pkg/apis/batch/types.go | 752 - .../pkg/apis/batch/zz_generated.deepcopy.go | 567 - .../kubernetes/pkg/apis/certificates/OWNERS | 8 - .../kubernetes/pkg/apis/certificates/doc.go | 20 - .../pkg/apis/certificates/helpers.go | 138 - .../pkg/apis/certificates/register.go | 56 - .../kubernetes/pkg/apis/certificates/types.go | 514 - .../certificates/zz_generated.deepcopy.go | 415 - vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS | 4 - .../pkg/apis/core/annotation_key_constants.go | 158 - vendor/k8s.io/kubernetes/pkg/apis/core/doc.go | 25 - .../pkg/apis/core/helper/helpers.go | 528 - .../pkg/apis/core/helper/qos/qos.go | 171 - .../kubernetes/pkg/apis/core/install/OWNERS | 8 - .../pkg/apis/core/install/install.go | 38 - .../k8s.io/kubernetes/pkg/apis/core/json.go | 31 - .../pkg/apis/core/objectreference.go | 37 - .../kubernetes/pkg/apis/core/pods/helpers.go | 97 - .../kubernetes/pkg/apis/core/register.go | 102 - .../kubernetes/pkg/apis/core/resource.go | 58 - .../k8s.io/kubernetes/pkg/apis/core/taint.go | 42 - .../kubernetes/pkg/apis/core/toleration.go | 30 - .../k8s.io/kubernetes/pkg/apis/core/types.go | 7171 - .../k8s.io/kubernetes/pkg/apis/core/v1/OWNERS | 24 - .../kubernetes/pkg/apis/core/v1/conversion.go | 568 - .../kubernetes/pkg/apis/core/v1/defaults.go | 527 - .../k8s.io/kubernetes/pkg/apis/core/v1/doc.go | 25 - .../pkg/apis/core/v1/helper/helpers.go | 341 - .../kubernetes/pkg/apis/core/v1/register.go | 46 - .../apis/core/v1/zz_generated.conversion.go | 9404 - .../pkg/apis/core/v1/zz_generated.defaults.go | 1297 - .../apis/core/v1/zz_generated.validations.go | 165 - .../pkg/apis/core/validation/OWNERS | 21 - .../pkg/apis/core/validation/doc.go | 19 - .../pkg/apis/core/validation/events.go | 193 - .../pkg/apis/core/validation/names.go | 138 - .../pkg/apis/core/validation/validation.go | 9605 - .../apis/core/validation/validation_patch.go | 68 - .../pkg/apis/core/zz_generated.deepcopy.go | 6881 - .../kubernetes/pkg/apis/extensions/OWNERS | 24 - .../kubernetes/pkg/apis/extensions/doc.go | 19 - .../pkg/apis/extensions/register.go | 67 - .../kubernetes/pkg/apis/extensions/types.go | 29 - .../apis/extensions/zz_generated.deepcopy.go | 22 - .../kubernetes/pkg/apis/networking/OWNERS | 8 - .../kubernetes/pkg/apis/networking/doc.go | 20 - .../pkg/apis/networking/register.go | 61 - .../kubernetes/pkg/apis/networking/types.go | 695 - .../apis/networking/zz_generated.deepcopy.go | 930 - .../pkg/capabilities/capabilities.go | 96 - .../k8s.io/kubernetes/pkg/capabilities/doc.go | 18 - .../k8s.io/kubernetes/pkg/controller/OWNERS | 18 - .../pkg/controller/controller_ref_manager.go | 596 - .../pkg/controller/controller_utils.go | 1452 - .../deployment/util/deployment_util.go | 971 - .../k8s.io/kubernetes/pkg/controller/doc.go | 19 - vendor/k8s.io/kubernetes/pkg/features/OWNERS | 4 - .../kubernetes/pkg/features/client_adapter.go | 114 - .../kubernetes/pkg/features/kube_features.go | 2598 - .../pkg/features/openshift_features.go | 32 - vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go | 19 - .../kubernetes/pkg/fieldpath/fieldpath.go | 120 - .../k8s.io/kubernetes/pkg/util/hash/hash.go | 32 - .../kubernetes/pkg/util/labels/.readonly | 0 .../k8s.io/kubernetes/pkg/util/labels/doc.go | 18 - .../kubernetes/pkg/util/labels/labels.go | 124 - .../kubernetes/pkg/util/parsers/parsers.go | 69 - .../kubernetes/pkg/util/taints/taints.go | 289 - .../test/e2e/framework/.import-restrictions | 66 - .../kubernetes/test/e2e/framework/OWNERS | 19 - .../kubernetes/test/e2e/framework/README.md | 88 - .../kubernetes/test/e2e/framework/bugs.go | 108 - .../kubernetes/test/e2e/framework/expect.go | 352 - .../e2e/framework/flake_reporting_util.go | 97 - .../test/e2e/framework/framework.go | 779 - .../kubernetes/test/e2e/framework/get.go | 150 - .../test/e2e/framework/ginkgologger.go | 117 - .../test/e2e/framework/ginkgowrapper.go | 650 - .../kubernetes/test/e2e/framework/gomega.go | 65 - .../e2e/framework/internal/junit/junit.go | 64 - .../internal/junit/junit_data_races.go | 75 - .../internal/junit/junit_no_data_races.go | 29 - .../framework/kubectl/.import-restrictions | 12 - .../test/e2e/framework/kubectl/builder.go | 205 - .../e2e/framework/kubectl/kubectl_utils.go | 206 - .../kubernetes/test/e2e/framework/log.go | 44 - .../test/e2e/framework/namespacedname.go | 49 - .../e2e/framework/node/.import-restrictions | 12 - .../test/e2e/framework/node/helper.go | 224 - .../test/e2e/framework/node/node_killer.go | 94 - .../test/e2e/framework/node/resource.go | 842 - .../kubernetes/test/e2e/framework/node/ssh.go | 43 - .../test/e2e/framework/node/wait.go | 317 - .../test/e2e/framework/nodes_util.go | 26 - .../e2e/framework/pod/.import-restrictions | 12 - .../test/e2e/framework/pod/create.go | 272 - .../test/e2e/framework/pod/delete.go | 120 - .../kubernetes/test/e2e/framework/pod/dial.go | 230 - .../test/e2e/framework/pod/exec_util.go | 214 - .../kubernetes/test/e2e/framework/pod/get.go | 31 - .../test/e2e/framework/pod/node_selection.go | 105 - .../test/e2e/framework/pod/pod_client.go | 399 - .../test/e2e/framework/pod/resource.go | 557 - .../test/e2e/framework/pod/utils.go | 294 - .../kubernetes/test/e2e/framework/pod/wait.go | 949 - .../kubernetes/test/e2e/framework/ports.go | 28 - .../kubernetes/test/e2e/framework/provider.go | 192 - .../kubernetes/test/e2e/framework/size.go | 60 - .../framework/skipper/.import-restrictions | 9 - .../test/e2e/framework/skipper/skipper.go | 252 - .../e2e/framework/ssh/.import-restrictions | 12 - .../kubernetes/test/e2e/framework/ssh/ssh.go | 468 - .../test/e2e/framework/test_context.go | 678 - .../framework/testfiles/.import-restrictions | 12 - .../test/e2e/framework/testfiles/testfiles.go | 193 - .../kubernetes/test/e2e/framework/timeouts.go | 131 - .../kubernetes/test/e2e/framework/util.go | 708 - .../test/e2e/testing-manifests/README.md | 22 - .../test/e2e/testing-manifests/dra/OWNERS | 11 - .../dra/dra-test-driver-proxy.yaml | 80 - .../test/e2e/testing-manifests/embed.go | 33 - .../flexvolume/attachable-with-long-mount | 145 - .../e2e/testing-manifests/flexvolume/dummy | 70 - .../flexvolume/dummy-attachable | 143 - .../gpu/gce/nvidia-driver-installer.yaml | 146 - .../gpu/gce/nvidia-gpu-device-plugin.yaml | 57 - .../agnhost-primary-deployment.yaml.in | 28 - .../guestbook/agnhost-primary-service.yaml | 16 - .../agnhost-replica-deployment.yaml.in | 28 - .../guestbook/agnhost-replica-service.yaml | 15 - .../guestbook/frontend-deployment.yaml.in | 26 - .../guestbook/frontend-service.yaml | 16 - .../guestbook/legacy/frontend-controller.yaml | 29 - .../legacy/redis-master-controller.yaml | 26 - .../legacy/redis-slave-controller.yaml | 37 - .../guestbook/redis-master-deployment.yaml.in | 27 - .../guestbook/redis-master-service.yaml | 16 - .../guestbook/redis-slave-deployment.yaml.in | 38 - .../guestbook/redis-slave-service.yaml | 15 - .../kubectl/agnhost-deployment1.yaml.in | 22 - .../kubectl/agnhost-deployment2.yaml.in | 19 - .../kubectl/agnhost-deployment3.yaml.in | 19 - .../agnhost-primary-controller.json.in | 40 - .../kubectl/agnhost-primary-pod.yaml | 32 - .../kubectl/agnhost-primary-service.json | 23 - .../kubectl/agnhost-rc.yaml.in | 16 - .../kubectl/busybox-cronjob.yaml.in | 21 - .../kubectl/busybox-pod.yaml.in | 13 - .../kubectl/pause-pod.yaml.in | 12 - .../kubectl/pod-with-readiness-probe.yaml.in | 19 - .../kubernetes/test/e2e/testing-manifests/pod | 13 - ...le-device-plugin-control-registration.yaml | 52 - .../sample-device-plugin.yaml | 55 - .../statefulset/cassandra/controller.yaml | 58 - .../statefulset/cassandra/pdb.yaml | 11 - .../statefulset/cassandra/service.yaml | 12 - .../statefulset/cassandra/statefulset.yaml | 90 - .../statefulset/cassandra/tester.yaml | 51 - .../statefulset/cockroachdb/service.yaml | 33 - .../statefulset/cockroachdb/statefulset.yaml | 103 - .../testing-manifests/statefulset/etcd/OWNERS | 4 - .../statefulset/etcd/pdb.yaml | 11 - .../statefulset/etcd/service.yaml | 16 - .../statefulset/etcd/statefulset.yaml | 178 - .../statefulset/etcd/tester.yaml | 27 - .../statefulset/mysql-galera/service.yaml | 16 - .../statefulset/mysql-galera/statefulset.yaml | 87 - .../statefulset/mysql-upgrade/configmap.yaml | 13 - .../statefulset/mysql-upgrade/service.yaml | 27 - .../mysql-upgrade/statefulset.yaml | 162 - .../statefulset/mysql-upgrade/tester.yaml | 51 - .../statefulset/zookeeper/service.yaml | 18 - .../statefulset/zookeeper/statefulset.yaml | 88 - .../e2e/testing-manifests/storage-csi/OWNERS | 19 - .../crd/hello-populator-crd.yaml | 50 - ...lator.storage.k8s.io_volumepopulators.yaml | 56 - .../hello-populator-deploy.yaml | 68 - .../rbac-data-source-validator.yaml | 37 - .../setup-data-source-validator.yaml | 24 - .../storage-csi/controller-role.yaml | 4 - .../storage-csi/external-attacher/rbac.yaml | 93 - .../rbac.yaml | 89 - .../external-provisioner/rbac.yaml | 133 - .../storage-csi/external-resizer/rbac.yaml | 97 - .../csi-snapshotter/rbac-csi-snapshotter.yaml | 97 - ...age.k8s.io_volumegroupsnapshotclasses.yaml | 178 - ...ge.k8s.io_volumegroupsnapshotcontents.yaml | 661 - ...t.storage.k8s.io_volumegroupsnapshots.yaml | 460 - .../csi-hostpath-plugin.yaml | 397 - .../run_group_snapshot_e2e.sh | 312 - .../storage-csi/gce-pd/controller_ss.yaml | 152 - .../gce-pd/csi-controller-rbac.yaml | 198 - .../storage-csi/gce-pd/node_ds.yaml | 115 - .../storage-csi/hostpath/README.md | 4 - .../hostpath/csi-hostpath-driverinfo.yaml | 20 - .../hostpath/csi-hostpath-plugin.yaml | 418 - .../hostpath/csi-hostpath-snapshotclass.yaml | 13 - .../hostpath/csi-hostpath-testing.yaml | 87 - .../hostpath/hostpath/e2e-test-rbac.yaml | 31 - .../mock/csi-mock-driver-attacher.yaml | 35 - .../mock/csi-mock-driver-resizer.yaml | 34 - .../mock/csi-mock-driver-snapshotter.yaml | 36 - .../storage-csi/mock/csi-mock-driver.yaml | 104 - .../storage-csi/mock/csi-mock-driverinfo.yaml | 7 - .../storage-csi/mock/csi-mock-proxy.yaml | 109 - .../storage-csi/mock/csi-mock-rbac.yaml | 87 - .../storage-csi/mock/csi-storageclass.yaml | 7 - .../storage-csi/update-hostpath.sh | 152 - .../test/utils/admission_webhook.go | 138 - vendor/k8s.io/kubernetes/test/utils/audit.go | 223 - .../kubernetes/test/utils/conditions.go | 105 - .../kubernetes/test/utils/create_resources.go | 178 - .../kubernetes/test/utils/delete_resources.go | 57 - .../kubernetes/test/utils/density_utils.go | 107 - .../kubernetes/test/utils/deployment.go | 369 - .../kubernetes/test/utils/format/format.go | 92 - .../k8s.io/kubernetes/test/utils/image/OWNERS | 13 - .../test/utils/image/csi_manifest.go | 133 - .../kubernetes/test/utils/image/manifest.go | 407 - .../test/utils/kubeconfig/kubeconfig.go | 63 - vendor/k8s.io/kubernetes/test/utils/node.go | 33 - vendor/k8s.io/kubernetes/test/utils/paths.go | 82 - .../kubernetes/test/utils/pki_helpers.go | 87 - .../k8s.io/kubernetes/test/utils/pod_store.go | 82 - .../kubernetes/test/utils/replicaset.go | 69 - .../k8s.io/kubernetes/test/utils/runners.go | 1432 - vendor/k8s.io/kubernetes/test/utils/tmpdir.go | 34 - .../kubernetes/test/utils/update_resources.go | 62 - vendor/k8s.io/pod-security-admission/LICENSE | 201 - .../pod-security-admission/api/attributes.go | 146 - .../pod-security-admission/api/constants.go | 50 - .../k8s.io/pod-security-admission/api/doc.go | 18 - .../pod-security-admission/api/helpers.go | 269 - .../policy/check_allowPrivilegeEscalation.go | 93 - .../policy/check_appArmorProfile.go | 143 - .../policy/check_capabilities_baseline.go | 110 - .../policy/check_capabilities_restricted.go | 145 - .../policy/check_hostNamespaces.go | 82 - .../policy/check_hostPathVolumes.go | 76 - .../policy/check_hostPorts.go | 91 - .../check_hostProbesAndhostLifecycle.go | 150 - .../policy/check_privileged.go | 75 - .../policy/check_procMount_baseline.go | 106 - .../policy/check_procMount_restricted.go | 56 - .../policy/check_restrictedVolumes.go | 173 - .../policy/check_runAsNonRoot.go | 145 - .../policy/check_runAsUser.go | 116 - .../policy/check_seLinuxOptions.go | 172 - .../policy/check_seccompProfile_baseline.go | 171 - .../policy/check_seccompProfile_restricted.go | 155 - .../policy/check_sysctls.go | 143 - .../policy/check_windowsHostProcess.go | 102 - .../pod-security-admission/policy/checks.go | 184 - .../pod-security-admission/policy/doc.go | 18 - .../pod-security-admission/policy/helpers.go | 43 - .../pod-security-admission/policy/registry.go | 232 - .../pod-security-admission/policy/visitor.go | 37 - vendor/k8s.io/utils/buffer/ring_fixed.go | 120 + vendor/k8s.io/utils/exec/exec.go | 16 + vendor/k8s.io/utils/exec/fixup_go118.go | 32 - vendor/k8s.io/utils/exec/fixup_go119.go | 40 - vendor/k8s.io/utils/integer/integer.go | 79 - vendor/k8s.io/utils/path/file.go | 78 - vendor/modules.txt | 594 +- .../konnectivity-client/LICENSE | 201 - .../konnectivity-client/pkg/client/client.go | 564 - .../konnectivity-client/pkg/client/conn.go | 157 - .../pkg/client/metrics/metrics.go | 164 - .../pkg/common/metrics/metrics.go | 78 - .../proto/client/client.pb.go | 893 - .../proto/client/client.proto | 104 - .../proto/client/client_grpc.pb.go | 150 - 3078 files changed, 53477 insertions(+), 1020594 deletions(-) delete mode 100644 vendor/cel.dev/expr/.bazelversion delete mode 100644 vendor/cel.dev/expr/.gitattributes delete mode 100644 vendor/cel.dev/expr/.gitignore delete mode 100644 vendor/cel.dev/expr/BUILD.bazel delete mode 100644 vendor/cel.dev/expr/CODE_OF_CONDUCT.md delete mode 100644 vendor/cel.dev/expr/CONTRIBUTING.md delete mode 100644 vendor/cel.dev/expr/GOVERNANCE.md delete mode 100644 vendor/cel.dev/expr/MAINTAINERS.md delete mode 100644 vendor/cel.dev/expr/MODULE.bazel delete mode 100644 vendor/cel.dev/expr/README.md delete mode 100644 vendor/cel.dev/expr/WORKSPACE delete mode 100644 vendor/cel.dev/expr/WORKSPACE.bzlmod delete mode 100644 vendor/cel.dev/expr/checked.pb.go delete mode 100644 vendor/cel.dev/expr/cloudbuild.yaml delete mode 100644 vendor/cel.dev/expr/eval.pb.go delete mode 100644 vendor/cel.dev/expr/explain.pb.go delete mode 100644 vendor/cel.dev/expr/regen_go_proto.sh delete mode 100644 vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh delete mode 100644 vendor/cel.dev/expr/syntax.pb.go delete mode 100644 vendor/cel.dev/expr/value.pb.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/.gitignore delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/LICENSE delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/README.md delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_config.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_state.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_type.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/char_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/comparators.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/configuration.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/dfa.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/dfa_state.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/error_listener.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/error_strategy.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/errors.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/file_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/input_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/int_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/interval_set.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/jcollect.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/lexer.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/lexer_action.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/nostatistics.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/parser.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_context.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/recognizer.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/rule_context.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/semantic_context.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/statistics.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/stats_data.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/token.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/token_source.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/token_stream.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/trace_listener.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/transition.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/tree.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/trees.go delete mode 100644 vendor/github.com/antlr4-go/antlr/v4/utils.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/context.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/request.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/types.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/version.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/generate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/local.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamResourceDiscovery.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamScope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateKeyPair.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplateVersion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVpcAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterfaceGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateMacSystemIntegrityProtectionModificationTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateManagedPrefixList.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNatGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAcl.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAclEntry.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsAccessScope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsPath.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterfacePermission.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePlacementGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePublicIpv4Pool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReplaceRootVolumeTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReservedInstancesListing.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRestoreImageTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerPeer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSecurityGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshots.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSpotDatafeedSubscription.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateStoreImageTask.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnetCidrReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTags.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilterRule.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorSession.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorTarget.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnect.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnectPeer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayMulticastDomain.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPeeringAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPolicyTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPrefixListReference.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTableAnnouncement.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayVpcAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessTrustProvider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointConnectionNotification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointServiceConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcPeeringConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnectionRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCarrierGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipPool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCustomerGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteDhcpOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteEgressOnlyInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFleets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFlowLogs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFpgaImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceConnectEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceEventWindow.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpam.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamExternalResourceVerificationToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamPool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamResourceDiscovery.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamScope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteKeyPair.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplateVersions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVpcAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterfaceGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteManagedPrefixList.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNatGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAcl.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAclEntry.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScopeAnalysis.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAnalysis.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsPath.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterfacePermission.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePlacementGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePublicIpv4Pool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteQueuedReservedInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerPeer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSecurityGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSpotDatafeedSubscription.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnetCidrReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTags.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilterRule.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorSession.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorTarget.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnect.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnectPeer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayMulticastDomain.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPeeringAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPolicyTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPrefixListReference.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTableAnnouncement.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayVpcAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessTrustProvider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcBlockPublicAccessExclusion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointConnectionNotifications.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointServiceConfigurations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcPeeringConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnectionRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionByoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamByoasn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamPoolCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionPublicIpv4PoolCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterInstanceEventNotificationAttributes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupMembers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupSources.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAccountAttributes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressTransfers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressesAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAggregateIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAvailabilityZones.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeBundleTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeByoipCidrs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockOfferings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlocks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationBillingRequests.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationFleets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCarrierGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClassicLinkInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnRoutes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnTargetNetworks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCoipPools.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeConversionTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCustomerGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDeclarativePoliciesReports.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDhcpOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeElasticGpus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportImageTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastLaunchImages.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastSnapshotRestores.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetHistory.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFlowLogs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImages.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservationOfferings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHosts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdentityIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImages.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportImageTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportSnapshotTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceConnectEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceCreditSpecifications.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventNotificationAttributes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventWindows.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceImageMetadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTopology.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypeOfferings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInternetGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamByoasn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamExternalResourceVerificationTokens.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamPools.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveries.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveryAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamScopes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpams.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpv6Pools.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeKeyPairs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplateVersions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplates.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTables.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLockedSnapshots.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacHosts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacModificationTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeManagedPrefixLists.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMovingAddresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNatGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkAcls.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopeAnalyses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAnalyses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsPaths.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfacePermissions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaces.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeOutpostLags.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePlacementGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrefixLists.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrincipalIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePublicIpv4Pools.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRegions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReplaceRootVolumeTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesListings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesModifications.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesOfferings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerPeers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteTables.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstanceAvailability.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupReferences.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupRules.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeServiceLinkVirtualInterfaces.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotTierStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshots.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotDatafeedSubscription.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequestHistory.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequests.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotInstanceRequests.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotPriceHistory.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStaleSecurityGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStoreImageTasks.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSubnets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTags.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilterRules.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilters.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorSessions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorTargets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayAttachments.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnectPeers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnects.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPolicyTables.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTableAnnouncements.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTables.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstanceLoggingConfigurations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessTrustProviders.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumesModifications.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLink.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServices.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcPeeringConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnGateways.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachClassicLinkVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachInternetGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachNetworkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVerifiedAccessTrustProvider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVpnGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAddressTransfer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAllowedImagesSettings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAwsNetworkPerformanceMetricSubscription.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableEbsEncryptionByDefault.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastLaunch.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastSnapshotRestores.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageBlockPublicAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeprecation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeregistrationProtection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableIpamOrganizationAdminAccount.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableRouteServerPropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSerialConsoleAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableTransitGatewayRouteTablePropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVgwRoutePropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLink.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLinkDnsSupport.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateCapacityReservationBillingOwner.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateClientVpnTargetNetwork.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateEnclaveCertificateIamRole.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIamInstanceProfile.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateInstanceEventWindow.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamByoasn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamResourceDiscovery.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateNatGatewayAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteServer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSecurityGroupVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSubnetCidrBlock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayMulticastDomain.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayPolicyTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayRouteTable.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTrunkInterface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateVpcCidrBlock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAddressTransfer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAllowedImagesSettings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAwsNetworkPerformanceMetricSubscription.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableEbsEncryptionByDefault.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastLaunch.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastSnapshotRestores.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageBlockPublicAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeprecation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeregistrationProtection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableIpamOrganizationAdminAccount.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableReachabilityAnalyzerOrganizationSharing.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableRouteServerPropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSerialConsoleAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableTransitGatewayRouteTablePropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVgwRoutePropagation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVolumeIO.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLink.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLinkDnsSupport.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientCertificateRevocationList.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportTransitGatewayRoutes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportVerifiedAccessInstanceClientConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetActiveVpnTunnelStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAllowedImagesSettings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedEnclaveCertificateIamRoles.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAwsNetworkPerformanceData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCapacityReservationUsage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCoipPoolUsage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleOutput.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleScreenshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDeclarativePoliciesReportSummary.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDefaultCreditSpecification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsDefaultKmsKeyId.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsEncryptionByDefault.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetFlowLogsIntegrationTemplate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetGroupsForCapacityReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetHostReservationPurchasePreview.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetImageBlockPublicAccessState.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceMetadataDefaults.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTpmEkPub.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTypesFromInstanceRequirements.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceUefiData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamAddressHistory.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredAccounts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredResourceCidrs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolAllocations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolCidrs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamResourceCidrs.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetLaunchTemplateData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListEntries.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeAnalysisFindings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeContent.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetPasswordData.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetReservedInstancesExchangeQuote.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerPropagations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerRoutingDatabase.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSecurityGroupsForVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSerialConsoleAccessStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSpotPlacementScores.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSubnetCidrReservations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableEntries.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointPolicy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointTargets.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessGroupPolicy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceSampleConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceTypes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnTunnelReplacementStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportClientVpnClientCertificateRevocationList.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportKeyPair.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportSnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListImagesInRecycleBin.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListSnapshotsInRecycleBin.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_LockSnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAddressAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAvailabilityZoneGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservationFleet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyClientVpnEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyDefaultCreditSpecification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyEbsDefaultKmsKeyId.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFleet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFpgaImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyHosts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdentityIdFormat.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCapacityReservationAttributes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCpuOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCreditSpecification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventStartTime.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventWindow.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMaintenanceOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataDefaults.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceNetworkPerformanceOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstancePlacement.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpam.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamPool.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceDiscovery.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamScope.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLaunchTemplate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLocalGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyManagedPrefixList.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPrivateDnsNameOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPublicIpDnsNameOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyReservedInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyRouteServer.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySecurityGroupRules.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotTier.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySpotFleetRequest.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySubnetAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterNetworkServices.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterRule.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorSession.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGateway.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayPrefixListReference.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayVpcAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpointPolicy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroup.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroupPolicy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstance.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstanceLoggingConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessTrustProvider.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolume.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolumeAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpoint.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointConnectionNotification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServiceConfiguration.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePayerResponsibility.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePermissions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcPeeringConnectionOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcTenancy.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnectionOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelCertificate.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelOptions.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MonitorInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveAddressToVpc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveByoipCidrToIpam.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveCapacityReservationInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionByoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamByoasn.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamPoolCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlockExtension.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseHostReservation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseReservedInstancesOffering.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseScheduledInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RebootInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterImage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterInstanceEventNotificationAttributes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupMembers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupSources.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectCapacityReservationBillingOwnership.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayMulticastDomainAssociations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayPeeringAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayVpcAttachment.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcEndpointConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcPeeringConnection.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseHosts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseIpamPoolAllocation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceIamInstanceProfileAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceImageCriteriaInAllowedImagesSettings.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclEntry.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRouteTableAssociation.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceTransitGatewayRoute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceVpnTunnel.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReportInstanceStatus.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotFleet.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetAddressAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetEbsDefaultKmsKeyId.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetFpgaImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetImageAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetInstanceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetNetworkInterfaceAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetSnapshotAttribute.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreAddressToClassic.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreImageFromRecycleBin.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreManagedPrefixListVersion.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotFromRecycleBin.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotTier.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeClientVpnIngress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupEgress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupIngress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunScheduledInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchLocalGatewayRoutes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayRoutes.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SendDiagnosticInterrupt.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartDeclarativePoliciesReport.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAccessScopeAnalysis.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAnalysis.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartVpcEndpointServicePrivateDnsVerification.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StopInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateClientVpnConnections.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignIpv6Addresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateIpAddresses.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateNatGatewayAddress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnlockSnapshot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnmonitorInstances.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsEgress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsIngress.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_WithdrawByoipCidr.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/deserializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/generated.json delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/options.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/serializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/enums.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/types.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ec2/validators.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/enums.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go delete mode 100644 vendor/github.com/aws/smithy-go/.gitignore delete mode 100644 vendor/github.com/aws/smithy-go/.travis.yml delete mode 100644 vendor/github.com/aws/smithy-go/CHANGELOG.md delete mode 100644 vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/aws/smithy-go/CONTRIBUTING.md delete mode 100644 vendor/github.com/aws/smithy-go/LICENSE delete mode 100644 vendor/github.com/aws/smithy-go/Makefile delete mode 100644 vendor/github.com/aws/smithy-go/NOTICE delete mode 100644 vendor/github.com/aws/smithy-go/README.md delete mode 100644 vendor/github.com/aws/smithy-go/auth/auth.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/bearer/docs.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/bearer/middleware.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/bearer/token.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/identity.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/option.go delete mode 100644 vendor/github.com/aws/smithy-go/auth/scheme_id.go delete mode 100644 vendor/github.com/aws/smithy-go/changelog-template.json delete mode 100644 vendor/github.com/aws/smithy-go/context/suppress_expired.go delete mode 100644 vendor/github.com/aws/smithy-go/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/document.go delete mode 100644 vendor/github.com/aws/smithy-go/document/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/document/document.go delete mode 100644 vendor/github.com/aws/smithy-go/document/errors.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/encoding.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/array.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/constants.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/encoder.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/escape.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/object.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/json/value.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/array.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/constants.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/element.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/encoder.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/error_utils.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/escape.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/map.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/value.go delete mode 100644 vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.go delete mode 100644 vendor/github.com/aws/smithy-go/endpoints/endpoint.go delete mode 100644 vendor/github.com/aws/smithy-go/errors.go delete mode 100644 vendor/github.com/aws/smithy-go/go_module_metadata.go delete mode 100644 vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE delete mode 100644 vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go delete mode 100644 vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go delete mode 100644 vendor/github.com/aws/smithy-go/io/byte.go delete mode 100644 vendor/github.com/aws/smithy-go/io/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/io/reader.go delete mode 100644 vendor/github.com/aws/smithy-go/io/ringbuffer.go delete mode 100644 vendor/github.com/aws/smithy-go/local-mod-replace.sh delete mode 100644 vendor/github.com/aws/smithy-go/logging/logger.go delete mode 100644 vendor/github.com/aws/smithy-go/metrics/metrics.go delete mode 100644 vendor/github.com/aws/smithy-go/metrics/nop.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/context.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/logging.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/metadata.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/middleware.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/ordered_group.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/stack.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/stack_values.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/step_build.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/step_deserialize.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/step_finalize.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/step_initialize.go delete mode 100644 vendor/github.com/aws/smithy-go/middleware/step_serialize.go delete mode 100644 vendor/github.com/aws/smithy-go/modman.toml delete mode 100644 vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go delete mode 100644 vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go delete mode 100644 vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go delete mode 100644 vendor/github.com/aws/smithy-go/properties.go delete mode 100644 vendor/github.com/aws/smithy-go/ptr/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/ptr/from_ptr.go delete mode 100644 vendor/github.com/aws/smithy-go/ptr/gen_scalars.go delete mode 100644 vendor/github.com/aws/smithy-go/ptr/to_ptr.go delete mode 100644 vendor/github.com/aws/smithy-go/rand/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/rand/rand.go delete mode 100644 vendor/github.com/aws/smithy-go/rand/uuid.go delete mode 100644 vendor/github.com/aws/smithy-go/time/time.go delete mode 100644 vendor/github.com/aws/smithy-go/tracing/context.go delete mode 100644 vendor/github.com/aws/smithy-go/tracing/nop.go delete mode 100644 vendor/github.com/aws/smithy-go/tracing/tracing.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/auth.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/client.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/doc.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/headerlist.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/host.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/interceptor.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/metrics.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/properties.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/request.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/response.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/time.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/url.go delete mode 100644 vendor/github.com/aws/smithy-go/transport/http/user_agent.go delete mode 100644 vendor/github.com/aws/smithy-go/validation.go delete mode 100644 vendor/github.com/aws/smithy-go/waiter/logger.go delete mode 100644 vendor/github.com/aws/smithy-go/waiter/waiter.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/.gitignore delete mode 100644 vendor/github.com/cenkalti/backoff/v4/LICENSE delete mode 100644 vendor/github.com/cenkalti/backoff/v4/README.md delete mode 100644 vendor/github.com/cenkalti/backoff/v4/backoff.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/context.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/exponential.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/retry.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/ticker.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/timer.go delete mode 100644 vendor/github.com/cenkalti/backoff/v4/tries.go delete mode 100644 vendor/github.com/distribution/reference/.gitattributes delete mode 100644 vendor/github.com/distribution/reference/.gitignore delete mode 100644 vendor/github.com/distribution/reference/.golangci.yml delete mode 100644 vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md delete mode 100644 vendor/github.com/distribution/reference/CONTRIBUTING.md delete mode 100644 vendor/github.com/distribution/reference/GOVERNANCE.md delete mode 100644 vendor/github.com/distribution/reference/LICENSE delete mode 100644 vendor/github.com/distribution/reference/MAINTAINERS delete mode 100644 vendor/github.com/distribution/reference/Makefile delete mode 100644 vendor/github.com/distribution/reference/README.md delete mode 100644 vendor/github.com/distribution/reference/SECURITY.md delete mode 100644 vendor/github.com/distribution/reference/distribution-logo.svg delete mode 100644 vendor/github.com/distribution/reference/helpers.go delete mode 100644 vendor/github.com/distribution/reference/normalize.go delete mode 100644 vendor/github.com/distribution/reference/reference.go delete mode 100644 vendor/github.com/distribution/reference/regexp.go delete mode 100644 vendor/github.com/distribution/reference/sort.go delete mode 100644 vendor/github.com/emicklei/go-restful/v3/.travis.yml delete mode 100644 vendor/github.com/felixge/httpsnoop/.gitignore delete mode 100644 vendor/github.com/felixge/httpsnoop/LICENSE.txt delete mode 100644 vendor/github.com/felixge/httpsnoop/Makefile delete mode 100644 vendor/github.com/felixge/httpsnoop/README.md delete mode 100644 vendor/github.com/felixge/httpsnoop/capture_metrics.go delete mode 100644 vendor/github.com/felixge/httpsnoop/docs.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go delete mode 100644 vendor/github.com/go-logr/stdr/LICENSE delete mode 100644 vendor/github.com/go-logr/stdr/README.md delete mode 100644 vendor/github.com/go-logr/stdr/stdr.go create mode 100644 vendor/github.com/go-openapi/swag/.codecov.yml create mode 100644 vendor/github.com/go-openapi/swag/.mockery.yml create mode 100644 vendor/github.com/go-openapi/swag/SECURITY.md rename vendor/{cel.dev/expr => github.com/go-openapi/swag/cmdutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go create mode 100644 vendor/github.com/go-openapi/swag/cmdutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/cmdutils_iface.go rename vendor/github.com/{moby/spdystream => go-openapi/swag/conv}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/conv/convert.go create mode 100644 vendor/github.com/go-openapi/swag/conv/convert_types.go create mode 100644 vendor/github.com/go-openapi/swag/conv/doc.go create mode 100644 vendor/github.com/go-openapi/swag/conv/format.go create mode 100644 vendor/github.com/go-openapi/swag/conv/sizeof.go create mode 100644 vendor/github.com/go-openapi/swag/conv/type_constraints.go create mode 100644 vendor/github.com/go-openapi/swag/conv_iface.go delete mode 100644 vendor/github.com/go-openapi/swag/convert.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 vendor/github.com/go-openapi/swag/file.go rename vendor/github.com/{openshift-eng/openshift-tests-extension/pkg/util/sets => go-openapi/swag/fileutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/fileutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/fileutils/file.go rename vendor/github.com/go-openapi/swag/{ => fileutils}/path.go (58%) create mode 100644 vendor/github.com/go-openapi/swag/fileutils_iface.go delete mode 100644 vendor/github.com/go-openapi/swag/initialism_index.go delete mode 100644 vendor/github.com/go-openapi/swag/json.go rename vendor/{google.golang.org/genproto/googleapis/api => github.com/go-openapi/swag/jsonname}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/jsonname/doc.go create mode 100644 vendor/github.com/go-openapi/swag/jsonname/name_provider.go create mode 100644 vendor/github.com/go-openapi/swag/jsonname_iface.go rename vendor/{google.golang.org/genproto/googleapis/rpc => github.com/go-openapi/swag/jsonutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/README.md create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/concat.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/json.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go create mode 100644 vendor/github.com/go-openapi/swag/jsonutils_iface.go rename vendor/{google.golang.org/grpc => github.com/go-openapi/swag/loading}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/loading/doc.go create mode 100644 vendor/github.com/go-openapi/swag/loading/errors.go create mode 100644 vendor/github.com/go-openapi/swag/loading/json.go rename vendor/github.com/go-openapi/swag/{ => loading}/loading.go (59%) create mode 100644 vendor/github.com/go-openapi/swag/loading/options.go create mode 100644 vendor/github.com/go-openapi/swag/loading/yaml.go create mode 100644 vendor/github.com/go-openapi/swag/loading_iface.go rename vendor/github.com/go-openapi/swag/{ => mangling}/BENCHMARK.md (53%) rename vendor/{k8s.io/component-helpers => github.com/go-openapi/swag/mangling}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/mangling/doc.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/initialism_index.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/name_lexem.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/name_mangler.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/options.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/pools.go create mode 100644 vendor/github.com/go-openapi/swag/mangling/split.go rename vendor/github.com/go-openapi/swag/{ => mangling}/string_bytes.go (60%) create mode 100644 vendor/github.com/go-openapi/swag/mangling/util.go create mode 100644 vendor/github.com/go-openapi/swag/mangling_iface.go delete mode 100644 vendor/github.com/go-openapi/swag/name_lexem.go delete mode 100644 vendor/github.com/go-openapi/swag/net.go rename vendor/{k8s.io/kube-openapi/pkg/validation/errors => github.com/go-openapi/swag/netutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/netutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/netutils/net.go create mode 100644 vendor/github.com/go-openapi/swag/netutils_iface.go delete mode 100644 vendor/github.com/go-openapi/swag/split.go rename vendor/{k8s.io/kube-openapi/pkg/validation/strfmt => github.com/go-openapi/swag/stringutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/stringutils/collection_formats.go create mode 100644 vendor/github.com/go-openapi/swag/stringutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/stringutils/strings.go create mode 100644 vendor/github.com/go-openapi/swag/stringutils_iface.go rename vendor/{k8s.io/kubelet => github.com/go-openapi/swag/typeutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/typeutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/typeutils/types.go create mode 100644 vendor/github.com/go-openapi/swag/typeutils_iface.go delete mode 100644 vendor/github.com/go-openapi/swag/util.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go rename vendor/{k8s.io/kubernetes => github.com/go-openapi/swag/yamlutils}/LICENSE (100%) create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/doc.go create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/errors.go create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/yaml.go create mode 100644 vendor/github.com/go-openapi/swag/yamlutils_iface.go delete mode 100644 vendor/github.com/google/cel-go/LICENSE delete mode 100644 vendor/github.com/google/cel-go/cel/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/cel/cel.go delete mode 100644 vendor/github.com/google/cel-go/cel/decls.go delete mode 100644 vendor/github.com/google/cel-go/cel/env.go delete mode 100644 vendor/github.com/google/cel-go/cel/folding.go delete mode 100644 vendor/github.com/google/cel-go/cel/inlining.go delete mode 100644 vendor/github.com/google/cel-go/cel/io.go delete mode 100644 vendor/github.com/google/cel-go/cel/library.go delete mode 100644 vendor/github.com/google/cel-go/cel/macro.go delete mode 100644 vendor/github.com/google/cel-go/cel/optimizer.go delete mode 100644 vendor/github.com/google/cel-go/cel/options.go delete mode 100644 vendor/github.com/google/cel-go/cel/program.go delete mode 100644 vendor/github.com/google/cel-go/cel/prompt.go delete mode 100644 vendor/github.com/google/cel-go/cel/templates/authoring.tmpl delete mode 100644 vendor/github.com/google/cel-go/cel/validator.go delete mode 100644 vendor/github.com/google/cel-go/checker/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/checker/checker.go delete mode 100644 vendor/github.com/google/cel-go/checker/cost.go delete mode 100644 vendor/github.com/google/cel-go/checker/decls/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/checker/decls/decls.go delete mode 100644 vendor/github.com/google/cel-go/checker/env.go delete mode 100644 vendor/github.com/google/cel-go/checker/errors.go delete mode 100644 vendor/github.com/google/cel-go/checker/format.go delete mode 100644 vendor/github.com/google/cel-go/checker/mapping.go delete mode 100644 vendor/github.com/google/cel-go/checker/options.go delete mode 100644 vendor/github.com/google/cel-go/checker/printer.go delete mode 100644 vendor/github.com/google/cel-go/checker/scopes.go delete mode 100644 vendor/github.com/google/cel-go/checker/types.go delete mode 100644 vendor/github.com/google/cel-go/common/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/ast/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/ast/ast.go delete mode 100644 vendor/github.com/google/cel-go/common/ast/conversion.go delete mode 100644 vendor/github.com/google/cel-go/common/ast/expr.go delete mode 100644 vendor/github.com/google/cel-go/common/ast/factory.go delete mode 100644 vendor/github.com/google/cel-go/common/ast/navigable.go delete mode 100644 vendor/github.com/google/cel-go/common/containers/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/containers/container.go delete mode 100644 vendor/github.com/google/cel-go/common/cost.go delete mode 100644 vendor/github.com/google/cel-go/common/debug/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/debug/debug.go delete mode 100644 vendor/github.com/google/cel-go/common/decls/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/decls/decls.go delete mode 100644 vendor/github.com/google/cel-go/common/doc.go delete mode 100644 vendor/github.com/google/cel-go/common/env/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/env/env.go delete mode 100644 vendor/github.com/google/cel-go/common/error.go delete mode 100644 vendor/github.com/google/cel-go/common/errors.go delete mode 100644 vendor/github.com/google/cel-go/common/functions/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/functions/functions.go delete mode 100644 vendor/github.com/google/cel-go/common/location.go delete mode 100644 vendor/github.com/google/cel-go/common/operators/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/operators/operators.go delete mode 100644 vendor/github.com/google/cel-go/common/overloads/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/overloads/overloads.go delete mode 100644 vendor/github.com/google/cel-go/common/runes/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/runes/buffer.go delete mode 100644 vendor/github.com/google/cel-go/common/source.go delete mode 100644 vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/stdlib/standard.go delete mode 100644 vendor/github.com/google/cel-go/common/types/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/types/any_value.go delete mode 100644 vendor/github.com/google/cel-go/common/types/bool.go delete mode 100644 vendor/github.com/google/cel-go/common/types/bytes.go delete mode 100644 vendor/github.com/google/cel-go/common/types/compare.go delete mode 100644 vendor/github.com/google/cel-go/common/types/doc.go delete mode 100644 vendor/github.com/google/cel-go/common/types/double.go delete mode 100644 vendor/github.com/google/cel-go/common/types/duration.go delete mode 100644 vendor/github.com/google/cel-go/common/types/err.go delete mode 100644 vendor/github.com/google/cel-go/common/types/format.go delete mode 100644 vendor/github.com/google/cel-go/common/types/int.go delete mode 100644 vendor/github.com/google/cel-go/common/types/iterator.go delete mode 100644 vendor/github.com/google/cel-go/common/types/json_value.go delete mode 100644 vendor/github.com/google/cel-go/common/types/list.go delete mode 100644 vendor/github.com/google/cel-go/common/types/map.go delete mode 100644 vendor/github.com/google/cel-go/common/types/null.go delete mode 100644 vendor/github.com/google/cel-go/common/types/object.go delete mode 100644 vendor/github.com/google/cel-go/common/types/optional.go delete mode 100644 vendor/github.com/google/cel-go/common/types/overflow.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/checked.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/enum.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/equal.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/file.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/pb.go delete mode 100644 vendor/github.com/google/cel-go/common/types/pb/type.go delete mode 100644 vendor/github.com/google/cel-go/common/types/provider.go delete mode 100644 vendor/github.com/google/cel-go/common/types/ref/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/types/ref/provider.go delete mode 100644 vendor/github.com/google/cel-go/common/types/ref/reference.go delete mode 100644 vendor/github.com/google/cel-go/common/types/string.go delete mode 100644 vendor/github.com/google/cel-go/common/types/timestamp.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/comparer.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/container.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/field_tester.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/indexer.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/iterator.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/lister.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/mapper.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/matcher.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/math.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/receiver.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/sizer.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/traits.go delete mode 100644 vendor/github.com/google/cel-go/common/types/traits/zeroer.go delete mode 100644 vendor/github.com/google/cel-go/common/types/types.go delete mode 100644 vendor/github.com/google/cel-go/common/types/uint.go delete mode 100644 vendor/github.com/google/cel-go/common/types/unknown.go delete mode 100644 vendor/github.com/google/cel-go/common/types/util.go delete mode 100644 vendor/github.com/google/cel-go/ext/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/ext/README.md delete mode 100644 vendor/github.com/google/cel-go/ext/bindings.go delete mode 100644 vendor/github.com/google/cel-go/ext/comprehensions.go delete mode 100644 vendor/github.com/google/cel-go/ext/encoders.go delete mode 100644 vendor/github.com/google/cel-go/ext/extension_option_factory.go delete mode 100644 vendor/github.com/google/cel-go/ext/formatting.go delete mode 100644 vendor/github.com/google/cel-go/ext/formatting_v2.go delete mode 100644 vendor/github.com/google/cel-go/ext/guards.go delete mode 100644 vendor/github.com/google/cel-go/ext/lists.go delete mode 100644 vendor/github.com/google/cel-go/ext/math.go delete mode 100644 vendor/github.com/google/cel-go/ext/native.go delete mode 100644 vendor/github.com/google/cel-go/ext/protos.go delete mode 100644 vendor/github.com/google/cel-go/ext/regex.go delete mode 100644 vendor/github.com/google/cel-go/ext/sets.go delete mode 100644 vendor/github.com/google/cel-go/ext/strings.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/interpreter/activation.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/attribute_patterns.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/attributes.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/decorators.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/dispatcher.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/evalstate.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/functions/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/interpreter/functions/functions.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/interpretable.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/interpreter.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/optimizations.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/planner.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/prune.go delete mode 100644 vendor/github.com/google/cel-go/interpreter/runtimecost.go delete mode 100644 vendor/github.com/google/cel-go/parser/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/parser/errors.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/BUILD.bazel delete mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.g4 delete mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.interp delete mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.tokens delete mode 100644 vendor/github.com/google/cel-go/parser/gen/CELLexer.interp delete mode 100644 vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_lexer.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_listener.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_parser.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_visitor.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/doc.go delete mode 100644 vendor/github.com/google/cel-go/parser/gen/generate.sh delete mode 100644 vendor/github.com/google/cel-go/parser/helper.go delete mode 100644 vendor/github.com/google/cel-go/parser/input.go delete mode 100644 vendor/github.com/google/cel-go/parser/macro.go delete mode 100644 vendor/github.com/google/cel-go/parser/options.go delete mode 100644 vendor/github.com/google/cel-go/parser/parser.go delete mode 100644 vendor/github.com/google/cel-go/parser/unescape.go delete mode 100644 vendor/github.com/google/cel-go/parser/unparser.go delete mode 100644 vendor/github.com/gorilla/websocket/.gitignore delete mode 100644 vendor/github.com/gorilla/websocket/AUTHORS delete mode 100644 vendor/github.com/gorilla/websocket/LICENSE delete mode 100644 vendor/github.com/gorilla/websocket/README.md delete mode 100644 vendor/github.com/gorilla/websocket/client.go delete mode 100644 vendor/github.com/gorilla/websocket/compression.go delete mode 100644 vendor/github.com/gorilla/websocket/conn.go delete mode 100644 vendor/github.com/gorilla/websocket/doc.go delete mode 100644 vendor/github.com/gorilla/websocket/join.go delete mode 100644 vendor/github.com/gorilla/websocket/json.go delete mode 100644 vendor/github.com/gorilla/websocket/mask.go delete mode 100644 vendor/github.com/gorilla/websocket/mask_safe.go delete mode 100644 vendor/github.com/gorilla/websocket/prepared.go delete mode 100644 vendor/github.com/gorilla/websocket/proxy.go delete mode 100644 vendor/github.com/gorilla/websocket/server.go delete mode 100644 vendor/github.com/gorilla/websocket/util.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/compile.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/fuzz.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/parse.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/types.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_proto.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/proto2_convert.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/pattern.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/readerfactory.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/string_array_flag.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/trie.go delete mode 100644 vendor/github.com/josharian/intern/README.md delete mode 100644 vendor/github.com/josharian/intern/intern.go delete mode 100644 vendor/github.com/josharian/intern/license.md delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 vendor/github.com/moby/spdystream/CONTRIBUTING.md delete mode 100644 vendor/github.com/moby/spdystream/MAINTAINERS delete mode 100644 vendor/github.com/moby/spdystream/NOTICE delete mode 100644 vendor/github.com/moby/spdystream/README.md delete mode 100644 vendor/github.com/moby/spdystream/connection.go delete mode 100644 vendor/github.com/moby/spdystream/handlers.go delete mode 100644 vendor/github.com/moby/spdystream/priority.go delete mode 100644 vendor/github.com/moby/spdystream/spdy/dictionary.go delete mode 100644 vendor/github.com/moby/spdystream/spdy/read.go delete mode 100644 vendor/github.com/moby/spdystream/spdy/types.go delete mode 100644 vendor/github.com/moby/spdystream/spdy/write.go delete mode 100644 vendor/github.com/moby/spdystream/stream.go delete mode 100644 vendor/github.com/moby/spdystream/utils.go delete mode 100644 vendor/github.com/mxk/go-flowrate/LICENSE delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/io.go delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/util.go delete mode 100644 vendor/github.com/onsi/ginkgo/v2/OWNERS delete mode 100644 vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go delete mode 100644 vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go delete mode 100644 vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go delete mode 100644 vendor/github.com/onsi/ginkgo/v2/types/types_patch.go delete mode 100644 vendor/github.com/onsi/gomega/gcustom/make_matcher.go delete mode 100644 vendor/github.com/opencontainers/go-digest/.mailmap delete mode 100644 vendor/github.com/opencontainers/go-digest/.pullapprove.yml delete mode 100644 vendor/github.com/opencontainers/go-digest/.travis.yml delete mode 100644 vendor/github.com/opencontainers/go-digest/CONTRIBUTING.md delete mode 100644 vendor/github.com/opencontainers/go-digest/LICENSE delete mode 100644 vendor/github.com/opencontainers/go-digest/LICENSE.docs delete mode 100644 vendor/github.com/opencontainers/go-digest/MAINTAINERS delete mode 100644 vendor/github.com/opencontainers/go-digest/README.md delete mode 100644 vendor/github.com/opencontainers/go-digest/algorithm.go delete mode 100644 vendor/github.com/opencontainers/go-digest/digest.go delete mode 100644 vendor/github.com/opencontainers/go-digest/digester.go delete mode 100644 vendor/github.com/opencontainers/go-digest/doc.go delete mode 100644 vendor/github.com/opencontainers/go-digest/verifiers.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/LICENSE delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmd.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages/cmdimages.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo/info.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist/list.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate/update.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/dbtime/time.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extension.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/environment.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/task.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/viewer.html delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/registry.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/component.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/concurrency.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/environment.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/names.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/output.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/suite.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/parallel.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/util.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/junit/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/README.md delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/byte.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/doc.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/empty.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int32.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int64.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/set.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/string.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/version/version.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_crio_credential_provider_config.go create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_criocredentialproviderconfigs.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-CustomNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-Default.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-DevPreviewNoUpgrade.crd.yaml rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_dnses.crd.yaml => 0000_10_config-operator_01_dnses-OKD.crd.yaml} (91%) create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-TechPreviewNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Hypershift-CustomNoUpgrade.crd.yaml rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml => 0000_10_config-operator_01_infrastructures-Hypershift-DevPreviewNoUpgrade.crd.yaml} (99%) rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml => 0000_10_config-operator_01_infrastructures-Hypershift-TechPreviewNoUpgrade.crd.yaml} (99%) create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-SelfManagedHA-CustomNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml => 0000_10_config-operator_01_infrastructures-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml} (99%) create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-CustomNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-Default.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-DevPreviewNoUpgrade.crd.yaml rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_ingresses.crd.yaml => 0000_10_config-operator_01_ingresses-OKD.crd.yaml} (99%) create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-TechPreviewNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-CustomNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-Default.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-DevPreviewNoUpgrade.crd.yaml rename vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/{0000_10_config-operator_01_networks.crd.yaml => 0000_10_config-operator_01_networks-OKD.crd.yaml} (99%) create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-TechPreviewNoUpgrade.crd.yaml create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go delete mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go delete mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go create mode 100644 vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go create mode 100644 vendor/github.com/openshift/api/config/v1alpha2/zz_generated.model_name.go create mode 100644 vendor/github.com/openshift/api/machine/v1/zz_generated.model_name.go create mode 100644 vendor/github.com/openshift/api/machine/v1beta1/zz_generated.model_name.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/alertmanagerconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/alertmanagercustomconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/audit.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backup.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backupspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicyspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicystatus.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoring.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/containerresource.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigstatus.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/gatherconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyfulciocawithrekorrootoftrust.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicypkirootoftrust.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicypublickeyrootoftrust.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicystatus.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagesigstoreverificationpolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagather.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagatherspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/metricsserverconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/persistentvolumeclaimreference.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/persistentvolumeconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/pkicertificatesubject.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyfulciosubject.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyidentity.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchexactrepository.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchremapidentity.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyrootoftrust.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionpolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/storage.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/userdefinedmonitoring.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/custom.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gatherconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gathererconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gatherers.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/insightsdatagather.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/insightsdatagatherspec.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/persistentvolumeclaimreference.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/persistentvolumeconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/storage.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/backup.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clusterimagepolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clustermonitoring.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/config_client.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/criocredentialproviderconfig.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/doc.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/imagepolicy.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/insightsdatagather.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/config_client.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/doc.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/generated_expansion.go delete mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/insightsdatagather.go delete mode 100644 vendor/github.com/openshift/machine-api-operator/test/e2e/util.go delete mode 100644 vendor/github.com/pkg/errors/.gitignore delete mode 100644 vendor/github.com/pkg/errors/.travis.yml delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/Makefile delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/go113.go delete mode 100644 vendor/github.com/pkg/errors/stack.go delete mode 100644 vendor/github.com/robfig/cron/v3/.gitignore delete mode 100644 vendor/github.com/robfig/cron/v3/.travis.yml delete mode 100644 vendor/github.com/robfig/cron/v3/LICENSE delete mode 100644 vendor/github.com/robfig/cron/v3/README.md delete mode 100644 vendor/github.com/robfig/cron/v3/chain.go delete mode 100644 vendor/github.com/robfig/cron/v3/constantdelay.go delete mode 100644 vendor/github.com/robfig/cron/v3/cron.go delete mode 100644 vendor/github.com/robfig/cron/v3/doc.go delete mode 100644 vendor/github.com/robfig/cron/v3/logger.go delete mode 100644 vendor/github.com/robfig/cron/v3/option.go delete mode 100644 vendor/github.com/robfig/cron/v3/parser.go delete mode 100644 vendor/github.com/robfig/cron/v3/spec.go delete mode 100644 vendor/github.com/stoewer/go-strcase/.gitignore delete mode 100644 vendor/github.com/stoewer/go-strcase/.golangci.yml delete mode 100644 vendor/github.com/stoewer/go-strcase/LICENSE delete mode 100644 vendor/github.com/stoewer/go-strcase/README.md delete mode 100644 vendor/github.com/stoewer/go-strcase/camel.go delete mode 100644 vendor/github.com/stoewer/go-strcase/doc.go delete mode 100644 vendor/github.com/stoewer/go-strcase/helper.go delete mode 100644 vendor/github.com/stoewer/go-strcase/kebab.go delete mode 100644 vendor/github.com/stoewer/go-strcase/snake.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/CONTRIBUTING.md delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/LICENSE delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/VERSIONING.md delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/doc.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/attr.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/doc.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/scope.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/limit.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/span.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/tracer.go delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/tracer_provider.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/.clomonitor.yml delete mode 100644 vendor/go.opentelemetry.io/otel/.codespellignore delete mode 100644 vendor/go.opentelemetry.io/otel/.codespellrc delete mode 100644 vendor/go.opentelemetry.io/otel/.gitattributes delete mode 100644 vendor/go.opentelemetry.io/otel/.gitignore delete mode 100644 vendor/go.opentelemetry.io/otel/.golangci.yml delete mode 100644 vendor/go.opentelemetry.io/otel/.lycheeignore delete mode 100644 vendor/go.opentelemetry.io/otel/.markdownlint.yaml delete mode 100644 vendor/go.opentelemetry.io/otel/CHANGELOG.md delete mode 100644 vendor/go.opentelemetry.io/otel/CODEOWNERS delete mode 100644 vendor/go.opentelemetry.io/otel/CONTRIBUTING.md delete mode 100644 vendor/go.opentelemetry.io/otel/Makefile delete mode 100644 vendor/go.opentelemetry.io/otel/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/RELEASING.md delete mode 100644 vendor/go.opentelemetry.io/otel/SECURITY-INSIGHTS.yml delete mode 100644 vendor/go.opentelemetry.io/otel/VERSIONING.md delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/context.go delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/dependencies.Dockerfile delete mode 100644 vendor/go.opentelemetry.io/otel/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/error_handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/context.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/instruments.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/meter.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/propagator.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/state.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal_logging.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/metric/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncint64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/config.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/embedded/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/meter.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/noop/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/metric/noop/noop.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/syncfloat64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/syncint64.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/propagation.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/trace_context.go delete mode 100644 vendor/go.opentelemetry.io/otel/renovate.json delete mode 100644 vendor/go.opentelemetry.io/otel/requirements.txt delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/auto.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/config.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/container.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/process.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/event.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/internal/env/env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/batch_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/simple_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/tracer.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/link.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/provider.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/noop/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/trace/noop/noop.go delete mode 100644 vendor/go.opentelemetry.io/otel/verify_released_changelog.sh delete mode 100644 vendor/go.opentelemetry.io/otel/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/versions.yaml delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/LICENSE delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.go delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.gw.go delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go delete mode 100644 vendor/golang.org/x/crypto/LICENSE delete mode 100644 vendor/golang.org/x/crypto/PATENTS delete mode 100644 vendor/golang.org/x/crypto/blowfish/block.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/cipher.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/const.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_generic.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_noasm.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/xor.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519.go delete mode 100644 vendor/golang.org/x/crypto/internal/alias/alias.go delete mode 100644 vendor/golang.org/x/crypto/internal/alias/alias_purego.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/poly1305.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s delete mode 100644 vendor/golang.org/x/crypto/ssh/buffer.go delete mode 100644 vendor/golang.org/x/crypto/ssh/certs.go delete mode 100644 vendor/golang.org/x/crypto/ssh/channel.go delete mode 100644 vendor/golang.org/x/crypto/ssh/cipher.go delete mode 100644 vendor/golang.org/x/crypto/ssh/client.go delete mode 100644 vendor/golang.org/x/crypto/ssh/client_auth.go delete mode 100644 vendor/golang.org/x/crypto/ssh/common.go delete mode 100644 vendor/golang.org/x/crypto/ssh/connection.go delete mode 100644 vendor/golang.org/x/crypto/ssh/doc.go delete mode 100644 vendor/golang.org/x/crypto/ssh/handshake.go delete mode 100644 vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go delete mode 100644 vendor/golang.org/x/crypto/ssh/kex.go delete mode 100644 vendor/golang.org/x/crypto/ssh/keys.go delete mode 100644 vendor/golang.org/x/crypto/ssh/mac.go delete mode 100644 vendor/golang.org/x/crypto/ssh/messages.go delete mode 100644 vendor/golang.org/x/crypto/ssh/mlkem.go delete mode 100644 vendor/golang.org/x/crypto/ssh/mux.go delete mode 100644 vendor/golang.org/x/crypto/ssh/server.go delete mode 100644 vendor/golang.org/x/crypto/ssh/session.go delete mode 100644 vendor/golang.org/x/crypto/ssh/ssh_gss.go delete mode 100644 vendor/golang.org/x/crypto/ssh/streamlocal.go delete mode 100644 vendor/golang.org/x/crypto/ssh/tcpip.go delete mode 100644 vendor/golang.org/x/crypto/ssh/transport.go delete mode 100644 vendor/golang.org/x/exp/LICENSE delete mode 100644 vendor/golang.org/x/exp/PATENTS delete mode 100644 vendor/golang.org/x/exp/constraints/constraints.go delete mode 100644 vendor/golang.org/x/exp/slices/cmp.go delete mode 100644 vendor/golang.org/x/exp/slices/slices.go delete mode 100644 vendor/golang.org/x/exp/slices/sort.go delete mode 100644 vendor/golang.org/x/exp/slices/zsortanyfunc.go delete mode 100644 vendor/golang.org/x/exp/slices/zsortordered.go create mode 100644 vendor/golang.org/x/net/html/nodetype_string.go create mode 100644 vendor/golang.org/x/net/http2/client_priority_go126.go create mode 100644 vendor/golang.org/x/net/http2/client_priority_go127.go create mode 100644 vendor/golang.org/x/net/internal/httpsfv/httpsfv.go delete mode 100644 vendor/golang.org/x/net/internal/socks/client.go delete mode 100644 vendor/golang.org/x/net/internal/socks/socks.go delete mode 100644 vendor/golang.org/x/net/internal/timeseries/timeseries.go delete mode 100644 vendor/golang.org/x/net/proxy/dial.go delete mode 100644 vendor/golang.org/x/net/proxy/direct.go delete mode 100644 vendor/golang.org/x/net/proxy/per_host.go delete mode 100644 vendor/golang.org/x/net/proxy/proxy.go delete mode 100644 vendor/golang.org/x/net/proxy/socks5.go delete mode 100644 vendor/golang.org/x/net/trace/events.go delete mode 100644 vendor/golang.org/x/net/trace/histogram.go delete mode 100644 vendor/golang.org/x/net/trace/trace.go delete mode 100644 vendor/golang.org/x/net/websocket/client.go delete mode 100644 vendor/golang.org/x/net/websocket/dial.go delete mode 100644 vendor/golang.org/x/net/websocket/hybi.go delete mode 100644 vendor/golang.org/x/net/websocket/server.go delete mode 100644 vendor/golang.org/x/net/websocket/websocket.go delete mode 100644 vendor/golang.org/x/sync/singleflight/singleflight.go delete mode 100644 vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s delete mode 100644 vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s delete mode 100644 vendor/golang.org/x/sys/cpu/byteorder.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_aix.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_x86.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_loong64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_loong64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mipsx.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_wasm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_big.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_little.go delete mode 100644 vendor/golang.org/x/sys/cpu/hwcap_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/parse.go delete mode 100644 vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/key.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/syscall.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/value.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go delete mode 100644 vendor/golang.org/x/text/cases/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/cases/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/cases/tables12.0.0.go rename vendor/golang.org/x/text/cases/{tables13.0.0.go => tables17.0.0.go} (60%) delete mode 100644 vendor/golang.org/x/text/cases/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/feature/plural/common.go delete mode 100644 vendor/golang.org/x/text/feature/plural/message.go delete mode 100644 vendor/golang.org/x/text/feature/plural/plural.go delete mode 100644 vendor/golang.org/x/text/feature/plural/tables.go delete mode 100644 vendor/golang.org/x/text/internal/catmsg/catmsg.go delete mode 100644 vendor/golang.org/x/text/internal/catmsg/codec.go delete mode 100644 vendor/golang.org/x/text/internal/catmsg/varint.go delete mode 100644 vendor/golang.org/x/text/internal/format/format.go delete mode 100644 vendor/golang.org/x/text/internal/format/parser.go delete mode 100644 vendor/golang.org/x/text/internal/number/common.go delete mode 100644 vendor/golang.org/x/text/internal/number/decimal.go delete mode 100644 vendor/golang.org/x/text/internal/number/format.go delete mode 100644 vendor/golang.org/x/text/internal/number/number.go delete mode 100644 vendor/golang.org/x/text/internal/number/pattern.go delete mode 100644 vendor/golang.org/x/text/internal/number/roundingmode_string.go delete mode 100644 vendor/golang.org/x/text/internal/number/tables.go delete mode 100644 vendor/golang.org/x/text/internal/stringset/set.go delete mode 100644 vendor/golang.org/x/text/message/catalog.go delete mode 100644 vendor/golang.org/x/text/message/catalog/catalog.go delete mode 100644 vendor/golang.org/x/text/message/catalog/dict.go delete mode 100644 vendor/golang.org/x/text/message/catalog/go19.go delete mode 100644 vendor/golang.org/x/text/message/catalog/gopre19.go delete mode 100644 vendor/golang.org/x/text/message/doc.go delete mode 100644 vendor/golang.org/x/text/message/format.go delete mode 100644 vendor/golang.org/x/text/message/message.go delete mode 100644 vendor/golang.org/x/text/message/print.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go create mode 100644 vendor/golang.org/x/text/unicode/bidi/tables17.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables12.0.0.go rename vendor/golang.org/x/text/unicode/norm/{tables13.0.0.go => tables17.0.0.go} (53%) delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables9.0.0.go delete mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases_go122.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go delete mode 100644 vendor/google.golang.org/grpc/AUTHORS delete mode 100644 vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md delete mode 100644 vendor/google.golang.org/grpc/CONTRIBUTING.md delete mode 100644 vendor/google.golang.org/grpc/GOVERNANCE.md delete mode 100644 vendor/google.golang.org/grpc/MAINTAINERS.md delete mode 100644 vendor/google.golang.org/grpc/Makefile delete mode 100644 vendor/google.golang.org/grpc/NOTICE.txt delete mode 100644 vendor/google.golang.org/grpc/README.md delete mode 100644 vendor/google.golang.org/grpc/SECURITY.md delete mode 100644 vendor/google.golang.org/grpc/attributes/attributes.go delete mode 100644 vendor/google.golang.org/grpc/backoff.go delete mode 100644 vendor/google.golang.org/grpc/backoff/backoff.go delete mode 100644 vendor/google.golang.org/grpc/balancer/balancer.go delete mode 100644 vendor/google.golang.org/grpc/balancer/base/balancer.go delete mode 100644 vendor/google.golang.org/grpc/balancer/base/base.go delete mode 100644 vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go delete mode 100644 vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go delete mode 100644 vendor/google.golang.org/grpc/balancer/grpclb/state/state.go delete mode 100644 vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go delete mode 100644 vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go delete mode 100644 vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go delete mode 100644 vendor/google.golang.org/grpc/balancer/subconn.go delete mode 100644 vendor/google.golang.org/grpc/balancer_wrapper.go delete mode 100644 vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go delete mode 100644 vendor/google.golang.org/grpc/call.go delete mode 100644 vendor/google.golang.org/grpc/channelz/channelz.go delete mode 100644 vendor/google.golang.org/grpc/clientconn.go delete mode 100644 vendor/google.golang.org/grpc/codec.go delete mode 100644 vendor/google.golang.org/grpc/codes/code_string.go delete mode 100644 vendor/google.golang.org/grpc/codes/codes.go delete mode 100644 vendor/google.golang.org/grpc/connectivity/connectivity.go delete mode 100644 vendor/google.golang.org/grpc/credentials/credentials.go delete mode 100644 vendor/google.golang.org/grpc/credentials/insecure/insecure.go delete mode 100644 vendor/google.golang.org/grpc/credentials/tls.go delete mode 100644 vendor/google.golang.org/grpc/dialoptions.go delete mode 100644 vendor/google.golang.org/grpc/doc.go delete mode 100644 vendor/google.golang.org/grpc/encoding/encoding.go delete mode 100644 vendor/google.golang.org/grpc/encoding/encoding_v2.go delete mode 100644 vendor/google.golang.org/grpc/encoding/gzip/gzip.go delete mode 100644 vendor/google.golang.org/grpc/encoding/internal/internal.go delete mode 100644 vendor/google.golang.org/grpc/encoding/proto/proto.go delete mode 100644 vendor/google.golang.org/grpc/experimental/stats/metricregistry.go delete mode 100644 vendor/google.golang.org/grpc/experimental/stats/metrics.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/component.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/grpclog.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/internal/grpclog.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/internal/logger.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/logger.go delete mode 100644 vendor/google.golang.org/grpc/grpclog/loggerv2.go delete mode 100644 vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go delete mode 100644 vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go delete mode 100644 vendor/google.golang.org/grpc/interceptor.go delete mode 100644 vendor/google.golang.org/grpc/internal/backoff/backoff.go delete mode 100644 vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go delete mode 100644 vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go delete mode 100644 vendor/google.golang.org/grpc/internal/balancer/weight/weight.go delete mode 100644 vendor/google.golang.org/grpc/internal/balancerload/load.go delete mode 100644 vendor/google.golang.org/grpc/internal/binarylog/binarylog.go delete mode 100644 vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go delete mode 100644 vendor/google.golang.org/grpc/internal/binarylog/env_config.go delete mode 100644 vendor/google.golang.org/grpc/internal/binarylog/method_logger.go delete mode 100644 vendor/google.golang.org/grpc/internal/binarylog/sink.go delete mode 100644 vendor/google.golang.org/grpc/internal/buffer/unbounded.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/channel.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/channelmap.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/funcs.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/logging.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/server.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/socket.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/subchannel.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/trace.go delete mode 100644 vendor/google.golang.org/grpc/internal/credentials/credentials.go delete mode 100644 vendor/google.golang.org/grpc/internal/credentials/spiffe.go delete mode 100644 vendor/google.golang.org/grpc/internal/credentials/syscallconn.go delete mode 100644 vendor/google.golang.org/grpc/internal/credentials/util.go delete mode 100644 vendor/google.golang.org/grpc/internal/envconfig/envconfig.go delete mode 100644 vendor/google.golang.org/grpc/internal/envconfig/observability.go delete mode 100644 vendor/google.golang.org/grpc/internal/envconfig/xds.go delete mode 100644 vendor/google.golang.org/grpc/internal/experimental.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/event.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/compressor.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/grpcutil.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/metadata.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/method.go delete mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/regex.go delete mode 100644 vendor/google.golang.org/grpc/internal/idle/idle.go delete mode 100644 vendor/google.golang.org/grpc/internal/internal.go delete mode 100644 vendor/google.golang.org/grpc/internal/metadata/metadata.go delete mode 100644 vendor/google.golang.org/grpc/internal/pretty/pretty.go delete mode 100644 vendor/google.golang.org/grpc/internal/proxyattributes/proxyattributes.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/config_selector.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go delete mode 100644 vendor/google.golang.org/grpc/internal/resolver/unix/unix.go delete mode 100644 vendor/google.golang.org/grpc/internal/serviceconfig/duration.go delete mode 100644 vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go delete mode 100644 vendor/google.golang.org/grpc/internal/stats/labels.go delete mode 100644 vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go delete mode 100644 vendor/google.golang.org/grpc/internal/stats/stats.go delete mode 100644 vendor/google.golang.org/grpc/internal/status/status.go delete mode 100644 vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go delete mode 100644 vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go delete mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_others.go delete mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go delete mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/client_stream.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/controlbuf.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/defaults.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/flowcontrol.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/handler_server.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/http2_client.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/http2_server.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/http_util.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/logging.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/networktype/networktype.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/proxy.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/server_stream.go delete mode 100644 vendor/google.golang.org/grpc/internal/transport/transport.go delete mode 100644 vendor/google.golang.org/grpc/keepalive/keepalive.go delete mode 100644 vendor/google.golang.org/grpc/mem/buffer_pool.go delete mode 100644 vendor/google.golang.org/grpc/mem/buffer_slice.go delete mode 100644 vendor/google.golang.org/grpc/mem/buffers.go delete mode 100644 vendor/google.golang.org/grpc/metadata/metadata.go delete mode 100644 vendor/google.golang.org/grpc/peer/peer.go delete mode 100644 vendor/google.golang.org/grpc/picker_wrapper.go delete mode 100644 vendor/google.golang.org/grpc/preloader.go delete mode 100644 vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go delete mode 100644 vendor/google.golang.org/grpc/resolver/map.go delete mode 100644 vendor/google.golang.org/grpc/resolver/resolver.go delete mode 100644 vendor/google.golang.org/grpc/resolver_wrapper.go delete mode 100644 vendor/google.golang.org/grpc/rpc_util.go delete mode 100644 vendor/google.golang.org/grpc/server.go delete mode 100644 vendor/google.golang.org/grpc/service_config.go delete mode 100644 vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go delete mode 100644 vendor/google.golang.org/grpc/stats/handlers.go delete mode 100644 vendor/google.golang.org/grpc/stats/metrics.go delete mode 100644 vendor/google.golang.org/grpc/stats/stats.go delete mode 100644 vendor/google.golang.org/grpc/status/status.go delete mode 100644 vendor/google.golang.org/grpc/stream.go delete mode 100644 vendor/google.golang.org/grpc/stream_interfaces.go delete mode 100644 vendor/google.golang.org/grpc/tap/tap.go delete mode 100644 vendor/google.golang.org/grpc/trace.go delete mode 100644 vendor/google.golang.org/grpc/trace_notrace.go delete mode 100644 vendor/google.golang.org/grpc/trace_withtrace.go delete mode 100644 vendor/google.golang.org/grpc/version.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/decode.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/doc.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/encode.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go delete mode 100644 vendor/google.golang.org/protobuf/internal/editionssupport/editions.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/encode.go delete mode 100644 vendor/google.golang.org/protobuf/protoadapt/convert.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/editions.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/proto.go delete mode 100644 vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go delete mode 100644 vendor/google.golang.org/protobuf/types/dynamicpb/types.go delete mode 100644 vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go delete mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS delete mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/validation/path/name.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/doc.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/doc.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/stream.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/portforward/constants.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/doc.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/remotecommand/constants.go delete mode 100644 vendor/k8s.io/apimachinery/third_party/forked/golang/netutil/addr.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/attributes.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/audit.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/chain.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/config.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/configuration/configuration_manager.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/decorator.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/errors.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/handler.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/initializer/initializer.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/initializer/interfaces.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/interfaces.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/metrics/metrics.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/activation.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/condition.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/mutation.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/kubeconfig.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/statuserror.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/interfaces.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/matchconditions/interface.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/matchconditions/matcher.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/plugin.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/reinvocationcontext.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/request/admissionreview.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/request/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugins.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/reinvocation.go delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/util.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/install/install.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/types_encryption.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/types_encryption.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/helpers.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.protomessage.pb.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/register.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/zz_generated.model_name.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/cel/config.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/context.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/evaluator.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/format.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/metrics.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/request.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/scheme.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/audit/union.go delete mode 100644 vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go delete mode 100644 vendor/k8s.io/apiserver/pkg/authentication/user/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/authentication/user/user.go delete mode 100644 vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go delete mode 100644 vendor/k8s.io/apiserver/pkg/authorization/authorizer/rule.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/cidr.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/adaptor.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/equality.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/maplist.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/schemas.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/typeprovider.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/valuesreflect.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/valuesunstructured.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/environment/base.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/environment/environment.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/errors.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/escaping.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/format.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/ip.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/lazy/lazy.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/authz.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/cidr.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/cost.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/format.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/ip.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/jsonpatch.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/libraries.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/lists.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/quantity.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/regex.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/semverlib.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/test.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/urls.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/limits.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/dynamic/objects.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/jsonpatch.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/typeresolver.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/combined.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/definitions.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/discovery.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/refs.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/resolver.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/quantity.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/semver.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/types.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/url.go delete mode 100644 vendor/k8s.io/apiserver/pkg/cel/value.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/context.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/doc.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/methods.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/received_time.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/server_shutdown_signal.go delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go delete mode 100644 vendor/k8s.io/apiserver/pkg/features/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/features/kube_features.go delete mode 100644 vendor/k8s.io/apiserver/pkg/quota/v1/OWNERS delete mode 100644 vendor/k8s.io/apiserver/pkg/quota/v1/interfaces.go delete mode 100644 vendor/k8s.io/apiserver/pkg/quota/v1/resources.go delete mode 100644 vendor/k8s.io/apiserver/pkg/server/egressselector/config.go delete mode 100644 vendor/k8s.io/apiserver/pkg/server/egressselector/egress_selector.go delete mode 100644 vendor/k8s.io/apiserver/pkg/server/egressselector/metrics/metrics.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/compatibility/registry.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/compatibility/version.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/authentication.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/client.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/error.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/metrics.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/serviceresolver.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/validation.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go delete mode 100644 vendor/k8s.io/apiserver/pkg/util/x509metrics/server_cert_deprecations.go delete mode 100644 vendor/k8s.io/apiserver/pkg/warning/context.go delete mode 100644 vendor/k8s.io/client-go/tools/portforward/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/portforward/doc.go delete mode 100644 vendor/k8s.io/client-go/tools/portforward/fallback_dialer.go delete mode 100644 vendor/k8s.io/client-go/tools/portforward/portforward.go delete mode 100644 vendor/k8s.io/client-go/tools/portforward/tunneling_connection.go delete mode 100644 vendor/k8s.io/client-go/tools/portforward/tunneling_dialer.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/doc.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/errorstream.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/fallback.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/reader.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/resize.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/spdy.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v1.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v2.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v3.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v4.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v5.go delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/websocket.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/informerwatcher.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/retrywatcher.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/until.go delete mode 100644 vendor/k8s.io/client-go/transport/spdy/spdy.go delete mode 100644 vendor/k8s.io/client-go/transport/websocket/roundtripper.go delete mode 100644 vendor/k8s.io/client-go/util/exec/exec.go delete mode 100644 vendor/k8s.io/component-base/compatibility/OWNERS delete mode 100644 vendor/k8s.io/component-base/compatibility/registry.go delete mode 100644 vendor/k8s.io/component-base/compatibility/version.go delete mode 100644 vendor/k8s.io/component-base/logs/OWNERS delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/doc.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/kube_features.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/options.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/options_no_slog.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/options_slog.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/pflags.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/registry.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/text.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/types.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/component-base/logs/api/v1/zz_generated.model_name.go delete mode 100644 vendor/k8s.io/component-base/logs/internal/setverbositylevel/setverbositylevel.go delete mode 100644 vendor/k8s.io/component-base/logs/klogflags/klogflags.go delete mode 100644 vendor/k8s.io/component-base/logs/logs.go delete mode 100644 vendor/k8s.io/component-base/logs/testinit/testinit.go delete mode 100644 vendor/k8s.io/component-base/metrics/prometheus/compatversion/metrics.go delete mode 100644 vendor/k8s.io/component-base/tracing/OWNERS delete mode 100644 vendor/k8s.io/component-base/tracing/api/v1/config.go delete mode 100644 vendor/k8s.io/component-base/tracing/api/v1/doc.go delete mode 100644 vendor/k8s.io/component-base/tracing/api/v1/types.go delete mode 100644 vendor/k8s.io/component-base/tracing/api/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/component-base/tracing/api/v1/zz_generated.model_name.go delete mode 100644 vendor/k8s.io/component-base/tracing/tracing.go delete mode 100644 vendor/k8s.io/component-base/tracing/utils.go delete mode 100644 vendor/k8s.io/component-base/zpages/features/doc.go delete mode 100644 vendor/k8s.io/component-base/zpages/features/kube_features.go delete mode 100644 vendor/k8s.io/component-helpers/node/util/sysctl/namespace.go delete mode 100644 vendor/k8s.io/component-helpers/node/util/sysctl/sysctl.go delete mode 100644 vendor/k8s.io/component-helpers/resource/OWNERS delete mode 100644 vendor/k8s.io/component-helpers/resource/helpers.go delete mode 100644 vendor/k8s.io/component-helpers/scheduling/corev1/doc.go delete mode 100644 vendor/k8s.io/component-helpers/scheduling/corev1/helpers.go delete mode 100644 vendor/k8s.io/component-helpers/scheduling/corev1/nodeaffinity/nodeaffinity.go delete mode 100644 vendor/k8s.io/controller-manager/LICENSE delete mode 100644 vendor/k8s.io/controller-manager/pkg/features/OWNERS delete mode 100644 vendor/k8s.io/controller-manager/pkg/features/kube_features.go delete mode 100644 vendor/k8s.io/klog/v2/internal/verbosity/verbosity.go delete mode 100644 vendor/k8s.io/klog/v2/textlogger/options.go delete mode 100644 vendor/k8s.io/klog/v2/textlogger/textlogger.go delete mode 100644 vendor/k8s.io/klog/v2/textlogger/textlogger_slog.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/pools.go (64%) create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/state.go (63%) rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/token.go (87%) create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/migrate.sh create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/govalidator/LICENSE delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/govalidator/patterns.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/govalidator/validator.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/errors/.gitignore delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/errors/api.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/errors/doc.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/errors/headers.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/errors/schema.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/.gitignore delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/bson.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/bson/objectid.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/date.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/default.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/doc.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/duration.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/format.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/kubernetes-extensions.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/time.go delete mode 100644 vendor/k8s.io/kubectl/pkg/scale/scale.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/podutils/podutils.go delete mode 100644 vendor/k8s.io/kubelet/pkg/apis/OWNERS delete mode 100644 vendor/k8s.io/kubelet/pkg/apis/well_known_labels.go delete mode 100644 vendor/k8s.io/kubelet/pkg/apis/well_known_openshift_labels.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/service/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/service/util.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/service/warnings.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/v1/pod/util.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/api/v1/service/util.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/apps/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/apps/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/apps/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/annotations.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/batch/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/batch/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/batch/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/helpers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/certificates/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/helper/helpers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/helper/qos/qos.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/install/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/install/install.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/json.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/objectreference.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/pods/helpers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/resource.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/taint.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/toleration.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/conversion.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/defaults.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/helper/helpers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.validations.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/events.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/names.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation_patch.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/extensions/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/extensions/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/extensions/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/extensions/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/networking/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/networking/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/networking/register.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/networking/types.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/apis/networking/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/capabilities/capabilities.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/capabilities/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/controller/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/controller/controller_ref_manager.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/controller/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/features/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/pkg/features/client_adapter.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/features/kube_features.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/features/openshift_features.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/hash/hash.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/labels/.readonly delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/labels/doc.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/labels/labels.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/parsers/parsers.go delete mode 100644 vendor/k8s.io/kubernetes/pkg/util/taints/taints.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/README.md delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/bugs.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/expect.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/flake_reporting_util.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/framework.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/get.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/ginkgologger.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/gomega.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/internal/junit/junit.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/internal/junit/junit_data_races.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/internal/junit/junit_no_data_races.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/kubectl/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/kubectl/builder.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/kubectl/kubectl_utils.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/log.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/namespacedname.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/helper.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/node_killer.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/resource.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/ssh.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/node/wait.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/nodes_util.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/create.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/delete.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/dial.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/get.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/node_selection.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/pod_client.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/resource.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/utils.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/ports.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/provider.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/size.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/skipper/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/skipper/skipper.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/ssh/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/ssh/ssh.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/test_context.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/testfiles/.import-restrictions delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/testfiles/testfiles.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/timeouts.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/framework/util.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/README.md delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/embed.go delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/flexvolume/attachable-with-long-mount delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/flexvolume/dummy delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/flexvolume/dummy-attachable delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/gpu/gce/nvidia-driver-installer.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/gpu/gce/nvidia-gpu-device-plugin.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/agnhost-primary-deployment.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/agnhost-primary-service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/agnhost-replica-service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/frontend-deployment.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/frontend-service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/legacy/frontend-controller.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/legacy/redis-slave-controller.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/redis-master-deployment.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/redis-master-service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/redis-slave-deployment.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/guestbook/redis-slave-service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-deployment1.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-deployment2.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-deployment3.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-primary-controller.json.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-primary-service.json delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/agnhost-rc.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/busybox-cronjob.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/busybox-pod.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/pause-pod.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/kubectl/pod-with-readiness-probe.yaml.in delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/pod delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cassandra/controller.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cassandra/pdb.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cassandra/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cassandra/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cassandra/tester.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cockroachdb/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/cockroachdb/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/etcd/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/etcd/pdb.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/etcd/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/etcd/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/etcd/tester.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-galera/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-galera/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-upgrade/configmap.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-upgrade/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-upgrade/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/mysql-upgrade/tester.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/zookeeper/service.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/statefulset/zookeeper/statefulset.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/any-volume-datasource/crd/hello-populator-crd.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/any-volume-datasource/crd/populator.storage.k8s.io_volumepopulators.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/any-volume-datasource/hello-populator-deploy.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/any-volume-datasource/volume-data-source-validator/rbac-data-source-validator.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/any-volume-datasource/volume-data-source-validator/setup-data-source-validator.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/controller-role.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-health-monitor/external-health-monitor-controller/rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-resizer/rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/csi-snapshotter/rbac-csi-snapshotter.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/csi-hostpath-plugin.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/run_group_snapshot_e2e.sh delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/csi-controller-rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/node_ds.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/README.md delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-driverinfo.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-snapshotclass.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/e2e-test-rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-attacher.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-resizer.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver-snapshotter.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driverinfo.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-rbac.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-storageclass.yaml delete mode 100644 vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/update-hostpath.sh delete mode 100644 vendor/k8s.io/kubernetes/test/utils/admission_webhook.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/audit.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/conditions.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/create_resources.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/delete_resources.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/density_utils.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/deployment.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/format/format.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/image/OWNERS delete mode 100644 vendor/k8s.io/kubernetes/test/utils/image/csi_manifest.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/image/manifest.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/kubeconfig/kubeconfig.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/node.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/paths.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/pki_helpers.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/pod_store.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/replicaset.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/runners.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/tmpdir.go delete mode 100644 vendor/k8s.io/kubernetes/test/utils/update_resources.go delete mode 100644 vendor/k8s.io/pod-security-admission/LICENSE delete mode 100644 vendor/k8s.io/pod-security-admission/api/attributes.go delete mode 100644 vendor/k8s.io/pod-security-admission/api/constants.go delete mode 100644 vendor/k8s.io/pod-security-admission/api/doc.go delete mode 100644 vendor/k8s.io/pod-security-admission/api/helpers.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_allowPrivilegeEscalation.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_appArmorProfile.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_capabilities_baseline.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_capabilities_restricted.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_hostNamespaces.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_hostPathVolumes.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_hostPorts.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_hostProbesAndhostLifecycle.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_privileged.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_procMount_baseline.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_procMount_restricted.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_restrictedVolumes.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_runAsNonRoot.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_runAsUser.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_seLinuxOptions.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_seccompProfile_baseline.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_seccompProfile_restricted.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_sysctls.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/check_windowsHostProcess.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/checks.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/doc.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/helpers.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/registry.go delete mode 100644 vendor/k8s.io/pod-security-admission/policy/visitor.go create mode 100644 vendor/k8s.io/utils/buffer/ring_fixed.go delete mode 100644 vendor/k8s.io/utils/exec/fixup_go118.go delete mode 100644 vendor/k8s.io/utils/exec/fixup_go119.go delete mode 100644 vendor/k8s.io/utils/integer/integer.go delete mode 100644 vendor/k8s.io/utils/path/file.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/LICENSE delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/conn.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics/metrics.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics/metrics.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.proto delete mode 100644 vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client_grpc.pb.go diff --git a/go.mod b/go.mod index 91db3dcc7..12dd8264b 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/openshift/machine-api-provider-aws go 1.25.0 +replace github.com/openshift/api => ../api + require ( github.com/aws/aws-sdk-go v1.55.8 github.com/blang/semver v3.5.1+incompatible @@ -17,8 +19,8 @@ require ( k8s.io/apiserver v0.35.2 k8s.io/client-go v0.35.2 k8s.io/component-base v0.35.2 - k8s.io/klog/v2 v2.130.1 - k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 + k8s.io/klog/v2 v2.140.0 + k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 sigs.k8s.io/controller-runtime v0.23.3 sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250520071515-71f7db556ca5 sigs.k8s.io/controller-tools v0.19.0 @@ -34,7 +36,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chai2010/gettext-go v1.0.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.12.2 // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/color v1.18.0 // indirect @@ -44,7 +46,18 @@ require ( github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gobuffalo/flect v1.0.3 // indirect github.com/google/btree v1.1.3 // indirect @@ -55,10 +68,8 @@ require ( github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect - github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect @@ -87,15 +98,15 @@ require ( go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.30.0 // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/mod v0.33.0 // indirect + golang.org/x/net v0.50.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.38.0 // indirect - golang.org/x/text v0.32.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.39.0 // indirect + golang.org/x/tools v0.42.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect @@ -109,12 +120,12 @@ require ( k8s.io/cli-runtime v0.35.2 // indirect k8s.io/code-generator v0.35.2 // indirect k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect - k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect + k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 // indirect k8s.io/kubectl v0.35.2 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/kustomize/api v0.20.1 // indirect sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) diff --git a/go.sum b/go.sum index 385eb75d1..25257cce8 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= -github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= -github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= @@ -143,8 +143,36 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= @@ -243,8 +271,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -287,8 +313,6 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= -github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= -github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= @@ -343,8 +367,6 @@ github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= -github.com/openshift/api v0.0.0-20260310125822-c9c9ac0c889c h1:Nh/QU5htvdGtCN1o5VGtThy+ncw8zbhfG7n+bqecNvM= -github.com/openshift/api v0.0.0-20260310125822-c9c9ac0c889c/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= github.com/openshift/client-go v0.0.0-20260305144912-aba4b273812d h1:TCwd4qbMSPfQaxrQD6e9RPw1Jc3qLGaHf8el4RNJjM0= github.com/openshift/client-go v0.0.0-20260305144912-aba4b273812d/go.mod h1:7QeQMJHhEpcMankJSrwuMALpRRM1ADtaFyURHXyPSSQ= github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20250910145856-21d03d30056d h1:+sqUThLi/lmgT5/scmmjnS6+RZFtbdxRAscNfCPyLPI= @@ -538,13 +560,13 @@ golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4= golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= -golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -558,22 +580,22 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= -golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= -golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -626,14 +648,14 @@ k8s.io/component-base v0.35.2 h1:btgR+qNrpWuRSuvWSnQYsZy88yf5gVwemvz0yw79pGc= k8s.io/component-base v0.35.2/go.mod h1:B1iBJjooe6xIJYUucAxb26RwhAjzx0gHnqO9htWIX+0= k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b h1:gMplByicHV/TJBizHd9aVEsTYoJBnnUAT5MHlTkbjhQ= k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b/go.mod h1:CgujABENc3KuTrcsdpGmrrASjtQsWCT7R99mEV4U/fM= -k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= -k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE= -k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= +k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 h1:A7Lby6ekC6nv+6oO38huCMFBRP0Os+tIeq1GkwxOQes= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= k8s.io/kubectl v0.35.2 h1:aSmqhSOfsoG9NR5oR8OD5eMKpLN9x8oncxfqLHbJJII= k8s.io/kubectl v0.35.2/go.mod h1:+OJC779UsDJGxNPbHxCwvb4e4w9Eh62v/DNYU2TlsyM= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU= +k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= @@ -654,7 +676,7 @@ sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482 h1:2WOzJpHUBVrrkDjU4KBT8n5LDcj824eX0I5UKcgeRUs= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/vendor/cel.dev/expr/.bazelversion b/vendor/cel.dev/expr/.bazelversion deleted file mode 100644 index 13c50892b..000000000 --- a/vendor/cel.dev/expr/.bazelversion +++ /dev/null @@ -1,2 +0,0 @@ -7.3.2 -# Keep this pinned version in parity with cel-go diff --git a/vendor/cel.dev/expr/.gitattributes b/vendor/cel.dev/expr/.gitattributes deleted file mode 100644 index 3de1ec213..000000000 --- a/vendor/cel.dev/expr/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.pb.go linguist-generated=true -*.pb.go -diff -merge diff --git a/vendor/cel.dev/expr/.gitignore b/vendor/cel.dev/expr/.gitignore deleted file mode 100644 index 0d4fed27c..000000000 --- a/vendor/cel.dev/expr/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bazel-* -MODULE.bazel.lock diff --git a/vendor/cel.dev/expr/BUILD.bazel b/vendor/cel.dev/expr/BUILD.bazel deleted file mode 100644 index f5bda3bb1..000000000 --- a/vendor/cel.dev/expr/BUILD.bazel +++ /dev/null @@ -1,33 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -go_library( - name = "expr", - srcs = [ - "checked.pb.go", - "eval.pb.go", - "explain.pb.go", - "syntax.pb.go", - "value.pb.go", - ], - importpath = "cel.dev/expr", - visibility = ["//visibility:public"], - deps = [ - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - "@org_golang_google_protobuf//types/known/anypb", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/emptypb", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_google_protobuf//types/known/timestamppb", - ], -) - -alias( - name = "go_default_library", - actual = ":expr", - visibility = ["//visibility:public"], -) diff --git a/vendor/cel.dev/expr/CODE_OF_CONDUCT.md b/vendor/cel.dev/expr/CODE_OF_CONDUCT.md deleted file mode 100644 index 59908e2d8..000000000 --- a/vendor/cel.dev/expr/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,25 +0,0 @@ -# Contributor Code of Conduct -## Version 0.1.1 (adapted from 0.3b-angular) - -As contributors and maintainers of the Common Expression Language -(CEL) project, we pledge to respect everyone who contributes by -posting issues, updating documentation, submitting pull requests, -providing feedback in comments, and any other activities. - -Communication through any of CEL's channels (GitHub, Gitter, IRC, -mailing lists, Google+, Twitter, etc.) must be constructive and never -resort to personal attacks, trolling, public or private harassment, -insults, or other unprofessional conduct. - -We promise to extend courtesy and respect to everyone involved in this -project regardless of gender, gender identity, sexual orientation, -disability, age, race, ethnicity, religion, or level of experience. We -expect anyone contributing to the project to do the same. - -If any member of the community violates this code of conduct, the -maintainers of the CEL project may take action, removing issues, -comments, and PRs or blocking accounts as deemed appropriate. - -If you are subject to or witness unacceptable behavior, or have any -other concerns, please email us at -[cel-conduct@google.com](mailto:cel-conduct@google.com). diff --git a/vendor/cel.dev/expr/CONTRIBUTING.md b/vendor/cel.dev/expr/CONTRIBUTING.md deleted file mode 100644 index 8f5fd5c31..000000000 --- a/vendor/cel.dev/expr/CONTRIBUTING.md +++ /dev/null @@ -1,32 +0,0 @@ -# How to Contribute - -We'd love to accept your patches and contributions to this project. There are a -few guidelines you need to follow. - -## Contributor License Agreement - -Contributions to this project must be accompanied by a Contributor License -Agreement. You (or your employer) retain the copyright to your contribution, -this simply gives us permission to use and redistribute your contributions as -part of the project. Head over to to see -your current agreements on file or to sign a new one. - -You generally only need to submit a CLA once, so if you've already submitted one -(even if it was for a different project), you probably don't need to do it -again. - -## Code reviews - -All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult -[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more -information on using pull requests. - -## What to expect from maintainers - -Expect maintainers to respond to new issues or pull requests within a week. -For outstanding and ongoing issues and particularly for long-running -pull requests, expect the maintainers to review within a week of a -contributor asking for a new review. There is no commitment to resolution -- -merging or closing a pull request, or fixing or closing an issue -- because some -issues will require more discussion than others. diff --git a/vendor/cel.dev/expr/GOVERNANCE.md b/vendor/cel.dev/expr/GOVERNANCE.md deleted file mode 100644 index 0a525bc17..000000000 --- a/vendor/cel.dev/expr/GOVERNANCE.md +++ /dev/null @@ -1,43 +0,0 @@ -# Project Governance - -This document defines the governance process for the CEL language. CEL is -Google-developed, but openly governed. Major contributors to the CEL -specification and its corresponding implementations constitute the CEL -Language Council. New members may be added by a unanimous vote of the -Council. - -The MAINTAINERS.md file lists the members of the CEL Language Council, and -unofficially indicates the "areas of expertise" of each member with respect -to the publicly available CEL repos. - -## Code Changes - -Code changes must follow the standard pull request (PR) model documented in the -CONTRIBUTING.md for each CEL repo. All fixes and features must be reviewed by a -maintainer. The maintainer reserves the right to request that any feature -request (FR) or PR be reviewed by the language council. - -## Syntax and Semantic Changes - -Syntactic and semantic changes must be reviewed by the CEL Language Council. -Maintainers may also request language council review at their discretion. - -The review process is as follows: - -- Create a Feature Request in the CEL-Spec repo. The feature description will - serve as an abstract for the detailed design document. -- Co-develop a design document with the Language Council. -- Once the proposer gives the design document approval, the document will be - linked to the FR in the CEL-Spec repo and opened for comments to members of - the cel-lang-discuss@googlegroups.com. -- The Language Council will review the design doc at the next council meeting - (once every three weeks) and the council decision included in the document. - -If the proposal is approved, the spec will be updated by a maintainer (if -applicable) and a rationale will be included in the CEL-Spec wiki to ensure -future developers may follow CEL's growth and direction over time. - -Approved proposals may be implemented by the proposer or by the maintainers as -the parties see fit. At the discretion of the maintainer, changes from the -approved design are permitted during implementation if they improve the user -experience and clarity of the feature. diff --git a/vendor/cel.dev/expr/MAINTAINERS.md b/vendor/cel.dev/expr/MAINTAINERS.md deleted file mode 100644 index 1ed2eb8ab..000000000 --- a/vendor/cel.dev/expr/MAINTAINERS.md +++ /dev/null @@ -1,13 +0,0 @@ -# CEL Language Council - -| Name | Company | Area of Expertise | -|-----------------|--------------|-------------------| -| Alfred Fuller | Facebook | cel-cpp, cel-spec | -| Jim Larson | Google | cel-go, cel-spec | -| Matthais Blume | Google | cel-spec | -| Tristan Swadell | Google | cel-go, cel-spec | - -## Emeritus - -* Sanjay Ghemawat (Google) -* Wolfgang Grieskamp (Facebook) diff --git a/vendor/cel.dev/expr/MODULE.bazel b/vendor/cel.dev/expr/MODULE.bazel deleted file mode 100644 index cb98ed599..000000000 --- a/vendor/cel.dev/expr/MODULE.bazel +++ /dev/null @@ -1,56 +0,0 @@ -module( - name = "cel-spec", -) - -bazel_dep( - name = "bazel_skylib", - version = "1.7.1", -) -bazel_dep( - name = "gazelle", - version = "0.39.1", - repo_name = "bazel_gazelle", -) -bazel_dep( - name = "protobuf", - version = "27.1", - repo_name = "com_google_protobuf", -) -bazel_dep( - name = "rules_cc", - version = "0.0.17", -) -bazel_dep( - name = "rules_go", - version = "0.53.0", - repo_name = "io_bazel_rules_go", -) -bazel_dep( - name = "rules_java", - version = "7.6.5", -) -bazel_dep( - name = "rules_proto", - version = "7.0.2", -) -bazel_dep( - name = "rules_python", - version = "0.35.0", -) - -### PYTHON ### -python = use_extension("@rules_python//python/extensions:python.bzl", "python") -python.toolchain( - ignore_root_user_error = True, - python_version = "3.11", -) - -go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.23.0") - -go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "//:go.mod") -use_repo( - go_deps, - "org_golang_google_protobuf", -) diff --git a/vendor/cel.dev/expr/README.md b/vendor/cel.dev/expr/README.md deleted file mode 100644 index 42d67f87c..000000000 --- a/vendor/cel.dev/expr/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Common Expression Language - -The Common Expression Language (CEL) implements common semantics for expression -evaluation, enabling different applications to more easily interoperate. - -Key Applications - -* Security policy: organizations have complex infrastructure and need common - tooling to reason about the system as a whole -* Protocols: expressions are a useful data type and require interoperability - across programming languages and platforms. - - -Guiding philosophy: - -1. Keep it small & fast. - * CEL evaluates in linear time, is mutation free, and not Turing-complete. - This limitation is a feature of the language design, which allows the - implementation to evaluate orders of magnitude faster than equivalently - sandboxed JavaScript. -2. Make it extensible. - * CEL is designed to be embedded in applications, and allows for - extensibility via its context which allows for functions and data to be - provided by the software that embeds it. -3. Developer-friendly. - * The language is approachable to developers. The initial spec was based - on the experience of developing Firebase Rules and usability testing - many prior iterations. - * The library itself and accompanying toolings should be easy to adopt by - teams that seek to integrate CEL into their platforms. - -The required components of a system that supports CEL are: - -* The textual representation of an expression as written by a developer. It is - of similar syntax to expressions in C/C++/Java/JavaScript -* A representation of the program's abstract syntax tree (AST). -* A compiler library that converts the textual representation to the binary - representation. This can be done ahead of time (in the control plane) or - just before evaluation (in the data plane). -* A context containing one or more typed variables, often protobuf messages. - Most use-cases will use `attribute_context.proto` -* An evaluator library that takes the binary format in the context and - produces a result, usually a Boolean. - -For use cases which require persistence or cross-process communcation, it is -highly recommended to serialize the type-checked expression as a protocol -buffer. The CEL team will maintains canonical protocol buffers for ASTs and -will keep these versions identical and wire-compatible in perpetuity: - -* [CEL canonical](https://github.com/google/cel-spec/tree/master/proto/cel/expr) -* [CEL v1alpha1](https://github.com/googleapis/googleapis/tree/master/google/api/expr/v1alpha1) - - -Example of boolean conditions and object construction: - -``` c -// Condition -account.balance >= transaction.withdrawal - || (account.overdraftProtection - && account.overdraftLimit >= transaction.withdrawal - account.balance) - -// Object construction -common.GeoPoint{ latitude: 10.0, longitude: -5.5 } -``` - -For more detail, see: - -* [Introduction](doc/intro.md) -* [Language Definition](doc/langdef.md) - -Released under the [Apache License](LICENSE). diff --git a/vendor/cel.dev/expr/WORKSPACE b/vendor/cel.dev/expr/WORKSPACE deleted file mode 100644 index b6dc9ed67..000000000 --- a/vendor/cel.dev/expr/WORKSPACE +++ /dev/null @@ -1,145 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "io_bazel_rules_go", - sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", - ], -) - -http_archive( - name = "bazel_gazelle", - sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz", - ], -) - -http_archive( - name = "rules_proto", - sha256 = "e017528fd1c91c5a33f15493e3a398181a9e821a804eb7ff5acdd1d2d6c2b18d", - strip_prefix = "rules_proto-4.0.0-3.20.0", - urls = [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0-3.20.0.tar.gz", - ], -) - -# googleapis as of 09/16/2024 -http_archive( - name = "com_google_googleapis", - strip_prefix = "googleapis-4082d5e51e8481f6ccc384cacd896f4e78f19dee", - sha256 = "57319889d47578b3c89bf1b3f34888d796a8913d63b32d750a4cd12ed303c4e8", - urls = [ - "https://github.com/googleapis/googleapis/archive/4082d5e51e8481f6ccc384cacd896f4e78f19dee.tar.gz", - ], -) - -# protobuf -http_archive( - name = "com_google_protobuf", - sha256 = "8242327e5df8c80ba49e4165250b8f79a76bd11765facefaaecfca7747dc8da2", - strip_prefix = "protobuf-3.21.5", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.5.zip"], -) - -# googletest -http_archive( - name = "com_google_googletest", - urls = ["https://github.com/google/googletest/archive/master.zip"], - strip_prefix = "googletest-master", -) - -# gflags -http_archive( - name = "com_github_gflags_gflags", - sha256 = "6e16c8bc91b1310a44f3965e616383dbda48f83e8c1eaa2370a215057b00cabe", - strip_prefix = "gflags-77592648e3f3be87d6c7123eb81cbad75f9aef5a", - urls = [ - "https://mirror.bazel.build/github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz", - "https://github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz", - ], -) - -# glog -http_archive( - name = "com_google_glog", - sha256 = "1ee310e5d0a19b9d584a855000434bb724aa744745d5b8ab1855c85bff8a8e21", - strip_prefix = "glog-028d37889a1e80e8a07da1b8945ac706259e5fd8", - urls = [ - "https://mirror.bazel.build/github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz", - "https://github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz", - ], -) - -# absl -http_archive( - name = "com_google_absl", - strip_prefix = "abseil-cpp-master", - urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"], -) - -load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") -load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") - -switched_rules_by_language( - name = "com_google_googleapis_imports", - cc = True, -) - -# Do *not* call *_dependencies(), etc, yet. See comment at the end. - -# Generated Google APIs protos for Golang -# Generated Google APIs protos for Golang 08/26/2024 -go_repository( - name = "org_golang_google_genproto_googleapis_api", - build_file_proto_mode = "disable_global", - importpath = "google.golang.org/genproto/googleapis/api", - sum = "h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=", - version = "v0.0.0-20240826202546-f6391c0de4c7", -) - -# Generated Google APIs protos for Golang 08/26/2024 -go_repository( - name = "org_golang_google_genproto_googleapis_rpc", - build_file_proto_mode = "disable_global", - importpath = "google.golang.org/genproto/googleapis/rpc", - sum = "h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=", - version = "v0.0.0-20240826202546-f6391c0de4c7", -) - -# gRPC deps -go_repository( - name = "org_golang_google_grpc", - build_file_proto_mode = "disable_global", - importpath = "google.golang.org/grpc", - tag = "v1.49.0", -) - -go_repository( - name = "org_golang_x_net", - importpath = "golang.org/x/net", - sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=", - version = "v0.0.0-20190311183353-d8887717615a", -) - -go_repository( - name = "org_golang_x_text", - importpath = "golang.org/x/text", - sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=", - version = "v0.3.2", -) - -# Run the dependencies at the end. These will silently try to import some -# of the above repositories but at different versions, so ours must come first. -go_rules_dependencies() -go_register_toolchains(version = "1.19.1") -gazelle_dependencies() -rules_proto_dependencies() -rules_proto_toolchains() -protobuf_deps() diff --git a/vendor/cel.dev/expr/WORKSPACE.bzlmod b/vendor/cel.dev/expr/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/cel.dev/expr/checked.pb.go b/vendor/cel.dev/expr/checked.pb.go deleted file mode 100644 index b18085e9b..000000000 --- a/vendor/cel.dev/expr/checked.pb.go +++ /dev/null @@ -1,1231 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v5.27.1 -// source: cel/expr/checked.proto - -package expr - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Type_PrimitiveType int32 - -const ( - Type_PRIMITIVE_TYPE_UNSPECIFIED Type_PrimitiveType = 0 - Type_BOOL Type_PrimitiveType = 1 - Type_INT64 Type_PrimitiveType = 2 - Type_UINT64 Type_PrimitiveType = 3 - Type_DOUBLE Type_PrimitiveType = 4 - Type_STRING Type_PrimitiveType = 5 - Type_BYTES Type_PrimitiveType = 6 -) - -// Enum value maps for Type_PrimitiveType. -var ( - Type_PrimitiveType_name = map[int32]string{ - 0: "PRIMITIVE_TYPE_UNSPECIFIED", - 1: "BOOL", - 2: "INT64", - 3: "UINT64", - 4: "DOUBLE", - 5: "STRING", - 6: "BYTES", - } - Type_PrimitiveType_value = map[string]int32{ - "PRIMITIVE_TYPE_UNSPECIFIED": 0, - "BOOL": 1, - "INT64": 2, - "UINT64": 3, - "DOUBLE": 4, - "STRING": 5, - "BYTES": 6, - } -) - -func (x Type_PrimitiveType) Enum() *Type_PrimitiveType { - p := new(Type_PrimitiveType) - *p = x - return p -} - -func (x Type_PrimitiveType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Type_PrimitiveType) Descriptor() protoreflect.EnumDescriptor { - return file_cel_expr_checked_proto_enumTypes[0].Descriptor() -} - -func (Type_PrimitiveType) Type() protoreflect.EnumType { - return &file_cel_expr_checked_proto_enumTypes[0] -} - -func (x Type_PrimitiveType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Type_PrimitiveType.Descriptor instead. -func (Type_PrimitiveType) EnumDescriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0} -} - -type Type_WellKnownType int32 - -const ( - Type_WELL_KNOWN_TYPE_UNSPECIFIED Type_WellKnownType = 0 - Type_ANY Type_WellKnownType = 1 - Type_TIMESTAMP Type_WellKnownType = 2 - Type_DURATION Type_WellKnownType = 3 -) - -// Enum value maps for Type_WellKnownType. -var ( - Type_WellKnownType_name = map[int32]string{ - 0: "WELL_KNOWN_TYPE_UNSPECIFIED", - 1: "ANY", - 2: "TIMESTAMP", - 3: "DURATION", - } - Type_WellKnownType_value = map[string]int32{ - "WELL_KNOWN_TYPE_UNSPECIFIED": 0, - "ANY": 1, - "TIMESTAMP": 2, - "DURATION": 3, - } -) - -func (x Type_WellKnownType) Enum() *Type_WellKnownType { - p := new(Type_WellKnownType) - *p = x - return p -} - -func (x Type_WellKnownType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Type_WellKnownType) Descriptor() protoreflect.EnumDescriptor { - return file_cel_expr_checked_proto_enumTypes[1].Descriptor() -} - -func (Type_WellKnownType) Type() protoreflect.EnumType { - return &file_cel_expr_checked_proto_enumTypes[1] -} - -func (x Type_WellKnownType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Type_WellKnownType.Descriptor instead. -func (Type_WellKnownType) EnumDescriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1} -} - -type CheckedExpr struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReferenceMap map[int64]*Reference `protobuf:"bytes,2,rep,name=reference_map,json=referenceMap,proto3" json:"reference_map,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - TypeMap map[int64]*Type `protobuf:"bytes,3,rep,name=type_map,json=typeMap,proto3" json:"type_map,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - SourceInfo *SourceInfo `protobuf:"bytes,5,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"` - ExprVersion string `protobuf:"bytes,6,opt,name=expr_version,json=exprVersion,proto3" json:"expr_version,omitempty"` - Expr *Expr `protobuf:"bytes,4,opt,name=expr,proto3" json:"expr,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckedExpr) Reset() { - *x = CheckedExpr{} - mi := &file_cel_expr_checked_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckedExpr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckedExpr) ProtoMessage() {} - -func (x *CheckedExpr) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CheckedExpr.ProtoReflect.Descriptor instead. -func (*CheckedExpr) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{0} -} - -func (x *CheckedExpr) GetReferenceMap() map[int64]*Reference { - if x != nil { - return x.ReferenceMap - } - return nil -} - -func (x *CheckedExpr) GetTypeMap() map[int64]*Type { - if x != nil { - return x.TypeMap - } - return nil -} - -func (x *CheckedExpr) GetSourceInfo() *SourceInfo { - if x != nil { - return x.SourceInfo - } - return nil -} - -func (x *CheckedExpr) GetExprVersion() string { - if x != nil { - return x.ExprVersion - } - return "" -} - -func (x *CheckedExpr) GetExpr() *Expr { - if x != nil { - return x.Expr - } - return nil -} - -type Type struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to TypeKind: - // - // *Type_Dyn - // *Type_Null - // *Type_Primitive - // *Type_Wrapper - // *Type_WellKnown - // *Type_ListType_ - // *Type_MapType_ - // *Type_Function - // *Type_MessageType - // *Type_TypeParam - // *Type_Type - // *Type_Error - // *Type_AbstractType_ - TypeKind isType_TypeKind `protobuf_oneof:"type_kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Type) Reset() { - *x = Type{} - mi := &file_cel_expr_checked_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Type) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type) ProtoMessage() {} - -func (x *Type) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Type.ProtoReflect.Descriptor instead. -func (*Type) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1} -} - -func (x *Type) GetTypeKind() isType_TypeKind { - if x != nil { - return x.TypeKind - } - return nil -} - -func (x *Type) GetDyn() *emptypb.Empty { - if x != nil { - if x, ok := x.TypeKind.(*Type_Dyn); ok { - return x.Dyn - } - } - return nil -} - -func (x *Type) GetNull() structpb.NullValue { - if x != nil { - if x, ok := x.TypeKind.(*Type_Null); ok { - return x.Null - } - } - return structpb.NullValue(0) -} - -func (x *Type) GetPrimitive() Type_PrimitiveType { - if x != nil { - if x, ok := x.TypeKind.(*Type_Primitive); ok { - return x.Primitive - } - } - return Type_PRIMITIVE_TYPE_UNSPECIFIED -} - -func (x *Type) GetWrapper() Type_PrimitiveType { - if x != nil { - if x, ok := x.TypeKind.(*Type_Wrapper); ok { - return x.Wrapper - } - } - return Type_PRIMITIVE_TYPE_UNSPECIFIED -} - -func (x *Type) GetWellKnown() Type_WellKnownType { - if x != nil { - if x, ok := x.TypeKind.(*Type_WellKnown); ok { - return x.WellKnown - } - } - return Type_WELL_KNOWN_TYPE_UNSPECIFIED -} - -func (x *Type) GetListType() *Type_ListType { - if x != nil { - if x, ok := x.TypeKind.(*Type_ListType_); ok { - return x.ListType - } - } - return nil -} - -func (x *Type) GetMapType() *Type_MapType { - if x != nil { - if x, ok := x.TypeKind.(*Type_MapType_); ok { - return x.MapType - } - } - return nil -} - -func (x *Type) GetFunction() *Type_FunctionType { - if x != nil { - if x, ok := x.TypeKind.(*Type_Function); ok { - return x.Function - } - } - return nil -} - -func (x *Type) GetMessageType() string { - if x != nil { - if x, ok := x.TypeKind.(*Type_MessageType); ok { - return x.MessageType - } - } - return "" -} - -func (x *Type) GetTypeParam() string { - if x != nil { - if x, ok := x.TypeKind.(*Type_TypeParam); ok { - return x.TypeParam - } - } - return "" -} - -func (x *Type) GetType() *Type { - if x != nil { - if x, ok := x.TypeKind.(*Type_Type); ok { - return x.Type - } - } - return nil -} - -func (x *Type) GetError() *emptypb.Empty { - if x != nil { - if x, ok := x.TypeKind.(*Type_Error); ok { - return x.Error - } - } - return nil -} - -func (x *Type) GetAbstractType() *Type_AbstractType { - if x != nil { - if x, ok := x.TypeKind.(*Type_AbstractType_); ok { - return x.AbstractType - } - } - return nil -} - -type isType_TypeKind interface { - isType_TypeKind() -} - -type Type_Dyn struct { - Dyn *emptypb.Empty `protobuf:"bytes,1,opt,name=dyn,proto3,oneof"` -} - -type Type_Null struct { - Null structpb.NullValue `protobuf:"varint,2,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Type_Primitive struct { - Primitive Type_PrimitiveType `protobuf:"varint,3,opt,name=primitive,proto3,enum=cel.expr.Type_PrimitiveType,oneof"` -} - -type Type_Wrapper struct { - Wrapper Type_PrimitiveType `protobuf:"varint,4,opt,name=wrapper,proto3,enum=cel.expr.Type_PrimitiveType,oneof"` -} - -type Type_WellKnown struct { - WellKnown Type_WellKnownType `protobuf:"varint,5,opt,name=well_known,json=wellKnown,proto3,enum=cel.expr.Type_WellKnownType,oneof"` -} - -type Type_ListType_ struct { - ListType *Type_ListType `protobuf:"bytes,6,opt,name=list_type,json=listType,proto3,oneof"` -} - -type Type_MapType_ struct { - MapType *Type_MapType `protobuf:"bytes,7,opt,name=map_type,json=mapType,proto3,oneof"` -} - -type Type_Function struct { - Function *Type_FunctionType `protobuf:"bytes,8,opt,name=function,proto3,oneof"` -} - -type Type_MessageType struct { - MessageType string `protobuf:"bytes,9,opt,name=message_type,json=messageType,proto3,oneof"` -} - -type Type_TypeParam struct { - TypeParam string `protobuf:"bytes,10,opt,name=type_param,json=typeParam,proto3,oneof"` -} - -type Type_Type struct { - Type *Type `protobuf:"bytes,11,opt,name=type,proto3,oneof"` -} - -type Type_Error struct { - Error *emptypb.Empty `protobuf:"bytes,12,opt,name=error,proto3,oneof"` -} - -type Type_AbstractType_ struct { - AbstractType *Type_AbstractType `protobuf:"bytes,14,opt,name=abstract_type,json=abstractType,proto3,oneof"` -} - -func (*Type_Dyn) isType_TypeKind() {} - -func (*Type_Null) isType_TypeKind() {} - -func (*Type_Primitive) isType_TypeKind() {} - -func (*Type_Wrapper) isType_TypeKind() {} - -func (*Type_WellKnown) isType_TypeKind() {} - -func (*Type_ListType_) isType_TypeKind() {} - -func (*Type_MapType_) isType_TypeKind() {} - -func (*Type_Function) isType_TypeKind() {} - -func (*Type_MessageType) isType_TypeKind() {} - -func (*Type_TypeParam) isType_TypeKind() {} - -func (*Type_Type) isType_TypeKind() {} - -func (*Type_Error) isType_TypeKind() {} - -func (*Type_AbstractType_) isType_TypeKind() {} - -type Decl struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to DeclKind: - // - // *Decl_Ident - // *Decl_Function - DeclKind isDecl_DeclKind `protobuf_oneof:"decl_kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Decl) Reset() { - *x = Decl{} - mi := &file_cel_expr_checked_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Decl) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Decl) ProtoMessage() {} - -func (x *Decl) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Decl.ProtoReflect.Descriptor instead. -func (*Decl) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{2} -} - -func (x *Decl) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Decl) GetDeclKind() isDecl_DeclKind { - if x != nil { - return x.DeclKind - } - return nil -} - -func (x *Decl) GetIdent() *Decl_IdentDecl { - if x != nil { - if x, ok := x.DeclKind.(*Decl_Ident); ok { - return x.Ident - } - } - return nil -} - -func (x *Decl) GetFunction() *Decl_FunctionDecl { - if x != nil { - if x, ok := x.DeclKind.(*Decl_Function); ok { - return x.Function - } - } - return nil -} - -type isDecl_DeclKind interface { - isDecl_DeclKind() -} - -type Decl_Ident struct { - Ident *Decl_IdentDecl `protobuf:"bytes,2,opt,name=ident,proto3,oneof"` -} - -type Decl_Function struct { - Function *Decl_FunctionDecl `protobuf:"bytes,3,opt,name=function,proto3,oneof"` -} - -func (*Decl_Ident) isDecl_DeclKind() {} - -func (*Decl_Function) isDecl_DeclKind() {} - -type Reference struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - OverloadId []string `protobuf:"bytes,3,rep,name=overload_id,json=overloadId,proto3" json:"overload_id,omitempty"` - Value *Constant `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Reference) Reset() { - *x = Reference{} - mi := &file_cel_expr_checked_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Reference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reference) ProtoMessage() {} - -func (x *Reference) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Reference.ProtoReflect.Descriptor instead. -func (*Reference) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{3} -} - -func (x *Reference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Reference) GetOverloadId() []string { - if x != nil { - return x.OverloadId - } - return nil -} - -func (x *Reference) GetValue() *Constant { - if x != nil { - return x.Value - } - return nil -} - -type Type_ListType struct { - state protoimpl.MessageState `protogen:"open.v1"` - ElemType *Type `protobuf:"bytes,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Type_ListType) Reset() { - *x = Type_ListType{} - mi := &file_cel_expr_checked_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Type_ListType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type_ListType) ProtoMessage() {} - -func (x *Type_ListType) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Type_ListType.ProtoReflect.Descriptor instead. -func (*Type_ListType) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Type_ListType) GetElemType() *Type { - if x != nil { - return x.ElemType - } - return nil -} - -type Type_MapType struct { - state protoimpl.MessageState `protogen:"open.v1"` - KeyType *Type `protobuf:"bytes,1,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - ValueType *Type `protobuf:"bytes,2,opt,name=value_type,json=valueType,proto3" json:"value_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Type_MapType) Reset() { - *x = Type_MapType{} - mi := &file_cel_expr_checked_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Type_MapType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type_MapType) ProtoMessage() {} - -func (x *Type_MapType) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Type_MapType.ProtoReflect.Descriptor instead. -func (*Type_MapType) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *Type_MapType) GetKeyType() *Type { - if x != nil { - return x.KeyType - } - return nil -} - -func (x *Type_MapType) GetValueType() *Type { - if x != nil { - return x.ValueType - } - return nil -} - -type Type_FunctionType struct { - state protoimpl.MessageState `protogen:"open.v1"` - ResultType *Type `protobuf:"bytes,1,opt,name=result_type,json=resultType,proto3" json:"result_type,omitempty"` - ArgTypes []*Type `protobuf:"bytes,2,rep,name=arg_types,json=argTypes,proto3" json:"arg_types,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Type_FunctionType) Reset() { - *x = Type_FunctionType{} - mi := &file_cel_expr_checked_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Type_FunctionType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type_FunctionType) ProtoMessage() {} - -func (x *Type_FunctionType) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Type_FunctionType.ProtoReflect.Descriptor instead. -func (*Type_FunctionType) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 2} -} - -func (x *Type_FunctionType) GetResultType() *Type { - if x != nil { - return x.ResultType - } - return nil -} - -func (x *Type_FunctionType) GetArgTypes() []*Type { - if x != nil { - return x.ArgTypes - } - return nil -} - -type Type_AbstractType struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ParameterTypes []*Type `protobuf:"bytes,2,rep,name=parameter_types,json=parameterTypes,proto3" json:"parameter_types,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Type_AbstractType) Reset() { - *x = Type_AbstractType{} - mi := &file_cel_expr_checked_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Type_AbstractType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type_AbstractType) ProtoMessage() {} - -func (x *Type_AbstractType) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Type_AbstractType.ProtoReflect.Descriptor instead. -func (*Type_AbstractType) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 3} -} - -func (x *Type_AbstractType) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Type_AbstractType) GetParameterTypes() []*Type { - if x != nil { - return x.ParameterTypes - } - return nil -} - -type Decl_IdentDecl struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *Type `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value *Constant `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Doc string `protobuf:"bytes,3,opt,name=doc,proto3" json:"doc,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Decl_IdentDecl) Reset() { - *x = Decl_IdentDecl{} - mi := &file_cel_expr_checked_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Decl_IdentDecl) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Decl_IdentDecl) ProtoMessage() {} - -func (x *Decl_IdentDecl) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Decl_IdentDecl.ProtoReflect.Descriptor instead. -func (*Decl_IdentDecl) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Decl_IdentDecl) GetType() *Type { - if x != nil { - return x.Type - } - return nil -} - -func (x *Decl_IdentDecl) GetValue() *Constant { - if x != nil { - return x.Value - } - return nil -} - -func (x *Decl_IdentDecl) GetDoc() string { - if x != nil { - return x.Doc - } - return "" -} - -type Decl_FunctionDecl struct { - state protoimpl.MessageState `protogen:"open.v1"` - Overloads []*Decl_FunctionDecl_Overload `protobuf:"bytes,1,rep,name=overloads,proto3" json:"overloads,omitempty"` - Doc string `protobuf:"bytes,2,opt,name=doc,proto3" json:"doc,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Decl_FunctionDecl) Reset() { - *x = Decl_FunctionDecl{} - mi := &file_cel_expr_checked_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Decl_FunctionDecl) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Decl_FunctionDecl) ProtoMessage() {} - -func (x *Decl_FunctionDecl) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Decl_FunctionDecl.ProtoReflect.Descriptor instead. -func (*Decl_FunctionDecl) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Decl_FunctionDecl) GetOverloads() []*Decl_FunctionDecl_Overload { - if x != nil { - return x.Overloads - } - return nil -} - -func (x *Decl_FunctionDecl) GetDoc() string { - if x != nil { - return x.Doc - } - return "" -} - -type Decl_FunctionDecl_Overload struct { - state protoimpl.MessageState `protogen:"open.v1"` - OverloadId string `protobuf:"bytes,1,opt,name=overload_id,json=overloadId,proto3" json:"overload_id,omitempty"` - Params []*Type `protobuf:"bytes,2,rep,name=params,proto3" json:"params,omitempty"` - TypeParams []string `protobuf:"bytes,3,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"` - ResultType *Type `protobuf:"bytes,4,opt,name=result_type,json=resultType,proto3" json:"result_type,omitempty"` - IsInstanceFunction bool `protobuf:"varint,5,opt,name=is_instance_function,json=isInstanceFunction,proto3" json:"is_instance_function,omitempty"` - Doc string `protobuf:"bytes,6,opt,name=doc,proto3" json:"doc,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Decl_FunctionDecl_Overload) Reset() { - *x = Decl_FunctionDecl_Overload{} - mi := &file_cel_expr_checked_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Decl_FunctionDecl_Overload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Decl_FunctionDecl_Overload) ProtoMessage() {} - -func (x *Decl_FunctionDecl_Overload) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_checked_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Decl_FunctionDecl_Overload.ProtoReflect.Descriptor instead. -func (*Decl_FunctionDecl_Overload) Descriptor() ([]byte, []int) { - return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1, 0} -} - -func (x *Decl_FunctionDecl_Overload) GetOverloadId() string { - if x != nil { - return x.OverloadId - } - return "" -} - -func (x *Decl_FunctionDecl_Overload) GetParams() []*Type { - if x != nil { - return x.Params - } - return nil -} - -func (x *Decl_FunctionDecl_Overload) GetTypeParams() []string { - if x != nil { - return x.TypeParams - } - return nil -} - -func (x *Decl_FunctionDecl_Overload) GetResultType() *Type { - if x != nil { - return x.ResultType - } - return nil -} - -func (x *Decl_FunctionDecl_Overload) GetIsInstanceFunction() bool { - if x != nil { - return x.IsInstanceFunction - } - return false -} - -func (x *Decl_FunctionDecl_Overload) GetDoc() string { - if x != nil { - return x.Doc - } - return "" -} - -var File_cel_expr_checked_proto protoreflect.FileDescriptor - -const file_cel_expr_checked_proto_rawDesc = "" + - "\n" + - "\x16cel/expr/checked.proto\x12\bcel.expr\x1a\x15cel/expr/syntax.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xba\x03\n" + - "\vCheckedExpr\x12L\n" + - "\rreference_map\x18\x02 \x03(\v2'.cel.expr.CheckedExpr.ReferenceMapEntryR\freferenceMap\x12=\n" + - "\btype_map\x18\x03 \x03(\v2\".cel.expr.CheckedExpr.TypeMapEntryR\atypeMap\x125\n" + - "\vsource_info\x18\x05 \x01(\v2\x14.cel.expr.SourceInfoR\n" + - "sourceInfo\x12!\n" + - "\fexpr_version\x18\x06 \x01(\tR\vexprVersion\x12\"\n" + - "\x04expr\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\x04expr\x1aT\n" + - "\x11ReferenceMapEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12)\n" + - "\x05value\x18\x02 \x01(\v2\x13.cel.expr.ReferenceR\x05value:\x028\x01\x1aJ\n" + - "\fTypeMapEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12$\n" + - "\x05value\x18\x02 \x01(\v2\x0e.cel.expr.TypeR\x05value:\x028\x01\"\xe6\t\n" + - "\x04Type\x12*\n" + - "\x03dyn\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x03dyn\x120\n" + - "\x04null\x18\x02 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\x04null\x12<\n" + - "\tprimitive\x18\x03 \x01(\x0e2\x1c.cel.expr.Type.PrimitiveTypeH\x00R\tprimitive\x128\n" + - "\awrapper\x18\x04 \x01(\x0e2\x1c.cel.expr.Type.PrimitiveTypeH\x00R\awrapper\x12=\n" + - "\n" + - "well_known\x18\x05 \x01(\x0e2\x1c.cel.expr.Type.WellKnownTypeH\x00R\twellKnown\x126\n" + - "\tlist_type\x18\x06 \x01(\v2\x17.cel.expr.Type.ListTypeH\x00R\blistType\x123\n" + - "\bmap_type\x18\a \x01(\v2\x16.cel.expr.Type.MapTypeH\x00R\amapType\x129\n" + - "\bfunction\x18\b \x01(\v2\x1b.cel.expr.Type.FunctionTypeH\x00R\bfunction\x12#\n" + - "\fmessage_type\x18\t \x01(\tH\x00R\vmessageType\x12\x1f\n" + - "\n" + - "type_param\x18\n" + - " \x01(\tH\x00R\ttypeParam\x12$\n" + - "\x04type\x18\v \x01(\v2\x0e.cel.expr.TypeH\x00R\x04type\x12.\n" + - "\x05error\x18\f \x01(\v2\x16.google.protobuf.EmptyH\x00R\x05error\x12B\n" + - "\rabstract_type\x18\x0e \x01(\v2\x1b.cel.expr.Type.AbstractTypeH\x00R\fabstractType\x1a7\n" + - "\bListType\x12+\n" + - "\telem_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\belemType\x1ac\n" + - "\aMapType\x12)\n" + - "\bkey_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\akeyType\x12-\n" + - "\n" + - "value_type\x18\x02 \x01(\v2\x0e.cel.expr.TypeR\tvalueType\x1al\n" + - "\fFunctionType\x12/\n" + - "\vresult_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\n" + - "resultType\x12+\n" + - "\targ_types\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\bargTypes\x1a[\n" + - "\fAbstractType\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x127\n" + - "\x0fparameter_types\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\x0eparameterTypes\"s\n" + - "\rPrimitiveType\x12\x1e\n" + - "\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\b\n" + - "\x04BOOL\x10\x01\x12\t\n" + - "\x05INT64\x10\x02\x12\n" + - "\n" + - "\x06UINT64\x10\x03\x12\n" + - "\n" + - "\x06DOUBLE\x10\x04\x12\n" + - "\n" + - "\x06STRING\x10\x05\x12\t\n" + - "\x05BYTES\x10\x06\"V\n" + - "\rWellKnownType\x12\x1f\n" + - "\x1bWELL_KNOWN_TYPE_UNSPECIFIED\x10\x00\x12\a\n" + - "\x03ANY\x10\x01\x12\r\n" + - "\tTIMESTAMP\x10\x02\x12\f\n" + - "\bDURATION\x10\x03B\v\n" + - "\ttype_kind\"\xd4\x04\n" + - "\x04Decl\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x120\n" + - "\x05ident\x18\x02 \x01(\v2\x18.cel.expr.Decl.IdentDeclH\x00R\x05ident\x129\n" + - "\bfunction\x18\x03 \x01(\v2\x1b.cel.expr.Decl.FunctionDeclH\x00R\bfunction\x1ak\n" + - "\tIdentDecl\x12\"\n" + - "\x04type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\x04type\x12(\n" + - "\x05value\x18\x02 \x01(\v2\x12.cel.expr.ConstantR\x05value\x12\x10\n" + - "\x03doc\x18\x03 \x01(\tR\x03doc\x1a\xd0\x02\n" + - "\fFunctionDecl\x12B\n" + - "\toverloads\x18\x01 \x03(\v2$.cel.expr.Decl.FunctionDecl.OverloadR\toverloads\x12\x10\n" + - "\x03doc\x18\x02 \x01(\tR\x03doc\x1a\xe9\x01\n" + - "\bOverload\x12\x1f\n" + - "\voverload_id\x18\x01 \x01(\tR\n" + - "overloadId\x12&\n" + - "\x06params\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\x06params\x12\x1f\n" + - "\vtype_params\x18\x03 \x03(\tR\n" + - "typeParams\x12/\n" + - "\vresult_type\x18\x04 \x01(\v2\x0e.cel.expr.TypeR\n" + - "resultType\x120\n" + - "\x14is_instance_function\x18\x05 \x01(\bR\x12isInstanceFunction\x12\x10\n" + - "\x03doc\x18\x06 \x01(\tR\x03docB\v\n" + - "\tdecl_kind\"j\n" + - "\tReference\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" + - "\voverload_id\x18\x03 \x03(\tR\n" + - "overloadId\x12(\n" + - "\x05value\x18\x04 \x01(\v2\x12.cel.expr.ConstantR\x05valueB,\n" + - "\fdev.cel.exprB\tDeclProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3" - -var ( - file_cel_expr_checked_proto_rawDescOnce sync.Once - file_cel_expr_checked_proto_rawDescData []byte -) - -func file_cel_expr_checked_proto_rawDescGZIP() []byte { - file_cel_expr_checked_proto_rawDescOnce.Do(func() { - file_cel_expr_checked_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_checked_proto_rawDesc), len(file_cel_expr_checked_proto_rawDesc))) - }) - return file_cel_expr_checked_proto_rawDescData -} - -var file_cel_expr_checked_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_cel_expr_checked_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_cel_expr_checked_proto_goTypes = []any{ - (Type_PrimitiveType)(0), // 0: cel.expr.Type.PrimitiveType - (Type_WellKnownType)(0), // 1: cel.expr.Type.WellKnownType - (*CheckedExpr)(nil), // 2: cel.expr.CheckedExpr - (*Type)(nil), // 3: cel.expr.Type - (*Decl)(nil), // 4: cel.expr.Decl - (*Reference)(nil), // 5: cel.expr.Reference - nil, // 6: cel.expr.CheckedExpr.ReferenceMapEntry - nil, // 7: cel.expr.CheckedExpr.TypeMapEntry - (*Type_ListType)(nil), // 8: cel.expr.Type.ListType - (*Type_MapType)(nil), // 9: cel.expr.Type.MapType - (*Type_FunctionType)(nil), // 10: cel.expr.Type.FunctionType - (*Type_AbstractType)(nil), // 11: cel.expr.Type.AbstractType - (*Decl_IdentDecl)(nil), // 12: cel.expr.Decl.IdentDecl - (*Decl_FunctionDecl)(nil), // 13: cel.expr.Decl.FunctionDecl - (*Decl_FunctionDecl_Overload)(nil), // 14: cel.expr.Decl.FunctionDecl.Overload - (*SourceInfo)(nil), // 15: cel.expr.SourceInfo - (*Expr)(nil), // 16: cel.expr.Expr - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty - (structpb.NullValue)(0), // 18: google.protobuf.NullValue - (*Constant)(nil), // 19: cel.expr.Constant -} -var file_cel_expr_checked_proto_depIdxs = []int32{ - 6, // 0: cel.expr.CheckedExpr.reference_map:type_name -> cel.expr.CheckedExpr.ReferenceMapEntry - 7, // 1: cel.expr.CheckedExpr.type_map:type_name -> cel.expr.CheckedExpr.TypeMapEntry - 15, // 2: cel.expr.CheckedExpr.source_info:type_name -> cel.expr.SourceInfo - 16, // 3: cel.expr.CheckedExpr.expr:type_name -> cel.expr.Expr - 17, // 4: cel.expr.Type.dyn:type_name -> google.protobuf.Empty - 18, // 5: cel.expr.Type.null:type_name -> google.protobuf.NullValue - 0, // 6: cel.expr.Type.primitive:type_name -> cel.expr.Type.PrimitiveType - 0, // 7: cel.expr.Type.wrapper:type_name -> cel.expr.Type.PrimitiveType - 1, // 8: cel.expr.Type.well_known:type_name -> cel.expr.Type.WellKnownType - 8, // 9: cel.expr.Type.list_type:type_name -> cel.expr.Type.ListType - 9, // 10: cel.expr.Type.map_type:type_name -> cel.expr.Type.MapType - 10, // 11: cel.expr.Type.function:type_name -> cel.expr.Type.FunctionType - 3, // 12: cel.expr.Type.type:type_name -> cel.expr.Type - 17, // 13: cel.expr.Type.error:type_name -> google.protobuf.Empty - 11, // 14: cel.expr.Type.abstract_type:type_name -> cel.expr.Type.AbstractType - 12, // 15: cel.expr.Decl.ident:type_name -> cel.expr.Decl.IdentDecl - 13, // 16: cel.expr.Decl.function:type_name -> cel.expr.Decl.FunctionDecl - 19, // 17: cel.expr.Reference.value:type_name -> cel.expr.Constant - 5, // 18: cel.expr.CheckedExpr.ReferenceMapEntry.value:type_name -> cel.expr.Reference - 3, // 19: cel.expr.CheckedExpr.TypeMapEntry.value:type_name -> cel.expr.Type - 3, // 20: cel.expr.Type.ListType.elem_type:type_name -> cel.expr.Type - 3, // 21: cel.expr.Type.MapType.key_type:type_name -> cel.expr.Type - 3, // 22: cel.expr.Type.MapType.value_type:type_name -> cel.expr.Type - 3, // 23: cel.expr.Type.FunctionType.result_type:type_name -> cel.expr.Type - 3, // 24: cel.expr.Type.FunctionType.arg_types:type_name -> cel.expr.Type - 3, // 25: cel.expr.Type.AbstractType.parameter_types:type_name -> cel.expr.Type - 3, // 26: cel.expr.Decl.IdentDecl.type:type_name -> cel.expr.Type - 19, // 27: cel.expr.Decl.IdentDecl.value:type_name -> cel.expr.Constant - 14, // 28: cel.expr.Decl.FunctionDecl.overloads:type_name -> cel.expr.Decl.FunctionDecl.Overload - 3, // 29: cel.expr.Decl.FunctionDecl.Overload.params:type_name -> cel.expr.Type - 3, // 30: cel.expr.Decl.FunctionDecl.Overload.result_type:type_name -> cel.expr.Type - 31, // [31:31] is the sub-list for method output_type - 31, // [31:31] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name -} - -func init() { file_cel_expr_checked_proto_init() } -func file_cel_expr_checked_proto_init() { - if File_cel_expr_checked_proto != nil { - return - } - file_cel_expr_syntax_proto_init() - file_cel_expr_checked_proto_msgTypes[1].OneofWrappers = []any{ - (*Type_Dyn)(nil), - (*Type_Null)(nil), - (*Type_Primitive)(nil), - (*Type_Wrapper)(nil), - (*Type_WellKnown)(nil), - (*Type_ListType_)(nil), - (*Type_MapType_)(nil), - (*Type_Function)(nil), - (*Type_MessageType)(nil), - (*Type_TypeParam)(nil), - (*Type_Type)(nil), - (*Type_Error)(nil), - (*Type_AbstractType_)(nil), - } - file_cel_expr_checked_proto_msgTypes[2].OneofWrappers = []any{ - (*Decl_Ident)(nil), - (*Decl_Function)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_checked_proto_rawDesc), len(file_cel_expr_checked_proto_rawDesc)), - NumEnums: 2, - NumMessages: 13, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cel_expr_checked_proto_goTypes, - DependencyIndexes: file_cel_expr_checked_proto_depIdxs, - EnumInfos: file_cel_expr_checked_proto_enumTypes, - MessageInfos: file_cel_expr_checked_proto_msgTypes, - }.Build() - File_cel_expr_checked_proto = out.File - file_cel_expr_checked_proto_goTypes = nil - file_cel_expr_checked_proto_depIdxs = nil -} diff --git a/vendor/cel.dev/expr/cloudbuild.yaml b/vendor/cel.dev/expr/cloudbuild.yaml deleted file mode 100644 index e3e533a04..000000000 --- a/vendor/cel.dev/expr/cloudbuild.yaml +++ /dev/null @@ -1,9 +0,0 @@ -steps: -- name: 'gcr.io/cloud-builders/bazel:7.3.2' - entrypoint: bazel - args: ['build', '...'] - id: bazel-build - waitFor: ['-'] -timeout: 15m -options: - machineType: 'N1_HIGHCPU_32' diff --git a/vendor/cel.dev/expr/eval.pb.go b/vendor/cel.dev/expr/eval.pb.go deleted file mode 100644 index 83acb8935..000000000 --- a/vendor/cel.dev/expr/eval.pb.go +++ /dev/null @@ -1,468 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v5.27.1 -// source: cel/expr/eval.proto - -package expr - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type EvalState struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []*ExprValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - Results []*EvalState_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EvalState) Reset() { - *x = EvalState{} - mi := &file_cel_expr_eval_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EvalState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvalState) ProtoMessage() {} - -func (x *EvalState) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvalState.ProtoReflect.Descriptor instead. -func (*EvalState) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{0} -} - -func (x *EvalState) GetValues() []*ExprValue { - if x != nil { - return x.Values - } - return nil -} - -func (x *EvalState) GetResults() []*EvalState_Result { - if x != nil { - return x.Results - } - return nil -} - -type ExprValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *ExprValue_Value - // *ExprValue_Error - // *ExprValue_Unknown - Kind isExprValue_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExprValue) Reset() { - *x = ExprValue{} - mi := &file_cel_expr_eval_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExprValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExprValue) ProtoMessage() {} - -func (x *ExprValue) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExprValue.ProtoReflect.Descriptor instead. -func (*ExprValue) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{1} -} - -func (x *ExprValue) GetKind() isExprValue_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *ExprValue) GetValue() *Value { - if x != nil { - if x, ok := x.Kind.(*ExprValue_Value); ok { - return x.Value - } - } - return nil -} - -func (x *ExprValue) GetError() *ErrorSet { - if x != nil { - if x, ok := x.Kind.(*ExprValue_Error); ok { - return x.Error - } - } - return nil -} - -func (x *ExprValue) GetUnknown() *UnknownSet { - if x != nil { - if x, ok := x.Kind.(*ExprValue_Unknown); ok { - return x.Unknown - } - } - return nil -} - -type isExprValue_Kind interface { - isExprValue_Kind() -} - -type ExprValue_Value struct { - Value *Value `protobuf:"bytes,1,opt,name=value,proto3,oneof"` -} - -type ExprValue_Error struct { - Error *ErrorSet `protobuf:"bytes,2,opt,name=error,proto3,oneof"` -} - -type ExprValue_Unknown struct { - Unknown *UnknownSet `protobuf:"bytes,3,opt,name=unknown,proto3,oneof"` -} - -func (*ExprValue_Value) isExprValue_Kind() {} - -func (*ExprValue_Error) isExprValue_Kind() {} - -func (*ExprValue_Unknown) isExprValue_Kind() {} - -type ErrorSet struct { - state protoimpl.MessageState `protogen:"open.v1"` - Errors []*Status `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ErrorSet) Reset() { - *x = ErrorSet{} - mi := &file_cel_expr_eval_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ErrorSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ErrorSet) ProtoMessage() {} - -func (x *ErrorSet) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ErrorSet.ProtoReflect.Descriptor instead. -func (*ErrorSet) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{2} -} - -func (x *ErrorSet) GetErrors() []*Status { - if x != nil { - return x.Errors - } - return nil -} - -type Status struct { - state protoimpl.MessageState `protogen:"open.v1"` - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Status) Reset() { - *x = Status{} - mi := &file_cel_expr_eval_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{3} -} - -func (x *Status) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *Status) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *Status) GetDetails() []*anypb.Any { - if x != nil { - return x.Details - } - return nil -} - -type UnknownSet struct { - state protoimpl.MessageState `protogen:"open.v1"` - Exprs []int64 `protobuf:"varint,1,rep,packed,name=exprs,proto3" json:"exprs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnknownSet) Reset() { - *x = UnknownSet{} - mi := &file_cel_expr_eval_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnknownSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnknownSet) ProtoMessage() {} - -func (x *UnknownSet) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnknownSet.ProtoReflect.Descriptor instead. -func (*UnknownSet) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{4} -} - -func (x *UnknownSet) GetExprs() []int64 { - if x != nil { - return x.Exprs - } - return nil -} - -type EvalState_Result struct { - state protoimpl.MessageState `protogen:"open.v1"` - Expr int64 `protobuf:"varint,1,opt,name=expr,proto3" json:"expr,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EvalState_Result) Reset() { - *x = EvalState_Result{} - mi := &file_cel_expr_eval_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EvalState_Result) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvalState_Result) ProtoMessage() {} - -func (x *EvalState_Result) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvalState_Result.ProtoReflect.Descriptor instead. -func (*EvalState_Result) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *EvalState_Result) GetExpr() int64 { - if x != nil { - return x.Expr - } - return 0 -} - -func (x *EvalState_Result) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} - -var File_cel_expr_eval_proto protoreflect.FileDescriptor - -const file_cel_expr_eval_proto_rawDesc = "" + - "\n" + - "\x13cel/expr/eval.proto\x12\bcel.expr\x1a\x19google/protobuf/any.proto\x1a\x14cel/expr/value.proto\"\xa2\x01\n" + - "\tEvalState\x12+\n" + - "\x06values\x18\x01 \x03(\v2\x13.cel.expr.ExprValueR\x06values\x124\n" + - "\aresults\x18\x03 \x03(\v2\x1a.cel.expr.EvalState.ResultR\aresults\x1a2\n" + - "\x06Result\x12\x12\n" + - "\x04expr\x18\x01 \x01(\x03R\x04expr\x12\x14\n" + - "\x05value\x18\x02 \x01(\x03R\x05value\"\x9a\x01\n" + - "\tExprValue\x12'\n" + - "\x05value\x18\x01 \x01(\v2\x0f.cel.expr.ValueH\x00R\x05value\x12*\n" + - "\x05error\x18\x02 \x01(\v2\x12.cel.expr.ErrorSetH\x00R\x05error\x120\n" + - "\aunknown\x18\x03 \x01(\v2\x14.cel.expr.UnknownSetH\x00R\aunknownB\x06\n" + - "\x04kind\"4\n" + - "\bErrorSet\x12(\n" + - "\x06errors\x18\x01 \x03(\v2\x10.cel.expr.StatusR\x06errors\"f\n" + - "\x06Status\x12\x12\n" + - "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\x12.\n" + - "\adetails\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\adetails\"\"\n" + - "\n" + - "UnknownSet\x12\x14\n" + - "\x05exprs\x18\x01 \x03(\x03R\x05exprsB,\n" + - "\fdev.cel.exprB\tEvalProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3" - -var ( - file_cel_expr_eval_proto_rawDescOnce sync.Once - file_cel_expr_eval_proto_rawDescData []byte -) - -func file_cel_expr_eval_proto_rawDescGZIP() []byte { - file_cel_expr_eval_proto_rawDescOnce.Do(func() { - file_cel_expr_eval_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_eval_proto_rawDesc), len(file_cel_expr_eval_proto_rawDesc))) - }) - return file_cel_expr_eval_proto_rawDescData -} - -var file_cel_expr_eval_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_cel_expr_eval_proto_goTypes = []any{ - (*EvalState)(nil), // 0: cel.expr.EvalState - (*ExprValue)(nil), // 1: cel.expr.ExprValue - (*ErrorSet)(nil), // 2: cel.expr.ErrorSet - (*Status)(nil), // 3: cel.expr.Status - (*UnknownSet)(nil), // 4: cel.expr.UnknownSet - (*EvalState_Result)(nil), // 5: cel.expr.EvalState.Result - (*Value)(nil), // 6: cel.expr.Value - (*anypb.Any)(nil), // 7: google.protobuf.Any -} -var file_cel_expr_eval_proto_depIdxs = []int32{ - 1, // 0: cel.expr.EvalState.values:type_name -> cel.expr.ExprValue - 5, // 1: cel.expr.EvalState.results:type_name -> cel.expr.EvalState.Result - 6, // 2: cel.expr.ExprValue.value:type_name -> cel.expr.Value - 2, // 3: cel.expr.ExprValue.error:type_name -> cel.expr.ErrorSet - 4, // 4: cel.expr.ExprValue.unknown:type_name -> cel.expr.UnknownSet - 3, // 5: cel.expr.ErrorSet.errors:type_name -> cel.expr.Status - 7, // 6: cel.expr.Status.details:type_name -> google.protobuf.Any - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_cel_expr_eval_proto_init() } -func file_cel_expr_eval_proto_init() { - if File_cel_expr_eval_proto != nil { - return - } - file_cel_expr_value_proto_init() - file_cel_expr_eval_proto_msgTypes[1].OneofWrappers = []any{ - (*ExprValue_Value)(nil), - (*ExprValue_Error)(nil), - (*ExprValue_Unknown)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_eval_proto_rawDesc), len(file_cel_expr_eval_proto_rawDesc)), - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cel_expr_eval_proto_goTypes, - DependencyIndexes: file_cel_expr_eval_proto_depIdxs, - MessageInfos: file_cel_expr_eval_proto_msgTypes, - }.Build() - File_cel_expr_eval_proto = out.File - file_cel_expr_eval_proto_goTypes = nil - file_cel_expr_eval_proto_depIdxs = nil -} diff --git a/vendor/cel.dev/expr/explain.pb.go b/vendor/cel.dev/expr/explain.pb.go deleted file mode 100644 index 423993397..000000000 --- a/vendor/cel.dev/expr/explain.pb.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v5.27.1 -// source: cel/expr/explain.proto - -package expr - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Deprecated: Marked as deprecated in cel/expr/explain.proto. -type Explain struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - ExprSteps []*Explain_ExprStep `protobuf:"bytes,2,rep,name=expr_steps,json=exprSteps,proto3" json:"expr_steps,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Explain) Reset() { - *x = Explain{} - mi := &file_cel_expr_explain_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Explain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Explain) ProtoMessage() {} - -func (x *Explain) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_explain_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Explain.ProtoReflect.Descriptor instead. -func (*Explain) Descriptor() ([]byte, []int) { - return file_cel_expr_explain_proto_rawDescGZIP(), []int{0} -} - -func (x *Explain) GetValues() []*Value { - if x != nil { - return x.Values - } - return nil -} - -func (x *Explain) GetExprSteps() []*Explain_ExprStep { - if x != nil { - return x.ExprSteps - } - return nil -} - -type Explain_ExprStep struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ValueIndex int32 `protobuf:"varint,2,opt,name=value_index,json=valueIndex,proto3" json:"value_index,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Explain_ExprStep) Reset() { - *x = Explain_ExprStep{} - mi := &file_cel_expr_explain_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Explain_ExprStep) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Explain_ExprStep) ProtoMessage() {} - -func (x *Explain_ExprStep) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_explain_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Explain_ExprStep.ProtoReflect.Descriptor instead. -func (*Explain_ExprStep) Descriptor() ([]byte, []int) { - return file_cel_expr_explain_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *Explain_ExprStep) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Explain_ExprStep) GetValueIndex() int32 { - if x != nil { - return x.ValueIndex - } - return 0 -} - -var File_cel_expr_explain_proto protoreflect.FileDescriptor - -const file_cel_expr_explain_proto_rawDesc = "" + - "\n" + - "\x16cel/expr/explain.proto\x12\bcel.expr\x1a\x14cel/expr/value.proto\"\xae\x01\n" + - "\aExplain\x12'\n" + - "\x06values\x18\x01 \x03(\v2\x0f.cel.expr.ValueR\x06values\x129\n" + - "\n" + - "expr_steps\x18\x02 \x03(\v2\x1a.cel.expr.Explain.ExprStepR\texprSteps\x1a;\n" + - "\bExprStep\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1f\n" + - "\vvalue_index\x18\x02 \x01(\x05R\n" + - "valueIndex:\x02\x18\x01B/\n" + - "\fdev.cel.exprB\fExplainProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3" - -var ( - file_cel_expr_explain_proto_rawDescOnce sync.Once - file_cel_expr_explain_proto_rawDescData []byte -) - -func file_cel_expr_explain_proto_rawDescGZIP() []byte { - file_cel_expr_explain_proto_rawDescOnce.Do(func() { - file_cel_expr_explain_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_explain_proto_rawDesc), len(file_cel_expr_explain_proto_rawDesc))) - }) - return file_cel_expr_explain_proto_rawDescData -} - -var file_cel_expr_explain_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cel_expr_explain_proto_goTypes = []any{ - (*Explain)(nil), // 0: cel.expr.Explain - (*Explain_ExprStep)(nil), // 1: cel.expr.Explain.ExprStep - (*Value)(nil), // 2: cel.expr.Value -} -var file_cel_expr_explain_proto_depIdxs = []int32{ - 2, // 0: cel.expr.Explain.values:type_name -> cel.expr.Value - 1, // 1: cel.expr.Explain.expr_steps:type_name -> cel.expr.Explain.ExprStep - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_cel_expr_explain_proto_init() } -func file_cel_expr_explain_proto_init() { - if File_cel_expr_explain_proto != nil { - return - } - file_cel_expr_value_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_explain_proto_rawDesc), len(file_cel_expr_explain_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cel_expr_explain_proto_goTypes, - DependencyIndexes: file_cel_expr_explain_proto_depIdxs, - MessageInfos: file_cel_expr_explain_proto_msgTypes, - }.Build() - File_cel_expr_explain_proto = out.File - file_cel_expr_explain_proto_goTypes = nil - file_cel_expr_explain_proto_depIdxs = nil -} diff --git a/vendor/cel.dev/expr/regen_go_proto.sh b/vendor/cel.dev/expr/regen_go_proto.sh deleted file mode 100644 index fdcbb3ce2..000000000 --- a/vendor/cel.dev/expr/regen_go_proto.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -bazel build //proto/cel/expr/conformance/... -files=($(bazel aquery 'kind(proto, //proto/cel/expr/conformance/...)' | grep Outputs | grep "[.]pb[.]go" | sed 's/Outputs: \[//' | sed 's/\]//' | tr "," "\n")) -for src in ${files[@]}; -do - dst=$(echo $src | sed 's/\(.*\/cel.dev\/expr\/\(.*\)\)/\2/') - echo "copying $dst" - $(cp $src $dst) -done diff --git a/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh b/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh deleted file mode 100644 index 9a13479e4..000000000 --- a/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -bazel build //proto/cel/expr:all - -rm -vf ./*.pb.go - -files=( $(bazel cquery //proto/cel/expr:expr_go_proto --output=starlark --starlark:expr="'\n'.join([f.path for f in target.output_groups.go_generated_srcs.to_list()])") ) -for src in "${files[@]}"; -do - cp -v "${src}" ./ -done diff --git a/vendor/cel.dev/expr/syntax.pb.go b/vendor/cel.dev/expr/syntax.pb.go deleted file mode 100644 index 72d19b20d..000000000 --- a/vendor/cel.dev/expr/syntax.pb.go +++ /dev/null @@ -1,1394 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v5.27.1 -// source: cel/expr/syntax.proto - -package expr - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - structpb "google.golang.org/protobuf/types/known/structpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SourceInfo_Extension_Component int32 - -const ( - SourceInfo_Extension_COMPONENT_UNSPECIFIED SourceInfo_Extension_Component = 0 - SourceInfo_Extension_COMPONENT_PARSER SourceInfo_Extension_Component = 1 - SourceInfo_Extension_COMPONENT_TYPE_CHECKER SourceInfo_Extension_Component = 2 - SourceInfo_Extension_COMPONENT_RUNTIME SourceInfo_Extension_Component = 3 -) - -// Enum value maps for SourceInfo_Extension_Component. -var ( - SourceInfo_Extension_Component_name = map[int32]string{ - 0: "COMPONENT_UNSPECIFIED", - 1: "COMPONENT_PARSER", - 2: "COMPONENT_TYPE_CHECKER", - 3: "COMPONENT_RUNTIME", - } - SourceInfo_Extension_Component_value = map[string]int32{ - "COMPONENT_UNSPECIFIED": 0, - "COMPONENT_PARSER": 1, - "COMPONENT_TYPE_CHECKER": 2, - "COMPONENT_RUNTIME": 3, - } -) - -func (x SourceInfo_Extension_Component) Enum() *SourceInfo_Extension_Component { - p := new(SourceInfo_Extension_Component) - *p = x - return p -} - -func (x SourceInfo_Extension_Component) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SourceInfo_Extension_Component) Descriptor() protoreflect.EnumDescriptor { - return file_cel_expr_syntax_proto_enumTypes[0].Descriptor() -} - -func (SourceInfo_Extension_Component) Type() protoreflect.EnumType { - return &file_cel_expr_syntax_proto_enumTypes[0] -} - -func (x SourceInfo_Extension_Component) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SourceInfo_Extension_Component.Descriptor instead. -func (SourceInfo_Extension_Component) EnumDescriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0} -} - -type ParsedExpr struct { - state protoimpl.MessageState `protogen:"open.v1"` - Expr *Expr `protobuf:"bytes,2,opt,name=expr,proto3" json:"expr,omitempty"` - SourceInfo *SourceInfo `protobuf:"bytes,3,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ParsedExpr) Reset() { - *x = ParsedExpr{} - mi := &file_cel_expr_syntax_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ParsedExpr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParsedExpr) ProtoMessage() {} - -func (x *ParsedExpr) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParsedExpr.ProtoReflect.Descriptor instead. -func (*ParsedExpr) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{0} -} - -func (x *ParsedExpr) GetExpr() *Expr { - if x != nil { - return x.Expr - } - return nil -} - -func (x *ParsedExpr) GetSourceInfo() *SourceInfo { - if x != nil { - return x.SourceInfo - } - return nil -} - -type Expr struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - // Types that are valid to be assigned to ExprKind: - // - // *Expr_ConstExpr - // *Expr_IdentExpr - // *Expr_SelectExpr - // *Expr_CallExpr - // *Expr_ListExpr - // *Expr_StructExpr - // *Expr_ComprehensionExpr - ExprKind isExpr_ExprKind `protobuf_oneof:"expr_kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr) Reset() { - *x = Expr{} - mi := &file_cel_expr_syntax_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr) ProtoMessage() {} - -func (x *Expr) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr.ProtoReflect.Descriptor instead. -func (*Expr) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1} -} - -func (x *Expr) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Expr) GetExprKind() isExpr_ExprKind { - if x != nil { - return x.ExprKind - } - return nil -} - -func (x *Expr) GetConstExpr() *Constant { - if x != nil { - if x, ok := x.ExprKind.(*Expr_ConstExpr); ok { - return x.ConstExpr - } - } - return nil -} - -func (x *Expr) GetIdentExpr() *Expr_Ident { - if x != nil { - if x, ok := x.ExprKind.(*Expr_IdentExpr); ok { - return x.IdentExpr - } - } - return nil -} - -func (x *Expr) GetSelectExpr() *Expr_Select { - if x != nil { - if x, ok := x.ExprKind.(*Expr_SelectExpr); ok { - return x.SelectExpr - } - } - return nil -} - -func (x *Expr) GetCallExpr() *Expr_Call { - if x != nil { - if x, ok := x.ExprKind.(*Expr_CallExpr); ok { - return x.CallExpr - } - } - return nil -} - -func (x *Expr) GetListExpr() *Expr_CreateList { - if x != nil { - if x, ok := x.ExprKind.(*Expr_ListExpr); ok { - return x.ListExpr - } - } - return nil -} - -func (x *Expr) GetStructExpr() *Expr_CreateStruct { - if x != nil { - if x, ok := x.ExprKind.(*Expr_StructExpr); ok { - return x.StructExpr - } - } - return nil -} - -func (x *Expr) GetComprehensionExpr() *Expr_Comprehension { - if x != nil { - if x, ok := x.ExprKind.(*Expr_ComprehensionExpr); ok { - return x.ComprehensionExpr - } - } - return nil -} - -type isExpr_ExprKind interface { - isExpr_ExprKind() -} - -type Expr_ConstExpr struct { - ConstExpr *Constant `protobuf:"bytes,3,opt,name=const_expr,json=constExpr,proto3,oneof"` -} - -type Expr_IdentExpr struct { - IdentExpr *Expr_Ident `protobuf:"bytes,4,opt,name=ident_expr,json=identExpr,proto3,oneof"` -} - -type Expr_SelectExpr struct { - SelectExpr *Expr_Select `protobuf:"bytes,5,opt,name=select_expr,json=selectExpr,proto3,oneof"` -} - -type Expr_CallExpr struct { - CallExpr *Expr_Call `protobuf:"bytes,6,opt,name=call_expr,json=callExpr,proto3,oneof"` -} - -type Expr_ListExpr struct { - ListExpr *Expr_CreateList `protobuf:"bytes,7,opt,name=list_expr,json=listExpr,proto3,oneof"` -} - -type Expr_StructExpr struct { - StructExpr *Expr_CreateStruct `protobuf:"bytes,8,opt,name=struct_expr,json=structExpr,proto3,oneof"` -} - -type Expr_ComprehensionExpr struct { - ComprehensionExpr *Expr_Comprehension `protobuf:"bytes,9,opt,name=comprehension_expr,json=comprehensionExpr,proto3,oneof"` -} - -func (*Expr_ConstExpr) isExpr_ExprKind() {} - -func (*Expr_IdentExpr) isExpr_ExprKind() {} - -func (*Expr_SelectExpr) isExpr_ExprKind() {} - -func (*Expr_CallExpr) isExpr_ExprKind() {} - -func (*Expr_ListExpr) isExpr_ExprKind() {} - -func (*Expr_StructExpr) isExpr_ExprKind() {} - -func (*Expr_ComprehensionExpr) isExpr_ExprKind() {} - -type Constant struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to ConstantKind: - // - // *Constant_NullValue - // *Constant_BoolValue - // *Constant_Int64Value - // *Constant_Uint64Value - // *Constant_DoubleValue - // *Constant_StringValue - // *Constant_BytesValue - // *Constant_DurationValue - // *Constant_TimestampValue - ConstantKind isConstant_ConstantKind `protobuf_oneof:"constant_kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Constant) Reset() { - *x = Constant{} - mi := &file_cel_expr_syntax_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Constant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Constant) ProtoMessage() {} - -func (x *Constant) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Constant.ProtoReflect.Descriptor instead. -func (*Constant) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{2} -} - -func (x *Constant) GetConstantKind() isConstant_ConstantKind { - if x != nil { - return x.ConstantKind - } - return nil -} - -func (x *Constant) GetNullValue() structpb.NullValue { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_NullValue); ok { - return x.NullValue - } - } - return structpb.NullValue(0) -} - -func (x *Constant) GetBoolValue() bool { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_BoolValue); ok { - return x.BoolValue - } - } - return false -} - -func (x *Constant) GetInt64Value() int64 { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_Int64Value); ok { - return x.Int64Value - } - } - return 0 -} - -func (x *Constant) GetUint64Value() uint64 { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_Uint64Value); ok { - return x.Uint64Value - } - } - return 0 -} - -func (x *Constant) GetDoubleValue() float64 { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_DoubleValue); ok { - return x.DoubleValue - } - } - return 0 -} - -func (x *Constant) GetStringValue() string { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_StringValue); ok { - return x.StringValue - } - } - return "" -} - -func (x *Constant) GetBytesValue() []byte { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_BytesValue); ok { - return x.BytesValue - } - } - return nil -} - -// Deprecated: Marked as deprecated in cel/expr/syntax.proto. -func (x *Constant) GetDurationValue() *durationpb.Duration { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_DurationValue); ok { - return x.DurationValue - } - } - return nil -} - -// Deprecated: Marked as deprecated in cel/expr/syntax.proto. -func (x *Constant) GetTimestampValue() *timestamppb.Timestamp { - if x != nil { - if x, ok := x.ConstantKind.(*Constant_TimestampValue); ok { - return x.TimestampValue - } - } - return nil -} - -type isConstant_ConstantKind interface { - isConstant_ConstantKind() -} - -type Constant_NullValue struct { - NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Constant_BoolValue struct { - BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Constant_Int64Value struct { - Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof"` -} - -type Constant_Uint64Value struct { - Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof"` -} - -type Constant_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof"` -} - -type Constant_StringValue struct { - StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Constant_BytesValue struct { - BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"` -} - -type Constant_DurationValue struct { - // Deprecated: Marked as deprecated in cel/expr/syntax.proto. - DurationValue *durationpb.Duration `protobuf:"bytes,8,opt,name=duration_value,json=durationValue,proto3,oneof"` -} - -type Constant_TimestampValue struct { - // Deprecated: Marked as deprecated in cel/expr/syntax.proto. - TimestampValue *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=timestamp_value,json=timestampValue,proto3,oneof"` -} - -func (*Constant_NullValue) isConstant_ConstantKind() {} - -func (*Constant_BoolValue) isConstant_ConstantKind() {} - -func (*Constant_Int64Value) isConstant_ConstantKind() {} - -func (*Constant_Uint64Value) isConstant_ConstantKind() {} - -func (*Constant_DoubleValue) isConstant_ConstantKind() {} - -func (*Constant_StringValue) isConstant_ConstantKind() {} - -func (*Constant_BytesValue) isConstant_ConstantKind() {} - -func (*Constant_DurationValue) isConstant_ConstantKind() {} - -func (*Constant_TimestampValue) isConstant_ConstantKind() {} - -type SourceInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - SyntaxVersion string `protobuf:"bytes,1,opt,name=syntax_version,json=syntaxVersion,proto3" json:"syntax_version,omitempty"` - Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` - LineOffsets []int32 `protobuf:"varint,3,rep,packed,name=line_offsets,json=lineOffsets,proto3" json:"line_offsets,omitempty"` - Positions map[int64]int32 `protobuf:"bytes,4,rep,name=positions,proto3" json:"positions,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - MacroCalls map[int64]*Expr `protobuf:"bytes,5,rep,name=macro_calls,json=macroCalls,proto3" json:"macro_calls,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Extensions []*SourceInfo_Extension `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SourceInfo) Reset() { - *x = SourceInfo{} - mi := &file_cel_expr_syntax_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SourceInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SourceInfo) ProtoMessage() {} - -func (x *SourceInfo) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SourceInfo.ProtoReflect.Descriptor instead. -func (*SourceInfo) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3} -} - -func (x *SourceInfo) GetSyntaxVersion() string { - if x != nil { - return x.SyntaxVersion - } - return "" -} - -func (x *SourceInfo) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *SourceInfo) GetLineOffsets() []int32 { - if x != nil { - return x.LineOffsets - } - return nil -} - -func (x *SourceInfo) GetPositions() map[int64]int32 { - if x != nil { - return x.Positions - } - return nil -} - -func (x *SourceInfo) GetMacroCalls() map[int64]*Expr { - if x != nil { - return x.MacroCalls - } - return nil -} - -func (x *SourceInfo) GetExtensions() []*SourceInfo_Extension { - if x != nil { - return x.Extensions - } - return nil -} - -type Expr_Ident struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_Ident) Reset() { - *x = Expr_Ident{} - mi := &file_cel_expr_syntax_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_Ident) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_Ident) ProtoMessage() {} - -func (x *Expr_Ident) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_Ident.ProtoReflect.Descriptor instead. -func (*Expr_Ident) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Expr_Ident) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type Expr_Select struct { - state protoimpl.MessageState `protogen:"open.v1"` - Operand *Expr `protobuf:"bytes,1,opt,name=operand,proto3" json:"operand,omitempty"` - Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"` - TestOnly bool `protobuf:"varint,3,opt,name=test_only,json=testOnly,proto3" json:"test_only,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_Select) Reset() { - *x = Expr_Select{} - mi := &file_cel_expr_syntax_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_Select) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_Select) ProtoMessage() {} - -func (x *Expr_Select) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_Select.ProtoReflect.Descriptor instead. -func (*Expr_Select) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *Expr_Select) GetOperand() *Expr { - if x != nil { - return x.Operand - } - return nil -} - -func (x *Expr_Select) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -func (x *Expr_Select) GetTestOnly() bool { - if x != nil { - return x.TestOnly - } - return false -} - -type Expr_Call struct { - state protoimpl.MessageState `protogen:"open.v1"` - Target *Expr `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"` - Args []*Expr `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_Call) Reset() { - *x = Expr_Call{} - mi := &file_cel_expr_syntax_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_Call) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_Call) ProtoMessage() {} - -func (x *Expr_Call) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_Call.ProtoReflect.Descriptor instead. -func (*Expr_Call) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 2} -} - -func (x *Expr_Call) GetTarget() *Expr { - if x != nil { - return x.Target - } - return nil -} - -func (x *Expr_Call) GetFunction() string { - if x != nil { - return x.Function - } - return "" -} - -func (x *Expr_Call) GetArgs() []*Expr { - if x != nil { - return x.Args - } - return nil -} - -type Expr_CreateList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Elements []*Expr `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` - OptionalIndices []int32 `protobuf:"varint,2,rep,packed,name=optional_indices,json=optionalIndices,proto3" json:"optional_indices,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_CreateList) Reset() { - *x = Expr_CreateList{} - mi := &file_cel_expr_syntax_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_CreateList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_CreateList) ProtoMessage() {} - -func (x *Expr_CreateList) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_CreateList.ProtoReflect.Descriptor instead. -func (*Expr_CreateList) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 3} -} - -func (x *Expr_CreateList) GetElements() []*Expr { - if x != nil { - return x.Elements - } - return nil -} - -func (x *Expr_CreateList) GetOptionalIndices() []int32 { - if x != nil { - return x.OptionalIndices - } - return nil -} - -type Expr_CreateStruct struct { - state protoimpl.MessageState `protogen:"open.v1"` - MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` - Entries []*Expr_CreateStruct_Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_CreateStruct) Reset() { - *x = Expr_CreateStruct{} - mi := &file_cel_expr_syntax_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_CreateStruct) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_CreateStruct) ProtoMessage() {} - -func (x *Expr_CreateStruct) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_CreateStruct.ProtoReflect.Descriptor instead. -func (*Expr_CreateStruct) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4} -} - -func (x *Expr_CreateStruct) GetMessageName() string { - if x != nil { - return x.MessageName - } - return "" -} - -func (x *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry { - if x != nil { - return x.Entries - } - return nil -} - -type Expr_Comprehension struct { - state protoimpl.MessageState `protogen:"open.v1"` - IterVar string `protobuf:"bytes,1,opt,name=iter_var,json=iterVar,proto3" json:"iter_var,omitempty"` - IterVar2 string `protobuf:"bytes,8,opt,name=iter_var2,json=iterVar2,proto3" json:"iter_var2,omitempty"` - IterRange *Expr `protobuf:"bytes,2,opt,name=iter_range,json=iterRange,proto3" json:"iter_range,omitempty"` - AccuVar string `protobuf:"bytes,3,opt,name=accu_var,json=accuVar,proto3" json:"accu_var,omitempty"` - AccuInit *Expr `protobuf:"bytes,4,opt,name=accu_init,json=accuInit,proto3" json:"accu_init,omitempty"` - LoopCondition *Expr `protobuf:"bytes,5,opt,name=loop_condition,json=loopCondition,proto3" json:"loop_condition,omitempty"` - LoopStep *Expr `protobuf:"bytes,6,opt,name=loop_step,json=loopStep,proto3" json:"loop_step,omitempty"` - Result *Expr `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_Comprehension) Reset() { - *x = Expr_Comprehension{} - mi := &file_cel_expr_syntax_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_Comprehension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_Comprehension) ProtoMessage() {} - -func (x *Expr_Comprehension) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_Comprehension.ProtoReflect.Descriptor instead. -func (*Expr_Comprehension) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 5} -} - -func (x *Expr_Comprehension) GetIterVar() string { - if x != nil { - return x.IterVar - } - return "" -} - -func (x *Expr_Comprehension) GetIterVar2() string { - if x != nil { - return x.IterVar2 - } - return "" -} - -func (x *Expr_Comprehension) GetIterRange() *Expr { - if x != nil { - return x.IterRange - } - return nil -} - -func (x *Expr_Comprehension) GetAccuVar() string { - if x != nil { - return x.AccuVar - } - return "" -} - -func (x *Expr_Comprehension) GetAccuInit() *Expr { - if x != nil { - return x.AccuInit - } - return nil -} - -func (x *Expr_Comprehension) GetLoopCondition() *Expr { - if x != nil { - return x.LoopCondition - } - return nil -} - -func (x *Expr_Comprehension) GetLoopStep() *Expr { - if x != nil { - return x.LoopStep - } - return nil -} - -func (x *Expr_Comprehension) GetResult() *Expr { - if x != nil { - return x.Result - } - return nil -} - -type Expr_CreateStruct_Entry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // Types that are valid to be assigned to KeyKind: - // - // *Expr_CreateStruct_Entry_FieldKey - // *Expr_CreateStruct_Entry_MapKey - KeyKind isExpr_CreateStruct_Entry_KeyKind `protobuf_oneof:"key_kind"` - Value *Expr `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - OptionalEntry bool `protobuf:"varint,5,opt,name=optional_entry,json=optionalEntry,proto3" json:"optional_entry,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Expr_CreateStruct_Entry) Reset() { - *x = Expr_CreateStruct_Entry{} - mi := &file_cel_expr_syntax_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Expr_CreateStruct_Entry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr_CreateStruct_Entry) ProtoMessage() {} - -func (x *Expr_CreateStruct_Entry) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr_CreateStruct_Entry.ProtoReflect.Descriptor instead. -func (*Expr_CreateStruct_Entry) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4, 0} -} - -func (x *Expr_CreateStruct_Entry) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Expr_CreateStruct_Entry) GetKeyKind() isExpr_CreateStruct_Entry_KeyKind { - if x != nil { - return x.KeyKind - } - return nil -} - -func (x *Expr_CreateStruct_Entry) GetFieldKey() string { - if x != nil { - if x, ok := x.KeyKind.(*Expr_CreateStruct_Entry_FieldKey); ok { - return x.FieldKey - } - } - return "" -} - -func (x *Expr_CreateStruct_Entry) GetMapKey() *Expr { - if x != nil { - if x, ok := x.KeyKind.(*Expr_CreateStruct_Entry_MapKey); ok { - return x.MapKey - } - } - return nil -} - -func (x *Expr_CreateStruct_Entry) GetValue() *Expr { - if x != nil { - return x.Value - } - return nil -} - -func (x *Expr_CreateStruct_Entry) GetOptionalEntry() bool { - if x != nil { - return x.OptionalEntry - } - return false -} - -type isExpr_CreateStruct_Entry_KeyKind interface { - isExpr_CreateStruct_Entry_KeyKind() -} - -type Expr_CreateStruct_Entry_FieldKey struct { - FieldKey string `protobuf:"bytes,2,opt,name=field_key,json=fieldKey,proto3,oneof"` -} - -type Expr_CreateStruct_Entry_MapKey struct { - MapKey *Expr `protobuf:"bytes,3,opt,name=map_key,json=mapKey,proto3,oneof"` -} - -func (*Expr_CreateStruct_Entry_FieldKey) isExpr_CreateStruct_Entry_KeyKind() {} - -func (*Expr_CreateStruct_Entry_MapKey) isExpr_CreateStruct_Entry_KeyKind() {} - -type SourceInfo_Extension struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AffectedComponents []SourceInfo_Extension_Component `protobuf:"varint,2,rep,packed,name=affected_components,json=affectedComponents,proto3,enum=cel.expr.SourceInfo_Extension_Component" json:"affected_components,omitempty"` - Version *SourceInfo_Extension_Version `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SourceInfo_Extension) Reset() { - *x = SourceInfo_Extension{} - mi := &file_cel_expr_syntax_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SourceInfo_Extension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SourceInfo_Extension) ProtoMessage() {} - -func (x *SourceInfo_Extension) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SourceInfo_Extension.ProtoReflect.Descriptor instead. -func (*SourceInfo_Extension) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2} -} - -func (x *SourceInfo_Extension) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *SourceInfo_Extension) GetAffectedComponents() []SourceInfo_Extension_Component { - if x != nil { - return x.AffectedComponents - } - return nil -} - -func (x *SourceInfo_Extension) GetVersion() *SourceInfo_Extension_Version { - if x != nil { - return x.Version - } - return nil -} - -type SourceInfo_Extension_Version struct { - state protoimpl.MessageState `protogen:"open.v1"` - Major int64 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` - Minor int64 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SourceInfo_Extension_Version) Reset() { - *x = SourceInfo_Extension_Version{} - mi := &file_cel_expr_syntax_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SourceInfo_Extension_Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SourceInfo_Extension_Version) ProtoMessage() {} - -func (x *SourceInfo_Extension_Version) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_syntax_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SourceInfo_Extension_Version.ProtoReflect.Descriptor instead. -func (*SourceInfo_Extension_Version) Descriptor() ([]byte, []int) { - return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0} -} - -func (x *SourceInfo_Extension_Version) GetMajor() int64 { - if x != nil { - return x.Major - } - return 0 -} - -func (x *SourceInfo_Extension_Version) GetMinor() int64 { - if x != nil { - return x.Minor - } - return 0 -} - -var File_cel_expr_syntax_proto protoreflect.FileDescriptor - -const file_cel_expr_syntax_proto_rawDesc = "" + - "\n" + - "\x15cel/expr/syntax.proto\x12\bcel.expr\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"g\n" + - "\n" + - "ParsedExpr\x12\"\n" + - "\x04expr\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\x04expr\x125\n" + - "\vsource_info\x18\x03 \x01(\v2\x14.cel.expr.SourceInfoR\n" + - "sourceInfo\"\x9a\v\n" + - "\x04Expr\x12\x0e\n" + - "\x02id\x18\x02 \x01(\x03R\x02id\x123\n" + - "\n" + - "const_expr\x18\x03 \x01(\v2\x12.cel.expr.ConstantH\x00R\tconstExpr\x125\n" + - "\n" + - "ident_expr\x18\x04 \x01(\v2\x14.cel.expr.Expr.IdentH\x00R\tidentExpr\x128\n" + - "\vselect_expr\x18\x05 \x01(\v2\x15.cel.expr.Expr.SelectH\x00R\n" + - "selectExpr\x122\n" + - "\tcall_expr\x18\x06 \x01(\v2\x13.cel.expr.Expr.CallH\x00R\bcallExpr\x128\n" + - "\tlist_expr\x18\a \x01(\v2\x19.cel.expr.Expr.CreateListH\x00R\blistExpr\x12>\n" + - "\vstruct_expr\x18\b \x01(\v2\x1b.cel.expr.Expr.CreateStructH\x00R\n" + - "structExpr\x12M\n" + - "\x12comprehension_expr\x18\t \x01(\v2\x1c.cel.expr.Expr.ComprehensionH\x00R\x11comprehensionExpr\x1a\x1b\n" + - "\x05Ident\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x1ae\n" + - "\x06Select\x12(\n" + - "\aoperand\x18\x01 \x01(\v2\x0e.cel.expr.ExprR\aoperand\x12\x14\n" + - "\x05field\x18\x02 \x01(\tR\x05field\x12\x1b\n" + - "\ttest_only\x18\x03 \x01(\bR\btestOnly\x1an\n" + - "\x04Call\x12&\n" + - "\x06target\x18\x01 \x01(\v2\x0e.cel.expr.ExprR\x06target\x12\x1a\n" + - "\bfunction\x18\x02 \x01(\tR\bfunction\x12\"\n" + - "\x04args\x18\x03 \x03(\v2\x0e.cel.expr.ExprR\x04args\x1ac\n" + - "\n" + - "CreateList\x12*\n" + - "\belements\x18\x01 \x03(\v2\x0e.cel.expr.ExprR\belements\x12)\n" + - "\x10optional_indices\x18\x02 \x03(\x05R\x0foptionalIndices\x1a\xab\x02\n" + - "\fCreateStruct\x12!\n" + - "\fmessage_name\x18\x01 \x01(\tR\vmessageName\x12;\n" + - "\aentries\x18\x02 \x03(\v2!.cel.expr.Expr.CreateStruct.EntryR\aentries\x1a\xba\x01\n" + - "\x05Entry\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" + - "\tfield_key\x18\x02 \x01(\tH\x00R\bfieldKey\x12)\n" + - "\amap_key\x18\x03 \x01(\v2\x0e.cel.expr.ExprH\x00R\x06mapKey\x12$\n" + - "\x05value\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\x05value\x12%\n" + - "\x0eoptional_entry\x18\x05 \x01(\bR\roptionalEntryB\n" + - "\n" + - "\bkey_kind\x1a\xca\x02\n" + - "\rComprehension\x12\x19\n" + - "\biter_var\x18\x01 \x01(\tR\aiterVar\x12\x1b\n" + - "\titer_var2\x18\b \x01(\tR\biterVar2\x12-\n" + - "\n" + - "iter_range\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\titerRange\x12\x19\n" + - "\baccu_var\x18\x03 \x01(\tR\aaccuVar\x12+\n" + - "\taccu_init\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\baccuInit\x125\n" + - "\x0eloop_condition\x18\x05 \x01(\v2\x0e.cel.expr.ExprR\rloopCondition\x12+\n" + - "\tloop_step\x18\x06 \x01(\v2\x0e.cel.expr.ExprR\bloopStep\x12&\n" + - "\x06result\x18\a \x01(\v2\x0e.cel.expr.ExprR\x06resultB\v\n" + - "\texpr_kind\"\xc1\x03\n" + - "\bConstant\x12;\n" + - "\n" + - "null_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12\x1f\n" + - "\n" + - "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12!\n" + - "\vint64_value\x18\x03 \x01(\x03H\x00R\n" + - "int64Value\x12#\n" + - "\fuint64_value\x18\x04 \x01(\x04H\x00R\vuint64Value\x12#\n" + - "\fdouble_value\x18\x05 \x01(\x01H\x00R\vdoubleValue\x12#\n" + - "\fstring_value\x18\x06 \x01(\tH\x00R\vstringValue\x12!\n" + - "\vbytes_value\x18\a \x01(\fH\x00R\n" + - "bytesValue\x12F\n" + - "\x0eduration_value\x18\b \x01(\v2\x19.google.protobuf.DurationB\x02\x18\x01H\x00R\rdurationValue\x12I\n" + - "\x0ftimestamp_value\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x02\x18\x01H\x00R\x0etimestampValueB\x0f\n" + - "\rconstant_kind\"\xac\x06\n" + - "\n" + - "SourceInfo\x12%\n" + - "\x0esyntax_version\x18\x01 \x01(\tR\rsyntaxVersion\x12\x1a\n" + - "\blocation\x18\x02 \x01(\tR\blocation\x12!\n" + - "\fline_offsets\x18\x03 \x03(\x05R\vlineOffsets\x12A\n" + - "\tpositions\x18\x04 \x03(\v2#.cel.expr.SourceInfo.PositionsEntryR\tpositions\x12E\n" + - "\vmacro_calls\x18\x05 \x03(\v2$.cel.expr.SourceInfo.MacroCallsEntryR\n" + - "macroCalls\x12>\n" + - "\n" + - "extensions\x18\x06 \x03(\v2\x1e.cel.expr.SourceInfo.ExtensionR\n" + - "extensions\x1a<\n" + - "\x0ePositionsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\x1aM\n" + - "\x0fMacroCallsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12$\n" + - "\x05value\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\x05value:\x028\x01\x1a\xe0\x02\n" + - "\tExtension\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12Y\n" + - "\x13affected_components\x18\x02 \x03(\x0e2(.cel.expr.SourceInfo.Extension.ComponentR\x12affectedComponents\x12@\n" + - "\aversion\x18\x03 \x01(\v2&.cel.expr.SourceInfo.Extension.VersionR\aversion\x1a5\n" + - "\aVersion\x12\x14\n" + - "\x05major\x18\x01 \x01(\x03R\x05major\x12\x14\n" + - "\x05minor\x18\x02 \x01(\x03R\x05minor\"o\n" + - "\tComponent\x12\x19\n" + - "\x15COMPONENT_UNSPECIFIED\x10\x00\x12\x14\n" + - "\x10COMPONENT_PARSER\x10\x01\x12\x1a\n" + - "\x16COMPONENT_TYPE_CHECKER\x10\x02\x12\x15\n" + - "\x11COMPONENT_RUNTIME\x10\x03B.\n" + - "\fdev.cel.exprB\vSyntaxProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3" - -var ( - file_cel_expr_syntax_proto_rawDescOnce sync.Once - file_cel_expr_syntax_proto_rawDescData []byte -) - -func file_cel_expr_syntax_proto_rawDescGZIP() []byte { - file_cel_expr_syntax_proto_rawDescOnce.Do(func() { - file_cel_expr_syntax_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_syntax_proto_rawDesc), len(file_cel_expr_syntax_proto_rawDesc))) - }) - return file_cel_expr_syntax_proto_rawDescData -} - -var file_cel_expr_syntax_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cel_expr_syntax_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_cel_expr_syntax_proto_goTypes = []any{ - (SourceInfo_Extension_Component)(0), // 0: cel.expr.SourceInfo.Extension.Component - (*ParsedExpr)(nil), // 1: cel.expr.ParsedExpr - (*Expr)(nil), // 2: cel.expr.Expr - (*Constant)(nil), // 3: cel.expr.Constant - (*SourceInfo)(nil), // 4: cel.expr.SourceInfo - (*Expr_Ident)(nil), // 5: cel.expr.Expr.Ident - (*Expr_Select)(nil), // 6: cel.expr.Expr.Select - (*Expr_Call)(nil), // 7: cel.expr.Expr.Call - (*Expr_CreateList)(nil), // 8: cel.expr.Expr.CreateList - (*Expr_CreateStruct)(nil), // 9: cel.expr.Expr.CreateStruct - (*Expr_Comprehension)(nil), // 10: cel.expr.Expr.Comprehension - (*Expr_CreateStruct_Entry)(nil), // 11: cel.expr.Expr.CreateStruct.Entry - nil, // 12: cel.expr.SourceInfo.PositionsEntry - nil, // 13: cel.expr.SourceInfo.MacroCallsEntry - (*SourceInfo_Extension)(nil), // 14: cel.expr.SourceInfo.Extension - (*SourceInfo_Extension_Version)(nil), // 15: cel.expr.SourceInfo.Extension.Version - (structpb.NullValue)(0), // 16: google.protobuf.NullValue - (*durationpb.Duration)(nil), // 17: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp -} -var file_cel_expr_syntax_proto_depIdxs = []int32{ - 2, // 0: cel.expr.ParsedExpr.expr:type_name -> cel.expr.Expr - 4, // 1: cel.expr.ParsedExpr.source_info:type_name -> cel.expr.SourceInfo - 3, // 2: cel.expr.Expr.const_expr:type_name -> cel.expr.Constant - 5, // 3: cel.expr.Expr.ident_expr:type_name -> cel.expr.Expr.Ident - 6, // 4: cel.expr.Expr.select_expr:type_name -> cel.expr.Expr.Select - 7, // 5: cel.expr.Expr.call_expr:type_name -> cel.expr.Expr.Call - 8, // 6: cel.expr.Expr.list_expr:type_name -> cel.expr.Expr.CreateList - 9, // 7: cel.expr.Expr.struct_expr:type_name -> cel.expr.Expr.CreateStruct - 10, // 8: cel.expr.Expr.comprehension_expr:type_name -> cel.expr.Expr.Comprehension - 16, // 9: cel.expr.Constant.null_value:type_name -> google.protobuf.NullValue - 17, // 10: cel.expr.Constant.duration_value:type_name -> google.protobuf.Duration - 18, // 11: cel.expr.Constant.timestamp_value:type_name -> google.protobuf.Timestamp - 12, // 12: cel.expr.SourceInfo.positions:type_name -> cel.expr.SourceInfo.PositionsEntry - 13, // 13: cel.expr.SourceInfo.macro_calls:type_name -> cel.expr.SourceInfo.MacroCallsEntry - 14, // 14: cel.expr.SourceInfo.extensions:type_name -> cel.expr.SourceInfo.Extension - 2, // 15: cel.expr.Expr.Select.operand:type_name -> cel.expr.Expr - 2, // 16: cel.expr.Expr.Call.target:type_name -> cel.expr.Expr - 2, // 17: cel.expr.Expr.Call.args:type_name -> cel.expr.Expr - 2, // 18: cel.expr.Expr.CreateList.elements:type_name -> cel.expr.Expr - 11, // 19: cel.expr.Expr.CreateStruct.entries:type_name -> cel.expr.Expr.CreateStruct.Entry - 2, // 20: cel.expr.Expr.Comprehension.iter_range:type_name -> cel.expr.Expr - 2, // 21: cel.expr.Expr.Comprehension.accu_init:type_name -> cel.expr.Expr - 2, // 22: cel.expr.Expr.Comprehension.loop_condition:type_name -> cel.expr.Expr - 2, // 23: cel.expr.Expr.Comprehension.loop_step:type_name -> cel.expr.Expr - 2, // 24: cel.expr.Expr.Comprehension.result:type_name -> cel.expr.Expr - 2, // 25: cel.expr.Expr.CreateStruct.Entry.map_key:type_name -> cel.expr.Expr - 2, // 26: cel.expr.Expr.CreateStruct.Entry.value:type_name -> cel.expr.Expr - 2, // 27: cel.expr.SourceInfo.MacroCallsEntry.value:type_name -> cel.expr.Expr - 0, // 28: cel.expr.SourceInfo.Extension.affected_components:type_name -> cel.expr.SourceInfo.Extension.Component - 15, // 29: cel.expr.SourceInfo.Extension.version:type_name -> cel.expr.SourceInfo.Extension.Version - 30, // [30:30] is the sub-list for method output_type - 30, // [30:30] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name -} - -func init() { file_cel_expr_syntax_proto_init() } -func file_cel_expr_syntax_proto_init() { - if File_cel_expr_syntax_proto != nil { - return - } - file_cel_expr_syntax_proto_msgTypes[1].OneofWrappers = []any{ - (*Expr_ConstExpr)(nil), - (*Expr_IdentExpr)(nil), - (*Expr_SelectExpr)(nil), - (*Expr_CallExpr)(nil), - (*Expr_ListExpr)(nil), - (*Expr_StructExpr)(nil), - (*Expr_ComprehensionExpr)(nil), - } - file_cel_expr_syntax_proto_msgTypes[2].OneofWrappers = []any{ - (*Constant_NullValue)(nil), - (*Constant_BoolValue)(nil), - (*Constant_Int64Value)(nil), - (*Constant_Uint64Value)(nil), - (*Constant_DoubleValue)(nil), - (*Constant_StringValue)(nil), - (*Constant_BytesValue)(nil), - (*Constant_DurationValue)(nil), - (*Constant_TimestampValue)(nil), - } - file_cel_expr_syntax_proto_msgTypes[10].OneofWrappers = []any{ - (*Expr_CreateStruct_Entry_FieldKey)(nil), - (*Expr_CreateStruct_Entry_MapKey)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_syntax_proto_rawDesc), len(file_cel_expr_syntax_proto_rawDesc)), - NumEnums: 1, - NumMessages: 15, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cel_expr_syntax_proto_goTypes, - DependencyIndexes: file_cel_expr_syntax_proto_depIdxs, - EnumInfos: file_cel_expr_syntax_proto_enumTypes, - MessageInfos: file_cel_expr_syntax_proto_msgTypes, - }.Build() - File_cel_expr_syntax_proto = out.File - file_cel_expr_syntax_proto_goTypes = nil - file_cel_expr_syntax_proto_depIdxs = nil -} diff --git a/vendor/cel.dev/expr/value.pb.go b/vendor/cel.dev/expr/value.pb.go deleted file mode 100644 index 1f53a6a29..000000000 --- a/vendor/cel.dev/expr/value.pb.go +++ /dev/null @@ -1,575 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v5.27.1 -// source: cel/expr/value.proto - -package expr - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Value struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *Value_NullValue - // *Value_BoolValue - // *Value_Int64Value - // *Value_Uint64Value - // *Value_DoubleValue - // *Value_StringValue - // *Value_BytesValue - // *Value_EnumValue - // *Value_ObjectValue - // *Value_MapValue - // *Value_ListValue - // *Value_TypeValue - Kind isValue_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Value) Reset() { - *x = Value{} - mi := &file_cel_expr_value_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Value) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Value) ProtoMessage() {} - -func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_value_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Value.ProtoReflect.Descriptor instead. -func (*Value) Descriptor() ([]byte, []int) { - return file_cel_expr_value_proto_rawDescGZIP(), []int{0} -} - -func (x *Value) GetKind() isValue_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *Value) GetNullValue() structpb.NullValue { - if x != nil { - if x, ok := x.Kind.(*Value_NullValue); ok { - return x.NullValue - } - } - return structpb.NullValue(0) -} - -func (x *Value) GetBoolValue() bool { - if x != nil { - if x, ok := x.Kind.(*Value_BoolValue); ok { - return x.BoolValue - } - } - return false -} - -func (x *Value) GetInt64Value() int64 { - if x != nil { - if x, ok := x.Kind.(*Value_Int64Value); ok { - return x.Int64Value - } - } - return 0 -} - -func (x *Value) GetUint64Value() uint64 { - if x != nil { - if x, ok := x.Kind.(*Value_Uint64Value); ok { - return x.Uint64Value - } - } - return 0 -} - -func (x *Value) GetDoubleValue() float64 { - if x != nil { - if x, ok := x.Kind.(*Value_DoubleValue); ok { - return x.DoubleValue - } - } - return 0 -} - -func (x *Value) GetStringValue() string { - if x != nil { - if x, ok := x.Kind.(*Value_StringValue); ok { - return x.StringValue - } - } - return "" -} - -func (x *Value) GetBytesValue() []byte { - if x != nil { - if x, ok := x.Kind.(*Value_BytesValue); ok { - return x.BytesValue - } - } - return nil -} - -func (x *Value) GetEnumValue() *EnumValue { - if x != nil { - if x, ok := x.Kind.(*Value_EnumValue); ok { - return x.EnumValue - } - } - return nil -} - -func (x *Value) GetObjectValue() *anypb.Any { - if x != nil { - if x, ok := x.Kind.(*Value_ObjectValue); ok { - return x.ObjectValue - } - } - return nil -} - -func (x *Value) GetMapValue() *MapValue { - if x != nil { - if x, ok := x.Kind.(*Value_MapValue); ok { - return x.MapValue - } - } - return nil -} - -func (x *Value) GetListValue() *ListValue { - if x != nil { - if x, ok := x.Kind.(*Value_ListValue); ok { - return x.ListValue - } - } - return nil -} - -func (x *Value) GetTypeValue() string { - if x != nil { - if x, ok := x.Kind.(*Value_TypeValue); ok { - return x.TypeValue - } - } - return "" -} - -type isValue_Kind interface { - isValue_Kind() -} - -type Value_NullValue struct { - NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Value_BoolValue struct { - BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Value_Int64Value struct { - Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof"` -} - -type Value_Uint64Value struct { - Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof"` -} - -type Value_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof"` -} - -type Value_StringValue struct { - StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Value_BytesValue struct { - BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"` -} - -type Value_EnumValue struct { - EnumValue *EnumValue `protobuf:"bytes,9,opt,name=enum_value,json=enumValue,proto3,oneof"` -} - -type Value_ObjectValue struct { - ObjectValue *anypb.Any `protobuf:"bytes,10,opt,name=object_value,json=objectValue,proto3,oneof"` -} - -type Value_MapValue struct { - MapValue *MapValue `protobuf:"bytes,11,opt,name=map_value,json=mapValue,proto3,oneof"` -} - -type Value_ListValue struct { - ListValue *ListValue `protobuf:"bytes,12,opt,name=list_value,json=listValue,proto3,oneof"` -} - -type Value_TypeValue struct { - TypeValue string `protobuf:"bytes,15,opt,name=type_value,json=typeValue,proto3,oneof"` -} - -func (*Value_NullValue) isValue_Kind() {} - -func (*Value_BoolValue) isValue_Kind() {} - -func (*Value_Int64Value) isValue_Kind() {} - -func (*Value_Uint64Value) isValue_Kind() {} - -func (*Value_DoubleValue) isValue_Kind() {} - -func (*Value_StringValue) isValue_Kind() {} - -func (*Value_BytesValue) isValue_Kind() {} - -func (*Value_EnumValue) isValue_Kind() {} - -func (*Value_ObjectValue) isValue_Kind() {} - -func (*Value_MapValue) isValue_Kind() {} - -func (*Value_ListValue) isValue_Kind() {} - -func (*Value_TypeValue) isValue_Kind() {} - -type EnumValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EnumValue) Reset() { - *x = EnumValue{} - mi := &file_cel_expr_value_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EnumValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnumValue) ProtoMessage() {} - -func (x *EnumValue) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_value_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnumValue.ProtoReflect.Descriptor instead. -func (*EnumValue) Descriptor() ([]byte, []int) { - return file_cel_expr_value_proto_rawDescGZIP(), []int{1} -} - -func (x *EnumValue) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *EnumValue) GetValue() int32 { - if x != nil { - return x.Value - } - return 0 -} - -type ListValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListValue) Reset() { - *x = ListValue{} - mi := &file_cel_expr_value_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValue) ProtoMessage() {} - -func (x *ListValue) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_value_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListValue.ProtoReflect.Descriptor instead. -func (*ListValue) Descriptor() ([]byte, []int) { - return file_cel_expr_value_proto_rawDescGZIP(), []int{2} -} - -func (x *ListValue) GetValues() []*Value { - if x != nil { - return x.Values - } - return nil -} - -type MapValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entries []*MapValue_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MapValue) Reset() { - *x = MapValue{} - mi := &file_cel_expr_value_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MapValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MapValue) ProtoMessage() {} - -func (x *MapValue) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_value_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MapValue.ProtoReflect.Descriptor instead. -func (*MapValue) Descriptor() ([]byte, []int) { - return file_cel_expr_value_proto_rawDescGZIP(), []int{3} -} - -func (x *MapValue) GetEntries() []*MapValue_Entry { - if x != nil { - return x.Entries - } - return nil -} - -type MapValue_Entry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key *Value `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MapValue_Entry) Reset() { - *x = MapValue_Entry{} - mi := &file_cel_expr_value_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MapValue_Entry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MapValue_Entry) ProtoMessage() {} - -func (x *MapValue_Entry) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_value_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MapValue_Entry.ProtoReflect.Descriptor instead. -func (*MapValue_Entry) Descriptor() ([]byte, []int) { - return file_cel_expr_value_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *MapValue_Entry) GetKey() *Value { - if x != nil { - return x.Key - } - return nil -} - -func (x *MapValue_Entry) GetValue() *Value { - if x != nil { - return x.Value - } - return nil -} - -var File_cel_expr_value_proto protoreflect.FileDescriptor - -const file_cel_expr_value_proto_rawDesc = "" + - "\n" + - "\x14cel/expr/value.proto\x12\bcel.expr\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x9d\x04\n" + - "\x05Value\x12;\n" + - "\n" + - "null_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12\x1f\n" + - "\n" + - "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12!\n" + - "\vint64_value\x18\x03 \x01(\x03H\x00R\n" + - "int64Value\x12#\n" + - "\fuint64_value\x18\x04 \x01(\x04H\x00R\vuint64Value\x12#\n" + - "\fdouble_value\x18\x05 \x01(\x01H\x00R\vdoubleValue\x12#\n" + - "\fstring_value\x18\x06 \x01(\tH\x00R\vstringValue\x12!\n" + - "\vbytes_value\x18\a \x01(\fH\x00R\n" + - "bytesValue\x124\n" + - "\n" + - "enum_value\x18\t \x01(\v2\x13.cel.expr.EnumValueH\x00R\tenumValue\x129\n" + - "\fobject_value\x18\n" + - " \x01(\v2\x14.google.protobuf.AnyH\x00R\vobjectValue\x121\n" + - "\tmap_value\x18\v \x01(\v2\x12.cel.expr.MapValueH\x00R\bmapValue\x124\n" + - "\n" + - "list_value\x18\f \x01(\v2\x13.cel.expr.ListValueH\x00R\tlistValue\x12\x1f\n" + - "\n" + - "type_value\x18\x0f \x01(\tH\x00R\ttypeValueB\x06\n" + - "\x04kind\"5\n" + - "\tEnumValue\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + - "\x05value\x18\x02 \x01(\x05R\x05value\"4\n" + - "\tListValue\x12'\n" + - "\x06values\x18\x01 \x03(\v2\x0f.cel.expr.ValueR\x06values\"\x91\x01\n" + - "\bMapValue\x122\n" + - "\aentries\x18\x01 \x03(\v2\x18.cel.expr.MapValue.EntryR\aentries\x1aQ\n" + - "\x05Entry\x12!\n" + - "\x03key\x18\x01 \x01(\v2\x0f.cel.expr.ValueR\x03key\x12%\n" + - "\x05value\x18\x02 \x01(\v2\x0f.cel.expr.ValueR\x05valueB-\n" + - "\fdev.cel.exprB\n" + - "ValueProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3" - -var ( - file_cel_expr_value_proto_rawDescOnce sync.Once - file_cel_expr_value_proto_rawDescData []byte -) - -func file_cel_expr_value_proto_rawDescGZIP() []byte { - file_cel_expr_value_proto_rawDescOnce.Do(func() { - file_cel_expr_value_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_value_proto_rawDesc), len(file_cel_expr_value_proto_rawDesc))) - }) - return file_cel_expr_value_proto_rawDescData -} - -var file_cel_expr_value_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_cel_expr_value_proto_goTypes = []any{ - (*Value)(nil), // 0: cel.expr.Value - (*EnumValue)(nil), // 1: cel.expr.EnumValue - (*ListValue)(nil), // 2: cel.expr.ListValue - (*MapValue)(nil), // 3: cel.expr.MapValue - (*MapValue_Entry)(nil), // 4: cel.expr.MapValue.Entry - (structpb.NullValue)(0), // 5: google.protobuf.NullValue - (*anypb.Any)(nil), // 6: google.protobuf.Any -} -var file_cel_expr_value_proto_depIdxs = []int32{ - 5, // 0: cel.expr.Value.null_value:type_name -> google.protobuf.NullValue - 1, // 1: cel.expr.Value.enum_value:type_name -> cel.expr.EnumValue - 6, // 2: cel.expr.Value.object_value:type_name -> google.protobuf.Any - 3, // 3: cel.expr.Value.map_value:type_name -> cel.expr.MapValue - 2, // 4: cel.expr.Value.list_value:type_name -> cel.expr.ListValue - 0, // 5: cel.expr.ListValue.values:type_name -> cel.expr.Value - 4, // 6: cel.expr.MapValue.entries:type_name -> cel.expr.MapValue.Entry - 0, // 7: cel.expr.MapValue.Entry.key:type_name -> cel.expr.Value - 0, // 8: cel.expr.MapValue.Entry.value:type_name -> cel.expr.Value - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_cel_expr_value_proto_init() } -func file_cel_expr_value_proto_init() { - if File_cel_expr_value_proto != nil { - return - } - file_cel_expr_value_proto_msgTypes[0].OneofWrappers = []any{ - (*Value_NullValue)(nil), - (*Value_BoolValue)(nil), - (*Value_Int64Value)(nil), - (*Value_Uint64Value)(nil), - (*Value_DoubleValue)(nil), - (*Value_StringValue)(nil), - (*Value_BytesValue)(nil), - (*Value_EnumValue)(nil), - (*Value_ObjectValue)(nil), - (*Value_MapValue)(nil), - (*Value_ListValue)(nil), - (*Value_TypeValue)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_value_proto_rawDesc), len(file_cel_expr_value_proto_rawDesc)), - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cel_expr_value_proto_goTypes, - DependencyIndexes: file_cel_expr_value_proto_depIdxs, - MessageInfos: file_cel_expr_value_proto_msgTypes, - }.Build() - File_cel_expr_value_proto = out.File - file_cel_expr_value_proto_goTypes = nil - file_cel_expr_value_proto_depIdxs = nil -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/.gitignore b/vendor/github.com/antlr4-go/antlr/v4/.gitignore deleted file mode 100644 index 38ea34ff5..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -### Go template - -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - - -# Go workspace file -go.work - -# No Goland stuff in this repo -.idea diff --git a/vendor/github.com/antlr4-go/antlr/v4/LICENSE b/vendor/github.com/antlr4-go/antlr/v4/LICENSE deleted file mode 100644 index a22292eb5..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012-2023 The ANTLR Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither name of copyright holders nor the names of its contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/antlr4-go/antlr/v4/README.md b/vendor/github.com/antlr4-go/antlr/v4/README.md deleted file mode 100644 index 03e5b83eb..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/README.md +++ /dev/null @@ -1,54 +0,0 @@ -[![Go Report Card](https://goreportcard.com/badge/github.com/antlr4-go/antlr?style=flat-square)](https://goreportcard.com/report/github.com/antlr4-go/antlr) -[![PkgGoDev](https://pkg.go.dev/badge/github.com/github.com/antlr4-go/antlr)](https://pkg.go.dev/github.com/antlr4-go/antlr) -[![Release](https://img.shields.io/github/v/release/antlr4-go/antlr?sort=semver&style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest) -[![Release](https://img.shields.io/github/go-mod/go-version/antlr4-go/antlr?style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest) -[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=flat-square)](https://github.com/antlr4-go/antlr/commit-activity) -[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) -[![GitHub stars](https://img.shields.io/github/stars/antlr4-go/antlr?style=flat-square&label=Star&maxAge=2592000)](https://GitHub.com/Naereen/StrapDown.js/stargazers/) -# ANTLR4 Go Runtime Module Repo - -IMPORTANT: Please submit PRs via a clone of the https://github.com/antlr/antlr4 repo, and not here. - - - Do not submit PRs or any change requests to this repo - - This repo is read only and is updated by the ANTLR team to create a new release of the Go Runtime for ANTLR - - This repo contains the Go runtime that your generated projects should import - -## Introduction - -This repo contains the official modules for the Go Runtime for ANTLR. It is a copy of the runtime maintained -at: https://github.com/antlr/antlr4/tree/master/runtime/Go/antlr and is automatically updated by the ANTLR team to create -the official Go runtime release only. No development work is carried out in this repo and PRs are not accepted here. - -The dev branch of this repo is kept in sync with the dev branch of the main ANTLR repo and is updated periodically. - -### Why? - -The `go get` command is unable to retrieve the Go runtime when it is embedded so -deeply in the main repo. A `go get` against the `antlr/antlr4` repo, while retrieving the correct source code for the runtime, -does not correctly resolve tags and will create a reference in your `go.mod` file that is unclear, will not upgrade smoothly and -causes confusion. - -For instance, the current Go runtime release, which is tagged with v4.13.0 in `antlr/antlr4` is retrieved by go get as: - -```sh -require ( - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc -) -``` - -Where you would expect to see: - -```sh -require ( - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.13.0 -) -``` - -The decision was taken to create a separate org in a separate repo to hold the official Go runtime for ANTLR and -from whence users can expect `go get` to behave as expected. - - -# Documentation -Please read the official documentation at: https://github.com/antlr/antlr4/blob/master/doc/index.md for tips on -migrating existing projects to use the new module location and for information on how to use the Go runtime in -general. diff --git a/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go b/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go deleted file mode 100644 index 3bb4fd7c4..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Package antlr implements the Go version of the ANTLR 4 runtime. - -# The ANTLR Tool - -ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, -or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. -From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface -(or visitor) that makes it easy to respond to the recognition of phrases of interest. - -# Go Runtime - -At version 4.11.x and prior, the Go runtime was not properly versioned for go modules. After this point, the runtime -source code to be imported was held in the `runtime/Go/antlr/v4` directory, and the go.mod file was updated to reflect the version of -ANTLR4 that it is compatible with (I.E. uses the /v4 path). - -However, this was found to be problematic, as it meant that with the runtime embedded so far underneath the root -of the repo, the `go get` and related commands could not properly resolve the location of the go runtime source code. -This meant that the reference to the runtime in your `go.mod` file would refer to the correct source code, but would not -list the release tag such as @4.12.0 - this was confusing, to say the least. - -As of 4.12.1, the runtime is now available as a go module in its own repo, and can be imported as `github.com/antlr4-go/antlr` -(the go get command should also be used with this path). See the main documentation for the ANTLR4 project for more information, -which is available at [ANTLR docs]. The documentation for using the Go runtime is available at [Go runtime docs]. - -This means that if you are using the source code without modules, you should also use the source code in the [new repo]. -Though we highly recommend that you use go modules, as they are now idiomatic for Go. - -I am aware that this change will prove Hyrum's Law, but am prepared to live with it for the common good. - -Go runtime author: [Jim Idle] jimi@idle.ws - -# Code Generation - -ANTLR supports the generation of code in a number of [target languages], and the generated code is supported by a -runtime library, written specifically to support the generated code in the target language. This library is the -runtime for the Go target. - -To generate code for the go target, it is generally recommended to place the source grammar files in a package of -their own, and use the `.sh` script method of generating code, using the go generate directive. In that same directory -it is usual, though not required, to place the antlr tool that should be used to generate the code. That does mean -that the antlr tool JAR file will be checked in to your source code control though, so you are, of course, free to use any other -way of specifying the version of the ANTLR tool to use, such as aliasing in `.zshrc` or equivalent, or a profile in -your IDE, or configuration in your CI system. Checking in the jar does mean that it is easy to reproduce the build as -it was at any point in its history. - -Here is a general/recommended template for an ANTLR based recognizer in Go: - - . - ├── parser - │ ├── mygrammar.g4 - │ ├── antlr-4.12.1-complete.jar - │ ├── generate.go - │ └── generate.sh - ├── parsing - generated code goes here - │ └── error_listeners.go - ├── go.mod - ├── go.sum - ├── main.go - └── main_test.go - -Make sure that the package statement in your grammar file(s) reflects the go package the generated code will exist in. - -The generate.go file then looks like this: - - package parser - - //go:generate ./generate.sh - -And the generate.sh file will look similar to this: - - #!/bin/sh - - alias antlr4='java -Xmx500M -cp "./antlr4-4.12.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool' - antlr4 -Dlanguage=Go -no-visitor -package parsing *.g4 - -depending on whether you want visitors or listeners or any other ANTLR options. Not that another option here -is to generate the code into a - -From the command line at the root of your source package (location of go.mo)d) you can then simply issue the command: - - go generate ./... - -Which will generate the code for the parser, and place it in the parsing package. You can then use the generated code -by importing the parsing package. - -There are no hard and fast rules on this. It is just a recommendation. You can generate the code in any way and to anywhere you like. - -# Copyright Notice - -Copyright (c) 2012-2023 The ANTLR Project. All rights reserved. - -Use of this file is governed by the BSD 3-clause license, which can be found in the [LICENSE.txt] file in the project root. - -[target languages]: https://github.com/antlr/antlr4/tree/master/runtime -[LICENSE.txt]: https://github.com/antlr/antlr4/blob/master/LICENSE.txt -[ANTLR docs]: https://github.com/antlr/antlr4/blob/master/doc/index.md -[new repo]: https://github.com/antlr4-go/antlr -[Jim Idle]: https://github.com/jimidle -[Go runtime docs]: https://github.com/antlr/antlr4/blob/master/doc/go-target.md -*/ -package antlr diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn.go b/vendor/github.com/antlr4-go/antlr/v4/atn.go deleted file mode 100644 index cdeefed24..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "sync" - -// ATNInvalidAltNumber is used to represent an ALT number that has yet to be calculated or -// which is invalid for a particular struct such as [*antlr.BaseRuleContext] -var ATNInvalidAltNumber int - -// ATN represents an “[Augmented Transition Network]”, though general in ANTLR the term -// “Augmented Recursive Transition Network” though there are some descriptions of “[Recursive Transition Network]” -// in existence. -// -// ATNs represent the main networks in the system and are serialized by the code generator and support [ALL(*)]. -// -// [Augmented Transition Network]: https://en.wikipedia.org/wiki/Augmented_transition_network -// [ALL(*)]: https://www.antlr.org/papers/allstar-techreport.pdf -// [Recursive Transition Network]: https://en.wikipedia.org/wiki/Recursive_transition_network -type ATN struct { - - // DecisionToState is the decision points for all rules, sub-rules, optional - // blocks, ()+, ()*, etc. Each sub-rule/rule is a decision point, and we must track them, so we - // can go back later and build DFA predictors for them. This includes - // all the rules, sub-rules, optional blocks, ()+, ()* etc... - DecisionToState []DecisionState - - // grammarType is the ATN type and is used for deserializing ATNs from strings. - grammarType int - - // lexerActions is referenced by action transitions in the ATN for lexer ATNs. - lexerActions []LexerAction - - // maxTokenType is the maximum value for any symbol recognized by a transition in the ATN. - maxTokenType int - - modeNameToStartState map[string]*TokensStartState - - modeToStartState []*TokensStartState - - // ruleToStartState maps from rule index to starting state number. - ruleToStartState []*RuleStartState - - // ruleToStopState maps from rule index to stop state number. - ruleToStopState []*RuleStopState - - // ruleToTokenType maps the rule index to the resulting token type for lexer - // ATNs. For parser ATNs, it maps the rule index to the generated bypass token - // type if ATNDeserializationOptions.isGenerateRuleBypassTransitions was - // specified, and otherwise is nil. - ruleToTokenType []int - - // ATNStates is a list of all states in the ATN, ordered by state number. - // - states []ATNState - - mu sync.Mutex - stateMu sync.RWMutex - edgeMu sync.RWMutex -} - -// NewATN returns a new ATN struct representing the given grammarType and is used -// for runtime deserialization of ATNs from the code generated by the ANTLR tool -func NewATN(grammarType int, maxTokenType int) *ATN { - return &ATN{ - grammarType: grammarType, - maxTokenType: maxTokenType, - modeNameToStartState: make(map[string]*TokensStartState), - } -} - -// NextTokensInContext computes and returns the set of valid tokens that can occur starting -// in state s. If ctx is nil, the set of tokens will not include what can follow -// the rule surrounding s. In other words, the set will be restricted to tokens -// reachable staying within the rule of s. -func (a *ATN) NextTokensInContext(s ATNState, ctx RuleContext) *IntervalSet { - return NewLL1Analyzer(a).Look(s, nil, ctx) -} - -// NextTokensNoContext computes and returns the set of valid tokens that can occur starting -// in state s and staying in same rule. [antlr.Token.EPSILON] is in set if we reach end of -// rule. -func (a *ATN) NextTokensNoContext(s ATNState) *IntervalSet { - a.mu.Lock() - defer a.mu.Unlock() - iset := s.GetNextTokenWithinRule() - if iset == nil { - iset = a.NextTokensInContext(s, nil) - iset.readOnly = true - s.SetNextTokenWithinRule(iset) - } - return iset -} - -// NextTokens computes and returns the set of valid tokens starting in state s, by -// calling either [NextTokensNoContext] (ctx == nil) or [NextTokensInContext] (ctx != nil). -func (a *ATN) NextTokens(s ATNState, ctx RuleContext) *IntervalSet { - if ctx == nil { - return a.NextTokensNoContext(s) - } - - return a.NextTokensInContext(s, ctx) -} - -func (a *ATN) addState(state ATNState) { - if state != nil { - state.SetATN(a) - state.SetStateNumber(len(a.states)) - } - - a.states = append(a.states, state) -} - -func (a *ATN) removeState(state ATNState) { - a.states[state.GetStateNumber()] = nil // Just free the memory; don't shift states in the slice -} - -func (a *ATN) defineDecisionState(s DecisionState) int { - a.DecisionToState = append(a.DecisionToState, s) - s.setDecision(len(a.DecisionToState) - 1) - - return s.getDecision() -} - -func (a *ATN) getDecisionState(decision int) DecisionState { - if len(a.DecisionToState) == 0 { - return nil - } - - return a.DecisionToState[decision] -} - -// getExpectedTokens computes the set of input symbols which could follow ATN -// state number stateNumber in the specified full parse context ctx and returns -// the set of potentially valid input symbols which could follow the specified -// state in the specified context. This method considers the complete parser -// context, but does not evaluate semantic predicates (i.e. all predicates -// encountered during the calculation are assumed true). If a path in the ATN -// exists from the starting state to the RuleStopState of the outermost context -// without Matching any symbols, Token.EOF is added to the returned set. -// -// A nil ctx defaults to ParserRuleContext.EMPTY. -// -// It panics if the ATN does not contain state stateNumber. -func (a *ATN) getExpectedTokens(stateNumber int, ctx RuleContext) *IntervalSet { - if stateNumber < 0 || stateNumber >= len(a.states) { - panic("Invalid state number.") - } - - s := a.states[stateNumber] - following := a.NextTokens(s, nil) - - if !following.contains(TokenEpsilon) { - return following - } - - expected := NewIntervalSet() - - expected.addSet(following) - expected.removeOne(TokenEpsilon) - - for ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) { - invokingState := a.states[ctx.GetInvokingState()] - rt := invokingState.GetTransitions()[0] - - following = a.NextTokens(rt.(*RuleTransition).followState, nil) - expected.addSet(following) - expected.removeOne(TokenEpsilon) - ctx = ctx.GetParent().(RuleContext) - } - - if following.contains(TokenEpsilon) { - expected.addOne(TokenEOF) - } - - return expected -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_config.go b/vendor/github.com/antlr4-go/antlr/v4/atn_config.go deleted file mode 100644 index a83f25d34..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_config.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" -) - -const ( - lexerConfig = iota // Indicates that this ATNConfig is for a lexer - parserConfig // Indicates that this ATNConfig is for a parser -) - -// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic -// context). The syntactic context is a graph-structured stack node whose -// path(s) to the root is the rule invocation(s) chain used to arrive in the -// state. The semantic context is the tree of semantic predicates encountered -// before reaching an ATN state. -type ATNConfig struct { - precedenceFilterSuppressed bool - state ATNState - alt int - context *PredictionContext - semanticContext SemanticContext - reachesIntoOuterContext int - cType int // lexerConfig or parserConfig - lexerActionExecutor *LexerActionExecutor - passedThroughNonGreedyDecision bool -} - -// NewATNConfig6 creates a new ATNConfig instance given a state, alt and context only -func NewATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig { - return NewATNConfig5(state, alt, context, SemanticContextNone) -} - -// NewATNConfig5 creates a new ATNConfig instance given a state, alt, context and semantic context -func NewATNConfig5(state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) *ATNConfig { - if semanticContext == nil { - panic("semanticContext cannot be nil") // TODO: Necessary? - } - - pac := &ATNConfig{} - pac.state = state - pac.alt = alt - pac.context = context - pac.semanticContext = semanticContext - pac.cType = parserConfig - return pac -} - -// NewATNConfig4 creates a new ATNConfig instance given an existing config, and a state only -func NewATNConfig4(c *ATNConfig, state ATNState) *ATNConfig { - return NewATNConfig(c, state, c.GetContext(), c.GetSemanticContext()) -} - -// NewATNConfig3 creates a new ATNConfig instance given an existing config, a state and a semantic context -func NewATNConfig3(c *ATNConfig, state ATNState, semanticContext SemanticContext) *ATNConfig { - return NewATNConfig(c, state, c.GetContext(), semanticContext) -} - -// NewATNConfig2 creates a new ATNConfig instance given an existing config, and a context only -func NewATNConfig2(c *ATNConfig, semanticContext SemanticContext) *ATNConfig { - return NewATNConfig(c, c.GetState(), c.GetContext(), semanticContext) -} - -// NewATNConfig1 creates a new ATNConfig instance given an existing config, a state, and a context only -func NewATNConfig1(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig { - return NewATNConfig(c, state, context, c.GetSemanticContext()) -} - -// NewATNConfig creates a new ATNConfig instance given an existing config, a state, a context and a semantic context, other 'constructors' -// are just wrappers around this one. -func NewATNConfig(c *ATNConfig, state ATNState, context *PredictionContext, semanticContext SemanticContext) *ATNConfig { - if semanticContext == nil { - panic("semanticContext cannot be nil") // TODO: Remove this - probably put here for some bug that is now fixed - } - b := &ATNConfig{} - b.InitATNConfig(c, state, c.GetAlt(), context, semanticContext) - b.cType = parserConfig - return b -} - -func (a *ATNConfig) InitATNConfig(c *ATNConfig, state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) { - - a.state = state - a.alt = alt - a.context = context - a.semanticContext = semanticContext - a.reachesIntoOuterContext = c.GetReachesIntoOuterContext() - a.precedenceFilterSuppressed = c.getPrecedenceFilterSuppressed() -} - -func (a *ATNConfig) getPrecedenceFilterSuppressed() bool { - return a.precedenceFilterSuppressed -} - -func (a *ATNConfig) setPrecedenceFilterSuppressed(v bool) { - a.precedenceFilterSuppressed = v -} - -// GetState returns the ATN state associated with this configuration -func (a *ATNConfig) GetState() ATNState { - return a.state -} - -// GetAlt returns the alternative associated with this configuration -func (a *ATNConfig) GetAlt() int { - return a.alt -} - -// SetContext sets the rule invocation stack associated with this configuration -func (a *ATNConfig) SetContext(v *PredictionContext) { - a.context = v -} - -// GetContext returns the rule invocation stack associated with this configuration -func (a *ATNConfig) GetContext() *PredictionContext { - return a.context -} - -// GetSemanticContext returns the semantic context associated with this configuration -func (a *ATNConfig) GetSemanticContext() SemanticContext { - return a.semanticContext -} - -// GetReachesIntoOuterContext returns the count of references to an outer context from this configuration -func (a *ATNConfig) GetReachesIntoOuterContext() int { - return a.reachesIntoOuterContext -} - -// SetReachesIntoOuterContext sets the count of references to an outer context from this configuration -func (a *ATNConfig) SetReachesIntoOuterContext(v int) { - a.reachesIntoOuterContext = v -} - -// Equals is the default comparison function for an ATNConfig when no specialist implementation is required -// for a collection. -// -// An ATN configuration is equal to another if both have the same state, they -// predict the same alternative, and syntactic/semantic contexts are the same. -func (a *ATNConfig) Equals(o Collectable[*ATNConfig]) bool { - switch a.cType { - case lexerConfig: - return a.LEquals(o) - case parserConfig: - return a.PEquals(o) - default: - panic("Invalid ATNConfig type") - } -} - -// PEquals is the default comparison function for a Parser ATNConfig when no specialist implementation is required -// for a collection. -// -// An ATN configuration is equal to another if both have the same state, they -// predict the same alternative, and syntactic/semantic contexts are the same. -func (a *ATNConfig) PEquals(o Collectable[*ATNConfig]) bool { - var other, ok = o.(*ATNConfig) - - if !ok { - return false - } - if a == other { - return true - } else if other == nil { - return false - } - - var equal bool - - if a.context == nil { - equal = other.context == nil - } else { - equal = a.context.Equals(other.context) - } - - var ( - nums = a.state.GetStateNumber() == other.state.GetStateNumber() - alts = a.alt == other.alt - cons = a.semanticContext.Equals(other.semanticContext) - sups = a.precedenceFilterSuppressed == other.precedenceFilterSuppressed - ) - - return nums && alts && cons && sups && equal -} - -// Hash is the default hash function for a parser ATNConfig, when no specialist hash function -// is required for a collection -func (a *ATNConfig) Hash() int { - switch a.cType { - case lexerConfig: - return a.LHash() - case parserConfig: - return a.PHash() - default: - panic("Invalid ATNConfig type") - } -} - -// PHash is the default hash function for a parser ATNConfig, when no specialist hash function -// is required for a collection -func (a *ATNConfig) PHash() int { - var c int - if a.context != nil { - c = a.context.Hash() - } - - h := murmurInit(7) - h = murmurUpdate(h, a.state.GetStateNumber()) - h = murmurUpdate(h, a.alt) - h = murmurUpdate(h, c) - h = murmurUpdate(h, a.semanticContext.Hash()) - return murmurFinish(h, 4) -} - -// String returns a string representation of the ATNConfig, usually used for debugging purposes -func (a *ATNConfig) String() string { - var s1, s2, s3 string - - if a.context != nil { - s1 = ",[" + fmt.Sprint(a.context) + "]" - } - - if a.semanticContext != SemanticContextNone { - s2 = "," + fmt.Sprint(a.semanticContext) - } - - if a.reachesIntoOuterContext > 0 { - s3 = ",up=" + fmt.Sprint(a.reachesIntoOuterContext) - } - - return fmt.Sprintf("(%v,%v%v%v%v)", a.state, a.alt, s1, s2, s3) -} - -func NewLexerATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig { - lac := &ATNConfig{} - lac.state = state - lac.alt = alt - lac.context = context - lac.semanticContext = SemanticContextNone - lac.cType = lexerConfig - return lac -} - -func NewLexerATNConfig4(c *ATNConfig, state ATNState) *ATNConfig { - lac := &ATNConfig{} - lac.lexerActionExecutor = c.lexerActionExecutor - lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state) - lac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext()) - lac.cType = lexerConfig - return lac -} - -func NewLexerATNConfig3(c *ATNConfig, state ATNState, lexerActionExecutor *LexerActionExecutor) *ATNConfig { - lac := &ATNConfig{} - lac.lexerActionExecutor = lexerActionExecutor - lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state) - lac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext()) - lac.cType = lexerConfig - return lac -} - -func NewLexerATNConfig2(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig { - lac := &ATNConfig{} - lac.lexerActionExecutor = c.lexerActionExecutor - lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state) - lac.InitATNConfig(c, state, c.GetAlt(), context, c.GetSemanticContext()) - lac.cType = lexerConfig - return lac -} - -//goland:noinspection GoUnusedExportedFunction -func NewLexerATNConfig1(state ATNState, alt int, context *PredictionContext) *ATNConfig { - lac := &ATNConfig{} - lac.state = state - lac.alt = alt - lac.context = context - lac.semanticContext = SemanticContextNone - lac.cType = lexerConfig - return lac -} - -// LHash is the default hash function for Lexer ATNConfig objects, it can be used directly or via -// the default comparator [ObjEqComparator]. -func (a *ATNConfig) LHash() int { - var f int - if a.passedThroughNonGreedyDecision { - f = 1 - } else { - f = 0 - } - h := murmurInit(7) - h = murmurUpdate(h, a.state.GetStateNumber()) - h = murmurUpdate(h, a.alt) - h = murmurUpdate(h, a.context.Hash()) - h = murmurUpdate(h, a.semanticContext.Hash()) - h = murmurUpdate(h, f) - h = murmurUpdate(h, a.lexerActionExecutor.Hash()) - h = murmurFinish(h, 6) - return h -} - -// LEquals is the default comparison function for Lexer ATNConfig objects, it can be used directly or via -// the default comparator [ObjEqComparator]. -func (a *ATNConfig) LEquals(other Collectable[*ATNConfig]) bool { - var otherT, ok = other.(*ATNConfig) - if !ok { - return false - } else if a == otherT { - return true - } else if a.passedThroughNonGreedyDecision != otherT.passedThroughNonGreedyDecision { - return false - } - - switch { - case a.lexerActionExecutor == nil && otherT.lexerActionExecutor == nil: - return true - case a.lexerActionExecutor != nil && otherT.lexerActionExecutor != nil: - if !a.lexerActionExecutor.Equals(otherT.lexerActionExecutor) { - return false - } - default: - return false // One but not both, are nil - } - - return a.PEquals(otherT) -} - -func checkNonGreedyDecision(source *ATNConfig, target ATNState) bool { - var ds, ok = target.(DecisionState) - - return source.passedThroughNonGreedyDecision || (ok && ds.getNonGreedy()) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go b/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go deleted file mode 100644 index 52dbaf806..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" -) - -// ATNConfigSet is a specialized set of ATNConfig that tracks information -// about its elements and can combine similar configurations using a -// graph-structured stack. -type ATNConfigSet struct { - cachedHash int - - // configLookup is used to determine whether two ATNConfigSets are equal. We - // need all configurations with the same (s, i, _, semctx) to be equal. A key - // effectively doubles the number of objects associated with ATNConfigs. All - // keys are hashed by (s, i, _, pi), not including the context. Wiped out when - // read-only because a set becomes a DFA state. - configLookup *JStore[*ATNConfig, Comparator[*ATNConfig]] - - // configs is the added elements that did not match an existing key in configLookup - configs []*ATNConfig - - // TODO: These fields make me pretty uncomfortable, but it is nice to pack up - // info together because it saves re-computation. Can we track conflicts as they - // are added to save scanning configs later? - conflictingAlts *BitSet - - // dipsIntoOuterContext is used by parsers and lexers. In a lexer, it indicates - // we hit a pred while computing a closure operation. Do not make a DFA state - // from the ATNConfigSet in this case. TODO: How is this used by parsers? - dipsIntoOuterContext bool - - // fullCtx is whether it is part of a full context LL prediction. Used to - // determine how to merge $. It is a wildcard with SLL, but not for an LL - // context merge. - fullCtx bool - - // Used in parser and lexer. In lexer, it indicates we hit a pred - // while computing a closure operation. Don't make a DFA state from this set. - hasSemanticContext bool - - // readOnly is whether it is read-only. Do not - // allow any code to manipulate the set if true because DFA states will point at - // sets and those must not change. It not, protect other fields; conflictingAlts - // in particular, which is assigned after readOnly. - readOnly bool - - // TODO: These fields make me pretty uncomfortable, but it is nice to pack up - // info together because it saves re-computation. Can we track conflicts as they - // are added to save scanning configs later? - uniqueAlt int -} - -// Alts returns the combined set of alts for all the configurations in this set. -func (b *ATNConfigSet) Alts() *BitSet { - alts := NewBitSet() - for _, it := range b.configs { - alts.add(it.GetAlt()) - } - return alts -} - -// NewATNConfigSet creates a new ATNConfigSet instance. -func NewATNConfigSet(fullCtx bool) *ATNConfigSet { - return &ATNConfigSet{ - cachedHash: -1, - configLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, "NewATNConfigSet()"), - fullCtx: fullCtx, - } -} - -// Add merges contexts with existing configs for (s, i, pi, _), -// where 's' is the ATNConfig.state, 'i' is the ATNConfig.alt, and -// 'pi' is the [ATNConfig].semanticContext. -// -// We use (s,i,pi) as the key. -// Updates dipsIntoOuterContext and hasSemanticContext when necessary. -func (b *ATNConfigSet) Add(config *ATNConfig, mergeCache *JPCMap) bool { - if b.readOnly { - panic("set is read-only") - } - - if config.GetSemanticContext() != SemanticContextNone { - b.hasSemanticContext = true - } - - if config.GetReachesIntoOuterContext() > 0 { - b.dipsIntoOuterContext = true - } - - existing, present := b.configLookup.Put(config) - - // The config was not already in the set - // - if !present { - b.cachedHash = -1 - b.configs = append(b.configs, config) // Track order here - return true - } - - // Merge a previous (s, i, pi, _) with it and save the result - rootIsWildcard := !b.fullCtx - merged := merge(existing.GetContext(), config.GetContext(), rootIsWildcard, mergeCache) - - // No need to check for existing.context because config.context is in the cache, - // since the only way to create new graphs is the "call rule" and here. We cache - // at both places. - existing.SetReachesIntoOuterContext(intMax(existing.GetReachesIntoOuterContext(), config.GetReachesIntoOuterContext())) - - // Preserve the precedence filter suppression during the merge - if config.getPrecedenceFilterSuppressed() { - existing.setPrecedenceFilterSuppressed(true) - } - - // Replace the context because there is no need to do alt mapping - existing.SetContext(merged) - - return true -} - -// GetStates returns the set of states represented by all configurations in this config set -func (b *ATNConfigSet) GetStates() *JStore[ATNState, Comparator[ATNState]] { - - // states uses the standard comparator and Hash() provided by the ATNState instance - // - states := NewJStore[ATNState, Comparator[ATNState]](aStateEqInst, ATNStateCollection, "ATNConfigSet.GetStates()") - - for i := 0; i < len(b.configs); i++ { - states.Put(b.configs[i].GetState()) - } - - return states -} - -func (b *ATNConfigSet) GetPredicates() []SemanticContext { - predicates := make([]SemanticContext, 0) - - for i := 0; i < len(b.configs); i++ { - c := b.configs[i].GetSemanticContext() - - if c != SemanticContextNone { - predicates = append(predicates, c) - } - } - - return predicates -} - -func (b *ATNConfigSet) OptimizeConfigs(interpreter *BaseATNSimulator) { - if b.readOnly { - panic("set is read-only") - } - - // Empty indicate no optimization is possible - if b.configLookup == nil || b.configLookup.Len() == 0 { - return - } - - for i := 0; i < len(b.configs); i++ { - config := b.configs[i] - config.SetContext(interpreter.getCachedContext(config.GetContext())) - } -} - -func (b *ATNConfigSet) AddAll(coll []*ATNConfig) bool { - for i := 0; i < len(coll); i++ { - b.Add(coll[i], nil) - } - - return false -} - -// Compare The configs are only equal if they are in the same order and their Equals function returns true. -// Java uses ArrayList.equals(), which requires the same order. -func (b *ATNConfigSet) Compare(bs *ATNConfigSet) bool { - if len(b.configs) != len(bs.configs) { - return false - } - for i := 0; i < len(b.configs); i++ { - if !b.configs[i].Equals(bs.configs[i]) { - return false - } - } - - return true -} - -func (b *ATNConfigSet) Equals(other Collectable[ATNConfig]) bool { - if b == other { - return true - } else if _, ok := other.(*ATNConfigSet); !ok { - return false - } - - other2 := other.(*ATNConfigSet) - var eca bool - switch { - case b.conflictingAlts == nil && other2.conflictingAlts == nil: - eca = true - case b.conflictingAlts != nil && other2.conflictingAlts != nil: - eca = b.conflictingAlts.equals(other2.conflictingAlts) - } - return b.configs != nil && - b.fullCtx == other2.fullCtx && - b.uniqueAlt == other2.uniqueAlt && - eca && - b.hasSemanticContext == other2.hasSemanticContext && - b.dipsIntoOuterContext == other2.dipsIntoOuterContext && - b.Compare(other2) -} - -func (b *ATNConfigSet) Hash() int { - if b.readOnly { - if b.cachedHash == -1 { - b.cachedHash = b.hashCodeConfigs() - } - - return b.cachedHash - } - - return b.hashCodeConfigs() -} - -func (b *ATNConfigSet) hashCodeConfigs() int { - h := 1 - for _, config := range b.configs { - h = 31*h + config.Hash() - } - return h -} - -func (b *ATNConfigSet) Contains(item *ATNConfig) bool { - if b.readOnly { - panic("not implemented for read-only sets") - } - if b.configLookup == nil { - return false - } - return b.configLookup.Contains(item) -} - -func (b *ATNConfigSet) ContainsFast(item *ATNConfig) bool { - return b.Contains(item) -} - -func (b *ATNConfigSet) Clear() { - if b.readOnly { - panic("set is read-only") - } - b.configs = make([]*ATNConfig, 0) - b.cachedHash = -1 - b.configLookup = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, "NewATNConfigSet()") -} - -func (b *ATNConfigSet) String() string { - - s := "[" - - for i, c := range b.configs { - s += c.String() - - if i != len(b.configs)-1 { - s += ", " - } - } - - s += "]" - - if b.hasSemanticContext { - s += ",hasSemanticContext=" + fmt.Sprint(b.hasSemanticContext) - } - - if b.uniqueAlt != ATNInvalidAltNumber { - s += ",uniqueAlt=" + fmt.Sprint(b.uniqueAlt) - } - - if b.conflictingAlts != nil { - s += ",conflictingAlts=" + b.conflictingAlts.String() - } - - if b.dipsIntoOuterContext { - s += ",dipsIntoOuterContext" - } - - return s -} - -// NewOrderedATNConfigSet creates a config set with a slightly different Hash/Equal pair -// for use in lexers. -func NewOrderedATNConfigSet() *ATNConfigSet { - return &ATNConfigSet{ - cachedHash: -1, - // This set uses the standard Hash() and Equals() from ATNConfig - configLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ATNConfigCollection, "ATNConfigSet.NewOrderedATNConfigSet()"), - fullCtx: false, - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go b/vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go deleted file mode 100644 index bdb30b362..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "errors" - -var defaultATNDeserializationOptions = ATNDeserializationOptions{true, true, false} - -type ATNDeserializationOptions struct { - readOnly bool - verifyATN bool - generateRuleBypassTransitions bool -} - -func (opts *ATNDeserializationOptions) ReadOnly() bool { - return opts.readOnly -} - -func (opts *ATNDeserializationOptions) SetReadOnly(readOnly bool) { - if opts.readOnly { - panic(errors.New("cannot mutate read only ATNDeserializationOptions")) - } - opts.readOnly = readOnly -} - -func (opts *ATNDeserializationOptions) VerifyATN() bool { - return opts.verifyATN -} - -func (opts *ATNDeserializationOptions) SetVerifyATN(verifyATN bool) { - if opts.readOnly { - panic(errors.New("cannot mutate read only ATNDeserializationOptions")) - } - opts.verifyATN = verifyATN -} - -func (opts *ATNDeserializationOptions) GenerateRuleBypassTransitions() bool { - return opts.generateRuleBypassTransitions -} - -func (opts *ATNDeserializationOptions) SetGenerateRuleBypassTransitions(generateRuleBypassTransitions bool) { - if opts.readOnly { - panic(errors.New("cannot mutate read only ATNDeserializationOptions")) - } - opts.generateRuleBypassTransitions = generateRuleBypassTransitions -} - -//goland:noinspection GoUnusedExportedFunction -func DefaultATNDeserializationOptions() *ATNDeserializationOptions { - return NewATNDeserializationOptions(&defaultATNDeserializationOptions) -} - -func NewATNDeserializationOptions(other *ATNDeserializationOptions) *ATNDeserializationOptions { - o := new(ATNDeserializationOptions) - if other != nil { - *o = *other - o.readOnly = false - } - return o -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go b/vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go deleted file mode 100644 index 2dcb9ae11..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go +++ /dev/null @@ -1,684 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" -) - -const serializedVersion = 4 - -type loopEndStateIntPair struct { - item0 *LoopEndState - item1 int -} - -type blockStartStateIntPair struct { - item0 BlockStartState - item1 int -} - -type ATNDeserializer struct { - options *ATNDeserializationOptions - data []int32 - pos int -} - -func NewATNDeserializer(options *ATNDeserializationOptions) *ATNDeserializer { - if options == nil { - options = &defaultATNDeserializationOptions - } - - return &ATNDeserializer{options: options} -} - -//goland:noinspection GoUnusedFunction -func stringInSlice(a string, list []string) int { - for i, b := range list { - if b == a { - return i - } - } - - return -1 -} - -func (a *ATNDeserializer) Deserialize(data []int32) *ATN { - a.data = data - a.pos = 0 - a.checkVersion() - - atn := a.readATN() - - a.readStates(atn) - a.readRules(atn) - a.readModes(atn) - - sets := a.readSets(atn, nil) - - a.readEdges(atn, sets) - a.readDecisions(atn) - a.readLexerActions(atn) - a.markPrecedenceDecisions(atn) - a.verifyATN(atn) - - if a.options.GenerateRuleBypassTransitions() && atn.grammarType == ATNTypeParser { - a.generateRuleBypassTransitions(atn) - // Re-verify after modification - a.verifyATN(atn) - } - - return atn - -} - -func (a *ATNDeserializer) checkVersion() { - version := a.readInt() - - if version != serializedVersion { - panic("Could not deserialize ATN with version " + strconv.Itoa(version) + " (expected " + strconv.Itoa(serializedVersion) + ").") - } -} - -func (a *ATNDeserializer) readATN() *ATN { - grammarType := a.readInt() - maxTokenType := a.readInt() - - return NewATN(grammarType, maxTokenType) -} - -func (a *ATNDeserializer) readStates(atn *ATN) { - nstates := a.readInt() - - // Allocate worst case size. - loopBackStateNumbers := make([]loopEndStateIntPair, 0, nstates) - endStateNumbers := make([]blockStartStateIntPair, 0, nstates) - - // Preallocate states slice. - atn.states = make([]ATNState, 0, nstates) - - for i := 0; i < nstates; i++ { - stype := a.readInt() - - // Ignore bad types of states - if stype == ATNStateInvalidType { - atn.addState(nil) - continue - } - - ruleIndex := a.readInt() - - s := a.stateFactory(stype, ruleIndex) - - if stype == ATNStateLoopEnd { - loopBackStateNumber := a.readInt() - - loopBackStateNumbers = append(loopBackStateNumbers, loopEndStateIntPair{s.(*LoopEndState), loopBackStateNumber}) - } else if s2, ok := s.(BlockStartState); ok { - endStateNumber := a.readInt() - - endStateNumbers = append(endStateNumbers, blockStartStateIntPair{s2, endStateNumber}) - } - - atn.addState(s) - } - - // Delay the assignment of loop back and end states until we know all the state - // instances have been initialized - for _, pair := range loopBackStateNumbers { - pair.item0.loopBackState = atn.states[pair.item1] - } - - for _, pair := range endStateNumbers { - pair.item0.setEndState(atn.states[pair.item1].(*BlockEndState)) - } - - numNonGreedyStates := a.readInt() - for j := 0; j < numNonGreedyStates; j++ { - stateNumber := a.readInt() - - atn.states[stateNumber].(DecisionState).setNonGreedy(true) - } - - numPrecedenceStates := a.readInt() - for j := 0; j < numPrecedenceStates; j++ { - stateNumber := a.readInt() - - atn.states[stateNumber].(*RuleStartState).isPrecedenceRule = true - } -} - -func (a *ATNDeserializer) readRules(atn *ATN) { - nrules := a.readInt() - - if atn.grammarType == ATNTypeLexer { - atn.ruleToTokenType = make([]int, nrules) - } - - atn.ruleToStartState = make([]*RuleStartState, nrules) - - for i := range atn.ruleToStartState { - s := a.readInt() - startState := atn.states[s].(*RuleStartState) - - atn.ruleToStartState[i] = startState - - if atn.grammarType == ATNTypeLexer { - tokenType := a.readInt() - - atn.ruleToTokenType[i] = tokenType - } - } - - atn.ruleToStopState = make([]*RuleStopState, nrules) - - for _, state := range atn.states { - if s2, ok := state.(*RuleStopState); ok { - atn.ruleToStopState[s2.ruleIndex] = s2 - atn.ruleToStartState[s2.ruleIndex].stopState = s2 - } - } -} - -func (a *ATNDeserializer) readModes(atn *ATN) { - nmodes := a.readInt() - atn.modeToStartState = make([]*TokensStartState, nmodes) - - for i := range atn.modeToStartState { - s := a.readInt() - - atn.modeToStartState[i] = atn.states[s].(*TokensStartState) - } -} - -func (a *ATNDeserializer) readSets(_ *ATN, sets []*IntervalSet) []*IntervalSet { - m := a.readInt() - - // Preallocate the needed capacity. - if cap(sets)-len(sets) < m { - isets := make([]*IntervalSet, len(sets), len(sets)+m) - copy(isets, sets) - sets = isets - } - - for i := 0; i < m; i++ { - iset := NewIntervalSet() - - sets = append(sets, iset) - - n := a.readInt() - containsEOF := a.readInt() - - if containsEOF != 0 { - iset.addOne(-1) - } - - for j := 0; j < n; j++ { - i1 := a.readInt() - i2 := a.readInt() - - iset.addRange(i1, i2) - } - } - - return sets -} - -func (a *ATNDeserializer) readEdges(atn *ATN, sets []*IntervalSet) { - nedges := a.readInt() - - for i := 0; i < nedges; i++ { - var ( - src = a.readInt() - trg = a.readInt() - ttype = a.readInt() - arg1 = a.readInt() - arg2 = a.readInt() - arg3 = a.readInt() - trans = a.edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets) - srcState = atn.states[src] - ) - - srcState.AddTransition(trans, -1) - } - - // Edges for rule stop states can be derived, so they are not serialized - for _, state := range atn.states { - for _, t := range state.GetTransitions() { - var rt, ok = t.(*RuleTransition) - - if !ok { - continue - } - - outermostPrecedenceReturn := -1 - - if atn.ruleToStartState[rt.getTarget().GetRuleIndex()].isPrecedenceRule { - if rt.precedence == 0 { - outermostPrecedenceReturn = rt.getTarget().GetRuleIndex() - } - } - - trans := NewEpsilonTransition(rt.followState, outermostPrecedenceReturn) - - atn.ruleToStopState[rt.getTarget().GetRuleIndex()].AddTransition(trans, -1) - } - } - - for _, state := range atn.states { - if s2, ok := state.(BlockStartState); ok { - // We need to know the end state to set its start state - if s2.getEndState() == nil { - panic("IllegalState") - } - - // Block end states can only be associated to a single block start state - if s2.getEndState().startState != nil { - panic("IllegalState") - } - - s2.getEndState().startState = state - } - - if s2, ok := state.(*PlusLoopbackState); ok { - for _, t := range s2.GetTransitions() { - if t2, ok := t.getTarget().(*PlusBlockStartState); ok { - t2.loopBackState = state - } - } - } else if s2, ok := state.(*StarLoopbackState); ok { - for _, t := range s2.GetTransitions() { - if t2, ok := t.getTarget().(*StarLoopEntryState); ok { - t2.loopBackState = state - } - } - } - } -} - -func (a *ATNDeserializer) readDecisions(atn *ATN) { - ndecisions := a.readInt() - - for i := 0; i < ndecisions; i++ { - s := a.readInt() - decState := atn.states[s].(DecisionState) - - atn.DecisionToState = append(atn.DecisionToState, decState) - decState.setDecision(i) - } -} - -func (a *ATNDeserializer) readLexerActions(atn *ATN) { - if atn.grammarType == ATNTypeLexer { - count := a.readInt() - - atn.lexerActions = make([]LexerAction, count) - - for i := range atn.lexerActions { - actionType := a.readInt() - data1 := a.readInt() - data2 := a.readInt() - atn.lexerActions[i] = a.lexerActionFactory(actionType, data1, data2) - } - } -} - -func (a *ATNDeserializer) generateRuleBypassTransitions(atn *ATN) { - count := len(atn.ruleToStartState) - - for i := 0; i < count; i++ { - atn.ruleToTokenType[i] = atn.maxTokenType + i + 1 - } - - for i := 0; i < count; i++ { - a.generateRuleBypassTransition(atn, i) - } -} - -func (a *ATNDeserializer) generateRuleBypassTransition(atn *ATN, idx int) { - bypassStart := NewBasicBlockStartState() - - bypassStart.ruleIndex = idx - atn.addState(bypassStart) - - bypassStop := NewBlockEndState() - - bypassStop.ruleIndex = idx - atn.addState(bypassStop) - - bypassStart.endState = bypassStop - - atn.defineDecisionState(&bypassStart.BaseDecisionState) - - bypassStop.startState = bypassStart - - var excludeTransition Transition - var endState ATNState - - if atn.ruleToStartState[idx].isPrecedenceRule { - // Wrap from the beginning of the rule to the StarLoopEntryState - endState = nil - - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] - - if a.stateIsEndStateFor(state, idx) != nil { - endState = state - excludeTransition = state.(*StarLoopEntryState).loopBackState.GetTransitions()[0] - - break - } - } - - if excludeTransition == nil { - panic("Couldn't identify final state of the precedence rule prefix section.") - } - } else { - endState = atn.ruleToStopState[idx] - } - - // All non-excluded transitions that currently target end state need to target - // blockEnd instead - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] - - for j := 0; j < len(state.GetTransitions()); j++ { - transition := state.GetTransitions()[j] - - if transition == excludeTransition { - continue - } - - if transition.getTarget() == endState { - transition.setTarget(bypassStop) - } - } - } - - // All transitions leaving the rule start state need to leave blockStart instead - ruleToStartState := atn.ruleToStartState[idx] - count := len(ruleToStartState.GetTransitions()) - - for count > 0 { - bypassStart.AddTransition(ruleToStartState.GetTransitions()[count-1], -1) - ruleToStartState.SetTransitions([]Transition{ruleToStartState.GetTransitions()[len(ruleToStartState.GetTransitions())-1]}) - } - - // Link the new states - atn.ruleToStartState[idx].AddTransition(NewEpsilonTransition(bypassStart, -1), -1) - bypassStop.AddTransition(NewEpsilonTransition(endState, -1), -1) - - MatchState := NewBasicState() - - atn.addState(MatchState) - MatchState.AddTransition(NewAtomTransition(bypassStop, atn.ruleToTokenType[idx]), -1) - bypassStart.AddTransition(NewEpsilonTransition(MatchState, -1), -1) -} - -func (a *ATNDeserializer) stateIsEndStateFor(state ATNState, idx int) ATNState { - if state.GetRuleIndex() != idx { - return nil - } - - if _, ok := state.(*StarLoopEntryState); !ok { - return nil - } - - maybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget() - - if _, ok := maybeLoopEndState.(*LoopEndState); !ok { - return nil - } - - var _, ok = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState) - - if maybeLoopEndState.(*LoopEndState).epsilonOnlyTransitions && ok { - return state - } - - return nil -} - -// markPrecedenceDecisions analyzes the StarLoopEntryState states in the -// specified ATN to set the StarLoopEntryState.precedenceRuleDecision field to -// the correct value. -func (a *ATNDeserializer) markPrecedenceDecisions(atn *ATN) { - for _, state := range atn.states { - if _, ok := state.(*StarLoopEntryState); !ok { - continue - } - - // We analyze the [ATN] to determine if an ATN decision state is the - // decision for the closure block that determines whether a - // precedence rule should continue or complete. - if atn.ruleToStartState[state.GetRuleIndex()].isPrecedenceRule { - maybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget() - - if s3, ok := maybeLoopEndState.(*LoopEndState); ok { - var _, ok2 = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState) - - if s3.epsilonOnlyTransitions && ok2 { - state.(*StarLoopEntryState).precedenceRuleDecision = true - } - } - } - } -} - -func (a *ATNDeserializer) verifyATN(atn *ATN) { - if !a.options.VerifyATN() { - return - } - - // Verify assumptions - for _, state := range atn.states { - if state == nil { - continue - } - - a.checkCondition(state.GetEpsilonOnlyTransitions() || len(state.GetTransitions()) <= 1, "") - - switch s2 := state.(type) { - case *PlusBlockStartState: - a.checkCondition(s2.loopBackState != nil, "") - - case *StarLoopEntryState: - a.checkCondition(s2.loopBackState != nil, "") - a.checkCondition(len(s2.GetTransitions()) == 2, "") - - switch s2.transitions[0].getTarget().(type) { - case *StarBlockStartState: - _, ok := s2.transitions[1].getTarget().(*LoopEndState) - - a.checkCondition(ok, "") - a.checkCondition(!s2.nonGreedy, "") - - case *LoopEndState: - var _, ok = s2.transitions[1].getTarget().(*StarBlockStartState) - - a.checkCondition(ok, "") - a.checkCondition(s2.nonGreedy, "") - - default: - panic("IllegalState") - } - - case *StarLoopbackState: - a.checkCondition(len(state.GetTransitions()) == 1, "") - - var _, ok = state.GetTransitions()[0].getTarget().(*StarLoopEntryState) - - a.checkCondition(ok, "") - - case *LoopEndState: - a.checkCondition(s2.loopBackState != nil, "") - - case *RuleStartState: - a.checkCondition(s2.stopState != nil, "") - - case BlockStartState: - a.checkCondition(s2.getEndState() != nil, "") - - case *BlockEndState: - a.checkCondition(s2.startState != nil, "") - - case DecisionState: - a.checkCondition(len(s2.GetTransitions()) <= 1 || s2.getDecision() >= 0, "") - - default: - var _, ok = s2.(*RuleStopState) - - a.checkCondition(len(s2.GetTransitions()) <= 1 || ok, "") - } - } -} - -func (a *ATNDeserializer) checkCondition(condition bool, message string) { - if !condition { - if message == "" { - message = "IllegalState" - } - - panic(message) - } -} - -func (a *ATNDeserializer) readInt() int { - v := a.data[a.pos] - - a.pos++ - - return int(v) // data is 32 bits but int is at least that big -} - -func (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, _, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition { - target := atn.states[trg] - - switch typeIndex { - case TransitionEPSILON: - return NewEpsilonTransition(target, -1) - - case TransitionRANGE: - if arg3 != 0 { - return NewRangeTransition(target, TokenEOF, arg2) - } - - return NewRangeTransition(target, arg1, arg2) - - case TransitionRULE: - return NewRuleTransition(atn.states[arg1], arg2, arg3, target) - - case TransitionPREDICATE: - return NewPredicateTransition(target, arg1, arg2, arg3 != 0) - - case TransitionPRECEDENCE: - return NewPrecedencePredicateTransition(target, arg1) - - case TransitionATOM: - if arg3 != 0 { - return NewAtomTransition(target, TokenEOF) - } - - return NewAtomTransition(target, arg1) - - case TransitionACTION: - return NewActionTransition(target, arg1, arg2, arg3 != 0) - - case TransitionSET: - return NewSetTransition(target, sets[arg1]) - - case TransitionNOTSET: - return NewNotSetTransition(target, sets[arg1]) - - case TransitionWILDCARD: - return NewWildcardTransition(target) - } - - panic("The specified transition type is not valid.") -} - -func (a *ATNDeserializer) stateFactory(typeIndex, ruleIndex int) ATNState { - var s ATNState - - switch typeIndex { - case ATNStateInvalidType: - return nil - - case ATNStateBasic: - s = NewBasicState() - - case ATNStateRuleStart: - s = NewRuleStartState() - - case ATNStateBlockStart: - s = NewBasicBlockStartState() - - case ATNStatePlusBlockStart: - s = NewPlusBlockStartState() - - case ATNStateStarBlockStart: - s = NewStarBlockStartState() - - case ATNStateTokenStart: - s = NewTokensStartState() - - case ATNStateRuleStop: - s = NewRuleStopState() - - case ATNStateBlockEnd: - s = NewBlockEndState() - - case ATNStateStarLoopBack: - s = NewStarLoopbackState() - - case ATNStateStarLoopEntry: - s = NewStarLoopEntryState() - - case ATNStatePlusLoopBack: - s = NewPlusLoopbackState() - - case ATNStateLoopEnd: - s = NewLoopEndState() - - default: - panic(fmt.Sprintf("state type %d is invalid", typeIndex)) - } - - s.SetRuleIndex(ruleIndex) - - return s -} - -func (a *ATNDeserializer) lexerActionFactory(typeIndex, data1, data2 int) LexerAction { - switch typeIndex { - case LexerActionTypeChannel: - return NewLexerChannelAction(data1) - - case LexerActionTypeCustom: - return NewLexerCustomAction(data1, data2) - - case LexerActionTypeMode: - return NewLexerModeAction(data1) - - case LexerActionTypeMore: - return LexerMoreActionINSTANCE - - case LexerActionTypePopMode: - return LexerPopModeActionINSTANCE - - case LexerActionTypePushMode: - return NewLexerPushModeAction(data1) - - case LexerActionTypeSkip: - return LexerSkipActionINSTANCE - - case LexerActionTypeType: - return NewLexerTypeAction(data1) - - default: - panic(fmt.Sprintf("lexer action %d is invalid", typeIndex)) - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go deleted file mode 100644 index afe6c9f80..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -var ATNSimulatorError = NewDFAState(0x7FFFFFFF, NewATNConfigSet(false)) - -type IATNSimulator interface { - SharedContextCache() *PredictionContextCache - ATN() *ATN - DecisionToDFA() []*DFA -} - -type BaseATNSimulator struct { - atn *ATN - sharedContextCache *PredictionContextCache - decisionToDFA []*DFA -} - -func (b *BaseATNSimulator) getCachedContext(context *PredictionContext) *PredictionContext { - if b.sharedContextCache == nil { - return context - } - - //visited := NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionVisitedCollection, "Visit map in getCachedContext()") - visited := NewVisitRecord() - return getCachedBasePredictionContext(context, b.sharedContextCache, visited) -} - -func (b *BaseATNSimulator) SharedContextCache() *PredictionContextCache { - return b.sharedContextCache -} - -func (b *BaseATNSimulator) ATN() *ATN { - return b.atn -} - -func (b *BaseATNSimulator) DecisionToDFA() []*DFA { - return b.decisionToDFA -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_state.go b/vendor/github.com/antlr4-go/antlr/v4/atn_state.go deleted file mode 100644 index 2ae5807cd..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_state.go +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "os" - "strconv" -) - -// Constants for serialization. -const ( - ATNStateInvalidType = 0 - ATNStateBasic = 1 - ATNStateRuleStart = 2 - ATNStateBlockStart = 3 - ATNStatePlusBlockStart = 4 - ATNStateStarBlockStart = 5 - ATNStateTokenStart = 6 - ATNStateRuleStop = 7 - ATNStateBlockEnd = 8 - ATNStateStarLoopBack = 9 - ATNStateStarLoopEntry = 10 - ATNStatePlusLoopBack = 11 - ATNStateLoopEnd = 12 - - ATNStateInvalidStateNumber = -1 -) - -//goland:noinspection GoUnusedGlobalVariable -var ATNStateInitialNumTransitions = 4 - -type ATNState interface { - GetEpsilonOnlyTransitions() bool - - GetRuleIndex() int - SetRuleIndex(int) - - GetNextTokenWithinRule() *IntervalSet - SetNextTokenWithinRule(*IntervalSet) - - GetATN() *ATN - SetATN(*ATN) - - GetStateType() int - - GetStateNumber() int - SetStateNumber(int) - - GetTransitions() []Transition - SetTransitions([]Transition) - AddTransition(Transition, int) - - String() string - Hash() int - Equals(Collectable[ATNState]) bool -} - -type BaseATNState struct { - // NextTokenWithinRule caches lookahead during parsing. Not used during construction. - NextTokenWithinRule *IntervalSet - - // atn is the current ATN. - atn *ATN - - epsilonOnlyTransitions bool - - // ruleIndex tracks the Rule index because there are no Rule objects at runtime. - ruleIndex int - - stateNumber int - - stateType int - - // Track the transitions emanating from this ATN state. - transitions []Transition -} - -func NewATNState() *BaseATNState { - return &BaseATNState{stateNumber: ATNStateInvalidStateNumber, stateType: ATNStateInvalidType} -} - -func (as *BaseATNState) GetRuleIndex() int { - return as.ruleIndex -} - -func (as *BaseATNState) SetRuleIndex(v int) { - as.ruleIndex = v -} -func (as *BaseATNState) GetEpsilonOnlyTransitions() bool { - return as.epsilonOnlyTransitions -} - -func (as *BaseATNState) GetATN() *ATN { - return as.atn -} - -func (as *BaseATNState) SetATN(atn *ATN) { - as.atn = atn -} - -func (as *BaseATNState) GetTransitions() []Transition { - return as.transitions -} - -func (as *BaseATNState) SetTransitions(t []Transition) { - as.transitions = t -} - -func (as *BaseATNState) GetStateType() int { - return as.stateType -} - -func (as *BaseATNState) GetStateNumber() int { - return as.stateNumber -} - -func (as *BaseATNState) SetStateNumber(stateNumber int) { - as.stateNumber = stateNumber -} - -func (as *BaseATNState) GetNextTokenWithinRule() *IntervalSet { - return as.NextTokenWithinRule -} - -func (as *BaseATNState) SetNextTokenWithinRule(v *IntervalSet) { - as.NextTokenWithinRule = v -} - -func (as *BaseATNState) Hash() int { - return as.stateNumber -} - -func (as *BaseATNState) String() string { - return strconv.Itoa(as.stateNumber) -} - -func (as *BaseATNState) Equals(other Collectable[ATNState]) bool { - if ot, ok := other.(ATNState); ok { - return as.stateNumber == ot.GetStateNumber() - } - - return false -} - -func (as *BaseATNState) isNonGreedyExitState() bool { - return false -} - -func (as *BaseATNState) AddTransition(trans Transition, index int) { - if len(as.transitions) == 0 { - as.epsilonOnlyTransitions = trans.getIsEpsilon() - } else if as.epsilonOnlyTransitions != trans.getIsEpsilon() { - _, _ = fmt.Fprintf(os.Stdin, "ATN state %d has both epsilon and non-epsilon transitions.\n", as.stateNumber) - as.epsilonOnlyTransitions = false - } - - // TODO: Check code for already present compared to the Java equivalent - //alreadyPresent := false - //for _, t := range as.transitions { - // if t.getTarget().GetStateNumber() == trans.getTarget().GetStateNumber() { - // if t.getLabel() != nil && trans.getLabel() != nil && trans.getLabel().Equals(t.getLabel()) { - // alreadyPresent = true - // break - // } - // } else if t.getIsEpsilon() && trans.getIsEpsilon() { - // alreadyPresent = true - // break - // } - //} - //if !alreadyPresent { - if index == -1 { - as.transitions = append(as.transitions, trans) - } else { - as.transitions = append(as.transitions[:index], append([]Transition{trans}, as.transitions[index:]...)...) - // TODO: as.transitions.splice(index, 1, trans) - } - //} else { - // _, _ = fmt.Fprintf(os.Stderr, "Transition already present in state %d\n", as.stateNumber) - //} -} - -type BasicState struct { - BaseATNState -} - -func NewBasicState() *BasicState { - return &BasicState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateBasic, - }, - } -} - -type DecisionState interface { - ATNState - - getDecision() int - setDecision(int) - - getNonGreedy() bool - setNonGreedy(bool) -} - -type BaseDecisionState struct { - BaseATNState - decision int - nonGreedy bool -} - -func NewBaseDecisionState() *BaseDecisionState { - return &BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateBasic, - }, - decision: -1, - } -} - -func (s *BaseDecisionState) getDecision() int { - return s.decision -} - -func (s *BaseDecisionState) setDecision(b int) { - s.decision = b -} - -func (s *BaseDecisionState) getNonGreedy() bool { - return s.nonGreedy -} - -func (s *BaseDecisionState) setNonGreedy(b bool) { - s.nonGreedy = b -} - -type BlockStartState interface { - DecisionState - - getEndState() *BlockEndState - setEndState(*BlockEndState) -} - -// BaseBlockStartState is the start of a regular (...) block. -type BaseBlockStartState struct { - BaseDecisionState - endState *BlockEndState -} - -func NewBlockStartState() *BaseBlockStartState { - return &BaseBlockStartState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateBasic, - }, - decision: -1, - }, - } -} - -func (s *BaseBlockStartState) getEndState() *BlockEndState { - return s.endState -} - -func (s *BaseBlockStartState) setEndState(b *BlockEndState) { - s.endState = b -} - -type BasicBlockStartState struct { - BaseBlockStartState -} - -func NewBasicBlockStartState() *BasicBlockStartState { - return &BasicBlockStartState{ - BaseBlockStartState: BaseBlockStartState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateBlockStart, - }, - }, - }, - } -} - -var _ BlockStartState = &BasicBlockStartState{} - -// BlockEndState is a terminal node of a simple (a|b|c) block. -type BlockEndState struct { - BaseATNState - startState ATNState -} - -func NewBlockEndState() *BlockEndState { - return &BlockEndState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateBlockEnd, - }, - startState: nil, - } -} - -// RuleStopState is the last node in the ATN for a rule, unless that rule is the -// start symbol. In that case, there is one transition to EOF. Later, we might -// encode references to all calls to this rule to compute FOLLOW sets for error -// handling. -type RuleStopState struct { - BaseATNState -} - -func NewRuleStopState() *RuleStopState { - return &RuleStopState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateRuleStop, - }, - } -} - -type RuleStartState struct { - BaseATNState - stopState ATNState - isPrecedenceRule bool -} - -func NewRuleStartState() *RuleStartState { - return &RuleStartState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateRuleStart, - }, - } -} - -// PlusLoopbackState is a decision state for A+ and (A|B)+. It has two -// transitions: one to the loop back to start of the block, and one to exit. -type PlusLoopbackState struct { - BaseDecisionState -} - -func NewPlusLoopbackState() *PlusLoopbackState { - return &PlusLoopbackState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStatePlusLoopBack, - }, - }, - } -} - -// PlusBlockStartState is the start of a (A|B|...)+ loop. Technically it is a -// decision state; we don't use it for code generation. Somebody might need it, -// it is included for completeness. In reality, PlusLoopbackState is the real -// decision-making node for A+. -type PlusBlockStartState struct { - BaseBlockStartState - loopBackState ATNState -} - -func NewPlusBlockStartState() *PlusBlockStartState { - return &PlusBlockStartState{ - BaseBlockStartState: BaseBlockStartState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStatePlusBlockStart, - }, - }, - }, - } -} - -var _ BlockStartState = &PlusBlockStartState{} - -// StarBlockStartState is the block that begins a closure loop. -type StarBlockStartState struct { - BaseBlockStartState -} - -func NewStarBlockStartState() *StarBlockStartState { - return &StarBlockStartState{ - BaseBlockStartState: BaseBlockStartState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateStarBlockStart, - }, - }, - }, - } -} - -var _ BlockStartState = &StarBlockStartState{} - -type StarLoopbackState struct { - BaseATNState -} - -func NewStarLoopbackState() *StarLoopbackState { - return &StarLoopbackState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateStarLoopBack, - }, - } -} - -type StarLoopEntryState struct { - BaseDecisionState - loopBackState ATNState - precedenceRuleDecision bool -} - -func NewStarLoopEntryState() *StarLoopEntryState { - // False precedenceRuleDecision indicates whether s state can benefit from a precedence DFA during SLL decision making. - return &StarLoopEntryState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateStarLoopEntry, - }, - }, - } -} - -// LoopEndState marks the end of a * or + loop. -type LoopEndState struct { - BaseATNState - loopBackState ATNState -} - -func NewLoopEndState() *LoopEndState { - return &LoopEndState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateLoopEnd, - }, - } -} - -// TokensStartState is the Tokens rule start state linking to each lexer rule start state. -type TokensStartState struct { - BaseDecisionState -} - -func NewTokensStartState() *TokensStartState { - return &TokensStartState{ - BaseDecisionState: BaseDecisionState{ - BaseATNState: BaseATNState{ - stateNumber: ATNStateInvalidStateNumber, - stateType: ATNStateTokenStart, - }, - }, - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_type.go b/vendor/github.com/antlr4-go/antlr/v4/atn_type.go deleted file mode 100644 index 3a515a145..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/atn_type.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// Represent the type of recognizer an ATN applies to. -const ( - ATNTypeLexer = 0 - ATNTypeParser = 1 -) diff --git a/vendor/github.com/antlr4-go/antlr/v4/char_stream.go b/vendor/github.com/antlr4-go/antlr/v4/char_stream.go deleted file mode 100644 index bd8127b6b..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/char_stream.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -type CharStream interface { - IntStream - GetText(int, int) string - GetTextFromTokens(start, end Token) string - GetTextFromInterval(Interval) string -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go b/vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go deleted file mode 100644 index 1bb0314ea..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// TokenFactory creates CommonToken objects. -type TokenFactory interface { - Create(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token -} - -// CommonTokenFactory is the default TokenFactory implementation. -type CommonTokenFactory struct { - // copyText indicates whether CommonToken.setText should be called after - // constructing tokens to explicitly set the text. This is useful for cases - // where the input stream might not be able to provide arbitrary substrings of - // text from the input after the lexer creates a token (e.g. the - // implementation of CharStream.GetText in UnbufferedCharStream panics an - // UnsupportedOperationException). Explicitly setting the token text allows - // Token.GetText to be called at any time regardless of the input stream - // implementation. - // - // The default value is false to avoid the performance and memory overhead of - // copying text for every token unless explicitly requested. - copyText bool -} - -func NewCommonTokenFactory(copyText bool) *CommonTokenFactory { - return &CommonTokenFactory{copyText: copyText} -} - -// CommonTokenFactoryDEFAULT is the default CommonTokenFactory. It does not -// explicitly copy token text when constructing tokens. -var CommonTokenFactoryDEFAULT = NewCommonTokenFactory(false) - -func (c *CommonTokenFactory) Create(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token { - t := NewCommonToken(source, ttype, channel, start, stop) - - t.line = line - t.column = column - - if text != "" { - t.SetText(text) - } else if c.copyText && source.charStream != nil { - t.SetText(source.charStream.GetTextFromInterval(NewInterval(start, stop))) - } - - return t -} - -func (c *CommonTokenFactory) createThin(ttype int, text string) Token { - t := NewCommonToken(nil, ttype, TokenDefaultChannel, -1, -1) - t.SetText(text) - - return t -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go b/vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go deleted file mode 100644 index b75da9df0..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "strconv" -) - -// CommonTokenStream is an implementation of TokenStream that loads tokens from -// a TokenSource on-demand and places the tokens in a buffer to provide access -// to any previous token by index. This token stream ignores the value of -// Token.getChannel. If your parser requires the token stream filter tokens to -// only those on a particular channel, such as Token.DEFAULT_CHANNEL or -// Token.HIDDEN_CHANNEL, use a filtering token stream such a CommonTokenStream. -type CommonTokenStream struct { - channel int - - // fetchedEOF indicates whether the Token.EOF token has been fetched from - // tokenSource and added to tokens. This field improves performance for the - // following cases: - // - // consume: The lookahead check in consume to preven consuming the EOF symbol is - // optimized by checking the values of fetchedEOF and p instead of calling LA. - // - // fetch: The check to prevent adding multiple EOF symbols into tokens is - // trivial with bt field. - fetchedEOF bool - - // index into [tokens] of the current token (next token to consume). - // tokens[p] should be LT(1). It is set to -1 when the stream is first - // constructed or when SetTokenSource is called, indicating that the first token - // has not yet been fetched from the token source. For additional information, - // see the documentation of [IntStream] for a description of initializing methods. - index int - - // tokenSource is the [TokenSource] from which tokens for the bt stream are - // fetched. - tokenSource TokenSource - - // tokens contains all tokens fetched from the token source. The list is considered a - // complete view of the input once fetchedEOF is set to true. - tokens []Token -} - -// NewCommonTokenStream creates a new CommonTokenStream instance using the supplied lexer to produce -// tokens and will pull tokens from the given lexer channel. -func NewCommonTokenStream(lexer Lexer, channel int) *CommonTokenStream { - return &CommonTokenStream{ - channel: channel, - index: -1, - tokenSource: lexer, - tokens: make([]Token, 0), - } -} - -// GetAllTokens returns all tokens currently pulled from the token source. -func (c *CommonTokenStream) GetAllTokens() []Token { - return c.tokens -} - -func (c *CommonTokenStream) Mark() int { - return 0 -} - -func (c *CommonTokenStream) Release(_ int) {} - -func (c *CommonTokenStream) Reset() { - c.fetchedEOF = false - c.tokens = make([]Token, 0) - c.Seek(0) -} - -func (c *CommonTokenStream) Seek(index int) { - c.lazyInit() - c.index = c.adjustSeekIndex(index) -} - -func (c *CommonTokenStream) Get(index int) Token { - c.lazyInit() - - return c.tokens[index] -} - -func (c *CommonTokenStream) Consume() { - SkipEOFCheck := false - - if c.index >= 0 { - if c.fetchedEOF { - // The last token in tokens is EOF. Skip the check if p indexes any fetched. - // token except the last. - SkipEOFCheck = c.index < len(c.tokens)-1 - } else { - // No EOF token in tokens. Skip the check if p indexes a fetched token. - SkipEOFCheck = c.index < len(c.tokens) - } - } else { - // Not yet initialized - SkipEOFCheck = false - } - - if !SkipEOFCheck && c.LA(1) == TokenEOF { - panic("cannot consume EOF") - } - - if c.Sync(c.index + 1) { - c.index = c.adjustSeekIndex(c.index + 1) - } -} - -// Sync makes sure index i in tokens has a token and returns true if a token is -// located at index i and otherwise false. -func (c *CommonTokenStream) Sync(i int) bool { - n := i - len(c.tokens) + 1 // How many more elements do we need? - - if n > 0 { - fetched := c.fetch(n) - return fetched >= n - } - - return true -} - -// fetch adds n elements to buffer and returns the actual number of elements -// added to the buffer. -func (c *CommonTokenStream) fetch(n int) int { - if c.fetchedEOF { - return 0 - } - - for i := 0; i < n; i++ { - t := c.tokenSource.NextToken() - - t.SetTokenIndex(len(c.tokens)) - c.tokens = append(c.tokens, t) - - if t.GetTokenType() == TokenEOF { - c.fetchedEOF = true - - return i + 1 - } - } - - return n -} - -// GetTokens gets all tokens from start to stop inclusive. -func (c *CommonTokenStream) GetTokens(start int, stop int, types *IntervalSet) []Token { - if start < 0 || stop < 0 { - return nil - } - - c.lazyInit() - - subset := make([]Token, 0) - - if stop >= len(c.tokens) { - stop = len(c.tokens) - 1 - } - - for i := start; i < stop; i++ { - t := c.tokens[i] - - if t.GetTokenType() == TokenEOF { - break - } - - if types == nil || types.contains(t.GetTokenType()) { - subset = append(subset, t) - } - } - - return subset -} - -func (c *CommonTokenStream) LA(i int) int { - return c.LT(i).GetTokenType() -} - -func (c *CommonTokenStream) lazyInit() { - if c.index == -1 { - c.setup() - } -} - -func (c *CommonTokenStream) setup() { - c.Sync(0) - c.index = c.adjustSeekIndex(0) -} - -func (c *CommonTokenStream) GetTokenSource() TokenSource { - return c.tokenSource -} - -// SetTokenSource resets the c token stream by setting its token source. -func (c *CommonTokenStream) SetTokenSource(tokenSource TokenSource) { - c.tokenSource = tokenSource - c.tokens = make([]Token, 0) - c.index = -1 - c.fetchedEOF = false -} - -// NextTokenOnChannel returns the index of the next token on channel given a -// starting index. Returns i if tokens[i] is on channel. Returns -1 if there are -// no tokens on channel between 'i' and [TokenEOF]. -func (c *CommonTokenStream) NextTokenOnChannel(i, _ int) int { - c.Sync(i) - - if i >= len(c.tokens) { - return -1 - } - - token := c.tokens[i] - - for token.GetChannel() != c.channel { - if token.GetTokenType() == TokenEOF { - return -1 - } - - i++ - c.Sync(i) - token = c.tokens[i] - } - - return i -} - -// previousTokenOnChannel returns the index of the previous token on channel -// given a starting index. Returns i if tokens[i] is on channel. Returns -1 if -// there are no tokens on channel between i and 0. -func (c *CommonTokenStream) previousTokenOnChannel(i, channel int) int { - for i >= 0 && c.tokens[i].GetChannel() != channel { - i-- - } - - return i -} - -// GetHiddenTokensToRight collects all tokens on a specified channel to the -// right of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL -// or EOF. If channel is -1, it finds any non-default channel token. -func (c *CommonTokenStream) GetHiddenTokensToRight(tokenIndex, channel int) []Token { - c.lazyInit() - - if tokenIndex < 0 || tokenIndex >= len(c.tokens) { - panic(strconv.Itoa(tokenIndex) + " not in 0.." + strconv.Itoa(len(c.tokens)-1)) - } - - nextOnChannel := c.NextTokenOnChannel(tokenIndex+1, LexerDefaultTokenChannel) - from := tokenIndex + 1 - - // If no onChannel to the right, then nextOnChannel == -1, so set 'to' to the last token - var to int - - if nextOnChannel == -1 { - to = len(c.tokens) - 1 - } else { - to = nextOnChannel - } - - return c.filterForChannel(from, to, channel) -} - -// GetHiddenTokensToLeft collects all tokens on channel to the left of the -// current token until we see a token on DEFAULT_TOKEN_CHANNEL. If channel is -// -1, it finds any non default channel token. -func (c *CommonTokenStream) GetHiddenTokensToLeft(tokenIndex, channel int) []Token { - c.lazyInit() - - if tokenIndex < 0 || tokenIndex >= len(c.tokens) { - panic(strconv.Itoa(tokenIndex) + " not in 0.." + strconv.Itoa(len(c.tokens)-1)) - } - - prevOnChannel := c.previousTokenOnChannel(tokenIndex-1, LexerDefaultTokenChannel) - - if prevOnChannel == tokenIndex-1 { - return nil - } - - // If there are none on channel to the left and prevOnChannel == -1 then from = 0 - from := prevOnChannel + 1 - to := tokenIndex - 1 - - return c.filterForChannel(from, to, channel) -} - -func (c *CommonTokenStream) filterForChannel(left, right, channel int) []Token { - hidden := make([]Token, 0) - - for i := left; i < right+1; i++ { - t := c.tokens[i] - - if channel == -1 { - if t.GetChannel() != LexerDefaultTokenChannel { - hidden = append(hidden, t) - } - } else if t.GetChannel() == channel { - hidden = append(hidden, t) - } - } - - if len(hidden) == 0 { - return nil - } - - return hidden -} - -func (c *CommonTokenStream) GetSourceName() string { - return c.tokenSource.GetSourceName() -} - -func (c *CommonTokenStream) Size() int { - return len(c.tokens) -} - -func (c *CommonTokenStream) Index() int { - return c.index -} - -func (c *CommonTokenStream) GetAllText() string { - c.Fill() - return c.GetTextFromInterval(NewInterval(0, len(c.tokens)-1)) -} - -func (c *CommonTokenStream) GetTextFromTokens(start, end Token) string { - if start == nil || end == nil { - return "" - } - - return c.GetTextFromInterval(NewInterval(start.GetTokenIndex(), end.GetTokenIndex())) -} - -func (c *CommonTokenStream) GetTextFromRuleContext(interval RuleContext) string { - return c.GetTextFromInterval(interval.GetSourceInterval()) -} - -func (c *CommonTokenStream) GetTextFromInterval(interval Interval) string { - c.lazyInit() - c.Sync(interval.Stop) - - start := interval.Start - stop := interval.Stop - - if start < 0 || stop < 0 { - return "" - } - - if stop >= len(c.tokens) { - stop = len(c.tokens) - 1 - } - - s := "" - - for i := start; i < stop+1; i++ { - t := c.tokens[i] - - if t.GetTokenType() == TokenEOF { - break - } - - s += t.GetText() - } - - return s -} - -// Fill gets all tokens from the lexer until EOF. -func (c *CommonTokenStream) Fill() { - c.lazyInit() - - for c.fetch(1000) == 1000 { - continue - } -} - -func (c *CommonTokenStream) adjustSeekIndex(i int) int { - return c.NextTokenOnChannel(i, c.channel) -} - -func (c *CommonTokenStream) LB(k int) Token { - if k == 0 || c.index-k < 0 { - return nil - } - - i := c.index - n := 1 - - // Find k good tokens looking backward - for n <= k { - // Skip off-channel tokens - i = c.previousTokenOnChannel(i-1, c.channel) - n++ - } - - if i < 0 { - return nil - } - - return c.tokens[i] -} - -func (c *CommonTokenStream) LT(k int) Token { - c.lazyInit() - - if k == 0 { - return nil - } - - if k < 0 { - return c.LB(-k) - } - - i := c.index - n := 1 // We know tokens[n] is valid - - // Find k good tokens - for n < k { - // Skip off-channel tokens, but make sure to not look past EOF - if c.Sync(i + 1) { - i = c.NextTokenOnChannel(i+1, c.channel) - } - - n++ - } - - return c.tokens[i] -} - -// getNumberOfOnChannelTokens counts EOF once. -func (c *CommonTokenStream) getNumberOfOnChannelTokens() int { - var n int - - c.Fill() - - for i := 0; i < len(c.tokens); i++ { - t := c.tokens[i] - - if t.GetChannel() == c.channel { - n++ - } - - if t.GetTokenType() == TokenEOF { - break - } - } - - return n -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/comparators.go b/vendor/github.com/antlr4-go/antlr/v4/comparators.go deleted file mode 100644 index 7467e9b43..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/comparators.go +++ /dev/null @@ -1,150 +0,0 @@ -package antlr - -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -// This file contains all the implementations of custom comparators used for generic collections when the -// Hash() and Equals() funcs supplied by the struct objects themselves need to be overridden. Normally, we would -// put the comparators in the source file for the struct themselves, but given the organization of this code is -// sorta kinda based upon the Java code, I found it confusing trying to find out which comparator was where and used by -// which instantiation of a collection. For instance, an Array2DHashSet in the Java source, when used with ATNConfig -// collections requires three different comparators depending on what the collection is being used for. Collecting - pun intended - -// all the comparators here, makes it much easier to see which implementation of hash and equals is used by which collection. -// It also makes it easy to verify that the Hash() and Equals() functions marry up with the Java implementations. - -// ObjEqComparator is the equivalent of the Java ObjectEqualityComparator, which is the default instance of -// Equality comparator. We do not have inheritance in Go, only interfaces, so we use generics to enforce some -// type safety and avoid having to implement this for every type that we want to perform comparison on. -// -// This comparator works by using the standard Hash() and Equals() methods of the type T that is being compared. Which -// allows us to use it in any collection instance that does not require a special hash or equals implementation. -type ObjEqComparator[T Collectable[T]] struct{} - -var ( - aStateEqInst = &ObjEqComparator[ATNState]{} - aConfEqInst = &ObjEqComparator[*ATNConfig]{} - - // aConfCompInst is the comparator used for the ATNConfigSet for the configLookup cache - aConfCompInst = &ATNConfigComparator[*ATNConfig]{} - atnConfCompInst = &BaseATNConfigComparator[*ATNConfig]{} - dfaStateEqInst = &ObjEqComparator[*DFAState]{} - semctxEqInst = &ObjEqComparator[SemanticContext]{} - atnAltCfgEqInst = &ATNAltConfigComparator[*ATNConfig]{} - pContextEqInst = &ObjEqComparator[*PredictionContext]{} -) - -// Equals2 delegates to the Equals() method of type T -func (c *ObjEqComparator[T]) Equals2(o1, o2 T) bool { - return o1.Equals(o2) -} - -// Hash1 delegates to the Hash() method of type T -func (c *ObjEqComparator[T]) Hash1(o T) int { - - return o.Hash() -} - -type SemCComparator[T Collectable[T]] struct{} - -// ATNConfigComparator is used as the comparator for the configLookup field of an ATNConfigSet -// and has a custom Equals() and Hash() implementation, because equality is not based on the -// standard Hash() and Equals() methods of the ATNConfig type. -type ATNConfigComparator[T Collectable[T]] struct { -} - -// Equals2 is a custom comparator for ATNConfigs specifically for configLookup -func (c *ATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool { - - // Same pointer, must be equal, even if both nil - // - if o1 == o2 { - return true - - } - - // If either are nil, but not both, then the result is false - // - if o1 == nil || o2 == nil { - return false - } - - return o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() && - o1.GetAlt() == o2.GetAlt() && - o1.GetSemanticContext().Equals(o2.GetSemanticContext()) -} - -// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup -func (c *ATNConfigComparator[T]) Hash1(o *ATNConfig) int { - - hash := 7 - hash = 31*hash + o.GetState().GetStateNumber() - hash = 31*hash + o.GetAlt() - hash = 31*hash + o.GetSemanticContext().Hash() - return hash -} - -// ATNAltConfigComparator is used as the comparator for mapping configs to Alt Bitsets -type ATNAltConfigComparator[T Collectable[T]] struct { -} - -// Equals2 is a custom comparator for ATNConfigs specifically for configLookup -func (c *ATNAltConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool { - - // Same pointer, must be equal, even if both nil - // - if o1 == o2 { - return true - - } - - // If either are nil, but not both, then the result is false - // - if o1 == nil || o2 == nil { - return false - } - - return o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() && - o1.GetContext().Equals(o2.GetContext()) -} - -// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup -func (c *ATNAltConfigComparator[T]) Hash1(o *ATNConfig) int { - h := murmurInit(7) - h = murmurUpdate(h, o.GetState().GetStateNumber()) - h = murmurUpdate(h, o.GetContext().Hash()) - return murmurFinish(h, 2) -} - -// BaseATNConfigComparator is used as the comparator for the configLookup field of a ATNConfigSet -// and has a custom Equals() and Hash() implementation, because equality is not based on the -// standard Hash() and Equals() methods of the ATNConfig type. -type BaseATNConfigComparator[T Collectable[T]] struct { -} - -// Equals2 is a custom comparator for ATNConfigs specifically for baseATNConfigSet -func (c *BaseATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool { - - // Same pointer, must be equal, even if both nil - // - if o1 == o2 { - return true - - } - - // If either are nil, but not both, then the result is false - // - if o1 == nil || o2 == nil { - return false - } - - return o1.GetState().GetStateNumber() == o2.GetState().GetStateNumber() && - o1.GetAlt() == o2.GetAlt() && - o1.GetSemanticContext().Equals(o2.GetSemanticContext()) -} - -// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup, but in fact just -// delegates to the standard Hash() method of the ATNConfig type. -func (c *BaseATNConfigComparator[T]) Hash1(o *ATNConfig) int { - return o.Hash() -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/configuration.go b/vendor/github.com/antlr4-go/antlr/v4/configuration.go deleted file mode 100644 index c2b724514..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/configuration.go +++ /dev/null @@ -1,214 +0,0 @@ -package antlr - -type runtimeConfiguration struct { - statsTraceStacks bool - lexerATNSimulatorDebug bool - lexerATNSimulatorDFADebug bool - parserATNSimulatorDebug bool - parserATNSimulatorTraceATNSim bool - parserATNSimulatorDFADebug bool - parserATNSimulatorRetryDebug bool - lRLoopEntryBranchOpt bool - memoryManager bool -} - -// Global runtime configuration -var runtimeConfig = runtimeConfiguration{ - lRLoopEntryBranchOpt: true, -} - -type runtimeOption func(*runtimeConfiguration) error - -// ConfigureRuntime allows the runtime to be configured globally setting things like trace and statistics options. -// It uses the functional options pattern for go. This is a package global function as it operates on the runtime -// configuration regardless of the instantiation of anything higher up such as a parser or lexer. Generally this is -// used for debugging/tracing/statistics options, which are usually used by the runtime maintainers (or rather the -// only maintainer). However, it is possible that you might want to use this to set a global option concerning the -// memory allocation type used by the runtime such as sync.Pool or not. -// -// The options are applied in the order they are passed in, so the last option will override any previous options. -// -// For example, if you want to turn on the collection create point stack flag to true, you can do: -// -// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true)) -// -// If you want to turn it off, you can do: -// -// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false)) -func ConfigureRuntime(options ...runtimeOption) error { - for _, option := range options { - err := option(&runtimeConfig) - if err != nil { - return err - } - } - return nil -} - -// WithStatsTraceStacks sets the global flag indicating whether to collect stack traces at the create-point of -// certain structs, such as collections, or the use point of certain methods such as Put(). -// Because this can be expensive, it is turned off by default. However, it -// can be useful to track down exactly where memory is being created and used. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false)) -func WithStatsTraceStacks(trace bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.statsTraceStacks = trace - return nil - } -} - -// WithLexerATNSimulatorDebug sets the global flag indicating whether to log debug information from the lexer [ATN] -// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful -// to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(false)) -func WithLexerATNSimulatorDebug(debug bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.lexerATNSimulatorDebug = debug - return nil - } -} - -// WithLexerATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the lexer [ATN] [DFA] -// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful -// to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(false)) -func WithLexerATNSimulatorDFADebug(debug bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.lexerATNSimulatorDFADebug = debug - return nil - } -} - -// WithParserATNSimulatorDebug sets the global flag indicating whether to log debug information from the parser [ATN] -// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful -// to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(false)) -func WithParserATNSimulatorDebug(debug bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.parserATNSimulatorDebug = debug - return nil - } -} - -// WithParserATNSimulatorTraceATNSim sets the global flag indicating whether to log trace information from the parser [ATN] simulator -// [DFA]. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful -// to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(false)) -func WithParserATNSimulatorTraceATNSim(trace bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.parserATNSimulatorTraceATNSim = trace - return nil - } -} - -// WithParserATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA] -// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful -// to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(false)) -func WithParserATNSimulatorDFADebug(debug bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.parserATNSimulatorDFADebug = debug - return nil - } -} - -// WithParserATNSimulatorRetryDebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA] -// simulator when retrying a decision. This is useful for debugging parser issues by comparing the output with the Java runtime. -// Only useful to the runtime maintainers. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(false)) -func WithParserATNSimulatorRetryDebug(debug bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.parserATNSimulatorRetryDebug = debug - return nil - } -} - -// WithLRLoopEntryBranchOpt sets the global flag indicating whether let recursive loop operations should be -// optimized or not. This is useful for debugging parser issues by comparing the output with the Java runtime. -// It turns off the functionality of [canDropLoopEntryEdgeInLeftRecursiveRule] in [ParserATNSimulator]. -// -// Note that default is to use this optimization. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(true)) -// -// You can turn it off at any time using: -// -// antlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(false)) -func WithLRLoopEntryBranchOpt(off bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.lRLoopEntryBranchOpt = off - return nil - } -} - -// WithMemoryManager sets the global flag indicating whether to use the memory manager or not. This is useful -// for poorly constructed grammars that create a lot of garbage. It turns on the functionality of [memoryManager], which -// will intercept garbage collection and cause available memory to be reused. At the end of the day, this is no substitute -// for fixing your grammar by ridding yourself of extreme ambiguity. BUt if you are just trying to reuse an opensource -// grammar, this may help make it more practical. -// -// Note that default is to use normal Go memory allocation and not pool memory. -// -// Use: -// -// antlr.ConfigureRuntime(antlr.WithMemoryManager(true)) -// -// Note that if you turn this on, you should probably leave it on. You should use only one memory strategy or the other -// and should remember to nil out any references to the parser or lexer when you are done with them. -func WithMemoryManager(use bool) runtimeOption { - return func(config *runtimeConfiguration) error { - config.memoryManager = use - return nil - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/dfa.go b/vendor/github.com/antlr4-go/antlr/v4/dfa.go deleted file mode 100644 index 6b63eb158..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/dfa.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// DFA represents the Deterministic Finite Automaton used by the recognizer, including all the states it can -// reach and the transitions between them. -type DFA struct { - // atnStartState is the ATN state in which this was created - atnStartState DecisionState - - decision int - - // states is all the DFA states. Use Map to get the old state back; Set can only - // indicate whether it is there. Go maps implement key hash collisions and so on and are very - // good, but the DFAState is an object and can't be used directly as the key as it can in say Java - // amd C#, whereby if the hashcode is the same for two objects, then Equals() is called against them - // to see if they really are the same object. Hence, we have our own map storage. - // - states *JStore[*DFAState, *ObjEqComparator[*DFAState]] - - numstates int - - s0 *DFAState - - // precedenceDfa is the backing field for isPrecedenceDfa and setPrecedenceDfa. - // True if the DFA is for a precedence decision and false otherwise. - precedenceDfa bool -} - -func NewDFA(atnStartState DecisionState, decision int) *DFA { - dfa := &DFA{ - atnStartState: atnStartState, - decision: decision, - states: nil, // Lazy initialize - } - if s, ok := atnStartState.(*StarLoopEntryState); ok && s.precedenceRuleDecision { - dfa.precedenceDfa = true - dfa.s0 = NewDFAState(-1, NewATNConfigSet(false)) - dfa.s0.isAcceptState = false - dfa.s0.requiresFullContext = false - } - return dfa -} - -// getPrecedenceStartState gets the start state for the current precedence and -// returns the start state corresponding to the specified precedence if a start -// state exists for the specified precedence and nil otherwise. d must be a -// precedence DFA. See also isPrecedenceDfa. -func (d *DFA) getPrecedenceStartState(precedence int) *DFAState { - if !d.getPrecedenceDfa() { - panic("only precedence DFAs may contain a precedence start state") - } - - // s0.edges is never nil for a precedence DFA - if precedence < 0 || precedence >= len(d.getS0().getEdges()) { - return nil - } - - return d.getS0().getIthEdge(precedence) -} - -// setPrecedenceStartState sets the start state for the current precedence. d -// must be a precedence DFA. See also isPrecedenceDfa. -func (d *DFA) setPrecedenceStartState(precedence int, startState *DFAState) { - if !d.getPrecedenceDfa() { - panic("only precedence DFAs may contain a precedence start state") - } - - if precedence < 0 { - return - } - - // Synchronization on s0 here is ok. When the DFA is turned into a - // precedence DFA, s0 will be initialized once and not updated again. s0.edges - // is never nil for a precedence DFA. - s0 := d.getS0() - if precedence >= s0.numEdges() { - edges := append(s0.getEdges(), make([]*DFAState, precedence+1-s0.numEdges())...) - s0.setEdges(edges) - d.setS0(s0) - } - - s0.setIthEdge(precedence, startState) -} - -func (d *DFA) getPrecedenceDfa() bool { - return d.precedenceDfa -} - -// setPrecedenceDfa sets whether d is a precedence DFA. If precedenceDfa differs -// from the current DFA configuration, then d.states is cleared, the initial -// state s0 is set to a new DFAState with an empty outgoing DFAState.edges to -// store the start states for individual precedence values if precedenceDfa is -// true or nil otherwise, and d.precedenceDfa is updated. -func (d *DFA) setPrecedenceDfa(precedenceDfa bool) { - if d.getPrecedenceDfa() != precedenceDfa { - d.states = nil // Lazy initialize - d.numstates = 0 - - if precedenceDfa { - precedenceState := NewDFAState(-1, NewATNConfigSet(false)) - precedenceState.setEdges(make([]*DFAState, 0)) - precedenceState.isAcceptState = false - precedenceState.requiresFullContext = false - d.setS0(precedenceState) - } else { - d.setS0(nil) - } - - d.precedenceDfa = precedenceDfa - } -} - -// Len returns the number of states in d. We use this instead of accessing states directly so that we can implement lazy -// instantiation of the states JMap. -func (d *DFA) Len() int { - if d.states == nil { - return 0 - } - return d.states.Len() -} - -// Get returns a state that matches s if it is present in the DFA state set. We defer to this -// function instead of accessing states directly so that we can implement lazy instantiation of the states JMap. -func (d *DFA) Get(s *DFAState) (*DFAState, bool) { - if d.states == nil { - return nil, false - } - return d.states.Get(s) -} - -func (d *DFA) Put(s *DFAState) (*DFAState, bool) { - if d.states == nil { - d.states = NewJStore[*DFAState, *ObjEqComparator[*DFAState]](dfaStateEqInst, DFAStateCollection, "DFA via DFA.Put") - } - return d.states.Put(s) -} - -func (d *DFA) getS0() *DFAState { - return d.s0 -} - -func (d *DFA) setS0(s *DFAState) { - d.s0 = s -} - -// sortedStates returns the states in d sorted by their state number, or an empty set if d.states is nil. -func (d *DFA) sortedStates() []*DFAState { - if d.states == nil { - return []*DFAState{} - } - vs := d.states.SortedSlice(func(i, j *DFAState) bool { - return i.stateNumber < j.stateNumber - }) - - return vs -} - -func (d *DFA) String(literalNames []string, symbolicNames []string) string { - if d.getS0() == nil { - return "" - } - - return NewDFASerializer(d, literalNames, symbolicNames).String() -} - -func (d *DFA) ToLexerString() string { - if d.getS0() == nil { - return "" - } - - return NewLexerDFASerializer(d).String() -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go b/vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go deleted file mode 100644 index 0e1100989..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" - "strings" -) - -// DFASerializer is a DFA walker that knows how to dump the DFA states to serialized -// strings. -type DFASerializer struct { - dfa *DFA - literalNames []string - symbolicNames []string -} - -func NewDFASerializer(dfa *DFA, literalNames, symbolicNames []string) *DFASerializer { - if literalNames == nil { - literalNames = make([]string, 0) - } - - if symbolicNames == nil { - symbolicNames = make([]string, 0) - } - - return &DFASerializer{ - dfa: dfa, - literalNames: literalNames, - symbolicNames: symbolicNames, - } -} - -func (d *DFASerializer) String() string { - if d.dfa.getS0() == nil { - return "" - } - - buf := "" - states := d.dfa.sortedStates() - - for _, s := range states { - if s.edges != nil { - n := len(s.edges) - - for j := 0; j < n; j++ { - t := s.edges[j] - - if t != nil && t.stateNumber != 0x7FFFFFFF { - buf += d.GetStateString(s) - buf += "-" - buf += d.getEdgeLabel(j) - buf += "->" - buf += d.GetStateString(t) - buf += "\n" - } - } - } - } - - if len(buf) == 0 { - return "" - } - - return buf -} - -func (d *DFASerializer) getEdgeLabel(i int) string { - if i == 0 { - return "EOF" - } else if d.literalNames != nil && i-1 < len(d.literalNames) { - return d.literalNames[i-1] - } else if d.symbolicNames != nil && i-1 < len(d.symbolicNames) { - return d.symbolicNames[i-1] - } - - return strconv.Itoa(i - 1) -} - -func (d *DFASerializer) GetStateString(s *DFAState) string { - var a, b string - - if s.isAcceptState { - a = ":" - } - - if s.requiresFullContext { - b = "^" - } - - baseStateStr := a + "s" + strconv.Itoa(s.stateNumber) + b - - if s.isAcceptState { - if s.predicates != nil { - return baseStateStr + "=>" + fmt.Sprint(s.predicates) - } - - return baseStateStr + "=>" + fmt.Sprint(s.prediction) - } - - return baseStateStr -} - -type LexerDFASerializer struct { - *DFASerializer -} - -func NewLexerDFASerializer(dfa *DFA) *LexerDFASerializer { - return &LexerDFASerializer{DFASerializer: NewDFASerializer(dfa, nil, nil)} -} - -func (l *LexerDFASerializer) getEdgeLabel(i int) string { - var sb strings.Builder - sb.Grow(6) - sb.WriteByte('\'') - sb.WriteRune(rune(i)) - sb.WriteByte('\'') - return sb.String() -} - -func (l *LexerDFASerializer) String() string { - if l.dfa.getS0() == nil { - return "" - } - - buf := "" - states := l.dfa.sortedStates() - - for i := 0; i < len(states); i++ { - s := states[i] - - if s.edges != nil { - n := len(s.edges) - - for j := 0; j < n; j++ { - t := s.edges[j] - - if t != nil && t.stateNumber != 0x7FFFFFFF { - buf += l.GetStateString(s) - buf += "-" - buf += l.getEdgeLabel(j) - buf += "->" - buf += l.GetStateString(t) - buf += "\n" - } - } - } - } - - if len(buf) == 0 { - return "" - } - - return buf -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/dfa_state.go b/vendor/github.com/antlr4-go/antlr/v4/dfa_state.go deleted file mode 100644 index 654143074..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/dfa_state.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" -) - -// PredPrediction maps a predicate to a predicted alternative. -type PredPrediction struct { - alt int - pred SemanticContext -} - -func NewPredPrediction(pred SemanticContext, alt int) *PredPrediction { - return &PredPrediction{alt: alt, pred: pred} -} - -func (p *PredPrediction) String() string { - return "(" + fmt.Sprint(p.pred) + ", " + fmt.Sprint(p.alt) + ")" -} - -// DFAState represents a set of possible [ATN] configurations. As Aho, Sethi, -// Ullman p. 117 says: "The DFA uses its state to keep track of all possible -// states the ATN can be in after reading each input symbol. That is to say, -// after reading input a1, a2,..an, the DFA is in a state that represents the -// subset T of the states of the ATN that are reachable from the ATN's start -// state along some path labeled a1a2..an." -// -// In conventional NFA-to-DFA conversion, therefore, the subset T would be a bitset representing the set of -// states the [ATN] could be in. We need to track the alt predicted by each state -// as well, however. More importantly, we need to maintain a stack of states, -// tracking the closure operations as they jump from rule to rule, emulating -// rule invocations (method calls). I have to add a stack to simulate the proper -// lookahead sequences for the underlying LL grammar from which the ATN was -// derived. -// -// I use a set of [ATNConfig] objects, not simple states. An [ATNConfig] is both a -// state (ala normal conversion) and a [RuleContext] describing the chain of rules -// (if any) followed to arrive at that state. -// -// A [DFAState] may have multiple references to a particular state, but with -// different [ATN] contexts (with same or different alts) meaning that state was -// reached via a different set of rule invocations. -type DFAState struct { - stateNumber int - configs *ATNConfigSet - - // edges elements point to the target of the symbol. Shift up by 1 so (-1) - // Token.EOF maps to the first element. - edges []*DFAState - - isAcceptState bool - - // prediction is the 'ttype' we match or alt we predict if the state is 'accept'. - // Set to ATN.INVALID_ALT_NUMBER when predicates != nil or - // requiresFullContext. - prediction int - - lexerActionExecutor *LexerActionExecutor - - // requiresFullContext indicates it was created during an SLL prediction that - // discovered a conflict between the configurations in the state. Future - // ParserATNSimulator.execATN invocations immediately jump doing - // full context prediction if true. - requiresFullContext bool - - // predicates is the predicates associated with the ATN configurations of the - // DFA state during SLL parsing. When we have predicates, requiresFullContext - // is false, since full context prediction evaluates predicates on-the-fly. If - // d is - // not nil, then prediction is ATN.INVALID_ALT_NUMBER. - // - // We only use these for non-requiresFullContext but conflicting states. That - // means we know from the context (it's $ or we don't dip into outer context) - // that it's an ambiguity not a conflict. - // - // This list is computed by - // ParserATNSimulator.predicateDFAState. - predicates []*PredPrediction -} - -func NewDFAState(stateNumber int, configs *ATNConfigSet) *DFAState { - if configs == nil { - configs = NewATNConfigSet(false) - } - - return &DFAState{configs: configs, stateNumber: stateNumber} -} - -// GetAltSet gets the set of all alts mentioned by all ATN configurations in d. -func (d *DFAState) GetAltSet() []int { - var alts []int - - if d.configs != nil { - for _, c := range d.configs.configs { - alts = append(alts, c.GetAlt()) - } - } - - if len(alts) == 0 { - return nil - } - - return alts -} - -func (d *DFAState) getEdges() []*DFAState { - return d.edges -} - -func (d *DFAState) numEdges() int { - return len(d.edges) -} - -func (d *DFAState) getIthEdge(i int) *DFAState { - return d.edges[i] -} - -func (d *DFAState) setEdges(newEdges []*DFAState) { - d.edges = newEdges -} - -func (d *DFAState) setIthEdge(i int, edge *DFAState) { - d.edges[i] = edge -} - -func (d *DFAState) setPrediction(v int) { - d.prediction = v -} - -func (d *DFAState) String() string { - var s string - if d.isAcceptState { - if d.predicates != nil { - s = "=>" + fmt.Sprint(d.predicates) - } else { - s = "=>" + fmt.Sprint(d.prediction) - } - } - - return fmt.Sprintf("%d:%s%s", d.stateNumber, fmt.Sprint(d.configs), s) -} - -func (d *DFAState) Hash() int { - h := murmurInit(7) - h = murmurUpdate(h, d.configs.Hash()) - return murmurFinish(h, 1) -} - -// Equals returns whether d equals other. Two DFAStates are equal if their ATN -// configuration sets are the same. This method is used to see if a state -// already exists. -// -// Because the number of alternatives and number of ATN configurations are -// finite, there is a finite number of DFA states that can be processed. This is -// necessary to show that the algorithm terminates. -// -// Cannot test the DFA state numbers here because in -// ParserATNSimulator.addDFAState we need to know if any other state exists that -// has d exact set of ATN configurations. The stateNumber is irrelevant. -func (d *DFAState) Equals(o Collectable[*DFAState]) bool { - if d == o { - return true - } - - return d.configs.Equals(o.(*DFAState).configs) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go b/vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go deleted file mode 100644 index bd2cd8bc3..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "strconv" -) - -// -// This implementation of {@link ANTLRErrorListener} can be used to identify -// certain potential correctness and performance problems in grammars. "reports" -// are made by calling {@link Parser//NotifyErrorListeners} with the appropriate -// message. -// -//
    -//
  • Ambiguities: These are cases where more than one path through the -// grammar can Match the input.
  • -//
  • Weak context sensitivity: These are cases where full-context -// prediction resolved an SLL conflict to a unique alternative which equaled the -// minimum alternative of the SLL conflict.
  • -//
  • Strong (forced) context sensitivity: These are cases where the -// full-context prediction resolved an SLL conflict to a unique alternative, -// and the minimum alternative of the SLL conflict was found to not be -// a truly viable alternative. Two-stage parsing cannot be used for inputs where -// d situation occurs.
  • -//
- -type DiagnosticErrorListener struct { - *DefaultErrorListener - - exactOnly bool -} - -//goland:noinspection GoUnusedExportedFunction -func NewDiagnosticErrorListener(exactOnly bool) *DiagnosticErrorListener { - - n := new(DiagnosticErrorListener) - - // whether all ambiguities or only exact ambiguities are Reported. - n.exactOnly = exactOnly - return n -} - -func (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) { - if d.exactOnly && !exact { - return - } - msg := "reportAmbiguity d=" + - d.getDecisionDescription(recognizer, dfa) + - ": ambigAlts=" + - d.getConflictingAlts(ambigAlts, configs).String() + - ", input='" + - recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'" - recognizer.NotifyErrorListeners(msg, nil, nil) -} - -func (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, _ *BitSet, _ *ATNConfigSet) { - - msg := "reportAttemptingFullContext d=" + - d.getDecisionDescription(recognizer, dfa) + - ", input='" + - recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'" - recognizer.NotifyErrorListeners(msg, nil, nil) -} - -func (d *DiagnosticErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, _ int, _ *ATNConfigSet) { - msg := "reportContextSensitivity d=" + - d.getDecisionDescription(recognizer, dfa) + - ", input='" + - recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'" - recognizer.NotifyErrorListeners(msg, nil, nil) -} - -func (d *DiagnosticErrorListener) getDecisionDescription(recognizer Parser, dfa *DFA) string { - decision := dfa.decision - ruleIndex := dfa.atnStartState.GetRuleIndex() - - ruleNames := recognizer.GetRuleNames() - if ruleIndex < 0 || ruleIndex >= len(ruleNames) { - return strconv.Itoa(decision) - } - ruleName := ruleNames[ruleIndex] - if ruleName == "" { - return strconv.Itoa(decision) - } - return strconv.Itoa(decision) + " (" + ruleName + ")" -} - -// Computes the set of conflicting or ambiguous alternatives from a -// configuration set, if that information was not already provided by the -// parser. -// -// @param ReportedAlts The set of conflicting or ambiguous alternatives, as -// Reported by the parser. -// @param configs The conflicting or ambiguous configuration set. -// @return Returns {@code ReportedAlts} if it is not {@code nil}, otherwise -// returns the set of alternatives represented in {@code configs}. -func (d *DiagnosticErrorListener) getConflictingAlts(ReportedAlts *BitSet, set *ATNConfigSet) *BitSet { - if ReportedAlts != nil { - return ReportedAlts - } - result := NewBitSet() - for _, c := range set.configs { - result.add(c.GetAlt()) - } - - return result -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/error_listener.go b/vendor/github.com/antlr4-go/antlr/v4/error_listener.go deleted file mode 100644 index 21a021643..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/error_listener.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "os" - "strconv" -) - -// Provides an empty default implementation of {@link ANTLRErrorListener}. The -// default implementation of each method does nothing, but can be overridden as -// necessary. - -type ErrorListener interface { - SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) - ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) - ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet) - ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet) -} - -type DefaultErrorListener struct { -} - -//goland:noinspection GoUnusedExportedFunction -func NewDefaultErrorListener() *DefaultErrorListener { - return new(DefaultErrorListener) -} - -func (d *DefaultErrorListener) SyntaxError(_ Recognizer, _ interface{}, _, _ int, _ string, _ RecognitionException) { -} - -func (d *DefaultErrorListener) ReportAmbiguity(_ Parser, _ *DFA, _, _ int, _ bool, _ *BitSet, _ *ATNConfigSet) { -} - -func (d *DefaultErrorListener) ReportAttemptingFullContext(_ Parser, _ *DFA, _, _ int, _ *BitSet, _ *ATNConfigSet) { -} - -func (d *DefaultErrorListener) ReportContextSensitivity(_ Parser, _ *DFA, _, _, _ int, _ *ATNConfigSet) { -} - -type ConsoleErrorListener struct { - *DefaultErrorListener -} - -func NewConsoleErrorListener() *ConsoleErrorListener { - return new(ConsoleErrorListener) -} - -// ConsoleErrorListenerINSTANCE provides a default instance of {@link ConsoleErrorListener}. -var ConsoleErrorListenerINSTANCE = NewConsoleErrorListener() - -// SyntaxError prints messages to System.err containing the -// values of line, charPositionInLine, and msg using -// the following format: -// -// line : -func (c *ConsoleErrorListener) SyntaxError(_ Recognizer, _ interface{}, line, column int, msg string, _ RecognitionException) { - _, _ = fmt.Fprintln(os.Stderr, "line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg) -} - -type ProxyErrorListener struct { - *DefaultErrorListener - delegates []ErrorListener -} - -func NewProxyErrorListener(delegates []ErrorListener) *ProxyErrorListener { - if delegates == nil { - panic("delegates is not provided") - } - l := new(ProxyErrorListener) - l.delegates = delegates - return l -} - -func (p *ProxyErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) { - for _, d := range p.delegates { - d.SyntaxError(recognizer, offendingSymbol, line, column, msg, e) - } -} - -func (p *ProxyErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) { - for _, d := range p.delegates { - d.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) - } -} - -func (p *ProxyErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet) { - for _, d := range p.delegates { - d.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) - } -} - -func (p *ProxyErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet) { - for _, d := range p.delegates { - d.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/error_strategy.go b/vendor/github.com/antlr4-go/antlr/v4/error_strategy.go deleted file mode 100644 index 9db2be1c7..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/error_strategy.go +++ /dev/null @@ -1,702 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -type ErrorStrategy interface { - reset(Parser) - RecoverInline(Parser) Token - Recover(Parser, RecognitionException) - Sync(Parser) - InErrorRecoveryMode(Parser) bool - ReportError(Parser, RecognitionException) - ReportMatch(Parser) -} - -// DefaultErrorStrategy is the default implementation of ANTLRErrorStrategy used for -// error reporting and recovery in ANTLR parsers. -type DefaultErrorStrategy struct { - errorRecoveryMode bool - lastErrorIndex int - lastErrorStates *IntervalSet -} - -var _ ErrorStrategy = &DefaultErrorStrategy{} - -func NewDefaultErrorStrategy() *DefaultErrorStrategy { - - d := new(DefaultErrorStrategy) - - // Indicates whether the error strategy is currently "recovering from an - // error". This is used to suppress Reporting multiple error messages while - // attempting to recover from a detected syntax error. - // - // @see //InErrorRecoveryMode - // - d.errorRecoveryMode = false - - // The index into the input stream where the last error occurred. - // This is used to prevent infinite loops where an error is found - // but no token is consumed during recovery...another error is found, - // ad nauseam. This is a failsafe mechanism to guarantee that at least - // one token/tree node is consumed for two errors. - // - d.lastErrorIndex = -1 - d.lastErrorStates = nil - return d -} - -//

The default implementation simply calls {@link //endErrorCondition} to -// ensure that the handler is not in error recovery mode.

-func (d *DefaultErrorStrategy) reset(recognizer Parser) { - d.endErrorCondition(recognizer) -} - -// This method is called to enter error recovery mode when a recognition -// exception is Reported. -func (d *DefaultErrorStrategy) beginErrorCondition(_ Parser) { - d.errorRecoveryMode = true -} - -func (d *DefaultErrorStrategy) InErrorRecoveryMode(_ Parser) bool { - return d.errorRecoveryMode -} - -// This method is called to leave error recovery mode after recovering from -// a recognition exception. -func (d *DefaultErrorStrategy) endErrorCondition(_ Parser) { - d.errorRecoveryMode = false - d.lastErrorStates = nil - d.lastErrorIndex = -1 -} - -// ReportMatch is the default implementation of error matching and simply calls endErrorCondition. -func (d *DefaultErrorStrategy) ReportMatch(recognizer Parser) { - d.endErrorCondition(recognizer) -} - -// ReportError is the default implementation of error reporting. -// It returns immediately if the handler is already -// in error recovery mode. Otherwise, it calls [beginErrorCondition] -// and dispatches the Reporting task based on the runtime type of e -// according to the following table. -// -// [NoViableAltException] : Dispatches the call to [ReportNoViableAlternative] -// [InputMisMatchException] : Dispatches the call to [ReportInputMisMatch] -// [FailedPredicateException] : Dispatches the call to [ReportFailedPredicate] -// All other types : Calls [NotifyErrorListeners] to Report the exception -func (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionException) { - // if we've already Reported an error and have not Matched a token - // yet successfully, don't Report any errors. - if d.InErrorRecoveryMode(recognizer) { - return // don't Report spurious errors - } - d.beginErrorCondition(recognizer) - - switch t := e.(type) { - default: - fmt.Println("unknown recognition error type: " + reflect.TypeOf(e).Name()) - // fmt.Println(e.stack) - recognizer.NotifyErrorListeners(e.GetMessage(), e.GetOffendingToken(), e) - case *NoViableAltException: - d.ReportNoViableAlternative(recognizer, t) - case *InputMisMatchException: - d.ReportInputMisMatch(recognizer, t) - case *FailedPredicateException: - d.ReportFailedPredicate(recognizer, t) - } -} - -// Recover is the default recovery implementation. -// It reSynchronizes the parser by consuming tokens until we find one in the reSynchronization set - -// loosely the set of tokens that can follow the current rule. -func (d *DefaultErrorStrategy) Recover(recognizer Parser, _ RecognitionException) { - - if d.lastErrorIndex == recognizer.GetInputStream().Index() && - d.lastErrorStates != nil && d.lastErrorStates.contains(recognizer.GetState()) { - // uh oh, another error at same token index and previously-Visited - // state in ATN must be a case where LT(1) is in the recovery - // token set so nothing got consumed. Consume a single token - // at least to prevent an infinite loop d is a failsafe. - recognizer.Consume() - } - d.lastErrorIndex = recognizer.GetInputStream().Index() - if d.lastErrorStates == nil { - d.lastErrorStates = NewIntervalSet() - } - d.lastErrorStates.addOne(recognizer.GetState()) - followSet := d.GetErrorRecoverySet(recognizer) - d.consumeUntil(recognizer, followSet) -} - -// Sync is the default implementation of error strategy synchronization. -// -// This Sync makes sure that the current lookahead symbol is consistent with what were expecting -// at this point in the [ATN]. You can call this anytime but ANTLR only -// generates code to check before sub-rules/loops and each iteration. -// -// Implements [Jim Idle]'s magic Sync mechanism in closures and optional -// sub-rules. E.g.: -// -// a : Sync ( stuff Sync )* -// Sync : {consume to what can follow Sync} -// -// At the start of a sub-rule upon error, Sync performs single -// token deletion, if possible. If it can't do that, it bails on the current -// rule and uses the default error recovery, which consumes until the -// reSynchronization set of the current rule. -// -// If the sub-rule is optional -// -// ({@code (...)?}, {@code (...)*}, -// -// or a block with an empty alternative), then the expected set includes what follows -// the sub-rule. -// -// During loop iteration, it consumes until it sees a token that can start a -// sub-rule or what follows loop. Yes, that is pretty aggressive. We opt to -// stay in the loop as long as possible. -// -// # Origins -// -// Previous versions of ANTLR did a poor job of their recovery within loops. -// A single mismatch token or missing token would force the parser to bail -// out of the entire rules surrounding the loop. So, for rule: -// -// classfunc : 'class' ID '{' member* '}' -// -// input with an extra token between members would force the parser to -// consume until it found the next class definition rather than the next -// member definition of the current class. -// -// This functionality cost a bit of effort because the parser has to -// compare the token set at the start of the loop and at each iteration. If for -// some reason speed is suffering for you, you can turn off this -// functionality by simply overriding this method as empty: -// -// { } -// -// [Jim Idle]: https://github.com/jimidle -func (d *DefaultErrorStrategy) Sync(recognizer Parser) { - // If already recovering, don't try to Sync - if d.InErrorRecoveryMode(recognizer) { - return - } - - s := recognizer.GetInterpreter().atn.states[recognizer.GetState()] - la := recognizer.GetTokenStream().LA(1) - - // try cheaper subset first might get lucky. seems to shave a wee bit off - nextTokens := recognizer.GetATN().NextTokens(s, nil) - if nextTokens.contains(TokenEpsilon) || nextTokens.contains(la) { - return - } - - switch s.GetStateType() { - case ATNStateBlockStart, ATNStateStarBlockStart, ATNStatePlusBlockStart, ATNStateStarLoopEntry: - // Report error and recover if possible - if d.SingleTokenDeletion(recognizer) != nil { - return - } - recognizer.SetError(NewInputMisMatchException(recognizer)) - case ATNStatePlusLoopBack, ATNStateStarLoopBack: - d.ReportUnwantedToken(recognizer) - expecting := NewIntervalSet() - expecting.addSet(recognizer.GetExpectedTokens()) - whatFollowsLoopIterationOrRule := expecting.addSet(d.GetErrorRecoverySet(recognizer)) - d.consumeUntil(recognizer, whatFollowsLoopIterationOrRule) - default: - // do nothing if we can't identify the exact kind of ATN state - } -} - -// ReportNoViableAlternative is called by [ReportError] when the exception is a [NoViableAltException]. -// -// See also [ReportError] -func (d *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e *NoViableAltException) { - tokens := recognizer.GetTokenStream() - var input string - if tokens != nil { - if e.startToken.GetTokenType() == TokenEOF { - input = "" - } else { - input = tokens.GetTextFromTokens(e.startToken, e.offendingToken) - } - } else { - input = "" - } - msg := "no viable alternative at input " + d.escapeWSAndQuote(input) - recognizer.NotifyErrorListeners(msg, e.offendingToken, e) -} - -// ReportInputMisMatch is called by [ReportError] when the exception is an [InputMisMatchException] -// -// See also: [ReportError] -func (d *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) { - msg := "mismatched input " + d.GetTokenErrorDisplay(e.offendingToken) + - " expecting " + e.getExpectedTokens().StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false) - recognizer.NotifyErrorListeners(msg, e.offendingToken, e) -} - -// ReportFailedPredicate is called by [ReportError] when the exception is a [FailedPredicateException]. -// -// See also: [ReportError] -func (d *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *FailedPredicateException) { - ruleName := recognizer.GetRuleNames()[recognizer.GetParserRuleContext().GetRuleIndex()] - msg := "rule " + ruleName + " " + e.message - recognizer.NotifyErrorListeners(msg, e.offendingToken, e) -} - -// ReportUnwantedToken is called to report a syntax error that requires the removal -// of a token from the input stream. At the time d method is called, the -// erroneous symbol is the current LT(1) symbol and has not yet been -// removed from the input stream. When this method returns, -// recognizer is in error recovery mode. -// -// This method is called when singleTokenDeletion identifies -// single-token deletion as a viable recovery strategy for a mismatched -// input error. -// -// The default implementation simply returns if the handler is already in -// error recovery mode. Otherwise, it calls beginErrorCondition to -// enter error recovery mode, followed by calling -// [NotifyErrorListeners] -func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) { - if d.InErrorRecoveryMode(recognizer) { - return - } - d.beginErrorCondition(recognizer) - t := recognizer.GetCurrentToken() - tokenName := d.GetTokenErrorDisplay(t) - expecting := d.GetExpectedTokens(recognizer) - msg := "extraneous input " + tokenName + " expecting " + - expecting.StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false) - recognizer.NotifyErrorListeners(msg, t, nil) -} - -// ReportMissingToken is called to report a syntax error which requires the -// insertion of a missing token into the input stream. At the time this -// method is called, the missing token has not yet been inserted. When this -// method returns, recognizer is in error recovery mode. -// -// This method is called when singleTokenInsertion identifies -// single-token insertion as a viable recovery strategy for a mismatched -// input error. -// -// The default implementation simply returns if the handler is already in -// error recovery mode. Otherwise, it calls beginErrorCondition to -// enter error recovery mode, followed by calling [NotifyErrorListeners] -func (d *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) { - if d.InErrorRecoveryMode(recognizer) { - return - } - d.beginErrorCondition(recognizer) - t := recognizer.GetCurrentToken() - expecting := d.GetExpectedTokens(recognizer) - msg := "missing " + expecting.StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false) + - " at " + d.GetTokenErrorDisplay(t) - recognizer.NotifyErrorListeners(msg, t, nil) -} - -// The RecoverInline default implementation attempts to recover from the mismatched input -// by using single token insertion and deletion as described below. If the -// recovery attempt fails, this method panics with [InputMisMatchException}. -// TODO: Not sure that panic() is the right thing to do here - JI -// -// # EXTRA TOKEN (single token deletion) -// -// LA(1) is not what we are looking for. If LA(2) has the -// right token, however, then assume LA(1) is some extra spurious -// token and delete it. Then consume and return the next token (which was -// the LA(2) token) as the successful result of the Match operation. -// -// # This recovery strategy is implemented by singleTokenDeletion -// -// # MISSING TOKEN (single token insertion) -// -// If current token -at LA(1) - is consistent with what could come -// after the expected LA(1) token, then assume the token is missing -// and use the parser's [TokenFactory] to create it on the fly. The -// “insertion” is performed by returning the created token as the successful -// result of the Match operation. -// -// This recovery strategy is implemented by [SingleTokenInsertion]. -// -// # Example -// -// For example, Input i=(3 is clearly missing the ')'. When -// the parser returns from the nested call to expr, it will have -// call the chain: -// -// stat → expr → atom -// -// and it will be trying to Match the ')' at this point in the -// derivation: -// -// : ID '=' '(' INT ')' ('+' atom)* ';' -// ^ -// -// The attempt to [Match] ')' will fail when it sees ';' and -// call [RecoverInline]. To recover, it sees that LA(1)==';' -// is in the set of tokens that can follow the ')' token reference -// in rule atom. It can assume that you forgot the ')'. -func (d *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token { - // SINGLE TOKEN DELETION - MatchedSymbol := d.SingleTokenDeletion(recognizer) - if MatchedSymbol != nil { - // we have deleted the extra token. - // now, move past ttype token as if all were ok - recognizer.Consume() - return MatchedSymbol - } - // SINGLE TOKEN INSERTION - if d.SingleTokenInsertion(recognizer) { - return d.GetMissingSymbol(recognizer) - } - // even that didn't work must panic the exception - recognizer.SetError(NewInputMisMatchException(recognizer)) - return nil -} - -// SingleTokenInsertion implements the single-token insertion inline error recovery -// strategy. It is called by [RecoverInline] if the single-token -// deletion strategy fails to recover from the mismatched input. If this -// method returns {@code true}, {@code recognizer} will be in error recovery -// mode. -// -// This method determines whether single-token insertion is viable by -// checking if the LA(1) input symbol could be successfully Matched -// if it were instead the LA(2) symbol. If this method returns -// {@code true}, the caller is responsible for creating and inserting a -// token with the correct type to produce this behavior.

-// -// This func returns true if single-token insertion is a viable recovery -// strategy for the current mismatched input. -func (d *DefaultErrorStrategy) SingleTokenInsertion(recognizer Parser) bool { - currentSymbolType := recognizer.GetTokenStream().LA(1) - // if current token is consistent with what could come after current - // ATN state, then we know we're missing a token error recovery - // is free to conjure up and insert the missing token - atn := recognizer.GetInterpreter().atn - currentState := atn.states[recognizer.GetState()] - next := currentState.GetTransitions()[0].getTarget() - expectingAtLL2 := atn.NextTokens(next, recognizer.GetParserRuleContext()) - if expectingAtLL2.contains(currentSymbolType) { - d.ReportMissingToken(recognizer) - return true - } - - return false -} - -// SingleTokenDeletion implements the single-token deletion inline error recovery -// strategy. It is called by [RecoverInline] to attempt to recover -// from mismatched input. If this method returns nil, the parser and error -// handler state will not have changed. If this method returns non-nil, -// recognizer will not be in error recovery mode since the -// returned token was a successful Match. -// -// If the single-token deletion is successful, this method calls -// [ReportUnwantedToken] to Report the error, followed by -// [Consume] to actually “delete” the extraneous token. Then, -// before returning, [ReportMatch] is called to signal a successful -// Match. -// -// The func returns the successfully Matched [Token] instance if single-token -// deletion successfully recovers from the mismatched input, otherwise nil. -func (d *DefaultErrorStrategy) SingleTokenDeletion(recognizer Parser) Token { - NextTokenType := recognizer.GetTokenStream().LA(2) - expecting := d.GetExpectedTokens(recognizer) - if expecting.contains(NextTokenType) { - d.ReportUnwantedToken(recognizer) - // print("recoverFromMisMatchedToken deleting " \ - // + str(recognizer.GetTokenStream().LT(1)) \ - // + " since " + str(recognizer.GetTokenStream().LT(2)) \ - // + " is what we want", file=sys.stderr) - recognizer.Consume() // simply delete extra token - // we want to return the token we're actually Matching - MatchedSymbol := recognizer.GetCurrentToken() - d.ReportMatch(recognizer) // we know current token is correct - return MatchedSymbol - } - - return nil -} - -// GetMissingSymbol conjures up a missing token during error recovery. -// -// The recognizer attempts to recover from single missing -// symbols. But, actions might refer to that missing symbol. -// For example: -// -// x=ID {f($x)}. -// -// The action clearly assumes -// that there has been an identifier Matched previously and that -// $x points at that token. If that token is missing, but -// the next token in the stream is what we want we assume that -// this token is missing, and we keep going. Because we -// have to return some token to replace the missing token, -// we have to conjure one up. This method gives the user control -// over the tokens returned for missing tokens. Mostly, -// you will want to create something special for identifier -// tokens. For literals such as '{' and ',', the default -// action in the parser or tree parser works. It simply creates -// a [CommonToken] of the appropriate type. The text will be the token name. -// If you need to change which tokens must be created by the lexer, -// override this method to create the appropriate tokens. -func (d *DefaultErrorStrategy) GetMissingSymbol(recognizer Parser) Token { - currentSymbol := recognizer.GetCurrentToken() - expecting := d.GetExpectedTokens(recognizer) - expectedTokenType := expecting.first() - var tokenText string - - if expectedTokenType == TokenEOF { - tokenText = "" - } else { - ln := recognizer.GetLiteralNames() - if expectedTokenType > 0 && expectedTokenType < len(ln) { - tokenText = "" - } else { - tokenText = "" // TODO: matches the JS impl - } - } - current := currentSymbol - lookback := recognizer.GetTokenStream().LT(-1) - if current.GetTokenType() == TokenEOF && lookback != nil { - current = lookback - } - - tf := recognizer.GetTokenFactory() - - return tf.Create(current.GetSource(), expectedTokenType, tokenText, TokenDefaultChannel, -1, -1, current.GetLine(), current.GetColumn()) -} - -func (d *DefaultErrorStrategy) GetExpectedTokens(recognizer Parser) *IntervalSet { - return recognizer.GetExpectedTokens() -} - -// GetTokenErrorDisplay determines how a token should be displayed in an error message. -// The default is to display just the text, but during development you might -// want to have a lot of information spit out. Override this func in that case -// to use t.String() (which, for [CommonToken], dumps everything about -// the token). This is better than forcing you to override a method in -// your token objects because you don't have to go modify your lexer -// so that it creates a new type. -func (d *DefaultErrorStrategy) GetTokenErrorDisplay(t Token) string { - if t == nil { - return "" - } - s := t.GetText() - if s == "" { - if t.GetTokenType() == TokenEOF { - s = "" - } else { - s = "<" + strconv.Itoa(t.GetTokenType()) + ">" - } - } - return d.escapeWSAndQuote(s) -} - -func (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string { - s = strings.Replace(s, "\t", "\\t", -1) - s = strings.Replace(s, "\n", "\\n", -1) - s = strings.Replace(s, "\r", "\\r", -1) - return "'" + s + "'" -} - -// GetErrorRecoverySet computes the error recovery set for the current rule. During -// rule invocation, the parser pushes the set of tokens that can -// follow that rule reference on the stack. This amounts to -// computing FIRST of what follows the rule reference in the -// enclosing rule. See LinearApproximator.FIRST(). -// -// This local follow set only includes tokens -// from within the rule i.e., the FIRST computation done by -// ANTLR stops at the end of a rule. -// -// # Example -// -// When you find a "no viable alt exception", the input is not -// consistent with any of the alternatives for rule r. The best -// thing to do is to consume tokens until you see something that -// can legally follow a call to r or any rule that called r. -// You don't want the exact set of viable next tokens because the -// input might just be missing a token--you might consume the -// rest of the input looking for one of the missing tokens. -// -// Consider the grammar: -// -// a : '[' b ']' -// | '(' b ')' -// ; -// -// b : c '^' INT -// ; -// -// c : ID -// | INT -// ; -// -// At each rule invocation, the set of tokens that could follow -// that rule is pushed on a stack. Here are the various -// context-sensitive follow sets: -// -// FOLLOW(b1_in_a) = FIRST(']') = ']' -// FOLLOW(b2_in_a) = FIRST(')') = ')' -// FOLLOW(c_in_b) = FIRST('^') = '^' -// -// Upon erroneous input “[]”, the call chain is -// -// a → b → c -// -// and, hence, the follow context stack is: -// -// Depth Follow set Start of rule execution -// 0 a (from main()) -// 1 ']' b -// 2 '^' c -// -// Notice that ')' is not included, because b would have to have -// been called from a different context in rule a for ')' to be -// included. -// -// For error recovery, we cannot consider FOLLOW(c) -// (context-sensitive or otherwise). We need the combined set of -// all context-sensitive FOLLOW sets - the set of all tokens that -// could follow any reference in the call chain. We need to -// reSync to one of those tokens. Note that FOLLOW(c)='^' and if -// we reSync'd to that token, we'd consume until EOF. We need to -// Sync to context-sensitive FOLLOWs for a, b, and c: -// -// {']','^'} -// -// In this case, for input "[]", LA(1) is ']' and in the set, so we would -// not consume anything. After printing an error, rule c would -// return normally. Rule b would not find the required '^' though. -// At this point, it gets a mismatched token error and panics an -// exception (since LA(1) is not in the viable following token -// set). The rule exception handler tries to recover, but finds -// the same recovery set and doesn't consume anything. Rule b -// exits normally returning to rule a. Now it finds the ']' (and -// with the successful Match exits errorRecovery mode). -// -// So, you can see that the parser walks up the call chain looking -// for the token that was a member of the recovery set. -// -// Errors are not generated in errorRecovery mode. -// -// ANTLR's error recovery mechanism is based upon original ideas: -// -// [Algorithms + Data Structures = Programs] by Niklaus Wirth and -// [A note on error recovery in recursive descent parsers]. -// -// Later, Josef Grosch had some good ideas in [Efficient and Comfortable Error Recovery in Recursive Descent -// Parsers] -// -// Like Grosch I implement context-sensitive FOLLOW sets that are combined at run-time upon error to avoid overhead -// during parsing. Later, the runtime Sync was improved for loops/sub-rules see [Sync] docs -// -// [A note on error recovery in recursive descent parsers]: http://portal.acm.org/citation.cfm?id=947902.947905 -// [Algorithms + Data Structures = Programs]: https://t.ly/5QzgE -// [Efficient and Comfortable Error Recovery in Recursive Descent Parsers]: ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip -func (d *DefaultErrorStrategy) GetErrorRecoverySet(recognizer Parser) *IntervalSet { - atn := recognizer.GetInterpreter().atn - ctx := recognizer.GetParserRuleContext() - recoverSet := NewIntervalSet() - for ctx != nil && ctx.GetInvokingState() >= 0 { - // compute what follows who invoked us - invokingState := atn.states[ctx.GetInvokingState()] - rt := invokingState.GetTransitions()[0] - follow := atn.NextTokens(rt.(*RuleTransition).followState, nil) - recoverSet.addSet(follow) - ctx = ctx.GetParent().(ParserRuleContext) - } - recoverSet.removeOne(TokenEpsilon) - return recoverSet -} - -// Consume tokens until one Matches the given token set.// -func (d *DefaultErrorStrategy) consumeUntil(recognizer Parser, set *IntervalSet) { - ttype := recognizer.GetTokenStream().LA(1) - for ttype != TokenEOF && !set.contains(ttype) { - recognizer.Consume() - ttype = recognizer.GetTokenStream().LA(1) - } -} - -// The BailErrorStrategy implementation of ANTLRErrorStrategy responds to syntax errors -// by immediately canceling the parse operation with a -// [ParseCancellationException]. The implementation ensures that the -// [ParserRuleContext//exception] field is set for all parse tree nodes -// that were not completed prior to encountering the error. -// -// This error strategy is useful in the following scenarios. -// -// - Two-stage parsing: This error strategy allows the first -// stage of two-stage parsing to immediately terminate if an error is -// encountered, and immediately fall back to the second stage. In addition to -// avoiding wasted work by attempting to recover from errors here, the empty -// implementation of [BailErrorStrategy.Sync] improves the performance of -// the first stage. -// -// - Silent validation: When syntax errors are not being -// Reported or logged, and the parse result is simply ignored if errors occur, -// the [BailErrorStrategy] avoids wasting work on recovering from errors -// when the result will be ignored either way. -// -// myparser.SetErrorHandler(NewBailErrorStrategy()) -// -// See also: [Parser.SetErrorHandler(ANTLRErrorStrategy)] -type BailErrorStrategy struct { - *DefaultErrorStrategy -} - -var _ ErrorStrategy = &BailErrorStrategy{} - -//goland:noinspection GoUnusedExportedFunction -func NewBailErrorStrategy() *BailErrorStrategy { - - b := new(BailErrorStrategy) - - b.DefaultErrorStrategy = NewDefaultErrorStrategy() - - return b -} - -// Recover Instead of recovering from exception e, re-panic it wrapped -// in a [ParseCancellationException] so it is not caught by the -// rule func catches. Use Exception.GetCause() to get the -// original [RecognitionException]. -func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) { - context := recognizer.GetParserRuleContext() - for context != nil { - context.SetException(e) - if parent, ok := context.GetParent().(ParserRuleContext); ok { - context = parent - } else { - context = nil - } - } - recognizer.SetError(NewParseCancellationException()) // TODO: we don't emit e properly -} - -// RecoverInline makes sure we don't attempt to recover inline if the parser -// successfully recovers, it won't panic an exception. -func (b *BailErrorStrategy) RecoverInline(recognizer Parser) Token { - b.Recover(recognizer, NewInputMisMatchException(recognizer)) - - return nil -} - -// Sync makes sure we don't attempt to recover from problems in sub-rules. -func (b *BailErrorStrategy) Sync(_ Parser) { -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/errors.go b/vendor/github.com/antlr4-go/antlr/v4/errors.go deleted file mode 100644 index 8f0f2f601..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/errors.go +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// The root of the ANTLR exception hierarchy. In general, ANTLR tracks just -// 3 kinds of errors: prediction errors, failed predicate errors, and -// mismatched input errors. In each case, the parser knows where it is -// in the input, where it is in the ATN, the rule invocation stack, -// and what kind of problem occurred. - -type RecognitionException interface { - GetOffendingToken() Token - GetMessage() string - GetInputStream() IntStream -} - -type BaseRecognitionException struct { - message string - recognizer Recognizer - offendingToken Token - offendingState int - ctx RuleContext - input IntStream -} - -func NewBaseRecognitionException(message string, recognizer Recognizer, input IntStream, ctx RuleContext) *BaseRecognitionException { - - // todo - // Error.call(this) - // - // if (!!Error.captureStackTrace) { - // Error.captureStackTrace(this, RecognitionException) - // } else { - // stack := NewError().stack - // } - // TODO: may be able to use - "runtime" func Stack(buf []byte, all bool) int - - t := new(BaseRecognitionException) - - t.message = message - t.recognizer = recognizer - t.input = input - t.ctx = ctx - - // The current Token when an error occurred. Since not all streams - // support accessing symbols by index, we have to track the {@link Token} - // instance itself. - // - t.offendingToken = nil - - // Get the ATN state number the parser was in at the time the error - // occurred. For NoViableAltException and LexerNoViableAltException exceptions, this is the - // DecisionState number. For others, it is the state whose outgoing edge we couldn't Match. - // - t.offendingState = -1 - if t.recognizer != nil { - t.offendingState = t.recognizer.GetState() - } - - return t -} - -func (b *BaseRecognitionException) GetMessage() string { - return b.message -} - -func (b *BaseRecognitionException) GetOffendingToken() Token { - return b.offendingToken -} - -func (b *BaseRecognitionException) GetInputStream() IntStream { - return b.input -} - -//

If the state number is not known, b method returns -1.

- -// getExpectedTokens gets the set of input symbols which could potentially follow the -// previously Matched symbol at the time this exception was raised. -// -// If the set of expected tokens is not known and could not be computed, -// this method returns nil. -// -// The func returns the set of token types that could potentially follow the current -// state in the {ATN}, or nil if the information is not available. - -func (b *BaseRecognitionException) getExpectedTokens() *IntervalSet { - if b.recognizer != nil { - return b.recognizer.GetATN().getExpectedTokens(b.offendingState, b.ctx) - } - - return nil -} - -func (b *BaseRecognitionException) String() string { - return b.message -} - -type LexerNoViableAltException struct { - *BaseRecognitionException - - startIndex int - deadEndConfigs *ATNConfigSet -} - -func NewLexerNoViableAltException(lexer Lexer, input CharStream, startIndex int, deadEndConfigs *ATNConfigSet) *LexerNoViableAltException { - - l := new(LexerNoViableAltException) - - l.BaseRecognitionException = NewBaseRecognitionException("", lexer, input, nil) - - l.startIndex = startIndex - l.deadEndConfigs = deadEndConfigs - - return l -} - -func (l *LexerNoViableAltException) String() string { - symbol := "" - if l.startIndex >= 0 && l.startIndex < l.input.Size() { - symbol = l.input.(CharStream).GetTextFromInterval(NewInterval(l.startIndex, l.startIndex)) - } - return "LexerNoViableAltException" + symbol -} - -type NoViableAltException struct { - *BaseRecognitionException - - startToken Token - offendingToken Token - ctx ParserRuleContext - deadEndConfigs *ATNConfigSet -} - -// NewNoViableAltException creates an exception indicating that the parser could not decide which of two or more paths -// to take based upon the remaining input. It tracks the starting token -// of the offending input and also knows where the parser was -// in the various paths when the error. -// -// Reported by [ReportNoViableAlternative] -func NewNoViableAltException(recognizer Parser, input TokenStream, startToken Token, offendingToken Token, deadEndConfigs *ATNConfigSet, ctx ParserRuleContext) *NoViableAltException { - - if ctx == nil { - ctx = recognizer.GetParserRuleContext() - } - - if offendingToken == nil { - offendingToken = recognizer.GetCurrentToken() - } - - if startToken == nil { - startToken = recognizer.GetCurrentToken() - } - - if input == nil { - input = recognizer.GetInputStream().(TokenStream) - } - - n := new(NoViableAltException) - n.BaseRecognitionException = NewBaseRecognitionException("", recognizer, input, ctx) - - // Which configurations did we try at input.Index() that couldn't Match - // input.LT(1) - n.deadEndConfigs = deadEndConfigs - - // The token object at the start index the input stream might - // not be buffering tokens so get a reference to it. - // - // At the time the error occurred, of course the stream needs to keep a - // buffer of all the tokens, but later we might not have access to those. - n.startToken = startToken - n.offendingToken = offendingToken - - return n -} - -type InputMisMatchException struct { - *BaseRecognitionException -} - -// NewInputMisMatchException creates an exception that signifies any kind of mismatched input exceptions such as -// when the current input does not Match the expected token. -func NewInputMisMatchException(recognizer Parser) *InputMisMatchException { - - i := new(InputMisMatchException) - i.BaseRecognitionException = NewBaseRecognitionException("", recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext()) - - i.offendingToken = recognizer.GetCurrentToken() - - return i - -} - -// FailedPredicateException indicates that a semantic predicate failed during validation. Validation of predicates -// occurs when normally parsing the alternative just like Matching a token. -// Disambiguating predicate evaluation occurs when we test a predicate during -// prediction. -type FailedPredicateException struct { - *BaseRecognitionException - - ruleIndex int - predicateIndex int - predicate string -} - -//goland:noinspection GoUnusedExportedFunction -func NewFailedPredicateException(recognizer Parser, predicate string, message string) *FailedPredicateException { - - f := new(FailedPredicateException) - - f.BaseRecognitionException = NewBaseRecognitionException(f.formatMessage(predicate, message), recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext()) - - s := recognizer.GetInterpreter().atn.states[recognizer.GetState()] - trans := s.GetTransitions()[0] - if trans2, ok := trans.(*PredicateTransition); ok { - f.ruleIndex = trans2.ruleIndex - f.predicateIndex = trans2.predIndex - } else { - f.ruleIndex = 0 - f.predicateIndex = 0 - } - f.predicate = predicate - f.offendingToken = recognizer.GetCurrentToken() - - return f -} - -func (f *FailedPredicateException) formatMessage(predicate, message string) string { - if message != "" { - return message - } - - return "failed predicate: {" + predicate + "}?" -} - -type ParseCancellationException struct { -} - -func (p ParseCancellationException) GetOffendingToken() Token { - //TODO implement me - panic("implement me") -} - -func (p ParseCancellationException) GetMessage() string { - //TODO implement me - panic("implement me") -} - -func (p ParseCancellationException) GetInputStream() IntStream { - //TODO implement me - panic("implement me") -} - -func NewParseCancellationException() *ParseCancellationException { - // Error.call(this) - // Error.captureStackTrace(this, ParseCancellationException) - return new(ParseCancellationException) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/file_stream.go b/vendor/github.com/antlr4-go/antlr/v4/file_stream.go deleted file mode 100644 index 5f65f809b..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/file_stream.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "bufio" - "os" -) - -// This is an InputStream that is loaded from a file all at once -// when you construct the object. - -type FileStream struct { - InputStream - filename string -} - -//goland:noinspection GoUnusedExportedFunction -func NewFileStream(fileName string) (*FileStream, error) { - - f, err := os.Open(fileName) - if err != nil { - return nil, err - } - - defer func(f *os.File) { - errF := f.Close() - if errF != nil { - } - }(f) - - reader := bufio.NewReader(f) - fInfo, err := f.Stat() - if err != nil { - return nil, err - } - - fs := &FileStream{ - InputStream: InputStream{ - index: 0, - name: fileName, - }, - filename: fileName, - } - - // Pre-build the buffer and read runes efficiently - // - fs.data = make([]rune, 0, fInfo.Size()) - for { - r, _, err := reader.ReadRune() - if err != nil { - break - } - fs.data = append(fs.data, r) - } - fs.size = len(fs.data) // Size in runes - - // All done. - // - return fs, nil -} - -func (f *FileStream) GetSourceName() string { - return f.filename -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/input_stream.go b/vendor/github.com/antlr4-go/antlr/v4/input_stream.go deleted file mode 100644 index b737fe85f..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/input_stream.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "bufio" - "io" -) - -type InputStream struct { - name string - index int - data []rune - size int -} - -// NewIoStream creates a new input stream from the given io.Reader reader. -// Note that the reader is read completely into memory and so it must actually -// have a stopping point - you cannot pass in a reader on an open-ended source such -// as a socket for instance. -func NewIoStream(reader io.Reader) *InputStream { - - rReader := bufio.NewReader(reader) - - is := &InputStream{ - name: "", - index: 0, - } - - // Pre-build the buffer and read runes reasonably efficiently given that - // we don't exactly know how big the input is. - // - is.data = make([]rune, 0, 512) - for { - r, _, err := rReader.ReadRune() - if err != nil { - break - } - is.data = append(is.data, r) - } - is.size = len(is.data) // number of runes - return is -} - -// NewInputStream creates a new input stream from the given string -func NewInputStream(data string) *InputStream { - - is := &InputStream{ - name: "", - index: 0, - data: []rune(data), // This is actually the most efficient way - } - is.size = len(is.data) // number of runes, but we could also use len(data), which is efficient too - return is -} - -func (is *InputStream) reset() { - is.index = 0 -} - -// Consume moves the input pointer to the next character in the input stream -func (is *InputStream) Consume() { - if is.index >= is.size { - // assert is.LA(1) == TokenEOF - panic("cannot consume EOF") - } - is.index++ -} - -// LA returns the character at the given offset from the start of the input stream -func (is *InputStream) LA(offset int) int { - - if offset == 0 { - return 0 // nil - } - if offset < 0 { - offset++ // e.g., translate LA(-1) to use offset=0 - } - pos := is.index + offset - 1 - - if pos < 0 || pos >= is.size { // invalid - return TokenEOF - } - - return int(is.data[pos]) -} - -// LT returns the character at the given offset from the start of the input stream -func (is *InputStream) LT(offset int) int { - return is.LA(offset) -} - -// Index returns the current offset in to the input stream -func (is *InputStream) Index() int { - return is.index -} - -// Size returns the total number of characters in the input stream -func (is *InputStream) Size() int { - return is.size -} - -// Mark does nothing here as we have entire buffer -func (is *InputStream) Mark() int { - return -1 -} - -// Release does nothing here as we have entire buffer -func (is *InputStream) Release(_ int) { -} - -// Seek the input point to the provided index offset -func (is *InputStream) Seek(index int) { - if index <= is.index { - is.index = index // just jump don't update stream state (line,...) - return - } - // seek forward - is.index = intMin(index, is.size) -} - -// GetText returns the text from the input stream from the start to the stop index -func (is *InputStream) GetText(start int, stop int) string { - if stop >= is.size { - stop = is.size - 1 - } - if start >= is.size { - return "" - } - - return string(is.data[start : stop+1]) -} - -// GetTextFromTokens returns the text from the input stream from the first character of the start token to the last -// character of the stop token -func (is *InputStream) GetTextFromTokens(start, stop Token) string { - if start != nil && stop != nil { - return is.GetTextFromInterval(NewInterval(start.GetTokenIndex(), stop.GetTokenIndex())) - } - - return "" -} - -func (is *InputStream) GetTextFromInterval(i Interval) string { - return is.GetText(i.Start, i.Stop) -} - -func (*InputStream) GetSourceName() string { - return "" -} - -// String returns the entire input stream as a string -func (is *InputStream) String() string { - return string(is.data) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/int_stream.go b/vendor/github.com/antlr4-go/antlr/v4/int_stream.go deleted file mode 100644 index 4778878bd..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/int_stream.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -type IntStream interface { - Consume() - LA(int) int - Mark() int - Release(marker int) - Index() int - Seek(index int) - Size() int - GetSourceName() string -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/interval_set.go b/vendor/github.com/antlr4-go/antlr/v4/interval_set.go deleted file mode 100644 index cc5066067..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/interval_set.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "strconv" - "strings" -) - -type Interval struct { - Start int - Stop int -} - -// NewInterval creates a new interval with the given start and stop values. -func NewInterval(start, stop int) Interval { - return Interval{ - Start: start, - Stop: stop, - } -} - -// Contains returns true if the given item is contained within the interval. -func (i Interval) Contains(item int) bool { - return item >= i.Start && item < i.Stop -} - -// String generates a string representation of the interval. -func (i Interval) String() string { - if i.Start == i.Stop-1 { - return strconv.Itoa(i.Start) - } - - return strconv.Itoa(i.Start) + ".." + strconv.Itoa(i.Stop-1) -} - -// Length returns the length of the interval. -func (i Interval) Length() int { - return i.Stop - i.Start -} - -// IntervalSet represents a collection of [Intervals], which may be read-only. -type IntervalSet struct { - intervals []Interval - readOnly bool -} - -// NewIntervalSet creates a new empty, writable, interval set. -func NewIntervalSet() *IntervalSet { - - i := new(IntervalSet) - - i.intervals = nil - i.readOnly = false - - return i -} - -func (i *IntervalSet) Equals(other *IntervalSet) bool { - if len(i.intervals) != len(other.intervals) { - return false - } - - for k, v := range i.intervals { - if v.Start != other.intervals[k].Start || v.Stop != other.intervals[k].Stop { - return false - } - } - - return true -} - -func (i *IntervalSet) first() int { - if len(i.intervals) == 0 { - return TokenInvalidType - } - - return i.intervals[0].Start -} - -func (i *IntervalSet) addOne(v int) { - i.addInterval(NewInterval(v, v+1)) -} - -func (i *IntervalSet) addRange(l, h int) { - i.addInterval(NewInterval(l, h+1)) -} - -func (i *IntervalSet) addInterval(v Interval) { - if i.intervals == nil { - i.intervals = make([]Interval, 0) - i.intervals = append(i.intervals, v) - } else { - // find insert pos - for k, interval := range i.intervals { - // distinct range -> insert - if v.Stop < interval.Start { - i.intervals = append(i.intervals[0:k], append([]Interval{v}, i.intervals[k:]...)...) - return - } else if v.Stop == interval.Start { - i.intervals[k].Start = v.Start - return - } else if v.Start <= interval.Stop { - i.intervals[k] = NewInterval(intMin(interval.Start, v.Start), intMax(interval.Stop, v.Stop)) - - // if not applying to end, merge potential overlaps - if k < len(i.intervals)-1 { - l := i.intervals[k] - r := i.intervals[k+1] - // if r contained in l - if l.Stop >= r.Stop { - i.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...) - } else if l.Stop >= r.Start { // partial overlap - i.intervals[k] = NewInterval(l.Start, r.Stop) - i.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...) - } - } - return - } - } - // greater than any exiting - i.intervals = append(i.intervals, v) - } -} - -func (i *IntervalSet) addSet(other *IntervalSet) *IntervalSet { - if other.intervals != nil { - for k := 0; k < len(other.intervals); k++ { - i2 := other.intervals[k] - i.addInterval(NewInterval(i2.Start, i2.Stop)) - } - } - return i -} - -func (i *IntervalSet) complement(start int, stop int) *IntervalSet { - result := NewIntervalSet() - result.addInterval(NewInterval(start, stop+1)) - for j := 0; j < len(i.intervals); j++ { - result.removeRange(i.intervals[j]) - } - return result -} - -func (i *IntervalSet) contains(item int) bool { - if i.intervals == nil { - return false - } - for k := 0; k < len(i.intervals); k++ { - if i.intervals[k].Contains(item) { - return true - } - } - return false -} - -func (i *IntervalSet) length() int { - iLen := 0 - - for _, v := range i.intervals { - iLen += v.Length() - } - - return iLen -} - -func (i *IntervalSet) removeRange(v Interval) { - if v.Start == v.Stop-1 { - i.removeOne(v.Start) - } else if i.intervals != nil { - k := 0 - for n := 0; n < len(i.intervals); n++ { - ni := i.intervals[k] - // intervals are ordered - if v.Stop <= ni.Start { - return - } else if v.Start > ni.Start && v.Stop < ni.Stop { - i.intervals[k] = NewInterval(ni.Start, v.Start) - x := NewInterval(v.Stop, ni.Stop) - // i.intervals.splice(k, 0, x) - i.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...) - return - } else if v.Start <= ni.Start && v.Stop >= ni.Stop { - // i.intervals.splice(k, 1) - i.intervals = append(i.intervals[0:k], i.intervals[k+1:]...) - k = k - 1 // need another pass - } else if v.Start < ni.Stop { - i.intervals[k] = NewInterval(ni.Start, v.Start) - } else if v.Stop < ni.Stop { - i.intervals[k] = NewInterval(v.Stop, ni.Stop) - } - k++ - } - } -} - -func (i *IntervalSet) removeOne(v int) { - if i.intervals != nil { - for k := 0; k < len(i.intervals); k++ { - ki := i.intervals[k] - // intervals i ordered - if v < ki.Start { - return - } else if v == ki.Start && v == ki.Stop-1 { - // i.intervals.splice(k, 1) - i.intervals = append(i.intervals[0:k], i.intervals[k+1:]...) - return - } else if v == ki.Start { - i.intervals[k] = NewInterval(ki.Start+1, ki.Stop) - return - } else if v == ki.Stop-1 { - i.intervals[k] = NewInterval(ki.Start, ki.Stop-1) - return - } else if v < ki.Stop-1 { - x := NewInterval(ki.Start, v) - ki.Start = v + 1 - // i.intervals.splice(k, 0, x) - i.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...) - return - } - } - } -} - -func (i *IntervalSet) String() string { - return i.StringVerbose(nil, nil, false) -} - -func (i *IntervalSet) StringVerbose(literalNames []string, symbolicNames []string, elemsAreChar bool) string { - - if i.intervals == nil { - return "{}" - } else if literalNames != nil || symbolicNames != nil { - return i.toTokenString(literalNames, symbolicNames) - } else if elemsAreChar { - return i.toCharString() - } - - return i.toIndexString() -} - -func (i *IntervalSet) GetIntervals() []Interval { - return i.intervals -} - -func (i *IntervalSet) toCharString() string { - names := make([]string, len(i.intervals)) - - var sb strings.Builder - - for j := 0; j < len(i.intervals); j++ { - v := i.intervals[j] - if v.Stop == v.Start+1 { - if v.Start == TokenEOF { - names = append(names, "") - } else { - sb.WriteByte('\'') - sb.WriteRune(rune(v.Start)) - sb.WriteByte('\'') - names = append(names, sb.String()) - sb.Reset() - } - } else { - sb.WriteByte('\'') - sb.WriteRune(rune(v.Start)) - sb.WriteString("'..'") - sb.WriteRune(rune(v.Stop - 1)) - sb.WriteByte('\'') - names = append(names, sb.String()) - sb.Reset() - } - } - if len(names) > 1 { - return "{" + strings.Join(names, ", ") + "}" - } - - return names[0] -} - -func (i *IntervalSet) toIndexString() string { - - names := make([]string, 0) - for j := 0; j < len(i.intervals); j++ { - v := i.intervals[j] - if v.Stop == v.Start+1 { - if v.Start == TokenEOF { - names = append(names, "") - } else { - names = append(names, strconv.Itoa(v.Start)) - } - } else { - names = append(names, strconv.Itoa(v.Start)+".."+strconv.Itoa(v.Stop-1)) - } - } - if len(names) > 1 { - return "{" + strings.Join(names, ", ") + "}" - } - - return names[0] -} - -func (i *IntervalSet) toTokenString(literalNames []string, symbolicNames []string) string { - names := make([]string, 0) - for _, v := range i.intervals { - for j := v.Start; j < v.Stop; j++ { - names = append(names, i.elementName(literalNames, symbolicNames, j)) - } - } - if len(names) > 1 { - return "{" + strings.Join(names, ", ") + "}" - } - - return names[0] -} - -func (i *IntervalSet) elementName(literalNames []string, symbolicNames []string, a int) string { - if a == TokenEOF { - return "" - } else if a == TokenEpsilon { - return "" - } else { - if a < len(literalNames) && literalNames[a] != "" { - return literalNames[a] - } - - return symbolicNames[a] - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/jcollect.go b/vendor/github.com/antlr4-go/antlr/v4/jcollect.go deleted file mode 100644 index ceccd96d2..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/jcollect.go +++ /dev/null @@ -1,685 +0,0 @@ -package antlr - -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -import ( - "container/list" - "runtime/debug" - "sort" - "sync" -) - -// Collectable is an interface that a struct should implement if it is to be -// usable as a key in these collections. -type Collectable[T any] interface { - Hash() int - Equals(other Collectable[T]) bool -} - -type Comparator[T any] interface { - Hash1(o T) int - Equals2(T, T) bool -} - -type CollectionSource int -type CollectionDescriptor struct { - SybolicName string - Description string -} - -const ( - UnknownCollection CollectionSource = iota - ATNConfigLookupCollection - ATNStateCollection - DFAStateCollection - ATNConfigCollection - PredictionContextCollection - SemanticContextCollection - ClosureBusyCollection - PredictionVisitedCollection - MergeCacheCollection - PredictionContextCacheCollection - AltSetCollection - ReachSetCollection -) - -var CollectionDescriptors = map[CollectionSource]CollectionDescriptor{ - UnknownCollection: { - SybolicName: "UnknownCollection", - Description: "Unknown collection type. Only used if the target author thought it was an unimportant collection.", - }, - ATNConfigCollection: { - SybolicName: "ATNConfigCollection", - Description: "ATNConfig collection. Used to store the ATNConfigs for a particular state in the ATN." + - "For instance, it is used to store the results of the closure() operation in the ATN.", - }, - ATNConfigLookupCollection: { - SybolicName: "ATNConfigLookupCollection", - Description: "ATNConfigLookup collection. Used to store the ATNConfigs for a particular state in the ATN." + - "This is used to prevent duplicating equivalent states in an ATNConfigurationSet.", - }, - ATNStateCollection: { - SybolicName: "ATNStateCollection", - Description: "ATNState collection. This is used to store the states of the ATN.", - }, - DFAStateCollection: { - SybolicName: "DFAStateCollection", - Description: "DFAState collection. This is used to store the states of the DFA.", - }, - PredictionContextCollection: { - SybolicName: "PredictionContextCollection", - Description: "PredictionContext collection. This is used to store the prediction contexts of the ATN and cache computes.", - }, - SemanticContextCollection: { - SybolicName: "SemanticContextCollection", - Description: "SemanticContext collection. This is used to store the semantic contexts of the ATN.", - }, - ClosureBusyCollection: { - SybolicName: "ClosureBusyCollection", - Description: "ClosureBusy collection. This is used to check and prevent infinite recursion right recursive rules." + - "It stores ATNConfigs that are currently being processed in the closure() operation.", - }, - PredictionVisitedCollection: { - SybolicName: "PredictionVisitedCollection", - Description: "A map that records whether we have visited a particular context when searching through cached entries.", - }, - MergeCacheCollection: { - SybolicName: "MergeCacheCollection", - Description: "A map that records whether we have already merged two particular contexts and can save effort by not repeating it.", - }, - PredictionContextCacheCollection: { - SybolicName: "PredictionContextCacheCollection", - Description: "A map that records whether we have already created a particular context and can save effort by not computing it again.", - }, - AltSetCollection: { - SybolicName: "AltSetCollection", - Description: "Used to eliminate duplicate alternatives in an ATN config set.", - }, - ReachSetCollection: { - SybolicName: "ReachSetCollection", - Description: "Used as merge cache to prevent us needing to compute the merge of two states if we have already done it.", - }, -} - -// JStore implements a container that allows the use of a struct to calculate the key -// for a collection of values akin to map. This is not meant to be a full-blown HashMap but just -// serve the needs of the ANTLR Go runtime. -// -// For ease of porting the logic of the runtime from the master target (Java), this collection -// operates in a similar way to Java, in that it can use any struct that supplies a Hash() and Equals() -// function as the key. The values are stored in a standard go map which internally is a form of hashmap -// itself, the key for the go map is the hash supplied by the key object. The collection is able to deal with -// hash conflicts by using a simple slice of values associated with the hash code indexed bucket. That isn't -// particularly efficient, but it is simple, and it works. As this is specifically for the ANTLR runtime, and -// we understand the requirements, then this is fine - this is not a general purpose collection. -type JStore[T any, C Comparator[T]] struct { - store map[int][]T - len int - comparator Comparator[T] - stats *JStatRec -} - -func NewJStore[T any, C Comparator[T]](comparator Comparator[T], cType CollectionSource, desc string) *JStore[T, C] { - - if comparator == nil { - panic("comparator cannot be nil") - } - - s := &JStore[T, C]{ - store: make(map[int][]T, 1), - comparator: comparator, - } - if collectStats { - s.stats = &JStatRec{ - Source: cType, - Description: desc, - } - - // Track where we created it from if we are being asked to do so - if runtimeConfig.statsTraceStacks { - s.stats.CreateStack = debug.Stack() - } - Statistics.AddJStatRec(s.stats) - } - return s -} - -// Put will store given value in the collection. Note that the key for storage is generated from -// the value itself - this is specifically because that is what ANTLR needs - this would not be useful -// as any kind of general collection. -// -// If the key has a hash conflict, then the value will be added to the slice of values associated with the -// hash, unless the value is already in the slice, in which case the existing value is returned. Value equivalence is -// tested by calling the equals() method on the key. -// -// # If the given value is already present in the store, then the existing value is returned as v and exists is set to true -// -// If the given value is not present in the store, then the value is added to the store and returned as v and exists is set to false. -func (s *JStore[T, C]) Put(value T) (v T, exists bool) { - - if collectStats { - s.stats.Puts++ - } - kh := s.comparator.Hash1(value) - - var hClash bool - for _, v1 := range s.store[kh] { - hClash = true - if s.comparator.Equals2(value, v1) { - if collectStats { - s.stats.PutHits++ - s.stats.PutHashConflicts++ - } - return v1, true - } - if collectStats { - s.stats.PutMisses++ - } - } - if collectStats && hClash { - s.stats.PutHashConflicts++ - } - s.store[kh] = append(s.store[kh], value) - - if collectStats { - if len(s.store[kh]) > s.stats.MaxSlotSize { - s.stats.MaxSlotSize = len(s.store[kh]) - } - } - s.len++ - if collectStats { - s.stats.CurSize = s.len - if s.len > s.stats.MaxSize { - s.stats.MaxSize = s.len - } - } - return value, false -} - -// Get will return the value associated with the key - the type of the key is the same type as the value -// which would not generally be useful, but this is a specific thing for ANTLR where the key is -// generated using the object we are going to store. -func (s *JStore[T, C]) Get(key T) (T, bool) { - if collectStats { - s.stats.Gets++ - } - kh := s.comparator.Hash1(key) - var hClash bool - for _, v := range s.store[kh] { - hClash = true - if s.comparator.Equals2(key, v) { - if collectStats { - s.stats.GetHits++ - s.stats.GetHashConflicts++ - } - return v, true - } - if collectStats { - s.stats.GetMisses++ - } - } - if collectStats { - if hClash { - s.stats.GetHashConflicts++ - } - s.stats.GetNoEnt++ - } - return key, false -} - -// Contains returns true if the given key is present in the store -func (s *JStore[T, C]) Contains(key T) bool { - _, present := s.Get(key) - return present -} - -func (s *JStore[T, C]) SortedSlice(less func(i, j T) bool) []T { - vs := make([]T, 0, len(s.store)) - for _, v := range s.store { - vs = append(vs, v...) - } - sort.Slice(vs, func(i, j int) bool { - return less(vs[i], vs[j]) - }) - - return vs -} - -func (s *JStore[T, C]) Each(f func(T) bool) { - for _, e := range s.store { - for _, v := range e { - f(v) - } - } -} - -func (s *JStore[T, C]) Len() int { - return s.len -} - -func (s *JStore[T, C]) Values() []T { - vs := make([]T, 0, len(s.store)) - for _, e := range s.store { - vs = append(vs, e...) - } - return vs -} - -type entry[K, V any] struct { - key K - val V -} - -type JMap[K, V any, C Comparator[K]] struct { - store map[int][]*entry[K, V] - len int - comparator Comparator[K] - stats *JStatRec -} - -func NewJMap[K, V any, C Comparator[K]](comparator Comparator[K], cType CollectionSource, desc string) *JMap[K, V, C] { - m := &JMap[K, V, C]{ - store: make(map[int][]*entry[K, V], 1), - comparator: comparator, - } - if collectStats { - m.stats = &JStatRec{ - Source: cType, - Description: desc, - } - // Track where we created it from if we are being asked to do so - if runtimeConfig.statsTraceStacks { - m.stats.CreateStack = debug.Stack() - } - Statistics.AddJStatRec(m.stats) - } - return m -} - -func (m *JMap[K, V, C]) Put(key K, val V) (V, bool) { - if collectStats { - m.stats.Puts++ - } - kh := m.comparator.Hash1(key) - - var hClash bool - for _, e := range m.store[kh] { - hClash = true - if m.comparator.Equals2(e.key, key) { - if collectStats { - m.stats.PutHits++ - m.stats.PutHashConflicts++ - } - return e.val, true - } - if collectStats { - m.stats.PutMisses++ - } - } - if collectStats { - if hClash { - m.stats.PutHashConflicts++ - } - } - m.store[kh] = append(m.store[kh], &entry[K, V]{key, val}) - if collectStats { - if len(m.store[kh]) > m.stats.MaxSlotSize { - m.stats.MaxSlotSize = len(m.store[kh]) - } - } - m.len++ - if collectStats { - m.stats.CurSize = m.len - if m.len > m.stats.MaxSize { - m.stats.MaxSize = m.len - } - } - return val, false -} - -func (m *JMap[K, V, C]) Values() []V { - vs := make([]V, 0, len(m.store)) - for _, e := range m.store { - for _, v := range e { - vs = append(vs, v.val) - } - } - return vs -} - -func (m *JMap[K, V, C]) Get(key K) (V, bool) { - if collectStats { - m.stats.Gets++ - } - var none V - kh := m.comparator.Hash1(key) - var hClash bool - for _, e := range m.store[kh] { - hClash = true - if m.comparator.Equals2(e.key, key) { - if collectStats { - m.stats.GetHits++ - m.stats.GetHashConflicts++ - } - return e.val, true - } - if collectStats { - m.stats.GetMisses++ - } - } - if collectStats { - if hClash { - m.stats.GetHashConflicts++ - } - m.stats.GetNoEnt++ - } - return none, false -} - -func (m *JMap[K, V, C]) Len() int { - return m.len -} - -func (m *JMap[K, V, C]) Delete(key K) { - kh := m.comparator.Hash1(key) - for i, e := range m.store[kh] { - if m.comparator.Equals2(e.key, key) { - m.store[kh] = append(m.store[kh][:i], m.store[kh][i+1:]...) - m.len-- - return - } - } -} - -func (m *JMap[K, V, C]) Clear() { - m.store = make(map[int][]*entry[K, V]) -} - -type JPCMap struct { - store *JMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]] - size int - stats *JStatRec -} - -func NewJPCMap(cType CollectionSource, desc string) *JPCMap { - m := &JPCMap{ - store: NewJMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]](pContextEqInst, cType, desc), - } - if collectStats { - m.stats = &JStatRec{ - Source: cType, - Description: desc, - } - // Track where we created it from if we are being asked to do so - if runtimeConfig.statsTraceStacks { - m.stats.CreateStack = debug.Stack() - } - Statistics.AddJStatRec(m.stats) - } - return m -} - -func (pcm *JPCMap) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) { - if collectStats { - pcm.stats.Gets++ - } - // Do we have a map stored by k1? - // - m2, present := pcm.store.Get(k1) - if present { - if collectStats { - pcm.stats.GetHits++ - } - // We found a map of values corresponding to k1, so now we need to look up k2 in that map - // - return m2.Get(k2) - } - if collectStats { - pcm.stats.GetMisses++ - } - return nil, false -} - -func (pcm *JPCMap) Put(k1, k2, v *PredictionContext) { - - if collectStats { - pcm.stats.Puts++ - } - // First does a map already exist for k1? - // - if m2, present := pcm.store.Get(k1); present { - if collectStats { - pcm.stats.PutHits++ - } - _, present = m2.Put(k2, v) - if !present { - pcm.size++ - if collectStats { - pcm.stats.CurSize = pcm.size - if pcm.size > pcm.stats.MaxSize { - pcm.stats.MaxSize = pcm.size - } - } - } - } else { - // No map found for k1, so we create it, add in our value, then store is - // - if collectStats { - pcm.stats.PutMisses++ - m2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, pcm.stats.Source, pcm.stats.Description+" map entry") - } else { - m2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, "map entry") - } - - m2.Put(k2, v) - pcm.store.Put(k1, m2) - pcm.size++ - } -} - -type JPCMap2 struct { - store map[int][]JPCEntry - size int - stats *JStatRec -} - -type JPCEntry struct { - k1, k2, v *PredictionContext -} - -func NewJPCMap2(cType CollectionSource, desc string) *JPCMap2 { - m := &JPCMap2{ - store: make(map[int][]JPCEntry, 1000), - } - if collectStats { - m.stats = &JStatRec{ - Source: cType, - Description: desc, - } - // Track where we created it from if we are being asked to do so - if runtimeConfig.statsTraceStacks { - m.stats.CreateStack = debug.Stack() - } - Statistics.AddJStatRec(m.stats) - } - return m -} - -func dHash(k1, k2 *PredictionContext) int { - return k1.cachedHash*31 + k2.cachedHash -} - -func (pcm *JPCMap2) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) { - if collectStats { - pcm.stats.Gets++ - } - - h := dHash(k1, k2) - var hClash bool - for _, e := range pcm.store[h] { - hClash = true - if e.k1.Equals(k1) && e.k2.Equals(k2) { - if collectStats { - pcm.stats.GetHits++ - pcm.stats.GetHashConflicts++ - } - return e.v, true - } - if collectStats { - pcm.stats.GetMisses++ - } - } - if collectStats { - if hClash { - pcm.stats.GetHashConflicts++ - } - pcm.stats.GetNoEnt++ - } - return nil, false -} - -func (pcm *JPCMap2) Put(k1, k2, v *PredictionContext) (*PredictionContext, bool) { - if collectStats { - pcm.stats.Puts++ - } - h := dHash(k1, k2) - var hClash bool - for _, e := range pcm.store[h] { - hClash = true - if e.k1.Equals(k1) && e.k2.Equals(k2) { - if collectStats { - pcm.stats.PutHits++ - pcm.stats.PutHashConflicts++ - } - return e.v, true - } - if collectStats { - pcm.stats.PutMisses++ - } - } - if collectStats { - if hClash { - pcm.stats.PutHashConflicts++ - } - } - pcm.store[h] = append(pcm.store[h], JPCEntry{k1, k2, v}) - pcm.size++ - if collectStats { - pcm.stats.CurSize = pcm.size - if pcm.size > pcm.stats.MaxSize { - pcm.stats.MaxSize = pcm.size - } - } - return nil, false -} - -type VisitEntry struct { - k *PredictionContext - v *PredictionContext -} -type VisitRecord struct { - store map[*PredictionContext]*PredictionContext - len int - stats *JStatRec -} - -type VisitList struct { - cache *list.List - lock sync.RWMutex -} - -var visitListPool = VisitList{ - cache: list.New(), - lock: sync.RWMutex{}, -} - -// NewVisitRecord returns a new VisitRecord instance from the pool if available. -// Note that this "map" uses a pointer as a key because we are emulating the behavior of -// IdentityHashMap in Java, which uses the `==` operator to compare whether the keys are equal, -// which means is the key the same reference to an object rather than is it .equals() to another -// object. -func NewVisitRecord() *VisitRecord { - visitListPool.lock.Lock() - el := visitListPool.cache.Front() - defer visitListPool.lock.Unlock() - var vr *VisitRecord - if el == nil { - vr = &VisitRecord{ - store: make(map[*PredictionContext]*PredictionContext), - } - if collectStats { - vr.stats = &JStatRec{ - Source: PredictionContextCacheCollection, - Description: "VisitRecord", - } - // Track where we created it from if we are being asked to do so - if runtimeConfig.statsTraceStacks { - vr.stats.CreateStack = debug.Stack() - } - } - } else { - vr = el.Value.(*VisitRecord) - visitListPool.cache.Remove(el) - vr.store = make(map[*PredictionContext]*PredictionContext) - } - if collectStats { - Statistics.AddJStatRec(vr.stats) - } - return vr -} - -func (vr *VisitRecord) Release() { - vr.len = 0 - vr.store = nil - if collectStats { - vr.stats.MaxSize = 0 - vr.stats.CurSize = 0 - vr.stats.Gets = 0 - vr.stats.GetHits = 0 - vr.stats.GetMisses = 0 - vr.stats.GetHashConflicts = 0 - vr.stats.GetNoEnt = 0 - vr.stats.Puts = 0 - vr.stats.PutHits = 0 - vr.stats.PutMisses = 0 - vr.stats.PutHashConflicts = 0 - vr.stats.MaxSlotSize = 0 - } - visitListPool.lock.Lock() - visitListPool.cache.PushBack(vr) - visitListPool.lock.Unlock() -} - -func (vr *VisitRecord) Get(k *PredictionContext) (*PredictionContext, bool) { - if collectStats { - vr.stats.Gets++ - } - v := vr.store[k] - if v != nil { - if collectStats { - vr.stats.GetHits++ - } - return v, true - } - if collectStats { - vr.stats.GetNoEnt++ - } - return nil, false -} - -func (vr *VisitRecord) Put(k, v *PredictionContext) (*PredictionContext, bool) { - if collectStats { - vr.stats.Puts++ - } - vr.store[k] = v - vr.len++ - if collectStats { - vr.stats.CurSize = vr.len - if vr.len > vr.stats.MaxSize { - vr.stats.MaxSize = vr.len - } - } - return v, false -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/lexer.go b/vendor/github.com/antlr4-go/antlr/v4/lexer.go deleted file mode 100644 index 3c7896a91..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/lexer.go +++ /dev/null @@ -1,426 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" -) - -// A lexer is recognizer that draws input symbols from a character stream. -// lexer grammars result in a subclass of this object. A Lexer object -// uses simplified Match() and error recovery mechanisms in the interest -// of speed. -/// - -type Lexer interface { - TokenSource - Recognizer - - Emit() Token - - SetChannel(int) - PushMode(int) - PopMode() int - SetType(int) - SetMode(int) -} - -type BaseLexer struct { - *BaseRecognizer - - Interpreter ILexerATNSimulator - TokenStartCharIndex int - TokenStartLine int - TokenStartColumn int - ActionType int - Virt Lexer // The most derived lexer implementation. Allows virtual method calls. - - input CharStream - factory TokenFactory - tokenFactorySourcePair *TokenSourceCharStreamPair - token Token - hitEOF bool - channel int - thetype int - modeStack IntStack - mode int - text string -} - -func NewBaseLexer(input CharStream) *BaseLexer { - - lexer := new(BaseLexer) - - lexer.BaseRecognizer = NewBaseRecognizer() - - lexer.input = input - lexer.factory = CommonTokenFactoryDEFAULT - lexer.tokenFactorySourcePair = &TokenSourceCharStreamPair{lexer, input} - - lexer.Virt = lexer - - lexer.Interpreter = nil // child classes must populate it - - // The goal of all lexer rules/methods is to create a token object. - // l is an instance variable as multiple rules may collaborate to - // create a single token. NextToken will return l object after - // Matching lexer rule(s). If you subclass to allow multiple token - // emissions, then set l to the last token to be Matched or - // something non nil so that the auto token emit mechanism will not - // emit another token. - lexer.token = nil - - // What character index in the stream did the current token start at? - // Needed, for example, to get the text for current token. Set at - // the start of NextToken. - lexer.TokenStartCharIndex = -1 - - // The line on which the first character of the token resides/// - lexer.TokenStartLine = -1 - - // The character position of first character within the line/// - lexer.TokenStartColumn = -1 - - // Once we see EOF on char stream, next token will be EOF. - // If you have DONE : EOF then you see DONE EOF. - lexer.hitEOF = false - - // The channel number for the current token/// - lexer.channel = TokenDefaultChannel - - // The token type for the current token/// - lexer.thetype = TokenInvalidType - - lexer.modeStack = make([]int, 0) - lexer.mode = LexerDefaultMode - - // You can set the text for the current token to override what is in - // the input char buffer. Use setText() or can set l instance var. - // / - lexer.text = "" - - return lexer -} - -const ( - LexerDefaultMode = 0 - LexerMore = -2 - LexerSkip = -3 -) - -//goland:noinspection GoUnusedConst -const ( - LexerDefaultTokenChannel = TokenDefaultChannel - LexerHidden = TokenHiddenChannel - LexerMinCharValue = 0x0000 - LexerMaxCharValue = 0x10FFFF -) - -func (b *BaseLexer) Reset() { - // wack Lexer state variables - if b.input != nil { - b.input.Seek(0) // rewind the input - } - b.token = nil - b.thetype = TokenInvalidType - b.channel = TokenDefaultChannel - b.TokenStartCharIndex = -1 - b.TokenStartColumn = -1 - b.TokenStartLine = -1 - b.text = "" - - b.hitEOF = false - b.mode = LexerDefaultMode - b.modeStack = make([]int, 0) - - b.Interpreter.reset() -} - -func (b *BaseLexer) GetInterpreter() ILexerATNSimulator { - return b.Interpreter -} - -func (b *BaseLexer) GetInputStream() CharStream { - return b.input -} - -func (b *BaseLexer) GetSourceName() string { - return b.GrammarFileName -} - -func (b *BaseLexer) SetChannel(v int) { - b.channel = v -} - -func (b *BaseLexer) GetTokenFactory() TokenFactory { - return b.factory -} - -func (b *BaseLexer) setTokenFactory(f TokenFactory) { - b.factory = f -} - -func (b *BaseLexer) safeMatch() (ret int) { - defer func() { - if e := recover(); e != nil { - if re, ok := e.(RecognitionException); ok { - b.notifyListeners(re) // Report error - b.Recover(re) - ret = LexerSkip // default - } - } - }() - - return b.Interpreter.Match(b.input, b.mode) -} - -// NextToken returns a token from the lexer input source i.e., Match a token on the source char stream. -func (b *BaseLexer) NextToken() Token { - if b.input == nil { - panic("NextToken requires a non-nil input stream.") - } - - tokenStartMarker := b.input.Mark() - - // previously in finally block - defer func() { - // make sure we release marker after Match or - // unbuffered char stream will keep buffering - b.input.Release(tokenStartMarker) - }() - - for { - if b.hitEOF { - b.EmitEOF() - return b.token - } - b.token = nil - b.channel = TokenDefaultChannel - b.TokenStartCharIndex = b.input.Index() - b.TokenStartColumn = b.Interpreter.GetCharPositionInLine() - b.TokenStartLine = b.Interpreter.GetLine() - b.text = "" - continueOuter := false - for { - b.thetype = TokenInvalidType - - ttype := b.safeMatch() - - if b.input.LA(1) == TokenEOF { - b.hitEOF = true - } - if b.thetype == TokenInvalidType { - b.thetype = ttype - } - if b.thetype == LexerSkip { - continueOuter = true - break - } - if b.thetype != LexerMore { - break - } - } - - if continueOuter { - continue - } - if b.token == nil { - b.Virt.Emit() - } - return b.token - } -} - -// Skip instructs the lexer to Skip creating a token for current lexer rule -// and look for another token. [NextToken] knows to keep looking when -// a lexer rule finishes with token set to [SKIPTOKEN]. Recall that -// if token==nil at end of any token rule, it creates one for you -// and emits it. -func (b *BaseLexer) Skip() { - b.thetype = LexerSkip -} - -func (b *BaseLexer) More() { - b.thetype = LexerMore -} - -// SetMode changes the lexer to a new mode. The lexer will use this mode from hereon in and the rules for that mode -// will be in force. -func (b *BaseLexer) SetMode(m int) { - b.mode = m -} - -// PushMode saves the current lexer mode so that it can be restored later. See [PopMode], then sets the -// current lexer mode to the supplied mode m. -func (b *BaseLexer) PushMode(m int) { - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("pushMode " + strconv.Itoa(m)) - } - b.modeStack.Push(b.mode) - b.mode = m -} - -// PopMode restores the lexer mode saved by a call to [PushMode]. It is a panic error if there is no saved mode to -// return to. -func (b *BaseLexer) PopMode() int { - if len(b.modeStack) == 0 { - panic("Empty Stack") - } - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("popMode back to " + fmt.Sprint(b.modeStack[0:len(b.modeStack)-1])) - } - i, _ := b.modeStack.Pop() - b.mode = i - return b.mode -} - -func (b *BaseLexer) inputStream() CharStream { - return b.input -} - -// SetInputStream resets the lexer input stream and associated lexer state. -func (b *BaseLexer) SetInputStream(input CharStream) { - b.input = nil - b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input} - b.Reset() - b.input = input - b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input} -} - -func (b *BaseLexer) GetTokenSourceCharStreamPair() *TokenSourceCharStreamPair { - return b.tokenFactorySourcePair -} - -// EmitToken by default does not support multiple emits per [NextToken] invocation -// for efficiency reasons. Subclass and override this func, [NextToken], -// and [GetToken] (to push tokens into a list and pull from that list -// rather than a single variable as this implementation does). -func (b *BaseLexer) EmitToken(token Token) { - b.token = token -} - -// Emit is the standard method called to automatically emit a token at the -// outermost lexical rule. The token object should point into the -// char buffer start..stop. If there is a text override in 'text', -// use that to set the token's text. Override this method to emit -// custom [Token] objects or provide a new factory. -// / -func (b *BaseLexer) Emit() Token { - t := b.factory.Create(b.tokenFactorySourcePair, b.thetype, b.text, b.channel, b.TokenStartCharIndex, b.GetCharIndex()-1, b.TokenStartLine, b.TokenStartColumn) - b.EmitToken(t) - return t -} - -// EmitEOF emits an EOF token. By default, this is the last token emitted -func (b *BaseLexer) EmitEOF() Token { - cpos := b.GetCharPositionInLine() - lpos := b.GetLine() - eof := b.factory.Create(b.tokenFactorySourcePair, TokenEOF, "", TokenDefaultChannel, b.input.Index(), b.input.Index()-1, lpos, cpos) - b.EmitToken(eof) - return eof -} - -// GetCharPositionInLine returns the current position in the current line as far as the lexer is concerned. -func (b *BaseLexer) GetCharPositionInLine() int { - return b.Interpreter.GetCharPositionInLine() -} - -func (b *BaseLexer) GetLine() int { - return b.Interpreter.GetLine() -} - -func (b *BaseLexer) GetType() int { - return b.thetype -} - -func (b *BaseLexer) SetType(t int) { - b.thetype = t -} - -// GetCharIndex returns the index of the current character of lookahead -func (b *BaseLexer) GetCharIndex() int { - return b.input.Index() -} - -// GetText returns the text Matched so far for the current token or any text override. -func (b *BaseLexer) GetText() string { - if b.text != "" { - return b.text - } - - return b.Interpreter.GetText(b.input) -} - -// SetText sets the complete text of this token; it wipes any previous changes to the text. -func (b *BaseLexer) SetText(text string) { - b.text = text -} - -// GetATN returns the ATN used by the lexer. -func (b *BaseLexer) GetATN() *ATN { - return b.Interpreter.ATN() -} - -// GetAllTokens returns a list of all [Token] objects in input char stream. -// Forces a load of all tokens that can be made from the input char stream. -// -// Does not include EOF token. -func (b *BaseLexer) GetAllTokens() []Token { - vl := b.Virt - tokens := make([]Token, 0) - t := vl.NextToken() - for t.GetTokenType() != TokenEOF { - tokens = append(tokens, t) - t = vl.NextToken() - } - return tokens -} - -func (b *BaseLexer) notifyListeners(e RecognitionException) { - start := b.TokenStartCharIndex - stop := b.input.Index() - text := b.input.GetTextFromInterval(NewInterval(start, stop)) - msg := "token recognition error at: '" + text + "'" - listener := b.GetErrorListenerDispatch() - listener.SyntaxError(b, nil, b.TokenStartLine, b.TokenStartColumn, msg, e) -} - -func (b *BaseLexer) getErrorDisplayForChar(c rune) string { - if c == TokenEOF { - return "" - } else if c == '\n' { - return "\\n" - } else if c == '\t' { - return "\\t" - } else if c == '\r' { - return "\\r" - } else { - return string(c) - } -} - -func (b *BaseLexer) getCharErrorDisplay(c rune) string { - return "'" + b.getErrorDisplayForChar(c) + "'" -} - -// Recover can normally Match any char in its vocabulary after Matching -// a token, so here we do the easy thing and just kill a character and hope -// it all works out. You can instead use the rule invocation stack -// to do sophisticated error recovery if you are in a fragment rule. -// -// In general, lexers should not need to recover and should have rules that cover any eventuality, such as -// a character that makes no sense to the recognizer. -func (b *BaseLexer) Recover(re RecognitionException) { - if b.input.LA(1) != TokenEOF { - if _, ok := re.(*LexerNoViableAltException); ok { - // Skip a char and try again - b.Interpreter.Consume(b.input) - } else { - // TODO: Do we lose character or line position information? - b.input.Consume() - } - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/lexer_action.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_action.go deleted file mode 100644 index eaa7393e0..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/lexer_action.go +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "strconv" - -const ( - // LexerActionTypeChannel represents a [LexerChannelAction] action. - LexerActionTypeChannel = 0 - - // LexerActionTypeCustom represents a [LexerCustomAction] action. - LexerActionTypeCustom = 1 - - // LexerActionTypeMode represents a [LexerModeAction] action. - LexerActionTypeMode = 2 - - // LexerActionTypeMore represents a [LexerMoreAction] action. - LexerActionTypeMore = 3 - - // LexerActionTypePopMode represents a [LexerPopModeAction] action. - LexerActionTypePopMode = 4 - - // LexerActionTypePushMode represents a [LexerPushModeAction] action. - LexerActionTypePushMode = 5 - - // LexerActionTypeSkip represents a [LexerSkipAction] action. - LexerActionTypeSkip = 6 - - // LexerActionTypeType represents a [LexerTypeAction] action. - LexerActionTypeType = 7 -) - -type LexerAction interface { - getActionType() int - getIsPositionDependent() bool - execute(lexer Lexer) - Hash() int - Equals(other LexerAction) bool -} - -type BaseLexerAction struct { - actionType int - isPositionDependent bool -} - -func NewBaseLexerAction(action int) *BaseLexerAction { - la := new(BaseLexerAction) - - la.actionType = action - la.isPositionDependent = false - - return la -} - -func (b *BaseLexerAction) execute(_ Lexer) { - panic("Not implemented") -} - -func (b *BaseLexerAction) getActionType() int { - return b.actionType -} - -func (b *BaseLexerAction) getIsPositionDependent() bool { - return b.isPositionDependent -} - -func (b *BaseLexerAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, b.actionType) - return murmurFinish(h, 1) -} - -func (b *BaseLexerAction) Equals(other LexerAction) bool { - return b.actionType == other.getActionType() -} - -// LexerSkipAction implements the [BaseLexerAction.Skip] lexer action by calling [Lexer.Skip]. -// -// The Skip command does not have any parameters, so this action is -// implemented as a singleton instance exposed by the [LexerSkipActionINSTANCE]. -type LexerSkipAction struct { - *BaseLexerAction -} - -func NewLexerSkipAction() *LexerSkipAction { - la := new(LexerSkipAction) - la.BaseLexerAction = NewBaseLexerAction(LexerActionTypeSkip) - return la -} - -// LexerSkipActionINSTANCE provides a singleton instance of this parameterless lexer action. -var LexerSkipActionINSTANCE = NewLexerSkipAction() - -func (l *LexerSkipAction) execute(lexer Lexer) { - lexer.Skip() -} - -// String returns a string representation of the current [LexerSkipAction]. -func (l *LexerSkipAction) String() string { - return "skip" -} - -func (b *LexerSkipAction) Equals(other LexerAction) bool { - return other.getActionType() == LexerActionTypeSkip -} - -// Implements the {@code type} lexer action by calling {@link Lexer//setType} -// -// with the assigned type. -type LexerTypeAction struct { - *BaseLexerAction - - thetype int -} - -func NewLexerTypeAction(thetype int) *LexerTypeAction { - l := new(LexerTypeAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeType) - l.thetype = thetype - return l -} - -func (l *LexerTypeAction) execute(lexer Lexer) { - lexer.SetType(l.thetype) -} - -func (l *LexerTypeAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.actionType) - h = murmurUpdate(h, l.thetype) - return murmurFinish(h, 2) -} - -func (l *LexerTypeAction) Equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerTypeAction); !ok { - return false - } else { - return l.thetype == other.(*LexerTypeAction).thetype - } -} - -func (l *LexerTypeAction) String() string { - return "actionType(" + strconv.Itoa(l.thetype) + ")" -} - -// LexerPushModeAction implements the pushMode lexer action by calling -// [Lexer.pushMode] with the assigned mode. -type LexerPushModeAction struct { - *BaseLexerAction - mode int -} - -func NewLexerPushModeAction(mode int) *LexerPushModeAction { - - l := new(LexerPushModeAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypePushMode) - - l.mode = mode - return l -} - -//

This action is implemented by calling {@link Lexer//pushMode} with the -// value provided by {@link //getMode}.

-func (l *LexerPushModeAction) execute(lexer Lexer) { - lexer.PushMode(l.mode) -} - -func (l *LexerPushModeAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.actionType) - h = murmurUpdate(h, l.mode) - return murmurFinish(h, 2) -} - -func (l *LexerPushModeAction) Equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerPushModeAction); !ok { - return false - } else { - return l.mode == other.(*LexerPushModeAction).mode - } -} - -func (l *LexerPushModeAction) String() string { - return "pushMode(" + strconv.Itoa(l.mode) + ")" -} - -// LexerPopModeAction implements the popMode lexer action by calling [Lexer.popMode]. -// -// The popMode command does not have any parameters, so this action is -// implemented as a singleton instance exposed by [LexerPopModeActionINSTANCE] -type LexerPopModeAction struct { - *BaseLexerAction -} - -func NewLexerPopModeAction() *LexerPopModeAction { - - l := new(LexerPopModeAction) - - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypePopMode) - - return l -} - -var LexerPopModeActionINSTANCE = NewLexerPopModeAction() - -//

This action is implemented by calling {@link Lexer//popMode}.

-func (l *LexerPopModeAction) execute(lexer Lexer) { - lexer.PopMode() -} - -func (l *LexerPopModeAction) String() string { - return "popMode" -} - -// Implements the {@code more} lexer action by calling {@link Lexer//more}. -// -//

The {@code more} command does not have any parameters, so l action is -// implemented as a singleton instance exposed by {@link //INSTANCE}.

- -type LexerMoreAction struct { - *BaseLexerAction -} - -func NewLexerMoreAction() *LexerMoreAction { - l := new(LexerMoreAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeMore) - - return l -} - -var LexerMoreActionINSTANCE = NewLexerMoreAction() - -//

This action is implemented by calling {@link Lexer//popMode}.

-func (l *LexerMoreAction) execute(lexer Lexer) { - lexer.More() -} - -func (l *LexerMoreAction) String() string { - return "more" -} - -// LexerModeAction implements the mode lexer action by calling [Lexer.mode] with -// the assigned mode. -type LexerModeAction struct { - *BaseLexerAction - mode int -} - -func NewLexerModeAction(mode int) *LexerModeAction { - l := new(LexerModeAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeMode) - l.mode = mode - return l -} - -//

This action is implemented by calling {@link Lexer//mode} with the -// value provided by {@link //getMode}.

-func (l *LexerModeAction) execute(lexer Lexer) { - lexer.SetMode(l.mode) -} - -func (l *LexerModeAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.actionType) - h = murmurUpdate(h, l.mode) - return murmurFinish(h, 2) -} - -func (l *LexerModeAction) Equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerModeAction); !ok { - return false - } else { - return l.mode == other.(*LexerModeAction).mode - } -} - -func (l *LexerModeAction) String() string { - return "mode(" + strconv.Itoa(l.mode) + ")" -} - -// Executes a custom lexer action by calling {@link Recognizer//action} with the -// rule and action indexes assigned to the custom action. The implementation of -// a custom action is added to the generated code for the lexer in an override -// of {@link Recognizer//action} when the grammar is compiled. -// -//

This class may represent embedded actions created with the {...} -// syntax in ANTLR 4, as well as actions created for lexer commands where the -// command argument could not be evaluated when the grammar was compiled.

- -// Constructs a custom lexer action with the specified rule and action -// indexes. -// -// @param ruleIndex The rule index to use for calls to -// {@link Recognizer//action}. -// @param actionIndex The action index to use for calls to -// {@link Recognizer//action}. - -type LexerCustomAction struct { - *BaseLexerAction - ruleIndex, actionIndex int -} - -func NewLexerCustomAction(ruleIndex, actionIndex int) *LexerCustomAction { - l := new(LexerCustomAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeCustom) - l.ruleIndex = ruleIndex - l.actionIndex = actionIndex - l.isPositionDependent = true - return l -} - -//

Custom actions are implemented by calling {@link Lexer//action} with the -// appropriate rule and action indexes.

-func (l *LexerCustomAction) execute(lexer Lexer) { - lexer.Action(nil, l.ruleIndex, l.actionIndex) -} - -func (l *LexerCustomAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.actionType) - h = murmurUpdate(h, l.ruleIndex) - h = murmurUpdate(h, l.actionIndex) - return murmurFinish(h, 3) -} - -func (l *LexerCustomAction) Equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerCustomAction); !ok { - return false - } else { - return l.ruleIndex == other.(*LexerCustomAction).ruleIndex && - l.actionIndex == other.(*LexerCustomAction).actionIndex - } -} - -// LexerChannelAction implements the channel lexer action by calling -// [Lexer.setChannel] with the assigned channel. -// -// Constructs a new channel action with the specified channel value. -type LexerChannelAction struct { - *BaseLexerAction - channel int -} - -// NewLexerChannelAction creates a channel lexer action by calling -// [Lexer.setChannel] with the assigned channel. -// -// Constructs a new channel action with the specified channel value. -func NewLexerChannelAction(channel int) *LexerChannelAction { - l := new(LexerChannelAction) - l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeChannel) - l.channel = channel - return l -} - -//

This action is implemented by calling {@link Lexer//setChannel} with the -// value provided by {@link //getChannel}.

-func (l *LexerChannelAction) execute(lexer Lexer) { - lexer.SetChannel(l.channel) -} - -func (l *LexerChannelAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.actionType) - h = murmurUpdate(h, l.channel) - return murmurFinish(h, 2) -} - -func (l *LexerChannelAction) Equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerChannelAction); !ok { - return false - } else { - return l.channel == other.(*LexerChannelAction).channel - } -} - -func (l *LexerChannelAction) String() string { - return "channel(" + strconv.Itoa(l.channel) + ")" -} - -// This implementation of {@link LexerAction} is used for tracking input offsets -// for position-dependent actions within a {@link LexerActionExecutor}. -// -//

This action is not serialized as part of the ATN, and is only required for -// position-dependent lexer actions which appear at a location other than the -// end of a rule. For more information about DFA optimizations employed for -// lexer actions, see {@link LexerActionExecutor//append} and -// {@link LexerActionExecutor//fixOffsetBeforeMatch}.

- -type LexerIndexedCustomAction struct { - *BaseLexerAction - offset int - lexerAction LexerAction - isPositionDependent bool -} - -// NewLexerIndexedCustomAction constructs a new indexed custom action by associating a character offset -// with a [LexerAction]. -// -// Note: This class is only required for lexer actions for which -// [LexerAction.isPositionDependent] returns true. -// -// The offset points into the input [CharStream], relative to -// the token start index, at which the specified lexerAction should be -// executed. -func NewLexerIndexedCustomAction(offset int, lexerAction LexerAction) *LexerIndexedCustomAction { - - l := new(LexerIndexedCustomAction) - l.BaseLexerAction = NewBaseLexerAction(lexerAction.getActionType()) - - l.offset = offset - l.lexerAction = lexerAction - l.isPositionDependent = true - - return l -} - -//

This method calls {@link //execute} on the result of {@link //getAction} -// using the provided {@code lexer}.

-func (l *LexerIndexedCustomAction) execute(lexer Lexer) { - // assume the input stream position was properly set by the calling code - l.lexerAction.execute(lexer) -} - -func (l *LexerIndexedCustomAction) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, l.offset) - h = murmurUpdate(h, l.lexerAction.Hash()) - return murmurFinish(h, 2) -} - -func (l *LexerIndexedCustomAction) equals(other LexerAction) bool { - if l == other { - return true - } else if _, ok := other.(*LexerIndexedCustomAction); !ok { - return false - } else { - return l.offset == other.(*LexerIndexedCustomAction).offset && - l.lexerAction.Equals(other.(*LexerIndexedCustomAction).lexerAction) - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go deleted file mode 100644 index dfc28c32b..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "golang.org/x/exp/slices" - -// Represents an executor for a sequence of lexer actions which traversed during -// the Matching operation of a lexer rule (token). -// -//

The executor tracks position information for position-dependent lexer actions -// efficiently, ensuring that actions appearing only at the end of the rule do -// not cause bloating of the {@link DFA} created for the lexer.

- -type LexerActionExecutor struct { - lexerActions []LexerAction - cachedHash int -} - -func NewLexerActionExecutor(lexerActions []LexerAction) *LexerActionExecutor { - - if lexerActions == nil { - lexerActions = make([]LexerAction, 0) - } - - l := new(LexerActionExecutor) - - l.lexerActions = lexerActions - - // Caches the result of {@link //hashCode} since the hash code is an element - // of the performance-critical {@link ATNConfig//hashCode} operation. - l.cachedHash = murmurInit(0) - for _, a := range lexerActions { - l.cachedHash = murmurUpdate(l.cachedHash, a.Hash()) - } - l.cachedHash = murmurFinish(l.cachedHash, len(lexerActions)) - - return l -} - -// LexerActionExecutorappend creates a [LexerActionExecutor] which executes the actions for -// the input [LexerActionExecutor] followed by a specified -// [LexerAction]. -// TODO: This does not match the Java code -func LexerActionExecutorappend(lexerActionExecutor *LexerActionExecutor, lexerAction LexerAction) *LexerActionExecutor { - if lexerActionExecutor == nil { - return NewLexerActionExecutor([]LexerAction{lexerAction}) - } - - return NewLexerActionExecutor(append(lexerActionExecutor.lexerActions, lexerAction)) -} - -// fixOffsetBeforeMatch creates a [LexerActionExecutor] which encodes the current offset -// for position-dependent lexer actions. -// -// Normally, when the executor encounters lexer actions where -// [LexerAction.isPositionDependent] returns true, it calls -// [IntStream.Seek] on the input [CharStream] to set the input -// position to the end of the current token. This behavior provides -// for efficient [DFA] representation of lexer actions which appear at the end -// of a lexer rule, even when the lexer rule Matches a variable number of -// characters. -// -// Prior to traversing a Match transition in the [ATN], the current offset -// from the token start index is assigned to all position-dependent lexer -// actions which have not already been assigned a fixed offset. By storing -// the offsets relative to the token start index, the [DFA] representation of -// lexer actions which appear in the middle of tokens remains efficient due -// to sharing among tokens of the same Length, regardless of their absolute -// position in the input stream. -// -// If the current executor already has offsets assigned to all -// position-dependent lexer actions, the method returns this instance. -// -// The offset is assigned to all position-dependent -// lexer actions which do not already have offsets assigned. -// -// The func returns a [LexerActionExecutor] that stores input stream offsets -// for all position-dependent lexer actions. -func (l *LexerActionExecutor) fixOffsetBeforeMatch(offset int) *LexerActionExecutor { - var updatedLexerActions []LexerAction - for i := 0; i < len(l.lexerActions); i++ { - _, ok := l.lexerActions[i].(*LexerIndexedCustomAction) - if l.lexerActions[i].getIsPositionDependent() && !ok { - if updatedLexerActions == nil { - updatedLexerActions = make([]LexerAction, 0, len(l.lexerActions)) - updatedLexerActions = append(updatedLexerActions, l.lexerActions...) - } - updatedLexerActions[i] = NewLexerIndexedCustomAction(offset, l.lexerActions[i]) - } - } - if updatedLexerActions == nil { - return l - } - - return NewLexerActionExecutor(updatedLexerActions) -} - -// Execute the actions encapsulated by l executor within the context of a -// particular {@link Lexer}. -// -//

This method calls {@link IntStream//seek} to set the position of the -// {@code input} {@link CharStream} prior to calling -// {@link LexerAction//execute} on a position-dependent action. Before the -// method returns, the input position will be restored to the same position -// it was in when the method was invoked.

-// -// @param lexer The lexer instance. -// @param input The input stream which is the source for the current token. -// When l method is called, the current {@link IntStream//index} for -// {@code input} should be the start of the following token, i.e. 1 -// character past the end of the current token. -// @param startIndex The token start index. This value may be passed to -// {@link IntStream//seek} to set the {@code input} position to the beginning -// of the token. -// / -func (l *LexerActionExecutor) execute(lexer Lexer, input CharStream, startIndex int) { - requiresSeek := false - stopIndex := input.Index() - - defer func() { - if requiresSeek { - input.Seek(stopIndex) - } - }() - - for i := 0; i < len(l.lexerActions); i++ { - lexerAction := l.lexerActions[i] - if la, ok := lexerAction.(*LexerIndexedCustomAction); ok { - offset := la.offset - input.Seek(startIndex + offset) - lexerAction = la.lexerAction - requiresSeek = (startIndex + offset) != stopIndex - } else if lexerAction.getIsPositionDependent() { - input.Seek(stopIndex) - requiresSeek = false - } - lexerAction.execute(lexer) - } -} - -func (l *LexerActionExecutor) Hash() int { - if l == nil { - // TODO: Why is this here? l should not be nil - return 61 - } - - // TODO: This is created from the action itself when the struct is created - will this be an issue at some point? Java uses the runtime assign hashcode - return l.cachedHash -} - -func (l *LexerActionExecutor) Equals(other interface{}) bool { - if l == other { - return true - } - othert, ok := other.(*LexerActionExecutor) - if !ok { - return false - } - if othert == nil { - return false - } - if l.cachedHash != othert.cachedHash { - return false - } - if len(l.lexerActions) != len(othert.lexerActions) { - return false - } - return slices.EqualFunc(l.lexerActions, othert.lexerActions, func(i, j LexerAction) bool { - return i.Equals(j) - }) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go deleted file mode 100644 index fe938b025..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go +++ /dev/null @@ -1,677 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" - "strings" -) - -//goland:noinspection GoUnusedGlobalVariable -var ( - LexerATNSimulatorMinDFAEdge = 0 - LexerATNSimulatorMaxDFAEdge = 127 // forces unicode to stay in ATN - - LexerATNSimulatorMatchCalls = 0 -) - -type ILexerATNSimulator interface { - IATNSimulator - - reset() - Match(input CharStream, mode int) int - GetCharPositionInLine() int - GetLine() int - GetText(input CharStream) string - Consume(input CharStream) -} - -type LexerATNSimulator struct { - BaseATNSimulator - - recog Lexer - predictionMode int - mergeCache *JPCMap2 - startIndex int - Line int - CharPositionInLine int - mode int - prevAccept *SimState - MatchCalls int -} - -func NewLexerATNSimulator(recog Lexer, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *LexerATNSimulator { - l := &LexerATNSimulator{ - BaseATNSimulator: BaseATNSimulator{ - atn: atn, - sharedContextCache: sharedContextCache, - }, - } - - l.decisionToDFA = decisionToDFA - l.recog = recog - - // The current token's starting index into the character stream. - // Shared across DFA to ATN simulation in case the ATN fails and the - // DFA did not have a previous accept state. In l case, we use the - // ATN-generated exception object. - l.startIndex = -1 - - // line number 1..n within the input - l.Line = 1 - - // The index of the character relative to the beginning of the line - // 0..n-1 - l.CharPositionInLine = 0 - - l.mode = LexerDefaultMode - - // Used during DFA/ATN exec to record the most recent accept configuration - // info - l.prevAccept = NewSimState() - - return l -} - -func (l *LexerATNSimulator) copyState(simulator *LexerATNSimulator) { - l.CharPositionInLine = simulator.CharPositionInLine - l.Line = simulator.Line - l.mode = simulator.mode - l.startIndex = simulator.startIndex -} - -func (l *LexerATNSimulator) Match(input CharStream, mode int) int { - l.MatchCalls++ - l.mode = mode - mark := input.Mark() - - defer func() { - input.Release(mark) - }() - - l.startIndex = input.Index() - l.prevAccept.reset() - - dfa := l.decisionToDFA[mode] - - var s0 *DFAState - l.atn.stateMu.RLock() - s0 = dfa.getS0() - l.atn.stateMu.RUnlock() - - if s0 == nil { - return l.MatchATN(input) - } - - return l.execATN(input, s0) -} - -func (l *LexerATNSimulator) reset() { - l.prevAccept.reset() - l.startIndex = -1 - l.Line = 1 - l.CharPositionInLine = 0 - l.mode = LexerDefaultMode -} - -func (l *LexerATNSimulator) MatchATN(input CharStream) int { - startState := l.atn.modeToStartState[l.mode] - - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("MatchATN mode " + strconv.Itoa(l.mode) + " start: " + startState.String()) - } - oldMode := l.mode - s0Closure := l.computeStartState(input, startState) - suppressEdge := s0Closure.hasSemanticContext - s0Closure.hasSemanticContext = false - - next := l.addDFAState(s0Closure, suppressEdge) - - predict := l.execATN(input, next) - - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("DFA after MatchATN: " + l.decisionToDFA[oldMode].ToLexerString()) - } - return predict -} - -func (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int { - - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("start state closure=" + ds0.configs.String()) - } - if ds0.isAcceptState { - // allow zero-Length tokens - l.captureSimState(l.prevAccept, input, ds0) - } - t := input.LA(1) - s := ds0 // s is current/from DFA state - - for { // while more work - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("execATN loop starting closure: " + s.configs.String()) - } - - // As we move src->trg, src->trg, we keep track of the previous trg to - // avoid looking up the DFA state again, which is expensive. - // If the previous target was already part of the DFA, we might - // be able to avoid doing a reach operation upon t. If s!=nil, - // it means that semantic predicates didn't prevent us from - // creating a DFA state. Once we know s!=nil, we check to see if - // the DFA state has an edge already for t. If so, we can just reuse - // it's configuration set there's no point in re-computing it. - // This is kind of like doing DFA simulation within the ATN - // simulation because DFA simulation is really just a way to avoid - // computing reach/closure sets. Technically, once we know that - // we have a previously added DFA state, we could jump over to - // the DFA simulator. But, that would mean popping back and forth - // a lot and making things more complicated algorithmically. - // This optimization makes a lot of sense for loops within DFA. - // A character will take us back to an existing DFA state - // that already has lots of edges out of it. e.g., .* in comments. - target := l.getExistingTargetState(s, t) - if target == nil { - target = l.computeTargetState(input, s, t) - // print("Computed:" + str(target)) - } - if target == ATNSimulatorError { - break - } - // If l is a consumable input element, make sure to consume before - // capturing the accept state so the input index, line, and char - // position accurately reflect the state of the interpreter at the - // end of the token. - if t != TokenEOF { - l.Consume(input) - } - if target.isAcceptState { - l.captureSimState(l.prevAccept, input, target) - if t == TokenEOF { - break - } - } - t = input.LA(1) - s = target // flip current DFA target becomes new src/from state - } - - return l.failOrAccept(l.prevAccept, input, s.configs, t) -} - -// Get an existing target state for an edge in the DFA. If the target state -// for the edge has not yet been computed or is otherwise not available, -// l method returns {@code nil}. -// -// @param s The current DFA state -// @param t The next input symbol -// @return The existing target DFA state for the given input symbol -// {@code t}, or {@code nil} if the target state for l edge is not -// already cached -func (l *LexerATNSimulator) getExistingTargetState(s *DFAState, t int) *DFAState { - if t < LexerATNSimulatorMinDFAEdge || t > LexerATNSimulatorMaxDFAEdge { - return nil - } - - l.atn.edgeMu.RLock() - defer l.atn.edgeMu.RUnlock() - if s.getEdges() == nil { - return nil - } - target := s.getIthEdge(t - LexerATNSimulatorMinDFAEdge) - if runtimeConfig.lexerATNSimulatorDebug && target != nil { - fmt.Println("reuse state " + strconv.Itoa(s.stateNumber) + " edge to " + strconv.Itoa(target.stateNumber)) - } - return target -} - -// computeTargetState computes a target state for an edge in the [DFA], and attempt to add the -// computed state and corresponding edge to the [DFA]. -// -// The func returns the computed target [DFA] state for the given input symbol t. -// If this does not lead to a valid [DFA] state, this method -// returns ATNSimulatorError. -func (l *LexerATNSimulator) computeTargetState(input CharStream, s *DFAState, t int) *DFAState { - reach := NewOrderedATNConfigSet() - - // if we don't find an existing DFA state - // Fill reach starting from closure, following t transitions - l.getReachableConfigSet(input, s.configs, reach, t) - - if len(reach.configs) == 0 { // we got nowhere on t from s - if !reach.hasSemanticContext { - // we got nowhere on t, don't panic out l knowledge it'd - // cause a fail-over from DFA later. - l.addDFAEdge(s, t, ATNSimulatorError, nil) - } - // stop when we can't Match any more char - return ATNSimulatorError - } - // Add an edge from s to target DFA found/created for reach - return l.addDFAEdge(s, t, nil, reach) -} - -func (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream, reach *ATNConfigSet, t int) int { - if l.prevAccept.dfaState != nil { - lexerActionExecutor := prevAccept.dfaState.lexerActionExecutor - l.accept(input, lexerActionExecutor, l.startIndex, prevAccept.index, prevAccept.line, prevAccept.column) - return prevAccept.dfaState.prediction - } - - // if no accept and EOF is first char, return EOF - if t == TokenEOF && input.Index() == l.startIndex { - return TokenEOF - } - - panic(NewLexerNoViableAltException(l.recog, input, l.startIndex, reach)) -} - -// getReachableConfigSet when given a starting configuration set, figures out all [ATN] configurations -// we can reach upon input t. -// -// Parameter reach is a return parameter. -func (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure *ATNConfigSet, reach *ATNConfigSet, t int) { - // l is used to Skip processing for configs which have a lower priority - // than a runtimeConfig that already reached an accept state for the same rule - SkipAlt := ATNInvalidAltNumber - - for _, cfg := range closure.configs { - currentAltReachedAcceptState := cfg.GetAlt() == SkipAlt - if currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision { - continue - } - - if runtimeConfig.lexerATNSimulatorDebug { - - fmt.Printf("testing %s at %s\n", l.GetTokenName(t), cfg.String()) - } - - for _, trans := range cfg.GetState().GetTransitions() { - target := l.getReachableTarget(trans, t) - if target != nil { - lexerActionExecutor := cfg.lexerActionExecutor - if lexerActionExecutor != nil { - lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.Index() - l.startIndex) - } - treatEOFAsEpsilon := t == TokenEOF - config := NewLexerATNConfig3(cfg, target, lexerActionExecutor) - if l.closure(input, config, reach, - currentAltReachedAcceptState, true, treatEOFAsEpsilon) { - // any remaining configs for l alt have a lower priority - // than the one that just reached an accept state. - SkipAlt = cfg.GetAlt() - } - } - } - } -} - -func (l *LexerATNSimulator) accept(input CharStream, lexerActionExecutor *LexerActionExecutor, startIndex, index, line, charPos int) { - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Printf("ACTION %v\n", lexerActionExecutor) - } - // seek to after last char in token - input.Seek(index) - l.Line = line - l.CharPositionInLine = charPos - if lexerActionExecutor != nil && l.recog != nil { - lexerActionExecutor.execute(l.recog, input, startIndex) - } -} - -func (l *LexerATNSimulator) getReachableTarget(trans Transition, t int) ATNState { - if trans.Matches(t, 0, LexerMaxCharValue) { - return trans.getTarget() - } - - return nil -} - -func (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *ATNConfigSet { - configs := NewOrderedATNConfigSet() - for i := 0; i < len(p.GetTransitions()); i++ { - target := p.GetTransitions()[i].getTarget() - cfg := NewLexerATNConfig6(target, i+1, BasePredictionContextEMPTY) - l.closure(input, cfg, configs, false, false, false) - } - - return configs -} - -// closure since the alternatives within any lexer decision are ordered by -// preference, this method stops pursuing the closure as soon as an accept -// state is reached. After the first accept state is reached by depth-first -// search from runtimeConfig, all other (potentially reachable) states for -// this rule would have a lower priority. -// -// The func returns true if an accept state is reached. -func (l *LexerATNSimulator) closure(input CharStream, config *ATNConfig, configs *ATNConfigSet, - currentAltReachedAcceptState, speculative, treatEOFAsEpsilon bool) bool { - - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("closure(" + config.String() + ")") - } - - _, ok := config.state.(*RuleStopState) - if ok { - - if runtimeConfig.lexerATNSimulatorDebug { - if l.recog != nil { - fmt.Printf("closure at %s rule stop %s\n", l.recog.GetRuleNames()[config.state.GetRuleIndex()], config) - } else { - fmt.Printf("closure at rule stop %s\n", config) - } - } - - if config.context == nil || config.context.hasEmptyPath() { - if config.context == nil || config.context.isEmpty() { - configs.Add(config, nil) - return true - } - - configs.Add(NewLexerATNConfig2(config, config.state, BasePredictionContextEMPTY), nil) - currentAltReachedAcceptState = true - } - if config.context != nil && !config.context.isEmpty() { - for i := 0; i < config.context.length(); i++ { - if config.context.getReturnState(i) != BasePredictionContextEmptyReturnState { - newContext := config.context.GetParent(i) // "pop" return state - returnState := l.atn.states[config.context.getReturnState(i)] - cfg := NewLexerATNConfig2(config, returnState, newContext) - currentAltReachedAcceptState = l.closure(input, cfg, configs, currentAltReachedAcceptState, speculative, treatEOFAsEpsilon) - } - } - } - return currentAltReachedAcceptState - } - // optimization - if !config.state.GetEpsilonOnlyTransitions() { - if !currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision { - configs.Add(config, nil) - } - } - for j := 0; j < len(config.state.GetTransitions()); j++ { - trans := config.state.GetTransitions()[j] - cfg := l.getEpsilonTarget(input, config, trans, configs, speculative, treatEOFAsEpsilon) - if cfg != nil { - currentAltReachedAcceptState = l.closure(input, cfg, configs, - currentAltReachedAcceptState, speculative, treatEOFAsEpsilon) - } - } - return currentAltReachedAcceptState -} - -// side-effect: can alter configs.hasSemanticContext -func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *ATNConfig, trans Transition, - configs *ATNConfigSet, speculative, treatEOFAsEpsilon bool) *ATNConfig { - - var cfg *ATNConfig - - if trans.getSerializationType() == TransitionRULE { - - rt := trans.(*RuleTransition) - newContext := SingletonBasePredictionContextCreate(config.context, rt.followState.GetStateNumber()) - cfg = NewLexerATNConfig2(config, trans.getTarget(), newContext) - - } else if trans.getSerializationType() == TransitionPRECEDENCE { - panic("Precedence predicates are not supported in lexers.") - } else if trans.getSerializationType() == TransitionPREDICATE { - // Track traversing semantic predicates. If we traverse, - // we cannot add a DFA state for l "reach" computation - // because the DFA would not test the predicate again in the - // future. Rather than creating collections of semantic predicates - // like v3 and testing them on prediction, v4 will test them on the - // fly all the time using the ATN not the DFA. This is slower but - // semantically it's not used that often. One of the key elements to - // l predicate mechanism is not adding DFA states that see - // predicates immediately afterwards in the ATN. For example, - - // a : ID {p1}? | ID {p2}? - - // should create the start state for rule 'a' (to save start state - // competition), but should not create target of ID state. The - // collection of ATN states the following ID references includes - // states reached by traversing predicates. Since l is when we - // test them, we cannot cash the DFA state target of ID. - - pt := trans.(*PredicateTransition) - - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("EVAL rule " + strconv.Itoa(trans.(*PredicateTransition).ruleIndex) + ":" + strconv.Itoa(pt.predIndex)) - } - configs.hasSemanticContext = true - if l.evaluatePredicate(input, pt.ruleIndex, pt.predIndex, speculative) { - cfg = NewLexerATNConfig4(config, trans.getTarget()) - } - } else if trans.getSerializationType() == TransitionACTION { - if config.context == nil || config.context.hasEmptyPath() { - // execute actions anywhere in the start rule for a token. - // - // TODO: if the entry rule is invoked recursively, some - // actions may be executed during the recursive call. The - // problem can appear when hasEmptyPath() is true but - // isEmpty() is false. In this case, the config needs to be - // split into two contexts - one with just the empty path - // and another with everything but the empty path. - // Unfortunately, the current algorithm does not allow - // getEpsilonTarget to return two configurations, so - // additional modifications are needed before we can support - // the split operation. - lexerActionExecutor := LexerActionExecutorappend(config.lexerActionExecutor, l.atn.lexerActions[trans.(*ActionTransition).actionIndex]) - cfg = NewLexerATNConfig3(config, trans.getTarget(), lexerActionExecutor) - } else { - // ignore actions in referenced rules - cfg = NewLexerATNConfig4(config, trans.getTarget()) - } - } else if trans.getSerializationType() == TransitionEPSILON { - cfg = NewLexerATNConfig4(config, trans.getTarget()) - } else if trans.getSerializationType() == TransitionATOM || - trans.getSerializationType() == TransitionRANGE || - trans.getSerializationType() == TransitionSET { - if treatEOFAsEpsilon { - if trans.Matches(TokenEOF, 0, LexerMaxCharValue) { - cfg = NewLexerATNConfig4(config, trans.getTarget()) - } - } - } - return cfg -} - -// evaluatePredicate eEvaluates a predicate specified in the lexer. -// -// If speculative is true, this method was called before -// [consume] for the Matched character. This method should call -// [consume] before evaluating the predicate to ensure position -// sensitive values, including [GetText], [GetLine], -// and [GetColumn], properly reflect the current -// lexer state. This method should restore input and the simulator -// to the original state before returning, i.e. undo the actions made by the -// call to [Consume]. -// -// The func returns true if the specified predicate evaluates to true. -func (l *LexerATNSimulator) evaluatePredicate(input CharStream, ruleIndex, predIndex int, speculative bool) bool { - // assume true if no recognizer was provided - if l.recog == nil { - return true - } - if !speculative { - return l.recog.Sempred(nil, ruleIndex, predIndex) - } - savedcolumn := l.CharPositionInLine - savedLine := l.Line - index := input.Index() - marker := input.Mark() - - defer func() { - l.CharPositionInLine = savedcolumn - l.Line = savedLine - input.Seek(index) - input.Release(marker) - }() - - l.Consume(input) - return l.recog.Sempred(nil, ruleIndex, predIndex) -} - -func (l *LexerATNSimulator) captureSimState(settings *SimState, input CharStream, dfaState *DFAState) { - settings.index = input.Index() - settings.line = l.Line - settings.column = l.CharPositionInLine - settings.dfaState = dfaState -} - -func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfgs *ATNConfigSet) *DFAState { - if to == nil && cfgs != nil { - // leading to l call, ATNConfigSet.hasSemanticContext is used as a - // marker indicating dynamic predicate evaluation makes l edge - // dependent on the specific input sequence, so the static edge in the - // DFA should be omitted. The target DFAState is still created since - // execATN has the ability to reSynchronize with the DFA state cache - // following the predicate evaluation step. - // - // TJP notes: next time through the DFA, we see a pred again and eval. - // If that gets us to a previously created (but dangling) DFA - // state, we can continue in pure DFA mode from there. - // - suppressEdge := cfgs.hasSemanticContext - cfgs.hasSemanticContext = false - to = l.addDFAState(cfgs, true) - - if suppressEdge { - return to - } - } - // add the edge - if tk < LexerATNSimulatorMinDFAEdge || tk > LexerATNSimulatorMaxDFAEdge { - // Only track edges within the DFA bounds - return to - } - if runtimeConfig.lexerATNSimulatorDebug { - fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + strconv.Itoa(tk)) - } - l.atn.edgeMu.Lock() - defer l.atn.edgeMu.Unlock() - if from.getEdges() == nil { - // make room for tokens 1..n and -1 masquerading as index 0 - from.setEdges(make([]*DFAState, LexerATNSimulatorMaxDFAEdge-LexerATNSimulatorMinDFAEdge+1)) - } - from.setIthEdge(tk-LexerATNSimulatorMinDFAEdge, to) // connect - - return to -} - -// Add a NewDFA state if there isn't one with l set of -// configurations already. This method also detects the first -// configuration containing an ATN rule stop state. Later, when -// traversing the DFA, we will know which rule to accept. -func (l *LexerATNSimulator) addDFAState(configs *ATNConfigSet, suppressEdge bool) *DFAState { - - proposed := NewDFAState(-1, configs) - var firstConfigWithRuleStopState *ATNConfig - - for _, cfg := range configs.configs { - _, ok := cfg.GetState().(*RuleStopState) - - if ok { - firstConfigWithRuleStopState = cfg - break - } - } - if firstConfigWithRuleStopState != nil { - proposed.isAcceptState = true - proposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor - proposed.setPrediction(l.atn.ruleToTokenType[firstConfigWithRuleStopState.GetState().GetRuleIndex()]) - } - dfa := l.decisionToDFA[l.mode] - - l.atn.stateMu.Lock() - defer l.atn.stateMu.Unlock() - existing, present := dfa.Get(proposed) - if present { - - // This state was already present, so just return it. - // - proposed = existing - } else { - - // We need to add the new state - // - proposed.stateNumber = dfa.Len() - configs.readOnly = true - configs.configLookup = nil // Not needed now - proposed.configs = configs - dfa.Put(proposed) - } - if !suppressEdge { - dfa.setS0(proposed) - } - return proposed -} - -func (l *LexerATNSimulator) getDFA(mode int) *DFA { - return l.decisionToDFA[mode] -} - -// GetText returns the text [Match]ed so far for the current token. -func (l *LexerATNSimulator) GetText(input CharStream) string { - // index is first lookahead char, don't include. - return input.GetTextFromInterval(NewInterval(l.startIndex, input.Index()-1)) -} - -func (l *LexerATNSimulator) Consume(input CharStream) { - curChar := input.LA(1) - if curChar == int('\n') { - l.Line++ - l.CharPositionInLine = 0 - } else { - l.CharPositionInLine++ - } - input.Consume() -} - -func (l *LexerATNSimulator) GetCharPositionInLine() int { - return l.CharPositionInLine -} - -func (l *LexerATNSimulator) GetLine() int { - return l.Line -} - -func (l *LexerATNSimulator) GetTokenName(tt int) string { - if tt == -1 { - return "EOF" - } - - var sb strings.Builder - sb.Grow(6) - sb.WriteByte('\'') - sb.WriteRune(rune(tt)) - sb.WriteByte('\'') - - return sb.String() -} - -func resetSimState(sim *SimState) { - sim.index = -1 - sim.line = 0 - sim.column = -1 - sim.dfaState = nil -} - -type SimState struct { - index int - line int - column int - dfaState *DFAState -} - -func NewSimState() *SimState { - s := new(SimState) - resetSimState(s) - return s -} - -func (s *SimState) reset() { - resetSimState(s) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go b/vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go deleted file mode 100644 index 4955ac876..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -type LL1Analyzer struct { - atn *ATN -} - -func NewLL1Analyzer(atn *ATN) *LL1Analyzer { - la := new(LL1Analyzer) - la.atn = atn - return la -} - -const ( - // LL1AnalyzerHitPred is a special value added to the lookahead sets to indicate that we hit - // a predicate during analysis if - // - // seeThruPreds==false - LL1AnalyzerHitPred = TokenInvalidType -) - -// * -// Calculates the SLL(1) expected lookahead set for each outgoing transition -// of an {@link ATNState}. The returned array has one element for each -// outgoing transition in {@code s}. If the closure from transition -// i leads to a semantic predicate before Matching a symbol, the -// element at index i of the result will be {@code nil}. -// -// @param s the ATN state -// @return the expected symbols for each outgoing transition of {@code s}. -func (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet { - if s == nil { - return nil - } - count := len(s.GetTransitions()) - look := make([]*IntervalSet, count) - for alt := 0; alt < count; alt++ { - - look[alt] = NewIntervalSet() - lookBusy := NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, "LL1Analyzer.getDecisionLookahead for lookBusy") - la.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), false, false) - - // Wipe out lookahead for la alternative if we found nothing, - // or we had a predicate when we !seeThruPreds - if look[alt].length() == 0 || look[alt].contains(LL1AnalyzerHitPred) { - look[alt] = nil - } - } - return look -} - -// Look computes the set of tokens that can follow s in the [ATN] in the -// specified ctx. -// -// If ctx is nil and the end of the rule containing -// s is reached, [EPSILON] is added to the result set. -// -// If ctx is not nil and the end of the outermost rule is -// reached, [EOF] is added to the result set. -// -// Parameter s the ATN state, and stopState is the ATN state to stop at. This can be a -// [BlockEndState] to detect epsilon paths through a closure. -// -// Parameter ctx is the complete parser context, or nil if the context -// should be ignored -// -// The func returns the set of tokens that can follow s in the [ATN] in the -// specified ctx. -func (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet { - r := NewIntervalSet() - var lookContext *PredictionContext - if ctx != nil { - lookContext = predictionContextFromRuleContext(s.GetATN(), ctx) - } - la.look1(s, stopState, lookContext, r, NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, "LL1Analyzer.Look for la.look1()"), - NewBitSet(), true, true) - return r -} - -//* -// Compute set of tokens that can follow {@code s} in the ATN in the -// specified {@code ctx}. -// -//

If {@code ctx} is {@code nil} and {@code stopState} or the end of the -// rule containing {@code s} is reached, {@link Token//EPSILON} is added to -// the result set. If {@code ctx} is not {@code nil} and {@code addEOF} is -// {@code true} and {@code stopState} or the end of the outermost rule is -// reached, {@link Token//EOF} is added to the result set.

-// -// @param s the ATN state. -// @param stopState the ATN state to stop at. This can be a -// {@link BlockEndState} to detect epsilon paths through a closure. -// @param ctx The outer context, or {@code nil} if the outer context should -// not be used. -// @param look The result lookahead set. -// @param lookBusy A set used for preventing epsilon closures in the ATN -// from causing a stack overflow. Outside code should pass -// {@code NewSet} for la argument. -// @param calledRuleStack A set used for preventing left recursion in the -// ATN from causing a stack overflow. Outside code should pass -// {@code NewBitSet()} for la argument. -// @param seeThruPreds {@code true} to true semantic predicates as -// implicitly {@code true} and "see through them", otherwise {@code false} -// to treat semantic predicates as opaque and add {@link //HitPred} to the -// result if one is encountered. -// @param addEOF Add {@link Token//EOF} to the result if the end of the -// outermost context is reached. This parameter has no effect if {@code ctx} -// is {@code nil}. - -func (la *LL1Analyzer) look2(_, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]], - calledRuleStack *BitSet, seeThruPreds, addEOF bool, i int) { - - returnState := la.atn.states[ctx.getReturnState(i)] - la.look1(returnState, stopState, ctx.GetParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF) - -} - -func (la *LL1Analyzer) look1(s, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool) { - - c := NewATNConfig6(s, 0, ctx) - - if lookBusy.Contains(c) { - return - } - - _, present := lookBusy.Put(c) - if present { - return - - } - if s == stopState { - if ctx == nil { - look.addOne(TokenEpsilon) - return - } else if ctx.isEmpty() && addEOF { - look.addOne(TokenEOF) - return - } - } - - _, ok := s.(*RuleStopState) - - if ok { - if ctx == nil { - look.addOne(TokenEpsilon) - return - } else if ctx.isEmpty() && addEOF { - look.addOne(TokenEOF) - return - } - - if ctx.pcType != PredictionContextEmpty { - removed := calledRuleStack.contains(s.GetRuleIndex()) - defer func() { - if removed { - calledRuleStack.add(s.GetRuleIndex()) - } - }() - calledRuleStack.remove(s.GetRuleIndex()) - // run thru all possible stack tops in ctx - for i := 0; i < ctx.length(); i++ { - returnState := la.atn.states[ctx.getReturnState(i)] - la.look2(returnState, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, i) - } - return - } - } - - n := len(s.GetTransitions()) - - for i := 0; i < n; i++ { - t := s.GetTransitions()[i] - - if t1, ok := t.(*RuleTransition); ok { - if calledRuleStack.contains(t1.getTarget().GetRuleIndex()) { - continue - } - - newContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber()) - la.look3(stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, t1) - } else if t2, ok := t.(AbstractPredicateTransition); ok { - if seeThruPreds { - la.look1(t2.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) - } else { - look.addOne(LL1AnalyzerHitPred) - } - } else if t.getIsEpsilon() { - la.look1(t.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) - } else if _, ok := t.(*WildcardTransition); ok { - look.addRange(TokenMinUserTokenType, la.atn.maxTokenType) - } else { - set := t.getLabel() - if set != nil { - if _, ok := t.(*NotSetTransition); ok { - set = set.complement(TokenMinUserTokenType, la.atn.maxTokenType) - } - look.addSet(set) - } - } - } -} - -func (la *LL1Analyzer) look3(stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]], - calledRuleStack *BitSet, seeThruPreds, addEOF bool, t1 *RuleTransition) { - - newContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber()) - - defer func() { - calledRuleStack.remove(t1.getTarget().GetRuleIndex()) - }() - - calledRuleStack.add(t1.getTarget().GetRuleIndex()) - la.look1(t1.getTarget(), stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) - -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go b/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go deleted file mode 100644 index 923c7b52c..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build !antlr.stats - -package antlr - -// This file is compiled when the build configuration antlr.stats is not enabled. -// which then allows the compiler to optimize out all the code that is not used. -const collectStats = false - -// goRunStats is a dummy struct used when build configuration antlr.stats is not enabled. -type goRunStats struct { -} - -var Statistics = &goRunStats{} - -func (s *goRunStats) AddJStatRec(_ *JStatRec) { - // Do nothing - compiler will optimize this out (hopefully) -} - -func (s *goRunStats) CollectionAnomalies() { - // Do nothing - compiler will optimize this out (hopefully) -} - -func (s *goRunStats) Reset() { - // Do nothing - compiler will optimize this out (hopefully) -} - -func (s *goRunStats) Report(dir string, prefix string) error { - // Do nothing - compiler will optimize this out (hopefully) - return nil -} - -func (s *goRunStats) Analyze() { - // Do nothing - compiler will optimize this out (hopefully) -} - -type statsOption func(*goRunStats) error - -func (s *goRunStats) Configure(options ...statsOption) error { - // Do nothing - compiler will optimize this out (hopefully) - return nil -} - -func WithTopN(topN int) statsOption { - return func(s *goRunStats) error { - return nil - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/parser.go b/vendor/github.com/antlr4-go/antlr/v4/parser.go deleted file mode 100644 index fb57ac15d..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/parser.go +++ /dev/null @@ -1,700 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" -) - -type Parser interface { - Recognizer - - GetInterpreter() *ParserATNSimulator - - GetTokenStream() TokenStream - GetTokenFactory() TokenFactory - GetParserRuleContext() ParserRuleContext - SetParserRuleContext(ParserRuleContext) - Consume() Token - GetParseListeners() []ParseTreeListener - - GetErrorHandler() ErrorStrategy - SetErrorHandler(ErrorStrategy) - GetInputStream() IntStream - GetCurrentToken() Token - GetExpectedTokens() *IntervalSet - NotifyErrorListeners(string, Token, RecognitionException) - IsExpectedToken(int) bool - GetPrecedence() int - GetRuleInvocationStack(ParserRuleContext) []string -} - -type BaseParser struct { - *BaseRecognizer - - Interpreter *ParserATNSimulator - BuildParseTrees bool - - input TokenStream - errHandler ErrorStrategy - precedenceStack IntStack - ctx ParserRuleContext - - tracer *TraceListener - parseListeners []ParseTreeListener - _SyntaxErrors int -} - -// NewBaseParser contains all the parsing support code to embed in parsers. Essentially most of it is error -// recovery stuff. -// -//goland:noinspection GoUnusedExportedFunction -func NewBaseParser(input TokenStream) *BaseParser { - - p := new(BaseParser) - - p.BaseRecognizer = NewBaseRecognizer() - - // The input stream. - p.input = nil - - // The error handling strategy for the parser. The default value is a new - // instance of {@link DefaultErrorStrategy}. - p.errHandler = NewDefaultErrorStrategy() - p.precedenceStack = make([]int, 0) - p.precedenceStack.Push(0) - - // The ParserRuleContext object for the currently executing rule. - // p.is always non-nil during the parsing process. - p.ctx = nil - - // Specifies whether the parser should construct a parse tree during - // the parsing process. The default value is {@code true}. - p.BuildParseTrees = true - - // When setTrace(true) is called, a reference to the - // TraceListener is stored here, so it can be easily removed in a - // later call to setTrace(false). The listener itself is - // implemented as a parser listener so p.field is not directly used by - // other parser methods. - p.tracer = nil - - // The list of ParseTreeListener listeners registered to receive - // events during the parse. - p.parseListeners = nil - - // The number of syntax errors Reported during parsing. p.value is - // incremented each time NotifyErrorListeners is called. - p._SyntaxErrors = 0 - p.SetInputStream(input) - - return p -} - -// This field maps from the serialized ATN string to the deserialized [ATN] with -// bypass alternatives. -// -// [ATNDeserializationOptions.isGenerateRuleBypassTransitions] -// -//goland:noinspection GoUnusedGlobalVariable -var bypassAltsAtnCache = make(map[string]int) - -// reset the parser's state// -func (p *BaseParser) reset() { - if p.input != nil { - p.input.Seek(0) - } - p.errHandler.reset(p) - p.ctx = nil - p._SyntaxErrors = 0 - p.SetTrace(nil) - p.precedenceStack = make([]int, 0) - p.precedenceStack.Push(0) - if p.Interpreter != nil { - p.Interpreter.reset() - } -} - -func (p *BaseParser) GetErrorHandler() ErrorStrategy { - return p.errHandler -} - -func (p *BaseParser) SetErrorHandler(e ErrorStrategy) { - p.errHandler = e -} - -// Match current input symbol against {@code ttype}. If the symbol type -// Matches, {@link ANTLRErrorStrategy//ReportMatch} and {@link //consume} are -// called to complete the Match process. -// -//

If the symbol type does not Match, -// {@link ANTLRErrorStrategy//recoverInline} is called on the current error -// strategy to attempt recovery. If {@link //getBuildParseTree} is -// {@code true} and the token index of the symbol returned by -// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to -// the parse tree by calling {@link ParserRuleContext//addErrorNode}.

-// -// @param ttype the token type to Match -// @return the Matched symbol -// @panics RecognitionException if the current input symbol did not Match -// {@code ttype} and the error strategy could not recover from the -// mismatched symbol - -func (p *BaseParser) Match(ttype int) Token { - - t := p.GetCurrentToken() - - if t.GetTokenType() == ttype { - p.errHandler.ReportMatch(p) - p.Consume() - } else { - t = p.errHandler.RecoverInline(p) - if p.HasError() { - return nil - } - if p.BuildParseTrees && t.GetTokenIndex() == -1 { - - // we must have conjured up a new token during single token - // insertion if it's not the current symbol - p.ctx.AddErrorNode(t) - } - } - - return t -} - -// Match current input symbol as a wildcard. If the symbol type Matches -// (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//ReportMatch} -// and {@link //consume} are called to complete the Match process. -// -//

If the symbol type does not Match, -// {@link ANTLRErrorStrategy//recoverInline} is called on the current error -// strategy to attempt recovery. If {@link //getBuildParseTree} is -// {@code true} and the token index of the symbol returned by -// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to -// the parse tree by calling {@link ParserRuleContext//addErrorNode}.

-// -// @return the Matched symbol -// @panics RecognitionException if the current input symbol did not Match -// a wildcard and the error strategy could not recover from the mismatched -// symbol - -func (p *BaseParser) MatchWildcard() Token { - t := p.GetCurrentToken() - if t.GetTokenType() > 0 { - p.errHandler.ReportMatch(p) - p.Consume() - } else { - t = p.errHandler.RecoverInline(p) - if p.BuildParseTrees && t.GetTokenIndex() == -1 { - // we must have conjured up a new token during single token - // insertion if it's not the current symbol - p.ctx.AddErrorNode(t) - } - } - return t -} - -func (p *BaseParser) GetParserRuleContext() ParserRuleContext { - return p.ctx -} - -func (p *BaseParser) SetParserRuleContext(v ParserRuleContext) { - p.ctx = v -} - -func (p *BaseParser) GetParseListeners() []ParseTreeListener { - if p.parseListeners == nil { - return make([]ParseTreeListener, 0) - } - return p.parseListeners -} - -// AddParseListener registers listener to receive events during the parsing process. -// -// To support output-preserving grammar transformations (including but not -// limited to left-recursion removal, automated left-factoring, and -// optimized code generation), calls to listener methods during the parse -// may differ substantially from calls made by -// [ParseTreeWalker.DEFAULT] used after the parse is complete. In -// particular, rule entry and exit events may occur in a different order -// during the parse than after the parser. In addition, calls to certain -// rule entry methods may be omitted. -// -// With the following specific exceptions, calls to listener events are -// deterministic, i.e. for identical input the calls to listener -// methods will be the same. -// -// - Alterations to the grammar used to generate code may change the -// behavior of the listener calls. -// - Alterations to the command line options passed to ANTLR 4 when -// generating the parser may change the behavior of the listener calls. -// - Changing the version of the ANTLR Tool used to generate the parser -// may change the behavior of the listener calls. -func (p *BaseParser) AddParseListener(listener ParseTreeListener) { - if listener == nil { - panic("listener") - } - if p.parseListeners == nil { - p.parseListeners = make([]ParseTreeListener, 0) - } - p.parseListeners = append(p.parseListeners, listener) -} - -// RemoveParseListener removes listener from the list of parse listeners. -// -// If listener is nil or has not been added as a parse -// listener, this func does nothing. -func (p *BaseParser) RemoveParseListener(listener ParseTreeListener) { - - if p.parseListeners != nil { - - idx := -1 - for i, v := range p.parseListeners { - if v == listener { - idx = i - break - } - } - - if idx == -1 { - return - } - - // remove the listener from the slice - p.parseListeners = append(p.parseListeners[0:idx], p.parseListeners[idx+1:]...) - - if len(p.parseListeners) == 0 { - p.parseListeners = nil - } - } -} - -// Remove all parse listeners. -func (p *BaseParser) removeParseListeners() { - p.parseListeners = nil -} - -// TriggerEnterRuleEvent notifies all parse listeners of an enter rule event. -func (p *BaseParser) TriggerEnterRuleEvent() { - if p.parseListeners != nil { - ctx := p.ctx - for _, listener := range p.parseListeners { - listener.EnterEveryRule(ctx) - ctx.EnterRule(listener) - } - } -} - -// TriggerExitRuleEvent notifies any parse listeners of an exit rule event. -func (p *BaseParser) TriggerExitRuleEvent() { - if p.parseListeners != nil { - // reverse order walk of listeners - ctx := p.ctx - l := len(p.parseListeners) - 1 - - for i := range p.parseListeners { - listener := p.parseListeners[l-i] - ctx.ExitRule(listener) - listener.ExitEveryRule(ctx) - } - } -} - -func (p *BaseParser) GetInterpreter() *ParserATNSimulator { - return p.Interpreter -} - -func (p *BaseParser) GetATN() *ATN { - return p.Interpreter.atn -} - -func (p *BaseParser) GetTokenFactory() TokenFactory { - return p.input.GetTokenSource().GetTokenFactory() -} - -// setTokenFactory is used to tell our token source and error strategy about a new way to create tokens. -func (p *BaseParser) setTokenFactory(factory TokenFactory) { - p.input.GetTokenSource().setTokenFactory(factory) -} - -// GetATNWithBypassAlts - the ATN with bypass alternatives is expensive to create, so we create it -// lazily. -func (p *BaseParser) GetATNWithBypassAlts() { - - // TODO - Implement this? - panic("Not implemented!") - - // serializedAtn := p.getSerializedATN() - // if (serializedAtn == nil) { - // panic("The current parser does not support an ATN with bypass alternatives.") - // } - // result := p.bypassAltsAtnCache[serializedAtn] - // if (result == nil) { - // deserializationOptions := NewATNDeserializationOptions(nil) - // deserializationOptions.generateRuleBypassTransitions = true - // result = NewATNDeserializer(deserializationOptions).deserialize(serializedAtn) - // p.bypassAltsAtnCache[serializedAtn] = result - // } - // return result -} - -// The preferred method of getting a tree pattern. For example, here's a -// sample use: -// -//
-// ParseTree t = parser.expr()
-// ParseTreePattern p = parser.compileParseTreePattern("<ID>+0",
-// MyParser.RULE_expr)
-// ParseTreeMatch m = p.Match(t)
-// String id = m.Get("ID")
-// 
- -//goland:noinspection GoUnusedParameter -func (p *BaseParser) compileParseTreePattern(pattern, patternRuleIndex, lexer Lexer) { - - panic("NewParseTreePatternMatcher not implemented!") - // - // if (lexer == nil) { - // if (p.GetTokenStream() != nil) { - // tokenSource := p.GetTokenStream().GetTokenSource() - // if _, ok := tokenSource.(ILexer); ok { - // lexer = tokenSource - // } - // } - // } - // if (lexer == nil) { - // panic("Parser can't discover a lexer to use") - // } - - // m := NewParseTreePatternMatcher(lexer, p) - // return m.compile(pattern, patternRuleIndex) -} - -func (p *BaseParser) GetInputStream() IntStream { - return p.GetTokenStream() -} - -func (p *BaseParser) SetInputStream(input TokenStream) { - p.SetTokenStream(input) -} - -func (p *BaseParser) GetTokenStream() TokenStream { - return p.input -} - -// SetTokenStream installs input as the token stream and resets the parser. -func (p *BaseParser) SetTokenStream(input TokenStream) { - p.input = nil - p.reset() - p.input = input -} - -// GetCurrentToken returns the current token at LT(1). -// -// [Match] needs to return the current input symbol, which gets put -// into the label for the associated token ref e.g., x=ID. -func (p *BaseParser) GetCurrentToken() Token { - return p.input.LT(1) -} - -func (p *BaseParser) NotifyErrorListeners(msg string, offendingToken Token, err RecognitionException) { - if offendingToken == nil { - offendingToken = p.GetCurrentToken() - } - p._SyntaxErrors++ - line := offendingToken.GetLine() - column := offendingToken.GetColumn() - listener := p.GetErrorListenerDispatch() - listener.SyntaxError(p, offendingToken, line, column, msg, err) -} - -func (p *BaseParser) Consume() Token { - o := p.GetCurrentToken() - if o.GetTokenType() != TokenEOF { - p.GetInputStream().Consume() - } - hasListener := p.parseListeners != nil && len(p.parseListeners) > 0 - if p.BuildParseTrees || hasListener { - if p.errHandler.InErrorRecoveryMode(p) { - node := p.ctx.AddErrorNode(o) - if p.parseListeners != nil { - for _, l := range p.parseListeners { - l.VisitErrorNode(node) - } - } - - } else { - node := p.ctx.AddTokenNode(o) - if p.parseListeners != nil { - for _, l := range p.parseListeners { - l.VisitTerminal(node) - } - } - } - // node.invokingState = p.state - } - - return o -} - -func (p *BaseParser) addContextToParseTree() { - // add current context to parent if we have a parent - if p.ctx.GetParent() != nil { - p.ctx.GetParent().(ParserRuleContext).AddChild(p.ctx) - } -} - -func (p *BaseParser) EnterRule(localctx ParserRuleContext, state, _ int) { - p.SetState(state) - p.ctx = localctx - p.ctx.SetStart(p.input.LT(1)) - if p.BuildParseTrees { - p.addContextToParseTree() - } - if p.parseListeners != nil { - p.TriggerEnterRuleEvent() - } -} - -func (p *BaseParser) ExitRule() { - p.ctx.SetStop(p.input.LT(-1)) - // trigger event on ctx, before it reverts to parent - if p.parseListeners != nil { - p.TriggerExitRuleEvent() - } - p.SetState(p.ctx.GetInvokingState()) - if p.ctx.GetParent() != nil { - p.ctx = p.ctx.GetParent().(ParserRuleContext) - } else { - p.ctx = nil - } -} - -func (p *BaseParser) EnterOuterAlt(localctx ParserRuleContext, altNum int) { - localctx.SetAltNumber(altNum) - // if we have a new localctx, make sure we replace existing ctx - // that is previous child of parse tree - if p.BuildParseTrees && p.ctx != localctx { - if p.ctx.GetParent() != nil { - p.ctx.GetParent().(ParserRuleContext).RemoveLastChild() - p.ctx.GetParent().(ParserRuleContext).AddChild(localctx) - } - } - p.ctx = localctx -} - -// Get the precedence level for the top-most precedence rule. -// -// @return The precedence level for the top-most precedence rule, or -1 if -// the parser context is not nested within a precedence rule. - -func (p *BaseParser) GetPrecedence() int { - if len(p.precedenceStack) == 0 { - return -1 - } - - return p.precedenceStack[len(p.precedenceStack)-1] -} - -func (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, _, precedence int) { - p.SetState(state) - p.precedenceStack.Push(precedence) - p.ctx = localctx - p.ctx.SetStart(p.input.LT(1)) - if p.parseListeners != nil { - p.TriggerEnterRuleEvent() // simulates rule entry for - // left-recursive rules - } -} - -// -// Like {@link //EnterRule} but for recursive rules. - -func (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state, _ int) { - previous := p.ctx - previous.SetParent(localctx) - previous.SetInvokingState(state) - previous.SetStop(p.input.LT(-1)) - - p.ctx = localctx - p.ctx.SetStart(previous.GetStart()) - if p.BuildParseTrees { - p.ctx.AddChild(previous) - } - if p.parseListeners != nil { - p.TriggerEnterRuleEvent() // simulates rule entry for - // left-recursive rules - } -} - -func (p *BaseParser) UnrollRecursionContexts(parentCtx ParserRuleContext) { - _, _ = p.precedenceStack.Pop() - p.ctx.SetStop(p.input.LT(-1)) - retCtx := p.ctx // save current ctx (return value) - // unroll so ctx is as it was before call to recursive method - if p.parseListeners != nil { - for p.ctx != parentCtx { - p.TriggerExitRuleEvent() - p.ctx = p.ctx.GetParent().(ParserRuleContext) - } - } else { - p.ctx = parentCtx - } - // hook into tree - retCtx.SetParent(parentCtx) - if p.BuildParseTrees && parentCtx != nil { - // add return ctx into invoking rule's tree - parentCtx.AddChild(retCtx) - } -} - -func (p *BaseParser) GetInvokingContext(ruleIndex int) ParserRuleContext { - ctx := p.ctx - for ctx != nil { - if ctx.GetRuleIndex() == ruleIndex { - return ctx - } - ctx = ctx.GetParent().(ParserRuleContext) - } - return nil -} - -func (p *BaseParser) Precpred(_ RuleContext, precedence int) bool { - return precedence >= p.precedenceStack[len(p.precedenceStack)-1] -} - -//goland:noinspection GoUnusedParameter -func (p *BaseParser) inContext(context ParserRuleContext) bool { - // TODO: useful in parser? - return false -} - -// IsExpectedToken checks whether symbol can follow the current state in the -// {ATN}. The behavior of p.method is equivalent to the following, but is -// implemented such that the complete context-sensitive follow set does not -// need to be explicitly constructed. -// -// return getExpectedTokens().contains(symbol) -func (p *BaseParser) IsExpectedToken(symbol int) bool { - atn := p.Interpreter.atn - ctx := p.ctx - s := atn.states[p.state] - following := atn.NextTokens(s, nil) - if following.contains(symbol) { - return true - } - if !following.contains(TokenEpsilon) { - return false - } - for ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) { - invokingState := atn.states[ctx.GetInvokingState()] - rt := invokingState.GetTransitions()[0] - following = atn.NextTokens(rt.(*RuleTransition).followState, nil) - if following.contains(symbol) { - return true - } - ctx = ctx.GetParent().(ParserRuleContext) - } - if following.contains(TokenEpsilon) && symbol == TokenEOF { - return true - } - - return false -} - -// GetExpectedTokens and returns the set of input symbols which could follow the current parser -// state and context, as given by [GetState] and [GetContext], -// respectively. -func (p *BaseParser) GetExpectedTokens() *IntervalSet { - return p.Interpreter.atn.getExpectedTokens(p.state, p.ctx) -} - -func (p *BaseParser) GetExpectedTokensWithinCurrentRule() *IntervalSet { - atn := p.Interpreter.atn - s := atn.states[p.state] - return atn.NextTokens(s, nil) -} - -// GetRuleIndex get a rule's index (i.e., RULE_ruleName field) or -1 if not found. -func (p *BaseParser) GetRuleIndex(ruleName string) int { - var ruleIndex, ok = p.GetRuleIndexMap()[ruleName] - if ok { - return ruleIndex - } - - return -1 -} - -// GetRuleInvocationStack returns a list of the rule names in your parser instance -// leading up to a call to the current rule. You could override if -// you want more details such as the file/line info of where -// in the ATN a rule is invoked. -func (p *BaseParser) GetRuleInvocationStack(c ParserRuleContext) []string { - if c == nil { - c = p.ctx - } - stack := make([]string, 0) - for c != nil { - // compute what follows who invoked us - ruleIndex := c.GetRuleIndex() - if ruleIndex < 0 { - stack = append(stack, "n/a") - } else { - stack = append(stack, p.GetRuleNames()[ruleIndex]) - } - - vp := c.GetParent() - - if vp == nil { - break - } - - c = vp.(ParserRuleContext) - } - return stack -} - -// GetDFAStrings returns a list of all DFA states used for debugging purposes -func (p *BaseParser) GetDFAStrings() string { - return fmt.Sprint(p.Interpreter.decisionToDFA) -} - -// DumpDFA prints the whole of the DFA for debugging -func (p *BaseParser) DumpDFA() { - seenOne := false - for _, dfa := range p.Interpreter.decisionToDFA { - if dfa.Len() > 0 { - if seenOne { - fmt.Println() - } - fmt.Println("Decision " + strconv.Itoa(dfa.decision) + ":") - fmt.Print(dfa.String(p.LiteralNames, p.SymbolicNames)) - seenOne = true - } - } -} - -func (p *BaseParser) GetSourceName() string { - return p.GrammarFileName -} - -// SetTrace installs a trace listener for the parse. -// -// During a parse it is sometimes useful to listen in on the rule entry and exit -// events as well as token Matches. This is for quick and dirty debugging. -func (p *BaseParser) SetTrace(trace *TraceListener) { - if trace == nil { - p.RemoveParseListener(p.tracer) - p.tracer = nil - } else { - if p.tracer != nil { - p.RemoveParseListener(p.tracer) - } - p.tracer = NewTraceListener(p) - p.AddParseListener(p.tracer) - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go deleted file mode 100644 index ae2869692..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go +++ /dev/null @@ -1,1668 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" - "strings" -) - -var () - -// ClosureBusy is a store of ATNConfigs and is a tiny abstraction layer over -// a standard JStore so that we can use Lazy instantiation of the JStore, mostly -// to avoid polluting the stats module with a ton of JStore instances with nothing in them. -type ClosureBusy struct { - bMap *JStore[*ATNConfig, Comparator[*ATNConfig]] - desc string -} - -// NewClosureBusy creates a new ClosureBusy instance used to avoid infinite recursion for right-recursive rules -func NewClosureBusy(desc string) *ClosureBusy { - return &ClosureBusy{ - desc: desc, - } -} - -func (c *ClosureBusy) Put(config *ATNConfig) (*ATNConfig, bool) { - if c.bMap == nil { - c.bMap = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, c.desc) - } - return c.bMap.Put(config) -} - -type ParserATNSimulator struct { - BaseATNSimulator - - parser Parser - predictionMode int - input TokenStream - startIndex int - dfa *DFA - mergeCache *JPCMap - outerContext ParserRuleContext -} - -//goland:noinspection GoUnusedExportedFunction -func NewParserATNSimulator(parser Parser, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *ParserATNSimulator { - - p := &ParserATNSimulator{ - BaseATNSimulator: BaseATNSimulator{ - atn: atn, - sharedContextCache: sharedContextCache, - }, - } - - p.parser = parser - p.decisionToDFA = decisionToDFA - // SLL, LL, or LL + exact ambig detection?// - p.predictionMode = PredictionModeLL - // LAME globals to avoid parameters!!!!! I need these down deep in predTransition - p.input = nil - p.startIndex = 0 - p.outerContext = nil - p.dfa = nil - // Each prediction operation uses a cache for merge of prediction contexts. - // Don't keep around as it wastes huge amounts of memory. [JPCMap] - // isn't Synchronized, but we're ok since two threads shouldn't reuse same - // parser/atn-simulator object because it can only handle one input at a time. - // This maps graphs a and b to merged result c. (a,b) -> c. We can avoid - // the merge if we ever see a and b again. Note that (b,a) -> c should - // also be examined during cache lookup. - // - p.mergeCache = nil - - return p -} - -func (p *ParserATNSimulator) GetPredictionMode() int { - return p.predictionMode -} - -func (p *ParserATNSimulator) SetPredictionMode(v int) { - p.predictionMode = v -} - -func (p *ParserATNSimulator) reset() { -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) AdaptivePredict(parser *BaseParser, input TokenStream, decision int, outerContext ParserRuleContext) int { - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("adaptivePredict decision " + strconv.Itoa(decision) + - " exec LA(1)==" + p.getLookaheadName(input) + - " line " + strconv.Itoa(input.LT(1).GetLine()) + ":" + - strconv.Itoa(input.LT(1).GetColumn())) - } - p.input = input - p.startIndex = input.Index() - p.outerContext = outerContext - - dfa := p.decisionToDFA[decision] - p.dfa = dfa - m := input.Mark() - index := input.Index() - - defer func() { - p.dfa = nil - p.mergeCache = nil // whack cache after each prediction - // Do not attempt to run a GC now that we're done with the cache as makes the - // GC overhead terrible for badly formed grammars and has little effect on well formed - // grammars. - // I have made some extra effort to try and reduce memory pressure by reusing allocations when - // possible. However, it can only have a limited effect. The real solution is to encourage grammar - // authors to think more carefully about their grammar and to use the new antlr.stats tag to inspect - // what is happening at runtime, along with using the error listener to report ambiguities. - - input.Seek(index) - input.Release(m) - }() - - // Now we are certain to have a specific decision's DFA - // But, do we still need an initial state? - var s0 *DFAState - p.atn.stateMu.RLock() - if dfa.getPrecedenceDfa() { - p.atn.edgeMu.RLock() - // the start state for a precedence DFA depends on the current - // parser precedence, and is provided by a DFA method. - s0 = dfa.getPrecedenceStartState(p.parser.GetPrecedence()) - p.atn.edgeMu.RUnlock() - } else { - // the start state for a "regular" DFA is just s0 - s0 = dfa.getS0() - } - p.atn.stateMu.RUnlock() - - if s0 == nil { - if outerContext == nil { - outerContext = ParserRuleContextEmpty - } - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("predictATN decision " + strconv.Itoa(dfa.decision) + - " exec LA(1)==" + p.getLookaheadName(input) + - ", outerContext=" + outerContext.String(p.parser.GetRuleNames(), nil)) - } - fullCtx := false - s0Closure := p.computeStartState(dfa.atnStartState, ParserRuleContextEmpty, fullCtx) - - p.atn.stateMu.Lock() - if dfa.getPrecedenceDfa() { - // If p is a precedence DFA, we use applyPrecedenceFilter - // to convert the computed start state to a precedence start - // state. We then use DFA.setPrecedenceStartState to set the - // appropriate start state for the precedence level rather - // than simply setting DFA.s0. - // - dfa.s0.configs = s0Closure - s0Closure = p.applyPrecedenceFilter(s0Closure) - s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure)) - p.atn.edgeMu.Lock() - dfa.setPrecedenceStartState(p.parser.GetPrecedence(), s0) - p.atn.edgeMu.Unlock() - } else { - s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure)) - dfa.setS0(s0) - } - p.atn.stateMu.Unlock() - } - - alt, re := p.execATN(dfa, s0, input, index, outerContext) - parser.SetError(re) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("DFA after predictATN: " + dfa.String(p.parser.GetLiteralNames(), nil)) - } - return alt - -} - -// execATN performs ATN simulation to compute a predicted alternative based -// upon the remaining input, but also updates the DFA cache to avoid -// having to traverse the ATN again for the same input sequence. -// -// There are some key conditions we're looking for after computing a new -// set of ATN configs (proposed DFA state): -// -// - If the set is empty, there is no viable alternative for current symbol -// - Does the state uniquely predict an alternative? -// - Does the state have a conflict that would prevent us from -// putting it on the work list? -// -// We also have some key operations to do: -// -// - Add an edge from previous DFA state to potentially NewDFA state, D, -// - Upon current symbol but only if adding to work list, which means in all -// cases except no viable alternative (and possibly non-greedy decisions?) -// - Collecting predicates and adding semantic context to DFA accept states -// - adding rule context to context-sensitive DFA accept states -// - Consuming an input symbol -// - Reporting a conflict -// - Reporting an ambiguity -// - Reporting a context sensitivity -// - Reporting insufficient predicates -// -// Cover these cases: -// -// - dead end -// - single alt -// - single alt + predicates -// - conflict -// - conflict + predicates -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) { - - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("execATN decision " + strconv.Itoa(dfa.decision) + - ", DFA state " + s0.String() + - ", LA(1)==" + p.getLookaheadName(input) + - " line " + strconv.Itoa(input.LT(1).GetLine()) + ":" + strconv.Itoa(input.LT(1).GetColumn())) - } - - previousD := s0 - - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("s0 = " + s0.String()) - } - t := input.LA(1) - for { // for more work - D := p.getExistingTargetState(previousD, t) - if D == nil { - D = p.computeTargetState(dfa, previousD, t) - } - if D == ATNSimulatorError { - // if any configs in previous dipped into outer context, that - // means that input up to t actually finished entry rule - // at least for SLL decision. Full LL doesn't dip into outer - // so don't need special case. - // We will get an error no matter what so delay until after - // decision better error message. Also, no reachable target - // ATN states in SLL implies LL will also get nowhere. - // If conflict in states that dip out, choose min since we - // will get error no matter what. - e := p.noViableAlt(input, outerContext, previousD.configs, startIndex) - input.Seek(startIndex) - alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext) - if alt != ATNInvalidAltNumber { - return alt, nil - } - p.parser.SetError(e) - return ATNInvalidAltNumber, e - } - if D.requiresFullContext && p.predictionMode != PredictionModeSLL { - // IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error) - conflictingAlts := D.configs.conflictingAlts - if D.predicates != nil { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("DFA state has preds in DFA sim LL fail-over") - } - conflictIndex := input.Index() - if conflictIndex != startIndex { - input.Seek(startIndex) - } - conflictingAlts = p.evalSemanticContext(D.predicates, outerContext, true) - if conflictingAlts.length() == 1 { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("Full LL avoided") - } - return conflictingAlts.minValue(), nil - } - if conflictIndex != startIndex { - // restore the index so Reporting the fallback to full - // context occurs with the index at the correct spot - input.Seek(conflictIndex) - } - } - if runtimeConfig.parserATNSimulatorDFADebug { - fmt.Println("ctx sensitive state " + outerContext.String(nil, nil) + " in " + D.String()) - } - fullCtx := true - s0Closure := p.computeStartState(dfa.atnStartState, outerContext, fullCtx) - p.ReportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.Index()) - alt, re := p.execATNWithFullContext(dfa, D, s0Closure, input, startIndex, outerContext) - return alt, re - } - if D.isAcceptState { - if D.predicates == nil { - return D.prediction, nil - } - stopIndex := input.Index() - input.Seek(startIndex) - alts := p.evalSemanticContext(D.predicates, outerContext, true) - - switch alts.length() { - case 0: - return ATNInvalidAltNumber, p.noViableAlt(input, outerContext, D.configs, startIndex) - case 1: - return alts.minValue(), nil - default: - // Report ambiguity after predicate evaluation to make sure the correct set of ambig alts is Reported. - p.ReportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs) - return alts.minValue(), nil - } - } - previousD = D - - if t != TokenEOF { - input.Consume() - t = input.LA(1) - } - } -} - -// Get an existing target state for an edge in the DFA. If the target state -// for the edge has not yet been computed or is otherwise not available, -// p method returns {@code nil}. -// -// @param previousD The current DFA state -// @param t The next input symbol -// @return The existing target DFA state for the given input symbol -// {@code t}, or {@code nil} if the target state for p edge is not -// already cached - -func (p *ParserATNSimulator) getExistingTargetState(previousD *DFAState, t int) *DFAState { - if t+1 < 0 { - return nil - } - - p.atn.edgeMu.RLock() - defer p.atn.edgeMu.RUnlock() - edges := previousD.getEdges() - if edges == nil || t+1 >= len(edges) { - return nil - } - return previousD.getIthEdge(t + 1) -} - -// Compute a target state for an edge in the DFA, and attempt to add the -// computed state and corresponding edge to the DFA. -// -// @param dfa The DFA -// @param previousD The current DFA state -// @param t The next input symbol -// -// @return The computed target DFA state for the given input symbol -// {@code t}. If {@code t} does not lead to a valid DFA state, p method -// returns {@link //ERROR}. -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t int) *DFAState { - reach := p.computeReachSet(previousD.configs, t, false) - - if reach == nil { - p.addDFAEdge(dfa, previousD, t, ATNSimulatorError) - return ATNSimulatorError - } - // create new target state we'll add to DFA after it's complete - D := NewDFAState(-1, reach) - - predictedAlt := p.getUniqueAlt(reach) - - if runtimeConfig.parserATNSimulatorDebug { - altSubSets := PredictionModegetConflictingAltSubsets(reach) - fmt.Println("SLL altSubSets=" + fmt.Sprint(altSubSets) + - ", previous=" + previousD.configs.String() + - ", configs=" + reach.String() + - ", predict=" + strconv.Itoa(predictedAlt) + - ", allSubsetsConflict=" + - fmt.Sprint(PredictionModeallSubsetsConflict(altSubSets)) + - ", conflictingAlts=" + p.getConflictingAlts(reach).String()) - } - if predictedAlt != ATNInvalidAltNumber { - // NO CONFLICT, UNIQUELY PREDICTED ALT - D.isAcceptState = true - D.configs.uniqueAlt = predictedAlt - D.setPrediction(predictedAlt) - } else if PredictionModehasSLLConflictTerminatingPrediction(p.predictionMode, reach) { - // MORE THAN ONE VIABLE ALTERNATIVE - D.configs.conflictingAlts = p.getConflictingAlts(reach) - D.requiresFullContext = true - // in SLL-only mode, we will stop at p state and return the minimum alt - D.isAcceptState = true - D.setPrediction(D.configs.conflictingAlts.minValue()) - } - if D.isAcceptState && D.configs.hasSemanticContext { - p.predicateDFAState(D, p.atn.getDecisionState(dfa.decision)) - if D.predicates != nil { - D.setPrediction(ATNInvalidAltNumber) - } - } - // all adds to dfa are done after we've created full D state - D = p.addDFAEdge(dfa, previousD, t, D) - return D -} - -func (p *ParserATNSimulator) predicateDFAState(dfaState *DFAState, decisionState DecisionState) { - // We need to test all predicates, even in DFA states that - // uniquely predict alternative. - nalts := len(decisionState.GetTransitions()) - // Update DFA so reach becomes accept state with (predicate,alt) - // pairs if preds found for conflicting alts - altsToCollectPredsFrom := p.getConflictingAltsOrUniqueAlt(dfaState.configs) - altToPred := p.getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState.configs, nalts) - if altToPred != nil { - dfaState.predicates = p.getPredicatePredictions(altsToCollectPredsFrom, altToPred) - dfaState.setPrediction(ATNInvalidAltNumber) // make sure we use preds - } else { - // There are preds in configs but they might go away - // when OR'd together like {p}? || NONE == NONE. If neither - // alt has preds, resolve to min alt - dfaState.setPrediction(altsToCollectPredsFrom.minValue()) - } -} - -// comes back with reach.uniqueAlt set to a valid alt -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 *ATNConfigSet, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) { - - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("execATNWithFullContext " + s0.String()) - } - - fullCtx := true - foundExactAmbig := false - var reach *ATNConfigSet - previous := s0 - input.Seek(startIndex) - t := input.LA(1) - predictedAlt := -1 - - for { // for more work - reach = p.computeReachSet(previous, t, fullCtx) - if reach == nil { - // if any configs in previous dipped into outer context, that - // means that input up to t actually finished entry rule - // at least for LL decision. Full LL doesn't dip into outer - // so don't need special case. - // We will get an error no matter what so delay until after - // decision better error message. Also, no reachable target - // ATN states in SLL implies LL will also get nowhere. - // If conflict in states that dip out, choose min since we - // will get error no matter what. - input.Seek(startIndex) - alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext) - if alt != ATNInvalidAltNumber { - return alt, nil - } - return alt, p.noViableAlt(input, outerContext, previous, startIndex) - } - altSubSets := PredictionModegetConflictingAltSubsets(reach) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("LL altSubSets=" + fmt.Sprint(altSubSets) + ", predict=" + - strconv.Itoa(PredictionModegetUniqueAlt(altSubSets)) + ", resolvesToJustOneViableAlt=" + - fmt.Sprint(PredictionModeresolvesToJustOneViableAlt(altSubSets))) - } - reach.uniqueAlt = p.getUniqueAlt(reach) - // unique prediction? - if reach.uniqueAlt != ATNInvalidAltNumber { - predictedAlt = reach.uniqueAlt - break - } - if p.predictionMode != PredictionModeLLExactAmbigDetection { - predictedAlt = PredictionModeresolvesToJustOneViableAlt(altSubSets) - if predictedAlt != ATNInvalidAltNumber { - break - } - } else { - // In exact ambiguity mode, we never try to terminate early. - // Just keeps scarfing until we know what the conflict is - if PredictionModeallSubsetsConflict(altSubSets) && PredictionModeallSubsetsEqual(altSubSets) { - foundExactAmbig = true - predictedAlt = PredictionModegetSingleViableAlt(altSubSets) - break - } - // else there are multiple non-conflicting subsets or - // we're not sure what the ambiguity is yet. - // So, keep going. - } - previous = reach - if t != TokenEOF { - input.Consume() - t = input.LA(1) - } - } - // If the configuration set uniquely predicts an alternative, - // without conflict, then we know that it's a full LL decision - // not SLL. - if reach.uniqueAlt != ATNInvalidAltNumber { - p.ReportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.Index()) - return predictedAlt, nil - } - // We do not check predicates here because we have checked them - // on-the-fly when doing full context prediction. - - // - // In non-exact ambiguity detection mode, we might actually be able to - // detect an exact ambiguity, but I'm not going to spend the cycles - // needed to check. We only emit ambiguity warnings in exact ambiguity - // mode. - // - // For example, we might know that we have conflicting configurations. - // But, that does not mean that there is no way forward without a - // conflict. It's possible to have non-conflicting alt subsets as in: - // - // altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}] - // - // from - // - // [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]), - // (13,2,[5 10 $]), (21,2,[5 10 $]), (11,2,[$])] - // - // In p case, (17,1,[5 $]) indicates there is some next sequence that - // would resolve p without conflict to alternative 1. Any other viable - // next sequence, however, is associated with a conflict. We stop - // looking for input because no amount of further lookahead will alter - // the fact that we should predict alternative 1. We just can't say for - // sure that there is an ambiguity without looking further. - - p.ReportAmbiguity(dfa, D, startIndex, input.Index(), foundExactAmbig, reach.Alts(), reach) - - return predictedAlt, nil -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) computeReachSet(closure *ATNConfigSet, t int, fullCtx bool) *ATNConfigSet { - if p.mergeCache == nil { - p.mergeCache = NewJPCMap(ReachSetCollection, "Merge cache for computeReachSet()") - } - intermediate := NewATNConfigSet(fullCtx) - - // Configurations already in a rule stop state indicate reaching the end - // of the decision rule (local context) or end of the start rule (full - // context). Once reached, these configurations are never updated by a - // closure operation, so they are handled separately for the performance - // advantage of having a smaller intermediate set when calling closure. - // - // For full-context reach operations, separate handling is required to - // ensure that the alternative Matching the longest overall sequence is - // chosen when multiple such configurations can Match the input. - - var skippedStopStates []*ATNConfig - - // First figure out where we can reach on input t - for _, c := range closure.configs { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("testing " + p.GetTokenName(t) + " at " + c.String()) - } - - if _, ok := c.GetState().(*RuleStopState); ok { - if fullCtx || t == TokenEOF { - skippedStopStates = append(skippedStopStates, c) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("added " + c.String() + " to SkippedStopStates") - } - } - continue - } - - for _, trans := range c.GetState().GetTransitions() { - target := p.getReachableTarget(trans, t) - if target != nil { - cfg := NewATNConfig4(c, target) - intermediate.Add(cfg, p.mergeCache) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("added " + cfg.String() + " to intermediate") - } - } - } - } - - // Now figure out where the reach operation can take us... - var reach *ATNConfigSet - - // This block optimizes the reach operation for intermediate sets which - // trivially indicate a termination state for the overall - // AdaptivePredict operation. - // - // The conditions assume that intermediate - // contains all configurations relevant to the reach set, but p - // condition is not true when one or more configurations have been - // withheld in SkippedStopStates, or when the current symbol is EOF. - // - if skippedStopStates == nil && t != TokenEOF { - if len(intermediate.configs) == 1 { - // Don't pursue the closure if there is just one state. - // It can only have one alternative just add to result - // Also don't pursue the closure if there is unique alternative - // among the configurations. - reach = intermediate - } else if p.getUniqueAlt(intermediate) != ATNInvalidAltNumber { - // Also don't pursue the closure if there is unique alternative - // among the configurations. - reach = intermediate - } - } - // If the reach set could not be trivially determined, perform a closure - // operation on the intermediate set to compute its initial value. - // - if reach == nil { - reach = NewATNConfigSet(fullCtx) - closureBusy := NewClosureBusy("ParserATNSimulator.computeReachSet() make a closureBusy") - treatEOFAsEpsilon := t == TokenEOF - amount := len(intermediate.configs) - for k := 0; k < amount; k++ { - p.closure(intermediate.configs[k], reach, closureBusy, false, fullCtx, treatEOFAsEpsilon) - } - } - if t == TokenEOF { - // After consuming EOF no additional input is possible, so we are - // only interested in configurations which reached the end of the - // decision rule (local context) or end of the start rule (full - // context). Update reach to contain only these configurations. This - // handles both explicit EOF transitions in the grammar and implicit - // EOF transitions following the end of the decision or start rule. - // - // When reach==intermediate, no closure operation was performed. In - // p case, removeAllConfigsNotInRuleStopState needs to check for - // reachable rule stop states as well as configurations already in - // a rule stop state. - // - // This is handled before the configurations in SkippedStopStates, - // because any configurations potentially added from that list are - // already guaranteed to meet this condition whether it's - // required. - // - reach = p.removeAllConfigsNotInRuleStopState(reach, reach.Equals(intermediate)) - } - // If SkippedStopStates!=nil, then it contains at least one - // configuration. For full-context reach operations, these - // configurations reached the end of the start rule, in which case we - // only add them back to reach if no configuration during the current - // closure operation reached such a state. This ensures AdaptivePredict - // chooses an alternative Matching the longest overall sequence when - // multiple alternatives are viable. - // - if skippedStopStates != nil && ((!fullCtx) || (!PredictionModehasConfigInRuleStopState(reach))) { - for l := 0; l < len(skippedStopStates); l++ { - reach.Add(skippedStopStates[l], p.mergeCache) - } - } - - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("computeReachSet " + closure.String() + " -> " + reach.String()) - } - - if len(reach.configs) == 0 { - return nil - } - - return reach -} - -// removeAllConfigsNotInRuleStopState returns a configuration set containing only the configurations from -// configs which are in a [RuleStopState]. If all -// configurations in configs are already in a rule stop state, this -// method simply returns configs. -// -// When lookToEndOfRule is true, this method uses -// [ATN].[NextTokens] for each configuration in configs which is -// not already in a rule stop state to see if a rule stop state is reachable -// from the configuration via epsilon-only transitions. -// -// When lookToEndOfRule is true, this method checks for rule stop states -// reachable by epsilon-only transitions from each configuration in -// configs. -// -// The func returns configs if all configurations in configs are in a -// rule stop state, otherwise it returns a new configuration set containing only -// the configurations from configs which are in a rule stop state -func (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs *ATNConfigSet, lookToEndOfRule bool) *ATNConfigSet { - if PredictionModeallConfigsInRuleStopStates(configs) { - return configs - } - result := NewATNConfigSet(configs.fullCtx) - for _, config := range configs.configs { - if _, ok := config.GetState().(*RuleStopState); ok { - result.Add(config, p.mergeCache) - continue - } - if lookToEndOfRule && config.GetState().GetEpsilonOnlyTransitions() { - NextTokens := p.atn.NextTokens(config.GetState(), nil) - if NextTokens.contains(TokenEpsilon) { - endOfRuleState := p.atn.ruleToStopState[config.GetState().GetRuleIndex()] - result.Add(NewATNConfig4(config, endOfRuleState), p.mergeCache) - } - } - } - return result -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, fullCtx bool) *ATNConfigSet { - // always at least the implicit call to start rule - initialContext := predictionContextFromRuleContext(p.atn, ctx) - configs := NewATNConfigSet(fullCtx) - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("computeStartState from ATN state " + a.String() + - " initialContext=" + initialContext.String()) - } - - for i := 0; i < len(a.GetTransitions()); i++ { - target := a.GetTransitions()[i].getTarget() - c := NewATNConfig6(target, i+1, initialContext) - closureBusy := NewClosureBusy("ParserATNSimulator.computeStartState() make a closureBusy") - p.closure(c, configs, closureBusy, true, fullCtx, false) - } - return configs -} - -// applyPrecedenceFilter transforms the start state computed by -// [computeStartState] to the special start state used by a -// precedence [DFA] for a particular precedence value. The transformation -// process applies the following changes to the start state's configuration -// set. -// -// 1. Evaluate the precedence predicates for each configuration using -// [SemanticContext].evalPrecedence. -// 2. Remove all configurations which predict an alternative greater than -// 1, for which another configuration that predicts alternative 1 is in the -// same ATN state with the same prediction context. -// -// Transformation 2 is valid for the following reasons: -// -// - The closure block cannot contain any epsilon transitions which bypass -// the body of the closure, so all states reachable via alternative 1 are -// part of the precedence alternatives of the transformed left-recursive -// rule. -// - The "primary" portion of a left recursive rule cannot contain an -// epsilon transition, so the only way an alternative other than 1 can exist -// in a state that is also reachable via alternative 1 is by nesting calls -// to the left-recursive rule, with the outer calls not being at the -// preferred precedence level. -// -// The prediction context must be considered by this filter to address -// situations like the following: -// -// grammar TA -// prog: statement* EOF -// statement: letterA | statement letterA 'b' -// letterA: 'a' -// -// In the above grammar, the [ATN] state immediately before the token -// reference 'a' in letterA is reachable from the left edge -// of both the primary and closure blocks of the left-recursive rule -// statement. The prediction context associated with each of these -// configurations distinguishes between them, and prevents the alternative -// which stepped out to prog, and then back in to statement -// from being eliminated by the filter. -// -// The func returns the transformed configuration set representing the start state -// for a precedence [DFA] at a particular precedence level (determined by -// calling [Parser].getPrecedence). -func (p *ParserATNSimulator) applyPrecedenceFilter(configs *ATNConfigSet) *ATNConfigSet { - - statesFromAlt1 := make(map[int]*PredictionContext) - configSet := NewATNConfigSet(configs.fullCtx) - - for _, config := range configs.configs { - // handle alt 1 first - if config.GetAlt() != 1 { - continue - } - updatedContext := config.GetSemanticContext().evalPrecedence(p.parser, p.outerContext) - if updatedContext == nil { - // the configuration was eliminated - continue - } - statesFromAlt1[config.GetState().GetStateNumber()] = config.GetContext() - if updatedContext != config.GetSemanticContext() { - configSet.Add(NewATNConfig2(config, updatedContext), p.mergeCache) - } else { - configSet.Add(config, p.mergeCache) - } - } - for _, config := range configs.configs { - - if config.GetAlt() == 1 { - // already handled - continue - } - // In the future, p elimination step could be updated to also - // filter the prediction context for alternatives predicting alt>1 - // (basically a graph subtraction algorithm). - if !config.getPrecedenceFilterSuppressed() { - context := statesFromAlt1[config.GetState().GetStateNumber()] - if context != nil && context.Equals(config.GetContext()) { - // eliminated - continue - } - } - configSet.Add(config, p.mergeCache) - } - return configSet -} - -func (p *ParserATNSimulator) getReachableTarget(trans Transition, ttype int) ATNState { - if trans.Matches(ttype, 0, p.atn.maxTokenType) { - return trans.getTarget() - } - - return nil -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs *ATNConfigSet, nalts int) []SemanticContext { - - altToPred := make([]SemanticContext, nalts+1) - for _, c := range configs.configs { - if ambigAlts.contains(c.GetAlt()) { - altToPred[c.GetAlt()] = SemanticContextorContext(altToPred[c.GetAlt()], c.GetSemanticContext()) - } - } - nPredAlts := 0 - for i := 1; i <= nalts; i++ { - pred := altToPred[i] - if pred == nil { - altToPred[i] = SemanticContextNone - } else if pred != SemanticContextNone { - nPredAlts++ - } - } - // unambiguous alts are nil in altToPred - if nPredAlts == 0 { - altToPred = nil - } - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("getPredsForAmbigAlts result " + fmt.Sprint(altToPred)) - } - return altToPred -} - -func (p *ParserATNSimulator) getPredicatePredictions(ambigAlts *BitSet, altToPred []SemanticContext) []*PredPrediction { - pairs := make([]*PredPrediction, 0) - containsPredicate := false - for i := 1; i < len(altToPred); i++ { - pred := altToPred[i] - // un-predicated is indicated by SemanticContextNONE - if ambigAlts != nil && ambigAlts.contains(i) { - pairs = append(pairs, NewPredPrediction(pred, i)) - } - if pred != SemanticContextNone { - containsPredicate = true - } - } - if !containsPredicate { - return nil - } - return pairs -} - -// getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule is used to improve the localization of error messages by -// choosing an alternative rather than panic a NoViableAltException in particular prediction scenarios where the -// Error state was reached during [ATN] simulation. -// -// The default implementation of this method uses the following -// algorithm to identify an [ATN] configuration which successfully parsed the -// decision entry rule. Choosing such an alternative ensures that the -// [ParserRuleContext] returned by the calling rule will be complete -// and valid, and the syntax error will be Reported later at a more -// localized location. -// -// - If a syntactically valid path or paths reach the end of the decision rule, and -// they are semantically valid if predicated, return the min associated alt. -// - Else, if a semantically invalid but syntactically valid path exist -// or paths exist, return the minimum associated alt. -// - Otherwise, return [ATNInvalidAltNumber]. -// -// In some scenarios, the algorithm described above could predict an -// alternative which will result in a [FailedPredicateException] in -// the parser. Specifically, this could occur if the only configuration -// capable of successfully parsing to the end of the decision rule is -// blocked by a semantic predicate. By choosing this alternative within -// [AdaptivePredict] instead of panic a [NoViableAltException], the resulting -// [FailedPredicateException] in the parser will identify the specific -// predicate which is preventing the parser from successfully parsing the -// decision rule, which helps developers identify and correct logic errors -// in semantic predicates. -// -// pass in the configs holding ATN configurations which were valid immediately before -// the ERROR state was reached, outerContext as the initial parser context from the paper -// or the parser stack at the instant before prediction commences. -// -// Teh func returns the value to return from [AdaptivePredict], or -// [ATNInvalidAltNumber] if a suitable alternative was not -// identified and [AdaptivePredict] should report an error instead. -func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs *ATNConfigSet, outerContext ParserRuleContext) int { - cfgs := p.splitAccordingToSemanticValidity(configs, outerContext) - semValidConfigs := cfgs[0] - semInvalidConfigs := cfgs[1] - alt := p.GetAltThatFinishedDecisionEntryRule(semValidConfigs) - if alt != ATNInvalidAltNumber { // semantically/syntactically viable path exists - return alt - } - // Is there a syntactically valid path with a failed pred? - if len(semInvalidConfigs.configs) > 0 { - alt = p.GetAltThatFinishedDecisionEntryRule(semInvalidConfigs) - if alt != ATNInvalidAltNumber { // syntactically viable path exists - return alt - } - } - return ATNInvalidAltNumber -} - -func (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs *ATNConfigSet) int { - alts := NewIntervalSet() - - for _, c := range configs.configs { - _, ok := c.GetState().(*RuleStopState) - - if c.GetReachesIntoOuterContext() > 0 || (ok && c.GetContext().hasEmptyPath()) { - alts.addOne(c.GetAlt()) - } - } - if alts.length() == 0 { - return ATNInvalidAltNumber - } - - return alts.first() -} - -// Walk the list of configurations and split them according to -// those that have preds evaluating to true/false. If no pred, assume -// true pred and include in succeeded set. Returns Pair of sets. -// -// Create a NewSet so as not to alter the incoming parameter. -// -// Assumption: the input stream has been restored to the starting point -// prediction, which is where predicates need to evaluate. - -type ATNConfigSetPair struct { - item0, item1 *ATNConfigSet -} - -func (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs *ATNConfigSet, outerContext ParserRuleContext) []*ATNConfigSet { - succeeded := NewATNConfigSet(configs.fullCtx) - failed := NewATNConfigSet(configs.fullCtx) - - for _, c := range configs.configs { - if c.GetSemanticContext() != SemanticContextNone { - predicateEvaluationResult := c.GetSemanticContext().evaluate(p.parser, outerContext) - if predicateEvaluationResult { - succeeded.Add(c, nil) - } else { - failed.Add(c, nil) - } - } else { - succeeded.Add(c, nil) - } - } - return []*ATNConfigSet{succeeded, failed} -} - -// evalSemanticContext looks through a list of predicate/alt pairs, returning alts for the -// pairs that win. A [SemanticContextNone] predicate indicates an alt containing an -// un-predicated runtimeConfig which behaves as "always true." If !complete -// then we stop at the first predicate that evaluates to true. This -// includes pairs with nil predicates. -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPrediction, outerContext ParserRuleContext, complete bool) *BitSet { - predictions := NewBitSet() - for i := 0; i < len(predPredictions); i++ { - pair := predPredictions[i] - if pair.pred == SemanticContextNone { - predictions.add(pair.alt) - if !complete { - break - } - continue - } - - predicateEvaluationResult := pair.pred.evaluate(p.parser, outerContext) - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug { - fmt.Println("eval pred " + pair.String() + "=" + fmt.Sprint(predicateEvaluationResult)) - } - if predicateEvaluationResult { - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug { - fmt.Println("PREDICT " + fmt.Sprint(pair.alt)) - } - predictions.add(pair.alt) - if !complete { - break - } - } - } - return predictions -} - -func (p *ParserATNSimulator) closure(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx, treatEOFAsEpsilon bool) { - initialDepth := 0 - p.closureCheckingStopState(config, configs, closureBusy, collectPredicates, - fullCtx, initialDepth, treatEOFAsEpsilon) -} - -func (p *ParserATNSimulator) closureCheckingStopState(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) { - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("closure(" + config.String() + ")") - } - - var stack []*ATNConfig - visited := make(map[*ATNConfig]bool) - - stack = append(stack, config) - - for len(stack) > 0 { - currConfig := stack[len(stack)-1] - stack = stack[:len(stack)-1] - - if _, ok := visited[currConfig]; ok { - continue - } - visited[currConfig] = true - - if _, ok := currConfig.GetState().(*RuleStopState); ok { - // We hit rule end. If we have context info, use it - // run thru all possible stack tops in ctx - if !currConfig.GetContext().isEmpty() { - for i := 0; i < currConfig.GetContext().length(); i++ { - if currConfig.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState { - if fullCtx { - nb := NewATNConfig1(currConfig, currConfig.GetState(), BasePredictionContextEMPTY) - configs.Add(nb, p.mergeCache) - continue - } else { - // we have no context info, just chase follow links (if greedy) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("FALLING off rule " + p.getRuleName(currConfig.GetState().GetRuleIndex())) - } - p.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon) - } - continue - } - returnState := p.atn.states[currConfig.GetContext().getReturnState(i)] - newContext := currConfig.GetContext().GetParent(i) // "pop" return state - - c := NewATNConfig5(returnState, currConfig.GetAlt(), newContext, currConfig.GetSemanticContext()) - // While we have context to pop back from, we may have - // gotten that context AFTER having falling off a rule. - // Make sure we track that we are now out of context. - c.SetReachesIntoOuterContext(currConfig.GetReachesIntoOuterContext()) - - stack = append(stack, c) - } - continue - } else if fullCtx { - // reached end of start rule - configs.Add(currConfig, p.mergeCache) - continue - } else { - // else if we have no context info, just chase follow links (if greedy) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("FALLING off rule " + p.getRuleName(currConfig.GetState().GetRuleIndex())) - } - } - } - - p.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon) - } -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) closureCheckingStopStateRecursive(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) { - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("closure(" + config.String() + ")") - } - - if _, ok := config.GetState().(*RuleStopState); ok { - // We hit rule end. If we have context info, use it - // run thru all possible stack tops in ctx - if !config.GetContext().isEmpty() { - for i := 0; i < config.GetContext().length(); i++ { - if config.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState { - if fullCtx { - nb := NewATNConfig1(config, config.GetState(), BasePredictionContextEMPTY) - configs.Add(nb, p.mergeCache) - continue - } else { - // we have no context info, just chase follow links (if greedy) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex())) - } - p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon) - } - continue - } - returnState := p.atn.states[config.GetContext().getReturnState(i)] - newContext := config.GetContext().GetParent(i) // "pop" return state - - c := NewATNConfig5(returnState, config.GetAlt(), newContext, config.GetSemanticContext()) - // While we have context to pop back from, we may have - // gotten that context AFTER having falling off a rule. - // Make sure we track that we are now out of context. - c.SetReachesIntoOuterContext(config.GetReachesIntoOuterContext()) - p.closureCheckingStopState(c, configs, closureBusy, collectPredicates, fullCtx, depth-1, treatEOFAsEpsilon) - } - return - } else if fullCtx { - // reached end of start rule - configs.Add(config, p.mergeCache) - return - } else { - // else if we have no context info, just chase follow links (if greedy) - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex())) - } - } - } - p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon) -} - -// Do the actual work of walking epsilon edges -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) closureWork(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) { - state := config.GetState() - // optimization - if !state.GetEpsilonOnlyTransitions() { - configs.Add(config, p.mergeCache) - // make sure to not return here, because EOF transitions can act as - // both epsilon transitions and non-epsilon transitions. - } - for i := 0; i < len(state.GetTransitions()); i++ { - if i == 0 && p.canDropLoopEntryEdgeInLeftRecursiveRule(config) { - continue - } - - t := state.GetTransitions()[i] - _, ok := t.(*ActionTransition) - continueCollecting := collectPredicates && !ok - c := p.getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEOFAsEpsilon) - if c != nil { - newDepth := depth - - if _, ok := config.GetState().(*RuleStopState); ok { - // target fell off end of rule mark resulting c as having dipped into outer context - // We can't get here if incoming config was rule stop and we had context - // track how far we dip into outer context. Might - // come in handy and we avoid evaluating context dependent - // preds if this is > 0. - - if p.dfa != nil && p.dfa.getPrecedenceDfa() { - if t.(*EpsilonTransition).outermostPrecedenceReturn == p.dfa.atnStartState.GetRuleIndex() { - c.setPrecedenceFilterSuppressed(true) - } - } - - c.SetReachesIntoOuterContext(c.GetReachesIntoOuterContext() + 1) - - _, present := closureBusy.Put(c) - if present { - // avoid infinite recursion for right-recursive rules - continue - } - - configs.dipsIntoOuterContext = true // TODO: can remove? only care when we add to set per middle of this method - newDepth-- - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("dips into outer ctx: " + c.String()) - } - } else { - - if !t.getIsEpsilon() { - _, present := closureBusy.Put(c) - if present { - // avoid infinite recursion for EOF* and EOF+ - continue - } - } - if _, ok := t.(*RuleTransition); ok { - // latch when newDepth goes negative - once we step out of the entry context we can't return - if newDepth >= 0 { - newDepth++ - } - } - } - p.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEOFAsEpsilon) - } - } -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) canDropLoopEntryEdgeInLeftRecursiveRule(config *ATNConfig) bool { - if !runtimeConfig.lRLoopEntryBranchOpt { - return false - } - - _p := config.GetState() - - // First check to see if we are in StarLoopEntryState generated during - // left-recursion elimination. For efficiency, also check if - // the context has an empty stack case. If so, it would mean - // global FOLLOW so we can't perform optimization - if _p.GetStateType() != ATNStateStarLoopEntry { - return false - } - startLoop, ok := _p.(*StarLoopEntryState) - if !ok { - return false - } - if !startLoop.precedenceRuleDecision || - config.GetContext().isEmpty() || - config.GetContext().hasEmptyPath() { - return false - } - - // Require all return states to return back to the same rule - // that p is in. - numCtxs := config.GetContext().length() - for i := 0; i < numCtxs; i++ { - returnState := p.atn.states[config.GetContext().getReturnState(i)] - if returnState.GetRuleIndex() != _p.GetRuleIndex() { - return false - } - } - x := _p.GetTransitions()[0].getTarget() - decisionStartState := x.(BlockStartState) - blockEndStateNum := decisionStartState.getEndState().stateNumber - blockEndState := p.atn.states[blockEndStateNum].(*BlockEndState) - - // Verify that the top of each stack context leads to loop entry/exit - // state through epsilon edges and w/o leaving rule. - - for i := 0; i < numCtxs; i++ { // for each stack context - returnStateNumber := config.GetContext().getReturnState(i) - returnState := p.atn.states[returnStateNumber] - - // all states must have single outgoing epsilon edge - if len(returnState.GetTransitions()) != 1 || !returnState.GetTransitions()[0].getIsEpsilon() { - return false - } - - // Look for prefix op case like 'not expr', (' type ')' expr - returnStateTarget := returnState.GetTransitions()[0].getTarget() - if returnState.GetStateType() == ATNStateBlockEnd && returnStateTarget == _p { - continue - } - - // Look for 'expr op expr' or case where expr's return state is block end - // of (...)* internal block; the block end points to loop back - // which points to p but we don't need to check that - if returnState == blockEndState { - continue - } - - // Look for ternary expr ? expr : expr. The return state points at block end, - // which points at loop entry state - if returnStateTarget == blockEndState { - continue - } - - // Look for complex prefix 'between expr and expr' case where 2nd expr's - // return state points at block end state of (...)* internal block - if returnStateTarget.GetStateType() == ATNStateBlockEnd && - len(returnStateTarget.GetTransitions()) == 1 && - returnStateTarget.GetTransitions()[0].getIsEpsilon() && - returnStateTarget.GetTransitions()[0].getTarget() == _p { - continue - } - - // anything else ain't conforming - return false - } - - return true -} - -func (p *ParserATNSimulator) getRuleName(index int) string { - if p.parser != nil && index >= 0 { - return p.parser.GetRuleNames()[index] - } - var sb strings.Builder - sb.Grow(32) - - sb.WriteString("') - return sb.String() -} - -func (p *ParserATNSimulator) getEpsilonTarget(config *ATNConfig, t Transition, collectPredicates, inContext, fullCtx, treatEOFAsEpsilon bool) *ATNConfig { - - switch t.getSerializationType() { - case TransitionRULE: - return p.ruleTransition(config, t.(*RuleTransition)) - case TransitionPRECEDENCE: - return p.precedenceTransition(config, t.(*PrecedencePredicateTransition), collectPredicates, inContext, fullCtx) - case TransitionPREDICATE: - return p.predTransition(config, t.(*PredicateTransition), collectPredicates, inContext, fullCtx) - case TransitionACTION: - return p.actionTransition(config, t.(*ActionTransition)) - case TransitionEPSILON: - return NewATNConfig4(config, t.getTarget()) - case TransitionATOM, TransitionRANGE, TransitionSET: - // EOF transitions act like epsilon transitions after the first EOF - // transition is traversed - if treatEOFAsEpsilon { - if t.Matches(TokenEOF, 0, 1) { - return NewATNConfig4(config, t.getTarget()) - } - } - return nil - default: - return nil - } -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) actionTransition(config *ATNConfig, t *ActionTransition) *ATNConfig { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("ACTION edge " + strconv.Itoa(t.ruleIndex) + ":" + strconv.Itoa(t.actionIndex)) - } - return NewATNConfig4(config, t.getTarget()) -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) precedenceTransition(config *ATNConfig, - pt *PrecedencePredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig { - - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " + - strconv.Itoa(pt.precedence) + ">=_p, ctx dependent=true") - if p.parser != nil { - fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil))) - } - } - var c *ATNConfig - if collectPredicates && inContext { - if fullCtx { - // In full context mode, we can evaluate predicates on-the-fly - // during closure, which dramatically reduces the size of - // the runtimeConfig sets. It also obviates the need to test predicates - // later during conflict resolution. - currentPosition := p.input.Index() - p.input.Seek(p.startIndex) - predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext) - p.input.Seek(currentPosition) - if predSucceeds { - c = NewATNConfig4(config, pt.getTarget()) // no pred context - } - } else { - newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate()) - c = NewATNConfig3(config, pt.getTarget(), newSemCtx) - } - } else { - c = NewATNConfig4(config, pt.getTarget()) - } - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("runtimeConfig from pred transition=" + c.String()) - } - return c -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) predTransition(config *ATNConfig, pt *PredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig { - - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " + strconv.Itoa(pt.ruleIndex) + - ":" + strconv.Itoa(pt.predIndex) + ", ctx dependent=" + fmt.Sprint(pt.isCtxDependent)) - if p.parser != nil { - fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil))) - } - } - var c *ATNConfig - if collectPredicates && (!pt.isCtxDependent || inContext) { - if fullCtx { - // In full context mode, we can evaluate predicates on-the-fly - // during closure, which dramatically reduces the size of - // the config sets. It also obviates the need to test predicates - // later during conflict resolution. - currentPosition := p.input.Index() - p.input.Seek(p.startIndex) - predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext) - p.input.Seek(currentPosition) - if predSucceeds { - c = NewATNConfig4(config, pt.getTarget()) // no pred context - } - } else { - newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate()) - c = NewATNConfig3(config, pt.getTarget(), newSemCtx) - } - } else { - c = NewATNConfig4(config, pt.getTarget()) - } - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("config from pred transition=" + c.String()) - } - return c -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) ruleTransition(config *ATNConfig, t *RuleTransition) *ATNConfig { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("CALL rule " + p.getRuleName(t.getTarget().GetRuleIndex()) + ", ctx=" + config.GetContext().String()) - } - returnState := t.followState - newContext := SingletonBasePredictionContextCreate(config.GetContext(), returnState.GetStateNumber()) - return NewATNConfig1(config, t.getTarget(), newContext) -} - -func (p *ParserATNSimulator) getConflictingAlts(configs *ATNConfigSet) *BitSet { - altsets := PredictionModegetConflictingAltSubsets(configs) - return PredictionModeGetAlts(altsets) -} - -// getConflictingAltsOrUniqueAlt Sam pointed out a problem with the previous definition, v3, of -// ambiguous states. If we have another state associated with conflicting -// alternatives, we should keep going. For example, the following grammar -// -// s : (ID | ID ID?) ; -// -// When the [ATN] simulation reaches the state before ;, it has a [DFA] -// state that looks like: -// -// [12|1|[], 6|2|[], 12|2|[]]. -// -// Naturally -// -// 12|1|[] and 12|2|[] -// -// conflict, but we cannot stop processing this node -// because alternative to has another way to continue, via -// -// [6|2|[]]. -// -// The key is that we have a single state that has config's only associated -// with a single alternative, 2, and crucially the state transitions -// among the configurations are all non-epsilon transitions. That means -// we don't consider any conflicts that include alternative 2. So, we -// ignore the conflict between alts 1 and 2. We ignore a set of -// conflicting alts when there is an intersection with an alternative -// associated with a single alt state in the state config-list map. -// -// It's also the case that we might have two conflicting configurations but -// also a 3rd non-conflicting configuration for a different alternative: -// -// [1|1|[], 1|2|[], 8|3|[]]. -// -// This can come about from grammar: -// -// a : A | A | A B -// -// After Matching input A, we reach the stop state for rule A, state 1. -// State 8 is the state right before B. Clearly alternatives 1 and 2 -// conflict and no amount of further lookahead will separate the two. -// However, alternative 3 will be able to continue, so we do not -// stop working on this state. -// -// In the previous example, we're concerned -// with states associated with the conflicting alternatives. Here alt -// 3 is not associated with the conflicting configs, but since we can continue -// looking for input reasonably, I don't declare the state done. We -// ignore a set of conflicting alts when we have an alternative -// that we still need to pursue. -func (p *ParserATNSimulator) getConflictingAltsOrUniqueAlt(configs *ATNConfigSet) *BitSet { - var conflictingAlts *BitSet - if configs.uniqueAlt != ATNInvalidAltNumber { - conflictingAlts = NewBitSet() - conflictingAlts.add(configs.uniqueAlt) - } else { - conflictingAlts = configs.conflictingAlts - } - return conflictingAlts -} - -func (p *ParserATNSimulator) GetTokenName(t int) string { - if t == TokenEOF { - return "EOF" - } - - if p.parser != nil && p.parser.GetLiteralNames() != nil && t < len(p.parser.GetLiteralNames()) { - return p.parser.GetLiteralNames()[t] + "<" + strconv.Itoa(t) + ">" - } - - if p.parser != nil && p.parser.GetLiteralNames() != nil && t < len(p.parser.GetSymbolicNames()) { - return p.parser.GetSymbolicNames()[t] + "<" + strconv.Itoa(t) + ">" - } - - return strconv.Itoa(t) -} - -func (p *ParserATNSimulator) getLookaheadName(input TokenStream) string { - return p.GetTokenName(input.LA(1)) -} - -// Used for debugging in [AdaptivePredict] around [execATN], but I cut -// it out for clarity now that alg. works well. We can leave this -// "dead" code for a bit. -func (p *ParserATNSimulator) dumpDeadEndConfigs(_ *NoViableAltException) { - - panic("Not implemented") - - // fmt.Println("dead end configs: ") - // var decs = nvae.deadEndConfigs - // - // for i:=0; i0) { - // var t = c.state.GetTransitions()[0] - // if t2, ok := t.(*AtomTransition); ok { - // trans = "Atom "+ p.GetTokenName(t2.label) - // } else if t3, ok := t.(SetTransition); ok { - // _, ok := t.(*NotSetTransition) - // - // var s string - // if (ok){ - // s = "~" - // } - // - // trans = s + "Set " + t3.set - // } - // } - // fmt.Errorf(c.String(p.parser, true) + ":" + trans) - // } -} - -func (p *ParserATNSimulator) noViableAlt(input TokenStream, outerContext ParserRuleContext, configs *ATNConfigSet, startIndex int) *NoViableAltException { - return NewNoViableAltException(p.parser, input, input.Get(startIndex), input.LT(1), configs, outerContext) -} - -func (p *ParserATNSimulator) getUniqueAlt(configs *ATNConfigSet) int { - alt := ATNInvalidAltNumber - for _, c := range configs.configs { - if alt == ATNInvalidAltNumber { - alt = c.GetAlt() // found first alt - } else if c.GetAlt() != alt { - return ATNInvalidAltNumber - } - } - return alt -} - -// Add an edge to the DFA, if possible. This method calls -// {@link //addDFAState} to ensure the {@code to} state is present in the -// DFA. If {@code from} is {@code nil}, or if {@code t} is outside the -// range of edges that can be represented in the DFA tables, p method -// returns without adding the edge to the DFA. -// -//

If {@code to} is {@code nil}, p method returns {@code nil}. -// Otherwise, p method returns the {@link DFAState} returned by calling -// {@link //addDFAState} for the {@code to} state.

-// -// @param dfa The DFA -// @param from The source state for the edge -// @param t The input symbol -// @param to The target state for the edge -// -// @return If {@code to} is {@code nil}, p method returns {@code nil} -// otherwise p method returns the result of calling {@link //addDFAState} -// on {@code to} -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFAState) *DFAState { - if runtimeConfig.parserATNSimulatorDebug { - fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + p.GetTokenName(t)) - } - if to == nil { - return nil - } - p.atn.stateMu.Lock() - to = p.addDFAState(dfa, to) // used existing if possible not incoming - p.atn.stateMu.Unlock() - if from == nil || t < -1 || t > p.atn.maxTokenType { - return to - } - p.atn.edgeMu.Lock() - if from.getEdges() == nil { - from.setEdges(make([]*DFAState, p.atn.maxTokenType+1+1)) - } - from.setIthEdge(t+1, to) // connect - p.atn.edgeMu.Unlock() - - if runtimeConfig.parserATNSimulatorDebug { - var names []string - if p.parser != nil { - names = p.parser.GetLiteralNames() - } - - fmt.Println("DFA=\n" + dfa.String(names, nil)) - } - return to -} - -// addDFAState adds state D to the [DFA] if it is not already present, and returns -// the actual instance stored in the [DFA]. If a state equivalent to D -// is already in the [DFA], the existing state is returned. Otherwise, this -// method returns D after adding it to the [DFA]. -// -// If D is [ATNSimulatorError], this method returns [ATNSimulatorError] and -// does not change the DFA. -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) addDFAState(dfa *DFA, d *DFAState) *DFAState { - if d == ATNSimulatorError { - return d - } - - existing, present := dfa.Get(d) - if present { - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Print("addDFAState " + d.String() + " exists") - } - return existing - } - - // The state will be added if not already there or we will be given back the existing state struct - // if it is present. - // - d.stateNumber = dfa.Len() - if !d.configs.readOnly { - d.configs.OptimizeConfigs(&p.BaseATNSimulator) - d.configs.readOnly = true - d.configs.configLookup = nil - } - dfa.Put(d) - - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("addDFAState new " + d.String()) - } - - return d -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAlts *BitSet, configs *ATNConfigSet, startIndex, stopIndex int) { - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug { - interval := NewInterval(startIndex, stopIndex+1) - fmt.Println("ReportAttemptingFullContext decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() + - ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval)) - } - if p.parser != nil { - p.parser.GetErrorListenerDispatch().ReportAttemptingFullContext(p.parser, dfa, startIndex, stopIndex, conflictingAlts, configs) - } -} - -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int, configs *ATNConfigSet, startIndex, stopIndex int) { - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug { - interval := NewInterval(startIndex, stopIndex+1) - fmt.Println("ReportContextSensitivity decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() + - ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval)) - } - if p.parser != nil { - p.parser.GetErrorListenerDispatch().ReportContextSensitivity(p.parser, dfa, startIndex, stopIndex, prediction, configs) - } -} - -// ReportAmbiguity reports and ambiguity in the parse, which shows that the parser will explore a different route. -// -// If context-sensitive parsing, we know it's an ambiguity not a conflict or error, but we can report it to the developer -// so that they can see that this is happening and can take action if they want to. -// -//goland:noinspection GoBoolExpressions -func (p *ParserATNSimulator) ReportAmbiguity(dfa *DFA, _ *DFAState, startIndex, stopIndex int, - exact bool, ambigAlts *BitSet, configs *ATNConfigSet) { - if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug { - interval := NewInterval(startIndex, stopIndex+1) - fmt.Println("ReportAmbiguity " + ambigAlts.String() + ":" + configs.String() + - ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval)) - } - if p.parser != nil { - p.parser.GetErrorListenerDispatch().ReportAmbiguity(p.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs) - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go b/vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go deleted file mode 100644 index c249bc138..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "reflect" - "strconv" -) - -type ParserRuleContext interface { - RuleContext - - SetException(RecognitionException) - - AddTokenNode(token Token) *TerminalNodeImpl - AddErrorNode(badToken Token) *ErrorNodeImpl - - EnterRule(listener ParseTreeListener) - ExitRule(listener ParseTreeListener) - - SetStart(Token) - GetStart() Token - - SetStop(Token) - GetStop() Token - - AddChild(child RuleContext) RuleContext - RemoveLastChild() -} - -type BaseParserRuleContext struct { - parentCtx RuleContext - invokingState int - RuleIndex int - - start, stop Token - exception RecognitionException - children []Tree -} - -func NewBaseParserRuleContext(parent ParserRuleContext, invokingStateNumber int) *BaseParserRuleContext { - prc := new(BaseParserRuleContext) - InitBaseParserRuleContext(prc, parent, invokingStateNumber) - return prc -} - -func InitBaseParserRuleContext(prc *BaseParserRuleContext, parent ParserRuleContext, invokingStateNumber int) { - // What context invoked b rule? - prc.parentCtx = parent - - // What state invoked the rule associated with b context? - // The "return address" is the followState of invokingState - // If parent is nil, b should be -1. - if parent == nil { - prc.invokingState = -1 - } else { - prc.invokingState = invokingStateNumber - } - - prc.RuleIndex = -1 - // * If we are debugging or building a parse tree for a Visitor, - // we need to track all of the tokens and rule invocations associated - // with prc rule's context. This is empty for parsing w/o tree constr. - // operation because we don't the need to track the details about - // how we parse prc rule. - // / - prc.children = nil - prc.start = nil - prc.stop = nil - // The exception that forced prc rule to return. If the rule successfully - // completed, prc is {@code nil}. - prc.exception = nil -} - -func (prc *BaseParserRuleContext) SetException(e RecognitionException) { - prc.exception = e -} - -func (prc *BaseParserRuleContext) GetChildren() []Tree { - return prc.children -} - -func (prc *BaseParserRuleContext) CopyFrom(ctx *BaseParserRuleContext) { - // from RuleContext - prc.parentCtx = ctx.parentCtx - prc.invokingState = ctx.invokingState - prc.children = nil - prc.start = ctx.start - prc.stop = ctx.stop -} - -func (prc *BaseParserRuleContext) GetText() string { - if prc.GetChildCount() == 0 { - return "" - } - - var s string - for _, child := range prc.children { - s += child.(ParseTree).GetText() - } - - return s -} - -// EnterRule is called when any rule is entered. -func (prc *BaseParserRuleContext) EnterRule(_ ParseTreeListener) { -} - -// ExitRule is called when any rule is exited. -func (prc *BaseParserRuleContext) ExitRule(_ ParseTreeListener) { -} - -// * Does not set parent link other add methods do that -func (prc *BaseParserRuleContext) addTerminalNodeChild(child TerminalNode) TerminalNode { - if prc.children == nil { - prc.children = make([]Tree, 0) - } - if child == nil { - panic("Child may not be null") - } - prc.children = append(prc.children, child) - return child -} - -func (prc *BaseParserRuleContext) AddChild(child RuleContext) RuleContext { - if prc.children == nil { - prc.children = make([]Tree, 0) - } - if child == nil { - panic("Child may not be null") - } - prc.children = append(prc.children, child) - return child -} - -// RemoveLastChild is used by [EnterOuterAlt] to toss out a [RuleContext] previously added as -// we entered a rule. If we have a label, we will need to remove -// the generic ruleContext object. -func (prc *BaseParserRuleContext) RemoveLastChild() { - if prc.children != nil && len(prc.children) > 0 { - prc.children = prc.children[0 : len(prc.children)-1] - } -} - -func (prc *BaseParserRuleContext) AddTokenNode(token Token) *TerminalNodeImpl { - - node := NewTerminalNodeImpl(token) - prc.addTerminalNodeChild(node) - node.parentCtx = prc - return node - -} - -func (prc *BaseParserRuleContext) AddErrorNode(badToken Token) *ErrorNodeImpl { - node := NewErrorNodeImpl(badToken) - prc.addTerminalNodeChild(node) - node.parentCtx = prc - return node -} - -func (prc *BaseParserRuleContext) GetChild(i int) Tree { - if prc.children != nil && len(prc.children) >= i { - return prc.children[i] - } - - return nil -} - -func (prc *BaseParserRuleContext) GetChildOfType(i int, childType reflect.Type) RuleContext { - if childType == nil { - return prc.GetChild(i).(RuleContext) - } - - for j := 0; j < len(prc.children); j++ { - child := prc.children[j] - if reflect.TypeOf(child) == childType { - if i == 0 { - return child.(RuleContext) - } - - i-- - } - } - - return nil -} - -func (prc *BaseParserRuleContext) ToStringTree(ruleNames []string, recog Recognizer) string { - return TreesStringTree(prc, ruleNames, recog) -} - -func (prc *BaseParserRuleContext) GetRuleContext() RuleContext { - return prc -} - -func (prc *BaseParserRuleContext) Accept(visitor ParseTreeVisitor) interface{} { - return visitor.VisitChildren(prc) -} - -func (prc *BaseParserRuleContext) SetStart(t Token) { - prc.start = t -} - -func (prc *BaseParserRuleContext) GetStart() Token { - return prc.start -} - -func (prc *BaseParserRuleContext) SetStop(t Token) { - prc.stop = t -} - -func (prc *BaseParserRuleContext) GetStop() Token { - return prc.stop -} - -func (prc *BaseParserRuleContext) GetToken(ttype int, i int) TerminalNode { - - for j := 0; j < len(prc.children); j++ { - child := prc.children[j] - if c2, ok := child.(TerminalNode); ok { - if c2.GetSymbol().GetTokenType() == ttype { - if i == 0 { - return c2 - } - - i-- - } - } - } - return nil -} - -func (prc *BaseParserRuleContext) GetTokens(ttype int) []TerminalNode { - if prc.children == nil { - return make([]TerminalNode, 0) - } - - tokens := make([]TerminalNode, 0) - - for j := 0; j < len(prc.children); j++ { - child := prc.children[j] - if tchild, ok := child.(TerminalNode); ok { - if tchild.GetSymbol().GetTokenType() == ttype { - tokens = append(tokens, tchild) - } - } - } - - return tokens -} - -func (prc *BaseParserRuleContext) GetPayload() interface{} { - return prc -} - -func (prc *BaseParserRuleContext) getChild(ctxType reflect.Type, i int) RuleContext { - if prc.children == nil || i < 0 || i >= len(prc.children) { - return nil - } - - j := -1 // what element have we found with ctxType? - for _, o := range prc.children { - - childType := reflect.TypeOf(o) - - if childType.Implements(ctxType) { - j++ - if j == i { - return o.(RuleContext) - } - } - } - return nil -} - -// Go lacks generics, so it's not possible for us to return the child with the correct type, but we do -// check for convertibility - -func (prc *BaseParserRuleContext) GetTypedRuleContext(ctxType reflect.Type, i int) RuleContext { - return prc.getChild(ctxType, i) -} - -func (prc *BaseParserRuleContext) GetTypedRuleContexts(ctxType reflect.Type) []RuleContext { - if prc.children == nil { - return make([]RuleContext, 0) - } - - contexts := make([]RuleContext, 0) - - for _, child := range prc.children { - childType := reflect.TypeOf(child) - - if childType.ConvertibleTo(ctxType) { - contexts = append(contexts, child.(RuleContext)) - } - } - return contexts -} - -func (prc *BaseParserRuleContext) GetChildCount() int { - if prc.children == nil { - return 0 - } - - return len(prc.children) -} - -func (prc *BaseParserRuleContext) GetSourceInterval() Interval { - if prc.start == nil || prc.stop == nil { - return TreeInvalidInterval - } - - return NewInterval(prc.start.GetTokenIndex(), prc.stop.GetTokenIndex()) -} - -//need to manage circular dependencies, so export now - -// Print out a whole tree, not just a node, in LISP format -// (root child1 .. childN). Print just a node if b is a leaf. -// - -func (prc *BaseParserRuleContext) String(ruleNames []string, stop RuleContext) string { - - var p ParserRuleContext = prc - s := "[" - for p != nil && p != stop { - if ruleNames == nil { - if !p.IsEmpty() { - s += strconv.Itoa(p.GetInvokingState()) - } - } else { - ri := p.GetRuleIndex() - var ruleName string - if ri >= 0 && ri < len(ruleNames) { - ruleName = ruleNames[ri] - } else { - ruleName = strconv.Itoa(ri) - } - s += ruleName - } - if p.GetParent() != nil && (ruleNames != nil || !p.GetParent().(ParserRuleContext).IsEmpty()) { - s += " " - } - pi := p.GetParent() - if pi != nil { - p = pi.(ParserRuleContext) - } else { - p = nil - } - } - s += "]" - return s -} - -func (prc *BaseParserRuleContext) SetParent(v Tree) { - if v == nil { - prc.parentCtx = nil - } else { - prc.parentCtx = v.(RuleContext) - } -} - -func (prc *BaseParserRuleContext) GetInvokingState() int { - return prc.invokingState -} - -func (prc *BaseParserRuleContext) SetInvokingState(t int) { - prc.invokingState = t -} - -func (prc *BaseParserRuleContext) GetRuleIndex() int { - return prc.RuleIndex -} - -func (prc *BaseParserRuleContext) GetAltNumber() int { - return ATNInvalidAltNumber -} - -func (prc *BaseParserRuleContext) SetAltNumber(_ int) {} - -// IsEmpty returns true if the context of b is empty. -// -// A context is empty if there is no invoking state, meaning nobody calls -// current context. -func (prc *BaseParserRuleContext) IsEmpty() bool { - return prc.invokingState == -1 -} - -// GetParent returns the combined text of all child nodes. This method only considers -// tokens which have been added to the parse tree. -// -// Since tokens on hidden channels (e.g. whitespace or comments) are not -// added to the parse trees, they will not appear in the output of this -// method. -func (prc *BaseParserRuleContext) GetParent() Tree { - return prc.parentCtx -} - -var ParserRuleContextEmpty = NewBaseParserRuleContext(nil, -1) - -type InterpreterRuleContext interface { - ParserRuleContext -} - -type BaseInterpreterRuleContext struct { - *BaseParserRuleContext -} - -//goland:noinspection GoUnusedExportedFunction -func NewBaseInterpreterRuleContext(parent BaseInterpreterRuleContext, invokingStateNumber, ruleIndex int) *BaseInterpreterRuleContext { - - prc := new(BaseInterpreterRuleContext) - - prc.BaseParserRuleContext = NewBaseParserRuleContext(parent, invokingStateNumber) - - prc.RuleIndex = ruleIndex - - return prc -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go deleted file mode 100644 index c1b80cc1f..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go +++ /dev/null @@ -1,727 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "golang.org/x/exp/slices" - "strconv" -) - -var _emptyPredictionContextHash int - -func init() { - _emptyPredictionContextHash = murmurInit(1) - _emptyPredictionContextHash = murmurFinish(_emptyPredictionContextHash, 0) -} - -func calculateEmptyHash() int { - return _emptyPredictionContextHash -} - -const ( - // BasePredictionContextEmptyReturnState represents {@code $} in an array in full context mode, $ - // doesn't mean wildcard: - // - // $ + x = [$,x] - // - // Here, - // - // $ = EmptyReturnState - BasePredictionContextEmptyReturnState = 0x7FFFFFFF -) - -// TODO: JI These are meant to be atomics - this does not seem to match the Java runtime here -// -//goland:noinspection GoUnusedGlobalVariable -var ( - BasePredictionContextglobalNodeCount = 1 - BasePredictionContextid = BasePredictionContextglobalNodeCount -) - -const ( - PredictionContextEmpty = iota - PredictionContextSingleton - PredictionContextArray -) - -// PredictionContext is a go idiomatic implementation of PredictionContext that does not rty to -// emulate inheritance from Java, and can be used without an interface definition. An interface -// is not required because no user code will ever need to implement this interface. -type PredictionContext struct { - cachedHash int - pcType int - parentCtx *PredictionContext - returnState int - parents []*PredictionContext - returnStates []int -} - -func NewEmptyPredictionContext() *PredictionContext { - nep := &PredictionContext{} - nep.cachedHash = calculateEmptyHash() - nep.pcType = PredictionContextEmpty - nep.returnState = BasePredictionContextEmptyReturnState - return nep -} - -func NewBaseSingletonPredictionContext(parent *PredictionContext, returnState int) *PredictionContext { - pc := &PredictionContext{} - pc.pcType = PredictionContextSingleton - pc.returnState = returnState - pc.parentCtx = parent - if parent != nil { - pc.cachedHash = calculateHash(parent, returnState) - } else { - pc.cachedHash = calculateEmptyHash() - } - return pc -} - -func SingletonBasePredictionContextCreate(parent *PredictionContext, returnState int) *PredictionContext { - if returnState == BasePredictionContextEmptyReturnState && parent == nil { - // someone can pass in the bits of an array ctx that mean $ - return BasePredictionContextEMPTY - } - return NewBaseSingletonPredictionContext(parent, returnState) -} - -func NewArrayPredictionContext(parents []*PredictionContext, returnStates []int) *PredictionContext { - // Parent can be nil only if full ctx mode and we make an array - // from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using - // nil parent and - // returnState == {@link //EmptyReturnState}. - hash := murmurInit(1) - for _, parent := range parents { - hash = murmurUpdate(hash, parent.Hash()) - } - for _, returnState := range returnStates { - hash = murmurUpdate(hash, returnState) - } - hash = murmurFinish(hash, len(parents)<<1) - - nec := &PredictionContext{} - nec.cachedHash = hash - nec.pcType = PredictionContextArray - nec.parents = parents - nec.returnStates = returnStates - return nec -} - -func (p *PredictionContext) Hash() int { - return p.cachedHash -} - -func (p *PredictionContext) Equals(other Collectable[*PredictionContext]) bool { - switch p.pcType { - case PredictionContextEmpty: - otherP := other.(*PredictionContext) - return other == nil || otherP == nil || otherP.isEmpty() - case PredictionContextSingleton: - return p.SingletonEquals(other) - case PredictionContextArray: - return p.ArrayEquals(other) - } - return false -} - -func (p *PredictionContext) ArrayEquals(o Collectable[*PredictionContext]) bool { - if o == nil { - return false - } - other := o.(*PredictionContext) - if other == nil || other.pcType != PredictionContextArray { - return false - } - if p.cachedHash != other.Hash() { - return false // can't be same if hash is different - } - - // Must compare the actual array elements and not just the array address - // - return slices.Equal(p.returnStates, other.returnStates) && - slices.EqualFunc(p.parents, other.parents, func(x, y *PredictionContext) bool { - return x.Equals(y) - }) -} - -func (p *PredictionContext) SingletonEquals(other Collectable[*PredictionContext]) bool { - if other == nil { - return false - } - otherP := other.(*PredictionContext) - if otherP == nil { - return false - } - - if p.cachedHash != otherP.Hash() { - return false // Can't be same if hash is different - } - - if p.returnState != otherP.getReturnState(0) { - return false - } - - // Both parents must be nil if one is - if p.parentCtx == nil { - return otherP.parentCtx == nil - } - - return p.parentCtx.Equals(otherP.parentCtx) -} - -func (p *PredictionContext) GetParent(i int) *PredictionContext { - switch p.pcType { - case PredictionContextEmpty: - return nil - case PredictionContextSingleton: - return p.parentCtx - case PredictionContextArray: - return p.parents[i] - } - return nil -} - -func (p *PredictionContext) getReturnState(i int) int { - switch p.pcType { - case PredictionContextArray: - return p.returnStates[i] - default: - return p.returnState - } -} - -func (p *PredictionContext) GetReturnStates() []int { - switch p.pcType { - case PredictionContextArray: - return p.returnStates - default: - return []int{p.returnState} - } -} - -func (p *PredictionContext) length() int { - switch p.pcType { - case PredictionContextArray: - return len(p.returnStates) - default: - return 1 - } -} - -func (p *PredictionContext) hasEmptyPath() bool { - switch p.pcType { - case PredictionContextSingleton: - return p.returnState == BasePredictionContextEmptyReturnState - } - return p.getReturnState(p.length()-1) == BasePredictionContextEmptyReturnState -} - -func (p *PredictionContext) String() string { - switch p.pcType { - case PredictionContextEmpty: - return "$" - case PredictionContextSingleton: - var up string - - if p.parentCtx == nil { - up = "" - } else { - up = p.parentCtx.String() - } - - if len(up) == 0 { - if p.returnState == BasePredictionContextEmptyReturnState { - return "$" - } - - return strconv.Itoa(p.returnState) - } - - return strconv.Itoa(p.returnState) + " " + up - case PredictionContextArray: - if p.isEmpty() { - return "[]" - } - - s := "[" - for i := 0; i < len(p.returnStates); i++ { - if i > 0 { - s = s + ", " - } - if p.returnStates[i] == BasePredictionContextEmptyReturnState { - s = s + "$" - continue - } - s = s + strconv.Itoa(p.returnStates[i]) - if !p.parents[i].isEmpty() { - s = s + " " + p.parents[i].String() - } else { - s = s + "nil" - } - } - return s + "]" - - default: - return "unknown" - } -} - -func (p *PredictionContext) isEmpty() bool { - switch p.pcType { - case PredictionContextEmpty: - return true - case PredictionContextArray: - // since EmptyReturnState can only appear in the last position, we - // don't need to verify that size==1 - return p.returnStates[0] == BasePredictionContextEmptyReturnState - default: - return false - } -} - -func (p *PredictionContext) Type() int { - return p.pcType -} - -func calculateHash(parent *PredictionContext, returnState int) int { - h := murmurInit(1) - h = murmurUpdate(h, parent.Hash()) - h = murmurUpdate(h, returnState) - return murmurFinish(h, 2) -} - -// Convert a {@link RuleContext} tree to a {@link BasePredictionContext} graph. -// Return {@link //EMPTY} if {@code outerContext} is empty or nil. -// / -func predictionContextFromRuleContext(a *ATN, outerContext RuleContext) *PredictionContext { - if outerContext == nil { - outerContext = ParserRuleContextEmpty - } - // if we are in RuleContext of start rule, s, then BasePredictionContext - // is EMPTY. Nobody called us. (if we are empty, return empty) - if outerContext.GetParent() == nil || outerContext == ParserRuleContextEmpty { - return BasePredictionContextEMPTY - } - // If we have a parent, convert it to a BasePredictionContext graph - parent := predictionContextFromRuleContext(a, outerContext.GetParent().(RuleContext)) - state := a.states[outerContext.GetInvokingState()] - transition := state.GetTransitions()[0] - - return SingletonBasePredictionContextCreate(parent, transition.(*RuleTransition).followState.GetStateNumber()) -} - -func merge(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext { - - // Share same graph if both same - // - if a == b || a.Equals(b) { - return a - } - - if a.pcType == PredictionContextSingleton && b.pcType == PredictionContextSingleton { - return mergeSingletons(a, b, rootIsWildcard, mergeCache) - } - // At least one of a or b is array - // If one is $ and rootIsWildcard, return $ as wildcard - if rootIsWildcard { - if a.isEmpty() { - return a - } - if b.isEmpty() { - return b - } - } - - // Convert either Singleton or Empty to arrays, so that we can merge them - // - ara := convertToArray(a) - arb := convertToArray(b) - return mergeArrays(ara, arb, rootIsWildcard, mergeCache) -} - -func convertToArray(pc *PredictionContext) *PredictionContext { - switch pc.Type() { - case PredictionContextEmpty: - return NewArrayPredictionContext([]*PredictionContext{}, []int{}) - case PredictionContextSingleton: - return NewArrayPredictionContext([]*PredictionContext{pc.GetParent(0)}, []int{pc.getReturnState(0)}) - default: - // Already an array - } - return pc -} - -// mergeSingletons merges two Singleton [PredictionContext] instances. -// -// Stack tops equal, parents merge is same return left graph. -//

-// -//

Same stack top, parents differ merge parents giving array node, then -// remainders of those graphs. A new root node is created to point to the -// merged parents.
-//

-// -//

Different stack tops pointing to same parent. Make array node for the -// root where both element in the root point to the same (original) -// parent.
-//

-// -//

Different stack tops pointing to different parents. Make array node for -// the root where each element points to the corresponding original -// parent.
-//

-// -// @param a the first {@link SingletonBasePredictionContext} -// @param b the second {@link SingletonBasePredictionContext} -// @param rootIsWildcard {@code true} if this is a local-context merge, -// otherwise false to indicate a full-context merge -// @param mergeCache -// / -func mergeSingletons(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext { - if mergeCache != nil { - previous, present := mergeCache.Get(a, b) - if present { - return previous - } - previous, present = mergeCache.Get(b, a) - if present { - return previous - } - } - - rootMerge := mergeRoot(a, b, rootIsWildcard) - if rootMerge != nil { - if mergeCache != nil { - mergeCache.Put(a, b, rootMerge) - } - return rootMerge - } - if a.returnState == b.returnState { - parent := merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache) - // if parent is same as existing a or b parent or reduced to a parent, - // return it - if parent.Equals(a.parentCtx) { - return a // ax + bx = ax, if a=b - } - if parent.Equals(b.parentCtx) { - return b // ax + bx = bx, if a=b - } - // else: ax + ay = a'[x,y] - // merge parents x and y, giving array node with x,y then remainders - // of those graphs. dup a, a' points at merged array. - // New joined parent so create a new singleton pointing to it, a' - spc := SingletonBasePredictionContextCreate(parent, a.returnState) - if mergeCache != nil { - mergeCache.Put(a, b, spc) - } - return spc - } - // a != b payloads differ - // see if we can collapse parents due to $+x parents if local ctx - var singleParent *PredictionContext - if a.Equals(b) || (a.parentCtx != nil && a.parentCtx.Equals(b.parentCtx)) { // ax + - // bx = - // [a,b]x - singleParent = a.parentCtx - } - if singleParent != nil { // parents are same - // sort payloads and use same parent - payloads := []int{a.returnState, b.returnState} - if a.returnState > b.returnState { - payloads[0] = b.returnState - payloads[1] = a.returnState - } - parents := []*PredictionContext{singleParent, singleParent} - apc := NewArrayPredictionContext(parents, payloads) - if mergeCache != nil { - mergeCache.Put(a, b, apc) - } - return apc - } - // parents differ and can't merge them. Just pack together - // into array can't merge. - // ax + by = [ax,by] - payloads := []int{a.returnState, b.returnState} - parents := []*PredictionContext{a.parentCtx, b.parentCtx} - if a.returnState > b.returnState { // sort by payload - payloads[0] = b.returnState - payloads[1] = a.returnState - parents = []*PredictionContext{b.parentCtx, a.parentCtx} - } - apc := NewArrayPredictionContext(parents, payloads) - if mergeCache != nil { - mergeCache.Put(a, b, apc) - } - return apc -} - -// Handle case where at least one of {@code a} or {@code b} is -// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used -// to represent {@link //EMPTY}. -// -//

Local-Context Merges

-// -//

These local-context merge operations are used when {@code rootIsWildcard} -// is true.

-// -//

{@link //EMPTY} is superset of any graph return {@link //EMPTY}.
-//

-// -//

{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is -// {@code //EMPTY} return left graph.
-//

-// -//

Special case of last merge if local context.
-//

-// -//

Full-Context Merges

-// -//

These full-context merge operations are used when {@code rootIsWildcard} -// is false.

-// -//

-// -//

Must keep all contexts {@link //EMPTY} in array is a special value (and -// nil parent).
-//

-// -//

-// -// @param a the first {@link SingletonBasePredictionContext} -// @param b the second {@link SingletonBasePredictionContext} -// @param rootIsWildcard {@code true} if this is a local-context merge, -// otherwise false to indicate a full-context merge -// / -func mergeRoot(a, b *PredictionContext, rootIsWildcard bool) *PredictionContext { - if rootIsWildcard { - if a.pcType == PredictionContextEmpty { - return BasePredictionContextEMPTY // // + b =// - } - if b.pcType == PredictionContextEmpty { - return BasePredictionContextEMPTY // a +// =// - } - } else { - if a.isEmpty() && b.isEmpty() { - return BasePredictionContextEMPTY // $ + $ = $ - } else if a.isEmpty() { // $ + x = [$,x] - payloads := []int{b.getReturnState(-1), BasePredictionContextEmptyReturnState} - parents := []*PredictionContext{b.GetParent(-1), nil} - return NewArrayPredictionContext(parents, payloads) - } else if b.isEmpty() { // x + $ = [$,x] ($ is always first if present) - payloads := []int{a.getReturnState(-1), BasePredictionContextEmptyReturnState} - parents := []*PredictionContext{a.GetParent(-1), nil} - return NewArrayPredictionContext(parents, payloads) - } - } - return nil -} - -// Merge two {@link ArrayBasePredictionContext} instances. -// -//

Different tops, different parents.
-//

-// -//

Shared top, same parents.
-//

-// -//

Shared top, different parents.
-//

-// -//

Shared top, all shared parents.
-//

-// -//

Equal tops, merge parents and reduce top to -// {@link SingletonBasePredictionContext}.
-//

-// -//goland:noinspection GoBoolExpressions -func mergeArrays(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext { - if mergeCache != nil { - previous, present := mergeCache.Get(a, b) - if present { - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous") - } - return previous - } - previous, present = mergeCache.Get(b, a) - if present { - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous") - } - return previous - } - } - // merge sorted payloads a + b => M - i := 0 // walks a - j := 0 // walks b - k := 0 // walks target M array - - mergedReturnStates := make([]int, len(a.returnStates)+len(b.returnStates)) - mergedParents := make([]*PredictionContext, len(a.returnStates)+len(b.returnStates)) - // walk and merge to yield mergedParents, mergedReturnStates - for i < len(a.returnStates) && j < len(b.returnStates) { - aParent := a.parents[i] - bParent := b.parents[j] - if a.returnStates[i] == b.returnStates[j] { - // same payload (stack tops are equal), must yield merged singleton - payload := a.returnStates[i] - // $+$ = $ - bothDollars := payload == BasePredictionContextEmptyReturnState && aParent == nil && bParent == nil - axAX := aParent != nil && bParent != nil && aParent.Equals(bParent) // ax+ax - // -> - // ax - if bothDollars || axAX { - mergedParents[k] = aParent // choose left - mergedReturnStates[k] = payload - } else { // ax+ay -> a'[x,y] - mergedParent := merge(aParent, bParent, rootIsWildcard, mergeCache) - mergedParents[k] = mergedParent - mergedReturnStates[k] = payload - } - i++ // hop over left one as usual - j++ // but also Skip one in right side since we merge - } else if a.returnStates[i] < b.returnStates[j] { // copy a[i] to M - mergedParents[k] = aParent - mergedReturnStates[k] = a.returnStates[i] - i++ - } else { // b > a, copy b[j] to M - mergedParents[k] = bParent - mergedReturnStates[k] = b.returnStates[j] - j++ - } - k++ - } - // copy over any payloads remaining in either array - if i < len(a.returnStates) { - for p := i; p < len(a.returnStates); p++ { - mergedParents[k] = a.parents[p] - mergedReturnStates[k] = a.returnStates[p] - k++ - } - } else { - for p := j; p < len(b.returnStates); p++ { - mergedParents[k] = b.parents[p] - mergedReturnStates[k] = b.returnStates[p] - k++ - } - } - // trim merged if we combined a few that had same stack tops - if k < len(mergedParents) { // write index < last position trim - if k == 1 { // for just one merged element, return singleton top - pc := SingletonBasePredictionContextCreate(mergedParents[0], mergedReturnStates[0]) - if mergeCache != nil { - mergeCache.Put(a, b, pc) - } - return pc - } - mergedParents = mergedParents[0:k] - mergedReturnStates = mergedReturnStates[0:k] - } - - M := NewArrayPredictionContext(mergedParents, mergedReturnStates) - - // if we created same array as a or b, return that instead - // TODO: JI track whether this is possible above during merge sort for speed and possibly avoid an allocation - if M.Equals(a) { - if mergeCache != nil { - mergeCache.Put(a, b, a) - } - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> a") - } - return a - } - if M.Equals(b) { - if mergeCache != nil { - mergeCache.Put(a, b, b) - } - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> b") - } - return b - } - combineCommonParents(&mergedParents) - - if mergeCache != nil { - mergeCache.Put(a, b, M) - } - if runtimeConfig.parserATNSimulatorTraceATNSim { - fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> " + M.String()) - } - return M -} - -// Make pass over all M parents and merge any Equals() ones. -// Note that we pass a pointer to the slice as we want to modify it in place. -// -//goland:noinspection GoUnusedFunction -func combineCommonParents(parents *[]*PredictionContext) { - uniqueParents := NewJStore[*PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCollection, "combineCommonParents for PredictionContext") - - for p := 0; p < len(*parents); p++ { - parent := (*parents)[p] - _, _ = uniqueParents.Put(parent) - } - for q := 0; q < len(*parents); q++ { - pc, _ := uniqueParents.Get((*parents)[q]) - (*parents)[q] = pc - } -} - -func getCachedBasePredictionContext(context *PredictionContext, contextCache *PredictionContextCache, visited *VisitRecord) *PredictionContext { - if context.isEmpty() { - return context - } - existing, present := visited.Get(context) - if present { - return existing - } - - existing, present = contextCache.Get(context) - if present { - visited.Put(context, existing) - return existing - } - changed := false - parents := make([]*PredictionContext, context.length()) - for i := 0; i < len(parents); i++ { - parent := getCachedBasePredictionContext(context.GetParent(i), contextCache, visited) - if changed || !parent.Equals(context.GetParent(i)) { - if !changed { - parents = make([]*PredictionContext, context.length()) - for j := 0; j < context.length(); j++ { - parents[j] = context.GetParent(j) - } - changed = true - } - parents[i] = parent - } - } - if !changed { - contextCache.add(context) - visited.Put(context, context) - return context - } - var updated *PredictionContext - if len(parents) == 0 { - updated = BasePredictionContextEMPTY - } else if len(parents) == 1 { - updated = SingletonBasePredictionContextCreate(parents[0], context.getReturnState(0)) - } else { - updated = NewArrayPredictionContext(parents, context.GetReturnStates()) - } - contextCache.add(updated) - visited.Put(updated, updated) - visited.Put(context, updated) - - return updated -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go deleted file mode 100644 index 25dfb11e8..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go +++ /dev/null @@ -1,48 +0,0 @@ -package antlr - -var BasePredictionContextEMPTY = &PredictionContext{ - cachedHash: calculateEmptyHash(), - pcType: PredictionContextEmpty, - returnState: BasePredictionContextEmptyReturnState, -} - -// PredictionContextCache is Used to cache [PredictionContext] objects. It is used for the shared -// context cash associated with contexts in DFA states. This cache -// can be used for both lexers and parsers. -type PredictionContextCache struct { - cache *JMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]] -} - -func NewPredictionContextCache() *PredictionContextCache { - return &PredictionContextCache{ - cache: NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, "NewPredictionContextCache()"), - } -} - -// Add a context to the cache and return it. If the context already exists, -// return that one instead and do not add a new context to the cache. -// Protect shared cache from unsafe thread access. -func (p *PredictionContextCache) add(ctx *PredictionContext) *PredictionContext { - if ctx.isEmpty() { - return BasePredictionContextEMPTY - } - - // Put will return the existing entry if it is present (note this is done via Equals, not whether it is - // the same pointer), otherwise it will add the new entry and return that. - // - existing, present := p.cache.Get(ctx) - if present { - return existing - } - p.cache.Put(ctx, ctx) - return ctx -} - -func (p *PredictionContextCache) Get(ctx *PredictionContext) (*PredictionContext, bool) { - pc, exists := p.cache.Get(ctx) - return pc, exists -} - -func (p *PredictionContextCache) length() int { - return p.cache.Len() -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go deleted file mode 100644 index 3f85a6a52..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go +++ /dev/null @@ -1,536 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// This enumeration defines the prediction modes available in ANTLR 4 along with -// utility methods for analyzing configuration sets for conflicts and/or -// ambiguities. - -const ( - // PredictionModeSLL represents the SLL(*) prediction mode. - // This prediction mode ignores the current - // parser context when making predictions. This is the fastest prediction - // mode, and provides correct results for many grammars. This prediction - // mode is more powerful than the prediction mode provided by ANTLR 3, but - // may result in syntax errors for grammar and input combinations which are - // not SLL. - // - // When using this prediction mode, the parser will either return a correct - // parse tree (i.e. the same parse tree that would be returned with the - // [PredictionModeLL] prediction mode), or it will Report a syntax error. If a - // syntax error is encountered when using the SLL prediction mode, - // it may be due to either an actual syntax error in the input or indicate - // that the particular combination of grammar and input requires the more - // powerful LL prediction abilities to complete successfully. - // - // This prediction mode does not provide any guarantees for prediction - // behavior for syntactically-incorrect inputs. - // - PredictionModeSLL = 0 - - // PredictionModeLL represents the LL(*) prediction mode. - // This prediction mode allows the current parser - // context to be used for resolving SLL conflicts that occur during - // prediction. This is the fastest prediction mode that guarantees correct - // parse results for all combinations of grammars with syntactically correct - // inputs. - // - // When using this prediction mode, the parser will make correct decisions - // for all syntactically-correct grammar and input combinations. However, in - // cases where the grammar is truly ambiguous this prediction mode might not - // report a precise answer for exactly which alternatives are - // ambiguous. - // - // This prediction mode does not provide any guarantees for prediction - // behavior for syntactically-incorrect inputs. - // - PredictionModeLL = 1 - - // PredictionModeLLExactAmbigDetection represents the LL(*) prediction mode - // with exact ambiguity detection. - // - // In addition to the correctness guarantees provided by the [PredictionModeLL] prediction mode, - // this prediction mode instructs the prediction algorithm to determine the - // complete and exact set of ambiguous alternatives for every ambiguous - // decision encountered while parsing. - // - // This prediction mode may be used for diagnosing ambiguities during - // grammar development. Due to the performance overhead of calculating sets - // of ambiguous alternatives, this prediction mode should be avoided when - // the exact results are not necessary. - // - // This prediction mode does not provide any guarantees for prediction - // behavior for syntactically-incorrect inputs. - // - PredictionModeLLExactAmbigDetection = 2 -) - -// PredictionModehasSLLConflictTerminatingPrediction computes the SLL prediction termination condition. -// -// This method computes the SLL prediction termination condition for both of -// the following cases: -// -// - The usual SLL+LL fallback upon SLL conflict -// - Pure SLL without LL fallback -// -// # Combined SLL+LL Parsing -// -// When LL-fallback is enabled upon SLL conflict, correct predictions are -// ensured regardless of how the termination condition is computed by this -// method. Due to the substantially higher cost of LL prediction, the -// prediction should only fall back to LL when the additional lookahead -// cannot lead to a unique SLL prediction. -// -// Assuming combined SLL+LL parsing, an SLL configuration set with only -// conflicting subsets should fall back to full LL, even if the -// configuration sets don't resolve to the same alternative, e.g. -// -// {1,2} and {3,4} -// -// If there is at least one non-conflicting -// configuration, SLL could continue with the hopes that more lookahead will -// resolve via one of those non-conflicting configurations. -// -// Here's the prediction termination rule them: SLL (for SLL+LL parsing) -// stops when it sees only conflicting configuration subsets. In contrast, -// full LL keeps going when there is uncertainty. -// -// # Heuristic -// -// As a heuristic, we stop prediction when we see any conflicting subset -// unless we see a state that only has one alternative associated with it. -// The single-alt-state thing lets prediction continue upon rules like -// (otherwise, it would admit defeat too soon): -// -// [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ; -// -// When the [ATN] simulation reaches the state before ';', it has a -// [DFA] state that looks like: -// -// [12|1|[], 6|2|[], 12|2|[]] -// -// Naturally -// -// 12|1|[] and 12|2|[] -// -// conflict, but we cannot stop processing this node because alternative to has another way to continue, -// via -// -// [6|2|[]] -// -// It also let's us continue for this rule: -// -// [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ; -// -// After Matching input A, we reach the stop state for rule A, state 1. -// State 8 is the state immediately before B. Clearly alternatives 1 and 2 -// conflict and no amount of further lookahead will separate the two. -// However, alternative 3 will be able to continue, and so we do not stop -// working on this state. In the previous example, we're concerned with -// states associated with the conflicting alternatives. Here alt 3 is not -// associated with the conflicting configs, but since we can continue -// looking for input reasonably, don't declare the state done. -// -// # Pure SLL Parsing -// -// To handle pure SLL parsing, all we have to do is make sure that we -// combine stack contexts for configurations that differ only by semantic -// predicate. From there, we can do the usual SLL termination heuristic. -// -// # Predicates in SLL+LL Parsing -// -// SLL decisions don't evaluate predicates until after they reach [DFA] stop -// states because they need to create the [DFA] cache that works in all -// semantic situations. In contrast, full LL evaluates predicates collected -// during start state computation, so it can ignore predicates thereafter. -// This means that SLL termination detection can totally ignore semantic -// predicates. -// -// Implementation-wise, [ATNConfigSet] combines stack contexts but not -// semantic predicate contexts, so we might see two configurations like the -// following: -// -// (s, 1, x, {}), (s, 1, x', {p}) -// -// Before testing these configurations against others, we have to merge -// x and x' (without modifying the existing configurations). -// For example, we test (x+x')==x” when looking for conflicts in -// the following configurations: -// -// (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x”, {}) -// -// If the configuration set has predicates (as indicated by -// [ATNConfigSet.hasSemanticContext]), this algorithm makes a copy of -// the configurations to strip out all the predicates so that a standard -// [ATNConfigSet] will merge everything ignoring predicates. -func PredictionModehasSLLConflictTerminatingPrediction(mode int, configs *ATNConfigSet) bool { - - // Configs in rule stop states indicate reaching the end of the decision - // rule (local context) or end of start rule (full context). If all - // configs meet this condition, then none of the configurations is able - // to Match additional input, so we terminate prediction. - // - if PredictionModeallConfigsInRuleStopStates(configs) { - return true - } - - // pure SLL mode parsing - if mode == PredictionModeSLL { - // Don't bother with combining configs from different semantic - // contexts if we can fail over to full LL costs more time - // since we'll often fail over anyway. - if configs.hasSemanticContext { - // dup configs, tossing out semantic predicates - dup := NewATNConfigSet(false) - for _, c := range configs.configs { - - // NewATNConfig({semanticContext:}, c) - c = NewATNConfig2(c, SemanticContextNone) - dup.Add(c, nil) - } - configs = dup - } - // now we have combined contexts for configs with dissimilar predicates - } - // pure SLL or combined SLL+LL mode parsing - altsets := PredictionModegetConflictingAltSubsets(configs) - return PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs) -} - -// PredictionModehasConfigInRuleStopState checks if any configuration in the given configs is in a -// [RuleStopState]. Configurations meeting this condition have reached -// the end of the decision rule (local context) or end of start rule (full -// context). -// -// The func returns true if any configuration in the supplied configs is in a [RuleStopState] -func PredictionModehasConfigInRuleStopState(configs *ATNConfigSet) bool { - for _, c := range configs.configs { - if _, ok := c.GetState().(*RuleStopState); ok { - return true - } - } - return false -} - -// PredictionModeallConfigsInRuleStopStates checks if all configurations in configs are in a -// [RuleStopState]. Configurations meeting this condition have reached -// the end of the decision rule (local context) or end of start rule (full -// context). -// -// the func returns true if all configurations in configs are in a -// [RuleStopState] -func PredictionModeallConfigsInRuleStopStates(configs *ATNConfigSet) bool { - - for _, c := range configs.configs { - if _, ok := c.GetState().(*RuleStopState); !ok { - return false - } - } - return true -} - -// PredictionModeresolvesToJustOneViableAlt checks full LL prediction termination. -// -// Can we stop looking ahead during [ATN] simulation or is there some -// uncertainty as to which alternative we will ultimately pick, after -// consuming more input? Even if there are partial conflicts, we might know -// that everything is going to resolve to the same minimum alternative. That -// means we can stop since no more lookahead will change that fact. On the -// other hand, there might be multiple conflicts that resolve to different -// minimums. That means we need more look ahead to decide which of those -// alternatives we should predict. -// -// The basic idea is to split the set of configurations 'C', into -// conflicting subsets (s, _, ctx, _) and singleton subsets with -// non-conflicting configurations. Two configurations conflict if they have -// identical [ATNConfig].state and [ATNConfig].context values -// but a different [ATNConfig].alt value, e.g. -// -// (s, i, ctx, _) -// -// and -// -// (s, j, ctx, _) ; for i != j -// -// Reduce these configuration subsets to the set of possible alternatives. -// You can compute the alternative subsets in one pass as follows: -// -// A_s,ctx = {i | (s, i, ctx, _)} -// -// for each configuration in C holding s and ctx fixed. -// -// Or in pseudo-code: -// -// for each configuration c in C: -// map[c] U = c.ATNConfig.alt alt // map hash/equals uses s and x, not alt and not pred -// -// The values in map are the set of -// -// A_s,ctx -// -// sets. -// -// If -// -// |A_s,ctx| = 1 -// -// then there is no conflict associated with s and ctx. -// -// Reduce the subsets to singletons by choosing a minimum of each subset. If -// the union of these alternative subsets is a singleton, then no amount of -// further lookahead will help us. We will always pick that alternative. If, -// however, there is more than one alternative, then we are uncertain which -// alternative to predict and must continue looking for resolution. We may -// or may not discover an ambiguity in the future, even if there are no -// conflicting subsets this round. -// -// The biggest sin is to terminate early because it means we've made a -// decision but were uncertain as to the eventual outcome. We haven't used -// enough lookahead. On the other hand, announcing a conflict too late is no -// big deal; you will still have the conflict. It's just inefficient. It -// might even look until the end of file. -// -// No special consideration for semantic predicates is required because -// predicates are evaluated on-the-fly for full LL prediction, ensuring that -// no configuration contains a semantic context during the termination -// check. -// -// # Conflicting Configs -// -// Two configurations: -// -// (s, i, x) and (s, j, x') -// -// conflict when i != j but x = x'. Because we merge all -// (s, i, _) configurations together, that means that there are at -// most n configurations associated with state s for -// n possible alternatives in the decision. The merged stacks -// complicate the comparison of configuration contexts x and x'. -// -// Sam checks to see if one is a subset of the other by calling -// merge and checking to see if the merged result is either x or x'. -// If the x associated with lowest alternative i -// is the superset, then i is the only possible prediction since the -// others resolve to min(i) as well. However, if x is -// associated with j > i then at least one stack configuration for -// j is not in conflict with alternative i. The algorithm -// should keep going, looking for more lookahead due to the uncertainty. -// -// For simplicity, I'm doing an equality check between x and -// x', which lets the algorithm continue to consume lookahead longer -// than necessary. The reason I like the equality is of course the -// simplicity but also because that is the test you need to detect the -// alternatives that are actually in conflict. -// -// # Continue/Stop Rule -// -// Continue if the union of resolved alternative sets from non-conflicting and -// conflicting alternative subsets has more than one alternative. We are -// uncertain about which alternative to predict. -// -// The complete set of alternatives, -// -// [i for (_, i, _)] -// -// tells us which alternatives are still in the running for the amount of input we've -// consumed at this point. The conflicting sets let us to strip away -// configurations that won't lead to more states because we resolve -// conflicts to the configuration with a minimum alternate for the -// conflicting set. -// -// Cases -// -// - no conflicts and more than 1 alternative in set => continue -// - (s, 1, x), (s, 2, x), (s, 3, z), (s', 1, y), (s', 2, y) yields non-conflicting set -// {3} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1,3} => continue -// - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y), (s”, 1, z) yields non-conflicting set -// {1} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1} => stop and predict 1 -// - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y) yields conflicting, reduced sets -// {1} ∪ {1} = {1} => stop and predict 1, can announce ambiguity {1,2} -// - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets -// {1} ∪ {2} = {1,2} => continue -// - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets -// {1} ∪ {2} = {1,2} => continue -// - (s, 1, x), (s, 2, x), (s', 3, y), (s', 4, y) yields conflicting, reduced sets -// {1} ∪ {3} = {1,3} => continue -// -// # Exact Ambiguity Detection -// -// If all states report the same conflicting set of alternatives, then we -// know we have the exact ambiguity set: -// -// |A_i| > 1 -// -// and -// -// A_i = A_j ; for all i, j -// -// In other words, we continue examining lookahead until all A_i -// have more than one alternative and all A_i are the same. If -// -// A={{1,2}, {1,3}} -// -// then regular LL prediction would terminate because the resolved set is {1}. -// To determine what the real ambiguity is, we have to know whether the ambiguity is between one and -// two or one and three so we keep going. We can only stop prediction when -// we need exact ambiguity detection when the sets look like: -// -// A={{1,2}} -// -// or -// -// {{1,2},{1,2}}, etc... -func PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int { - return PredictionModegetSingleViableAlt(altsets) -} - -// PredictionModeallSubsetsConflict determines if every alternative subset in altsets contains more -// than one alternative. -// -// The func returns true if every [BitSet] in altsets has -// [BitSet].cardinality cardinality > 1 -func PredictionModeallSubsetsConflict(altsets []*BitSet) bool { - return !PredictionModehasNonConflictingAltSet(altsets) -} - -// PredictionModehasNonConflictingAltSet determines if any single alternative subset in altsets contains -// exactly one alternative. -// -// The func returns true if altsets contains at least one [BitSet] with -// [BitSet].cardinality cardinality 1 -func PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool { - for i := 0; i < len(altsets); i++ { - alts := altsets[i] - if alts.length() == 1 { - return true - } - } - return false -} - -// PredictionModehasConflictingAltSet determines if any single alternative subset in altsets contains -// more than one alternative. -// -// The func returns true if altsets contains a [BitSet] with -// [BitSet].cardinality cardinality > 1, otherwise false -func PredictionModehasConflictingAltSet(altsets []*BitSet) bool { - for i := 0; i < len(altsets); i++ { - alts := altsets[i] - if alts.length() > 1 { - return true - } - } - return false -} - -// PredictionModeallSubsetsEqual determines if every alternative subset in altsets is equivalent. -// -// The func returns true if every member of altsets is equal to the others. -func PredictionModeallSubsetsEqual(altsets []*BitSet) bool { - var first *BitSet - - for i := 0; i < len(altsets); i++ { - alts := altsets[i] - if first == nil { - first = alts - } else if alts != first { - return false - } - } - - return true -} - -// PredictionModegetUniqueAlt returns the unique alternative predicted by all alternative subsets in -// altsets. If no such alternative exists, this method returns -// [ATNInvalidAltNumber]. -// -// @param altsets a collection of alternative subsets -func PredictionModegetUniqueAlt(altsets []*BitSet) int { - all := PredictionModeGetAlts(altsets) - if all.length() == 1 { - return all.minValue() - } - - return ATNInvalidAltNumber -} - -// PredictionModeGetAlts returns the complete set of represented alternatives for a collection of -// alternative subsets. This method returns the union of each [BitSet] -// in altsets, being the set of represented alternatives in altsets. -func PredictionModeGetAlts(altsets []*BitSet) *BitSet { - all := NewBitSet() - for _, alts := range altsets { - all.or(alts) - } - return all -} - -// PredictionModegetConflictingAltSubsets gets the conflicting alt subsets from a configuration set. -// -// for each configuration c in configs: -// map[c] U= c.ATNConfig.alt // map hash/equals uses s and x, not alt and not pred -func PredictionModegetConflictingAltSubsets(configs *ATNConfigSet) []*BitSet { - configToAlts := NewJMap[*ATNConfig, *BitSet, *ATNAltConfigComparator[*ATNConfig]](atnAltCfgEqInst, AltSetCollection, "PredictionModegetConflictingAltSubsets()") - - for _, c := range configs.configs { - - alts, ok := configToAlts.Get(c) - if !ok { - alts = NewBitSet() - configToAlts.Put(c, alts) - } - alts.add(c.GetAlt()) - } - - return configToAlts.Values() -} - -// PredictionModeGetStateToAltMap gets a map from state to alt subset from a configuration set. -// -// for each configuration c in configs: -// map[c.ATNConfig.state] U= c.ATNConfig.alt} -func PredictionModeGetStateToAltMap(configs *ATNConfigSet) *AltDict { - m := NewAltDict() - - for _, c := range configs.configs { - alts := m.Get(c.GetState().String()) - if alts == nil { - alts = NewBitSet() - m.put(c.GetState().String(), alts) - } - alts.(*BitSet).add(c.GetAlt()) - } - return m -} - -func PredictionModehasStateAssociatedWithOneAlt(configs *ATNConfigSet) bool { - values := PredictionModeGetStateToAltMap(configs).values() - for i := 0; i < len(values); i++ { - if values[i].(*BitSet).length() == 1 { - return true - } - } - return false -} - -// PredictionModegetSingleViableAlt gets the single alternative predicted by all alternative subsets in altsets -// if there is one. -// -// TODO: JI - Review this code - it does not seem to do the same thing as the Java code - maybe because [BitSet] is not like the Java utils BitSet -func PredictionModegetSingleViableAlt(altsets []*BitSet) int { - result := ATNInvalidAltNumber - - for i := 0; i < len(altsets); i++ { - alts := altsets[i] - minAlt := alts.minValue() - if result == ATNInvalidAltNumber { - result = minAlt - } else if result != minAlt { // more than 1 viable alt - return ATNInvalidAltNumber - } - } - return result -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/recognizer.go b/vendor/github.com/antlr4-go/antlr/v4/recognizer.go deleted file mode 100644 index 2e0b504fb..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/recognizer.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strings" - - "strconv" -) - -type Recognizer interface { - GetLiteralNames() []string - GetSymbolicNames() []string - GetRuleNames() []string - - Sempred(RuleContext, int, int) bool - Precpred(RuleContext, int) bool - - GetState() int - SetState(int) - Action(RuleContext, int, int) - AddErrorListener(ErrorListener) - RemoveErrorListeners() - GetATN() *ATN - GetErrorListenerDispatch() ErrorListener - HasError() bool - GetError() RecognitionException - SetError(RecognitionException) -} - -type BaseRecognizer struct { - listeners []ErrorListener - state int - - RuleNames []string - LiteralNames []string - SymbolicNames []string - GrammarFileName string - SynErr RecognitionException -} - -func NewBaseRecognizer() *BaseRecognizer { - rec := new(BaseRecognizer) - rec.listeners = []ErrorListener{ConsoleErrorListenerINSTANCE} - rec.state = -1 - return rec -} - -//goland:noinspection GoUnusedGlobalVariable -var tokenTypeMapCache = make(map[string]int) - -//goland:noinspection GoUnusedGlobalVariable -var ruleIndexMapCache = make(map[string]int) - -func (b *BaseRecognizer) checkVersion(toolVersion string) { - runtimeVersion := "4.12.0" - if runtimeVersion != toolVersion { - fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion) - } -} - -func (b *BaseRecognizer) SetError(err RecognitionException) { - b.SynErr = err -} - -func (b *BaseRecognizer) HasError() bool { - return b.SynErr != nil -} - -func (b *BaseRecognizer) GetError() RecognitionException { - return b.SynErr -} - -func (b *BaseRecognizer) Action(_ RuleContext, _, _ int) { - panic("action not implemented on Recognizer!") -} - -func (b *BaseRecognizer) AddErrorListener(listener ErrorListener) { - b.listeners = append(b.listeners, listener) -} - -func (b *BaseRecognizer) RemoveErrorListeners() { - b.listeners = make([]ErrorListener, 0) -} - -func (b *BaseRecognizer) GetRuleNames() []string { - return b.RuleNames -} - -func (b *BaseRecognizer) GetTokenNames() []string { - return b.LiteralNames -} - -func (b *BaseRecognizer) GetSymbolicNames() []string { - return b.SymbolicNames -} - -func (b *BaseRecognizer) GetLiteralNames() []string { - return b.LiteralNames -} - -func (b *BaseRecognizer) GetState() int { - return b.state -} - -func (b *BaseRecognizer) SetState(v int) { - b.state = v -} - -//func (b *Recognizer) GetTokenTypeMap() { -// var tokenNames = b.GetTokenNames() -// if (tokenNames==nil) { -// panic("The current recognizer does not provide a list of token names.") -// } -// var result = tokenTypeMapCache[tokenNames] -// if(result==nil) { -// result = tokenNames.reduce(function(o, k, i) { o[k] = i }) -// result.EOF = TokenEOF -// tokenTypeMapCache[tokenNames] = result -// } -// return result -//} - -// GetRuleIndexMap Get a map from rule names to rule indexes. -// -// Used for XPath and tree pattern compilation. -// -// TODO: JI This is not yet implemented in the Go runtime. Maybe not needed. -func (b *BaseRecognizer) GetRuleIndexMap() map[string]int { - - panic("Method not defined!") - // var ruleNames = b.GetRuleNames() - // if (ruleNames==nil) { - // panic("The current recognizer does not provide a list of rule names.") - // } - // - // var result = ruleIndexMapCache[ruleNames] - // if(result==nil) { - // result = ruleNames.reduce(function(o, k, i) { o[k] = i }) - // ruleIndexMapCache[ruleNames] = result - // } - // return result -} - -// GetTokenType get the token type based upon its name -func (b *BaseRecognizer) GetTokenType(_ string) int { - panic("Method not defined!") - // var ttype = b.GetTokenTypeMap()[tokenName] - // if (ttype !=nil) { - // return ttype - // } else { - // return TokenInvalidType - // } -} - -//func (b *Recognizer) GetTokenTypeMap() map[string]int { -// Vocabulary vocabulary = getVocabulary() -// -// Synchronized (tokenTypeMapCache) { -// Map result = tokenTypeMapCache.Get(vocabulary) -// if (result == null) { -// result = new HashMap() -// for (int i = 0; i < GetATN().maxTokenType; i++) { -// String literalName = vocabulary.getLiteralName(i) -// if (literalName != null) { -// result.put(literalName, i) -// } -// -// String symbolicName = vocabulary.GetSymbolicName(i) -// if (symbolicName != null) { -// result.put(symbolicName, i) -// } -// } -// -// result.put("EOF", Token.EOF) -// result = Collections.unmodifiableMap(result) -// tokenTypeMapCache.put(vocabulary, result) -// } -// -// return result -// } -//} - -// GetErrorHeader returns the error header, normally line/character position information. -// -// Can be overridden in sub structs embedding BaseRecognizer. -func (b *BaseRecognizer) GetErrorHeader(e RecognitionException) string { - line := e.GetOffendingToken().GetLine() - column := e.GetOffendingToken().GetColumn() - return "line " + strconv.Itoa(line) + ":" + strconv.Itoa(column) -} - -// GetTokenErrorDisplay shows how a token should be displayed in an error message. -// -// The default is to display just the text, but during development you might -// want to have a lot of information spit out. Override in that case -// to use t.String() (which, for CommonToken, dumps everything about -// the token). This is better than forcing you to override a method in -// your token objects because you don't have to go modify your lexer -// so that it creates a NewJava type. -// -// Deprecated: This method is not called by the ANTLR 4 Runtime. Specific -// implementations of [ANTLRErrorStrategy] may provide a similar -// feature when necessary. For example, see [DefaultErrorStrategy].GetTokenErrorDisplay() -func (b *BaseRecognizer) GetTokenErrorDisplay(t Token) string { - if t == nil { - return "" - } - s := t.GetText() - if s == "" { - if t.GetTokenType() == TokenEOF { - s = "" - } else { - s = "<" + strconv.Itoa(t.GetTokenType()) + ">" - } - } - s = strings.Replace(s, "\t", "\\t", -1) - s = strings.Replace(s, "\n", "\\n", -1) - s = strings.Replace(s, "\r", "\\r", -1) - - return "'" + s + "'" -} - -func (b *BaseRecognizer) GetErrorListenerDispatch() ErrorListener { - return NewProxyErrorListener(b.listeners) -} - -// Sempred embedding structs need to override this if there are sempreds or actions -// that the ATN interpreter needs to execute -func (b *BaseRecognizer) Sempred(_ RuleContext, _ int, _ int) bool { - return true -} - -// Precpred embedding structs need to override this if there are preceding predicates -// that the ATN interpreter needs to execute -func (b *BaseRecognizer) Precpred(_ RuleContext, _ int) bool { - return true -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/rule_context.go b/vendor/github.com/antlr4-go/antlr/v4/rule_context.go deleted file mode 100644 index f2ad04793..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/rule_context.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// RuleContext is a record of a single rule invocation. It knows -// which context invoked it, if any. If there is no parent context, then -// naturally the invoking state is not valid. The parent link -// provides a chain upwards from the current rule invocation to the root -// of the invocation tree, forming a stack. -// -// We actually carry no information about the rule associated with this context (except -// when parsing). We keep only the state number of the invoking state from -// the [ATN] submachine that invoked this. Contrast this with the s -// pointer inside [ParserRuleContext] that tracks the current state -// being "executed" for the current rule. -// -// The parent contexts are useful for computing lookahead sets and -// getting error information. -// -// These objects are used during parsing and prediction. -// For the special case of parsers, we use the struct -// [ParserRuleContext], which embeds a RuleContext. -// -// @see ParserRuleContext -type RuleContext interface { - RuleNode - - GetInvokingState() int - SetInvokingState(int) - - GetRuleIndex() int - IsEmpty() bool - - GetAltNumber() int - SetAltNumber(altNumber int) - - String([]string, RuleContext) string -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/semantic_context.go b/vendor/github.com/antlr4-go/antlr/v4/semantic_context.go deleted file mode 100644 index 68cb9061e..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/semantic_context.go +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" -) - -// SemanticContext is a tree structure used to record the semantic context in which -// -// an ATN configuration is valid. It's either a single predicate, -// a conjunction p1 && p2, or a sum of products p1 || p2. -// -// I have scoped the AND, OR, and Predicate subclasses of -// [SemanticContext] within the scope of this outer ``class'' -type SemanticContext interface { - Equals(other Collectable[SemanticContext]) bool - Hash() int - - evaluate(parser Recognizer, outerContext RuleContext) bool - evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext - - String() string -} - -func SemanticContextandContext(a, b SemanticContext) SemanticContext { - if a == nil || a == SemanticContextNone { - return b - } - if b == nil || b == SemanticContextNone { - return a - } - result := NewAND(a, b) - if len(result.opnds) == 1 { - return result.opnds[0] - } - - return result -} - -func SemanticContextorContext(a, b SemanticContext) SemanticContext { - if a == nil { - return b - } - if b == nil { - return a - } - if a == SemanticContextNone || b == SemanticContextNone { - return SemanticContextNone - } - result := NewOR(a, b) - if len(result.opnds) == 1 { - return result.opnds[0] - } - - return result -} - -type Predicate struct { - ruleIndex int - predIndex int - isCtxDependent bool -} - -func NewPredicate(ruleIndex, predIndex int, isCtxDependent bool) *Predicate { - p := new(Predicate) - - p.ruleIndex = ruleIndex - p.predIndex = predIndex - p.isCtxDependent = isCtxDependent // e.g., $i ref in pred - return p -} - -//The default {@link SemanticContext}, which is semantically equivalent to -//a predicate of the form {@code {true}?}. - -var SemanticContextNone = NewPredicate(-1, -1, false) - -func (p *Predicate) evalPrecedence(_ Recognizer, _ RuleContext) SemanticContext { - return p -} - -func (p *Predicate) evaluate(parser Recognizer, outerContext RuleContext) bool { - - var localctx RuleContext - - if p.isCtxDependent { - localctx = outerContext - } - - return parser.Sempred(localctx, p.ruleIndex, p.predIndex) -} - -func (p *Predicate) Equals(other Collectable[SemanticContext]) bool { - if p == other { - return true - } else if _, ok := other.(*Predicate); !ok { - return false - } else { - return p.ruleIndex == other.(*Predicate).ruleIndex && - p.predIndex == other.(*Predicate).predIndex && - p.isCtxDependent == other.(*Predicate).isCtxDependent - } -} - -func (p *Predicate) Hash() int { - h := murmurInit(0) - h = murmurUpdate(h, p.ruleIndex) - h = murmurUpdate(h, p.predIndex) - if p.isCtxDependent { - h = murmurUpdate(h, 1) - } else { - h = murmurUpdate(h, 0) - } - return murmurFinish(h, 3) -} - -func (p *Predicate) String() string { - return "{" + strconv.Itoa(p.ruleIndex) + ":" + strconv.Itoa(p.predIndex) + "}?" -} - -type PrecedencePredicate struct { - precedence int -} - -func NewPrecedencePredicate(precedence int) *PrecedencePredicate { - - p := new(PrecedencePredicate) - p.precedence = precedence - - return p -} - -func (p *PrecedencePredicate) evaluate(parser Recognizer, outerContext RuleContext) bool { - return parser.Precpred(outerContext, p.precedence) -} - -func (p *PrecedencePredicate) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext { - if parser.Precpred(outerContext, p.precedence) { - return SemanticContextNone - } - - return nil -} - -func (p *PrecedencePredicate) compareTo(other *PrecedencePredicate) int { - return p.precedence - other.precedence -} - -func (p *PrecedencePredicate) Equals(other Collectable[SemanticContext]) bool { - - var op *PrecedencePredicate - var ok bool - if op, ok = other.(*PrecedencePredicate); !ok { - return false - } - - if p == op { - return true - } - - return p.precedence == other.(*PrecedencePredicate).precedence -} - -func (p *PrecedencePredicate) Hash() int { - h := uint32(1) - h = 31*h + uint32(p.precedence) - return int(h) -} - -func (p *PrecedencePredicate) String() string { - return "{" + strconv.Itoa(p.precedence) + ">=prec}?" -} - -func PrecedencePredicatefilterPrecedencePredicates(set *JStore[SemanticContext, Comparator[SemanticContext]]) []*PrecedencePredicate { - result := make([]*PrecedencePredicate, 0) - - set.Each(func(v SemanticContext) bool { - if c2, ok := v.(*PrecedencePredicate); ok { - result = append(result, c2) - } - return true - }) - - return result -} - -// A semantic context which is true whenever none of the contained contexts -// is false.` - -type AND struct { - opnds []SemanticContext -} - -func NewAND(a, b SemanticContext) *AND { - - operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, "NewAND() operands") - if aa, ok := a.(*AND); ok { - for _, o := range aa.opnds { - operands.Put(o) - } - } else { - operands.Put(a) - } - - if ba, ok := b.(*AND); ok { - for _, o := range ba.opnds { - operands.Put(o) - } - } else { - operands.Put(b) - } - precedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands) - if len(precedencePredicates) > 0 { - // interested in the transition with the lowest precedence - var reduced *PrecedencePredicate - - for _, p := range precedencePredicates { - if reduced == nil || p.precedence < reduced.precedence { - reduced = p - } - } - - operands.Put(reduced) - } - - vs := operands.Values() - opnds := make([]SemanticContext, len(vs)) - copy(opnds, vs) - - and := new(AND) - and.opnds = opnds - - return and -} - -func (a *AND) Equals(other Collectable[SemanticContext]) bool { - if a == other { - return true - } - if _, ok := other.(*AND); !ok { - return false - } else { - for i, v := range other.(*AND).opnds { - if !a.opnds[i].Equals(v) { - return false - } - } - return true - } -} - -// {@inheritDoc} -// -//

-// The evaluation of predicates by a context is short-circuiting, but -// unordered.

-func (a *AND) evaluate(parser Recognizer, outerContext RuleContext) bool { - for i := 0; i < len(a.opnds); i++ { - if !a.opnds[i].evaluate(parser, outerContext) { - return false - } - } - return true -} - -func (a *AND) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext { - differs := false - operands := make([]SemanticContext, 0) - - for i := 0; i < len(a.opnds); i++ { - context := a.opnds[i] - evaluated := context.evalPrecedence(parser, outerContext) - differs = differs || (evaluated != context) - if evaluated == nil { - // The AND context is false if any element is false - return nil - } else if evaluated != SemanticContextNone { - // Reduce the result by Skipping true elements - operands = append(operands, evaluated) - } - } - if !differs { - return a - } - - if len(operands) == 0 { - // all elements were true, so the AND context is true - return SemanticContextNone - } - - var result SemanticContext - - for _, o := range operands { - if result == nil { - result = o - } else { - result = SemanticContextandContext(result, o) - } - } - - return result -} - -func (a *AND) Hash() int { - h := murmurInit(37) // Init with a value different from OR - for _, op := range a.opnds { - h = murmurUpdate(h, op.Hash()) - } - return murmurFinish(h, len(a.opnds)) -} - -func (o *OR) Hash() int { - h := murmurInit(41) // Init with o value different from AND - for _, op := range o.opnds { - h = murmurUpdate(h, op.Hash()) - } - return murmurFinish(h, len(o.opnds)) -} - -func (a *AND) String() string { - s := "" - - for _, o := range a.opnds { - s += "&& " + fmt.Sprint(o) - } - - if len(s) > 3 { - return s[0:3] - } - - return s -} - -// -// A semantic context which is true whenever at least one of the contained -// contexts is true. -// - -type OR struct { - opnds []SemanticContext -} - -func NewOR(a, b SemanticContext) *OR { - - operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, "NewOR() operands") - if aa, ok := a.(*OR); ok { - for _, o := range aa.opnds { - operands.Put(o) - } - } else { - operands.Put(a) - } - - if ba, ok := b.(*OR); ok { - for _, o := range ba.opnds { - operands.Put(o) - } - } else { - operands.Put(b) - } - precedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands) - if len(precedencePredicates) > 0 { - // interested in the transition with the lowest precedence - var reduced *PrecedencePredicate - - for _, p := range precedencePredicates { - if reduced == nil || p.precedence > reduced.precedence { - reduced = p - } - } - - operands.Put(reduced) - } - - vs := operands.Values() - - opnds := make([]SemanticContext, len(vs)) - copy(opnds, vs) - - o := new(OR) - o.opnds = opnds - - return o -} - -func (o *OR) Equals(other Collectable[SemanticContext]) bool { - if o == other { - return true - } else if _, ok := other.(*OR); !ok { - return false - } else { - for i, v := range other.(*OR).opnds { - if !o.opnds[i].Equals(v) { - return false - } - } - return true - } -} - -//

-// The evaluation of predicates by o context is short-circuiting, but -// unordered.

-func (o *OR) evaluate(parser Recognizer, outerContext RuleContext) bool { - for i := 0; i < len(o.opnds); i++ { - if o.opnds[i].evaluate(parser, outerContext) { - return true - } - } - return false -} - -func (o *OR) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext { - differs := false - operands := make([]SemanticContext, 0) - for i := 0; i < len(o.opnds); i++ { - context := o.opnds[i] - evaluated := context.evalPrecedence(parser, outerContext) - differs = differs || (evaluated != context) - if evaluated == SemanticContextNone { - // The OR context is true if any element is true - return SemanticContextNone - } else if evaluated != nil { - // Reduce the result by Skipping false elements - operands = append(operands, evaluated) - } - } - if !differs { - return o - } - if len(operands) == 0 { - // all elements were false, so the OR context is false - return nil - } - var result SemanticContext - - for _, o := range operands { - if result == nil { - result = o - } else { - result = SemanticContextorContext(result, o) - } - } - - return result -} - -func (o *OR) String() string { - s := "" - - for _, o := range o.opnds { - s += "|| " + fmt.Sprint(o) - } - - if len(s) > 3 { - return s[0:3] - } - - return s -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/statistics.go b/vendor/github.com/antlr4-go/antlr/v4/statistics.go deleted file mode 100644 index 70c0673a0..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/statistics.go +++ /dev/null @@ -1,281 +0,0 @@ -//go:build antlr.stats - -package antlr - -import ( - "fmt" - "log" - "os" - "path/filepath" - "sort" - "strconv" - "sync" -) - -// This file allows the user to collect statistics about the runtime of the ANTLR runtime. It is not enabled by default -// and so incurs no time penalty. To enable it, you must build the runtime with the antlr.stats build tag. -// - -// Tells various components to collect statistics - because it is only true when this file is included, it will -// allow the compiler to completely eliminate all the code that is only used when collecting statistics. -const collectStats = true - -// goRunStats is a collection of all the various data the ANTLR runtime has collected about a particular run. -// It is exported so that it can be used by others to look for things that are not already looked for in the -// runtime statistics. -type goRunStats struct { - - // jStats is a slice of all the [JStatRec] records that have been created, which is one for EVERY collection created - // during a run. It is exported so that it can be used by others to look for things that are not already looked for - // within this package. - // - jStats []*JStatRec - jStatsLock sync.RWMutex - topN int - topNByMax []*JStatRec - topNByUsed []*JStatRec - unusedCollections map[CollectionSource]int - counts map[CollectionSource]int -} - -const ( - collectionsFile = "collections" -) - -var ( - Statistics = &goRunStats{ - topN: 10, - } -) - -type statsOption func(*goRunStats) error - -// Configure allows the statistics system to be configured as the user wants and override the defaults -func (s *goRunStats) Configure(options ...statsOption) error { - for _, option := range options { - err := option(s) - if err != nil { - return err - } - } - return nil -} - -// WithTopN sets the number of things to list in the report when we are concerned with the top N things. -// -// For example, if you want to see the top 20 collections by size, you can do: -// -// antlr.Statistics.Configure(antlr.WithTopN(20)) -func WithTopN(topN int) statsOption { - return func(s *goRunStats) error { - s.topN = topN - return nil - } -} - -// Analyze looks through all the statistical records and computes all the outputs that might be useful to the user. -// -// The function gathers and analyzes a number of statistics about any particular run of -// an ANTLR generated recognizer. In the vast majority of cases, the statistics are only -// useful to maintainers of ANTLR itself, but they can be useful to users as well. They may be -// especially useful in tracking down bugs or performance problems when an ANTLR user could -// supply the output from this package, but cannot supply the grammar file(s) they are using, even -// privately to the maintainers. -// -// The statistics are gathered by the runtime itself, and are not gathered by the parser or lexer, but the user -// must call this function their selves to analyze the statistics. This is because none of the infrastructure is -// extant unless the calling program is built with the antlr.stats tag like so: -// -// go build -tags antlr.stats . -// -// When a program is built with the antlr.stats tag, the Statistics object is created and available outside -// the package. The user can then call the [Statistics.Analyze] function to analyze the statistics and then call the -// [Statistics.Report] function to report the statistics. -// -// Please forward any questions about this package to the ANTLR discussion groups on GitHub or send to them to -// me [Jim Idle] directly at jimi@idle.ws -// -// [Jim Idle]: https:://github.com/jim-idle -func (s *goRunStats) Analyze() { - - // Look for anything that looks strange and record it in our local maps etc for the report to present it - // - s.CollectionAnomalies() - s.TopNCollections() -} - -// TopNCollections looks through all the statistical records and gathers the top ten collections by size. -func (s *goRunStats) TopNCollections() { - - // Let's sort the stat records by MaxSize - // - sort.Slice(s.jStats, func(i, j int) bool { - return s.jStats[i].MaxSize > s.jStats[j].MaxSize - }) - - for i := 0; i < len(s.jStats) && i < s.topN; i++ { - s.topNByMax = append(s.topNByMax, s.jStats[i]) - } - - // Sort by the number of times used - // - sort.Slice(s.jStats, func(i, j int) bool { - return s.jStats[i].Gets+s.jStats[i].Puts > s.jStats[j].Gets+s.jStats[j].Puts - }) - for i := 0; i < len(s.jStats) && i < s.topN; i++ { - s.topNByUsed = append(s.topNByUsed, s.jStats[i]) - } -} - -// Report dumps a markdown formatted report of all the statistics collected during a run to the given dir output -// path, which should represent a directory. Generated files will be prefixed with the given prefix and will be -// given a type name such as `anomalies` and a time stamp such as `2021-09-01T12:34:56` and a .md suffix. -func (s *goRunStats) Report(dir string, prefix string) error { - - isDir, err := isDirectory(dir) - switch { - case err != nil: - return err - case !isDir: - return fmt.Errorf("output directory `%s` is not a directory", dir) - } - s.reportCollections(dir, prefix) - - // Clean out any old data in case the user forgets - // - s.Reset() - return nil -} - -func (s *goRunStats) Reset() { - s.jStats = nil - s.topNByUsed = nil - s.topNByMax = nil -} - -func (s *goRunStats) reportCollections(dir, prefix string) { - cname := filepath.Join(dir, ".asciidoctor") - // If the file doesn't exist, create it, or append to the file - f, err := os.OpenFile(cname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - log.Fatal(err) - } - _, _ = f.WriteString(`// .asciidoctorconfig -++++ - -++++`) - _ = f.Close() - - fname := filepath.Join(dir, prefix+"_"+"_"+collectionsFile+"_"+".adoc") - // If the file doesn't exist, create it, or append to the file - f, err = os.OpenFile(fname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - log.Fatal(err) - } - defer func(f *os.File) { - err := f.Close() - if err != nil { - log.Fatal(err) - } - }(f) - _, _ = f.WriteString("= Collections for " + prefix + "\n\n") - - _, _ = f.WriteString("== Summary\n") - - if s.unusedCollections != nil { - _, _ = f.WriteString("=== Unused Collections\n") - _, _ = f.WriteString("Unused collections incur a penalty for allocation that makes them a candidate for either\n") - _, _ = f.WriteString(" removal or optimization. If you are using a collection that is not used, you should\n") - _, _ = f.WriteString(" consider removing it. If you are using a collection that is used, but not very often,\n") - _, _ = f.WriteString(" you should consider using lazy initialization to defer the allocation until it is\n") - _, _ = f.WriteString(" actually needed.\n\n") - - _, _ = f.WriteString("\n.Unused collections\n") - _, _ = f.WriteString(`[cols="<3,>1"]` + "\n\n") - _, _ = f.WriteString("|===\n") - _, _ = f.WriteString("| Type | Count\n") - - for k, v := range s.unusedCollections { - _, _ = f.WriteString("| " + CollectionDescriptors[k].SybolicName + " | " + strconv.Itoa(v) + "\n") - } - f.WriteString("|===\n\n") - } - - _, _ = f.WriteString("\n.Summary of Collections\n") - _, _ = f.WriteString(`[cols="<3,>1"]` + "\n\n") - _, _ = f.WriteString("|===\n") - _, _ = f.WriteString("| Type | Count\n") - for k, v := range s.counts { - _, _ = f.WriteString("| " + CollectionDescriptors[k].SybolicName + " | " + strconv.Itoa(v) + "\n") - } - _, _ = f.WriteString("| Total | " + strconv.Itoa(len(s.jStats)) + "\n") - _, _ = f.WriteString("|===\n\n") - - _, _ = f.WriteString("\n.Summary of Top " + strconv.Itoa(s.topN) + " Collections by MaxSize\n") - _, _ = f.WriteString(`[cols="<1,<3,>1,>1,>1,>1"]` + "\n\n") - _, _ = f.WriteString("|===\n") - _, _ = f.WriteString("| Source | Description | MaxSize | EndSize | Puts | Gets\n") - for _, c := range s.topNByMax { - _, _ = f.WriteString("| " + CollectionDescriptors[c.Source].SybolicName + "\n") - _, _ = f.WriteString("| " + c.Description + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.MaxSize) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.CurSize) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.Puts) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.Gets) + "\n") - _, _ = f.WriteString("\n") - } - _, _ = f.WriteString("|===\n\n") - - _, _ = f.WriteString("\n.Summary of Top " + strconv.Itoa(s.topN) + " Collections by Access\n") - _, _ = f.WriteString(`[cols="<1,<3,>1,>1,>1,>1,>1"]` + "\n\n") - _, _ = f.WriteString("|===\n") - _, _ = f.WriteString("| Source | Description | MaxSize | EndSize | Puts | Gets | P+G\n") - for _, c := range s.topNByUsed { - _, _ = f.WriteString("| " + CollectionDescriptors[c.Source].SybolicName + "\n") - _, _ = f.WriteString("| " + c.Description + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.MaxSize) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.CurSize) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.Puts) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.Gets) + "\n") - _, _ = f.WriteString("| " + strconv.Itoa(c.Gets+c.Puts) + "\n") - _, _ = f.WriteString("\n") - } - _, _ = f.WriteString("|===\n\n") -} - -// AddJStatRec adds a [JStatRec] record to the [goRunStats] collection when build runtimeConfig antlr.stats is enabled. -func (s *goRunStats) AddJStatRec(rec *JStatRec) { - s.jStatsLock.Lock() - defer s.jStatsLock.Unlock() - s.jStats = append(s.jStats, rec) -} - -// CollectionAnomalies looks through all the statistical records and gathers any anomalies that have been found. -func (s *goRunStats) CollectionAnomalies() { - s.jStatsLock.RLock() - defer s.jStatsLock.RUnlock() - s.counts = make(map[CollectionSource]int, len(s.jStats)) - for _, c := range s.jStats { - - // Accumlate raw counts - // - s.counts[c.Source]++ - - // Look for allocated but unused collections and count them - if c.MaxSize == 0 && c.Puts == 0 { - if s.unusedCollections == nil { - s.unusedCollections = make(map[CollectionSource]int) - } - s.unusedCollections[c.Source]++ - } - if c.MaxSize > 6000 { - fmt.Println("Collection ", c.Description, "accumulated a max size of ", c.MaxSize, " - this is probably too large and indicates a poorly formed grammar") - } - } - -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/stats_data.go b/vendor/github.com/antlr4-go/antlr/v4/stats_data.go deleted file mode 100644 index 4d9eb94e5..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/stats_data.go +++ /dev/null @@ -1,23 +0,0 @@ -package antlr - -// A JStatRec is a record of a particular use of a [JStore], [JMap] or JPCMap] collection. Typically, it will be -// used to look for unused collections that wre allocated anyway, problems with hash bucket clashes, and anomalies -// such as huge numbers of Gets with no entries found GetNoEnt. You can refer to the CollectionAnomalies() function -// for ideas on what can be gleaned from these statistics about collections. -type JStatRec struct { - Source CollectionSource - MaxSize int - CurSize int - Gets int - GetHits int - GetMisses int - GetHashConflicts int - GetNoEnt int - Puts int - PutHits int - PutMisses int - PutHashConflicts int - MaxSlotSize int - Description string - CreateStack []byte -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/token.go b/vendor/github.com/antlr4-go/antlr/v4/token.go deleted file mode 100644 index 9670efb82..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/token.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "strconv" - "strings" -) - -type TokenSourceCharStreamPair struct { - tokenSource TokenSource - charStream CharStream -} - -// A token has properties: text, type, line, character position in the line -// (so we can ignore tabs), token channel, index, and source from which -// we obtained this token. - -type Token interface { - GetSource() *TokenSourceCharStreamPair - GetTokenType() int - GetChannel() int - GetStart() int - GetStop() int - GetLine() int - GetColumn() int - - GetText() string - SetText(s string) - - GetTokenIndex() int - SetTokenIndex(v int) - - GetTokenSource() TokenSource - GetInputStream() CharStream - - String() string -} - -type BaseToken struct { - source *TokenSourceCharStreamPair - tokenType int // token type of the token - channel int // The parser ignores everything not on DEFAULT_CHANNEL - start int // optional return -1 if not implemented. - stop int // optional return -1 if not implemented. - tokenIndex int // from 0..n-1 of the token object in the input stream - line int // line=1..n of the 1st character - column int // beginning of the line at which it occurs, 0..n-1 - text string // text of the token. - readOnly bool -} - -const ( - TokenInvalidType = 0 - - // TokenEpsilon - during lookahead operations, this "token" signifies we hit the rule end [ATN] state - // and did not follow it despite needing to. - TokenEpsilon = -2 - - TokenMinUserTokenType = 1 - - TokenEOF = -1 - - // TokenDefaultChannel is the default channel upon which tokens are sent to the parser. - // - // All tokens go to the parser (unless [Skip] is called in the lexer rule) - // on a particular "channel". The parser tunes to a particular channel - // so that whitespace etc... can go to the parser on a "hidden" channel. - TokenDefaultChannel = 0 - - // TokenHiddenChannel defines the normal hidden channel - the parser wil not see tokens that are not on [TokenDefaultChannel]. - // - // Anything on a different channel than TokenDefaultChannel is not parsed by parser. - TokenHiddenChannel = 1 -) - -func (b *BaseToken) GetChannel() int { - return b.channel -} - -func (b *BaseToken) GetStart() int { - return b.start -} - -func (b *BaseToken) GetStop() int { - return b.stop -} - -func (b *BaseToken) GetLine() int { - return b.line -} - -func (b *BaseToken) GetColumn() int { - return b.column -} - -func (b *BaseToken) GetTokenType() int { - return b.tokenType -} - -func (b *BaseToken) GetSource() *TokenSourceCharStreamPair { - return b.source -} - -func (b *BaseToken) GetTokenIndex() int { - return b.tokenIndex -} - -func (b *BaseToken) SetTokenIndex(v int) { - b.tokenIndex = v -} - -func (b *BaseToken) GetTokenSource() TokenSource { - return b.source.tokenSource -} - -func (b *BaseToken) GetInputStream() CharStream { - return b.source.charStream -} - -type CommonToken struct { - BaseToken -} - -func NewCommonToken(source *TokenSourceCharStreamPair, tokenType, channel, start, stop int) *CommonToken { - - t := &CommonToken{ - BaseToken: BaseToken{ - source: source, - tokenType: tokenType, - channel: channel, - start: start, - stop: stop, - tokenIndex: -1, - }, - } - - if t.source.tokenSource != nil { - t.line = source.tokenSource.GetLine() - t.column = source.tokenSource.GetCharPositionInLine() - } else { - t.column = -1 - } - return t -} - -// An empty {@link Pair} which is used as the default value of -// {@link //source} for tokens that do not have a source. - -//CommonToken.EMPTY_SOURCE = [ nil, nil ] - -// Constructs a New{@link CommonToken} as a copy of another {@link Token}. -// -//

-// If {@code oldToken} is also a {@link CommonToken} instance, the newly -// constructed token will share a reference to the {@link //text} field and -// the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will -// be assigned the result of calling {@link //GetText}, and {@link //source} -// will be constructed from the result of {@link Token//GetTokenSource} and -// {@link Token//GetInputStream}.

-// -// @param oldToken The token to copy. -func (c *CommonToken) clone() *CommonToken { - t := NewCommonToken(c.source, c.tokenType, c.channel, c.start, c.stop) - t.tokenIndex = c.GetTokenIndex() - t.line = c.GetLine() - t.column = c.GetColumn() - t.text = c.GetText() - return t -} - -func (c *CommonToken) GetText() string { - if c.text != "" { - return c.text - } - input := c.GetInputStream() - if input == nil { - return "" - } - n := input.Size() - if c.start < n && c.stop < n { - return input.GetTextFromInterval(NewInterval(c.start, c.stop)) - } - return "" -} - -func (c *CommonToken) SetText(text string) { - c.text = text -} - -func (c *CommonToken) String() string { - txt := c.GetText() - if txt != "" { - txt = strings.Replace(txt, "\n", "\\n", -1) - txt = strings.Replace(txt, "\r", "\\r", -1) - txt = strings.Replace(txt, "\t", "\\t", -1) - } else { - txt = "" - } - - var ch string - if c.channel > 0 { - ch = ",channel=" + strconv.Itoa(c.channel) - } else { - ch = "" - } - - return "[@" + strconv.Itoa(c.tokenIndex) + "," + strconv.Itoa(c.start) + ":" + strconv.Itoa(c.stop) + "='" + - txt + "',<" + strconv.Itoa(c.tokenType) + ">" + - ch + "," + strconv.Itoa(c.line) + ":" + strconv.Itoa(c.column) + "]" -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/token_source.go b/vendor/github.com/antlr4-go/antlr/v4/token_source.go deleted file mode 100644 index a3f36eaa6..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/token_source.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -type TokenSource interface { - NextToken() Token - Skip() - More() - GetLine() int - GetCharPositionInLine() int - GetInputStream() CharStream - GetSourceName() string - setTokenFactory(factory TokenFactory) - GetTokenFactory() TokenFactory -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/token_stream.go b/vendor/github.com/antlr4-go/antlr/v4/token_stream.go deleted file mode 100644 index bf4ff6633..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/token_stream.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -type TokenStream interface { - IntStream - - LT(k int) Token - Reset() - - Get(index int) Token - GetTokenSource() TokenSource - SetTokenSource(TokenSource) - - GetAllText() string - GetTextFromInterval(Interval) string - GetTextFromRuleContext(RuleContext) string - GetTextFromTokens(Token, Token) string -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go b/vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go deleted file mode 100644 index ccf59b465..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go +++ /dev/null @@ -1,662 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "bytes" - "fmt" -) - -// -// Useful for rewriting out a buffered input token stream after doing some -// augmentation or other manipulations on it. - -//

-// You can insert stuff, replace, and delete chunks. Note that the operations -// are done lazily--only if you convert the buffer to a {@link String} with -// {@link TokenStream#getText()}. This is very efficient because you are not -// moving data around all the time. As the buffer of tokens is converted to -// strings, the {@link #getText()} method(s) scan the input token stream and -// check to see if there is an operation at the current index. If so, the -// operation is done and then normal {@link String} rendering continues on the -// buffer. This is like having multiple Turing machine instruction streams -// (programs) operating on a single input tape. :)

-//

- -// This rewriter makes no modifications to the token stream. It does not ask the -// stream to fill itself up nor does it advance the input cursor. The token -// stream {@link TokenStream#index()} will return the same value before and -// after any {@link #getText()} call.

- -//

-// The rewriter only works on tokens that you have in the buffer and ignores the -// current input cursor. If you are buffering tokens on-demand, calling -// {@link #getText()} halfway through the input will only do rewrites for those -// tokens in the first half of the file.

- -//

-// Since the operations are done lazily at {@link #getText}-time, operations do -// not screw up the token index values. That is, an insert operation at token -// index {@code i} does not change the index values for tokens -// {@code i}+1..n-1.

- -//

-// Because operations never actually alter the buffer, you may always get the -// original token stream back without undoing anything. Since the instructions -// are queued up, you can easily simulate transactions and roll back any changes -// if there is an error just by removing instructions. For example,

- -//
-// CharStream input = new ANTLRFileStream("input");
-// TLexer lex = new TLexer(input);
-// CommonTokenStream tokens = new CommonTokenStream(lex);
-// T parser = new T(tokens);
-// TokenStreamRewriter rewriter = new TokenStreamRewriter(tokens);
-// parser.startRule();
-// 
- -//

-// Then in the rules, you can execute (assuming rewriter is visible):

- -//
-// Token t,u;
-// ...
-// rewriter.insertAfter(t, "text to put after t");}
-// rewriter.insertAfter(u, "text after u");}
-// System.out.println(rewriter.getText());
-// 
- -//

-// You can also have multiple "instruction streams" and get multiple rewrites -// from a single pass over the input. Just name the instruction streams and use -// that name again when printing the buffer. This could be useful for generating -// a C file and also its header file--all from the same buffer:

- -//
-// rewriter.insertAfter("pass1", t, "text to put after t");}
-// rewriter.insertAfter("pass2", u, "text after u");}
-// System.out.println(rewriter.getText("pass1"));
-// System.out.println(rewriter.getText("pass2"));
-// 
- -//

-// If you don't use named rewrite streams, a "default" stream is used as the -// first example shows.

- -const ( - DefaultProgramName = "default" - ProgramInitSize = 100 - MinTokenIndex = 0 -) - -// Define the rewrite operation hierarchy - -type RewriteOperation interface { - - // Execute the rewrite operation by possibly adding to the buffer. - // Return the index of the next token to operate on. - Execute(buffer *bytes.Buffer) int - String() string - GetInstructionIndex() int - GetIndex() int - GetText() string - GetOpName() string - GetTokens() TokenStream - SetInstructionIndex(val int) - SetIndex(int) - SetText(string) - SetOpName(string) - SetTokens(TokenStream) -} - -type BaseRewriteOperation struct { - //Current index of rewrites list - instructionIndex int - //Token buffer index - index int - //Substitution text - text string - //Actual operation name - opName string - //Pointer to token steam - tokens TokenStream -} - -func (op *BaseRewriteOperation) GetInstructionIndex() int { - return op.instructionIndex -} - -func (op *BaseRewriteOperation) GetIndex() int { - return op.index -} - -func (op *BaseRewriteOperation) GetText() string { - return op.text -} - -func (op *BaseRewriteOperation) GetOpName() string { - return op.opName -} - -func (op *BaseRewriteOperation) GetTokens() TokenStream { - return op.tokens -} - -func (op *BaseRewriteOperation) SetInstructionIndex(val int) { - op.instructionIndex = val -} - -func (op *BaseRewriteOperation) SetIndex(val int) { - op.index = val -} - -func (op *BaseRewriteOperation) SetText(val string) { - op.text = val -} - -func (op *BaseRewriteOperation) SetOpName(val string) { - op.opName = val -} - -func (op *BaseRewriteOperation) SetTokens(val TokenStream) { - op.tokens = val -} - -func (op *BaseRewriteOperation) Execute(_ *bytes.Buffer) int { - return op.index -} - -func (op *BaseRewriteOperation) String() string { - return fmt.Sprintf("<%s@%d:\"%s\">", - op.opName, - op.tokens.Get(op.GetIndex()), - op.text, - ) - -} - -type InsertBeforeOp struct { - BaseRewriteOperation -} - -func NewInsertBeforeOp(index int, text string, stream TokenStream) *InsertBeforeOp { - return &InsertBeforeOp{BaseRewriteOperation: BaseRewriteOperation{ - index: index, - text: text, - opName: "InsertBeforeOp", - tokens: stream, - }} -} - -func (op *InsertBeforeOp) Execute(buffer *bytes.Buffer) int { - buffer.WriteString(op.text) - if op.tokens.Get(op.index).GetTokenType() != TokenEOF { - buffer.WriteString(op.tokens.Get(op.index).GetText()) - } - return op.index + 1 -} - -func (op *InsertBeforeOp) String() string { - return op.BaseRewriteOperation.String() -} - -// InsertAfterOp distinguishes between insert after/before to do the "insert after" instructions -// first and then the "insert before" instructions at same index. Implementation -// of "insert after" is "insert before index+1". -type InsertAfterOp struct { - BaseRewriteOperation -} - -func NewInsertAfterOp(index int, text string, stream TokenStream) *InsertAfterOp { - return &InsertAfterOp{ - BaseRewriteOperation: BaseRewriteOperation{ - index: index + 1, - text: text, - tokens: stream, - }, - } -} - -func (op *InsertAfterOp) Execute(buffer *bytes.Buffer) int { - buffer.WriteString(op.text) - if op.tokens.Get(op.index).GetTokenType() != TokenEOF { - buffer.WriteString(op.tokens.Get(op.index).GetText()) - } - return op.index + 1 -} - -func (op *InsertAfterOp) String() string { - return op.BaseRewriteOperation.String() -} - -// ReplaceOp tries to replace range from x..y with (y-x)+1 ReplaceOp -// instructions. -type ReplaceOp struct { - BaseRewriteOperation - LastIndex int -} - -func NewReplaceOp(from, to int, text string, stream TokenStream) *ReplaceOp { - return &ReplaceOp{ - BaseRewriteOperation: BaseRewriteOperation{ - index: from, - text: text, - opName: "ReplaceOp", - tokens: stream, - }, - LastIndex: to, - } -} - -func (op *ReplaceOp) Execute(buffer *bytes.Buffer) int { - if op.text != "" { - buffer.WriteString(op.text) - } - return op.LastIndex + 1 -} - -func (op *ReplaceOp) String() string { - if op.text == "" { - return fmt.Sprintf("", - op.tokens.Get(op.index), op.tokens.Get(op.LastIndex)) - } - return fmt.Sprintf("", - op.tokens.Get(op.index), op.tokens.Get(op.LastIndex), op.text) -} - -type TokenStreamRewriter struct { - //Our source stream - tokens TokenStream - // You may have multiple, named streams of rewrite operations. - // I'm calling these things "programs." - // Maps String (name) → rewrite (List) - programs map[string][]RewriteOperation - lastRewriteTokenIndexes map[string]int -} - -func NewTokenStreamRewriter(tokens TokenStream) *TokenStreamRewriter { - return &TokenStreamRewriter{ - tokens: tokens, - programs: map[string][]RewriteOperation{ - DefaultProgramName: make([]RewriteOperation, 0, ProgramInitSize), - }, - lastRewriteTokenIndexes: map[string]int{}, - } -} - -func (tsr *TokenStreamRewriter) GetTokenStream() TokenStream { - return tsr.tokens -} - -// Rollback the instruction stream for a program so that -// the indicated instruction (via instructionIndex) is no -// longer in the stream. UNTESTED! -func (tsr *TokenStreamRewriter) Rollback(programName string, instructionIndex int) { - is, ok := tsr.programs[programName] - if ok { - tsr.programs[programName] = is[MinTokenIndex:instructionIndex] - } -} - -func (tsr *TokenStreamRewriter) RollbackDefault(instructionIndex int) { - tsr.Rollback(DefaultProgramName, instructionIndex) -} - -// DeleteProgram Reset the program so that no instructions exist -func (tsr *TokenStreamRewriter) DeleteProgram(programName string) { - tsr.Rollback(programName, MinTokenIndex) //TODO: double test on that cause lower bound is not included -} - -func (tsr *TokenStreamRewriter) DeleteProgramDefault() { - tsr.DeleteProgram(DefaultProgramName) -} - -func (tsr *TokenStreamRewriter) InsertAfter(programName string, index int, text string) { - // to insert after, just insert before next index (even if past end) - var op RewriteOperation = NewInsertAfterOp(index, text, tsr.tokens) - rewrites := tsr.GetProgram(programName) - op.SetInstructionIndex(len(rewrites)) - tsr.AddToProgram(programName, op) -} - -func (tsr *TokenStreamRewriter) InsertAfterDefault(index int, text string) { - tsr.InsertAfter(DefaultProgramName, index, text) -} - -func (tsr *TokenStreamRewriter) InsertAfterToken(programName string, token Token, text string) { - tsr.InsertAfter(programName, token.GetTokenIndex(), text) -} - -func (tsr *TokenStreamRewriter) InsertBefore(programName string, index int, text string) { - var op RewriteOperation = NewInsertBeforeOp(index, text, tsr.tokens) - rewrites := tsr.GetProgram(programName) - op.SetInstructionIndex(len(rewrites)) - tsr.AddToProgram(programName, op) -} - -func (tsr *TokenStreamRewriter) InsertBeforeDefault(index int, text string) { - tsr.InsertBefore(DefaultProgramName, index, text) -} - -func (tsr *TokenStreamRewriter) InsertBeforeToken(programName string, token Token, text string) { - tsr.InsertBefore(programName, token.GetTokenIndex(), text) -} - -func (tsr *TokenStreamRewriter) Replace(programName string, from, to int, text string) { - if from > to || from < 0 || to < 0 || to >= tsr.tokens.Size() { - panic(fmt.Sprintf("replace: range invalid: %d..%d(size=%d)", - from, to, tsr.tokens.Size())) - } - var op RewriteOperation = NewReplaceOp(from, to, text, tsr.tokens) - rewrites := tsr.GetProgram(programName) - op.SetInstructionIndex(len(rewrites)) - tsr.AddToProgram(programName, op) -} - -func (tsr *TokenStreamRewriter) ReplaceDefault(from, to int, text string) { - tsr.Replace(DefaultProgramName, from, to, text) -} - -func (tsr *TokenStreamRewriter) ReplaceDefaultPos(index int, text string) { - tsr.ReplaceDefault(index, index, text) -} - -func (tsr *TokenStreamRewriter) ReplaceToken(programName string, from, to Token, text string) { - tsr.Replace(programName, from.GetTokenIndex(), to.GetTokenIndex(), text) -} - -func (tsr *TokenStreamRewriter) ReplaceTokenDefault(from, to Token, text string) { - tsr.ReplaceToken(DefaultProgramName, from, to, text) -} - -func (tsr *TokenStreamRewriter) ReplaceTokenDefaultPos(index Token, text string) { - tsr.ReplaceTokenDefault(index, index, text) -} - -func (tsr *TokenStreamRewriter) Delete(programName string, from, to int) { - tsr.Replace(programName, from, to, "") -} - -func (tsr *TokenStreamRewriter) DeleteDefault(from, to int) { - tsr.Delete(DefaultProgramName, from, to) -} - -func (tsr *TokenStreamRewriter) DeleteDefaultPos(index int) { - tsr.DeleteDefault(index, index) -} - -func (tsr *TokenStreamRewriter) DeleteToken(programName string, from, to Token) { - tsr.ReplaceToken(programName, from, to, "") -} - -func (tsr *TokenStreamRewriter) DeleteTokenDefault(from, to Token) { - tsr.DeleteToken(DefaultProgramName, from, to) -} - -func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndex(programName string) int { - i, ok := tsr.lastRewriteTokenIndexes[programName] - if !ok { - return -1 - } - return i -} - -func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndexDefault() int { - return tsr.GetLastRewriteTokenIndex(DefaultProgramName) -} - -func (tsr *TokenStreamRewriter) SetLastRewriteTokenIndex(programName string, i int) { - tsr.lastRewriteTokenIndexes[programName] = i -} - -func (tsr *TokenStreamRewriter) InitializeProgram(name string) []RewriteOperation { - is := make([]RewriteOperation, 0, ProgramInitSize) - tsr.programs[name] = is - return is -} - -func (tsr *TokenStreamRewriter) AddToProgram(name string, op RewriteOperation) { - is := tsr.GetProgram(name) - is = append(is, op) - tsr.programs[name] = is -} - -func (tsr *TokenStreamRewriter) GetProgram(name string) []RewriteOperation { - is, ok := tsr.programs[name] - if !ok { - is = tsr.InitializeProgram(name) - } - return is -} - -// GetTextDefault returns the text from the original tokens altered per the -// instructions given to this rewriter. -func (tsr *TokenStreamRewriter) GetTextDefault() string { - return tsr.GetText( - DefaultProgramName, - NewInterval(0, tsr.tokens.Size()-1)) -} - -// GetText returns the text from the original tokens altered per the -// instructions given to this rewriter. -func (tsr *TokenStreamRewriter) GetText(programName string, interval Interval) string { - rewrites := tsr.programs[programName] - start := interval.Start - stop := interval.Stop - // ensure start/end are in range - stop = min(stop, tsr.tokens.Size()-1) - start = max(start, 0) - if len(rewrites) == 0 { - return tsr.tokens.GetTextFromInterval(interval) // no instructions to execute - } - buf := bytes.Buffer{} - // First, optimize instruction stream - indexToOp := reduceToSingleOperationPerIndex(rewrites) - // Walk buffer, executing instructions and emitting tokens - for i := start; i <= stop && i < tsr.tokens.Size(); { - op := indexToOp[i] - delete(indexToOp, i) // remove so any left have index size-1 - t := tsr.tokens.Get(i) - if op == nil { - // no operation at that index, just dump token - if t.GetTokenType() != TokenEOF { - buf.WriteString(t.GetText()) - } - i++ // move to next token - } else { - i = op.Execute(&buf) // execute operation and skip - } - } - // include stuff after end if it's last index in buffer - // So, if they did an insertAfter(lastValidIndex, "foo"), include - // foo if end==lastValidIndex. - if stop == tsr.tokens.Size()-1 { - // Scan any remaining operations after last token - // should be included (they will be inserts). - for _, op := range indexToOp { - if op.GetIndex() >= tsr.tokens.Size()-1 { - buf.WriteString(op.GetText()) - } - } - } - return buf.String() -} - -// reduceToSingleOperationPerIndex combines operations and report invalid operations (like -// overlapping replaces that are not completed nested). Inserts to -// same index need to be combined etc... -// -// Here are the cases: -// -// I.i.u I.j.v leave alone, non-overlapping -// I.i.u I.i.v combine: Iivu -// -// R.i-j.u R.x-y.v | i-j in x-y delete first R -// R.i-j.u R.i-j.v delete first R -// R.i-j.u R.x-y.v | x-y in i-j ERROR -// R.i-j.u R.x-y.v | boundaries overlap ERROR -// -// Delete special case of replace (text==null): -// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right) -// -// I.i.u R.x-y.v | i in (x+1)-y delete I (since insert before -// we're not deleting i) -// I.i.u R.x-y.v | i not in (x+1)-y leave alone, non-overlapping -// R.x-y.v I.i.u | i in x-y ERROR -// R.x-y.v I.x.u R.x-y.uv (combine, delete I) -// R.x-y.v I.i.u | i not in x-y leave alone, non-overlapping -// -// I.i.u = insert u before op @ index i -// R.x-y.u = replace x-y indexed tokens with u -// -// First we need to examine replaces. For any replace op: -// -// 1. wipe out any insertions before op within that range. -// 2. Drop any replace op before that is contained completely within -// that range. -// 3. Throw exception upon boundary overlap with any previous replace. -// -// Then we can deal with inserts: -// -// 1. for any inserts to same index, combine even if not adjacent. -// 2. for any prior replace with same left boundary, combine this -// insert with replace and delete this 'replace'. -// 3. throw exception if index in same range as previous replace -// -// Don't actually delete; make op null in list. Easier to walk list. -// Later we can throw as we add to index → op map. -// -// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the -// inserted stuff would be before the 'replace' range. But, if you -// add tokens in front of a method body '{' and then delete the method -// body, I think the stuff before the '{' you added should disappear too. -// -// The func returns a map from token index to operation. -func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]RewriteOperation { - // WALK REPLACES - for i := 0; i < len(rewrites); i++ { - op := rewrites[i] - if op == nil { - continue - } - rop, ok := op.(*ReplaceOp) - if !ok { - continue - } - // Wipe prior inserts within range - for j := 0; j < i && j < len(rewrites); j++ { - if iop, ok := rewrites[j].(*InsertBeforeOp); ok { - if iop.index == rop.index { - // E.g., insert before 2, delete 2..2; update replace - // text to include insert before, kill insert - rewrites[iop.instructionIndex] = nil - if rop.text != "" { - rop.text = iop.text + rop.text - } else { - rop.text = iop.text - } - } else if iop.index > rop.index && iop.index <= rop.LastIndex { - // delete insert as it's a no-op. - rewrites[iop.instructionIndex] = nil - } - } - } - // Drop any prior replaces contained within - for j := 0; j < i && j < len(rewrites); j++ { - if prevop, ok := rewrites[j].(*ReplaceOp); ok { - if prevop.index >= rop.index && prevop.LastIndex <= rop.LastIndex { - // delete replace as it's a no-op. - rewrites[prevop.instructionIndex] = nil - continue - } - // throw exception unless disjoint or identical - disjoint := prevop.LastIndex < rop.index || prevop.index > rop.LastIndex - // Delete special case of replace (text==null): - // D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right) - if prevop.text == "" && rop.text == "" && !disjoint { - rewrites[prevop.instructionIndex] = nil - rop.index = min(prevop.index, rop.index) - rop.LastIndex = max(prevop.LastIndex, rop.LastIndex) - } else if !disjoint { - panic("replace op boundaries of " + rop.String() + " overlap with previous " + prevop.String()) - } - } - } - } - // WALK INSERTS - for i := 0; i < len(rewrites); i++ { - op := rewrites[i] - if op == nil { - continue - } - //hack to replicate inheritance in composition - _, iok := rewrites[i].(*InsertBeforeOp) - _, aok := rewrites[i].(*InsertAfterOp) - if !iok && !aok { - continue - } - iop := rewrites[i] - // combine current insert with prior if any at same index - // deviating a bit from TokenStreamRewriter.java - hard to incorporate inheritance logic - for j := 0; j < i && j < len(rewrites); j++ { - if nextIop, ok := rewrites[j].(*InsertAfterOp); ok { - if nextIop.index == iop.GetIndex() { - iop.SetText(nextIop.text + iop.GetText()) - rewrites[j] = nil - } - } - if prevIop, ok := rewrites[j].(*InsertBeforeOp); ok { - if prevIop.index == iop.GetIndex() { - iop.SetText(iop.GetText() + prevIop.text) - rewrites[prevIop.instructionIndex] = nil - } - } - } - // look for replaces where iop.index is in range; error - for j := 0; j < i && j < len(rewrites); j++ { - if rop, ok := rewrites[j].(*ReplaceOp); ok { - if iop.GetIndex() == rop.index { - rop.text = iop.GetText() + rop.text - rewrites[i] = nil - continue - } - if iop.GetIndex() >= rop.index && iop.GetIndex() <= rop.LastIndex { - panic("insert op " + iop.String() + " within boundaries of previous " + rop.String()) - } - } - } - } - m := map[int]RewriteOperation{} - for i := 0; i < len(rewrites); i++ { - op := rewrites[i] - if op == nil { - continue - } - if _, ok := m[op.GetIndex()]; ok { - panic("should only be one op per index") - } - m[op.GetIndex()] = op - } - return m -} - -/* - Quick fixing Go lack of overloads -*/ - -func max(a, b int) int { - if a > b { - return a - } else { - return b - } -} -func min(a, b int) int { - if a < b { - return a - } else { - return b - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/trace_listener.go b/vendor/github.com/antlr4-go/antlr/v4/trace_listener.go deleted file mode 100644 index 7b663bf84..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/trace_listener.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "fmt" - -type TraceListener struct { - parser *BaseParser -} - -func NewTraceListener(parser *BaseParser) *TraceListener { - tl := new(TraceListener) - tl.parser = parser - return tl -} - -func (t *TraceListener) VisitErrorNode(_ ErrorNode) { -} - -func (t *TraceListener) EnterEveryRule(ctx ParserRuleContext) { - fmt.Println("enter " + t.parser.GetRuleNames()[ctx.GetRuleIndex()] + ", LT(1)=" + t.parser.input.LT(1).GetText()) -} - -func (t *TraceListener) VisitTerminal(node TerminalNode) { - fmt.Println("consume " + fmt.Sprint(node.GetSymbol()) + " rule " + t.parser.GetRuleNames()[t.parser.ctx.GetRuleIndex()]) -} - -func (t *TraceListener) ExitEveryRule(ctx ParserRuleContext) { - fmt.Println("exit " + t.parser.GetRuleNames()[ctx.GetRuleIndex()] + ", LT(1)=" + t.parser.input.LT(1).GetText()) -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/transition.go b/vendor/github.com/antlr4-go/antlr/v4/transition.go deleted file mode 100644 index 313b0fc12..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/transition.go +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "fmt" - "strconv" - "strings" -) - -// atom, set, epsilon, action, predicate, rule transitions. -// -//

This is a one way link. It emanates from a state (usually via a list of -// transitions) and has a target state.

-// -//

Since we never have to change the ATN transitions once we construct it, -// the states. We'll use the term Edge for the DFA to distinguish them from -// ATN transitions.

- -type Transition interface { - getTarget() ATNState - setTarget(ATNState) - getIsEpsilon() bool - getLabel() *IntervalSet - getSerializationType() int - Matches(int, int, int) bool -} - -type BaseTransition struct { - target ATNState - isEpsilon bool - label int - intervalSet *IntervalSet - serializationType int -} - -func NewBaseTransition(target ATNState) *BaseTransition { - - if target == nil { - panic("target cannot be nil.") - } - - t := new(BaseTransition) - - t.target = target - // Are we epsilon, action, sempred? - t.isEpsilon = false - t.intervalSet = nil - - return t -} - -func (t *BaseTransition) getTarget() ATNState { - return t.target -} - -func (t *BaseTransition) setTarget(s ATNState) { - t.target = s -} - -func (t *BaseTransition) getIsEpsilon() bool { - return t.isEpsilon -} - -func (t *BaseTransition) getLabel() *IntervalSet { - return t.intervalSet -} - -func (t *BaseTransition) getSerializationType() int { - return t.serializationType -} - -func (t *BaseTransition) Matches(_, _, _ int) bool { - panic("Not implemented") -} - -const ( - TransitionEPSILON = 1 - TransitionRANGE = 2 - TransitionRULE = 3 - TransitionPREDICATE = 4 // e.g., {isType(input.LT(1))}? - TransitionATOM = 5 - TransitionACTION = 6 - TransitionSET = 7 // ~(A|B) or ~atom, wildcard, which convert to next 2 - TransitionNOTSET = 8 - TransitionWILDCARD = 9 - TransitionPRECEDENCE = 10 -) - -//goland:noinspection GoUnusedGlobalVariable -var TransitionserializationNames = []string{ - "INVALID", - "EPSILON", - "RANGE", - "RULE", - "PREDICATE", - "ATOM", - "ACTION", - "SET", - "NOT_SET", - "WILDCARD", - "PRECEDENCE", -} - -//var TransitionserializationTypes struct { -// EpsilonTransition int -// RangeTransition int -// RuleTransition int -// PredicateTransition int -// AtomTransition int -// ActionTransition int -// SetTransition int -// NotSetTransition int -// WildcardTransition int -// PrecedencePredicateTransition int -//}{ -// TransitionEPSILON, -// TransitionRANGE, -// TransitionRULE, -// TransitionPREDICATE, -// TransitionATOM, -// TransitionACTION, -// TransitionSET, -// TransitionNOTSET, -// TransitionWILDCARD, -// TransitionPRECEDENCE -//} - -// AtomTransition -// TODO: make all transitions sets? no, should remove set edges -type AtomTransition struct { - BaseTransition -} - -func NewAtomTransition(target ATNState, intervalSet int) *AtomTransition { - t := &AtomTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionATOM, - label: intervalSet, - isEpsilon: false, - }, - } - t.intervalSet = t.makeLabel() - - return t -} - -func (t *AtomTransition) makeLabel() *IntervalSet { - s := NewIntervalSet() - s.addOne(t.label) - return s -} - -func (t *AtomTransition) Matches(symbol, _, _ int) bool { - return t.label == symbol -} - -func (t *AtomTransition) String() string { - return strconv.Itoa(t.label) -} - -type RuleTransition struct { - BaseTransition - followState ATNState - ruleIndex, precedence int -} - -func NewRuleTransition(ruleStart ATNState, ruleIndex, precedence int, followState ATNState) *RuleTransition { - return &RuleTransition{ - BaseTransition: BaseTransition{ - target: ruleStart, - isEpsilon: true, - serializationType: TransitionRULE, - }, - ruleIndex: ruleIndex, - precedence: precedence, - followState: followState, - } -} - -func (t *RuleTransition) Matches(_, _, _ int) bool { - return false -} - -type EpsilonTransition struct { - BaseTransition - outermostPrecedenceReturn int -} - -func NewEpsilonTransition(target ATNState, outermostPrecedenceReturn int) *EpsilonTransition { - return &EpsilonTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionEPSILON, - isEpsilon: true, - }, - outermostPrecedenceReturn: outermostPrecedenceReturn, - } -} - -func (t *EpsilonTransition) Matches(_, _, _ int) bool { - return false -} - -func (t *EpsilonTransition) String() string { - return "epsilon" -} - -type RangeTransition struct { - BaseTransition - start, stop int -} - -func NewRangeTransition(target ATNState, start, stop int) *RangeTransition { - t := &RangeTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionRANGE, - isEpsilon: false, - }, - start: start, - stop: stop, - } - t.intervalSet = t.makeLabel() - return t -} - -func (t *RangeTransition) makeLabel() *IntervalSet { - s := NewIntervalSet() - s.addRange(t.start, t.stop) - return s -} - -func (t *RangeTransition) Matches(symbol, _, _ int) bool { - return symbol >= t.start && symbol <= t.stop -} - -func (t *RangeTransition) String() string { - var sb strings.Builder - sb.WriteByte('\'') - sb.WriteRune(rune(t.start)) - sb.WriteString("'..'") - sb.WriteRune(rune(t.stop)) - sb.WriteByte('\'') - return sb.String() -} - -type AbstractPredicateTransition interface { - Transition - IAbstractPredicateTransitionFoo() -} - -type BaseAbstractPredicateTransition struct { - BaseTransition -} - -func NewBasePredicateTransition(target ATNState) *BaseAbstractPredicateTransition { - return &BaseAbstractPredicateTransition{ - BaseTransition: BaseTransition{ - target: target, - }, - } -} - -func (a *BaseAbstractPredicateTransition) IAbstractPredicateTransitionFoo() {} - -type PredicateTransition struct { - BaseAbstractPredicateTransition - isCtxDependent bool - ruleIndex, predIndex int -} - -func NewPredicateTransition(target ATNState, ruleIndex, predIndex int, isCtxDependent bool) *PredicateTransition { - return &PredicateTransition{ - BaseAbstractPredicateTransition: BaseAbstractPredicateTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionPREDICATE, - isEpsilon: true, - }, - }, - isCtxDependent: isCtxDependent, - ruleIndex: ruleIndex, - predIndex: predIndex, - } -} - -func (t *PredicateTransition) Matches(_, _, _ int) bool { - return false -} - -func (t *PredicateTransition) getPredicate() *Predicate { - return NewPredicate(t.ruleIndex, t.predIndex, t.isCtxDependent) -} - -func (t *PredicateTransition) String() string { - return "pred_" + strconv.Itoa(t.ruleIndex) + ":" + strconv.Itoa(t.predIndex) -} - -type ActionTransition struct { - BaseTransition - isCtxDependent bool - ruleIndex, actionIndex, predIndex int -} - -func NewActionTransition(target ATNState, ruleIndex, actionIndex int, isCtxDependent bool) *ActionTransition { - return &ActionTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionACTION, - isEpsilon: true, - }, - isCtxDependent: isCtxDependent, - ruleIndex: ruleIndex, - actionIndex: actionIndex, - } -} - -func (t *ActionTransition) Matches(_, _, _ int) bool { - return false -} - -func (t *ActionTransition) String() string { - return "action_" + strconv.Itoa(t.ruleIndex) + ":" + strconv.Itoa(t.actionIndex) -} - -type SetTransition struct { - BaseTransition -} - -func NewSetTransition(target ATNState, set *IntervalSet) *SetTransition { - t := &SetTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionSET, - }, - } - - if set != nil { - t.intervalSet = set - } else { - t.intervalSet = NewIntervalSet() - t.intervalSet.addOne(TokenInvalidType) - } - return t -} - -func (t *SetTransition) Matches(symbol, _, _ int) bool { - return t.intervalSet.contains(symbol) -} - -func (t *SetTransition) String() string { - return t.intervalSet.String() -} - -type NotSetTransition struct { - SetTransition -} - -func NewNotSetTransition(target ATNState, set *IntervalSet) *NotSetTransition { - t := &NotSetTransition{ - SetTransition: SetTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionNOTSET, - }, - }, - } - if set != nil { - t.intervalSet = set - } else { - t.intervalSet = NewIntervalSet() - t.intervalSet.addOne(TokenInvalidType) - } - - return t -} - -func (t *NotSetTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool { - return symbol >= minVocabSymbol && symbol <= maxVocabSymbol && !t.intervalSet.contains(symbol) -} - -func (t *NotSetTransition) String() string { - return "~" + t.intervalSet.String() -} - -type WildcardTransition struct { - BaseTransition -} - -func NewWildcardTransition(target ATNState) *WildcardTransition { - return &WildcardTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionWILDCARD, - }, - } -} - -func (t *WildcardTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool { - return symbol >= minVocabSymbol && symbol <= maxVocabSymbol -} - -func (t *WildcardTransition) String() string { - return "." -} - -type PrecedencePredicateTransition struct { - BaseAbstractPredicateTransition - precedence int -} - -func NewPrecedencePredicateTransition(target ATNState, precedence int) *PrecedencePredicateTransition { - return &PrecedencePredicateTransition{ - BaseAbstractPredicateTransition: BaseAbstractPredicateTransition{ - BaseTransition: BaseTransition{ - target: target, - serializationType: TransitionPRECEDENCE, - isEpsilon: true, - }, - }, - precedence: precedence, - } -} - -func (t *PrecedencePredicateTransition) Matches(_, _, _ int) bool { - return false -} - -func (t *PrecedencePredicateTransition) getPredicate() *PrecedencePredicate { - return NewPrecedencePredicate(t.precedence) -} - -func (t *PrecedencePredicateTransition) String() string { - return fmt.Sprint(t.precedence) + " >= _p" -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/tree.go b/vendor/github.com/antlr4-go/antlr/v4/tree.go deleted file mode 100644 index c288420fb..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/tree.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -// The basic notion of a tree has a parent, a payload, and a list of children. -// It is the most abstract interface for all the trees used by ANTLR. -/// - -var TreeInvalidInterval = NewInterval(-1, -2) - -type Tree interface { - GetParent() Tree - SetParent(Tree) - GetPayload() interface{} - GetChild(i int) Tree - GetChildCount() int - GetChildren() []Tree -} - -type SyntaxTree interface { - Tree - GetSourceInterval() Interval -} - -type ParseTree interface { - SyntaxTree - Accept(Visitor ParseTreeVisitor) interface{} - GetText() string - ToStringTree([]string, Recognizer) string -} - -type RuleNode interface { - ParseTree - GetRuleContext() RuleContext -} - -type TerminalNode interface { - ParseTree - GetSymbol() Token -} - -type ErrorNode interface { - TerminalNode - - errorNode() -} - -type ParseTreeVisitor interface { - Visit(tree ParseTree) interface{} - VisitChildren(node RuleNode) interface{} - VisitTerminal(node TerminalNode) interface{} - VisitErrorNode(node ErrorNode) interface{} -} - -type BaseParseTreeVisitor struct{} - -var _ ParseTreeVisitor = &BaseParseTreeVisitor{} - -func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return tree.Accept(v) } -func (v *BaseParseTreeVisitor) VisitChildren(_ RuleNode) interface{} { return nil } -func (v *BaseParseTreeVisitor) VisitTerminal(_ TerminalNode) interface{} { return nil } -func (v *BaseParseTreeVisitor) VisitErrorNode(_ ErrorNode) interface{} { return nil } - -// TODO: Implement this? -//func (this ParseTreeVisitor) Visit(ctx) { -// if (Utils.isArray(ctx)) { -// self := this -// return ctx.map(function(child) { return VisitAtom(self, child)}) -// } else { -// return VisitAtom(this, ctx) -// } -//} -// -//func VisitAtom(Visitor, ctx) { -// if (ctx.parser == nil) { //is terminal -// return -// } -// -// name := ctx.parser.ruleNames[ctx.ruleIndex] -// funcName := "Visit" + Utils.titleCase(name) -// -// return Visitor[funcName](ctx) -//} - -type ParseTreeListener interface { - VisitTerminal(node TerminalNode) - VisitErrorNode(node ErrorNode) - EnterEveryRule(ctx ParserRuleContext) - ExitEveryRule(ctx ParserRuleContext) -} - -type BaseParseTreeListener struct{} - -var _ ParseTreeListener = &BaseParseTreeListener{} - -func (l *BaseParseTreeListener) VisitTerminal(_ TerminalNode) {} -func (l *BaseParseTreeListener) VisitErrorNode(_ ErrorNode) {} -func (l *BaseParseTreeListener) EnterEveryRule(_ ParserRuleContext) {} -func (l *BaseParseTreeListener) ExitEveryRule(_ ParserRuleContext) {} - -type TerminalNodeImpl struct { - parentCtx RuleContext - symbol Token -} - -var _ TerminalNode = &TerminalNodeImpl{} - -func NewTerminalNodeImpl(symbol Token) *TerminalNodeImpl { - tn := new(TerminalNodeImpl) - - tn.parentCtx = nil - tn.symbol = symbol - - return tn -} - -func (t *TerminalNodeImpl) GetChild(_ int) Tree { - return nil -} - -func (t *TerminalNodeImpl) GetChildren() []Tree { - return nil -} - -func (t *TerminalNodeImpl) SetChildren(_ []Tree) { - panic("Cannot set children on terminal node") -} - -func (t *TerminalNodeImpl) GetSymbol() Token { - return t.symbol -} - -func (t *TerminalNodeImpl) GetParent() Tree { - return t.parentCtx -} - -func (t *TerminalNodeImpl) SetParent(tree Tree) { - t.parentCtx = tree.(RuleContext) -} - -func (t *TerminalNodeImpl) GetPayload() interface{} { - return t.symbol -} - -func (t *TerminalNodeImpl) GetSourceInterval() Interval { - if t.symbol == nil { - return TreeInvalidInterval - } - tokenIndex := t.symbol.GetTokenIndex() - return NewInterval(tokenIndex, tokenIndex) -} - -func (t *TerminalNodeImpl) GetChildCount() int { - return 0 -} - -func (t *TerminalNodeImpl) Accept(v ParseTreeVisitor) interface{} { - return v.VisitTerminal(t) -} - -func (t *TerminalNodeImpl) GetText() string { - return t.symbol.GetText() -} - -func (t *TerminalNodeImpl) String() string { - if t.symbol.GetTokenType() == TokenEOF { - return "" - } - - return t.symbol.GetText() -} - -func (t *TerminalNodeImpl) ToStringTree(_ []string, _ Recognizer) string { - return t.String() -} - -// Represents a token that was consumed during reSynchronization -// rather than during a valid Match operation. For example, -// we will create this kind of a node during single token insertion -// and deletion as well as during "consume until error recovery set" -// upon no viable alternative exceptions. - -type ErrorNodeImpl struct { - *TerminalNodeImpl -} - -var _ ErrorNode = &ErrorNodeImpl{} - -func NewErrorNodeImpl(token Token) *ErrorNodeImpl { - en := new(ErrorNodeImpl) - en.TerminalNodeImpl = NewTerminalNodeImpl(token) - return en -} - -func (e *ErrorNodeImpl) errorNode() {} - -func (e *ErrorNodeImpl) Accept(v ParseTreeVisitor) interface{} { - return v.VisitErrorNode(e) -} - -type ParseTreeWalker struct { -} - -func NewParseTreeWalker() *ParseTreeWalker { - return new(ParseTreeWalker) -} - -// Walk performs a walk on the given parse tree starting at the root and going down recursively -// with depth-first search. On each node, [EnterRule] is called before -// recursively walking down into child nodes, then [ExitRule] is called after the recursive call to wind up. -func (p *ParseTreeWalker) Walk(listener ParseTreeListener, t Tree) { - switch tt := t.(type) { - case ErrorNode: - listener.VisitErrorNode(tt) - case TerminalNode: - listener.VisitTerminal(tt) - default: - p.EnterRule(listener, t.(RuleNode)) - for i := 0; i < t.GetChildCount(); i++ { - child := t.GetChild(i) - p.Walk(listener, child) - } - p.ExitRule(listener, t.(RuleNode)) - } -} - -// EnterRule enters a grammar rule by first triggering the generic event [ParseTreeListener].[EnterEveryRule] -// then by triggering the event specific to the given parse tree node -func (p *ParseTreeWalker) EnterRule(listener ParseTreeListener, r RuleNode) { - ctx := r.GetRuleContext().(ParserRuleContext) - listener.EnterEveryRule(ctx) - ctx.EnterRule(listener) -} - -// ExitRule exits a grammar rule by first triggering the event specific to the given parse tree node -// then by triggering the generic event [ParseTreeListener].ExitEveryRule -func (p *ParseTreeWalker) ExitRule(listener ParseTreeListener, r RuleNode) { - ctx := r.GetRuleContext().(ParserRuleContext) - ctx.ExitRule(listener) - listener.ExitEveryRule(ctx) -} - -//goland:noinspection GoUnusedGlobalVariable -var ParseTreeWalkerDefault = NewParseTreeWalker() - -type IterativeParseTreeWalker struct { - *ParseTreeWalker -} - -//goland:noinspection GoUnusedExportedFunction -func NewIterativeParseTreeWalker() *IterativeParseTreeWalker { - return new(IterativeParseTreeWalker) -} - -func (i *IterativeParseTreeWalker) Walk(listener ParseTreeListener, t Tree) { - var stack []Tree - var indexStack []int - currentNode := t - currentIndex := 0 - - for currentNode != nil { - // pre-order visit - switch tt := currentNode.(type) { - case ErrorNode: - listener.VisitErrorNode(tt) - case TerminalNode: - listener.VisitTerminal(tt) - default: - i.EnterRule(listener, currentNode.(RuleNode)) - } - // Move down to first child, if exists - if currentNode.GetChildCount() > 0 { - stack = append(stack, currentNode) - indexStack = append(indexStack, currentIndex) - currentIndex = 0 - currentNode = currentNode.GetChild(0) - continue - } - - for { - // post-order visit - if ruleNode, ok := currentNode.(RuleNode); ok { - i.ExitRule(listener, ruleNode) - } - // No parent, so no siblings - if len(stack) == 0 { - currentNode = nil - currentIndex = 0 - break - } - // Move to next sibling if possible - currentIndex++ - if stack[len(stack)-1].GetChildCount() > currentIndex { - currentNode = stack[len(stack)-1].GetChild(currentIndex) - break - } - // No next, sibling, so move up - currentNode, stack = stack[len(stack)-1], stack[:len(stack)-1] - currentIndex, indexStack = indexStack[len(indexStack)-1], indexStack[:len(indexStack)-1] - } - } -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/trees.go b/vendor/github.com/antlr4-go/antlr/v4/trees.go deleted file mode 100644 index f44c05d81..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/trees.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import "fmt" - -/** A set of utility routines useful for all kinds of ANTLR trees. */ - -// TreesStringTree prints out a whole tree in LISP form. [getNodeText] is used on the -// node payloads to get the text for the nodes. Detects parse trees and extracts data appropriately. -func TreesStringTree(tree Tree, ruleNames []string, recog Recognizer) string { - - if recog != nil { - ruleNames = recog.GetRuleNames() - } - - s := TreesGetNodeText(tree, ruleNames, nil) - - s = EscapeWhitespace(s, false) - c := tree.GetChildCount() - if c == 0 { - return s - } - res := "(" + s + " " - if c > 0 { - s = TreesStringTree(tree.GetChild(0), ruleNames, nil) - res += s - } - for i := 1; i < c; i++ { - s = TreesStringTree(tree.GetChild(i), ruleNames, nil) - res += " " + s - } - res += ")" - return res -} - -func TreesGetNodeText(t Tree, ruleNames []string, recog Parser) string { - if recog != nil { - ruleNames = recog.GetRuleNames() - } - - if ruleNames != nil { - switch t2 := t.(type) { - case RuleNode: - t3 := t2.GetRuleContext() - altNumber := t3.GetAltNumber() - - if altNumber != ATNInvalidAltNumber { - return fmt.Sprintf("%s:%d", ruleNames[t3.GetRuleIndex()], altNumber) - } - return ruleNames[t3.GetRuleIndex()] - case ErrorNode: - return fmt.Sprint(t2) - case TerminalNode: - if t2.GetSymbol() != nil { - return t2.GetSymbol().GetText() - } - } - } - - // no recognition for rule names - payload := t.GetPayload() - if p2, ok := payload.(Token); ok { - return p2.GetText() - } - - return fmt.Sprint(t.GetPayload()) -} - -// TreesGetChildren returns am ordered list of all children of this node -// -//goland:noinspection GoUnusedExportedFunction -func TreesGetChildren(t Tree) []Tree { - list := make([]Tree, 0) - for i := 0; i < t.GetChildCount(); i++ { - list = append(list, t.GetChild(i)) - } - return list -} - -// TreesgetAncestors returns a list of all ancestors of this node. The first node of list is the root -// and the last node is the parent of this node. -// -//goland:noinspection GoUnusedExportedFunction -func TreesgetAncestors(t Tree) []Tree { - ancestors := make([]Tree, 0) - t = t.GetParent() - for t != nil { - f := []Tree{t} - ancestors = append(f, ancestors...) - t = t.GetParent() - } - return ancestors -} - -//goland:noinspection GoUnusedExportedFunction -func TreesFindAllTokenNodes(t ParseTree, ttype int) []ParseTree { - return TreesfindAllNodes(t, ttype, true) -} - -//goland:noinspection GoUnusedExportedFunction -func TreesfindAllRuleNodes(t ParseTree, ruleIndex int) []ParseTree { - return TreesfindAllNodes(t, ruleIndex, false) -} - -func TreesfindAllNodes(t ParseTree, index int, findTokens bool) []ParseTree { - nodes := make([]ParseTree, 0) - treesFindAllNodes(t, index, findTokens, &nodes) - return nodes -} - -func treesFindAllNodes(t ParseTree, index int, findTokens bool, nodes *[]ParseTree) { - // check this node (the root) first - - t2, ok := t.(TerminalNode) - t3, ok2 := t.(ParserRuleContext) - - if findTokens && ok { - if t2.GetSymbol().GetTokenType() == index { - *nodes = append(*nodes, t2) - } - } else if !findTokens && ok2 { - if t3.GetRuleIndex() == index { - *nodes = append(*nodes, t3) - } - } - // check children - for i := 0; i < t.GetChildCount(); i++ { - treesFindAllNodes(t.GetChild(i).(ParseTree), index, findTokens, nodes) - } -} - -//goland:noinspection GoUnusedExportedFunction -func TreesDescendants(t ParseTree) []ParseTree { - nodes := []ParseTree{t} - for i := 0; i < t.GetChildCount(); i++ { - nodes = append(nodes, TreesDescendants(t.GetChild(i).(ParseTree))...) - } - return nodes -} diff --git a/vendor/github.com/antlr4-go/antlr/v4/utils.go b/vendor/github.com/antlr4-go/antlr/v4/utils.go deleted file mode 100644 index 733d7df9d..000000000 --- a/vendor/github.com/antlr4-go/antlr/v4/utils.go +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. - -package antlr - -import ( - "bytes" - "errors" - "fmt" - "math/bits" - "os" - "strconv" - "strings" - "syscall" -) - -func intMin(a, b int) int { - if a < b { - return a - } - return b -} - -func intMax(a, b int) int { - if a > b { - return a - } - return b -} - -// A simple integer stack - -type IntStack []int - -var ErrEmptyStack = errors.New("stack is empty") - -func (s *IntStack) Pop() (int, error) { - l := len(*s) - 1 - if l < 0 { - return 0, ErrEmptyStack - } - v := (*s)[l] - *s = (*s)[0:l] - return v, nil -} - -func (s *IntStack) Push(e int) { - *s = append(*s, e) -} - -const bitsPerWord = 64 - -func indexForBit(bit int) int { - return bit / bitsPerWord -} - -//goland:noinspection GoUnusedExportedFunction,GoUnusedFunction -func wordForBit(data []uint64, bit int) uint64 { - idx := indexForBit(bit) - if idx >= len(data) { - return 0 - } - return data[idx] -} - -func maskForBit(bit int) uint64 { - return uint64(1) << (bit % bitsPerWord) -} - -func wordsNeeded(bit int) int { - return indexForBit(bit) + 1 -} - -type BitSet struct { - data []uint64 -} - -// NewBitSet creates a new bitwise set -// TODO: See if we can replace with the standard library's BitSet -func NewBitSet() *BitSet { - return &BitSet{} -} - -func (b *BitSet) add(value int) { - idx := indexForBit(value) - if idx >= len(b.data) { - size := wordsNeeded(value) - data := make([]uint64, size) - copy(data, b.data) - b.data = data - } - b.data[idx] |= maskForBit(value) -} - -func (b *BitSet) clear(index int) { - idx := indexForBit(index) - if idx >= len(b.data) { - return - } - b.data[idx] &= ^maskForBit(index) -} - -func (b *BitSet) or(set *BitSet) { - // Get min size necessary to represent the bits in both sets. - bLen := b.minLen() - setLen := set.minLen() - maxLen := intMax(bLen, setLen) - if maxLen > len(b.data) { - // Increase the size of len(b.data) to represent the bits in both sets. - data := make([]uint64, maxLen) - copy(data, b.data) - b.data = data - } - // len(b.data) is at least setLen. - for i := 0; i < setLen; i++ { - b.data[i] |= set.data[i] - } -} - -func (b *BitSet) remove(value int) { - b.clear(value) -} - -func (b *BitSet) contains(value int) bool { - idx := indexForBit(value) - if idx >= len(b.data) { - return false - } - return (b.data[idx] & maskForBit(value)) != 0 -} - -func (b *BitSet) minValue() int { - for i, v := range b.data { - if v == 0 { - continue - } - return i*bitsPerWord + bits.TrailingZeros64(v) - } - return 2147483647 -} - -func (b *BitSet) equals(other interface{}) bool { - otherBitSet, ok := other.(*BitSet) - if !ok { - return false - } - - if b == otherBitSet { - return true - } - - // We only compare set bits, so we cannot rely on the two slices having the same size. Its - // possible for two BitSets to have different slice lengths but the same set bits. So we only - // compare the relevant words and ignore the trailing zeros. - bLen := b.minLen() - otherLen := otherBitSet.minLen() - - if bLen != otherLen { - return false - } - - for i := 0; i < bLen; i++ { - if b.data[i] != otherBitSet.data[i] { - return false - } - } - - return true -} - -func (b *BitSet) minLen() int { - for i := len(b.data); i > 0; i-- { - if b.data[i-1] != 0 { - return i - } - } - return 0 -} - -func (b *BitSet) length() int { - cnt := 0 - for _, val := range b.data { - cnt += bits.OnesCount64(val) - } - return cnt -} - -func (b *BitSet) String() string { - vals := make([]string, 0, b.length()) - - for i, v := range b.data { - for v != 0 { - n := bits.TrailingZeros64(v) - vals = append(vals, strconv.Itoa(i*bitsPerWord+n)) - v &= ^(uint64(1) << n) - } - } - - return "{" + strings.Join(vals, ", ") + "}" -} - -type AltDict struct { - data map[string]interface{} -} - -func NewAltDict() *AltDict { - d := new(AltDict) - d.data = make(map[string]interface{}) - return d -} - -func (a *AltDict) Get(key string) interface{} { - key = "k-" + key - return a.data[key] -} - -func (a *AltDict) put(key string, value interface{}) { - key = "k-" + key - a.data[key] = value -} - -func (a *AltDict) values() []interface{} { - vs := make([]interface{}, len(a.data)) - i := 0 - for _, v := range a.data { - vs[i] = v - i++ - } - return vs -} - -func EscapeWhitespace(s string, escapeSpaces bool) string { - - s = strings.Replace(s, "\t", "\\t", -1) - s = strings.Replace(s, "\n", "\\n", -1) - s = strings.Replace(s, "\r", "\\r", -1) - if escapeSpaces { - s = strings.Replace(s, " ", "\u00B7", -1) - } - return s -} - -//goland:noinspection GoUnusedExportedFunction -func TerminalNodeToStringArray(sa []TerminalNode) []string { - st := make([]string, len(sa)) - - for i, s := range sa { - st[i] = fmt.Sprintf("%v", s) - } - - return st -} - -//goland:noinspection GoUnusedExportedFunction -func PrintArrayJavaStyle(sa []string) string { - var buffer bytes.Buffer - - buffer.WriteString("[") - - for i, s := range sa { - buffer.WriteString(s) - if i != len(sa)-1 { - buffer.WriteString(", ") - } - } - - buffer.WriteString("]") - - return buffer.String() -} - -// murmur hash -func murmurInit(seed int) int { - return seed -} - -func murmurUpdate(h int, value int) int { - const c1 uint32 = 0xCC9E2D51 - const c2 uint32 = 0x1B873593 - const r1 uint32 = 15 - const r2 uint32 = 13 - const m uint32 = 5 - const n uint32 = 0xE6546B64 - - k := uint32(value) - k *= c1 - k = (k << r1) | (k >> (32 - r1)) - k *= c2 - - hash := uint32(h) ^ k - hash = (hash << r2) | (hash >> (32 - r2)) - hash = hash*m + n - return int(hash) -} - -func murmurFinish(h int, numberOfWords int) int { - var hash = uint32(h) - hash ^= uint32(numberOfWords) << 2 - hash ^= hash >> 16 - hash *= 0x85ebca6b - hash ^= hash >> 13 - hash *= 0xc2b2ae35 - hash ^= hash >> 16 - - return int(hash) -} - -func isDirectory(dir string) (bool, error) { - fileInfo, err := os.Stat(dir) - if err != nil { - switch { - case errors.Is(err, syscall.ENOENT): - // The given directory does not exist, so we will try to create it - // - err = os.MkdirAll(dir, 0755) - if err != nil { - return false, err - } - - return true, nil - case err != nil: - return false, err - default: - } - } - return fileInfo.IsDir(), err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt deleted file mode 100644 index 899129ecc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt +++ /dev/null @@ -1,3 +0,0 @@ -AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -Copyright 2014-2015 Stripe, Inc. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go deleted file mode 100644 index 6504a2186..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go +++ /dev/null @@ -1,18 +0,0 @@ -package aws - -// AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing. -type AccountIDEndpointMode string - -const ( - // AccountIDEndpointModeUnset indicates the AWS account ID will not be used for endpoint routing - AccountIDEndpointModeUnset AccountIDEndpointMode = "" - - // AccountIDEndpointModePreferred indicates the AWS account ID will be used for endpoint routing if present - AccountIDEndpointModePreferred = "preferred" - - // AccountIDEndpointModeRequired indicates an error will be returned if the AWS account ID is not resolved from identity - AccountIDEndpointModeRequired = "required" - - // AccountIDEndpointModeDisabled indicates the AWS account ID will be ignored during endpoint routing - AccountIDEndpointModeDisabled = "disabled" -) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.go deleted file mode 100644 index 4152caade..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.go +++ /dev/null @@ -1,33 +0,0 @@ -package aws - -// RequestChecksumCalculation controls request checksum calculation workflow -type RequestChecksumCalculation int - -const ( - // RequestChecksumCalculationUnset is the unset value for RequestChecksumCalculation - RequestChecksumCalculationUnset RequestChecksumCalculation = iota - - // RequestChecksumCalculationWhenSupported indicates request checksum will be calculated - // if the operation supports input checksums - RequestChecksumCalculationWhenSupported - - // RequestChecksumCalculationWhenRequired indicates request checksum will be calculated - // if required by the operation or if user elects to set a checksum algorithm in request - RequestChecksumCalculationWhenRequired -) - -// ResponseChecksumValidation controls response checksum validation workflow -type ResponseChecksumValidation int - -const ( - // ResponseChecksumValidationUnset is the unset value for ResponseChecksumValidation - ResponseChecksumValidationUnset ResponseChecksumValidation = iota - - // ResponseChecksumValidationWhenSupported indicates response checksum will be validated - // if the operation supports output checksums - ResponseChecksumValidationWhenSupported - - // ResponseChecksumValidationWhenRequired indicates response checksum will only - // be validated if the operation requires output checksum validation - ResponseChecksumValidationWhenRequired -) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go deleted file mode 100644 index 3219517da..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go +++ /dev/null @@ -1,250 +0,0 @@ -package aws - -import ( - "net/http" - - smithybearer "github.com/aws/smithy-go/auth/bearer" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// HTTPClient provides the interface to provide custom HTTPClients. Generally -// *http.Client is sufficient for most use cases. The HTTPClient should not -// follow 301 or 302 redirects. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// A Config provides service configuration for service clients. -type Config struct { - // The region to send requests to. This parameter is required and must - // be configured globally or on a per-client basis unless otherwise - // noted. A full list of regions is found in the "Regions and Endpoints" - // document. - // - // See http://docs.aws.amazon.com/general/latest/gr/rande.html for - // information on AWS regions. - Region string - - // The credentials object to use when signing requests. - // Use the LoadDefaultConfig to load configuration from all the SDK's supported - // sources, and resolve credentials using the SDK's default credential chain. - Credentials CredentialsProvider - - // The Bearer Authentication token provider to use for authenticating API - // operation calls with a Bearer Authentication token. The API clients and - // operation must support Bearer Authentication scheme in order for the - // token provider to be used. API clients created with NewFromConfig will - // automatically be configured with this option, if the API client support - // Bearer Authentication. - // - // The SDK's config.LoadDefaultConfig can automatically populate this - // option for external configuration options such as SSO session. - // https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html - BearerAuthTokenProvider smithybearer.TokenProvider - - // The HTTP Client the SDK's API clients will use to invoke HTTP requests. - // The SDK defaults to a BuildableClient allowing API clients to create - // copies of the HTTP Client for service specific customizations. - // - // Use a (*http.Client) for custom behavior. Using a custom http.Client - // will prevent the SDK from modifying the HTTP client. - HTTPClient HTTPClient - - // An endpoint resolver that can be used to provide or override an endpoint - // for the given service and region. - // - // See the `aws.EndpointResolver` documentation for additional usage - // information. - // - // Deprecated: See Config.EndpointResolverWithOptions - EndpointResolver EndpointResolver - - // An endpoint resolver that can be used to provide or override an endpoint - // for the given service and region. - // - // When EndpointResolverWithOptions is specified, it will be used by a - // service client rather than using EndpointResolver if also specified. - // - // See the `aws.EndpointResolverWithOptions` documentation for additional - // usage information. - // - // Deprecated: with the release of endpoint resolution v2 in API clients, - // EndpointResolver and EndpointResolverWithOptions are deprecated. - // Providing a value for this field will likely prevent you from using - // newer endpoint-related service features. See API client options - // EndpointResolverV2 and BaseEndpoint. - EndpointResolverWithOptions EndpointResolverWithOptions - - // RetryMaxAttempts specifies the maximum number attempts an API client - // will call an operation that fails with a retryable error. - // - // API Clients will only use this value to construct a retryer if the - // Config.Retryer member is not nil. This value will be ignored if - // Retryer is not nil. - RetryMaxAttempts int - - // RetryMode specifies the retry model the API client will be created with. - // - // API Clients will only use this value to construct a retryer if the - // Config.Retryer member is not nil. This value will be ignored if - // Retryer is not nil. - RetryMode RetryMode - - // Retryer is a function that provides a Retryer implementation. A Retryer - // guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - // - // In general, the provider function should return a new instance of a - // Retryer if you are attempting to provide a consistent Retryer - // configuration across all clients. This will ensure that each client will - // be provided a new instance of the Retryer implementation, and will avoid - // issues such as sharing the same retry token bucket across services. - // - // If not nil, RetryMaxAttempts, and RetryMode will be ignored by API - // clients. - Retryer func() Retryer - - // ConfigSources are the sources that were used to construct the Config. - // Allows for additional configuration to be loaded by clients. - ConfigSources []interface{} - - // APIOptions provides the set of middleware mutations modify how the API - // client requests will be handled. This is useful for adding additional - // tracing data to a request, or changing behavior of the SDK's client. - APIOptions []func(*middleware.Stack) error - - // The logger writer interface to write logging messages to. Defaults to - // standard error. - Logger logging.Logger - - // Configures the events that will be sent to the configured logger. This - // can be used to configure the logging of signing, retries, request, and - // responses of the SDK clients. - // - // See the ClientLogMode type documentation for the complete set of logging - // modes and available configuration. - ClientLogMode ClientLogMode - - // The configured DefaultsMode. If not specified, service clients will - // default to legacy. - // - // Supported modes are: auto, cross-region, in-region, legacy, mobile, - // standard - DefaultsMode DefaultsMode - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode - // is set to DefaultsModeAuto and is initialized by - // `config.LoadDefaultConfig`. You should not populate this structure - // programmatically, or rely on the values here within your applications. - RuntimeEnvironment RuntimeEnvironment - - // AppId is an optional application specific identifier that can be set. - // When set it will be appended to the User-Agent header of every request - // in the form of App/{AppId}. This variable is sourced from environment - // variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id. - // See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for - // more information on environment variables and shared config settings. - AppID string - - // BaseEndpoint is an intermediary transfer location to a service specific - // BaseEndpoint on a service's Options. - BaseEndpoint *string - - // DisableRequestCompression toggles if an operation request could be - // compressed or not. Will be set to false by default. This variable is sourced from - // environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute - // disable_request_compression - DisableRequestCompression bool - - // RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be - // compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. - // This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or - // the shared config profile attribute request_min_compression_size_bytes - RequestMinCompressSizeBytes int64 - - // Controls how a resolved AWS account ID is handled for endpoint routing. - AccountIDEndpointMode AccountIDEndpointMode - - // RequestChecksumCalculation determines when request checksum calculation is performed. - // - // There are two possible values for this setting: - // - // 1. RequestChecksumCalculationWhenSupported (default): The checksum is always calculated - // if the operation supports it, regardless of whether the user sets an algorithm in the request. - // - // 2. RequestChecksumCalculationWhenRequired: The checksum is only calculated if the user - // explicitly sets a checksum algorithm in the request. - // - // This setting is sourced from the environment variable AWS_REQUEST_CHECKSUM_CALCULATION - // or the shared config profile attribute "request_checksum_calculation". - RequestChecksumCalculation RequestChecksumCalculation - - // ResponseChecksumValidation determines when response checksum validation is performed - // - // There are two possible values for this setting: - // - // 1. ResponseChecksumValidationWhenSupported (default): The checksum is always validated - // if the operation supports it, regardless of whether the user sets the validation mode to ENABLED in request. - // - // 2. ResponseChecksumValidationWhenRequired: The checksum is only validated if the user - // explicitly sets the validation mode to ENABLED in the request - // This variable is sourced from environment variable AWS_RESPONSE_CHECKSUM_VALIDATION or - // the shared config profile attribute "response_checksum_validation". - ResponseChecksumValidation ResponseChecksumValidation - - // Registry of HTTP interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // Priority list of preferred auth scheme IDs. - AuthSchemePreference []string - - // ServiceOptions provides service specific configuration options that will be applied - // when constructing clients for specific services. Each callback function receives the service ID - // and the service's Options struct, allowing for dynamic configuration based on the service. - ServiceOptions []func(string, any) -} - -// NewConfig returns a new Config pointer that can be chained with builder -// methods to set multiple configuration values inline without using pointers. -func NewConfig() *Config { - return &Config{} -} - -// Copy will return a shallow copy of the Config object. -func (c Config) Copy() Config { - cp := c - return cp -} - -// EndpointDiscoveryEnableState indicates if endpoint discovery is -// enabled, disabled, auto or unset state. -// -// Default behavior (Auto or Unset) indicates operations that require endpoint -// discovery will use Endpoint Discovery by default. Operations that -// optionally use Endpoint Discovery will not use Endpoint Discovery -// unless EndpointDiscovery is explicitly enabled. -type EndpointDiscoveryEnableState uint - -// Enumeration values for EndpointDiscoveryEnableState -const ( - // EndpointDiscoveryUnset represents EndpointDiscoveryEnableState is unset. - // Users do not need to use this value explicitly. The behavior for unset - // is the same as for EndpointDiscoveryAuto. - EndpointDiscoveryUnset EndpointDiscoveryEnableState = iota - - // EndpointDiscoveryAuto represents an AUTO state that allows endpoint - // discovery only when required by the api. This is the default - // configuration resolved by the client if endpoint discovery is neither - // enabled or disabled. - EndpointDiscoveryAuto // default state - - // EndpointDiscoveryDisabled indicates client MUST not perform endpoint - // discovery even when required. - EndpointDiscoveryDisabled - - // EndpointDiscoveryEnabled indicates client MUST always perform endpoint - // discovery if supported for the operation. - EndpointDiscoveryEnabled -) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/context.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/context.go deleted file mode 100644 index 4d8e26ef3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/context.go +++ /dev/null @@ -1,22 +0,0 @@ -package aws - -import ( - "context" - "time" -) - -type suppressedContext struct { - context.Context -} - -func (s *suppressedContext) Deadline() (deadline time.Time, ok bool) { - return time.Time{}, false -} - -func (s *suppressedContext) Done() <-chan struct{} { - return nil -} - -func (s *suppressedContext) Err() error { - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go deleted file mode 100644 index 623890e8d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go +++ /dev/null @@ -1,235 +0,0 @@ -package aws - -import ( - "context" - "fmt" - "sync/atomic" - "time" - - sdkrand "github.com/aws/aws-sdk-go-v2/internal/rand" - "github.com/aws/aws-sdk-go-v2/internal/sync/singleflight" -) - -// CredentialsCacheOptions are the options -type CredentialsCacheOptions struct { - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // An ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. This can cause an - // increased number of requests to refresh the credentials to occur. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // ExpiryWindowJitterFrac provides a mechanism for randomizing the - // expiration of credentials within the configured ExpiryWindow by a random - // percentage. Valid values are between 0.0 and 1.0. - // - // As an example if ExpiryWindow is 60 seconds and ExpiryWindowJitterFrac - // is 0.5 then credentials will be set to expire between 30 to 60 seconds - // prior to their actual expiration time. - // - // If ExpiryWindow is 0 or less then ExpiryWindowJitterFrac is ignored. - // If ExpiryWindowJitterFrac is 0 then no randomization will be applied to the window. - // If ExpiryWindowJitterFrac < 0 the value will be treated as 0. - // If ExpiryWindowJitterFrac > 1 the value will be treated as 1. - ExpiryWindowJitterFrac float64 -} - -// CredentialsCache provides caching and concurrency safe credentials retrieval -// via the provider's retrieve method. -// -// CredentialsCache will look for optional interfaces on the Provider to adjust -// how the credential cache handles credentials caching. -// -// - HandleFailRefreshCredentialsCacheStrategy - Allows provider to handle -// credential refresh failures. This could return an updated Credentials -// value, or attempt another means of retrieving credentials. -// -// - AdjustExpiresByCredentialsCacheStrategy - Allows provider to adjust how -// credentials Expires is modified. This could modify how the Credentials -// Expires is adjusted based on the CredentialsCache ExpiryWindow option. -// Such as providing a floor not to reduce the Expires below. -type CredentialsCache struct { - provider CredentialsProvider - - options CredentialsCacheOptions - creds atomic.Value - sf singleflight.Group -} - -// NewCredentialsCache returns a CredentialsCache that wraps provider. Provider -// is expected to not be nil. A variadic list of one or more functions can be -// provided to modify the CredentialsCache configuration. This allows for -// configuration of credential expiry window and jitter. -func NewCredentialsCache(provider CredentialsProvider, optFns ...func(options *CredentialsCacheOptions)) *CredentialsCache { - options := CredentialsCacheOptions{} - - for _, fn := range optFns { - fn(&options) - } - - if options.ExpiryWindow < 0 { - options.ExpiryWindow = 0 - } - - if options.ExpiryWindowJitterFrac < 0 { - options.ExpiryWindowJitterFrac = 0 - } else if options.ExpiryWindowJitterFrac > 1 { - options.ExpiryWindowJitterFrac = 1 - } - - return &CredentialsCache{ - provider: provider, - options: options, - } -} - -// Retrieve returns the credentials. If the credentials have already been -// retrieved, and not expired the cached credentials will be returned. If the -// credentials have not been retrieved yet, or expired the provider's Retrieve -// method will be called. -// -// Returns and error if the provider's retrieve method returns an error. -func (p *CredentialsCache) Retrieve(ctx context.Context) (Credentials, error) { - if creds, ok := p.getCreds(); ok && !creds.Expired() { - return creds, nil - } - - resCh := p.sf.DoChan("", func() (interface{}, error) { - return p.singleRetrieve(&suppressedContext{ctx}) - }) - select { - case res := <-resCh: - return res.Val.(Credentials), res.Err - case <-ctx.Done(): - return Credentials{}, &RequestCanceledError{Err: ctx.Err()} - } -} - -func (p *CredentialsCache) singleRetrieve(ctx context.Context) (interface{}, error) { - currCreds, ok := p.getCreds() - if ok && !currCreds.Expired() { - return currCreds, nil - } - - newCreds, err := p.provider.Retrieve(ctx) - if err != nil { - handleFailToRefresh := defaultHandleFailToRefresh - if cs, ok := p.provider.(HandleFailRefreshCredentialsCacheStrategy); ok { - handleFailToRefresh = cs.HandleFailToRefresh - } - newCreds, err = handleFailToRefresh(ctx, currCreds, err) - if err != nil { - return Credentials{}, fmt.Errorf("failed to refresh cached credentials, %w", err) - } - } - - if newCreds.CanExpire && p.options.ExpiryWindow > 0 { - adjustExpiresBy := defaultAdjustExpiresBy - if cs, ok := p.provider.(AdjustExpiresByCredentialsCacheStrategy); ok { - adjustExpiresBy = cs.AdjustExpiresBy - } - - randFloat64, err := sdkrand.CryptoRandFloat64() - if err != nil { - return Credentials{}, fmt.Errorf("failed to get random provider, %w", err) - } - - var jitter time.Duration - if p.options.ExpiryWindowJitterFrac > 0 { - jitter = time.Duration(randFloat64 * - p.options.ExpiryWindowJitterFrac * float64(p.options.ExpiryWindow)) - } - - newCreds, err = adjustExpiresBy(newCreds, -(p.options.ExpiryWindow - jitter)) - if err != nil { - return Credentials{}, fmt.Errorf("failed to adjust credentials expires, %w", err) - } - } - - p.creds.Store(&newCreds) - return newCreds, nil -} - -// getCreds returns the currently stored credentials and true. Returning false -// if no credentials were stored. -func (p *CredentialsCache) getCreds() (Credentials, bool) { - v := p.creds.Load() - if v == nil { - return Credentials{}, false - } - - c := v.(*Credentials) - if c == nil || !c.HasKeys() { - return Credentials{}, false - } - - return *c, true -} - -// ProviderSources returns a list of where the underlying credential provider -// has been sourced, if available. Returns empty if the provider doesn't implement -// the interface -func (p *CredentialsCache) ProviderSources() []CredentialSource { - asSource, ok := p.provider.(CredentialProviderSource) - if !ok { - return []CredentialSource{} - } - return asSource.ProviderSources() -} - -// Invalidate will invalidate the cached credentials. The next call to Retrieve -// will cause the provider's Retrieve method to be called. -func (p *CredentialsCache) Invalidate() { - p.creds.Store((*Credentials)(nil)) -} - -// IsCredentialsProvider returns whether credential provider wrapped by CredentialsCache -// matches the target provider type. -func (p *CredentialsCache) IsCredentialsProvider(target CredentialsProvider) bool { - return IsCredentialsProvider(p.provider, target) -} - -// HandleFailRefreshCredentialsCacheStrategy is an interface for -// CredentialsCache to allow CredentialsProvider how failed to refresh -// credentials is handled. -type HandleFailRefreshCredentialsCacheStrategy interface { - // Given the previously cached Credentials, if any, and refresh error, may - // returns new or modified set of Credentials, or error. - // - // Credential caches may use default implementation if nil. - HandleFailToRefresh(context.Context, Credentials, error) (Credentials, error) -} - -// defaultHandleFailToRefresh returns the passed in error. -func defaultHandleFailToRefresh(ctx context.Context, _ Credentials, err error) (Credentials, error) { - return Credentials{}, err -} - -// AdjustExpiresByCredentialsCacheStrategy is an interface for CredentialCache -// to allow CredentialsProvider to intercept adjustments to Credentials expiry -// based on expectations and use cases of CredentialsProvider. -// -// Credential caches may use default implementation if nil. -type AdjustExpiresByCredentialsCacheStrategy interface { - // Given a Credentials as input, applying any mutations and - // returning the potentially updated Credentials, or error. - AdjustExpiresBy(Credentials, time.Duration) (Credentials, error) -} - -// defaultAdjustExpiresBy adds the duration to the passed in credentials Expires, -// and returns the updated credentials value. If Credentials value's CanExpire -// is false, the passed in credentials are returned unchanged. -func defaultAdjustExpiresBy(creds Credentials, dur time.Duration) (Credentials, error) { - if !creds.CanExpire { - return creds, nil - } - - creds.Expires = creds.Expires.Add(dur) - return creds, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go deleted file mode 100644 index 4ad2ee440..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go +++ /dev/null @@ -1,230 +0,0 @@ -package aws - -import ( - "context" - "fmt" - "reflect" - "time" - - "github.com/aws/aws-sdk-go-v2/internal/sdk" -) - -// AnonymousCredentials provides a sentinel CredentialsProvider that should be -// used to instruct the SDK's signing middleware to not sign the request. -// -// Using `nil` credentials when configuring an API client will achieve the same -// result. The AnonymousCredentials type allows you to configure the SDK's -// external config loading to not attempt to source credentials from the shared -// config or environment. -// -// For example you can use this CredentialsProvider with an API client's -// Options to instruct the client not to sign a request for accessing public -// S3 bucket objects. -// -// The following example demonstrates using the AnonymousCredentials to prevent -// SDK's external config loading attempt to resolve credentials. -// -// cfg, err := config.LoadDefaultConfig(context.TODO(), -// config.WithCredentialsProvider(aws.AnonymousCredentials{}), -// ) -// if err != nil { -// log.Fatalf("failed to load config, %v", err) -// } -// -// client := s3.NewFromConfig(cfg) -// -// Alternatively you can leave the API client Option's `Credential` member to -// nil. If using the `NewFromConfig` constructor you'll need to explicitly set -// the `Credentials` member to nil, if the external config resolved a -// credential provider. -// -// client := s3.New(s3.Options{ -// // Credentials defaults to a nil value. -// }) -// -// This can also be configured for specific operations calls too. -// -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// log.Fatalf("failed to load config, %v", err) -// } -// -// client := s3.NewFromConfig(config) -// -// result, err := client.GetObject(context.TODO(), s3.GetObject{ -// Bucket: aws.String("example-bucket"), -// Key: aws.String("example-key"), -// }, func(o *s3.Options) { -// o.Credentials = nil -// // Or -// o.Credentials = aws.AnonymousCredentials{} -// }) -type AnonymousCredentials struct{} - -// Retrieve implements the CredentialsProvider interface, but will always -// return error, and cannot be used to sign a request. The AnonymousCredentials -// type is used as a sentinel type instructing the AWS request signing -// middleware to not sign a request. -func (AnonymousCredentials) Retrieve(context.Context) (Credentials, error) { - return Credentials{Source: "AnonymousCredentials"}, - fmt.Errorf("the AnonymousCredentials is not a valid credential provider, and cannot be used to sign AWS requests with") -} - -// CredentialSource is the source of the credential provider. -// A provider can have multiple credential sources: For example, a provider that reads a profile, calls ECS to -// get credentials and then assumes a role using STS will have all these as part of its provider chain. -type CredentialSource int - -const ( - // CredentialSourceUndefined is the sentinel zero value - CredentialSourceUndefined CredentialSource = iota - // CredentialSourceCode credentials resolved from code, cli parameters, session object, or client instance - CredentialSourceCode - // CredentialSourceEnvVars credentials resolved from environment variables - CredentialSourceEnvVars - // CredentialSourceEnvVarsSTSWebIDToken credentials resolved from environment variables for assuming a role with STS using a web identity token - CredentialSourceEnvVarsSTSWebIDToken - // CredentialSourceSTSAssumeRole credentials resolved from STS using AssumeRole - CredentialSourceSTSAssumeRole - // CredentialSourceSTSAssumeRoleSaml credentials resolved from STS using assume role with SAML - CredentialSourceSTSAssumeRoleSaml - // CredentialSourceSTSAssumeRoleWebID credentials resolved from STS using assume role with web identity - CredentialSourceSTSAssumeRoleWebID - // CredentialSourceSTSFederationToken credentials resolved from STS using a federation token - CredentialSourceSTSFederationToken - // CredentialSourceSTSSessionToken credentials resolved from STS using a session token S - CredentialSourceSTSSessionToken - // CredentialSourceProfile credentials resolved from a config file(s) profile with static credentials - CredentialSourceProfile - // CredentialSourceProfileSourceProfile credentials resolved from a source profile in a config file(s) profile - CredentialSourceProfileSourceProfile - // CredentialSourceProfileNamedProvider credentials resolved from a named provider in a config file(s) profile (like EcsContainer) - CredentialSourceProfileNamedProvider - // CredentialSourceProfileSTSWebIDToken credentials resolved from configuration for assuming a role with STS using web identity token in a config file(s) profile - CredentialSourceProfileSTSWebIDToken - // CredentialSourceProfileSSO credentials resolved from an SSO session in a config file(s) profile - CredentialSourceProfileSSO - // CredentialSourceSSO credentials resolved from an SSO session - CredentialSourceSSO - // CredentialSourceProfileSSOLegacy credentials resolved from an SSO session in a config file(s) profile using legacy format - CredentialSourceProfileSSOLegacy - // CredentialSourceSSOLegacy credentials resolved from an SSO session using legacy format - CredentialSourceSSOLegacy - // CredentialSourceProfileProcess credentials resolved from a process in a config file(s) profile - CredentialSourceProfileProcess - // CredentialSourceProcess credentials resolved from a process - CredentialSourceProcess - // CredentialSourceHTTP credentials resolved from an HTTP endpoint - CredentialSourceHTTP - // CredentialSourceIMDS credentials resolved from the instance metadata service (IMDS) - CredentialSourceIMDS -) - -// A Credentials is the AWS credentials value for individual credential fields. -type Credentials struct { - // AWS Access key ID - AccessKeyID string - - // AWS Secret Access Key - SecretAccessKey string - - // AWS Session Token - SessionToken string - - // Source of the credentials - Source string - - // States if the credentials can expire or not. - CanExpire bool - - // The time the credentials will expire at. Should be ignored if CanExpire - // is false. - Expires time.Time - - // The ID of the account for the credentials. - AccountID string -} - -// Expired returns if the credentials have expired. -func (v Credentials) Expired() bool { - if v.CanExpire { - // Calling Round(0) on the current time will truncate the monotonic - // reading only. Ensures credential expiry time is always based on - // reported wall-clock time. - return !v.Expires.After(sdk.NowTime().Round(0)) - } - - return false -} - -// HasKeys returns if the credentials keys are set. -func (v Credentials) HasKeys() bool { - return len(v.AccessKeyID) > 0 && len(v.SecretAccessKey) > 0 -} - -// A CredentialsProvider is the interface for any component which will provide -// credentials Credentials. A CredentialsProvider is required to manage its own -// Expired state, and what to be expired means. -// -// A credentials provider implementation can be wrapped with a CredentialCache -// to cache the credential value retrieved. Without the cache the SDK will -// attempt to retrieve the credentials for every request. -type CredentialsProvider interface { - // Retrieve returns nil if it successfully retrieved the value. - // Error is returned if the value were not obtainable, or empty. - Retrieve(ctx context.Context) (Credentials, error) -} - -// CredentialProviderSource allows any credential provider to track -// all providers where a credential provider were sourced. For example, if the credentials came from a -// call to a role specified in the profile, this method will give the whole breadcrumb trail -type CredentialProviderSource interface { - ProviderSources() []CredentialSource -} - -// CredentialsProviderFunc provides a helper wrapping a function value to -// satisfy the CredentialsProvider interface. -type CredentialsProviderFunc func(context.Context) (Credentials, error) - -// Retrieve delegates to the function value the CredentialsProviderFunc wraps. -func (fn CredentialsProviderFunc) Retrieve(ctx context.Context) (Credentials, error) { - return fn(ctx) -} - -type isCredentialsProvider interface { - IsCredentialsProvider(CredentialsProvider) bool -} - -// IsCredentialsProvider returns whether the target CredentialProvider is the same type as provider when comparing the -// implementation type. -// -// If provider has a method IsCredentialsProvider(CredentialsProvider) bool it will be responsible for validating -// whether target matches the credential provider type. -// -// When comparing the CredentialProvider implementations provider and target for equality, the following rules are used: -// -// If provider is of type T and target is of type V, true if type *T is the same as type *V, otherwise false -// If provider is of type *T and target is of type V, true if type *T is the same as type *V, otherwise false -// If provider is of type T and target is of type *V, true if type *T is the same as type *V, otherwise false -// If provider is of type *T and target is of type *V,true if type *T is the same as type *V, otherwise false -func IsCredentialsProvider(provider, target CredentialsProvider) bool { - if target == nil || provider == nil { - return provider == target - } - - if x, ok := provider.(isCredentialsProvider); ok { - return x.IsCredentialsProvider(target) - } - - targetType := reflect.TypeOf(target) - if targetType.Kind() != reflect.Ptr { - targetType = reflect.PtrTo(targetType) - } - - providerType := reflect.TypeOf(provider) - if providerType.Kind() != reflect.Ptr { - providerType = reflect.PtrTo(providerType) - } - - return targetType.AssignableTo(providerType) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go deleted file mode 100644 index fd408e518..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go +++ /dev/null @@ -1,38 +0,0 @@ -package defaults - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - "runtime" - "strings" -) - -var getGOOS = func() string { - return runtime.GOOS -} - -// ResolveDefaultsModeAuto is used to determine the effective aws.DefaultsMode when the mode -// is set to aws.DefaultsModeAuto. -func ResolveDefaultsModeAuto(region string, environment aws.RuntimeEnvironment) aws.DefaultsMode { - goos := getGOOS() - if goos == "android" || goos == "ios" { - return aws.DefaultsModeMobile - } - - var currentRegion string - if len(environment.EnvironmentIdentifier) > 0 { - currentRegion = environment.Region - } - - if len(currentRegion) == 0 && len(environment.EC2InstanceMetadataRegion) > 0 { - currentRegion = environment.EC2InstanceMetadataRegion - } - - if len(region) > 0 && len(currentRegion) > 0 { - if strings.EqualFold(region, currentRegion) { - return aws.DefaultsModeInRegion - } - return aws.DefaultsModeCrossRegion - } - - return aws.DefaultsModeStandard -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go deleted file mode 100644 index 8b7e01fa2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go +++ /dev/null @@ -1,43 +0,0 @@ -package defaults - -import ( - "time" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// Configuration is the set of SDK configuration options that are determined based -// on the configured DefaultsMode. -type Configuration struct { - // RetryMode is the configuration's default retry mode API clients should - // use for constructing a Retryer. - RetryMode aws.RetryMode - - // ConnectTimeout is the maximum amount of time a dial will wait for - // a connect to complete. - // - // See https://pkg.go.dev/net#Dialer.Timeout - ConnectTimeout *time.Duration - - // TLSNegotiationTimeout specifies the maximum amount of time waiting to - // wait for a TLS handshake. - // - // See https://pkg.go.dev/net/http#Transport.TLSHandshakeTimeout - TLSNegotiationTimeout *time.Duration -} - -// GetConnectTimeout returns the ConnectTimeout value, returns false if the value is not set. -func (c *Configuration) GetConnectTimeout() (time.Duration, bool) { - if c.ConnectTimeout == nil { - return 0, false - } - return *c.ConnectTimeout, true -} - -// GetTLSNegotiationTimeout returns the TLSNegotiationTimeout value, returns false if the value is not set. -func (c *Configuration) GetTLSNegotiationTimeout() (time.Duration, bool) { - if c.TLSNegotiationTimeout == nil { - return 0, false - } - return *c.TLSNegotiationTimeout, true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go deleted file mode 100644 index dbaa873dc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsconfig. DO NOT EDIT. - -package defaults - -import ( - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "time" -) - -// GetModeConfiguration returns the default Configuration descriptor for the given mode. -// -// Supports the following modes: cross-region, in-region, mobile, standard -func GetModeConfiguration(mode aws.DefaultsMode) (Configuration, error) { - var mv aws.DefaultsMode - mv.SetFromString(string(mode)) - - switch mv { - case aws.DefaultsModeCrossRegion: - settings := Configuration{ - ConnectTimeout: aws.Duration(3100 * time.Millisecond), - RetryMode: aws.RetryMode("standard"), - TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond), - } - return settings, nil - case aws.DefaultsModeInRegion: - settings := Configuration{ - ConnectTimeout: aws.Duration(1100 * time.Millisecond), - RetryMode: aws.RetryMode("standard"), - TLSNegotiationTimeout: aws.Duration(1100 * time.Millisecond), - } - return settings, nil - case aws.DefaultsModeMobile: - settings := Configuration{ - ConnectTimeout: aws.Duration(30000 * time.Millisecond), - RetryMode: aws.RetryMode("standard"), - TLSNegotiationTimeout: aws.Duration(30000 * time.Millisecond), - } - return settings, nil - case aws.DefaultsModeStandard: - settings := Configuration{ - ConnectTimeout: aws.Duration(3100 * time.Millisecond), - RetryMode: aws.RetryMode("standard"), - TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond), - } - return settings, nil - default: - return Configuration{}, fmt.Errorf("unsupported defaults mode: %v", mode) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go deleted file mode 100644 index 2d90011b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package defaults provides recommended configuration values for AWS SDKs and CLIs. -package defaults diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go deleted file mode 100644 index fcf9387c2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsmode. DO NOT EDIT. - -package aws - -import ( - "strings" -) - -// DefaultsMode is the SDK defaults mode setting. -type DefaultsMode string - -// The DefaultsMode constants. -const ( - // DefaultsModeAuto is an experimental mode that builds on the standard mode. - // The SDK will attempt to discover the execution environment to determine the - // appropriate settings automatically. - // - // Note that the auto detection is heuristics-based and does not guarantee 100% - // accuracy. STANDARD mode will be used if the execution environment cannot - // be determined. The auto detection might query EC2 Instance Metadata service - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html), - // which might introduce latency. Therefore we recommend choosing an explicit - // defaults_mode instead if startup latency is critical to your application - DefaultsModeAuto DefaultsMode = "auto" - - // DefaultsModeCrossRegion builds on the standard mode and includes optimization - // tailored for applications which call AWS services in a different region - // - // Note that the default values vended from this mode might change as best practices - // may evolve. As a result, it is encouraged to perform tests when upgrading - // the SDK - DefaultsModeCrossRegion DefaultsMode = "cross-region" - - // DefaultsModeInRegion builds on the standard mode and includes optimization - // tailored for applications which call AWS services from within the same AWS - // region - // - // Note that the default values vended from this mode might change as best practices - // may evolve. As a result, it is encouraged to perform tests when upgrading - // the SDK - DefaultsModeInRegion DefaultsMode = "in-region" - - // DefaultsModeLegacy provides default settings that vary per SDK and were used - // prior to establishment of defaults_mode - DefaultsModeLegacy DefaultsMode = "legacy" - - // DefaultsModeMobile builds on the standard mode and includes optimization - // tailored for mobile applications - // - // Note that the default values vended from this mode might change as best practices - // may evolve. As a result, it is encouraged to perform tests when upgrading - // the SDK - DefaultsModeMobile DefaultsMode = "mobile" - - // DefaultsModeStandard provides the latest recommended default values that - // should be safe to run in most scenarios - // - // Note that the default values vended from this mode might change as best practices - // may evolve. As a result, it is encouraged to perform tests when upgrading - // the SDK - DefaultsModeStandard DefaultsMode = "standard" -) - -// SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches -// the provided string when compared using EqualFold. If the value does not match a known -// constant it will be set to as-is and the function will return false. As a special case, if the -// provided value is a zero-length string, the mode will be set to LegacyDefaultsMode. -func (d *DefaultsMode) SetFromString(v string) (ok bool) { - switch { - case strings.EqualFold(v, string(DefaultsModeAuto)): - *d = DefaultsModeAuto - ok = true - case strings.EqualFold(v, string(DefaultsModeCrossRegion)): - *d = DefaultsModeCrossRegion - ok = true - case strings.EqualFold(v, string(DefaultsModeInRegion)): - *d = DefaultsModeInRegion - ok = true - case strings.EqualFold(v, string(DefaultsModeLegacy)): - *d = DefaultsModeLegacy - ok = true - case strings.EqualFold(v, string(DefaultsModeMobile)): - *d = DefaultsModeMobile - ok = true - case strings.EqualFold(v, string(DefaultsModeStandard)): - *d = DefaultsModeStandard - ok = true - case len(v) == 0: - *d = DefaultsModeLegacy - ok = true - default: - *d = DefaultsMode(v) - } - return ok -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go deleted file mode 100644 index d8b6e09e5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go +++ /dev/null @@ -1,62 +0,0 @@ -// Package aws provides the core SDK's utilities and shared types. Use this package's -// utilities to simplify setting and reading API operations parameters. -// -// # Value and Pointer Conversion Utilities -// -// This package includes a helper conversion utility for each scalar type the SDK's -// API use. These utilities make getting a pointer of the scalar, and dereferencing -// a pointer easier. -// -// Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. -// The Pointer to value will safely dereference the pointer and return its value. -// If the pointer was nil, the scalar's zero value will be returned. -// -// The value to pointer functions will be named after the scalar type. So get a -// *string from a string value use the "String" function. This makes it easy to -// to get pointer of a literal string value, because getting the address of a -// literal requires assigning the value to a variable first. -// -// var strPtr *string -// -// // Without the SDK's conversion functions -// str := "my string" -// strPtr = &str -// -// // With the SDK's conversion functions -// strPtr = aws.String("my string") -// -// // Convert *string to string value -// str = aws.ToString(strPtr) -// -// In addition to scalars the aws package also includes conversion utilities for -// map and slice for commonly types used in API parameters. The map and slice -// conversion functions use similar naming pattern as the scalar conversion -// functions. -// -// var strPtrs []*string -// var strs []string = []string{"Go", "Gophers", "Go"} -// -// // Convert []string to []*string -// strPtrs = aws.StringSlice(strs) -// -// // Convert []*string to []string -// strs = aws.ToStringSlice(strPtrs) -// -// # SDK Default HTTP Client -// -// The SDK will use the http.DefaultClient if a HTTP client is not provided to -// the SDK's Session, or service client constructor. This means that if the -// http.DefaultClient is modified by other components of your application the -// modifications will be picked up by the SDK as well. -// -// In some cases this might be intended, but it is a better practice to create -// a custom HTTP Client to share explicitly through your application. You can -// configure the SDK to use the custom HTTP Client by setting the HTTPClient -// value of the SDK's Config type when creating a Session or service client. -package aws - -// generate.go uses a build tag of "ignore", go run doesn't need to specify -// this because go run ignores all build flags when running a go file directly. -//go:generate go run -tags codegen generate.go -//go:generate go run -tags codegen logging_generate.go -//go:generate gofmt -w -s . diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go deleted file mode 100644 index 99edbf3ee..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go +++ /dev/null @@ -1,247 +0,0 @@ -package aws - -import ( - "fmt" -) - -// DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. -type DualStackEndpointState uint - -const ( - // DualStackEndpointStateUnset is the default value behavior for dual-stack endpoint resolution. - DualStackEndpointStateUnset DualStackEndpointState = iota - - // DualStackEndpointStateEnabled enables dual-stack endpoint resolution for service endpoints. - DualStackEndpointStateEnabled - - // DualStackEndpointStateDisabled disables dual-stack endpoint resolution for endpoints. - DualStackEndpointStateDisabled -) - -// GetUseDualStackEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. -// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState. -func GetUseDualStackEndpoint(options ...interface{}) (value DualStackEndpointState, found bool) { - type iface interface { - GetUseDualStackEndpoint() DualStackEndpointState - } - for _, option := range options { - if i, ok := option.(iface); ok { - value = i.GetUseDualStackEndpoint() - found = true - break - } - } - return value, found -} - -// FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. -type FIPSEndpointState uint - -const ( - // FIPSEndpointStateUnset is the default value behavior for FIPS endpoint resolution. - FIPSEndpointStateUnset FIPSEndpointState = iota - - // FIPSEndpointStateEnabled enables FIPS endpoint resolution for service endpoints. - FIPSEndpointStateEnabled - - // FIPSEndpointStateDisabled disables FIPS endpoint resolution for endpoints. - FIPSEndpointStateDisabled -) - -// GetUseFIPSEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. -// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState. -func GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found bool) { - type iface interface { - GetUseFIPSEndpoint() FIPSEndpointState - } - for _, option := range options { - if i, ok := option.(iface); ok { - value = i.GetUseFIPSEndpoint() - found = true - break - } - } - return value, found -} - -// Endpoint represents the endpoint a service client should make API operation -// calls to. -// -// The SDK will automatically resolve these endpoints per API client using an -// internal endpoint resolvers. If you'd like to provide custom endpoint -// resolving behavior you can implement the EndpointResolver interface. -// -// Deprecated: This structure was used with the global [EndpointResolver] -// interface, which has been deprecated in favor of service-specific endpoint -// resolution. See the deprecation docs on that interface for more information. -type Endpoint struct { - // The base URL endpoint the SDK API clients will use to make API calls to. - // The SDK will suffix URI path and query elements to this endpoint. - URL string - - // Specifies if the endpoint's hostname can be modified by the SDK's API - // client. - // - // If the hostname is mutable the SDK API clients may modify any part of - // the hostname based on the requirements of the API, (e.g. adding, or - // removing content in the hostname). Such as, Amazon S3 API client - // prefixing "bucketname" to the hostname, or changing the - // hostname service name component from "s3." to "s3-accesspoint.dualstack." - // for the dualstack endpoint of an S3 Accesspoint resource. - // - // Care should be taken when providing a custom endpoint for an API. If the - // endpoint hostname is mutable, and the client cannot modify the endpoint - // correctly, the operation call will most likely fail, or have undefined - // behavior. - // - // If hostname is immutable, the SDK API clients will not modify the - // hostname of the URL. This may cause the API client not to function - // correctly if the API requires the operation specific hostname values - // to be used by the client. - // - // This flag does not modify the API client's behavior if this endpoint - // will be used instead of Endpoint Discovery, or if the endpoint will be - // used to perform Endpoint Discovery. That behavior is configured via the - // API Client's Options. - HostnameImmutable bool - - // The AWS partition the endpoint belongs to. - PartitionID string - - // The service name that should be used for signing the requests to the - // endpoint. - SigningName string - - // The region that should be used for signing the request to the endpoint. - SigningRegion string - - // The signing method that should be used for signing the requests to the - // endpoint. - SigningMethod string - - // The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. - // When providing a custom endpoint, you should set the source as EndpointSourceCustom. - // If source is not provided when providing a custom endpoint, the SDK may not - // perform required host mutations correctly. Source should be used along with - // HostnameImmutable property as per the usage requirement. - Source EndpointSource -} - -// EndpointSource is the endpoint source type. -// -// Deprecated: The global [Endpoint] structure is deprecated. -type EndpointSource int - -const ( - // EndpointSourceServiceMetadata denotes service modeled endpoint metadata is used as Endpoint Source. - EndpointSourceServiceMetadata EndpointSource = iota - - // EndpointSourceCustom denotes endpoint is a custom endpoint. This source should be used when - // user provides a custom endpoint to be used by the SDK. - EndpointSourceCustom -) - -// EndpointNotFoundError is a sentinel error to indicate that the -// EndpointResolver implementation was unable to resolve an endpoint for the -// given service and region. Resolvers should use this to indicate that an API -// client should fallback and attempt to use it's internal default resolver to -// resolve the endpoint. -type EndpointNotFoundError struct { - Err error -} - -// Error is the error message. -func (e *EndpointNotFoundError) Error() string { - return fmt.Sprintf("endpoint not found, %v", e.Err) -} - -// Unwrap returns the underlying error. -func (e *EndpointNotFoundError) Unwrap() error { - return e.Err -} - -// EndpointResolver is an endpoint resolver that can be used to provide or -// override an endpoint for the given service and region. API clients will -// attempt to use the EndpointResolver first to resolve an endpoint if -// available. If the EndpointResolver returns an EndpointNotFoundError error, -// API clients will fallback to attempting to resolve the endpoint using its -// internal default endpoint resolver. -// -// Deprecated: The global endpoint resolution interface is deprecated. The API -// for endpoint resolution is now unique to each service and is set via the -// EndpointResolverV2 field on service client options. Setting a value for -// EndpointResolver on aws.Config or service client options will prevent you -// from using any endpoint-related service features released after the -// introduction of EndpointResolverV2. You may also encounter broken or -// unexpected behavior when using the old global interface with services that -// use many endpoint-related customizations such as S3. -type EndpointResolver interface { - ResolveEndpoint(service, region string) (Endpoint, error) -} - -// EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface. -// -// Deprecated: The global endpoint resolution interface is deprecated. See -// deprecation docs on [EndpointResolver]. -type EndpointResolverFunc func(service, region string) (Endpoint, error) - -// ResolveEndpoint calls the wrapped function and returns the results. -func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) { - return e(service, region) -} - -// EndpointResolverWithOptions is an endpoint resolver that can be used to provide or -// override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will -// attempt to use the EndpointResolverWithOptions first to resolve an endpoint if -// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, -// API clients will fallback to attempting to resolve the endpoint using its -// internal default endpoint resolver. -// -// Deprecated: The global endpoint resolution interface is deprecated. See -// deprecation docs on [EndpointResolver]. -type EndpointResolverWithOptions interface { - ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) -} - -// EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface. -// -// Deprecated: The global endpoint resolution interface is deprecated. See -// deprecation docs on [EndpointResolver]. -type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error) - -// ResolveEndpoint calls the wrapped function and returns the results. -func (e EndpointResolverWithOptionsFunc) ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) { - return e(service, region, options...) -} - -// GetDisableHTTPS takes a service's EndpointResolverOptions and returns the DisableHTTPS value. -// Returns boolean false if the provided options does not have a method to retrieve the DisableHTTPS. -func GetDisableHTTPS(options ...interface{}) (value bool, found bool) { - type iface interface { - GetDisableHTTPS() bool - } - for _, option := range options { - if i, ok := option.(iface); ok { - value = i.GetDisableHTTPS() - found = true - break - } - } - return value, found -} - -// GetResolvedRegion takes a service's EndpointResolverOptions and returns the ResolvedRegion value. -// Returns boolean false if the provided options does not have a method to retrieve the ResolvedRegion. -func GetResolvedRegion(options ...interface{}) (value string, found bool) { - type iface interface { - GetResolvedRegion() string - } - for _, option := range options { - if i, ok := option.(iface); ok { - value = i.GetResolvedRegion() - found = true - break - } - } - return value, found -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/errors.go deleted file mode 100644 index f390a08f9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package aws - -// MissingRegionError is an error that is returned if region configuration -// value was not found. -type MissingRegionError struct{} - -func (*MissingRegionError) Error() string { - return "an AWS region is required, but was not found" -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go deleted file mode 100644 index 2394418e9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go +++ /dev/null @@ -1,365 +0,0 @@ -// Code generated by aws/generate.go DO NOT EDIT. - -package aws - -import ( - "github.com/aws/smithy-go/ptr" - "time" -) - -// ToBool returns bool value dereferenced if the passed -// in pointer was not nil. Returns a bool zero value if the -// pointer was nil. -func ToBool(p *bool) (v bool) { - return ptr.ToBool(p) -} - -// ToBoolSlice returns a slice of bool values, that are -// dereferenced if the passed in pointer was not nil. Returns a bool -// zero value if the pointer was nil. -func ToBoolSlice(vs []*bool) []bool { - return ptr.ToBoolSlice(vs) -} - -// ToBoolMap returns a map of bool values, that are -// dereferenced if the passed in pointer was not nil. The bool -// zero value is used if the pointer was nil. -func ToBoolMap(vs map[string]*bool) map[string]bool { - return ptr.ToBoolMap(vs) -} - -// ToByte returns byte value dereferenced if the passed -// in pointer was not nil. Returns a byte zero value if the -// pointer was nil. -func ToByte(p *byte) (v byte) { - return ptr.ToByte(p) -} - -// ToByteSlice returns a slice of byte values, that are -// dereferenced if the passed in pointer was not nil. Returns a byte -// zero value if the pointer was nil. -func ToByteSlice(vs []*byte) []byte { - return ptr.ToByteSlice(vs) -} - -// ToByteMap returns a map of byte values, that are -// dereferenced if the passed in pointer was not nil. The byte -// zero value is used if the pointer was nil. -func ToByteMap(vs map[string]*byte) map[string]byte { - return ptr.ToByteMap(vs) -} - -// ToString returns string value dereferenced if the passed -// in pointer was not nil. Returns a string zero value if the -// pointer was nil. -func ToString(p *string) (v string) { - return ptr.ToString(p) -} - -// ToStringSlice returns a slice of string values, that are -// dereferenced if the passed in pointer was not nil. Returns a string -// zero value if the pointer was nil. -func ToStringSlice(vs []*string) []string { - return ptr.ToStringSlice(vs) -} - -// ToStringMap returns a map of string values, that are -// dereferenced if the passed in pointer was not nil. The string -// zero value is used if the pointer was nil. -func ToStringMap(vs map[string]*string) map[string]string { - return ptr.ToStringMap(vs) -} - -// ToInt returns int value dereferenced if the passed -// in pointer was not nil. Returns a int zero value if the -// pointer was nil. -func ToInt(p *int) (v int) { - return ptr.ToInt(p) -} - -// ToIntSlice returns a slice of int values, that are -// dereferenced if the passed in pointer was not nil. Returns a int -// zero value if the pointer was nil. -func ToIntSlice(vs []*int) []int { - return ptr.ToIntSlice(vs) -} - -// ToIntMap returns a map of int values, that are -// dereferenced if the passed in pointer was not nil. The int -// zero value is used if the pointer was nil. -func ToIntMap(vs map[string]*int) map[string]int { - return ptr.ToIntMap(vs) -} - -// ToInt8 returns int8 value dereferenced if the passed -// in pointer was not nil. Returns a int8 zero value if the -// pointer was nil. -func ToInt8(p *int8) (v int8) { - return ptr.ToInt8(p) -} - -// ToInt8Slice returns a slice of int8 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int8 -// zero value if the pointer was nil. -func ToInt8Slice(vs []*int8) []int8 { - return ptr.ToInt8Slice(vs) -} - -// ToInt8Map returns a map of int8 values, that are -// dereferenced if the passed in pointer was not nil. The int8 -// zero value is used if the pointer was nil. -func ToInt8Map(vs map[string]*int8) map[string]int8 { - return ptr.ToInt8Map(vs) -} - -// ToInt16 returns int16 value dereferenced if the passed -// in pointer was not nil. Returns a int16 zero value if the -// pointer was nil. -func ToInt16(p *int16) (v int16) { - return ptr.ToInt16(p) -} - -// ToInt16Slice returns a slice of int16 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int16 -// zero value if the pointer was nil. -func ToInt16Slice(vs []*int16) []int16 { - return ptr.ToInt16Slice(vs) -} - -// ToInt16Map returns a map of int16 values, that are -// dereferenced if the passed in pointer was not nil. The int16 -// zero value is used if the pointer was nil. -func ToInt16Map(vs map[string]*int16) map[string]int16 { - return ptr.ToInt16Map(vs) -} - -// ToInt32 returns int32 value dereferenced if the passed -// in pointer was not nil. Returns a int32 zero value if the -// pointer was nil. -func ToInt32(p *int32) (v int32) { - return ptr.ToInt32(p) -} - -// ToInt32Slice returns a slice of int32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int32 -// zero value if the pointer was nil. -func ToInt32Slice(vs []*int32) []int32 { - return ptr.ToInt32Slice(vs) -} - -// ToInt32Map returns a map of int32 values, that are -// dereferenced if the passed in pointer was not nil. The int32 -// zero value is used if the pointer was nil. -func ToInt32Map(vs map[string]*int32) map[string]int32 { - return ptr.ToInt32Map(vs) -} - -// ToInt64 returns int64 value dereferenced if the passed -// in pointer was not nil. Returns a int64 zero value if the -// pointer was nil. -func ToInt64(p *int64) (v int64) { - return ptr.ToInt64(p) -} - -// ToInt64Slice returns a slice of int64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int64 -// zero value if the pointer was nil. -func ToInt64Slice(vs []*int64) []int64 { - return ptr.ToInt64Slice(vs) -} - -// ToInt64Map returns a map of int64 values, that are -// dereferenced if the passed in pointer was not nil. The int64 -// zero value is used if the pointer was nil. -func ToInt64Map(vs map[string]*int64) map[string]int64 { - return ptr.ToInt64Map(vs) -} - -// ToUint returns uint value dereferenced if the passed -// in pointer was not nil. Returns a uint zero value if the -// pointer was nil. -func ToUint(p *uint) (v uint) { - return ptr.ToUint(p) -} - -// ToUintSlice returns a slice of uint values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint -// zero value if the pointer was nil. -func ToUintSlice(vs []*uint) []uint { - return ptr.ToUintSlice(vs) -} - -// ToUintMap returns a map of uint values, that are -// dereferenced if the passed in pointer was not nil. The uint -// zero value is used if the pointer was nil. -func ToUintMap(vs map[string]*uint) map[string]uint { - return ptr.ToUintMap(vs) -} - -// ToUint8 returns uint8 value dereferenced if the passed -// in pointer was not nil. Returns a uint8 zero value if the -// pointer was nil. -func ToUint8(p *uint8) (v uint8) { - return ptr.ToUint8(p) -} - -// ToUint8Slice returns a slice of uint8 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint8 -// zero value if the pointer was nil. -func ToUint8Slice(vs []*uint8) []uint8 { - return ptr.ToUint8Slice(vs) -} - -// ToUint8Map returns a map of uint8 values, that are -// dereferenced if the passed in pointer was not nil. The uint8 -// zero value is used if the pointer was nil. -func ToUint8Map(vs map[string]*uint8) map[string]uint8 { - return ptr.ToUint8Map(vs) -} - -// ToUint16 returns uint16 value dereferenced if the passed -// in pointer was not nil. Returns a uint16 zero value if the -// pointer was nil. -func ToUint16(p *uint16) (v uint16) { - return ptr.ToUint16(p) -} - -// ToUint16Slice returns a slice of uint16 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint16 -// zero value if the pointer was nil. -func ToUint16Slice(vs []*uint16) []uint16 { - return ptr.ToUint16Slice(vs) -} - -// ToUint16Map returns a map of uint16 values, that are -// dereferenced if the passed in pointer was not nil. The uint16 -// zero value is used if the pointer was nil. -func ToUint16Map(vs map[string]*uint16) map[string]uint16 { - return ptr.ToUint16Map(vs) -} - -// ToUint32 returns uint32 value dereferenced if the passed -// in pointer was not nil. Returns a uint32 zero value if the -// pointer was nil. -func ToUint32(p *uint32) (v uint32) { - return ptr.ToUint32(p) -} - -// ToUint32Slice returns a slice of uint32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint32 -// zero value if the pointer was nil. -func ToUint32Slice(vs []*uint32) []uint32 { - return ptr.ToUint32Slice(vs) -} - -// ToUint32Map returns a map of uint32 values, that are -// dereferenced if the passed in pointer was not nil. The uint32 -// zero value is used if the pointer was nil. -func ToUint32Map(vs map[string]*uint32) map[string]uint32 { - return ptr.ToUint32Map(vs) -} - -// ToUint64 returns uint64 value dereferenced if the passed -// in pointer was not nil. Returns a uint64 zero value if the -// pointer was nil. -func ToUint64(p *uint64) (v uint64) { - return ptr.ToUint64(p) -} - -// ToUint64Slice returns a slice of uint64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint64 -// zero value if the pointer was nil. -func ToUint64Slice(vs []*uint64) []uint64 { - return ptr.ToUint64Slice(vs) -} - -// ToUint64Map returns a map of uint64 values, that are -// dereferenced if the passed in pointer was not nil. The uint64 -// zero value is used if the pointer was nil. -func ToUint64Map(vs map[string]*uint64) map[string]uint64 { - return ptr.ToUint64Map(vs) -} - -// ToFloat32 returns float32 value dereferenced if the passed -// in pointer was not nil. Returns a float32 zero value if the -// pointer was nil. -func ToFloat32(p *float32) (v float32) { - return ptr.ToFloat32(p) -} - -// ToFloat32Slice returns a slice of float32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a float32 -// zero value if the pointer was nil. -func ToFloat32Slice(vs []*float32) []float32 { - return ptr.ToFloat32Slice(vs) -} - -// ToFloat32Map returns a map of float32 values, that are -// dereferenced if the passed in pointer was not nil. The float32 -// zero value is used if the pointer was nil. -func ToFloat32Map(vs map[string]*float32) map[string]float32 { - return ptr.ToFloat32Map(vs) -} - -// ToFloat64 returns float64 value dereferenced if the passed -// in pointer was not nil. Returns a float64 zero value if the -// pointer was nil. -func ToFloat64(p *float64) (v float64) { - return ptr.ToFloat64(p) -} - -// ToFloat64Slice returns a slice of float64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a float64 -// zero value if the pointer was nil. -func ToFloat64Slice(vs []*float64) []float64 { - return ptr.ToFloat64Slice(vs) -} - -// ToFloat64Map returns a map of float64 values, that are -// dereferenced if the passed in pointer was not nil. The float64 -// zero value is used if the pointer was nil. -func ToFloat64Map(vs map[string]*float64) map[string]float64 { - return ptr.ToFloat64Map(vs) -} - -// ToTime returns time.Time value dereferenced if the passed -// in pointer was not nil. Returns a time.Time zero value if the -// pointer was nil. -func ToTime(p *time.Time) (v time.Time) { - return ptr.ToTime(p) -} - -// ToTimeSlice returns a slice of time.Time values, that are -// dereferenced if the passed in pointer was not nil. Returns a time.Time -// zero value if the pointer was nil. -func ToTimeSlice(vs []*time.Time) []time.Time { - return ptr.ToTimeSlice(vs) -} - -// ToTimeMap returns a map of time.Time values, that are -// dereferenced if the passed in pointer was not nil. The time.Time -// zero value is used if the pointer was nil. -func ToTimeMap(vs map[string]*time.Time) map[string]time.Time { - return ptr.ToTimeMap(vs) -} - -// ToDuration returns time.Duration value dereferenced if the passed -// in pointer was not nil. Returns a time.Duration zero value if the -// pointer was nil. -func ToDuration(p *time.Duration) (v time.Duration) { - return ptr.ToDuration(p) -} - -// ToDurationSlice returns a slice of time.Duration values, that are -// dereferenced if the passed in pointer was not nil. Returns a time.Duration -// zero value if the pointer was nil. -func ToDurationSlice(vs []*time.Duration) []time.Duration { - return ptr.ToDurationSlice(vs) -} - -// ToDurationMap returns a map of time.Duration values, that are -// dereferenced if the passed in pointer was not nil. The time.Duration -// zero value is used if the pointer was nil. -func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration { - return ptr.ToDurationMap(vs) -} 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 deleted file mode 100644 index 1820ff0fb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package aws - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.39.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go deleted file mode 100644 index 91c94d987..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by aws/logging_generate.go DO NOT EDIT. - -package aws - -// ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where -// each bit is a flag that describes the logging behavior for one or more client components. -// The entire 64-bit group is reserved for later expansion by the SDK. -// -// Example: Setting ClientLogMode to enable logging of retries and requests -// -// clientLogMode := aws.LogRetries | aws.LogRequest -// -// Example: Adding an additional log mode to an existing ClientLogMode value -// -// clientLogMode |= aws.LogResponse -type ClientLogMode uint64 - -// Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events. -const ( - LogSigning ClientLogMode = 1 << (64 - 1 - iota) - LogRetries - LogRequest - LogRequestWithBody - LogResponse - LogResponseWithBody - LogDeprecatedUsage - LogRequestEventMessage - LogResponseEventMessage -) - -// IsSigning returns whether the Signing logging mode bit is set -func (m ClientLogMode) IsSigning() bool { - return m&LogSigning != 0 -} - -// IsRetries returns whether the Retries logging mode bit is set -func (m ClientLogMode) IsRetries() bool { - return m&LogRetries != 0 -} - -// IsRequest returns whether the Request logging mode bit is set -func (m ClientLogMode) IsRequest() bool { - return m&LogRequest != 0 -} - -// IsRequestWithBody returns whether the RequestWithBody logging mode bit is set -func (m ClientLogMode) IsRequestWithBody() bool { - return m&LogRequestWithBody != 0 -} - -// IsResponse returns whether the Response logging mode bit is set -func (m ClientLogMode) IsResponse() bool { - return m&LogResponse != 0 -} - -// IsResponseWithBody returns whether the ResponseWithBody logging mode bit is set -func (m ClientLogMode) IsResponseWithBody() bool { - return m&LogResponseWithBody != 0 -} - -// IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set -func (m ClientLogMode) IsDeprecatedUsage() bool { - return m&LogDeprecatedUsage != 0 -} - -// IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set -func (m ClientLogMode) IsRequestEventMessage() bool { - return m&LogRequestEventMessage != 0 -} - -// IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set -func (m ClientLogMode) IsResponseEventMessage() bool { - return m&LogResponseEventMessage != 0 -} - -// ClearSigning clears the Signing logging mode bit -func (m *ClientLogMode) ClearSigning() { - *m &^= LogSigning -} - -// ClearRetries clears the Retries logging mode bit -func (m *ClientLogMode) ClearRetries() { - *m &^= LogRetries -} - -// ClearRequest clears the Request logging mode bit -func (m *ClientLogMode) ClearRequest() { - *m &^= LogRequest -} - -// ClearRequestWithBody clears the RequestWithBody logging mode bit -func (m *ClientLogMode) ClearRequestWithBody() { - *m &^= LogRequestWithBody -} - -// ClearResponse clears the Response logging mode bit -func (m *ClientLogMode) ClearResponse() { - *m &^= LogResponse -} - -// ClearResponseWithBody clears the ResponseWithBody logging mode bit -func (m *ClientLogMode) ClearResponseWithBody() { - *m &^= LogResponseWithBody -} - -// ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit -func (m *ClientLogMode) ClearDeprecatedUsage() { - *m &^= LogDeprecatedUsage -} - -// ClearRequestEventMessage clears the RequestEventMessage logging mode bit -func (m *ClientLogMode) ClearRequestEventMessage() { - *m &^= LogRequestEventMessage -} - -// ClearResponseEventMessage clears the ResponseEventMessage logging mode bit -func (m *ClientLogMode) ClearResponseEventMessage() { - *m &^= LogResponseEventMessage -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go deleted file mode 100644 index 6ecc2231a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build clientlogmode -// +build clientlogmode - -package main - -import ( - "fmt" - "log" - "os" - "strings" - "text/template" -) - -var config = struct { - ModeBits []string -}{ - // Items should be appended only to keep bit-flag positions stable - ModeBits: []string{ - "Signing", - "Retries", - "Request", - "RequestWithBody", - "Response", - "ResponseWithBody", - "DeprecatedUsage", - "RequestEventMessage", - "ResponseEventMessage", - }, -} - -func bitName(name string) string { - return strings.ToUpper(name[:1]) + name[1:] -} - -var tmpl = template.Must(template.New("ClientLogMode").Funcs(map[string]interface{}{ - "symbolName": func(name string) string { - return "Log" + bitName(name) - }, - "bitName": bitName, -}).Parse(`// Code generated by aws/logging_generate.go DO NOT EDIT. - -package aws - -// ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where -// each bit is a flag that describes the logging behavior for one or more client components. -// The entire 64-bit group is reserved for later expansion by the SDK. -// -// Example: Setting ClientLogMode to enable logging of retries and requests -// clientLogMode := aws.LogRetries | aws.LogRequest -// -// Example: Adding an additional log mode to an existing ClientLogMode value -// clientLogMode |= aws.LogResponse -type ClientLogMode uint64 - -// Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events. -const ( -{{- range $index, $field := .ModeBits }} - {{ (symbolName $field) }}{{- if (eq 0 $index) }} ClientLogMode = 1 << (64 - 1 - iota){{- end }} -{{- end }} -) -{{ range $_, $field := .ModeBits }} -// Is{{- bitName $field }} returns whether the {{ bitName $field }} logging mode bit is set -func (m ClientLogMode) Is{{- bitName $field }}() bool { - return m&{{- (symbolName $field) }} != 0 -} -{{ end }} -{{- range $_, $field := .ModeBits }} -// Clear{{- bitName $field }} clears the {{ bitName $field }} logging mode bit -func (m *ClientLogMode) Clear{{- bitName $field }}() { - *m &^= {{ (symbolName $field) }} -} -{{ end -}} -`)) - -func main() { - uniqueBitFields := make(map[string]struct{}) - - for _, bitName := range config.ModeBits { - if _, ok := uniqueBitFields[strings.ToLower(bitName)]; ok { - panic(fmt.Sprintf("duplicate bit field: %s", bitName)) - } - uniqueBitFields[bitName] = struct{}{} - } - - file, err := os.Create("logging.go") - if err != nil { - log.Fatal(err) - } - defer file.Close() - - err = tmpl.Execute(file, config) - if err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go deleted file mode 100644 index d66f0960a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go +++ /dev/null @@ -1,213 +0,0 @@ -package middleware - -import ( - "context" - - "github.com/aws/aws-sdk-go-v2/aws" - - "github.com/aws/smithy-go/middleware" -) - -// RegisterServiceMetadata registers metadata about the service and operation into the middleware context -// so that it is available at runtime for other middleware to introspect. -type RegisterServiceMetadata struct { - ServiceID string - SigningName string - Region string - OperationName string -} - -// ID returns the middleware identifier. -func (s *RegisterServiceMetadata) ID() string { - return "RegisterServiceMetadata" -} - -// HandleInitialize registers service metadata information into the middleware context, allowing for introspection. -func (s RegisterServiceMetadata) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) (out middleware.InitializeOutput, metadata middleware.Metadata, err error) { - if len(s.ServiceID) > 0 { - ctx = SetServiceID(ctx, s.ServiceID) - } - if len(s.SigningName) > 0 { - ctx = SetSigningName(ctx, s.SigningName) - } - if len(s.Region) > 0 { - ctx = setRegion(ctx, s.Region) - } - if len(s.OperationName) > 0 { - ctx = setOperationName(ctx, s.OperationName) - } - return next.HandleInitialize(ctx, in) -} - -// service metadata keys for storing and lookup of runtime stack information. -type ( - serviceIDKey struct{} - signingNameKey struct{} - signingRegionKey struct{} - regionKey struct{} - operationNameKey struct{} - partitionIDKey struct{} - requiresLegacyEndpointsKey struct{} -) - -// GetServiceID retrieves the service id from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetServiceID(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, serviceIDKey{}).(string) - return v -} - -// GetSigningName retrieves the service signing name from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -// -// Deprecated: This value is unstable. The resolved signing name is available -// in the signer properties object passed to the signer. -func GetSigningName(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, signingNameKey{}).(string) - return v -} - -// GetSigningRegion retrieves the region from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -// -// Deprecated: This value is unstable. The resolved signing region is available -// in the signer properties object passed to the signer. -func GetSigningRegion(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, signingRegionKey{}).(string) - return v -} - -// GetRegion retrieves the endpoint region from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetRegion(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, regionKey{}).(string) - return v -} - -// GetOperationName retrieves the service operation metadata from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetOperationName(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, operationNameKey{}).(string) - return v -} - -// GetPartitionID retrieves the endpoint partition id from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetPartitionID(ctx context.Context) string { - v, _ := middleware.GetStackValue(ctx, partitionIDKey{}).(string) - return v -} - -// GetRequiresLegacyEndpoints the flag used to indicate if legacy endpoint -// customizations need to be executed. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetRequiresLegacyEndpoints(ctx context.Context) bool { - v, _ := middleware.GetStackValue(ctx, requiresLegacyEndpointsKey{}).(bool) - return v -} - -// SetRequiresLegacyEndpoints set or modifies the flag indicated that -// legacy endpoint customizations are needed. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func SetRequiresLegacyEndpoints(ctx context.Context, value bool) context.Context { - return middleware.WithStackValue(ctx, requiresLegacyEndpointsKey{}, value) -} - -// SetSigningName set or modifies the sigv4 or sigv4a signing name on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -// -// Deprecated: This value is unstable. Use WithSigV4SigningName client option -// funcs instead. -func SetSigningName(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, signingNameKey{}, value) -} - -// SetSigningRegion sets or modifies the region on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -// -// Deprecated: This value is unstable. Use WithSigV4SigningRegion client option -// funcs instead. -func SetSigningRegion(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, signingRegionKey{}, value) -} - -// SetServiceID sets the service id on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func SetServiceID(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, serviceIDKey{}, value) -} - -// setRegion sets the endpoint region on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func setRegion(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, regionKey{}, value) -} - -// setOperationName sets the service operation on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func setOperationName(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, operationNameKey{}, value) -} - -// SetPartitionID sets the partition id of a resolved region on the context -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func SetPartitionID(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, partitionIDKey{}, value) -} - -// EndpointSource key -type endpointSourceKey struct{} - -// GetEndpointSource returns an endpoint source if set on context -func GetEndpointSource(ctx context.Context) (v aws.EndpointSource) { - v, _ = middleware.GetStackValue(ctx, endpointSourceKey{}).(aws.EndpointSource) - return v -} - -// SetEndpointSource sets endpoint source on context -func SetEndpointSource(ctx context.Context, value aws.EndpointSource) context.Context { - return middleware.WithStackValue(ctx, endpointSourceKey{}, value) -} - -type signingCredentialsKey struct{} - -// GetSigningCredentials returns the credentials that were used for signing if set on context. -func GetSigningCredentials(ctx context.Context) (v aws.Credentials) { - v, _ = middleware.GetStackValue(ctx, signingCredentialsKey{}).(aws.Credentials) - return v -} - -// SetSigningCredentials sets the credentails used for signing on the context. -func SetSigningCredentials(ctx context.Context, value aws.Credentials) context.Context { - return middleware.WithStackValue(ctx, signingCredentialsKey{}, value) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go deleted file mode 100644 index 6d5f0079c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go +++ /dev/null @@ -1,168 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/internal/rand" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyrand "github.com/aws/smithy-go/rand" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// ClientRequestID is a Smithy BuildMiddleware that will generate a unique ID for logical API operation -// invocation. -type ClientRequestID struct{} - -// ID the identifier for the ClientRequestID -func (r *ClientRequestID) ID() string { - return "ClientRequestID" -} - -// HandleBuild attaches a unique operation invocation id for the operation to the request -func (r ClientRequestID) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", req) - } - - invocationID, err := smithyrand.NewUUID(rand.Reader).GetUUID() - if err != nil { - return out, metadata, err - } - - const invocationIDHeader = "Amz-Sdk-Invocation-Id" - req.Header[invocationIDHeader] = append(req.Header[invocationIDHeader][:0], invocationID) - - return next.HandleBuild(ctx, in) -} - -// RecordResponseTiming records the response timing for the SDK client requests. -type RecordResponseTiming struct{} - -// ID is the middleware identifier -func (a *RecordResponseTiming) ID() string { - return "RecordResponseTiming" -} - -// HandleDeserialize calculates response metadata and clock skew -func (a RecordResponseTiming) 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) - responseAt := sdk.NowTime() - setResponseAt(&metadata, responseAt) - - var serverTime time.Time - - switch resp := out.RawResponse.(type) { - case *smithyhttp.Response: - respDateHeader := resp.Header.Get("Date") - if len(respDateHeader) == 0 { - break - } - var parseErr error - serverTime, parseErr = smithyhttp.ParseTime(respDateHeader) - if parseErr != nil { - logger := middleware.GetLogger(ctx) - logger.Logf(logging.Warn, "failed to parse response Date header value, got %v", - parseErr.Error()) - break - } - setServerTime(&metadata, serverTime) - } - - if !serverTime.IsZero() { - attemptSkew := serverTime.Sub(responseAt) - setAttemptSkew(&metadata, attemptSkew) - } - - return out, metadata, err -} - -type responseAtKey struct{} - -// GetResponseAt returns the time response was received at. -func GetResponseAt(metadata middleware.Metadata) (v time.Time, ok bool) { - v, ok = metadata.Get(responseAtKey{}).(time.Time) - return v, ok -} - -// setResponseAt sets the response time on the metadata. -func setResponseAt(metadata *middleware.Metadata, v time.Time) { - metadata.Set(responseAtKey{}, v) -} - -type serverTimeKey struct{} - -// GetServerTime returns the server time for response. -func GetServerTime(metadata middleware.Metadata) (v time.Time, ok bool) { - v, ok = metadata.Get(serverTimeKey{}).(time.Time) - return v, ok -} - -// setServerTime sets the server time on the metadata. -func setServerTime(metadata *middleware.Metadata, v time.Time) { - metadata.Set(serverTimeKey{}, v) -} - -type attemptSkewKey struct{} - -// GetAttemptSkew returns Attempt clock skew for response from metadata. -func GetAttemptSkew(metadata middleware.Metadata) (v time.Duration, ok bool) { - v, ok = metadata.Get(attemptSkewKey{}).(time.Duration) - return v, ok -} - -// setAttemptSkew sets the attempt clock skew on the metadata. -func setAttemptSkew(metadata *middleware.Metadata, v time.Duration) { - metadata.Set(attemptSkewKey{}, v) -} - -// AddClientRequestIDMiddleware adds ClientRequestID to the middleware stack -func AddClientRequestIDMiddleware(stack *middleware.Stack) error { - return stack.Build.Add(&ClientRequestID{}, middleware.After) -} - -// AddRecordResponseTiming adds RecordResponseTiming middleware to the -// middleware stack. -func AddRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&RecordResponseTiming{}, middleware.After) -} - -// rawResponseKey is the accessor key used to store and access the -// raw response within the response metadata. -type rawResponseKey struct{} - -// AddRawResponse middleware adds raw response on to the metadata -type AddRawResponse struct{} - -// ID the identifier for the ClientRequestID -func (m *AddRawResponse) ID() string { - return "AddRawResponseToMetadata" -} - -// HandleDeserialize adds raw response on the middleware metadata -func (m AddRawResponse) 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) - metadata.Set(rawResponseKey{}, out.RawResponse) - return out, metadata, err -} - -// AddRawResponseToMetadata adds middleware to the middleware stack that -// store raw response on to the metadata. -func AddRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&AddRawResponse{}, middleware.Before) -} - -// GetRawResponse returns raw response set on metadata -func GetRawResponse(metadata middleware.Metadata) interface{} { - return metadata.Get(rawResponseKey{}) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go deleted file mode 100644 index ba262dadc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -package middleware - -import "runtime" - -func getNormalizedOSName() (os string) { - switch runtime.GOOS { - case "android": - os = "android" - case "linux": - os = "linux" - case "windows": - os = "windows" - case "darwin": - os = "macos" - case "ios": - os = "ios" - default: - os = "other" - } - return os -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go deleted file mode 100644 index e14a1e4ec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build !go1.16 -// +build !go1.16 - -package middleware - -import "runtime" - -func getNormalizedOSName() (os string) { - switch runtime.GOOS { - case "android": - os = "android" - case "linux": - os = "linux" - case "windows": - os = "windows" - case "darwin": - // Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64 - // For now declare this as "other" until we have a better detection mechanism. - fallthrough - default: - os = "other" - } - return os -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go deleted file mode 100644 index 3f6aaf231..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go +++ /dev/null @@ -1,94 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "os" -) - -const envAwsLambdaFunctionName = "AWS_LAMBDA_FUNCTION_NAME" -const envAmznTraceID = "_X_AMZN_TRACE_ID" -const amznTraceIDHeader = "X-Amzn-Trace-Id" - -// AddRecursionDetection adds recursionDetection to the middleware stack -func AddRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&RecursionDetection{}, middleware.After) -} - -// RecursionDetection detects Lambda environment and sets its X-Ray trace ID to request header if absent -// to avoid recursion invocation in Lambda -type RecursionDetection struct{} - -// ID returns the middleware identifier -func (m *RecursionDetection) ID() string { - return "RecursionDetection" -} - -// HandleBuild detects Lambda environment and adds its trace ID to request header if absent -func (m *RecursionDetection) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown request type %T", req) - } - - _, hasLambdaEnv := os.LookupEnv(envAwsLambdaFunctionName) - xAmznTraceID, hasTraceID := os.LookupEnv(envAmznTraceID) - value := req.Header.Get(amznTraceIDHeader) - // only set the X-Amzn-Trace-Id header when it is not set initially, the - // current environment is Lambda and the _X_AMZN_TRACE_ID env variable exists - if value != "" || !hasLambdaEnv || !hasTraceID { - return next.HandleBuild(ctx, in) - } - - req.Header.Set(amznTraceIDHeader, percentEncode(xAmznTraceID)) - return next.HandleBuild(ctx, in) -} - -func percentEncode(s string) string { - upperhex := "0123456789ABCDEF" - hexCount := 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEncode(c) { - hexCount++ - } - } - - if hexCount == 0 { - return s - } - - required := len(s) + 2*hexCount - t := make([]byte, required) - j := 0 - for i := 0; i < len(s); i++ { - if c := s[i]; shouldEncode(c) { - t[j] = '%' - t[j+1] = upperhex[c>>4] - t[j+2] = upperhex[c&15] - j += 3 - } else { - t[j] = c - j++ - } - } - return string(t) -} - -func shouldEncode(c byte) bool { - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { - return false - } - switch c { - case '-', '=', ';', ':', '+', '&', '[', ']', '{', '}', '"', '\'', ',': - return false - default: - return true - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.go deleted file mode 100644 index dd3391fe4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.go +++ /dev/null @@ -1,27 +0,0 @@ -package middleware - -import ( - "github.com/aws/smithy-go/middleware" -) - -// requestIDKey is used to retrieve request id from response metadata -type requestIDKey struct{} - -// SetRequestIDMetadata sets the provided request id over middleware metadata -func SetRequestIDMetadata(metadata *middleware.Metadata, id string) { - metadata.Set(requestIDKey{}, id) -} - -// GetRequestIDMetadata retrieves the request id from middleware metadata -// returns string and bool indicating value of request id, whether request id was set. -func GetRequestIDMetadata(metadata middleware.Metadata) (string, bool) { - if !metadata.Has(requestIDKey{}) { - return "", false - } - - v, ok := metadata.Get(requestIDKey{}).(string) - if !ok { - return "", true - } - return v, true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go deleted file mode 100644 index 128b60a73..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go +++ /dev/null @@ -1,57 +0,0 @@ -package middleware - -import ( - "context" - - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// AddRequestIDRetrieverMiddleware adds request id retriever middleware -func AddRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - // add error wrapper middleware before operation deserializers so that it can wrap the error response - // returned by operation deserializers - return stack.Deserialize.Insert(&RequestIDRetriever{}, "OperationDeserializer", middleware.Before) -} - -// RequestIDRetriever middleware captures the AWS service request ID from the -// raw response. -type RequestIDRetriever struct { -} - -// ID returns the middleware identifier -func (m *RequestIDRetriever) ID() string { - return "RequestIDRetriever" -} - -// HandleDeserialize pulls the AWS request ID from the response, storing it in -// operation metadata. -func (m *RequestIDRetriever) 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) - - resp, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - // No raw response to wrap with. - return out, metadata, err - } - - // Different header which can map to request id - requestIDHeaderList := []string{"X-Amzn-Requestid", "X-Amz-RequestId"} - - for _, h := range requestIDHeaderList { - // check for headers known to contain Request id - if v := resp.Header.Get(h); len(v) != 0 { - // set reqID on metadata for successful responses. - SetRequestIDMetadata(&metadata, v) - - span, _ := tracing.GetSpan(ctx) - span.SetProperty("aws.request_id", v) - break - } - } - - return out, metadata, err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go deleted file mode 100644 index 3314230fd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go +++ /dev/null @@ -1,393 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "os" - "runtime" - "sort" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -var languageVersion = strings.TrimPrefix(runtime.Version(), "go") - -// SDKAgentKeyType is the metadata type to add to the SDK agent string -type SDKAgentKeyType int - -// The set of valid SDKAgentKeyType constants. If an unknown value is assigned for SDKAgentKeyType it will -// be mapped to AdditionalMetadata. -const ( - _ SDKAgentKeyType = iota - APIMetadata - OperatingSystemMetadata - LanguageMetadata - EnvironmentMetadata - FeatureMetadata - ConfigMetadata - FrameworkMetadata - AdditionalMetadata - ApplicationIdentifier - FeatureMetadata2 -) - -// Hardcoded value to specify which version of the user agent we're using -const uaMetadata = "ua/2.1" - -func (k SDKAgentKeyType) string() string { - switch k { - case APIMetadata: - return "api" - case OperatingSystemMetadata: - return "os" - case LanguageMetadata: - return "lang" - case EnvironmentMetadata: - return "exec-env" - case FeatureMetadata: - return "ft" - case ConfigMetadata: - return "cfg" - case FrameworkMetadata: - return "lib" - case ApplicationIdentifier: - return "app" - case FeatureMetadata2: - return "m" - case AdditionalMetadata: - fallthrough - default: - return "md" - } -} - -const execEnvVar = `AWS_EXECUTION_ENV` - -var validChars = map[rune]bool{ - '!': true, '#': true, '$': true, '%': true, '&': true, '\'': true, '*': true, '+': true, - '-': true, '.': true, '^': true, '_': true, '`': true, '|': true, '~': true, -} - -// UserAgentFeature enumerates tracked SDK features. -type UserAgentFeature string - -// Enumerates UserAgentFeature. -const ( - UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types) - - UserAgentFeatureWaiter = "B" - UserAgentFeaturePaginator = "C" - - UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard) - UserAgentFeatureRetryModeStandard = "E" - UserAgentFeatureRetryModeAdaptive = "F" - - UserAgentFeatureS3Transfer = "G" - UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external) - UserAgentFeatureS3CryptoV2 = "I" // n/a - UserAgentFeatureS3ExpressBucket = "J" - UserAgentFeatureS3AccessGrants = "K" // not yet implemented - - UserAgentFeatureGZIPRequestCompression = "L" - - UserAgentFeatureProtocolRPCV2CBOR = "M" - - UserAgentFeatureAccountIDEndpoint = "O" // DO NOT IMPLEMENT: rules output is not currently defined. SDKs should not parse endpoints for feature information. - UserAgentFeatureAccountIDModePreferred = "P" - UserAgentFeatureAccountIDModeDisabled = "Q" - UserAgentFeatureAccountIDModeRequired = "R" - - UserAgentFeatureRequestChecksumCRC32 = "U" - UserAgentFeatureRequestChecksumCRC32C = "V" - UserAgentFeatureRequestChecksumCRC64 = "W" - UserAgentFeatureRequestChecksumSHA1 = "X" - UserAgentFeatureRequestChecksumSHA256 = "Y" - UserAgentFeatureRequestChecksumWhenSupported = "Z" - UserAgentFeatureRequestChecksumWhenRequired = "a" - UserAgentFeatureResponseChecksumWhenSupported = "b" - UserAgentFeatureResponseChecksumWhenRequired = "c" - - UserAgentFeatureDynamoDBUserAgent = "d" // not yet implemented - - UserAgentFeatureCredentialsCode = "e" - UserAgentFeatureCredentialsJvmSystemProperties = "f" // n/a (this is not a JVM sdk) - UserAgentFeatureCredentialsEnvVars = "g" - UserAgentFeatureCredentialsEnvVarsStsWebIDToken = "h" - UserAgentFeatureCredentialsStsAssumeRole = "i" - UserAgentFeatureCredentialsStsAssumeRoleSaml = "j" // not yet implemented - UserAgentFeatureCredentialsStsAssumeRoleWebID = "k" - UserAgentFeatureCredentialsStsFederationToken = "l" // not yet implemented - UserAgentFeatureCredentialsStsSessionToken = "m" // not yet implemented - UserAgentFeatureCredentialsProfile = "n" - UserAgentFeatureCredentialsProfileSourceProfile = "o" - UserAgentFeatureCredentialsProfileNamedProvider = "p" - UserAgentFeatureCredentialsProfileStsWebIDToken = "q" - UserAgentFeatureCredentialsProfileSso = "r" - UserAgentFeatureCredentialsSso = "s" - UserAgentFeatureCredentialsProfileSsoLegacy = "t" - UserAgentFeatureCredentialsSsoLegacy = "u" - UserAgentFeatureCredentialsProfileProcess = "v" - UserAgentFeatureCredentialsProcess = "w" - UserAgentFeatureCredentialsBoto2ConfigFile = "x" // n/a (this is not boto/Python) - UserAgentFeatureCredentialsAwsSdkStore = "y" // n/a (this is used by .NET based sdk) - UserAgentFeatureCredentialsHTTP = "z" - UserAgentFeatureCredentialsIMDS = "0" - - UserAgentFeatureBearerServiceEnvVars = "3" -) - -var credentialSourceToFeature = map[aws.CredentialSource]UserAgentFeature{ - aws.CredentialSourceCode: UserAgentFeatureCredentialsCode, - aws.CredentialSourceEnvVars: UserAgentFeatureCredentialsEnvVars, - aws.CredentialSourceEnvVarsSTSWebIDToken: UserAgentFeatureCredentialsEnvVarsStsWebIDToken, - aws.CredentialSourceSTSAssumeRole: UserAgentFeatureCredentialsStsAssumeRole, - aws.CredentialSourceSTSAssumeRoleSaml: UserAgentFeatureCredentialsStsAssumeRoleSaml, - aws.CredentialSourceSTSAssumeRoleWebID: UserAgentFeatureCredentialsStsAssumeRoleWebID, - aws.CredentialSourceSTSFederationToken: UserAgentFeatureCredentialsStsFederationToken, - aws.CredentialSourceSTSSessionToken: UserAgentFeatureCredentialsStsSessionToken, - aws.CredentialSourceProfile: UserAgentFeatureCredentialsProfile, - aws.CredentialSourceProfileSourceProfile: UserAgentFeatureCredentialsProfileSourceProfile, - aws.CredentialSourceProfileNamedProvider: UserAgentFeatureCredentialsProfileNamedProvider, - aws.CredentialSourceProfileSTSWebIDToken: UserAgentFeatureCredentialsProfileStsWebIDToken, - aws.CredentialSourceProfileSSO: UserAgentFeatureCredentialsProfileSso, - aws.CredentialSourceSSO: UserAgentFeatureCredentialsSso, - aws.CredentialSourceProfileSSOLegacy: UserAgentFeatureCredentialsProfileSsoLegacy, - aws.CredentialSourceSSOLegacy: UserAgentFeatureCredentialsSsoLegacy, - aws.CredentialSourceProfileProcess: UserAgentFeatureCredentialsProfileProcess, - aws.CredentialSourceProcess: UserAgentFeatureCredentialsProcess, - aws.CredentialSourceHTTP: UserAgentFeatureCredentialsHTTP, - aws.CredentialSourceIMDS: UserAgentFeatureCredentialsIMDS, -} - -// RequestUserAgent is a build middleware that set the User-Agent for the request. -type RequestUserAgent struct { - sdkAgent, userAgent *smithyhttp.UserAgentBuilder - features map[UserAgentFeature]struct{} -} - -// NewRequestUserAgent returns a new requestUserAgent which will set the User-Agent and X-Amz-User-Agent for the -// request. -// -// User-Agent example: -// -// aws-sdk-go-v2/1.2.3 -// -// X-Amz-User-Agent example: -// -// aws-sdk-go-v2/1.2.3 md/GOOS/linux md/GOARCH/amd64 lang/go/1.15 -func NewRequestUserAgent() *RequestUserAgent { - userAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder() - addProductName(userAgent) - addUserAgentMetadata(userAgent) - addProductName(sdkAgent) - - r := &RequestUserAgent{ - sdkAgent: sdkAgent, - userAgent: userAgent, - features: map[UserAgentFeature]struct{}{}, - } - - addSDKMetadata(r) - - return r -} - -func addSDKMetadata(r *RequestUserAgent) { - r.AddSDKAgentKey(OperatingSystemMetadata, getNormalizedOSName()) - r.AddSDKAgentKeyValue(LanguageMetadata, "go", languageVersion) - r.AddSDKAgentKeyValue(AdditionalMetadata, "GOOS", runtime.GOOS) - r.AddSDKAgentKeyValue(AdditionalMetadata, "GOARCH", runtime.GOARCH) - if ev := os.Getenv(execEnvVar); len(ev) > 0 { - r.AddSDKAgentKey(EnvironmentMetadata, ev) - } -} - -func addProductName(builder *smithyhttp.UserAgentBuilder) { - builder.AddKeyValue(aws.SDKName, aws.SDKVersion) -} - -func addUserAgentMetadata(builder *smithyhttp.UserAgentBuilder) { - builder.AddKey(uaMetadata) -} - -// AddUserAgentKey retrieves a requestUserAgent from the provided stack, or initializes one. -func AddUserAgentKey(key string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - requestUserAgent, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - requestUserAgent.AddUserAgentKey(key) - return nil - } -} - -// AddUserAgentKeyValue retrieves a requestUserAgent from the provided stack, or initializes one. -func AddUserAgentKeyValue(key, value string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - requestUserAgent, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - requestUserAgent.AddUserAgentKeyValue(key, value) - return nil - } -} - -// AddSDKAgentKey retrieves a requestUserAgent from the provided stack, or initializes one. -func AddSDKAgentKey(keyType SDKAgentKeyType, key string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - requestUserAgent, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - requestUserAgent.AddSDKAgentKey(keyType, key) - return nil - } -} - -// AddSDKAgentKeyValue retrieves a requestUserAgent from the provided stack, or initializes one. -func AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - requestUserAgent, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - requestUserAgent.AddSDKAgentKeyValue(keyType, key, value) - return nil - } -} - -// AddRequestUserAgentMiddleware registers a requestUserAgent middleware on the stack if not present. -func AddRequestUserAgentMiddleware(stack *middleware.Stack) error { - _, err := getOrAddRequestUserAgent(stack) - return err -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*RequestUserAgent, error) { - id := (*RequestUserAgent)(nil).ID() - bm, ok := stack.Build.Get(id) - if !ok { - bm = NewRequestUserAgent() - err := stack.Build.Add(bm, middleware.After) - if err != nil { - return nil, err - } - } - - requestUserAgent, ok := bm.(*RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", bm, id) - } - - return requestUserAgent, nil -} - -// AddUserAgentKey adds the component identified by name to the User-Agent string. -func (u *RequestUserAgent) AddUserAgentKey(key string) { - u.userAgent.AddKey(strings.Map(rules, key)) -} - -// AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string. -func (u *RequestUserAgent) AddUserAgentKeyValue(key, value string) { - u.userAgent.AddKeyValue(strings.Map(rules, key), strings.Map(rules, value)) -} - -// AddUserAgentFeature adds the feature ID to the tracking list to be emitted -// in the final User-Agent string. -func (u *RequestUserAgent) AddUserAgentFeature(feature UserAgentFeature) { - u.features[feature] = struct{}{} -} - -// AddSDKAgentKey adds the component identified by name to the User-Agent string. -func (u *RequestUserAgent) AddSDKAgentKey(keyType SDKAgentKeyType, key string) { - // TODO: should target sdkAgent - u.userAgent.AddKey(keyType.string() + "/" + strings.Map(rules, key)) -} - -// AddSDKAgentKeyValue adds the key identified by the given name and value to the User-Agent string. -func (u *RequestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) { - // TODO: should target sdkAgent - u.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+"#"+strings.Map(rules, value)) -} - -// AddCredentialsSource adds the credential source as a feature on the User-Agent string -func (u *RequestUserAgent) AddCredentialsSource(source aws.CredentialSource) { - x, ok := credentialSourceToFeature[source] - if ok { - u.AddUserAgentFeature(x) - } -} - -// ID the name of the middleware. -func (u *RequestUserAgent) ID() string { - return "UserAgent" -} - -// HandleBuild adds or appends the constructed user agent to the request. -func (u *RequestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - switch req := in.Request.(type) { - case *smithyhttp.Request: - u.addHTTPUserAgent(req) - // TODO: To be re-enabled - // u.addHTTPSDKAgent(req) - default: - return out, metadata, fmt.Errorf("unknown transport type %T", in) - } - - return next.HandleBuild(ctx, in) -} - -func (u *RequestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) { - const userAgent = "User-Agent" - if len(u.features) > 0 { - updateHTTPHeader(request, userAgent, buildFeatureMetrics(u.features)) - } - updateHTTPHeader(request, userAgent, u.userAgent.Build()) -} - -func (u *RequestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) { - const sdkAgent = "X-Amz-User-Agent" - updateHTTPHeader(request, sdkAgent, u.sdkAgent.Build()) -} - -func updateHTTPHeader(request *smithyhttp.Request, header string, value string) { - var current string - if v := request.Header[header]; len(v) > 0 { - current = v[0] - } - if len(current) > 0 { - current = value + " " + current - } else { - current = value - } - request.Header[header] = append(request.Header[header][:0], current) -} - -func rules(r rune) rune { - switch { - case r >= '0' && r <= '9': - return r - case r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z': - return r - case validChars[r]: - return r - default: - return '-' - } -} - -func buildFeatureMetrics(features map[UserAgentFeature]struct{}) string { - fs := make([]string, 0, len(features)) - for f := range features { - fs = append(fs, string(f)) - } - - sort.Strings(fs) - return fmt.Sprintf("%s/%s", FeatureMetadata2.string(), strings.Join(fs, ",")) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.go deleted file mode 100644 index 12a2c77a9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.go +++ /dev/null @@ -1,24 +0,0 @@ -package ec2query - -import ( - "encoding/xml" - "fmt" - "io" -) - -// ErrorComponents represents the error response fields -// that will be deserialized from a ec2query error response body -type ErrorComponents struct { - Code string `xml:"Errors>Error>Code"` - Message string `xml:"Errors>Error>Message"` - RequestID string `xml:"RequestID"` -} - -// GetErrorResponseComponents returns the error components from a ec2query error response body -func GetErrorResponseComponents(r io.Reader) (ErrorComponents, error) { - var er ErrorComponents - if err := xml.NewDecoder(r).Decode(&er); err != nil && err != io.EOF { - return ErrorComponents{}, fmt.Errorf("error while fetching xml error response code: %w", err) - } - return er, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go deleted file mode 100644 index 6669a3ddf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go +++ /dev/null @@ -1,61 +0,0 @@ -package query - -import ( - "net/url" - "strconv" -) - -// Array represents the encoding of Query lists and sets. A Query array is a -// representation of a list of values of a fixed type. A serialized array might -// look like the following: -// -// ListName.member.1=foo -// &ListName.member.2=bar -// &Listname.member.3=baz -type Array struct { - // The query values to add the array to. - values url.Values - // The array's prefix, which includes the names of all parent structures - // and ends with the name of the list. For example, the prefix might be - // "ParentStructure.ListName". This prefix will be used to form the full - // keys for each element in the list. For example, an entry might have the - // key "ParentStructure.ListName.member.MemberName.1". - // - // When the array is not flat the prefix will contain the memberName otherwise the memberName is ignored - prefix string - // Elements are stored in values, so we keep track of the list size here. - size int32 - // Empty lists are encoded as "=", if we add a value later we will - // remove this encoding - emptyValue Value -} - -func newArray(values url.Values, prefix string, flat bool, memberName string) *Array { - emptyValue := newValue(values, prefix, flat) - emptyValue.String("") - - if !flat { - // This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead - prefix = prefix + keySeparator + memberName - } - - return &Array{ - values: values, - prefix: prefix, - emptyValue: emptyValue, - } -} - -// Value adds a new element to the Query Array. Returns a Value type used to -// encode the array element. -func (a *Array) Value() Value { - if a.size == 0 { - delete(a.values, a.emptyValue.key) - } - - // Query lists start a 1, so adjust the size first - a.size++ - // Lists can't have flat members - // This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead - return newValue(a.values, a.prefix+keySeparator+strconv.FormatInt(int64(a.size), 10), false) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go deleted file mode 100644 index 2ecf9241c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go +++ /dev/null @@ -1,80 +0,0 @@ -package query - -import ( - "io" - "net/url" - "sort" -) - -// Encoder is a Query encoder that supports construction of Query body -// values using methods. -type Encoder struct { - // The query values that will be built up to manage encoding. - values url.Values - // The writer that the encoded body will be written to. - writer io.Writer - Value -} - -// NewEncoder returns a new Query body encoder -func NewEncoder(writer io.Writer) *Encoder { - values := url.Values{} - return &Encoder{ - values: values, - writer: writer, - Value: newBaseValue(values), - } -} - -// Encode returns the []byte slice representing the current -// state of the Query encoder. -func (e Encoder) Encode() error { - ws, ok := e.writer.(interface{ WriteString(string) (int, error) }) - if !ok { - // Fall back to less optimal byte slice casting if WriteString isn't available. - ws = &wrapWriteString{writer: e.writer} - } - - // Get the keys and sort them to have a stable output - keys := make([]string, 0, len(e.values)) - for k := range e.values { - keys = append(keys, k) - } - sort.Strings(keys) - isFirstEntry := true - for _, key := range keys { - queryValues := e.values[key] - escapedKey := url.QueryEscape(key) - for _, value := range queryValues { - if !isFirstEntry { - if _, err := ws.WriteString(`&`); err != nil { - return err - } - } else { - isFirstEntry = false - } - if _, err := ws.WriteString(escapedKey); err != nil { - return err - } - if _, err := ws.WriteString(`=`); err != nil { - return err - } - if _, err := ws.WriteString(url.QueryEscape(value)); err != nil { - return err - } - } - } - return nil -} - -// wrapWriteString wraps an io.Writer to provide a WriteString method -// where one is not available. -type wrapWriteString struct { - writer io.Writer -} - -// WriteString writes a string to the wrapped writer by casting it to -// a byte array first. -func (w wrapWriteString) WriteString(v string) (int, error) { - return w.writer.Write([]byte(v)) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go deleted file mode 100644 index dea242b8b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go +++ /dev/null @@ -1,78 +0,0 @@ -package query - -import ( - "fmt" - "net/url" -) - -// Map represents the encoding of Query maps. A Query map is a representation -// of a mapping of arbitrary string keys to arbitrary values of a fixed type. -// A Map differs from an Object in that the set of keys is not fixed, in that -// the values must all be of the same type, and that map entries are ordered. -// A serialized map might look like the following: -// -// MapName.entry.1.key=Foo -// &MapName.entry.1.value=spam -// &MapName.entry.2.key=Bar -// &MapName.entry.2.value=eggs -type Map struct { - // The query values to add the map to. - values url.Values - // The map's prefix, which includes the names of all parent structures - // and ends with the name of the object. For example, the prefix might be - // "ParentStructure.MapName". This prefix will be used to form the full - // keys for each key-value pair of the map. For example, a value might have - // the key "ParentStructure.MapName.1.value". - // - // While this is currently represented as a string that gets added to, it - // could also be represented as a stack that only gets condensed into a - // string when a finalized key is created. This could potentially reduce - // allocations. - prefix string - // Whether the map is flat or not. A map that is not flat will produce the - // following entries to the url.Values for a given key-value pair: - // MapName.entry.1.KeyLocationName=mykey - // MapName.entry.1.ValueLocationName=myvalue - // A map that is flat will produce the following: - // MapName.1.KeyLocationName=mykey - // MapName.1.ValueLocationName=myvalue - flat bool - // The location name of the key. In most cases this should be "key". - keyLocationName string - // The location name of the value. In most cases this should be "value". - valueLocationName string - // Elements are stored in values, so we keep track of the list size here. - size int32 -} - -func newMap(values url.Values, prefix string, flat bool, keyLocationName string, valueLocationName string) *Map { - return &Map{ - values: values, - prefix: prefix, - flat: flat, - keyLocationName: keyLocationName, - valueLocationName: valueLocationName, - } -} - -// Key adds the given named key to the Query map. -// Returns a Value encoder that should be used to encode a Query value type. -func (m *Map) Key(name string) Value { - // Query lists start a 1, so adjust the size first - m.size++ - var key string - var value string - if m.flat { - key = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.keyLocationName) - value = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.valueLocationName) - } else { - key = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.keyLocationName) - value = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.valueLocationName) - } - - // The key can only be a string, so we just go ahead and set it here - newValue(m.values, key, false).String(name) - - // Maps can't have flat members - return newValue(m.values, value, false) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go deleted file mode 100644 index 360344791..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go +++ /dev/null @@ -1,62 +0,0 @@ -package query - -import ( - "context" - "fmt" - "io/ioutil" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// AddAsGetRequestMiddleware adds a middleware to the Serialize stack after the -// operation serializer that will convert the query request body to a GET -// operation with the query message in the HTTP request querystring. -func AddAsGetRequestMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&asGetRequest{}, "OperationSerializer", middleware.After) -} - -type asGetRequest struct{} - -func (*asGetRequest) ID() string { return "Query:AsGetRequest" } - -func (m *asGetRequest) HandleSerialize( - ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - req, ok := input.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("expect smithy HTTP Request, got %T", input.Request) - } - - req.Method = "GET" - - // If the stream is not set, nothing else to do. - stream := req.GetStream() - if stream == nil { - return next.HandleSerialize(ctx, input) - } - - // Clear the stream since there will not be any body. - req.Header.Del("Content-Type") - req, err = req.SetStream(nil) - if err != nil { - return out, metadata, fmt.Errorf("unable update request body %w", err) - } - input.Request = req - - // Update request query with the body's query string value. - delim := "" - if len(req.URL.RawQuery) != 0 { - delim = "&" - } - - b, err := ioutil.ReadAll(stream) - if err != nil { - return out, metadata, fmt.Errorf("unable to get request body %w", err) - } - req.URL.RawQuery += delim + string(b) - - return next.HandleSerialize(ctx, input) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go deleted file mode 100644 index 305a8ace3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go +++ /dev/null @@ -1,68 +0,0 @@ -package query - -import "net/url" - -// Object represents the encoding of Query structures and unions. A Query -// object is a representation of a mapping of string keys to arbitrary -// values where there is a fixed set of keys whose values each have their -// own known type. A serialized object might look like the following: -// -// ObjectName.Foo=value -// &ObjectName.Bar=5 -type Object struct { - // The query values to add the object to. - values url.Values - // The object's prefix, which includes the names of all parent structures - // and ends with the name of the object. For example, the prefix might be - // "ParentStructure.ObjectName". This prefix will be used to form the full - // keys for each member of the object. For example, a member might have the - // key "ParentStructure.ObjectName.MemberName". - // - // While this is currently represented as a string that gets added to, it - // could also be represented as a stack that only gets condensed into a - // string when a finalized key is created. This could potentially reduce - // allocations. - prefix string -} - -func newObject(values url.Values, prefix string) *Object { - return &Object{ - values: values, - prefix: prefix, - } -} - -// Key adds the given named key to the Query object. -// Returns a Value encoder that should be used to encode a Query value type. -func (o *Object) Key(name string) Value { - return o.key(name, false) -} - -// KeyWithValues adds the given named key to the Query object. -// Returns a Value encoder that should be used to encode a Query list of values. -func (o *Object) KeyWithValues(name string) Value { - return o.keyWithValues(name, false) -} - -// FlatKey adds the given named key to the Query object. -// Returns a Value encoder that should be used to encode a Query value type. The -// value will be flattened if it is a map or array. -func (o *Object) FlatKey(name string) Value { - return o.key(name, true) -} - -func (o *Object) key(name string, flatValue bool) Value { - if o.prefix != "" { - // This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead - return newValue(o.values, o.prefix+keySeparator+name, flatValue) - } - return newValue(o.values, name, flatValue) -} - -func (o *Object) keyWithValues(name string, flatValue bool) Value { - if o.prefix != "" { - // This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead - return newAppendValue(o.values, o.prefix+keySeparator+name, flatValue) - } - return newAppendValue(o.values, name, flatValue) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go deleted file mode 100644 index 8063c592d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go +++ /dev/null @@ -1,117 +0,0 @@ -package query - -import ( - "math/big" - "net/url" - - "github.com/aws/smithy-go/encoding/httpbinding" -) - -const keySeparator = "." - -// Value represents a Query Value type. -type Value struct { - // The query values to add the value to. - values url.Values - // The value's key, which will form the prefix for complex types. - key string - // Whether the value should be flattened or not if it's a flattenable type. - flat bool - queryValue httpbinding.QueryValue -} - -func newValue(values url.Values, key string, flat bool) Value { - return Value{ - values: values, - key: key, - flat: flat, - queryValue: httpbinding.NewQueryValue(values, key, false), - } -} - -func newAppendValue(values url.Values, key string, flat bool) Value { - return Value{ - values: values, - key: key, - flat: flat, - queryValue: httpbinding.NewQueryValue(values, key, true), - } -} - -func newBaseValue(values url.Values) Value { - return Value{ - values: values, - queryValue: httpbinding.NewQueryValue(nil, "", false), - } -} - -// Array returns a new Array encoder. -func (qv Value) Array(locationName string) *Array { - return newArray(qv.values, qv.key, qv.flat, locationName) -} - -// Object returns a new Object encoder. -func (qv Value) Object() *Object { - return newObject(qv.values, qv.key) -} - -// Map returns a new Map encoder. -func (qv Value) Map(keyLocationName string, valueLocationName string) *Map { - return newMap(qv.values, qv.key, qv.flat, keyLocationName, valueLocationName) -} - -// Base64EncodeBytes encodes v as a base64 query string value. -// This is intended to enable compatibility with the JSON encoder. -func (qv Value) Base64EncodeBytes(v []byte) { - qv.queryValue.Blob(v) -} - -// Boolean encodes v as a query string value -func (qv Value) Boolean(v bool) { - qv.queryValue.Boolean(v) -} - -// String encodes v as a query string value -func (qv Value) String(v string) { - qv.queryValue.String(v) -} - -// Byte encodes v as a query string value -func (qv Value) Byte(v int8) { - qv.queryValue.Byte(v) -} - -// Short encodes v as a query string value -func (qv Value) Short(v int16) { - qv.queryValue.Short(v) -} - -// Integer encodes v as a query string value -func (qv Value) Integer(v int32) { - qv.queryValue.Integer(v) -} - -// Long encodes v as a query string value -func (qv Value) Long(v int64) { - qv.queryValue.Long(v) -} - -// Float encodes v as a query string value -func (qv Value) Float(v float32) { - qv.queryValue.Float(v) -} - -// Double encodes v as a query string value -func (qv Value) Double(v float64) { - qv.queryValue.Double(v) -} - -// BigInteger encodes v as a query string value -func (qv Value) BigInteger(v *big.Int) { - qv.queryValue.BigInteger(v) -} - -// BigDecimal encodes v as a query string value -func (qv Value) BigDecimal(v *big.Float) { - qv.queryValue.BigDecimal(v) -} 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/aws/protocol/xml/error_utils.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go deleted file mode 100644 index 6975ce652..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go +++ /dev/null @@ -1,48 +0,0 @@ -package xml - -import ( - "encoding/xml" - "fmt" - "io" -) - -// ErrorComponents represents the error response fields -// that will be deserialized from an xml error response body -type ErrorComponents struct { - Code string - Message string - RequestID string -} - -// GetErrorResponseComponents returns the error fields from an xml error response body -func GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error) { - if noErrorWrapping { - var errResponse noWrappedErrorResponse - if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { - return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) - } - return ErrorComponents(errResponse), nil - } - - var errResponse wrappedErrorResponse - if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { - return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) - } - return ErrorComponents(errResponse), nil -} - -// noWrappedErrorResponse represents the error response body with -// no internal Error wrapping -type noWrappedErrorResponse struct { - Code string `xml:"Code"` - Message string `xml:"Message"` - RequestID string `xml:"RequestId"` -} - -// wrappedErrorResponse represents the error response body -// wrapped within Error -type wrappedErrorResponse struct { - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` - RequestID string `xml:"RequestId"` -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go deleted file mode 100644 index 8c7836410..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go +++ /dev/null @@ -1,20 +0,0 @@ -package ratelimit - -import "context" - -// None implements a no-op rate limiter which effectively disables client-side -// rate limiting (also known as "retry quotas"). -// -// GetToken does nothing and always returns a nil error. The returned -// token-release function does nothing, and always returns a nil error. -// -// AddTokens does nothing and always returns a nil error. -var None = &none{} - -type none struct{} - -func (*none) GetToken(ctx context.Context, cost uint) (func() error, error) { - return func() error { return nil }, nil -} - -func (*none) AddTokens(v uint) error { return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go deleted file mode 100644 index 974ef594f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go +++ /dev/null @@ -1,96 +0,0 @@ -package ratelimit - -import ( - "sync" -) - -// TokenBucket provides a concurrency safe utility for adding and removing -// tokens from the available token bucket. -type TokenBucket struct { - remainingTokens uint - maxCapacity uint - minCapacity uint - mu sync.Mutex -} - -// NewTokenBucket returns an initialized TokenBucket with the capacity -// specified. -func NewTokenBucket(i uint) *TokenBucket { - return &TokenBucket{ - remainingTokens: i, - maxCapacity: i, - minCapacity: 1, - } -} - -// Retrieve attempts to reduce the available tokens by the amount requested. If -// there are tokens available true will be returned along with the number of -// available tokens remaining. If amount requested is larger than the available -// capacity, false will be returned along with the available capacity. If the -// amount is less than the available capacity, the capacity will be reduced by -// that amount, and the remaining capacity and true will be returned. -func (t *TokenBucket) Retrieve(amount uint) (available uint, retrieved bool) { - t.mu.Lock() - defer t.mu.Unlock() - - if amount > t.remainingTokens { - return t.remainingTokens, false - } - - t.remainingTokens -= amount - return t.remainingTokens, true -} - -// Refund returns the amount of tokens back to the available token bucket, up -// to the initial capacity. -func (t *TokenBucket) Refund(amount uint) { - t.mu.Lock() - defer t.mu.Unlock() - - // Capacity cannot exceed max capacity. - t.remainingTokens = uintMin(t.remainingTokens+amount, t.maxCapacity) -} - -// Capacity returns the maximum capacity of tokens that the bucket could -// contain. -func (t *TokenBucket) Capacity() uint { - t.mu.Lock() - defer t.mu.Unlock() - - return t.maxCapacity -} - -// Remaining returns the number of tokens that remaining in the bucket. -func (t *TokenBucket) Remaining() uint { - t.mu.Lock() - defer t.mu.Unlock() - - return t.remainingTokens -} - -// Resize adjusts the size of the token bucket. Returns the capacity remaining. -func (t *TokenBucket) Resize(size uint) uint { - t.mu.Lock() - defer t.mu.Unlock() - - t.maxCapacity = uintMax(size, t.minCapacity) - - // Capacity needs to be capped at max capacity, if max size reduced. - t.remainingTokens = uintMin(t.remainingTokens, t.maxCapacity) - - return t.remainingTokens -} - -func uintMin(a, b uint) uint { - if a < b { - return a - } - return b -} - -func uintMax(a, b uint) uint { - if a > b { - return a - } - return b -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go deleted file mode 100644 index d89090ad3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go +++ /dev/null @@ -1,83 +0,0 @@ -package ratelimit - -import ( - "context" - "fmt" -) - -type rateToken struct { - tokenCost uint - bucket *TokenBucket -} - -func (t rateToken) release() error { - t.bucket.Refund(t.tokenCost) - return nil -} - -// TokenRateLimit provides a Token Bucket RateLimiter implementation -// that limits the overall number of retry attempts that can be made across -// operation invocations. -type TokenRateLimit struct { - bucket *TokenBucket -} - -// NewTokenRateLimit returns an TokenRateLimit with default values. -// Functional options can configure the retry rate limiter. -func NewTokenRateLimit(tokens uint) *TokenRateLimit { - return &TokenRateLimit{ - bucket: NewTokenBucket(tokens), - } -} - -type canceledError struct { - Err error -} - -func (c canceledError) CanceledError() bool { return true } -func (c canceledError) Unwrap() error { return c.Err } -func (c canceledError) Error() string { - return fmt.Sprintf("canceled, %v", c.Err) -} - -// GetToken may cause a available pool of retry quota to be -// decremented. Will return an error if the decremented value can not be -// reduced from the retry quota. -func (l *TokenRateLimit) GetToken(ctx context.Context, cost uint) (func() error, error) { - select { - case <-ctx.Done(): - return nil, canceledError{Err: ctx.Err()} - default: - } - if avail, ok := l.bucket.Retrieve(cost); !ok { - return nil, QuotaExceededError{Available: avail, Requested: cost} - } - - return rateToken{ - tokenCost: cost, - bucket: l.bucket, - }.release, nil -} - -// AddTokens increments the token bucket by a fixed amount. -func (l *TokenRateLimit) AddTokens(v uint) error { - l.bucket.Refund(v) - return nil -} - -// Remaining returns the number of remaining tokens in the bucket. -func (l *TokenRateLimit) Remaining() uint { - return l.bucket.Remaining() -} - -// QuotaExceededError provides the SDK error when the retries for a given -// token bucket have been exhausted. -type QuotaExceededError struct { - Available uint - Requested uint -} - -func (e QuotaExceededError) Error() string { - return fmt.Sprintf("retry quota exceeded, %d available, %d requested", - e.Available, e.Requested) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/request.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/request.go deleted file mode 100644 index d8d00e615..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/request.go +++ /dev/null @@ -1,25 +0,0 @@ -package aws - -import ( - "fmt" -) - -// TODO remove replace with smithy.CanceledError - -// RequestCanceledError is the error that will be returned by an API request -// that was canceled. Requests given a Context may return this error when -// canceled. -type RequestCanceledError struct { - Err error -} - -// CanceledError returns true to satisfy interfaces checking for canceled errors. -func (*RequestCanceledError) CanceledError() bool { return true } - -// Unwrap returns the underlying error, if there was one. -func (e *RequestCanceledError) Unwrap() error { - return e.Err -} -func (e *RequestCanceledError) Error() string { - return fmt.Sprintf("request canceled, %v", e.Err) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go deleted file mode 100644 index 4dfde8573..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go +++ /dev/null @@ -1,156 +0,0 @@ -package retry - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/sdk" -) - -const ( - // DefaultRequestCost is the cost of a single request from the adaptive - // rate limited token bucket. - DefaultRequestCost uint = 1 -) - -// DefaultThrottles provides the set of errors considered throttle errors that -// are checked by default. -var DefaultThrottles = []IsErrorThrottle{ - ThrottleErrorCode{ - Codes: DefaultThrottleErrorCodes, - }, -} - -// AdaptiveModeOptions provides the functional options for configuring the -// adaptive retry mode, and delay behavior. -type AdaptiveModeOptions struct { - // If the adaptive token bucket is empty, when an attempt will be made - // AdaptiveMode will sleep until a token is available. This can occur when - // attempts fail with throttle errors. Use this option to disable the sleep - // until token is available, and return error immediately. - FailOnNoAttemptTokens bool - - // The cost of an attempt from the AdaptiveMode's adaptive token bucket. - RequestCost uint - - // Set of strategies to determine if the attempt failed due to a throttle - // error. - // - // It is safe to append to this list in NewAdaptiveMode's functional options. - Throttles []IsErrorThrottle - - // Set of options for standard retry mode that AdaptiveMode is built on top - // of. AdaptiveMode may apply its own defaults to Standard retry mode that - // are different than the defaults of NewStandard. Use these options to - // override the default options. - StandardOptions []func(*StandardOptions) -} - -// AdaptiveMode provides an experimental retry strategy that expands on the -// Standard retry strategy, adding client attempt rate limits. The attempt rate -// limit is initially unrestricted, but becomes restricted when the attempt -// fails with for a throttle error. When restricted AdaptiveMode may need to -// sleep before an attempt is made, if too many throttles have been received. -// AdaptiveMode's sleep can be canceled with context cancel. Set -// AdaptiveModeOptions FailOnNoAttemptTokens to change the behavior from sleep, -// to fail fast. -// -// Eventually unrestricted attempt rate limit will be restored once attempts no -// longer are failing due to throttle errors. -type AdaptiveMode struct { - options AdaptiveModeOptions - throttles IsErrorThrottles - - retryer aws.RetryerV2 - rateLimit *adaptiveRateLimit -} - -// NewAdaptiveMode returns an initialized AdaptiveMode retry strategy. -func NewAdaptiveMode(optFns ...func(*AdaptiveModeOptions)) *AdaptiveMode { - o := AdaptiveModeOptions{ - RequestCost: DefaultRequestCost, - Throttles: append([]IsErrorThrottle{}, DefaultThrottles...), - } - for _, fn := range optFns { - fn(&o) - } - - return &AdaptiveMode{ - options: o, - throttles: IsErrorThrottles(o.Throttles), - retryer: NewStandard(o.StandardOptions...), - rateLimit: newAdaptiveRateLimit(), - } -} - -// IsErrorRetryable returns if the failed attempt is retryable. This check -// should determine if the error can be retried, or if the error is -// terminal. -func (a *AdaptiveMode) IsErrorRetryable(err error) bool { - return a.retryer.IsErrorRetryable(err) -} - -// MaxAttempts returns the maximum number of attempts that can be made for -// an attempt before failing. A value of 0 implies that the attempt should -// be retried until it succeeds if the errors are retryable. -func (a *AdaptiveMode) MaxAttempts() int { - return a.retryer.MaxAttempts() -} - -// RetryDelay returns the delay that should be used before retrying the -// attempt. Will return error if the if the delay could not be determined. -func (a *AdaptiveMode) RetryDelay(attempt int, opErr error) ( - time.Duration, error, -) { - return a.retryer.RetryDelay(attempt, opErr) -} - -// GetRetryToken attempts to deduct the retry cost from the retry token pool. -// Returning the token release function, or error. -func (a *AdaptiveMode) GetRetryToken(ctx context.Context, opErr error) ( - releaseToken func(error) error, err error, -) { - return a.retryer.GetRetryToken(ctx, opErr) -} - -// GetInitialToken returns the initial attempt token that can increment the -// retry token pool if the attempt is successful. -// -// Deprecated: This method does not provide a way to block using Context, -// nor can it return an error. Use RetryerV2, and GetAttemptToken instead. Only -// present to implement Retryer interface. -func (a *AdaptiveMode) GetInitialToken() (releaseToken func(error) error) { - return nopRelease -} - -// GetAttemptToken returns the attempt token that can be used to rate limit -// attempt calls. Will be used by the SDK's retry package's Attempt -// middleware to get an attempt token prior to calling the temp and releasing -// the attempt token after the attempt has been made. -func (a *AdaptiveMode) GetAttemptToken(ctx context.Context) (func(error) error, error) { - for { - acquiredToken, waitTryAgain := a.rateLimit.AcquireToken(a.options.RequestCost) - if acquiredToken { - break - } - if a.options.FailOnNoAttemptTokens { - return nil, fmt.Errorf( - "unable to get attempt token, and FailOnNoAttemptTokens enables") - } - - if err := sdk.SleepWithContext(ctx, waitTryAgain); err != nil { - return nil, fmt.Errorf("failed to wait for token to be available, %w", err) - } - } - - return a.handleResponse, nil -} - -func (a *AdaptiveMode) handleResponse(opErr error) error { - throttled := a.throttles.IsErrorThrottle(opErr).Bool() - - a.rateLimit.Update(throttled) - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go deleted file mode 100644 index ad96d9b8c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go +++ /dev/null @@ -1,158 +0,0 @@ -package retry - -import ( - "math" - "sync" - "time" - - "github.com/aws/aws-sdk-go-v2/internal/sdk" -) - -type adaptiveRateLimit struct { - tokenBucketEnabled bool - - smooth float64 - beta float64 - scaleConstant float64 - minFillRate float64 - - fillRate float64 - calculatedRate float64 - lastRefilled time.Time - measuredTxRate float64 - lastTxRateBucket float64 - requestCount int64 - lastMaxRate float64 - lastThrottleTime time.Time - timeWindow float64 - - tokenBucket *adaptiveTokenBucket - - mu sync.Mutex -} - -func newAdaptiveRateLimit() *adaptiveRateLimit { - now := sdk.NowTime() - return &adaptiveRateLimit{ - smooth: 0.8, - beta: 0.7, - scaleConstant: 0.4, - - minFillRate: 0.5, - - lastTxRateBucket: math.Floor(timeFloat64Seconds(now)), - lastThrottleTime: now, - - tokenBucket: newAdaptiveTokenBucket(0), - } -} - -func (a *adaptiveRateLimit) Enable(v bool) { - a.mu.Lock() - defer a.mu.Unlock() - - a.tokenBucketEnabled = v -} - -func (a *adaptiveRateLimit) AcquireToken(amount uint) ( - tokenAcquired bool, waitTryAgain time.Duration, -) { - a.mu.Lock() - defer a.mu.Unlock() - - if !a.tokenBucketEnabled { - return true, 0 - } - - a.tokenBucketRefill() - - available, ok := a.tokenBucket.Retrieve(float64(amount)) - if !ok { - waitDur := float64Seconds((float64(amount) - available) / a.fillRate) - return false, waitDur - } - - return true, 0 -} - -func (a *adaptiveRateLimit) Update(throttled bool) { - a.mu.Lock() - defer a.mu.Unlock() - - a.updateMeasuredRate() - - if throttled { - rateToUse := a.measuredTxRate - if a.tokenBucketEnabled { - rateToUse = math.Min(a.measuredTxRate, a.fillRate) - } - - a.lastMaxRate = rateToUse - a.calculateTimeWindow() - a.lastThrottleTime = sdk.NowTime() - a.calculatedRate = a.cubicThrottle(rateToUse) - a.tokenBucketEnabled = true - } else { - a.calculateTimeWindow() - a.calculatedRate = a.cubicSuccess(sdk.NowTime()) - } - - newRate := math.Min(a.calculatedRate, 2*a.measuredTxRate) - a.tokenBucketUpdateRate(newRate) -} - -func (a *adaptiveRateLimit) cubicSuccess(t time.Time) float64 { - dt := secondsFloat64(t.Sub(a.lastThrottleTime)) - return (a.scaleConstant * math.Pow(dt-a.timeWindow, 3)) + a.lastMaxRate -} - -func (a *adaptiveRateLimit) cubicThrottle(rateToUse float64) float64 { - return rateToUse * a.beta -} - -func (a *adaptiveRateLimit) calculateTimeWindow() { - a.timeWindow = math.Pow((a.lastMaxRate*(1.-a.beta))/a.scaleConstant, 1./3.) -} - -func (a *adaptiveRateLimit) tokenBucketUpdateRate(newRPS float64) { - a.tokenBucketRefill() - a.fillRate = math.Max(newRPS, a.minFillRate) - a.tokenBucket.Resize(newRPS) -} - -func (a *adaptiveRateLimit) updateMeasuredRate() { - now := sdk.NowTime() - timeBucket := math.Floor(timeFloat64Seconds(now)*2.) / 2. - a.requestCount++ - - if timeBucket > a.lastTxRateBucket { - currentRate := float64(a.requestCount) / (timeBucket - a.lastTxRateBucket) - a.measuredTxRate = (currentRate * a.smooth) + (a.measuredTxRate * (1. - a.smooth)) - a.requestCount = 0 - a.lastTxRateBucket = timeBucket - } -} - -func (a *adaptiveRateLimit) tokenBucketRefill() { - now := sdk.NowTime() - if a.lastRefilled.IsZero() { - a.lastRefilled = now - return - } - - fillAmount := secondsFloat64(now.Sub(a.lastRefilled)) * a.fillRate - a.tokenBucket.Refund(fillAmount) - a.lastRefilled = now -} - -func float64Seconds(v float64) time.Duration { - return time.Duration(v * float64(time.Second)) -} - -func secondsFloat64(v time.Duration) float64 { - return float64(v) / float64(time.Second) -} - -func timeFloat64Seconds(v time.Time) float64 { - return float64(v.UnixNano()) / float64(time.Second) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go deleted file mode 100644 index 052723e8e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go +++ /dev/null @@ -1,83 +0,0 @@ -package retry - -import ( - "math" - "sync" -) - -// adaptiveTokenBucket provides a concurrency safe utility for adding and -// removing tokens from the available token bucket. -type adaptiveTokenBucket struct { - remainingTokens float64 - maxCapacity float64 - minCapacity float64 - mu sync.Mutex -} - -// newAdaptiveTokenBucket returns an initialized adaptiveTokenBucket with the -// capacity specified. -func newAdaptiveTokenBucket(i float64) *adaptiveTokenBucket { - return &adaptiveTokenBucket{ - remainingTokens: i, - maxCapacity: i, - minCapacity: 1, - } -} - -// Retrieve attempts to reduce the available tokens by the amount requested. If -// there are tokens available true will be returned along with the number of -// available tokens remaining. If amount requested is larger than the available -// capacity, false will be returned along with the available capacity. If the -// amount is less than the available capacity, the capacity will be reduced by -// that amount, and the remaining capacity and true will be returned. -func (t *adaptiveTokenBucket) Retrieve(amount float64) (available float64, retrieved bool) { - t.mu.Lock() - defer t.mu.Unlock() - - if amount > t.remainingTokens { - return t.remainingTokens, false - } - - t.remainingTokens -= amount - return t.remainingTokens, true -} - -// Refund returns the amount of tokens back to the available token bucket, up -// to the initial capacity. -func (t *adaptiveTokenBucket) Refund(amount float64) { - t.mu.Lock() - defer t.mu.Unlock() - - // Capacity cannot exceed max capacity. - t.remainingTokens = math.Min(t.remainingTokens+amount, t.maxCapacity) -} - -// Capacity returns the maximum capacity of tokens that the bucket could -// contain. -func (t *adaptiveTokenBucket) Capacity() float64 { - t.mu.Lock() - defer t.mu.Unlock() - - return t.maxCapacity -} - -// Remaining returns the number of tokens that remaining in the bucket. -func (t *adaptiveTokenBucket) Remaining() float64 { - t.mu.Lock() - defer t.mu.Unlock() - - return t.remainingTokens -} - -// Resize adjusts the size of the token bucket. Returns the capacity remaining. -func (t *adaptiveTokenBucket) Resize(size float64) float64 { - t.mu.Lock() - defer t.mu.Unlock() - - t.maxCapacity = math.Max(size, t.minCapacity) - - // Capacity needs to be capped at max capacity, if max size reduced. - t.remainingTokens = math.Min(t.remainingTokens, t.maxCapacity) - - return t.remainingTokens -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go deleted file mode 100644 index bfa5bf7d1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go +++ /dev/null @@ -1,51 +0,0 @@ -package retry - -import ( - "context" - - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" -) - -type attemptMetrics struct { - Attempts metrics.Int64Counter - Errors metrics.Int64Counter - - AttemptDuration metrics.Float64Histogram -} - -func newAttemptMetrics(meter metrics.Meter) (*attemptMetrics, error) { - m := &attemptMetrics{} - var err error - - m.Attempts, err = meter.Int64Counter("client.call.attempts", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "{attempt}" - o.Description = "The number of attempts for an individual operation" - }) - if err != nil { - return nil, err - } - m.Errors, err = meter.Int64Counter("client.call.errors", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "{error}" - o.Description = "The number of errors for an operation" - }) - if err != nil { - return nil, err - } - m.AttemptDuration, err = meter.Float64Histogram("client.call.attempt_duration", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "The time it takes to connect to the service, send the request, and get back HTTP status code and headers (including time queued waiting to be sent)" - }) - if err != nil { - return nil, err - } - - return m, nil -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go deleted file mode 100644 index 3a08ebe0a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go +++ /dev/null @@ -1,80 +0,0 @@ -// Package retry provides interfaces and implementations for SDK request retry behavior. -// -// # Retryer Interface and Implementations -// -// This package defines Retryer interface that is used to either implement custom retry behavior -// or to extend the existing retry implementations provided by the SDK. This package provides a single -// retry implementation: Standard. -// -// # Standard -// -// Standard is the default retryer implementation used by service clients. The standard retryer is a rate limited -// retryer that has a configurable max attempts to limit the number of retry attempts when a retryable error occurs. -// In addition, the retryer uses a configurable token bucket to rate limit the retry attempts across the client, -// and uses an additional delay policy to limit the time between a requests subsequent attempts. -// -// By default the standard retryer uses the DefaultRetryables slice of IsErrorRetryable types to determine whether -// a given error is retryable. By default this list of retryables includes the following: -// - Retrying errors that implement the RetryableError method, and return true. -// - Connection Errors -// - Errors that implement a ConnectionError, Temporary, or Timeout method that return true. -// - Connection Reset Errors. -// - net.OpErr types that are dialing errors or are temporary. -// - HTTP Status Codes: 500, 502, 503, and 504. -// - API Error Codes -// - RequestTimeout, RequestTimeoutException -// - Throttling, ThrottlingException, ThrottledException, RequestThrottledException, TooManyRequestsException, -// RequestThrottled, SlowDown, EC2ThrottledException -// - ProvisionedThroughputExceededException, RequestLimitExceeded, BandwidthLimitExceeded, LimitExceededException -// - TransactionInProgressException, PriorRequestNotComplete -// -// The standard retryer will not retry a request in the event if the context associated with the request -// has been cancelled. Applications must handle this case explicitly if they wish to retry with a different context -// value. -// -// You can configure the standard retryer implementation to fit your applications by constructing a standard retryer -// using the NewStandard function, and providing one more functional argument that mutate the StandardOptions -// structure. StandardOptions provides the ability to modify the token bucket rate limiter, retryable error conditions, -// and the retry delay policy. -// -// For example to modify the default retry attempts for the standard retryer: -// -// // configure the custom retryer -// customRetry := retry.NewStandard(func(o *retry.StandardOptions) { -// o.MaxAttempts = 5 -// }) -// -// // create a service client with the retryer -// s3.NewFromConfig(cfg, func(o *s3.Options) { -// o.Retryer = customRetry -// }) -// -// # Utilities -// -// A number of package functions have been provided to easily wrap retryer implementations in an implementation agnostic -// way. These are: -// -// AddWithErrorCodes - Provides the ability to add additional API error codes that should be considered retryable -// in addition to those considered retryable by the provided retryer. -// -// AddWithMaxAttempts - Provides the ability to set the max number of attempts for retrying a request by wrapping -// a retryer implementation. -// -// AddWithMaxBackoffDelay - Provides the ability to set the max back off delay that can occur before retrying a -// request by wrapping a retryer implementation. -// -// The following package functions have been provided to easily satisfy different retry interfaces to further customize -// a given retryer's behavior: -// -// BackoffDelayerFunc - Can be used to wrap a function to satisfy the BackoffDelayer interface. For example, -// you can use this method to easily create custom back off policies to be used with the -// standard retryer. -// -// IsErrorRetryableFunc - Can be used to wrap a function to satisfy the IsErrorRetryable interface. For example, -// this can be used to extend the standard retryer to add additional logic to determine if an -// error should be retried. -// -// IsErrorTimeoutFunc - Can be used to wrap a function to satisfy IsErrorTimeout interface. For example, -// this can be used to extend the standard retryer to add additional logic to determine if an -// error should be considered a timeout. -package retry diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.go deleted file mode 100644 index 3e432eefe..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.go +++ /dev/null @@ -1,20 +0,0 @@ -package retry - -import "fmt" - -// MaxAttemptsError provides the error when the maximum number of attempts have -// been exceeded. -type MaxAttemptsError struct { - Attempt int - Err error -} - -func (e *MaxAttemptsError) Error() string { - return fmt.Sprintf("exceeded maximum number of attempts, %d, %v", e.Attempt, e.Err) -} - -// Unwrap returns the nested error causing the max attempts error. Provides the -// implementation for errors.Is and errors.As to unwrap nested errors. -func (e *MaxAttemptsError) Unwrap() error { - return e.Err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.go deleted file mode 100644 index c266996de..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.go +++ /dev/null @@ -1,49 +0,0 @@ -package retry - -import ( - "math" - "time" - - "github.com/aws/aws-sdk-go-v2/internal/rand" - "github.com/aws/aws-sdk-go-v2/internal/timeconv" -) - -// ExponentialJitterBackoff provides backoff delays with jitter based on the -// number of attempts. -type ExponentialJitterBackoff struct { - maxBackoff time.Duration - // precomputed number of attempts needed to reach max backoff. - maxBackoffAttempts float64 - - randFloat64 func() (float64, error) -} - -// NewExponentialJitterBackoff returns an ExponentialJitterBackoff configured -// for the max backoff. -func NewExponentialJitterBackoff(maxBackoff time.Duration) *ExponentialJitterBackoff { - return &ExponentialJitterBackoff{ - maxBackoff: maxBackoff, - maxBackoffAttempts: math.Log2( - float64(maxBackoff) / float64(time.Second)), - randFloat64: rand.CryptoRandFloat64, - } -} - -// BackoffDelay returns the duration to wait before the next attempt should be -// made. Returns an error if unable get a duration. -func (j *ExponentialJitterBackoff) BackoffDelay(attempt int, err error) (time.Duration, error) { - if attempt > int(j.maxBackoffAttempts) { - return j.maxBackoff, nil - } - - b, err := j.randFloat64() - if err != nil { - return 0, err - } - - // [0.0, 1.0) * 2 ^ attempts - ri := int64(1 << uint64(attempt)) - delaySeconds := b * float64(ri) - - return timeconv.FloatSecondsDur(delaySeconds), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.go deleted file mode 100644 index 7a3f18301..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.go +++ /dev/null @@ -1,52 +0,0 @@ -package retry - -import ( - awsmiddle "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" -) - -// attemptResultsKey is a metadata accessor key to retrieve metadata -// for all request attempts. -type attemptResultsKey struct { -} - -// GetAttemptResults retrieves attempts results from middleware metadata. -func GetAttemptResults(metadata middleware.Metadata) (AttemptResults, bool) { - m, ok := metadata.Get(attemptResultsKey{}).(AttemptResults) - return m, ok -} - -// AttemptResults represents struct containing metadata returned by all request attempts. -type AttemptResults struct { - - // Results is a slice consisting attempt result from all request attempts. - // Results are stored in order request attempt is made. - Results []AttemptResult -} - -// AttemptResult represents attempt result returned by a single request attempt. -type AttemptResult struct { - - // Err is the error if received for the request attempt. - Err error - - // Retryable denotes if request may be retried. This states if an - // error is considered retryable. - Retryable bool - - // Retried indicates if this request was retried. - Retried bool - - // ResponseMetadata is any existing metadata passed via the response middlewares. - ResponseMetadata middleware.Metadata -} - -// addAttemptResults adds attempt results to middleware metadata -func addAttemptResults(metadata *middleware.Metadata, v AttemptResults) { - metadata.Set(attemptResultsKey{}, v) -} - -// GetRawResponse returns raw response recorded for the attempt result -func (a AttemptResult) GetRawResponse() interface{} { - return awsmiddle.GetRawResponse(a.ResponseMetadata) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go deleted file mode 100644 index 5549922ab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go +++ /dev/null @@ -1,418 +0,0 @@ -package retry - -import ( - "context" - "errors" - "fmt" - "strconv" - "strings" - "time" - - internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" - "github.com/aws/smithy-go" - - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddle "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - smithymiddle "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - "github.com/aws/smithy-go/transport/http" -) - -// RequestCloner is a function that can take an input request type and clone -// the request for use in a subsequent retry attempt. -type RequestCloner func(interface{}) interface{} - -type retryMetadata struct { - AttemptNum int - AttemptTime time.Time - MaxAttempts int - AttemptClockSkew time.Duration -} - -// Attempt is a Smithy Finalize middleware that handles retry attempts using -// the provided Retryer implementation. -type Attempt struct { - // Enable the logging of retry attempts performed by the SDK. This will - // include logging retry attempts, unretryable errors, and when max - // attempts are reached. - LogAttempts bool - - // A Meter instance for recording retry-related metrics. - OperationMeter metrics.Meter - - retryer aws.RetryerV2 - requestCloner RequestCloner -} - -// define the threshold at which we will consider certain kind of errors to be probably -// caused by clock skew -const skewThreshold = 4 * time.Minute - -// NewAttemptMiddleware returns a new Attempt retry middleware. -func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt { - m := &Attempt{ - retryer: wrapAsRetryerV2(retryer), - requestCloner: requestCloner, - } - for _, fn := range optFns { - fn(m) - } - if m.OperationMeter == nil { - m.OperationMeter = metrics.NopMeterProvider{}.Meter("") - } - - return m -} - -// ID returns the middleware identifier -func (r *Attempt) ID() string { return "Retry" } - -func (r Attempt) logf(logger logging.Logger, classification logging.Classification, format string, v ...interface{}) { - if !r.LogAttempts { - return - } - logger.Logf(classification, format, v...) -} - -// HandleFinalize utilizes the provider Retryer implementation to attempt -// retries over the next handler -func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( - out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, -) { - var attemptNum int - var attemptClockSkew time.Duration - var attemptResults AttemptResults - - maxAttempts := r.retryer.MaxAttempts() - releaseRetryToken := nopRelease - - retryMetrics, err := newAttemptMetrics(r.OperationMeter) - if err != nil { - return out, metadata, err - } - - for { - attemptNum++ - attemptInput := in - attemptInput.Request = r.requestCloner(attemptInput.Request) - - // Record the metadata for the for attempt being started. - attemptCtx := setRetryMetadata(ctx, retryMetadata{ - AttemptNum: attemptNum, - AttemptTime: sdk.NowTime().UTC(), - MaxAttempts: maxAttempts, - AttemptClockSkew: attemptClockSkew, - }) - - // Setting clock skew to be used on other context (like signing) - ctx = internalcontext.SetAttemptSkewContext(ctx, attemptClockSkew) - - var attemptResult AttemptResult - - attemptCtx, span := tracing.StartSpan(attemptCtx, "Attempt", func(o *tracing.SpanOptions) { - o.Properties.Set("operation.attempt", attemptNum) - }) - retryMetrics.Attempts.Add(ctx, 1, withOperationMetadata(ctx)) - - start := sdk.NowTime() - out, attemptResult, releaseRetryToken, err = r.handleAttempt(attemptCtx, attemptInput, releaseRetryToken, next) - elapsed := sdk.NowTime().Sub(start) - - retryMetrics.AttemptDuration.Record(ctx, float64(elapsed)/1e9, withOperationMetadata(ctx)) - if err != nil { - retryMetrics.Errors.Add(ctx, 1, withOperationMetadata(ctx), func(o *metrics.RecordMetricOptions) { - o.Properties.Set("exception.type", errorType(err)) - }) - } - - span.End() - - attemptClockSkew, _ = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata) - - // AttemptResult Retried states that the attempt was not successful, and - // should be retried. - shouldRetry := attemptResult.Retried - - // Add attempt metadata to list of all attempt metadata - attemptResults.Results = append(attemptResults.Results, attemptResult) - - if !shouldRetry { - // Ensure the last response's metadata is used as the bases for result - // metadata returned by the stack. The Slice of attempt results - // will be added to this cloned metadata. - metadata = attemptResult.ResponseMetadata.Clone() - - break - } - } - - addAttemptResults(&metadata, attemptResults) - return out, metadata, err -} - -// handleAttempt handles an individual request attempt. -func (r *Attempt) handleAttempt( - ctx context.Context, in smithymiddle.FinalizeInput, releaseRetryToken func(error) error, next smithymiddle.FinalizeHandler, -) ( - out smithymiddle.FinalizeOutput, attemptResult AttemptResult, _ func(error) error, err error, -) { - defer func() { - attemptResult.Err = err - }() - - // Short circuit if this attempt never can succeed because the context is - // canceled. This reduces the chance of token pools being modified for - // attempts that will not be made - select { - case <-ctx.Done(): - return out, attemptResult, nopRelease, ctx.Err() - default: - } - - //------------------------------ - // Get Attempt Token - //------------------------------ - releaseAttemptToken, err := r.retryer.GetAttemptToken(ctx) - if err != nil { - return out, attemptResult, nopRelease, fmt.Errorf( - "failed to get retry Send token, %w", err) - } - - //------------------------------ - // Send Attempt - //------------------------------ - logger := smithymiddle.GetLogger(ctx) - service, operation := awsmiddle.GetServiceID(ctx), awsmiddle.GetOperationName(ctx) - retryMetadata, _ := getRetryMetadata(ctx) - attemptNum := retryMetadata.AttemptNum - maxAttempts := retryMetadata.MaxAttempts - - // Following attempts must ensure the request payload stream starts in a - // rewound state. - if attemptNum > 1 { - if rewindable, ok := in.Request.(interface{ RewindStream() error }); ok { - if rewindErr := rewindable.RewindStream(); rewindErr != nil { - return out, attemptResult, nopRelease, fmt.Errorf( - "failed to rewind transport stream for retry, %w", rewindErr) - } - } - - r.logf(logger, logging.Debug, "retrying request %s/%s, attempt %d", - service, operation, attemptNum) - } - - var metadata smithymiddle.Metadata - out, metadata, err = next.HandleFinalize(ctx, in) - attemptResult.ResponseMetadata = metadata - - //------------------------------ - // Bookkeeping - //------------------------------ - // Release the retry token based on the state of the attempt's error (if any). - if releaseError := releaseRetryToken(err); releaseError != nil && err != nil { - return out, attemptResult, nopRelease, fmt.Errorf( - "failed to release retry token after request error, %w", err) - } - // Release the attempt token based on the state of the attempt's error (if any). - if releaseError := releaseAttemptToken(err); releaseError != nil && err != nil { - return out, attemptResult, nopRelease, fmt.Errorf( - "failed to release initial token after request error, %w", err) - } - // If there was no error making the attempt, nothing further to do. There - // will be nothing to retry. - if err == nil { - return out, attemptResult, nopRelease, err - } - - err = wrapAsClockSkew(ctx, err) - - //------------------------------ - // Is Retryable and Should Retry - //------------------------------ - // If the attempt failed with an unretryable error, nothing further to do - // but return, and inform the caller about the terminal failure. - retryable := r.retryer.IsErrorRetryable(err) - if !retryable { - r.logf(logger, logging.Debug, "request failed with unretryable error %v", err) - return out, attemptResult, nopRelease, err - } - - // set retryable to true - attemptResult.Retryable = true - - // Once the maximum number of attempts have been exhausted there is nothing - // further to do other than inform the caller about the terminal failure. - if maxAttempts > 0 && attemptNum >= maxAttempts { - r.logf(logger, logging.Debug, "max retry attempts exhausted, max %d", maxAttempts) - err = &MaxAttemptsError{ - Attempt: attemptNum, - Err: err, - } - return out, attemptResult, nopRelease, err - } - - //------------------------------ - // Get Retry (aka Retry Quota) Token - //------------------------------ - // Get a retry token that will be released after the - releaseRetryToken, retryTokenErr := r.retryer.GetRetryToken(ctx, err) - if retryTokenErr != nil { - return out, attemptResult, nopRelease, errors.Join(err, retryTokenErr) - } - - //------------------------------ - // Retry Delay and Sleep - //------------------------------ - // Get the retry delay before another attempt can be made, and sleep for - // that time. Potentially early exist if the sleep is canceled via the - // context. - retryDelay, reqErr := r.retryer.RetryDelay(attemptNum, err) - if reqErr != nil { - return out, attemptResult, releaseRetryToken, reqErr - } - if reqErr = sdk.SleepWithContext(ctx, retryDelay); reqErr != nil { - err = &aws.RequestCanceledError{Err: reqErr} - return out, attemptResult, releaseRetryToken, err - } - - // The request should be re-attempted. - attemptResult.Retried = true - - return out, attemptResult, releaseRetryToken, err -} - -// errors that, if detected when we know there's a clock skew, -// can be retried and have a high chance of success -var possibleSkewCodes = map[string]struct{}{ - "InvalidSignatureException": {}, - "SignatureDoesNotMatch": {}, - "AuthFailure": {}, -} - -var definiteSkewCodes = map[string]struct{}{ - "RequestExpired": {}, - "RequestInTheFuture": {}, - "RequestTimeTooSkewed": {}, -} - -// wrapAsClockSkew checks if this error could be related to a clock skew -// error and if so, wrap the error. -func wrapAsClockSkew(ctx context.Context, err error) error { - var v interface{ ErrorCode() string } - if !errors.As(err, &v) { - return err - } - if _, ok := definiteSkewCodes[v.ErrorCode()]; ok { - return &retryableClockSkewError{Err: err} - } - _, isPossibleSkewCode := possibleSkewCodes[v.ErrorCode()] - if skew := internalcontext.GetAttemptSkewContext(ctx); skew > skewThreshold && isPossibleSkewCode { - return &retryableClockSkewError{Err: err} - } - return err -} - -// MetricsHeader attaches SDK request metric header for retries to the transport -type MetricsHeader struct{} - -// ID returns the middleware identifier -func (r *MetricsHeader) ID() string { - return "RetryMetricsHeader" -} - -// HandleFinalize attaches the SDK request metric header to the transport layer -func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( - out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, -) { - retryMetadata, _ := getRetryMetadata(ctx) - - const retryMetricHeader = "Amz-Sdk-Request" - var parts []string - - parts = append(parts, "attempt="+strconv.Itoa(retryMetadata.AttemptNum)) - if retryMetadata.MaxAttempts != 0 { - parts = append(parts, "max="+strconv.Itoa(retryMetadata.MaxAttempts)) - } - - var ttl time.Time - if deadline, ok := ctx.Deadline(); ok { - ttl = deadline - } - - // Only append the TTL if it can be determined. - if !ttl.IsZero() && retryMetadata.AttemptClockSkew > 0 { - const unixTimeFormat = "20060102T150405Z" - ttl = ttl.Add(retryMetadata.AttemptClockSkew) - parts = append(parts, "ttl="+ttl.Format(unixTimeFormat)) - } - - switch req := in.Request.(type) { - case *http.Request: - req.Header[retryMetricHeader] = append(req.Header[retryMetricHeader][:0], strings.Join(parts, "; ")) - default: - return out, metadata, fmt.Errorf("unknown transport type %T", req) - } - - return next.HandleFinalize(ctx, in) -} - -type retryMetadataKey struct{} - -// getRetryMetadata retrieves retryMetadata from the context and a bool -// indicating if it was set. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func getRetryMetadata(ctx context.Context) (metadata retryMetadata, ok bool) { - metadata, ok = smithymiddle.GetStackValue(ctx, retryMetadataKey{}).(retryMetadata) - return metadata, ok -} - -// setRetryMetadata sets the retryMetadata on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func setRetryMetadata(ctx context.Context, metadata retryMetadata) context.Context { - return smithymiddle.WithStackValue(ctx, retryMetadataKey{}, metadata) -} - -// AddRetryMiddlewaresOptions is the set of options that can be passed to -// AddRetryMiddlewares for configuring retry associated middleware. -type AddRetryMiddlewaresOptions struct { - Retryer aws.Retryer - - // Enable the logging of retry attempts performed by the SDK. This will - // include logging retry attempts, unretryable errors, and when max - // attempts are reached. - LogRetryAttempts bool -} - -// AddRetryMiddlewares adds retry middleware to operation middleware stack -func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresOptions) error { - attempt := NewAttemptMiddleware(options.Retryer, http.RequestCloner, func(middleware *Attempt) { - middleware.LogAttempts = options.LogRetryAttempts - }) - - // index retry to before signing, if signing exists - if err := stack.Finalize.Insert(attempt, "Signing", smithymiddle.Before); err != nil { - return err - } - - if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil { - return err - } - return nil -} - -// Determines the value of exception.type for metrics purposes. We prefer an -// API-specific error code, otherwise it's just the Go type for the value. -func errorType(err error) string { - var terr smithy.APIError - if errors.As(err, &terr) { - return terr.ErrorCode() - } - return fmt.Sprintf("%T", err) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go deleted file mode 100644 index af81635b3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go +++ /dev/null @@ -1,90 +0,0 @@ -package retry - -import ( - "context" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// AddWithErrorCodes returns a Retryer with additional error codes considered -// for determining if the error should be retried. -func AddWithErrorCodes(r aws.Retryer, codes ...string) aws.Retryer { - retryable := &RetryableErrorCode{ - Codes: map[string]struct{}{}, - } - for _, c := range codes { - retryable.Codes[c] = struct{}{} - } - - return &withIsErrorRetryable{ - RetryerV2: wrapAsRetryerV2(r), - Retryable: retryable, - } -} - -type withIsErrorRetryable struct { - aws.RetryerV2 - Retryable IsErrorRetryable -} - -func (r *withIsErrorRetryable) IsErrorRetryable(err error) bool { - if v := r.Retryable.IsErrorRetryable(err); v != aws.UnknownTernary { - return v.Bool() - } - return r.RetryerV2.IsErrorRetryable(err) -} - -// AddWithMaxAttempts returns a Retryer with MaxAttempts set to the value -// specified. -func AddWithMaxAttempts(r aws.Retryer, max int) aws.Retryer { - return &withMaxAttempts{ - RetryerV2: wrapAsRetryerV2(r), - Max: max, - } -} - -type withMaxAttempts struct { - aws.RetryerV2 - Max int -} - -func (w *withMaxAttempts) MaxAttempts() int { - return w.Max -} - -// AddWithMaxBackoffDelay returns a retryer wrapping the passed in retryer -// overriding the RetryDelay behavior for a alternate minimum initial backoff -// delay. -func AddWithMaxBackoffDelay(r aws.Retryer, delay time.Duration) aws.Retryer { - return &withMaxBackoffDelay{ - RetryerV2: wrapAsRetryerV2(r), - backoff: NewExponentialJitterBackoff(delay), - } -} - -type withMaxBackoffDelay struct { - aws.RetryerV2 - backoff *ExponentialJitterBackoff -} - -func (r *withMaxBackoffDelay) RetryDelay(attempt int, err error) (time.Duration, error) { - return r.backoff.BackoffDelay(attempt, err) -} - -type wrappedAsRetryerV2 struct { - aws.Retryer -} - -func wrapAsRetryerV2(r aws.Retryer) aws.RetryerV2 { - v, ok := r.(aws.RetryerV2) - if !ok { - v = wrappedAsRetryerV2{Retryer: r} - } - - return v -} - -func (w wrappedAsRetryerV2) GetAttemptToken(context.Context) (func(error) error, error) { - return w.Retryer.GetInitialToken(), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go deleted file mode 100644 index 1b485f998..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go +++ /dev/null @@ -1,228 +0,0 @@ -package retry - -import ( - "errors" - "fmt" - "net" - "net/url" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// IsErrorRetryable provides the interface of an implementation to determine if -// a error as the result of an operation is retryable. -type IsErrorRetryable interface { - IsErrorRetryable(error) aws.Ternary -} - -// IsErrorRetryables is a collection of checks to determine of the error is -// retryable. Iterates through the checks and returns the state of retryable -// if any check returns something other than unknown. -type IsErrorRetryables []IsErrorRetryable - -// IsErrorRetryable returns if the error is retryable if any of the checks in -// the list return a value other than unknown. -func (r IsErrorRetryables) IsErrorRetryable(err error) aws.Ternary { - for _, re := range r { - if v := re.IsErrorRetryable(err); v != aws.UnknownTernary { - return v - } - } - return aws.UnknownTernary -} - -// IsErrorRetryableFunc wraps a function with the IsErrorRetryable interface. -type IsErrorRetryableFunc func(error) aws.Ternary - -// IsErrorRetryable returns if the error is retryable. -func (fn IsErrorRetryableFunc) IsErrorRetryable(err error) aws.Ternary { - return fn(err) -} - -// RetryableError is an IsErrorRetryable implementation which uses the -// optional interface Retryable on the error value to determine if the error is -// retryable. -type RetryableError struct{} - -// IsErrorRetryable returns if the error is retryable if it satisfies the -// Retryable interface, and returns if the attempt should be retried. -func (RetryableError) IsErrorRetryable(err error) aws.Ternary { - var v interface{ RetryableError() bool } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - return aws.BoolTernary(v.RetryableError()) -} - -// NoRetryCanceledError detects if the error was an request canceled error and -// returns if so. -type NoRetryCanceledError struct{} - -// IsErrorRetryable returns the error is not retryable if the request was -// canceled. -func (NoRetryCanceledError) IsErrorRetryable(err error) aws.Ternary { - var v interface{ CanceledError() bool } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - if v.CanceledError() { - return aws.FalseTernary - } - return aws.UnknownTernary -} - -// RetryableConnectionError determines if the underlying error is an HTTP -// connection and returns if it should be retried. -// -// Includes errors such as connection reset, connection refused, net dial, -// temporary, and timeout errors. -type RetryableConnectionError struct{} - -// IsErrorRetryable returns if the error is caused by and HTTP connection -// error, and should be retried. -func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary { - if err == nil { - return aws.UnknownTernary - } - var retryable bool - - var conErr interface{ ConnectionError() bool } - var tempErr interface{ Temporary() bool } - var timeoutErr interface{ Timeout() bool } - var urlErr *url.Error - var netOpErr *net.OpError - var dnsError *net.DNSError - - if errors.As(err, &dnsError) { - // NXDOMAIN errors should not be retried - if dnsError.IsNotFound { - return aws.BoolTernary(false) - } - - // if !dnsError.Temporary(), error may or may not be temporary, - // (i.e. !Temporary() =/=> !retryable) so we should fall through to - // remaining checks - if dnsError.Temporary() { - return aws.BoolTernary(true) - } - } - - switch { - case errors.As(err, &conErr) && conErr.ConnectionError(): - retryable = true - - case strings.Contains(err.Error(), "use of closed network connection"): - fallthrough - case strings.Contains(err.Error(), "connection reset"): - // The errors "connection reset" and "use of closed network connection" - // are effectively the same. It appears to be the difference between - // sync and async read of TCP RST in the stdlib's net.Conn read loop. - // see #2737 - retryable = true - - case errors.As(err, &urlErr): - // Refused connections should be retried as the service may not yet be - // running on the port. Go TCP dial considers refused connections as - // not temporary. - if strings.Contains(urlErr.Error(), "connection refused") { - retryable = true - } else { - return r.IsErrorRetryable(errors.Unwrap(urlErr)) - } - - case errors.As(err, &netOpErr): - // Network dial, or temporary network errors are always retryable. - if strings.EqualFold(netOpErr.Op, "dial") || netOpErr.Temporary() { - retryable = true - } else { - return r.IsErrorRetryable(errors.Unwrap(netOpErr)) - } - - case errors.As(err, &tempErr) && tempErr.Temporary(): - // Fallback to the generic temporary check, with temporary errors - // retryable. - retryable = true - - case errors.As(err, &timeoutErr) && timeoutErr.Timeout(): - // Fallback to the generic timeout check, with timeout errors - // retryable. - retryable = true - - default: - return aws.UnknownTernary - } - - return aws.BoolTernary(retryable) - -} - -// RetryableHTTPStatusCode provides a IsErrorRetryable based on HTTP status -// codes. -type RetryableHTTPStatusCode struct { - Codes map[int]struct{} -} - -// IsErrorRetryable return if the passed in error is retryable based on the -// HTTP status code. -func (r RetryableHTTPStatusCode) IsErrorRetryable(err error) aws.Ternary { - var v interface{ HTTPStatusCode() int } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - _, ok := r.Codes[v.HTTPStatusCode()] - if !ok { - return aws.UnknownTernary - } - - return aws.TrueTernary -} - -// RetryableErrorCode determines if an attempt should be retried based on the -// API error code. -type RetryableErrorCode struct { - Codes map[string]struct{} -} - -// IsErrorRetryable return if the error is retryable based on the error codes. -// Returns unknown if the error doesn't have a code or it is unknown. -func (r RetryableErrorCode) IsErrorRetryable(err error) aws.Ternary { - var v interface{ ErrorCode() string } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - _, ok := r.Codes[v.ErrorCode()] - if !ok { - return aws.UnknownTernary - } - - return aws.TrueTernary -} - -// retryableClockSkewError marks errors that can be caused by clock skew -// (difference between server time and client time). -// This is returned when there's certain confidence that adjusting the client time -// could allow a retry to succeed -type retryableClockSkewError struct{ Err error } - -func (e *retryableClockSkewError) Error() string { - return fmt.Sprintf("Probable clock skew error: %v", e.Err) -} - -// Unwrap returns the wrapped error. -func (e *retryableClockSkewError) Unwrap() error { - return e.Err -} - -// RetryableError allows the retryer to retry this request -func (e *retryableClockSkewError) RetryableError() bool { - return true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go deleted file mode 100644 index d5ea93222..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go +++ /dev/null @@ -1,269 +0,0 @@ -package retry - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/aws/ratelimit" -) - -// BackoffDelayer provides the interface for determining the delay to before -// another request attempt, that previously failed. -type BackoffDelayer interface { - BackoffDelay(attempt int, err error) (time.Duration, error) -} - -// BackoffDelayerFunc provides a wrapper around a function to determine the -// backoff delay of an attempt retry. -type BackoffDelayerFunc func(int, error) (time.Duration, error) - -// BackoffDelay returns the delay before attempt to retry a request. -func (fn BackoffDelayerFunc) BackoffDelay(attempt int, err error) (time.Duration, error) { - return fn(attempt, err) -} - -const ( - // DefaultMaxAttempts is the maximum of attempts for an API request - DefaultMaxAttempts int = 3 - - // DefaultMaxBackoff is the maximum back off delay between attempts - DefaultMaxBackoff time.Duration = 20 * time.Second -) - -// Default retry token quota values. -const ( - DefaultRetryRateTokens uint = 500 - DefaultRetryCost uint = 5 - DefaultRetryTimeoutCost uint = 10 - DefaultNoRetryIncrement uint = 1 -) - -// DefaultRetryableHTTPStatusCodes is the default set of HTTP status codes the SDK -// should consider as retryable errors. -var DefaultRetryableHTTPStatusCodes = map[int]struct{}{ - 500: {}, - 502: {}, - 503: {}, - 504: {}, -} - -// DefaultRetryableErrorCodes provides the set of API error codes that should -// be retried. -var DefaultRetryableErrorCodes = map[string]struct{}{ - "RequestTimeout": {}, - "RequestTimeoutException": {}, -} - -// DefaultThrottleErrorCodes provides the set of API error codes that are -// considered throttle errors. -var DefaultThrottleErrorCodes = map[string]struct{}{ - "Throttling": {}, - "ThrottlingException": {}, - "ThrottledException": {}, - "RequestThrottledException": {}, - "TooManyRequestsException": {}, - "ProvisionedThroughputExceededException": {}, - "TransactionInProgressException": {}, - "RequestLimitExceeded": {}, - "BandwidthLimitExceeded": {}, - "LimitExceededException": {}, - "RequestThrottled": {}, - "SlowDown": {}, - "PriorRequestNotComplete": {}, - "EC2ThrottledException": {}, -} - -// DefaultRetryables provides the set of retryable checks that are used by -// default. -var DefaultRetryables = []IsErrorRetryable{ - NoRetryCanceledError{}, - RetryableError{}, - RetryableConnectionError{}, - RetryableHTTPStatusCode{ - Codes: DefaultRetryableHTTPStatusCodes, - }, - RetryableErrorCode{ - Codes: DefaultRetryableErrorCodes, - }, - RetryableErrorCode{ - Codes: DefaultThrottleErrorCodes, - }, -} - -// DefaultTimeouts provides the set of timeout checks that are used by default. -var DefaultTimeouts = []IsErrorTimeout{ - TimeouterError{}, -} - -// StandardOptions provides the functional options for configuring the standard -// retryable, and delay behavior. -type StandardOptions struct { - // Maximum number of attempts that should be made. - MaxAttempts int - - // MaxBackoff duration between retried attempts. - MaxBackoff time.Duration - - // Provides the backoff strategy the retryer will use to determine the - // delay between retry attempts. - Backoff BackoffDelayer - - // Set of strategies to determine if the attempt should be retried based on - // the error response received. - // - // It is safe to append to this list in NewStandard's functional options. - Retryables []IsErrorRetryable - - // Set of strategies to determine if the attempt failed due to a timeout - // error. - // - // It is safe to append to this list in NewStandard's functional options. - Timeouts []IsErrorTimeout - - // Provides the rate limiting strategy for rate limiting attempt retries - // across all attempts the retryer is being used with. - // - // A RateLimiter operates as a token bucket with a set capacity, where - // attempt failures events consume tokens. A retry attempt that attempts to - // consume more tokens than what's available results in operation failure. - // The default implementation is parameterized as follows: - // - a capacity of 500 (DefaultRetryRateTokens) - // - a retry caused by a timeout costs 10 tokens (DefaultRetryCost) - // - a retry caused by other errors costs 5 tokens (DefaultRetryTimeoutCost) - // - an operation that succeeds on the 1st attempt adds 1 token (DefaultNoRetryIncrement) - // - // You can disable rate limiting by setting this field to ratelimit.None. - RateLimiter RateLimiter - - // The cost to deduct from the RateLimiter's token bucket per retry. - RetryCost uint - - // The cost to deduct from the RateLimiter's token bucket per retry caused - // by timeout error. - RetryTimeoutCost uint - - // The cost to payback to the RateLimiter's token bucket for successful - // attempts. - NoRetryIncrement uint -} - -// RateLimiter provides the interface for limiting the rate of attempt retries -// allowed by the retryer. -type RateLimiter interface { - GetToken(ctx context.Context, cost uint) (releaseToken func() error, err error) - AddTokens(uint) error -} - -// Standard is the standard retry pattern for the SDK. It uses a set of -// retryable checks to determine of the failed attempt should be retried, and -// what retry delay should be used. -type Standard struct { - options StandardOptions - - timeout IsErrorTimeout - retryable IsErrorRetryable - backoff BackoffDelayer -} - -// NewStandard initializes a standard retry behavior with defaults that can be -// overridden via functional options. -func NewStandard(fnOpts ...func(*StandardOptions)) *Standard { - o := StandardOptions{ - MaxAttempts: DefaultMaxAttempts, - MaxBackoff: DefaultMaxBackoff, - Retryables: append([]IsErrorRetryable{}, DefaultRetryables...), - Timeouts: append([]IsErrorTimeout{}, DefaultTimeouts...), - - RateLimiter: ratelimit.NewTokenRateLimit(DefaultRetryRateTokens), - RetryCost: DefaultRetryCost, - RetryTimeoutCost: DefaultRetryTimeoutCost, - NoRetryIncrement: DefaultNoRetryIncrement, - } - for _, fn := range fnOpts { - fn(&o) - } - if o.MaxAttempts <= 0 { - o.MaxAttempts = DefaultMaxAttempts - } - - backoff := o.Backoff - if backoff == nil { - backoff = NewExponentialJitterBackoff(o.MaxBackoff) - } - - return &Standard{ - options: o, - backoff: backoff, - retryable: IsErrorRetryables(o.Retryables), - timeout: IsErrorTimeouts(o.Timeouts), - } -} - -// MaxAttempts returns the maximum number of attempts that can be made for a -// request before failing. -func (s *Standard) MaxAttempts() int { - return s.options.MaxAttempts -} - -// IsErrorRetryable returns if the error is can be retried or not. Should not -// consider the number of attempts made. -func (s *Standard) IsErrorRetryable(err error) bool { - return s.retryable.IsErrorRetryable(err).Bool() -} - -// RetryDelay returns the delay to use before another request attempt is made. -func (s *Standard) RetryDelay(attempt int, err error) (time.Duration, error) { - return s.backoff.BackoffDelay(attempt, err) -} - -// GetAttemptToken returns the token to be released after then attempt completes. -// The release token will add NoRetryIncrement to the RateLimiter token pool if -// the attempt was successful. If the attempt failed, nothing will be done. -func (s *Standard) GetAttemptToken(context.Context) (func(error) error, error) { - return s.GetInitialToken(), nil -} - -// GetInitialToken returns a token for adding the NoRetryIncrement to the -// RateLimiter token if the attempt completed successfully without error. -// -// InitialToken applies to result of the each attempt, including the first. -// Whereas the RetryToken applies to the result of subsequent attempts. -// -// Deprecated: use GetAttemptToken instead. -func (s *Standard) GetInitialToken() func(error) error { - return releaseToken(s.noRetryIncrement).release -} - -func (s *Standard) noRetryIncrement() error { - return s.options.RateLimiter.AddTokens(s.options.NoRetryIncrement) -} - -// GetRetryToken attempts to deduct the retry cost from the retry token pool. -// Returning the token release function, or error. -func (s *Standard) GetRetryToken(ctx context.Context, opErr error) (func(error) error, error) { - cost := s.options.RetryCost - - if s.timeout.IsErrorTimeout(opErr).Bool() { - cost = s.options.RetryTimeoutCost - } - - fn, err := s.options.RateLimiter.GetToken(ctx, cost) - if err != nil { - return nil, fmt.Errorf("failed to get rate limit token, %w", err) - } - - return releaseToken(fn).release, nil -} - -func nopRelease(error) error { return nil } - -type releaseToken func() error - -func (f releaseToken) release(err error) error { - if err != nil { - return nil - } - - return f() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go deleted file mode 100644 index c4b844d15..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go +++ /dev/null @@ -1,60 +0,0 @@ -package retry - -import ( - "errors" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// IsErrorThrottle provides the interface of an implementation to determine if -// a error response from an operation is a throttling error. -type IsErrorThrottle interface { - IsErrorThrottle(error) aws.Ternary -} - -// IsErrorThrottles is a collection of checks to determine of the error a -// throttle error. Iterates through the checks and returns the state of -// throttle if any check returns something other than unknown. -type IsErrorThrottles []IsErrorThrottle - -// IsErrorThrottle returns if the error is a throttle error if any of the -// checks in the list return a value other than unknown. -func (r IsErrorThrottles) IsErrorThrottle(err error) aws.Ternary { - for _, re := range r { - if v := re.IsErrorThrottle(err); v != aws.UnknownTernary { - return v - } - } - return aws.UnknownTernary -} - -// IsErrorThrottleFunc wraps a function with the IsErrorThrottle interface. -type IsErrorThrottleFunc func(error) aws.Ternary - -// IsErrorThrottle returns if the error is a throttle error. -func (fn IsErrorThrottleFunc) IsErrorThrottle(err error) aws.Ternary { - return fn(err) -} - -// ThrottleErrorCode determines if an attempt should be retried based on the -// API error code. -type ThrottleErrorCode struct { - Codes map[string]struct{} -} - -// IsErrorThrottle return if the error is a throttle error based on the error -// codes. Returns unknown if the error doesn't have a code or it is unknown. -func (r ThrottleErrorCode) IsErrorThrottle(err error) aws.Ternary { - var v interface{ ErrorCode() string } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - _, ok := r.Codes[v.ErrorCode()] - if !ok { - return aws.UnknownTernary - } - - return aws.TrueTernary -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.go deleted file mode 100644 index 3d47870d2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.go +++ /dev/null @@ -1,52 +0,0 @@ -package retry - -import ( - "errors" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// IsErrorTimeout provides the interface of an implementation to determine if -// a error matches. -type IsErrorTimeout interface { - IsErrorTimeout(err error) aws.Ternary -} - -// IsErrorTimeouts is a collection of checks to determine of the error is -// retryable. Iterates through the checks and returns the state of retryable -// if any check returns something other than unknown. -type IsErrorTimeouts []IsErrorTimeout - -// IsErrorTimeout returns if the error is retryable if any of the checks in -// the list return a value other than unknown. -func (ts IsErrorTimeouts) IsErrorTimeout(err error) aws.Ternary { - for _, t := range ts { - if v := t.IsErrorTimeout(err); v != aws.UnknownTernary { - return v - } - } - return aws.UnknownTernary -} - -// IsErrorTimeoutFunc wraps a function with the IsErrorTimeout interface. -type IsErrorTimeoutFunc func(error) aws.Ternary - -// IsErrorTimeout returns if the error is retryable. -func (fn IsErrorTimeoutFunc) IsErrorTimeout(err error) aws.Ternary { - return fn(err) -} - -// TimeouterError provides the IsErrorTimeout implementation for determining if -// an error is a timeout based on type with the Timeout method. -type TimeouterError struct{} - -// IsErrorTimeout returns if the error is a timeout error. -func (t TimeouterError) IsErrorTimeout(err error) aws.Ternary { - var v interface{ Timeout() bool } - - if !errors.As(err, &v) { - return aws.UnknownTernary - } - - return aws.BoolTernary(v.Timeout()) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go deleted file mode 100644 index b0ba4cb2f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go +++ /dev/null @@ -1,127 +0,0 @@ -package aws - -import ( - "context" - "fmt" - "time" -) - -// RetryMode provides the mode the API client will use to create a retryer -// based on. -type RetryMode string - -const ( - // RetryModeStandard model provides rate limited retry attempts with - // exponential backoff delay. - RetryModeStandard RetryMode = "standard" - - // RetryModeAdaptive model provides attempt send rate limiting on throttle - // responses in addition to standard mode's retry rate limiting. - // - // Adaptive retry mode is experimental and is subject to change in the - // future. - RetryModeAdaptive RetryMode = "adaptive" -) - -// ParseRetryMode attempts to parse a RetryMode from the given string. -// Returning error if the value is not a known RetryMode. -func ParseRetryMode(v string) (mode RetryMode, err error) { - switch v { - case "standard": - return RetryModeStandard, nil - case "adaptive": - return RetryModeAdaptive, nil - default: - return mode, fmt.Errorf("unknown RetryMode, %v", v) - } -} - -func (m RetryMode) String() string { return string(m) } - -// Retryer is an interface to determine if a given error from a -// attempt should be retried, and if so what backoff delay to apply. The -// default implementation used by most services is the retry package's Standard -// type. Which contains basic retry logic using exponential backoff. -type Retryer interface { - // IsErrorRetryable returns if the failed attempt is retryable. This check - // should determine if the error can be retried, or if the error is - // terminal. - IsErrorRetryable(error) bool - - // MaxAttempts returns the maximum number of attempts that can be made for - // an attempt before failing. A value of 0 implies that the attempt should - // be retried until it succeeds if the errors are retryable. - MaxAttempts() int - - // RetryDelay returns the delay that should be used before retrying the - // attempt. Will return error if the delay could not be determined. - RetryDelay(attempt int, opErr error) (time.Duration, error) - - // GetRetryToken attempts to deduct the retry cost from the retry token pool. - // Returning the token release function, or error. - GetRetryToken(ctx context.Context, opErr error) (releaseToken func(error) error, err error) - - // GetInitialToken returns the initial attempt token that can increment the - // retry token pool if the attempt is successful. - GetInitialToken() (releaseToken func(error) error) -} - -// RetryerV2 is an interface to determine if a given error from an attempt -// should be retried, and if so what backoff delay to apply. The default -// implementation used by most services is the retry package's Standard type. -// Which contains basic retry logic using exponential backoff. -// -// RetryerV2 replaces the Retryer interface, deprecating the GetInitialToken -// method in favor of GetAttemptToken which takes a context, and can return an error. -// -// The SDK's retry package's Attempt middleware, and utilities will always -// wrap a Retryer as a RetryerV2. Delegating to GetInitialToken, only if -// GetAttemptToken is not implemented. -type RetryerV2 interface { - Retryer - - // GetInitialToken returns the initial attempt token that can increment the - // retry token pool if the attempt is successful. - // - // Deprecated: This method does not provide a way to block using Context, - // nor can it return an error. Use RetryerV2, and GetAttemptToken instead. - GetInitialToken() (releaseToken func(error) error) - - // GetAttemptToken returns the send token that can be used to rate limit - // attempt calls. Will be used by the SDK's retry package's Attempt - // middleware to get a send token prior to calling the temp and releasing - // the send token after the attempt has been made. - GetAttemptToken(context.Context) (func(error) error, error) -} - -// NopRetryer provides a RequestRetryDecider implementation that will flag -// all attempt errors as not retryable, with a max attempts of 1. -type NopRetryer struct{} - -// IsErrorRetryable returns false for all error values. -func (NopRetryer) IsErrorRetryable(error) bool { return false } - -// MaxAttempts always returns 1 for the original attempt. -func (NopRetryer) MaxAttempts() int { return 1 } - -// RetryDelay is not valid for the NopRetryer. Will always return error. -func (NopRetryer) RetryDelay(int, error) (time.Duration, error) { - return 0, fmt.Errorf("not retrying any attempt errors") -} - -// GetRetryToken returns a stub function that does nothing. -func (NopRetryer) GetRetryToken(context.Context, error) (func(error) error, error) { - return nopReleaseToken, nil -} - -// GetInitialToken returns a stub function that does nothing. -func (NopRetryer) GetInitialToken() func(error) error { - return nopReleaseToken -} - -// GetAttemptToken returns a stub function that does nothing. -func (NopRetryer) GetAttemptToken(context.Context) (func(error) error, error) { - return nopReleaseToken, nil -} - -func nopReleaseToken(error) error { return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go deleted file mode 100644 index 3af9b2b33..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go +++ /dev/null @@ -1,14 +0,0 @@ -package aws - -// ExecutionEnvironmentID is the AWS execution environment runtime identifier. -type ExecutionEnvironmentID string - -// RuntimeEnvironment is a collection of values that are determined at runtime -// based on the environment that the SDK is executing in. Some of these values -// may or may not be present based on the executing environment and certain SDK -// configuration properties that drive whether these values are populated.. -type RuntimeEnvironment struct { - EnvironmentIdentifier ExecutionEnvironmentID - Region string - EC2InstanceMetadataRegion string -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.go deleted file mode 100644 index cbf22f1d0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.go +++ /dev/null @@ -1,115 +0,0 @@ -package v4 - -import ( - "strings" - "sync" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -func lookupKey(service, region string) string { - var s strings.Builder - s.Grow(len(region) + len(service) + 3) - s.WriteString(region) - s.WriteRune('/') - s.WriteString(service) - return s.String() -} - -type derivedKey struct { - AccessKey string - Date time.Time - Credential []byte -} - -type derivedKeyCache struct { - values map[string]derivedKey - mutex sync.RWMutex -} - -func newDerivedKeyCache() derivedKeyCache { - return derivedKeyCache{ - values: make(map[string]derivedKey), - } -} - -func (s *derivedKeyCache) Get(credentials aws.Credentials, service, region string, signingTime SigningTime) []byte { - key := lookupKey(service, region) - s.mutex.RLock() - if cred, ok := s.get(key, credentials, signingTime.Time); ok { - s.mutex.RUnlock() - return cred - } - s.mutex.RUnlock() - - s.mutex.Lock() - if cred, ok := s.get(key, credentials, signingTime.Time); ok { - s.mutex.Unlock() - return cred - } - cred := deriveKey(credentials.SecretAccessKey, service, region, signingTime) - entry := derivedKey{ - AccessKey: credentials.AccessKeyID, - Date: signingTime.Time, - Credential: cred, - } - s.values[key] = entry - s.mutex.Unlock() - - return cred -} - -func (s *derivedKeyCache) get(key string, credentials aws.Credentials, signingTime time.Time) ([]byte, bool) { - cacheEntry, ok := s.retrieveFromCache(key) - if ok && cacheEntry.AccessKey == credentials.AccessKeyID && isSameDay(signingTime, cacheEntry.Date) { - return cacheEntry.Credential, true - } - return nil, false -} - -func (s *derivedKeyCache) retrieveFromCache(key string) (derivedKey, bool) { - if v, ok := s.values[key]; ok { - return v, true - } - return derivedKey{}, false -} - -// SigningKeyDeriver derives a signing key from a set of credentials -type SigningKeyDeriver struct { - cache derivedKeyCache -} - -// NewSigningKeyDeriver returns a new SigningKeyDeriver -func NewSigningKeyDeriver() *SigningKeyDeriver { - return &SigningKeyDeriver{ - cache: newDerivedKeyCache(), - } -} - -// DeriveKey returns a derived signing key from the given credentials to be used with SigV4 signing. -func (k *SigningKeyDeriver) DeriveKey(credential aws.Credentials, service, region string, signingTime SigningTime) []byte { - return k.cache.Get(credential, service, region, signingTime) -} - -func deriveKey(secret, service, region string, t SigningTime) []byte { - hmacDate := HMACSHA256([]byte("AWS4"+secret), []byte(t.ShortTimeFormat())) - hmacRegion := HMACSHA256(hmacDate, []byte(region)) - hmacService := HMACSHA256(hmacRegion, []byte(service)) - return HMACSHA256(hmacService, []byte("aws4_request")) -} - -func isSameDay(x, y time.Time) bool { - xYear, xMonth, xDay := x.Date() - yYear, yMonth, yDay := y.Date() - - if xYear != yYear { - return false - } - - if xMonth != yMonth { - return false - } - - return xDay == yDay -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go deleted file mode 100644 index a23cb003b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go +++ /dev/null @@ -1,40 +0,0 @@ -package v4 - -// Signature Version 4 (SigV4) Constants -const ( - // EmptyStringSHA256 is the hex encoded sha256 value of an empty string - EmptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` - - // UnsignedPayload indicates that the request payload body is unsigned - UnsignedPayload = "UNSIGNED-PAYLOAD" - - // AmzAlgorithmKey indicates the signing algorithm - AmzAlgorithmKey = "X-Amz-Algorithm" - - // AmzSecurityTokenKey indicates the security token to be used with temporary credentials - AmzSecurityTokenKey = "X-Amz-Security-Token" - - // AmzDateKey is the UTC timestamp for the request in the format YYYYMMDD'T'HHMMSS'Z' - AmzDateKey = "X-Amz-Date" - - // AmzCredentialKey is the access key ID and credential scope - AmzCredentialKey = "X-Amz-Credential" - - // AmzSignedHeadersKey is the set of headers signed for the request - AmzSignedHeadersKey = "X-Amz-SignedHeaders" - - // AmzSignatureKey is the query parameter to store the SigV4 signature - AmzSignatureKey = "X-Amz-Signature" - - // TimeFormat is the time format to be used in the X-Amz-Date header or query parameter - TimeFormat = "20060102T150405Z" - - // ShortTimeFormat is the shorten time format used in the credential scope - ShortTimeFormat = "20060102" - - // ContentSHAKey is the SHA256 of request body - ContentSHAKey = "X-Amz-Content-Sha256" - - // StreamingEventsPayload indicates that the request payload body is a signed event stream. - StreamingEventsPayload = "STREAMING-AWS4-HMAC-SHA256-EVENTS" -) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go deleted file mode 100644 index c61955ad5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go +++ /dev/null @@ -1,82 +0,0 @@ -package v4 - -import ( - sdkstrings "github.com/aws/aws-sdk-go-v2/internal/strings" -) - -// Rules houses a set of Rule needed for validation of a -// string value -type Rules []Rule - -// Rule interface allows for more flexible rules and just simply -// checks whether or not a value adheres to that Rule -type Rule interface { - IsValid(value string) bool -} - -// IsValid will iterate through all rules and see if any rules -// apply to the value and supports nested rules -func (r Rules) IsValid(value string) bool { - for _, rule := range r { - if rule.IsValid(value) { - return true - } - } - return false -} - -// MapRule generic Rule for maps -type MapRule map[string]struct{} - -// IsValid for the map Rule satisfies whether it exists in the map -func (m MapRule) IsValid(value string) bool { - _, ok := m[value] - return ok -} - -// AllowList is a generic Rule for include listing -type AllowList struct { - Rule -} - -// IsValid for AllowList checks if the value is within the AllowList -func (w AllowList) IsValid(value string) bool { - return w.Rule.IsValid(value) -} - -// ExcludeList is a generic Rule for exclude listing -type ExcludeList struct { - Rule -} - -// IsValid for AllowList checks if the value is within the AllowList -func (b ExcludeList) IsValid(value string) bool { - return !b.Rule.IsValid(value) -} - -// Patterns is a list of strings to match against -type Patterns []string - -// IsValid for Patterns checks each pattern and returns if a match has -// been found -func (p Patterns) IsValid(value string) bool { - for _, pattern := range p { - if sdkstrings.HasPrefixFold(value, pattern) { - return true - } - } - return false -} - -// InclusiveRules rules allow for rules to depend on one another -type InclusiveRules []Rule - -// IsValid will return true if all rules are true -func (r InclusiveRules) IsValid(value string) bool { - for _, rule := range r { - if !rule.IsValid(value) { - return false - } - } - return true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go deleted file mode 100644 index d99b32ceb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go +++ /dev/null @@ -1,70 +0,0 @@ -package v4 - -// IgnoredHeaders is a list of headers that are ignored during signing -var IgnoredHeaders = Rules{ - ExcludeList{ - MapRule{ - "Authorization": struct{}{}, - "User-Agent": struct{}{}, - "X-Amzn-Trace-Id": struct{}{}, - "Expect": struct{}{}, - "Transfer-Encoding": struct{}{}, - }, - }, -} - -// RequiredSignedHeaders is a allow list for Build canonical headers. -var RequiredSignedHeaders = Rules{ - AllowList{ - MapRule{ - "Cache-Control": struct{}{}, - "Content-Disposition": struct{}{}, - "Content-Encoding": struct{}{}, - "Content-Language": struct{}{}, - "Content-Md5": struct{}{}, - "Content-Type": struct{}{}, - "Expires": struct{}{}, - "If-Match": struct{}{}, - "If-Modified-Since": struct{}{}, - "If-None-Match": struct{}{}, - "If-Unmodified-Since": struct{}{}, - "Range": struct{}{}, - "X-Amz-Acl": struct{}{}, - "X-Amz-Copy-Source": struct{}{}, - "X-Amz-Copy-Source-If-Match": struct{}{}, - "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, - "X-Amz-Copy-Source-If-None-Match": struct{}{}, - "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, - "X-Amz-Copy-Source-Range": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Grant-Full-control": struct{}{}, - "X-Amz-Grant-Read": struct{}{}, - "X-Amz-Grant-Read-Acp": struct{}{}, - "X-Amz-Grant-Write": struct{}{}, - "X-Amz-Grant-Write-Acp": struct{}{}, - "X-Amz-Metadata-Directive": struct{}{}, - "X-Amz-Mfa": struct{}{}, - "X-Amz-Server-Side-Encryption": struct{}{}, - "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, - "X-Amz-Server-Side-Encryption-Context": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Storage-Class": struct{}{}, - "X-Amz-Website-Redirect-Location": struct{}{}, - "X-Amz-Content-Sha256": struct{}{}, - "X-Amz-Tagging": struct{}{}, - }, - }, - Patterns{"X-Amz-Object-Lock-"}, - Patterns{"X-Amz-Meta-"}, -} - -// AllowedQueryHoisting is a allowed list for Build query headers. The boolean value -// represents whether or not it is a pattern. -var AllowedQueryHoisting = InclusiveRules{ - ExcludeList{RequiredSignedHeaders}, - Patterns{"X-Amz-"}, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.go deleted file mode 100644 index e7fa7a1b1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.go +++ /dev/null @@ -1,13 +0,0 @@ -package v4 - -import ( - "crypto/hmac" - "crypto/sha256" -) - -// HMACSHA256 computes a HMAC-SHA256 of data given the provided key. -func HMACSHA256(key []byte, data []byte) []byte { - hash := hmac.New(sha256.New, key) - hash.Write(data) - return hash.Sum(nil) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.go deleted file mode 100644 index bf93659a4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.go +++ /dev/null @@ -1,75 +0,0 @@ -package v4 - -import ( - "net/http" - "strings" -) - -// SanitizeHostForHeader removes default port from host and updates request.Host -func SanitizeHostForHeader(r *http.Request) { - host := getHost(r) - port := portOnly(host) - if port != "" && isDefaultPort(r.URL.Scheme, port) { - r.Host = stripPort(host) - } -} - -// Returns host from request -func getHost(r *http.Request) string { - if r.Host != "" { - return r.Host - } - - return r.URL.Host -} - -// Hostname returns u.Host, without any port number. -// -// If Host is an IPv6 literal with a port number, Hostname returns the -// IPv6 literal without the square brackets. IPv6 literals may include -// a zone identifier. -// -// Copied from the Go 1.8 standard library (net/url) -func stripPort(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return hostport - } - if i := strings.IndexByte(hostport, ']'); i != -1 { - return strings.TrimPrefix(hostport[:i], "[") - } - return hostport[:colon] -} - -// Port returns the port part of u.Host, without the leading colon. -// If u.Host doesn't contain a port, Port returns an empty string. -// -// Copied from the Go 1.8 standard library (net/url) -func portOnly(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return "" - } - if i := strings.Index(hostport, "]:"); i != -1 { - return hostport[i+len("]:"):] - } - if strings.Contains(hostport, "]") { - return "" - } - return hostport[colon+len(":"):] -} - -// Returns true if the specified URI is using the standard port -// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs) -func isDefaultPort(scheme, port string) bool { - if port == "" { - return true - } - - lowerCaseScheme := strings.ToLower(scheme) - if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") { - return true - } - - return false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go deleted file mode 100644 index fc7887909..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go +++ /dev/null @@ -1,13 +0,0 @@ -package v4 - -import "strings" - -// BuildCredentialScope builds the Signature Version 4 (SigV4) signing scope -func BuildCredentialScope(signingTime SigningTime, region, service string) string { - return strings.Join([]string{ - signingTime.ShortTimeFormat(), - region, - service, - "aws4_request", - }, "/") -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.go deleted file mode 100644 index 1de06a765..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.go +++ /dev/null @@ -1,36 +0,0 @@ -package v4 - -import "time" - -// SigningTime provides a wrapper around a time.Time which provides cached values for SigV4 signing. -type SigningTime struct { - time.Time - timeFormat string - shortTimeFormat string -} - -// NewSigningTime creates a new SigningTime given a time.Time -func NewSigningTime(t time.Time) SigningTime { - return SigningTime{ - Time: t, - } -} - -// TimeFormat provides a time formatted in the X-Amz-Date format. -func (m *SigningTime) TimeFormat() string { - return m.format(&m.timeFormat, TimeFormat) -} - -// ShortTimeFormat provides a time formatted of 20060102. -func (m *SigningTime) ShortTimeFormat() string { - return m.format(&m.shortTimeFormat, ShortTimeFormat) -} - -func (m *SigningTime) format(target *string, format string) string { - if len(*target) > 0 { - return *target - } - v := m.Time.Format(format) - *target = v - return v -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go deleted file mode 100644 index d025dbaa0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go +++ /dev/null @@ -1,80 +0,0 @@ -package v4 - -import ( - "net/url" - "strings" -) - -const doubleSpace = " " - -// StripExcessSpaces will rewrite the passed in slice's string values to not -// contain multiple side-by-side spaces. -func StripExcessSpaces(str string) string { - var j, k, l, m, spaces int - // Trim trailing spaces - for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- { - } - - // Trim leading spaces - for k = 0; k < j && str[k] == ' '; k++ { - } - str = str[k : j+1] - - // Strip multiple spaces. - j = strings.Index(str, doubleSpace) - if j < 0 { - return str - } - - buf := []byte(str) - for k, m, l = j, j, len(buf); k < l; k++ { - if buf[k] == ' ' { - if spaces == 0 { - // First space. - buf[m] = buf[k] - m++ - } - spaces++ - } else { - // End of multiple spaces. - spaces = 0 - buf[m] = buf[k] - m++ - } - } - - return string(buf[:m]) -} - -// GetURIPath returns the escaped URI component from the provided URL. -func GetURIPath(u *url.URL) string { - var uriPath string - - if len(u.Opaque) > 0 { - const schemeSep, pathSep, queryStart = "//", "/", "?" - - opaque := u.Opaque - // Cut off the query string if present. - if idx := strings.Index(opaque, queryStart); idx >= 0 { - opaque = opaque[:idx] - } - - // Cutout the scheme separator if present. - if strings.Index(opaque, schemeSep) == 0 { - opaque = opaque[len(schemeSep):] - } - - // capture URI path starting with first path separator. - if idx := strings.Index(opaque, pathSep); idx >= 0 { - uriPath = opaque[idx:] - } - } else { - uriPath = u.EscapedPath() - } - - if len(uriPath) == 0 { - uriPath = "/" - } - - return uriPath -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go deleted file mode 100644 index 8a46220a3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go +++ /dev/null @@ -1,420 +0,0 @@ -package v4 - -import ( - "context" - "crypto/sha256" - "encoding/hex" - "fmt" - "io" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const computePayloadHashMiddlewareID = "ComputePayloadHash" - -// HashComputationError indicates an error occurred while computing the signing hash -type HashComputationError struct { - Err error -} - -// Error is the error message -func (e *HashComputationError) Error() string { - return fmt.Sprintf("failed to compute payload hash: %v", e.Err) -} - -// Unwrap returns the underlying error if one is set -func (e *HashComputationError) Unwrap() error { - return e.Err -} - -// SigningError indicates an error condition occurred while performing SigV4 signing -type SigningError struct { - Err error -} - -func (e *SigningError) Error() string { - return fmt.Sprintf("failed to sign request: %v", e.Err) -} - -// Unwrap returns the underlying error cause -func (e *SigningError) Unwrap() error { - return e.Err -} - -// UseDynamicPayloadSigningMiddleware swaps the compute payload sha256 middleware with a resolver middleware that -// switches between unsigned and signed payload based on TLS state for request. -// This middleware should not be used for AWS APIs that do not support unsigned payload signing auth. -// By default, SDK uses this middleware for known AWS APIs that support such TLS based auth selection . -// -// Usage example - -// S3 PutObject API allows unsigned payload signing auth usage when TLS is enabled, and uses this middleware to -// dynamically switch between unsigned and signed payload based on TLS state for request. -func UseDynamicPayloadSigningMiddleware(stack *middleware.Stack) error { - _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &dynamicPayloadSigningMiddleware{}) - return err -} - -// dynamicPayloadSigningMiddleware dynamically resolves the middleware that computes and set payload sha256 middleware. -type dynamicPayloadSigningMiddleware struct { -} - -// ID returns the resolver identifier -func (m *dynamicPayloadSigningMiddleware) ID() string { - return computePayloadHashMiddlewareID -} - -// HandleFinalize delegates SHA256 computation according to whether the request -// is TLS-enabled. -func (m *dynamicPayloadSigningMiddleware) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if req.IsHTTPS() { - return (&UnsignedPayload{}).HandleFinalize(ctx, in, next) - } - return (&ComputePayloadSHA256{}).HandleFinalize(ctx, in, next) -} - -// UnsignedPayload sets the SigV4 request payload hash to unsigned. -// -// Will not set the Unsigned Payload magic SHA value, if a SHA has already been -// stored in the context. (e.g. application pre-computed SHA256 before making -// API call). -// -// This middleware does not check the X-Amz-Content-Sha256 header, if that -// header is serialized a middleware must translate it into the context. -type UnsignedPayload struct{} - -// AddUnsignedPayloadMiddleware adds unsignedPayload to the operation -// middleware stack -func AddUnsignedPayloadMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -// ID returns the unsignedPayload identifier -func (m *UnsignedPayload) ID() string { - return computePayloadHashMiddlewareID -} - -// HandleFinalize sets the payload hash magic value to the unsigned sentinel. -func (m *UnsignedPayload) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if GetPayloadHash(ctx) == "" { - ctx = SetPayloadHash(ctx, v4Internal.UnsignedPayload) - } - return next.HandleFinalize(ctx, in) -} - -// ComputePayloadSHA256 computes SHA256 payload hash to sign. -// -// Will not set the Unsigned Payload magic SHA value, if a SHA has already been -// stored in the context. (e.g. application pre-computed SHA256 before making -// API call). -// -// This middleware does not check the X-Amz-Content-Sha256 header, if that -// header is serialized a middleware must translate it into the context. -type ComputePayloadSHA256 struct{} - -// AddComputePayloadSHA256Middleware adds computePayloadSHA256 to the -// operation middleware stack -func AddComputePayloadSHA256Middleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -// RemoveComputePayloadSHA256Middleware removes computePayloadSHA256 from the -// operation middleware stack -func RemoveComputePayloadSHA256Middleware(stack *middleware.Stack) error { - _, err := stack.Finalize.Remove(computePayloadHashMiddlewareID) - return err -} - -// ID is the middleware name -func (m *ComputePayloadSHA256) ID() string { - return computePayloadHashMiddlewareID -} - -// HandleFinalize computes the payload hash for the request, storing it to the -// context. This is a no-op if a caller has previously set that value. -func (m *ComputePayloadSHA256) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if GetPayloadHash(ctx) != "" { - return next.HandleFinalize(ctx, in) - } - - _, span := tracing.StartSpan(ctx, "ComputePayloadSHA256") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &HashComputationError{ - Err: fmt.Errorf("unexpected request middleware type %T", in.Request), - } - } - - hash := sha256.New() - if stream := req.GetStream(); stream != nil { - _, err = io.Copy(hash, stream) - if err != nil { - return out, metadata, &HashComputationError{ - Err: fmt.Errorf("failed to compute payload hash, %w", err), - } - } - - if err := req.RewindStream(); err != nil { - return out, metadata, &HashComputationError{ - Err: fmt.Errorf("failed to seek body to start, %w", err), - } - } - } - - ctx = SetPayloadHash(ctx, hex.EncodeToString(hash.Sum(nil))) - - span.End() - return next.HandleFinalize(ctx, in) -} - -// SwapComputePayloadSHA256ForUnsignedPayloadMiddleware replaces the -// ComputePayloadSHA256 middleware with the UnsignedPayload middleware. -// -// Use this to disable computing the Payload SHA256 checksum and instead use -// UNSIGNED-PAYLOAD for the SHA256 value. -func SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack *middleware.Stack) error { - _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &UnsignedPayload{}) - return err -} - -// ContentSHA256Header sets the X-Amz-Content-Sha256 header value to -// the Payload hash stored in the context. -type ContentSHA256Header struct{} - -// AddContentSHA256HeaderMiddleware adds ContentSHA256Header to the -// operation middleware stack -func AddContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&ContentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After) -} - -// RemoveContentSHA256HeaderMiddleware removes contentSHA256Header middleware -// from the operation middleware stack -func RemoveContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - _, err := stack.Finalize.Remove((*ContentSHA256Header)(nil).ID()) - return err -} - -// ID returns the ContentSHA256HeaderMiddleware identifier -func (m *ContentSHA256Header) ID() string { - return "SigV4ContentSHA256Header" -} - -// HandleFinalize sets the X-Amz-Content-Sha256 header value to the Payload hash -// stored in the context. -func (m *ContentSHA256Header) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &HashComputationError{Err: fmt.Errorf("unexpected request middleware type %T", in.Request)} - } - - req.Header.Set(v4Internal.ContentSHAKey, GetPayloadHash(ctx)) - return next.HandleFinalize(ctx, in) -} - -// SignHTTPRequestMiddlewareOptions is the configuration options for -// [SignHTTPRequestMiddleware]. -// -// Deprecated: [SignHTTPRequestMiddleware] is deprecated. -type SignHTTPRequestMiddlewareOptions struct { - CredentialsProvider aws.CredentialsProvider - Signer HTTPSigner - LogSigning bool -} - -// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 -// HTTP Signing. -// -// Deprecated: AWS service clients no longer use this middleware. Signing as an -// SDK operation is now performed through an internal per-service middleware -// which opaquely selects and uses the signer from the resolved auth scheme. -type SignHTTPRequestMiddleware struct { - credentialsProvider aws.CredentialsProvider - signer HTTPSigner - logSigning bool -} - -// NewSignHTTPRequestMiddleware constructs a [SignHTTPRequestMiddleware] using -// the given [Signer] for signing requests. -// -// Deprecated: SignHTTPRequestMiddleware is deprecated. -func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *SignHTTPRequestMiddleware { - return &SignHTTPRequestMiddleware{ - credentialsProvider: options.CredentialsProvider, - signer: options.Signer, - logSigning: options.LogSigning, - } -} - -// ID is the SignHTTPRequestMiddleware identifier. -// -// Deprecated: SignHTTPRequestMiddleware is deprecated. -func (s *SignHTTPRequestMiddleware) ID() string { - return "Signing" -} - -// HandleFinalize will take the provided input and sign the request using the -// SigV4 authentication scheme. -// -// Deprecated: SignHTTPRequestMiddleware is deprecated. -func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if !haveCredentialProvider(s.credentialsProvider) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &SigningError{Err: fmt.Errorf("unexpected request middleware type %T", in.Request)} - } - - signingName, signingRegion := awsmiddleware.GetSigningName(ctx), awsmiddleware.GetSigningRegion(ctx) - payloadHash := GetPayloadHash(ctx) - if len(payloadHash) == 0 { - return out, metadata, &SigningError{Err: fmt.Errorf("computed payload hash missing from context")} - } - - credentials, err := s.credentialsProvider.Retrieve(ctx) - if err != nil { - return out, metadata, &SigningError{Err: fmt.Errorf("failed to retrieve credentials: %w", err)} - } - - signerOptions := []func(o *SignerOptions){ - func(o *SignerOptions) { - o.Logger = middleware.GetLogger(ctx) - o.LogSigning = s.logSigning - }, - } - - // existing DisableURIPathEscaping is equivalent in purpose - // to authentication scheme property DisableDoubleEncoding - disableDoubleEncoding, overridden := internalauth.GetDisableDoubleEncoding(ctx) - if overridden { - signerOptions = append(signerOptions, func(o *SignerOptions) { - o.DisableURIPathEscaping = disableDoubleEncoding - }) - } - - err = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), signerOptions...) - if err != nil { - return out, metadata, &SigningError{Err: fmt.Errorf("failed to sign http request, %w", err)} - } - - ctx = awsmiddleware.SetSigningCredentials(ctx, credentials) - - return next.HandleFinalize(ctx, in) -} - -// StreamingEventsPayload signs input event stream messages. -type StreamingEventsPayload struct{} - -// AddStreamingEventsPayload adds the streamingEventsPayload middleware to the stack. -func AddStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&StreamingEventsPayload{}, middleware.Before) -} - -// ID identifies the middleware. -func (s *StreamingEventsPayload) ID() string { - return computePayloadHashMiddlewareID -} - -// HandleFinalize marks the input stream to be signed with SigV4. -func (s *StreamingEventsPayload) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - contentSHA := GetPayloadHash(ctx) - if len(contentSHA) == 0 { - contentSHA = v4Internal.StreamingEventsPayload - } - - ctx = SetPayloadHash(ctx, contentSHA) - - return next.HandleFinalize(ctx, in) -} - -// GetSignedRequestSignature attempts to extract the signature of the request. -// Returning an error if the request is unsigned, or unable to extract the -// signature. -func GetSignedRequestSignature(r *http.Request) ([]byte, error) { - const authHeaderSignatureElem = "Signature=" - - if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { - ps := strings.Split(auth, ",") - for _, p := range ps { - p = strings.TrimSpace(p) - if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 { - sig := p[len(authHeaderSignatureElem):] - if len(sig) == 0 { - return nil, fmt.Errorf("invalid request signature authorization header") - } - return hex.DecodeString(sig) - } - } - } - - if sig := r.URL.Query().Get("X-Amz-Signature"); len(sig) != 0 { - return hex.DecodeString(sig) - } - - return nil, fmt.Errorf("request not signed") -} - -func haveCredentialProvider(p aws.CredentialsProvider) bool { - if p == nil { - return false - } - - return !aws.IsCredentialsProvider(p, (*aws.AnonymousCredentials)(nil)) -} - -type payloadHashKey struct{} - -// GetPayloadHash retrieves the payload hash to use for signing -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetPayloadHash(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, payloadHashKey{}).(string) - return v -} - -// SetPayloadHash sets the payload hash to be used for signing the request -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func SetPayloadHash(ctx context.Context, hash string) context.Context { - return middleware.WithStackValue(ctx, payloadHashKey{}, hash) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.go deleted file mode 100644 index e1a066512..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.go +++ /dev/null @@ -1,127 +0,0 @@ -package v4 - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go/middleware" - smithyHTTP "github.com/aws/smithy-go/transport/http" -) - -// HTTPPresigner is an interface to a SigV4 signer that can sign create a -// presigned URL for a HTTP requests. -type HTTPPresigner interface { - PresignHTTP( - ctx context.Context, credentials aws.Credentials, r *http.Request, - payloadHash string, service string, region string, signingTime time.Time, - optFns ...func(*SignerOptions), - ) (url string, signedHeader http.Header, err error) -} - -// PresignedHTTPRequest provides the URL and signed headers that are included -// in the presigned URL. -type PresignedHTTPRequest struct { - URL string - Method string - SignedHeader http.Header -} - -// PresignHTTPRequestMiddlewareOptions is the options for the PresignHTTPRequestMiddleware middleware. -type PresignHTTPRequestMiddlewareOptions struct { - CredentialsProvider aws.CredentialsProvider - Presigner HTTPPresigner - LogSigning bool -} - -// PresignHTTPRequestMiddleware provides the Finalize middleware for creating a -// presigned URL for an HTTP request. -// -// Will short circuit the middleware stack and not forward onto the next -// Finalize handler. -type PresignHTTPRequestMiddleware struct { - credentialsProvider aws.CredentialsProvider - presigner HTTPPresigner - logSigning bool -} - -// NewPresignHTTPRequestMiddleware returns a new PresignHTTPRequestMiddleware -// initialized with the presigner. -func NewPresignHTTPRequestMiddleware(options PresignHTTPRequestMiddlewareOptions) *PresignHTTPRequestMiddleware { - return &PresignHTTPRequestMiddleware{ - credentialsProvider: options.CredentialsProvider, - presigner: options.Presigner, - logSigning: options.LogSigning, - } -} - -// ID provides the middleware ID. -func (*PresignHTTPRequestMiddleware) ID() string { return "PresignHTTPRequest" } - -// HandleFinalize will take the provided input and create a presigned url for -// the http request using the SigV4 presign authentication scheme. -// -// Since the signed request is not a valid HTTP request -func (s *PresignHTTPRequestMiddleware) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyHTTP.Request) - if !ok { - return out, metadata, &SigningError{ - Err: fmt.Errorf("unexpected request middleware type %T", in.Request), - } - } - - httpReq := req.Build(ctx) - if !haveCredentialProvider(s.credentialsProvider) { - out.Result = &PresignedHTTPRequest{ - URL: httpReq.URL.String(), - Method: httpReq.Method, - SignedHeader: http.Header{}, - } - - return out, metadata, nil - } - - signingName := awsmiddleware.GetSigningName(ctx) - signingRegion := awsmiddleware.GetSigningRegion(ctx) - payloadHash := GetPayloadHash(ctx) - if len(payloadHash) == 0 { - return out, metadata, &SigningError{ - Err: fmt.Errorf("computed payload hash missing from context"), - } - } - - credentials, err := s.credentialsProvider.Retrieve(ctx) - if err != nil { - return out, metadata, &SigningError{ - Err: fmt.Errorf("failed to retrieve credentials: %w", err), - } - } - - u, h, err := s.presigner.PresignHTTP(ctx, credentials, - httpReq, payloadHash, signingName, signingRegion, sdk.NowTime(), - func(o *SignerOptions) { - o.Logger = middleware.GetLogger(ctx) - o.LogSigning = s.logSigning - }) - if err != nil { - return out, metadata, &SigningError{ - Err: fmt.Errorf("failed to sign http request, %w", err), - } - } - - out.Result = &PresignedHTTPRequest{ - URL: u, - Method: httpReq.Method, - SignedHeader: h, - } - - return out, metadata, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go deleted file mode 100644 index 32875e077..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go +++ /dev/null @@ -1,86 +0,0 @@ -package v4 - -import ( - "context" - "crypto/sha256" - "encoding/hex" - "github.com/aws/aws-sdk-go-v2/aws" - v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" - "strings" - "time" -) - -// EventStreamSigner is an AWS EventStream protocol signer. -type EventStreamSigner interface { - GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error) -} - -// StreamSignerOptions is the configuration options for StreamSigner. -type StreamSignerOptions struct{} - -// StreamSigner implements Signature Version 4 (SigV4) signing of event stream encoded payloads. -type StreamSigner struct { - options StreamSignerOptions - - credentials aws.Credentials - service string - region string - - prevSignature []byte - - signingKeyDeriver *v4Internal.SigningKeyDeriver -} - -// NewStreamSigner returns a new AWS EventStream protocol signer. -func NewStreamSigner(credentials aws.Credentials, service, region string, seedSignature []byte, optFns ...func(*StreamSignerOptions)) *StreamSigner { - o := StreamSignerOptions{} - - for _, fn := range optFns { - fn(&o) - } - - return &StreamSigner{ - options: o, - credentials: credentials, - service: service, - region: region, - signingKeyDeriver: v4Internal.NewSigningKeyDeriver(), - prevSignature: seedSignature, - } -} - -// GetSignature signs the provided header and payload bytes. -func (s *StreamSigner) GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error) { - options := s.options - - for _, fn := range optFns { - fn(&options) - } - - prevSignature := s.prevSignature - - st := v4Internal.NewSigningTime(signingTime.UTC()) - - sigKey := s.signingKeyDeriver.DeriveKey(s.credentials, s.service, s.region, st) - - scope := v4Internal.BuildCredentialScope(st, s.region, s.service) - - stringToSign := s.buildEventStreamStringToSign(headers, payload, prevSignature, scope, &st) - - signature := v4Internal.HMACSHA256(sigKey, []byte(stringToSign)) - s.prevSignature = signature - - return signature, nil -} - -func (s *StreamSigner) buildEventStreamStringToSign(headers, payload, previousSignature []byte, credentialScope string, signingTime *v4Internal.SigningTime) string { - hash := sha256.New() - return strings.Join([]string{ - "AWS4-HMAC-SHA256-PAYLOAD", - signingTime.TimeFormat(), - credentialScope, - hex.EncodeToString(previousSignature), - hex.EncodeToString(makeHash(hash, headers)), - hex.EncodeToString(makeHash(hash, payload)), - }, "\n") -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go deleted file mode 100644 index 7ed91d5ba..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go +++ /dev/null @@ -1,564 +0,0 @@ -// Package v4 implements the AWS signature version 4 algorithm (commonly known -// as SigV4). -// -// For more information about SigV4, see [Signing AWS API requests] in the IAM -// user guide. -// -// While this implementation CAN work in an external context, it is developed -// primarily for SDK use and you may encounter fringe behaviors around header -// canonicalization. -// -// # Pre-escaping a request URI -// -// AWS v4 signature validation requires that the canonical string's URI path -// component must be the escaped form of the HTTP request's path. -// -// The Go HTTP client will perform escaping automatically on the HTTP request. -// This may cause signature validation errors because the request differs from -// the URI path or query from which the signature was generated. -// -// Because of this, we recommend that you explicitly escape the request when -// using this signer outside of the SDK to prevent possible signature mismatch. -// This can be done by setting URL.Opaque on the request. The signer will -// prefer that value, falling back to the return of URL.EscapedPath if unset. -// -// When setting URL.Opaque you must do so in the form of: -// -// "///" -// -// // e.g. -// "//example.com/some/path" -// -// The leading "//" and hostname are required or the escaping will not work -// correctly. -// -// The TestStandaloneSign unit test provides a complete example of using the -// signer outside of the SDK and pre-escaping the URI path. -// -// [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html -package v4 - -import ( - "context" - "crypto/sha256" - "encoding/hex" - "fmt" - "hash" - "net/http" - "net/textproto" - "net/url" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" - "github.com/aws/smithy-go/encoding/httpbinding" - "github.com/aws/smithy-go/logging" -) - -const ( - signingAlgorithm = "AWS4-HMAC-SHA256" - authorizationHeader = "Authorization" - - // Version of signing v4 - Version = "SigV4" -) - -// HTTPSigner is an interface to a SigV4 signer that can sign HTTP requests -type HTTPSigner interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*SignerOptions)) error -} - -type keyDerivator interface { - DeriveKey(credential aws.Credentials, service, region string, signingTime v4Internal.SigningTime) []byte -} - -// SignerOptions is the SigV4 Signer options. -type SignerOptions struct { - // Disables the Signer's moving HTTP header key/value pairs from the HTTP - // request header to the request's query string. This is most commonly used - // with pre-signed requests preventing headers from being added to the - // request's query string. - DisableHeaderHoisting bool - - // Disables the automatic escaping of the URI path of the request for the - // siganture's canonical string's path. For services that do not need additional - // escaping then use this to disable the signer escaping the path. - // - // S3 is an example of a service that does not need additional escaping. - // - // http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - DisableURIPathEscaping bool - - // The logger to send log messages to. - Logger logging.Logger - - // Enable logging of signed requests. - // This will enable logging of the canonical request, the string to sign, and for presigning the subsequent - // presigned URL. - LogSigning bool - - // Disables setting the session token on the request as part of signing - // through X-Amz-Security-Token. This is needed for variations of v4 that - // present the token elsewhere. - DisableSessionToken bool -} - -// Signer applies AWS v4 signing to given request. Use this to sign requests -// that need to be signed with AWS V4 Signatures. -type Signer struct { - options SignerOptions - keyDerivator keyDerivator -} - -// NewSigner returns a new SigV4 Signer -func NewSigner(optFns ...func(signer *SignerOptions)) *Signer { - options := SignerOptions{} - - for _, fn := range optFns { - fn(&options) - } - - return &Signer{options: options, keyDerivator: v4Internal.NewSigningKeyDeriver()} -} - -type httpSigner struct { - Request *http.Request - ServiceName string - Region string - Time v4Internal.SigningTime - Credentials aws.Credentials - KeyDerivator keyDerivator - IsPreSign bool - - PayloadHash string - - DisableHeaderHoisting bool - DisableURIPathEscaping bool - DisableSessionToken bool -} - -func (s *httpSigner) Build() (signedRequest, error) { - req := s.Request - - query := req.URL.Query() - headers := req.Header - - s.setRequiredSigningFields(headers, query) - - // Sort Each Query Key's Values - for key := range query { - sort.Strings(query[key]) - } - - v4Internal.SanitizeHostForHeader(req) - - credentialScope := s.buildCredentialScope() - credentialStr := s.Credentials.AccessKeyID + "/" + credentialScope - if s.IsPreSign { - query.Set(v4Internal.AmzCredentialKey, credentialStr) - } - - unsignedHeaders := headers - if s.IsPreSign && !s.DisableHeaderHoisting { - var urlValues url.Values - urlValues, unsignedHeaders = buildQuery(v4Internal.AllowedQueryHoisting, headers) - for k := range urlValues { - query[k] = urlValues[k] - } - } - - host := req.URL.Host - if len(req.Host) > 0 { - host = req.Host - } - - signedHeaders, signedHeadersStr, canonicalHeaderStr := s.buildCanonicalHeaders(host, v4Internal.IgnoredHeaders, unsignedHeaders, s.Request.ContentLength) - - if s.IsPreSign { - query.Set(v4Internal.AmzSignedHeadersKey, signedHeadersStr) - } - - var rawQuery strings.Builder - rawQuery.WriteString(strings.Replace(query.Encode(), "+", "%20", -1)) - - canonicalURI := v4Internal.GetURIPath(req.URL) - if !s.DisableURIPathEscaping { - canonicalURI = httpbinding.EscapePath(canonicalURI, false) - } - - canonicalString := s.buildCanonicalString( - req.Method, - canonicalURI, - rawQuery.String(), - signedHeadersStr, - canonicalHeaderStr, - ) - - strToSign := s.buildStringToSign(credentialScope, canonicalString) - signingSignature, err := s.buildSignature(strToSign) - if err != nil { - return signedRequest{}, err - } - - if s.IsPreSign { - rawQuery.WriteString("&X-Amz-Signature=") - rawQuery.WriteString(signingSignature) - } else { - headers[authorizationHeader] = append(headers[authorizationHeader][:0], buildAuthorizationHeader(credentialStr, signedHeadersStr, signingSignature)) - } - - req.URL.RawQuery = rawQuery.String() - - return signedRequest{ - Request: req, - SignedHeaders: signedHeaders, - CanonicalString: canonicalString, - StringToSign: strToSign, - PreSigned: s.IsPreSign, - }, nil -} - -func buildAuthorizationHeader(credentialStr, signedHeadersStr, signingSignature string) string { - const credential = "Credential=" - const signedHeaders = "SignedHeaders=" - const signature = "Signature=" - const commaSpace = ", " - - var parts strings.Builder - parts.Grow(len(signingAlgorithm) + 1 + - len(credential) + len(credentialStr) + 2 + - len(signedHeaders) + len(signedHeadersStr) + 2 + - len(signature) + len(signingSignature), - ) - parts.WriteString(signingAlgorithm) - parts.WriteRune(' ') - parts.WriteString(credential) - parts.WriteString(credentialStr) - parts.WriteString(commaSpace) - parts.WriteString(signedHeaders) - parts.WriteString(signedHeadersStr) - parts.WriteString(commaSpace) - parts.WriteString(signature) - parts.WriteString(signingSignature) - return parts.String() -} - -// SignHTTP signs AWS v4 requests with the provided payload hash, service name, region the -// request is made to, and time the request is signed at. The signTime allows -// you to specify that a request is signed for the future, and cannot be -// used until then. -// -// The payloadHash is the hex encoded SHA-256 hash of the request payload, and -// must be provided. Even if the request has no payload (aka body). If the -// request has no payload you should use the hex encoded SHA-256 of an empty -// string as the payloadHash value. -// -// "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" -// -// Some services such as Amazon S3 accept alternative values for the payload -// hash, such as "UNSIGNED-PAYLOAD" for requests where the body will not be -// included in the request signature. -// -// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html -// -// Sign differs from Presign in that it will sign the request using HTTP -// header values. This type of signing is intended for http.Request values that -// will not be shared, or are shared in a way the header values on the request -// will not be lost. -// -// The passed in request will be modified in place. -func (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(options *SignerOptions)) error { - options := s.options - - for _, fn := range optFns { - fn(&options) - } - - signer := &httpSigner{ - Request: r, - PayloadHash: payloadHash, - ServiceName: service, - Region: region, - Credentials: credentials, - Time: v4Internal.NewSigningTime(signingTime.UTC()), - DisableHeaderHoisting: options.DisableHeaderHoisting, - DisableURIPathEscaping: options.DisableURIPathEscaping, - DisableSessionToken: options.DisableSessionToken, - KeyDerivator: s.keyDerivator, - } - - signedRequest, err := signer.Build() - if err != nil { - return err - } - - logSigningInfo(ctx, options, &signedRequest, false) - - return nil -} - -// PresignHTTP signs AWS v4 requests with the payload hash, service name, region -// the request is made to, and time the request is signed at. The signTime -// allows you to specify that a request is signed for the future, and cannot -// be used until then. -// -// Returns the signed URL and the map of HTTP headers that were included in the -// signature or an error if signing the request failed. For presigned requests -// these headers and their values must be included on the HTTP request when it -// is made. This is helpful to know what header values need to be shared with -// the party the presigned request will be distributed to. -// -// The payloadHash is the hex encoded SHA-256 hash of the request payload, and -// must be provided. Even if the request has no payload (aka body). If the -// request has no payload you should use the hex encoded SHA-256 of an empty -// string as the payloadHash value. -// -// "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" -// -// Some services such as Amazon S3 accept alternative values for the payload -// hash, such as "UNSIGNED-PAYLOAD" for requests where the body will not be -// included in the request signature. -// -// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html -// -// PresignHTTP differs from SignHTTP in that it will sign the request using -// query string instead of header values. This allows you to share the -// Presigned Request's URL with third parties, or distribute it throughout your -// system with minimal dependencies. -// -// PresignHTTP will not set the expires time of the presigned request -// automatically. To specify the expire duration for a request add the -// "X-Amz-Expires" query parameter on the request with the value as the -// duration in seconds the presigned URL should be considered valid for. This -// parameter is not used by all AWS services, and is most notable used by -// Amazon S3 APIs. -// -// expires := 20 * time.Minute -// query := req.URL.Query() -// query.Set("X-Amz-Expires", strconv.FormatInt(int64(expires/time.Second), 10)) -// req.URL.RawQuery = query.Encode() -// -// This method does not modify the provided request. -func (s *Signer) PresignHTTP( - ctx context.Context, credentials aws.Credentials, r *http.Request, - payloadHash string, service string, region string, signingTime time.Time, - optFns ...func(*SignerOptions), -) (signedURI string, signedHeaders http.Header, err error) { - options := s.options - - for _, fn := range optFns { - fn(&options) - } - - signer := &httpSigner{ - Request: r.Clone(r.Context()), - PayloadHash: payloadHash, - ServiceName: service, - Region: region, - Credentials: credentials, - Time: v4Internal.NewSigningTime(signingTime.UTC()), - IsPreSign: true, - DisableHeaderHoisting: options.DisableHeaderHoisting, - DisableURIPathEscaping: options.DisableURIPathEscaping, - DisableSessionToken: options.DisableSessionToken, - KeyDerivator: s.keyDerivator, - } - - signedRequest, err := signer.Build() - if err != nil { - return "", nil, err - } - - logSigningInfo(ctx, options, &signedRequest, true) - - signedHeaders = make(http.Header) - - // For the signed headers we canonicalize the header keys in the returned map. - // This avoids situations where can standard library double headers like host header. For example the standard - // library will set the Host header, even if it is present in lower-case form. - for k, v := range signedRequest.SignedHeaders { - key := textproto.CanonicalMIMEHeaderKey(k) - signedHeaders[key] = append(signedHeaders[key], v...) - } - - return signedRequest.Request.URL.String(), signedHeaders, nil -} - -func (s *httpSigner) buildCredentialScope() string { - return v4Internal.BuildCredentialScope(s.Time, s.Region, s.ServiceName) -} - -func buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header) { - query := url.Values{} - unsignedHeaders := http.Header{} - - // A list of headers to be converted to lower case to mitigate a limitation from S3 - lowerCaseHeaders := map[string]string{ - "X-Amz-Expected-Bucket-Owner": "x-amz-expected-bucket-owner", // see #2508 - "X-Amz-Request-Payer": "x-amz-request-payer", // see #2764 - } - - for k, h := range header { - if newKey, ok := lowerCaseHeaders[k]; ok { - k = newKey - } - - if r.IsValid(k) { - query[k] = h - } else { - unsignedHeaders[k] = h - } - } - - return query, unsignedHeaders -} - -func (s *httpSigner) buildCanonicalHeaders(host string, rule v4Internal.Rule, header http.Header, length int64) (signed http.Header, signedHeaders, canonicalHeadersStr string) { - signed = make(http.Header) - - var headers []string - const hostHeader = "host" - headers = append(headers, hostHeader) - signed[hostHeader] = append(signed[hostHeader], host) - - const contentLengthHeader = "content-length" - if length > 0 { - headers = append(headers, contentLengthHeader) - signed[contentLengthHeader] = append(signed[contentLengthHeader], strconv.FormatInt(length, 10)) - } - - for k, v := range header { - if !rule.IsValid(k) { - continue // ignored header - } - if strings.EqualFold(k, contentLengthHeader) { - // prevent signing already handled content-length header. - continue - } - - lowerCaseKey := strings.ToLower(k) - if _, ok := signed[lowerCaseKey]; ok { - // include additional values - signed[lowerCaseKey] = append(signed[lowerCaseKey], v...) - continue - } - - headers = append(headers, lowerCaseKey) - signed[lowerCaseKey] = v - } - sort.Strings(headers) - - signedHeaders = strings.Join(headers, ";") - - var canonicalHeaders strings.Builder - n := len(headers) - const colon = ':' - for i := 0; i < n; i++ { - if headers[i] == hostHeader { - canonicalHeaders.WriteString(hostHeader) - canonicalHeaders.WriteRune(colon) - canonicalHeaders.WriteString(v4Internal.StripExcessSpaces(host)) - } else { - canonicalHeaders.WriteString(headers[i]) - canonicalHeaders.WriteRune(colon) - // Trim out leading, trailing, and dedup inner spaces from signed header values. - values := signed[headers[i]] - for j, v := range values { - cleanedValue := strings.TrimSpace(v4Internal.StripExcessSpaces(v)) - canonicalHeaders.WriteString(cleanedValue) - if j < len(values)-1 { - canonicalHeaders.WriteRune(',') - } - } - } - canonicalHeaders.WriteRune('\n') - } - canonicalHeadersStr = canonicalHeaders.String() - - return signed, signedHeaders, canonicalHeadersStr -} - -func (s *httpSigner) buildCanonicalString(method, uri, query, signedHeaders, canonicalHeaders string) string { - return strings.Join([]string{ - method, - uri, - query, - canonicalHeaders, - signedHeaders, - s.PayloadHash, - }, "\n") -} - -func (s *httpSigner) buildStringToSign(credentialScope, canonicalRequestString string) string { - return strings.Join([]string{ - signingAlgorithm, - s.Time.TimeFormat(), - credentialScope, - hex.EncodeToString(makeHash(sha256.New(), []byte(canonicalRequestString))), - }, "\n") -} - -func makeHash(hash hash.Hash, b []byte) []byte { - hash.Reset() - hash.Write(b) - return hash.Sum(nil) -} - -func (s *httpSigner) buildSignature(strToSign string) (string, error) { - key := s.KeyDerivator.DeriveKey(s.Credentials, s.ServiceName, s.Region, s.Time) - return hex.EncodeToString(v4Internal.HMACSHA256(key, []byte(strToSign))), nil -} - -func (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Values) { - amzDate := s.Time.TimeFormat() - - if s.IsPreSign { - query.Set(v4Internal.AmzAlgorithmKey, signingAlgorithm) - sessionToken := s.Credentials.SessionToken - if !s.DisableSessionToken && len(sessionToken) > 0 { - query.Set("X-Amz-Security-Token", sessionToken) - } - - query.Set(v4Internal.AmzDateKey, amzDate) - return - } - - headers[v4Internal.AmzDateKey] = append(headers[v4Internal.AmzDateKey][:0], amzDate) - - if !s.DisableSessionToken && len(s.Credentials.SessionToken) > 0 { - headers[v4Internal.AmzSecurityTokenKey] = append(headers[v4Internal.AmzSecurityTokenKey][:0], s.Credentials.SessionToken) - } -} - -func logSigningInfo(ctx context.Context, options SignerOptions, request *signedRequest, isPresign bool) { - if !options.LogSigning { - return - } - signedURLMsg := "" - if isPresign { - signedURLMsg = fmt.Sprintf(logSignedURLMsg, request.Request.URL.String()) - } - logger := logging.WithContext(ctx, options.Logger) - logger.Logf(logging.Debug, logSignInfoMsg, request.CanonicalString, request.StringToSign, signedURLMsg) -} - -type signedRequest struct { - Request *http.Request - SignedHeaders http.Header - CanonicalString string - StringToSign string - PreSigned bool -} - -const logSignInfoMsg = `Request Signature: ----[ CANONICAL STRING ]----------------------------- -%s ----[ STRING TO SIGN ]-------------------------------- -%s%s ------------------------------------------------------` -const logSignedURLMsg = ` ----[ SIGNED URL ]------------------------------------ -%s` diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go deleted file mode 100644 index f3fc4d610..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by aws/generate.go DO NOT EDIT. - -package aws - -import ( - "github.com/aws/smithy-go/ptr" - "time" -) - -// Bool returns a pointer value for the bool value passed in. -func Bool(v bool) *bool { - return ptr.Bool(v) -} - -// BoolSlice returns a slice of bool pointers from the values -// passed in. -func BoolSlice(vs []bool) []*bool { - return ptr.BoolSlice(vs) -} - -// BoolMap returns a map of bool pointers from the values -// passed in. -func BoolMap(vs map[string]bool) map[string]*bool { - return ptr.BoolMap(vs) -} - -// Byte returns a pointer value for the byte value passed in. -func Byte(v byte) *byte { - return ptr.Byte(v) -} - -// ByteSlice returns a slice of byte pointers from the values -// passed in. -func ByteSlice(vs []byte) []*byte { - return ptr.ByteSlice(vs) -} - -// ByteMap returns a map of byte pointers from the values -// passed in. -func ByteMap(vs map[string]byte) map[string]*byte { - return ptr.ByteMap(vs) -} - -// String returns a pointer value for the string value passed in. -func String(v string) *string { - return ptr.String(v) -} - -// StringSlice returns a slice of string pointers from the values -// passed in. -func StringSlice(vs []string) []*string { - return ptr.StringSlice(vs) -} - -// StringMap returns a map of string pointers from the values -// passed in. -func StringMap(vs map[string]string) map[string]*string { - return ptr.StringMap(vs) -} - -// Int returns a pointer value for the int value passed in. -func Int(v int) *int { - return ptr.Int(v) -} - -// IntSlice returns a slice of int pointers from the values -// passed in. -func IntSlice(vs []int) []*int { - return ptr.IntSlice(vs) -} - -// IntMap returns a map of int pointers from the values -// passed in. -func IntMap(vs map[string]int) map[string]*int { - return ptr.IntMap(vs) -} - -// Int8 returns a pointer value for the int8 value passed in. -func Int8(v int8) *int8 { - return ptr.Int8(v) -} - -// Int8Slice returns a slice of int8 pointers from the values -// passed in. -func Int8Slice(vs []int8) []*int8 { - return ptr.Int8Slice(vs) -} - -// Int8Map returns a map of int8 pointers from the values -// passed in. -func Int8Map(vs map[string]int8) map[string]*int8 { - return ptr.Int8Map(vs) -} - -// Int16 returns a pointer value for the int16 value passed in. -func Int16(v int16) *int16 { - return ptr.Int16(v) -} - -// Int16Slice returns a slice of int16 pointers from the values -// passed in. -func Int16Slice(vs []int16) []*int16 { - return ptr.Int16Slice(vs) -} - -// Int16Map returns a map of int16 pointers from the values -// passed in. -func Int16Map(vs map[string]int16) map[string]*int16 { - return ptr.Int16Map(vs) -} - -// Int32 returns a pointer value for the int32 value passed in. -func Int32(v int32) *int32 { - return ptr.Int32(v) -} - -// Int32Slice returns a slice of int32 pointers from the values -// passed in. -func Int32Slice(vs []int32) []*int32 { - return ptr.Int32Slice(vs) -} - -// Int32Map returns a map of int32 pointers from the values -// passed in. -func Int32Map(vs map[string]int32) map[string]*int32 { - return ptr.Int32Map(vs) -} - -// Int64 returns a pointer value for the int64 value passed in. -func Int64(v int64) *int64 { - return ptr.Int64(v) -} - -// Int64Slice returns a slice of int64 pointers from the values -// passed in. -func Int64Slice(vs []int64) []*int64 { - return ptr.Int64Slice(vs) -} - -// Int64Map returns a map of int64 pointers from the values -// passed in. -func Int64Map(vs map[string]int64) map[string]*int64 { - return ptr.Int64Map(vs) -} - -// Uint returns a pointer value for the uint value passed in. -func Uint(v uint) *uint { - return ptr.Uint(v) -} - -// UintSlice returns a slice of uint pointers from the values -// passed in. -func UintSlice(vs []uint) []*uint { - return ptr.UintSlice(vs) -} - -// UintMap returns a map of uint pointers from the values -// passed in. -func UintMap(vs map[string]uint) map[string]*uint { - return ptr.UintMap(vs) -} - -// Uint8 returns a pointer value for the uint8 value passed in. -func Uint8(v uint8) *uint8 { - return ptr.Uint8(v) -} - -// Uint8Slice returns a slice of uint8 pointers from the values -// passed in. -func Uint8Slice(vs []uint8) []*uint8 { - return ptr.Uint8Slice(vs) -} - -// Uint8Map returns a map of uint8 pointers from the values -// passed in. -func Uint8Map(vs map[string]uint8) map[string]*uint8 { - return ptr.Uint8Map(vs) -} - -// Uint16 returns a pointer value for the uint16 value passed in. -func Uint16(v uint16) *uint16 { - return ptr.Uint16(v) -} - -// Uint16Slice returns a slice of uint16 pointers from the values -// passed in. -func Uint16Slice(vs []uint16) []*uint16 { - return ptr.Uint16Slice(vs) -} - -// Uint16Map returns a map of uint16 pointers from the values -// passed in. -func Uint16Map(vs map[string]uint16) map[string]*uint16 { - return ptr.Uint16Map(vs) -} - -// Uint32 returns a pointer value for the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return ptr.Uint32(v) -} - -// Uint32Slice returns a slice of uint32 pointers from the values -// passed in. -func Uint32Slice(vs []uint32) []*uint32 { - return ptr.Uint32Slice(vs) -} - -// Uint32Map returns a map of uint32 pointers from the values -// passed in. -func Uint32Map(vs map[string]uint32) map[string]*uint32 { - return ptr.Uint32Map(vs) -} - -// Uint64 returns a pointer value for the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return ptr.Uint64(v) -} - -// Uint64Slice returns a slice of uint64 pointers from the values -// passed in. -func Uint64Slice(vs []uint64) []*uint64 { - return ptr.Uint64Slice(vs) -} - -// Uint64Map returns a map of uint64 pointers from the values -// passed in. -func Uint64Map(vs map[string]uint64) map[string]*uint64 { - return ptr.Uint64Map(vs) -} - -// Float32 returns a pointer value for the float32 value passed in. -func Float32(v float32) *float32 { - return ptr.Float32(v) -} - -// Float32Slice returns a slice of float32 pointers from the values -// passed in. -func Float32Slice(vs []float32) []*float32 { - return ptr.Float32Slice(vs) -} - -// Float32Map returns a map of float32 pointers from the values -// passed in. -func Float32Map(vs map[string]float32) map[string]*float32 { - return ptr.Float32Map(vs) -} - -// Float64 returns a pointer value for the float64 value passed in. -func Float64(v float64) *float64 { - return ptr.Float64(v) -} - -// Float64Slice returns a slice of float64 pointers from the values -// passed in. -func Float64Slice(vs []float64) []*float64 { - return ptr.Float64Slice(vs) -} - -// Float64Map returns a map of float64 pointers from the values -// passed in. -func Float64Map(vs map[string]float64) map[string]*float64 { - return ptr.Float64Map(vs) -} - -// Time returns a pointer value for the time.Time value passed in. -func Time(v time.Time) *time.Time { - return ptr.Time(v) -} - -// TimeSlice returns a slice of time.Time pointers from the values -// passed in. -func TimeSlice(vs []time.Time) []*time.Time { - return ptr.TimeSlice(vs) -} - -// TimeMap returns a map of time.Time pointers from the values -// passed in. -func TimeMap(vs map[string]time.Time) map[string]*time.Time { - return ptr.TimeMap(vs) -} - -// Duration returns a pointer value for the time.Duration value passed in. -func Duration(v time.Duration) *time.Duration { - return ptr.Duration(v) -} - -// DurationSlice returns a slice of time.Duration pointers from the values -// passed in. -func DurationSlice(vs []time.Duration) []*time.Duration { - return ptr.DurationSlice(vs) -} - -// DurationMap returns a map of time.Duration pointers from the values -// passed in. -func DurationMap(vs map[string]time.Duration) map[string]*time.Duration { - return ptr.DurationMap(vs) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go deleted file mode 100644 index 8d7c35a9e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go +++ /dev/null @@ -1,342 +0,0 @@ -package http - -import ( - "context" - "crypto/tls" - "net" - "net/http" - "reflect" - "sync" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go/tracing" -) - -// Defaults for the HTTPTransportBuilder. -var ( - // Default connection pool options - DefaultHTTPTransportMaxIdleConns = 100 - DefaultHTTPTransportMaxIdleConnsPerHost = 10 - - // Default connection timeouts - DefaultHTTPTransportIdleConnTimeout = 90 * time.Second - DefaultHTTPTransportTLSHandleshakeTimeout = 10 * time.Second - DefaultHTTPTransportExpectContinueTimeout = 1 * time.Second - - // Default to TLS 1.2 for all HTTPS requests. - DefaultHTTPTransportTLSMinVersion uint16 = tls.VersionTLS12 -) - -// Timeouts for net.Dialer's network connection. -var ( - DefaultDialConnectTimeout = 30 * time.Second - DefaultDialKeepAliveTimeout = 30 * time.Second -) - -// BuildableClient provides a HTTPClient implementation with options to -// create copies of the HTTPClient when additional configuration is provided. -// -// The client's methods will not share the http.Transport value between copies -// of the BuildableClient. Only exported member values of the Transport and -// optional Dialer will be copied between copies of BuildableClient. -type BuildableClient struct { - transport *http.Transport - dialer *net.Dialer - - initOnce sync.Once - - clientTimeout time.Duration - client *http.Client -} - -// NewBuildableClient returns an initialized client for invoking HTTP -// requests. -func NewBuildableClient() *BuildableClient { - return &BuildableClient{} -} - -// Do implements the HTTPClient interface's Do method to invoke a HTTP request, -// and receive the response. Uses the BuildableClient's current -// configuration to invoke the http.Request. -// -// If connection pooling is enabled (aka HTTP KeepAlive) the client will only -// share pooled connections with its own instance. Copies of the -// BuildableClient will have their own connection pools. -// -// Redirect (3xx) responses will not be followed, the HTTP response received -// will returned instead. -func (b *BuildableClient) Do(req *http.Request) (*http.Response, error) { - b.initOnce.Do(b.build) - - return b.client.Do(req) -} - -// Freeze returns a frozen aws.HTTPClient implementation that is no longer a BuildableClient. -// Use this to prevent the SDK from applying DefaultMode configuration values to a buildable client. -func (b *BuildableClient) Freeze() aws.HTTPClient { - cpy := b.clone() - cpy.build() - return cpy.client -} - -func (b *BuildableClient) build() { - b.client = wrapWithLimitedRedirect(&http.Client{ - Timeout: b.clientTimeout, - Transport: b.GetTransport(), - }) -} - -func (b *BuildableClient) clone() *BuildableClient { - cpy := NewBuildableClient() - cpy.transport = b.GetTransport() - cpy.dialer = b.GetDialer() - cpy.clientTimeout = b.clientTimeout - - return cpy -} - -// WithTransportOptions copies the BuildableClient and returns it with the -// http.Transport options applied. -// -// If a non (*http.Transport) was set as the round tripper, the round tripper -// will be replaced with a default Transport value before invoking the option -// functions. -func (b *BuildableClient) WithTransportOptions(opts ...func(*http.Transport)) *BuildableClient { - cpy := b.clone() - - tr := cpy.GetTransport() - for _, opt := range opts { - opt(tr) - } - cpy.transport = tr - - return cpy -} - -// WithDialerOptions copies the BuildableClient and returns it with the -// net.Dialer options applied. Will set the client's http.Transport DialContext -// member. -func (b *BuildableClient) WithDialerOptions(opts ...func(*net.Dialer)) *BuildableClient { - cpy := b.clone() - - dialer := cpy.GetDialer() - for _, opt := range opts { - opt(dialer) - } - cpy.dialer = dialer - - tr := cpy.GetTransport() - tr.DialContext = cpy.dialer.DialContext - cpy.transport = tr - - return cpy -} - -// WithTimeout Sets the timeout used by the client for all requests. -func (b *BuildableClient) WithTimeout(timeout time.Duration) *BuildableClient { - cpy := b.clone() - cpy.clientTimeout = timeout - return cpy -} - -// GetTransport returns a copy of the client's HTTP Transport. -func (b *BuildableClient) GetTransport() *http.Transport { - var tr *http.Transport - if b.transport != nil { - tr = b.transport.Clone() - } else { - tr = defaultHTTPTransport() - } - - return tr -} - -// GetDialer returns a copy of the client's network dialer. -func (b *BuildableClient) GetDialer() *net.Dialer { - var dialer *net.Dialer - if b.dialer != nil { - dialer = shallowCopyStruct(b.dialer).(*net.Dialer) - } else { - dialer = defaultDialer() - } - - return dialer -} - -// GetTimeout returns a copy of the client's timeout to cancel requests with. -func (b *BuildableClient) GetTimeout() time.Duration { - return b.clientTimeout -} - -func defaultDialer() *net.Dialer { - return &net.Dialer{ - Timeout: DefaultDialConnectTimeout, - KeepAlive: DefaultDialKeepAliveTimeout, - DualStack: true, - } -} - -func defaultHTTPTransport() *http.Transport { - dialer := defaultDialer() - - tr := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: traceDialContext(dialer.DialContext), - TLSHandshakeTimeout: DefaultHTTPTransportTLSHandleshakeTimeout, - MaxIdleConns: DefaultHTTPTransportMaxIdleConns, - MaxIdleConnsPerHost: DefaultHTTPTransportMaxIdleConnsPerHost, - IdleConnTimeout: DefaultHTTPTransportIdleConnTimeout, - ExpectContinueTimeout: DefaultHTTPTransportExpectContinueTimeout, - ForceAttemptHTTP2: true, - TLSClientConfig: &tls.Config{ - MinVersion: DefaultHTTPTransportTLSMinVersion, - }, - } - - return tr -} - -type dialContext func(ctx context.Context, network, addr string) (net.Conn, error) - -func traceDialContext(dc dialContext) dialContext { - return func(ctx context.Context, network, addr string) (net.Conn, error) { - span, _ := tracing.GetSpan(ctx) - span.SetProperty("net.peer.name", addr) - - conn, err := dc(ctx, network, addr) - if err != nil { - return conn, err - } - - raddr := conn.RemoteAddr() - if raddr == nil { - return conn, err - } - - host, port, err := net.SplitHostPort(raddr.String()) - if err != nil { // don't blow up just because we couldn't parse - span.SetProperty("net.peer.addr", raddr.String()) - } else { - span.SetProperty("net.peer.host", host) - span.SetProperty("net.peer.port", port) - } - - return conn, err - } -} - -// shallowCopyStruct creates a shallow copy of the passed in source struct, and -// returns that copy of the same struct type. -func shallowCopyStruct(src interface{}) interface{} { - srcVal := reflect.ValueOf(src) - srcValType := srcVal.Type() - - var returnAsPtr bool - if srcValType.Kind() == reflect.Ptr { - srcVal = srcVal.Elem() - srcValType = srcValType.Elem() - returnAsPtr = true - } - dstVal := reflect.New(srcValType).Elem() - - for i := 0; i < srcValType.NumField(); i++ { - ft := srcValType.Field(i) - if len(ft.PkgPath) != 0 { - // unexported fields have a PkgPath - continue - } - - dstVal.Field(i).Set(srcVal.Field(i)) - } - - if returnAsPtr { - dstVal = dstVal.Addr() - } - - return dstVal.Interface() -} - -// wrapWithLimitedRedirect updates the Client's Transport and CheckRedirect to -// not follow any redirect other than 307 and 308. No other redirect will be -// followed. -// -// If the client does not have a Transport defined will use a new SDK default -// http.Transport configuration. -func wrapWithLimitedRedirect(c *http.Client) *http.Client { - tr := c.Transport - if tr == nil { - tr = defaultHTTPTransport() - } - - cc := *c - cc.CheckRedirect = limitedRedirect - cc.Transport = suppressBadHTTPRedirectTransport{ - tr: tr, - } - - return &cc -} - -// limitedRedirect is a CheckRedirect that prevents the client from following -// any non 307/308 HTTP status code redirects. -// -// The 307 and 308 redirects are allowed because the client must use the -// original HTTP method for the redirected to location. Whereas 301 and 302 -// allow the client to switch to GET for the redirect. -// -// Suppresses all redirect requests with a URL of badHTTPRedirectLocation. -func limitedRedirect(r *http.Request, via []*http.Request) error { - // Request.Response, in CheckRedirect is the response that is triggering - // the redirect. - resp := r.Response - if r.URL.String() == badHTTPRedirectLocation { - resp.Header.Del(badHTTPRedirectLocation) - return http.ErrUseLastResponse - } - - switch resp.StatusCode { - case 307, 308: - // Only allow 307 and 308 redirects as they preserve the method. - return nil - } - - return http.ErrUseLastResponse -} - -// suppressBadHTTPRedirectTransport provides an http.RoundTripper -// implementation that wraps another http.RoundTripper to prevent HTTP client -// receiving 301 and 302 HTTP responses redirects without the required location -// header. -// -// Clients using this utility must have a CheckRedirect, e.g. limitedRedirect, -// that check for responses with having a URL of baseHTTPRedirectLocation, and -// suppress the redirect. -type suppressBadHTTPRedirectTransport struct { - tr http.RoundTripper -} - -const badHTTPRedirectLocation = `https://amazonaws.com/badhttpredirectlocation` - -// RoundTrip backfills a stub location when a 301/302 response is received -// without a location. This stub location is used by limitedRedirect to prevent -// the HTTP client from failing attempting to use follow a redirect without a -// location value. -func (t suppressBadHTTPRedirectTransport) RoundTrip(r *http.Request) (*http.Response, error) { - resp, err := t.tr.RoundTrip(r) - if err != nil { - return resp, err - } - - // S3 is the only known service to return 301 without location header. - // The Go standard library HTTP client will return an opaque error if it - // tries to follow a 301/302 response missing the location header. - switch resp.StatusCode { - case 301, 302: - if v := resp.Header.Get("Location"); len(v) == 0 { - resp.Header.Set("Location", badHTTPRedirectLocation) - } - } - - return resp, err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.go deleted file mode 100644 index 556f54a7f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.go +++ /dev/null @@ -1,42 +0,0 @@ -package http - -import ( - "context" - "fmt" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// removeContentTypeHeader is a build middleware that removes -// content type header if content-length header is unset or -// is set to zero, -type removeContentTypeHeader struct { -} - -// ID the name of the middleware. -func (m *removeContentTypeHeader) ID() string { - return "RemoveContentTypeHeader" -} - -// HandleBuild adds or appends the constructed user agent to the request. -func (m *removeContentTypeHeader) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in) - } - - // remove contentTypeHeader when content-length is zero - if req.ContentLength == 0 { - req.Header.Del("content-type") - } - - return next.HandleBuild(ctx, in) -} - -// RemoveContentTypeHeader removes content-type header if -// content length is unset or equal to zero. -func RemoveContentTypeHeader(stack *middleware.Stack) error { - return stack.Build.Add(&removeContentTypeHeader{}, middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.go deleted file mode 100644 index 44651c990..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.go +++ /dev/null @@ -1,33 +0,0 @@ -package http - -import ( - "errors" - "fmt" - - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// ResponseError provides the HTTP centric error type wrapping the underlying error -// with the HTTP response value and the deserialized RequestID. -type ResponseError struct { - *smithyhttp.ResponseError - - // RequestID associated with response error - RequestID string -} - -// ServiceRequestID returns the request id associated with Response Error -func (e *ResponseError) ServiceRequestID() string { return e.RequestID } - -// Error returns the formatted error -func (e *ResponseError) Error() string { - return fmt.Sprintf( - "https response error StatusCode: %d, RequestID: %s, %v", - e.Response.StatusCode, e.RequestID, e.Err) -} - -// As populates target and returns true if the type of target is a error type that -// the ResponseError embeds, (e.g.AWS HTTP ResponseError) -func (e *ResponseError) As(target interface{}) bool { - return errors.As(e.ResponseError, target) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go deleted file mode 100644 index a1ad20fe3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go +++ /dev/null @@ -1,56 +0,0 @@ -package http - -import ( - "context" - - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// AddResponseErrorMiddleware adds response error wrapper middleware -func AddResponseErrorMiddleware(stack *middleware.Stack) error { - // add error wrapper middleware before request id retriever middleware so that it can wrap the error response - // returned by operation deserializers - return stack.Deserialize.Insert(&ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) -} - -// ResponseErrorWrapper wraps operation errors with ResponseError. -type ResponseErrorWrapper struct { -} - -// ID returns the middleware identifier -func (m *ResponseErrorWrapper) ID() string { - return "ResponseErrorWrapper" -} - -// HandleDeserialize wraps the stack error with smithyhttp.ResponseError. -func (m *ResponseErrorWrapper) 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 { - // Nothing to do when there is no error. - return out, metadata, err - } - - resp, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - // No raw response to wrap with. - return out, metadata, err - } - - // look for request id in metadata - reqID, _ := awsmiddleware.GetRequestIDMetadata(metadata) - - // Wrap the returned smithy error with the request id retrieved from the metadata - err = &ResponseError{ - ResponseError: &smithyhttp.ResponseError{ - Response: resp, - Err: err, - }, - RequestID: reqID, - } - - return out, metadata, err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go deleted file mode 100644 index 993929bd9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go +++ /dev/null @@ -1,104 +0,0 @@ -package http - -import ( - "context" - "fmt" - "io" - "time" - - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type readResult struct { - n int - err error -} - -// ResponseTimeoutError is an error when the reads from the response are -// delayed longer than the timeout the read was configured for. -type ResponseTimeoutError struct { - TimeoutDur time.Duration -} - -// Timeout returns that the error is was caused by a timeout, and can be -// retried. -func (*ResponseTimeoutError) Timeout() bool { return true } - -func (e *ResponseTimeoutError) Error() string { - return fmt.Sprintf("read on body reach timeout limit, %v", e.TimeoutDur) -} - -// timeoutReadCloser will handle body reads that take too long. -// We will return a ErrReadTimeout error if a timeout occurs. -type timeoutReadCloser struct { - reader io.ReadCloser - duration time.Duration -} - -// Read will spin off a goroutine to call the reader's Read method. We will -// select on the timer's channel or the read's channel. Whoever completes first -// will be returned. -func (r *timeoutReadCloser) Read(b []byte) (int, error) { - timer := time.NewTimer(r.duration) - c := make(chan readResult, 1) - - go func() { - n, err := r.reader.Read(b) - timer.Stop() - c <- readResult{n: n, err: err} - }() - - select { - case data := <-c: - return data.n, data.err - case <-timer.C: - return 0, &ResponseTimeoutError{TimeoutDur: r.duration} - } -} - -func (r *timeoutReadCloser) Close() error { - return r.reader.Close() -} - -// AddResponseReadTimeoutMiddleware adds a middleware to the stack that wraps the -// response body so that a read that takes too long will return an error. -func AddResponseReadTimeoutMiddleware(stack *middleware.Stack, duration time.Duration) error { - return stack.Deserialize.Add(&readTimeout{duration: duration}, middleware.After) -} - -// readTimeout wraps the response body with a timeoutReadCloser -type readTimeout struct { - duration time.Duration -} - -// ID returns the id of the middleware -func (*readTimeout) ID() string { - return "ReadResponseTimeout" -} - -// HandleDeserialize implements the DeserializeMiddleware interface -func (m *readTimeout) 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)} - } - - response.Body = &timeoutReadCloser{ - reader: response.Body, - duration: m.duration, - } - out.RawResponse = response - - return out, metadata, err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/types.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/types.go deleted file mode 100644 index cc3ae8114..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/types.go +++ /dev/null @@ -1,42 +0,0 @@ -package aws - -import ( - "fmt" -) - -// Ternary is an enum allowing an unknown or none state in addition to a bool's -// true and false. -type Ternary int - -func (t Ternary) String() string { - switch t { - case UnknownTernary: - return "unknown" - case FalseTernary: - return "false" - case TrueTernary: - return "true" - default: - return fmt.Sprintf("unknown value, %d", int(t)) - } -} - -// Bool returns true if the value is TrueTernary, false otherwise. -func (t Ternary) Bool() bool { - return t == TrueTernary -} - -// Enumerations for the values of the Ternary type. -const ( - UnknownTernary Ternary = iota - FalseTernary - TrueTernary -) - -// BoolTernary returns a true or false Ternary value for the bool provided. -func BoolTernary(v bool) Ternary { - if v { - return TrueTernary - } - return FalseTernary -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go deleted file mode 100644 index 5f729d45e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package aws provides core functionality for making requests to AWS services. -package aws - -// SDKName is the name of this AWS SDK -const SDKName = "aws-sdk-go-v2" - -// SDKVersion is the version of this SDK -const SDKVersion = goModuleVersion 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 deleted file mode 100644 index 526537b8b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ /dev/null @@ -1,945 +0,0 @@ -# v1.31.12 (2025-09-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.11 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.10 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.9 (2025-09-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.8 (2025-09-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.7 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.6 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.5 (2025-08-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.4 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.3 (2025-08-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.2 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.1 (2025-08-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.3 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.2 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.1 (2025-07-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.18 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.17 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.16 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.15 (2025-06-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.14 (2025-04-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.13 (2025-04-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.12 (2025-03-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.11 (2025-03-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.10 (2025-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.9 (2025-03-04.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.8 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.7 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.6 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.5 (2025-02-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.4 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.3 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.2 (2025-01-24) - -* **Bug Fix**: Fix env config naming and usage of deprecated ioutil -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.29.1 (2025-01-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2025-01-15) - -* **Feature**: S3 client behavior is updated to always calculate a checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). The checksum algorithm used by default now becomes CRC32. Checksum behavior can be configured using `when_supported` and `when_required` options - in code using RequestChecksumCalculation, in shared config using request_checksum_calculation, or as env variable using AWS_REQUEST_CHECKSUM_CALCULATION. The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using `when_supported` and `when_required` options - in code using ResponseChecksumValidation, in shared config using response_checksum_validation, or as env variable using AWS_RESPONSE_CHECKSUM_VALIDATION. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.11 (2025-01-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.10 (2025-01-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.9 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.8 (2025-01-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.7 (2024-12-19) - -* **Bug Fix**: Fix improper use of printf-style functions. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.6 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.5 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.4 (2024-11-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.3 (2024-11-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.2 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2024-10-16) - -* **Feature**: Adds the LoadOptions hook `WithBaseEndpoint` for setting global endpoint override in-code. - -# v1.27.43 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.42 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.41 (2024-10-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.40 (2024-10-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.39 (2024-09-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.38 (2024-09-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.37 (2024-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.36 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.35 (2024-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.34 (2024-09-16) - -* **Bug Fix**: Read `AWS_CONTAINER_CREDENTIALS_FULL_URI` env variable if set when reading a profile with `credential_source`. Also ensure `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is always read before it - -# v1.27.33 (2024-09-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.32 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.31 (2024-08-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.30 (2024-08-23) - -* **Bug Fix**: Don't fail credentials unit tests if credentials are found on a file - -# v1.27.29 (2024-08-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.28 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.27 (2024-07-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.26 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.25 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.24 (2024-07-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.23 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.22 (2024-06-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.21 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.20 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.19 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.18 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.17 (2024-06-03) - -* **Documentation**: Add deprecation docs to global endpoint resolution interfaces. These APIs were previously deprecated with the introduction of service-specific endpoint resolution (EndpointResolverV2 and BaseEndpoint on service client options). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.16 (2024-05-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.15 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.14 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.13 (2024-05-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.12 (2024-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.11 (2024-04-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.10 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.9 (2024-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.8 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.7 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.6 (2024-03-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.5 (2024-03-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.4 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.3 (2024-02-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.1 (2024-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.6 (2024-01-22) - -* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.5 (2024-01-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.4 (2024-01-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.3 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.2 (2023-12-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.1 (2023-12-08) - -* **Bug Fix**: Correct loading of [services *] sections into shared config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2023-12-07) - -* **Feature**: Support modeled request compression. The only algorithm supported at this time is `gzip`. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.12 (2023-12-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.11 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.10 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.9 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.8 (2023-11-28.3) - -* **Bug Fix**: Correct resolution of S3Express auth disable toggle. - -# v1.25.7 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.6 (2023-11-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.5 (2023-11-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.4 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.3 (2023-11-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.2 (2023-11-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.1 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2023-11-14) - -* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2023-11-13) - -* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2023-11-09.2) - -* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.3 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.2 (2023-11-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2023-11-06) - -* No change notes available for this release. - -# v1.22.0 (2023-11-02) - -* **Feature**: Add env and shared config settings for disabling IMDSv1 fallback. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2023-10-24) - -* No change notes available for this release. - -# v1.19.0 (2023-10-16) - -* **Feature**: Modify logic of retrieving user agent appID from env config - -# v1.18.45 (2023-10-12) - -* **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.44 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.43 (2023-10-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.42 (2023-09-22) - -* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. -* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.41 (2023-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.40 (2023-09-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.39 (2023-09-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.38 (2023-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.37 (2023-08-23) - -* No change notes available for this release. - -# v1.18.36 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.35 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.34 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.33 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.32 (2023-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.31 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.30 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.29 (2023-07-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.28 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.27 (2023-06-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.26 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.25 (2023-05-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.24 (2023-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.23 (2023-05-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.22 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.21 (2023-04-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.20 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.19 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.18 (2023-03-16) - -* **Bug Fix**: Allow RoleARN to be set as functional option on STS WebIdentityRoleOptions. Fixes aws/aws-sdk-go-v2#2015. - -# v1.18.17 (2023-03-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.16 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.15 (2023-02-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.14 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.13 (2023-02-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.12 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.11 (2023-02-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.10 (2023-01-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.9 (2023-01-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.8 (2023-01-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.7 (2022-12-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.6 (2022-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2022-12-15) - -* **Bug Fix**: Unify logic between shared config and in finding home directory -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.4 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2022-11-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2022-11-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2022-11-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2022-11-11) - -* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846 -* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.11 (2022-11-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.10 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.9 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.8 (2022-09-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.7 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.6 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.4 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2022-08-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2022-08-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2022-08-14) - -* **Feature**: Add alternative mechanism for determning the users `$HOME` or `%USERPROFILE%` location when the environment variables are not present. - -# v1.16.1 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2022-08-10) - -* **Feature**: Adds support for the following settings in the `~/.aws/credentials` file: `sso_account_id`, `sso_region`, `sso_role_name`, `sso_start_url`, and `ca_bundle`. - -# v1.15.17 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.16 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.15 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.14 (2022-07-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.13 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.12 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.11 (2022-06-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.10 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.9 (2022-05-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.8 (2022-05-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.7 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.6 (2022-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.5 (2022-05-09) - -* **Bug Fix**: Fixes a bug in LoadDefaultConfig to correctly assign ConfigSources so all config resolvers have access to the config sources. This fixes the feature/ec2/imds client not having configuration applied via config.LoadOptions such as EC2IMDSClientEnableState. PR [#1682](https://github.com/aws/aws-sdk-go-v2/pull/1682) - -# v1.15.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2022-02-24) - -* **Feature**: Adds support for loading RetryMaxAttempts and RetryMod from the environment and shared configuration files. These parameters drive how the SDK's API client will initialize its default retryer, if custome retryer has not been specified. See [config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config) module and [aws.Config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config) for more information about and how to use these new options. -* **Feature**: Adds support for the `ca_bundle` parameter in shared config and credentials files. The usage of the file is the same as environment variable, `AWS_CA_BUNDLE`, but sourced from shared config. Fixes [#1589](https://github.com/aws/aws-sdk-go-v2/issues/1589) -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2022-01-28) - -* **Bug Fix**: Fixes LoadDefaultConfig handling of errors returned by passed in functional options. Previously errors returned from the LoadOptions passed into LoadDefaultConfig were incorrectly ignored. [#1562](https://github.com/aws/aws-sdk-go-v2/pull/1562). Thanks to [Pinglei Guo](https://github.com/pingleig) for submitting this PR. -* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. -* **Bug Fix**: Updates `config` module to use os.UserHomeDir instead of hard coded environment variable for OS. [#1563](https://github.com/aws/aws-sdk-go-v2/pull/1563) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-01-07) - -* **Feature**: Add load option for CredentialCache. Adds a new member to the LoadOptions struct, CredentialsCacheOptions. This member allows specifying a function that will be used to configure the CredentialsCache. The CredentialsCacheOptions will only be used if the configuration loader will wrap the underlying credential provider in the CredentialsCache. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.1 (2021-12-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2021-12-02) - -* **Feature**: Add support for specifying `EndpointResolverWithOptions` on `LoadOptions`, and associated `WithEndpointResolverWithOptions`. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.3 (2021-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.2 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.1 (2021-11-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.3 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.2 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.1 (2021-09-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-09-02) - -* **Feature**: Add support for S3 Multi-Region Access Point ARNs. - -# v1.7.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-08-04) - -* **Feature**: adds error handling for defered close calls -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-07-15) - -* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-07-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-06-25) - -* **Feature**: Adds configuration setting for enabling endpoint discovery. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-05-20) - -* **Feature**: SSO credentials can now be defined alongside other credential providers within the same configuration profile. -* **Bug Fix**: Profile names were incorrectly normalized to lower-case, which could result in unexpected profile configurations. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.go b/vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.go deleted file mode 100644 index 99e123661..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.go +++ /dev/null @@ -1,19 +0,0 @@ -package config - -import "strings" - -func toAuthSchemePreferenceList(cfg string) []string { - if len(cfg) == 0 { - return nil - } - parts := strings.Split(cfg, ",") - ids := make([]string, 0, len(parts)) - - for _, p := range parts { - if id := strings.TrimSpace(p); len(id) > 0 { - ids = append(ids, id) - } - } - - return ids -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go deleted file mode 100644 index caa20a158..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go +++ /dev/null @@ -1,235 +0,0 @@ -package config - -import ( - "context" - "os" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// defaultAWSConfigResolvers are a slice of functions that will resolve external -// configuration values into AWS configuration values. -// -// This will setup the AWS configuration's Region, -var defaultAWSConfigResolvers = []awsConfigResolver{ - // Resolves the default configuration the SDK's aws.Config will be - // initialized with. - resolveDefaultAWSConfig, - - // Sets the logger to be used. Could be user provided logger, and client - // logging mode. - resolveLogger, - resolveClientLogMode, - - // Sets the HTTP client and configuration to use for making requests using - // the HTTP transport. - resolveHTTPClient, - resolveCustomCABundle, - - // Sets the endpoint resolving behavior the API Clients will use for making - // requests to. Clients default to their own clients this allows overrides - // to be specified. The resolveEndpointResolver option is deprecated, but - // we still need to set it for backwards compatibility on config - // construction. - resolveEndpointResolver, - resolveEndpointResolverWithOptions, - - // Sets the retry behavior API clients will use within their retry attempt - // middleware. Defaults to unset, allowing API clients to define their own - // retry behavior. - resolveRetryer, - - // Sets the region the API Clients should use for making requests to. - resolveRegion, - resolveEC2IMDSRegion, - resolveDefaultRegion, - - // Sets the additional set of middleware stack mutators that will custom - // API client request pipeline middleware. - resolveAPIOptions, - - // Resolves the DefaultsMode that should be used by SDK clients. If this - // mode is set to DefaultsModeAuto. - // - // Comes after HTTPClient and CustomCABundle to ensure the HTTP client is - // configured if provided before invoking IMDS if mode is auto. Comes - // before resolving credentials so that those subsequent clients use the - // configured auto mode. - resolveDefaultsModeOptions, - - // Sets the resolved credentials the API clients will use for - // authentication. Provides the SDK's default credential chain. - // - // Should probably be the last step in the resolve chain to ensure that all - // other configurations are resolved first in case downstream credentials - // implementations depend on or can be configured with earlier resolved - // configuration options. - resolveCredentials, - - // Sets the resolved bearer authentication token API clients will use for - // httpBearerAuth authentication scheme. - resolveBearerAuthToken, - - // Sets the sdk app ID if present in env var or shared config profile - resolveAppID, - - resolveBaseEndpoint, - - // Sets the DisableRequestCompression if present in env var or shared config profile - resolveDisableRequestCompression, - - // Sets the RequestMinCompressSizeBytes if present in env var or shared config profile - resolveRequestMinCompressSizeBytes, - - // Sets the AccountIDEndpointMode if present in env var or shared config profile - resolveAccountIDEndpointMode, - - // Sets the RequestChecksumCalculation if present in env var or shared config profile - resolveRequestChecksumCalculation, - - // Sets the ResponseChecksumValidation if present in env var or shared config profile - resolveResponseChecksumValidation, - - resolveInterceptors, - - resolveAuthSchemePreference, - - // Sets the ServiceOptions if present in LoadOptions - resolveServiceOptions, -} - -// A Config represents a generic configuration value or set of values. This type -// will be used by the AWSConfigResolvers to extract -// -// General the Config type will use type assertion against the Provider interfaces -// to extract specific data from the Config. -type Config interface{} - -// A loader is used to load external configuration data and returns it as -// a generic Config type. -// -// The loader should return an error if it fails to load the external configuration -// or the configuration data is malformed, or required components missing. -type loader func(context.Context, configs) (Config, error) - -// An awsConfigResolver will extract configuration data from the configs slice -// using the provider interfaces to extract specific functionality. The extracted -// configuration values will be written to the AWS Config value. -// -// The resolver should return an error if it it fails to extract the data, the -// data is malformed, or incomplete. -type awsConfigResolver func(ctx context.Context, cfg *aws.Config, configs configs) error - -// configs is a slice of Config values. These values will be used by the -// AWSConfigResolvers to extract external configuration values to populate the -// AWS Config type. -// -// Use AppendFromLoaders to add additional external Config values that are -// loaded from external sources. -// -// Use ResolveAWSConfig after external Config values have been added or loaded -// to extract the loaded configuration values into the AWS Config. -type configs []Config - -// AppendFromLoaders iterates over the slice of loaders passed in calling each -// loader function in order. The external config value returned by the loader -// will be added to the returned configs slice. -// -// If a loader returns an error this method will stop iterating and return -// that error. -func (cs configs) AppendFromLoaders(ctx context.Context, loaders []loader) (configs, error) { - for _, fn := range loaders { - cfg, err := fn(ctx, cs) - if err != nil { - return nil, err - } - - cs = append(cs, cfg) - } - - return cs, nil -} - -// ResolveAWSConfig returns a AWS configuration populated with values by calling -// the resolvers slice passed in. Each resolver is called in order. Any resolver -// may overwrite the AWS Configuration value of a previous resolver. -// -// If an resolver returns an error this method will return that error, and stop -// iterating over the resolvers. -func (cs configs) ResolveAWSConfig(ctx context.Context, resolvers []awsConfigResolver) (aws.Config, error) { - var cfg aws.Config - - for _, fn := range resolvers { - if err := fn(ctx, &cfg, cs); err != nil { - return aws.Config{}, err - } - } - - return cfg, nil -} - -// ResolveConfig calls the provide function passing slice of configuration sources. -// This implements the aws.ConfigResolver interface. -func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { - var cfgs []interface{} - for i := range cs { - cfgs = append(cfgs, cs[i]) - } - return f(cfgs) -} - -// LoadDefaultConfig reads the SDK's default external configurations, and -// populates an AWS Config with the values from the external configurations. -// -// An optional variadic set of additional Config values can be provided as input -// that will be prepended to the configs slice. Use this to add custom configuration. -// The custom configurations must satisfy the respective providers for their data -// or the custom data will be ignored by the resolvers and config loaders. -// -// cfg, err := config.LoadDefaultConfig( context.TODO(), -// config.WithSharedConfigProfile("test-profile"), -// ) -// if err != nil { -// panic(fmt.Sprintf("failed loading config, %v", err)) -// } -// -// The default configuration sources are: -// * Environment Variables -// * Shared Configuration and Shared Credentials files. -func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) { - var options LoadOptions - for _, optFn := range optFns { - if err := optFn(&options); err != nil { - return aws.Config{}, err - } - } - - // assign Load Options to configs - var cfgCpy = configs{options} - - cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options)) - if err != nil { - return aws.Config{}, err - } - - cfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers) - if err != nil { - return aws.Config{}, err - } - - return cfg, nil -} - -func resolveConfigLoaders(options *LoadOptions) []loader { - loaders := make([]loader, 2) - loaders[0] = loadEnvConfig - - // specification of a profile should cause a load failure if it doesn't exist - if os.Getenv(awsProfileEnv) != "" || options.SharedConfigProfile != "" { - loaders[1] = loadSharedConfig - } else { - loaders[1] = loadSharedConfigIgnoreNotExist - } - - return loaders -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go b/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go deleted file mode 100644 index 20b66367f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go +++ /dev/null @@ -1,47 +0,0 @@ -package config - -import ( - "context" - "os" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" -) - -const execEnvVar = "AWS_EXECUTION_ENV" - -// DefaultsModeOptions is the set of options that are used to configure -type DefaultsModeOptions struct { - // The SDK configuration defaults mode. Defaults to legacy if not specified. - // - // Supported modes are: auto, cross-region, in-region, legacy, mobile, standard - Mode aws.DefaultsMode - - // The EC2 Instance Metadata Client that should be used when performing environment - // discovery when aws.DefaultsModeAuto is set. - // - // If not specified the SDK will construct a client if the instance metadata service has not been disabled by - // the AWS_EC2_METADATA_DISABLED environment variable. - IMDSClient *imds.Client -} - -func resolveDefaultsModeRuntimeEnvironment(ctx context.Context, envConfig *EnvConfig, client *imds.Client) (aws.RuntimeEnvironment, error) { - getRegionOutput, err := client.GetRegion(ctx, &imds.GetRegionInput{}) - // honor context timeouts, but if we couldn't talk to IMDS don't fail runtime environment introspection. - select { - case <-ctx.Done(): - return aws.RuntimeEnvironment{}, err - default: - } - - var imdsRegion string - if err == nil { - imdsRegion = getRegionOutput.Region - } - - return aws.RuntimeEnvironment{ - EnvironmentIdentifier: aws.ExecutionEnvironmentID(os.Getenv(execEnvVar)), - Region: envConfig.Region, - EC2InstanceMetadataRegion: imdsRegion, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go deleted file mode 100644 index aab7164e2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Package config provides utilities for loading configuration from multiple -// sources that can be used to configure the SDK's API clients, and utilities. -// -// The config package will load configuration from environment variables, AWS -// shared configuration file (~/.aws/config), and AWS shared credentials file -// (~/.aws/credentials). -// -// Use the LoadDefaultConfig to load configuration from all the SDK's supported -// sources, and resolve credentials using the SDK's default credential chain. -// -// LoadDefaultConfig allows for a variadic list of additional Config sources that can -// provide one or more configuration values which can be used to programmatically control the resolution -// of a specific value, or allow for broader range of additional configuration sources not supported by the SDK. -// A Config source implements one or more provider interfaces defined in this package. Config sources passed in will -// take precedence over the default environment and shared config sources used by the SDK. If one or more Config sources -// implement the same provider interface, priority will be handled by the order in which the sources were passed in. -// -// A number of helpers (prefixed by “With“) are provided in this package that implement their respective provider -// interface. These helpers should be used for overriding configuration programmatically at runtime. -package config diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go deleted file mode 100644 index e932c63df..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go +++ /dev/null @@ -1,932 +0,0 @@ -package config - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" - smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" -) - -// CredentialsSourceName provides a name of the provider when config is -// loaded from environment. -const CredentialsSourceName = "EnvConfigCredentials" - -// Environment variables that will be read for configuration values. -const ( - awsAccessKeyIDEnv = "AWS_ACCESS_KEY_ID" - awsAccessKeyEnv = "AWS_ACCESS_KEY" - - awsSecretAccessKeyEnv = "AWS_SECRET_ACCESS_KEY" - awsSecretKeyEnv = "AWS_SECRET_KEY" - - awsSessionTokenEnv = "AWS_SESSION_TOKEN" - - awsContainerCredentialsFullURIEnv = "AWS_CONTAINER_CREDENTIALS_FULL_URI" - awsContainerCredentialsRelativeURIEnv = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" - awsContainerAuthorizationTokenEnv = "AWS_CONTAINER_AUTHORIZATION_TOKEN" - - awsRegionEnv = "AWS_REGION" - awsDefaultRegionEnv = "AWS_DEFAULT_REGION" - - awsProfileEnv = "AWS_PROFILE" - awsDefaultProfileEnv = "AWS_DEFAULT_PROFILE" - - awsSharedCredentialsFileEnv = "AWS_SHARED_CREDENTIALS_FILE" - - awsConfigFileEnv = "AWS_CONFIG_FILE" - - awsCABundleEnv = "AWS_CA_BUNDLE" - - awsWebIdentityTokenFileEnv = "AWS_WEB_IDENTITY_TOKEN_FILE" - - awsRoleARNEnv = "AWS_ROLE_ARN" - awsRoleSessionNameEnv = "AWS_ROLE_SESSION_NAME" - - awsEnableEndpointDiscoveryEnv = "AWS_ENABLE_ENDPOINT_DISCOVERY" - - awsS3UseARNRegionEnv = "AWS_S3_USE_ARN_REGION" - - awsEc2MetadataServiceEndpointModeEnv = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE" - - awsEc2MetadataServiceEndpointEnv = "AWS_EC2_METADATA_SERVICE_ENDPOINT" - - awsEc2MetadataDisabledEnv = "AWS_EC2_METADATA_DISABLED" - awsEc2MetadataV1DisabledEnv = "AWS_EC2_METADATA_V1_DISABLED" - - awsS3DisableMultiRegionAccessPointsEnv = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS" - - awsUseDualStackEndpointEnv = "AWS_USE_DUALSTACK_ENDPOINT" - - awsUseFIPSEndpointEnv = "AWS_USE_FIPS_ENDPOINT" - - awsDefaultsModeEnv = "AWS_DEFAULTS_MODE" - - awsMaxAttemptsEnv = "AWS_MAX_ATTEMPTS" - awsRetryModeEnv = "AWS_RETRY_MODE" - awsSdkUaAppIDEnv = "AWS_SDK_UA_APP_ID" - - awsIgnoreConfiguredEndpointURLEnv = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" - awsEndpointURLEnv = "AWS_ENDPOINT_URL" - - awsDisableRequestCompressionEnv = "AWS_DISABLE_REQUEST_COMPRESSION" - awsRequestMinCompressionSizeBytesEnv = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES" - - awsS3DisableExpressSessionAuthEnv = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH" - - awsAccountIDEnv = "AWS_ACCOUNT_ID" - awsAccountIDEndpointModeEnv = "AWS_ACCOUNT_ID_ENDPOINT_MODE" - - awsRequestChecksumCalculation = "AWS_REQUEST_CHECKSUM_CALCULATION" - awsResponseChecksumValidation = "AWS_RESPONSE_CHECKSUM_VALIDATION" - - awsAuthSchemePreferenceEnv = "AWS_AUTH_SCHEME_PREFERENCE" -) - -var ( - credAccessEnvKeys = []string{ - awsAccessKeyIDEnv, - awsAccessKeyEnv, - } - credSecretEnvKeys = []string{ - awsSecretAccessKeyEnv, - awsSecretKeyEnv, - } - regionEnvKeys = []string{ - awsRegionEnv, - awsDefaultRegionEnv, - } - profileEnvKeys = []string{ - awsProfileEnv, - awsDefaultProfileEnv, - } -) - -// EnvConfig is a collection of environment values the SDK will read -// setup config from. All environment values are optional. But some values -// such as credentials require multiple values to be complete or the values -// will be ignored. -type EnvConfig struct { - // Environment configuration values. If set both Access Key ID and Secret Access - // Key must be provided. Session Token and optionally also be provided, but is - // not required. - // - // # Access Key ID - // AWS_ACCESS_KEY_ID=AKID - // AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. - // - // # Secret Access Key - // AWS_SECRET_ACCESS_KEY=SECRET - // AWS_SECRET_KEY=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. - // - // # Session Token - // AWS_SESSION_TOKEN=TOKEN - Credentials aws.Credentials - - // ContainerCredentialsEndpoint value is the HTTP enabled endpoint to retrieve credentials - // using the endpointcreds.Provider - ContainerCredentialsEndpoint string - - // ContainerCredentialsRelativePath is the relative URI path that will be used when attempting to retrieve - // credentials from the container endpoint. - ContainerCredentialsRelativePath string - - // ContainerAuthorizationToken is the authorization token that will be included in the HTTP Authorization - // header when attempting to retrieve credentials from the container credentials endpoint. - ContainerAuthorizationToken string - - // Region value will instruct the SDK where to make service API requests to. If is - // not provided in the environment the region must be provided before a service - // client request is made. - // - // AWS_REGION=us-west-2 - // AWS_DEFAULT_REGION=us-west-2 - Region string - - // Profile name the SDK should load use when loading shared configuration from the - // shared configuration files. If not provided "default" will be used as the - // profile name. - // - // AWS_PROFILE=my_profile - // AWS_DEFAULT_PROFILE=my_profile - SharedConfigProfile string - - // Shared credentials file path can be set to instruct the SDK to use an alternate - // file for the shared credentials. If not set the file will be loaded from - // $HOME/.aws/credentials on Linux/Unix based systems, and - // %USERPROFILE%\.aws\credentials on Windows. - // - // AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials - SharedCredentialsFile string - - // Shared config file path can be set to instruct the SDK to use an alternate - // file for the shared config. If not set the file will be loaded from - // $HOME/.aws/config on Linux/Unix based systems, and - // %USERPROFILE%\.aws\config on Windows. - // - // AWS_CONFIG_FILE=$HOME/my_shared_config - SharedConfigFile string - - // Sets the path to a custom Credentials Authority (CA) Bundle PEM file - // that the SDK will use instead of the system's root CA bundle. - // Only use this if you want to configure the SDK to use a custom set - // of CAs. - // - // Enabling this option will attempt to merge the Transport - // into the SDK's HTTP client. If the client's Transport is - // not a http.Transport an error will be returned. If the - // Transport's TLS config is set this option will cause the - // SDK to overwrite the Transport's TLS config's RootCAs value. - // - // Setting a custom HTTPClient in the aws.Config options will override this setting. - // To use this option and custom HTTP client, the HTTP client needs to be provided - // when creating the config. Not the service client. - // - // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle - CustomCABundle string - - // Enables endpoint discovery via environment variables. - // - // AWS_ENABLE_ENDPOINT_DISCOVERY=true - EnableEndpointDiscovery aws.EndpointDiscoveryEnableState - - // Specifies the WebIdentity token the SDK should use to assume a role - // with. - // - // AWS_WEB_IDENTITY_TOKEN_FILE=file_path - WebIdentityTokenFilePath string - - // Specifies the IAM role arn to use when assuming an role. - // - // AWS_ROLE_ARN=role_arn - RoleARN string - - // Specifies the IAM role session name to use when assuming a role. - // - // AWS_ROLE_SESSION_NAME=session_name - RoleSessionName string - - // Specifies if the S3 service should allow ARNs to direct the region - // the client's requests are sent to. - // - // AWS_S3_USE_ARN_REGION=true - S3UseARNRegion *bool - - // Specifies if the EC2 IMDS service client is enabled. - // - // AWS_EC2_METADATA_DISABLED=true - EC2IMDSClientEnableState imds.ClientEnableState - - // Specifies if EC2 IMDSv1 fallback is disabled. - // - // AWS_EC2_METADATA_V1_DISABLED=true - EC2IMDSv1Disabled *bool - - // Specifies the EC2 Instance Metadata Service default endpoint selection mode (IPv4 or IPv6) - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE=IPv6 - EC2IMDSEndpointMode imds.EndpointModeState - - // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EC2IMDSEndpointMode. - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://fd00:ec2::254 - EC2IMDSEndpoint string - - // Specifies if the S3 service should disable multi-region access points - // support. - // - // AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS=true - S3DisableMultiRegionAccessPoints *bool - - // Specifies that SDK clients must resolve a dual-stack endpoint for - // services. - // - // AWS_USE_DUALSTACK_ENDPOINT=true - UseDualStackEndpoint aws.DualStackEndpointState - - // Specifies that SDK clients must resolve a FIPS endpoint for - // services. - // - // AWS_USE_FIPS_ENDPOINT=true - UseFIPSEndpoint aws.FIPSEndpointState - - // Specifies the SDK Defaults Mode used by services. - // - // AWS_DEFAULTS_MODE=standard - DefaultsMode aws.DefaultsMode - - // Specifies the maximum number attempts an API client will call an - // operation that fails with a retryable error. - // - // AWS_MAX_ATTEMPTS=3 - RetryMaxAttempts int - - // Specifies the retry model the API client will be created with. - // - // aws_retry_mode=standard - RetryMode aws.RetryMode - - // aws sdk app ID that can be added to user agent header string - AppID string - - // Flag used to disable configured endpoints. - IgnoreConfiguredEndpoints *bool - - // Value to contain configured endpoints to be propagated to - // corresponding endpoint resolution field. - BaseEndpoint string - - // determine if request compression is allowed, default to false - // retrieved from env var AWS_DISABLE_REQUEST_COMPRESSION - DisableRequestCompression *bool - - // inclusive threshold request body size to trigger compression, - // default to 10240 and must be within 0 and 10485760 bytes inclusive - // retrieved from env var AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES - RequestMinCompressSizeBytes *int64 - - // Whether S3Express auth is disabled. - // - // This will NOT prevent requests from being made to S3Express buckets, it - // will only bypass the modified endpoint routing and signing behaviors - // associated with the feature. - S3DisableExpressAuth *bool - - // Indicates whether account ID will be required/ignored in endpoint2.0 routing - AccountIDEndpointMode aws.AccountIDEndpointMode - - // Indicates whether request checksum should be calculated - RequestChecksumCalculation aws.RequestChecksumCalculation - - // Indicates whether response checksum should be validated - ResponseChecksumValidation aws.ResponseChecksumValidation - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// loadEnvConfig reads configuration values from the OS's environment variables. -// Returning the a Config typed EnvConfig to satisfy the ConfigLoader func type. -func loadEnvConfig(ctx context.Context, cfgs configs) (Config, error) { - return NewEnvConfig() -} - -// NewEnvConfig retrieves the SDK's environment configuration. -// See `EnvConfig` for the values that will be retrieved. -func NewEnvConfig() (EnvConfig, error) { - var cfg EnvConfig - - creds := aws.Credentials{ - Source: CredentialsSourceName, - } - setStringFromEnvVal(&creds.AccessKeyID, credAccessEnvKeys) - setStringFromEnvVal(&creds.SecretAccessKey, credSecretEnvKeys) - if creds.HasKeys() { - creds.AccountID = os.Getenv(awsAccountIDEnv) - creds.SessionToken = os.Getenv(awsSessionTokenEnv) - cfg.Credentials = creds - } - - cfg.ContainerCredentialsEndpoint = os.Getenv(awsContainerCredentialsFullURIEnv) - cfg.ContainerCredentialsRelativePath = os.Getenv(awsContainerCredentialsRelativeURIEnv) - cfg.ContainerAuthorizationToken = os.Getenv(awsContainerAuthorizationTokenEnv) - - setStringFromEnvVal(&cfg.Region, regionEnvKeys) - setStringFromEnvVal(&cfg.SharedConfigProfile, profileEnvKeys) - - cfg.SharedCredentialsFile = os.Getenv(awsSharedCredentialsFileEnv) - cfg.SharedConfigFile = os.Getenv(awsConfigFileEnv) - - cfg.CustomCABundle = os.Getenv(awsCABundleEnv) - - cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFileEnv) - - cfg.RoleARN = os.Getenv(awsRoleARNEnv) - cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnv) - - cfg.AppID = os.Getenv(awsSdkUaAppIDEnv) - - if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompressionEnv}); err != nil { - return cfg, err - } - if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytesEnv}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil { - return cfg, err - } - - if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnv}); err != nil { - return cfg, err - } - - if err := setBoolPtrFromEnvVal(&cfg.S3UseARNRegion, []string{awsS3UseARNRegionEnv}); err != nil { - return cfg, err - } - - setEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabledEnv}) - if err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnv}); err != nil { - return cfg, err - } - cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnv) - if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnv}); err != nil { - return cfg, err - } - - if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointsEnv}); err != nil { - return cfg, err - } - - if err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpointEnv}); err != nil { - return cfg, err - } - - if err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpointEnv}); err != nil { - return cfg, err - } - - if err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultsModeEnv}); err != nil { - return cfg, err - } - - if err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsMaxAttemptsEnv}); err != nil { - return cfg, err - } - if err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryModeEnv}); err != nil { - return cfg, err - } - - setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURLEnv}) - - if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpointURLEnv}); err != nil { - return cfg, err - } - - if err := setBoolPtrFromEnvVal(&cfg.S3DisableExpressAuth, []string{awsS3DisableExpressSessionAuthEnv}); err != nil { - return cfg, err - } - - if err := setAIDEndPointModeFromEnvVal(&cfg.AccountIDEndpointMode, []string{awsAccountIDEndpointModeEnv}); err != nil { - return cfg, err - } - - if err := setRequestChecksumCalculationFromEnvVal(&cfg.RequestChecksumCalculation, []string{awsRequestChecksumCalculation}); err != nil { - return cfg, err - } - if err := setResponseChecksumValidationFromEnvVal(&cfg.ResponseChecksumValidation, []string{awsResponseChecksumValidation}); err != nil { - return cfg, err - } - - cfg.AuthSchemePreference = toAuthSchemePreferenceList(os.Getenv(awsAuthSchemePreferenceEnv)) - - return cfg, nil -} - -func (c EnvConfig) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { - if len(c.DefaultsMode) == 0 { - return "", false, nil - } - return c.DefaultsMode, true, nil -} - -func (c EnvConfig) getAppID(context.Context) (string, bool, error) { - return c.AppID, len(c.AppID) > 0, nil -} - -func (c EnvConfig) getDisableRequestCompression(context.Context) (bool, bool, error) { - if c.DisableRequestCompression == nil { - return false, false, nil - } - return *c.DisableRequestCompression, true, nil -} - -func (c EnvConfig) getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) { - if c.RequestMinCompressSizeBytes == nil { - return 0, false, nil - } - return *c.RequestMinCompressSizeBytes, true, nil -} - -func (c EnvConfig) getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error) { - return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil -} - -func (c EnvConfig) getRequestChecksumCalculation(context.Context) (aws.RequestChecksumCalculation, bool, error) { - return c.RequestChecksumCalculation, c.RequestChecksumCalculation > 0, nil -} - -func (c EnvConfig) getResponseChecksumValidation(context.Context) (aws.ResponseChecksumValidation, bool, error) { - return c.ResponseChecksumValidation, c.ResponseChecksumValidation > 0, nil -} - -// GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, -// and not 0. -func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { - if c.RetryMaxAttempts == 0 { - return 0, false, nil - } - return c.RetryMaxAttempts, true, nil -} - -// GetRetryMode returns the RetryMode of AWS_RETRY_MODE if was specified, and a -// valid value. -func (c EnvConfig) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { - if len(c.RetryMode) == 0 { - return "", false, nil - } - return c.RetryMode, true, nil -} - -func setEC2IMDSClientEnableState(state *imds.ClientEnableState, keys []string) { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - switch { - case strings.EqualFold(value, "true"): - *state = imds.ClientDisabled - case strings.EqualFold(value, "false"): - *state = imds.ClientEnabled - default: - continue - } - break - } -} - -func setDefaultsModeFromEnvVal(mode *aws.DefaultsMode, keys []string) error { - for _, k := range keys { - if value := os.Getenv(k); len(value) > 0 { - if ok := mode.SetFromString(value); !ok { - return fmt.Errorf("invalid %s value: %s", k, value) - } - break - } - } - return nil -} - -func setRetryModeFromEnvVal(mode *aws.RetryMode, keys []string) (err error) { - for _, k := range keys { - if value := os.Getenv(k); len(value) > 0 { - *mode, err = aws.ParseRetryMode(value) - if err != nil { - return fmt.Errorf("invalid %s value, %w", k, err) - } - break - } - } - return nil -} - -func setEC2IMDSEndpointMode(mode *imds.EndpointModeState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - if err := mode.SetFromString(value); err != nil { - return fmt.Errorf("invalid value for environment variable, %s=%s, %v", k, value, err) - } - } - return nil -} - -func setAIDEndPointModeFromEnvVal(m *aws.AccountIDEndpointMode, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - - switch value { - case "preferred": - *m = aws.AccountIDEndpointModePreferred - case "required": - *m = aws.AccountIDEndpointModeRequired - case "disabled": - *m = aws.AccountIDEndpointModeDisabled - default: - return fmt.Errorf("invalid value for environment variable, %s=%s, must be preferred/required/disabled", k, value) - } - break - } - return nil -} - -func setRequestChecksumCalculationFromEnvVal(m *aws.RequestChecksumCalculation, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - - switch strings.ToLower(value) { - case checksumWhenSupported: - *m = aws.RequestChecksumCalculationWhenSupported - case checksumWhenRequired: - *m = aws.RequestChecksumCalculationWhenRequired - default: - return fmt.Errorf("invalid value for environment variable, %s=%s, must be when_supported/when_required", k, value) - } - } - return nil -} - -func setResponseChecksumValidationFromEnvVal(m *aws.ResponseChecksumValidation, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - - switch strings.ToLower(value) { - case checksumWhenSupported: - *m = aws.ResponseChecksumValidationWhenSupported - case checksumWhenRequired: - *m = aws.ResponseChecksumValidationWhenRequired - default: - return fmt.Errorf("invalid value for environment variable, %s=%s, must be when_supported/when_required", k, value) - } - - } - return nil -} - -// GetRegion returns the AWS Region if set in the environment. Returns an empty -// string if not set. -func (c EnvConfig) getRegion(ctx context.Context) (string, bool, error) { - if len(c.Region) == 0 { - return "", false, nil - } - return c.Region, true, nil -} - -// GetSharedConfigProfile returns the shared config profile if set in the -// environment. Returns an empty string if not set. -func (c EnvConfig) getSharedConfigProfile(ctx context.Context) (string, bool, error) { - if len(c.SharedConfigProfile) == 0 { - return "", false, nil - } - - return c.SharedConfigProfile, true, nil -} - -// getSharedConfigFiles returns a slice of filenames set in the environment. -// -// Will return the filenames in the order of: -// * Shared Config -func (c EnvConfig) getSharedConfigFiles(context.Context) ([]string, bool, error) { - var files []string - if v := c.SharedConfigFile; len(v) > 0 { - files = append(files, v) - } - - if len(files) == 0 { - return nil, false, nil - } - return files, true, nil -} - -// getSharedCredentialsFiles returns a slice of filenames set in the environment. -// -// Will return the filenames in the order of: -// * Shared Credentials -func (c EnvConfig) getSharedCredentialsFiles(context.Context) ([]string, bool, error) { - var files []string - if v := c.SharedCredentialsFile; len(v) > 0 { - files = append(files, v) - } - if len(files) == 0 { - return nil, false, nil - } - return files, true, nil -} - -// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was -func (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { - if len(c.CustomCABundle) == 0 { - return nil, false, nil - } - - b, err := os.ReadFile(c.CustomCABundle) - if err != nil { - return nil, false, err - } - return bytes.NewReader(b), true, nil -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func (c EnvConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { - if c.IgnoreConfiguredEndpoints == nil { - return false, false, nil - } - - return *c.IgnoreConfiguredEndpoints, true, nil -} - -func (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) { - return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil -} - -// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use -// with configured endpoints. -func (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { - if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURLEnv, normalizeEnv(sdkID))); endpt != "" { - return endpt, true, nil - } - return "", false, nil -} - -func normalizeEnv(sdkID string) string { - upper := strings.ToUpper(sdkID) - return strings.ReplaceAll(upper, " ", "_") -} - -// GetS3UseARNRegion returns whether to allow ARNs to direct the region -// the S3 client's requests are sent to. -func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { - if c.S3UseARNRegion == nil { - return false, false, nil - } - - return *c.S3UseARNRegion, true, nil -} - -// GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point -// support for the S3 client. -func (c EnvConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { - if c.S3DisableMultiRegionAccessPoints == nil { - return false, false, nil - } - - return *c.S3DisableMultiRegionAccessPoints, true, nil -} - -// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be -// used for requests. -func (c EnvConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { - if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { - return aws.DualStackEndpointStateUnset, false, nil - } - - return c.UseDualStackEndpoint, true, nil -} - -// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be -// used for requests. -func (c EnvConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { - if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { - return aws.FIPSEndpointStateUnset, false, nil - } - - return c.UseFIPSEndpoint, true, nil -} - -func setStringFromEnvVal(dst *string, keys []string) { - for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { - *dst = v - break - } - } -} - -func setIntFromEnvVal(dst *int, keys []string) error { - for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { - i, err := strconv.ParseInt(v, 10, 64) - if err != nil { - return fmt.Errorf("invalid value %s=%s, %w", k, v, err) - } - *dst = int(i) - break - } - } - - return nil -} - -func setBoolPtrFromEnvVal(dst **bool, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - - if *dst == nil { - *dst = new(bool) - } - - switch { - case strings.EqualFold(value, "false"): - **dst = false - case strings.EqualFold(value, "true"): - **dst = true - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true or false", - k, value) - } - break - } - - return nil -} - -func setInt64PtrFromEnvVal(dst **int64, keys []string, max int64) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - - v, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return fmt.Errorf("invalid value for env var, %s=%s, need int64", k, value) - } else if v < 0 || v > max { - return fmt.Errorf("invalid range for env var min request compression size bytes %q, must be within 0 and 10485760 inclusively", v) - } - if *dst == nil { - *dst = new(int64) - } - - **dst = v - break - } - - return nil -} - -func setEndpointDiscoveryTypeFromEnvVal(dst *aws.EndpointDiscoveryEnableState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue // skip if empty - } - - switch { - case strings.EqualFold(value, endpointDiscoveryDisabled): - *dst = aws.EndpointDiscoveryDisabled - case strings.EqualFold(value, endpointDiscoveryEnabled): - *dst = aws.EndpointDiscoveryEnabled - case strings.EqualFold(value, endpointDiscoveryAuto): - *dst = aws.EndpointDiscoveryAuto - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true, false or auto", - k, value) - } - } - return nil -} - -func setUseDualStackEndpointFromEnvVal(dst *aws.DualStackEndpointState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue // skip if empty - } - - switch { - case strings.EqualFold(value, "true"): - *dst = aws.DualStackEndpointStateEnabled - case strings.EqualFold(value, "false"): - *dst = aws.DualStackEndpointStateDisabled - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true, false", - k, value) - } - } - return nil -} - -func setUseFIPSEndpointFromEnvVal(dst *aws.FIPSEndpointState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue // skip if empty - } - - switch { - case strings.EqualFold(value, "true"): - *dst = aws.FIPSEndpointStateEnabled - case strings.EqualFold(value, "false"): - *dst = aws.FIPSEndpointStateDisabled - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true, false", - k, value) - } - } - return nil -} - -// GetEnableEndpointDiscovery returns resolved value for EnableEndpointDiscovery env variable setting. -func (c EnvConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) { - if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { - return aws.EndpointDiscoveryUnset, false, nil - } - - return c.EnableEndpointDiscovery, true, nil -} - -// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. -func (c EnvConfig) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { - if c.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { - return imds.ClientDefaultEnableState, false, nil - } - - return c.EC2IMDSClientEnableState, true, nil -} - -// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. -func (c EnvConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { - if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { - return imds.EndpointModeStateUnset, false, nil - } - - return c.EC2IMDSEndpointMode, true, nil -} - -// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. -func (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) { - if len(c.EC2IMDSEndpoint) == 0 { - return "", false, nil - } - - return c.EC2IMDSEndpoint, true, nil -} - -// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option -// resolver interface. -func (c EnvConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { - if c.EC2IMDSv1Disabled == nil { - return false, false - } - - return *c.EC2IMDSv1Disabled, true -} - -// GetS3DisableExpressAuth returns the configured value for -// [EnvConfig.S3DisableExpressAuth]. -func (c EnvConfig) GetS3DisableExpressAuth() (value, ok bool) { - if c.S3DisableExpressAuth == nil { - return false, false - } - - return *c.S3DisableExpressAuth, true -} - -func (c EnvConfig) getAuthSchemePreference() ([]string, bool) { - if len(c.AuthSchemePreference) > 0 { - return c.AuthSchemePreference, true - } - return nil, false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go b/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go deleted file mode 100644 index 654a7a77f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go +++ /dev/null @@ -1,4 +0,0 @@ -package config - -//go:generate go run -tags codegen ./codegen -output=provider_assert_test.go -//go:generate gofmt -s -w ./ 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 deleted file mode 100644 index 827423678..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package config - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.31.12" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go deleted file mode 100644 index 7cb5a1365..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go +++ /dev/null @@ -1,1355 +0,0 @@ -package config - -import ( - "context" - "io" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" - "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" - smithybearer "github.com/aws/smithy-go/auth/bearer" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// LoadOptionsFunc is a type alias for LoadOptions functional option -type LoadOptionsFunc func(*LoadOptions) error - -// LoadOptions are discrete set of options that are valid for loading the -// configuration -type LoadOptions struct { - - // Region is the region to send requests to. - Region string - - // Credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // Token provider for authentication operations with bearer authentication. - BearerAuthTokenProvider smithybearer.TokenProvider - - // HTTPClient the SDK's API clients will use to invoke HTTP requests. - HTTPClient HTTPClient - - // EndpointResolver that can be used to provide or override an endpoint for - // the given service and region. - // - // See the `aws.EndpointResolver` documentation on usage. - // - // Deprecated: See EndpointResolverWithOptions - EndpointResolver aws.EndpointResolver - - // EndpointResolverWithOptions that can be used to provide or override an - // endpoint for the given service and region. - // - // See the `aws.EndpointResolverWithOptions` documentation on usage. - EndpointResolverWithOptions aws.EndpointResolverWithOptions - - // RetryMaxAttempts specifies the maximum number attempts an API client - // will call an operation that fails with a retryable error. - // - // This value will only be used if Retryer option is nil. - RetryMaxAttempts int - - // RetryMode specifies the retry model the API client will be created with. - // - // This value will only be used if Retryer option is nil. - RetryMode aws.RetryMode - - // Retryer is a function that provides a Retryer implementation. A Retryer - // guides how HTTP requests should be retried in case of recoverable - // failures. - // - // If not nil, RetryMaxAttempts, and RetryMode will be ignored. - Retryer func() aws.Retryer - - // APIOptions provides the set of middleware mutations modify how the API - // client requests will be handled. This is useful for adding additional - // tracing data to a request, or changing behavior of the SDK's client. - APIOptions []func(*middleware.Stack) error - - // Logger writer interface to write logging messages to. - Logger logging.Logger - - // ClientLogMode is used to configure the events that will be sent to the - // configured logger. This can be used to configure the logging of signing, - // retries, request, and responses of the SDK clients. - // - // See the ClientLogMode type documentation for the complete set of logging - // modes and available configuration. - ClientLogMode *aws.ClientLogMode - - // SharedConfigProfile is the profile to be used when loading the SharedConfig - SharedConfigProfile string - - // SharedConfigFiles is the slice of custom shared config files to use when - // loading the SharedConfig. A non-default profile used within config file - // must have name defined with prefix 'profile '. eg [profile xyz] - // indicates a profile with name 'xyz'. To read more on the format of the - // config file, please refer the documentation at - // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-config - // - // If duplicate profiles are provided within the same, or across multiple - // shared config files, the next parsed profile will override only the - // properties that conflict with the previously defined profile. Note that - // if duplicate profiles are provided within the SharedCredentialsFiles and - // SharedConfigFiles, the properties defined in shared credentials file - // take precedence. - SharedConfigFiles []string - - // SharedCredentialsFile is the slice of custom shared credentials files to - // use when loading the SharedConfig. The profile name used within - // credentials file must not prefix 'profile '. eg [xyz] indicates a - // profile with name 'xyz'. Profile declared as [profile xyz] will be - // ignored. To read more on the format of the credentials file, please - // refer the documentation at - // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-creds - // - // If duplicate profiles are provided with a same, or across multiple - // shared credentials files, the next parsed profile will override only - // properties that conflict with the previously defined profile. Note that - // if duplicate profiles are provided within the SharedCredentialsFiles and - // SharedConfigFiles, the properties defined in shared credentials file - // take precedence. - SharedCredentialsFiles []string - - // CustomCABundle is CA bundle PEM bytes reader - CustomCABundle io.Reader - - // DefaultRegion is the fall back region, used if a region was not resolved - // from other sources - DefaultRegion string - - // UseEC2IMDSRegion indicates if SDK should retrieve the region - // from the EC2 Metadata service - UseEC2IMDSRegion *UseEC2IMDSRegion - - // CredentialsCacheOptions is a function for setting the - // aws.CredentialsCacheOptions - CredentialsCacheOptions func(*aws.CredentialsCacheOptions) - - // BearerAuthTokenCacheOptions is a function for setting the smithy-go - // auth/bearer#TokenCacheOptions - BearerAuthTokenCacheOptions func(*smithybearer.TokenCacheOptions) - - // SSOTokenProviderOptions is a function for setting the - // credentials/ssocreds.SSOTokenProviderOptions - SSOTokenProviderOptions func(*ssocreds.SSOTokenProviderOptions) - - // ProcessCredentialOptions is a function for setting - // the processcreds.Options - ProcessCredentialOptions func(*processcreds.Options) - - // EC2RoleCredentialOptions is a function for setting - // the ec2rolecreds.Options - EC2RoleCredentialOptions func(*ec2rolecreds.Options) - - // EndpointCredentialOptions is a function for setting - // the endpointcreds.Options - EndpointCredentialOptions func(*endpointcreds.Options) - - // WebIdentityRoleCredentialOptions is a function for setting - // the stscreds.WebIdentityRoleOptions - WebIdentityRoleCredentialOptions func(*stscreds.WebIdentityRoleOptions) - - // AssumeRoleCredentialOptions is a function for setting the - // stscreds.AssumeRoleOptions - AssumeRoleCredentialOptions func(*stscreds.AssumeRoleOptions) - - // SSOProviderOptions is a function for setting - // the ssocreds.Options - SSOProviderOptions func(options *ssocreds.Options) - - // LogConfigurationWarnings when set to true, enables logging - // configuration warnings - LogConfigurationWarnings *bool - - // S3UseARNRegion specifies if the S3 service should allow ARNs to direct - // the region, the client's requests are sent to. - S3UseARNRegion *bool - - // S3DisableMultiRegionAccessPoints specifies if the S3 service should disable - // the S3 Multi-Region access points feature. - S3DisableMultiRegionAccessPoints *bool - - // EnableEndpointDiscovery specifies if endpoint discovery is enable for - // the client. - EnableEndpointDiscovery aws.EndpointDiscoveryEnableState - - // Specifies if the EC2 IMDS service client is enabled. - // - // AWS_EC2_METADATA_DISABLED=true - EC2IMDSClientEnableState imds.ClientEnableState - - // Specifies the EC2 Instance Metadata Service default endpoint selection - // mode (IPv4 or IPv6) - EC2IMDSEndpointMode imds.EndpointModeState - - // Specifies the EC2 Instance Metadata Service endpoint to use. If - // specified it overrides EC2IMDSEndpointMode. - EC2IMDSEndpoint string - - // Specifies that SDK clients must resolve a dual-stack endpoint for - // services. - UseDualStackEndpoint aws.DualStackEndpointState - - // Specifies that SDK clients must resolve a FIPS endpoint for - // services. - UseFIPSEndpoint aws.FIPSEndpointState - - // Specifies the SDK configuration mode for defaults. - DefaultsModeOptions DefaultsModeOptions - - // The sdk app ID retrieved from env var or shared config to be added to request user agent header - AppID string - - // Specifies whether an operation request could be compressed - DisableRequestCompression *bool - - // The inclusive min bytes of a request body that could be compressed - RequestMinCompressSizeBytes *int64 - - // Whether S3 Express auth is disabled. - S3DisableExpressAuth *bool - - // Whether account id should be built into endpoint resolution - AccountIDEndpointMode aws.AccountIDEndpointMode - - // Specify if request checksum should be calculated - RequestChecksumCalculation aws.RequestChecksumCalculation - - // Specifies if response checksum should be validated - ResponseChecksumValidation aws.ResponseChecksumValidation - - // Service endpoint override. This value is not necessarily final and is - // passed to the service's EndpointResolverV2 for further delegation. - BaseEndpoint string - - // Registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string - - // ServiceOptions provides service specific configuration options that will be applied - // when constructing clients for specific services. Each callback function receives the service ID - // and the service's Options struct, allowing for dynamic configuration based on the service. - ServiceOptions []func(string, any) -} - -func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { - if len(o.DefaultsModeOptions.Mode) == 0 { - return "", false, nil - } - return o.DefaultsModeOptions.Mode, true, nil -} - -// GetRetryMaxAttempts returns the RetryMaxAttempts if specified in the -// LoadOptions and not 0. -func (o LoadOptions) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { - if o.RetryMaxAttempts == 0 { - return 0, false, nil - } - return o.RetryMaxAttempts, true, nil -} - -// GetRetryMode returns the RetryMode specified in the LoadOptions. -func (o LoadOptions) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { - if len(o.RetryMode) == 0 { - return "", false, nil - } - return o.RetryMode, true, nil -} - -func (o LoadOptions) getDefaultsModeIMDSClient(ctx context.Context) (*imds.Client, bool, error) { - if o.DefaultsModeOptions.IMDSClient == nil { - return nil, false, nil - } - return o.DefaultsModeOptions.IMDSClient, true, nil -} - -// getRegion returns Region from config's LoadOptions -func (o LoadOptions) getRegion(ctx context.Context) (string, bool, error) { - if len(o.Region) == 0 { - return "", false, nil - } - - return o.Region, true, nil -} - -// getAppID returns AppID from config's LoadOptions -func (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) { - return o.AppID, len(o.AppID) > 0, nil -} - -// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions -func (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { - if o.DisableRequestCompression == nil { - return false, false, nil - } - return *o.DisableRequestCompression, true, nil -} - -// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions -func (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { - if o.RequestMinCompressSizeBytes == nil { - return 0, false, nil - } - return *o.RequestMinCompressSizeBytes, true, nil -} - -func (o LoadOptions) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) { - return o.AccountIDEndpointMode, len(o.AccountIDEndpointMode) > 0, nil -} - -func (o LoadOptions) getRequestChecksumCalculation(ctx context.Context) (aws.RequestChecksumCalculation, bool, error) { - return o.RequestChecksumCalculation, o.RequestChecksumCalculation > 0, nil -} - -func (o LoadOptions) getResponseChecksumValidation(ctx context.Context) (aws.ResponseChecksumValidation, bool, error) { - return o.ResponseChecksumValidation, o.ResponseChecksumValidation > 0, nil -} - -func (o LoadOptions) getBaseEndpoint(context.Context) (string, bool, error) { - return o.BaseEndpoint, o.BaseEndpoint != "", nil -} - -func (o LoadOptions) getServiceOptions(context.Context) ([]func(string, any), bool, error) { - return o.ServiceOptions, len(o.ServiceOptions) > 0, nil -} - -// GetServiceBaseEndpoint satisfies (internal/configsources).ServiceBaseEndpointProvider. -// -// The sdkID value is unused because LoadOptions only supports setting a GLOBAL -// endpoint override. In-code, per-service endpoint overrides are performed via -// functional options in service client space. -func (o LoadOptions) GetServiceBaseEndpoint(context.Context, string) (string, bool, error) { - return o.BaseEndpoint, o.BaseEndpoint != "", nil -} - -// WithRegion is a helper function to construct functional options -// that sets Region on config's LoadOptions. Setting the region to -// an empty string, will result in the region value being ignored. -// If multiple WithRegion calls are made, the last call overrides -// the previous call values. -func WithRegion(v string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Region = v - return nil - } -} - -// WithAppID is a helper function to construct functional options -// that sets AppID on config's LoadOptions. -func WithAppID(ID string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.AppID = ID - return nil - } -} - -// WithDisableRequestCompression is a helper function to construct functional options -// that sets DisableRequestCompression on config's LoadOptions. -func WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc { - return func(o *LoadOptions) error { - if DisableRequestCompression == nil { - return nil - } - o.DisableRequestCompression = DisableRequestCompression - return nil - } -} - -// WithRequestMinCompressSizeBytes is a helper function to construct functional options -// that sets RequestMinCompressSizeBytes on config's LoadOptions. -func WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc { - return func(o *LoadOptions) error { - if RequestMinCompressSizeBytes == nil { - return nil - } - o.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes - return nil - } -} - -// WithAccountIDEndpointMode is a helper function to construct functional options -// that sets AccountIDEndpointMode on config's LoadOptions -func WithAccountIDEndpointMode(m aws.AccountIDEndpointMode) LoadOptionsFunc { - return func(o *LoadOptions) error { - if m != "" { - o.AccountIDEndpointMode = m - } - return nil - } -} - -// WithRequestChecksumCalculation is a helper function to construct functional options -// that sets RequestChecksumCalculation on config's LoadOptions -func WithRequestChecksumCalculation(c aws.RequestChecksumCalculation) LoadOptionsFunc { - return func(o *LoadOptions) error { - if c > 0 { - o.RequestChecksumCalculation = c - } - return nil - } -} - -// WithResponseChecksumValidation is a helper function to construct functional options -// that sets ResponseChecksumValidation on config's LoadOptions -func WithResponseChecksumValidation(v aws.ResponseChecksumValidation) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.ResponseChecksumValidation = v - return nil - } -} - -// getDefaultRegion returns DefaultRegion from config's LoadOptions -func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) { - if len(o.DefaultRegion) == 0 { - return "", false, nil - } - - return o.DefaultRegion, true, nil -} - -// WithDefaultRegion is a helper function to construct functional options -// that sets a DefaultRegion on config's LoadOptions. Setting the default -// region to an empty string, will result in the default region value -// being ignored. If multiple WithDefaultRegion calls are made, the last -// call overrides the previous call values. Note that both WithRegion and -// WithEC2IMDSRegion call takes precedence over WithDefaultRegion call -// when resolving region. -func WithDefaultRegion(v string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.DefaultRegion = v - return nil - } -} - -// getSharedConfigProfile returns SharedConfigProfile from config's LoadOptions -func (o LoadOptions) getSharedConfigProfile(ctx context.Context) (string, bool, error) { - if len(o.SharedConfigProfile) == 0 { - return "", false, nil - } - - return o.SharedConfigProfile, true, nil -} - -// WithSharedConfigProfile is a helper function to construct functional options -// that sets SharedConfigProfile on config's LoadOptions. Setting the shared -// config profile to an empty string, will result in the shared config profile -// value being ignored. -// If multiple WithSharedConfigProfile calls are made, the last call overrides -// the previous call values. -func WithSharedConfigProfile(v string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.SharedConfigProfile = v - return nil - } -} - -// getSharedConfigFiles returns SharedConfigFiles set on config's LoadOptions -func (o LoadOptions) getSharedConfigFiles(ctx context.Context) ([]string, bool, error) { - if o.SharedConfigFiles == nil { - return nil, false, nil - } - - return o.SharedConfigFiles, true, nil -} - -// WithSharedConfigFiles is a helper function to construct functional options -// that sets slice of SharedConfigFiles on config's LoadOptions. -// Setting the shared config files to an nil string slice, will result in the -// shared config files value being ignored. -// If multiple WithSharedConfigFiles calls are made, the last call overrides -// the previous call values. -func WithSharedConfigFiles(v []string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.SharedConfigFiles = v - return nil - } -} - -// getSharedCredentialsFiles returns SharedCredentialsFiles set on config's LoadOptions -func (o LoadOptions) getSharedCredentialsFiles(ctx context.Context) ([]string, bool, error) { - if o.SharedCredentialsFiles == nil { - return nil, false, nil - } - - return o.SharedCredentialsFiles, true, nil -} - -// WithSharedCredentialsFiles is a helper function to construct functional options -// that sets slice of SharedCredentialsFiles on config's LoadOptions. -// Setting the shared credentials files to an nil string slice, will result in the -// shared credentials files value being ignored. -// If multiple WithSharedCredentialsFiles calls are made, the last call overrides -// the previous call values. -func WithSharedCredentialsFiles(v []string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.SharedCredentialsFiles = v - return nil - } -} - -// getCustomCABundle returns CustomCABundle from LoadOptions -func (o LoadOptions) getCustomCABundle(ctx context.Context) (io.Reader, bool, error) { - if o.CustomCABundle == nil { - return nil, false, nil - } - - return o.CustomCABundle, true, nil -} - -// WithCustomCABundle is a helper function to construct functional options -// that sets CustomCABundle on config's LoadOptions. Setting the custom CA Bundle -// to nil will result in custom CA Bundle value being ignored. -// If multiple WithCustomCABundle calls are made, the last call overrides the -// previous call values. -func WithCustomCABundle(v io.Reader) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.CustomCABundle = v - return nil - } -} - -// UseEC2IMDSRegion provides a regionProvider that retrieves the region -// from the EC2 Metadata service. -type UseEC2IMDSRegion struct { - // If unset will default to generic EC2 IMDS client. - Client *imds.Client -} - -// getRegion attempts to retrieve the region from EC2 Metadata service. -func (p *UseEC2IMDSRegion) getRegion(ctx context.Context) (string, bool, error) { - if ctx == nil { - ctx = context.Background() - } - - client := p.Client - if client == nil { - client = imds.New(imds.Options{}) - } - - result, err := client.GetRegion(ctx, nil) - if err != nil { - return "", false, err - } - if len(result.Region) != 0 { - return result.Region, true, nil - } - return "", false, nil -} - -// getEC2IMDSRegion returns the value of EC2 IMDS region. -func (o LoadOptions) getEC2IMDSRegion(ctx context.Context) (string, bool, error) { - if o.UseEC2IMDSRegion == nil { - return "", false, nil - } - - return o.UseEC2IMDSRegion.getRegion(ctx) -} - -// WithEC2IMDSRegion is a helper function to construct functional options -// that enables resolving EC2IMDS region. The function takes -// in a UseEC2IMDSRegion functional option, and can be used to set the -// EC2IMDS client which will be used to resolve EC2IMDSRegion. -// If no functional option is provided, an EC2IMDS client is built and used -// by the resolver. If multiple WithEC2IMDSRegion calls are made, the last -// call overrides the previous call values. Note that the WithRegion calls takes -// precedence over WithEC2IMDSRegion when resolving region. -func WithEC2IMDSRegion(fnOpts ...func(o *UseEC2IMDSRegion)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.UseEC2IMDSRegion = &UseEC2IMDSRegion{} - - for _, fn := range fnOpts { - fn(o.UseEC2IMDSRegion) - } - return nil - } -} - -// getCredentialsProvider returns the credentials value -func (o LoadOptions) getCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error) { - if o.Credentials == nil { - return nil, false, nil - } - - return o.Credentials, true, nil -} - -// WithCredentialsProvider is a helper function to construct functional options -// that sets Credential provider value on config's LoadOptions. If credentials -// provider is set to nil, the credentials provider value will be ignored. -// If multiple WithCredentialsProvider calls are made, the last call overrides -// the previous call values. -func WithCredentialsProvider(v aws.CredentialsProvider) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Credentials = v - return nil - } -} - -// getCredentialsCacheOptionsProvider returns the wrapped function to set aws.CredentialsCacheOptions -func (o LoadOptions) getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) { - if o.CredentialsCacheOptions == nil { - return nil, false, nil - } - - return o.CredentialsCacheOptions, true, nil -} - -// WithCredentialsCacheOptions is a helper function to construct functional -// options that sets a function to modify the aws.CredentialsCacheOptions the -// aws.CredentialsCache will be configured with, if the CredentialsCache is used -// by the configuration loader. -// -// If multiple WithCredentialsCacheOptions calls are made, the last call -// overrides the previous call values. -func WithCredentialsCacheOptions(v func(*aws.CredentialsCacheOptions)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.CredentialsCacheOptions = v - return nil - } -} - -// getBearerAuthTokenProvider returns the credentials value -func (o LoadOptions) getBearerAuthTokenProvider(ctx context.Context) (smithybearer.TokenProvider, bool, error) { - if o.BearerAuthTokenProvider == nil { - return nil, false, nil - } - - return o.BearerAuthTokenProvider, true, nil -} - -// WithBearerAuthTokenProvider is a helper function to construct functional options -// that sets Credential provider value on config's LoadOptions. If credentials -// provider is set to nil, the credentials provider value will be ignored. -// If multiple WithBearerAuthTokenProvider calls are made, the last call overrides -// the previous call values. -func WithBearerAuthTokenProvider(v smithybearer.TokenProvider) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.BearerAuthTokenProvider = v - return nil - } -} - -// getBearerAuthTokenCacheOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions -func (o LoadOptions) getBearerAuthTokenCacheOptions(ctx context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) { - if o.BearerAuthTokenCacheOptions == nil { - return nil, false, nil - } - - return o.BearerAuthTokenCacheOptions, true, nil -} - -// WithBearerAuthTokenCacheOptions is a helper function to construct functional options -// that sets a function to modify the TokenCacheOptions the smithy-go -// auth/bearer#TokenCache will be configured with, if the TokenCache is used by -// the configuration loader. -// -// If multiple WithBearerAuthTokenCacheOptions calls are made, the last call overrides -// the previous call values. -func WithBearerAuthTokenCacheOptions(v func(*smithybearer.TokenCacheOptions)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.BearerAuthTokenCacheOptions = v - return nil - } -} - -// getSSOTokenProviderOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions -func (o LoadOptions) getSSOTokenProviderOptions(ctx context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) { - if o.SSOTokenProviderOptions == nil { - return nil, false, nil - } - - return o.SSOTokenProviderOptions, true, nil -} - -// WithSSOTokenProviderOptions is a helper function to construct functional -// options that sets a function to modify the SSOtokenProviderOptions the SDK's -// credentials/ssocreds#SSOProvider will be configured with, if the -// SSOTokenProvider is used by the configuration loader. -// -// If multiple WithSSOTokenProviderOptions calls are made, the last call overrides -// the previous call values. -func WithSSOTokenProviderOptions(v func(*ssocreds.SSOTokenProviderOptions)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.SSOTokenProviderOptions = v - return nil - } -} - -// getProcessCredentialOptions returns the wrapped function to set processcreds.Options -func (o LoadOptions) getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) { - if o.ProcessCredentialOptions == nil { - return nil, false, nil - } - - return o.ProcessCredentialOptions, true, nil -} - -// WithProcessCredentialOptions is a helper function to construct functional options -// that sets a function to use processcreds.Options on config's LoadOptions. -// If process credential options is set to nil, the process credential value will -// be ignored. If multiple WithProcessCredentialOptions calls are made, the last call -// overrides the previous call values. -func WithProcessCredentialOptions(v func(*processcreds.Options)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.ProcessCredentialOptions = v - return nil - } -} - -// getEC2RoleCredentialOptions returns the wrapped function to set the ec2rolecreds.Options -func (o LoadOptions) getEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error) { - if o.EC2RoleCredentialOptions == nil { - return nil, false, nil - } - - return o.EC2RoleCredentialOptions, true, nil -} - -// WithEC2RoleCredentialOptions is a helper function to construct functional options -// that sets a function to use ec2rolecreds.Options on config's LoadOptions. If -// EC2 role credential options is set to nil, the EC2 role credential options value -// will be ignored. If multiple WithEC2RoleCredentialOptions calls are made, -// the last call overrides the previous call values. -func WithEC2RoleCredentialOptions(v func(*ec2rolecreds.Options)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EC2RoleCredentialOptions = v - return nil - } -} - -// getEndpointCredentialOptions returns the wrapped function to set endpointcreds.Options -func (o LoadOptions) getEndpointCredentialOptions(context.Context) (func(*endpointcreds.Options), bool, error) { - if o.EndpointCredentialOptions == nil { - return nil, false, nil - } - - return o.EndpointCredentialOptions, true, nil -} - -// WithEndpointCredentialOptions is a helper function to construct functional options -// that sets a function to use endpointcreds.Options on config's LoadOptions. If -// endpoint credential options is set to nil, the endpoint credential options -// value will be ignored. If multiple WithEndpointCredentialOptions calls are made, -// the last call overrides the previous call values. -func WithEndpointCredentialOptions(v func(*endpointcreds.Options)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EndpointCredentialOptions = v - return nil - } -} - -// getWebIdentityRoleCredentialOptions returns the wrapped function -func (o LoadOptions) getWebIdentityRoleCredentialOptions(context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error) { - if o.WebIdentityRoleCredentialOptions == nil { - return nil, false, nil - } - - return o.WebIdentityRoleCredentialOptions, true, nil -} - -// WithWebIdentityRoleCredentialOptions is a helper function to construct -// functional options that sets a function to use stscreds.WebIdentityRoleOptions -// on config's LoadOptions. If web identity role credentials options is set to nil, -// the web identity role credentials value will be ignored. If multiple -// WithWebIdentityRoleCredentialOptions calls are made, the last call -// overrides the previous call values. -func WithWebIdentityRoleCredentialOptions(v func(*stscreds.WebIdentityRoleOptions)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.WebIdentityRoleCredentialOptions = v - return nil - } -} - -// getAssumeRoleCredentialOptions returns AssumeRoleCredentialOptions from LoadOptions -func (o LoadOptions) getAssumeRoleCredentialOptions(context.Context) (func(options *stscreds.AssumeRoleOptions), bool, error) { - if o.AssumeRoleCredentialOptions == nil { - return nil, false, nil - } - - return o.AssumeRoleCredentialOptions, true, nil -} - -// WithAssumeRoleCredentialOptions is a helper function to construct -// functional options that sets a function to use stscreds.AssumeRoleOptions -// on config's LoadOptions. If assume role credentials options is set to nil, -// the assume role credentials value will be ignored. If multiple -// WithAssumeRoleCredentialOptions calls are made, the last call overrides -// the previous call values. -func WithAssumeRoleCredentialOptions(v func(*stscreds.AssumeRoleOptions)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.AssumeRoleCredentialOptions = v - return nil - } -} - -func (o LoadOptions) getHTTPClient(ctx context.Context) (HTTPClient, bool, error) { - if o.HTTPClient == nil { - return nil, false, nil - } - - return o.HTTPClient, true, nil -} - -// WithHTTPClient is a helper function to construct functional options -// that sets HTTPClient on LoadOptions. If HTTPClient is set to nil, -// the HTTPClient value will be ignored. -// If multiple WithHTTPClient calls are made, the last call overrides -// the previous call values. -func WithHTTPClient(v HTTPClient) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.HTTPClient = v - return nil - } -} - -func (o LoadOptions) getAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error) { - if o.APIOptions == nil { - return nil, false, nil - } - - return o.APIOptions, true, nil -} - -// WithAPIOptions is a helper function to construct functional options -// that sets APIOptions on LoadOptions. If APIOptions is set to nil, the -// APIOptions value is ignored. If multiple WithAPIOptions calls are -// made, the last call overrides the previous call values. -func WithAPIOptions(v []func(*middleware.Stack) error) LoadOptionsFunc { - return func(o *LoadOptions) error { - if v == nil { - return nil - } - - o.APIOptions = append(o.APIOptions, v...) - return nil - } -} - -func (o LoadOptions) getRetryMaxAttempts(ctx context.Context) (int, bool, error) { - if o.RetryMaxAttempts == 0 { - return 0, false, nil - } - - return o.RetryMaxAttempts, true, nil -} - -// WithRetryMaxAttempts is a helper function to construct functional options that sets -// RetryMaxAttempts on LoadOptions. If RetryMaxAttempts is unset, the RetryMaxAttempts value is -// ignored. If multiple WithRetryMaxAttempts calls are made, the last call overrides -// the previous call values. -// -// Will be ignored of LoadOptions.Retryer or WithRetryer are used. -func WithRetryMaxAttempts(v int) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.RetryMaxAttempts = v - return nil - } -} - -func (o LoadOptions) getRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { - if o.RetryMode == "" { - return "", false, nil - } - - return o.RetryMode, true, nil -} - -// WithRetryMode is a helper function to construct functional options that sets -// RetryMode on LoadOptions. If RetryMode is unset, the RetryMode value is -// ignored. If multiple WithRetryMode calls are made, the last call overrides -// the previous call values. -// -// Will be ignored of LoadOptions.Retryer or WithRetryer are used. -func WithRetryMode(v aws.RetryMode) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.RetryMode = v - return nil - } -} - -func (o LoadOptions) getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) { - if o.Retryer == nil { - return nil, false, nil - } - - return o.Retryer, true, nil -} - -// WithRetryer is a helper function to construct functional options -// that sets Retryer on LoadOptions. If Retryer is set to nil, the -// Retryer value is ignored. If multiple WithRetryer calls are -// made, the last call overrides the previous call values. -func WithRetryer(v func() aws.Retryer) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Retryer = v - return nil - } -} - -func (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error) { - if o.EndpointResolver == nil { - return nil, false, nil - } - - return o.EndpointResolver, true, nil -} - -// WithEndpointResolver is a helper function to construct functional options -// that sets the EndpointResolver on LoadOptions. If the EndpointResolver is set to nil, -// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls -// are made, the last call overrides the previous call values. -// -// Deprecated: The global endpoint resolution interface is deprecated. The API -// for endpoint resolution is now unique to each service and is set via the -// EndpointResolverV2 field on service client options. Use of -// WithEndpointResolver or WithEndpointResolverWithOptions will prevent you -// from using any endpoint-related service features released after the -// introduction of EndpointResolverV2. You may also encounter broken or -// unexpected behavior when using the old global interface with services that -// use many endpoint-related customizations such as S3. -func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EndpointResolver = v - return nil - } -} - -func (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) { - if o.EndpointResolverWithOptions == nil { - return nil, false, nil - } - - return o.EndpointResolverWithOptions, true, nil -} - -// WithEndpointResolverWithOptions is a helper function to construct functional options -// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil, -// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls -// are made, the last call overrides the previous call values. -// -// Deprecated: The global endpoint resolution interface is deprecated. See -// deprecation docs on [WithEndpointResolver]. -func WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EndpointResolverWithOptions = v - return nil - } -} - -func (o LoadOptions) getLogger(ctx context.Context) (logging.Logger, bool, error) { - if o.Logger == nil { - return nil, false, nil - } - - return o.Logger, true, nil -} - -// WithLogger is a helper function to construct functional options -// that sets Logger on LoadOptions. If Logger is set to nil, the -// Logger value will be ignored. If multiple WithLogger calls are made, -// the last call overrides the previous call values. -func WithLogger(v logging.Logger) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Logger = v - return nil - } -} - -func (o LoadOptions) getClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error) { - if o.ClientLogMode == nil { - return 0, false, nil - } - - return *o.ClientLogMode, true, nil -} - -// WithClientLogMode is a helper function to construct functional options -// that sets client log mode on LoadOptions. If client log mode is set to nil, -// the client log mode value will be ignored. If multiple WithClientLogMode calls are made, -// the last call overrides the previous call values. -func WithClientLogMode(v aws.ClientLogMode) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.ClientLogMode = &v - return nil - } -} - -func (o LoadOptions) getLogConfigurationWarnings(ctx context.Context) (v bool, found bool, err error) { - if o.LogConfigurationWarnings == nil { - return false, false, nil - } - return *o.LogConfigurationWarnings, true, nil -} - -// WithLogConfigurationWarnings is a helper function to construct -// functional options that can be used to set LogConfigurationWarnings -// on LoadOptions. -// -// If multiple WithLogConfigurationWarnings calls are made, the last call -// overrides the previous call values. -func WithLogConfigurationWarnings(v bool) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.LogConfigurationWarnings = &v - return nil - } -} - -// GetS3UseARNRegion returns whether to allow ARNs to direct the region -// the S3 client's requests are sent to. -func (o LoadOptions) GetS3UseARNRegion(ctx context.Context) (v bool, found bool, err error) { - if o.S3UseARNRegion == nil { - return false, false, nil - } - return *o.S3UseARNRegion, true, nil -} - -// WithS3UseARNRegion is a helper function to construct functional options -// that can be used to set S3UseARNRegion on LoadOptions. -// If multiple WithS3UseARNRegion calls are made, the last call overrides -// the previous call values. -func WithS3UseARNRegion(v bool) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.S3UseARNRegion = &v - return nil - } -} - -// GetS3DisableMultiRegionAccessPoints returns whether to disable -// the S3 multi-region access points feature. -func (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) { - if o.S3DisableMultiRegionAccessPoints == nil { - return false, false, nil - } - return *o.S3DisableMultiRegionAccessPoints, true, nil -} - -// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options -// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions. -// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides -// the previous call values. -func WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.S3DisableMultiRegionAccessPoints = &v - return nil - } -} - -// GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set. -func (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { - if o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { - return aws.EndpointDiscoveryUnset, false, nil - } - return o.EnableEndpointDiscovery, true, nil -} - -// WithEndpointDiscovery is a helper function to construct functional options -// that can be used to enable endpoint discovery on LoadOptions for supported clients. -// If multiple WithEndpointDiscovery calls are made, the last call overrides -// the previous call values. -func WithEndpointDiscovery(v aws.EndpointDiscoveryEnableState) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EnableEndpointDiscovery = v - return nil - } -} - -// getSSOProviderOptions returns AssumeRoleCredentialOptions from LoadOptions -func (o LoadOptions) getSSOProviderOptions(context.Context) (func(options *ssocreds.Options), bool, error) { - if o.SSOProviderOptions == nil { - return nil, false, nil - } - - return o.SSOProviderOptions, true, nil -} - -// WithSSOProviderOptions is a helper function to construct -// functional options that sets a function to use ssocreds.Options -// on config's LoadOptions. If the SSO credential provider options is set to nil, -// the sso provider options value will be ignored. If multiple -// WithSSOProviderOptions calls are made, the last call overrides -// the previous call values. -func WithSSOProviderOptions(v func(*ssocreds.Options)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.SSOProviderOptions = v - return nil - } -} - -// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. -func (o LoadOptions) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { - if o.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { - return imds.ClientDefaultEnableState, false, nil - } - - return o.EC2IMDSClientEnableState, true, nil -} - -// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. -func (o LoadOptions) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { - if o.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { - return imds.EndpointModeStateUnset, false, nil - } - - return o.EC2IMDSEndpointMode, true, nil -} - -// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. -func (o LoadOptions) GetEC2IMDSEndpoint() (string, bool, error) { - if len(o.EC2IMDSEndpoint) == 0 { - return "", false, nil - } - - return o.EC2IMDSEndpoint, true, nil -} - -// WithEC2IMDSClientEnableState is a helper function to construct functional options that sets the EC2IMDSClientEnableState. -func WithEC2IMDSClientEnableState(v imds.ClientEnableState) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EC2IMDSClientEnableState = v - return nil - } -} - -// WithEC2IMDSEndpointMode is a helper function to construct functional options that sets the EC2IMDSEndpointMode. -func WithEC2IMDSEndpointMode(v imds.EndpointModeState) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EC2IMDSEndpointMode = v - return nil - } -} - -// WithEC2IMDSEndpoint is a helper function to construct functional options that sets the EC2IMDSEndpoint. -func WithEC2IMDSEndpoint(v string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.EC2IMDSEndpoint = v - return nil - } -} - -// WithUseDualStackEndpoint is a helper function to construct -// functional options that can be used to set UseDualStackEndpoint on LoadOptions. -func WithUseDualStackEndpoint(v aws.DualStackEndpointState) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.UseDualStackEndpoint = v - return nil - } -} - -// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be -// used for requests. -func (o LoadOptions) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { - if o.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { - return aws.DualStackEndpointStateUnset, false, nil - } - return o.UseDualStackEndpoint, true, nil -} - -// WithUseFIPSEndpoint is a helper function to construct -// functional options that can be used to set UseFIPSEndpoint on LoadOptions. -func WithUseFIPSEndpoint(v aws.FIPSEndpointState) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.UseFIPSEndpoint = v - return nil - } -} - -// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be -// used for requests. -func (o LoadOptions) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { - if o.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { - return aws.FIPSEndpointStateUnset, false, nil - } - return o.UseFIPSEndpoint, true, nil -} - -// WithDefaultsMode sets the SDK defaults configuration mode to the value provided. -// -// Zero or more functional options can be provided to provide configuration options for performing -// environment discovery when using aws.DefaultsModeAuto. -func WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsModeOptions)) LoadOptionsFunc { - do := DefaultsModeOptions{ - Mode: mode, - } - for _, fn := range optFns { - fn(&do) - } - return func(options *LoadOptions) error { - options.DefaultsModeOptions = do - return nil - } -} - -// GetS3DisableExpressAuth returns the configured value for -// [EnvConfig.S3DisableExpressAuth]. -func (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) { - if o.S3DisableExpressAuth == nil { - return false, false - } - - return *o.S3DisableExpressAuth, true -} - -// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth] -// to the value provided. -func WithS3DisableExpressAuth(v bool) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.S3DisableExpressAuth = &v - return nil - } -} - -// WithBaseEndpoint is a helper function to construct functional options that -// sets BaseEndpoint on config's LoadOptions. Empty values have no effect, and -// subsequent calls to this API override previous ones. -// -// This is an in-code setting, therefore, any value set using this hook takes -// precedence over and will override ALL environment and shared config -// directives that set endpoint URLs. Functional options on service clients -// have higher specificity, and functional options that modify the value of -// BaseEndpoint on a client will take precedence over this setting. -func WithBaseEndpoint(v string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.BaseEndpoint = v - return nil - } -} - -// WithServiceOptions is a helper function to construct functional options -// that sets ServiceOptions on config's LoadOptions. -func WithServiceOptions(callbacks ...func(string, any)) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.ServiceOptions = append(o.ServiceOptions, callbacks...) - return nil - } -} - -// WithBeforeExecution adds the BeforeExecutionInterceptor to config. -func WithBeforeExecution(i smithyhttp.BeforeExecutionInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeExecution = append(o.Interceptors.BeforeExecution, i) - return nil - } -} - -// WithBeforeSerialization adds the BeforeSerializationInterceptor to config. -func WithBeforeSerialization(i smithyhttp.BeforeSerializationInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeSerialization = append(o.Interceptors.BeforeSerialization, i) - return nil - } -} - -// WithAfterSerialization adds the AfterSerializationInterceptor to config. -func WithAfterSerialization(i smithyhttp.AfterSerializationInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterSerialization = append(o.Interceptors.AfterSerialization, i) - return nil - } -} - -// WithBeforeRetryLoop adds the BeforeRetryLoopInterceptor to config. -func WithBeforeRetryLoop(i smithyhttp.BeforeRetryLoopInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeRetryLoop = append(o.Interceptors.BeforeRetryLoop, i) - return nil - } -} - -// WithBeforeAttempt adds the BeforeAttemptInterceptor to config. -func WithBeforeAttempt(i smithyhttp.BeforeAttemptInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeAttempt = append(o.Interceptors.BeforeAttempt, i) - return nil - } -} - -// WithBeforeSigning adds the BeforeSigningInterceptor to config. -func WithBeforeSigning(i smithyhttp.BeforeSigningInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeSigning = append(o.Interceptors.BeforeSigning, i) - return nil - } -} - -// WithAfterSigning adds the AfterSigningInterceptor to config. -func WithAfterSigning(i smithyhttp.AfterSigningInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterSigning = append(o.Interceptors.AfterSigning, i) - return nil - } -} - -// WithBeforeTransmit adds the BeforeTransmitInterceptor to config. -func WithBeforeTransmit(i smithyhttp.BeforeTransmitInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeTransmit = append(o.Interceptors.BeforeTransmit, i) - return nil - } -} - -// WithAfterTransmit adds the AfterTransmitInterceptor to config. -func WithAfterTransmit(i smithyhttp.AfterTransmitInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterTransmit = append(o.Interceptors.AfterTransmit, i) - return nil - } -} - -// WithBeforeDeserialization adds the BeforeDeserializationInterceptor to config. -func WithBeforeDeserialization(i smithyhttp.BeforeDeserializationInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.BeforeDeserialization = append(o.Interceptors.BeforeDeserialization, i) - return nil - } -} - -// WithAfterDeserialization adds the AfterDeserializationInterceptor to config. -func WithAfterDeserialization(i smithyhttp.AfterDeserializationInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterDeserialization = append(o.Interceptors.AfterDeserialization, i) - return nil - } -} - -// WithAfterAttempt adds the AfterAttemptInterceptor to config. -func WithAfterAttempt(i smithyhttp.AfterAttemptInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterAttempt = append(o.Interceptors.AfterAttempt, i) - return nil - } -} - -// WithAfterExecution adds the AfterExecutionInterceptor to config. -func WithAfterExecution(i smithyhttp.AfterExecutionInterceptor) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.Interceptors.AfterExecution = append(o.Interceptors.AfterExecution, i) - return nil - } -} - -// WithAuthSchemePreference sets the priority order of auth schemes on config. -// -// Schemes are expressed as names e.g. sigv4a or sigv4. -func WithAuthSchemePreference(schemeIDs ...string) LoadOptionsFunc { - return func(o *LoadOptions) error { - o.AuthSchemePreference = schemeIDs - return nil - } -} - -func (o LoadOptions) getAuthSchemePreference() ([]string, bool) { - if len(o.AuthSchemePreference) > 0 { - return o.AuthSchemePreference, true - } - return nil, false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/local.go b/vendor/github.com/aws/aws-sdk-go-v2/config/local.go deleted file mode 100644 index b629137c8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/local.go +++ /dev/null @@ -1,51 +0,0 @@ -package config - -import ( - "fmt" - "net" - "net/url" -) - -var lookupHostFn = net.LookupHost - -func isLoopbackHost(host string) (bool, error) { - ip := net.ParseIP(host) - if ip != nil { - return ip.IsLoopback(), nil - } - - // Host is not an ip, perform lookup - addrs, err := lookupHostFn(host) - if err != nil { - return false, err - } - if len(addrs) == 0 { - return false, fmt.Errorf("no addrs found for host, %s", host) - } - - for _, addr := range addrs { - if !net.ParseIP(addr).IsLoopback() { - return false, nil - } - } - - return true, nil -} - -func validateLocalURL(v string) error { - u, err := url.Parse(v) - if err != nil { - return err - } - - host := u.Hostname() - if len(host) == 0 { - return fmt.Errorf("unable to parse host from local HTTP cred provider URL") - } else if isLoopback, err := isLoopbackHost(host); err != nil { - return fmt.Errorf("failed to resolve host %q, %v", host, err) - } else if !isLoopback { - return fmt.Errorf("invalid endpoint host, %q, only host resolving to loopback addresses are allowed", host) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go deleted file mode 100644 index 18b9b5ad2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go +++ /dev/null @@ -1,786 +0,0 @@ -package config - -import ( - "context" - "io" - "net/http" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" - "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" - smithybearer "github.com/aws/smithy-go/auth/bearer" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" -) - -// sharedConfigProfileProvider provides access to the shared config profile -// name external configuration value. -type sharedConfigProfileProvider interface { - getSharedConfigProfile(ctx context.Context) (string, bool, error) -} - -// getSharedConfigProfile searches the configs for a sharedConfigProfileProvider -// and returns the value if found. Returns an error if a provider fails before a -// value is found. -func getSharedConfigProfile(ctx context.Context, configs configs) (value string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(sharedConfigProfileProvider); ok { - value, found, err = p.getSharedConfigProfile(ctx) - if err != nil || found { - break - } - } - } - return -} - -// sharedConfigFilesProvider provides access to the shared config filesnames -// external configuration value. -type sharedConfigFilesProvider interface { - getSharedConfigFiles(ctx context.Context) ([]string, bool, error) -} - -// getSharedConfigFiles searches the configs for a sharedConfigFilesProvider -// and returns the value if found. Returns an error if a provider fails before a -// value is found. -func getSharedConfigFiles(ctx context.Context, configs configs) (value []string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(sharedConfigFilesProvider); ok { - value, found, err = p.getSharedConfigFiles(ctx) - if err != nil || found { - break - } - } - } - - return -} - -// sharedCredentialsFilesProvider provides access to the shared credentials filesnames -// external configuration value. -type sharedCredentialsFilesProvider interface { - getSharedCredentialsFiles(ctx context.Context) ([]string, bool, error) -} - -// getSharedCredentialsFiles searches the configs for a sharedCredentialsFilesProvider -// and returns the value if found. Returns an error if a provider fails before a -// value is found. -func getSharedCredentialsFiles(ctx context.Context, configs configs) (value []string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(sharedCredentialsFilesProvider); ok { - value, found, err = p.getSharedCredentialsFiles(ctx) - if err != nil || found { - break - } - } - } - - return -} - -// customCABundleProvider provides access to the custom CA bundle PEM bytes. -type customCABundleProvider interface { - getCustomCABundle(ctx context.Context) (io.Reader, bool, error) -} - -// getCustomCABundle searches the configs for a customCABundleProvider -// and returns the value if found. Returns an error if a provider fails before a -// value is found. -func getCustomCABundle(ctx context.Context, configs configs) (value io.Reader, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(customCABundleProvider); ok { - value, found, err = p.getCustomCABundle(ctx) - if err != nil || found { - break - } - } - } - - return -} - -// regionProvider provides access to the region external configuration value. -type regionProvider interface { - getRegion(ctx context.Context) (string, bool, error) -} - -// getRegion searches the configs for a regionProvider and returns the value -// if found. Returns an error if a provider fails before a value is found. -func getRegion(ctx context.Context, configs configs) (value string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(regionProvider); ok { - value, found, err = p.getRegion(ctx) - if err != nil || found { - break - } - } - } - return -} - -// IgnoreConfiguredEndpointsProvider is needed to search for all providers -// that provide a flag to disable configured endpoints. -type IgnoreConfiguredEndpointsProvider interface { - GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { - value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) - if err != nil || found { - break - } - } - } - return -} - -type baseEndpointProvider interface { - getBaseEndpoint(ctx context.Context) (string, bool, error) -} - -func getBaseEndpoint(ctx context.Context, configs configs) (value string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(baseEndpointProvider); ok { - value, found, err = p.getBaseEndpoint(ctx) - if err != nil || found { - break - } - } - } - return -} - -type servicesObjectProvider interface { - getServicesObject(ctx context.Context) (map[string]map[string]string, bool, error) -} - -func getServicesObject(ctx context.Context, configs configs) (value map[string]map[string]string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(servicesObjectProvider); ok { - value, found, err = p.getServicesObject(ctx) - if err != nil || found { - break - } - } - } - return -} - -// appIDProvider provides access to the sdk app ID value -type appIDProvider interface { - getAppID(ctx context.Context) (string, bool, error) -} - -func getAppID(ctx context.Context, configs configs) (value string, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(appIDProvider); ok { - value, found, err = p.getAppID(ctx) - if err != nil || found { - break - } - } - } - return -} - -// disableRequestCompressionProvider provides access to the DisableRequestCompression -type disableRequestCompressionProvider interface { - getDisableRequestCompression(context.Context) (bool, bool, error) -} - -func getDisableRequestCompression(ctx context.Context, configs configs) (value bool, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(disableRequestCompressionProvider); ok { - value, found, err = p.getDisableRequestCompression(ctx) - if err != nil || found { - break - } - } - } - return -} - -// requestMinCompressSizeBytesProvider provides access to the MinCompressSizeBytes -type requestMinCompressSizeBytesProvider interface { - getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) -} - -func getRequestMinCompressSizeBytes(ctx context.Context, configs configs) (value int64, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(requestMinCompressSizeBytesProvider); ok { - value, found, err = p.getRequestMinCompressSizeBytes(ctx) - if err != nil || found { - break - } - } - } - return -} - -// accountIDEndpointModeProvider provides access to the AccountIDEndpointMode -type accountIDEndpointModeProvider interface { - getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error) -} - -func getAccountIDEndpointMode(ctx context.Context, configs configs) (value aws.AccountIDEndpointMode, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(accountIDEndpointModeProvider); ok { - value, found, err = p.getAccountIDEndpointMode(ctx) - if err != nil || found { - break - } - } - } - return -} - -// requestChecksumCalculationProvider provides access to the RequestChecksumCalculation -type requestChecksumCalculationProvider interface { - getRequestChecksumCalculation(context.Context) (aws.RequestChecksumCalculation, bool, error) -} - -func getRequestChecksumCalculation(ctx context.Context, configs configs) (value aws.RequestChecksumCalculation, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(requestChecksumCalculationProvider); ok { - value, found, err = p.getRequestChecksumCalculation(ctx) - if err != nil || found { - break - } - } - } - return -} - -// responseChecksumValidationProvider provides access to the ResponseChecksumValidation -type responseChecksumValidationProvider interface { - getResponseChecksumValidation(context.Context) (aws.ResponseChecksumValidation, bool, error) -} - -func getResponseChecksumValidation(ctx context.Context, configs configs) (value aws.ResponseChecksumValidation, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(responseChecksumValidationProvider); ok { - value, found, err = p.getResponseChecksumValidation(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ec2IMDSRegionProvider provides access to the ec2 imds region -// configuration value -type ec2IMDSRegionProvider interface { - getEC2IMDSRegion(ctx context.Context) (string, bool, error) -} - -// getEC2IMDSRegion searches the configs for a ec2IMDSRegionProvider and -// returns the value if found. Returns an error if a provider fails before -// a value is found. -func getEC2IMDSRegion(ctx context.Context, configs configs) (region string, found bool, err error) { - for _, cfg := range configs { - if provider, ok := cfg.(ec2IMDSRegionProvider); ok { - region, found, err = provider.getEC2IMDSRegion(ctx) - if err != nil || found { - break - } - } - } - return -} - -// credentialsProviderProvider provides access to the credentials external -// configuration value. -type credentialsProviderProvider interface { - getCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error) -} - -// getCredentialsProvider searches the configs for a credentialsProviderProvider -// and returns the value if found. Returns an error if a provider fails before a -// value is found. -func getCredentialsProvider(ctx context.Context, configs configs) (p aws.CredentialsProvider, found bool, err error) { - for _, cfg := range configs { - if provider, ok := cfg.(credentialsProviderProvider); ok { - p, found, err = provider.getCredentialsProvider(ctx) - if err != nil || found { - break - } - } - } - return -} - -// credentialsCacheOptionsProvider is an interface for retrieving a function for setting -// the aws.CredentialsCacheOptions. -type credentialsCacheOptionsProvider interface { - getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) -} - -// getCredentialsCacheOptionsProvider is an interface for retrieving a function for setting -// the aws.CredentialsCacheOptions. -func getCredentialsCacheOptionsProvider(ctx context.Context, configs configs) ( - f func(*aws.CredentialsCacheOptions), found bool, err error, -) { - for _, config := range configs { - if p, ok := config.(credentialsCacheOptionsProvider); ok { - f, found, err = p.getCredentialsCacheOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// bearerAuthTokenProviderProvider provides access to the bearer authentication -// token external configuration value. -type bearerAuthTokenProviderProvider interface { - getBearerAuthTokenProvider(context.Context) (smithybearer.TokenProvider, bool, error) -} - -// getBearerAuthTokenProvider searches the config sources for a -// bearerAuthTokenProviderProvider and returns the value if found. Returns an -// error if a provider fails before a value is found. -func getBearerAuthTokenProvider(ctx context.Context, configs configs) (p smithybearer.TokenProvider, found bool, err error) { - for _, cfg := range configs { - if provider, ok := cfg.(bearerAuthTokenProviderProvider); ok { - p, found, err = provider.getBearerAuthTokenProvider(ctx) - if err != nil || found { - break - } - } - } - return -} - -// bearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for -// setting the smithy-go auth/bearer#TokenCacheOptions. -type bearerAuthTokenCacheOptionsProvider interface { - getBearerAuthTokenCacheOptions(context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) -} - -// getBearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for -// setting the smithy-go auth/bearer#TokenCacheOptions. -func getBearerAuthTokenCacheOptions(ctx context.Context, configs configs) ( - f func(*smithybearer.TokenCacheOptions), found bool, err error, -) { - for _, config := range configs { - if p, ok := config.(bearerAuthTokenCacheOptionsProvider); ok { - f, found, err = p.getBearerAuthTokenCacheOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ssoTokenProviderOptionsProvider is an interface for retrieving a function for -// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. -type ssoTokenProviderOptionsProvider interface { - getSSOTokenProviderOptions(context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) -} - -// getSSOTokenProviderOptions is an interface for retrieving a function for -// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. -func getSSOTokenProviderOptions(ctx context.Context, configs configs) ( - f func(*ssocreds.SSOTokenProviderOptions), found bool, err error, -) { - for _, config := range configs { - if p, ok := config.(ssoTokenProviderOptionsProvider); ok { - f, found, err = p.getSSOTokenProviderOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ssoTokenProviderOptionsProvider - -// processCredentialOptions is an interface for retrieving a function for setting -// the processcreds.Options. -type processCredentialOptions interface { - getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) -} - -// getProcessCredentialOptions searches the slice of configs and returns the first function found -func getProcessCredentialOptions(ctx context.Context, configs configs) (f func(*processcreds.Options), found bool, err error) { - for _, config := range configs { - if p, ok := config.(processCredentialOptions); ok { - f, found, err = p.getProcessCredentialOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ec2RoleCredentialOptionsProvider is an interface for retrieving a function -// for setting the ec2rolecreds.Provider options. -type ec2RoleCredentialOptionsProvider interface { - getEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error) -} - -// getEC2RoleCredentialProviderOptions searches the slice of configs and returns the first function found -func getEC2RoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*ec2rolecreds.Options), found bool, err error) { - for _, config := range configs { - if p, ok := config.(ec2RoleCredentialOptionsProvider); ok { - f, found, err = p.getEC2RoleCredentialOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// defaultRegionProvider is an interface for retrieving a default region if a region was not resolved from other sources -type defaultRegionProvider interface { - getDefaultRegion(ctx context.Context) (string, bool, error) -} - -// getDefaultRegion searches the slice of configs and returns the first fallback region found -func getDefaultRegion(ctx context.Context, configs configs) (value string, found bool, err error) { - for _, config := range configs { - if p, ok := config.(defaultRegionProvider); ok { - value, found, err = p.getDefaultRegion(ctx) - if err != nil || found { - break - } - } - } - return -} - -// endpointCredentialOptionsProvider is an interface for retrieving a function for setting -// the endpointcreds.ProviderOptions. -type endpointCredentialOptionsProvider interface { - getEndpointCredentialOptions(ctx context.Context) (func(*endpointcreds.Options), bool, error) -} - -// getEndpointCredentialProviderOptions searches the slice of configs and returns the first function found -func getEndpointCredentialProviderOptions(ctx context.Context, configs configs) (f func(*endpointcreds.Options), found bool, err error) { - for _, config := range configs { - if p, ok := config.(endpointCredentialOptionsProvider); ok { - f, found, err = p.getEndpointCredentialOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// webIdentityRoleCredentialOptionsProvider is an interface for retrieving a function for setting -// the stscreds.WebIdentityRoleProvider. -type webIdentityRoleCredentialOptionsProvider interface { - getWebIdentityRoleCredentialOptions(ctx context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error) -} - -// getWebIdentityCredentialProviderOptions searches the slice of configs and returns the first function found -func getWebIdentityCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.WebIdentityRoleOptions), found bool, err error) { - for _, config := range configs { - if p, ok := config.(webIdentityRoleCredentialOptionsProvider); ok { - f, found, err = p.getWebIdentityRoleCredentialOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// assumeRoleCredentialOptionsProvider is an interface for retrieving a function for setting -// the stscreds.AssumeRoleOptions. -type assumeRoleCredentialOptionsProvider interface { - getAssumeRoleCredentialOptions(ctx context.Context) (func(*stscreds.AssumeRoleOptions), bool, error) -} - -// getAssumeRoleCredentialProviderOptions searches the slice of configs and returns the first function found -func getAssumeRoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.AssumeRoleOptions), found bool, err error) { - for _, config := range configs { - if p, ok := config.(assumeRoleCredentialOptionsProvider); ok { - f, found, err = p.getAssumeRoleCredentialOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// HTTPClient is an HTTP client implementation -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// httpClientProvider is an interface for retrieving HTTPClient -type httpClientProvider interface { - getHTTPClient(ctx context.Context) (HTTPClient, bool, error) -} - -// getHTTPClient searches the slice of configs and returns the HTTPClient set on configs -func getHTTPClient(ctx context.Context, configs configs) (client HTTPClient, found bool, err error) { - for _, config := range configs { - if p, ok := config.(httpClientProvider); ok { - client, found, err = p.getHTTPClient(ctx) - if err != nil || found { - break - } - } - } - return -} - -// apiOptionsProvider is an interface for retrieving APIOptions -type apiOptionsProvider interface { - getAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error) -} - -// getAPIOptions searches the slice of configs and returns the APIOptions set on configs -func getAPIOptions(ctx context.Context, configs configs) (apiOptions []func(*middleware.Stack) error, found bool, err error) { - for _, config := range configs { - if p, ok := config.(apiOptionsProvider); ok { - // retrieve APIOptions from configs and set it on cfg - apiOptions, found, err = p.getAPIOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// endpointResolverProvider is an interface for retrieving an aws.EndpointResolver from a configuration source -type endpointResolverProvider interface { - getEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error) -} - -// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used -// to configure the aws.Config.EndpointResolver value. -func getEndpointResolver(ctx context.Context, configs configs) (f aws.EndpointResolver, found bool, err error) { - for _, c := range configs { - if p, ok := c.(endpointResolverProvider); ok { - f, found, err = p.getEndpointResolver(ctx) - if err != nil || found { - break - } - } - } - return -} - -// endpointResolverWithOptionsProvider is an interface for retrieving an aws.EndpointResolverWithOptions from a configuration source -type endpointResolverWithOptionsProvider interface { - getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) -} - -// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used -// to configure the aws.Config.EndpointResolver value. -func getEndpointResolverWithOptions(ctx context.Context, configs configs) (f aws.EndpointResolverWithOptions, found bool, err error) { - for _, c := range configs { - if p, ok := c.(endpointResolverWithOptionsProvider); ok { - f, found, err = p.getEndpointResolverWithOptions(ctx) - if err != nil || found { - break - } - } - } - return -} - -// loggerProvider is an interface for retrieving a logging.Logger from a configuration source. -type loggerProvider interface { - getLogger(ctx context.Context) (logging.Logger, bool, error) -} - -// getLogger searches the provided config sources for a logging.Logger that can be used -// to configure the aws.Config.Logger value. -func getLogger(ctx context.Context, configs configs) (l logging.Logger, found bool, err error) { - for _, c := range configs { - if p, ok := c.(loggerProvider); ok { - l, found, err = p.getLogger(ctx) - if err != nil || found { - break - } - } - } - return -} - -// clientLogModeProvider is an interface for retrieving the aws.ClientLogMode from a configuration source. -type clientLogModeProvider interface { - getClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error) -} - -func getClientLogMode(ctx context.Context, configs configs) (m aws.ClientLogMode, found bool, err error) { - for _, c := range configs { - if p, ok := c.(clientLogModeProvider); ok { - m, found, err = p.getClientLogMode(ctx) - if err != nil || found { - break - } - } - } - return -} - -// retryProvider is an configuration provider for custom Retryer. -type retryProvider interface { - getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) -} - -func getRetryer(ctx context.Context, configs configs) (v func() aws.Retryer, found bool, err error) { - for _, c := range configs { - if p, ok := c.(retryProvider); ok { - v, found, err = p.getRetryer(ctx) - if err != nil || found { - break - } - } - } - return -} - -// logConfigurationWarningsProvider is an configuration provider for -// retrieving a boolean indicating whether configuration issues should -// be logged when loading from config sources -type logConfigurationWarningsProvider interface { - getLogConfigurationWarnings(ctx context.Context) (bool, bool, error) -} - -func getLogConfigurationWarnings(ctx context.Context, configs configs) (v bool, found bool, err error) { - for _, c := range configs { - if p, ok := c.(logConfigurationWarningsProvider); ok { - v, found, err = p.getLogConfigurationWarnings(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ssoCredentialOptionsProvider is an interface for retrieving a function for setting -// the ssocreds.Options. -type ssoCredentialOptionsProvider interface { - getSSOProviderOptions(context.Context) (func(*ssocreds.Options), bool, error) -} - -func getSSOProviderOptions(ctx context.Context, configs configs) (v func(options *ssocreds.Options), found bool, err error) { - for _, c := range configs { - if p, ok := c.(ssoCredentialOptionsProvider); ok { - v, found, err = p.getSSOProviderOptions(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} - -type defaultsModeIMDSClientProvider interface { - getDefaultsModeIMDSClient(context.Context) (*imds.Client, bool, error) -} - -func getDefaultsModeIMDSClient(ctx context.Context, configs configs) (v *imds.Client, found bool, err error) { - for _, c := range configs { - if p, ok := c.(defaultsModeIMDSClientProvider); ok { - v, found, err = p.getDefaultsModeIMDSClient(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} - -type defaultsModeProvider interface { - getDefaultsMode(context.Context) (aws.DefaultsMode, bool, error) -} - -func getDefaultsMode(ctx context.Context, configs configs) (v aws.DefaultsMode, found bool, err error) { - for _, c := range configs { - if p, ok := c.(defaultsModeProvider); ok { - v, found, err = p.getDefaultsMode(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} - -type retryMaxAttemptsProvider interface { - GetRetryMaxAttempts(context.Context) (int, bool, error) -} - -func getRetryMaxAttempts(ctx context.Context, configs configs) (v int, found bool, err error) { - for _, c := range configs { - if p, ok := c.(retryMaxAttemptsProvider); ok { - v, found, err = p.GetRetryMaxAttempts(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} - -type retryModeProvider interface { - GetRetryMode(context.Context) (aws.RetryMode, bool, error) -} - -func getRetryMode(ctx context.Context, configs configs) (v aws.RetryMode, found bool, err error) { - for _, c := range configs { - if p, ok := c.(retryModeProvider); ok { - v, found, err = p.GetRetryMode(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} - -func getAuthSchemePreference(ctx context.Context, configs configs) ([]string, bool) { - type provider interface { - getAuthSchemePreference() ([]string, bool) - } - - for _, cfg := range configs { - if p, ok := cfg.(provider); ok { - if v, ok := p.getAuthSchemePreference(); ok { - return v, true - } - } - } - return nil, false -} - -type serviceOptionsProvider interface { - getServiceOptions(ctx context.Context) ([]func(string, any), bool, error) -} - -func getServiceOptions(ctx context.Context, configs configs) (v []func(string, any), found bool, err error) { - for _, c := range configs { - if p, ok := c.(serviceOptionsProvider); ok { - v, found, err = p.getServiceOptions(ctx) - if err != nil || found { - break - } - } - } - return v, found, err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go deleted file mode 100644 index 92a16d718..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go +++ /dev/null @@ -1,444 +0,0 @@ -package config - -import ( - "context" - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" - "net/http" - "os" - - "github.com/aws/aws-sdk-go-v2/aws" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" - "github.com/aws/smithy-go/logging" -) - -// resolveDefaultAWSConfig will write default configuration values into the cfg -// value. It will write the default values, overwriting any previous value. -// -// This should be used as the first resolver in the slice of resolvers when -// resolving external configuration. -func resolveDefaultAWSConfig(ctx context.Context, cfg *aws.Config, cfgs configs) error { - var sources []interface{} - for _, s := range cfgs { - sources = append(sources, s) - } - - *cfg = aws.Config{ - Logger: logging.NewStandardLogger(os.Stderr), - ConfigSources: sources, - } - return nil -} - -// resolveCustomCABundle extracts the first instance of a custom CA bundle filename -// from the external configurations. It will update the HTTP Client's builder -// to be configured with the custom CA bundle. -// -// Config provider used: -// * customCABundleProvider -func resolveCustomCABundle(ctx context.Context, cfg *aws.Config, cfgs configs) error { - pemCerts, found, err := getCustomCABundle(ctx, cfgs) - if err != nil { - // TODO error handling, What is the best way to handle this? - // capture previous errors continue. error out if all errors - return err - } - if !found { - return nil - } - - if cfg.HTTPClient == nil { - cfg.HTTPClient = awshttp.NewBuildableClient() - } - - trOpts, ok := cfg.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return fmt.Errorf("unable to add custom RootCAs HTTPClient, "+ - "has no WithTransportOptions, %T", cfg.HTTPClient) - } - - var appendErr error - client := trOpts.WithTransportOptions(func(tr *http.Transport) { - if tr.TLSClientConfig == nil { - tr.TLSClientConfig = &tls.Config{} - } - if tr.TLSClientConfig.RootCAs == nil { - tr.TLSClientConfig.RootCAs = x509.NewCertPool() - } - - b, err := ioutil.ReadAll(pemCerts) - if err != nil { - appendErr = fmt.Errorf("failed to read custom CA bundle PEM file") - } - - if !tr.TLSClientConfig.RootCAs.AppendCertsFromPEM(b) { - appendErr = fmt.Errorf("failed to load custom CA bundle PEM file") - } - }) - if appendErr != nil { - return appendErr - } - - cfg.HTTPClient = client - return err -} - -// resolveRegion extracts the first instance of a Region from the configs slice. -// -// Config providers used: -// * regionProvider -func resolveRegion(ctx context.Context, cfg *aws.Config, configs configs) error { - v, found, err := getRegion(ctx, configs) - if err != nil { - // TODO error handling, What is the best way to handle this? - // capture previous errors continue. error out if all errors - return err - } - if !found { - return nil - } - - cfg.Region = v - return nil -} - -func resolveBaseEndpoint(ctx context.Context, cfg *aws.Config, configs configs) error { - var downcastCfgSources []interface{} - for _, cs := range configs { - downcastCfgSources = append(downcastCfgSources, interface{}(cs)) - } - - if val, found, err := GetIgnoreConfiguredEndpoints(ctx, downcastCfgSources); found && val && err == nil { - cfg.BaseEndpoint = nil - return nil - } - - v, found, err := getBaseEndpoint(ctx, configs) - if err != nil { - return err - } - - if !found { - return nil - } - cfg.BaseEndpoint = aws.String(v) - return nil -} - -// resolveAppID extracts the sdk app ID from the configs slice's SharedConfig or env var -func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { - ID, _, err := getAppID(ctx, configs) - if err != nil { - return err - } - - cfg.AppID = ID - return nil -} - -// resolveDisableRequestCompression extracts the DisableRequestCompression from the configs slice's -// SharedConfig or EnvConfig -func resolveDisableRequestCompression(ctx context.Context, cfg *aws.Config, configs configs) error { - disable, _, err := getDisableRequestCompression(ctx, configs) - if err != nil { - return err - } - - cfg.DisableRequestCompression = disable - return nil -} - -// resolveRequestMinCompressSizeBytes extracts the RequestMinCompressSizeBytes from the configs slice's -// SharedConfig or EnvConfig -func resolveRequestMinCompressSizeBytes(ctx context.Context, cfg *aws.Config, configs configs) error { - minBytes, found, err := getRequestMinCompressSizeBytes(ctx, configs) - if err != nil { - return err - } - // must set a default min size 10240 if not configured - if !found { - minBytes = 10240 - } - cfg.RequestMinCompressSizeBytes = minBytes - return nil -} - -// resolveAccountIDEndpointMode extracts the AccountIDEndpointMode from the configs slice's -// SharedConfig or EnvConfig -func resolveAccountIDEndpointMode(ctx context.Context, cfg *aws.Config, configs configs) error { - m, found, err := getAccountIDEndpointMode(ctx, configs) - if err != nil { - return err - } - - if !found { - m = aws.AccountIDEndpointModePreferred - } - - cfg.AccountIDEndpointMode = m - return nil -} - -// resolveRequestChecksumCalculation extracts the RequestChecksumCalculation from the configs slice's -// SharedConfig or EnvConfig -func resolveRequestChecksumCalculation(ctx context.Context, cfg *aws.Config, configs configs) error { - c, found, err := getRequestChecksumCalculation(ctx, configs) - if err != nil { - return err - } - - if !found { - c = aws.RequestChecksumCalculationWhenSupported - } - cfg.RequestChecksumCalculation = c - return nil -} - -// resolveResponseValidation extracts the ResponseChecksumValidation from the configs slice's -// SharedConfig or EnvConfig -func resolveResponseChecksumValidation(ctx context.Context, cfg *aws.Config, configs configs) error { - c, found, err := getResponseChecksumValidation(ctx, configs) - if err != nil { - return err - } - - if !found { - c = aws.ResponseChecksumValidationWhenSupported - } - cfg.ResponseChecksumValidation = c - return nil -} - -// resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default -// region if region had not been resolved from other sources. -func resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error { - if len(cfg.Region) > 0 { - return nil - } - - v, found, err := getDefaultRegion(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.Region = v - - return nil -} - -// resolveHTTPClient extracts the first instance of a HTTPClient and sets `aws.Config.HTTPClient` to the HTTPClient instance -// if one has not been resolved from other sources. -func resolveHTTPClient(ctx context.Context, cfg *aws.Config, configs configs) error { - c, found, err := getHTTPClient(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.HTTPClient = c - return nil -} - -// resolveAPIOptions extracts the first instance of APIOptions and sets `aws.Config.APIOptions` to the resolved API options -// if one has not been resolved from other sources. -func resolveAPIOptions(ctx context.Context, cfg *aws.Config, configs configs) error { - o, found, err := getAPIOptions(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.APIOptions = o - - return nil -} - -// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice -// and sets the functions result on the aws.Config.EndpointResolver -func resolveEndpointResolver(ctx context.Context, cfg *aws.Config, configs configs) error { - endpointResolver, found, err := getEndpointResolver(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.EndpointResolver = endpointResolver - - return nil -} - -// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice -// and sets the functions result on the aws.Config.EndpointResolver -func resolveEndpointResolverWithOptions(ctx context.Context, cfg *aws.Config, configs configs) error { - endpointResolver, found, err := getEndpointResolverWithOptions(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.EndpointResolverWithOptions = endpointResolver - - return nil -} - -func resolveLogger(ctx context.Context, cfg *aws.Config, configs configs) error { - logger, found, err := getLogger(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.Logger = logger - - return nil -} - -func resolveClientLogMode(ctx context.Context, cfg *aws.Config, configs configs) error { - mode, found, err := getClientLogMode(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.ClientLogMode = mode - - return nil -} - -func resolveRetryer(ctx context.Context, cfg *aws.Config, configs configs) error { - retryer, found, err := getRetryer(ctx, configs) - if err != nil { - return err - } - - if found { - cfg.Retryer = retryer - return nil - } - - // Only load the retry options if a custom retryer has not be specified. - if err = resolveRetryMaxAttempts(ctx, cfg, configs); err != nil { - return err - } - return resolveRetryMode(ctx, cfg, configs) -} - -func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) error { - if len(cfg.Region) > 0 { - return nil - } - - region, found, err := getEC2IMDSRegion(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.Region = region - - return nil -} - -func resolveDefaultsModeOptions(ctx context.Context, cfg *aws.Config, configs configs) error { - defaultsMode, found, err := getDefaultsMode(ctx, configs) - if err != nil { - return err - } - if !found { - defaultsMode = aws.DefaultsModeLegacy - } - - var environment aws.RuntimeEnvironment - if defaultsMode == aws.DefaultsModeAuto { - envConfig, _, _ := getAWSConfigSources(configs) - - client, found, err := getDefaultsModeIMDSClient(ctx, configs) - if err != nil { - return err - } - if !found { - client = imds.NewFromConfig(*cfg) - } - - environment, err = resolveDefaultsModeRuntimeEnvironment(ctx, envConfig, client) - if err != nil { - return err - } - } - - cfg.DefaultsMode = defaultsMode - cfg.RuntimeEnvironment = environment - - return nil -} - -func resolveRetryMaxAttempts(ctx context.Context, cfg *aws.Config, configs configs) error { - maxAttempts, found, err := getRetryMaxAttempts(ctx, configs) - if err != nil || !found { - return err - } - cfg.RetryMaxAttempts = maxAttempts - - return nil -} - -func resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) error { - retryMode, found, err := getRetryMode(ctx, configs) - if err != nil || !found { - return err - } - cfg.RetryMode = retryMode - - return nil -} - -func resolveInterceptors(ctx context.Context, cfg *aws.Config, configs configs) error { - // LoadOptions is the only thing that you can really configure interceptors - // on so just check that directly. - for _, c := range configs { - if loadopts, ok := c.(LoadOptions); ok { - cfg.Interceptors = loadopts.Interceptors.Copy() - } - } - return nil -} - -func resolveAuthSchemePreference(ctx context.Context, cfg *aws.Config, configs configs) error { - if pref, ok := getAuthSchemePreference(ctx, configs); ok { - cfg.AuthSchemePreference = pref - } - return nil -} - -func resolveServiceOptions(ctx context.Context, cfg *aws.Config, configs configs) error { - serviceOptions, found, err := getServiceOptions(ctx, configs) - if err != nil { - return err - } - if !found { - return nil - } - - cfg.ServiceOptions = serviceOptions - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go deleted file mode 100644 index a8ebb3c0a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go +++ /dev/null @@ -1,122 +0,0 @@ -package config - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" - "github.com/aws/aws-sdk-go-v2/service/ssooidc" - smithybearer "github.com/aws/smithy-go/auth/bearer" -) - -// resolveBearerAuthToken extracts a token provider from the config sources. -// -// If an explicit bearer authentication token provider is not found the -// resolver will fallback to resolving token provider via other config sources -// such as SharedConfig. -func resolveBearerAuthToken(ctx context.Context, cfg *aws.Config, configs configs) error { - found, err := resolveBearerAuthTokenProvider(ctx, cfg, configs) - if found || err != nil { - return err - } - - return resolveBearerAuthTokenProviderChain(ctx, cfg, configs) -} - -// resolveBearerAuthTokenProvider extracts the first instance of -// BearerAuthTokenProvider from the config sources. -// -// The resolved BearerAuthTokenProvider will be wrapped in a cache to ensure -// the Token is only refreshed when needed. This also protects the -// TokenProvider so it can be used concurrently. -// -// Config providers used: -// * bearerAuthTokenProviderProvider -func resolveBearerAuthTokenProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { - tokenProvider, found, err := getBearerAuthTokenProvider(ctx, configs) - if !found || err != nil { - return false, err - } - - cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( - ctx, configs, tokenProvider) - if err != nil { - return false, err - } - - return true, nil -} - -func resolveBearerAuthTokenProviderChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) { - _, sharedConfig, _ := getAWSConfigSources(configs) - - var provider smithybearer.TokenProvider - - if sharedConfig.SSOSession != nil { - provider, err = resolveBearerAuthSSOTokenProvider( - ctx, cfg, sharedConfig.SSOSession, configs) - } - - if err == nil && provider != nil { - cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( - ctx, configs, provider) - } - - return err -} - -func resolveBearerAuthSSOTokenProvider(ctx context.Context, cfg *aws.Config, session *SSOSession, configs configs) (*ssocreds.SSOTokenProvider, error) { - ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) - if err != nil { - return nil, fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) - } - - var optFns []func(*ssocreds.SSOTokenProviderOptions) - if found { - optFns = append(optFns, ssoTokenProviderOptionsFn) - } - - cachePath, err := ssocreds.StandardCachedTokenFilepath(session.Name) - if err != nil { - return nil, fmt.Errorf("failed to get SSOTokenProvider's cache path, %w", err) - } - - client := ssooidc.NewFromConfig(*cfg) - provider := ssocreds.NewSSOTokenProvider(client, cachePath, optFns...) - - return provider, nil -} - -// wrapWithBearerAuthTokenCache will wrap provider with an smithy-go -// bearer/auth#TokenCache with the provided options if the provider is not -// already a TokenCache. -func wrapWithBearerAuthTokenCache( - ctx context.Context, - cfgs configs, - provider smithybearer.TokenProvider, - optFns ...func(*smithybearer.TokenCacheOptions), -) (smithybearer.TokenProvider, error) { - _, ok := provider.(*smithybearer.TokenCache) - if ok { - return provider, nil - } - - tokenCacheConfigOptions, optionsFound, err := getBearerAuthTokenCacheOptions(ctx, cfgs) - if err != nil { - return nil, err - } - - opts := make([]func(*smithybearer.TokenCacheOptions), 0, 2+len(optFns)) - opts = append(opts, func(o *smithybearer.TokenCacheOptions) { - o.RefreshBeforeExpires = 5 * time.Minute - o.RetrieveBearerTokenTimeout = 30 * time.Second - }) - opts = append(opts, optFns...) - if optionsFound { - opts = append(opts, tokenCacheConfigOptions) - } - - return smithybearer.NewTokenCache(provider, opts...), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go deleted file mode 100644 index b00259df0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go +++ /dev/null @@ -1,627 +0,0 @@ -package config - -import ( - "context" - "fmt" - "io/ioutil" - "net" - "net/url" - "os" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials" - "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" - "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" - "github.com/aws/aws-sdk-go-v2/service/sso" - "github.com/aws/aws-sdk-go-v2/service/ssooidc" - "github.com/aws/aws-sdk-go-v2/service/sts" -) - -const ( - // valid credential source values - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" - httpProviderAuthFileEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE" -) - -// direct representation of the IPv4 address for the ECS container -// "169.254.170.2" -var ecsContainerIPv4 net.IP = []byte{ - 169, 254, 170, 2, -} - -// direct representation of the IPv4 address for the EKS container -// "169.254.170.23" -var eksContainerIPv4 net.IP = []byte{ - 169, 254, 170, 23, -} - -// direct representation of the IPv6 address for the EKS container -// "fd00:ec2::23" -var eksContainerIPv6 net.IP = []byte{ - 0xFD, 0, 0xE, 0xC2, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0x23, -} - -var ( - ecsContainerEndpoint = "http://169.254.170.2" // not constant to allow for swapping during unit-testing -) - -// resolveCredentials extracts a credential provider from slice of config -// sources. -// -// If an explicit credential provider is not found the resolver will fallback -// to resolving credentials by extracting a credential provider from EnvConfig -// and SharedConfig. -func resolveCredentials(ctx context.Context, cfg *aws.Config, configs configs) error { - found, err := resolveCredentialProvider(ctx, cfg, configs) - if found || err != nil { - return err - } - - return resolveCredentialChain(ctx, cfg, configs) -} - -// resolveCredentialProvider extracts the first instance of Credentials from the -// config slices. -// -// The resolved CredentialProvider will be wrapped in a cache to ensure the -// credentials are only refreshed when needed. This also protects the -// credential provider to be used concurrently. -// -// Config providers used: -// * credentialsProviderProvider -func resolveCredentialProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { - credProvider, found, err := getCredentialsProvider(ctx, configs) - if !found || err != nil { - return false, err - } - - cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, credProvider) - if err != nil { - return false, err - } - - return true, nil -} - -// resolveCredentialChain resolves a credential provider chain using EnvConfig -// and SharedConfig if present in the slice of provided configs. -// -// The resolved CredentialProvider will be wrapped in a cache to ensure the -// credentials are only refreshed when needed. This also protects the -// credential provider to be used concurrently. -func resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) { - envConfig, sharedConfig, other := getAWSConfigSources(configs) - - // When checking if a profile was specified programmatically we should only consider the "other" - // configuration sources that have been provided. This ensures we correctly honor the expected credential - // hierarchy. - _, sharedProfileSet, err := getSharedConfigProfile(ctx, other) - if err != nil { - return err - } - - switch { - case sharedProfileSet: - ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other) - case envConfig.Credentials.HasKeys(): - ctx = addCredentialSource(ctx, aws.CredentialSourceEnvVars) - cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials, Source: getCredentialSources(ctx)} - case len(envConfig.WebIdentityTokenFilePath) > 0: - ctx = addCredentialSource(ctx, aws.CredentialSourceEnvVarsSTSWebIDToken) - err = assumeWebIdentity(ctx, cfg, envConfig.WebIdentityTokenFilePath, envConfig.RoleARN, envConfig.RoleSessionName, configs) - default: - ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other) - } - if err != nil { - return err - } - - // Wrap the resolved provider in a cache so the SDK will cache credentials. - cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, cfg.Credentials) - if err != nil { - return err - } - - return nil -} - -func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedConfig *SharedConfig, configs configs) (ctx2 context.Context, err error) { - switch { - case sharedConfig.Source != nil: - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSourceProfile) - // Assume IAM role with credentials source from a different profile. - ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig.Source, configs) - - case sharedConfig.Credentials.HasKeys(): - // Static Credentials from Shared Config/Credentials file. - ctx = addCredentialSource(ctx, aws.CredentialSourceProfile) - cfg.Credentials = credentials.StaticCredentialsProvider{ - Value: sharedConfig.Credentials, - Source: getCredentialSources(ctx), - } - - case len(sharedConfig.CredentialSource) != 0: - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileNamedProvider) - ctx, err = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs) - - case len(sharedConfig.WebIdentityTokenFile) != 0: - // Credentials from Assume Web Identity token require an IAM Role, and - // that roll will be assumed. May be wrapped with another assume role - // via SourceProfile. - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSTSWebIDToken) - return ctx, assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs) - - case sharedConfig.hasSSOConfiguration(): - if sharedConfig.hasLegacySSOConfiguration() { - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSSOLegacy) - ctx = addCredentialSource(ctx, aws.CredentialSourceSSOLegacy) - } else { - ctx = addCredentialSource(ctx, aws.CredentialSourceSSO) - } - if sharedConfig.SSOSession != nil { - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSSO) - } - err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs) - - case len(sharedConfig.CredentialProcess) != 0: - // Get credentials from CredentialProcess - ctx = addCredentialSource(ctx, aws.CredentialSourceProfileProcess) - ctx = addCredentialSource(ctx, aws.CredentialSourceProcess) - err = processCredentials(ctx, cfg, sharedConfig, configs) - - case len(envConfig.ContainerCredentialsRelativePath) != 0: - ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP) - err = resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) - - case len(envConfig.ContainerCredentialsEndpoint) != 0: - ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP) - err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) - - default: - ctx = addCredentialSource(ctx, aws.CredentialSourceIMDS) - err = resolveEC2RoleCredentials(ctx, cfg, configs) - } - if err != nil { - return ctx, err - } - - if len(sharedConfig.RoleARN) > 0 { - return ctx, credsFromAssumeRole(ctx, cfg, sharedConfig, configs) - } - - return ctx, nil -} - -func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error { - if err := sharedConfig.validateSSOConfiguration(); err != nil { - return err - } - - var options []func(*ssocreds.Options) - v, found, err := getSSOProviderOptions(ctx, configs) - if err != nil { - return err - } - if found { - options = append(options, v) - } - - cfgCopy := cfg.Copy() - - options = append(options, func(o *ssocreds.Options) { - o.CredentialSources = getCredentialSources(ctx) - }) - - if sharedConfig.SSOSession != nil { - ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) - if err != nil { - return fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) - } - var optFns []func(*ssocreds.SSOTokenProviderOptions) - if found { - optFns = append(optFns, ssoTokenProviderOptionsFn) - } - cfgCopy.Region = sharedConfig.SSOSession.SSORegion - cachedPath, err := ssocreds.StandardCachedTokenFilepath(sharedConfig.SSOSession.Name) - if err != nil { - return err - } - oidcClient := ssooidc.NewFromConfig(cfgCopy) - tokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath, optFns...) - options = append(options, func(o *ssocreds.Options) { - o.SSOTokenProvider = tokenProvider - o.CachedTokenFilepath = cachedPath - }) - } else { - cfgCopy.Region = sharedConfig.SSORegion - } - - cfg.Credentials = ssocreds.New(sso.NewFromConfig(cfgCopy), sharedConfig.SSOAccountID, sharedConfig.SSORoleName, sharedConfig.SSOStartURL, options...) - - return nil -} - -func ecsContainerURI(path string) string { - return fmt.Sprintf("%s%s", ecsContainerEndpoint, path) -} - -func processCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error { - var opts []func(*processcreds.Options) - - options, found, err := getProcessCredentialOptions(ctx, configs) - if err != nil { - return err - } - if found { - opts = append(opts, options) - } - - opts = append(opts, func(o *processcreds.Options) { - o.CredentialSources = getCredentialSources(ctx) - }) - - cfg.Credentials = processcreds.NewProvider(sharedConfig.CredentialProcess, opts...) - - return nil -} - -// isAllowedHost allows host to be loopback or known ECS/EKS container IPs -// -// host can either be an IP address OR an unresolved hostname - resolution will -// be automatically performed in the latter case -func isAllowedHost(host string) (bool, error) { - if ip := net.ParseIP(host); ip != nil { - return isIPAllowed(ip), nil - } - - addrs, err := lookupHostFn(host) - if err != nil { - return false, err - } - - for _, addr := range addrs { - if ip := net.ParseIP(addr); ip == nil || !isIPAllowed(ip) { - return false, nil - } - } - - return true, nil -} - -func isIPAllowed(ip net.IP) bool { - return ip.IsLoopback() || - ip.Equal(ecsContainerIPv4) || - ip.Equal(eksContainerIPv4) || - ip.Equal(eksContainerIPv6) -} - -func resolveLocalHTTPCredProvider(ctx context.Context, cfg *aws.Config, endpointURL, authToken string, configs configs) error { - var resolveErr error - - parsed, err := url.Parse(endpointURL) - if err != nil { - resolveErr = fmt.Errorf("invalid URL, %w", err) - } else { - host := parsed.Hostname() - if len(host) == 0 { - resolveErr = fmt.Errorf("unable to parse host from local HTTP cred provider URL") - } else if parsed.Scheme == "http" { - if isAllowedHost, allowHostErr := isAllowedHost(host); allowHostErr != nil { - resolveErr = fmt.Errorf("failed to resolve host %q, %v", host, allowHostErr) - } else if !isAllowedHost { - resolveErr = fmt.Errorf("invalid endpoint host, %q, only loopback/ecs/eks hosts are allowed", host) - } - } - } - - if resolveErr != nil { - return resolveErr - } - - return resolveHTTPCredProvider(ctx, cfg, endpointURL, authToken, configs) -} - -func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToken string, configs configs) error { - optFns := []func(*endpointcreds.Options){ - func(options *endpointcreds.Options) { - if len(authToken) != 0 { - options.AuthorizationToken = authToken - } - if authFilePath := os.Getenv(httpProviderAuthFileEnvVar); authFilePath != "" { - options.AuthorizationTokenProvider = endpointcreds.TokenProviderFunc(func() (string, error) { - var contents []byte - var err error - if contents, err = ioutil.ReadFile(authFilePath); err != nil { - return "", fmt.Errorf("failed to read authorization token from %v: %v", authFilePath, err) - } - return string(contents), nil - }) - } - options.APIOptions = cfg.APIOptions - if cfg.Retryer != nil { - options.Retryer = cfg.Retryer() - } - options.CredentialSources = getCredentialSources(ctx) - }, - } - - optFn, found, err := getEndpointCredentialProviderOptions(ctx, configs) - if err != nil { - return err - } - if found { - optFns = append(optFns, optFn) - } - - provider := endpointcreds.New(url, optFns...) - - cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider, func(options *aws.CredentialsCacheOptions) { - options.ExpiryWindow = 5 * time.Minute - }) - if err != nil { - return err - } - - return nil -} - -func resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedCfg *SharedConfig, configs configs) (context.Context, error) { - switch sharedCfg.CredentialSource { - case credSourceEc2Metadata: - ctx = addCredentialSource(ctx, aws.CredentialSourceIMDS) - return ctx, resolveEC2RoleCredentials(ctx, cfg, configs) - - case credSourceEnvironment: - ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP) - cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials, Source: getCredentialSources(ctx)} - - case credSourceECSContainer: - ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP) - if len(envConfig.ContainerCredentialsRelativePath) != 0 { - return ctx, resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) - } - if len(envConfig.ContainerCredentialsEndpoint) != 0 { - return ctx, resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) - } - return ctx, fmt.Errorf("EcsContainer was specified as the credential_source, but neither 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' or AWS_CONTAINER_CREDENTIALS_FULL_URI' was set") - - default: - return ctx, fmt.Errorf("credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment") - } - - return ctx, nil -} - -func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs configs) error { - optFns := make([]func(*ec2rolecreds.Options), 0, 2) - - optFn, found, err := getEC2RoleCredentialProviderOptions(ctx, configs) - if err != nil { - return err - } - if found { - optFns = append(optFns, optFn) - } - - optFns = append(optFns, func(o *ec2rolecreds.Options) { - // Only define a client from config if not already defined. - if o.Client == nil { - o.Client = imds.NewFromConfig(*cfg) - } - o.CredentialSources = getCredentialSources(ctx) - }) - - provider := ec2rolecreds.New(optFns...) - - cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider) - if err != nil { - return err - } - return nil -} - -func getAWSConfigSources(cfgs configs) (*EnvConfig, *SharedConfig, configs) { - var ( - envConfig *EnvConfig - sharedConfig *SharedConfig - other configs - ) - - for i := range cfgs { - switch c := cfgs[i].(type) { - case EnvConfig: - if envConfig == nil { - envConfig = &c - } - case *EnvConfig: - if envConfig == nil { - envConfig = c - } - case SharedConfig: - if sharedConfig == nil { - sharedConfig = &c - } - case *SharedConfig: - if envConfig == nil { - sharedConfig = c - } - default: - other = append(other, c) - } - } - - if envConfig == nil { - envConfig = &EnvConfig{} - } - - if sharedConfig == nil { - sharedConfig = &SharedConfig{} - } - - return envConfig, sharedConfig, other -} - -// AssumeRoleTokenProviderNotSetError is an error returned when creating a -// session when the MFAToken option is not set when shared config is configured -// load assume a role with an MFA token. -type AssumeRoleTokenProviderNotSetError struct{} - -// Error is the error message -func (e AssumeRoleTokenProviderNotSetError) Error() string { - return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") -} - -func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, roleARN, sessionName string, configs configs) error { - if len(filepath) == 0 { - return fmt.Errorf("token file path is not set") - } - - optFns := []func(*stscreds.WebIdentityRoleOptions){ - func(options *stscreds.WebIdentityRoleOptions) { - options.RoleSessionName = sessionName - }, - } - - optFn, found, err := getWebIdentityCredentialProviderOptions(ctx, configs) - if err != nil { - return err - } - - if found { - optFns = append(optFns, optFn) - } - - opts := stscreds.WebIdentityRoleOptions{ - RoleARN: roleARN, - } - - optFns = append(optFns, func(options *stscreds.WebIdentityRoleOptions) { - options.CredentialSources = getCredentialSources(ctx) - }) - - for _, fn := range optFns { - fn(&opts) - } - - if len(opts.RoleARN) == 0 { - return fmt.Errorf("role ARN is not set") - } - - client := opts.Client - if client == nil { - client = sts.NewFromConfig(*cfg) - } - - provider := stscreds.NewWebIdentityRoleProvider(client, roleARN, stscreds.IdentityTokenFile(filepath), optFns...) - - cfg.Credentials = provider - - return nil -} - -func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *SharedConfig, configs configs) (err error) { - // resolve credentials early - credentialSources := getCredentialSources(ctx) - optFns := []func(*stscreds.AssumeRoleOptions){ - func(options *stscreds.AssumeRoleOptions) { - options.RoleSessionName = sharedCfg.RoleSessionName - if sharedCfg.RoleDurationSeconds != nil { - if *sharedCfg.RoleDurationSeconds/time.Minute > 15 { - options.Duration = *sharedCfg.RoleDurationSeconds - } - } - // Assume role with external ID - if len(sharedCfg.ExternalID) > 0 { - options.ExternalID = aws.String(sharedCfg.ExternalID) - } - - // Assume role with MFA - if len(sharedCfg.MFASerial) != 0 { - options.SerialNumber = aws.String(sharedCfg.MFASerial) - } - - // add existing credential chain - options.CredentialSources = credentialSources - }, - } - - optFn, found, err := getAssumeRoleCredentialProviderOptions(ctx, configs) - if err != nil { - return err - } - if found { - optFns = append(optFns, optFn) - } - - { - // Synthesize options early to validate configuration errors sooner to ensure a token provider - // is present if the SerialNumber was set. - var o stscreds.AssumeRoleOptions - for _, fn := range optFns { - fn(&o) - } - if o.TokenProvider == nil && o.SerialNumber != nil { - return AssumeRoleTokenProviderNotSetError{} - } - } - cfg.Credentials = stscreds.NewAssumeRoleProvider(sts.NewFromConfig(*cfg), sharedCfg.RoleARN, optFns...) - - return nil -} - -// wrapWithCredentialsCache will wrap provider with an aws.CredentialsCache -// with the provided options if the provider is not already a -// aws.CredentialsCache. -func wrapWithCredentialsCache( - ctx context.Context, - cfgs configs, - provider aws.CredentialsProvider, - optFns ...func(options *aws.CredentialsCacheOptions), -) (aws.CredentialsProvider, error) { - _, ok := provider.(*aws.CredentialsCache) - if ok { - return provider, nil - } - - credCacheOptions, optionsFound, err := getCredentialsCacheOptionsProvider(ctx, cfgs) - if err != nil { - return nil, err - } - - // force allocation of a new slice if the additional options are - // needed, to prevent overwriting the passed in slice of options. - optFns = optFns[:len(optFns):len(optFns)] - if optionsFound { - optFns = append(optFns, credCacheOptions) - } - - return aws.NewCredentialsCache(provider, optFns...), nil -} - -// credentialSource stores the chain of providers that was used to create an instance of -// a credentials provider on the context -type credentialSource struct{} - -func addCredentialSource(ctx context.Context, source aws.CredentialSource) context.Context { - existing, ok := ctx.Value(credentialSource{}).([]aws.CredentialSource) - if !ok { - existing = []aws.CredentialSource{source} - } else { - existing = append(existing, source) - } - return context.WithValue(ctx, credentialSource{}, existing) -} - -func getCredentialSources(ctx context.Context) []aws.CredentialSource { - return ctx.Value(credentialSource{}).([]aws.CredentialSource) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go deleted file mode 100644 index 97be3f756..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ /dev/null @@ -1,1696 +0,0 @@ -package config - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" - "github.com/aws/aws-sdk-go-v2/internal/ini" - "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" - "github.com/aws/smithy-go/logging" - smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" -) - -const ( - // Prefix to use for filtering profiles. The profile prefix should only - // exist in the shared config file, not the credentials file. - profilePrefix = `profile ` - - // Prefix to be used for SSO sections. These are supposed to only exist in - // the shared config file, not the credentials file. - ssoSectionPrefix = `sso-session ` - - // Prefix for services section. It is referenced in profile via the services - // parameter to configure clients for service-specific parameters. - servicesPrefix = `services ` - - // string equivalent for boolean - endpointDiscoveryDisabled = `false` - endpointDiscoveryEnabled = `true` - endpointDiscoveryAuto = `auto` - - // Static Credentials group - accessKeyIDKey = `aws_access_key_id` // group required - secretAccessKey = `aws_secret_access_key` // group required - sessionTokenKey = `aws_session_token` // optional - - // Assume Role Credentials group - roleArnKey = `role_arn` // group required - sourceProfileKey = `source_profile` // group required - credentialSourceKey = `credential_source` // group required (or source_profile) - externalIDKey = `external_id` // optional - mfaSerialKey = `mfa_serial` // optional - roleSessionNameKey = `role_session_name` // optional - roleDurationSecondsKey = "duration_seconds" // optional - - // AWS Single Sign-On (AWS SSO) group - ssoSessionNameKey = "sso_session" - - ssoRegionKey = "sso_region" - ssoStartURLKey = "sso_start_url" - - ssoAccountIDKey = "sso_account_id" - ssoRoleNameKey = "sso_role_name" - - // Additional Config fields - regionKey = `region` - - // endpoint discovery group - enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional - - // External Credential process - credentialProcessKey = `credential_process` // optional - - // Web Identity Token File - webIdentityTokenFileKey = `web_identity_token_file` // optional - - // S3 ARN Region Usage - s3UseARNRegionKey = "s3_use_arn_region" - - ec2MetadataServiceEndpointModeKey = "ec2_metadata_service_endpoint_mode" - - ec2MetadataServiceEndpointKey = "ec2_metadata_service_endpoint" - - ec2MetadataV1DisabledKey = "ec2_metadata_v1_disabled" - - // Use DualStack Endpoint Resolution - useDualStackEndpoint = "use_dualstack_endpoint" - - // DefaultSharedConfigProfile is the default profile to be used when - // loading configuration from the config files if another profile name - // is not provided. - DefaultSharedConfigProfile = `default` - - // S3 Disable Multi-Region AccessPoints - s3DisableMultiRegionAccessPointsKey = `s3_disable_multiregion_access_points` - - useFIPSEndpointKey = "use_fips_endpoint" - - defaultsModeKey = "defaults_mode" - - // Retry options - retryMaxAttemptsKey = "max_attempts" - retryModeKey = "retry_mode" - - caBundleKey = "ca_bundle" - - sdkAppID = "sdk_ua_app_id" - - ignoreConfiguredEndpoints = "ignore_configured_endpoint_urls" - - endpointURL = "endpoint_url" - - servicesSectionKey = "services" - - disableRequestCompression = "disable_request_compression" - requestMinCompressionSizeBytes = "request_min_compression_size_bytes" - - s3DisableExpressSessionAuthKey = "s3_disable_express_session_auth" - - accountIDKey = "aws_account_id" - accountIDEndpointMode = "account_id_endpoint_mode" - - requestChecksumCalculationKey = "request_checksum_calculation" - responseChecksumValidationKey = "response_checksum_validation" - checksumWhenSupported = "when_supported" - checksumWhenRequired = "when_required" - - authSchemePreferenceKey = "auth_scheme_preference" -) - -// defaultSharedConfigProfile allows for swapping the default profile for testing -var defaultSharedConfigProfile = DefaultSharedConfigProfile - -// DefaultSharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/credentials -// - Windows: %USERPROFILE%\.aws\credentials -func DefaultSharedCredentialsFilename() string { - return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "credentials") -} - -// DefaultSharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/config -// - Windows: %USERPROFILE%\.aws\config -func DefaultSharedConfigFilename() string { - return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "config") -} - -// DefaultSharedConfigFiles is a slice of the default shared config files that -// the will be used in order to load the SharedConfig. -var DefaultSharedConfigFiles = []string{ - DefaultSharedConfigFilename(), -} - -// DefaultSharedCredentialsFiles is a slice of the default shared credentials -// files that the will be used in order to load the SharedConfig. -var DefaultSharedCredentialsFiles = []string{ - DefaultSharedCredentialsFilename(), -} - -// SSOSession provides the shared configuration parameters of the sso-session -// section. -type SSOSession struct { - Name string - SSORegion string - SSOStartURL string -} - -func (s *SSOSession) setFromIniSection(section ini.Section) { - updateString(&s.Name, section, ssoSessionNameKey) - updateString(&s.SSORegion, section, ssoRegionKey) - updateString(&s.SSOStartURL, section, ssoStartURLKey) -} - -// Services contains values configured in the services section -// of the AWS configuration file. -type Services struct { - // Services section values - // {"serviceId": {"key": "value"}} - // e.g. {"s3": {"endpoint_url": "example.com"}} - ServiceValues map[string]map[string]string -} - -func (s *Services) setFromIniSection(section ini.Section) { - if s.ServiceValues == nil { - s.ServiceValues = make(map[string]map[string]string) - } - for _, service := range section.List() { - s.ServiceValues[service] = section.Map(service) - } -} - -// SharedConfig represents the configuration fields of the SDK config files. -type SharedConfig struct { - Profile string - - // Credentials values from the config file. Both aws_access_key_id - // and aws_secret_access_key must be provided together in the same file - // to be considered valid. The values will be ignored if not a complete group. - // aws_session_token is an optional field that can be provided if both of the - // other two fields are also provided. - // - // aws_access_key_id - // aws_secret_access_key - // aws_session_token - Credentials aws.Credentials - - CredentialSource string - CredentialProcess string - WebIdentityTokenFile string - - // SSO session options - SSOSessionName string - SSOSession *SSOSession - - // Legacy SSO session options - SSORegion string - SSOStartURL string - - // SSO fields not used - SSOAccountID string - SSORoleName string - - RoleARN string - ExternalID string - MFASerial string - RoleSessionName string - RoleDurationSeconds *time.Duration - - SourceProfileName string - Source *SharedConfig - - // Region is the region the SDK should use for looking up AWS service endpoints - // and signing requests. - // - // region = us-west-2 - Region string - - // EnableEndpointDiscovery can be enabled or disabled in the shared config - // by setting endpoint_discovery_enabled to true, or false respectively. - // - // endpoint_discovery_enabled = true - EnableEndpointDiscovery aws.EndpointDiscoveryEnableState - - // Specifies if the S3 service should allow ARNs to direct the region - // the client's requests are sent to. - // - // s3_use_arn_region=true - S3UseARNRegion *bool - - // Specifies the EC2 Instance Metadata Service default endpoint selection - // mode (IPv4 or IPv6) - // - // ec2_metadata_service_endpoint_mode=IPv6 - EC2IMDSEndpointMode imds.EndpointModeState - - // Specifies the EC2 Instance Metadata Service endpoint to use. If - // specified it overrides EC2IMDSEndpointMode. - // - // ec2_metadata_service_endpoint=http://fd00:ec2::254 - EC2IMDSEndpoint string - - // Specifies that IMDS clients should not fallback to IMDSv1 if token - // requests fail. - // - // ec2_metadata_v1_disabled=true - EC2IMDSv1Disabled *bool - - // Specifies if the S3 service should disable support for Multi-Region - // access-points - // - // s3_disable_multiregion_access_points=true - S3DisableMultiRegionAccessPoints *bool - - // Specifies that SDK clients must resolve a dual-stack endpoint for - // services. - // - // use_dualstack_endpoint=true - UseDualStackEndpoint aws.DualStackEndpointState - - // Specifies that SDK clients must resolve a FIPS endpoint for - // services. - // - // use_fips_endpoint=true - UseFIPSEndpoint aws.FIPSEndpointState - - // Specifies which defaults mode should be used by services. - // - // defaults_mode=standard - DefaultsMode aws.DefaultsMode - - // Specifies the maximum number attempts an API client will call an - // operation that fails with a retryable error. - // - // max_attempts=3 - RetryMaxAttempts int - - // Specifies the retry model the API client will be created with. - // - // retry_mode=standard - RetryMode aws.RetryMode - - // Sets the path to a custom Credentials Authority (CA) Bundle PEM file - // that the SDK will use instead of the system's root CA bundle. Only use - // this if you want to configure the SDK to use a custom set of CAs. - // - // Enabling this option will attempt to merge the Transport into the SDK's - // HTTP client. If the client's Transport is not a http.Transport an error - // will be returned. If the Transport's TLS config is set this option will - // cause the SDK to overwrite the Transport's TLS config's RootCAs value. - // - // Setting a custom HTTPClient in the aws.Config options will override this - // setting. To use this option and custom HTTP client, the HTTP client - // needs to be provided when creating the config. Not the service client. - // - // ca_bundle=$HOME/my_custom_ca_bundle - CustomCABundle string - - // aws sdk app ID that can be added to user agent header string - AppID string - - // Flag used to disable configured endpoints. - IgnoreConfiguredEndpoints *bool - - // Value to contain configured endpoints to be propagated to - // corresponding endpoint resolution field. - BaseEndpoint string - - // Services section config. - ServicesSectionName string - Services Services - - // determine if request compression is allowed, default to false - // retrieved from config file's profile field disable_request_compression - DisableRequestCompression *bool - - // inclusive threshold request body size to trigger compression, - // default to 10240 and must be within 0 and 10485760 bytes inclusive - // retrieved from config file's profile field request_min_compression_size_bytes - RequestMinCompressSizeBytes *int64 - - // Whether S3Express auth is disabled. - // - // This will NOT prevent requests from being made to S3Express buckets, it - // will only bypass the modified endpoint routing and signing behaviors - // associated with the feature. - S3DisableExpressAuth *bool - - AccountIDEndpointMode aws.AccountIDEndpointMode - - // RequestChecksumCalculation indicates if the request checksum should be calculated - RequestChecksumCalculation aws.RequestChecksumCalculation - - // ResponseChecksumValidation indicates if the response checksum should be validated - ResponseChecksumValidation aws.ResponseChecksumValidation - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { - if len(c.DefaultsMode) == 0 { - return "", false, nil - } - - return c.DefaultsMode, true, nil -} - -// GetRetryMaxAttempts returns the maximum number of attempts an API client -// created Retryer should attempt an operation call before failing. -func (c SharedConfig) GetRetryMaxAttempts(ctx context.Context) (value int, ok bool, err error) { - if c.RetryMaxAttempts == 0 { - return 0, false, nil - } - - return c.RetryMaxAttempts, true, nil -} - -// GetRetryMode returns the model the API client should create its Retryer in. -func (c SharedConfig) GetRetryMode(ctx context.Context) (value aws.RetryMode, ok bool, err error) { - if len(c.RetryMode) == 0 { - return "", false, nil - } - - return c.RetryMode, true, nil -} - -// GetS3UseARNRegion returns if the S3 service should allow ARNs to direct the region -// the client's requests are sent to. -func (c SharedConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { - if c.S3UseARNRegion == nil { - return false, false, nil - } - - return *c.S3UseARNRegion, true, nil -} - -// GetEnableEndpointDiscovery returns if the enable_endpoint_discovery is set. -func (c SharedConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { - if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { - return aws.EndpointDiscoveryUnset, false, nil - } - - return c.EnableEndpointDiscovery, true, nil -} - -// GetS3DisableMultiRegionAccessPoints returns if the S3 service should disable support for Multi-Region -// access-points. -func (c SharedConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { - if c.S3DisableMultiRegionAccessPoints == nil { - return false, false, nil - } - - return *c.S3DisableMultiRegionAccessPoints, true, nil -} - -// GetRegion returns the region for the profile if a region is set. -func (c SharedConfig) getRegion(ctx context.Context) (string, bool, error) { - if len(c.Region) == 0 { - return "", false, nil - } - return c.Region, true, nil -} - -// GetCredentialsProvider returns the credentials for a profile if they were set. -func (c SharedConfig) getCredentialsProvider() (aws.Credentials, bool, error) { - return c.Credentials, true, nil -} - -// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. -func (c SharedConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { - if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { - return imds.EndpointModeStateUnset, false, nil - } - - return c.EC2IMDSEndpointMode, true, nil -} - -// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. -func (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) { - if len(c.EC2IMDSEndpoint) == 0 { - return "", false, nil - } - - return c.EC2IMDSEndpoint, true, nil -} - -// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option -// resolver interface. -func (c SharedConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { - if c.EC2IMDSv1Disabled == nil { - return false, false - } - - return *c.EC2IMDSv1Disabled, true -} - -// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be -// used for requests. -func (c SharedConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { - if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { - return aws.DualStackEndpointStateUnset, false, nil - } - - return c.UseDualStackEndpoint, true, nil -} - -// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be -// used for requests. -func (c SharedConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { - if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { - return aws.FIPSEndpointStateUnset, false, nil - } - - return c.UseFIPSEndpoint, true, nil -} - -// GetS3DisableExpressAuth returns the configured value for -// [SharedConfig.S3DisableExpressAuth]. -func (c SharedConfig) GetS3DisableExpressAuth() (value, ok bool) { - if c.S3DisableExpressAuth == nil { - return false, false - } - - return *c.S3DisableExpressAuth, true -} - -// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was -func (c SharedConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { - if len(c.CustomCABundle) == 0 { - return nil, false, nil - } - - b, err := ioutil.ReadFile(c.CustomCABundle) - if err != nil { - return nil, false, err - } - return bytes.NewReader(b), true, nil -} - -// getAppID returns the sdk app ID if set in shared config profile -func (c SharedConfig) getAppID(context.Context) (string, bool, error) { - return c.AppID, len(c.AppID) > 0, nil -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func (c SharedConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { - if c.IgnoreConfiguredEndpoints == nil { - return false, false, nil - } - - return *c.IgnoreConfiguredEndpoints, true, nil -} - -func (c SharedConfig) getBaseEndpoint(context.Context) (string, bool, error) { - return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil -} - -// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use -// with configured endpoints. -func (c SharedConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { - if service, ok := c.Services.ServiceValues[normalizeShared(sdkID)]; ok { - if endpt, ok := service[endpointURL]; ok { - return endpt, true, nil - } - } - return "", false, nil -} - -func normalizeShared(sdkID string) string { - lower := strings.ToLower(sdkID) - return strings.ReplaceAll(lower, " ", "_") -} - -func (c SharedConfig) getServicesObject(context.Context) (map[string]map[string]string, bool, error) { - return c.Services.ServiceValues, c.Services.ServiceValues != nil, nil -} - -// loadSharedConfigIgnoreNotExist is an alias for loadSharedConfig with the -// addition of ignoring when none of the files exist or when the profile -// is not found in any of the files. -func loadSharedConfigIgnoreNotExist(ctx context.Context, configs configs) (Config, error) { - cfg, err := loadSharedConfig(ctx, configs) - if err != nil { - if _, ok := err.(SharedConfigProfileNotExistError); ok { - return SharedConfig{}, nil - } - return nil, err - } - - return cfg, nil -} - -// loadSharedConfig uses the configs passed in to load the SharedConfig from file -// The file names and profile name are sourced from the configs. -// -// If profile name is not provided DefaultSharedConfigProfile (default) will -// be used. -// -// If shared config filenames are not provided DefaultSharedConfigFiles will -// be used. -// -// Config providers used: -// * sharedConfigProfileProvider -// * sharedConfigFilesProvider -func loadSharedConfig(ctx context.Context, configs configs) (Config, error) { - var profile string - var configFiles []string - var credentialsFiles []string - var ok bool - var err error - - profile, ok, err = getSharedConfigProfile(ctx, configs) - if err != nil { - return nil, err - } - if !ok { - profile = defaultSharedConfigProfile - } - - configFiles, ok, err = getSharedConfigFiles(ctx, configs) - if err != nil { - return nil, err - } - - credentialsFiles, ok, err = getSharedCredentialsFiles(ctx, configs) - if err != nil { - return nil, err - } - - // setup logger if log configuration warning is seti - var logger logging.Logger - logWarnings, found, err := getLogConfigurationWarnings(ctx, configs) - if err != nil { - return SharedConfig{}, err - } - if found && logWarnings { - logger, found, err = getLogger(ctx, configs) - if err != nil { - return SharedConfig{}, err - } - if !found { - logger = logging.NewStandardLogger(os.Stderr) - } - } - - return LoadSharedConfigProfile(ctx, profile, - func(o *LoadSharedConfigOptions) { - o.Logger = logger - o.ConfigFiles = configFiles - o.CredentialsFiles = credentialsFiles - }, - ) -} - -// LoadSharedConfigOptions struct contains optional values that can be used to load the config. -type LoadSharedConfigOptions struct { - - // CredentialsFiles are the shared credentials files - CredentialsFiles []string - - // ConfigFiles are the shared config files - ConfigFiles []string - - // Logger is the logger used to log shared config behavior - Logger logging.Logger -} - -// LoadSharedConfigProfile retrieves the configuration from the list of files -// using the profile provided. The order the files are listed will determine -// precedence. Values in subsequent files will overwrite values defined in -// earlier files. -// -// For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of A's. -// -// If config files are not set, SDK will default to using a file at location `.aws/config` if present. -// If credentials files are not set, SDK will default to using a file at location `.aws/credentials` if present. -// No default files are set, if files set to an empty slice. -// -// You can read more about shared config and credentials file location at -// https://docs.aws.amazon.com/credref/latest/refdocs/file-location.html#file-location -func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func(*LoadSharedConfigOptions)) (SharedConfig, error) { - var option LoadSharedConfigOptions - for _, fn := range optFns { - fn(&option) - } - - if option.ConfigFiles == nil { - option.ConfigFiles = DefaultSharedConfigFiles - } - - if option.CredentialsFiles == nil { - option.CredentialsFiles = DefaultSharedCredentialsFiles - } - - // load shared configuration sections from shared configuration INI options - configSections, err := loadIniFiles(option.ConfigFiles) - if err != nil { - return SharedConfig{}, err - } - - // check for profile prefix and drop duplicates or invalid profiles - err = processConfigSections(ctx, &configSections, option.Logger) - if err != nil { - return SharedConfig{}, err - } - - // load shared credentials sections from shared credentials INI options - credentialsSections, err := loadIniFiles(option.CredentialsFiles) - if err != nil { - return SharedConfig{}, err - } - - // check for profile prefix and drop duplicates or invalid profiles - err = processCredentialsSections(ctx, &credentialsSections, option.Logger) - if err != nil { - return SharedConfig{}, err - } - - err = mergeSections(&configSections, credentialsSections) - if err != nil { - return SharedConfig{}, err - } - - cfg := SharedConfig{} - profiles := map[string]struct{}{} - - if err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil { - return SharedConfig{}, err - } - - return cfg, nil -} - -func processConfigSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { - skipSections := map[string]struct{}{} - - for _, section := range sections.List() { - if _, ok := skipSections[section]; ok { - continue - } - - // drop sections from config file that do not have expected prefixes. - switch { - case strings.HasPrefix(section, profilePrefix): - // Rename sections to remove "profile " prefixing to match with - // credentials file. If default is already present, it will be - // dropped. - newName, err := renameProfileSection(section, sections, logger) - if err != nil { - return fmt.Errorf("failed to rename profile section, %w", err) - } - skipSections[newName] = struct{}{} - - case strings.HasPrefix(section, ssoSectionPrefix): - case strings.HasPrefix(section, servicesPrefix): - case strings.EqualFold(section, "default"): - default: - // drop this section, as invalid profile name - sections.DeleteSection(section) - - if logger != nil { - logger.Logf(logging.Debug, "A profile defined with name `%v` is ignored. "+ - "For use within a shared configuration file, "+ - "a non-default profile must have `profile ` "+ - "prefixed to the profile name.", - section, - ) - } - } - } - return nil -} - -func renameProfileSection(section string, sections *ini.Sections, logger logging.Logger) (string, error) { - v, ok := sections.GetSection(section) - if !ok { - return "", fmt.Errorf("error processing profiles within the shared configuration files") - } - - // delete section with profile as prefix - sections.DeleteSection(section) - - // set the value to non-prefixed name in sections. - section = strings.TrimPrefix(section, profilePrefix) - if sections.HasSection(section) { - oldSection, _ := sections.GetSection(section) - v.Logs = append(v.Logs, - fmt.Sprintf("A non-default profile not prefixed with `profile ` found in %s, "+ - "overriding non-default profile from %s", - v.SourceFile, oldSection.SourceFile)) - sections.DeleteSection(section) - } - - // assign non-prefixed name to section - v.Name = section - sections.SetSection(section, v) - - return section, nil -} - -func processCredentialsSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { - for _, section := range sections.List() { - // drop profiles with prefix for credential files - if strings.HasPrefix(section, profilePrefix) { - // drop this section, as invalid profile name - sections.DeleteSection(section) - - if logger != nil { - logger.Logf(logging.Debug, - "The profile defined with name `%v` is ignored. A profile with the `profile ` prefix is invalid "+ - "for the shared credentials file.\n", - section, - ) - } - } - } - return nil -} - -func loadIniFiles(filenames []string) (ini.Sections, error) { - mergedSections := ini.NewSections() - - for _, filename := range filenames { - sections, err := ini.OpenFile(filename) - var v *ini.UnableToReadFile - if ok := errors.As(err, &v); ok { - // Skip files which can't be opened and read for whatever reason. - // We treat such files as empty, and do not fall back to other locations. - continue - } else if err != nil { - return ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err} - } - - // mergeSections into mergedSections - err = mergeSections(&mergedSections, sections) - if err != nil { - return ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err} - } - } - - return mergedSections, nil -} - -// mergeSections merges source section properties into destination section properties -func mergeSections(dst *ini.Sections, src ini.Sections) error { - for _, sectionName := range src.List() { - srcSection, _ := src.GetSection(sectionName) - - if (!srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey)) || - (srcSection.Has(accessKeyIDKey) && !srcSection.Has(secretAccessKey)) { - srcSection.Errors = append(srcSection.Errors, - fmt.Errorf("partial credentials found for profile %v", sectionName)) - } - - if !dst.HasSection(sectionName) { - dst.SetSection(sectionName, srcSection) - continue - } - - // merge with destination srcSection - dstSection, _ := dst.GetSection(sectionName) - - // errors should be overriden if any - dstSection.Errors = srcSection.Errors - - // Access key id update - if srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey) { - accessKey := srcSection.String(accessKeyIDKey) - secretKey := srcSection.String(secretAccessKey) - - if dstSection.Has(accessKeyIDKey) { - dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, accessKeyIDKey, - dstSection.SourceFile[accessKeyIDKey], srcSection.SourceFile[accessKeyIDKey])) - } - - // update access key - v, err := ini.NewStringValue(accessKey) - if err != nil { - return fmt.Errorf("error merging access key, %w", err) - } - dstSection.UpdateValue(accessKeyIDKey, v) - - // update secret key - v, err = ini.NewStringValue(secretKey) - if err != nil { - return fmt.Errorf("error merging secret key, %w", err) - } - dstSection.UpdateValue(secretAccessKey, v) - - // update session token - if err = mergeStringKey(&srcSection, &dstSection, sectionName, sessionTokenKey); err != nil { - return err - } - - // update source file to reflect where the static creds came from - dstSection.UpdateSourceFile(accessKeyIDKey, srcSection.SourceFile[accessKeyIDKey]) - dstSection.UpdateSourceFile(secretAccessKey, srcSection.SourceFile[secretAccessKey]) - } - - stringKeys := []string{ - roleArnKey, - sourceProfileKey, - credentialSourceKey, - externalIDKey, - mfaSerialKey, - roleSessionNameKey, - regionKey, - enableEndpointDiscoveryKey, - credentialProcessKey, - webIdentityTokenFileKey, - s3UseARNRegionKey, - s3DisableMultiRegionAccessPointsKey, - ec2MetadataServiceEndpointModeKey, - ec2MetadataServiceEndpointKey, - ec2MetadataV1DisabledKey, - useDualStackEndpoint, - useFIPSEndpointKey, - defaultsModeKey, - retryModeKey, - caBundleKey, - roleDurationSecondsKey, - retryMaxAttemptsKey, - - ssoSessionNameKey, - ssoAccountIDKey, - ssoRegionKey, - ssoRoleNameKey, - ssoStartURLKey, - - authSchemePreferenceKey, - } - for i := range stringKeys { - if err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil { - return err - } - } - - // set srcSection on dst srcSection - *dst = dst.SetSection(sectionName, dstSection) - } - - return nil -} - -func mergeStringKey(srcSection *ini.Section, dstSection *ini.Section, sectionName, key string) error { - if srcSection.Has(key) { - srcValue := srcSection.String(key) - val, err := ini.NewStringValue(srcValue) - if err != nil { - return fmt.Errorf("error merging %s, %w", key, err) - } - - if dstSection.Has(key) { - dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, key, - dstSection.SourceFile[key], srcSection.SourceFile[key])) - } - - dstSection.UpdateValue(key, val) - dstSection.UpdateSourceFile(key, srcSection.SourceFile[key]) - } - return nil -} - -func newMergeKeyLogMessage(sectionName, key, dstSourceFile, srcSourceFile string) string { - return fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, key, dstSourceFile, key, srcSourceFile) -} - -// Returns an error if all of the files fail to load. If at least one file is -// successfully loaded and contains the profile, no error will be returned. -func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile string, - sections ini.Sections, logger logging.Logger) error { - c.Profile = profile - - section, ok := sections.GetSection(profile) - if !ok { - return SharedConfigProfileNotExistError{ - Profile: profile, - } - } - - // if logs are appended to the section, log them - if section.Logs != nil && logger != nil { - for _, log := range section.Logs { - logger.Logf(logging.Debug, log) - } - } - - // set config from the provided INI section - err := c.setFromIniSection(profile, section) - if err != nil { - return fmt.Errorf("error fetching config from profile, %v, %w", profile, err) - } - - if _, ok := profiles[profile]; ok { - // if this is the second instance of the profile the Assume Role - // options must be cleared because they are only valid for the - // first reference of a profile. The self linked instance of the - // profile only have credential provider options. - c.clearAssumeRoleOptions() - } else { - // First time a profile has been seen. Assert if the credential type - // requires a role ARN, the ARN is also set - if err := c.validateCredentialsConfig(profile); err != nil { - return err - } - } - - // if not top level profile and has credentials, return with credentials. - if len(profiles) != 0 && c.Credentials.HasKeys() { - return nil - } - - profiles[profile] = struct{}{} - - // validate no colliding credentials type are present - if err := c.validateCredentialType(); err != nil { - return err - } - - // Link source profiles for assume roles - if len(c.SourceProfileName) != 0 { - // Linked profile via source_profile ignore credential provider - // options, the source profile must provide the credentials. - c.clearCredentialOptions() - - srcCfg := &SharedConfig{} - err := srcCfg.setFromIniSections(profiles, c.SourceProfileName, sections, logger) - if err != nil { - // SourceProfileName that doesn't exist is an error in configuration. - if _, ok := err.(SharedConfigProfileNotExistError); ok { - err = SharedConfigAssumeRoleError{ - RoleARN: c.RoleARN, - Profile: c.SourceProfileName, - Err: err, - } - } - return err - } - - if !srcCfg.hasCredentials() { - return SharedConfigAssumeRoleError{ - RoleARN: c.RoleARN, - Profile: c.SourceProfileName, - } - } - - c.Source = srcCfg - } - - // If the profile contains an SSO session parameter, the session MUST exist - // as a section in the config file. Load the SSO session using the name - // provided. If the session section is not found or incomplete an error - // will be returned. - if c.hasSSOTokenProviderConfiguration() { - section, ok := sections.GetSection(ssoSectionPrefix + strings.TrimSpace(c.SSOSessionName)) - if !ok { - return fmt.Errorf("failed to find SSO session section, %v", c.SSOSessionName) - } - var ssoSession SSOSession - ssoSession.setFromIniSection(section) - ssoSession.Name = c.SSOSessionName - c.SSOSession = &ssoSession - } - - if len(c.ServicesSectionName) > 0 { - if section, ok := sections.GetSection(servicesPrefix + c.ServicesSectionName); ok { - var svcs Services - svcs.setFromIniSection(section) - c.Services = svcs - } - } - - return nil -} - -// setFromIniSection loads the configuration from the profile section defined in -// the provided INI file. A SharedConfig pointer type value is used so that -// multiple config file loadings can be chained. -// -// Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For example -// if a config file only includes aws_access_key_id but no aws_secret_access_key -// the aws_access_key_id will be ignored. -func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) error { - if len(section.Name) == 0 { - sources := make([]string, 0) - for _, v := range section.SourceFile { - sources = append(sources, v) - } - - return fmt.Errorf("parsing error : could not find profile section name after processing files: %v", sources) - } - - if len(section.Errors) != 0 { - var errStatement string - for i, e := range section.Errors { - errStatement = fmt.Sprintf("%d, %v\n", i+1, e.Error()) - } - return fmt.Errorf("Error using profile: \n %v", errStatement) - } - - // Assume Role - updateString(&c.RoleARN, section, roleArnKey) - updateString(&c.ExternalID, section, externalIDKey) - updateString(&c.MFASerial, section, mfaSerialKey) - updateString(&c.RoleSessionName, section, roleSessionNameKey) - updateString(&c.SourceProfileName, section, sourceProfileKey) - updateString(&c.CredentialSource, section, credentialSourceKey) - updateString(&c.Region, section, regionKey) - - // AWS Single Sign-On (AWS SSO) - // SSO session options - updateString(&c.SSOSessionName, section, ssoSessionNameKey) - - // Legacy SSO session options - updateString(&c.SSORegion, section, ssoRegionKey) - updateString(&c.SSOStartURL, section, ssoStartURLKey) - - // SSO fields not used - updateString(&c.SSOAccountID, section, ssoAccountIDKey) - updateString(&c.SSORoleName, section, ssoRoleNameKey) - - // we're retaining a behavioral quirk with this field that existed before - // the removal of literal parsing for #2276: - // - if the key is missing, the config field will not be set - // - if the key is set to a non-numeric, the config field will be set to 0 - if section.Has(roleDurationSecondsKey) { - if v, ok := section.Int(roleDurationSecondsKey); ok { - c.RoleDurationSeconds = aws.Duration(time.Duration(v) * time.Second) - } else { - c.RoleDurationSeconds = aws.Duration(time.Duration(0)) - } - } - - updateString(&c.CredentialProcess, section, credentialProcessKey) - updateString(&c.WebIdentityTokenFile, section, webIdentityTokenFileKey) - - updateEndpointDiscoveryType(&c.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) - updateBoolPtr(&c.S3UseARNRegion, section, s3UseARNRegionKey) - updateBoolPtr(&c.S3DisableMultiRegionAccessPoints, section, s3DisableMultiRegionAccessPointsKey) - updateBoolPtr(&c.S3DisableExpressAuth, section, s3DisableExpressSessionAuthKey) - - if err := updateEC2MetadataServiceEndpointMode(&c.EC2IMDSEndpointMode, section, ec2MetadataServiceEndpointModeKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %v", ec2MetadataServiceEndpointModeKey, err) - } - updateString(&c.EC2IMDSEndpoint, section, ec2MetadataServiceEndpointKey) - updateBoolPtr(&c.EC2IMDSv1Disabled, section, ec2MetadataV1DisabledKey) - - updateUseDualStackEndpoint(&c.UseDualStackEndpoint, section, useDualStackEndpoint) - updateUseFIPSEndpoint(&c.UseFIPSEndpoint, section, useFIPSEndpointKey) - - if err := updateDefaultsMode(&c.DefaultsMode, section, defaultsModeKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", defaultsModeKey, err) - } - - if err := updateInt(&c.RetryMaxAttempts, section, retryMaxAttemptsKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", retryMaxAttemptsKey, err) - } - if err := updateRetryMode(&c.RetryMode, section, retryModeKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", retryModeKey, err) - } - - updateString(&c.CustomCABundle, section, caBundleKey) - - // user agent app ID added to request User-Agent header - updateString(&c.AppID, section, sdkAppID) - - updateBoolPtr(&c.IgnoreConfiguredEndpoints, section, ignoreConfiguredEndpoints) - - updateString(&c.BaseEndpoint, section, endpointURL) - - if err := updateDisableRequestCompression(&c.DisableRequestCompression, section, disableRequestCompression); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", disableRequestCompression, err) - } - if err := updateRequestMinCompressSizeBytes(&c.RequestMinCompressSizeBytes, section, requestMinCompressionSizeBytes); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", requestMinCompressionSizeBytes, err) - } - - if err := updateAIDEndpointMode(&c.AccountIDEndpointMode, section, accountIDEndpointMode); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", accountIDEndpointMode, err) - } - - if err := updateRequestChecksumCalculation(&c.RequestChecksumCalculation, section, requestChecksumCalculationKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", requestChecksumCalculationKey, err) - } - if err := updateResponseChecksumValidation(&c.ResponseChecksumValidation, section, responseChecksumValidationKey); err != nil { - return fmt.Errorf("failed to load %s from shared config, %w", responseChecksumValidationKey, err) - } - - // Shared Credentials - creds := aws.Credentials{ - AccessKeyID: section.String(accessKeyIDKey), - SecretAccessKey: section.String(secretAccessKey), - SessionToken: section.String(sessionTokenKey), - Source: fmt.Sprintf("SharedConfigCredentials: %s", section.SourceFile[accessKeyIDKey]), - AccountID: section.String(accountIDKey), - } - - if creds.HasKeys() { - c.Credentials = creds - } - - updateString(&c.ServicesSectionName, section, servicesSectionKey) - - c.AuthSchemePreference = toAuthSchemePreferenceList(section.String(authSchemePreferenceKey)) - - return nil -} - -func updateRequestMinCompressSizeBytes(bytes **int64, sec ini.Section, key string) error { - if !sec.Has(key) { - return nil - } - - v, ok := sec.Int(key) - if !ok { - return fmt.Errorf("invalid value for min request compression size bytes %s, need int64", sec.String(key)) - } - if v < 0 || v > smithyrequestcompression.MaxRequestMinCompressSizeBytes { - return fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", v) - } - *bytes = new(int64) - **bytes = v - return nil -} - -func updateDisableRequestCompression(disable **bool, sec ini.Section, key string) error { - if !sec.Has(key) { - return nil - } - - v := sec.String(key) - switch { - case v == "true": - *disable = new(bool) - **disable = true - case v == "false": - *disable = new(bool) - **disable = false - default: - return fmt.Errorf("invalid value for shared config profile field, %s=%s, need true or false", key, v) - } - return nil -} - -func updateAIDEndpointMode(m *aws.AccountIDEndpointMode, sec ini.Section, key string) error { - if !sec.Has(key) { - return nil - } - - v := sec.String(key) - switch v { - case "preferred": - *m = aws.AccountIDEndpointModePreferred - case "required": - *m = aws.AccountIDEndpointModeRequired - case "disabled": - *m = aws.AccountIDEndpointModeDisabled - default: - return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be preferred/required/disabled", key, v) - } - - return nil -} - -func updateRequestChecksumCalculation(m *aws.RequestChecksumCalculation, sec ini.Section, key string) error { - if !sec.Has(key) { - return nil - } - - v := sec.String(key) - switch strings.ToLower(v) { - case checksumWhenSupported: - *m = aws.RequestChecksumCalculationWhenSupported - case checksumWhenRequired: - *m = aws.RequestChecksumCalculationWhenRequired - default: - return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be when_supported/when_required", key, v) - } - - return nil -} - -func updateResponseChecksumValidation(m *aws.ResponseChecksumValidation, sec ini.Section, key string) error { - if !sec.Has(key) { - return nil - } - - v := sec.String(key) - switch strings.ToLower(v) { - case checksumWhenSupported: - *m = aws.ResponseChecksumValidationWhenSupported - case checksumWhenRequired: - *m = aws.ResponseChecksumValidationWhenRequired - default: - return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be when_supported/when_required", key, v) - } - - return nil -} - -func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { - if c.RequestMinCompressSizeBytes == nil { - return 0, false, nil - } - return *c.RequestMinCompressSizeBytes, true, nil -} - -func (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { - if c.DisableRequestCompression == nil { - return false, false, nil - } - return *c.DisableRequestCompression, true, nil -} - -func (c SharedConfig) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) { - return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil -} - -func (c SharedConfig) getRequestChecksumCalculation(ctx context.Context) (aws.RequestChecksumCalculation, bool, error) { - return c.RequestChecksumCalculation, c.RequestChecksumCalculation > 0, nil -} - -func (c SharedConfig) getResponseChecksumValidation(ctx context.Context) (aws.ResponseChecksumValidation, bool, error) { - return c.ResponseChecksumValidation, c.ResponseChecksumValidation > 0, nil -} - -func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error { - if !section.Has(key) { - return nil - } - value := section.String(key) - if ok := mode.SetFromString(value); !ok { - return fmt.Errorf("invalid value: %s", value) - } - return nil -} - -func updateRetryMode(mode *aws.RetryMode, section ini.Section, key string) (err error) { - if !section.Has(key) { - return nil - } - value := section.String(key) - if *mode, err = aws.ParseRetryMode(value); err != nil { - return err - } - return nil -} - -func updateEC2MetadataServiceEndpointMode(endpointMode *imds.EndpointModeState, section ini.Section, key string) error { - if !section.Has(key) { - return nil - } - value := section.String(key) - return endpointMode.SetFromString(value) -} - -func (c *SharedConfig) validateCredentialsConfig(profile string) error { - if err := c.validateCredentialsRequireARN(profile); err != nil { - return err - } - - return nil -} - -func (c *SharedConfig) validateCredentialsRequireARN(profile string) error { - var credSource string - - switch { - case len(c.SourceProfileName) != 0: - credSource = sourceProfileKey - case len(c.CredentialSource) != 0: - credSource = credentialSourceKey - case len(c.WebIdentityTokenFile) != 0: - credSource = webIdentityTokenFileKey - } - - if len(credSource) != 0 && len(c.RoleARN) == 0 { - return CredentialRequiresARNError{ - Type: credSource, - Profile: profile, - } - } - - return nil -} - -func (c *SharedConfig) validateCredentialType() error { - // Only one or no credential type can be defined. - if !oneOrNone( - len(c.SourceProfileName) != 0, - len(c.CredentialSource) != 0, - len(c.CredentialProcess) != 0, - len(c.WebIdentityTokenFile) != 0, - ) { - return fmt.Errorf("only one credential type may be specified per profile: source profile, credential source, credential process, web identity token") - } - - return nil -} - -func (c *SharedConfig) validateSSOConfiguration() error { - if c.hasSSOTokenProviderConfiguration() { - err := c.validateSSOTokenProviderConfiguration() - if err != nil { - return err - } - return nil - } - - if c.hasLegacySSOConfiguration() { - err := c.validateLegacySSOConfiguration() - if err != nil { - return err - } - } - return nil -} - -func (c *SharedConfig) validateSSOTokenProviderConfiguration() error { - var missing []string - - if len(c.SSOSessionName) == 0 { - missing = append(missing, ssoSessionNameKey) - } - - if c.SSOSession == nil { - missing = append(missing, ssoSectionPrefix) - } else { - if len(c.SSOSession.SSORegion) == 0 { - missing = append(missing, ssoRegionKey) - } - - if len(c.SSOSession.SSOStartURL) == 0 { - missing = append(missing, ssoStartURLKey) - } - } - - if len(missing) > 0 { - return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", - c.Profile, strings.Join(missing, ", ")) - } - - if len(c.SSORegion) > 0 && c.SSORegion != c.SSOSession.SSORegion { - return fmt.Errorf("%s in profile %q must match %s in %s", ssoRegionKey, c.Profile, ssoRegionKey, ssoSectionPrefix) - } - - if len(c.SSOStartURL) > 0 && c.SSOStartURL != c.SSOSession.SSOStartURL { - return fmt.Errorf("%s in profile %q must match %s in %s", ssoStartURLKey, c.Profile, ssoStartURLKey, ssoSectionPrefix) - } - - return nil -} - -func (c *SharedConfig) validateLegacySSOConfiguration() error { - var missing []string - - if len(c.SSORegion) == 0 { - missing = append(missing, ssoRegionKey) - } - - if len(c.SSOStartURL) == 0 { - missing = append(missing, ssoStartURLKey) - } - - if len(c.SSOAccountID) == 0 { - missing = append(missing, ssoAccountIDKey) - } - - if len(c.SSORoleName) == 0 { - missing = append(missing, ssoRoleNameKey) - } - - if len(missing) > 0 { - return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", - c.Profile, strings.Join(missing, ", ")) - } - return nil -} - -func (c *SharedConfig) hasCredentials() bool { - switch { - case len(c.SourceProfileName) != 0: - case len(c.CredentialSource) != 0: - case len(c.CredentialProcess) != 0: - case len(c.WebIdentityTokenFile) != 0: - case c.hasSSOConfiguration(): - case c.Credentials.HasKeys(): - default: - return false - } - - return true -} - -func (c *SharedConfig) hasSSOConfiguration() bool { - return c.hasSSOTokenProviderConfiguration() || c.hasLegacySSOConfiguration() -} - -func (c *SharedConfig) hasSSOTokenProviderConfiguration() bool { - return len(c.SSOSessionName) > 0 -} - -func (c *SharedConfig) hasLegacySSOConfiguration() bool { - return len(c.SSORegion) > 0 || len(c.SSOAccountID) > 0 || len(c.SSOStartURL) > 0 || len(c.SSORoleName) > 0 -} - -func (c *SharedConfig) clearAssumeRoleOptions() { - c.RoleARN = "" - c.ExternalID = "" - c.MFASerial = "" - c.RoleSessionName = "" - c.SourceProfileName = "" -} - -func (c *SharedConfig) clearCredentialOptions() { - c.CredentialSource = "" - c.CredentialProcess = "" - c.WebIdentityTokenFile = "" - c.Credentials = aws.Credentials{} - c.SSOAccountID = "" - c.SSORegion = "" - c.SSORoleName = "" - c.SSOStartURL = "" -} - -// SharedConfigLoadError is an error for the shared config file failed to load. -type SharedConfigLoadError struct { - Filename string - Err error -} - -// Unwrap returns the underlying error that caused the failure. -func (e SharedConfigLoadError) Unwrap() error { - return e.Err -} - -func (e SharedConfigLoadError) Error() string { - return fmt.Sprintf("failed to load shared config file, %s, %v", e.Filename, e.Err) -} - -// SharedConfigProfileNotExistError is an error for the shared config when -// the profile was not find in the config file. -type SharedConfigProfileNotExistError struct { - Filename []string - Profile string - Err error -} - -// Unwrap returns the underlying error that caused the failure. -func (e SharedConfigProfileNotExistError) Unwrap() error { - return e.Err -} - -func (e SharedConfigProfileNotExistError) Error() string { - return fmt.Sprintf("failed to get shared config profile, %s", e.Profile) -} - -// SharedConfigAssumeRoleError is an error for the shared config when the -// profile contains assume role information, but that information is invalid -// or not complete. -type SharedConfigAssumeRoleError struct { - Profile string - RoleARN string - Err error -} - -// Unwrap returns the underlying error that caused the failure. -func (e SharedConfigAssumeRoleError) Unwrap() error { - return e.Err -} - -func (e SharedConfigAssumeRoleError) Error() string { - return fmt.Sprintf("failed to load assume role %s, of profile %s, %v", - e.RoleARN, e.Profile, e.Err) -} - -// CredentialRequiresARNError provides the error for shared config credentials -// that are incorrectly configured in the shared config or credentials file. -type CredentialRequiresARNError struct { - // type of credentials that were configured. - Type string - - // Profile name the credentials were in. - Profile string -} - -// Error satisfies the error interface. -func (e CredentialRequiresARNError) Error() string { - return fmt.Sprintf( - "credential type %s requires role_arn, profile %s", - e.Type, e.Profile, - ) -} - -func oneOrNone(bs ...bool) bool { - var count int - - for _, b := range bs { - if b { - count++ - if count > 1 { - return false - } - } - } - - return true -} - -// updateString will only update the dst with the value in the section key, key -// is present in the section. -func updateString(dst *string, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = section.String(key) -} - -// updateInt will only update the dst with the value in the section key, key -// is present in the section. -// -// Down casts the INI integer value from a int64 to an int, which could be -// different bit size depending on platform. -func updateInt(dst *int, section ini.Section, key string) error { - if !section.Has(key) { - return nil - } - - v, ok := section.Int(key) - if !ok { - return fmt.Errorf("invalid value %s=%s, expect integer", key, section.String(key)) - } - - *dst = int(v) - return nil -} - -// updateBool will only update the dst with the value in the section key, key -// is present in the section. -func updateBool(dst *bool, section ini.Section, key string) { - if !section.Has(key) { - return - } - - // retains pre-#2276 behavior where non-bool value would resolve to false - v, _ := section.Bool(key) - *dst = v -} - -// updateBoolPtr will only update the dst with the value in the section key, -// key is present in the section. -func updateBoolPtr(dst **bool, section ini.Section, key string) { - if !section.Has(key) { - return - } - - // retains pre-#2276 behavior where non-bool value would resolve to false - v, _ := section.Bool(key) - *dst = new(bool) - **dst = v -} - -// updateEndpointDiscoveryType will only update the dst with the value in the section, if -// a valid key and corresponding EndpointDiscoveryType is found. -func updateEndpointDiscoveryType(dst *aws.EndpointDiscoveryEnableState, section ini.Section, key string) { - if !section.Has(key) { - return - } - - value := section.String(key) - if len(value) == 0 { - return - } - - switch { - case strings.EqualFold(value, endpointDiscoveryDisabled): - *dst = aws.EndpointDiscoveryDisabled - case strings.EqualFold(value, endpointDiscoveryEnabled): - *dst = aws.EndpointDiscoveryEnabled - case strings.EqualFold(value, endpointDiscoveryAuto): - *dst = aws.EndpointDiscoveryAuto - } -} - -// updateEndpointDiscoveryType will only update the dst with the value in the section, if -// a valid key and corresponding EndpointDiscoveryType is found. -func updateUseDualStackEndpoint(dst *aws.DualStackEndpointState, section ini.Section, key string) { - if !section.Has(key) { - return - } - - // retains pre-#2276 behavior where non-bool value would resolve to false - if v, _ := section.Bool(key); v { - *dst = aws.DualStackEndpointStateEnabled - } else { - *dst = aws.DualStackEndpointStateDisabled - } - - return -} - -// updateEndpointDiscoveryType will only update the dst with the value in the section, if -// a valid key and corresponding EndpointDiscoveryType is found. -func updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key string) { - if !section.Has(key) { - return - } - - // retains pre-#2276 behavior where non-bool value would resolve to false - if v, _ := section.Bool(key); v { - *dst = aws.FIPSEndpointStateEnabled - } else { - *dst = aws.FIPSEndpointStateDisabled - } - - return -} - -func (c SharedConfig) getAuthSchemePreference() ([]string, bool) { - if len(c.AuthSchemePreference) > 0 { - return c.AuthSchemePreference, true - } - return nil, false -} 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 deleted file mode 100644 index 015f24d3b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ /dev/null @@ -1,843 +0,0 @@ -# v1.18.16 (2025-09-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.15 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.14 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.13 (2025-09-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.12 (2025-09-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.11 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.10 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.9 (2025-08-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.8 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.7 (2025-08-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.6 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2025-08-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.4 (2025-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2025-07-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.71 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.70 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.69 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.68 (2025-06-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.67 (2025-04-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.66 (2025-04-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.65 (2025-03-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.64 (2025-03-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.63 (2025-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.62 (2025-03-04.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.61 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.60 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.59 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.58 (2025-02-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.57 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.56 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.55 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.17.54 (2025-01-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.53 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.52 (2025-01-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.51 (2025-01-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.50 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.49 (2025-01-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.48 (2024-12-19) - -* **Bug Fix**: Fix improper use of printf-style functions. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.47 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.46 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.45 (2024-11-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.44 (2024-11-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.43 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.42 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.41 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.40 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.39 (2024-10-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.38 (2024-10-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.37 (2024-09-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.36 (2024-09-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.35 (2024-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.34 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.33 (2024-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.32 (2024-09-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.31 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.30 (2024-08-26) - -* **Bug Fix**: Save SSO cached token expiry in UTC to ensure cross-SDK compatibility. - -# v1.17.29 (2024-08-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.28 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.27 (2024-07-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.26 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.25 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.24 (2024-07-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.23 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.22 (2024-06-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.21 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.20 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.19 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.18 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.17 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.16 (2024-05-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.15 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.14 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.13 (2024-05-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.12 (2024-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.11 (2024-04-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.10 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.9 (2024-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.8 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.7 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.6 (2024-03-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2024-03-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.4 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2024-02-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2024-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.16 (2024-01-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.15 (2024-01-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.14 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.13 (2023-12-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.12 (2023-12-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.11 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.10 (2023-12-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.9 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.8 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.7 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.6 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2023-11-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2023-11-21) - -* **Bug Fix**: Don't expect error responses to have a JSON payload in the endpointcreds provider. - -# v1.16.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2023-11-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2023-11-14) - -* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. - -# v1.15.2 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2023-11-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.43 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.42 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.41 (2023-10-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.40 (2023-09-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.39 (2023-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.38 (2023-09-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.37 (2023-09-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.36 (2023-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.35 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.34 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.33 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.32 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.31 (2023-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.30 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.29 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.28 (2023-07-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.27 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.26 (2023-06-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.25 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.24 (2023-05-09) - -* No change notes available for this release. - -# v1.13.23 (2023-05-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.22 (2023-05-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.21 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.20 (2023-04-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.19 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.18 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.17 (2023-03-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.16 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.15 (2023-02-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.14 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.13 (2023-02-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.12 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.11 (2023-02-01) - -* No change notes available for this release. - -# v1.13.10 (2023-01-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.9 (2023-01-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.8 (2023-01-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.7 (2022-12-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.6 (2022-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.5 (2022-12-15) - -* **Bug Fix**: Unify logic between shared config and in finding home directory -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2022-11-22) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2022-11-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2022-11-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-11-11) - -* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846 -* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider - -# v1.12.24 (2022-11-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.23 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.22 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.21 (2022-09-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.20 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.19 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.18 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.17 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.16 (2022-08-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.15 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.14 (2022-08-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.11 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.9 (2022-07-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2022-06-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.5 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2022-05-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.3 (2022-05-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2022-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-04-25) - -* **Feature**: Adds Duration and Policy options that can be used when creating stscreds.WebIdentityRoleProvider credentials provider. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.2 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.1 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-03-23) - -* **Feature**: Update `ec2rolecreds` package's `Provider` to implememnt support for CredentialsCache new optional caching strategy interfaces, HandleFailRefreshCredentialsCacheStrategy and AdjustExpiresByCredentialsCacheStrategy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-02-24) - -* **Feature**: Adds support for `SourceIdentity` to `stscreds.AssumeRoleProvider` [#1588](https://github.com/aws/aws-sdk-go-v2/pull/1588). Fixes [#1575](https://github.com/aws/aws-sdk-go-v2/issues/1575) -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.5 (2021-12-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.4 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.3 (2021-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.2 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-11-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.3 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-09-10) - -* **Documentation**: Fixes the AssumeRoleProvider's documentation for using custom TokenProviders. - -# v1.4.0 (2021-08-27) - -* **Feature**: Adds support for Tags and TransitiveTagKeys to stscreds.AssumeRoleProvider. Closes https://github.com/aws/aws-sdk-go-v2/issues/723 -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Bug Fix**: Fixed example usages of aws.CredentialsCache ([#1275](https://github.com/aws/aws-sdk-go-v2/pull/1275)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.go deleted file mode 100644 index f6e2873ab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package credentials provides types for retrieving credentials from credentials sources. -*/ -package credentials diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go deleted file mode 100644 index 6ed71b42b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go +++ /dev/null @@ -1,58 +0,0 @@ -// Package ec2rolecreds provides the credentials provider implementation for -// retrieving AWS credentials from Amazon EC2 Instance Roles via Amazon EC2 IMDS. -// -// # Concurrency and caching -// -// The Provider is not safe to be used concurrently, and does not provide any -// caching of credentials retrieved. You should wrap the Provider with a -// `aws.CredentialsCache` to provide concurrency safety, and caching of -// credentials. -// -// # Loading credentials with the SDK's AWS Config -// -// The EC2 Instance role credentials provider will automatically be the resolved -// credential provider in the credential chain if no other credential provider is -// resolved first. -// -// To explicitly instruct the SDK's credentials resolving to use the EC2 Instance -// role for credentials, you specify a `credentials_source` property in the config -// profile the SDK will load. -// -// [default] -// credential_source = Ec2InstanceMetadata -// -// # Loading credentials with the Provider directly -// -// Another way to use the EC2 Instance role credentials provider is to create it -// directly and assign it as the credentials provider for an API client. -// -// The following example creates a credentials provider for a command, and wraps -// it with the CredentialsCache before assigning the provider to the Amazon S3 API -// client's Credentials option. -// -// provider := imds.New(imds.Options{}) -// -// // Create the service client value configured for credentials. -// svc := s3.New(s3.Options{ -// Credentials: aws.NewCredentialsCache(provider), -// }) -// -// If you need more control, you can set the configuration options on the -// credentials provider using the imds.Options type to configure the EC2 IMDS -// API Client and ExpiryWindow of the retrieved credentials. -// -// provider := imds.New(imds.Options{ -// // See imds.Options type's documentation for more options available. -// Client: imds.New(Options{ -// HTTPClient: customHTTPClient, -// }), -// -// // Modify how soon credentials expire prior to their original expiry time. -// ExpiryWindow: 5 * time.Minute, -// }) -// -// # EC2 IMDS API Client -// -// See the github.com/aws/aws-sdk-go-v2/feature/ec2/imds module for more details on -// configuring the client, and options available. -package ec2rolecreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go deleted file mode 100644 index a95e6c8bd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go +++ /dev/null @@ -1,241 +0,0 @@ -package ec2rolecreds - -import ( - "bufio" - "context" - "encoding/json" - "fmt" - "math" - "path" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" - sdkrand "github.com/aws/aws-sdk-go-v2/internal/rand" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" -) - -// ProviderName provides a name of EC2Role provider -const ProviderName = "EC2RoleProvider" - -// GetMetadataAPIClient provides the interface for an EC2 IMDS API client for the -// GetMetadata operation. -type GetMetadataAPIClient interface { - GetMetadata(context.Context, *imds.GetMetadataInput, ...func(*imds.Options)) (*imds.GetMetadataOutput, error) -} - -// A Provider retrieves credentials from the EC2 service, and keeps track if -// those credentials are expired. -// -// The New function must be used to create the with a custom EC2 IMDS client. -// -// p := &ec2rolecreds.New(func(o *ec2rolecreds.Options{ -// o.Client = imds.New(imds.Options{/* custom options */}) -// }) -type Provider struct { - options Options -} - -// Options is a list of user settable options for setting the behavior of the Provider. -type Options struct { - // The API client that will be used by the provider to make GetMetadata API - // calls to EC2 IMDS. - // - // If nil, the provider will default to the EC2 IMDS client. - Client GetMetadataAPIClient - - // The chain of providers that was used to create this provider - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// New returns an initialized Provider value configured to retrieve -// credentials from EC2 Instance Metadata service. -func New(optFns ...func(*Options)) *Provider { - options := Options{} - - for _, fn := range optFns { - fn(&options) - } - - if options.Client == nil { - options.Client = imds.New(imds.Options{}) - } - - return &Provider{ - options: options, - } -} - -// Retrieve retrieves credentials from the EC2 service. Error will be returned -// if the request fails, or unable to extract the desired credentials. -func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { - credsList, err := requestCredList(ctx, p.options.Client) - if err != nil { - return aws.Credentials{Source: ProviderName}, err - } - - if len(credsList) == 0 { - return aws.Credentials{Source: ProviderName}, - fmt.Errorf("unexpected empty EC2 IMDS role list") - } - credsName := credsList[0] - - roleCreds, err := requestCred(ctx, p.options.Client, credsName) - if err != nil { - return aws.Credentials{Source: ProviderName}, err - } - - creds := aws.Credentials{ - AccessKeyID: roleCreds.AccessKeyID, - SecretAccessKey: roleCreds.SecretAccessKey, - SessionToken: roleCreds.Token, - Source: ProviderName, - - CanExpire: true, - Expires: roleCreds.Expiration, - } - - // Cap role credentials Expires to 1 hour so they can be refreshed more - // often. Jitter will be applied credentials cache if being used. - if anHour := sdk.NowTime().Add(1 * time.Hour); creds.Expires.After(anHour) { - creds.Expires = anHour - } - - return creds, nil -} - -// HandleFailToRefresh will extend the credentials Expires time if it it is -// expired. If the credentials will not expire within the minimum time, they -// will be returned. -// -// If the credentials cannot expire, the original error will be returned. -func (p *Provider) HandleFailToRefresh(ctx context.Context, prevCreds aws.Credentials, err error) ( - aws.Credentials, error, -) { - if !prevCreds.CanExpire { - return aws.Credentials{}, err - } - - if prevCreds.Expires.After(sdk.NowTime().Add(5 * time.Minute)) { - return prevCreds, nil - } - - newCreds := prevCreds - randFloat64, err := sdkrand.CryptoRandFloat64() - if err != nil { - return aws.Credentials{}, fmt.Errorf("failed to get random float, %w", err) - } - - // Random distribution of [5,15) minutes. - expireOffset := time.Duration(randFloat64*float64(10*time.Minute)) + 5*time.Minute - newCreds.Expires = sdk.NowTime().Add(expireOffset) - - logger := middleware.GetLogger(ctx) - logger.Logf(logging.Warn, "Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again in %v minutes.", math.Floor(expireOffset.Minutes())) - - return newCreds, nil -} - -// AdjustExpiresBy will adds the passed in duration to the passed in -// credential's Expires time, unless the time until Expires is less than 15 -// minutes. Returns the credentials, even if not updated. -func (p *Provider) AdjustExpiresBy(creds aws.Credentials, dur time.Duration) ( - aws.Credentials, error, -) { - if !creds.CanExpire { - return creds, nil - } - if creds.Expires.Before(sdk.NowTime().Add(15 * time.Minute)) { - return creds, nil - } - - creds.Expires = creds.Expires.Add(dur) - return creds, nil -} - -// ec2RoleCredRespBody provides the shape for unmarshaling credential -// request responses. -type ec2RoleCredRespBody struct { - // Success State - Expiration time.Time - AccessKeyID string - SecretAccessKey string - Token string - - // Error state - Code string - Message string -} - -const iamSecurityCredsPath = "/iam/security-credentials/" - -// requestCredList requests a list of credentials from the EC2 service. If -// there are no credentials, or there is an error making or receiving the -// request -func requestCredList(ctx context.Context, client GetMetadataAPIClient) ([]string, error) { - resp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{ - Path: iamSecurityCredsPath, - }) - if err != nil { - return nil, fmt.Errorf("no EC2 IMDS role found, %w", err) - } - defer resp.Content.Close() - - credsList := []string{} - s := bufio.NewScanner(resp.Content) - for s.Scan() { - credsList = append(credsList, s.Text()) - } - - if err := s.Err(); err != nil { - return nil, fmt.Errorf("failed to read EC2 IMDS role, %w", err) - } - - return credsList, nil -} - -// requestCred requests the credentials for a specific credentials from the EC2 service. -// -// If the credentials cannot be found, or there is an error reading the response -// and error will be returned. -func requestCred(ctx context.Context, client GetMetadataAPIClient, credsName string) (ec2RoleCredRespBody, error) { - resp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{ - Path: path.Join(iamSecurityCredsPath, credsName), - }) - if err != nil { - return ec2RoleCredRespBody{}, - fmt.Errorf("failed to get %s EC2 IMDS role credentials, %w", - credsName, err) - } - defer resp.Content.Close() - - var respCreds ec2RoleCredRespBody - if err := json.NewDecoder(resp.Content).Decode(&respCreds); err != nil { - return ec2RoleCredRespBody{}, - fmt.Errorf("failed to decode %s EC2 IMDS role credentials, %w", - credsName, err) - } - - if !strings.EqualFold(respCreds.Code, "Success") { - // If an error code was returned something failed requesting the role. - return ec2RoleCredRespBody{}, - fmt.Errorf("failed to get %s EC2 IMDS role credentials, %w", - credsName, - &smithy.GenericAPIError{Code: respCreds.Code, Message: respCreds.Message}) - } - - return respCreds, nil -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *Provider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceIMDS} - } // If no source has been set, assume this is used directly which means just call to assume role - return p.options.CredentialSources -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go deleted file mode 100644 index c3f5dadce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -import ( - "context" - "github.com/aws/smithy-go/middleware" -) - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} - -type signRequestMiddleware struct { -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go deleted file mode 100644 index dc291c97c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go +++ /dev/null @@ -1,165 +0,0 @@ -package client - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - "github.com/aws/smithy-go" - smithymiddleware "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// ServiceID is the client identifer -const ServiceID = "endpoint-credentials" - -// HTTPClient is a client for sending HTTP requests -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Options is the endpoint client configurable options -type Options struct { - // The endpoint to retrieve credentials from - Endpoint string - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer - - // Set of options to modify how the credentials operation is invoked. - APIOptions []func(*smithymiddleware.Stack) error -} - -// Copy creates a copy of the API options. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*smithymiddleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - return to -} - -// Client is an client for retrieving AWS credentials from an endpoint -type Client struct { - options Options -} - -// New constructs a new Client from the given options -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - if options.HTTPClient == nil { - options.HTTPClient = awshttp.NewBuildableClient() - } - - if options.Retryer == nil { - // Amazon-owned implementations of this endpoint are known to sometimes - // return plaintext responses (i.e. no Code) like normal, add a few - // additional status codes - options.Retryer = retry.NewStandard(func(o *retry.StandardOptions) { - o.Retryables = append(o.Retryables, retry.RetryableHTTPStatusCode{ - Codes: map[int]struct{}{ - http.StatusTooManyRequests: {}, - }, - }) - }) - } - - for _, fn := range optFns { - fn(&options) - } - - client := &Client{ - options: options, - } - - return client -} - -// GetCredentialsInput is the input to send with the endpoint service to receive credentials. -type GetCredentialsInput struct { - AuthorizationToken string -} - -// GetCredentials retrieves credentials from credential endpoint -func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput, optFns ...func(*Options)) (*GetCredentialsOutput, error) { - stack := smithymiddleware.NewStack("GetCredentials", smithyhttp.NewStackRequest) - options := c.options.Copy() - for _, fn := range optFns { - fn(&options) - } - - stack.Serialize.Add(&serializeOpGetCredential{}, smithymiddleware.After) - stack.Build.Add(&buildEndpoint{Endpoint: options.Endpoint}, smithymiddleware.After) - stack.Deserialize.Add(&deserializeOpGetCredential{}, smithymiddleware.After) - addProtocolFinalizerMiddlewares(stack, options, "GetCredentials") - retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer}) - middleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID) - smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) - smithyhttp.AddCloseResponseBodyMiddleware(stack) - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, err - } - } - - handler := smithymiddleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) - result, _, err := handler.Handle(ctx, params) - if err != nil { - return nil, err - } - - return result.(*GetCredentialsOutput), err -} - -// GetCredentialsOutput is the response from the credential endpoint -type GetCredentialsOutput struct { - Expiration *time.Time - AccessKeyID string - SecretAccessKey string - Token string - AccountID string -} - -// EndpointError is an error returned from the endpoint service -type EndpointError struct { - Code string `json:"code"` - Message string `json:"message"` - Fault smithy.ErrorFault `json:"-"` - statusCode int `json:"-"` -} - -// Error is the error mesage string -func (e *EndpointError) Error() string { - return fmt.Sprintf("%s: %s", e.Code, e.Message) -} - -// ErrorCode is the error code returned by the endpoint -func (e *EndpointError) ErrorCode() string { - return e.Code -} - -// ErrorMessage is the error message returned by the endpoint -func (e *EndpointError) ErrorMessage() string { - return e.Message -} - -// ErrorFault indicates error fault classification -func (e *EndpointError) ErrorFault() smithy.ErrorFault { - return e.Fault -} - -// HTTPStatusCode implements retry.HTTPStatusCode. -func (e *EndpointError) HTTPStatusCode() int { - return e.statusCode -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go deleted file mode 100644 index 748ee6724..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -import ( - "context" - "github.com/aws/smithy-go/middleware" -) - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go deleted file mode 100644 index f2820d20e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go +++ /dev/null @@ -1,164 +0,0 @@ -package client - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/url" - - "github.com/aws/smithy-go" - smithymiddleware "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type buildEndpoint struct { - Endpoint string -} - -func (b *buildEndpoint) ID() string { - return "BuildEndpoint" -} - -func (b *buildEndpoint) HandleBuild(ctx context.Context, in smithymiddleware.BuildInput, next smithymiddleware.BuildHandler) ( - out smithymiddleware.BuildOutput, metadata smithymiddleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport, %T", in.Request) - } - - if len(b.Endpoint) == 0 { - return out, metadata, fmt.Errorf("endpoint not provided") - } - - parsed, err := url.Parse(b.Endpoint) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint, %w", err) - } - - request.URL = parsed - - return next.HandleBuild(ctx, in) -} - -type serializeOpGetCredential struct{} - -func (s *serializeOpGetCredential) ID() string { - return "OperationSerializer" -} - -func (s *serializeOpGetCredential) HandleSerialize(ctx context.Context, in smithymiddleware.SerializeInput, next smithymiddleware.SerializeHandler) ( - out smithymiddleware.SerializeOutput, metadata smithymiddleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type, %T", in.Request) - } - - params, ok := in.Parameters.(*GetCredentialsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters, %T", in.Parameters) - } - - const acceptHeader = "Accept" - request.Header[acceptHeader] = append(request.Header[acceptHeader][:0], "application/json") - - if len(params.AuthorizationToken) > 0 { - const authHeader = "Authorization" - request.Header[authHeader] = append(request.Header[authHeader][:0], params.AuthorizationToken) - } - - return next.HandleSerialize(ctx, in) -} - -type deserializeOpGetCredential struct{} - -func (d *deserializeOpGetCredential) ID() string { - return "OperationDeserializer" -} - -func (d *deserializeOpGetCredential) HandleDeserialize(ctx context.Context, in smithymiddleware.DeserializeInput, next smithymiddleware.DeserializeHandler) ( - out smithymiddleware.DeserializeOutput, metadata smithymiddleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, deserializeError(response) - } - - var shape *GetCredentialsOutput - if err = json.NewDecoder(response.Body).Decode(&shape); err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize json response, %w", err)} - } - - out.Result = shape - return out, metadata, err -} - -func deserializeError(response *smithyhttp.Response) error { - // we could be talking to anything, json isn't guaranteed - // see https://github.com/aws/aws-sdk-go-v2/issues/2316 - if response.Header.Get("Content-Type") == "application/json" { - return deserializeJSONError(response) - } - - msg, err := io.ReadAll(response.Body) - if err != nil { - return &smithy.DeserializationError{ - Err: fmt.Errorf("read response, %w", err), - } - } - - return &EndpointError{ - // no sensible value for Code - Message: string(msg), - Fault: stof(response.StatusCode), - statusCode: response.StatusCode, - } -} - -func deserializeJSONError(response *smithyhttp.Response) error { - var errShape *EndpointError - if err := json.NewDecoder(response.Body).Decode(&errShape); err != nil { - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode error message, %w", err), - } - } - - errShape.Fault = stof(response.StatusCode) - errShape.statusCode = response.StatusCode - return errShape -} - -// maps HTTP status code to smithy ErrorFault -func stof(code int) smithy.ErrorFault { - if code >= 500 { - return smithy.FaultServer - } - return smithy.FaultClient -} - -func addProtocolFinalizerMiddlewares(stack *smithymiddleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, smithymiddleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", smithymiddleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %w", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", smithymiddleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %w", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", smithymiddleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go deleted file mode 100644 index c8ac6d9ff..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go +++ /dev/null @@ -1,207 +0,0 @@ -// Package endpointcreds provides support for retrieving credentials from an -// arbitrary HTTP endpoint. -// -// The credentials endpoint Provider can receive both static and refreshable -// credentials that will expire. Credentials are static when an "Expiration" -// value is not provided in the endpoint's response. -// -// Static credentials will never expire once they have been retrieved. The format -// of the static credentials response: -// -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// } -// -// Refreshable credentials will expire within the "ExpiryWindow" of the Expiration -// value in the response. The format of the refreshable credentials response: -// -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// "Token" : "AQoDY....=", -// "Expiration" : "2016-02-25T06:03:31Z" -// } -// -// Errors should be returned in the following format and only returned with 400 -// or 500 HTTP status codes. -// -// { -// "code": "ErrorCode", -// "message": "Helpful error message." -// } -package endpointcreds - -import ( - "context" - "fmt" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client" - "github.com/aws/smithy-go/middleware" -) - -// ProviderName is the name of the credentials provider. -const ProviderName = `CredentialsEndpointProvider` - -type getCredentialsAPIClient interface { - GetCredentials(context.Context, *client.GetCredentialsInput, ...func(*client.Options)) (*client.GetCredentialsOutput, error) -} - -// Provider satisfies the aws.CredentialsProvider interface, and is a client to -// retrieve credentials from an arbitrary endpoint. -type Provider struct { - // The AWS Client to make HTTP requests to the endpoint with. The endpoint - // the request will be made to is provided by the aws.Config's - // EndpointResolver. - client getCredentialsAPIClient - - options Options -} - -// HTTPClient is a client for sending HTTP requests -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Options is structure of configurable options for Provider -type Options struct { - // Endpoint to retrieve credentials from. Required - Endpoint string - - // HTTPClient to handle sending HTTP requests to the target endpoint. - HTTPClient HTTPClient - - // Set of options to modify how the credentials operation is invoked. - APIOptions []func(*middleware.Stack) error - - // The Retryer to be used for determining whether a failed requested should be retried - Retryer aws.Retryer - - // Optional authorization token value if set will be used as the value of - // the Authorization header of the endpoint credential request. - // - // When constructed from environment, the provider will use the value of - // AWS_CONTAINER_AUTHORIZATION_TOKEN environment variable as the token - // - // Will be overridden if AuthorizationTokenProvider is configured - AuthorizationToken string - - // Optional auth provider func to dynamically load the auth token from a file - // everytime a credential is retrieved - // - // When constructed from environment, the provider will read and use the content - // of the file pointed to by AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE environment variable - // as the auth token everytime credentials are retrieved - // - // Will override AuthorizationToken if configured - AuthorizationTokenProvider AuthTokenProvider - - // The chain of providers that was used to create this provider - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// AuthTokenProvider defines an interface to dynamically load a value to be passed -// for the Authorization header of a credentials request. -type AuthTokenProvider interface { - GetToken() (string, error) -} - -// TokenProviderFunc is a func type implementing AuthTokenProvider interface -// and enables customizing token provider behavior -type TokenProviderFunc func() (string, error) - -// GetToken func retrieves auth token according to TokenProviderFunc implementation -func (p TokenProviderFunc) GetToken() (string, error) { - return p() -} - -// New returns a credentials Provider for retrieving AWS credentials -// from arbitrary endpoint. -func New(endpoint string, optFns ...func(*Options)) *Provider { - o := Options{ - Endpoint: endpoint, - } - - for _, fn := range optFns { - fn(&o) - } - - p := &Provider{ - client: client.New(client.Options{ - HTTPClient: o.HTTPClient, - Endpoint: o.Endpoint, - APIOptions: o.APIOptions, - Retryer: o.Retryer, - }), - options: o, - } - - return p -} - -// Retrieve will attempt to request the credentials from the endpoint the Provider -// was configured for. And error will be returned if the retrieval fails. -func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { - resp, err := p.getCredentials(ctx) - if err != nil { - return aws.Credentials{}, fmt.Errorf("failed to load credentials, %w", err) - } - - creds := aws.Credentials{ - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.Token, - Source: ProviderName, - AccountID: resp.AccountID, - } - - if resp.Expiration != nil { - creds.CanExpire = true - creds.Expires = *resp.Expiration - } - - return creds, nil -} - -func (p *Provider) getCredentials(ctx context.Context) (*client.GetCredentialsOutput, error) { - authToken, err := p.resolveAuthToken() - if err != nil { - return nil, fmt.Errorf("resolve auth token: %v", err) - } - - return p.client.GetCredentials(ctx, &client.GetCredentialsInput{ - AuthorizationToken: authToken, - }) -} - -func (p *Provider) resolveAuthToken() (string, error) { - authToken := p.options.AuthorizationToken - - var err error - if p.options.AuthorizationTokenProvider != nil { - authToken, err = p.options.AuthorizationTokenProvider.GetToken() - if err != nil { - return "", err - } - } - - if strings.ContainsAny(authToken, "\r\n") { - return "", fmt.Errorf("authorization token contains invalid newline sequence") - } - - return authToken, nil -} - -var _ aws.CredentialProviderSource = (*Provider)(nil) - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *Provider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceHTTP} - } - return p.options.CredentialSources -} 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 deleted file mode 100644 index 03357b760..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package credentials - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go deleted file mode 100644 index a3137b8fa..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package processcreds is a credentials provider to retrieve credentials from a -// external CLI invoked process. -// -// WARNING: The following describes a method of sourcing credentials from an external -// process. This can potentially be dangerous, so proceed with caution. Other -// credential providers should be preferred if at all possible. If using this -// option, you should make sure that the config file is as locked down as possible -// using security best practices for your operating system. -// -// # Concurrency and caching -// -// The Provider is not safe to be used concurrently, and does not provide any -// caching of credentials retrieved. You should wrap the Provider with a -// `aws.CredentialsCache` to provide concurrency safety, and caching of -// credentials. -// -// # Loading credentials with the SDKs AWS Config -// -// You can use credentials from a AWS shared config `credential_process` in a -// variety of ways. -// -// One way is to setup your shared config file, located in the default -// location, with the `credential_process` key and the command you want to be -// called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable -// (e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file. -// -// [default] -// credential_process = /command/to/call -// -// Loading configuration using external will use the credential process to -// retrieve credentials. NOTE: If there are credentials in the profile you are -// using, the credential process will not be used. -// -// // Initialize a session to load credentials. -// cfg, _ := config.LoadDefaultConfig(context.TODO()) -// -// // Create S3 service client to use the credentials. -// svc := s3.NewFromConfig(cfg) -// -// # Loading credentials with the Provider directly -// -// Another way to use the credentials process provider is by using the -// `NewProvider` constructor to create the provider and providing a it with a -// command to be executed to retrieve credentials. -// -// The following example creates a credentials provider for a command, and wraps -// it with the CredentialsCache before assigning the provider to the Amazon S3 API -// client's Credentials option. -// -// // Create credentials using the Provider. -// provider := processcreds.NewProvider("/path/to/command") -// -// // Create the service client value configured for credentials. -// svc := s3.New(s3.Options{ -// Credentials: aws.NewCredentialsCache(provider), -// }) -// -// If you need more control, you can set any configurable options in the -// credentials using one or more option functions. -// -// provider := processcreds.NewProvider("/path/to/command", -// func(o *processcreds.Options) { -// // Override the provider's default timeout -// o.Timeout = 2 * time.Minute -// }) -// -// You can also use your own `exec.Cmd` value by satisfying a value that satisfies -// the `NewCommandBuilder` interface and use the `NewProviderCommand` constructor. -// -// // Create an exec.Cmd -// cmdBuilder := processcreds.NewCommandBuilderFunc( -// func(ctx context.Context) (*exec.Cmd, error) { -// cmd := exec.CommandContext(ctx, -// "customCLICommand", -// "-a", "argument", -// ) -// cmd.Env = []string{ -// "ENV_VAR_FOO=value", -// "ENV_VAR_BAR=other_value", -// } -// -// return cmd, nil -// }, -// ) -// -// // Create credentials using your exec.Cmd and custom timeout -// provider := processcreds.NewProviderCommand(cmdBuilder, -// func(opt *processcreds.Provider) { -// // optionally override the provider's default timeout -// opt.Timeout = 1 * time.Second -// }) -package processcreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go deleted file mode 100644 index dfc6b2548..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go +++ /dev/null @@ -1,296 +0,0 @@ -package processcreds - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "os" - "os/exec" - "runtime" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/sdkio" -) - -const ( - // ProviderName is the name this credentials provider will label any - // returned credentials Value with. - ProviderName = `ProcessProvider` - - // DefaultTimeout default limit on time a process can run. - DefaultTimeout = time.Duration(1) * time.Minute -) - -// ProviderError is an error indicating failure initializing or executing the -// process credentials provider -type ProviderError struct { - Err error -} - -// Error returns the error message. -func (e *ProviderError) Error() string { - return fmt.Sprintf("process provider error: %v", e.Err) -} - -// Unwrap returns the underlying error the provider error wraps. -func (e *ProviderError) Unwrap() error { - return e.Err -} - -// Provider satisfies the credentials.Provider interface, and is a -// client to retrieve credentials from a process. -type Provider struct { - // Provides a constructor for exec.Cmd that are invoked by the provider for - // retrieving credentials. Use this to provide custom creation of exec.Cmd - // with things like environment variables, or other configuration. - // - // The provider defaults to the DefaultNewCommand function. - commandBuilder NewCommandBuilder - - options Options -} - -// Options is the configuration options for configuring the Provider. -type Options struct { - // Timeout limits the time a process can run. - Timeout time.Duration - // The chain of providers that was used to create this provider - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// NewCommandBuilder provides the interface for specifying how command will be -// created that the Provider will use to retrieve credentials with. -type NewCommandBuilder interface { - NewCommand(context.Context) (*exec.Cmd, error) -} - -// NewCommandBuilderFunc provides a wrapper type around a function pointer to -// satisfy the NewCommandBuilder interface. -type NewCommandBuilderFunc func(context.Context) (*exec.Cmd, error) - -// NewCommand calls the underlying function pointer the builder was initialized with. -func (fn NewCommandBuilderFunc) NewCommand(ctx context.Context) (*exec.Cmd, error) { - return fn(ctx) -} - -// DefaultNewCommandBuilder provides the default NewCommandBuilder -// implementation used by the provider. It takes a command and arguments to -// invoke. The command will also be initialized with the current process -// environment variables, stderr, and stdin pipes. -type DefaultNewCommandBuilder struct { - Args []string -} - -// NewCommand returns an initialized exec.Cmd with the builder's initialized -// Args. The command is also initialized current process environment variables, -// stderr, and stdin pipes. -func (b DefaultNewCommandBuilder) NewCommand(ctx context.Context) (*exec.Cmd, error) { - var cmdArgs []string - if runtime.GOOS == "windows" { - cmdArgs = []string{"cmd.exe", "/C"} - } else { - cmdArgs = []string{"sh", "-c"} - } - - if len(b.Args) == 0 { - return nil, &ProviderError{ - Err: fmt.Errorf("failed to prepare command: command must not be empty"), - } - } - - cmdArgs = append(cmdArgs, b.Args...) - cmd := exec.CommandContext(ctx, cmdArgs[0], cmdArgs[1:]...) - cmd.Env = os.Environ() - - cmd.Stderr = os.Stderr // display stderr on console for MFA - cmd.Stdin = os.Stdin // enable stdin for MFA - - return cmd, nil -} - -// NewProvider returns a pointer to a new Credentials object wrapping the -// Provider. -// -// The provider defaults to the DefaultNewCommandBuilder for creating command -// the Provider will use to retrieve credentials with. -func NewProvider(command string, options ...func(*Options)) *Provider { - var args []string - - // Ensure that the command arguments are not set if the provided command is - // empty. This will error out when the command is executed since no - // arguments are specified. - if len(command) > 0 { - args = []string{command} - } - - commanBuilder := DefaultNewCommandBuilder{ - Args: args, - } - return NewProviderCommand(commanBuilder, options...) -} - -// NewProviderCommand returns a pointer to a new Credentials object with the -// specified command, and default timeout duration. Use this to provide custom -// creation of exec.Cmd for options like environment variables, or other -// configuration. -func NewProviderCommand(builder NewCommandBuilder, options ...func(*Options)) *Provider { - p := &Provider{ - commandBuilder: builder, - options: Options{ - Timeout: DefaultTimeout, - }, - } - - for _, option := range options { - option(&p.options) - } - - return p -} - -// A CredentialProcessResponse is the AWS credentials format that must be -// returned when executing an external credential_process. -type CredentialProcessResponse struct { - // As of this writing, the Version key must be set to 1. This might - // increment over time as the structure evolves. - Version int - - // The access key ID that identifies the temporary security credentials. - AccessKeyID string `json:"AccessKeyId"` - - // The secret access key that can be used to sign requests. - SecretAccessKey string - - // The token that users must pass to the service API to use the temporary credentials. - SessionToken string - - // The date on which the current credentials expire. - Expiration *time.Time - - // The ID of the account for credentials - AccountID string `json:"AccountId"` -} - -// Retrieve executes the credential process command and returns the -// credentials, or error if the command fails. -func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { - out, err := p.executeCredentialProcess(ctx) - if err != nil { - return aws.Credentials{Source: ProviderName}, err - } - - // Serialize and validate response - resp := &CredentialProcessResponse{} - if err = json.Unmarshal(out, resp); err != nil { - return aws.Credentials{Source: ProviderName}, &ProviderError{ - Err: fmt.Errorf("parse failed of process output: %s, error: %w", out, err), - } - } - - if resp.Version != 1 { - return aws.Credentials{Source: ProviderName}, &ProviderError{ - Err: fmt.Errorf("wrong version in process output (not 1)"), - } - } - - if len(resp.AccessKeyID) == 0 { - return aws.Credentials{Source: ProviderName}, &ProviderError{ - Err: fmt.Errorf("missing AccessKeyId in process output"), - } - } - - if len(resp.SecretAccessKey) == 0 { - return aws.Credentials{Source: ProviderName}, &ProviderError{ - Err: fmt.Errorf("missing SecretAccessKey in process output"), - } - } - - creds := aws.Credentials{ - Source: ProviderName, - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.SessionToken, - AccountID: resp.AccountID, - } - - // Handle expiration - if resp.Expiration != nil { - creds.CanExpire = true - creds.Expires = *resp.Expiration - } - - return creds, nil -} - -// executeCredentialProcess starts the credential process on the OS and -// returns the results or an error. -func (p *Provider) executeCredentialProcess(ctx context.Context) ([]byte, error) { - if p.options.Timeout >= 0 { - var cancelFunc func() - ctx, cancelFunc = context.WithTimeout(ctx, p.options.Timeout) - defer cancelFunc() - } - - cmd, err := p.commandBuilder.NewCommand(ctx) - if err != nil { - return nil, err - } - - // get creds json on process's stdout - output := bytes.NewBuffer(make([]byte, 0, int(8*sdkio.KibiByte))) - if cmd.Stdout != nil { - cmd.Stdout = io.MultiWriter(cmd.Stdout, output) - } else { - cmd.Stdout = output - } - - execCh := make(chan error, 1) - go executeCommand(cmd, execCh) - - select { - case execError := <-execCh: - if execError == nil { - break - } - select { - case <-ctx.Done(): - return output.Bytes(), &ProviderError{ - Err: fmt.Errorf("credential process timed out: %w", execError), - } - default: - return output.Bytes(), &ProviderError{ - Err: fmt.Errorf("error in credential_process: %w", execError), - } - } - } - - out := output.Bytes() - if runtime.GOOS == "windows" { - // windows adds slashes to quotes - out = bytes.ReplaceAll(out, []byte(`\"`), []byte(`"`)) - } - - return out, nil -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *Provider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceProcess} - } - return p.options.CredentialSources -} - -func executeCommand(cmd *exec.Cmd, exec chan error) { - // Start the command - err := cmd.Start() - if err == nil { - err = cmd.Wait() - } - - exec <- err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go deleted file mode 100644 index ece1e65f7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go +++ /dev/null @@ -1,81 +0,0 @@ -// Package ssocreds provides a credential provider for retrieving temporary AWS -// credentials using an SSO access token. -// -// IMPORTANT: The provider in this package does not initiate or perform the AWS -// SSO login flow. The SDK provider expects that you have already performed the -// SSO login flow using AWS CLI using the "aws sso login" command, or by some -// other mechanism. The provider must find a valid non-expired access token for -// the AWS SSO user portal URL in ~/.aws/sso/cache. If a cached token is not -// found, it is expired, or the file is malformed an error will be returned. -// -// # Loading AWS SSO credentials with the AWS shared configuration file -// -// You can use configure AWS SSO credentials from the AWS shared configuration file by -// specifying the required keys in the profile and referencing an sso-session: -// -// sso_session -// sso_account_id -// sso_role_name -// -// For example, the following defines a profile "devsso" and specifies the AWS -// SSO parameters that defines the target account, role, sign-on portal, and -// the region where the user portal is located. Note: all SSO arguments must be -// provided, or an error will be returned. -// -// [profile devsso] -// sso_session = dev-session -// sso_role_name = SSOReadOnlyRole -// sso_account_id = 123456789012 -// -// [sso-session dev-session] -// sso_start_url = https://my-sso-portal.awsapps.com/start -// sso_region = us-east-1 -// sso_registration_scopes = sso:account:access -// -// Using the config module, you can load the AWS SDK shared configuration, and -// specify that this profile be used to retrieve credentials. For example: -// -// config, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile("devsso")) -// if err != nil { -// return err -// } -// -// # Programmatically loading AWS SSO credentials directly -// -// You can programmatically construct the AWS SSO Provider in your application, -// and provide the necessary information to load and retrieve temporary -// credentials using an access token from ~/.aws/sso/cache. -// -// ssoClient := sso.NewFromConfig(cfg) -// ssoOidcClient := ssooidc.NewFromConfig(cfg) -// tokenPath, err := ssocreds.StandardCachedTokenFilepath("dev-session") -// if err != nil { -// return err -// } -// -// var provider aws.CredentialsProvider -// provider = ssocreds.New(ssoClient, "123456789012", "SSOReadOnlyRole", "https://my-sso-portal.awsapps.com/start", func(options *ssocreds.Options) { -// options.SSOTokenProvider = ssocreds.NewSSOTokenProvider(ssoOidcClient, tokenPath) -// }) -// -// // Wrap the provider with aws.CredentialsCache to cache the credentials until their expire time -// provider = aws.NewCredentialsCache(provider) -// -// credentials, err := provider.Retrieve(context.TODO()) -// if err != nil { -// return err -// } -// -// It is important that you wrap the Provider with aws.CredentialsCache if you -// are programmatically constructing the provider directly. This prevents your -// application from accessing the cached access token and requesting new -// credentials each time the credentials are used. -// -// # Additional Resources -// -// Configuring the AWS CLI to use AWS Single Sign-On: -// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -// -// AWS Single Sign-On User Guide: -// https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html -package ssocreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go deleted file mode 100644 index 46ae2f923..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go +++ /dev/null @@ -1,233 +0,0 @@ -package ssocreds - -import ( - "crypto/sha1" - "encoding/hex" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" -) - -var osUserHomeDur = shareddefaults.UserHomeDir - -// StandardCachedTokenFilepath returns the filepath for the cached SSO token file, or -// error if unable get derive the path. Key that will be used to compute a SHA1 -// value that is hex encoded. -// -// Derives the filepath using the Key as: -// -// ~/.aws/sso/cache/.json -func StandardCachedTokenFilepath(key string) (string, error) { - homeDir := osUserHomeDur() - if len(homeDir) == 0 { - return "", fmt.Errorf("unable to get USER's home directory for cached token") - } - hash := sha1.New() - if _, err := hash.Write([]byte(key)); err != nil { - return "", fmt.Errorf("unable to compute cached token filepath key SHA1 hash, %w", err) - } - - cacheFilename := strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json" - - return filepath.Join(homeDir, ".aws", "sso", "cache", cacheFilename), nil -} - -type tokenKnownFields struct { - AccessToken string `json:"accessToken,omitempty"` - ExpiresAt *rfc3339 `json:"expiresAt,omitempty"` - - RefreshToken string `json:"refreshToken,omitempty"` - ClientID string `json:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty"` -} - -type token struct { - tokenKnownFields - UnknownFields map[string]interface{} `json:"-"` -} - -func (t token) MarshalJSON() ([]byte, error) { - fields := map[string]interface{}{} - - setTokenFieldString(fields, "accessToken", t.AccessToken) - setTokenFieldRFC3339(fields, "expiresAt", t.ExpiresAt) - - setTokenFieldString(fields, "refreshToken", t.RefreshToken) - setTokenFieldString(fields, "clientId", t.ClientID) - setTokenFieldString(fields, "clientSecret", t.ClientSecret) - - for k, v := range t.UnknownFields { - if _, ok := fields[k]; ok { - return nil, fmt.Errorf("unknown token field %v, duplicates known field", k) - } - fields[k] = v - } - - return json.Marshal(fields) -} - -func setTokenFieldString(fields map[string]interface{}, key, value string) { - if value == "" { - return - } - fields[key] = value -} -func setTokenFieldRFC3339(fields map[string]interface{}, key string, value *rfc3339) { - if value == nil { - return - } - fields[key] = value -} - -func (t *token) UnmarshalJSON(b []byte) error { - var fields map[string]interface{} - if err := json.Unmarshal(b, &fields); err != nil { - return nil - } - - t.UnknownFields = map[string]interface{}{} - - for k, v := range fields { - var err error - switch k { - case "accessToken": - err = getTokenFieldString(v, &t.AccessToken) - case "expiresAt": - err = getTokenFieldRFC3339(v, &t.ExpiresAt) - case "refreshToken": - err = getTokenFieldString(v, &t.RefreshToken) - case "clientId": - err = getTokenFieldString(v, &t.ClientID) - case "clientSecret": - err = getTokenFieldString(v, &t.ClientSecret) - default: - t.UnknownFields[k] = v - } - - if err != nil { - return fmt.Errorf("field %q, %w", k, err) - } - } - - return nil -} - -func getTokenFieldString(v interface{}, value *string) error { - var ok bool - *value, ok = v.(string) - if !ok { - return fmt.Errorf("expect value to be string, got %T", v) - } - return nil -} - -func getTokenFieldRFC3339(v interface{}, value **rfc3339) error { - var stringValue string - if err := getTokenFieldString(v, &stringValue); err != nil { - return err - } - - timeValue, err := parseRFC3339(stringValue) - if err != nil { - return err - } - - *value = &timeValue - return nil -} - -func loadCachedToken(filename string) (token, error) { - fileBytes, err := ioutil.ReadFile(filename) - if err != nil { - return token{}, fmt.Errorf("failed to read cached SSO token file, %w", err) - } - - var t token - if err := json.Unmarshal(fileBytes, &t); err != nil { - return token{}, fmt.Errorf("failed to parse cached SSO token file, %w", err) - } - - if len(t.AccessToken) == 0 || t.ExpiresAt == nil || time.Time(*t.ExpiresAt).IsZero() { - return token{}, fmt.Errorf( - "cached SSO token must contain accessToken and expiresAt fields") - } - - return t, nil -} - -func storeCachedToken(filename string, t token, fileMode os.FileMode) (err error) { - tmpFilename := filename + ".tmp-" + strconv.FormatInt(sdk.NowTime().UnixNano(), 10) - if err := writeCacheFile(tmpFilename, fileMode, t); err != nil { - return err - } - - if err := os.Rename(tmpFilename, filename); err != nil { - return fmt.Errorf("failed to replace old cached SSO token file, %w", err) - } - - return nil -} - -func writeCacheFile(filename string, fileMode os.FileMode, t token) (err error) { - var f *os.File - f, err = os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_RDWR, fileMode) - if err != nil { - return fmt.Errorf("failed to create cached SSO token file %w", err) - } - - defer func() { - closeErr := f.Close() - if err == nil && closeErr != nil { - err = fmt.Errorf("failed to close cached SSO token file, %w", closeErr) - } - }() - - encoder := json.NewEncoder(f) - - if err = encoder.Encode(t); err != nil { - return fmt.Errorf("failed to serialize cached SSO token, %w", err) - } - - return nil -} - -type rfc3339 time.Time - -func parseRFC3339(v string) (rfc3339, error) { - parsed, err := time.Parse(time.RFC3339, v) - if err != nil { - return rfc3339{}, fmt.Errorf("expected RFC3339 timestamp: %w", err) - } - - return rfc3339(parsed), nil -} - -func (r *rfc3339) UnmarshalJSON(bytes []byte) (err error) { - var value string - - // Use JSON unmarshal to unescape the quoted value making use of JSON's - // unquoting rules. - if err = json.Unmarshal(bytes, &value); err != nil { - return err - } - - *r, err = parseRFC3339(value) - - return nil -} - -func (r *rfc3339) MarshalJSON() ([]byte, error) { - value := time.Time(*r).UTC().Format(time.RFC3339) - - // Use JSON unmarshal to unescape the quoted value making use of JSON's - // quoting rules. - return json.Marshal(value) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go deleted file mode 100644 index 3ed9cbb3e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go +++ /dev/null @@ -1,165 +0,0 @@ -package ssocreds - -import ( - "context" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/aws-sdk-go-v2/service/sso" -) - -// ProviderName is the name of the provider used to specify the source of -// credentials. -const ProviderName = "SSOProvider" - -// GetRoleCredentialsAPIClient is a API client that implements the -// GetRoleCredentials operation. -type GetRoleCredentialsAPIClient interface { - GetRoleCredentials(context.Context, *sso.GetRoleCredentialsInput, ...func(*sso.Options)) ( - *sso.GetRoleCredentialsOutput, error, - ) -} - -// Options is the Provider options structure. -type Options struct { - // The Client which is configured for the AWS Region where the AWS SSO user - // portal is located. - Client GetRoleCredentialsAPIClient - - // The AWS account that is assigned to the user. - AccountID string - - // The role name that is assigned to the user. - RoleName string - - // The URL that points to the organization's AWS Single Sign-On (AWS SSO) - // user portal. - StartURL string - - // The filepath the cached token will be retrieved from. If unset Provider will - // use the startURL to determine the filepath at. - // - // ~/.aws/sso/cache/.json - // - // If custom cached token filepath is used, the Provider's startUrl - // parameter will be ignored. - CachedTokenFilepath string - - // Used by the SSOCredentialProvider if a token configuration - // profile is used in the shared config - SSOTokenProvider *SSOTokenProvider - - // The chain of providers that was used to create this provider. - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// Provider is an AWS credential provider that retrieves temporary AWS -// credentials by exchanging an SSO login token. -type Provider struct { - options Options - - cachedTokenFilepath string -} - -// New returns a new AWS Single Sign-On (AWS SSO) credential provider. The -// provided client is expected to be configured for the AWS Region where the -// AWS SSO user portal is located. -func New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL string, optFns ...func(options *Options)) *Provider { - options := Options{ - Client: client, - AccountID: accountID, - RoleName: roleName, - StartURL: startURL, - } - - for _, fn := range optFns { - fn(&options) - } - - return &Provider{ - options: options, - cachedTokenFilepath: options.CachedTokenFilepath, - } -} - -// Retrieve retrieves temporary AWS credentials from the configured Amazon -// Single Sign-On (AWS SSO) user portal by exchanging the accessToken present -// in ~/.aws/sso/cache. However, if a token provider configuration exists -// in the shared config, then we ought to use the token provider rather then -// direct access on the cached token. -func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { - var accessToken *string - if p.options.SSOTokenProvider != nil { - token, err := p.options.SSOTokenProvider.RetrieveBearerToken(ctx) - if err != nil { - return aws.Credentials{}, err - } - accessToken = &token.Value - } else { - if p.cachedTokenFilepath == "" { - cachedTokenFilepath, err := StandardCachedTokenFilepath(p.options.StartURL) - if err != nil { - return aws.Credentials{}, &InvalidTokenError{Err: err} - } - p.cachedTokenFilepath = cachedTokenFilepath - } - - tokenFile, err := loadCachedToken(p.cachedTokenFilepath) - if err != nil { - return aws.Credentials{}, &InvalidTokenError{Err: err} - } - - if tokenFile.ExpiresAt == nil || sdk.NowTime().After(time.Time(*tokenFile.ExpiresAt)) { - return aws.Credentials{}, &InvalidTokenError{} - } - accessToken = &tokenFile.AccessToken - } - - output, err := p.options.Client.GetRoleCredentials(ctx, &sso.GetRoleCredentialsInput{ - AccessToken: accessToken, - AccountId: &p.options.AccountID, - RoleName: &p.options.RoleName, - }) - if err != nil { - return aws.Credentials{}, err - } - - return aws.Credentials{ - AccessKeyID: aws.ToString(output.RoleCredentials.AccessKeyId), - SecretAccessKey: aws.ToString(output.RoleCredentials.SecretAccessKey), - SessionToken: aws.ToString(output.RoleCredentials.SessionToken), - CanExpire: true, - Expires: time.Unix(0, output.RoleCredentials.Expiration*int64(time.Millisecond)).UTC(), - Source: ProviderName, - AccountID: p.options.AccountID, - }, nil -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *Provider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceSSO} - } - return p.options.CredentialSources -} - -// InvalidTokenError is the error type that is returned if loaded token has -// expired or is otherwise invalid. To refresh the SSO session run AWS SSO -// login with the corresponding profile. -type InvalidTokenError struct { - Err error -} - -func (i *InvalidTokenError) Unwrap() error { - return i.Err -} - -func (i *InvalidTokenError) Error() string { - const msg = "the SSO session has expired or is invalid" - if i.Err == nil { - return msg - } - return msg + ": " + i.Err.Error() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go deleted file mode 100644 index 7f4fc5467..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go +++ /dev/null @@ -1,147 +0,0 @@ -package ssocreds - -import ( - "context" - "fmt" - "os" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/aws-sdk-go-v2/service/ssooidc" - "github.com/aws/smithy-go/auth/bearer" -) - -// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API -// client for calling CreateToken operation to refresh the SSO token. -type CreateTokenAPIClient interface { - CreateToken(context.Context, *ssooidc.CreateTokenInput, ...func(*ssooidc.Options)) ( - *ssooidc.CreateTokenOutput, error, - ) -} - -// SSOTokenProviderOptions provides the options for configuring the -// SSOTokenProvider. -type SSOTokenProviderOptions struct { - // Client that can be overridden - Client CreateTokenAPIClient - - // The set of API Client options to be applied when invoking the - // CreateToken operation. - ClientOptions []func(*ssooidc.Options) - - // The path the file containing the cached SSO token will be read from. - // Initialized the NewSSOTokenProvider's cachedTokenFilepath parameter. - CachedTokenFilepath string -} - -// SSOTokenProvider provides an utility for refreshing SSO AccessTokens for -// Bearer Authentication. The SSOTokenProvider can only be used to refresh -// already cached SSO Tokens. This utility cannot perform the initial SSO -// create token. -// -// The SSOTokenProvider is not safe to use concurrently. It must be wrapped in -// a utility such as smithy-go's auth/bearer#TokenCache. The SDK's -// config.LoadDefaultConfig will automatically wrap the SSOTokenProvider with -// the smithy-go TokenCache, if the external configuration loaded configured -// for an SSO session. -// -// The initial SSO create token should be preformed with the AWS CLI before the -// Go application using the SSOTokenProvider will need to retrieve the SSO -// token. If the AWS CLI has not created the token cache file, this provider -// will return an error when attempting to retrieve the cached token. -// -// This provider will attempt to refresh the cached SSO token periodically if -// needed when RetrieveBearerToken is called. -// -// A utility such as the AWS CLI must be used to initially create the SSO -// session and cached token file. -// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -type SSOTokenProvider struct { - options SSOTokenProviderOptions -} - -var _ bearer.TokenProvider = (*SSOTokenProvider)(nil) - -// NewSSOTokenProvider returns an initialized SSOTokenProvider that will -// periodically refresh the SSO token cached stored in the cachedTokenFilepath. -// The cachedTokenFilepath file's content will be rewritten by the token -// provider when the token is refreshed. -// -// The client must be configured for the AWS region the SSO token was created for. -func NewSSOTokenProvider(client CreateTokenAPIClient, cachedTokenFilepath string, optFns ...func(o *SSOTokenProviderOptions)) *SSOTokenProvider { - options := SSOTokenProviderOptions{ - Client: client, - CachedTokenFilepath: cachedTokenFilepath, - } - for _, fn := range optFns { - fn(&options) - } - - provider := &SSOTokenProvider{ - options: options, - } - - return provider -} - -// RetrieveBearerToken returns the SSO token stored in the cachedTokenFilepath -// the SSOTokenProvider was created with. If the token has expired -// RetrieveBearerToken will attempt to refresh it. If the token cannot be -// refreshed or is not present an error will be returned. -// -// A utility such as the AWS CLI must be used to initially create the SSO -// session and cached token file. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -func (p SSOTokenProvider) RetrieveBearerToken(ctx context.Context) (bearer.Token, error) { - cachedToken, err := loadCachedToken(p.options.CachedTokenFilepath) - if err != nil { - return bearer.Token{}, err - } - - if cachedToken.ExpiresAt != nil && sdk.NowTime().After(time.Time(*cachedToken.ExpiresAt)) { - cachedToken, err = p.refreshToken(ctx, cachedToken) - if err != nil { - return bearer.Token{}, fmt.Errorf("refresh cached SSO token failed, %w", err) - } - } - - expiresAt := aws.ToTime((*time.Time)(cachedToken.ExpiresAt)) - return bearer.Token{ - Value: cachedToken.AccessToken, - CanExpire: !expiresAt.IsZero(), - Expires: expiresAt, - }, nil -} - -func (p SSOTokenProvider) refreshToken(ctx context.Context, cachedToken token) (token, error) { - if cachedToken.ClientSecret == "" || cachedToken.ClientID == "" || cachedToken.RefreshToken == "" { - return token{}, fmt.Errorf("cached SSO token is expired, or not present, and cannot be refreshed") - } - - createResult, err := p.options.Client.CreateToken(ctx, &ssooidc.CreateTokenInput{ - ClientId: &cachedToken.ClientID, - ClientSecret: &cachedToken.ClientSecret, - RefreshToken: &cachedToken.RefreshToken, - GrantType: aws.String("refresh_token"), - }, p.options.ClientOptions...) - if err != nil { - return token{}, fmt.Errorf("unable to refresh SSO token, %w", err) - } - - expiresAt := sdk.NowTime().Add(time.Duration(createResult.ExpiresIn) * time.Second) - - cachedToken.AccessToken = aws.ToString(createResult.AccessToken) - cachedToken.ExpiresAt = (*rfc3339)(&expiresAt) - cachedToken.RefreshToken = aws.ToString(createResult.RefreshToken) - - fileInfo, err := os.Stat(p.options.CachedTokenFilepath) - if err != nil { - return token{}, fmt.Errorf("failed to stat cached SSO token file %w", err) - } - - if err = storeCachedToken(p.options.CachedTokenFilepath, cachedToken, fileInfo.Mode()); err != nil { - return token{}, fmt.Errorf("unable to cache refreshed SSO token, %w", err) - } - - return cachedToken, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.go deleted file mode 100644 index a469abdb7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.go +++ /dev/null @@ -1,63 +0,0 @@ -package credentials - -import ( - "context" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -const ( - // StaticCredentialsName provides a name of Static provider - StaticCredentialsName = "StaticCredentials" -) - -// StaticCredentialsEmptyError is emitted when static credentials are empty. -type StaticCredentialsEmptyError struct{} - -func (*StaticCredentialsEmptyError) Error() string { - return "static credentials are empty" -} - -// A StaticCredentialsProvider is a set of credentials which are set, and will -// never expire. -type StaticCredentialsProvider struct { - Value aws.Credentials - // These values are for reporting purposes and are not meant to be set up directly - Source []aws.CredentialSource -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (s StaticCredentialsProvider) ProviderSources() []aws.CredentialSource { - if s.Source == nil { - return []aws.CredentialSource{aws.CredentialSourceCode} // If no source has been set, assume this is used directly which means hardcoded creds - } - return s.Source -} - -// NewStaticCredentialsProvider return a StaticCredentialsProvider initialized with the AWS -// credentials passed in. -func NewStaticCredentialsProvider(key, secret, session string) StaticCredentialsProvider { - return StaticCredentialsProvider{ - Value: aws.Credentials{ - AccessKeyID: key, - SecretAccessKey: secret, - SessionToken: session, - }, - } -} - -// Retrieve returns the credentials or error if the credentials are invalid. -func (s StaticCredentialsProvider) Retrieve(_ context.Context) (aws.Credentials, error) { - v := s.Value - if v.AccessKeyID == "" || v.SecretAccessKey == "" { - return aws.Credentials{ - Source: StaticCredentialsName, - }, &StaticCredentialsEmptyError{} - } - - if len(v.Source) == 0 { - v.Source = StaticCredentialsName - } - - return v, nil -} 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 deleted file mode 100644 index 1ccf71e77..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go +++ /dev/null @@ -1,338 +0,0 @@ -// Package stscreds are credential Providers to retrieve STS AWS credentials. -// -// STS provides multiple ways to retrieve credentials which can be used when making -// future AWS service API operation calls. -// -// The SDK will ensure that per instance of credentials.Credentials all requests -// to refresh the credentials will be synchronized. But, the SDK is unable to -// ensure synchronous usage of the AssumeRoleProvider if the value is shared -// between multiple Credentials or service clients. -// -// # Assume Role -// -// To assume an IAM role using STS with the SDK you can create a new Credentials -// with the SDKs's stscreds package. -// -// // Initial credentials loaded from SDK's default credential chain. Such as -// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance -// // Role. These credentials will be used to to make the STS Assume Role API. -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } -// -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN. -// stsSvc := sts.NewFromConfig(cfg) -// creds := stscreds.NewAssumeRoleProvider(stsSvc, "myRoleArn") -// -// cfg.Credentials = aws.NewCredentialsCache(creds) -// -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) -// -// # Assume Role with custom MFA Token provider -// -// To assume an IAM role with a MFA token you can either specify a custom MFA -// token provider or use the SDK's built in StdinTokenProvider that will prompt -// the user for a token code each time the credentials need to to be refreshed. -// Specifying a custom token provider allows you to control where the token -// code is retrieved from, and how it is refreshed. -// -// With a custom token provider, the provider is responsible for refreshing the -// token code when called. -// -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } -// -// staticTokenProvider := func() (string, error) { -// return someTokenCode, nil -// } -// -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN using the MFA token code provided. -// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { -// o.SerialNumber = aws.String("myTokenSerialNumber") -// o.TokenProvider = staticTokenProvider -// }) -// -// cfg.Credentials = aws.NewCredentialsCache(creds) -// -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) -// -// # Assume Role with MFA Token Provider -// -// To assume an IAM role with MFA for longer running tasks where the credentials -// may need to be refreshed setting the TokenProvider field of AssumeRoleProvider -// will allow the credential provider to prompt for new MFA token code when the -// role's credentials need to be refreshed. -// -// The StdinTokenProvider function is available to prompt on stdin to retrieve -// the MFA token code from the user. You can also implement custom prompts by -// satisfying the TokenProvider function signature. -// -// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will -// have undesirable results as the StdinTokenProvider will not be synchronized. A -// single Credentials with an AssumeRoleProvider can be shared safely. -// -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } -// -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN using the MFA token code provided. -// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { -// o.SerialNumber = aws.String("myTokenSerialNumber") -// o.TokenProvider = stscreds.StdinTokenProvider -// }) -// -// cfg.Credentials = aws.NewCredentialsCache(creds) -// -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) -package stscreds - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/sts" - "github.com/aws/aws-sdk-go-v2/service/sts/types" -) - -// StdinTokenProvider will prompt on stdout and read from stdin for a string value. -// An error is returned if reading from stdin fails. -// -// Use this function go read MFA tokens from stdin. The function makes no attempt -// to make atomic prompts from stdin across multiple gorouties. -// -// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will -// have undesirable results as the StdinTokenProvider will not be synchronized. A -// single Credentials with an AssumeRoleProvider can be shared safely -// -// Will wait forever until something is provided on the stdin. -func StdinTokenProvider() (string, error) { - var v string - fmt.Printf("Assume Role MFA token code: ") - _, err := fmt.Scanln(&v) - - return v, err -} - -// ProviderName provides a name of AssumeRole provider -const ProviderName = "AssumeRoleProvider" - -// AssumeRoleAPIClient is a client capable of the STS AssumeRole operation. -type AssumeRoleAPIClient interface { - AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error) -} - -// DefaultDuration is the default amount of time in minutes that the -// credentials will be valid for. This value is only used by AssumeRoleProvider -// for specifying the default expiry duration of an assume role. -// -// Other providers such as WebIdentityRoleProvider do not use this value, and -// instead rely on STS API's default parameter handing to assign a default -// value. -var DefaultDuration = time.Duration(15) * time.Minute - -// AssumeRoleProvider retrieves temporary credentials from the STS service, and -// keeps track of their expiration time. -// -// This credential provider will be used by the SDKs default credential change -// when shared configuration is enabled, and the shared config or shared credentials -// file configure assume role. See Session docs for how to do this. -// -// AssumeRoleProvider does not provide any synchronization and it is not safe -// to share this value across multiple Credentials, Sessions, or service clients -// without also sharing the same Credentials instance. -type AssumeRoleProvider struct { - options AssumeRoleOptions -} - -// AssumeRoleOptions is the configurable options for AssumeRoleProvider -type AssumeRoleOptions struct { - // Client implementation of the AssumeRole operation. Required - Client AssumeRoleAPIClient - - // IAM Role ARN to be assumed. Required - RoleARN string - - // Session name, if you wish to uniquely identify this session. - RoleSessionName string - - // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. - Duration time.Duration - - // Optional ExternalID to pass along, defaults to nil if not set. - ExternalID *string - - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. - Policy *string - - // The ARNs of IAM managed policies you want to use as managed session policies. - // The policies must exist in the same account as the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's identity-based - // policy and the session policies. You can use the role's temporary credentials - // in subsequent AWS API calls to access resources in the account that owns - // the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - PolicyARNs []types.PolicyDescriptorType - - // The identification number of the MFA device that is associated with the user - // who is making the AssumeRole call. Specify this value if the trust policy - // of the role being assumed includes a condition that requires MFA authentication. - // The value is either the serial number for a hardware device (such as GAHT12345678) - // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). - SerialNumber *string - - // The source identity specified by the principal that is calling the AssumeRole - // operation. You can require users to specify a source identity when they assume a - // role. You do this by using the sts:SourceIdentity condition key in a role trust - // policy. You can use source identity information in CloudTrail logs to determine - // who took actions with a role. You can use the aws:SourceIdentity condition key - // to further control access to Amazon Web Services resources based on the value of - // source identity. For more information about using source identity, see Monitor - // and control actions taken with assumed roles - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - // in the IAM User Guide. - SourceIdentity *string - - // Async method of providing MFA token code for assuming an IAM role with MFA. - // The value returned by the function will be used as the TokenCode in the Retrieve - // call. See StdinTokenProvider for a provider that prompts and reads from stdin. - // - // This token provider will be called when ever the assumed role's - // credentials need to be refreshed when SerialNumber is set. - TokenProvider func() (string, error) - - // A list of session tags that you want to pass. Each session tag consists of a key - // name and an associated value. For more information about session tags, see - // Tagging STS Sessions - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the - // IAM User Guide. This parameter is optional. You can pass up to 50 session tags. - Tags []types.Tag - - // A list of keys for session tags that you want to set as transitive. If you set a - // tag key as transitive, the corresponding key and value passes to subsequent - // sessions in a role chain. For more information, see Chaining Roles with Session - // Tags - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) - // in the IAM User Guide. This parameter is optional. - TransitiveTagKeys []string - - // The chain of providers that was used to create this provider - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// NewAssumeRoleProvider constructs and returns a credentials provider that -// will retrieve credentials by assuming a IAM role using STS. -func NewAssumeRoleProvider(client AssumeRoleAPIClient, roleARN string, optFns ...func(*AssumeRoleOptions)) *AssumeRoleProvider { - o := AssumeRoleOptions{ - Client: client, - RoleARN: roleARN, - } - - for _, fn := range optFns { - fn(&o) - } - - return &AssumeRoleProvider{ - options: o, - } -} - -// Retrieve generates a new set of temporary credentials using STS. -func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) { - // Apply defaults where parameters are not set. - if len(p.options.RoleSessionName) == 0 { - // Try to work out a role name that will hopefully end up unique. - p.options.RoleSessionName = fmt.Sprintf("aws-go-sdk-%d", time.Now().UTC().UnixNano()) - } - if p.options.Duration == 0 { - // Expire as often as AWS permits. - p.options.Duration = DefaultDuration - } - input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int32(int32(p.options.Duration / time.Second)), - PolicyArns: p.options.PolicyARNs, - RoleArn: aws.String(p.options.RoleARN), - RoleSessionName: aws.String(p.options.RoleSessionName), - ExternalId: p.options.ExternalID, - SourceIdentity: p.options.SourceIdentity, - Tags: p.options.Tags, - TransitiveTagKeys: p.options.TransitiveTagKeys, - } - if p.options.Policy != nil { - input.Policy = p.options.Policy - } - if p.options.SerialNumber != nil { - if p.options.TokenProvider != nil { - input.SerialNumber = p.options.SerialNumber - code, err := p.options.TokenProvider() - if err != nil { - return aws.Credentials{}, err - } - input.TokenCode = aws.String(code) - } else { - return aws.Credentials{}, fmt.Errorf("assume role with MFA enabled, but TokenProvider is not set") - } - } - - resp, err := p.options.Client.AssumeRole(ctx, input) - if err != nil { - return aws.Credentials{Source: ProviderName}, err - } - - var accountID string - if resp.AssumedRoleUser != nil { - accountID = getAccountID(resp.AssumedRoleUser) - } - - return aws.Credentials{ - AccessKeyID: *resp.Credentials.AccessKeyId, - SecretAccessKey: *resp.Credentials.SecretAccessKey, - SessionToken: *resp.Credentials.SessionToken, - Source: ProviderName, - - CanExpire: true, - Expires: *resp.Credentials.Expiration, - AccountID: accountID, - }, nil -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *AssumeRoleProvider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceSTSAssumeRole} - } // If no source has been set, assume this is used directly which means just call to assume role - return append(p.options.CredentialSources, aws.CredentialSourceSTSAssumeRole) -} 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 deleted file mode 100644 index 5f4286dda..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go +++ /dev/null @@ -1,181 +0,0 @@ -package stscreds - -import ( - "context" - "fmt" - "io/ioutil" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/aws-sdk-go-v2/service/sts" - "github.com/aws/aws-sdk-go-v2/service/sts/types" -) - -var invalidIdentityTokenExceptionCode = (&types.InvalidIdentityTokenException{}).ErrorCode() - -const ( - // WebIdentityProviderName is the web identity provider name - WebIdentityProviderName = "WebIdentityCredentials" -) - -// AssumeRoleWithWebIdentityAPIClient is a client capable of the STS AssumeRoleWithWebIdentity operation. -type AssumeRoleWithWebIdentityAPIClient interface { - AssumeRoleWithWebIdentity(ctx context.Context, params *sts.AssumeRoleWithWebIdentityInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleWithWebIdentityOutput, error) -} - -// WebIdentityRoleProvider is used to retrieve credentials using -// an OIDC token. -type WebIdentityRoleProvider struct { - options WebIdentityRoleOptions -} - -// WebIdentityRoleOptions is a structure of configurable options for WebIdentityRoleProvider -type WebIdentityRoleOptions struct { - // Client implementation of the AssumeRoleWithWebIdentity operation. Required - Client AssumeRoleWithWebIdentityAPIClient - - // JWT Token Provider. Required - TokenRetriever IdentityTokenRetriever - - // IAM Role ARN to assume. Required - RoleARN string - - // Session name, if you wish to uniquely identify this session. - RoleSessionName string - - // Expiry duration of the STS credentials. STS will assign a default expiry - // duration if this value is unset. This is different from the Duration - // option of AssumeRoleProvider, which automatically assigns 15 minutes if - // Duration is unset. - // - // See the STS AssumeRoleWithWebIdentity API reference guide for more - // information on defaults. - // https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html - Duration time.Duration - - // An IAM policy in JSON format that you want to use as an inline session policy. - Policy *string - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you - // want to use as managed session policies. The policies must exist in the - // same account as the role. - PolicyARNs []types.PolicyDescriptorType - - // The chain of providers that was used to create this provider - // These values are for reporting purposes and are not meant to be set up directly - CredentialSources []aws.CredentialSource -} - -// IdentityTokenRetriever is an interface for retrieving a JWT -type IdentityTokenRetriever interface { - GetIdentityToken() ([]byte, error) -} - -// IdentityTokenFile is for retrieving an identity token from the given file name -type IdentityTokenFile string - -// GetIdentityToken retrieves the JWT token from the file and returns the contents as a []byte -func (j IdentityTokenFile) GetIdentityToken() ([]byte, error) { - b, err := ioutil.ReadFile(string(j)) - if err != nil { - return nil, fmt.Errorf("unable to read file at %s: %v", string(j), err) - } - - return b, nil -} - -// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the -// provided stsiface.ClientAPI -func NewWebIdentityRoleProvider(client AssumeRoleWithWebIdentityAPIClient, roleARN string, tokenRetriever IdentityTokenRetriever, optFns ...func(*WebIdentityRoleOptions)) *WebIdentityRoleProvider { - o := WebIdentityRoleOptions{ - Client: client, - RoleARN: roleARN, - TokenRetriever: tokenRetriever, - } - - for _, fn := range optFns { - fn(&o) - } - - return &WebIdentityRoleProvider{options: o} -} - -// Retrieve will attempt to assume a role from a token which is located at -// 'WebIdentityTokenFilePath' specified destination and if that is empty an -// error will be returned. -func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) { - b, err := p.options.TokenRetriever.GetIdentityToken() - if err != nil { - return aws.Credentials{}, fmt.Errorf("failed to retrieve jwt from provide source, %w", err) - } - - sessionName := p.options.RoleSessionName - if len(sessionName) == 0 { - // session name is used to uniquely identify a session. This simply - // uses unix time in nanoseconds to uniquely identify sessions. - sessionName = strconv.FormatInt(sdk.NowTime().UnixNano(), 10) - } - input := &sts.AssumeRoleWithWebIdentityInput{ - PolicyArns: p.options.PolicyARNs, - RoleArn: &p.options.RoleARN, - RoleSessionName: &sessionName, - WebIdentityToken: aws.String(string(b)), - } - if p.options.Duration != 0 { - // If set use the value, otherwise STS will assign a default expiration duration. - input.DurationSeconds = aws.Int32(int32(p.options.Duration / time.Second)) - } - if p.options.Policy != nil { - input.Policy = p.options.Policy - } - - resp, err := p.options.Client.AssumeRoleWithWebIdentity(ctx, input, func(options *sts.Options) { - options.Retryer = retry.AddWithErrorCodes(options.Retryer, invalidIdentityTokenExceptionCode) - }) - if err != nil { - return aws.Credentials{}, fmt.Errorf("failed to retrieve credentials, %w", err) - } - - var accountID string - if resp.AssumedRoleUser != nil { - accountID = getAccountID(resp.AssumedRoleUser) - } - - // InvalidIdentityToken error is a temporary error that can occur - // when assuming an Role with a JWT web identity token. - - value := aws.Credentials{ - AccessKeyID: aws.ToString(resp.Credentials.AccessKeyId), - SecretAccessKey: aws.ToString(resp.Credentials.SecretAccessKey), - SessionToken: aws.ToString(resp.Credentials.SessionToken), - Source: WebIdentityProviderName, - CanExpire: true, - Expires: *resp.Credentials.Expiration, - AccountID: accountID, - } - return value, 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 { - return "" - } - parts := strings.Split(*u.Arn, ":") - if len(parts) < 5 { - return "" - } - return parts[4] -} - -// ProviderSources returns the credential chain that was used to construct this provider -func (p *WebIdentityRoleProvider) ProviderSources() []aws.CredentialSource { - if p.options.CredentialSources == nil { - return []aws.CredentialSource{aws.CredentialSourceSTSAssumeRoleWebID} - } - return p.options.CredentialSources -} 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 deleted file mode 100644 index 6b8c45473..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ /dev/null @@ -1,494 +0,0 @@ -# v1.18.9 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.8 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.7 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.6 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.4 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2025-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2025-07-29) - -* **Feature**: Add config switch `DisableDefaultMaxBackoff` that allows you to disable the default maximum backoff (1 second) for IMDS calls retry attempt - -# v1.17.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.33 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.32 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.31 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.30 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.29 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.28 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.27 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.26 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.25 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.16.24 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.23 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.22 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.21 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.20 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.19 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.18 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.17 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.16 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.15 (2024-10-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.14 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.13 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.12 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.11 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.10 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.9 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.8 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.7 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.6 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.3 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2024-03-21) - -* **Feature**: Add config switch `DisableDefaultTimeout` that allows you to disable the default operation timeout (5 seconds) for IMDS calls. - -# v1.15.4 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.3 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.2 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.11 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.10 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.9 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.8 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.7 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.6 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.5 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.4 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.3 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.2 (2023-11-02) - -* No change notes available for this release. - -# v1.14.1 (2023-11-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.13 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.12 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.11 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.10 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.9 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.8 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.7 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.6 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.5 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2023-03-14) - -* **Feature**: Add flag to disable IMDSv1 fallback - -# v1.12.24 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.23 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.22 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.19 (2022-10-24) - -* **Bug Fix**: Fixes an issue that prevented logging of the API request or responses when the respective log modes were enabled. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-02-24) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.2 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-11-06) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-10-11) - -* **Feature**: Respect passed in Context Deadline/Timeout. Updates the IMDS Client operations to not override the passed in Context's Deadline or Timeout options. If an Client operation is called with a Context with a Deadline or Timeout, the client will no longer override it with the client's default timeout. -* **Bug Fix**: Fix IMDS client's response handling and operation timeout race. Fixes #1253 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-08-04) - -* **Feature**: adds error handling for defered close calls -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-07-15) - -* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go deleted file mode 100644 index 75edc4e9d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go +++ /dev/null @@ -1,358 +0,0 @@ -package imds - -import ( - "context" - "fmt" - "net" - "net/http" - "os" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/retry" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalconfig "github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config" - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// ServiceID provides the unique name of this API client -const ServiceID = "ec2imds" - -// Client provides the API client for interacting with the Amazon EC2 Instance -// Metadata Service API. -type Client struct { - options Options -} - -// ClientEnableState provides an enumeration if the client is enabled, -// disabled, or default behavior. -type ClientEnableState = internalconfig.ClientEnableState - -// Enumeration values for ClientEnableState -const ( - ClientDefaultEnableState ClientEnableState = internalconfig.ClientDefaultEnableState // default behavior - ClientDisabled ClientEnableState = internalconfig.ClientDisabled // client disabled - ClientEnabled ClientEnableState = internalconfig.ClientEnabled // client enabled -) - -// EndpointModeState is an enum configuration variable describing the client endpoint mode. -// Not configurable directly, but used when using the NewFromConfig. -type EndpointModeState = internalconfig.EndpointModeState - -// Enumeration values for EndpointModeState -const ( - EndpointModeStateUnset EndpointModeState = internalconfig.EndpointModeStateUnset - EndpointModeStateIPv4 EndpointModeState = internalconfig.EndpointModeStateIPv4 - EndpointModeStateIPv6 EndpointModeState = internalconfig.EndpointModeStateIPv6 -) - -const ( - disableClientEnvVar = "AWS_EC2_METADATA_DISABLED" - - // Client endpoint options - endpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" - - defaultIPv4Endpoint = "http://169.254.169.254" - defaultIPv6Endpoint = "http://[fd00:ec2::254]" -) - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - options.HTTPClient = resolveHTTPClient(options.HTTPClient) - - if options.Retryer == nil { - options.Retryer = retry.NewStandard() - } - if !options.DisableDefaultMaxBackoff { - options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second) - } - - if options.ClientEnableState == ClientDefaultEnableState { - if v := os.Getenv(disableClientEnvVar); strings.EqualFold(v, "true") { - options.ClientEnableState = ClientDisabled - } - } - - if len(options.Endpoint) == 0 { - if v := os.Getenv(endpointEnvVar); len(v) != 0 { - options.Endpoint = v - } - } - - client := &Client{ - options: options, - } - - if client.options.tokenProvider == nil && !client.options.disableAPIToken { - client.options.tokenProvider = newTokenProvider(client, defaultTokenTTL) - } - - return client -} - -// NewFromConfig returns an initialized Client based the AWS SDK config, and -// functional options. Provide additional functional options to further -// configure the behavior of the client, such as changing the client's endpoint -// or adding custom middleware behavior. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - APIOptions: append([]func(*middleware.Stack) error{}, cfg.APIOptions...), - HTTPClient: cfg.HTTPClient, - ClientLogMode: cfg.ClientLogMode, - Logger: cfg.Logger, - } - - if cfg.Retryer != nil { - opts.Retryer = cfg.Retryer() - } - - resolveClientEnableState(cfg, &opts) - resolveEndpointConfig(cfg, &opts) - resolveEndpointModeConfig(cfg, &opts) - resolveEnableFallback(cfg, &opts) - - return New(opts, optFns...) -} - -// Options provides the fields for configuring the API client's behavior. -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation - // call to modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The endpoint the client will use to retrieve EC2 instance metadata. - // - // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EndpointMode. - // - // If unset, and the environment variable AWS_EC2_METADATA_SERVICE_ENDPOINT - // has a value the client will use the value of the environment variable as - // the endpoint for operation calls. - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] - Endpoint string - - // The endpoint selection mode the client will use if no explicit endpoint is provided using the Endpoint field. - // - // Setting EndpointMode to EndpointModeStateIPv4 will configure the client to use the default EC2 IPv4 endpoint. - // Setting EndpointMode to EndpointModeStateIPv6 will configure the client to use the default EC2 IPv6 endpoint. - // - // By default if EndpointMode is not set (EndpointModeStateUnset) than the default endpoint selection mode EndpointModeStateIPv4. - EndpointMode EndpointModeState - - // The HTTP client to invoke API calls with. Defaults to client's default - // HTTP implementation if nil. - HTTPClient HTTPClient - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer - - // Changes if the EC2 Instance Metadata client is enabled or not. Client - // will default to enabled if not set to ClientDisabled. When the client is - // disabled it will return an error for all operation calls. - // - // If ClientEnableState value is ClientDefaultEnableState (default value), - // and the environment variable "AWS_EC2_METADATA_DISABLED" is set to - // "true", the client will be disabled. - // - // AWS_EC2_METADATA_DISABLED=true - ClientEnableState ClientEnableState - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // Configure IMDSv1 fallback behavior. By default, the client will attempt - // to fall back to IMDSv1 as needed for backwards compatibility. When set to [aws.FalseTernary] - // the client will return any errors encountered from attempting to fetch a token - // instead of silently using the insecure data flow of IMDSv1. - // - // See [configuring IMDS] for more information. - // - // [configuring IMDS]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html - EnableFallback aws.Ternary - - // By default, all IMDS client operations enforce a 5-second timeout. You - // can disable that behavior with this setting. - DisableDefaultTimeout bool - - // By default all IMDS client operations enforce a 1-second retry delay at maximum. - // You can disable that behavior with this setting. - DisableDefaultMaxBackoff bool - - // provides the caching of API tokens used for operation calls. If unset, - // the API token will not be retrieved for the operation. - tokenProvider *tokenProvider - - // option to disable the API token provider for testing. - disableAPIToken bool -} - -// HTTPClient provides the interface for a client making HTTP requests with the -// API. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Copy creates a copy of the API options. -func (o Options) Copy() Options { - to := o - to.APIOptions = append([]func(*middleware.Stack) error{}, o.APIOptions...) - return to -} - -// WithAPIOptions wraps the API middleware functions, as a functional option -// for the API Client Options. Use this helper to add additional functional -// options to the API client, or operation calls. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), - stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - for _, fn := range optFns { - fn(&options) - } - - if options.ClientEnableState == ClientDisabled { - return nil, metadata, &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: fmt.Errorf( - "access disabled to EC2 IMDS via client option, or %q environment variable", - disableClientEnvVar), - } - } - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) - result, metadata, err = handler.Handle(ctx, params) - if err != nil { - return nil, metadata, &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - return result, metadata, err -} - -const ( - // HTTP client constants - defaultDialerTimeout = 250 * time.Millisecond - defaultResponseHeaderTimeout = 500 * time.Millisecond -) - -func resolveHTTPClient(client HTTPClient) HTTPClient { - if client == nil { - client = awshttp.NewBuildableClient() - } - - if c, ok := client.(*awshttp.BuildableClient); ok { - client = c. - WithDialerOptions(func(d *net.Dialer) { - // Use a custom Dial timeout for the EC2 Metadata service to account - // for the possibility the application might not be running in an - // environment with the service present. The client should fail fast in - // this case. - d.Timeout = defaultDialerTimeout - }). - WithTransportOptions(func(tr *http.Transport) { - // Use a custom Transport timeout for the EC2 Metadata service to - // account for the possibility that the application might be running in - // a container, and EC2Metadata service drops the connection after a - // single IP Hop. The client should fail fast in this case. - tr.ResponseHeaderTimeout = defaultResponseHeaderTimeout - }) - } - - return client -} - -func resolveClientEnableState(cfg aws.Config, options *Options) error { - if options.ClientEnableState != ClientDefaultEnableState { - return nil - } - value, found, err := internalconfig.ResolveClientEnableState(cfg.ConfigSources) - if err != nil || !found { - return err - } - options.ClientEnableState = value - return nil -} - -func resolveEndpointModeConfig(cfg aws.Config, options *Options) error { - if options.EndpointMode != EndpointModeStateUnset { - return nil - } - value, found, err := internalconfig.ResolveEndpointModeConfig(cfg.ConfigSources) - if err != nil || !found { - return err - } - options.EndpointMode = value - return nil -} - -func resolveEndpointConfig(cfg aws.Config, options *Options) error { - if len(options.Endpoint) != 0 { - return nil - } - value, found, err := internalconfig.ResolveEndpointConfig(cfg.ConfigSources) - if err != nil || !found { - return err - } - options.Endpoint = value - return nil -} - -func resolveEnableFallback(cfg aws.Config, options *Options) { - if options.EnableFallback != aws.UnknownTernary { - return - } - - disabled, ok := internalconfig.ResolveV1FallbackDisabled(cfg.ConfigSources) - if !ok { - return - } - - if disabled { - options.EnableFallback = aws.FalseTernary - } else { - options.EnableFallback = aws.TrueTernary - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go deleted file mode 100644 index af58b6bb1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go +++ /dev/null @@ -1,77 +0,0 @@ -package imds - -import ( - "context" - "fmt" - "io" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getDynamicDataPath = "/latest/dynamic" - -// GetDynamicData uses the path provided to request information from the EC2 -// instance metadata service for dynamic data. The content will be returned -// as a string, or error if the request failed. -func (c *Client) GetDynamicData(ctx context.Context, params *GetDynamicDataInput, optFns ...func(*Options)) (*GetDynamicDataOutput, error) { - if params == nil { - params = &GetDynamicDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDynamicData", params, optFns, - addGetDynamicDataMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetDynamicDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetDynamicDataInput provides the input parameters for the GetDynamicData -// operation. -type GetDynamicDataInput struct { - // The relative dynamic data path to retrieve. Can be empty string to - // retrieve a response containing a new line separated list of dynamic data - // resources available. - // - // Must not include the dynamic data base path. - // - // May include leading slash. If Path includes trailing slash the trailing - // slash will be included in the request for the resource. - Path string -} - -// GetDynamicDataOutput provides the output parameters for the GetDynamicData -// operation. -type GetDynamicDataOutput struct { - Content io.ReadCloser - - ResultMetadata middleware.Metadata -} - -func addGetDynamicDataMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetDynamicData", - buildGetDynamicDataPath, - buildGetDynamicDataOutput) -} - -func buildGetDynamicDataPath(params interface{}) (string, error) { - p, ok := params.(*GetDynamicDataInput) - if !ok { - return "", fmt.Errorf("unknown parameter type %T", params) - } - - return appendURIPath(getDynamicDataPath, p.Path), nil -} - -func buildGetDynamicDataOutput(resp *smithyhttp.Response) (interface{}, error) { - return &GetDynamicDataOutput{ - Content: resp.Body, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go deleted file mode 100644 index 5111cc90c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go +++ /dev/null @@ -1,103 +0,0 @@ -package imds - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strings" - "time" - - "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getIAMInfoPath = getMetadataPath + "/iam/info" - -// GetIAMInfo retrieves an identity document describing an -// instance. Error is returned if the request fails or is unable to parse -// the response. -func (c *Client) GetIAMInfo( - ctx context.Context, params *GetIAMInfoInput, optFns ...func(*Options), -) ( - *GetIAMInfoOutput, error, -) { - if params == nil { - params = &GetIAMInfoInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIAMInfo", params, optFns, - addGetIAMInfoMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetIAMInfoOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetIAMInfoInput provides the input parameters for GetIAMInfo operation. -type GetIAMInfoInput struct{} - -// GetIAMInfoOutput provides the output parameters for GetIAMInfo operation. -type GetIAMInfoOutput struct { - IAMInfo - - ResultMetadata middleware.Metadata -} - -func addGetIAMInfoMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetIAMInfo", - buildGetIAMInfoPath, - buildGetIAMInfoOutput, - ) -} - -func buildGetIAMInfoPath(params interface{}) (string, error) { - return getIAMInfoPath, nil -} - -func buildGetIAMInfoOutput(resp *smithyhttp.Response) (v interface{}, err error) { - defer func() { - closeErr := resp.Body.Close() - if err == nil { - err = closeErr - } else if closeErr != nil { - err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) - } - }() - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(resp.Body, ringBuffer) - - imdsResult := &GetIAMInfoOutput{} - if err = json.NewDecoder(body).Decode(&imdsResult.IAMInfo); err != nil { - return nil, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode instance identity document, %w", err), - Snapshot: ringBuffer.Bytes(), - } - } - // Any code other success is an error - if !strings.EqualFold(imdsResult.Code, "success") { - return nil, fmt.Errorf("failed to get EC2 IMDS IAM info, %s", - imdsResult.Code) - } - - return imdsResult, nil -} - -// IAMInfo provides the shape for unmarshaling an IAM info from the metadata -// API. -type IAMInfo struct { - Code string - LastUpdated time.Time - InstanceProfileArn string - InstanceProfileID string -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go deleted file mode 100644 index dc8c09edf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go +++ /dev/null @@ -1,110 +0,0 @@ -package imds - -import ( - "context" - "encoding/json" - "fmt" - "io" - "time" - - "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getInstanceIdentityDocumentPath = getDynamicDataPath + "/instance-identity/document" - -// GetInstanceIdentityDocument retrieves an identity document describing an -// instance. Error is returned if the request fails or is unable to parse -// the response. -func (c *Client) GetInstanceIdentityDocument( - ctx context.Context, params *GetInstanceIdentityDocumentInput, optFns ...func(*Options), -) ( - *GetInstanceIdentityDocumentOutput, error, -) { - if params == nil { - params = &GetInstanceIdentityDocumentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetInstanceIdentityDocument", params, optFns, - addGetInstanceIdentityDocumentMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetInstanceIdentityDocumentOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetInstanceIdentityDocumentInput provides the input parameters for -// GetInstanceIdentityDocument operation. -type GetInstanceIdentityDocumentInput struct{} - -// GetInstanceIdentityDocumentOutput provides the output parameters for -// GetInstanceIdentityDocument operation. -type GetInstanceIdentityDocumentOutput struct { - InstanceIdentityDocument - - ResultMetadata middleware.Metadata -} - -func addGetInstanceIdentityDocumentMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetInstanceIdentityDocument", - buildGetInstanceIdentityDocumentPath, - buildGetInstanceIdentityDocumentOutput, - ) -} - -func buildGetInstanceIdentityDocumentPath(params interface{}) (string, error) { - return getInstanceIdentityDocumentPath, nil -} - -func buildGetInstanceIdentityDocumentOutput(resp *smithyhttp.Response) (v interface{}, err error) { - defer func() { - closeErr := resp.Body.Close() - if err == nil { - err = closeErr - } else if closeErr != nil { - err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) - } - }() - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(resp.Body, ringBuffer) - - output := &GetInstanceIdentityDocumentOutput{} - if err = json.NewDecoder(body).Decode(&output.InstanceIdentityDocument); err != nil { - return nil, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode instance identity document, %w", err), - Snapshot: ringBuffer.Bytes(), - } - } - - return output, nil -} - -// InstanceIdentityDocument provides the shape for unmarshaling -// an instance identity document -type InstanceIdentityDocument struct { - DevpayProductCodes []string `json:"devpayProductCodes"` - MarketplaceProductCodes []string `json:"marketplaceProductCodes"` - AvailabilityZone string `json:"availabilityZone"` - PrivateIP string `json:"privateIp"` - Version string `json:"version"` - Region string `json:"region"` - InstanceID string `json:"instanceId"` - BillingProducts []string `json:"billingProducts"` - InstanceType string `json:"instanceType"` - AccountID string `json:"accountId"` - PendingTime time.Time `json:"pendingTime"` - ImageID string `json:"imageId"` - KernelID string `json:"kernelId"` - RamdiskID string `json:"ramdiskId"` - Architecture string `json:"architecture"` -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go deleted file mode 100644 index 869bfc9fe..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go +++ /dev/null @@ -1,77 +0,0 @@ -package imds - -import ( - "context" - "fmt" - "io" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getMetadataPath = "/latest/meta-data" - -// GetMetadata uses the path provided to request information from the Amazon -// EC2 Instance Metadata Service. The content will be returned as a string, or -// error if the request failed. -func (c *Client) GetMetadata(ctx context.Context, params *GetMetadataInput, optFns ...func(*Options)) (*GetMetadataOutput, error) { - if params == nil { - params = &GetMetadataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetMetadata", params, optFns, - addGetMetadataMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetMetadataOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetMetadataInput provides the input parameters for the GetMetadata -// operation. -type GetMetadataInput struct { - // The relative metadata path to retrieve. Can be empty string to retrieve - // a response containing a new line separated list of metadata resources - // available. - // - // Must not include the metadata base path. - // - // May include leading slash. If Path includes trailing slash the trailing slash - // will be included in the request for the resource. - Path string -} - -// GetMetadataOutput provides the output parameters for the GetMetadata -// operation. -type GetMetadataOutput struct { - Content io.ReadCloser - - ResultMetadata middleware.Metadata -} - -func addGetMetadataMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetMetadata", - buildGetMetadataPath, - buildGetMetadataOutput) -} - -func buildGetMetadataPath(params interface{}) (string, error) { - p, ok := params.(*GetMetadataInput) - if !ok { - return "", fmt.Errorf("unknown parameter type %T", params) - } - - return appendURIPath(getMetadataPath, p.Path), nil -} - -func buildGetMetadataOutput(resp *smithyhttp.Response) (interface{}, error) { - return &GetMetadataOutput{ - Content: resp.Body, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go deleted file mode 100644 index 8c0572bb5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go +++ /dev/null @@ -1,73 +0,0 @@ -package imds - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// GetRegion retrieves an identity document describing an -// instance. Error is returned if the request fails or is unable to parse -// the response. -func (c *Client) GetRegion( - ctx context.Context, params *GetRegionInput, optFns ...func(*Options), -) ( - *GetRegionOutput, error, -) { - if params == nil { - params = &GetRegionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRegion", params, optFns, - addGetRegionMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetRegionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetRegionInput provides the input parameters for GetRegion operation. -type GetRegionInput struct{} - -// GetRegionOutput provides the output parameters for GetRegion operation. -type GetRegionOutput struct { - Region string - - ResultMetadata middleware.Metadata -} - -func addGetRegionMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetRegion", - buildGetInstanceIdentityDocumentPath, - buildGetRegionOutput, - ) -} - -func buildGetRegionOutput(resp *smithyhttp.Response) (interface{}, error) { - out, err := buildGetInstanceIdentityDocumentOutput(resp) - if err != nil { - return nil, err - } - - result, ok := out.(*GetInstanceIdentityDocumentOutput) - if !ok { - return nil, fmt.Errorf("unexpected instance identity document type, %T", out) - } - - region := result.Region - if len(region) == 0 { - return "", fmt.Errorf("instance metadata did not return a region value") - } - - return &GetRegionOutput{ - Region: region, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go deleted file mode 100644 index 1f9ee97a5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go +++ /dev/null @@ -1,119 +0,0 @@ -package imds - -import ( - "context" - "fmt" - "io" - "strconv" - "strings" - "time" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getTokenPath = "/latest/api/token" -const tokenTTLHeader = "X-Aws-Ec2-Metadata-Token-Ttl-Seconds" - -// getToken uses the duration to return a token for EC2 IMDS, or an error if -// the request failed. -func (c *Client) getToken(ctx context.Context, params *getTokenInput, optFns ...func(*Options)) (*getTokenOutput, error) { - if params == nil { - params = &getTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "getToken", params, optFns, - addGetTokenMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*getTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type getTokenInput struct { - TokenTTL time.Duration -} - -type getTokenOutput struct { - Token string - TokenTTL time.Duration - - ResultMetadata middleware.Metadata -} - -func addGetTokenMiddleware(stack *middleware.Stack, options Options) error { - err := addRequestMiddleware(stack, - options, - "PUT", - "GetToken", - buildGetTokenPath, - buildGetTokenOutput) - if err != nil { - return err - } - - err = stack.Serialize.Add(&tokenTTLRequestHeader{}, middleware.After) - if err != nil { - return err - } - - return nil -} - -func buildGetTokenPath(interface{}) (string, error) { - return getTokenPath, nil -} - -func buildGetTokenOutput(resp *smithyhttp.Response) (v interface{}, err error) { - defer func() { - closeErr := resp.Body.Close() - if err == nil { - err = closeErr - } else if closeErr != nil { - err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) - } - }() - - ttlHeader := resp.Header.Get(tokenTTLHeader) - tokenTTL, err := strconv.ParseInt(ttlHeader, 10, 64) - if err != nil { - return nil, fmt.Errorf("unable to parse API token, %w", err) - } - - var token strings.Builder - if _, err = io.Copy(&token, resp.Body); err != nil { - return nil, fmt.Errorf("unable to read API token, %w", err) - } - - return &getTokenOutput{ - Token: token.String(), - TokenTTL: time.Duration(tokenTTL) * time.Second, - }, nil -} - -type tokenTTLRequestHeader struct{} - -func (*tokenTTLRequestHeader) ID() string { return "tokenTTLRequestHeader" } -func (*tokenTTLRequestHeader) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("expect HTTP transport, got %T", in.Request) - } - - input, ok := in.Parameters.(*getTokenInput) - if !ok { - return out, metadata, fmt.Errorf("expect getTokenInput, got %T", in.Parameters) - } - - req.Header.Set(tokenTTLHeader, strconv.Itoa(int(input.TokenTTL/time.Second))) - - return next.HandleSerialize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go deleted file mode 100644 index 890369724..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go +++ /dev/null @@ -1,61 +0,0 @@ -package imds - -import ( - "context" - "io" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const getUserDataPath = "/latest/user-data" - -// GetUserData uses the path provided to request information from the EC2 -// instance metadata service for dynamic data. The content will be returned -// as a string, or error if the request failed. -func (c *Client) GetUserData(ctx context.Context, params *GetUserDataInput, optFns ...func(*Options)) (*GetUserDataOutput, error) { - if params == nil { - params = &GetUserDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetUserData", params, optFns, - addGetUserDataMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*GetUserDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -// GetUserDataInput provides the input parameters for the GetUserData -// operation. -type GetUserDataInput struct{} - -// GetUserDataOutput provides the output parameters for the GetUserData -// operation. -type GetUserDataOutput struct { - Content io.ReadCloser - - ResultMetadata middleware.Metadata -} - -func addGetUserDataMiddleware(stack *middleware.Stack, options Options) error { - return addAPIRequestMiddleware(stack, - options, - "GetUserData", - buildGetUserDataPath, - buildGetUserDataOutput) -} - -func buildGetUserDataPath(params interface{}) (string, error) { - return getUserDataPath, nil -} - -func buildGetUserDataOutput(resp *smithyhttp.Response) (interface{}, error) { - return &GetUserDataOutput{ - Content: resp.Body, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go deleted file mode 100644 index ad283cf82..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go +++ /dev/null @@ -1,48 +0,0 @@ -package imds - -import ( - "context" - "github.com/aws/smithy-go/middleware" -) - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} - -type signRequestMiddleware struct { -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go deleted file mode 100644 index d5765c36b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Package imds provides the API client for interacting with the Amazon EC2 -// Instance Metadata Service. -// -// All Client operation calls have a default timeout. If the operation is not -// completed before this timeout expires, the operation will be canceled. This -// timeout can be overridden through the following: -// - Set the options flag DisableDefaultTimeout -// - Provide a Context with a timeout or deadline with calling the client's operations. -// -// See the EC2 IMDS user guide for more information on using the API. -// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html -package imds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go deleted file mode 100644 index d7540da34..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go +++ /dev/null @@ -1,20 +0,0 @@ -package imds - -import ( - "context" - "github.com/aws/smithy-go/middleware" -) - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - return next.HandleFinalize(ctx, in) -} 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 deleted file mode 100644 index ce89f5829..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package imds - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go deleted file mode 100644 index ce7745589..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go +++ /dev/null @@ -1,114 +0,0 @@ -package config - -import ( - "fmt" - "strings" -) - -// ClientEnableState provides an enumeration if the client is enabled, -// disabled, or default behavior. -type ClientEnableState uint - -// Enumeration values for ClientEnableState -const ( - ClientDefaultEnableState ClientEnableState = iota - ClientDisabled - ClientEnabled -) - -// EndpointModeState is the EC2 IMDS Endpoint Configuration Mode -type EndpointModeState uint - -// Enumeration values for ClientEnableState -const ( - EndpointModeStateUnset EndpointModeState = iota - EndpointModeStateIPv4 - EndpointModeStateIPv6 -) - -// SetFromString sets the EndpointModeState based on the provided string value. Unknown values will default to EndpointModeStateUnset -func (e *EndpointModeState) SetFromString(v string) error { - v = strings.TrimSpace(v) - - switch { - case len(v) == 0: - *e = EndpointModeStateUnset - case strings.EqualFold(v, "IPv6"): - *e = EndpointModeStateIPv6 - case strings.EqualFold(v, "IPv4"): - *e = EndpointModeStateIPv4 - default: - return fmt.Errorf("unknown EC2 IMDS endpoint mode, must be either IPv6 or IPv4") - } - return nil -} - -// ClientEnableStateResolver is a config resolver interface for retrieving whether the IMDS client is disabled. -type ClientEnableStateResolver interface { - GetEC2IMDSClientEnableState() (ClientEnableState, bool, error) -} - -// EndpointModeResolver is a config resolver interface for retrieving the EndpointModeState configuration. -type EndpointModeResolver interface { - GetEC2IMDSEndpointMode() (EndpointModeState, bool, error) -} - -// EndpointResolver is a config resolver interface for retrieving the endpoint. -type EndpointResolver interface { - GetEC2IMDSEndpoint() (string, bool, error) -} - -type v1FallbackDisabledResolver interface { - GetEC2IMDSV1FallbackDisabled() (bool, bool) -} - -// ResolveClientEnableState resolves the ClientEnableState from a list of configuration sources. -func ResolveClientEnableState(sources []interface{}) (value ClientEnableState, found bool, err error) { - for _, source := range sources { - if resolver, ok := source.(ClientEnableStateResolver); ok { - value, found, err = resolver.GetEC2IMDSClientEnableState() - if err != nil || found { - return value, found, err - } - } - } - return value, found, err -} - -// ResolveEndpointModeConfig resolves the EndpointModeState from a list of configuration sources. -func ResolveEndpointModeConfig(sources []interface{}) (value EndpointModeState, found bool, err error) { - for _, source := range sources { - if resolver, ok := source.(EndpointModeResolver); ok { - value, found, err = resolver.GetEC2IMDSEndpointMode() - if err != nil || found { - return value, found, err - } - } - } - return value, found, err -} - -// ResolveEndpointConfig resolves the endpoint from a list of configuration sources. -func ResolveEndpointConfig(sources []interface{}) (value string, found bool, err error) { - for _, source := range sources { - if resolver, ok := source.(EndpointResolver); ok { - value, found, err = resolver.GetEC2IMDSEndpoint() - if err != nil || found { - return value, found, err - } - } - } - return value, found, err -} - -// ResolveV1FallbackDisabled ... -func ResolveV1FallbackDisabled(sources []interface{}) (bool, bool) { - for _, source := range sources { - if resolver, ok := source.(v1FallbackDisabledResolver); ok { - if v, found := resolver.GetEC2IMDSV1FallbackDisabled(); found { - return v, true - } - } - } - return false, false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go deleted file mode 100644 index 90cf4aeb3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go +++ /dev/null @@ -1,313 +0,0 @@ -package imds - -import ( - "bytes" - "context" - "fmt" - "io/ioutil" - "net/url" - "path" - "time" - - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func addAPIRequestMiddleware(stack *middleware.Stack, - options Options, - operation string, - getPath func(interface{}) (string, error), - getOutput func(*smithyhttp.Response) (interface{}, error), -) (err error) { - err = addRequestMiddleware(stack, options, "GET", operation, getPath, getOutput) - if err != nil { - return err - } - - // Token Serializer build and state management. - if !options.disableAPIToken { - err = stack.Finalize.Insert(options.tokenProvider, (*retry.Attempt)(nil).ID(), middleware.After) - if err != nil { - return err - } - - err = stack.Deserialize.Insert(options.tokenProvider, "OperationDeserializer", middleware.Before) - if err != nil { - return err - } - } - - return nil -} - -func addRequestMiddleware(stack *middleware.Stack, - options Options, - method string, - operation string, - getPath func(interface{}) (string, error), - getOutput func(*smithyhttp.Response) (interface{}, error), -) (err error) { - err = awsmiddleware.AddSDKAgentKey(awsmiddleware.FeatureMetadata, "ec2-imds")(stack) - if err != nil { - return err - } - - // Operation timeout - err = stack.Initialize.Add(&operationTimeout{ - Disabled: options.DisableDefaultTimeout, - DefaultTimeout: defaultOperationTimeout, - }, middleware.Before) - if err != nil { - return err - } - - // Operation Serializer - err = stack.Serialize.Add(&serializeRequest{ - GetPath: getPath, - Method: method, - }, middleware.After) - if err != nil { - return err - } - - // Operation endpoint resolver - err = stack.Serialize.Insert(&resolveEndpoint{ - Endpoint: options.Endpoint, - EndpointMode: options.EndpointMode, - }, "OperationSerializer", middleware.Before) - if err != nil { - return err - } - - // Operation Deserializer - err = stack.Deserialize.Add(&deserializeResponse{ - GetOutput: getOutput, - }, middleware.After) - if err != nil { - return err - } - - err = stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: options.ClientLogMode.IsRequest(), - LogRequestWithBody: options.ClientLogMode.IsRequestWithBody(), - LogResponse: options.ClientLogMode.IsResponse(), - LogResponseWithBody: options.ClientLogMode.IsResponseWithBody(), - }, middleware.After) - if err != nil { - return err - } - - err = addSetLoggerMiddleware(stack, options) - if err != nil { - return err - } - - if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { - return fmt.Errorf("add protocol finalizers: %w", err) - } - - // Retry support - return retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{ - Retryer: options.Retryer, - LogRetryAttempts: options.ClientLogMode.IsRetries(), - }) -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -type serializeRequest struct { - GetPath func(interface{}) (string, error) - Method string -} - -func (*serializeRequest) ID() string { - return "OperationSerializer" -} - -func (m *serializeRequest) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - reqPath, err := m.GetPath(in.Parameters) - if err != nil { - return out, metadata, fmt.Errorf("unable to get request URL path, %w", err) - } - - request.Request.URL.Path = reqPath - request.Request.Method = m.Method - - return next.HandleSerialize(ctx, in) -} - -type deserializeResponse struct { - GetOutput func(*smithyhttp.Response) (interface{}, error) -} - -func (*deserializeResponse) ID() string { - return "OperationDeserializer" -} - -func (m *deserializeResponse) 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 - } - - resp, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, fmt.Errorf( - "unexpected transport response type, %T, want %T", out.RawResponse, resp) - } - defer resp.Body.Close() - - // read the full body so that any operation timeouts cleanup will not race - // the body being read. - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return out, metadata, fmt.Errorf("read response body failed, %w", err) - } - resp.Body = ioutil.NopCloser(bytes.NewReader(body)) - - // Anything that's not 200 |< 300 is error - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return out, metadata, &smithyhttp.ResponseError{ - Response: resp, - Err: fmt.Errorf("request to EC2 IMDS failed"), - } - } - - result, err := m.GetOutput(resp) - if err != nil { - return out, metadata, fmt.Errorf( - "unable to get deserialized result for response, %w", err, - ) - } - out.Result = result - - return out, metadata, err -} - -type resolveEndpoint struct { - Endpoint string - EndpointMode EndpointModeState -} - -func (*resolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *resolveEndpoint) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - var endpoint string - if len(m.Endpoint) > 0 { - endpoint = m.Endpoint - } else { - switch m.EndpointMode { - case EndpointModeStateIPv6: - endpoint = defaultIPv6Endpoint - case EndpointModeStateIPv4: - fallthrough - case EndpointModeStateUnset: - endpoint = defaultIPv4Endpoint - default: - return out, metadata, fmt.Errorf("unsupported IMDS endpoint mode") - } - } - - req.URL, err = url.Parse(endpoint) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - return next.HandleSerialize(ctx, in) -} - -const ( - defaultOperationTimeout = 5 * time.Second -) - -// operationTimeout adds a timeout on the middleware stack if the Context the -// stack was called with does not have a deadline. The next middleware must -// complete before the timeout, or the context will be canceled. -// -// If DefaultTimeout is zero, no default timeout will be used if the Context -// does not have a timeout. -// -// The next middleware must also ensure that any resources that are also -// canceled by the stack's context are completely consumed before returning. -// Otherwise the timeout cleanup will race the resource being consumed -// upstream. -type operationTimeout struct { - Disabled bool - DefaultTimeout time.Duration -} - -func (*operationTimeout) ID() string { return "OperationTimeout" } - -func (m *operationTimeout) HandleInitialize( - ctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler, -) ( - output middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.Disabled { - return next.HandleInitialize(ctx, input) - } - - if _, ok := ctx.Deadline(); !ok && m.DefaultTimeout != 0 { - var cancelFn func() - ctx, cancelFn = context.WithTimeout(ctx, m.DefaultTimeout) - defer cancelFn() - } - - return next.HandleInitialize(ctx, input) -} - -// appendURIPath joins a URI path component to the existing path with `/` -// separators between the path components. If the path being added ends with a -// trailing `/` that slash will be maintained. -func appendURIPath(base, add string) string { - reqPath := path.Join(base, add) - if len(add) != 0 && add[len(add)-1] == '/' { - reqPath += "/" - } - return reqPath -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %w", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %w", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go deleted file mode 100644 index 5703c6e16..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go +++ /dev/null @@ -1,261 +0,0 @@ -package imds - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/logging" - "net/http" - "sync" - "sync/atomic" - "time" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const ( - // Headers for Token and TTL - tokenHeader = "x-aws-ec2-metadata-token" - defaultTokenTTL = 5 * time.Minute -) - -type tokenProvider struct { - client *Client - tokenTTL time.Duration - - token *apiToken - tokenMux sync.RWMutex - - disabled uint32 // Atomic updated -} - -func newTokenProvider(client *Client, ttl time.Duration) *tokenProvider { - return &tokenProvider{ - client: client, - tokenTTL: ttl, - } -} - -// apiToken provides the API token used by all operation calls for th EC2 -// Instance metadata service. -type apiToken struct { - token string - expires time.Time -} - -var timeNow = time.Now - -// Expired returns if the token is expired. -func (t *apiToken) Expired() bool { - // Calling Round(0) on the current time will truncate the monotonic reading only. Ensures credential expiry - // time is always based on reported wall-clock time. - return timeNow().Round(0).After(t.expires) -} - -func (t *tokenProvider) ID() string { return "APITokenProvider" } - -// HandleFinalize is the finalize stack middleware, that if the token provider is -// enabled, will attempt to add the cached API token to the request. If the API -// token is not cached, it will be retrieved in a separate API call, getToken. -// -// For retry attempts, handler must be added after attempt retryer. -// -// If request for getToken fails the token provider may be disabled from future -// requests, depending on the response status code. -func (t *tokenProvider) HandleFinalize( - ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if t.fallbackEnabled() && !t.enabled() { - // short-circuits to insecure data flow if token provider is disabled. - return next.HandleFinalize(ctx, input) - } - - req, ok := input.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport request type %T", input.Request) - } - - tok, err := t.getToken(ctx) - if err != nil { - // If the error allows the token to downgrade to insecure flow allow that. - var bypassErr *bypassTokenRetrievalError - if errors.As(err, &bypassErr) { - return next.HandleFinalize(ctx, input) - } - - return out, metadata, fmt.Errorf("failed to get API token, %w", err) - } - - req.Header.Set(tokenHeader, tok.token) - - return next.HandleFinalize(ctx, input) -} - -// HandleDeserialize is the deserialize stack middleware for determining if the -// operation the token provider is decorating failed because of a 401 -// unauthorized status code. If the operation failed for that reason the token -// provider needs to be re-enabled so that it can start adding the API token to -// operation calls. -func (t *tokenProvider) HandleDeserialize( - ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, input) - if err == nil { - return out, metadata, err - } - - resp, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, fmt.Errorf("expect HTTP transport, got %T", out.RawResponse) - } - - if resp.StatusCode == http.StatusUnauthorized { // unauthorized - t.enable() - err = &retryableError{Err: err, isRetryable: true} - } - - return out, metadata, err -} - -func (t *tokenProvider) getToken(ctx context.Context) (tok *apiToken, err error) { - if t.fallbackEnabled() && !t.enabled() { - return nil, &bypassTokenRetrievalError{ - Err: fmt.Errorf("cannot get API token, provider disabled"), - } - } - - t.tokenMux.RLock() - tok = t.token - t.tokenMux.RUnlock() - - if tok != nil && !tok.Expired() { - return tok, nil - } - - tok, err = t.updateToken(ctx) - if err != nil { - return nil, err - } - - return tok, nil -} - -func (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) { - t.tokenMux.Lock() - defer t.tokenMux.Unlock() - - // Prevent multiple requests to update retrieving the token. - if t.token != nil && !t.token.Expired() { - tok := t.token - return tok, nil - } - - result, err := t.client.getToken(ctx, &getTokenInput{ - TokenTTL: t.tokenTTL, - }) - if err != nil { - var statusErr interface{ HTTPStatusCode() int } - if errors.As(err, &statusErr) { - switch statusErr.HTTPStatusCode() { - // Disable future get token if failed because of 403, 404, or 405 - case http.StatusForbidden, - http.StatusNotFound, - http.StatusMethodNotAllowed: - - if t.fallbackEnabled() { - logger := middleware.GetLogger(ctx) - logger.Logf(logging.Warn, "falling back to IMDSv1: %v", err) - t.disable() - } - - // 400 errors are terminal, and need to be upstreamed - case http.StatusBadRequest: - return nil, err - } - } - - // Disable if request send failed or timed out getting response - var re *smithyhttp.RequestSendError - var ce *smithy.CanceledError - if errors.As(err, &re) || errors.As(err, &ce) { - atomic.StoreUint32(&t.disabled, 1) - } - - if !t.fallbackEnabled() { - // NOTE: getToken() is an implementation detail of some outer operation - // (e.g. GetMetadata). It has its own retries that have already been exhausted. - // Mark the underlying error as a terminal error. - err = &retryableError{Err: err, isRetryable: false} - return nil, err - } - - // Token couldn't be retrieved, fallback to IMDSv1 insecure flow for this request - // and allow the request to proceed. Future requests _may_ re-attempt fetching a - // token if not disabled. - return nil, &bypassTokenRetrievalError{Err: err} - } - - tok := &apiToken{ - token: result.Token, - expires: timeNow().Add(result.TokenTTL), - } - t.token = tok - - return tok, nil -} - -// enabled returns if the token provider is current enabled or not. -func (t *tokenProvider) enabled() bool { - return atomic.LoadUint32(&t.disabled) == 0 -} - -// fallbackEnabled returns false if EnableFallback is [aws.FalseTernary], true otherwise -func (t *tokenProvider) fallbackEnabled() bool { - switch t.client.options.EnableFallback { - case aws.FalseTernary: - return false - default: - return true - } -} - -// disable disables the token provider and it will no longer attempt to inject -// the token, nor request updates. -func (t *tokenProvider) disable() { - atomic.StoreUint32(&t.disabled, 1) -} - -// enable enables the token provide to start refreshing tokens, and adding them -// to the pending request. -func (t *tokenProvider) enable() { - t.tokenMux.Lock() - t.token = nil - t.tokenMux.Unlock() - atomic.StoreUint32(&t.disabled, 0) -} - -type bypassTokenRetrievalError struct { - Err error -} - -func (e *bypassTokenRetrievalError) Error() string { - return fmt.Sprintf("bypass token retrieval, %v", e.Err) -} - -func (e *bypassTokenRetrievalError) Unwrap() error { return e.Err } - -type retryableError struct { - Err error - isRetryable bool -} - -func (e *retryableError) RetryableError() bool { return e.isRetryable } - -func (e *retryableError) Error() string { return e.Err.Error() } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go deleted file mode 100644 index 0b81db548..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go +++ /dev/null @@ -1,45 +0,0 @@ -package auth - -import ( - "github.com/aws/smithy-go/auth" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// HTTPAuthScheme is the SDK's internal implementation of smithyhttp.AuthScheme -// for pre-existing implementations where the signer was added to client -// config. SDK clients will key off of this type and ensure per-operation -// updates to those signers persist on the scheme itself. -type HTTPAuthScheme struct { - schemeID string - signer smithyhttp.Signer -} - -var _ smithyhttp.AuthScheme = (*HTTPAuthScheme)(nil) - -// NewHTTPAuthScheme returns an auth scheme instance with the given config. -func NewHTTPAuthScheme(schemeID string, signer smithyhttp.Signer) *HTTPAuthScheme { - return &HTTPAuthScheme{ - schemeID: schemeID, - signer: signer, - } -} - -// SchemeID identifies the auth scheme. -func (s *HTTPAuthScheme) SchemeID() string { - return s.schemeID -} - -// IdentityResolver gets the identity resolver for the auth scheme. -func (s *HTTPAuthScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { - return o.GetIdentityResolver(s.schemeID) -} - -// Signer gets the signer for the auth scheme. -func (s *HTTPAuthScheme) Signer() smithyhttp.Signer { - return s.signer -} - -// WithSigner returns a new instance of the auth scheme with the updated signer. -func (s *HTTPAuthScheme) WithSigner(signer smithyhttp.Signer) *HTTPAuthScheme { - return NewHTTPAuthScheme(s.schemeID, signer) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go deleted file mode 100644 index bbc2ec06e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go +++ /dev/null @@ -1,191 +0,0 @@ -package auth - -import ( - "context" - "fmt" - - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -// SigV4 is a constant representing -// Authentication Scheme Signature Version 4 -const SigV4 = "sigv4" - -// SigV4A is a constant representing -// Authentication Scheme Signature Version 4A -const SigV4A = "sigv4a" - -// SigV4S3Express identifies the S3 S3Express auth scheme. -const SigV4S3Express = "sigv4-s3express" - -// None is a constant representing the -// None Authentication Scheme -const None = "none" - -// SupportedSchemes is a data structure -// that indicates the list of supported AWS -// authentication schemes -var SupportedSchemes = map[string]bool{ - SigV4: true, - SigV4A: true, - SigV4S3Express: true, - None: true, -} - -// AuthenticationScheme is a representation of -// AWS authentication schemes -type AuthenticationScheme interface { - isAuthenticationScheme() -} - -// AuthenticationSchemeV4 is a AWS SigV4 representation -type AuthenticationSchemeV4 struct { - Name string - SigningName *string - SigningRegion *string - DisableDoubleEncoding *bool -} - -func (a *AuthenticationSchemeV4) isAuthenticationScheme() {} - -// AuthenticationSchemeV4A is a AWS SigV4A representation -type AuthenticationSchemeV4A struct { - Name string - SigningName *string - SigningRegionSet []string - DisableDoubleEncoding *bool -} - -func (a *AuthenticationSchemeV4A) isAuthenticationScheme() {} - -// AuthenticationSchemeNone is a representation for the none auth scheme -type AuthenticationSchemeNone struct{} - -func (a *AuthenticationSchemeNone) isAuthenticationScheme() {} - -// NoAuthenticationSchemesFoundError is used in signaling -// that no authentication schemes have been specified. -type NoAuthenticationSchemesFoundError struct{} - -func (e *NoAuthenticationSchemesFoundError) Error() string { - return fmt.Sprint("No authentication schemes specified.") -} - -// UnSupportedAuthenticationSchemeSpecifiedError is used in -// signaling that only unsupported authentication schemes -// were specified. -type UnSupportedAuthenticationSchemeSpecifiedError struct { - UnsupportedSchemes []string -} - -func (e *UnSupportedAuthenticationSchemeSpecifiedError) Error() string { - return fmt.Sprint("Unsupported authentication scheme specified.") -} - -// GetAuthenticationSchemes extracts the relevant authentication scheme data -// into a custom strongly typed Go data structure. -func GetAuthenticationSchemes(p *smithy.Properties) ([]AuthenticationScheme, error) { - var result []AuthenticationScheme - if !p.Has("authSchemes") { - return nil, &NoAuthenticationSchemesFoundError{} - } - - authSchemes, _ := p.Get("authSchemes").([]interface{}) - - var unsupportedSchemes []string - for _, scheme := range authSchemes { - authScheme, _ := scheme.(map[string]interface{}) - - version := authScheme["name"].(string) - switch version { - case SigV4, SigV4S3Express: - v4Scheme := AuthenticationSchemeV4{ - Name: version, - SigningName: getSigningName(authScheme), - SigningRegion: getSigningRegion(authScheme), - DisableDoubleEncoding: getDisableDoubleEncoding(authScheme), - } - result = append(result, AuthenticationScheme(&v4Scheme)) - case SigV4A: - v4aScheme := AuthenticationSchemeV4A{ - Name: SigV4A, - SigningName: getSigningName(authScheme), - SigningRegionSet: getSigningRegionSet(authScheme), - DisableDoubleEncoding: getDisableDoubleEncoding(authScheme), - } - result = append(result, AuthenticationScheme(&v4aScheme)) - case None: - noneScheme := AuthenticationSchemeNone{} - result = append(result, AuthenticationScheme(&noneScheme)) - default: - unsupportedSchemes = append(unsupportedSchemes, authScheme["name"].(string)) - continue - } - } - - if len(result) == 0 { - return nil, &UnSupportedAuthenticationSchemeSpecifiedError{ - UnsupportedSchemes: unsupportedSchemes, - } - } - - return result, nil -} - -type disableDoubleEncoding struct{} - -// SetDisableDoubleEncoding sets or modifies the disable double encoding option -// on the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func SetDisableDoubleEncoding(ctx context.Context, value bool) context.Context { - return middleware.WithStackValue(ctx, disableDoubleEncoding{}, value) -} - -// GetDisableDoubleEncoding retrieves the disable double encoding option -// from the context. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetDisableDoubleEncoding(ctx context.Context) (value bool, ok bool) { - value, ok = middleware.GetStackValue(ctx, disableDoubleEncoding{}).(bool) - return value, ok -} - -func getSigningName(authScheme map[string]interface{}) *string { - signingName, ok := authScheme["signingName"].(string) - if !ok || signingName == "" { - return nil - } - return &signingName -} - -func getSigningRegionSet(authScheme map[string]interface{}) []string { - untypedSigningRegionSet, ok := authScheme["signingRegionSet"].([]interface{}) - if !ok { - return nil - } - signingRegionSet := []string{} - for _, item := range untypedSigningRegionSet { - signingRegionSet = append(signingRegionSet, item.(string)) - } - return signingRegionSet -} - -func getSigningRegion(authScheme map[string]interface{}) *string { - signingRegion, ok := authScheme["signingRegion"].(string) - if !ok || signingRegion == "" { - return nil - } - return &signingRegion -} - -func getDisableDoubleEncoding(authScheme map[string]interface{}) *bool { - disableDoubleEncoding, ok := authScheme["disableDoubleEncoding"].(bool) - if !ok { - return nil - } - return &disableDoubleEncoding -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go deleted file mode 100644 index f059b5d39..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go +++ /dev/null @@ -1,43 +0,0 @@ -package smithy - -import ( - "context" - "fmt" - "time" - - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/auth/bearer" -) - -// BearerTokenAdapter adapts smithy bearer.Token to smithy auth.Identity. -type BearerTokenAdapter struct { - Token bearer.Token -} - -var _ auth.Identity = (*BearerTokenAdapter)(nil) - -// Expiration returns the time of expiration for the token. -func (v *BearerTokenAdapter) Expiration() time.Time { - return v.Token.Expires -} - -// BearerTokenProviderAdapter adapts smithy bearer.TokenProvider to smithy -// auth.IdentityResolver. -type BearerTokenProviderAdapter struct { - Provider bearer.TokenProvider -} - -var _ (auth.IdentityResolver) = (*BearerTokenProviderAdapter)(nil) - -// GetIdentity retrieves a bearer token using the underlying provider. -func (v *BearerTokenProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( - auth.Identity, error, -) { - token, err := v.Provider.RetrieveBearerToken(ctx) - if err != nil { - return nil, fmt.Errorf("get token: %w", err) - } - - return &BearerTokenAdapter{Token: token}, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go deleted file mode 100644 index a88281527..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go +++ /dev/null @@ -1,35 +0,0 @@ -package smithy - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/auth/bearer" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// BearerTokenSignerAdapter adapts smithy bearer.Signer to smithy http -// auth.Signer. -type BearerTokenSignerAdapter struct { - Signer bearer.Signer -} - -var _ (smithyhttp.Signer) = (*BearerTokenSignerAdapter)(nil) - -// SignRequest signs the request with the provided bearer token. -func (v *BearerTokenSignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, _ smithy.Properties) error { - ca, ok := identity.(*BearerTokenAdapter) - if !ok { - return fmt.Errorf("unexpected identity type: %T", identity) - } - - signed, err := v.Signer.SignWithBearerToken(ctx, ca.Token, r) - if err != nil { - return fmt.Errorf("sign request: %w", err) - } - - *r = *signed.(*smithyhttp.Request) - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go deleted file mode 100644 index f926c4aaa..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go +++ /dev/null @@ -1,46 +0,0 @@ -package smithy - -import ( - "context" - "fmt" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" -) - -// CredentialsAdapter adapts aws.Credentials to auth.Identity. -type CredentialsAdapter struct { - Credentials aws.Credentials -} - -var _ auth.Identity = (*CredentialsAdapter)(nil) - -// Expiration returns the time of expiration for the credentials. -func (v *CredentialsAdapter) Expiration() time.Time { - return v.Credentials.Expires -} - -// CredentialsProviderAdapter adapts aws.CredentialsProvider to auth.IdentityResolver. -type CredentialsProviderAdapter struct { - Provider aws.CredentialsProvider -} - -var _ (auth.IdentityResolver) = (*CredentialsProviderAdapter)(nil) - -// GetIdentity retrieves AWS credentials using the underlying provider. -func (v *CredentialsProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( - auth.Identity, error, -) { - if v.Provider == nil { - return &CredentialsAdapter{Credentials: aws.Credentials{}}, nil - } - - creds, err := v.Provider.Retrieve(ctx) - if err != nil { - return nil, fmt.Errorf("get credentials: %w", err) - } - - return &CredentialsAdapter{Credentials: creds}, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go deleted file mode 100644 index 42b458673..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package smithy adapts concrete AWS auth and signing types to the generic smithy versions. -package smithy diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go deleted file mode 100644 index 24db8e144..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go +++ /dev/null @@ -1,57 +0,0 @@ -package smithy - -import ( - "context" - "fmt" - - v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// V4SignerAdapter adapts v4.HTTPSigner to smithy http.Signer. -type V4SignerAdapter struct { - Signer v4.HTTPSigner - Logger logging.Logger - LogSigning bool -} - -var _ (smithyhttp.Signer) = (*V4SignerAdapter)(nil) - -// SignRequest signs the request with the provided identity. -func (v *V4SignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { - ca, ok := identity.(*CredentialsAdapter) - if !ok { - return fmt.Errorf("unexpected identity type: %T", identity) - } - - name, ok := smithyhttp.GetSigV4SigningName(&props) - if !ok { - return fmt.Errorf("sigv4 signing name is required") - } - - region, ok := smithyhttp.GetSigV4SigningRegion(&props) - if !ok { - return fmt.Errorf("sigv4 signing region is required") - } - - hash := v4.GetPayloadHash(ctx) - signingTime := sdk.NowTime() - skew := internalcontext.GetAttemptSkewContext(ctx) - signingTime = signingTime.Add(skew) - err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, signingTime, func(o *v4.SignerOptions) { - o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) - - o.Logger = v.Logger - o.LogSigning = v.LogSigning - }) - if err != nil { - return fmt.Errorf("sign http: %w", err) - } - - return nil -} 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 deleted file mode 100644 index b34f47c91..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ /dev/null @@ -1,455 +0,0 @@ -# v1.4.9 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.8 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.7 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.6 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.5 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.4 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.3 (2025-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.37 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.36 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.35 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.34 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.33 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.32 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.31 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.30 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.29 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.3.28 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.27 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.26 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.25 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.24 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.23 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.22 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.21 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.20 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.19 (2024-10-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.18 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.17 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.16 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.15 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.14 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.13 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.12 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.11 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.10 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.9 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.8 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.5 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.4 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2024-03-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.10 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.9 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.8 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.7 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.6 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.4 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.3 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.2 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2023-11-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.43 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.42 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.41 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.40 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.39 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.38 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.37 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.36 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.35 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.34 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.33 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.32 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.31 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.30 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.29 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.28 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.27 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.26 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.25 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.24 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.23 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.22 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.21 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.20 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.19 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.18 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.17 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.16 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.15 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.14 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.13 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.12 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.11 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.10 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.9 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.8 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.7 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.6 (2022-03-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.5 (2022-02-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.4 (2022-01-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.3 (2022-01-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.2 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.7 (2021-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.6 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.5 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.4 (2021-08-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.2 (2021-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.1 (2021-07-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.0 (2021-06-25) - -* **Release**: Release new modules -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go deleted file mode 100644 index cd4d19b89..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go +++ /dev/null @@ -1,65 +0,0 @@ -package configsources - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" -) - -// EnableEndpointDiscoveryProvider is an interface for retrieving external configuration value -// for Enable Endpoint Discovery -type EnableEndpointDiscoveryProvider interface { - GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) -} - -// ResolveEnableEndpointDiscovery extracts the first instance of a EnableEndpointDiscoveryProvider from the config slice. -// Additionally returns a aws.EndpointDiscoveryEnableState to indicate if the value was found in provided configs, -// and error if one is encountered. -func ResolveEnableEndpointDiscovery(ctx context.Context, configs []interface{}) (value aws.EndpointDiscoveryEnableState, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(EnableEndpointDiscoveryProvider); ok { - value, found, err = p.GetEnableEndpointDiscovery(ctx) - if err != nil || found { - break - } - } - } - return -} - -// UseDualStackEndpointProvider is an interface for retrieving external configuration values for UseDualStackEndpoint -type UseDualStackEndpointProvider interface { - GetUseDualStackEndpoint(context.Context) (value aws.DualStackEndpointState, found bool, err error) -} - -// ResolveUseDualStackEndpoint extracts the first instance of a UseDualStackEndpoint from the config slice. -// Additionally returns a boolean to indicate if the value was found in provided configs, and error if one is encountered. -func ResolveUseDualStackEndpoint(ctx context.Context, configs []interface{}) (value aws.DualStackEndpointState, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(UseDualStackEndpointProvider); ok { - value, found, err = p.GetUseDualStackEndpoint(ctx) - if err != nil || found { - break - } - } - } - return -} - -// UseFIPSEndpointProvider is an interface for retrieving external configuration values for UseFIPSEndpoint -type UseFIPSEndpointProvider interface { - GetUseFIPSEndpoint(context.Context) (value aws.FIPSEndpointState, found bool, err error) -} - -// ResolveUseFIPSEndpoint extracts the first instance of a UseFIPSEndpointProvider from the config slice. -// Additionally, returns a boolean to indicate if the value was found in provided configs, and error if one is encountered. -func ResolveUseFIPSEndpoint(ctx context.Context, configs []interface{}) (value aws.FIPSEndpointState, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(UseFIPSEndpointProvider); ok { - value, found, err = p.GetUseFIPSEndpoint(ctx) - if err != nil || found { - break - } - } - } - return -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go deleted file mode 100644 index e7835f852..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go +++ /dev/null @@ -1,57 +0,0 @@ -package configsources - -import ( - "context" -) - -// ServiceBaseEndpointProvider is needed to search for all providers -// that provide a configured service endpoint -type ServiceBaseEndpointProvider interface { - GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) -} - -// IgnoreConfiguredEndpointsProvider is needed to search for all providers -// that provide a flag to disable configured endpoints. -// -// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because -// service packages cannot import github.com/aws/aws-sdk-go-v2/config -// due to result import cycle error. -type IgnoreConfiguredEndpointsProvider interface { - GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -// -// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because -// service packages cannot import github.com/aws/aws-sdk-go-v2/config -// due to result import cycle error. -func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { - for _, cfg := range configs { - if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { - value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) - if err != nil || found { - break - } - } - } - return -} - -// ResolveServiceBaseEndpoint is used to retrieve service endpoints from configured sources -// while allowing for configured endpoints to be disabled -func ResolveServiceBaseEndpoint(ctx context.Context, sdkID string, configs []interface{}) (value string, found bool, err error) { - if val, found, _ := GetIgnoreConfiguredEndpoints(ctx, configs); found && val { - return "", false, nil - } - - for _, cs := range configs { - if p, ok := cs.(ServiceBaseEndpointProvider); ok { - value, found, err = p.GetServiceBaseEndpoint(context.Background(), sdkID) - if err != nil || found { - break - } - } - } - return -} 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 deleted file mode 100644 index ebc2f6a76..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package configsources - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.4.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go deleted file mode 100644 index f0c283d39..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go +++ /dev/null @@ -1,52 +0,0 @@ -package context - -import ( - "context" - "time" - - "github.com/aws/smithy-go/middleware" -) - -type s3BackendKey struct{} -type checksumInputAlgorithmKey struct{} -type clockSkew struct{} - -const ( - // S3BackendS3Express identifies the S3Express backend - S3BackendS3Express = "S3Express" -) - -// SetS3Backend stores the resolved endpoint backend within the request -// context, which is required for a variety of custom S3 behaviors. -func SetS3Backend(ctx context.Context, typ string) context.Context { - return middleware.WithStackValue(ctx, s3BackendKey{}, typ) -} - -// GetS3Backend retrieves the stored endpoint backend within the context. -func GetS3Backend(ctx context.Context) string { - v, _ := middleware.GetStackValue(ctx, s3BackendKey{}).(string) - return v -} - -// SetChecksumInputAlgorithm sets the request checksum algorithm on the -// context. -func SetChecksumInputAlgorithm(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, checksumInputAlgorithmKey{}, value) -} - -// GetChecksumInputAlgorithm returns the checksum algorithm from the context. -func GetChecksumInputAlgorithm(ctx context.Context) string { - v, _ := middleware.GetStackValue(ctx, checksumInputAlgorithmKey{}).(string) - return v -} - -// SetAttemptSkewContext sets the clock skew value on the context -func SetAttemptSkewContext(ctx context.Context, v time.Duration) context.Context { - return middleware.WithStackValue(ctx, clockSkew{}, v) -} - -// GetAttemptSkewContext gets the clock skew value from the context -func GetAttemptSkewContext(ctx context.Context) time.Duration { - x, _ := middleware.GetStackValue(ctx, clockSkew{}).(time.Duration) - return x -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go deleted file mode 100644 index e6223dd3b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go +++ /dev/null @@ -1,94 +0,0 @@ -package awsrulesfn - -import ( - "strings" -) - -// ARN provides AWS ARN components broken out into a data structure. -type ARN struct { - Partition string - Service string - Region string - AccountId string - ResourceId OptionalStringSlice -} - -const ( - arnDelimiters = ":" - resourceDelimiters = "/:" - arnSections = 6 - arnPrefix = "arn:" - - // zero-indexed - sectionPartition = 1 - sectionService = 2 - sectionRegion = 3 - sectionAccountID = 4 - sectionResource = 5 -) - -// ParseARN returns an [ARN] value parsed from the input string provided. If -// the ARN cannot be parsed nil will be returned, and error added to -// [ErrorCollector]. -func ParseARN(input string) *ARN { - if !strings.HasPrefix(input, arnPrefix) { - return nil - } - - sections := strings.SplitN(input, arnDelimiters, arnSections) - if numSections := len(sections); numSections != arnSections { - return nil - } - - if sections[sectionPartition] == "" { - return nil - } - if sections[sectionService] == "" { - return nil - } - if sections[sectionResource] == "" { - return nil - } - - return &ARN{ - Partition: sections[sectionPartition], - Service: sections[sectionService], - Region: sections[sectionRegion], - AccountId: sections[sectionAccountID], - ResourceId: splitResource(sections[sectionResource]), - } -} - -// splitResource splits the resource components by the ARN resource delimiters. -func splitResource(v string) []string { - var parts []string - var offset int - - for offset <= len(v) { - idx := strings.IndexAny(v[offset:], "/:") - if idx < 0 { - parts = append(parts, v[offset:]) - break - } - parts = append(parts, v[offset:idx+offset]) - offset += idx + 1 - } - - return parts -} - -// OptionalStringSlice provides a helper to safely get the index of a string -// slice that may be out of bounds. Returns pointer to string if index is -// valid. Otherwise returns nil. -type OptionalStringSlice []string - -// Get returns a string pointer of the string at index i if the index is valid. -// Otherwise returns nil. -func (s OptionalStringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go deleted file mode 100644 index d5a365853..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package awsrulesfn provides AWS focused endpoint rule functions for -// evaluating endpoint resolution rules. -package awsrulesfn diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go deleted file mode 100644 index df72da97c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build codegen -// +build codegen - -package awsrulesfn - -//go:generate go run -tags codegen ./internal/partition/codegen.go -model partitions.json -output partitions.go -//go:generate gofmt -w -s . diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go deleted file mode 100644 index 637e5fc18..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go +++ /dev/null @@ -1,51 +0,0 @@ -package awsrulesfn - -import ( - "net" - "strings" - - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// IsVirtualHostableS3Bucket returns if the input is a DNS compatible bucket -// name and can be used with Amazon S3 virtual hosted style addressing. Similar -// to [rulesfn.IsValidHostLabel] with the added restriction that the length of label -// must be [3:63] characters long, all lowercase, and not formatted as an IP -// address. -func IsVirtualHostableS3Bucket(input string, allowSubDomains bool) bool { - // input should not be formatted as an IP address - // NOTE: this will technically trip up on IPv6 hosts with zone IDs, but - // validation further down will catch that anyway (it's guaranteed to have - // unfriendly characters % and : if that's the case) - if net.ParseIP(input) != nil { - return false - } - - var labels []string - if allowSubDomains { - labels = strings.Split(input, ".") - } else { - labels = []string{input} - } - - for _, label := range labels { - // validate special length constraints - if l := len(label); l < 3 || l > 63 { - return false - } - - // Validate no capital letters - for _, r := range label { - if r >= 'A' && r <= 'Z' { - return false - } - } - - // Validate valid host label - if !smithyhttp.ValidHostLabel(label) { - return false - } - } - - return true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go deleted file mode 100644 index 91414afe8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go +++ /dev/null @@ -1,76 +0,0 @@ -package awsrulesfn - -import "regexp" - -// Partition provides the metadata describing an AWS partition. -type Partition struct { - ID string `json:"id"` - Regions map[string]RegionOverrides `json:"regions"` - RegionRegex string `json:"regionRegex"` - DefaultConfig PartitionConfig `json:"outputs"` -} - -// PartitionConfig provides the endpoint metadata for an AWS region or partition. -type PartitionConfig struct { - Name string `json:"name"` - DnsSuffix string `json:"dnsSuffix"` - DualStackDnsSuffix string `json:"dualStackDnsSuffix"` - SupportsFIPS bool `json:"supportsFIPS"` - SupportsDualStack bool `json:"supportsDualStack"` - ImplicitGlobalRegion string `json:"implicitGlobalRegion"` -} - -type RegionOverrides struct { - Name *string `json:"name"` - DnsSuffix *string `json:"dnsSuffix"` - DualStackDnsSuffix *string `json:"dualStackDnsSuffix"` - SupportsFIPS *bool `json:"supportsFIPS"` - SupportsDualStack *bool `json:"supportsDualStack"` -} - -const defaultPartition = "aws" - -func getPartition(partitions []Partition, region string) *PartitionConfig { - for _, partition := range partitions { - if v, ok := partition.Regions[region]; ok { - p := mergeOverrides(partition.DefaultConfig, v) - return &p - } - } - - for _, partition := range partitions { - regionRegex := regexp.MustCompile(partition.RegionRegex) - if regionRegex.MatchString(region) { - v := partition.DefaultConfig - return &v - } - } - - for _, partition := range partitions { - if partition.ID == defaultPartition { - v := partition.DefaultConfig - return &v - } - } - - return nil -} - -func mergeOverrides(into PartitionConfig, from RegionOverrides) PartitionConfig { - if from.Name != nil { - into.Name = *from.Name - } - if from.DnsSuffix != nil { - into.DnsSuffix = *from.DnsSuffix - } - if from.DualStackDnsSuffix != nil { - into.DualStackDnsSuffix = *from.DualStackDnsSuffix - } - if from.SupportsFIPS != nil { - into.SupportsFIPS = *from.SupportsFIPS - } - if from.SupportsDualStack != nil { - into.SupportsDualStack = *from.SupportsDualStack - } - return into -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go deleted file mode 100644 index 6ad5df646..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go +++ /dev/null @@ -1,489 +0,0 @@ -// Code generated by endpoint/awsrulesfn/internal/partition. DO NOT EDIT. - -package awsrulesfn - -// GetPartition returns an AWS [Partition] for the region provided. If the -// partition cannot be determined then the default partition (AWS commercial) -// will be returned. -func GetPartition(region string) *PartitionConfig { - return getPartition(partitions, region) -} - -var partitions = []Partition{ - { - ID: "aws", - RegionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws", - DnsSuffix: "amazonaws.com", - DualStackDnsSuffix: "api.aws", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "us-east-1", - }, - Regions: map[string]RegionOverrides{ - "af-south-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-east-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-northeast-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-northeast-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-northeast-3": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-south-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-south-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-3": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-4": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-5": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-6": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ap-southeast-7": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "aws-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ca-central-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "ca-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-central-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-central-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-north-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-south-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-south-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-west-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-west-3": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "il-central-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "me-central-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "me-south-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "mx-central-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "sa-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-east-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-west-2": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-cn", - RegionRegex: "^cn\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-cn", - DnsSuffix: "amazonaws.com.cn", - DualStackDnsSuffix: "api.amazonwebservices.com.cn", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "cn-northwest-1", - }, - Regions: map[string]RegionOverrides{ - "aws-cn-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "cn-north-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "cn-northwest-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-eusc", - RegionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-eusc", - DnsSuffix: "amazonaws.eu", - DualStackDnsSuffix: "api.amazonwebservices.eu", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "eusc-de-east-1", - }, - Regions: map[string]RegionOverrides{ - "eusc-de-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-iso", - RegionRegex: "^us\\-iso\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-iso", - DnsSuffix: "c2s.ic.gov", - DualStackDnsSuffix: "api.aws.ic.gov", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "us-iso-east-1", - }, - Regions: map[string]RegionOverrides{ - "aws-iso-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-iso-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-iso-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-iso-b", - RegionRegex: "^us\\-isob\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-iso-b", - DnsSuffix: "sc2s.sgov.gov", - DualStackDnsSuffix: "api.aws.scloud", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "us-isob-east-1", - }, - Regions: map[string]RegionOverrides{ - "aws-iso-b-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-isob-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-iso-e", - RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-iso-e", - DnsSuffix: "cloud.adc-e.uk", - DualStackDnsSuffix: "api.cloud-aws.adc-e.uk", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "eu-isoe-west-1", - }, - Regions: map[string]RegionOverrides{ - "aws-iso-e-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "eu-isoe-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-iso-f", - RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-iso-f", - DnsSuffix: "csp.hci.ic.gov", - DualStackDnsSuffix: "api.aws.hci.ic.gov", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "us-isof-south-1", - }, - Regions: map[string]RegionOverrides{ - "aws-iso-f-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-isof-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-isof-south-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, - { - ID: "aws-us-gov", - RegionRegex: "^us\\-gov\\-\\w+\\-\\d+$", - DefaultConfig: PartitionConfig{ - Name: "aws-us-gov", - DnsSuffix: "amazonaws.com", - DualStackDnsSuffix: "api.aws", - SupportsFIPS: true, - SupportsDualStack: true, - ImplicitGlobalRegion: "us-gov-west-1", - }, - Regions: map[string]RegionOverrides{ - "aws-us-gov-global": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-gov-east-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - "us-gov-west-1": { - Name: nil, - DnsSuffix: nil, - DualStackDnsSuffix: nil, - SupportsFIPS: nil, - SupportsDualStack: nil, - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json deleted file mode 100644 index b346b0be9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "partitions" : [ { - "id" : "aws", - "outputs" : { - "dnsSuffix" : "amazonaws.com", - "dualStackDnsSuffix" : "api.aws", - "implicitGlobalRegion" : "us-east-1", - "name" : "aws", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", - "regions" : { - "af-south-1" : { - "description" : "Africa (Cape Town)" - }, - "ap-east-1" : { - "description" : "Asia Pacific (Hong Kong)" - }, - "ap-east-2" : { - "description" : "Asia Pacific (Taipei)" - }, - "ap-northeast-1" : { - "description" : "Asia Pacific (Tokyo)" - }, - "ap-northeast-2" : { - "description" : "Asia Pacific (Seoul)" - }, - "ap-northeast-3" : { - "description" : "Asia Pacific (Osaka)" - }, - "ap-south-1" : { - "description" : "Asia Pacific (Mumbai)" - }, - "ap-south-2" : { - "description" : "Asia Pacific (Hyderabad)" - }, - "ap-southeast-1" : { - "description" : "Asia Pacific (Singapore)" - }, - "ap-southeast-2" : { - "description" : "Asia Pacific (Sydney)" - }, - "ap-southeast-3" : { - "description" : "Asia Pacific (Jakarta)" - }, - "ap-southeast-4" : { - "description" : "Asia Pacific (Melbourne)" - }, - "ap-southeast-5" : { - "description" : "Asia Pacific (Malaysia)" - }, - "ap-southeast-6" : { - "description" : "Asia Pacific (New Zealand)" - }, - "ap-southeast-7" : { - "description" : "Asia Pacific (Thailand)" - }, - "aws-global" : { - "description" : "aws global region" - }, - "ca-central-1" : { - "description" : "Canada (Central)" - }, - "ca-west-1" : { - "description" : "Canada West (Calgary)" - }, - "eu-central-1" : { - "description" : "Europe (Frankfurt)" - }, - "eu-central-2" : { - "description" : "Europe (Zurich)" - }, - "eu-north-1" : { - "description" : "Europe (Stockholm)" - }, - "eu-south-1" : { - "description" : "Europe (Milan)" - }, - "eu-south-2" : { - "description" : "Europe (Spain)" - }, - "eu-west-1" : { - "description" : "Europe (Ireland)" - }, - "eu-west-2" : { - "description" : "Europe (London)" - }, - "eu-west-3" : { - "description" : "Europe (Paris)" - }, - "il-central-1" : { - "description" : "Israel (Tel Aviv)" - }, - "me-central-1" : { - "description" : "Middle East (UAE)" - }, - "me-south-1" : { - "description" : "Middle East (Bahrain)" - }, - "mx-central-1" : { - "description" : "Mexico (Central)" - }, - "sa-east-1" : { - "description" : "South America (Sao Paulo)" - }, - "us-east-1" : { - "description" : "US East (N. Virginia)" - }, - "us-east-2" : { - "description" : "US East (Ohio)" - }, - "us-west-1" : { - "description" : "US West (N. California)" - }, - "us-west-2" : { - "description" : "US West (Oregon)" - } - } - }, { - "id" : "aws-cn", - "outputs" : { - "dnsSuffix" : "amazonaws.com.cn", - "dualStackDnsSuffix" : "api.amazonwebservices.com.cn", - "implicitGlobalRegion" : "cn-northwest-1", - "name" : "aws-cn", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^cn\\-\\w+\\-\\d+$", - "regions" : { - "aws-cn-global" : { - "description" : "aws-cn global region" - }, - "cn-north-1" : { - "description" : "China (Beijing)" - }, - "cn-northwest-1" : { - "description" : "China (Ningxia)" - } - } - }, { - "id" : "aws-eusc", - "outputs" : { - "dnsSuffix" : "amazonaws.eu", - "dualStackDnsSuffix" : "api.amazonwebservices.eu", - "implicitGlobalRegion" : "eusc-de-east-1", - "name" : "aws-eusc", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^eusc\\-(de)\\-\\w+\\-\\d+$", - "regions" : { - "eusc-de-east-1" : { - "description" : "EU (Germany)" - } - } - }, { - "id" : "aws-iso", - "outputs" : { - "dnsSuffix" : "c2s.ic.gov", - "dualStackDnsSuffix" : "api.aws.ic.gov", - "implicitGlobalRegion" : "us-iso-east-1", - "name" : "aws-iso", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^us\\-iso\\-\\w+\\-\\d+$", - "regions" : { - "aws-iso-global" : { - "description" : "aws-iso global region" - }, - "us-iso-east-1" : { - "description" : "US ISO East" - }, - "us-iso-west-1" : { - "description" : "US ISO WEST" - } - } - }, { - "id" : "aws-iso-b", - "outputs" : { - "dnsSuffix" : "sc2s.sgov.gov", - "dualStackDnsSuffix" : "api.aws.scloud", - "implicitGlobalRegion" : "us-isob-east-1", - "name" : "aws-iso-b", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^us\\-isob\\-\\w+\\-\\d+$", - "regions" : { - "aws-iso-b-global" : { - "description" : "aws-iso-b global region" - }, - "us-isob-east-1" : { - "description" : "US ISOB East (Ohio)" - } - } - }, { - "id" : "aws-iso-e", - "outputs" : { - "dnsSuffix" : "cloud.adc-e.uk", - "dualStackDnsSuffix" : "api.cloud-aws.adc-e.uk", - "implicitGlobalRegion" : "eu-isoe-west-1", - "name" : "aws-iso-e", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$", - "regions" : { - "aws-iso-e-global" : { - "description" : "aws-iso-e global region" - }, - "eu-isoe-west-1" : { - "description" : "EU ISOE West" - } - } - }, { - "id" : "aws-iso-f", - "outputs" : { - "dnsSuffix" : "csp.hci.ic.gov", - "dualStackDnsSuffix" : "api.aws.hci.ic.gov", - "implicitGlobalRegion" : "us-isof-south-1", - "name" : "aws-iso-f", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$", - "regions" : { - "aws-iso-f-global" : { - "description" : "aws-iso-f global region" - }, - "us-isof-east-1" : { - "description" : "US ISOF EAST" - }, - "us-isof-south-1" : { - "description" : "US ISOF SOUTH" - } - } - }, { - "id" : "aws-us-gov", - "outputs" : { - "dnsSuffix" : "amazonaws.com", - "dualStackDnsSuffix" : "api.aws", - "implicitGlobalRegion" : "us-gov-west-1", - "name" : "aws-us-gov", - "supportsDualStack" : true, - "supportsFIPS" : true - }, - "regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$", - "regions" : { - "aws-us-gov-global" : { - "description" : "aws-us-gov global region" - }, - "us-gov-east-1" : { - "description" : "AWS GovCloud (US-East)" - }, - "us-gov-west-1" : { - "description" : "AWS GovCloud (US-West)" - } - } - } ], - "version" : "1.1" -} \ No newline at end of file diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go deleted file mode 100644 index 67950ca36..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go +++ /dev/null @@ -1,201 +0,0 @@ -package endpoints - -import ( - "fmt" - "regexp" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -const ( - defaultProtocol = "https" - defaultSigner = "v4" -) - -var ( - protocolPriority = []string{"https", "http"} - signerPriority = []string{"v4"} -) - -// Options provide configuration needed to direct how endpoints are resolved. -type Options struct { - // Disable usage of HTTPS (TLS / SSL) - DisableHTTPS bool -} - -// Partitions is a slice of partition -type Partitions []Partition - -// ResolveEndpoint resolves a service endpoint for the given region and options. -func (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) { - if len(ps) == 0 { - return aws.Endpoint{}, fmt.Errorf("no partitions found") - } - - for i := 0; i < len(ps); i++ { - if !ps[i].canResolveEndpoint(region) { - continue - } - - return ps[i].ResolveEndpoint(region, opts) - } - - // fallback to first partition format to use when resolving the endpoint. - return ps[0].ResolveEndpoint(region, opts) -} - -// Partition is an AWS partition description for a service and its' region endpoints. -type Partition struct { - ID string - RegionRegex *regexp.Regexp - PartitionEndpoint string - IsRegionalized bool - Defaults Endpoint - Endpoints Endpoints -} - -func (p Partition) canResolveEndpoint(region string) bool { - _, ok := p.Endpoints[region] - return ok || p.RegionRegex.MatchString(region) -} - -// ResolveEndpoint resolves and service endpoint for the given region and options. -func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) { - if len(region) == 0 && len(p.PartitionEndpoint) != 0 { - region = p.PartitionEndpoint - } - - e, _ := p.endpointForRegion(region) - - return e.resolve(p.ID, region, p.Defaults, options), nil -} - -func (p Partition) endpointForRegion(region string) (Endpoint, bool) { - if e, ok := p.Endpoints[region]; ok { - return e, true - } - - if !p.IsRegionalized { - return p.Endpoints[p.PartitionEndpoint], region == p.PartitionEndpoint - } - - // Unable to find any matching endpoint, return - // blank that will be used for generic endpoint creation. - return Endpoint{}, false -} - -// Endpoints is a map of service config regions to endpoints -type Endpoints map[string]Endpoint - -// CredentialScope is the credential scope of a region and service -type CredentialScope struct { - Region string - Service string -} - -// Endpoint is a service endpoint description -type Endpoint struct { - // True if the endpoint cannot be resolved for this partition/region/service - Unresolveable aws.Ternary - - Hostname string - Protocols []string - - CredentialScope CredentialScope - - SignatureVersions []string `json:"signatureVersions"` -} - -func (e Endpoint) resolve(partition, region string, def Endpoint, options Options) aws.Endpoint { - var merged Endpoint - merged.mergeIn(def) - merged.mergeIn(e) - e = merged - - var u string - if e.Unresolveable != aws.TrueTernary { - // Only attempt to resolve the endpoint if it can be resolved. - hostname := strings.Replace(e.Hostname, "{region}", region, 1) - - scheme := getEndpointScheme(e.Protocols, options.DisableHTTPS) - u = scheme + "://" + hostname - } - - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - signingName := e.CredentialScope.Service - - return aws.Endpoint{ - URL: u, - PartitionID: partition, - SigningRegion: signingRegion, - SigningName: signingName, - SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), - } -} - -func (e *Endpoint) mergeIn(other Endpoint) { - if other.Unresolveable != aws.UnknownTernary { - e.Unresolveable = other.Unresolveable - } - if len(other.Hostname) > 0 { - e.Hostname = other.Hostname - } - if len(other.Protocols) > 0 { - e.Protocols = other.Protocols - } - if len(other.CredentialScope.Region) > 0 { - e.CredentialScope.Region = other.CredentialScope.Region - } - if len(other.CredentialScope.Service) > 0 { - e.CredentialScope.Service = other.CredentialScope.Service - } - if len(other.SignatureVersions) > 0 { - e.SignatureVersions = other.SignatureVersions - } -} - -func getEndpointScheme(protocols []string, disableHTTPS bool) string { - if disableHTTPS { - return "http" - } - - return getByPriority(protocols, protocolPriority, defaultProtocol) -} - -func getByPriority(s []string, p []string, def string) string { - if len(s) == 0 { - return def - } - - for i := 0; i < len(p); i++ { - for j := 0; j < len(s); j++ { - if s[j] == p[i] { - return s[j] - } - } - } - - return s[0] -} - -// MapFIPSRegion extracts the intrinsic AWS region from one that may have an -// embedded FIPS microformat. -func MapFIPSRegion(region string) string { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(region, fipsInfix) || - strings.Contains(region, fipsPrefix) || - strings.Contains(region, fipsSuffix) { - region = strings.ReplaceAll(region, fipsInfix, "-") - region = strings.ReplaceAll(region, fipsPrefix, "") - region = strings.ReplaceAll(region, fipsSuffix, "") - } - - return region -} 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 deleted file mode 100644 index 8de3bfec8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ /dev/null @@ -1,430 +0,0 @@ -# v2.7.9 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.8 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.7 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.6 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.5 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.4 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.3 (2025-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.2 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.7.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.37 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.36 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.35 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.34 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.33 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.32 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.31 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.30 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.29 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v2.6.28 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.27 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.26 (2024-12-19) - -* **Bug Fix**: Fix improper use of printf-style functions. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.25 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.24 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.23 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.22 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.21 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.20 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.19 (2024-10-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.18 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.17 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.16 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.15 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.14 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.13 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.12 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.11 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.10 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.9 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.8 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.5 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.4 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.3 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.2 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.1 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.6.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.10 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.9 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.8 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.7 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.6 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.4 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.3 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.2 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.1 (2023-11-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.5.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.37 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.36 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.35 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.34 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.33 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.32 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.31 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.30 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.29 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.28 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.27 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.26 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.25 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.24 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.23 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.22 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.19 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.4.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.3.0 (2022-02-24) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.2.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.1.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.0.2 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.0.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v2.0.0 (2021-11-06) - -* **Release**: Endpoint Variant Model Support -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go deleted file mode 100644 index 32251a7e3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go +++ /dev/null @@ -1,302 +0,0 @@ -package endpoints - -import ( - "fmt" - "github.com/aws/smithy-go/logging" - "regexp" - "strings" - - "github.com/aws/aws-sdk-go-v2/aws" -) - -// DefaultKey is a compound map key of a variant and other values. -type DefaultKey struct { - Variant EndpointVariant - ServiceVariant ServiceVariant -} - -// EndpointKey is a compound map key of a region and associated variant value. -type EndpointKey struct { - Region string - Variant EndpointVariant - ServiceVariant ServiceVariant -} - -// EndpointVariant is a bit field to describe the endpoints attributes. -type EndpointVariant uint64 - -const ( - // FIPSVariant indicates that the endpoint is FIPS capable. - FIPSVariant EndpointVariant = 1 << (64 - 1 - iota) - - // DualStackVariant indicates that the endpoint is DualStack capable. - DualStackVariant -) - -// ServiceVariant is a bit field to describe the service endpoint attributes. -type ServiceVariant uint64 - -const ( - defaultProtocol = "https" - defaultSigner = "v4" -) - -var ( - protocolPriority = []string{"https", "http"} - signerPriority = []string{"v4", "s3v4"} -) - -// Options provide configuration needed to direct how endpoints are resolved. -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the provided logger. - LogDeprecated bool - - // ResolvedRegion is the resolved region string. If provided (non-zero length) it takes priority - // over the region name passed to the ResolveEndpoint call. - ResolvedRegion string - - // Disable usage of HTTPS (TLS / SSL) - DisableHTTPS bool - - // Instruct the resolver to use a service endpoint that supports dual-stack. - // If a service does not have a dual-stack endpoint an error will be returned by the resolver. - UseDualStackEndpoint aws.DualStackEndpointState - - // Instruct the resolver to use a service endpoint that supports FIPS. - // If a service does not have a FIPS endpoint an error will be returned by the resolver. - UseFIPSEndpoint aws.FIPSEndpointState - - // ServiceVariant is a bitfield of service specified endpoint variant data. - ServiceVariant ServiceVariant -} - -// GetEndpointVariant returns the EndpointVariant for the variant associated options. -func (o Options) GetEndpointVariant() (v EndpointVariant) { - if o.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled { - v |= DualStackVariant - } - if o.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled { - v |= FIPSVariant - } - return v -} - -// Partitions is a slice of partition -type Partitions []Partition - -// ResolveEndpoint resolves a service endpoint for the given region and options. -func (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) { - if len(ps) == 0 { - return aws.Endpoint{}, fmt.Errorf("no partitions found") - } - - if opts.Logger == nil { - opts.Logger = logging.Nop{} - } - - if len(opts.ResolvedRegion) > 0 { - region = opts.ResolvedRegion - } - - for i := 0; i < len(ps); i++ { - if !ps[i].canResolveEndpoint(region, opts) { - continue - } - - return ps[i].ResolveEndpoint(region, opts) - } - - // fallback to first partition format to use when resolving the endpoint. - return ps[0].ResolveEndpoint(region, opts) -} - -// Partition is an AWS partition description for a service and its' region endpoints. -type Partition struct { - ID string - RegionRegex *regexp.Regexp - PartitionEndpoint string - IsRegionalized bool - Defaults map[DefaultKey]Endpoint - Endpoints Endpoints -} - -func (p Partition) canResolveEndpoint(region string, opts Options) bool { - _, ok := p.Endpoints[EndpointKey{ - Region: region, - Variant: opts.GetEndpointVariant(), - }] - return ok || p.RegionRegex.MatchString(region) -} - -// ResolveEndpoint resolves and service endpoint for the given region and options. -func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) { - if len(region) == 0 && len(p.PartitionEndpoint) != 0 { - region = p.PartitionEndpoint - } - - endpoints := p.Endpoints - - variant := options.GetEndpointVariant() - serviceVariant := options.ServiceVariant - - defaults := p.Defaults[DefaultKey{ - Variant: variant, - ServiceVariant: serviceVariant, - }] - - return p.endpointForRegion(region, variant, serviceVariant, endpoints).resolve(p.ID, region, defaults, options) -} - -func (p Partition) endpointForRegion(region string, variant EndpointVariant, serviceVariant ServiceVariant, endpoints Endpoints) Endpoint { - key := EndpointKey{ - Region: region, - Variant: variant, - } - - if e, ok := endpoints[key]; ok { - return e - } - - if !p.IsRegionalized { - return endpoints[EndpointKey{ - Region: p.PartitionEndpoint, - Variant: variant, - ServiceVariant: serviceVariant, - }] - } - - // Unable to find any matching endpoint, return - // blank that will be used for generic endpoint creation. - return Endpoint{} -} - -// Endpoints is a map of service config regions to endpoints -type Endpoints map[EndpointKey]Endpoint - -// CredentialScope is the credential scope of a region and service -type CredentialScope struct { - Region string - Service string -} - -// Endpoint is a service endpoint description -type Endpoint struct { - // True if the endpoint cannot be resolved for this partition/region/service - Unresolveable aws.Ternary - - Hostname string - Protocols []string - - CredentialScope CredentialScope - - SignatureVersions []string - - // Indicates that this endpoint is deprecated. - Deprecated aws.Ternary -} - -// IsZero returns whether the endpoint structure is an empty (zero) value. -func (e Endpoint) IsZero() bool { - switch { - case e.Unresolveable != aws.UnknownTernary: - return false - case len(e.Hostname) != 0: - return false - case len(e.Protocols) != 0: - return false - case e.CredentialScope != (CredentialScope{}): - return false - case len(e.SignatureVersions) != 0: - return false - } - return true -} - -func (e Endpoint) resolve(partition, region string, def Endpoint, options Options) (aws.Endpoint, error) { - var merged Endpoint - merged.mergeIn(def) - merged.mergeIn(e) - e = merged - - if e.IsZero() { - return aws.Endpoint{}, fmt.Errorf("unable to resolve endpoint for region: %v", region) - } - - var u string - if e.Unresolveable != aws.TrueTernary { - // Only attempt to resolve the endpoint if it can be resolved. - hostname := strings.Replace(e.Hostname, "{region}", region, 1) - - scheme := getEndpointScheme(e.Protocols, options.DisableHTTPS) - u = scheme + "://" + hostname - } - - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - signingName := e.CredentialScope.Service - - if e.Deprecated == aws.TrueTernary && options.LogDeprecated { - options.Logger.Logf(logging.Warn, "endpoint identifier %q, url %q marked as deprecated", region, u) - } - - return aws.Endpoint{ - URL: u, - PartitionID: partition, - SigningRegion: signingRegion, - SigningName: signingName, - SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), - }, nil -} - -func (e *Endpoint) mergeIn(other Endpoint) { - if other.Unresolveable != aws.UnknownTernary { - e.Unresolveable = other.Unresolveable - } - if len(other.Hostname) > 0 { - e.Hostname = other.Hostname - } - if len(other.Protocols) > 0 { - e.Protocols = other.Protocols - } - if len(other.CredentialScope.Region) > 0 { - e.CredentialScope.Region = other.CredentialScope.Region - } - if len(other.CredentialScope.Service) > 0 { - e.CredentialScope.Service = other.CredentialScope.Service - } - if len(other.SignatureVersions) > 0 { - e.SignatureVersions = other.SignatureVersions - } - if other.Deprecated != aws.UnknownTernary { - e.Deprecated = other.Deprecated - } -} - -func getEndpointScheme(protocols []string, disableHTTPS bool) string { - if disableHTTPS { - return "http" - } - - return getByPriority(protocols, protocolPriority, defaultProtocol) -} - -func getByPriority(s []string, p []string, def string) string { - if len(s) == 0 { - return def - } - - for i := 0; i < len(p); i++ { - for j := 0; j < len(s); j++ { - if s[j] == p[i] { - return s[j] - } - } - } - - return s[0] -} 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 deleted file mode 100644 index c5168da33..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package endpoints - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "2.7.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md deleted file mode 100644 index f729db535..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ /dev/null @@ -1,283 +0,0 @@ -# v1.8.3 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 - -# v1.8.2 (2025-01-24) - -* **Bug Fix**: Refactor filepath.Walk to filepath.WalkDir - -# v1.8.1 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. - -# v1.8.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. - -# v1.7.3 (2024-01-22) - -* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. - -# v1.7.2 (2023-12-08) - -* **Bug Fix**: Correct loading of [services *] sections into shared config. - -# v1.7.1 (2023-11-16) - -* **Bug Fix**: Fix recognition of trailing comments in shared config properties. # or ; separators that aren't preceded by whitespace at the end of a property value should be considered part of it. - -# v1.7.0 (2023-11-13) - -* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. - -# v1.6.0 (2023-11-09.2) - -* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored - -# v1.5.2 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2023-11-07) - -* **Bug Fix**: Fix subproperty performance regression - -# v1.5.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.45 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.44 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.43 (2023-09-22) - -* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. -* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. - -# v1.3.42 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.41 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.40 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.39 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.38 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.37 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.36 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.35 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.34 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.33 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.32 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.31 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.30 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.29 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.28 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.27 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.26 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.25 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.24 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.23 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.22 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.21 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.20 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.19 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.18 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.17 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.16 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.15 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.14 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.13 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.12 (2022-05-17) - -* **Bug Fix**: Removes the fuzz testing files from the module, as they are invalid and not used. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.11 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.10 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.9 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.8 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.7 (2022-03-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.6 (2022-02-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.5 (2022-01-28) - -* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. - -# v1.3.4 (2022-01-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2022-01-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.5 (2021-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.4 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.3 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.2 (2021-08-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-08-04) - -* **Feature**: adds error handling for defered close calls -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.1 (2021-07-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.0 (2021-07-01) - -* **Feature**: Support for `:`, `=`, `[`, `]` being present in expression values. - -# v1.0.1 (2021-06-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.0 (2021-05-20) - -* **Release**: The `github.com/aws/aws-sdk-go-v2/internal/ini` package is now a Go Module. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go deleted file mode 100644 index 0f278d55e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go +++ /dev/null @@ -1,22 +0,0 @@ -package ini - -import "fmt" - -// UnableToReadFile is an error indicating that a ini file could not be read -type UnableToReadFile struct { - Err error -} - -// Error returns an error message and the underlying error message if present -func (e *UnableToReadFile) Error() string { - base := "unable to read file" - if e.Err == nil { - return base - } - return fmt.Sprintf("%s: %v", base, e.Err) -} - -// Unwrap returns the underlying error -func (e *UnableToReadFile) Unwrap() error { - return e.Err -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go deleted file mode 100644 index 00df0e3cb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package ini - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.8.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go deleted file mode 100644 index cefcce91e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go +++ /dev/null @@ -1,56 +0,0 @@ -// Package ini implements parsing of the AWS shared config file. -// -// Example: -// sections, err := ini.OpenFile("/path/to/file") -// if err != nil { -// panic(err) -// } -// -// profile := "foo" -// section, ok := sections.GetSection(profile) -// if !ok { -// fmt.Printf("section %q could not be found", profile) -// } -package ini - -import ( - "fmt" - "io" - "os" - "strings" -) - -// OpenFile parses shared config from the given file path. -func OpenFile(path string) (sections Sections, err error) { - f, oerr := os.Open(path) - if oerr != nil { - return Sections{}, &UnableToReadFile{Err: oerr} - } - - defer func() { - closeErr := f.Close() - if err == nil { - err = closeErr - } else if closeErr != nil { - err = fmt.Errorf("close error: %v, original error: %w", closeErr, err) - } - }() - - return Parse(f, path) -} - -// Parse parses shared config from the given reader. -func Parse(r io.Reader, path string) (Sections, error) { - contents, err := io.ReadAll(r) - if err != nil { - return Sections{}, fmt.Errorf("read all: %v", err) - } - - lines := strings.Split(string(contents), "\n") - tokens, err := tokenize(lines) - if err != nil { - return Sections{}, fmt.Errorf("tokenize: %v", err) - } - - return parse(tokens, path), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go deleted file mode 100644 index 2422d9046..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go +++ /dev/null @@ -1,109 +0,0 @@ -package ini - -import ( - "fmt" - "strings" -) - -func parse(tokens []lineToken, path string) Sections { - parser := &parser{ - path: path, - sections: NewSections(), - } - parser.parse(tokens) - return parser.sections -} - -type parser struct { - csection, ckey string // current state - path string // source file path - sections Sections // parse result -} - -func (p *parser) parse(tokens []lineToken) { - for _, otok := range tokens { - switch tok := otok.(type) { - case *lineTokenProfile: - p.handleProfile(tok) - case *lineTokenProperty: - p.handleProperty(tok) - case *lineTokenSubProperty: - p.handleSubProperty(tok) - case *lineTokenContinuation: - p.handleContinuation(tok) - } - } -} - -func (p *parser) handleProfile(tok *lineTokenProfile) { - name := tok.Name - if tok.Type != "" { - name = fmt.Sprintf("%s %s", tok.Type, tok.Name) - } - p.ckey = "" - p.csection = name - if _, ok := p.sections.container[name]; !ok { - p.sections.container[name] = NewSection(name) - } -} - -func (p *parser) handleProperty(tok *lineTokenProperty) { - if p.csection == "" { - return // LEGACY: don't error on "global" properties - } - - p.ckey = tok.Key - if _, ok := p.sections.container[p.csection].values[tok.Key]; ok { - section := p.sections.container[p.csection] - section.Logs = append(p.sections.container[p.csection].Logs, - fmt.Sprintf( - "For profile: %v, overriding %v value, with a %v value found in a duplicate profile defined later in the same file %v. \n", - p.csection, tok.Key, tok.Key, p.path, - ), - ) - p.sections.container[p.csection] = section - } - - p.sections.container[p.csection].values[tok.Key] = Value{ - str: tok.Value, - } - p.sections.container[p.csection].SourceFile[tok.Key] = p.path -} - -func (p *parser) handleSubProperty(tok *lineTokenSubProperty) { - if p.csection == "" { - return // LEGACY: don't error on "global" properties - } - - if p.ckey == "" || p.sections.container[p.csection].values[p.ckey].str != "" { - // This is an "orphaned" subproperty, either because it's at - // the beginning of a section or because the last property's - // value isn't empty. Either way we're lenient here and - // "promote" this to a normal property. - p.handleProperty(&lineTokenProperty{ - Key: tok.Key, - Value: strings.TrimSpace(trimPropertyComment(tok.Value)), - }) - return - } - - if p.sections.container[p.csection].values[p.ckey].mp == nil { - p.sections.container[p.csection].values[p.ckey] = Value{ - mp: map[string]string{}, - } - } - p.sections.container[p.csection].values[p.ckey].mp[tok.Key] = tok.Value -} - -func (p *parser) handleContinuation(tok *lineTokenContinuation) { - if p.ckey == "" { - return - } - - value, _ := p.sections.container[p.csection].values[p.ckey] - if value.str != "" && value.mp == nil { - value.str = fmt.Sprintf("%s\n%s", value.str, tok.Value) - } - - p.sections.container[p.csection].values[p.ckey] = value -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go deleted file mode 100644 index dd89848e6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go +++ /dev/null @@ -1,157 +0,0 @@ -package ini - -import ( - "sort" -) - -// Sections is a map of Section structures that represent -// a configuration. -type Sections struct { - container map[string]Section -} - -// NewSections returns empty ini Sections -func NewSections() Sections { - return Sections{ - container: make(map[string]Section, 0), - } -} - -// GetSection will return section p. If section p does not exist, -// false will be returned in the second parameter. -func (t Sections) GetSection(p string) (Section, bool) { - v, ok := t.container[p] - return v, ok -} - -// HasSection denotes if Sections consist of a section with -// provided name. -func (t Sections) HasSection(p string) bool { - _, ok := t.container[p] - return ok -} - -// SetSection sets a section value for provided section name. -func (t Sections) SetSection(p string, v Section) Sections { - t.container[p] = v - return t -} - -// DeleteSection deletes a section entry/value for provided section name./ -func (t Sections) DeleteSection(p string) { - delete(t.container, p) -} - -// values represents a map of union values. -type values map[string]Value - -// List will return a list of all sections that were successfully -// parsed. -func (t Sections) List() []string { - keys := make([]string, len(t.container)) - i := 0 - for k := range t.container { - keys[i] = k - i++ - } - - sort.Strings(keys) - return keys -} - -// Section contains a name and values. This represent -// a sectioned entry in a configuration file. -type Section struct { - // Name is the Section profile name - Name string - - // values are the values within parsed profile - values values - - // Errors is the list of errors - Errors []error - - // Logs is the list of logs - Logs []string - - // SourceFile is the INI Source file from where this section - // was retrieved. They key is the property, value is the - // source file the property was retrieved from. - SourceFile map[string]string -} - -// NewSection returns an initialize section for the name -func NewSection(name string) Section { - return Section{ - Name: name, - values: values{}, - SourceFile: map[string]string{}, - } -} - -// List will return a list of all -// services in values -func (t Section) List() []string { - keys := make([]string, len(t.values)) - i := 0 - for k := range t.values { - keys[i] = k - i++ - } - - sort.Strings(keys) - return keys -} - -// UpdateSourceFile updates source file for a property to provided filepath. -func (t Section) UpdateSourceFile(property string, filepath string) { - t.SourceFile[property] = filepath -} - -// UpdateValue updates value for a provided key with provided value -func (t Section) UpdateValue(k string, v Value) error { - t.values[k] = v - return nil -} - -// Has will return whether or not an entry exists in a given section -func (t Section) Has(k string) bool { - _, ok := t.values[k] - return ok -} - -// ValueType will returned what type the union is set to. If -// k was not found, the NoneType will be returned. -func (t Section) ValueType(k string) (ValueType, bool) { - v, ok := t.values[k] - return v.Type, ok -} - -// Bool returns a bool value at k -func (t Section) Bool(k string) (bool, bool) { - return t.values[k].BoolValue() -} - -// Int returns an integer value at k -func (t Section) Int(k string) (int64, bool) { - return t.values[k].IntValue() -} - -// Map returns a map value at k -func (t Section) Map(k string) map[string]string { - return t.values[k].MapValue() -} - -// Float64 returns a float value at k -func (t Section) Float64(k string) (float64, bool) { - return t.values[k].FloatValue() -} - -// String returns the string value at k -func (t Section) String(k string) string { - _, ok := t.values[k] - if !ok { - return "" - } - return t.values[k].StringValue() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go deleted file mode 100644 index ed77d0835..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go +++ /dev/null @@ -1,89 +0,0 @@ -package ini - -import ( - "strings" -) - -func trimProfileComment(s string) string { - r, _, _ := strings.Cut(s, "#") - r, _, _ = strings.Cut(r, ";") - return r -} - -func trimPropertyComment(s string) string { - r, _, _ := strings.Cut(s, " #") - r, _, _ = strings.Cut(r, " ;") - r, _, _ = strings.Cut(r, "\t#") - r, _, _ = strings.Cut(r, "\t;") - return r -} - -// assumes no surrounding comment -func splitProperty(s string) (string, string, bool) { - equalsi := strings.Index(s, "=") - coloni := strings.Index(s, ":") // LEGACY: also supported for property assignment - sep := "=" - if equalsi == -1 || coloni != -1 && coloni < equalsi { - sep = ":" - } - - k, v, ok := strings.Cut(s, sep) - if !ok { - return "", "", false - } - return strings.TrimSpace(k), strings.TrimSpace(v), true -} - -// assumes no surrounding comment, whitespace, or profile brackets -func splitProfile(s string) (string, string) { - var first int - for i, r := range s { - if isLineSpace(r) { - if first == 0 { - first = i - } - } else { - if first != 0 { - return s[:first], s[i:] - } - } - } - if first == 0 { - return "", s // type component is effectively blank - } - return "", "" -} - -func isLineSpace(r rune) bool { - return r == ' ' || r == '\t' -} - -func unquote(s string) string { - if isSingleQuoted(s) || isDoubleQuoted(s) { - return s[1 : len(s)-1] - } - return s -} - -// applies various legacy conversions to property values: -// - remote wrapping single/doublequotes -func legacyStrconv(s string) string { - s = unquote(s) - return s -} - -func isSingleQuoted(s string) bool { - return hasAffixes(s, "'", "'") -} - -func isDoubleQuoted(s string) bool { - return hasAffixes(s, `"`, `"`) -} - -func isBracketed(s string) bool { - return hasAffixes(s, "[", "]") -} - -func hasAffixes(s, left, right string) bool { - return strings.HasPrefix(s, left) && strings.HasSuffix(s, right) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go deleted file mode 100644 index 6e9a03744..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go +++ /dev/null @@ -1,32 +0,0 @@ -package ini - -type lineToken interface { - isLineToken() -} - -type lineTokenProfile struct { - Type string - Name string -} - -func (*lineTokenProfile) isLineToken() {} - -type lineTokenProperty struct { - Key string - Value string -} - -func (*lineTokenProperty) isLineToken() {} - -type lineTokenContinuation struct { - Value string -} - -func (*lineTokenContinuation) isLineToken() {} - -type lineTokenSubProperty struct { - Key string - Value string -} - -func (*lineTokenSubProperty) isLineToken() {} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go deleted file mode 100644 index 89a773684..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go +++ /dev/null @@ -1,92 +0,0 @@ -package ini - -import ( - "strings" -) - -func tokenize(lines []string) ([]lineToken, error) { - tokens := make([]lineToken, 0, len(lines)) - for _, line := range lines { - if len(strings.TrimSpace(line)) == 0 || isLineComment(line) { - continue - } - - if tok := asProfile(line); tok != nil { - tokens = append(tokens, tok) - } else if tok := asProperty(line); tok != nil { - tokens = append(tokens, tok) - } else if tok := asSubProperty(line); tok != nil { - tokens = append(tokens, tok) - } else if tok := asContinuation(line); tok != nil { - tokens = append(tokens, tok) - } // unrecognized tokens are effectively ignored - } - return tokens, nil -} - -func isLineComment(line string) bool { - trimmed := strings.TrimLeft(line, " \t") - return strings.HasPrefix(trimmed, "#") || strings.HasPrefix(trimmed, ";") -} - -func asProfile(line string) *lineTokenProfile { // " [ type name ] ; comment" - trimmed := strings.TrimSpace(trimProfileComment(line)) // "[ type name ]" - if !isBracketed(trimmed) { - return nil - } - trimmed = trimmed[1 : len(trimmed)-1] // " type name " (or just " name ") - trimmed = strings.TrimSpace(trimmed) // "type name" / "name" - typ, name := splitProfile(trimmed) - return &lineTokenProfile{ - Type: typ, - Name: name, - } -} - -func asProperty(line string) *lineTokenProperty { - if isLineSpace(rune(line[0])) { - return nil - } - - trimmed := trimPropertyComment(line) - trimmed = strings.TrimRight(trimmed, " \t") - k, v, ok := splitProperty(trimmed) - if !ok { - return nil - } - - return &lineTokenProperty{ - Key: strings.ToLower(k), // LEGACY: normalize key case - Value: legacyStrconv(v), // LEGACY: see func docs - } -} - -func asSubProperty(line string) *lineTokenSubProperty { - if !isLineSpace(rune(line[0])) { - return nil - } - - // comments on sub-properties are included in the value - trimmed := strings.TrimLeft(line, " \t") - k, v, ok := splitProperty(trimmed) - if !ok { - return nil - } - - return &lineTokenSubProperty{ // same LEGACY constraints as in normal property - Key: strings.ToLower(k), - Value: legacyStrconv(v), - } -} - -func asContinuation(line string) *lineTokenContinuation { - if !isLineSpace(rune(line[0])) { - return nil - } - - // includes comments like sub-properties - trimmed := strings.TrimLeft(line, " \t") - return &lineTokenContinuation{ - Value: trimmed, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go deleted file mode 100644 index e3706b3c3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go +++ /dev/null @@ -1,93 +0,0 @@ -package ini - -import ( - "fmt" - "strconv" - "strings" -) - -// ValueType is an enum that will signify what type -// the Value is -type ValueType int - -func (v ValueType) String() string { - switch v { - case NoneType: - return "NONE" - case StringType: - return "STRING" - } - - return "" -} - -// ValueType enums -const ( - NoneType = ValueType(iota) - StringType - QuotedStringType -) - -// Value is a union container -type Value struct { - Type ValueType - - str string - mp map[string]string -} - -// NewStringValue returns a Value type generated using a string input. -func NewStringValue(str string) (Value, error) { - return Value{str: str}, nil -} - -func (v Value) String() string { - switch v.Type { - case StringType: - return fmt.Sprintf("string: %s", string(v.str)) - case QuotedStringType: - return fmt.Sprintf("quoted string: %s", string(v.str)) - default: - return "union not set" - } -} - -// MapValue returns a map value for sub properties -func (v Value) MapValue() map[string]string { - return v.mp -} - -// IntValue returns an integer value -func (v Value) IntValue() (int64, bool) { - i, err := strconv.ParseInt(string(v.str), 0, 64) - if err != nil { - return 0, false - } - return i, true -} - -// FloatValue returns a float value -func (v Value) FloatValue() (float64, bool) { - f, err := strconv.ParseFloat(string(v.str), 64) - if err != nil { - return 0, false - } - return f, true -} - -// BoolValue returns a bool value -func (v Value) BoolValue() (bool, bool) { - // we don't use ParseBool as it recognizes more than what we've - // historically supported - if strings.EqualFold(v.str, "true") { - return true, true - } else if strings.EqualFold(v.str, "false") { - return false, true - } - return false, false -} - -// StringValue returns the string value -func (v Value) StringValue() string { - return v.str -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go deleted file mode 100644 index 8e24a3f0a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go +++ /dev/null @@ -1,42 +0,0 @@ -package middleware - -import ( - "context" - "sync/atomic" - "time" - - internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" - "github.com/aws/smithy-go/middleware" -) - -// AddTimeOffsetMiddleware sets a value representing clock skew on the request context. -// This can be read by other operations (such as signing) to correct the date value they send -// on the request -type AddTimeOffsetMiddleware struct { - Offset *atomic.Int64 -} - -// ID the identifier for AddTimeOffsetMiddleware -func (m *AddTimeOffsetMiddleware) ID() string { return "AddTimeOffsetMiddleware" } - -// HandleBuild sets a value for attemptSkew on the request context if one is set on the client. -func (m AddTimeOffsetMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - if m.Offset != nil { - offset := time.Duration(m.Offset.Load()) - ctx = internalcontext.SetAttemptSkewContext(ctx, offset) - } - return next.HandleBuild(ctx, in) -} - -// HandleDeserialize gets the clock skew context from the context, and if set, sets it on the pointer -// held by AddTimeOffsetMiddleware -func (m *AddTimeOffsetMiddleware) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - if v := internalcontext.GetAttemptSkewContext(ctx); v != 0 { - m.Offset.Store(v.Nanoseconds()) - } - return next.HandleDeserialize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go deleted file mode 100644 index c8484dcd7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go +++ /dev/null @@ -1,33 +0,0 @@ -package rand - -import ( - "crypto/rand" - "fmt" - "io" - "math/big" -) - -func init() { - Reader = rand.Reader -} - -// Reader provides a random reader that can reset during testing. -var Reader io.Reader - -var floatMaxBigInt = big.NewInt(1 << 53) - -// Float64 returns a float64 read from an io.Reader source. The returned float will be between [0.0, 1.0). -func Float64(reader io.Reader) (float64, error) { - bi, err := rand.Int(reader, floatMaxBigInt) - if err != nil { - return 0, fmt.Errorf("failed to read random value, %v", err) - } - - return float64(bi.Int64()) / (1 << 53), nil -} - -// CryptoRandFloat64 returns a random float64 obtained from the crypto rand -// source. -func CryptoRandFloat64() (float64, error) { - return Float64(Reader) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.go deleted file mode 100644 index 2b42cbe64..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.go +++ /dev/null @@ -1,9 +0,0 @@ -package sdk - -// Invalidator provides access to a type's invalidate method to make it -// invalidate it cache. -// -// e.g aws.SafeCredentialsProvider's Invalidate method. -type Invalidator interface { - Invalidate() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.go deleted file mode 100644 index 8e8dabad5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.go +++ /dev/null @@ -1,74 +0,0 @@ -package sdk - -import ( - "context" - "time" -) - -func init() { - NowTime = time.Now - Sleep = time.Sleep - SleepWithContext = sleepWithContext -} - -// NowTime is a value for getting the current time. This value can be overridden -// for testing mocking out current time. -var NowTime func() time.Time - -// Sleep is a value for sleeping for a duration. This value can be overridden -// for testing and mocking out sleep duration. -var Sleep func(time.Duration) - -// SleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the Context's -// error will be returned. -// -// This value can be overridden for testing and mocking out sleep duration. -var SleepWithContext func(context.Context, time.Duration) error - -// sleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the -// Context's error will be returned. -func sleepWithContext(ctx context.Context, dur time.Duration) error { - t := time.NewTimer(dur) - defer t.Stop() - - select { - case <-t.C: - break - case <-ctx.Done(): - return ctx.Err() - } - - return nil -} - -// noOpSleepWithContext does nothing, returns immediately. -func noOpSleepWithContext(context.Context, time.Duration) error { - return nil -} - -func noOpSleep(time.Duration) {} - -// TestingUseNopSleep is a utility for disabling sleep across the SDK for -// testing. -func TestingUseNopSleep() func() { - SleepWithContext = noOpSleepWithContext - Sleep = noOpSleep - - return func() { - SleepWithContext = sleepWithContext - Sleep = time.Sleep - } -} - -// TestingUseReferenceTime is a utility for swapping the time function across the SDK to return a specific reference time -// for testing purposes. -func TestingUseReferenceTime(referenceTime time.Time) func() { - NowTime = func() time.Time { - return referenceTime - } - return func() { - NowTime = time.Now - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.go deleted file mode 100644 index 6c443988b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.go +++ /dev/null @@ -1,12 +0,0 @@ -package sdkio - -const ( - // Byte is 8 bits - Byte int64 = 1 - // KibiByte (KiB) is 1024 Bytes - KibiByte = Byte * 1024 - // MebiByte (MiB) is 1024 KiB - MebiByte = KibiByte * 1024 - // GibiByte (GiB) is 1024 MiB - GibiByte = MebiByte * 1024 -) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go deleted file mode 100644 index c96b717e0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go +++ /dev/null @@ -1,47 +0,0 @@ -package shareddefaults - -import ( - "os" - "os/user" - "path/filepath" -) - -// SharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/credentials -// - Windows: %USERPROFILE%\.aws\credentials -func SharedCredentialsFilename() string { - return filepath.Join(UserHomeDir(), ".aws", "credentials") -} - -// SharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/config -// - Windows: %USERPROFILE%\.aws\config -func SharedConfigFilename() string { - return filepath.Join(UserHomeDir(), ".aws", "config") -} - -// UserHomeDir returns the home directory for the user the process is -// running under. -func UserHomeDir() string { - // Ignore errors since we only care about Windows and *nix. - home, _ := os.UserHomeDir() - - if len(home) > 0 { - return home - } - - currUser, _ := user.Current() - if currUser != nil { - home = currUser.HomeDir - } - - return home -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.go deleted file mode 100644 index d008ae27c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.go +++ /dev/null @@ -1,11 +0,0 @@ -package strings - -import ( - "strings" -) - -// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings, -// under Unicode case-folding. -func HasPrefixFold(s, prefix string) bool { - return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE deleted file mode 100644 index fe6a62006..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go deleted file mode 100644 index cb70616e8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package singleflight provides a duplicate function call suppression -// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight -// package. The package is forked, because the package a part of the unstable -// and unversioned golang.org/x/sync module. -// -// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight -package singleflight diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go deleted file mode 100644 index e8a1b17d5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package singleflight - -import ( - "bytes" - "errors" - "fmt" - "runtime" - "runtime/debug" - "sync" -) - -// errGoexit indicates the runtime.Goexit was called in -// the user given function. -var errGoexit = errors.New("runtime.Goexit was called") - -// A panicError is an arbitrary value recovered from a panic -// with the stack trace during the execution of given function. -type panicError struct { - value interface{} - stack []byte -} - -// Error implements error interface. -func (p *panicError) Error() string { - return fmt.Sprintf("%v\n\n%s", p.value, p.stack) -} - -func newPanicError(v interface{}) error { - stack := debug.Stack() - - // The first line of the stack trace is of the form "goroutine N [status]:" - // but by the time the panic reaches Do the goroutine may no longer exist - // and its status will have changed. Trim out the misleading line. - if line := bytes.IndexByte(stack[:], '\n'); line >= 0 { - stack = stack[line+1:] - } - return &panicError{value: v, stack: stack} -} - -// call is an in-flight or completed singleflight.Do call -type call struct { - wg sync.WaitGroup - - // These fields are written once before the WaitGroup is done - // and are only read after the WaitGroup is done. - val interface{} - err error - - // forgotten indicates whether Forget was called with this call's key - // while the call was still in flight. - forgotten bool - - // These fields are read and written with the singleflight - // mutex held before the WaitGroup is done, and are read but - // not written after the WaitGroup is done. - dups int - chans []chan<- Result -} - -// Group represents a class of work and forms a namespace in -// which units of work can be executed with duplicate suppression. -type Group struct { - mu sync.Mutex // protects m - m map[string]*call // lazily initialized -} - -// Result holds the results of Do, so they can be passed -// on a channel. -type Result struct { - Val interface{} - Err error - Shared bool -} - -// Do executes and returns the results of the given function, making -// sure that only one execution is in-flight for a given key at a -// time. If a duplicate comes in, the duplicate caller waits for the -// original to complete and receives the same results. -// The return value shared indicates whether v was given to multiple callers. -func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - g.mu.Unlock() - c.wg.Wait() - - if e, ok := c.err.(*panicError); ok { - panic(e) - } else if c.err == errGoexit { - runtime.Goexit() - } - return c.val, c.err, true - } - c := new(call) - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - g.doCall(c, key, fn) - return c.val, c.err, c.dups > 0 -} - -// DoChan is like Do but returns a channel that will receive the -// results when they are ready. -// -// The returned channel will not be closed. -func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { - ch := make(chan Result, 1) - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - c.chans = append(c.chans, ch) - g.mu.Unlock() - return ch - } - c := &call{chans: []chan<- Result{ch}} - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - go g.doCall(c, key, fn) - - return ch -} - -// doCall handles the single call for a key. -func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { - normalReturn := false - recovered := false - - // use double-defer to distinguish panic from runtime.Goexit, - // more details see https://golang.org/cl/134395 - defer func() { - // the given function invoked runtime.Goexit - if !normalReturn && !recovered { - c.err = errGoexit - } - - c.wg.Done() - g.mu.Lock() - defer g.mu.Unlock() - if !c.forgotten { - delete(g.m, key) - } - - if e, ok := c.err.(*panicError); ok { - // In order to prevent the waiting channels from being blocked forever, - // needs to ensure that this panic cannot be recovered. - if len(c.chans) > 0 { - go panic(e) - select {} // Keep this goroutine around so that it will appear in the crash dump. - } else { - panic(e) - } - } else if c.err == errGoexit { - // Already in the process of goexit, no need to call again - } else { - // Normal return - for _, ch := range c.chans { - ch <- Result{c.val, c.err, c.dups > 0} - } - } - }() - - func() { - defer func() { - if !normalReturn { - // Ideally, we would wait to take a stack trace until we've determined - // whether this is a panic or a runtime.Goexit. - // - // Unfortunately, the only way we can distinguish the two is to see - // whether the recover stopped the goroutine from terminating, and by - // the time we know that, the part of the stack trace relevant to the - // panic has been discarded. - if r := recover(); r != nil { - c.err = newPanicError(r) - } - } - }() - - c.val, c.err = fn() - normalReturn = true - }() - - if !normalReturn { - recovered = true - } -} - -// Forget tells the singleflight to forget about a key. Future calls -// to Do for this key will call the function rather than waiting for -// an earlier call to complete. -func (g *Group) Forget(key string) { - g.mu.Lock() - if c, ok := g.m[key]; ok { - c.forgotten = true - } - delete(g.m, key) - g.mu.Unlock() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.go deleted file mode 100644 index 5d69db5f2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.go +++ /dev/null @@ -1,13 +0,0 @@ -package timeconv - -import "time" - -// FloatSecondsDur converts a fractional seconds to duration. -func FloatSecondsDur(v float64) time.Duration { - return time.Duration(v * float64(time.Second)) -} - -// DurSecondsFloat converts a duration into fractional seconds. -func DurSecondsFloat(d time.Duration) float64 { - return float64(d) / float64(time.Second) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.md deleted file mode 100644 index 10faf8ca3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.md +++ /dev/null @@ -1,1387 +0,0 @@ -# v1.233.0 (2025-07-17) - -* **Feature**: AWS Free Tier Version2 Support - -# v1.232.0 (2025-07-15) - -* **Feature**: This release adds support for volume initialization status, which enables you to monitor when the initialization process for an EBS volume is completed. This release also adds IPv6 support to EC2 Instance Connect Endpoints, allowing you to connect to your EC2 Instance via a private IPv6 address. - -# v1.231.0 (2025-07-09) - -* **Feature**: Adds support to Capacity Blocks for ML for purchasing EC2 P6e-GB200 UltraServers. Customers can now purchase u-p6e-gb200x72 and u-p6e-gb200x36 UltraServers. Adds new DescribeCapacityBlocks andDescribeCapacityBlockStatus APIs. Adds support for CapacityBlockId to DescribeInstanceTopology. - -# v1.230.0 (2025-07-03) - -* **Feature**: This release adds GroupOwnerId as a response member to the DescribeSecurityGroupVpcAssociations API and also adds waiters for SecurityGroupVpcAssociations (SecurityGroupVpcAssociationAssociated and SecurityGroupVpcAssociationDisassociated). - -# v1.229.0 (2025-07-02) - -* **Feature**: AWS Site-to-Site VPN now supports IPv6 addresses on outer tunnel IPs, making it easier for customers to build or transition to IPv6-only networks. - -# v1.228.0 (2025-07-01) - -* **Feature**: Add Context to GetInstanceTypesFromInstanceRequirements API - -# v1.227.0 (2025-06-26) - -* **Feature**: This release adds support for OdbNetworkArn as a target in VPC Route Tables - -# v1.226.0 (2025-06-24) - -* **Feature**: This release allows you to create and register AMIs while maintaining their underlying EBS snapshots within Local Zones. - -# v1.225.2 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.225.1 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.225.0 (2025-06-09) - -* **Feature**: Release to support Elastic VMware Service (Amazon EVS) Subnet and Amazon EVS Network Interface Types. - -# v1.224.1 (2025-06-06) - -* No change notes available for this release. - -# v1.224.0 (2025-05-28) - -* **Feature**: Enable the option to automatically delete underlying Amazon EBS snapshots when deregistering Amazon Machine Images (AMIs) - -# v1.223.0 (2025-05-27) - -* **Feature**: This release adds three features - option to store AWS Site-to-Site VPN pre-shared keys in AWS Secrets Manager, GetActiveVpnTunnelStatus API to check the in-use VPN algorithms, and SampleType option in GetVpnConnectionDeviceSampleConfiguration API to get recommended sample configs for VPN devices. - -# v1.222.0 (2025-05-23) - -* **Feature**: This release adds support for the C7i-flex, M7i-flex, I7i, I7ie, I8g, P6-b200, Trn2, C8gd, M8gd and R8gd instances - -# v1.221.0 (2025-05-21) - -* **Feature**: Release of Dualstack and Ipv6-only EC2 Public DNS hostnames - -# v1.220.0 (2025-05-20) - -* **Feature**: This release expands the ModifyInstanceMaintenanceOptions API to enable or disable instance migration during customer-initiated reboots for EC2 Scheduled Reboot Events. - -# v1.219.0 (2025-05-19) - -* **Feature**: This release includes new APIs for System Integrity Protection (SIP) configuration and automated root volume ownership delegation for EC2 Mac instances. - -# v1.218.0 (2025-05-12) - -* **Feature**: EC2 - Adding support for AvailabilityZoneId - -# v1.217.0 (2025-05-08) - -* **Feature**: Launching the feature to support ENA queues offering flexibility to support multiple queues per Enhanced Network Interface (ENI) - -# v1.216.0 (2025-05-07) - -* **Feature**: This release adds API support for Path Component Exclusion (Filter Out ARN) for Reachability Analyzer - -# v1.215.0 (2025-05-06) - -* **Feature**: This release adds support for Amazon EBS Provisioned Rate for Volume Initialization, which lets you specify a volume initialization rate to ensure that your EBS volumes are initialized in a predictable amount of time. - -# v1.214.0 (2025-05-05) - -* **Feature**: This update introduces API operations to manage and create local gateway VIF and VIF groups. It also includes API operations to describe Outpost LAGs and service link VIFs. - -# v1.213.0 (2025-04-30) - -* **Feature**: Launch of cost distribution feature for IPAM owners to distribute costs to internal teams. - -# v1.212.0 (2025-04-22) - -* **Feature**: Added support for ClientRouteEnforcementOptions flag in CreateClientVpnEndpoint and ModifyClientVpnEndpoint requests and DescribeClientVpnEndpoints responses - -# v1.211.3 (2025-04-10) - -* No change notes available for this release. - -# v1.211.2 (2025-04-04) - -* **Documentation**: Doc-only updates for Amazon EC2 - -# v1.211.1 (2025-04-03) - -* No change notes available for this release. - -# v1.211.0 (2025-03-31) - -* **Feature**: Release VPC Route Server, a new feature allowing dynamic routing in VPCs. - -# v1.210.1 (2025-03-19) - -* **Documentation**: Doc-only updates for EC2 for March 2025. - -# v1.210.0 (2025-03-13) - -* **Feature**: This release changes the CreateLaunchTemplate, CreateLaunchTemplateVersion, ModifyLaunchTemplate CLI and SDKs such that if you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. - -# v1.209.0 (2025-03-11) - -* **Feature**: This release adds the GroupLongName field to the response of the DescribeAvailabilityZones API. - -# v1.208.0 (2025-03-07) - -* **Feature**: Add serviceManaged field to DescribeAddresses API response. - -# v1.207.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.207.0 (2025-03-04) - -* **Feature**: Update the DescribeVpcs response - -# v1.206.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.205.0 (2025-02-26) - -* **Feature**: Amazon EC2 Fleet customers can now override the Block Device Mapping specified in the Launch Template when creating a new Fleet request, saving the effort of creating and associating new Launch Templates to customize the Block Device Mapping. - -# v1.204.0 (2025-02-25) - -* **Feature**: Adds support for time-based EBS-backed AMI copy operations. Time-based copy ensures that EBS-backed AMIs are copied within and across Regions in a specified timeframe. - -# v1.203.1 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.203.0 (2025-02-11) - -* **Feature**: Adding support for the new fullSnapshotSizeInBytes field in the response of the EC2 EBS DescribeSnapshots API. This field represents the size of all the blocks that were written to the source volume at the time the snapshot was created. - -# v1.202.4 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.202.3 (2025-02-04) - -* No change notes available for this release. - -# v1.202.2 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.202.1 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.202.0 (2025-01-28) - -* **Feature**: This release changes the CreateFleet CLI and SDK's such that if you do not specify a client token, a randomly generated token is used for the request to ensure idempotency. - -# v1.201.1 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.201.0 (2025-01-23) - -* **Feature**: Added "future" allocation type for future dated capacity reservation - -# v1.200.0 (2025-01-17) - -* **Feature**: Release u7i-6tb.112xlarge, u7i-8tb.112xlarge, u7inh-32tb.480xlarge, p5e.48xlarge, p5en.48xlarge, f2.12xlarge, f2.48xlarge, trn2.48xlarge instance types. -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.199.2 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.199.1 (2025-01-14) - -* **Bug Fix**: Fix issue where waiters were not failing on unmatched errors as they should. This may have breaking behavioral changes for users in fringe cases. See [this announcement](https://github.com/aws/aws-sdk-go-v2/discussions/2954) for more information. -* **Bug Fix**: Fix nil dereference panic in certain waiters. - -# v1.199.0 (2025-01-13) - -* **Feature**: Add support for DisconnectOnSessionTimeout flag in CreateClientVpnEndpoint and ModifyClientVpnEndpoint requests and DescribeClientVpnEndpoints responses - -# v1.198.3 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.198.2 (2025-01-08) - -* No change notes available for this release. - -# v1.198.1 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.198.0 (2024-12-16) - -* **Feature**: This release adds support for EBS local snapshots in AWS Dedicated Local Zones, which allows you to store snapshots of EBS volumes locally in Dedicated Local Zones. - -# v1.197.0 (2024-12-13) - -* **Feature**: This release adds GroupId to the response for DeleteSecurityGroup. - -# v1.196.0 (2024-12-09) - -* **Feature**: This release includes a new API for modifying instance network-performance-options after launch. - -# v1.195.0 (2024-12-02) - -* **Feature**: Adds support for declarative policies that allow you to enforce desired configuration across an AWS organization through configuring account attributes. Adds support for Allowed AMIs that allows you to limit the use of AMIs in AWS accounts. Adds support for connectivity over non-HTTP protocols. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.194.0 (2024-11-26) - -* **Feature**: Adds support for Time-based Copy for EBS Snapshots and Cross Region PrivateLink. Time-based Copy ensures that EBS Snapshots are copied within and across AWS Regions in a specified timeframe. Cross Region PrivateLink enables customers to connect to VPC endpoint services hosted in other AWS Regions. - -# v1.193.0 (2024-11-21) - -* **Feature**: Adds support for requesting future-dated Capacity Reservations with a minimum commitment duration, enabling IPAM for organizational units within AWS Organizations, reserving EC2 Capacity Blocks that start in 30 minutes, and extending the end date of existing Capacity Blocks. - -# v1.192.0 (2024-11-20) - -* **Feature**: With this release, customers can express their desire to launch instances only in an ODCR or ODCR group rather than OnDemand capacity. Customers can express their baseline instances' CPU-performance in attribute-based Instance Requirements configuration by referencing an instance family. - -# v1.191.0 (2024-11-19) - -* **Feature**: This release adds VPC Block Public Access (VPC BPA), a new declarative control which blocks resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. - -# v1.190.0 (2024-11-18) - -* **Feature**: Adding request and response elements for managed resources. -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.189.0 (2024-11-15.2) - -* **Feature**: Remove non-functional enum variants for FleetCapacityReservationUsageStrategy - -# v1.188.0 (2024-11-13) - -* **Feature**: This release adds the source AMI details in DescribeImages API - -# v1.187.1 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.187.0 (2024-10-30) - -* **Feature**: This release adds two new capabilities to VPC Security Groups: Security Group VPC Associations and Shared Security Groups. - -# v1.186.1 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.186.0 (2024-10-24) - -* **Feature**: This release includes a new API to describe some details of the Amazon Machine Images (AMIs) that were used to launch EC2 instances, even if those AMIs are no longer available for use. - -# v1.185.0 (2024-10-23) - -* **Feature**: Amazon EC2 X8g, C8g and M8g instances are powered by AWS Graviton4 processors. X8g provide the lowest cost per GiB of memory among Graviton4 instances. C8g provide the best price performance for compute-intensive workloads. M8g provide the best price performance in for general purpose workloads. - -# v1.184.0 (2024-10-21) - -* **Feature**: Amazon EC2 now allows you to create network interfaces with just the EFA driver and no ENA driver by specifying the network interface type as efa-only. - -# v1.183.0 (2024-10-18) - -* **Feature**: RequestSpotInstances and RequestSpotFleet feature release. - -# v1.182.0 (2024-10-10) - -* **Feature**: This release adds support for assigning the billing of shared Amazon EC2 On-Demand Capacity Reservations. - -# v1.181.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.181.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.181.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Feature**: Documentation updates for Amazon EC2. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.180.0 (2024-10-03) - -* **Feature**: This release includes a new API for modifying instance cpu-options after launch. - -# v1.179.2 (2024-09-27) - -* No change notes available for this release. - -# v1.179.1 (2024-09-25) - -* **Documentation**: Updates to documentation for the transit gateway security group referencing feature. - -# v1.179.0 (2024-09-23) - -* **Feature**: Amazon EC2 G6e instances powered by NVIDIA L40S Tensor Core GPUs are the most cost-efficient GPU instances for deploying generative AI models and the highest performance GPU instances for spatial computing workloads. - -# v1.178.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.177.4 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.177.3 (2024-09-10) - -* No change notes available for this release. - -# v1.177.2 (2024-09-04) - -* No change notes available for this release. - -# v1.177.1 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.177.0 (2024-08-28) - -* **Feature**: Amazon VPC IP Address Manager (IPAM) now allows customers to provision IPv4 CIDR blocks and allocate Elastic IP Addresses directly from IPAM pools with public IPv4 space - -# v1.176.0 (2024-08-21) - -* **Feature**: DescribeInstanceStatus now returns health information on EBS volumes attached to Nitro instances - -# v1.175.1 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.175.0 (2024-08-12) - -* **Feature**: This release adds new capabilities to manage On-Demand Capacity Reservations including the ability to split your reservation, move capacity between reservations, and modify the instance eligibility of your reservation. - -# v1.174.0 (2024-08-08) - -* **Feature**: Launch of private IPv6 addressing for VPCs and Subnets. VPC IPAM supports the planning and monitoring of private IPv6 usage. - -# v1.173.0 (2024-07-25) - -* **Feature**: EC2 Fleet now supports using custom identifiers to reference Amazon Machine Images (AMI) in launch requests that are configured to choose from a diversified list of instance types. - -# v1.172.0 (2024-07-23) - -* **Feature**: Switch to new waiter matching implementation, which conveys a slight performance boost and removes the need for the go-jmespath runtime dependency. - -# v1.171.0 (2024-07-18) - -* **Feature**: Amazon VPC IP Address Manager (IPAM) now supports Bring-Your-Own-IP (BYOIP) for IP addresses registered with any Internet Registry. This feature uses DNS TXT records to validate ownership of a public IP address range. - -# v1.170.0 (2024-07-10.2) - -* **Feature**: Add parameters to enable provisioning IPAM BYOIPv4 space at a Local Zone Network Border Group level -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.169.0 (2024-07-10) - -* **Feature**: Add parameters to enable provisioning IPAM BYOIPv4 space at a Local Zone Network Border Group level -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.168.0 (2024-07-02) - -* **Feature**: Documentation updates for Elastic Compute Cloud (EC2). - -# v1.167.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.167.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.166.0 (2024-06-25) - -* **Feature**: This release is for the launch of the new u7ib-12tb.224xlarge, R8g, c7gn.metal and mac2-m1ultra.metal instance types - -# v1.165.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.165.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.164.2 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.164.1 (2024-06-14) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.164.0 (2024-06-12) - -* **Feature**: Tagging support for Traffic Mirroring FilterRule resource - -# v1.163.1 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.163.0 (2024-06-04) - -* **Feature**: U7i instances with up to 32 TiB of DDR5 memory and 896 vCPUs are now available. C7i-flex instances are launched and are lower-priced variants of the Amazon EC2 C7i instances that offer a baseline level of CPU performance with the ability to scale up to the full compute performance 95% of the time. - -# v1.162.1 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.162.0 (2024-05-28) - -* **Feature**: Providing support to accept BgpAsnExtended attribute - -# v1.161.4 (2024-05-23) - -* No change notes available for this release. - -# v1.161.3 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.161.2 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.161.1 (2024-05-10) - -* **Bug Fix**: Fix serialization behavior of empty lists. - -# v1.161.0 (2024-05-08) - -* **Feature**: Adding Precision Hardware Clock (PHC) to public API DescribeInstanceTypes -* **Bug Fix**: GoDoc improvement - -# v1.160.0 (2024-05-02) - -* **Feature**: This release includes a new API for retrieving the public endorsement key of the EC2 instance's Nitro Trusted Platform Module (NitroTPM). - -# v1.159.1 (2024-05-01) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.159.0 (2024-04-24) - -* **Feature**: Launching capability for customers to enable or disable automatic assignment of public IPv4 addresses to their network interface - -# v1.158.0 (2024-04-23) - -* **Feature**: This release introduces EC2 AMI Deregistration Protection, a new AMI property that can be enabled by customers to protect an AMI against an unintended deregistration. This release also enables the AMI owners to view the AMI 'LastLaunchedTime' in DescribeImages API. - -# v1.157.0 (2024-04-17) - -* **Feature**: Documentation updates for Elastic Compute Cloud (EC2). - -# v1.156.0 (2024-04-04) - -* **Feature**: Amazon EC2 G6 instances powered by NVIDIA L4 Tensor Core GPUs can be used for a wide range of graphics-intensive and machine learning use cases. Gr6 instances also feature NVIDIA L4 GPUs and can be used for graphics workloads with higher memory requirements. - -# v1.155.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.155.0 (2024-03-28) - -* **Feature**: Amazon EC2 C7gd, M7gd and R7gd metal instances with up to 3.8 TB of local NVMe-based SSD block-level storage have up to 45% improved real-time NVMe storage performance than comparable Graviton2-based instances. - -# v1.154.0 (2024-03-26) - -* **Feature**: Documentation updates for Elastic Compute Cloud (EC2). - -# v1.153.0 (2024-03-25) - -* **Feature**: Added support for ModifyInstanceMetadataDefaults and GetInstanceMetadataDefaults to set Instance Metadata Service account defaults - -# v1.152.0 (2024-03-19) - -* **Feature**: This release adds the new DescribeMacHosts API operation for getting information about EC2 Mac Dedicated Hosts. Users can now see the latest macOS versions that their underlying Apple Mac can support without needing to be updated. - -# v1.151.1 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.151.0 (2024-03-15) - -* **Feature**: Add media accelerator and neuron device information on the describe instance types API. - -# v1.150.1 (2024-03-12) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.150.0 (2024-03-07) - -* **Feature**: This release adds an optional parameter to RegisterImage and CopyImage APIs to support tagging AMIs at the time of creation. -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.149.4 (2024-03-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.149.3 (2024-03-04) - -* **Bug Fix**: Update internal/presigned-url dependency for corrected API name. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.149.2 (2024-03-01) - -* **Documentation**: With this release, Amazon EC2 Auto Scaling groups, EC2 Fleet, and Spot Fleet improve the default price protection behavior of attribute-based instance type selection of Spot Instances, to consistently select from a wide range of instance types. - -# v1.149.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.149.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.148.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.148.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.148.0 (2024-02-16) - -* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. - -# v1.147.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.146.0 (2024-01-29) - -* **Feature**: EC2 Fleet customers who use attribute based instance-type selection can now intuitively define their Spot instances price protection limit as a percentage of the lowest priced On-Demand instance type. - -# v1.145.0 (2024-01-24) - -* **Feature**: Introduced a new clientToken request parameter on CreateNetworkAcl and CreateRouteTable APIs. The clientToken parameter allows idempotent operations on the APIs. - -# v1.144.1 (2024-01-22) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.144.0 (2024-01-11) - -* **Feature**: This release adds support for adding an ElasticBlockStorage volume configurations in ECS RunTask/StartTask/CreateService/UpdateService APIs. The configuration allows for attaching EBS volumes to ECS Tasks. - -# v1.143.0 (2024-01-08) - -* **Feature**: Amazon EC2 R7iz bare metal instances are powered by custom 4th generation Intel Xeon Scalable processors. - -# v1.142.1 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.142.0 (2023-12-19) - -* **Feature**: Provision BYOIPv4 address ranges and advertise them by specifying the network border groups option in Los Angeles, Phoenix and Dallas AWS Local Zones. - -# v1.141.0 (2023-12-08) - -* **Feature**: M2 Mac instances are built on Apple M2 Mac mini computers. I4i instances are powered by 3rd generation Intel Xeon Scalable processors. C7i compute optimized, M7i general purpose and R7i memory optimized instances are powered by custom 4th Generation Intel Xeon Scalable processors. -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.140.1 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.140.0 (2023-12-06) - -* **Feature**: Releasing the new cpuManufacturer attribute within the DescribeInstanceTypes API response which notifies our customers with information on who the Manufacturer is for the processor attached to the instance, for example: Intel. -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.139.0 (2023-12-05) - -* **Feature**: Adds A10G, T4G, and H100 as accelerator name options and Habana as an accelerator manufacturer option for attribute based selection - -# v1.138.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.138.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.138.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.137.3 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.137.2 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.137.1 (2023-11-21) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.137.0 (2023-11-20) - -* **Feature**: This release adds support for Security group referencing over Transit gateways, enabling you to simplify Security group management and control of instance-to-instance traffic across VPCs that are connected by Transit gateway. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.136.0 (2023-11-17) - -* **Feature**: This release adds new features for Amazon VPC IP Address Manager (IPAM) Allowing a choice between Free and Advanced Tiers, viewing public IP address insights across regions and in Amazon Cloudwatch, use IPAM to plan your subnet IPs within a VPC and bring your own autonomous system number to IPAM. - -# v1.135.0 (2023-11-16) - -* **Feature**: Enable use of tenant-specific PublicSigningKeyUrl from device trust providers and onboard jumpcloud as a new device trust provider. - -# v1.134.0 (2023-11-15) - -* **Feature**: AWS EBS now supports Snapshot Lock, giving users the ability to lock an EBS Snapshot to prohibit deletion of the snapshot. This release introduces the LockSnapshot, UnlockSnapshot & DescribeLockedSnapshots APIs to manage lock configuration for snapshots. The release also includes the dl2q_24xlarge. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.133.0 (2023-11-13) - -* **Feature**: Adds the new EC2 DescribeInstanceTopology API, which you can use to retrieve the network topology of your running instances on select platform types to determine their relative proximity to each other. - -# v1.132.0 (2023-11-10) - -* **Feature**: EC2 adds API updates to enable ENA Express at instance launch time. - -# v1.131.0 (2023-11-09.2) - -* **Feature**: AWS EBS now supports Block Public Access for EBS Snapshots. This release introduces the EnableSnapshotBlockPublicAccess, DisableSnapshotBlockPublicAccess and GetSnapshotBlockPublicAccessState APIs to manage account-level public access settings for EBS Snapshots in an AWS Region. - -# v1.130.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.130.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.129.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Feature**: Capacity Blocks for ML are a new EC2 purchasing option for reserving GPU instances on a future date to support short duration machine learning (ML) workloads. Capacity Blocks automatically place instances close together inside Amazon EC2 UltraClusters for low-latency, high-throughput networking. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.128.0 (2023-10-26) - -* **Feature**: Launching GetSecurityGroupsForVpc API. This API gets security groups that can be associated by the AWS account making the request with network interfaces in the specified VPC. - -# v1.127.0 (2023-10-24) - -* **Feature**: This release updates the documentation for InstanceInterruptionBehavior and HibernationOptionsRequest to more accurately describe the behavior of these two parameters when using Spot hibernation. - -# v1.126.0 (2023-10-19) - -* **Feature**: Amazon EC2 C7a instances, powered by 4th generation AMD EPYC processors, are ideal for high performance, compute-intensive workloads such as high performance computing. Amazon EC2 R7i instances are next-generation memory optimized and powered by custom 4th Generation Intel Xeon Scalable processors. - -# v1.125.0 (2023-10-12) - -* **Feature**: This release adds Ubuntu Pro as a supported platform for On-Demand Capacity Reservations and adds support for setting an Amazon Machine Image (AMI) to disabled state. Disabling the AMI makes it private if it was previously shared, and prevents new EC2 instance launches from it. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.124.0 (2023-10-06) - -* **Feature**: Documentation updates for Elastic Compute Cloud (EC2). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.123.0 (2023-10-02) - -* **Feature**: Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances. - -# v1.122.0 (2023-09-28) - -* **Feature**: Adds support for Customer Managed Key encryption for Amazon Verified Access resources - -# v1.121.0 (2023-09-26) - -* **Feature**: The release includes AWS verified access to support FIPs compliance in North America regions - -# v1.120.0 (2023-09-22) - -* **Feature**: EC2 M2 Pro Mac instances are powered by Apple M2 Pro Mac Mini computers featuring 12 core CPU, 19 core GPU, 32 GiB of memory, and 16 core Apple Neural Engine and uniquely enabled by the AWS Nitro System through high-speed Thunderbolt connections. - -# v1.119.0 (2023-09-19) - -* **Feature**: This release adds support for C7i, and R7a instance types. - -# v1.118.0 (2023-09-12) - -* **Feature**: This release adds support for restricting public sharing of AMIs through AMI Block Public Access - -# v1.117.0 (2023-09-06) - -* **Feature**: This release adds 'outpost' location type to the DescribeInstanceTypeOfferings API, allowing customers that have been allowlisted for outpost to query their offerings in the API. - -# v1.116.0 (2023-09-05) - -* **Feature**: Introducing Amazon EC2 C7gd, M7gd, and R7gd Instances with up to 3.8 TB of local NVMe-based SSD block-level storage. These instances are powered by AWS Graviton3 processors, delivering up to 25% better performance over Graviton2-based instances. - -# v1.115.0 (2023-08-24) - -* **Feature**: Amazon EC2 M7a instances, powered by 4th generation AMD EPYC processors, deliver up to 50% higher performance compared to M6a instances. Amazon EC2 Hpc7a instances, powered by 4th Gen AMD EPYC processors, deliver up to 2.5x better performance compared to Amazon EC2 Hpc6a instances. - -# v1.114.0 (2023-08-21) - -* **Feature**: The DeleteKeyPair API has been updated to return the keyPairId when an existing key pair is deleted. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.113.1 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.113.0 (2023-08-17) - -* **Feature**: Adds support for SubnetConfigurations to allow users to select their own IPv4 and IPv6 addresses for Interface VPC endpoints -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.112.0 (2023-08-15) - -* **Feature**: Documentation updates for Elastic Compute Cloud (EC2). - -# v1.111.0 (2023-08-11) - -* **Feature**: Amazon EC2 P5 instances, powered by the latest NVIDIA H100 Tensor Core GPUs, deliver the highest performance in EC2 for deep learning (DL) and HPC applications. M7i-flex and M7i instances are next-generation general purpose instances powered by custom 4th Generation Intel Xeon Scalable processors. - -# v1.110.1 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.110.0 (2023-08-03) - -* **Feature**: This release adds new parameter isPrimaryIPv6 to allow assigning an IPv6 address as a primary IPv6 address to a network interface which cannot be changed to give equivalent functionality available for network interfaces with primary IPv4 address. - -# v1.109.1 (2023-08-01) - -* No change notes available for this release. - -# v1.109.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.108.1 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.108.0 (2023-07-27) - -* **Feature**: SDK and documentation updates for Amazon Elastic Block Store APIs - -# v1.107.0 (2023-07-25) - -* **Feature**: This release adds an instance's peak and baseline network bandwidth as well as the memory sizes of an instance's inference accelerators to DescribeInstanceTypes. - -# v1.106.0 (2023-07-24) - -* **Feature**: Add "disabled" enum value to SpotInstanceState. - -# v1.105.1 (2023-07-19) - -* **Documentation**: Amazon EC2 documentation updates. - -# v1.105.0 (2023-07-17) - -* **Feature**: Add Nitro TPM support on DescribeInstanceTypes - -# v1.104.0 (2023-07-13) - -* **Feature**: This release adds support for the C7gn and Hpc7g instances. C7gn instances are powered by AWS Graviton3 processors and the fifth-generation AWS Nitro Cards. Hpc7g instances are powered by AWS Graviton 3E processors and provide up to 200 Gbps network bandwidth. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.103.0 (2023-07-06) - -* **Feature**: Add Nitro Enclaves support on DescribeInstanceTypes - -# v1.102.0 (2023-06-20) - -* **Feature**: Adds support for targeting Dedicated Host allocations by assetIds in AWS Outposts - -# v1.101.0 (2023-06-19) - -* **Feature**: API changes to AWS Verified Access to include data from trust providers in logs - -# v1.100.1 (2023-06-15) - -* No change notes available for this release. - -# v1.100.0 (2023-06-13) - -* **Feature**: This release introduces a new feature, EC2 Instance Connect Endpoint, that enables you to connect to a resource over TCP, without requiring the resource to have a public IPv4 address. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.99.0 (2023-06-05) - -* **Feature**: Making InstanceTagAttribute as the required parameter for the DeregisterInstanceEventNotificationAttributes and RegisterInstanceEventNotificationAttributes APIs. - -# v1.98.0 (2023-05-18) - -* **Feature**: Add support for i4g.large, i4g.xlarge, i4g.2xlarge, i4g.4xlarge, i4g.8xlarge and i4g.16xlarge instances powered by AWS Graviton2 processors that deliver up to 15% better compute performance than our other storage-optimized instances. - -# v1.97.0 (2023-05-05) - -* **Feature**: This release adds support the inf2 and trn1n instances. inf2 instances are purpose built for deep learning inference while trn1n instances are powered by AWS Trainium accelerators and they build on the capabilities of Trainium-powered trn1 instances. - -# v1.96.1 (2023-05-04) - -* No change notes available for this release. - -# v1.96.0 (2023-05-03) - -* **Feature**: Adds an SDK paginator for GetNetworkInsightsAccessScopeAnalysisFindings - -# v1.95.0 (2023-04-27) - -* **Feature**: This release adds support for AMD SEV-SNP on EC2 instances. - -# v1.94.0 (2023-04-24) - -* **Feature**: API changes to AWS Verified Access related to identity providers' information. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.93.2 (2023-04-10) - -* No change notes available for this release. - -# v1.93.1 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.93.0 (2023-04-04) - -* **Feature**: C6in, M6in, M6idn, R6in and R6idn bare metal instances are powered by 3rd Generation Intel Xeon Scalable processors and offer up to 200 Gbps of network bandwidth. - -# v1.92.1 (2023-03-31) - -* **Documentation**: Documentation updates for EC2 On Demand Capacity Reservations - -# v1.92.0 (2023-03-30) - -* **Feature**: This release adds support for Tunnel Endpoint Lifecycle control, a new feature that provides Site-to-Site VPN customers with better visibility and control of their VPN tunnel maintenance updates. - -# v1.91.0 (2023-03-21) - -* **Feature**: This release adds support for AWS Network Firewall, AWS PrivateLink, and Gateway Load Balancers to Amazon VPC Reachability Analyzer, and it makes the path destination optional as long as a destination address in the filter at source is provided. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.90.0 (2023-03-14) - -* **Feature**: This release adds a new DnsOptions key (PrivateDnsOnlyForInboundResolverEndpoint) to CreateVpcEndpoint and ModifyVpcEndpoint APIs. - -# v1.89.1 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.89.0 (2023-03-08) - -* **Feature**: Introducing Amazon EC2 C7g, M7g and R7g instances, powered by the latest generation AWS Graviton3 processors and deliver up to 25% better performance over Graviton2-based instances. - -# v1.88.0 (2023-03-03) - -* **Feature**: This release adds support for a new boot mode for EC2 instances called 'UEFI Preferred'. - -# v1.87.0 (2023-02-28) - -* **Feature**: This release allows IMDS support to be set to v2-only on an existing AMI, so that all future instances launched from that AMI will use IMDSv2 by default. - -# v1.86.1 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.86.0 (2023-02-14) - -* **Feature**: With this release customers can turn host maintenance on or off when allocating or modifying a supported dedicated host. Host maintenance is turned on by default for supported hosts. - -# v1.85.0 (2023-02-10) - -* **Feature**: Adds support for waiters that automatically poll for an imported snapshot until it reaches the completed state. - -# v1.84.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. - -# v1.84.0 (2023-02-02) - -* **Feature**: Documentation updates for EC2. - -# v1.83.0 (2023-01-31) - -* **Feature**: This launch allows customers to associate up to 8 IP addresses to their NAT Gateways to increase the limit on concurrent connections to a single destination by eight times from 55K to 440K. - -# v1.82.0 (2023-01-30) - -* **Feature**: We add Prefix Lists as a new route destination option for LocalGatewayRoutes. This will allow customers to create routes to Prefix Lists. Prefix List routes will allow customers to group individual CIDR routes with the same target into a single route. - -# v1.81.0 (2023-01-25) - -* **Feature**: This release adds new functionality that allows customers to provision IPv6 CIDR blocks through Amazon VPC IP Address Manager (IPAM) as well as allowing customers to utilize IPAM Resource Discovery APIs. - -# v1.80.1 (2023-01-23) - -* No change notes available for this release. - -# v1.80.0 (2023-01-20) - -* **Feature**: C6in, M6in, M6idn, R6in and R6idn instances are powered by 3rd Generation Intel Xeon Scalable processors (code named Ice Lake) with an all-core turbo frequency of 3.5 GHz. - -# v1.79.0 (2023-01-19) - -* **Feature**: Adds SSM Parameter Resource Aliasing support to EC2 Launch Templates. Launch Templates can now store parameter aliases in place of AMI Resource IDs. CreateLaunchTemplateVersion and DescribeLaunchTemplateVersions now support a convenience flag, ResolveAlias, to return the resolved parameter value. - -# v1.78.0 (2023-01-13) - -* **Feature**: Documentation updates for EC2. - -# v1.77.0 (2022-12-20) - -* **Feature**: Adds support for pagination in the EC2 DescribeImages API. - -# v1.76.1 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.76.0 (2022-12-12) - -* **Feature**: This release updates DescribeFpgaImages to show supported instance types of AFIs in its response. - -# v1.75.0 (2022-12-05) - -* **Feature**: Documentation updates for EC2. - -# v1.74.1 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.0 (2022-11-29.2) - -* **Feature**: This release adds support for AWS Verified Access and the Hpc6id Amazon EC2 compute optimized instance type, which features 3rd generation Intel Xeon Scalable processors. - -# v1.73.0 (2022-11-29) - -* **Feature**: Introduces ENA Express, which uses AWS SRD and dynamic routing to increase throughput and minimize latency, adds support for trust relationships between Reachability Analyzer and AWS Organizations to enable cross-account analysis, and adds support for Infrastructure Performance metric subscriptions. - -# v1.72.1 (2022-11-22) - -* No change notes available for this release. - -# v1.72.0 (2022-11-18) - -* **Feature**: This release adds support for copying an Amazon Machine Image's tags when copying an AMI. - -# v1.71.0 (2022-11-17) - -* **Feature**: This release adds a new optional parameter "privateIpAddress" for the CreateNatGateway API. PrivateIPAddress will allow customers to select a custom Private IPv4 address instead of having it be auto-assigned. - -# v1.70.1 (2022-11-16) - -* No change notes available for this release. - -# v1.70.0 (2022-11-10) - -* **Feature**: This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price. - -# v1.69.0 (2022-11-09) - -* **Feature**: Amazon EC2 Trn1 instances, powered by AWS Trainium chips, are purpose built for high-performance deep learning training. u-24tb1.112xlarge and u-18tb1.112xlarge High Memory instances are purpose-built to run large in-memory databases. - -# v1.68.0 (2022-11-08) - -* **Feature**: This release enables sharing of EC2 Placement Groups across accounts and within AWS Organizations using Resource Access Manager - -# v1.67.0 (2022-11-07) - -* **Feature**: This release adds support for two new attributes for attribute-based instance type selection - NetworkBandwidthGbps and AllowedInstanceTypes. - -# v1.66.0 (2022-11-04) - -* **Feature**: This release adds API support for the recipient of an AMI account share to remove shared AMI launch permissions. - -# v1.65.0 (2022-10-31) - -* **Feature**: Elastic IP transfer is a new Amazon VPC feature that allows you to transfer your Elastic IP addresses from one AWS Account to another. - -# v1.64.0 (2022-10-27) - -* **Feature**: Feature supports the replacement of instance root volume using an updated AMI without requiring customers to stop their instance. - -# v1.63.3 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.2 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.1 (2022-10-06) - -* No change notes available for this release. - -# v1.63.0 (2022-10-04) - -* **Feature**: Added EnableNetworkAddressUsageMetrics flag for ModifyVpcAttribute, DescribeVpcAttribute APIs. - -# v1.62.0 (2022-10-03) - -* **Feature**: Adding an imdsSupport attribute to EC2 AMIs - -# v1.61.0 (2022-09-29) - -* **Feature**: u-3tb1 instances are powered by Intel Xeon Platinum 8176M (Skylake) processors and are purpose-built to run large in-memory databases. - -# v1.60.0 (2022-09-23) - -* **Feature**: Letting external AWS customers provide ImageId as a Launch Template override in FleetLaunchTemplateOverridesRequest - -# v1.59.0 (2022-09-22) - -* **Feature**: Documentation updates for Amazon EC2. - -# v1.58.0 (2022-09-20) - -* **Feature**: This release adds support for blocked paths to Amazon VPC Reachability Analyzer. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.57.0 (2022-09-19) - -* **Feature**: This release adds CapacityAllocations field to DescribeCapacityReservations - -# v1.56.0 (2022-09-15) - -* **Feature**: This feature allows customers to create tags for vpc-endpoint-connections and vpc-endpoint-service-permissions. - -# v1.55.0 (2022-09-14) - -* **Feature**: Documentation updates for Amazon EC2. -* **Feature**: This release adds support to send VPC Flow Logs to kinesis-data-firehose as new destination type -* **Feature**: This update introduces API operations to manage and create local gateway route tables, CoIP pools, and VIF group associations. -* **Feature**: Two new features for local gateway route tables: support for static routes targeting Elastic Network Interfaces and direct VPC routing. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.54.4 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.54.3 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.54.2 (2022-08-30) - -* No change notes available for this release. - -# v1.54.1 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.54.0 (2022-08-22) - -* **Feature**: R6a instances are powered by 3rd generation AMD EPYC (Milan) processors delivering all-core turbo frequency of 3.6 GHz. C6id, M6id, and R6id instances are powered by 3rd generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz. - -# v1.53.0 (2022-08-18) - -* **Feature**: This release adds support for VPN log options , a new feature allowing S2S VPN connections to send IKE activity logs to CloudWatch Logs - -# v1.52.1 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.52.0 (2022-08-10) - -* **Feature**: This release adds support for excluding specific data (non-root) volumes from multi-volume snapshot sets created from instances. - -# v1.51.3 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.2 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.1 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.0 (2022-07-29) - -* **Feature**: Documentation updates for Amazon EC2. - -# v1.50.1 (2022-07-28) - -* **Documentation**: Documentation updates for VM Import/Export. - -# v1.50.0 (2022-07-22) - -* **Feature**: Added support for EC2 M1 Mac instances. For more information, please visit aws.amazon.com/mac. - -# v1.49.1 (2022-07-18) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.49.0 (2022-07-14) - -* **Feature**: This release adds flow logs for Transit Gateway to allow customers to gain deeper visibility and insights into network traffic through their Transit Gateways. - -# v1.48.0 (2022-07-11) - -* **Feature**: Build, manage, and monitor a unified global network that connects resources running across your cloud and on-premises environments using the AWS Cloud WAN APIs. - -# v1.47.2 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.47.1 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.47.0 (2022-06-28) - -* **Feature**: This release adds a new spread placement group to EC2 Placement Groups: host level spread, which spread instances between physical hosts, available to Outpost customers only. CreatePlacementGroup and DescribePlacementGroups APIs were updated with a new parameter: SpreadLevel to support this feature. - -# v1.46.0 (2022-06-21) - -* **Feature**: This release adds support for Private IP VPNs, a new feature allowing S2S VPN connections to use private ip addresses as the tunnel outside ip address over Direct Connect as transport. - -# v1.45.1 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.0 (2022-05-26) - -* **Feature**: C7g instances, powered by the latest generation AWS Graviton3 processors, provide the best price performance in Amazon EC2 for compute-intensive workloads. - -# v1.44.0 (2022-05-24) - -* **Feature**: Stop Protection feature enables customers to protect their instances from accidental stop actions. - -# v1.43.1 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.0 (2022-05-12) - -* **Feature**: This release introduces a target type Gateway Load Balancer Endpoint for mirrored traffic. Customers can now specify GatewayLoadBalancerEndpoint option during the creation of a traffic mirror target. - -# v1.42.0 (2022-05-11) - -* **Feature**: This release updates AWS PrivateLink APIs to support IPv6 for PrivateLink Services and Endpoints of type 'Interface'. - -# v1.41.0 (2022-05-10) - -* **Feature**: Added support for using NitroTPM and UEFI Secure Boot on EC2 instances. - -# v1.40.0 (2022-05-06) - -* **Feature**: Add new state values for IPAMs, IPAM Scopes, and IPAM Pools. - -# v1.39.0 (2022-05-05) - -* **Feature**: Amazon EC2 I4i instances are powered by 3rd generation Intel Xeon Scalable processors and feature up to 30 TB of local AWS Nitro SSD storage - -# v1.38.0 (2022-05-03) - -* **Feature**: Adds support for allocating Dedicated Hosts on AWS Outposts. The AllocateHosts API now accepts an OutpostArn request parameter, and the DescribeHosts API now includes an OutpostArn response parameter. - -# v1.37.0 (2022-04-28) - -* **Feature**: This release adds support to query the public key and creation date of EC2 Key Pairs. Additionally, the format (pem or ppk) of a key pair can be specified when creating a new key pair. - -# v1.36.1 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.36.0 (2022-04-22) - -* **Feature**: Adds support for waiters that automatically poll for a deleted NAT Gateway until it reaches the deleted state. - -# v1.35.1 (2022-04-14) - -* **Documentation**: Documentation updates for Amazon EC2. - -# v1.35.0 (2022-04-12) - -* **Feature**: X2idn and X2iedn instances are powered by 3rd generation Intel Xeon Scalable processors with an all-core turbo frequency up to 3.5 GHzAmazon EC2. C6a instances are powered by 3rd generation AMD EPYC processors. - -# v1.34.0 (2022-03-30) - -* **Feature**: This release simplifies the auto-recovery configuration process enabling customers to set the recovery behavior to disabled or default -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.0 (2022-03-25) - -* **Feature**: This is release adds support for Amazon VPC Reachability Analyzer to analyze path through a Transit Gateway. - -# v1.32.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.0 (2022-03-15) - -* **Feature**: Adds the Cascade parameter to the DeleteIpam API. Customers can use this parameter to automatically delete their IPAM, including non-default scopes, pools, cidrs, and allocations. There mustn't be any pools provisioned in the default public scope to use this parameter. - -# v1.31.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Feature**: Updated service client model to latest release. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2022-01-28) - -* **Feature**: Updated to latest API model. - -# v1.28.0 (2022-01-14) - -* **Feature**: Updated API models -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2022-01-07) - -* **Feature**: API client updated -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. -* **Feature**: API client updated -* **Feature**: Updated to latest service endpoints - -# v1.25.0 (2021-12-02) - -* **Feature**: API client updated -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2021-11-30) - -* **Feature**: API client updated - -# v1.23.0 (2021-11-19) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.0 (2021-11-12) - -* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. -* **Feature**: Updated service to latest API model. -* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. - -# v1.21.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Feature**: Updated service to latest API model. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2021-10-21) - -* **Feature**: API client updated -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2021-10-11) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2021-09-24) - -* **Feature**: API client updated - -# v1.17.0 (2021-09-17) - -* **Feature**: Updated API client and endpoints to latest revision. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2021-09-02) - -* **Feature**: API client updated - -# v1.15.0 (2021-08-27) - -* **Feature**: Updated API model to latest revision. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2021-08-19) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2021-08-04) - -* **Feature**: Updated to latest API model. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2021-07-15) - -* **Feature**: Updated service model to latest version. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2021-07-01) - -* **Feature**: API client updated - -# v1.10.0 (2021-06-25) - -* **Feature**: API client updated -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2021-06-04) - -* **Feature**: Updated service client to latest API model. - -# v1.8.0 (2021-05-25) - -* **Feature**: API client updated - -# v1.7.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Feature**: Updated to latest service API model. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.go deleted file mode 100644 index 2a7294485..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.go +++ /dev/null @@ -1,1111 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - cryptorand "crypto/rand" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/protocol/query" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" - presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - smithyrand "github.com/aws/smithy-go/rand" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "EC2" -const ServiceAPIVersion = "2016-11-15" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/ec2") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/ec2") -} - -// Client provides the API client to make operations call for Amazon Elastic -// Compute Cloud. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveIdempotencyTokenProvider(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ec2") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, optFns...) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ec2", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func resolveIdempotencyTokenProvider(o *Options) { - if o.IdempotencyTokenProvider != nil { - return - } - o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ec2") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -// IdempotencyTokenProvider interface for providing idempotency token -type IdempotencyTokenProvider interface { - GetIdempotencyToken() (string, error) -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -// HTTPPresignerV4 represents presigner interface used by presign url client -type HTTPPresignerV4 interface { - PresignHTTP( - ctx context.Context, credentials aws.Credentials, r *http.Request, - payloadHash string, service string, region string, signingTime time.Time, - optFns ...func(*v4.SignerOptions), - ) (url string, signedHeader http.Header, err error) -} - -// PresignOptions represents the presign client options -type PresignOptions struct { - - // ClientOptions are list of functional options to mutate client options used by - // the presign client. - ClientOptions []func(*Options) - - // Presigner is the presigner used by the presign url client - Presigner HTTPPresignerV4 -} - -func (o PresignOptions) copy() PresignOptions { - clientOptions := make([]func(*Options), len(o.ClientOptions)) - copy(clientOptions, o.ClientOptions) - o.ClientOptions = clientOptions - return o -} - -// WithPresignClientFromClientOptions is a helper utility to retrieve a function -// that takes PresignOption as input -func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) { - return withPresignClientFromClientOptions(optFns).options -} - -type withPresignClientFromClientOptions []func(*Options) - -func (w withPresignClientFromClientOptions) options(o *PresignOptions) { - o.ClientOptions = append(o.ClientOptions, w...) -} - -// PresignClient represents the presign url client -type PresignClient struct { - client *Client - options PresignOptions -} - -// NewPresignClient generates a presign client using provided API Client and -// presign options -func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient { - var options PresignOptions - for _, fn := range optFns { - fn(&options) - } - if len(options.ClientOptions) != 0 { - c = New(c.options, options.ClientOptions...) - } - - if options.Presigner == nil { - options.Presigner = newDefaultV4Signer(c.options) - } - - return &PresignClient{ - client: c, - options: options, - } -} - -func withNopHTTPClientAPIOption(o *Options) { - o.HTTPClient = smithyhttp.NopClient{} -} - -type presignContextPolyfillMiddleware struct { -} - -func (*presignContextPolyfillMiddleware) ID() string { - return "presignContextPolyfill" -} - -func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - schemeID := rscheme.Scheme.SchemeID() - - if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { - if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningName(ctx, sn) - } - if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningRegion(ctx, sr) - } - } else if schemeID == "aws.auth#sigv4a" { - if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningName(ctx, sn) - } - if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) - } - } - - return next.HandleFinalize(ctx, in) -} - -type presignConverter PresignOptions - -func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { - if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { - stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) - } - if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { - stack.Finalize.Remove((*retry.Attempt)(nil).ID()) - } - if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) - } - stack.Deserialize.Clear() - stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) - stack.Build.Remove("UserAgent") - if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { - return err - } - - pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ - CredentialsProvider: options.Credentials, - Presigner: c.Presigner, - LogSigning: options.ClientLogMode.IsSigning(), - }) - if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { - return err - } - if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { - return err - } - // convert request to a GET request - err = query.AddAsGetRequestMiddleware(stack) - if err != nil { - return err - } - err = presignedurlcust.AddAsIsPresigningMiddleware(stack) - if err != nil { - return err - } - return nil -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.go deleted file mode 100644 index 4652a6b0c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts an Elastic IP address transfer. For more information, see [Accept a transferred Elastic IP address] in the -// Amazon VPC User Guide. -// -// [Accept a transferred Elastic IP address]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#using-instance-addressing-eips-transfer-accept -func (c *Client) AcceptAddressTransfer(ctx context.Context, params *AcceptAddressTransferInput, optFns ...func(*Options)) (*AcceptAddressTransferOutput, error) { - if params == nil { - params = &AcceptAddressTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptAddressTransfer", params, optFns, c.addOperationAcceptAddressTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptAddressTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptAddressTransferInput struct { - - // The Elastic IP address you are accepting for transfer. - // - // This member is required. - Address *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // tag : - The key/value combination of a tag assigned to the resource. Use the tag - // key in the filter name and the tag value as the filter value. For example, to - // find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type AcceptAddressTransferOutput struct { - - // An Elastic IP address transfer. - AddressTransfer *types.AddressTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptAddressTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptAddressTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptAddressTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptAddressTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptAddressTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptAddressTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptAddressTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptAddressTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.go deleted file mode 100644 index e6f0c2a7b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts a request to assign billing of the available capacity of a shared -// Capacity Reservation to your account. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations]. -// -// [Billing assignment for shared Amazon EC2 Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html -func (c *Client) AcceptCapacityReservationBillingOwnership(ctx context.Context, params *AcceptCapacityReservationBillingOwnershipInput, optFns ...func(*Options)) (*AcceptCapacityReservationBillingOwnershipOutput, error) { - if params == nil { - params = &AcceptCapacityReservationBillingOwnershipInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptCapacityReservationBillingOwnership", params, optFns, c.addOperationAcceptCapacityReservationBillingOwnershipMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptCapacityReservationBillingOwnershipOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptCapacityReservationBillingOwnershipInput struct { - - // The ID of the Capacity Reservation for which to accept the request. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AcceptCapacityReservationBillingOwnershipOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptCapacityReservationBillingOwnershipMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptCapacityReservationBillingOwnership{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptCapacityReservationBillingOwnership{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptCapacityReservationBillingOwnership"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptCapacityReservationBillingOwnershipValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptCapacityReservationBillingOwnership(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptCapacityReservationBillingOwnership(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptCapacityReservationBillingOwnership", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.go deleted file mode 100644 index 8827cfe50..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call. -func (c *Client) AcceptReservedInstancesExchangeQuote(ctx context.Context, params *AcceptReservedInstancesExchangeQuoteInput, optFns ...func(*Options)) (*AcceptReservedInstancesExchangeQuoteOutput, error) { - if params == nil { - params = &AcceptReservedInstancesExchangeQuoteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptReservedInstancesExchangeQuote", params, optFns, c.addOperationAcceptReservedInstancesExchangeQuoteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptReservedInstancesExchangeQuoteOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for accepting the quote. -type AcceptReservedInstancesExchangeQuoteInput struct { - - // The IDs of the Convertible Reserved Instances to exchange for another - // Convertible Reserved Instance of the same or higher value. - // - // This member is required. - ReservedInstanceIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The configuration of the target Convertible Reserved Instance to exchange for - // your current Convertible Reserved Instances. - TargetConfigurations []types.TargetConfigurationRequest - - noSmithyDocumentSerde -} - -// The result of the exchange and whether it was successful . -type AcceptReservedInstancesExchangeQuoteOutput struct { - - // The ID of the successful exchange. - ExchangeId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptReservedInstancesExchangeQuoteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptReservedInstancesExchangeQuote{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptReservedInstancesExchangeQuote{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptReservedInstancesExchangeQuote"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptReservedInstancesExchangeQuoteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptReservedInstancesExchangeQuote(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptReservedInstancesExchangeQuote(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptReservedInstancesExchangeQuote", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.go deleted file mode 100644 index ddb8e9347..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts a request to associate subnets with a transit gateway multicast domain. -func (c *Client) AcceptTransitGatewayMulticastDomainAssociations(ctx context.Context, params *AcceptTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*Options)) (*AcceptTransitGatewayMulticastDomainAssociationsOutput, error) { - if params == nil { - params = &AcceptTransitGatewayMulticastDomainAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptTransitGatewayMulticastDomainAssociations", params, optFns, c.addOperationAcceptTransitGatewayMulticastDomainAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptTransitGatewayMulticastDomainAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptTransitGatewayMulticastDomainAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of the subnets to associate with the transit gateway multicast domain. - SubnetIds []string - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -type AcceptTransitGatewayMulticastDomainAssociationsOutput struct { - - // Information about the multicast domain associations. - Associations *types.TransitGatewayMulticastDomainAssociations - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptTransitGatewayMulticastDomainAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptTransitGatewayMulticastDomainAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptTransitGatewayMulticastDomainAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptTransitGatewayMulticastDomainAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptTransitGatewayMulticastDomainAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.go deleted file mode 100644 index 5ea0d0147..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts a transit gateway peering attachment request. The peering attachment -// must be in the pendingAcceptance state. -func (c *Client) AcceptTransitGatewayPeeringAttachment(ctx context.Context, params *AcceptTransitGatewayPeeringAttachmentInput, optFns ...func(*Options)) (*AcceptTransitGatewayPeeringAttachmentOutput, error) { - if params == nil { - params = &AcceptTransitGatewayPeeringAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptTransitGatewayPeeringAttachment", params, optFns, c.addOperationAcceptTransitGatewayPeeringAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptTransitGatewayPeeringAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptTransitGatewayPeeringAttachmentInput struct { - - // The ID of the transit gateway attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AcceptTransitGatewayPeeringAttachmentOutput struct { - - // The transit gateway peering attachment. - TransitGatewayPeeringAttachment *types.TransitGatewayPeeringAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptTransitGatewayPeeringAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptTransitGatewayPeeringAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptTransitGatewayPeeringAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptTransitGatewayPeeringAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptTransitGatewayPeeringAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptTransitGatewayPeeringAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.go deleted file mode 100644 index 6d8077c5a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts a request to attach a VPC to a transit gateway. -// -// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your -// pending VPC attachment requests. Use RejectTransitGatewayVpcAttachmentto reject a VPC attachment request. -func (c *Client) AcceptTransitGatewayVpcAttachment(ctx context.Context, params *AcceptTransitGatewayVpcAttachmentInput, optFns ...func(*Options)) (*AcceptTransitGatewayVpcAttachmentOutput, error) { - if params == nil { - params = &AcceptTransitGatewayVpcAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptTransitGatewayVpcAttachment", params, optFns, c.addOperationAcceptTransitGatewayVpcAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptTransitGatewayVpcAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptTransitGatewayVpcAttachmentInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AcceptTransitGatewayVpcAttachmentOutput struct { - - // The VPC attachment. - TransitGatewayVpcAttachment *types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptTransitGatewayVpcAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptTransitGatewayVpcAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptTransitGatewayVpcAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptTransitGatewayVpcAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptTransitGatewayVpcAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptTransitGatewayVpcAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.go deleted file mode 100644 index 52327eb0e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts connection requests to your VPC endpoint service. -func (c *Client) AcceptVpcEndpointConnections(ctx context.Context, params *AcceptVpcEndpointConnectionsInput, optFns ...func(*Options)) (*AcceptVpcEndpointConnectionsOutput, error) { - if params == nil { - params = &AcceptVpcEndpointConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptVpcEndpointConnections", params, optFns, c.addOperationAcceptVpcEndpointConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptVpcEndpointConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptVpcEndpointConnectionsInput struct { - - // The ID of the VPC endpoint service. - // - // This member is required. - ServiceId *string - - // The IDs of the interface VPC endpoints. - // - // This member is required. - VpcEndpointIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AcceptVpcEndpointConnectionsOutput struct { - - // Information about the interface endpoints that were not accepted, if applicable. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptVpcEndpointConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptVpcEndpointConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptVpcEndpointConnectionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptVpcEndpointConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptVpcEndpointConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptVpcEndpointConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.go deleted file mode 100644 index 4ca7541cb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accept a VPC peering connection request. To accept a request, the VPC peering -// connection must be in the pending-acceptance state, and you must be the owner -// of the peer VPC. Use DescribeVpcPeeringConnectionsto view your outstanding VPC peering connection requests. -// -// For an inter-Region VPC peering connection request, you must accept the VPC -// peering connection in the Region of the accepter VPC. -func (c *Client) AcceptVpcPeeringConnection(ctx context.Context, params *AcceptVpcPeeringConnectionInput, optFns ...func(*Options)) (*AcceptVpcPeeringConnectionOutput, error) { - if params == nil { - params = &AcceptVpcPeeringConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptVpcPeeringConnection", params, optFns, c.addOperationAcceptVpcPeeringConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptVpcPeeringConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptVpcPeeringConnectionInput struct { - - // The ID of the VPC peering connection. You must specify this parameter in the - // request. - // - // This member is required. - VpcPeeringConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AcceptVpcPeeringConnectionOutput struct { - - // Information about the VPC peering connection. - VpcPeeringConnection *types.VpcPeeringConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptVpcPeeringConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAcceptVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAcceptVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptVpcPeeringConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptVpcPeeringConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptVpcPeeringConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptVpcPeeringConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptVpcPeeringConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.go deleted file mode 100644 index 21a166c98..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Advertises an IPv4 or IPv6 address range that is provisioned for use with your -// Amazon Web Services resources through bring your own IP addresses (BYOIP). -// -// You can perform this operation at most once every 10 seconds, even if you -// specify different address ranges each time. -// -// We recommend that you stop advertising the BYOIP CIDR from other locations when -// you advertise it from Amazon Web Services. To minimize down time, you can -// configure your Amazon Web Services resources to use an address from a BYOIP CIDR -// before it is advertised, and then simultaneously stop advertising it from the -// current location and start advertising it through Amazon Web Services. -// -// It can take a few minutes before traffic to the specified addresses starts -// routing to Amazon Web Services because of BGP propagation delays. -// -// To stop advertising the BYOIP CIDR, use WithdrawByoipCidr. -func (c *Client) AdvertiseByoipCidr(ctx context.Context, params *AdvertiseByoipCidrInput, optFns ...func(*Options)) (*AdvertiseByoipCidrOutput, error) { - if params == nil { - params = &AdvertiseByoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AdvertiseByoipCidr", params, optFns, c.addOperationAdvertiseByoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AdvertiseByoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AdvertiseByoipCidrInput struct { - - // The address range, in CIDR notation. This must be the exact range that you - // provisioned. You can't advertise only a portion of the provisioned range. - // - // This member is required. - Cidr *string - - // The public 2-byte or 4-byte ASN that you want to advertise. - Asn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // If you have [Local Zones] enabled, you can choose a network border group for Local Zones - // when you provision and advertise a BYOIPv4 CIDR. Choose the network border group - // carefully as the EIP and the Amazon Web Services resource it is associated with - // must reside in the same network border group. - // - // You can provision BYOIP address ranges to and advertise them in the following - // Local Zone network border groups: - // - // - us-east-1-dfw-2 - // - // - us-west-2-lax-1 - // - // - us-west-2-phx-2 - // - // You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this - // time. - // - // [Local Zones]: https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html - NetworkBorderGroup *string - - noSmithyDocumentSerde -} - -type AdvertiseByoipCidrOutput struct { - - // Information about the address range. - ByoipCidr *types.ByoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAdvertiseByoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAdvertiseByoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAdvertiseByoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AdvertiseByoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAdvertiseByoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAdvertiseByoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAdvertiseByoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AdvertiseByoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.go deleted file mode 100644 index 2e5b63915..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Allocates an Elastic IP address to your Amazon Web Services account. After you -// allocate the Elastic IP address you can associate it with an instance or network -// interface. After you release an Elastic IP address, it is released to the IP -// address pool and can be allocated to a different Amazon Web Services account. -// -// You can allocate an Elastic IP address from an address pool owned by Amazon Web -// Services or from an address pool created from a public IPv4 address range that -// you have brought to Amazon Web Services for use with your Amazon Web Services -// resources using bring your own IP addresses (BYOIP). For more information, see [Bring Your Own IP Addresses (BYOIP)] -// in the Amazon EC2 User Guide. -// -// If you release an Elastic IP address, you might be able to recover it. You -// cannot recover an Elastic IP address that you released after it is allocated to -// another Amazon Web Services account. To attempt to recover an Elastic IP address -// that you released, specify it in this operation. -// -// For more information, see [Elastic IP Addresses] in the Amazon EC2 User Guide. -// -// You can allocate a carrier IP address which is a public IP address from a -// telecommunication carrier, to a network interface which resides in a subnet in a -// Wavelength Zone (for example an EC2 instance). -// -// [Bring Your Own IP Addresses (BYOIP)]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html -// [Elastic IP Addresses]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html -func (c *Client) AllocateAddress(ctx context.Context, params *AllocateAddressInput, optFns ...func(*Options)) (*AllocateAddressOutput, error) { - if params == nil { - params = &AllocateAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AllocateAddress", params, optFns, c.addOperationAllocateAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AllocateAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AllocateAddressInput struct { - - // The Elastic IP address to recover or an IPv4 address from an address pool. - Address *string - - // The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 - // select an address from the address pool. Alternatively, specify a specific - // address from the address pool. - CustomerOwnedIpv4Pool *string - - // The network ( vpc ). - Domain types.DomainType - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR - // provisioned to it. For more information, see [Allocate sequential Elastic IP addresses from an IPAM pool]in the Amazon VPC IPAM User Guide. - // - // [Allocate sequential Elastic IP addresses from an IPAM pool]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html - IpamPoolId *string - - // A unique set of Availability Zones, Local Zones, or Wavelength Zones from - // which Amazon Web Services advertises IP addresses. Use this parameter to limit - // the IP address to this location. IP addresses cannot move between network border - // groups. - NetworkBorderGroup *string - - // The ID of an address pool that you own. Use this parameter to let Amazon EC2 - // select an address from the address pool. To specify a specific address from the - // address pool, use the Address parameter instead. - PublicIpv4Pool *string - - // The tags to assign to the Elastic IP address. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type AllocateAddressOutput struct { - - // The ID that represents the allocation of the Elastic IP address. - AllocationId *string - - // The carrier IP address. This option is only available for network interfaces - // that reside in a subnet in a Wavelength Zone. - CarrierIp *string - - // The customer-owned IP address. - CustomerOwnedIp *string - - // The ID of the customer-owned address pool. - CustomerOwnedIpv4Pool *string - - // The network ( vpc ). - Domain types.DomainType - - // The set of Availability Zones, Local Zones, or Wavelength Zones from which - // Amazon Web Services advertises IP addresses. - NetworkBorderGroup *string - - // The Elastic IP address. - PublicIp *string - - // The ID of an address pool. - PublicIpv4Pool *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAllocateAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAllocateAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAllocateAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AllocateAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAllocateAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAllocateAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AllocateAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.go deleted file mode 100644 index b8385eb3f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Allocates a Dedicated Host to your account. At a minimum, specify the supported -// instance type or instance family, the Availability Zone in which to allocate the -// host, and the number of hosts to allocate. -func (c *Client) AllocateHosts(ctx context.Context, params *AllocateHostsInput, optFns ...func(*Options)) (*AllocateHostsOutput, error) { - if params == nil { - params = &AllocateHostsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AllocateHosts", params, optFns, c.addOperationAllocateHostsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AllocateHostsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AllocateHostsInput struct { - - // The IDs of the Outpost hardware assets on which to allocate the Dedicated - // Hosts. Targeting specific hardware assets on an Outpost can help to minimize - // latency between your workloads. This parameter is supported only if you specify - // OutpostArn. If you are allocating the Dedicated Hosts in a Region, omit this - // parameter. - // - // - If you specify this parameter, you can omit Quantity. In this case, Amazon - // EC2 allocates a Dedicated Host on each specified hardware asset. - // - // - If you specify both AssetIds and Quantity, then the value for Quantity must - // be equal to the number of asset IDs specified. - AssetIds []string - - // Indicates whether the host accepts any untargeted instance launches that match - // its instance type configuration, or if it only accepts Host tenancy instance - // launches that specify its unique host ID. For more information, see [Understanding auto-placement and affinity]in the - // Amazon EC2 User Guide. - // - // Default: off - // - // [Understanding auto-placement and affinity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding - AutoPlacement types.AutoPlacement - - // The Availability Zone in which to allocate the Dedicated Host. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Indicates whether to enable or disable host maintenance for the Dedicated Host. - // For more information, see [Host maintenance]in the Amazon EC2 User Guide. - // - // [Host maintenance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html - HostMaintenance types.HostMaintenance - - // Indicates whether to enable or disable host recovery for the Dedicated Host. - // Host recovery is disabled by default. For more information, see [Host recovery]in the Amazon - // EC2 User Guide. - // - // Default: off - // - // [Host recovery]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html - HostRecovery types.HostRecovery - - // Specifies the instance family to be supported by the Dedicated Hosts. If you - // specify an instance family, the Dedicated Hosts support multiple instance types - // within that instance family. - // - // If you want the Dedicated Hosts to support a specific instance type only, omit - // this parameter and specify InstanceType instead. You cannot specify - // InstanceFamily and InstanceType in the same request. - InstanceFamily *string - - // Specifies the instance type to be supported by the Dedicated Hosts. If you - // specify an instance type, the Dedicated Hosts support instances of the specified - // instance type only. - // - // If you want the Dedicated Hosts to support multiple instance types in a - // specific instance family, omit this parameter and specify InstanceFamily - // instead. You cannot specify InstanceType and InstanceFamily in the same request. - InstanceType *string - - // The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to - // allocate the Dedicated Host. If you specify OutpostArn, you can optionally - // specify AssetIds. - // - // If you are allocating the Dedicated Host in a Region, omit this parameter. - OutpostArn *string - - // The number of Dedicated Hosts to allocate to your account with these - // parameters. If you are allocating the Dedicated Hosts on an Outpost, and you - // specify AssetIds, you can omit this parameter. In this case, Amazon EC2 - // allocates a Dedicated Host on each specified hardware asset. If you specify both - // AssetIds and Quantity, then the value that you specify for Quantity must be - // equal to the number of asset IDs specified. - Quantity *int32 - - // The tags to apply to the Dedicated Host during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Contains the output of AllocateHosts. -type AllocateHostsOutput struct { - - // The ID of the allocated Dedicated Host. This is used to launch an instance onto - // a specific host. - HostIds []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAllocateHostsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAllocateHosts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAllocateHosts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AllocateHosts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAllocateHosts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAllocateHosts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AllocateHosts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.go deleted file mode 100644 index 933d56278..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool -// locale. The locale is the Amazon Web Services Region where this IPAM pool is -// available for allocations. -// -// In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM -// pool or to a resource. For more information, see [Allocate CIDRs]in the Amazon VPC IPAM User -// Guide. -// -// This action creates an allocation with strong consistency. The returned CIDR -// will not overlap with any other allocations from the same pool. -// -// [Allocate CIDRs]: https://docs.aws.amazon.com/vpc/latest/ipam/allocate-cidrs-ipam.html -func (c *Client) AllocateIpamPoolCidr(ctx context.Context, params *AllocateIpamPoolCidrInput, optFns ...func(*Options)) (*AllocateIpamPoolCidrOutput, error) { - if params == nil { - params = &AllocateIpamPoolCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AllocateIpamPoolCidr", params, optFns, c.addOperationAllocateIpamPoolCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AllocateIpamPoolCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AllocateIpamPoolCidrInput struct { - - // The ID of the IPAM pool from which you would like to allocate a CIDR. - // - // This member is required. - IpamPoolId *string - - // Include a particular CIDR range that can be returned by the pool. Allowed CIDRs - // are only allowed if using netmask length for allocation. - AllowedCidrs []string - - // The CIDR you would like to allocate from the IPAM pool. Note the following: - // - // - If there is no DefaultNetmaskLength allocation rule set on the pool, you - // must specify either the NetmaskLength or the CIDR. - // - // - If the DefaultNetmaskLength allocation rule is set on the pool, you can - // specify either the NetmaskLength or the CIDR and the DefaultNetmaskLength - // allocation rule will be ignored. - // - // Possible values: Any available IPv4 or IPv6 CIDR. - Cidr *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the allocation. - Description *string - - // Exclude a particular CIDR range from being returned by the pool. Disallowed - // CIDRs are only allowed if using netmask length for allocation. - DisallowedCidrs []string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The netmask length of the CIDR you would like to allocate from the IPAM pool. - // Note the following: - // - // - If there is no DefaultNetmaskLength allocation rule set on the pool, you - // must specify either the NetmaskLength or the CIDR. - // - // - If the DefaultNetmaskLength allocation rule is set on the pool, you can - // specify either the NetmaskLength or the CIDR and the DefaultNetmaskLength - // allocation rule will be ignored. - // - // Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask - // lengths for IPv6 addresses are 0 - 128. - NetmaskLength *int32 - - // A preview of the next available CIDR in a pool. - PreviewNextCidr *bool - - noSmithyDocumentSerde -} - -type AllocateIpamPoolCidrOutput struct { - - // Information about the allocation created. - IpamPoolAllocation *types.IpamPoolAllocation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAllocateIpamPoolCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAllocateIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAllocateIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AllocateIpamPoolCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAllocateIpamPoolCidrMiddleware(stack, options); err != nil { - return err - } - if err = addOpAllocateIpamPoolCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAllocateIpamPoolCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAllocateIpamPoolCidr struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAllocateIpamPoolCidr) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAllocateIpamPoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AllocateIpamPoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AllocateIpamPoolCidrInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAllocateIpamPoolCidrMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAllocateIpamPoolCidr{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAllocateIpamPoolCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AllocateIpamPoolCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.go deleted file mode 100644 index 93999d67a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Applies a security group to the association between the target network and the -// Client VPN endpoint. This action replaces the existing security groups with the -// specified security groups. -func (c *Client) ApplySecurityGroupsToClientVpnTargetNetwork(ctx context.Context, params *ApplySecurityGroupsToClientVpnTargetNetworkInput, optFns ...func(*Options)) (*ApplySecurityGroupsToClientVpnTargetNetworkOutput, error) { - if params == nil { - params = &ApplySecurityGroupsToClientVpnTargetNetworkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ApplySecurityGroupsToClientVpnTargetNetwork", params, optFns, c.addOperationApplySecurityGroupsToClientVpnTargetNetworkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ApplySecurityGroupsToClientVpnTargetNetworkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ApplySecurityGroupsToClientVpnTargetNetworkInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // The IDs of the security groups to apply to the associated target network. Up to - // 5 security groups can be applied to an associated target network. - // - // This member is required. - SecurityGroupIds []string - - // The ID of the VPC in which the associated target network is located. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ApplySecurityGroupsToClientVpnTargetNetworkOutput struct { - - // The IDs of the applied security groups. - SecurityGroupIds []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationApplySecurityGroupsToClientVpnTargetNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpApplySecurityGroupsToClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpApplySecurityGroupsToClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ApplySecurityGroupsToClientVpnTargetNetwork"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpApplySecurityGroupsToClientVpnTargetNetworkValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplySecurityGroupsToClientVpnTargetNetwork(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opApplySecurityGroupsToClientVpnTargetNetwork(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ApplySecurityGroupsToClientVpnTargetNetwork", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.go deleted file mode 100644 index 6323f310e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Assigns the specified IPv6 addresses to the specified network interface. You -// can specify specific IPv6 addresses, or you can specify the number of IPv6 -// addresses to be automatically assigned from the subnet's IPv6 CIDR block range. -// You can assign as many IPv6 addresses to a network interface as you can assign -// private IPv4 addresses, and the limit varies by instance type. -// -// You must specify either the IPv6 addresses or the IPv6 address count in the -// request. -// -// You can optionally use Prefix Delegation on the network interface. You must -// specify either the IPV6 Prefix Delegation prefixes, or the IPv6 Prefix -// Delegation count. For information, see [Assigning prefixes to network interfaces]in the Amazon EC2 User Guide. -// -// [Assigning prefixes to network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html -func (c *Client) AssignIpv6Addresses(ctx context.Context, params *AssignIpv6AddressesInput, optFns ...func(*Options)) (*AssignIpv6AddressesOutput, error) { - if params == nil { - params = &AssignIpv6AddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssignIpv6Addresses", params, optFns, c.addOperationAssignIpv6AddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssignIpv6AddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssignIpv6AddressesInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The number of additional IPv6 addresses to assign to the network interface. The - // specified number of IPv6 addresses are assigned in addition to the existing IPv6 - // addresses that are already assigned to the network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't use - // this option if specifying specific IPv6 addresses. - Ipv6AddressCount *int32 - - // The IPv6 addresses to be assigned to the network interface. You can't use this - // option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []string - - // The number of IPv6 prefixes that Amazon Web Services automatically assigns to - // the network interface. You cannot use this option if you use the Ipv6Prefixes - // option. - Ipv6PrefixCount *int32 - - // One or more IPv6 prefixes assigned to the network interface. You can't use this - // option if you use the Ipv6PrefixCount option. - Ipv6Prefixes []string - - noSmithyDocumentSerde -} - -type AssignIpv6AddressesOutput struct { - - // The new IPv6 addresses assigned to the network interface. Existing IPv6 - // addresses that were assigned to the network interface before the request are not - // included. - AssignedIpv6Addresses []string - - // The IPv6 prefixes that are assigned to the network interface. - AssignedIpv6Prefixes []string - - // The ID of the network interface. - NetworkInterfaceId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssignIpv6AddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssignIpv6Addresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssignIpv6Addresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssignIpv6Addresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssignIpv6AddressesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignIpv6Addresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssignIpv6Addresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssignIpv6Addresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.go deleted file mode 100644 index 72df0d701..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Assigns the specified secondary private IP addresses to the specified network -// interface. -// -// You can specify specific secondary IP addresses, or you can specify the number -// of secondary IP addresses to be automatically assigned from the subnet's CIDR -// block range. The number of secondary IP addresses that you can assign to an -// instance varies by instance type. For more information about Elastic IP -// addresses, see [Elastic IP Addresses]in the Amazon EC2 User Guide. -// -// When you move a secondary private IP address to another network interface, any -// Elastic IP address that is associated with the IP address is also moved. -// -// Remapping an IP address is an asynchronous operation. When you move an IP -// address from one network interface to another, check -// network/interfaces/macs/mac/local-ipv4s in the instance metadata to confirm that -// the remapping is complete. -// -// You must specify either the IP addresses or the IP address count in the request. -// -// You can optionally use Prefix Delegation on the network interface. You must -// specify either the IPv4 Prefix Delegation prefixes, or the IPv4 Prefix -// Delegation count. For information, see [Assigning prefixes to network interfaces]in the Amazon EC2 User Guide. -// -// [Elastic IP Addresses]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html -// [Assigning prefixes to network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html -func (c *Client) AssignPrivateIpAddresses(ctx context.Context, params *AssignPrivateIpAddressesInput, optFns ...func(*Options)) (*AssignPrivateIpAddressesOutput, error) { - if params == nil { - params = &AssignPrivateIpAddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssignPrivateIpAddresses", params, optFns, c.addOperationAssignPrivateIpAddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssignPrivateIpAddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for AssignPrivateIpAddresses. -type AssignPrivateIpAddressesInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // Indicates whether to allow an IP address that is already assigned to another - // network interface or instance to be reassigned to the specified network - // interface. - AllowReassignment *bool - - // The number of IPv4 prefixes that Amazon Web Services automatically assigns to - // the network interface. You can't use this option if you use the Ipv4 Prefixes - // option. - Ipv4PrefixCount *int32 - - // One or more IPv4 prefixes assigned to the network interface. You can't use this - // option if you use the Ipv4PrefixCount option. - Ipv4Prefixes []string - - // The IP addresses to be assigned as a secondary private IP address to the - // network interface. You can't specify this parameter when also specifying a - // number of secondary IP addresses. - // - // If you don't specify an IP address, Amazon EC2 automatically selects an IP - // address within the subnet range. - PrivateIpAddresses []string - - // The number of secondary IP addresses to assign to the network interface. You - // can't specify this parameter when also specifying private IP addresses. - SecondaryPrivateIpAddressCount *int32 - - noSmithyDocumentSerde -} - -type AssignPrivateIpAddressesOutput struct { - - // The IPv4 prefixes that are assigned to the network interface. - AssignedIpv4Prefixes []types.Ipv4PrefixSpecification - - // The private IP addresses assigned to the network interface. - AssignedPrivateIpAddresses []types.AssignedPrivateIpAddress - - // The ID of the network interface. - NetworkInterfaceId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssignPrivateIpAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssignPrivateIpAddresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssignPrivateIpAddresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssignPrivateIpAddresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssignPrivateIpAddressesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignPrivateIpAddresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssignPrivateIpAddresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssignPrivateIpAddresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.go deleted file mode 100644 index 08d17ad10..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Assigns private IPv4 addresses to a private NAT gateway. For more information, -// see [Work with NAT gateways]in the Amazon VPC User Guide. -// -// [Work with NAT gateways]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html -func (c *Client) AssignPrivateNatGatewayAddress(ctx context.Context, params *AssignPrivateNatGatewayAddressInput, optFns ...func(*Options)) (*AssignPrivateNatGatewayAddressOutput, error) { - if params == nil { - params = &AssignPrivateNatGatewayAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssignPrivateNatGatewayAddress", params, optFns, c.addOperationAssignPrivateNatGatewayAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssignPrivateNatGatewayAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssignPrivateNatGatewayAddressInput struct { - - // The ID of the NAT gateway. - // - // This member is required. - NatGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The number of private IP addresses to assign to the NAT gateway. You can't - // specify this parameter when also specifying private IP addresses. - PrivateIpAddressCount *int32 - - // The private IPv4 addresses you want to assign to the private NAT gateway. - PrivateIpAddresses []string - - noSmithyDocumentSerde -} - -type AssignPrivateNatGatewayAddressOutput struct { - - // NAT gateway IP addresses. - NatGatewayAddresses []types.NatGatewayAddress - - // The ID of the NAT gateway. - NatGatewayId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssignPrivateNatGatewayAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssignPrivateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssignPrivateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssignPrivateNatGatewayAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssignPrivateNatGatewayAddressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignPrivateNatGatewayAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssignPrivateNatGatewayAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssignPrivateNatGatewayAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.go deleted file mode 100644 index cd8bcb78b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an Elastic IP address, or carrier IP address (for instances that are -// in subnets in Wavelength Zones) with an instance or a network interface. Before -// you can use an Elastic IP address, you must allocate it to your account. -// -// If the Elastic IP address is already associated with a different instance, it -// is disassociated from that instance and associated with the specified instance. -// If you associate an Elastic IP address with an instance that has an existing -// Elastic IP address, the existing address is disassociated from the instance, but -// remains allocated to your account. -// -// [Subnets in Wavelength Zones] You can associate an IP address from the -// telecommunication carrier to the instance or network interface. -// -// You cannot associate an Elastic IP address with an interface in a different -// network border group. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error, and you may be charged for each time the -// Elastic IP address is remapped to the same instance. For more information, see -// the Elastic IP Addresses section of [Amazon EC2 Pricing]. -// -// [Amazon EC2 Pricing]: http://aws.amazon.com/ec2/pricing/ -func (c *Client) AssociateAddress(ctx context.Context, params *AssociateAddressInput, optFns ...func(*Options)) (*AssociateAddressOutput, error) { - if params == nil { - params = &AssociateAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateAddress", params, optFns, c.addOperationAssociateAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateAddressInput struct { - - // The allocation ID. This is required. - AllocationId *string - - // Reassociation is automatic, but you can specify false to ensure the operation - // fails if the Elastic IP address is already associated with another resource. - AllowReassociation *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the instance. The instance must have exactly one attached network - // interface. You can specify either the instance ID or the network interface ID, - // but not both. - InstanceId *string - - // The ID of the network interface. If the instance has more than one network - // interface, you must specify a network interface ID. - // - // You can specify either the instance ID or the network interface ID, but not - // both. - NetworkInterfaceId *string - - // The primary or secondary private IP address to associate with the Elastic IP - // address. If no private IP address is specified, the Elastic IP address is - // associated with the primary private IP address. - PrivateIpAddress *string - - // Deprecated. - PublicIp *string - - noSmithyDocumentSerde -} - -type AssociateAddressOutput struct { - - // The ID that represents the association of the Elastic IP address with an - // instance. - AssociationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.go deleted file mode 100644 index d4145916e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Initiates a request to assign billing of the unused capacity of a shared -// Capacity Reservation to a consumer account that is consolidated under the same -// Amazon Web Services organizations payer account. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations]. -// -// [Billing assignment for shared Amazon EC2 Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html -func (c *Client) AssociateCapacityReservationBillingOwner(ctx context.Context, params *AssociateCapacityReservationBillingOwnerInput, optFns ...func(*Options)) (*AssociateCapacityReservationBillingOwnerOutput, error) { - if params == nil { - params = &AssociateCapacityReservationBillingOwnerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateCapacityReservationBillingOwner", params, optFns, c.addOperationAssociateCapacityReservationBillingOwnerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateCapacityReservationBillingOwnerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateCapacityReservationBillingOwnerInput struct { - - // The ID of the Capacity Reservation. - // - // This member is required. - CapacityReservationId *string - - // The ID of the consumer account to which to assign billing. - // - // This member is required. - UnusedReservationBillingOwnerId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateCapacityReservationBillingOwnerOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateCapacityReservationBillingOwnerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateCapacityReservationBillingOwner{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateCapacityReservationBillingOwner{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateCapacityReservationBillingOwner"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateCapacityReservationBillingOwnerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateCapacityReservationBillingOwner(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateCapacityReservationBillingOwner(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateCapacityReservationBillingOwner", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.go deleted file mode 100644 index 3edf2cca0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a target network with a Client VPN endpoint. A target network is a -// subnet in a VPC. You can associate multiple subnets from the same VPC with a -// Client VPN endpoint. You can associate only one subnet in each Availability -// Zone. We recommend that you associate at least two subnets to provide -// Availability Zone redundancy. -// -// If you specified a VPC when you created the Client VPN endpoint or if you have -// previous subnet associations, the specified subnet must be in the same VPC. To -// specify a subnet that's in a different VPC, you must first modify the Client VPN -// endpoint (ModifyClientVpnEndpoint ) and change the VPC that's associated with it. -func (c *Client) AssociateClientVpnTargetNetwork(ctx context.Context, params *AssociateClientVpnTargetNetworkInput, optFns ...func(*Options)) (*AssociateClientVpnTargetNetworkOutput, error) { - if params == nil { - params = &AssociateClientVpnTargetNetworkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateClientVpnTargetNetwork", params, optFns, c.addOperationAssociateClientVpnTargetNetworkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateClientVpnTargetNetworkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateClientVpnTargetNetworkInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // The ID of the subnet to associate with the Client VPN endpoint. - // - // This member is required. - SubnetId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateClientVpnTargetNetworkOutput struct { - - // The unique ID of the target network association. - AssociationId *string - - // The current state of the target network association. - Status *types.AssociationStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateClientVpnTargetNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateClientVpnTargetNetwork"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAssociateClientVpnTargetNetworkMiddleware(stack, options); err != nil { - return err - } - if err = addOpAssociateClientVpnTargetNetworkValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateClientVpnTargetNetwork(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAssociateClientVpnTargetNetwork struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAssociateClientVpnTargetNetwork) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAssociateClientVpnTargetNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AssociateClientVpnTargetNetworkInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateClientVpnTargetNetworkInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAssociateClientVpnTargetNetworkMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateClientVpnTargetNetwork{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAssociateClientVpnTargetNetwork(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateClientVpnTargetNetwork", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.go deleted file mode 100644 index 1b04c25a9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a set of DHCP options (that you've previously created) with the -// specified VPC, or associates no DHCP options with the VPC. -// -// After you associate the options with the VPC, any existing instances and all -// new instances that you launch in that VPC use the options. You don't need to -// restart or relaunch the instances. They automatically pick up the changes within -// a few hours, depending on how frequently the instance renews its DHCP lease. You -// can explicitly renew the lease using the operating system on the instance. -// -// For more information, see [DHCP option sets] in the Amazon VPC User Guide. -// -// [DHCP option sets]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html -func (c *Client) AssociateDhcpOptions(ctx context.Context, params *AssociateDhcpOptionsInput, optFns ...func(*Options)) (*AssociateDhcpOptionsOutput, error) { - if params == nil { - params = &AssociateDhcpOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateDhcpOptions", params, optFns, c.addOperationAssociateDhcpOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateDhcpOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateDhcpOptionsInput struct { - - // The ID of the DHCP options set, or default to associate no DHCP options with - // the VPC. - // - // This member is required. - DhcpOptionsId *string - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateDhcpOptionsOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateDhcpOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateDhcpOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateDhcpOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateDhcpOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateDhcpOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDhcpOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateDhcpOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.go deleted file mode 100644 index c3e3e1ada..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an Identity and Access Management (IAM) role with an Certificate -// Manager (ACM) certificate. This enables the certificate to be used by the ACM -// for Nitro Enclaves application inside an enclave. For more information, see [Certificate Manager for Nitro Enclaves]in -// the Amazon Web Services Nitro Enclaves User Guide. -// -// When the IAM role is associated with the ACM certificate, the certificate, -// certificate chain, and encrypted private key are placed in an Amazon S3 location -// that only the associated IAM role can access. The private key of the certificate -// is encrypted with an Amazon Web Services managed key that has an attached -// attestation-based key policy. -// -// To enable the IAM role to access the Amazon S3 object, you must grant it -// permission to call s3:GetObject on the Amazon S3 bucket returned by the -// command. To enable the IAM role to access the KMS key, you must grant it -// permission to call kms:Decrypt on the KMS key returned by the command. For more -// information, see [Grant the role permission to access the certificate and encryption key]in the Amazon Web Services Nitro Enclaves User Guide. -// -// [Certificate Manager for Nitro Enclaves]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html -// [Grant the role permission to access the certificate and encryption key]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html#add-policy -func (c *Client) AssociateEnclaveCertificateIamRole(ctx context.Context, params *AssociateEnclaveCertificateIamRoleInput, optFns ...func(*Options)) (*AssociateEnclaveCertificateIamRoleOutput, error) { - if params == nil { - params = &AssociateEnclaveCertificateIamRoleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateEnclaveCertificateIamRole", params, optFns, c.addOperationAssociateEnclaveCertificateIamRoleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateEnclaveCertificateIamRoleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateEnclaveCertificateIamRoleInput struct { - - // The ARN of the ACM certificate with which to associate the IAM role. - // - // This member is required. - CertificateArn *string - - // The ARN of the IAM role to associate with the ACM certificate. You can - // associate up to 16 IAM roles with an ACM certificate. - // - // This member is required. - RoleArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateEnclaveCertificateIamRoleOutput struct { - - // The name of the Amazon S3 bucket to which the certificate was uploaded. - CertificateS3BucketName *string - - // The Amazon S3 object key where the certificate, certificate chain, and - // encrypted private key bundle are stored. The object key is formatted as follows: - // role_arn / certificate_arn . - CertificateS3ObjectKey *string - - // The ID of the KMS key used to encrypt the private key of the certificate. - EncryptionKmsKeyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateEnclaveCertificateIamRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateEnclaveCertificateIamRole{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateEnclaveCertificateIamRole{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateEnclaveCertificateIamRole"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateEnclaveCertificateIamRoleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateEnclaveCertificateIamRole(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateEnclaveCertificateIamRole(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateEnclaveCertificateIamRole", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.go deleted file mode 100644 index 885ccab24..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an IAM instance profile with a running or stopped instance. You -// cannot associate more than one IAM instance profile with an instance. -func (c *Client) AssociateIamInstanceProfile(ctx context.Context, params *AssociateIamInstanceProfileInput, optFns ...func(*Options)) (*AssociateIamInstanceProfileOutput, error) { - if params == nil { - params = &AssociateIamInstanceProfileInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateIamInstanceProfile", params, optFns, c.addOperationAssociateIamInstanceProfileMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateIamInstanceProfileOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateIamInstanceProfileInput struct { - - // The IAM instance profile. - // - // This member is required. - IamInstanceProfile *types.IamInstanceProfileSpecification - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - noSmithyDocumentSerde -} - -type AssociateIamInstanceProfileOutput struct { - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *types.IamInstanceProfileAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateIamInstanceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateIamInstanceProfile{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateIamInstanceProfile{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateIamInstanceProfile"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateIamInstanceProfileValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateIamInstanceProfile(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateIamInstanceProfile(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateIamInstanceProfile", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.go deleted file mode 100644 index 9fb87f544..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates one or more targets with an event window. Only one type of target -// (instance IDs, Dedicated Host IDs, or tags) can be specified with an event -// window. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) AssociateInstanceEventWindow(ctx context.Context, params *AssociateInstanceEventWindowInput, optFns ...func(*Options)) (*AssociateInstanceEventWindowOutput, error) { - if params == nil { - params = &AssociateInstanceEventWindowInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateInstanceEventWindow", params, optFns, c.addOperationAssociateInstanceEventWindowMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateInstanceEventWindowOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateInstanceEventWindowInput struct { - - // One or more targets associated with the specified event window. - // - // This member is required. - AssociationTarget *types.InstanceEventWindowAssociationRequest - - // The ID of the event window. - // - // This member is required. - InstanceEventWindowId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateInstanceEventWindowOutput struct { - - // Information about the event window. - InstanceEventWindow *types.InstanceEventWindow - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateInstanceEventWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateInstanceEventWindow"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateInstanceEventWindowValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateInstanceEventWindow(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateInstanceEventWindow(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateInstanceEventWindow", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.go deleted file mode 100644 index afe7a72e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own -// in the same Amazon Web Services Region. For more information, see [Tutorial: Bring your ASN to IPAM]in the Amazon -// VPC IPAM guide. -// -// After the association succeeds, the ASN is eligible for advertisement. You can -// view the association with [DescribeByoipCidrs]. You can advertise the CIDR with [AdvertiseByoipCidr]. -// -// [DescribeByoipCidrs]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeByoipCidrs.html -// [AdvertiseByoipCidr]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AdvertiseByoipCidr.html -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -func (c *Client) AssociateIpamByoasn(ctx context.Context, params *AssociateIpamByoasnInput, optFns ...func(*Options)) (*AssociateIpamByoasnOutput, error) { - if params == nil { - params = &AssociateIpamByoasnInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateIpamByoasn", params, optFns, c.addOperationAssociateIpamByoasnMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateIpamByoasnOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateIpamByoasnInput struct { - - // A public 2-byte or 4-byte ASN. - // - // This member is required. - Asn *string - - // The BYOIP CIDR you want to associate with an ASN. - // - // This member is required. - Cidr *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateIpamByoasnOutput struct { - - // The ASN and BYOIP CIDR association. - AsnAssociation *types.AsnAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateIpamByoasn{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateIpamByoasn{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateIpamByoasn"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateIpamByoasnValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateIpamByoasn(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateIpamByoasn", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.go deleted file mode 100644 index 24d328e46..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an IPAM resource discovery with an Amazon VPC IPAM. A resource -// discovery is an IPAM component that enables IPAM to manage and monitor resources -// that belong to the owning account. -func (c *Client) AssociateIpamResourceDiscovery(ctx context.Context, params *AssociateIpamResourceDiscoveryInput, optFns ...func(*Options)) (*AssociateIpamResourceDiscoveryOutput, error) { - if params == nil { - params = &AssociateIpamResourceDiscoveryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateIpamResourceDiscovery", params, optFns, c.addOperationAssociateIpamResourceDiscoveryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateIpamResourceDiscoveryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateIpamResourceDiscoveryInput struct { - - // An IPAM ID. - // - // This member is required. - IpamId *string - - // A resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // A client token. - ClientToken *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Tag specifications. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type AssociateIpamResourceDiscoveryOutput struct { - - // A resource discovery association. An associated resource discovery is a - // resource discovery that has been associated with an IPAM. - IpamResourceDiscoveryAssociation *types.IpamResourceDiscoveryAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateIpamResourceDiscoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateIpamResourceDiscovery"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAssociateIpamResourceDiscoveryMiddleware(stack, options); err != nil { - return err - } - if err = addOpAssociateIpamResourceDiscoveryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateIpamResourceDiscovery(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAssociateIpamResourceDiscovery struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAssociateIpamResourceDiscovery) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAssociateIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AssociateIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateIpamResourceDiscoveryInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAssociateIpamResourceDiscoveryMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateIpamResourceDiscovery{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAssociateIpamResourceDiscovery(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateIpamResourceDiscovery", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.go deleted file mode 100644 index 3c87b06be..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public -// NAT gateway. For more information, see [Work with NAT gateways]in the Amazon VPC User Guide. -// -// By default, you can associate up to 2 Elastic IP addresses per public NAT -// gateway. You can increase the limit by requesting a quota adjustment. For more -// information, see [Elastic IP address quotas]in the Amazon VPC User Guide. -// -// When you associate an EIP or secondary EIPs with a public NAT gateway, the -// network border group of the EIPs must match the network border group of the -// Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, -// the EIP will fail to associate. You can see the network border group for the -// subnet's AZ by viewing the details of the subnet. Similarly, you can view the -// network border group of an EIP by viewing the details of the EIP address. For -// more information about network border groups and EIPs, see [Allocate an Elastic IP address]in the Amazon VPC -// User Guide. -// -// [Elastic IP address quotas]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-eips -// [Work with NAT gateways]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html -// [Allocate an Elastic IP address]: https://docs.aws.amazon.com/vpc/latest/userguide/WorkWithEIPs.html -func (c *Client) AssociateNatGatewayAddress(ctx context.Context, params *AssociateNatGatewayAddressInput, optFns ...func(*Options)) (*AssociateNatGatewayAddressOutput, error) { - if params == nil { - params = &AssociateNatGatewayAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateNatGatewayAddress", params, optFns, c.addOperationAssociateNatGatewayAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateNatGatewayAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateNatGatewayAddressInput struct { - - // The allocation IDs of EIPs that you want to associate with your NAT gateway. - // - // This member is required. - AllocationIds []string - - // The ID of the NAT gateway. - // - // This member is required. - NatGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The private IPv4 addresses that you want to assign to the NAT gateway. - PrivateIpAddresses []string - - noSmithyDocumentSerde -} - -type AssociateNatGatewayAddressOutput struct { - - // The IP addresses. - NatGatewayAddresses []types.NatGatewayAddress - - // The ID of the NAT gateway. - NatGatewayId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateNatGatewayAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateNatGatewayAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateNatGatewayAddressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateNatGatewayAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateNatGatewayAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateNatGatewayAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.go deleted file mode 100644 index d12c44aab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a route server with a VPC to enable dynamic route updates. -// -// A route server association is the connection established between a route server -// and a VPC. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) AssociateRouteServer(ctx context.Context, params *AssociateRouteServerInput, optFns ...func(*Options)) (*AssociateRouteServerOutput, error) { - if params == nil { - params = &AssociateRouteServerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateRouteServer", params, optFns, c.addOperationAssociateRouteServerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateRouteServerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateRouteServerInput struct { - - // The unique identifier for the route server to be associated. - // - // This member is required. - RouteServerId *string - - // The ID of the VPC to associate with the route server. - // - // This member is required. - VpcId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateRouteServerOutput struct { - - // Information about the association between the route server and the VPC. - RouteServerAssociation *types.RouteServerAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateRouteServerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateRouteServer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateRouteServer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateRouteServer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateRouteServerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateRouteServer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateRouteServer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateRouteServer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.go deleted file mode 100644 index a4c5941c9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a subnet in your VPC or an internet gateway or virtual private -// gateway attached to your VPC with a route table in your VPC. This association -// causes traffic from the subnet or gateway to be routed according to the routes -// in the route table. The action returns an association ID, which you need in -// order to disassociate the route table later. A route table can be associated -// with multiple subnets. -// -// For more information, see [Route tables] in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) AssociateRouteTable(ctx context.Context, params *AssociateRouteTableInput, optFns ...func(*Options)) (*AssociateRouteTableOutput, error) { - if params == nil { - params = &AssociateRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateRouteTable", params, optFns, c.addOperationAssociateRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateRouteTableInput struct { - - // The ID of the route table. - // - // This member is required. - RouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the internet gateway or virtual private gateway. - GatewayId *string - - // The ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -type AssociateRouteTableOutput struct { - - // The route table association ID. This ID is required for disassociating the - // route table. - AssociationId *string - - // The state of the association. - AssociationState *types.RouteTableAssociationState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.go deleted file mode 100644 index 58e8b6f05..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a security group with another VPC in the same Region. This enables -// you to use the same security group with network interfaces and instances in the -// specified VPC. -// -// - The VPC you want to associate the security group with must be in the same -// Region. -// -// - You can associate the security group with another VPC if your account owns -// the VPC or if the VPC was shared with you. -// -// - You must own the security group. -// -// - You cannot use this feature with default security groups. -// -// - You cannot use this feature with the default VPC. -func (c *Client) AssociateSecurityGroupVpc(ctx context.Context, params *AssociateSecurityGroupVpcInput, optFns ...func(*Options)) (*AssociateSecurityGroupVpcOutput, error) { - if params == nil { - params = &AssociateSecurityGroupVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateSecurityGroupVpc", params, optFns, c.addOperationAssociateSecurityGroupVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateSecurityGroupVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateSecurityGroupVpcInput struct { - - // A security group ID. - // - // This member is required. - GroupId *string - - // A VPC ID. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateSecurityGroupVpcOutput struct { - - // The state of the association. - State types.SecurityGroupVpcAssociationState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateSecurityGroupVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateSecurityGroupVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateSecurityGroupVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateSecurityGroupVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateSecurityGroupVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateSecurityGroupVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateSecurityGroupVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateSecurityGroupVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.go deleted file mode 100644 index f14b485fa..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a CIDR block with your subnet. You can only associate a single IPv6 -// CIDR block with your subnet. -func (c *Client) AssociateSubnetCidrBlock(ctx context.Context, params *AssociateSubnetCidrBlockInput, optFns ...func(*Options)) (*AssociateSubnetCidrBlockOutput, error) { - if params == nil { - params = &AssociateSubnetCidrBlockInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateSubnetCidrBlock", params, optFns, c.addOperationAssociateSubnetCidrBlockMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateSubnetCidrBlockOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateSubnetCidrBlockInput struct { - - // The ID of your subnet. - // - // This member is required. - SubnetId *string - - // The IPv6 CIDR block for your subnet. - Ipv6CidrBlock *string - - // An IPv6 IPAM pool ID. - Ipv6IpamPoolId *string - - // An IPv6 netmask length. - Ipv6NetmaskLength *int32 - - noSmithyDocumentSerde -} - -type AssociateSubnetCidrBlockOutput struct { - - // Information about the IPv6 association. - Ipv6CidrBlockAssociation *types.SubnetIpv6CidrBlockAssociation - - // The ID of the subnet. - SubnetId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateSubnetCidrBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateSubnetCidrBlock{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateSubnetCidrBlock{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateSubnetCidrBlock"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateSubnetCidrBlockValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateSubnetCidrBlock(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateSubnetCidrBlock(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateSubnetCidrBlock", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.go deleted file mode 100644 index 50f8329f9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates the specified subnets and transit gateway attachments with the -// specified transit gateway multicast domain. -// -// The transit gateway attachment must be in the available state before you can -// add a resource. Use [DescribeTransitGatewayAttachments]to see the state of the attachment. -// -// [DescribeTransitGatewayAttachments]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGatewayAttachments.html -func (c *Client) AssociateTransitGatewayMulticastDomain(ctx context.Context, params *AssociateTransitGatewayMulticastDomainInput, optFns ...func(*Options)) (*AssociateTransitGatewayMulticastDomainOutput, error) { - if params == nil { - params = &AssociateTransitGatewayMulticastDomainInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateTransitGatewayMulticastDomain", params, optFns, c.addOperationAssociateTransitGatewayMulticastDomainMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateTransitGatewayMulticastDomainOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateTransitGatewayMulticastDomainInput struct { - - // The IDs of the subnets to associate with the transit gateway multicast domain. - // - // This member is required. - SubnetIds []string - - // The ID of the transit gateway attachment to associate with the transit gateway - // multicast domain. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateTransitGatewayMulticastDomainOutput struct { - - // Information about the transit gateway multicast domain associations. - Associations *types.TransitGatewayMulticastDomainAssociations - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateTransitGatewayMulticastDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateTransitGatewayMulticastDomain"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateTransitGatewayMulticastDomainValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTransitGatewayMulticastDomain(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateTransitGatewayMulticastDomain(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateTransitGatewayMulticastDomain", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.go deleted file mode 100644 index 1629c934e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates the specified transit gateway attachment with a transit gateway -// policy table. -func (c *Client) AssociateTransitGatewayPolicyTable(ctx context.Context, params *AssociateTransitGatewayPolicyTableInput, optFns ...func(*Options)) (*AssociateTransitGatewayPolicyTableOutput, error) { - if params == nil { - params = &AssociateTransitGatewayPolicyTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateTransitGatewayPolicyTable", params, optFns, c.addOperationAssociateTransitGatewayPolicyTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateTransitGatewayPolicyTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateTransitGatewayPolicyTableInput struct { - - // The ID of the transit gateway attachment to associate with the policy table. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway policy table to associate with the transit - // gateway attachment. - // - // This member is required. - TransitGatewayPolicyTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateTransitGatewayPolicyTableOutput struct { - - // Describes the association of a transit gateway and a transit gateway policy - // table. - Association *types.TransitGatewayPolicyTableAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateTransitGatewayPolicyTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateTransitGatewayPolicyTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateTransitGatewayPolicyTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTransitGatewayPolicyTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateTransitGatewayPolicyTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateTransitGatewayPolicyTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.go deleted file mode 100644 index e90872100..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates the specified attachment with the specified transit gateway route -// table. You can associate only one route table with an attachment. -func (c *Client) AssociateTransitGatewayRouteTable(ctx context.Context, params *AssociateTransitGatewayRouteTableInput, optFns ...func(*Options)) (*AssociateTransitGatewayRouteTableOutput, error) { - if params == nil { - params = &AssociateTransitGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateTransitGatewayRouteTable", params, optFns, c.addOperationAssociateTransitGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateTransitGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateTransitGatewayRouteTableInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AssociateTransitGatewayRouteTableOutput struct { - - // The ID of the association. - Association *types.TransitGatewayAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateTransitGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateTransitGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateTransitGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTransitGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateTransitGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateTransitGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.go deleted file mode 100644 index cd0feeebb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a branch network interface with a trunk network interface. -// -// Before you create the association, use [CreateNetworkInterface] command and set the interface type to -// trunk . You must also create a network interface for each branch network -// interface that you want to associate with the trunk network interface. -// -// [CreateNetworkInterface]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html -func (c *Client) AssociateTrunkInterface(ctx context.Context, params *AssociateTrunkInterfaceInput, optFns ...func(*Options)) (*AssociateTrunkInterfaceOutput, error) { - if params == nil { - params = &AssociateTrunkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateTrunkInterface", params, optFns, c.addOperationAssociateTrunkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateTrunkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateTrunkInterfaceInput struct { - - // The ID of the branch network interface. - // - // This member is required. - BranchInterfaceId *string - - // The ID of the trunk network interface. - // - // This member is required. - TrunkInterfaceId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The application key. This applies to the GRE protocol. - GreKey *int32 - - // The ID of the VLAN. This applies to the VLAN protocol. - VlanId *int32 - - noSmithyDocumentSerde -} - -type AssociateTrunkInterfaceOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Information about the association between the trunk network interface and - // branch network interface. - InterfaceAssociation *types.TrunkInterfaceAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateTrunkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateTrunkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateTrunkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateTrunkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAssociateTrunkInterfaceMiddleware(stack, options); err != nil { - return err - } - if err = addOpAssociateTrunkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTrunkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAssociateTrunkInterface struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAssociateTrunkInterface) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAssociateTrunkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AssociateTrunkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateTrunkInterfaceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAssociateTrunkInterfaceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateTrunkInterface{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAssociateTrunkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateTrunkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.go deleted file mode 100644 index fe239aac7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR -// block, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 -// address pool that you provisioned through bring your own IP addresses ([BYOIP] ). -// -// You must specify one of the following in the request: an IPv4 CIDR block, an -// IPv6 pool, or an Amazon-provided IPv6 CIDR block. -// -// For more information about associating CIDR blocks with your VPC and applicable -// restrictions, see [IP addressing for your VPCs and subnets]in the Amazon VPC User Guide. -// -// [BYOIP]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html -// [IP addressing for your VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html -func (c *Client) AssociateVpcCidrBlock(ctx context.Context, params *AssociateVpcCidrBlockInput, optFns ...func(*Options)) (*AssociateVpcCidrBlockOutput, error) { - if params == nil { - params = &AssociateVpcCidrBlockInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateVpcCidrBlock", params, optFns, c.addOperationAssociateVpcCidrBlockMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateVpcCidrBlockOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateVpcCidrBlockInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the - // VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR - // block. - AmazonProvidedIpv6CidrBlock *bool - - // An IPv4 CIDR block to associate with the VPC. - CidrBlock *string - - // Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more - // information about Amazon VPC IP Address Manager (IPAM), see [What is IPAM?]in the Amazon VPC - // IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv4IpamPoolId *string - - // The netmask length of the IPv4 CIDR you would like to associate from an Amazon - // VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?]in the - // Amazon VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv4NetmaskLength *int32 - - // An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool - // in the request. - // - // To let Amazon choose the IPv6 CIDR block for you, omit this parameter. - Ipv6CidrBlock *string - - // The name of the location from which we advertise the IPV6 CIDR block. Use this - // parameter to limit the CIDR block to this location. - // - // You must set AmazonProvidedIpv6CidrBlock to true to use this parameter. - // - // You can have one IPv6 CIDR block association per network border group. - Ipv6CidrBlockNetworkBorderGroup *string - - // Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more - // information about Amazon VPC IP Address Manager (IPAM), see [What is IPAM?]in the Amazon VPC - // IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv6IpamPoolId *string - - // The netmask length of the IPv6 CIDR you would like to associate from an Amazon - // VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?]in the - // Amazon VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv6NetmaskLength *int32 - - // The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. - Ipv6Pool *string - - noSmithyDocumentSerde -} - -type AssociateVpcCidrBlockOutput struct { - - // Information about the IPv4 CIDR block association. - CidrBlockAssociation *types.VpcCidrBlockAssociation - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *types.VpcIpv6CidrBlockAssociation - - // The ID of the VPC. - VpcId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateVpcCidrBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateVpcCidrBlock{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateVpcCidrBlock{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateVpcCidrBlock"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateVpcCidrBlockValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateVpcCidrBlock(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateVpcCidrBlock(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateVpcCidrBlock", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.go deleted file mode 100644 index 8ca899fc0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more -// of the VPC security groups. You cannot link an EC2-Classic instance to more than -// one VPC at a time. You can only link an instance that's in the running state. -// An instance is automatically unlinked from a VPC when it's stopped - you can -// link it to the VPC again when you restart it. -// -// After you've linked an instance, you cannot change the VPC security groups that -// are associated with it. To change the security groups, you must first unlink the -// instance, and then link it again. -// -// Linking your instance to a VPC is sometimes referred to as attaching your -// instance. -func (c *Client) AttachClassicLinkVpc(ctx context.Context, params *AttachClassicLinkVpcInput, optFns ...func(*Options)) (*AttachClassicLinkVpcOutput, error) { - if params == nil { - params = &AttachClassicLinkVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachClassicLinkVpc", params, optFns, c.addOperationAttachClassicLinkVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachClassicLinkVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AttachClassicLinkVpcInput struct { - - // The IDs of the security groups. You cannot specify security groups from a - // different VPC. - // - // This member is required. - Groups []string - - // The ID of the EC2-Classic instance. - // - // This member is required. - InstanceId *string - - // The ID of the ClassicLink-enabled VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AttachClassicLinkVpcOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachClassicLinkVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachClassicLinkVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachClassicLinkVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachClassicLinkVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachClassicLinkVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachClassicLinkVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachClassicLinkVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachClassicLinkVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.go deleted file mode 100644 index e6ff7ecb2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches an internet gateway or a virtual private gateway to a VPC, enabling -// connectivity between the internet and the VPC. For more information, see [Internet gateways]in the -// Amazon VPC User Guide. -// -// [Internet gateways]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html -func (c *Client) AttachInternetGateway(ctx context.Context, params *AttachInternetGatewayInput, optFns ...func(*Options)) (*AttachInternetGatewayOutput, error) { - if params == nil { - params = &AttachInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachInternetGateway", params, optFns, c.addOperationAttachInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AttachInternetGatewayInput struct { - - // The ID of the internet gateway. - // - // This member is required. - InternetGatewayId *string - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AttachInternetGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachInternetGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.go deleted file mode 100644 index 6f8f18a70..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches a network interface to an instance. -func (c *Client) AttachNetworkInterface(ctx context.Context, params *AttachNetworkInterfaceInput, optFns ...func(*Options)) (*AttachNetworkInterfaceOutput, error) { - if params == nil { - params = &AttachNetworkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachNetworkInterface", params, optFns, c.addOperationAttachNetworkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachNetworkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for AttachNetworkInterface. -type AttachNetworkInterfaceInput struct { - - // The index of the device for the network interface attachment. - // - // This member is required. - DeviceIndex *int32 - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The number of ENA queues to be created with the instance. - EnaQueueCount *int32 - - // Configures ENA Express for the network interface that this action attaches to - // the instance. - EnaSrdSpecification *types.EnaSrdSpecification - - // The index of the network card. Some instance types support multiple network - // cards. The primary network interface must be assigned to network card index 0. - // The default is network card index 0. - NetworkCardIndex *int32 - - noSmithyDocumentSerde -} - -// Contains the output of AttachNetworkInterface. -type AttachNetworkInterfaceOutput struct { - - // The ID of the network interface attachment. - AttachmentId *string - - // The index of the network card. - NetworkCardIndex *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachNetworkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachNetworkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachNetworkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachNetworkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachNetworkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachNetworkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachNetworkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachNetworkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.go deleted file mode 100644 index 9e32f0ce6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches the specified Amazon Web Services Verified Access trust provider to -// the specified Amazon Web Services Verified Access instance. -func (c *Client) AttachVerifiedAccessTrustProvider(ctx context.Context, params *AttachVerifiedAccessTrustProviderInput, optFns ...func(*Options)) (*AttachVerifiedAccessTrustProviderOutput, error) { - if params == nil { - params = &AttachVerifiedAccessTrustProviderInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachVerifiedAccessTrustProvider", params, optFns, c.addOperationAttachVerifiedAccessTrustProviderMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachVerifiedAccessTrustProviderOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AttachVerifiedAccessTrustProviderInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // The ID of the Verified Access trust provider. - // - // This member is required. - VerifiedAccessTrustProviderId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AttachVerifiedAccessTrustProviderOutput struct { - - // Details about the Verified Access instance. - VerifiedAccessInstance *types.VerifiedAccessInstance - - // Details about the Verified Access trust provider. - VerifiedAccessTrustProvider *types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachVerifiedAccessTrustProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachVerifiedAccessTrustProvider"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAttachVerifiedAccessTrustProviderMiddleware(stack, options); err != nil { - return err - } - if err = addOpAttachVerifiedAccessTrustProviderValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachVerifiedAccessTrustProvider(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAttachVerifiedAccessTrustProvider struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAttachVerifiedAccessTrustProvider) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAttachVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AttachVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AttachVerifiedAccessTrustProviderInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAttachVerifiedAccessTrustProviderMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAttachVerifiedAccessTrustProvider{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAttachVerifiedAccessTrustProvider(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachVerifiedAccessTrustProvider", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.go deleted file mode 100644 index 406566994..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Attaches an Amazon EBS volume to a running or stopped instance, and exposes it -// to the instance with the specified device name. -// -// The maximum number of Amazon EBS volumes that you can attach to an instance -// depends on the instance type. If you exceed the volume attachment limit for an -// instance type, the attachment request fails with the AttachmentLimitExceeded -// error. For more information, see [Instance volume limits]. -// -// After you attach an EBS volume, you must make it available for use. For more -// information, see [Make an EBS volume available for use]. -// -// If a volume has an Amazon Web Services Marketplace product code: -// -// - The volume can be attached only to a stopped instance. -// -// - Amazon Web Services Marketplace product codes are copied from the volume to -// the instance. -// -// - You must be subscribed to the product. -// -// - The instance type and operating system of the instance must support the -// product. For example, you can't detach a volume from a Windows instance and -// attach it to a Linux instance. -// -// For more information, see [Attach an Amazon EBS volume to an instance] in the Amazon EBS User Guide. -// -// [Make an EBS volume available for use]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-using-volumes.html -// [Attach an Amazon EBS volume to an instance]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-attaching-volume.html -// [Instance volume limits]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html -func (c *Client) AttachVolume(ctx context.Context, params *AttachVolumeInput, optFns ...func(*Options)) (*AttachVolumeOutput, error) { - if params == nil { - params = &AttachVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachVolume", params, optFns, c.addOperationAttachVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AttachVolumeInput struct { - - // The device name (for example, /dev/sdh or xvdh ). - // - // This member is required. - Device *string - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The ID of the EBS volume. The volume and instance must be within the same - // Availability Zone. - // - // This member is required. - VolumeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Describes volume attachment details. -type AttachVolumeOutput struct { - - // The ARN of the Amazon Web Services-managed resource to which the volume is - // attached. - AssociatedResource *string - - // The time stamp when the attachment initiated. - AttachTime *time.Time - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool - - // The device name. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - Device *string - - // The ID of the instance. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - InstanceId *string - - // The service principal of the Amazon Web Services service that owns the - // underlying resource to which the volume is attached. - // - // This parameter is returned only for volumes that are attached to Amazon Web - // Services-managed resources. - InstanceOwningService *string - - // The attachment state of the volume. - State types.VolumeAttachmentState - - // The ID of the volume. - VolumeId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.go deleted file mode 100644 index 12b106367..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches an available virtual private gateway to a VPC. You can attach one -// virtual private gateway to one VPC at a time. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) AttachVpnGateway(ctx context.Context, params *AttachVpnGatewayInput, optFns ...func(*Options)) (*AttachVpnGatewayOutput, error) { - if params == nil { - params = &AttachVpnGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachVpnGateway", params, optFns, c.addOperationAttachVpnGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachVpnGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for AttachVpnGateway. -type AttachVpnGatewayInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // The ID of the virtual private gateway. - // - // This member is required. - VpnGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of AttachVpnGateway. -type AttachVpnGatewayOutput struct { - - // Information about the attachment. - VpcAttachment *types.VpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachVpnGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAttachVpnGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAttachVpnGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachVpnGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachVpnGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachVpnGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachVpnGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachVpnGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.go deleted file mode 100644 index 66d3cbf1f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds an ingress authorization rule to a Client VPN endpoint. Ingress -// authorization rules act as firewall rules that grant access to networks. You -// must configure ingress authorization rules to enable clients to access resources -// in Amazon Web Services or on-premises networks. -func (c *Client) AuthorizeClientVpnIngress(ctx context.Context, params *AuthorizeClientVpnIngressInput, optFns ...func(*Options)) (*AuthorizeClientVpnIngressOutput, error) { - if params == nil { - params = &AuthorizeClientVpnIngressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AuthorizeClientVpnIngress", params, optFns, c.addOperationAuthorizeClientVpnIngressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AuthorizeClientVpnIngressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AuthorizeClientVpnIngressInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // The IPv4 address range, in CIDR notation, of the network for which access is - // being authorized. - // - // This member is required. - TargetNetworkCidr *string - - // The ID of the group to grant access to, for example, the Active Directory group - // or identity provider (IdP) group. Required if AuthorizeAllGroups is false or - // not specified. - AccessGroupId *string - - // Indicates whether to grant access to all clients. Specify true to grant all - // clients who successfully establish a VPN connection access to the network. Must - // be set to true if AccessGroupId is not specified. - AuthorizeAllGroups *bool - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A brief description of the authorization rule. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type AuthorizeClientVpnIngressOutput struct { - - // The current state of the authorization rule. - Status *types.ClientVpnAuthorizationRuleStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAuthorizeClientVpnIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAuthorizeClientVpnIngress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAuthorizeClientVpnIngress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AuthorizeClientVpnIngress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAuthorizeClientVpnIngressMiddleware(stack, options); err != nil { - return err - } - if err = addOpAuthorizeClientVpnIngressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeClientVpnIngress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAuthorizeClientVpnIngress struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAuthorizeClientVpnIngress) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAuthorizeClientVpnIngress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AuthorizeClientVpnIngressInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AuthorizeClientVpnIngressInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAuthorizeClientVpnIngressMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAuthorizeClientVpnIngress{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAuthorizeClientVpnIngress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AuthorizeClientVpnIngress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.go deleted file mode 100644 index 4519480d0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds the specified outbound (egress) rules to a security group. -// -// An outbound rule permits instances to send traffic to the specified IPv4 or -// IPv6 address ranges, the IP address ranges specified by a prefix list, or the -// instances that are associated with a source security group. For more -// information, see [Security group rules]. -// -// You must specify exactly one of the following destinations: an IPv4 or IPv6 -// address range, a prefix list, or a security group. You must specify a protocol -// for each rule (for example, TCP). If the protocol is TCP or UDP, you must also -// specify a port or port range. If the protocol is ICMP or ICMPv6, you must also -// specify the ICMP type and code. -// -// Rule changes are propagated to instances associated with the security group as -// quickly as possible. However, a small delay might occur. -// -// For examples of rules that you can add to security groups for specific access -// scenarios, see [Security group rules for different use cases]in the Amazon EC2 User Guide. -// -// For information about security group quotas, see [Amazon VPC quotas] in the Amazon VPC User Guide. -// -// [Amazon VPC quotas]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html -// [Security group rules]: https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html -// [Security group rules for different use cases]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html -func (c *Client) AuthorizeSecurityGroupEgress(ctx context.Context, params *AuthorizeSecurityGroupEgressInput, optFns ...func(*Options)) (*AuthorizeSecurityGroupEgressOutput, error) { - if params == nil { - params = &AuthorizeSecurityGroupEgressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AuthorizeSecurityGroupEgress", params, optFns, c.addOperationAuthorizeSecurityGroupEgressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AuthorizeSecurityGroupEgressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AuthorizeSecurityGroupEgressInput struct { - - // The ID of the security group. - // - // This member is required. - GroupId *string - - // Not supported. Use IP permissions instead. - CidrIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Not supported. Use IP permissions instead. - FromPort *int32 - - // The permissions for the security group rules. - IpPermissions []types.IpPermission - - // Not supported. Use IP permissions instead. - IpProtocol *string - - // Not supported. Use IP permissions instead. - SourceSecurityGroupName *string - - // Not supported. Use IP permissions instead. - SourceSecurityGroupOwnerId *string - - // The tags applied to the security group rule. - TagSpecifications []types.TagSpecification - - // Not supported. Use IP permissions instead. - ToPort *int32 - - noSmithyDocumentSerde -} - -type AuthorizeSecurityGroupEgressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Information about the outbound (egress) security group rules that were added. - SecurityGroupRules []types.SecurityGroupRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAuthorizeSecurityGroupEgressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAuthorizeSecurityGroupEgress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAuthorizeSecurityGroupEgress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AuthorizeSecurityGroupEgress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAuthorizeSecurityGroupEgressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeSecurityGroupEgress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAuthorizeSecurityGroupEgress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AuthorizeSecurityGroupEgress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.go deleted file mode 100644 index a0ebe5ede..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds the specified inbound (ingress) rules to a security group. -// -// An inbound rule permits instances to receive traffic from the specified IPv4 or -// IPv6 address range, the IP address ranges that are specified by a prefix list, -// or the instances that are associated with a destination security group. For more -// information, see [Security group rules]. -// -// You must specify exactly one of the following sources: an IPv4 or IPv6 address -// range, a prefix list, or a security group. You must specify a protocol for each -// rule (for example, TCP). If the protocol is TCP or UDP, you must also specify a -// port or port range. If the protocol is ICMP or ICMPv6, you must also specify the -// ICMP/ICMPv6 type and code. -// -// Rule changes are propagated to instances associated with the security group as -// quickly as possible. However, a small delay might occur. -// -// For examples of rules that you can add to security groups for specific access -// scenarios, see [Security group rules for different use cases]in the Amazon EC2 User Guide. -// -// For more information about security group quotas, see [Amazon VPC quotas] in the Amazon VPC User -// Guide. -// -// [Amazon VPC quotas]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html -// [Security group rules]: https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html -// [Security group rules for different use cases]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html -func (c *Client) AuthorizeSecurityGroupIngress(ctx context.Context, params *AuthorizeSecurityGroupIngressInput, optFns ...func(*Options)) (*AuthorizeSecurityGroupIngressOutput, error) { - if params == nil { - params = &AuthorizeSecurityGroupIngressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AuthorizeSecurityGroupIngress", params, optFns, c.addOperationAuthorizeSecurityGroupIngressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AuthorizeSecurityGroupIngressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AuthorizeSecurityGroupIngressInput struct { - - // The IPv4 address range, in CIDR format. - // - // Amazon Web Services [canonicalizes] IPv4 and IPv6 CIDRs. For example, if you specify - // 100.68.0.18/18 for the CIDR block, Amazon Web Services canonicalizes the CIDR - // block to 100.68.0.0/18. Any subsequent DescribeSecurityGroups and - // DescribeSecurityGroupRules calls will return the canonicalized form of the CIDR - // block. Additionally, if you attempt to add another rule with the non-canonical - // form of the CIDR (such as 100.68.0.18/18) and there is already a rule for the - // canonicalized form of the CIDR block (such as 100.68.0.0/18), the API throws an - // duplicate rule error. - // - // To specify an IPv6 address range, use IP permissions instead. - // - // To specify multiple rules and descriptions for the rules, use IP permissions - // instead. - // - // [canonicalizes]: https://en.wikipedia.org/wiki/Canonicalization - CidrIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP, this is the ICMP type or -1 (all ICMP types). - // - // To specify multiple rules and descriptions for the rules, use IP permissions - // instead. - FromPort *int32 - - // The ID of the security group. - GroupId *string - - // [Default VPC] The name of the security group. For security groups for a default - // VPC you can specify either the ID or the name of the security group. For - // security groups for a nondefault VPC, you must specify the ID of the security - // group. - GroupName *string - - // The permissions for the security group rules. - IpPermissions []types.IpPermission - - // The IP protocol name ( tcp , udp , icmp ) or number (see [Protocol Numbers]). To specify all - // protocols, use -1 . - // - // To specify icmpv6 , use IP permissions instead. - // - // If you specify a protocol other than one of the supported values, traffic is - // allowed on all ports, regardless of any ports that you specify. - // - // To specify multiple rules and descriptions for the rules, use IP permissions - // instead. - // - // [Protocol Numbers]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // [Default VPC] The name of the source security group. - // - // The rule grants full ICMP, UDP, and TCP access. To create a rule with a - // specific protocol and port range, specify a set of IP permissions instead. - SourceSecurityGroupName *string - - // The Amazon Web Services account ID for the source security group, if the source - // security group is in a different account. - // - // The rule grants full ICMP, UDP, and TCP access. To create a rule with a - // specific protocol and port range, use IP permissions instead. - SourceSecurityGroupOwnerId *string - - // The tags applied to the security group rule. - TagSpecifications []types.TagSpecification - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP, this is the ICMP code or -1 (all ICMP codes). If the start - // port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes). - // - // To specify multiple rules and descriptions for the rules, use IP permissions - // instead. - ToPort *int32 - - noSmithyDocumentSerde -} - -type AuthorizeSecurityGroupIngressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Information about the inbound (ingress) security group rules that were added. - SecurityGroupRules []types.SecurityGroupRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAuthorizeSecurityGroupIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpAuthorizeSecurityGroupIngress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpAuthorizeSecurityGroupIngress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AuthorizeSecurityGroupIngress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeSecurityGroupIngress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAuthorizeSecurityGroupIngress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AuthorizeSecurityGroupIngress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.go deleted file mode 100644 index 532ab269f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Bundles an Amazon instance store-backed Windows instance. -// -// During bundling, only the root device volume (C:\) is bundled. Data on other -// instance store volumes is not preserved. -// -// This action is not applicable for Linux/Unix instances or Windows instances -// that are backed by Amazon EBS. -func (c *Client) BundleInstance(ctx context.Context, params *BundleInstanceInput, optFns ...func(*Options)) (*BundleInstanceOutput, error) { - if params == nil { - params = &BundleInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "BundleInstance", params, optFns, c.addOperationBundleInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*BundleInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for BundleInstance. -type BundleInstanceInput struct { - - // The ID of the instance to bundle. - // - // Default: None - // - // This member is required. - InstanceId *string - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify a - // bucket that belongs to someone else, Amazon EC2 returns an error. - // - // This member is required. - Storage *types.Storage - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of BundleInstance. -type BundleInstanceOutput struct { - - // Information about the bundle task. - BundleTask *types.BundleTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationBundleInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpBundleInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpBundleInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "BundleInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpBundleInstanceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBundleInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opBundleInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "BundleInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.go deleted file mode 100644 index 7393864c1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels a bundling operation for an instance store-backed Windows instance. -func (c *Client) CancelBundleTask(ctx context.Context, params *CancelBundleTaskInput, optFns ...func(*Options)) (*CancelBundleTaskOutput, error) { - if params == nil { - params = &CancelBundleTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelBundleTask", params, optFns, c.addOperationCancelBundleTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelBundleTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CancelBundleTask. -type CancelBundleTaskInput struct { - - // The ID of the bundle task. - // - // This member is required. - BundleId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of CancelBundleTask. -type CancelBundleTaskOutput struct { - - // Information about the bundle task. - BundleTask *types.BundleTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelBundleTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelBundleTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelBundleTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelBundleTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelBundleTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelBundleTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelBundleTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelBundleTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.go deleted file mode 100644 index ae5819686..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels the specified Capacity Reservation, releases the reserved capacity, and -// changes the Capacity Reservation's state to cancelled . -// -// You can cancel a Capacity Reservation that is in the following states: -// -// - assessing -// -// - active and there is no commitment duration or the commitment duration has -// elapsed. You can't cancel a future-dated Capacity Reservation during the -// commitment duration. -// -// You can't modify or cancel a Capacity Block. For more information, see [Capacity Blocks for ML]. -// -// If a future-dated Capacity Reservation enters the delayed state, the commitment -// duration is waived, and you can cancel it as soon as it enters the active state. -// -// Instances running in the reserved capacity continue running until you stop -// them. Stopped instances that target the Capacity Reservation can no longer -// launch. Modify these instances to either target a different Capacity -// Reservation, launch On-Demand Instance capacity, or run in any open Capacity -// Reservation that has matching attributes and sufficient capacity. -// -// [Capacity Blocks for ML]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-blocks.html -func (c *Client) CancelCapacityReservation(ctx context.Context, params *CancelCapacityReservationInput, optFns ...func(*Options)) (*CancelCapacityReservationOutput, error) { - if params == nil { - params = &CancelCapacityReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelCapacityReservation", params, optFns, c.addOperationCancelCapacityReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelCapacityReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelCapacityReservationInput struct { - - // The ID of the Capacity Reservation to be cancelled. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CancelCapacityReservationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelCapacityReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelCapacityReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelCapacityReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelCapacityReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelCapacityReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCapacityReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelCapacityReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.go deleted file mode 100644 index 9e9a61dc2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity -// Reservation Fleet, the following happens: -// -// - The Capacity Reservation Fleet's status changes to cancelled . -// -// - The individual Capacity Reservations in the Fleet are cancelled. Instances -// running in the Capacity Reservations at the time of cancelling the Fleet -// continue to run in shared capacity. -// -// - The Fleet stops creating new Capacity Reservations. -func (c *Client) CancelCapacityReservationFleets(ctx context.Context, params *CancelCapacityReservationFleetsInput, optFns ...func(*Options)) (*CancelCapacityReservationFleetsOutput, error) { - if params == nil { - params = &CancelCapacityReservationFleetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelCapacityReservationFleets", params, optFns, c.addOperationCancelCapacityReservationFleetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelCapacityReservationFleetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelCapacityReservationFleetsInput struct { - - // The IDs of the Capacity Reservation Fleets to cancel. - // - // This member is required. - CapacityReservationFleetIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CancelCapacityReservationFleetsOutput struct { - - // Information about the Capacity Reservation Fleets that could not be cancelled. - FailedFleetCancellations []types.FailedCapacityReservationFleetCancellationResult - - // Information about the Capacity Reservation Fleets that were successfully - // cancelled. - SuccessfulFleetCancellations []types.CapacityReservationFleetCancellationState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelCapacityReservationFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelCapacityReservationFleets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelCapacityReservationFleets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelCapacityReservationFleets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelCapacityReservationFleetsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCapacityReservationFleets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelCapacityReservationFleets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelCapacityReservationFleets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.go deleted file mode 100644 index 663dfefff..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels an active conversion task. The task can be the import of an instance or -// volume. The action removes all artifacts of the conversion, including a -// partially uploaded volume or instance. If the conversion is complete or is in -// the process of transferring the final disk image, the command fails and returns -// an exception. -func (c *Client) CancelConversionTask(ctx context.Context, params *CancelConversionTaskInput, optFns ...func(*Options)) (*CancelConversionTaskOutput, error) { - if params == nil { - params = &CancelConversionTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelConversionTask", params, optFns, c.addOperationCancelConversionTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelConversionTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelConversionTaskInput struct { - - // The ID of the conversion task. - // - // This member is required. - ConversionTaskId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The reason for canceling the conversion task. - ReasonMessage *string - - noSmithyDocumentSerde -} - -type CancelConversionTaskOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelConversionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelConversionTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelConversionTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelConversionTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelConversionTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelConversionTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelConversionTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelConversionTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.go deleted file mode 100644 index f720038a4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels the generation of an account status report. -// -// You can only cancel a report while it has the running status. Reports with -// other statuses ( complete , cancelled , or error ) can't be canceled. -// -// For more information, see [Generating the account status report for declarative policies] in the Amazon Web Services Organizations User Guide. -// -// [Generating the account status report for declarative policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative_status-report.html -func (c *Client) CancelDeclarativePoliciesReport(ctx context.Context, params *CancelDeclarativePoliciesReportInput, optFns ...func(*Options)) (*CancelDeclarativePoliciesReportOutput, error) { - if params == nil { - params = &CancelDeclarativePoliciesReportInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelDeclarativePoliciesReport", params, optFns, c.addOperationCancelDeclarativePoliciesReportMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelDeclarativePoliciesReportOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelDeclarativePoliciesReportInput struct { - - // The ID of the report. - // - // This member is required. - ReportId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CancelDeclarativePoliciesReportOutput struct { - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelDeclarativePoliciesReportMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelDeclarativePoliciesReport{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelDeclarativePoliciesReport{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelDeclarativePoliciesReport"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelDeclarativePoliciesReportValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelDeclarativePoliciesReport(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelDeclarativePoliciesReport(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelDeclarativePoliciesReport", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.go deleted file mode 100644 index 7be8de075..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels an active export task. The request removes all artifacts of the export, -// including any partially-created Amazon S3 objects. If the export task is -// complete or is in the process of transferring the final disk image, the command -// fails and returns an error. -func (c *Client) CancelExportTask(ctx context.Context, params *CancelExportTaskInput, optFns ...func(*Options)) (*CancelExportTaskOutput, error) { - if params == nil { - params = &CancelExportTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelExportTask", params, optFns, c.addOperationCancelExportTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelExportTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelExportTaskInput struct { - - // The ID of the export task. This is the ID returned by the - // CreateInstanceExportTask and ExportImage operations. - // - // This member is required. - ExportTaskId *string - - noSmithyDocumentSerde -} - -type CancelExportTaskOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelExportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelExportTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelExportTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelExportTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelExportTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelExportTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelExportTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelExportTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.go deleted file mode 100644 index 6f1767050..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes your Amazon Web Services account from the launch permissions for the -// specified AMI. For more information, see [Cancel having an AMI shared with your Amazon Web Services account]in the Amazon EC2 User Guide. -// -// [Cancel having an AMI shared with your Amazon Web Services account]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cancel-sharing-an-AMI.html -func (c *Client) CancelImageLaunchPermission(ctx context.Context, params *CancelImageLaunchPermissionInput, optFns ...func(*Options)) (*CancelImageLaunchPermissionOutput, error) { - if params == nil { - params = &CancelImageLaunchPermissionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelImageLaunchPermission", params, optFns, c.addOperationCancelImageLaunchPermissionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelImageLaunchPermissionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelImageLaunchPermissionInput struct { - - // The ID of the AMI that was shared with your Amazon Web Services account. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CancelImageLaunchPermissionOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelImageLaunchPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelImageLaunchPermission{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelImageLaunchPermission{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelImageLaunchPermission"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelImageLaunchPermissionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelImageLaunchPermission(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelImageLaunchPermission(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelImageLaunchPermission", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.go deleted file mode 100644 index 935fa60e6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels an in-process import virtual machine or import snapshot task. -func (c *Client) CancelImportTask(ctx context.Context, params *CancelImportTaskInput, optFns ...func(*Options)) (*CancelImportTaskOutput, error) { - if params == nil { - params = &CancelImportTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelImportTask", params, optFns, c.addOperationCancelImportTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelImportTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelImportTaskInput struct { - - // The reason for canceling the task. - CancelReason *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the import image or import snapshot task to be canceled. - ImportTaskId *string - - noSmithyDocumentSerde -} - -type CancelImportTaskOutput struct { - - // The ID of the task being canceled. - ImportTaskId *string - - // The current state of the task being canceled. - PreviousState *string - - // The current state of the task being canceled. - State *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelImportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelImportTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelImportTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelImportTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelImportTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelImportTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelImportTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.go deleted file mode 100644 index 8c410d673..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels the specified Reserved Instance listing in the Reserved Instance -// Marketplace. -// -// For more information, see [Sell in the Reserved Instance Marketplace] in the Amazon EC2 User Guide. -// -// [Sell in the Reserved Instance Marketplace]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html -func (c *Client) CancelReservedInstancesListing(ctx context.Context, params *CancelReservedInstancesListingInput, optFns ...func(*Options)) (*CancelReservedInstancesListingOutput, error) { - if params == nil { - params = &CancelReservedInstancesListingInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelReservedInstancesListing", params, optFns, c.addOperationCancelReservedInstancesListingMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelReservedInstancesListingOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CancelReservedInstancesListing. -type CancelReservedInstancesListingInput struct { - - // The ID of the Reserved Instance listing. - // - // This member is required. - ReservedInstancesListingId *string - - noSmithyDocumentSerde -} - -// Contains the output of CancelReservedInstancesListing. -type CancelReservedInstancesListingOutput struct { - - // The Reserved Instance listing. - ReservedInstancesListings []types.ReservedInstancesListing - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelReservedInstancesListingMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelReservedInstancesListing{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelReservedInstancesListing{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelReservedInstancesListing"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelReservedInstancesListingValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelReservedInstancesListing(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelReservedInstancesListing(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelReservedInstancesListing", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.go deleted file mode 100644 index c95478771..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels the specified Spot Fleet requests. -// -// After you cancel a Spot Fleet request, the Spot Fleet launches no new instances. -// -// You must also specify whether a canceled Spot Fleet request should terminate -// its instances. If you choose to terminate the instances, the Spot Fleet request -// enters the cancelled_terminating state. Otherwise, the Spot Fleet request -// enters the cancelled_running state and the instances continue to run until they -// are interrupted or you terminate them manually. -// -// Restrictions -// -// - You can delete up to 100 fleets in a single request. If you exceed the -// specified number, no fleets are deleted. -func (c *Client) CancelSpotFleetRequests(ctx context.Context, params *CancelSpotFleetRequestsInput, optFns ...func(*Options)) (*CancelSpotFleetRequestsOutput, error) { - if params == nil { - params = &CancelSpotFleetRequestsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelSpotFleetRequests", params, optFns, c.addOperationCancelSpotFleetRequestsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelSpotFleetRequestsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CancelSpotFleetRequests. -type CancelSpotFleetRequestsInput struct { - - // The IDs of the Spot Fleet requests. - // - // Constraint: You can specify up to 100 IDs in a single request. - // - // This member is required. - SpotFleetRequestIds []string - - // Indicates whether to terminate the associated instances when the Spot Fleet - // request is canceled. The default is to terminate the instances. - // - // To let the instances continue to run after the Spot Fleet request is canceled, - // specify no-terminate-instances . - // - // This member is required. - TerminateInstances *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of CancelSpotFleetRequests. -type CancelSpotFleetRequestsOutput struct { - - // Information about the Spot Fleet requests that are successfully canceled. - SuccessfulFleetRequests []types.CancelSpotFleetRequestsSuccessItem - - // Information about the Spot Fleet requests that are not successfully canceled. - UnsuccessfulFleetRequests []types.CancelSpotFleetRequestsErrorItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelSpotFleetRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelSpotFleetRequests{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelSpotFleetRequests{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelSpotFleetRequests"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelSpotFleetRequestsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSpotFleetRequests(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelSpotFleetRequests(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelSpotFleetRequests", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.go deleted file mode 100644 index 4212b5803..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels one or more Spot Instance requests. -// -// Canceling a Spot Instance request does not terminate running Spot Instances -// associated with the request. -func (c *Client) CancelSpotInstanceRequests(ctx context.Context, params *CancelSpotInstanceRequestsInput, optFns ...func(*Options)) (*CancelSpotInstanceRequestsOutput, error) { - if params == nil { - params = &CancelSpotInstanceRequestsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelSpotInstanceRequests", params, optFns, c.addOperationCancelSpotInstanceRequestsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelSpotInstanceRequestsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsInput struct { - - // The IDs of the Spot Instance requests. - // - // This member is required. - SpotInstanceRequestIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsOutput struct { - - // The Spot Instance requests. - CancelledSpotInstanceRequests []types.CancelledSpotInstanceRequest - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelSpotInstanceRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCancelSpotInstanceRequests{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCancelSpotInstanceRequests{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelSpotInstanceRequests"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelSpotInstanceRequestsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSpotInstanceRequests(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelSpotInstanceRequests(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelSpotInstanceRequests", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.go deleted file mode 100644 index 059090583..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Determines whether a product code is associated with an instance. This action -// can only be used by the owner of the product code. It is useful when a product -// code owner must verify whether another user's instance is eligible for support. -func (c *Client) ConfirmProductInstance(ctx context.Context, params *ConfirmProductInstanceInput, optFns ...func(*Options)) (*ConfirmProductInstanceOutput, error) { - if params == nil { - params = &ConfirmProductInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ConfirmProductInstance", params, optFns, c.addOperationConfirmProductInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ConfirmProductInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ConfirmProductInstanceInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The product code. This must be a product code that you own. - // - // This member is required. - ProductCode *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ConfirmProductInstanceOutput struct { - - // The Amazon Web Services account ID of the instance owner. This is only present - // if the product code is attached to the instance. - OwnerId *string - - // The return value of the request. Returns true if the specified product code is - // owned by the requester and associated with the specified instance. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationConfirmProductInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpConfirmProductInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpConfirmProductInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ConfirmProductInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpConfirmProductInstanceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConfirmProductInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opConfirmProductInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ConfirmProductInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.go deleted file mode 100644 index 7d227a013..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Copies the specified Amazon FPGA Image (AFI) to the current Region. -func (c *Client) CopyFpgaImage(ctx context.Context, params *CopyFpgaImageInput, optFns ...func(*Options)) (*CopyFpgaImageOutput, error) { - if params == nil { - params = &CopyFpgaImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CopyFpgaImage", params, optFns, c.addOperationCopyFpgaImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CopyFpgaImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CopyFpgaImageInput struct { - - // The ID of the source AFI. - // - // This member is required. - SourceFpgaImageId *string - - // The Region that contains the source AFI. - // - // This member is required. - SourceRegion *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The description for the new AFI. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name for the new AFI. The default is the name of the source AFI. - Name *string - - noSmithyDocumentSerde -} - -type CopyFpgaImageOutput struct { - - // The ID of the new AFI. - FpgaImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCopyFpgaImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCopyFpgaImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCopyFpgaImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CopyFpgaImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCopyFpgaImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyFpgaImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCopyFpgaImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CopyFpgaImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.go deleted file mode 100644 index 2aa359a6e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Initiates an AMI copy operation. You can copy an AMI from one Region to -// another, or from a Region to an Outpost. You can't copy an AMI from an Outpost -// to a Region, from one Outpost to another, or within the same Outpost. To copy an -// AMI to another partition, see [CreateStoreImageTask]. -// -// When you copy an AMI from one Region to another, the destination Region is the -// current Region. -// -// When you copy an AMI from a Region to an Outpost, specify the ARN of the -// Outpost as the destination. Backing snapshots copied to an Outpost are encrypted -// by default using the default encryption key for the Region or the key that you -// specify. Outposts do not support unencrypted snapshots. -// -// For information about the prerequisites when copying an AMI, see [Copy an Amazon EC2 AMI] in the Amazon -// EC2 User Guide. -// -// [CreateStoreImageTask]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html -// [Copy an Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html -func (c *Client) CopyImage(ctx context.Context, params *CopyImageInput, optFns ...func(*Options)) (*CopyImageOutput, error) { - if params == nil { - params = &CopyImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CopyImage", params, optFns, c.addOperationCopyImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CopyImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CopyImage. -type CopyImageInput struct { - - // The name of the new AMI in the destination Region. - // - // This member is required. - Name *string - - // The ID of the AMI to copy. - // - // This member is required. - SourceImageId *string - - // The name of the Region that contains the AMI to copy. - // - // This member is required. - SourceRegion *string - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see [Ensuring idempotency in Amazon EC2 API requests]in the Amazon EC2 API Reference. - // - // [Ensuring idempotency in Amazon EC2 API requests]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Indicates whether to include your user-defined AMI tags when copying the AMI. - // - // The following tags will not be copied: - // - // - System tags (prefixed with aws: ) - // - // - For public and shared AMIs, user-defined tags that are attached by other - // Amazon Web Services accounts - // - // Default: Your user-defined AMI tags are not copied. - CopyImageTags *bool - - // A description for the new AMI in the destination Region. - Description *string - - // The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. Only - // specify this parameter when copying an AMI from an Amazon Web Services Region to - // an Outpost. The AMI must be in the Region of the destination Outpost. You cannot - // copy an AMI from an Outpost to a Region, from one Outpost to another, or within - // the same Outpost. - // - // For more information, see [Copy AMIs from an Amazon Web Services Region to an Outpost] in the Amazon EBS User Guide. - // - // [Copy AMIs from an Amazon Web Services Region to an Outpost]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis - DestinationOutpostArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether the destination snapshots of the copied image should be - // encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot - // create an unencrypted copy of an encrypted snapshot. The default KMS key for - // Amazon EBS is used unless you specify a non-default Key Management Service (KMS) - // KMS key using KmsKeyId . For more information, see [Use encryption with EBS-backed AMIs] in the Amazon EC2 User - // Guide. - // - // [Use encryption with EBS-backed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html - Encrypted *bool - - // The identifier of the symmetric Key Management Service (KMS) KMS key to use - // when creating encrypted volumes. If this parameter is not specified, your Amazon - // Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, - // you must also set the encrypted state to true . - // - // You can specify a KMS key using any of the following: - // - // - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Key alias. For example, alias/ExampleAlias. - // - // - Key ARN. For example, - // arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Alias ARN. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you - // specify an identifier that is not valid, the action can appear to complete, but - // eventually fails. - // - // The specified KMS key must exist in the destination Region. - // - // Amazon EBS does not support asymmetric KMS keys. - KmsKeyId *string - - // Specify a completion duration, in 15 minute increments, to initiate a - // time-based AMI copy. The specified completion duration applies to each of the - // snapshots associated with the AMI. Each snapshot associated with the AMI will be - // completed within the specified completion duration, with copy throughput - // automatically adjusted for each snapshot based on its size to meet the timing - // target. - // - // If you do not specify a value, the AMI copy operation is completed on a - // best-effort basis. - // - // For more information, see [Time-based copies for Amazon EBS snapshots and EBS-backed AMIs]. - // - // [Time-based copies for Amazon EBS snapshots and EBS-backed AMIs]: https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html - SnapshotCopyCompletionDurationMinutes *int64 - - // The tags to apply to the new AMI and new snapshots. You can tag the AMI, the - // snapshots, or both. - // - // - To tag the new AMI, the value for ResourceType must be image . - // - // - To tag the new snapshots, the value for ResourceType must be snapshot . The - // same tag is applied to all the new snapshots. - // - // If you specify other values for ResourceType , the request fails. - // - // To tag an AMI or snapshot after it has been created, see [CreateTags]. - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Contains the output of CopyImage. -type CopyImageOutput struct { - - // The ID of the new AMI. - ImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCopyImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCopyImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCopyImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CopyImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCopyImageMiddleware(stack, options); err != nil { - return err - } - if err = addOpCopyImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCopyImage struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCopyImage) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCopyImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CopyImageInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CopyImageInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCopyImageMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCopyImage{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCopyImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CopyImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.go deleted file mode 100644 index 463203491..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.go +++ /dev/null @@ -1,384 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. -// You can copy a snapshot within the same Region, from one Region to another, or -// from a Region to an Outpost. You can't copy a snapshot from an Outpost to a -// Region, from one Outpost to another, or within the same Outpost. -// -// You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). -// -// When copying snapshots to a Region, copies of encrypted EBS snapshots remain -// encrypted. Copies of unencrypted snapshots remain unencrypted, unless you enable -// encryption for the snapshot copy operation. By default, encrypted snapshot -// copies use the default KMS key; however, you can specify a different KMS key. To -// copy an encrypted snapshot that has been shared from another account, you must -// have permissions for the KMS key used to encrypt the snapshot. -// -// Snapshots copied to an Outpost are encrypted by default using the default -// encryption key for the Region, or a different key that you specify in the -// request using KmsKeyId. Outposts do not support unencrypted snapshots. For more -// information, see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. -// -// Snapshots created by copying another snapshot have an arbitrary volume ID that -// should not be used for any purpose. -// -// For more information, see [Copy an Amazon EBS snapshot] in the Amazon EBS User Guide. -// -// [Copy an Amazon EBS snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-copy-snapshot.html -// [Amazon EBS local snapshots on Outposts]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#ami -func (c *Client) CopySnapshot(ctx context.Context, params *CopySnapshotInput, optFns ...func(*Options)) (*CopySnapshotOutput, error) { - if params == nil { - params = &CopySnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CopySnapshot", params, optFns, c.addOperationCopySnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CopySnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CopySnapshotInput struct { - - // The ID of the Region that contains the snapshot to be copied. - // - // This member is required. - SourceRegion *string - - // The ID of the EBS snapshot to copy. - // - // This member is required. - SourceSnapshotId *string - - // Specify a completion duration, in 15 minute increments, to initiate a - // time-based snapshot copy. Time-based snapshot copy operations complete within - // the specified duration. For more information, see [Time-based copies]. - // - // If you do not specify a value, the snapshot copy operation is completed on a - // best-effort basis. - // - // [Time-based copies]: https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html - CompletionDurationMinutes *int32 - - // A description for the EBS snapshot. - Description *string - - // The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. - // Only specify this parameter when copying a snapshot from an Amazon Web Services - // Region to an Outpost. The snapshot must be in the Region for the destination - // Outpost. You cannot copy a snapshot from an Outpost to a Region, from one - // Outpost to another, or within the same Outpost. - // - // For more information, see [Copy snapshots from an Amazon Web Services Region to an Outpost] in the Amazon EBS User Guide. - // - // [Copy snapshots from an Amazon Web Services Region to an Outpost]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots - DestinationOutpostArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // To encrypt a copy of an unencrypted snapshot if encryption by default is not - // enabled, enable encryption using this parameter. Otherwise, omit this parameter. - // Encrypted snapshots are encrypted, even if you omit this parameter and - // encryption by default is not enabled. You cannot set this parameter to false. - // For more information, see [Amazon EBS encryption]in the Amazon EBS User Guide. - // - // [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html - Encrypted *bool - - // The identifier of the KMS key to use for Amazon EBS encryption. If this - // parameter is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is - // specified, the encrypted state must be true . - // - // You can specify the KMS key using any of the following: - // - // - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Key alias. For example, alias/ExampleAlias. - // - // - Key ARN. For example, - // arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Alias ARN. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you - // specify an ID, alias, or ARN that is not valid, the action can appear to - // complete, but eventually fails. - KmsKeyId *string - - // When you copy an encrypted source snapshot using the Amazon EC2 Query API, you - // must supply a pre-signed URL. This parameter is optional for unencrypted - // snapshots. For more information, see [Query requests]. - // - // The PresignedUrl should use the snapshot source endpoint, the CopySnapshot - // action, and include the SourceRegion , SourceSnapshotId , and DestinationRegion - // parameters. The PresignedUrl must be signed using Amazon Web Services Signature - // Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm - // for this parameter uses the same logic that is described in [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]in the Amazon S3 - // API Reference. An invalid or improperly signed PresignedUrl will cause the copy - // operation to fail asynchronously, and the snapshot will move to an error state. - // - // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html - // [Query requests]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html - PresignedUrl *string - - // The tags to apply to the new snapshot. - TagSpecifications []types.TagSpecification - - // Used by the SDK's PresignURL autofill customization to specify the region the - // of the client's request. - destinationRegion *string - - noSmithyDocumentSerde -} - -type CopySnapshotOutput struct { - - // The ID of the new snapshot. - SnapshotId *string - - // Any tags applied to the new snapshot. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCopySnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCopySnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCopySnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CopySnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addCopySnapshotPresignURLMiddleware(stack, options); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCopySnapshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopySnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func copyCopySnapshotInputForPresign(params interface{}) (interface{}, error) { - input, ok := params.(*CopySnapshotInput) - if !ok { - return nil, fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - cpy := *input - return &cpy, nil -} -func getCopySnapshotPresignedUrl(params interface{}) (string, bool, error) { - input, ok := params.(*CopySnapshotInput) - if !ok { - return ``, false, fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - if input.PresignedUrl == nil || len(*input.PresignedUrl) == 0 { - return ``, false, nil - } - return *input.PresignedUrl, true, nil -} -func getCopySnapshotSourceRegion(params interface{}) (string, bool, error) { - input, ok := params.(*CopySnapshotInput) - if !ok { - return ``, false, fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { - return ``, false, nil - } - return *input.SourceRegion, true, nil -} -func setCopySnapshotPresignedUrl(params interface{}, value string) error { - input, ok := params.(*CopySnapshotInput) - if !ok { - return fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - input.PresignedUrl = &value - return nil -} -func setCopySnapshotdestinationRegion(params interface{}, value string) error { - input, ok := params.(*CopySnapshotInput) - if !ok { - return fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - input.destinationRegion = &value - return nil -} -func addCopySnapshotPresignURLMiddleware(stack *middleware.Stack, options Options) error { - return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ - Accessor: presignedurlcust.ParameterAccessor{ - GetPresignedURL: getCopySnapshotPresignedUrl, - - GetSourceRegion: getCopySnapshotSourceRegion, - - CopyInput: copyCopySnapshotInputForPresign, - - SetDestinationRegion: setCopySnapshotdestinationRegion, - - SetPresignedURL: setCopySnapshotPresignedUrl, - }, - Presigner: &presignAutoFillCopySnapshotClient{client: NewPresignClient(New(options))}, - }) -} - -type presignAutoFillCopySnapshotClient struct { - client *PresignClient -} - -// PresignURL is a middleware accessor that satisfies URLPresigner interface. -func (c *presignAutoFillCopySnapshotClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { - input, ok := params.(*CopySnapshotInput) - if !ok { - return nil, fmt.Errorf("expect *CopySnapshotInput type, got %T", params) - } - optFn := func(o *Options) { - o.Region = srcRegion - o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) - } - presignOptFn := WithPresignClientFromClientOptions(optFn) - return c.client.PresignCopySnapshot(ctx, input, presignOptFn) -} - -func newServiceMetadataMiddleware_opCopySnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CopySnapshot", - } -} - -// PresignCopySnapshot is used to generate a presigned HTTP Request which contains -// presigned URL, signed headers and HTTP method used. -func (c *PresignClient) PresignCopySnapshot(ctx context.Context, params *CopySnapshotInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { - if params == nil { - params = &CopySnapshotInput{} - } - options := c.options.copy() - for _, fn := range optFns { - fn(&options) - } - clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) - - result, _, err := c.client.invokeOperation(ctx, "CopySnapshot", params, clientOptFns, - c.client.addOperationCopySnapshotMiddlewares, - presignConverter(options).convertToPresignMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*v4.PresignedHTTPRequest) - return out, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.go deleted file mode 100644 index 5c36aae99..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.go +++ /dev/null @@ -1,346 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates a new Capacity Reservation with the specified attributes. Capacity -// Reservations enable you to reserve capacity for your Amazon EC2 instances in a -// specific Availability Zone for any duration. -// -// You can create a Capacity Reservation at any time, and you can choose when it -// starts. You can create a Capacity Reservation for immediate use or you can -// request a Capacity Reservation for a future date. -// -// For more information, see [Reserve compute capacity with On-Demand Capacity Reservations] in the Amazon EC2 User Guide. -// -// Your request to create a Capacity Reservation could fail if: -// -// - Amazon EC2 does not have sufficient capacity. In this case, try again at a -// later time, try in a different Availability Zone, or request a smaller Capacity -// Reservation. If your workload is flexible across instance types and sizes, try -// with different instance attributes. -// -// - The requested quantity exceeds your On-Demand Instance quota. In this case, -// increase your On-Demand Instance quota for the requested instance type and try -// again. For more information, see [Amazon EC2 Service Quotas]in the Amazon EC2 User Guide. -// -// [Amazon EC2 Service Quotas]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html -// [Reserve compute capacity with On-Demand Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html -func (c *Client) CreateCapacityReservation(ctx context.Context, params *CreateCapacityReservationInput, optFns ...func(*Options)) (*CreateCapacityReservationOutput, error) { - if params == nil { - params = &CreateCapacityReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCapacityReservation", params, optFns, c.addOperationCreateCapacityReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCapacityReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCapacityReservationInput struct { - - // The number of instances for which to reserve capacity. - // - // You can request future-dated Capacity Reservations for an instance count with a - // minimum of 100 vCPUs. For example, if you request a future-dated Capacity - // Reservation for m5.xlarge instances, you must request at least 25 instances (25 - // * m5.xlarge = 100 vCPUs). - // - // Valid range: 1 - 1000 - // - // This member is required. - InstanceCount *int32 - - // The type of operating system for which to reserve capacity. - // - // This member is required. - InstancePlatform types.CapacityReservationInstancePlatform - - // The instance type for which to reserve capacity. - // - // You can request future-dated Capacity Reservations for instance types in the C, - // M, R, I, and T instance families only. - // - // For more information, see [Instance types] in the Amazon EC2 User Guide. - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - // - // This member is required. - InstanceType *string - - // The Availability Zone in which to create the Capacity Reservation. - AvailabilityZone *string - - // The ID of the Availability Zone in which to create the Capacity Reservation. - AvailabilityZoneId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensure Idempotency]. - // - // [Ensure Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Required for future-dated Capacity Reservations only. To create a Capacity - // Reservation for immediate use, omit this parameter. - // - // Specify a commitment duration, in seconds, for the future-dated Capacity - // Reservation. - // - // The commitment duration is a minimum duration for which you commit to having - // the future-dated Capacity Reservation in the active state in your account after - // it has been delivered. - // - // For more information, see [Commitment duration]. - // - // [Commitment duration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-concepts.html#cr-commitment-duration - CommitmentDuration *int64 - - // Required for future-dated Capacity Reservations only. To create a Capacity - // Reservation for immediate use, omit this parameter. - // - // Indicates that the requested capacity will be delivered in addition to any - // running instances or reserved capacity that you have in your account at the - // requested date and time. - // - // The only supported value is incremental . - DeliveryPreference types.CapacityReservationDeliveryPreference - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether the Capacity Reservation supports EBS-optimized instances. - // This optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using an - // EBS- optimized instance. - EbsOptimized *bool - - // The date and time at which the Capacity Reservation expires. When a Capacity - // Reservation expires, the reserved capacity is released and you can no longer - // launch instances into it. The Capacity Reservation's state changes to expired - // when it reaches its end date and time. - // - // You must provide an EndDate value if EndDateType is limited . Omit EndDate if - // EndDateType is unlimited . - // - // If the EndDateType is limited , the Capacity Reservation is cancelled within an - // hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, - // the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on - // 5/31/2019. - // - // If you are requesting a future-dated Capacity Reservation, you can't specify an - // end date and time that is within the commitment duration. - EndDate *time.Time - - // Indicates the way in which the Capacity Reservation ends. A Capacity - // Reservation can have one of the following end types: - // - // - unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. Do not provide an EndDate if the EndDateType is unlimited . - // - // - limited - The Capacity Reservation expires automatically at a specified date - // and time. You must provide an EndDate value if the EndDateType value is - // limited . - EndDateType types.EndDateType - - // Deprecated. - EphemeralStorage *bool - - // Indicates the type of instance launches that the Capacity Reservation accepts. - // The options include: - // - // - open - The Capacity Reservation automatically matches all instances that - // have matching attributes (instance type, platform, and Availability Zone). - // Instances that have matching attributes run in the Capacity Reservation - // automatically without specifying any additional parameters. - // - // - targeted - The Capacity Reservation only accepts instances that have - // matching attributes (instance type, platform, and Availability Zone), and - // explicitly target the Capacity Reservation. This ensures that only permitted - // instances can use the reserved capacity. - // - // If you are requesting a future-dated Capacity Reservation, you must specify - // targeted . - // - // Default: open - InstanceMatchCriteria types.InstanceMatchCriteria - - // Not supported for future-dated Capacity Reservations. - // - // The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity - // Reservation. - OutpostArn *string - - // Not supported for future-dated Capacity Reservations. - // - // The Amazon Resource Name (ARN) of the cluster placement group in which to - // create the Capacity Reservation. For more information, see [Capacity Reservations for cluster placement groups]in the Amazon EC2 - // User Guide. - // - // [Capacity Reservations for cluster placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html - PlacementGroupArn *string - - // Required for future-dated Capacity Reservations only. To create a Capacity - // Reservation for immediate use, omit this parameter. - // - // The date and time at which the future-dated Capacity Reservation should become - // available for use, in the ISO8601 format in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - // - // You can request a future-dated Capacity Reservation between 5 and 120 days in - // advance. - StartDate *time.Time - - // The tags to apply to the Capacity Reservation during launch. - TagSpecifications []types.TagSpecification - - // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can - // have one of the following tenancy settings: - // - // - default - The Capacity Reservation is created on hardware that is shared - // with other Amazon Web Services accounts. - // - // - dedicated - The Capacity Reservation is created on single-tenant hardware - // that is dedicated to a single Amazon Web Services account. - Tenancy types.CapacityReservationTenancy - - noSmithyDocumentSerde -} - -type CreateCapacityReservationOutput struct { - - // Information about the Capacity Reservation. - CapacityReservation *types.CapacityReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCapacityReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCapacityReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCapacityReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCapacityReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateCapacityReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCapacityReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCapacityReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.go deleted file mode 100644 index 8d2918f6e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create a new Capacity Reservation by splitting the capacity of the source -// -// Capacity Reservation. The new Capacity Reservation will have the same attributes -// as the source Capacity Reservation except for tags. The source Capacity -// Reservation must be active and owned by your Amazon Web Services account. -func (c *Client) CreateCapacityReservationBySplitting(ctx context.Context, params *CreateCapacityReservationBySplittingInput, optFns ...func(*Options)) (*CreateCapacityReservationBySplittingOutput, error) { - if params == nil { - params = &CreateCapacityReservationBySplittingInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCapacityReservationBySplitting", params, optFns, c.addOperationCreateCapacityReservationBySplittingMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCapacityReservationBySplittingOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCapacityReservationBySplittingInput struct { - - // The number of instances to split from the source Capacity Reservation. - // - // This member is required. - InstanceCount *int32 - - // The ID of the Capacity Reservation from which you want to split the capacity. - // - // This member is required. - SourceCapacityReservationId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensure Idempotency]. - // - // [Ensure Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the new Capacity Reservation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateCapacityReservationBySplittingOutput struct { - - // Information about the destination Capacity Reservation. - DestinationCapacityReservation *types.CapacityReservation - - // The number of instances in the new Capacity Reservation. The number of - // instances in the source Capacity Reservation was reduced by this amount. - InstanceCount *int32 - - // Information about the source Capacity Reservation. - SourceCapacityReservation *types.CapacityReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCapacityReservationBySplittingMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCapacityReservationBySplitting{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCapacityReservationBySplitting{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCapacityReservationBySplitting"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateCapacityReservationBySplittingMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateCapacityReservationBySplittingValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCapacityReservationBySplitting(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateCapacityReservationBySplitting struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateCapacityReservationBySplitting) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateCapacityReservationBySplitting) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateCapacityReservationBySplittingInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCapacityReservationBySplittingInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateCapacityReservationBySplittingMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCapacityReservationBySplitting{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateCapacityReservationBySplitting(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCapacityReservationBySplitting", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.go deleted file mode 100644 index f4a9fbacf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates a Capacity Reservation Fleet. For more information, see [Create a Capacity Reservation Fleet] in the Amazon -// EC2 User Guide. -// -// [Create a Capacity Reservation Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-cr-fleets.html#create-crfleet -func (c *Client) CreateCapacityReservationFleet(ctx context.Context, params *CreateCapacityReservationFleetInput, optFns ...func(*Options)) (*CreateCapacityReservationFleetOutput, error) { - if params == nil { - params = &CreateCapacityReservationFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCapacityReservationFleet", params, optFns, c.addOperationCreateCapacityReservationFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCapacityReservationFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCapacityReservationFleetInput struct { - - // Information about the instance types for which to reserve the capacity. - // - // This member is required. - InstanceTypeSpecifications []types.ReservationFleetInstanceSpecification - - // The total number of capacity units to be reserved by the Capacity Reservation - // Fleet. This value, together with the instance type weights that you assign to - // each instance type used by the Fleet determine the number of instances for which - // the Fleet reserves capacity. Both values are based on units that make sense for - // your workload. For more information, see [Total target capacity]in the Amazon EC2 User Guide. - // - // [Total target capacity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity - // - // This member is required. - TotalTargetCapacity *int32 - - // The strategy used by the Capacity Reservation Fleet to determine which of the - // specified instance types to use. Currently, only the prioritized allocation - // strategy is supported. For more information, see [Allocation strategy]in the Amazon EC2 User Guide. - // - // Valid values: prioritized - // - // [Allocation strategy]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#allocation-strategy - AllocationStrategy *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensure Idempotency]. - // - // [Ensure Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The date and time at which the Capacity Reservation Fleet expires. When the - // Capacity Reservation Fleet expires, its state changes to expired and all of the - // Capacity Reservations in the Fleet expire. - // - // The Capacity Reservation Fleet expires within an hour after the specified time. - // For example, if you specify 5/31/2019 , 13:30:55 , the Capacity Reservation - // Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019 . - EndDate *time.Time - - // Indicates the type of instance launches that the Capacity Reservation Fleet - // accepts. All Capacity Reservations in the Fleet inherit this instance matching - // criteria. - // - // Currently, Capacity Reservation Fleets support open instance matching criteria - // only. This means that instances that have matching attributes (instance type, - // platform, and Availability Zone) run in the Capacity Reservations automatically. - // Instances do not need to explicitly target a Capacity Reservation Fleet to use - // its reserved capacity. - InstanceMatchCriteria types.FleetInstanceMatchCriteria - - // The tags to assign to the Capacity Reservation Fleet. The tags are - // automatically assigned to the Capacity Reservations in the Fleet. - TagSpecifications []types.TagSpecification - - // Indicates the tenancy of the Capacity Reservation Fleet. All Capacity - // Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet - // can have one of the following tenancy settings: - // - // - default - The Capacity Reservation Fleet is created on hardware that is - // shared with other Amazon Web Services accounts. - // - // - dedicated - The Capacity Reservations are created on single-tenant hardware - // that is dedicated to a single Amazon Web Services account. - Tenancy types.FleetCapacityReservationTenancy - - noSmithyDocumentSerde -} - -type CreateCapacityReservationFleetOutput struct { - - // The allocation strategy used by the Capacity Reservation Fleet. - AllocationStrategy *string - - // The ID of the Capacity Reservation Fleet. - CapacityReservationFleetId *string - - // The date and time at which the Capacity Reservation Fleet was created. - CreateTime *time.Time - - // The date and time at which the Capacity Reservation Fleet expires. - EndDate *time.Time - - // Information about the individual Capacity Reservations in the Capacity - // Reservation Fleet. - FleetCapacityReservations []types.FleetCapacityReservation - - // The instance matching criteria for the Capacity Reservation Fleet. - InstanceMatchCriteria types.FleetInstanceMatchCriteria - - // The status of the Capacity Reservation Fleet. - State types.CapacityReservationFleetState - - // The tags assigned to the Capacity Reservation Fleet. - Tags []types.Tag - - // Indicates the tenancy of Capacity Reservation Fleet. - Tenancy types.FleetCapacityReservationTenancy - - // The requested capacity units that have been successfully reserved. - TotalFulfilledCapacity *float64 - - // The total number of capacity units for which the Capacity Reservation Fleet - // reserves capacity. - TotalTargetCapacity *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCapacityReservationFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCapacityReservationFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCapacityReservationFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCapacityReservationFleet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateCapacityReservationFleetMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateCapacityReservationFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCapacityReservationFleet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateCapacityReservationFleet struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateCapacityReservationFleet) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateCapacityReservationFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateCapacityReservationFleetInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCapacityReservationFleetInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateCapacityReservationFleetMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCapacityReservationFleet{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateCapacityReservationFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCapacityReservationFleet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.go deleted file mode 100644 index 9b4d96802..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a carrier gateway. For more information about carrier gateways, see [Carrier gateways] in -// the Amazon Web Services Wavelength Developer Guide. -// -// [Carrier gateways]: https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#wavelength-carrier-gateway -func (c *Client) CreateCarrierGateway(ctx context.Context, params *CreateCarrierGatewayInput, optFns ...func(*Options)) (*CreateCarrierGatewayOutput, error) { - if params == nil { - params = &CreateCarrierGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCarrierGateway", params, optFns, c.addOperationCreateCarrierGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCarrierGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCarrierGatewayInput struct { - - // The ID of the VPC to associate with the carrier gateway. - // - // This member is required. - VpcId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to associate with the carrier gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateCarrierGatewayOutput struct { - - // Information about the carrier gateway. - CarrierGateway *types.CarrierGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCarrierGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCarrierGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCarrierGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCarrierGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateCarrierGatewayMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateCarrierGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCarrierGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateCarrierGateway struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateCarrierGateway) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateCarrierGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateCarrierGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCarrierGatewayInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateCarrierGatewayMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCarrierGateway{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateCarrierGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCarrierGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.go deleted file mode 100644 index 6704b3517..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.go +++ /dev/null @@ -1,328 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Client VPN endpoint. A Client VPN endpoint is the resource you create -// and configure to enable and manage client VPN sessions. It is the destination -// endpoint at which all client VPN sessions are terminated. -func (c *Client) CreateClientVpnEndpoint(ctx context.Context, params *CreateClientVpnEndpointInput, optFns ...func(*Options)) (*CreateClientVpnEndpointOutput, error) { - if params == nil { - params = &CreateClientVpnEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateClientVpnEndpoint", params, optFns, c.addOperationCreateClientVpnEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateClientVpnEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateClientVpnEndpointInput struct { - - // Information about the authentication method to be used to authenticate clients. - // - // This member is required. - AuthenticationOptions []types.ClientVpnAuthenticationRequest - - // The IPv4 address range, in CIDR notation, from which to assign client IP - // addresses. The address range cannot overlap with the local CIDR of the VPC in - // which the associated subnet is located, or the routes that you add manually. The - // address range cannot be changed after the Client VPN endpoint has been created. - // Client CIDR range must have a size of at least /22 and must not be greater than - // /12. - // - // This member is required. - ClientCidrBlock *string - - // Information about the client connection logging options. - // - // If you enable client connection logging, data about client connections is sent - // to a Cloudwatch Logs log stream. The following information is logged: - // - // - Client connection requests - // - // - Client connection results (successful and unsuccessful) - // - // - Reasons for unsuccessful client connection requests - // - // - Client connection termination time - // - // This member is required. - ConnectionLogOptions *types.ConnectionLogOptions - - // The ARN of the server certificate. For more information, see the [Certificate Manager User Guide]. - // - // [Certificate Manager User Guide]: https://docs.aws.amazon.com/acm/latest/userguide/ - // - // This member is required. - ServerCertificateArn *string - - // The options for managing connection authorization for new client connections. - ClientConnectOptions *types.ClientConnectOptions - - // Options for enabling a customizable text banner that will be displayed on - // Amazon Web Services provided clients when a VPN session is established. - ClientLoginBannerOptions *types.ClientLoginBannerOptions - - // Client route enforcement is a feature of the Client VPN service that helps - // enforce administrator defined routes on devices connected through the VPN. T his - // feature helps improve your security posture by ensuring that network traffic - // originating from a connected client is not inadvertently sent outside the VPN - // tunnel. - // - // Client route enforcement works by monitoring the route table of a connected - // device for routing policy changes to the VPN connection. If the feature detects - // any VPN routing policy modifications, it will automatically force an update to - // the route table, reverting it back to the expected route configurations. - ClientRouteEnforcementOptions *types.ClientRouteEnforcementOptions - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A brief description of the Client VPN endpoint. - Description *string - - // Indicates whether the client VPN session is disconnected after the maximum - // timeout specified in SessionTimeoutHours is reached. If true , users are - // prompted to reconnect client VPN. If false , client VPN attempts to reconnect - // automatically. The default value is true . - DisconnectOnSessionTimeout *bool - - // Information about the DNS servers to be used for DNS resolution. A Client VPN - // endpoint can have up to two DNS servers. If no DNS server is specified, the DNS - // address configured on the device is used for the DNS server. - DnsServers []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of one or more security groups to apply to the target network. You must - // also specify the ID of the VPC that contains the security groups. - SecurityGroupIds []string - - // Specify whether to enable the self-service portal for the Client VPN endpoint. - // - // Default Value: enabled - SelfServicePortal types.SelfServicePortal - - // The maximum VPN session duration time in hours. - // - // Valid values: 8 | 10 | 12 | 24 - // - // Default value: 24 - SessionTimeoutHours *int32 - - // Indicates whether split-tunnel is enabled on the Client VPN endpoint. - // - // By default, split-tunnel on a VPN endpoint is disabled. - // - // For information about split-tunnel VPN endpoints, see [Split-tunnel Client VPN endpoint] in the Client VPN - // Administrator Guide. - // - // [Split-tunnel Client VPN endpoint]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html - SplitTunnel *bool - - // The tags to apply to the Client VPN endpoint during creation. - TagSpecifications []types.TagSpecification - - // The transport protocol to be used by the VPN session. - // - // Default value: udp - TransportProtocol types.TransportProtocol - - // The ID of the VPC to associate with the Client VPN endpoint. If no security - // group IDs are specified in the request, the default security group for the VPC - // is applied. - VpcId *string - - // The port number to assign to the Client VPN endpoint for TCP and UDP traffic. - // - // Valid Values: 443 | 1194 - // - // Default Value: 443 - VpnPort *int32 - - noSmithyDocumentSerde -} - -type CreateClientVpnEndpointOutput struct { - - // The ID of the Client VPN endpoint. - ClientVpnEndpointId *string - - // The DNS name to be used by clients when establishing their VPN session. - DnsName *string - - // The current state of the Client VPN endpoint. - Status *types.ClientVpnEndpointStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateClientVpnEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateClientVpnEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateClientVpnEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateClientVpnEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateClientVpnEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateClientVpnEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateClientVpnEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateClientVpnEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateClientVpnEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateClientVpnEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateClientVpnEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateClientVpnEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateClientVpnEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateClientVpnEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.go deleted file mode 100644 index 39ead32b0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint -// has a route table that describes the available destination network routes. Each -// route in the route table specifies the path for traffic to specific resources or -// networks. -func (c *Client) CreateClientVpnRoute(ctx context.Context, params *CreateClientVpnRouteInput, optFns ...func(*Options)) (*CreateClientVpnRouteOutput, error) { - if params == nil { - params = &CreateClientVpnRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateClientVpnRoute", params, optFns, c.addOperationCreateClientVpnRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateClientVpnRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateClientVpnRouteInput struct { - - // The ID of the Client VPN endpoint to which to add the route. - // - // This member is required. - ClientVpnEndpointId *string - - // The IPv4 address range, in CIDR notation, of the route destination. For example: - // - // - To add a route for Internet access, enter 0.0.0.0/0 - // - // - To add a route for a peered VPC, enter the peered VPC's IPv4 CIDR range - // - // - To add a route for an on-premises network, enter the Amazon Web Services - // Site-to-Site VPN connection's IPv4 CIDR range - // - // - To add a route for the local network, enter the client CIDR range - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the subnet through which you want to route traffic. The specified - // subnet must be an existing target network of the Client VPN endpoint. - // - // Alternatively, if you're adding a route for the local network, specify local . - // - // This member is required. - TargetVpcSubnetId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A brief description of the route. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CreateClientVpnRouteOutput struct { - - // The current state of the route. - Status *types.ClientVpnRouteStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateClientVpnRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateClientVpnRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateClientVpnRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateClientVpnRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateClientVpnRouteMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateClientVpnRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateClientVpnRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateClientVpnRoute struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateClientVpnRoute) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateClientVpnRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateClientVpnRouteInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateClientVpnRouteInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateClientVpnRouteMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateClientVpnRoute{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateClientVpnRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateClientVpnRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.go deleted file mode 100644 index bd52562b7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a range of customer-owned IP addresses. -func (c *Client) CreateCoipCidr(ctx context.Context, params *CreateCoipCidrInput, optFns ...func(*Options)) (*CreateCoipCidrOutput, error) { - if params == nil { - params = &CreateCoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCoipCidr", params, optFns, c.addOperationCreateCoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCoipCidrInput struct { - - // A customer-owned IP address range to create. - // - // This member is required. - Cidr *string - - // The ID of the address pool. - // - // This member is required. - CoipPoolId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CreateCoipCidrOutput struct { - - // Information about a range of customer-owned IP addresses. - CoipCidr *types.CoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateCoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateCoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.go deleted file mode 100644 index 9858dd9e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a pool of customer-owned IP (CoIP) addresses. -func (c *Client) CreateCoipPool(ctx context.Context, params *CreateCoipPoolInput, optFns ...func(*Options)) (*CreateCoipPoolOutput, error) { - if params == nil { - params = &CreateCoipPoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCoipPool", params, optFns, c.addOperationCreateCoipPoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCoipPoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCoipPoolInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the CoIP address pool. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateCoipPoolOutput struct { - - // Information about the CoIP address pool. - CoipPool *types.CoipPool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCoipPoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCoipPool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCoipPool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCoipPool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateCoipPoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCoipPool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateCoipPool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCoipPool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.go deleted file mode 100644 index 8818b500c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provides information to Amazon Web Services about your customer gateway device. -// The customer gateway device is the appliance at your end of the VPN connection. -// You must provide the IP address of the customer gateway device’s external -// interface. The IP address must be static and can be behind a device performing -// network address translation (NAT). -// -// For devices that use Border Gateway Protocol (BGP), you can also provide the -// device's BGP Autonomous System Number (ASN). You can use an existing ASN -// assigned to your network. If you don't have an ASN already, you can use a -// private ASN. For more information, see [Customer gateway options for your Site-to-Site VPN connection]in the Amazon Web Services Site-to-Site -// VPN User Guide. -// -// To create more than one customer gateway with the same VPN type, IP address, -// and BGP ASN, specify a unique device name for each customer gateway. An -// identical request returns information about the existing customer gateway; it -// doesn't create a new customer gateway. -// -// [Customer gateway options for your Site-to-Site VPN connection]: https://docs.aws.amazon.com/vpn/latest/s2svpn/cgw-options.html -func (c *Client) CreateCustomerGateway(ctx context.Context, params *CreateCustomerGatewayInput, optFns ...func(*Options)) (*CreateCustomerGatewayOutput, error) { - if params == nil { - params = &CreateCustomerGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCustomerGateway", params, optFns, c.addOperationCreateCustomerGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCustomerGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateCustomerGateway. -type CreateCustomerGatewayInput struct { - - // The type of VPN connection that this customer gateway supports ( ipsec.1 ). - // - // This member is required. - Type types.GatewayType - - // For customer gateway devices that support BGP, specify the device's ASN. You - // must specify either BgpAsn or BgpAsnExtended when creating the customer - // gateway. If the ASN is larger than 2,147,483,647 , you must use BgpAsnExtended . - // - // Default: 65000 - // - // Valid values: 1 to 2,147,483,647 - BgpAsn *int32 - - // For customer gateway devices that support BGP, specify the device's ASN. You - // must specify either BgpAsn or BgpAsnExtended when creating the customer - // gateway. If the ASN is larger than 2,147,483,647 , you must use BgpAsnExtended . - // - // Valid values: 2,147,483,648 to 4,294,967,295 - BgpAsnExtended *int64 - - // The Amazon Resource Name (ARN) for the customer gateway certificate. - CertificateArn *string - - // A name for the customer gateway device. - // - // Length Constraints: Up to 255 characters. - DeviceName *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address for the customer gateway device's outside interface. The address - // must be static. If OutsideIpAddressType in your VPN connection options is set - // to PrivateIpv4 , you can use an RFC6598 or RFC1918 private IPv4 address. If - // OutsideIpAddressType is set to Ipv6 , you can use an IPv6 address. - IpAddress *string - - // This member has been deprecated. The Internet-routable IP address for the - // customer gateway's outside interface. The address must be static. - PublicIp *string - - // The tags to apply to the customer gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Contains the output of CreateCustomerGateway. -type CreateCustomerGatewayOutput struct { - - // Information about the customer gateway. - CustomerGateway *types.CustomerGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCustomerGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateCustomerGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateCustomerGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCustomerGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateCustomerGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomerGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateCustomerGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCustomerGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.go deleted file mode 100644 index 5d7ef24ec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a default subnet with a size /20 IPv4 CIDR block in the specified -// Availability Zone in your default VPC. You can have only one default subnet per -// Availability Zone. For more information, see [Create a default subnet]in the Amazon VPC User Guide. -// -// [Create a default subnet]: https://docs.aws.amazon.com/vpc/latest/userguide/work-with-default-vpc.html#create-default-subnet -func (c *Client) CreateDefaultSubnet(ctx context.Context, params *CreateDefaultSubnetInput, optFns ...func(*Options)) (*CreateDefaultSubnetOutput, error) { - if params == nil { - params = &CreateDefaultSubnetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateDefaultSubnet", params, optFns, c.addOperationCreateDefaultSubnetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateDefaultSubnetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateDefaultSubnetInput struct { - - // The Availability Zone in which to create the default subnet. - // - // This member is required. - AvailabilityZone *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether to create an IPv6 only subnet. If you already have a default - // subnet for this Availability Zone, you must delete it before you can create an - // IPv6 only subnet. - Ipv6Native *bool - - noSmithyDocumentSerde -} - -type CreateDefaultSubnetOutput struct { - - // Information about the subnet. - Subnet *types.Subnet - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateDefaultSubnetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateDefaultSubnet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateDefaultSubnet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDefaultSubnet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateDefaultSubnetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDefaultSubnet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateDefaultSubnet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateDefaultSubnet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.go deleted file mode 100644 index 37d297ff1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet in -// each Availability Zone. For more information about the components of a default -// VPC, see [Default VPCs]in the Amazon VPC User Guide. You cannot specify the components of the -// default VPC yourself. -// -// If you deleted your previous default VPC, you can create a default VPC. You -// cannot have more than one default VPC per Region. -// -// [Default VPCs]: https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html -func (c *Client) CreateDefaultVpc(ctx context.Context, params *CreateDefaultVpcInput, optFns ...func(*Options)) (*CreateDefaultVpcOutput, error) { - if params == nil { - params = &CreateDefaultVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateDefaultVpc", params, optFns, c.addOperationCreateDefaultVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateDefaultVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateDefaultVpcInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CreateDefaultVpcOutput struct { - - // Information about the VPC. - Vpc *types.Vpc - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateDefaultVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateDefaultVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateDefaultVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDefaultVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDefaultVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateDefaultVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateDefaultVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.go deleted file mode 100644 index 6be582827..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delegates ownership of the Amazon EBS root volume for an Apple silicon Mac -// instance to an administrative user. -func (c *Client) CreateDelegateMacVolumeOwnershipTask(ctx context.Context, params *CreateDelegateMacVolumeOwnershipTaskInput, optFns ...func(*Options)) (*CreateDelegateMacVolumeOwnershipTaskOutput, error) { - if params == nil { - params = &CreateDelegateMacVolumeOwnershipTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateDelegateMacVolumeOwnershipTask", params, optFns, c.addOperationCreateDelegateMacVolumeOwnershipTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateDelegateMacVolumeOwnershipTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateDelegateMacVolumeOwnershipTaskInput struct { - - // The ID of the Amazon EC2 Mac instance. - // - // This member is required. - InstanceId *string - - // Specifies the following credentials: - // - // - Internal disk administrative user - // - // - Username - Only the default administrative user ( aws-managed-user ) is - // supported and it is used by default. You can't specify a different - // administrative user. - // - // - Password - If you did not change the default password for aws-managed-user , - // specify the default password, which is blank. Otherwise, specify your password. - // - // - Amazon EBS root volume administrative user - // - // - Username - If you did not change the default administrative user, specify - // ec2-user . Otherwise, specify the username for your administrative user. - // - // - Password - Specify the password for the administrative user. - // - // The credentials must be specified in the following JSON format: - // - // { "internalDiskPassword":"internal-disk-admin_password", - // "rootVolumeUsername":"root-volume-admin_username", - // "rootVolumepassword":"root-volume-admin_password" } - // - // This member is required. - MacCredentials *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the volume ownership delegation task. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateDelegateMacVolumeOwnershipTaskOutput struct { - - // Information about the volume ownership delegation task. - MacModificationTask *types.MacModificationTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateDelegateMacVolumeOwnershipTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateDelegateMacVolumeOwnershipTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateDelegateMacVolumeOwnershipTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDelegateMacVolumeOwnershipTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateDelegateMacVolumeOwnershipTaskMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateDelegateMacVolumeOwnershipTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDelegateMacVolumeOwnershipTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateDelegateMacVolumeOwnershipTask struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateDelegateMacVolumeOwnershipTask) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateDelegateMacVolumeOwnershipTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateDelegateMacVolumeOwnershipTaskInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDelegateMacVolumeOwnershipTaskInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateDelegateMacVolumeOwnershipTaskMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDelegateMacVolumeOwnershipTask{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateDelegateMacVolumeOwnershipTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateDelegateMacVolumeOwnershipTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.go deleted file mode 100644 index 72229495a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a custom set of DHCP options. After you create a DHCP option set, you -// associate it with a VPC. After you associate a DHCP option set with a VPC, all -// existing and newly launched instances in the VPC use this set of DHCP options. -// -// The following are the individual DHCP options you can specify. For more -// information, see [DHCP option sets]in the Amazon VPC User Guide. -// -// - domain-name - If you're using AmazonProvidedDNS in us-east-1 , specify -// ec2.internal . If you're using AmazonProvidedDNS in any other Region, specify -// region.compute.internal . Otherwise, specify a custom domain name. This value -// is used to complete unqualified DNS hostnames. -// -// Some Linux operating systems accept multiple domain names separated by spaces. -// -// However, Windows and other Linux operating systems treat the value as a single -// domain, which results in unexpected behavior. If your DHCP option set is -// associated with a VPC that has instances running operating systems that treat -// the value as a single domain, specify only one domain name. -// -// - domain-name-servers - The IP addresses of up to four DNS servers, or -// AmazonProvidedDNS. To specify multiple domain name servers in a single -// parameter, separate the IP addresses using commas. To have your instances -// receive custom DNS hostnames as specified in domain-name , you must specify a -// custom DNS server. -// -// - ntp-servers - The IP addresses of up to eight Network Time Protocol (NTP) -// servers (four IPv4 addresses and four IPv6 addresses). -// -// - netbios-name-servers - The IP addresses of up to four NetBIOS name servers. -// -// - netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that -// you specify 2. Broadcast and multicast are not supported. For more information -// about NetBIOS node types, see [RFC 2132]. -// -// - ipv6-address-preferred-lease-time - A value (in seconds, minutes, hours, or -// years) for how frequently a running instance with an IPv6 assigned to it goes -// through DHCPv6 lease renewal. Acceptable values are between 140 and 2147483647 -// seconds (approximately 68 years). If no value is entered, the default lease time -// is 140 seconds. If you use long-term addressing for EC2 instances, you can -// increase the lease time and avoid frequent lease renewal requests. Lease renewal -// typically occurs when half of the lease time has elapsed. -// -// [DHCP option sets]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html -// -// [RFC 2132]: https://www.ietf.org/rfc/rfc2132.txt -func (c *Client) CreateDhcpOptions(ctx context.Context, params *CreateDhcpOptionsInput, optFns ...func(*Options)) (*CreateDhcpOptionsOutput, error) { - if params == nil { - params = &CreateDhcpOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateDhcpOptions", params, optFns, c.addOperationCreateDhcpOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateDhcpOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateDhcpOptionsInput struct { - - // A DHCP configuration option. - // - // This member is required. - DhcpConfigurations []types.NewDhcpConfiguration - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the DHCP option. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateDhcpOptionsOutput struct { - - // A set of DHCP options. - DhcpOptions *types.DhcpOptions - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateDhcpOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateDhcpOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateDhcpOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDhcpOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateDhcpOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDhcpOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateDhcpOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.go deleted file mode 100644 index c2347e585..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// [IPv6 only] Creates an egress-only internet gateway for your VPC. An -// egress-only internet gateway is used to enable outbound communication over IPv6 -// from instances in your VPC to the internet, and prevents hosts outside of your -// VPC from initiating an IPv6 connection with your instance. -func (c *Client) CreateEgressOnlyInternetGateway(ctx context.Context, params *CreateEgressOnlyInternetGatewayInput, optFns ...func(*Options)) (*CreateEgressOnlyInternetGatewayOutput, error) { - if params == nil { - params = &CreateEgressOnlyInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateEgressOnlyInternetGateway", params, optFns, c.addOperationCreateEgressOnlyInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateEgressOnlyInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateEgressOnlyInternetGatewayInput struct { - - // The ID of the VPC for which to create the egress-only internet gateway. - // - // This member is required. - VpcId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the egress-only internet gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateEgressOnlyInternetGatewayOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // Information about the egress-only internet gateway. - EgressOnlyInternetGateway *types.EgressOnlyInternetGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateEgressOnlyInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateEgressOnlyInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateEgressOnlyInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEgressOnlyInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateEgressOnlyInternetGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEgressOnlyInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateEgressOnlyInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateEgressOnlyInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.go deleted file mode 100644 index 3301784f6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates an EC2 Fleet that contains the configuration information for On-Demand -// Instances and Spot Instances. Instances are launched immediately if there is -// available capacity. -// -// A single EC2 Fleet can include multiple launch specifications that vary by -// instance type, AMI, Availability Zone, or subnet. -// -// For more information, see [EC2 Fleet] in the Amazon EC2 User Guide. -// -// [EC2 Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html -func (c *Client) CreateFleet(ctx context.Context, params *CreateFleetInput, optFns ...func(*Options)) (*CreateFleetOutput, error) { - if params == nil { - params = &CreateFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateFleet", params, optFns, c.addOperationCreateFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateFleetInput struct { - - // The configuration for the EC2 Fleet. - // - // This member is required. - LaunchTemplateConfigs []types.FleetLaunchTemplateConfigRequest - - // The number of units to request. - // - // This member is required. - TargetCapacitySpecification *types.TargetCapacitySpecificationRequest - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. If you do not specify a client token, a randomly generated token is - // used for the request to ensure idempotency. - // - // For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Reserved. - Context *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether running instances should be terminated if the total target - // capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet. - // - // Supported only for fleets of type maintain . - ExcessCapacityTerminationPolicy types.FleetExcessCapacityTerminationPolicy - - // Describes the configuration of On-Demand Instances in an EC2 Fleet. - OnDemandOptions *types.OnDemandOptionsRequest - - // Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported - // only for fleets of type maintain . For more information, see [EC2 Fleet health checks] in the Amazon EC2 - // User Guide. - // - // [EC2 Fleet health checks]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks - ReplaceUnhealthyInstances *bool - - // Describes the configuration of Spot Instances in an EC2 Fleet. - SpotOptions *types.SpotOptionsRequest - - // The key-value pair for tagging the EC2 Fleet request on creation. For more - // information, see [Tag your resources]. - // - // If the fleet type is instant , specify a resource type of fleet to tag the - // fleet or instance to tag the instances at launch. - // - // If the fleet type is maintain or request , specify a resource type of fleet to - // tag the fleet. You cannot specify a resource type of instance . To tag instances - // at launch, specify the tags in a [launch template]. - // - // [launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template - // [Tag your resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources - TagSpecifications []types.TagSpecification - - // Indicates whether running instances should be terminated when the EC2 Fleet - // expires. - TerminateInstancesWithExpiration *bool - - // The fleet type. The default value is maintain . - // - // - maintain - The EC2 Fleet places an asynchronous request for your desired - // capacity, and continues to maintain your desired Spot capacity by replenishing - // interrupted Spot Instances. - // - // - request - The EC2 Fleet places an asynchronous one-time request for your - // desired capacity, but does submit Spot requests in alternative capacity pools if - // Spot capacity is unavailable, and does not maintain Spot capacity if Spot - // Instances are interrupted. - // - // - instant - The EC2 Fleet places a synchronous one-time request for your - // desired capacity, and returns errors for any instances that could not be - // launched. - // - // For more information, see [EC2 Fleet request types] in the Amazon EC2 User Guide. - // - // [EC2 Fleet request types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html - Type types.FleetType - - // The start date and time of the request, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request - // immediately. - ValidFrom *time.Time - - // The end date and time of the request, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or - // able to fulfill the request. If no value is specified, the request remains until - // you cancel it. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -type CreateFleetOutput struct { - - // Information about the instances that could not be launched by the fleet. - // Supported only for fleets of type instant . - Errors []types.CreateFleetError - - // The ID of the EC2 Fleet. - FleetId *string - - // Information about the instances that were launched by the fleet. Supported only - // for fleets of type instant . - Instances []types.CreateFleetInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFleet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateFleetMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFleet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateFleet struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateFleet) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateFleetInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFleetInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateFleetMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFleet{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateFleet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.go deleted file mode 100644 index 64582576c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates one or more flow logs to capture information about IP traffic for a -// specific network interface, subnet, or VPC. -// -// Flow log data for a monitored network interface is recorded as flow log -// records, which are log events consisting of fields that describe the traffic -// flow. For more information, see [Flow log records]in the Amazon VPC User Guide. -// -// When publishing to CloudWatch Logs, flow log records are published to a log -// group, and each network interface has a unique log stream in the log group. When -// publishing to Amazon S3, flow log records for all of the monitored network -// interfaces are published to a single log file object that is stored in the -// specified bucket. -// -// For more information, see [VPC Flow Logs] in the Amazon VPC User Guide. -// -// [Flow log records]: https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html -// [VPC Flow Logs]: https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html -func (c *Client) CreateFlowLogs(ctx context.Context, params *CreateFlowLogsInput, optFns ...func(*Options)) (*CreateFlowLogsOutput, error) { - if params == nil { - params = &CreateFlowLogsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateFlowLogs", params, optFns, c.addOperationCreateFlowLogsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateFlowLogsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateFlowLogsInput struct { - - // The IDs of the resources to monitor. For example, if the resource type is VPC , - // specify the IDs of the VPCs. - // - // Constraints: Maximum of 25 for transit gateway resource types. Maximum of 1000 - // for the other resource types. - // - // This member is required. - ResourceIds []string - - // The type of resource to monitor. - // - // This member is required. - ResourceType types.FlowLogsResourceType - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The ARN of the IAM role that allows Amazon EC2 to publish flow logs across - // accounts. - DeliverCrossAccountRole *string - - // The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the log - // destination. - // - // This parameter is required if the destination type is cloud-watch-logs , or if - // the destination type is kinesis-data-firehose and the delivery stream and the - // resources to monitor are in different accounts. - DeliverLogsPermissionArn *string - - // The destination options. - DestinationOptions *types.DestinationOptionsRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The destination for the flow log data. The meaning of this parameter depends on - // the destination type. - // - // - If the destination type is cloud-watch-logs , specify the ARN of a - // CloudWatch Logs log group. For example: - // - // arn:aws:logs:region:account_id:log-group:my_group - // - // Alternatively, use the LogGroupName parameter. - // - // - If the destination type is s3 , specify the ARN of an S3 bucket. For example: - // - // arn:aws:s3:::my_bucket/my_subfolder/ - // - // The subfolder is optional. Note that you can't use AWSLogs as a subfolder name. - // - // - If the destination type is kinesis-data-firehose , specify the ARN of a - // Kinesis Data Firehose delivery stream. For example: - // - // arn:aws:firehose:region:account_id:deliverystream:my_stream - LogDestination *string - - // The type of destination for the flow log data. - // - // Default: cloud-watch-logs - LogDestinationType types.LogDestinationType - - // The fields to include in the flow log record. List the fields in the order in - // which they should appear. If you omit this parameter, the flow log is created - // using the default format. If you specify this parameter, you must include at - // least one field. For more information about the available fields, see [Flow log records]in the - // Amazon VPC User Guide or [Transit Gateway Flow Log records]in the Amazon Web Services Transit Gateway Guide. - // - // Specify the fields using the ${field-id} format, separated by spaces. - // - // [Flow log records]: https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html - // [Transit Gateway Flow Log records]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-flow-logs.html#flow-log-records - LogFormat *string - - // The name of a new or existing CloudWatch Logs log group where Amazon EC2 - // publishes your flow logs. - // - // This parameter is valid only if the destination type is cloud-watch-logs . - LogGroupName *string - - // The maximum interval of time during which a flow of packets is captured and - // aggregated into a flow log record. The possible values are 60 seconds (1 minute) - // or 600 seconds (10 minutes). This parameter must be 60 seconds for transit - // gateway resource types. - // - // When a network interface is attached to a [Nitro-based instance], the aggregation interval is always - // 60 seconds or less, regardless of the value that you specify. - // - // Default: 600 - // - // [Nitro-based instance]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - MaxAggregationInterval *int32 - - // The tags to apply to the flow logs. - TagSpecifications []types.TagSpecification - - // The type of traffic to monitor (accepted traffic, rejected traffic, or all - // traffic). This parameter is not supported for transit gateway resource types. It - // is required for the other resource types. - TrafficType types.TrafficType - - noSmithyDocumentSerde -} - -type CreateFlowLogsOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // The IDs of the flow logs. - FlowLogIds []string - - // Information about the flow logs that could not be created successfully. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateFlowLogsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateFlowLogs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateFlowLogs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFlowLogs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateFlowLogsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlowLogs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateFlowLogs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateFlowLogs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.go deleted file mode 100644 index 764d38bf4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP). -// -// The create operation is asynchronous. To verify that the AFI is ready for use, -// check the output logs. -// -// An AFI contains the FPGA bitstream that is ready to download to an FPGA. You -// can securely deploy an AFI on multiple FPGA-accelerated instances. For more -// information, see the [Amazon Web Services FPGA Hardware Development Kit]. -// -// [Amazon Web Services FPGA Hardware Development Kit]: https://github.com/aws/aws-fpga/ -func (c *Client) CreateFpgaImage(ctx context.Context, params *CreateFpgaImageInput, optFns ...func(*Options)) (*CreateFpgaImageOutput, error) { - if params == nil { - params = &CreateFpgaImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateFpgaImage", params, optFns, c.addOperationCreateFpgaImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateFpgaImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateFpgaImageInput struct { - - // The location of the encrypted design checkpoint in Amazon S3. The input must be - // a tarball. - // - // This member is required. - InputStorageLocation *types.StorageLocation - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the AFI. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The location in Amazon S3 for the output logs. - LogsStorageLocation *types.StorageLocation - - // A name for the AFI. - Name *string - - // The tags to apply to the FPGA image during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateFpgaImageOutput struct { - - // The global FPGA image identifier (AGFI ID). - FpgaImageGlobalId *string - - // The FPGA image identifier (AFI ID). - FpgaImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateFpgaImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateFpgaImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateFpgaImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFpgaImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateFpgaImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFpgaImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateFpgaImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateFpgaImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.go deleted file mode 100644 index 320fbf5d2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is -// either running or stopped. -// -// If you customized your instance with instance store volumes or Amazon EBS -// volumes in addition to the root device volume, the new AMI contains block device -// mapping information for those volumes. When you launch an instance from this new -// AMI, the instance automatically launches with those additional volumes. -// -// The location of the source instance determines where you can create the -// snapshots of the AMI: -// -// - If the source instance is in a Region, you must create the snapshots in the -// same Region as the instance. -// -// - If the source instance is in a Local Zone, you can create the snapshots in -// the same Local Zone or in its parent Region. -// -// For more information, see [Create an Amazon EBS-backed AMI] in the Amazon Elastic Compute Cloud User Guide. -// -// [Create an Amazon EBS-backed AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html -func (c *Client) CreateImage(ctx context.Context, params *CreateImageInput, optFns ...func(*Options)) (*CreateImageOutput, error) { - if params == nil { - params = &CreateImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateImage", params, optFns, c.addOperationCreateImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateImageInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // A name for the new image. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // This member is required. - Name *string - - // The block device mappings. - // - // When using the CreateImage action: - // - // - You can't change the volume size using the VolumeSize parameter. If you - // want a different volume size, you must first change the volume size of the - // source instance. - // - // - You can't modify the encryption status of existing volumes or snapshots. To - // create an AMI with volumes or snapshots that have a different encryption status - // (for example, where the source volume and snapshots are unencrypted, and you - // want to create an AMI with encrypted volumes or snapshots), use the CopyImageaction. - // - // - The only option that can be changed for existing mappings or snapshots is - // DeleteOnTermination . - BlockDeviceMappings []types.BlockDeviceMapping - - // A description for the new image. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether or not the instance should be automatically rebooted before - // creating the image. Specify one of the following values: - // - // - true - The instance is not rebooted before creating the image. This creates - // crash-consistent snapshots that include only the data that has been written to - // the volumes at the time the snapshots are created. Buffered data and data in - // memory that has not yet been written to the volumes is not included in the - // snapshots. - // - // - false - The instance is rebooted before creating the image. This ensures - // that all buffered data and data in memory is written to the volumes before the - // snapshots are created. - // - // Default: false - NoReboot *bool - - // Only supported for instances in Local Zones. If the source instance is not in a - // Local Zone, omit this parameter. - // - // The Amazon S3 location where the snapshots will be stored. - // - // - To create local snapshots in the same Local Zone as the source instance, - // specify local . - // - // - To create regional snapshots in the parent Region of the Local Zone, - // specify regional or omit this parameter. - // - // Default: regional - SnapshotLocation types.SnapshotLocationEnum - - // The tags to apply to the AMI and snapshots on creation. You can tag the AMI, - // the snapshots, or both. - // - // - To tag the AMI, the value for ResourceType must be image . - // - // - To tag the snapshots that are created of the root volume and of other - // Amazon EBS volumes that are attached to the instance, the value for - // ResourceType must be snapshot . The same tag is applied to all of the - // snapshots that are created. - // - // If you specify other values for ResourceType , the request fails. - // - // To tag an AMI or snapshot after it has been created, see [CreateTags]. - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateImageOutput struct { - - // The ID of the new AMI. - ImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.go deleted file mode 100644 index 7929c9c95..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an EC2 Instance Connect Endpoint. -// -// An EC2 Instance Connect Endpoint allows you to connect to an instance, without -// requiring the instance to have a public IPv4 or public IPv6 address. For more -// information, see [Connect to your instances using EC2 Instance Connect Endpoint]in the Amazon EC2 User Guide. -// -// [Connect to your instances using EC2 Instance Connect Endpoint]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect-Endpoint.html -func (c *Client) CreateInstanceConnectEndpoint(ctx context.Context, params *CreateInstanceConnectEndpointInput, optFns ...func(*Options)) (*CreateInstanceConnectEndpointOutput, error) { - if params == nil { - params = &CreateInstanceConnectEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateInstanceConnectEndpoint", params, optFns, c.addOperationCreateInstanceConnectEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateInstanceConnectEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateInstanceConnectEndpointInput struct { - - // The ID of the subnet in which to create the EC2 Instance Connect Endpoint. - // - // This member is required. - SubnetId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address type of the endpoint. - // - // If no value is specified, the default value is determined by the IP address - // type of the subnet: - // - // - dualstack - If the subnet has both IPv4 and IPv6 CIDRs - // - // - ipv4 - If the subnet has only IPv4 CIDRs - // - // - ipv6 - If the subnet has only IPv6 CIDRs - // - // PreserveClientIp is only supported on IPv4 EC2 Instance Connect Endpoints. To - // use PreserveClientIp , the value for IpAddressType must be ipv4 . - IpAddressType types.IpAddressType - - // Indicates whether the client IP address is preserved as the source. The - // following are the possible values. - // - // - true - Use the client IP address as the source. - // - // - false - Use the network interface IP address as the source. - // - // PreserveClientIp is only supported on IPv4 EC2 Instance Connect Endpoints. To - // use PreserveClientIp , the value for IpAddressType must be ipv4 . - // - // Default: false - PreserveClientIp *bool - - // One or more security groups to associate with the endpoint. If you don't - // specify a security group, the default security group for your VPC will be - // associated with the endpoint. - SecurityGroupIds []string - - // The tags to apply to the EC2 Instance Connect Endpoint during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateInstanceConnectEndpointOutput struct { - - // Unique, case-sensitive idempotency token provided by the client in the the - // request. - ClientToken *string - - // Information about the EC2 Instance Connect Endpoint. - InstanceConnectEndpoint *types.Ec2InstanceConnectEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateInstanceConnectEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateInstanceConnectEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateInstanceConnectEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateInstanceConnectEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateInstanceConnectEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateInstanceConnectEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstanceConnectEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateInstanceConnectEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateInstanceConnectEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateInstanceConnectEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateInstanceConnectEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateInstanceConnectEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateInstanceConnectEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateInstanceConnectEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateInstanceConnectEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateInstanceConnectEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.go deleted file mode 100644 index de9609807..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an event window in which scheduled events for the associated Amazon EC2 -// instances can run. -// -// You can define either a set of time ranges or a cron expression when creating -// the event window, but not both. All event window times are in UTC. -// -// You can create up to 200 event windows per Amazon Web Services Region. -// -// When you create the event window, targets (instance IDs, Dedicated Host IDs, or -// tags) are not yet associated with it. To ensure that the event window can be -// used, you must associate one or more targets with it by using the AssociateInstanceEventWindowAPI. -// -// Event windows are applicable only for scheduled events that stop, reboot, or -// terminate instances. -// -// Event windows are not applicable for: -// -// - Expedited scheduled events and network maintenance events. -// -// - Unscheduled maintenance such as AutoRecovery and unplanned reboots. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) CreateInstanceEventWindow(ctx context.Context, params *CreateInstanceEventWindowInput, optFns ...func(*Options)) (*CreateInstanceEventWindowOutput, error) { - if params == nil { - params = &CreateInstanceEventWindowInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateInstanceEventWindow", params, optFns, c.addOperationCreateInstanceEventWindowMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateInstanceEventWindowOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateInstanceEventWindowInput struct { - - // The cron expression for the event window, for example, * 0-4,20-23 * * 1,5 . If - // you specify a cron expression, you can't specify a time range. - // - // Constraints: - // - // - Only hour and day of the week values are supported. - // - // - For day of the week values, you can specify either integers 0 through 6 , or - // alternative single values SUN through SAT . - // - // - The minute, month, and year must be specified by * . - // - // - The hour value must be one or a multiple range, for example, 0-4 or - // 0-4,20-23 . - // - // - Each hour range must be >= 2 hours, for example, 0-2 or 20-23 . - // - // - The event window must be >= 4 hours. The combined total time ranges in the - // event window must be >= 4 hours. - // - // For more information about cron expressions, see [cron] on the Wikipedia website. - // - // [cron]: https://en.wikipedia.org/wiki/Cron - CronExpression *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the event window. - Name *string - - // The tags to apply to the event window. - TagSpecifications []types.TagSpecification - - // The time range for the event window. If you specify a time range, you can't - // specify a cron expression. - TimeRanges []types.InstanceEventWindowTimeRangeRequest - - noSmithyDocumentSerde -} - -type CreateInstanceEventWindowOutput struct { - - // Information about the event window. - InstanceEventWindow *types.InstanceEventWindow - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateInstanceEventWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateInstanceEventWindow"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstanceEventWindow(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateInstanceEventWindow(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateInstanceEventWindow", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.go deleted file mode 100644 index b3387ca02..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Exports a running or stopped instance to an Amazon S3 bucket. -// -// For information about the prerequisites for your Amazon S3 bucket, supported -// operating systems, image formats, and known limitations for the types of -// instances you can export, see [Exporting an instance as a VM Using VM Import/Export]in the VM Import/Export User Guide. -// -// [Exporting an instance as a VM Using VM Import/Export]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html -func (c *Client) CreateInstanceExportTask(ctx context.Context, params *CreateInstanceExportTaskInput, optFns ...func(*Options)) (*CreateInstanceExportTaskOutput, error) { - if params == nil { - params = &CreateInstanceExportTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateInstanceExportTask", params, optFns, c.addOperationCreateInstanceExportTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateInstanceExportTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateInstanceExportTaskInput struct { - - // The format and location for an export instance task. - // - // This member is required. - ExportToS3Task *types.ExportToS3TaskSpecification - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The target virtualization environment. - // - // This member is required. - TargetEnvironment types.ExportEnvironment - - // A description for the conversion task or the resource being exported. The - // maximum length is 255 characters. - Description *string - - // The tags to apply to the export instance task during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateInstanceExportTaskOutput struct { - - // Information about the export instance task. - ExportTask *types.ExportTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateInstanceExportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateInstanceExportTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateInstanceExportTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateInstanceExportTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateInstanceExportTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstanceExportTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateInstanceExportTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateInstanceExportTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.go deleted file mode 100644 index 38aa1c36c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an internet gateway for use with a VPC. After creating the internet -// gateway, you attach it to a VPC using AttachInternetGateway. -// -// For more information, see [Internet gateways] in the Amazon VPC User Guide. -// -// [Internet gateways]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html -func (c *Client) CreateInternetGateway(ctx context.Context, params *CreateInternetGatewayInput, optFns ...func(*Options)) (*CreateInternetGatewayOutput, error) { - if params == nil { - params = &CreateInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateInternetGateway", params, optFns, c.addOperationCreateInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateInternetGatewayInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the internet gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateInternetGatewayOutput struct { - - // Information about the internet gateway. - InternetGateway *types.InternetGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.go deleted file mode 100644 index a804b0778..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create an IPAM. Amazon VPC IP Address Manager (IPAM) is a VPC feature that you -// can use to automate your IP address management workflows including assigning, -// tracking, troubleshooting, and auditing IP addresses across Amazon Web Services -// Regions and accounts throughout your Amazon Web Services Organization. -// -// For more information, see [Create an IPAM] in the Amazon VPC IPAM User Guide. -// -// [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html -func (c *Client) CreateIpam(ctx context.Context, params *CreateIpamInput, optFns ...func(*Options)) (*CreateIpamOutput, error) { - if params == nil { - params = &CreateIpamInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateIpam", params, optFns, c.addOperationCreateIpamMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateIpamOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateIpamInput struct { - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the IPAM. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Enable this option to use your own GUA ranges as private IPv6 addresses. This - // option is disabled by default. - EnablePrivateGua *bool - - // A metered account is an Amazon Web Services account that is charged for active - // IP addresses managed in IPAM. For more information, see [Enable cost distribution]in the Amazon VPC IPAM - // User Guide. - // - // Possible values: - // - // - ipam-owner (default): The Amazon Web Services account which owns the IPAM is - // charged for all active IP addresses managed in IPAM. - // - // - resource-owner : The Amazon Web Services account that owns the IP address is - // charged for the active IP address. - // - // [Enable cost distribution]: https://docs.aws.amazon.com/vpc/latest/ipam/ipam-enable-cost-distro.html - MeteredAccount types.IpamMeteredAccount - - // The operating Regions for the IPAM. Operating Regions are Amazon Web Services - // Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only - // discovers and monitors resources in the Amazon Web Services Regions you select - // as operating Regions. - // - // For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User - // Guide. - // - // [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html - OperatingRegions []types.AddIpamOperatingRegion - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - // IPAM is offered in a Free Tier and an Advanced Tier. For more information about - // the features available in each tier and the costs associated with the tiers, see - // [Amazon VPC pricing > IPAM tab]. - // - // [Amazon VPC pricing > IPAM tab]: http://aws.amazon.com/vpc/pricing/ - Tier types.IpamTier - - noSmithyDocumentSerde -} - -type CreateIpamOutput struct { - - // Information about the IPAM created. - Ipam *types.Ipam - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateIpamMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateIpam{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateIpam{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIpam"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateIpamMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIpam(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateIpam struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateIpam) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateIpam) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateIpamInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIpamInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateIpamMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIpam{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateIpam(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateIpam", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.go deleted file mode 100644 index 69ccb5fd8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create a verification token. A verification token is an Amazon Web -// Services-generated random value that you can use to prove ownership of an -// external resource. For example, you can use a verification token to validate -// that you control a public IP address range when you bring an IP address range to -// Amazon Web Services (BYOIP). -func (c *Client) CreateIpamExternalResourceVerificationToken(ctx context.Context, params *CreateIpamExternalResourceVerificationTokenInput, optFns ...func(*Options)) (*CreateIpamExternalResourceVerificationTokenOutput, error) { - if params == nil { - params = &CreateIpamExternalResourceVerificationTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateIpamExternalResourceVerificationToken", params, optFns, c.addOperationCreateIpamExternalResourceVerificationTokenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateIpamExternalResourceVerificationTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateIpamExternalResourceVerificationTokenInput struct { - - // The ID of the IPAM that will create the token. - // - // This member is required. - IpamId *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Token tags. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateIpamExternalResourceVerificationTokenOutput struct { - - // The verification token. - IpamExternalResourceVerificationToken *types.IpamExternalResourceVerificationToken - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateIpamExternalResourceVerificationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateIpamExternalResourceVerificationToken{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateIpamExternalResourceVerificationToken{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIpamExternalResourceVerificationToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateIpamExternalResourceVerificationTokenMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateIpamExternalResourceVerificationTokenValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIpamExternalResourceVerificationToken(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateIpamExternalResourceVerificationToken struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateIpamExternalResourceVerificationToken) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateIpamExternalResourceVerificationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateIpamExternalResourceVerificationTokenInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIpamExternalResourceVerificationTokenInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateIpamExternalResourceVerificationTokenMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIpamExternalResourceVerificationToken{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateIpamExternalResourceVerificationToken(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateIpamExternalResourceVerificationToken", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPool.go deleted file mode 100644 index d03c7cb4f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPool.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create an IP address pool for Amazon VPC IP Address Manager (IPAM). In IPAM, a -// pool is a collection of contiguous IP addresses CIDRs. Pools enable you to -// organize your IP addresses according to your routing and security needs. For -// example, if you have separate routing and security needs for development and -// production applications, you can create a pool for each. -// -// For more information, see [Create a top-level pool] in the Amazon VPC IPAM User Guide. -// -// [Create a top-level pool]: https://docs.aws.amazon.com/vpc/latest/ipam/create-top-ipam.html -func (c *Client) CreateIpamPool(ctx context.Context, params *CreateIpamPoolInput, optFns ...func(*Options)) (*CreateIpamPoolOutput, error) { - if params == nil { - params = &CreateIpamPoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateIpamPool", params, optFns, c.addOperationCreateIpamPoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateIpamPoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateIpamPoolInput struct { - - // The IP protocol assigned to this IPAM pool. You must choose either IPv4 or IPv6 - // protocol for a pool. - // - // This member is required. - AddressFamily types.AddressFamily - - // The ID of the scope in which you would like to create the IPAM pool. - // - // This member is required. - IpamScopeId *string - - // The default netmask length for allocations added to this pool. If, for example, - // the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new - // allocations will default to 10.0.0.0/16. - AllocationDefaultNetmaskLength *int32 - - // The maximum netmask length possible for CIDR allocations in this IPAM pool to - // be compliant. The maximum netmask length must be greater than the minimum - // netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible - // netmask lengths for IPv6 addresses are 0 - 128. - AllocationMaxNetmaskLength *int32 - - // The minimum netmask length required for CIDR allocations in this IPAM pool to - // be compliant. The minimum netmask length must be less than the maximum netmask - // length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask - // lengths for IPv6 addresses are 0 - 128. - AllocationMinNetmaskLength *int32 - - // Tags that are required for resources that use CIDRs from this IPAM pool. - // Resources that do not have these tags will not be allowed to allocate space from - // the pool. If the resources have their tags changed after they have allocated - // space or if the allocation tagging requirements are changed on the pool, the - // resource may be marked as noncompliant. - AllocationResourceTags []types.RequestIpamResourceTag - - // If selected, IPAM will continuously look for resources within the CIDR range of - // this pool and automatically import them as allocations into your IPAM. The CIDRs - // that will be allocated for these resources must not already be allocated to - // other resources in order for the import to succeed. IPAM will import a CIDR - // regardless of its compliance with the pool's allocation rules, so a resource - // might be imported and subsequently marked as noncompliant. If IPAM discovers - // multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM - // discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of - // them only. - // - // A locale must be set on the pool for this feature to work. - AutoImport *bool - - // Limits which service in Amazon Web Services that the pool can be used in. - // "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. - AwsService types.IpamPoolAwsService - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the IPAM pool. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The locale for the pool should be one of the following: - // - // - An Amazon Web Services Region where you want this IPAM pool to be available - // for allocations. - // - // - The network border group for an Amazon Web Services Local Zone where you - // want this IPAM pool to be available for allocations ([supported Local Zones] ). This option is only - // available for IPAM IPv4 pools in the public scope. - // - // Possible values: Any Amazon Web Services Region or supported Amazon Web - // Services Local Zone. Default is none and means any locale. - // - // [supported Local Zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - Locale *string - - // The IP address source for pools in the public scope. Only used for provisioning - // IP address CIDRs to pools in the public scope. Default is byoip . For more - // information, see [Create IPv6 pools]in the Amazon VPC IPAM User Guide. By default, you can add - // only one Amazon-provided IPv6 CIDR block to a top-level IPv6 pool if - // PublicIpSource is amazon . For information on increasing the default limit, see [Quotas for your IPAM] - // in the Amazon VPC IPAM User Guide. - // - // [Create IPv6 pools]: https://docs.aws.amazon.com/vpc/latest/ipam/intro-create-ipv6-pools.html - // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - PublicIpSource types.IpamPoolPublicIpSource - - // Determines if the pool is publicly advertisable. The request can only contain - // PubliclyAdvertisable if AddressFamily is ipv6 and PublicIpSource is byoip . - PubliclyAdvertisable *bool - - // The ID of the source IPAM pool. Use this option to create a pool within an - // existing pool. Note that the CIDR you provision for the pool within the source - // pool must be available in the source pool's CIDR range. - SourceIpamPoolId *string - - // The resource used to provision CIDRs to a resource planning pool. - SourceResource *types.IpamPoolSourceResourceRequest - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateIpamPoolOutput struct { - - // Information about the IPAM pool created. - IpamPool *types.IpamPool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateIpamPoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateIpamPool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateIpamPool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIpamPool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateIpamPoolMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateIpamPoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIpamPool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateIpamPool struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateIpamPool) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateIpamPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateIpamPoolInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIpamPoolInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateIpamPoolMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIpamPool{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateIpamPool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateIpamPool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamResourceDiscovery.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamResourceDiscovery.go deleted file mode 100644 index dea05d7b6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamResourceDiscovery.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an IPAM resource discovery. A resource discovery is an IPAM component -// that enables IPAM to manage and monitor resources that belong to the owning -// account. -func (c *Client) CreateIpamResourceDiscovery(ctx context.Context, params *CreateIpamResourceDiscoveryInput, optFns ...func(*Options)) (*CreateIpamResourceDiscoveryOutput, error) { - if params == nil { - params = &CreateIpamResourceDiscoveryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateIpamResourceDiscovery", params, optFns, c.addOperationCreateIpamResourceDiscoveryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateIpamResourceDiscoveryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateIpamResourceDiscoveryInput struct { - - // A client token for the IPAM resource discovery. - ClientToken *string - - // A description for the IPAM resource discovery. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Operating Regions for the IPAM resource discovery. Operating Regions are Amazon - // Web Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM - // only discovers and monitors resources in the Amazon Web Services Regions you - // select as operating Regions. - OperatingRegions []types.AddIpamOperatingRegion - - // Tag specifications for the IPAM resource discovery. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateIpamResourceDiscoveryOutput struct { - - // An IPAM resource discovery. - IpamResourceDiscovery *types.IpamResourceDiscovery - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateIpamResourceDiscoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIpamResourceDiscovery"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateIpamResourceDiscoveryMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIpamResourceDiscovery(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateIpamResourceDiscovery struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateIpamResourceDiscovery) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIpamResourceDiscoveryInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateIpamResourceDiscoveryMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIpamResourceDiscovery{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateIpamResourceDiscovery(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateIpamResourceDiscovery", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamScope.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamScope.go deleted file mode 100644 index d8e63b6eb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamScope.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create an IPAM scope. In IPAM, a scope is the highest-level container within -// IPAM. An IPAM contains two default scopes. Each scope represents the IP space -// for a single network. The private scope is intended for all private IP address -// space. The public scope is intended for all public IP address space. Scopes -// enable you to reuse IP addresses across multiple unconnected networks without -// causing IP address overlap or conflict. -// -// For more information, see [Add a scope] in the Amazon VPC IPAM User Guide. -// -// [Add a scope]: https://docs.aws.amazon.com/vpc/latest/ipam/add-scope-ipam.html -func (c *Client) CreateIpamScope(ctx context.Context, params *CreateIpamScopeInput, optFns ...func(*Options)) (*CreateIpamScopeOutput, error) { - if params == nil { - params = &CreateIpamScopeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateIpamScope", params, optFns, c.addOperationCreateIpamScopeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateIpamScopeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateIpamScopeInput struct { - - // The ID of the IPAM for which you're creating this scope. - // - // This member is required. - IpamId *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the scope you're creating. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateIpamScopeOutput struct { - - // Information about the created scope. - IpamScope *types.IpamScope - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateIpamScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateIpamScope{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateIpamScope{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIpamScope"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateIpamScopeMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateIpamScopeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIpamScope(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateIpamScope struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateIpamScope) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateIpamScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateIpamScopeInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIpamScopeInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateIpamScopeMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIpamScope{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateIpamScope(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateIpamScope", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateKeyPair.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateKeyPair.go deleted file mode 100644 index 15adb7061..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateKeyPair.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the -// specified format. Amazon EC2 stores the public key and displays the private key -// for you to save to a file. The private key is returned as an unencrypted PEM -// encoded PKCS#1 private key or an unencrypted PPK formatted private key for use -// with PuTTY. If a key with the specified name already exists, Amazon EC2 returns -// an error. -// -// The key pair returned to you is available only in the Amazon Web Services -// Region in which you create it. If you prefer, you can create your own key pair -// using a third-party tool and upload it to any Region using ImportKeyPair. -// -// You can have up to 5,000 key pairs per Amazon Web Services Region. -// -// For more information, see [Amazon EC2 key pairs] in the Amazon EC2 User Guide. -// -// [Amazon EC2 key pairs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html -func (c *Client) CreateKeyPair(ctx context.Context, params *CreateKeyPairInput, optFns ...func(*Options)) (*CreateKeyPairOutput, error) { - if params == nil { - params = &CreateKeyPairInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateKeyPair", params, optFns, c.addOperationCreateKeyPairMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateKeyPairOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateKeyPairInput struct { - - // A unique name for the key pair. - // - // Constraints: Up to 255 ASCII characters - // - // This member is required. - KeyName *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The format of the key pair. - // - // Default: pem - KeyFormat types.KeyFormat - - // The type of key pair. Note that ED25519 keys are not supported for Windows - // instances. - // - // Default: rsa - KeyType types.KeyType - - // The tags to apply to the new key pair. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Describes a key pair. -type CreateKeyPairOutput struct { - - // - For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER - // encoded private key. - // - // - For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 - // digest, which is the default for OpenSSH, starting with OpenSSH 6.8. - KeyFingerprint *string - - // An unencrypted PEM encoded RSA or ED25519 private key. - KeyMaterial *string - - // The name of the key pair. - KeyName *string - - // The ID of the key pair. - KeyPairId *string - - // Any tags applied to the key pair. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateKeyPairMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateKeyPair{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateKeyPair{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateKeyPair"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateKeyPairValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateKeyPair(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateKeyPair(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateKeyPair", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplate.go deleted file mode 100644 index f8b630f75..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplate.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a launch template. -// -// A launch template contains the parameters to launch an instance. When you -// launch an instance using RunInstances, you can specify a launch template instead of -// providing the launch parameters in the request. For more information, see [Store instance launch parameters in Amazon EC2 launch templates]in -// the Amazon EC2 User Guide. -// -// To clone an existing launch template as the basis for a new launch template, -// use the Amazon EC2 console. The API, SDKs, and CLI do not support cloning a -// template. For more information, see [Create a launch template from an existing launch template]in the Amazon EC2 User Guide. -// -// [Create a launch template from an existing launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#create-launch-template-from-existing-launch-template -// [Store instance launch parameters in Amazon EC2 launch templates]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html -func (c *Client) CreateLaunchTemplate(ctx context.Context, params *CreateLaunchTemplateInput, optFns ...func(*Options)) (*CreateLaunchTemplateOutput, error) { - if params == nil { - params = &CreateLaunchTemplateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLaunchTemplate", params, optFns, c.addOperationCreateLaunchTemplateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLaunchTemplateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLaunchTemplateInput struct { - - // The information for the launch template. - // - // This member is required. - LaunchTemplateData *types.RequestLaunchTemplateData - - // A name for the launch template. - // - // This member is required. - LaunchTemplateName *string - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. If a client token isn't specified, a randomly generated token is used - // in the request to ensure idempotency. - // - // For more information, see [Ensuring idempotency]. - // - // Constraint: Maximum 128 ASCII characters. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Reserved for internal use. - Operator *types.OperatorRequest - - // The tags to apply to the launch template on creation. To tag the launch - // template, the resource type must be launch-template . - // - // To specify the tags for the resources that are created when an instance is - // launched, you must use the TagSpecifications parameter in the [launch template data] structure. - // - // [launch template data]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestLaunchTemplateData.html - TagSpecifications []types.TagSpecification - - // A description for the first version of the launch template. - VersionDescription *string - - noSmithyDocumentSerde -} - -type CreateLaunchTemplateOutput struct { - - // Information about the launch template. - LaunchTemplate *types.LaunchTemplate - - // If the launch template contains parameters or parameter combinations that are - // not valid, an error code and an error message are returned for each issue that's - // found. - Warning *types.ValidationWarning - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLaunchTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLaunchTemplate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateLaunchTemplateMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateLaunchTemplateValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLaunchTemplate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateLaunchTemplate struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateLaunchTemplate) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateLaunchTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateLaunchTemplateInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLaunchTemplateInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateLaunchTemplateMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLaunchTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateLaunchTemplate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLaunchTemplate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplateVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplateVersion.go deleted file mode 100644 index 6fc79a0ac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLaunchTemplateVersion.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new version of a launch template. You must specify an existing launch -// template, either by name or ID. You can determine whether the new version -// inherits parameters from a source version, and add or overwrite parameters as -// needed. -// -// Launch template versions are numbered in the order in which they are created. -// You can't specify, change, or replace the numbering of launch template versions. -// -// Launch templates are immutable; after you create a launch template, you can't -// modify it. Instead, you can create a new version of the launch template that -// includes the changes that you require. -// -// For more information, see [Modify a launch template (manage launch template versions)] in the Amazon EC2 User Guide. -// -// [Modify a launch template (manage launch template versions)]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-launch-template-versions.html -func (c *Client) CreateLaunchTemplateVersion(ctx context.Context, params *CreateLaunchTemplateVersionInput, optFns ...func(*Options)) (*CreateLaunchTemplateVersionOutput, error) { - if params == nil { - params = &CreateLaunchTemplateVersionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLaunchTemplateVersion", params, optFns, c.addOperationCreateLaunchTemplateVersionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLaunchTemplateVersionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLaunchTemplateVersionInput struct { - - // The information for the launch template. - // - // This member is required. - LaunchTemplateData *types.RequestLaunchTemplateData - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. If a client token isn't specified, a randomly generated token is used - // in the request to ensure idempotency. - // - // For more information, see [Ensuring idempotency]. - // - // Constraint: Maximum 128 ASCII characters. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateName *string - - // If true , and if a Systems Manager parameter is specified for ImageId , the AMI - // ID is displayed in the response for imageID . For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the - // Amazon EC2 User Guide. - // - // Default: false - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ResolveAlias *bool - - // The version of the launch template on which to base the new version. Snapshots - // applied to the block device mapping are ignored when creating a new version - // unless they are explicitly included. - // - // If you specify this parameter, the new version inherits the launch parameters - // from the source version. If you specify additional launch parameters for the new - // version, they overwrite any corresponding launch parameters inherited from the - // source version. - // - // If you omit this parameter, the new version contains only the launch parameters - // that you specify for the new version. - SourceVersion *string - - // A description for the version of the launch template. - VersionDescription *string - - noSmithyDocumentSerde -} - -type CreateLaunchTemplateVersionOutput struct { - - // Information about the launch template version. - LaunchTemplateVersion *types.LaunchTemplateVersion - - // If the new version of the launch template contains parameters or parameter - // combinations that are not valid, an error code and an error message are returned - // for each issue that's found. - Warning *types.ValidationWarning - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLaunchTemplateVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLaunchTemplateVersion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLaunchTemplateVersion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLaunchTemplateVersion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateLaunchTemplateVersionMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateLaunchTemplateVersionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLaunchTemplateVersion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateLaunchTemplateVersion struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateLaunchTemplateVersion) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateLaunchTemplateVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateLaunchTemplateVersionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLaunchTemplateVersionInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateLaunchTemplateVersionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLaunchTemplateVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateLaunchTemplateVersion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLaunchTemplateVersion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRoute.go deleted file mode 100644 index d953f96c3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRoute.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a static route for the specified local gateway route table. You must -// specify one of the following targets: -// -// - LocalGatewayVirtualInterfaceGroupId -// -// - NetworkInterfaceId -func (c *Client) CreateLocalGatewayRoute(ctx context.Context, params *CreateLocalGatewayRouteInput, optFns ...func(*Options)) (*CreateLocalGatewayRouteOutput, error) { - if params == nil { - params = &CreateLocalGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayRoute", params, optFns, c.addOperationCreateLocalGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayRouteInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // The CIDR range used for destination matches. Routing decisions are based on the - // most specific match. - DestinationCidrBlock *string - - // The ID of the prefix list. Use a prefix list in place of DestinationCidrBlock . - // You cannot use DestinationPrefixListId and DestinationCidrBlock in the same - // request. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The ID of the network interface. - NetworkInterfaceId *string - - noSmithyDocumentSerde -} - -type CreateLocalGatewayRouteOutput struct { - - // Information about the route. - Route *types.LocalGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTable.go deleted file mode 100644 index 870ed9970..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTable.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a local gateway route table. -func (c *Client) CreateLocalGatewayRouteTable(ctx context.Context, params *CreateLocalGatewayRouteTableInput, optFns ...func(*Options)) (*CreateLocalGatewayRouteTableOutput, error) { - if params == nil { - params = &CreateLocalGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayRouteTable", params, optFns, c.addOperationCreateLocalGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayRouteTableInput struct { - - // The ID of the local gateway. - // - // This member is required. - LocalGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The mode of the local gateway route table. - Mode types.LocalGatewayRouteTableMode - - // The tags assigned to the local gateway route table. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateLocalGatewayRouteTableOutput struct { - - // Information about the local gateway route table. - LocalGatewayRouteTable *types.LocalGatewayRouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go deleted file mode 100644 index 82be8858a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a local gateway route table virtual interface group association. -func (c *Client) CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(ctx context.Context, params *CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput, optFns ...func(*Options)) (*CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput, error) { - if params == nil { - params = &CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation", params, optFns, c.addOperationCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // The ID of the local gateway route table virtual interface group association. - // - // This member is required. - LocalGatewayVirtualInterfaceGroupId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags assigned to the local gateway route table virtual interface group - // association. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput struct { - - // Information about the local gateway route table virtual interface group - // association. - LocalGatewayRouteTableVirtualInterfaceGroupAssociation *types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVpcAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVpcAssociation.go deleted file mode 100644 index 31a8a3f9e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayRouteTableVpcAssociation.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates the specified VPC with the specified local gateway route table. -func (c *Client) CreateLocalGatewayRouteTableVpcAssociation(ctx context.Context, params *CreateLocalGatewayRouteTableVpcAssociationInput, optFns ...func(*Options)) (*CreateLocalGatewayRouteTableVpcAssociationOutput, error) { - if params == nil { - params = &CreateLocalGatewayRouteTableVpcAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayRouteTableVpcAssociation", params, optFns, c.addOperationCreateLocalGatewayRouteTableVpcAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayRouteTableVpcAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayRouteTableVpcAssociationInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the local gateway route table VPC association. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateLocalGatewayRouteTableVpcAssociationOutput struct { - - // Information about the association. - LocalGatewayRouteTableVpcAssociation *types.LocalGatewayRouteTableVpcAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayRouteTableVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayRouteTableVpcAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayRouteTableVpcAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayRouteTableVpcAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayRouteTableVpcAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayRouteTableVpcAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayRouteTableVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayRouteTableVpcAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterface.go deleted file mode 100644 index f0624808f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterface.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create a virtual interface for a local gateway. -func (c *Client) CreateLocalGatewayVirtualInterface(ctx context.Context, params *CreateLocalGatewayVirtualInterfaceInput, optFns ...func(*Options)) (*CreateLocalGatewayVirtualInterfaceOutput, error) { - if params == nil { - params = &CreateLocalGatewayVirtualInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayVirtualInterface", params, optFns, c.addOperationCreateLocalGatewayVirtualInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayVirtualInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayVirtualInterfaceInput struct { - - // The IP address assigned to the local gateway virtual interface on the Outpost - // side. Only IPv4 is supported. - // - // This member is required. - LocalAddress *string - - // The ID of the local gateway virtual interface group. - // - // This member is required. - LocalGatewayVirtualInterfaceGroupId *string - - // References the Link Aggregation Group (LAG) that connects the Outpost to - // on-premises network devices. - // - // This member is required. - OutpostLagId *string - - // The peer IP address for the local gateway virtual interface. Only IPv4 is - // supported. - // - // This member is required. - PeerAddress *string - - // The virtual local area network (VLAN) used for the local gateway virtual - // interface. - // - // This member is required. - Vlan *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Autonomous System Number (ASN) of the Border Gateway Protocol (BGP) peer. - PeerBgpAsn *int32 - - // The extended 32-bit ASN of the BGP peer for use with larger ASN values. - PeerBgpAsnExtended *int64 - - // The tags to apply to a resource when the local gateway virtual interface is - // being created. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateLocalGatewayVirtualInterfaceOutput struct { - - // Information about the local gateway virtual interface. - LocalGatewayVirtualInterface *types.LocalGatewayVirtualInterface - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayVirtualInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayVirtualInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayVirtualInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayVirtualInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayVirtualInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayVirtualInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayVirtualInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayVirtualInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterfaceGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterfaceGroup.go deleted file mode 100644 index 245421c79..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateLocalGatewayVirtualInterfaceGroup.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create a local gateway virtual interface group. -func (c *Client) CreateLocalGatewayVirtualInterfaceGroup(ctx context.Context, params *CreateLocalGatewayVirtualInterfaceGroupInput, optFns ...func(*Options)) (*CreateLocalGatewayVirtualInterfaceGroupOutput, error) { - if params == nil { - params = &CreateLocalGatewayVirtualInterfaceGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateLocalGatewayVirtualInterfaceGroup", params, optFns, c.addOperationCreateLocalGatewayVirtualInterfaceGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateLocalGatewayVirtualInterfaceGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateLocalGatewayVirtualInterfaceGroupInput struct { - - // The ID of the local gateway. - // - // This member is required. - LocalGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Autonomous System Number(ASN) for the local Border Gateway Protocol (BGP). - LocalBgpAsn *int32 - - // The extended 32-bit ASN for the local BGP configuration. - LocalBgpAsnExtended *int64 - - // The tags to apply to the local gateway virtual interface group when the - // resource is being created. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateLocalGatewayVirtualInterfaceGroupOutput struct { - - // Information about the created local gateway virtual interface group. - LocalGatewayVirtualInterfaceGroup *types.LocalGatewayVirtualInterfaceGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateLocalGatewayVirtualInterfaceGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateLocalGatewayVirtualInterfaceGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateLocalGatewayVirtualInterfaceGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLocalGatewayVirtualInterfaceGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateLocalGatewayVirtualInterfaceGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocalGatewayVirtualInterfaceGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateLocalGatewayVirtualInterfaceGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateLocalGatewayVirtualInterfaceGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateMacSystemIntegrityProtectionModificationTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateMacSystemIntegrityProtectionModificationTask.go deleted file mode 100644 index cf7f1974f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateMacSystemIntegrityProtectionModificationTask.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a System Integrity Protection (SIP) modification task to configure the -// SIP settings for an x86 Mac instance or Apple silicon Mac instance. For more -// information, see [Configure SIP for Amazon EC2 instances]in the Amazon EC2 User Guide. -// -// When you configure the SIP settings for your instance, you can either enable or -// disable all SIP settings, or you can specify a custom SIP configuration that -// selectively enables or disables specific SIP settings. -// -// If you implement a custom configuration, [connect to the instance and verify the settings] to ensure that your requirements are -// properly implemented and functioning as intended. -// -// SIP configurations might change with macOS updates. We recommend that you -// review custom SIP settings after any macOS version upgrade to ensure continued -// compatibility and proper functionality of your security configurations. -// -// To enable or disable all SIP settings, use the -// MacSystemIntegrityProtectionStatus parameter only. For example, to enable all -// SIP settings, specify the following: -// -// - MacSystemIntegrityProtectionStatus=enabled -// -// To specify a custom configuration that selectively enables or disables specific -// SIP settings, use the MacSystemIntegrityProtectionStatus parameter to enable or -// disable all SIP settings, and then use the -// MacSystemIntegrityProtectionConfiguration parameter to specify exceptions. In -// this case, the exceptions you specify for -// MacSystemIntegrityProtectionConfiguration override the value you specify for -// MacSystemIntegrityProtectionStatus. For example, to enable all SIP settings, -// except NvramProtections , specify the following: -// -// - MacSystemIntegrityProtectionStatus=enabled -// -// - MacSystemIntegrityProtectionConfigurationRequest "NvramProtections=disabled" -// -// [Configure SIP for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mac-sip-settings.html#mac-sip-configure -// [connect to the instance and verify the settings]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mac-sip-settings.html#mac-sip-check-settings -func (c *Client) CreateMacSystemIntegrityProtectionModificationTask(ctx context.Context, params *CreateMacSystemIntegrityProtectionModificationTaskInput, optFns ...func(*Options)) (*CreateMacSystemIntegrityProtectionModificationTaskOutput, error) { - if params == nil { - params = &CreateMacSystemIntegrityProtectionModificationTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateMacSystemIntegrityProtectionModificationTask", params, optFns, c.addOperationCreateMacSystemIntegrityProtectionModificationTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateMacSystemIntegrityProtectionModificationTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateMacSystemIntegrityProtectionModificationTaskInput struct { - - // The ID of the Amazon EC2 Mac instance. - // - // This member is required. - InstanceId *string - - // Specifies the overall SIP status for the instance. To enable all SIP settings, - // specify enabled . To disable all SIP settings, specify disabled . - // - // This member is required. - MacSystemIntegrityProtectionStatus types.MacSystemIntegrityProtectionSettingStatus - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // [Apple silicon Mac instances only] Specifies the following credentials: - // - // - Internal disk administrative user - // - // - Username - Only the default administrative user ( aws-managed-user ) is - // supported and it is used by default. You can't specify a different - // administrative user. - // - // - Password - If you did not change the default password for aws-managed-user , - // specify the default password, which is blank. Otherwise, specify your password. - // - // - Amazon EBS root volume administrative user - // - // - Username - If you did not change the default administrative user, specify - // ec2-user . Otherwise, specify the username for your administrative user. - // - // - Password - Specify the password for the administrative user. - // - // The credentials must be specified in the following JSON format: - // - // { "internalDiskPassword":"internal-disk-admin_password", - // "rootVolumeUsername":"root-volume-admin_username", - // "rootVolumepassword":"root-volume-admin_password" } - MacCredentials *string - - // Specifies the overrides to selectively enable or disable individual SIP - // settings. The individual settings you specify here override the overall SIP - // status you specify for MacSystemIntegrityProtectionStatus. - MacSystemIntegrityProtectionConfiguration *types.MacSystemIntegrityProtectionConfigurationRequest - - // Specifies tags to apply to the SIP modification task. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateMacSystemIntegrityProtectionModificationTaskOutput struct { - - // Information about the SIP modification task. - MacModificationTask *types.MacModificationTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateMacSystemIntegrityProtectionModificationTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateMacSystemIntegrityProtectionModificationTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateMacSystemIntegrityProtectionModificationTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateMacSystemIntegrityProtectionModificationTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateMacSystemIntegrityProtectionModificationTaskMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateMacSystemIntegrityProtectionModificationTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMacSystemIntegrityProtectionModificationTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateMacSystemIntegrityProtectionModificationTask struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateMacSystemIntegrityProtectionModificationTask) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateMacSystemIntegrityProtectionModificationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateMacSystemIntegrityProtectionModificationTaskInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMacSystemIntegrityProtectionModificationTaskInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateMacSystemIntegrityProtectionModificationTaskMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMacSystemIntegrityProtectionModificationTask{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateMacSystemIntegrityProtectionModificationTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateMacSystemIntegrityProtectionModificationTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateManagedPrefixList.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateManagedPrefixList.go deleted file mode 100644 index 5c44553f4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateManagedPrefixList.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a managed prefix list. You can specify entries for the prefix list. -// Each entry consists of a CIDR block and an optional description. -func (c *Client) CreateManagedPrefixList(ctx context.Context, params *CreateManagedPrefixListInput, optFns ...func(*Options)) (*CreateManagedPrefixListOutput, error) { - if params == nil { - params = &CreateManagedPrefixListInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateManagedPrefixList", params, optFns, c.addOperationCreateManagedPrefixListMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateManagedPrefixListOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateManagedPrefixListInput struct { - - // The IP address type. - // - // Valid Values: IPv4 | IPv6 - // - // This member is required. - AddressFamily *string - - // The maximum number of entries for the prefix list. - // - // This member is required. - MaxEntries *int32 - - // A name for the prefix list. - // - // Constraints: Up to 255 characters in length. The name cannot start with - // com.amazonaws . - // - // This member is required. - PrefixListName *string - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. For more information, see [Ensuring idempotency]. - // - // Constraints: Up to 255 UTF-8 characters in length. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more entries for the prefix list. - Entries []types.AddPrefixListEntry - - // The tags to apply to the prefix list during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateManagedPrefixListOutput struct { - - // Information about the prefix list. - PrefixList *types.ManagedPrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateManagedPrefixListMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateManagedPrefixList"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateManagedPrefixListMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateManagedPrefixListValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateManagedPrefixList(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateManagedPrefixList struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateManagedPrefixList) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateManagedPrefixList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateManagedPrefixListInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateManagedPrefixListInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateManagedPrefixListMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateManagedPrefixList{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateManagedPrefixList(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateManagedPrefixList", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNatGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNatGateway.go deleted file mode 100644 index 7d566dbcb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNatGateway.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a NAT gateway in the specified subnet. This action creates a network -// interface in the specified subnet with a private IP address from the IP address -// range of the subnet. You can create either a public NAT gateway or a private NAT -// gateway. -// -// With a public NAT gateway, internet-bound traffic from a private subnet can be -// routed to the NAT gateway, so that instances in a private subnet can connect to -// the internet. -// -// With a private NAT gateway, private communication is routed across VPCs and -// on-premises networks through a transit gateway or virtual private gateway. -// Common use cases include running large workloads behind a small pool of -// allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating -// between overlapping networks. -// -// For more information, see [NAT gateways] in the Amazon VPC User Guide. -// -// When you create a public NAT gateway and assign it an EIP or secondary EIPs, -// the network border group of the EIPs must match the network border group of the -// Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, -// the NAT gateway will fail to launch. You can see the network border group for -// the subnet's AZ by viewing the details of the subnet. Similarly, you can view -// the network border group of an EIP by viewing the details of the EIP address. -// For more information about network border groups and EIPs, see [Allocate an Elastic IP address]in the Amazon -// VPC User Guide. -// -// [NAT gateways]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html -// [Allocate an Elastic IP address]: https://docs.aws.amazon.com/vpc/latest/userguide/WorkWithEIPs.html -func (c *Client) CreateNatGateway(ctx context.Context, params *CreateNatGatewayInput, optFns ...func(*Options)) (*CreateNatGatewayOutput, error) { - if params == nil { - params = &CreateNatGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNatGateway", params, optFns, c.addOperationCreateNatGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNatGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNatGatewayInput struct { - - // The ID of the subnet in which to create the NAT gateway. - // - // This member is required. - SubnetId *string - - // [Public NAT gateways only] The allocation ID of an Elastic IP address to - // associate with the NAT gateway. You cannot specify an Elastic IP address with a - // private NAT gateway. If the Elastic IP address is associated with another - // resource, you must first disassociate it. - AllocationId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // Constraint: Maximum 64 ASCII characters. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Indicates whether the NAT gateway supports public or private connectivity. The - // default is public connectivity. - ConnectivityType types.ConnectivityType - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The private IPv4 address to assign to the NAT gateway. If you don't provide an - // address, a private IPv4 address will be automatically assigned. - PrivateIpAddress *string - - // Secondary EIP allocation IDs. For more information, see [Create a NAT gateway] in the Amazon VPC User - // Guide. - // - // [Create a NAT gateway]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html - SecondaryAllocationIds []string - - // [Private NAT gateway only] The number of secondary private IPv4 addresses you - // want to assign to the NAT gateway. For more information about secondary - // addresses, see [Create a NAT gateway]in the Amazon VPC User Guide. - // - // [Create a NAT gateway]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html - SecondaryPrivateIpAddressCount *int32 - - // Secondary private IPv4 addresses. For more information about secondary - // addresses, see [Create a NAT gateway]in the Amazon VPC User Guide. - // - // [Create a NAT gateway]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html - SecondaryPrivateIpAddresses []string - - // The tags to assign to the NAT gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateNatGatewayOutput struct { - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - // Only returned if a client token was provided in the request. - ClientToken *string - - // Information about the NAT gateway. - NatGateway *types.NatGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNatGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNatGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNatGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNatGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNatGatewayMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNatGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNatGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNatGateway struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNatGateway) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNatGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNatGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNatGatewayInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNatGatewayMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNatGateway{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNatGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNatGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAcl.go deleted file mode 100644 index ed5637d43..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAcl.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a network ACL in a VPC. Network ACLs provide an optional layer of -// security (in addition to security groups) for the instances in your VPC. -// -// For more information, see [Network ACLs] in the Amazon VPC User Guide. -// -// [Network ACLs]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html -func (c *Client) CreateNetworkAcl(ctx context.Context, params *CreateNetworkAclInput, optFns ...func(*Options)) (*CreateNetworkAclOutput, error) { - if params == nil { - params = &CreateNetworkAclInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkAcl", params, optFns, c.addOperationCreateNetworkAclMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkAclOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNetworkAclInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the network ACL. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateNetworkAclOutput struct { - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - // Only returned if a client token was provided in the request. - ClientToken *string - - // Information about the network ACL. - NetworkAcl *types.NetworkAcl - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkAclMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkAcl{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkAcl{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkAcl"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNetworkAclMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkAclValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkAcl(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNetworkAcl struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNetworkAcl) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNetworkAcl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNetworkAclInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNetworkAclInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNetworkAclMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNetworkAcl{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNetworkAcl(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkAcl", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAclEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAclEntry.go deleted file mode 100644 index 314441d87..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkAclEntry.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an entry (a rule) in a network ACL with the specified rule number. Each -// network ACL has a set of numbered ingress rules and a separate set of numbered -// egress rules. When determining whether a packet should be allowed in or out of a -// subnet associated with the ACL, we process the entries in the ACL according to -// the rule numbers, in ascending order. Each network ACL has a set of ingress -// rules and a separate set of egress rules. -// -// We recommend that you leave room between the rule numbers (for example, 100, -// 110, 120, ...), and not number them one right after the other (for example, 101, -// 102, 103, ...). This makes it easier to add a rule between existing ones without -// having to renumber the rules. -// -// After you add an entry, you can't modify it; you must either replace it, or -// create an entry and delete the old one. -// -// For more information about network ACLs, see [Network ACLs] in the Amazon VPC User Guide. -// -// [Network ACLs]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html -func (c *Client) CreateNetworkAclEntry(ctx context.Context, params *CreateNetworkAclEntryInput, optFns ...func(*Options)) (*CreateNetworkAclEntryOutput, error) { - if params == nil { - params = &CreateNetworkAclEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkAclEntry", params, optFns, c.addOperationCreateNetworkAclEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkAclEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNetworkAclEntryInput struct { - - // Indicates whether this is an egress rule (rule is applied to traffic leaving - // the subnet). - // - // This member is required. - Egress *bool - - // The ID of the network ACL. - // - // This member is required. - NetworkAclId *string - - // The protocol number. A value of "-1" means all protocols. If you specify "-1" - // or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on - // all ports is allowed, regardless of any ports or ICMP types or codes that you - // specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, - // traffic for all ICMP types and codes allowed, regardless of any that you - // specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, - // you must specify an ICMP type and code. - // - // This member is required. - Protocol *string - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // This member is required. - RuleAction types.RuleAction - - // The rule number for the entry (for example, 100). ACL entries are processed in - // ascending order by rule number. - // - // Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is - // reserved for internal use. - // - // This member is required. - RuleNumber *int32 - - // The IPv4 network range to allow or deny, in CIDR notation (for example - // 172.16.0.0/24 ). We modify the specified CIDR block to its canonical form; for - // example, if you specify 100.68.0.18/18 , we modify it to 100.68.0.0/18 . - CidrBlock *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying - // protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *types.IcmpTypeCode - - // The IPv6 network range to allow or deny, in CIDR notation (for example - // 2001:db8:1234:1a00::/64 ). - Ipv6CidrBlock *string - - // TCP or UDP protocols: The range of ports the rule applies to. Required if - // specifying protocol 6 (TCP) or 17 (UDP). - PortRange *types.PortRange - - noSmithyDocumentSerde -} - -type CreateNetworkAclEntryOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkAclEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkAclEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkAclEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkAclEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateNetworkAclEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkAclEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsAccessScope.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsAccessScope.go deleted file mode 100644 index 4e00ec7f0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsAccessScope.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Network Access Scope. -// -// Amazon Web Services Network Access Analyzer enables cloud networking and cloud -// operations teams to verify that their networks on Amazon Web Services conform to -// their network security and governance objectives. For more information, see the [Amazon Web Services Network Access Analyzer Guide] -// . -// -// [Amazon Web Services Network Access Analyzer Guide]: https://docs.aws.amazon.com/vpc/latest/network-access-analyzer/ -func (c *Client) CreateNetworkInsightsAccessScope(ctx context.Context, params *CreateNetworkInsightsAccessScopeInput, optFns ...func(*Options)) (*CreateNetworkInsightsAccessScopeOutput, error) { - if params == nil { - params = &CreateNetworkInsightsAccessScopeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkInsightsAccessScope", params, optFns, c.addOperationCreateNetworkInsightsAccessScopeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkInsightsAccessScopeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNetworkInsightsAccessScopeInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - // - // This member is required. - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The paths to exclude. - ExcludePaths []types.AccessScopePathRequest - - // The paths to match. - MatchPaths []types.AccessScopePathRequest - - // The tags to apply. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateNetworkInsightsAccessScopeOutput struct { - - // The Network Access Scope. - NetworkInsightsAccessScope *types.NetworkInsightsAccessScope - - // The Network Access Scope content. - NetworkInsightsAccessScopeContent *types.NetworkInsightsAccessScopeContent - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkInsightsAccessScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkInsightsAccessScope{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkInsightsAccessScope{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkInsightsAccessScope"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNetworkInsightsAccessScopeMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkInsightsAccessScopeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkInsightsAccessScope(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNetworkInsightsAccessScope struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNetworkInsightsAccessScope) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNetworkInsightsAccessScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNetworkInsightsAccessScopeInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNetworkInsightsAccessScopeInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNetworkInsightsAccessScopeMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNetworkInsightsAccessScope{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNetworkInsightsAccessScope(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkInsightsAccessScope", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsPath.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsPath.go deleted file mode 100644 index 173e8f38f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInsightsPath.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a path to analyze for reachability. -// -// Reachability Analyzer enables you to analyze and debug network reachability -// between two resources in your virtual private cloud (VPC). For more information, -// see the [Reachability Analyzer Guide]. -// -// [Reachability Analyzer Guide]: https://docs.aws.amazon.com/vpc/latest/reachability/ -func (c *Client) CreateNetworkInsightsPath(ctx context.Context, params *CreateNetworkInsightsPathInput, optFns ...func(*Options)) (*CreateNetworkInsightsPathOutput, error) { - if params == nil { - params = &CreateNetworkInsightsPathInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkInsightsPath", params, optFns, c.addOperationCreateNetworkInsightsPathMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkInsightsPathOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNetworkInsightsPathInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - // - // This member is required. - ClientToken *string - - // The protocol. - // - // This member is required. - Protocol types.Protocol - - // The ID or ARN of the source. If the resource is in another account, you must - // specify an ARN. - // - // This member is required. - Source *string - - // The ID or ARN of the destination. If the resource is in another account, you - // must specify an ARN. - Destination *string - - // The IP address of the destination. - DestinationIp *string - - // The destination port. - DestinationPort *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Scopes the analysis to network paths that match specific filters at the - // destination. If you specify this parameter, you can't specify the parameter for - // the destination IP address. - FilterAtDestination *types.PathRequestFilter - - // Scopes the analysis to network paths that match specific filters at the source. - // If you specify this parameter, you can't specify the parameters for the source - // IP address or the destination port. - FilterAtSource *types.PathRequestFilter - - // The IP address of the source. - SourceIp *string - - // The tags to add to the path. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateNetworkInsightsPathOutput struct { - - // Information about the path. - NetworkInsightsPath *types.NetworkInsightsPath - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkInsightsPathMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkInsightsPath{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkInsightsPath{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkInsightsPath"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNetworkInsightsPathMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkInsightsPathValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkInsightsPath(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNetworkInsightsPath struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNetworkInsightsPath) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNetworkInsightsPath) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNetworkInsightsPathInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNetworkInsightsPathInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNetworkInsightsPathMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNetworkInsightsPath{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNetworkInsightsPath(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkInsightsPath", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterface.go deleted file mode 100644 index 001085d14..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterface.go +++ /dev/null @@ -1,330 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a network interface in the specified subnet. -// -// The number of IP addresses you can assign to a network interface varies by -// instance type. -// -// For more information about network interfaces, see [Elastic network interfaces] in the Amazon EC2 User -// Guide. -// -// [Elastic network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html -func (c *Client) CreateNetworkInterface(ctx context.Context, params *CreateNetworkInterfaceInput, optFns ...func(*Options)) (*CreateNetworkInterfaceOutput, error) { - if params == nil { - params = &CreateNetworkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkInterface", params, optFns, c.addOperationCreateNetworkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNetworkInterfaceInput struct { - - // The ID of the subnet to associate with the network interface. - // - // This member is required. - SubnetId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A connection tracking specification for the network interface. - ConnectionTrackingSpecification *types.ConnectionTrackingSpecificationRequest - - // A description for the network interface. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // If you’re creating a network interface in a dual-stack or IPv6-only subnet, you - // have the option to assign a primary IPv6 IP address. A primary IPv6 address is - // an IPv6 GUA address associated with an ENI that you have enabled to use a - // primary IPv6 address. Use this option if the instance that this ENI will be - // attached to relies on its IPv6 address not changing. Amazon Web Services will - // automatically assign an IPv6 address associated with the ENI attached to your - // instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to - // be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to - // be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address - // until the instance is terminated or the network interface is detached. If you - // have multiple IPv6 addresses associated with an ENI attached to your instance - // and you enable a primary IPv6 address, the first IPv6 GUA address associated - // with the ENI becomes the primary IPv6 address. - EnablePrimaryIpv6 *bool - - // The IDs of the security groups. - Groups []string - - // The type of network interface. The default is interface . - // - // If you specify efa-only , do not assign any IP addresses to the network - // interface. EFA-only network interfaces do not support IP addresses. - // - // The only supported values are interface , efa , efa-only , and trunk . - InterfaceType types.NetworkInterfaceCreationType - - // The number of IPv4 prefixes that Amazon Web Services automatically assigns to - // the network interface. - // - // You can't specify a count of IPv4 prefixes if you've specified one of the - // following: specific IPv4 prefixes, specific private IPv4 addresses, or a count - // of private IPv4 addresses. - Ipv4PrefixCount *int32 - - // The IPv4 prefixes assigned to the network interface. - // - // You can't specify IPv4 prefixes if you've specified one of the following: a - // count of IPv4 prefixes, specific private IPv4 addresses, or a count of private - // IPv4 addresses. - Ipv4Prefixes []types.Ipv4PrefixSpecificationRequest - - // The number of IPv6 addresses to assign to a network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. - // - // You can't specify a count of IPv6 addresses using this parameter if you've - // specified one of the following: specific IPv6 addresses, specific IPv6 prefixes, - // or a count of IPv6 prefixes. - // - // If your subnet has the AssignIpv6AddressOnCreation attribute set, you can - // override that setting by specifying 0 as the IPv6 address count. - Ipv6AddressCount *int32 - - // The IPv6 addresses from the IPv6 CIDR block range of your subnet. - // - // You can't specify IPv6 addresses using this parameter if you've specified one - // of the following: a count of IPv6 addresses, specific IPv6 prefixes, or a count - // of IPv6 prefixes. - Ipv6Addresses []types.InstanceIpv6Address - - // The number of IPv6 prefixes that Amazon Web Services automatically assigns to - // the network interface. - // - // You can't specify a count of IPv6 prefixes if you've specified one of the - // following: specific IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 - // addresses. - Ipv6PrefixCount *int32 - - // The IPv6 prefixes assigned to the network interface. - // - // You can't specify IPv6 prefixes if you've specified one of the following: a - // count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses. - Ipv6Prefixes []types.Ipv6PrefixSpecificationRequest - - // Reserved for internal use. - Operator *types.OperatorRequest - - // The primary private IPv4 address of the network interface. If you don't specify - // an IPv4 address, Amazon EC2 selects one for you from the subnet's IPv4 CIDR - // range. If you specify an IP address, you cannot indicate any IP addresses - // specified in privateIpAddresses as primary (only one IP address can be - // designated as primary). - PrivateIpAddress *string - - // The private IPv4 addresses. - // - // You can't specify private IPv4 addresses if you've specified one of the - // following: a count of private IPv4 addresses, specific IPv4 prefixes, or a count - // of IPv4 prefixes. - PrivateIpAddresses []types.PrivateIpAddressSpecification - - // The number of secondary private IPv4 addresses to assign to a network - // interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 - // selects these IP addresses within the subnet's IPv4 CIDR range. You can't - // specify this option and specify more than one private IP address using - // privateIpAddresses . - // - // You can't specify a count of private IPv4 addresses if you've specified one of - // the following: specific private IPv4 addresses, specific IPv4 prefixes, or a - // count of IPv4 prefixes. - SecondaryPrivateIpAddressCount *int32 - - // The tags to apply to the new network interface. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateNetworkInterfaceOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - ClientToken *string - - // Information about the network interface. - NetworkInterface *types.NetworkInterface - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNetworkInterfaceMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNetworkInterface struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNetworkInterface) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNetworkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNetworkInterfaceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNetworkInterfaceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNetworkInterface{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNetworkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterfacePermission.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterfacePermission.go deleted file mode 100644 index 75b8ea79a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateNetworkInterfacePermission.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Grants an Amazon Web Services-authorized account permission to attach the -// specified network interface to an instance in their account. -// -// You can grant permission to a single Amazon Web Services account only, and only -// one account at a time. -func (c *Client) CreateNetworkInterfacePermission(ctx context.Context, params *CreateNetworkInterfacePermissionInput, optFns ...func(*Options)) (*CreateNetworkInterfacePermissionOutput, error) { - if params == nil { - params = &CreateNetworkInterfacePermissionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNetworkInterfacePermission", params, optFns, c.addOperationCreateNetworkInterfacePermissionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNetworkInterfacePermissionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The type of permission to grant. - // - // This member is required. - Permission types.InterfacePermissionType - - // The Amazon Web Services account ID. - AwsAccountId *string - - // The Amazon Web Services service. Currently not supported. - AwsService *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionOutput struct { - - // Information about the permission for the network interface. - InterfacePermission *types.NetworkInterfacePermission - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNetworkInterfacePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateNetworkInterfacePermission{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateNetworkInterfacePermission{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNetworkInterfacePermission"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateNetworkInterfacePermissionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetworkInterfacePermission(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateNetworkInterfacePermission(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNetworkInterfacePermission", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePlacementGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePlacementGroup.go deleted file mode 100644 index d8ad7048a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePlacementGroup.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a placement group in which to launch instances. The strategy of the -// placement group determines how the instances are organized within the group. -// -// A cluster placement group is a logical grouping of instances within a single -// Availability Zone that benefit from low network latency, high network -// throughput. A spread placement group places instances on distinct hardware. A -// partition placement group places groups of instances in different partitions, -// where instances in one partition do not share the same hardware with instances -// in another partition. -// -// For more information, see [Placement groups] in the Amazon EC2 User Guide. -// -// [Placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html -func (c *Client) CreatePlacementGroup(ctx context.Context, params *CreatePlacementGroupInput, optFns ...func(*Options)) (*CreatePlacementGroupOutput, error) { - if params == nil { - params = &CreatePlacementGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreatePlacementGroup", params, optFns, c.addOperationCreatePlacementGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreatePlacementGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreatePlacementGroupInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // A name for the placement group. Must be unique within the scope of your account - // for the Region. - // - // Constraints: Up to 255 ASCII characters - GroupName *string - - // The number of partitions. Valid only when Strategy is set to partition . - PartitionCount *int32 - - // Determines how placement groups spread instances. - // - // - Host – You can use host only with Outpost placement groups. - // - // - Rack – No usage restrictions. - SpreadLevel types.SpreadLevel - - // The placement strategy. - Strategy types.PlacementStrategy - - // The tags to apply to the new placement group. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreatePlacementGroupOutput struct { - - // Information about the placement group. - PlacementGroup *types.PlacementGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreatePlacementGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreatePlacementGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreatePlacementGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePlacementGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePlacementGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreatePlacementGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreatePlacementGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePublicIpv4Pool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePublicIpv4Pool.go deleted file mode 100644 index b1dcd7534..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreatePublicIpv4Pool.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a public IPv4 address pool. A public IPv4 pool is an EC2 IP address -// pool required for the public IPv4 CIDRs that you own and bring to Amazon Web -// Services to manage with IPAM. IPv6 addresses you bring to Amazon Web Services, -// however, use IPAM pools only. To monitor the status of pool creation, use [DescribePublicIpv4Pools]. -// -// [DescribePublicIpv4Pools]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribePublicIpv4Pools.html -func (c *Client) CreatePublicIpv4Pool(ctx context.Context, params *CreatePublicIpv4PoolInput, optFns ...func(*Options)) (*CreatePublicIpv4PoolOutput, error) { - if params == nil { - params = &CreatePublicIpv4PoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreatePublicIpv4Pool", params, optFns, c.addOperationCreatePublicIpv4PoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreatePublicIpv4PoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreatePublicIpv4PoolInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Availability Zone (AZ) or Local Zone (LZ) network border group that the - // resource that the IP address is assigned to is in. Defaults to an AZ network - // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon - // EC2 User Guide. - // - // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - NetworkBorderGroup *string - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreatePublicIpv4PoolOutput struct { - - // The ID of the public IPv4 pool. - PoolId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreatePublicIpv4PoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreatePublicIpv4Pool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreatePublicIpv4Pool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePublicIpv4Pool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePublicIpv4Pool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreatePublicIpv4Pool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreatePublicIpv4Pool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReplaceRootVolumeTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReplaceRootVolumeTask.go deleted file mode 100644 index 28b6037da..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReplaceRootVolumeTask.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Replaces the EBS-backed root volume for a running instance with a new volume -// that is restored to the original root volume's launch state, that is restored to -// a specific snapshot taken from the original root volume, or that is restored -// from an AMI that has the same key characteristics as that of the instance. -// -// For more information, see [Replace a root volume] in the Amazon EC2 User Guide. -// -// [Replace a root volume]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html -func (c *Client) CreateReplaceRootVolumeTask(ctx context.Context, params *CreateReplaceRootVolumeTaskInput, optFns ...func(*Options)) (*CreateReplaceRootVolumeTaskOutput, error) { - if params == nil { - params = &CreateReplaceRootVolumeTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateReplaceRootVolumeTask", params, optFns, c.addOperationCreateReplaceRootVolumeTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateReplaceRootVolumeTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateReplaceRootVolumeTaskInput struct { - - // The ID of the instance for which to replace the root volume. - // - // This member is required. - InstanceId *string - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. If you do not specify a client token, a randomly generated token is - // used for the request to ensure idempotency. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Indicates whether to automatically delete the original root volume after the - // root volume replacement task completes. To delete the original root volume, - // specify true . If you choose to keep the original root volume after the - // replacement task completes, you must manually delete it when you no longer need - // it. - DeleteReplacedRootVolume *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the AMI to use to restore the root volume. The specified AMI must - // have the same product code, billing information, architecture type, and - // virtualization type as that of the instance. - // - // If you want to restore the replacement volume from a specific snapshot, or if - // you want to restore it to its launch state, omit this parameter. - ImageId *string - - // The ID of the snapshot from which to restore the replacement root volume. The - // specified snapshot must be a snapshot that you previously created from the - // original root volume. - // - // If you want to restore the replacement root volume to the initial launch state, - // or if you want to restore the replacement root volume from an AMI, omit this - // parameter. - SnapshotId *string - - // The tags to apply to the root volume replacement task. - TagSpecifications []types.TagSpecification - - // Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate), in MiB/s, at which to download the snapshot blocks from - // Amazon S3 to the replacement root volume. This is also known as volume - // initialization. Specifying a volume initialization rate ensures that the volume - // is initialized at a predictable and consistent rate after creation. - // - // Omit this parameter if: - // - // - You want to create the volume using fast snapshot restore. You must specify - // a snapshot that is enabled for fast snapshot restore. In this case, the volume - // is fully initialized at creation. - // - // If you specify a snapshot that is enabled for fast snapshot restore and a - // volume initialization rate, the volume will be initialized at the specified rate - // instead of fast snapshot restore. - // - // - You want to create a volume that is initialized at the default rate. - // - // For more information, see [Initialize Amazon EBS volumes] in the Amazon EC2 User Guide. - // - // Valid range: 100 - 300 MiB/s - // - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - VolumeInitializationRate *int64 - - noSmithyDocumentSerde -} - -type CreateReplaceRootVolumeTaskOutput struct { - - // Information about the root volume replacement task. - ReplaceRootVolumeTask *types.ReplaceRootVolumeTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateReplaceRootVolumeTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateReplaceRootVolumeTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateReplaceRootVolumeTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReplaceRootVolumeTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateReplaceRootVolumeTaskMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateReplaceRootVolumeTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReplaceRootVolumeTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateReplaceRootVolumeTask struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateReplaceRootVolumeTask) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateReplaceRootVolumeTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateReplaceRootVolumeTaskInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateReplaceRootVolumeTaskInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateReplaceRootVolumeTaskMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateReplaceRootVolumeTask{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateReplaceRootVolumeTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateReplaceRootVolumeTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReservedInstancesListing.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReservedInstancesListing.go deleted file mode 100644 index c7f958109..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateReservedInstancesListing.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the -// Reserved Instance Marketplace. You can submit one Standard Reserved Instance -// listing at a time. To get a list of your Standard Reserved Instances, you can -// use the DescribeReservedInstancesoperation. -// -// Only Standard Reserved Instances can be sold in the Reserved Instance -// Marketplace. Convertible Reserved Instances cannot be sold. -// -// The Reserved Instance Marketplace matches sellers who want to resell Standard -// Reserved Instance capacity that they no longer need with buyers who want to -// purchase additional capacity. Reserved Instances bought and sold through the -// Reserved Instance Marketplace work like any other Reserved Instances. -// -// To sell your Standard Reserved Instances, you must first register as a seller -// in the Reserved Instance Marketplace. After completing the registration process, -// you can create a Reserved Instance Marketplace listing of some or all of your -// Standard Reserved Instances, and specify the upfront price to receive for them. -// Your Standard Reserved Instance listings then become available for purchase. To -// view the details of your Standard Reserved Instance listing, you can use the DescribeReservedInstancesListings -// operation. -// -// For more information, see [Sell in the Reserved Instance Marketplace] in the Amazon EC2 User Guide. -// -// [Sell in the Reserved Instance Marketplace]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html -func (c *Client) CreateReservedInstancesListing(ctx context.Context, params *CreateReservedInstancesListingInput, optFns ...func(*Options)) (*CreateReservedInstancesListingOutput, error) { - if params == nil { - params = &CreateReservedInstancesListingInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateReservedInstancesListing", params, optFns, c.addOperationCreateReservedInstancesListingMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateReservedInstancesListingOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateReservedInstancesListing. -type CreateReservedInstancesListingInput struct { - - // Unique, case-sensitive identifier you provide to ensure idempotency of your - // listings. This helps avoid duplicate listings. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - // - // This member is required. - ClientToken *string - - // The number of instances that are a part of a Reserved Instance account to be - // listed in the Reserved Instance Marketplace. This number should be less than or - // equal to the instance count associated with the Reserved Instance ID specified - // in this call. - // - // This member is required. - InstanceCount *int32 - - // A list specifying the price of the Standard Reserved Instance for each month - // remaining in the Reserved Instance term. - // - // This member is required. - PriceSchedules []types.PriceScheduleSpecification - - // The ID of the active Standard Reserved Instance. - // - // This member is required. - ReservedInstancesId *string - - noSmithyDocumentSerde -} - -// Contains the output of CreateReservedInstancesListing. -type CreateReservedInstancesListingOutput struct { - - // Information about the Standard Reserved Instance listing. - ReservedInstancesListings []types.ReservedInstancesListing - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateReservedInstancesListingMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateReservedInstancesListing{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateReservedInstancesListing{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReservedInstancesListing"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateReservedInstancesListingValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReservedInstancesListing(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateReservedInstancesListing(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateReservedInstancesListing", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRestoreImageTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRestoreImageTask.go deleted file mode 100644 index f9d97153f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRestoreImageTask.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Starts a task that restores an AMI from an Amazon S3 object that was previously -// created by using [CreateStoreImageTask]. -// -// To use this API, you must have the required permissions. For more information, -// see [Permissions for storing and restoring AMIs using S3]in the Amazon EC2 User Guide. -// -// For more information, see [Store and restore an AMI using S3] in the Amazon EC2 User Guide. -// -// [CreateStoreImageTask]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html -// [Store and restore an AMI using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html -// [Permissions for storing and restoring AMIs using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-ami-store-restore.html#ami-s3-permissions -func (c *Client) CreateRestoreImageTask(ctx context.Context, params *CreateRestoreImageTaskInput, optFns ...func(*Options)) (*CreateRestoreImageTaskOutput, error) { - if params == nil { - params = &CreateRestoreImageTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRestoreImageTask", params, optFns, c.addOperationCreateRestoreImageTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRestoreImageTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRestoreImageTaskInput struct { - - // The name of the Amazon S3 bucket that contains the stored AMI object. - // - // This member is required. - Bucket *string - - // The name of the stored AMI object in the bucket. - // - // This member is required. - ObjectKey *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name for the restored AMI. The name must be unique for AMIs in the Region - // for this account. If you do not provide a name, the new AMI gets the same name - // as the original AMI. - Name *string - - // The tags to apply to the AMI and snapshots on restoration. You can tag the AMI, - // the snapshots, or both. - // - // - To tag the AMI, the value for ResourceType must be image . - // - // - To tag the snapshots, the value for ResourceType must be snapshot . The same - // tag is applied to all of the snapshots that are created. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateRestoreImageTaskOutput struct { - - // The AMI ID. - ImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRestoreImageTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRestoreImageTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRestoreImageTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRestoreImageTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateRestoreImageTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRestoreImageTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateRestoreImageTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRestoreImageTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRoute.go deleted file mode 100644 index 4865a9751..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRoute.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a route in a route table within a VPC. -// -// You must specify either a destination CIDR block or a prefix list ID. You must -// also specify exactly one of the resources from the parameter list. -// -// When determining how to route traffic, we use the route with the most specific -// match. For example, traffic is destined for the IPv4 address 192.0.2.3 , and the -// route table includes the following two IPv4 routes: -// -// - 192.0.2.0/24 (goes to some target A) -// -// - 192.0.2.0/28 (goes to some target B) -// -// Both routes apply to the traffic destined for 192.0.2.3 . However, the second -// route in the list covers a smaller number of IP addresses and is therefore more -// specific, so we use that route to determine where to target the traffic. -// -// For more information about route tables, see [Route tables] in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) CreateRoute(ctx context.Context, params *CreateRouteInput, optFns ...func(*Options)) (*CreateRouteOutput, error) { - if params == nil { - params = &CreateRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRoute", params, optFns, c.addOperationCreateRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRouteInput struct { - - // The ID of the route table for the route. - // - // This member is required. - RouteTableId *string - - // The ID of the carrier gateway. - // - // You can only use this option when the VPC contains a subnet which is associated - // with a Wavelength Zone. - CarrierGatewayId *string - - // The Amazon Resource Name (ARN) of the core network. - CoreNetworkArn *string - - // The IPv4 CIDR address block used for the destination match. Routing decisions - // are based on the most specific match. We modify the specified CIDR block to its - // canonical form; for example, if you specify 100.68.0.18/18 , we modify it to - // 100.68.0.0/18 . - DestinationCidrBlock *string - - // The IPv6 CIDR block used for the destination match. Routing decisions are based - // on the most specific match. - DestinationIpv6CidrBlock *string - - // The ID of a prefix list used for the destination match. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // [IPv6 traffic only] The ID of an egress-only internet gateway. - EgressOnlyInternetGatewayId *string - - // The ID of an internet gateway or virtual private gateway attached to your VPC. - GatewayId *string - - // The ID of a NAT instance in your VPC. The operation fails if you specify an - // instance ID unless exactly one network interface is attached. - InstanceId *string - - // The ID of the local gateway. - LocalGatewayId *string - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string - - // The ID of a network interface. - NetworkInterfaceId *string - - // The Amazon Resource Name (ARN) of the ODB network. - OdbNetworkArn *string - - // The ID of a transit gateway. - TransitGatewayId *string - - // The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only. - VpcEndpointId *string - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -type CreateRouteOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServer.go deleted file mode 100644 index 29e46beed..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServer.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new route server to manage dynamic routing in a VPC. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) CreateRouteServer(ctx context.Context, params *CreateRouteServerInput, optFns ...func(*Options)) (*CreateRouteServerOutput, error) { - if params == nil { - params = &CreateRouteServerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRouteServer", params, optFns, c.addOperationCreateRouteServerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRouteServerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRouteServerInput struct { - - // The private Autonomous System Number (ASN) for the Amazon side of the BGP - // session. Valid values are from 1 to 4294967295. We recommend using a private ASN - // in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. - // - // This member is required. - AmazonSideAsn *int64 - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether routes should be persisted after all BGP sessions are - // terminated. - PersistRoutes types.RouteServerPersistRoutesAction - - // The number of minutes a route server will wait after BGP is re-established to - // unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. - // Required if PersistRoutes is enabled . - // - // If you set the duration to 1 minute, then when your network appliance - // re-establishes BGP with route server, it has 1 minute to relearn it's adjacent - // network and advertise those routes to route server before route server resumes - // normal functionality. In most cases, 1 minute is probably sufficient. If, - // however, you have concerns that your BGP network may not be capable of fully - // re-establishing and re-learning everything in 1 minute, you can increase the - // duration up to 5 minutes. - PersistRoutesDuration *int64 - - // Indicates whether SNS notifications should be enabled for route server events. - // Enabling SNS notifications persists BGP status changes to an SNS topic - // provisioned by Amazon Web Services. - SnsNotificationsEnabled *bool - - // The tags to apply to the route server during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateRouteServerOutput struct { - - // Information about the created route server. - RouteServer *types.RouteServer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRouteServerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRouteServer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRouteServer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRouteServer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateRouteServerMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateRouteServerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRouteServer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateRouteServer struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateRouteServer) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRouteServerInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateRouteServerMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRouteServer{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateRouteServer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRouteServer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerEndpoint.go deleted file mode 100644 index dd14f05e8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerEndpoint.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new endpoint for a route server in a specified subnet. -// -// A route server endpoint is an Amazon Web Services-managed component inside a -// subnet that facilitates [BGP (Border Gateway Protocol)]connections between your route server and your BGP -// peers. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [BGP (Border Gateway Protocol)]: https://en.wikipedia.org/wiki/Border_Gateway_Protocol -func (c *Client) CreateRouteServerEndpoint(ctx context.Context, params *CreateRouteServerEndpointInput, optFns ...func(*Options)) (*CreateRouteServerEndpointOutput, error) { - if params == nil { - params = &CreateRouteServerEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRouteServerEndpoint", params, optFns, c.addOperationCreateRouteServerEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRouteServerEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRouteServerEndpointInput struct { - - // The ID of the route server for which to create an endpoint. - // - // This member is required. - RouteServerId *string - - // The ID of the subnet in which to create the route server endpoint. - // - // This member is required. - SubnetId *string - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the route server endpoint during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateRouteServerEndpointOutput struct { - - // Information about the created route server endpoint. - RouteServerEndpoint *types.RouteServerEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRouteServerEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRouteServerEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRouteServerEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRouteServerEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateRouteServerEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateRouteServerEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRouteServerEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateRouteServerEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateRouteServerEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateRouteServerEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateRouteServerEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRouteServerEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateRouteServerEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRouteServerEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateRouteServerEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRouteServerEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerPeer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerPeer.go deleted file mode 100644 index 5de7f3951..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteServerPeer.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new BGP peer for a specified route server endpoint. -// -// A route server peer is a session between a route server endpoint and the device -// deployed in Amazon Web Services (such as a firewall appliance or other network -// security function running on an EC2 instance). The device must meet these -// requirements: -// -// - Have an elastic network interface in the VPC -// -// - Support BGP (Border Gateway Protocol) -// -// - Can initiate BGP sessions -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) CreateRouteServerPeer(ctx context.Context, params *CreateRouteServerPeerInput, optFns ...func(*Options)) (*CreateRouteServerPeerOutput, error) { - if params == nil { - params = &CreateRouteServerPeerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRouteServerPeer", params, optFns, c.addOperationCreateRouteServerPeerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRouteServerPeerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRouteServerPeerInput struct { - - // The BGP options for the peer, including ASN (Autonomous System Number) and BFD - // (Bidrectional Forwarding Detection) settings. - // - // This member is required. - BgpOptions *types.RouteServerBgpOptionsRequest - - // The IPv4 address of the peer device. - // - // This member is required. - PeerAddress *string - - // The ID of the route server endpoint for which to create a peer. - // - // This member is required. - RouteServerEndpointId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the route server peer during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateRouteServerPeerOutput struct { - - // Information about the created route server peer. - RouteServerPeer *types.RouteServerPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRouteServerPeerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRouteServerPeer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRouteServerPeer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRouteServerPeer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateRouteServerPeerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRouteServerPeer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateRouteServerPeer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRouteServerPeer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteTable.go deleted file mode 100644 index 5fa58ddda..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateRouteTable.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a route table for the specified VPC. After you create a route table, -// you can add routes and associate the table with a subnet. -// -// For more information, see [Route tables] in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) CreateRouteTable(ctx context.Context, params *CreateRouteTableInput, optFns ...func(*Options)) (*CreateRouteTableOutput, error) { - if params == nil { - params = &CreateRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateRouteTable", params, optFns, c.addOperationCreateRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateRouteTableInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the route table. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateRouteTableOutput struct { - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - // Only returned if a client token was provided in the request. - ClientToken *string - - // Information about the route table. - RouteTable *types.RouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateRouteTableMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateRouteTable struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateRouteTable) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRouteTableInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateRouteTableMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRouteTable{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSecurityGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSecurityGroup.go deleted file mode 100644 index 5c3c98472..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSecurityGroup.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a security group. -// -// A security group acts as a virtual firewall for your instance to control -// inbound and outbound traffic. For more information, see [Amazon EC2 security groups]in the Amazon EC2 User -// Guide and [Security groups for your VPC]in the Amazon VPC User Guide. -// -// When you create a security group, you specify a friendly name of your choice. -// You can't have two security groups for the same VPC with the same name. -// -// You have a default security group for use in your VPC. If you don't specify a -// security group when you launch an instance, the instance is launched into the -// appropriate default security group. A default security group includes a default -// rule that grants instances unrestricted network access to each other. -// -// You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress. -// -// For more information about VPC security group limits, see [Amazon VPC Limits]. -// -// [Amazon VPC Limits]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html -// [Amazon EC2 security groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html -// [Security groups for your VPC]: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html -func (c *Client) CreateSecurityGroup(ctx context.Context, params *CreateSecurityGroupInput, optFns ...func(*Options)) (*CreateSecurityGroupOutput, error) { - if params == nil { - params = &CreateSecurityGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSecurityGroup", params, optFns, c.addOperationCreateSecurityGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSecurityGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSecurityGroupInput struct { - - // A description for the security group. - // - // Constraints: Up to 255 characters in length - // - // Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // This member is required. - Description *string - - // The name of the security group. Names are case-insensitive and must be unique - // within the VPC. - // - // Constraints: Up to 255 characters in length. Can't start with sg- . - // - // Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // This member is required. - GroupName *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the security group. - TagSpecifications []types.TagSpecification - - // The ID of the VPC. Required for a nondefault VPC. - VpcId *string - - noSmithyDocumentSerde -} - -type CreateSecurityGroupOutput struct { - - // The ID of the security group. - GroupId *string - - // The security group ARN. - SecurityGroupArn *string - - // The tags assigned to the security group. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSecurityGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSecurityGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSecurityGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSecurityGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSecurityGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSecurityGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSecurityGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSecurityGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshot.go deleted file mode 100644 index 1e25c4f7c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshot.go +++ /dev/null @@ -1,342 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use -// snapshots for backups, to make copies of EBS volumes, and to save data before -// shutting down an instance. -// -// The location of the source EBS volume determines where you can create the -// snapshot. -// -// - If the source volume is in a Region, you must create the snapshot in the -// same Region as the volume. -// -// - If the source volume is in a Local Zone, you can create the snapshot in the -// same Local Zone or in its parent Amazon Web Services Region. -// -// - If the source volume is on an Outpost, you can create the snapshot on the -// same Outpost or in its parent Amazon Web Services Region. -// -// When a snapshot is created, any Amazon Web Services Marketplace product codes -// that are associated with the source volume are propagated to the snapshot. -// -// You can take a snapshot of an attached volume that is in use. However, -// snapshots only capture data that has been written to your Amazon EBS volume at -// the time the snapshot command is issued; this might exclude any data that has -// been cached by any applications or the operating system. If you can pause any -// file systems on the volume long enough to take a snapshot, your snapshot should -// be complete. However, if you cannot pause all file writes to the volume, you -// should unmount the volume from within the instance, issue the snapshot command, -// and then remount the volume to ensure a consistent and complete snapshot. You -// may remount and use your volume while the snapshot status is pending . -// -// When you create a snapshot for an EBS volume that serves as a root device, we -// recommend that you stop the instance before taking the snapshot. -// -// Snapshots that are taken from encrypted volumes are automatically encrypted. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. Your encrypted volumes and any associated snapshots always remain -// protected. For more information, see [Amazon EBS encryption]in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput, optFns ...func(*Options)) (*CreateSnapshotOutput, error) { - if params == nil { - params = &CreateSnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSnapshot", params, optFns, c.addOperationCreateSnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSnapshotInput struct { - - // The ID of the Amazon EBS volume. - // - // This member is required. - VolumeId *string - - // A description for the snapshot. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Only supported for volumes in Local Zones. If the source volume is not in a - // Local Zone, omit this parameter. - // - // - To create a local snapshot in the same Local Zone as the source volume, - // specify local . - // - // - To create a regional snapshot in the parent Region of the Local Zone, - // specify regional or omit this parameter. - // - // Default value: regional - Location types.SnapshotLocationEnum - - // Only supported for volumes on Outposts. If the source volume is not on an - // Outpost, omit this parameter. - // - // - To create the snapshot on the same Outpost as the source volume, specify - // the ARN of that Outpost. The snapshot must be created on the same Outpost as the - // volume. - // - // - To create the snapshot in the parent Region of the Outpost, omit this - // parameter. - // - // For more information, see [Create local snapshots from volumes on an Outpost] in the Amazon EBS User Guide. - // - // [Create local snapshots from volumes on an Outpost]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot - OutpostArn *string - - // The tags to apply to the snapshot during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Describes a snapshot. -type CreateSnapshotOutput struct { - - // The Availability Zone or Local Zone of the snapshot. For example, us-west-1a - // (Availability Zone) or us-west-2-lax-1a (Local Zone). - AvailabilityZone *string - - // Only for snapshot copies created with time-based snapshot copy operations. - // - // The completion duration requested for the time-based snapshot copy operation. - CompletionDurationMinutes *int32 - - // The time stamp when the snapshot was completed. - CompletionTime *time.Time - - // The data encryption key identifier for the snapshot. This value is a unique - // identifier that corresponds to the data encryption key that was used to encrypt - // the original volume or snapshot copy. Because data encryption keys are inherited - // by volumes created from snapshots, and vice versa, if snapshots share the same - // data encryption key identifier, then they belong to the same volume/snapshot - // lineage. This parameter is only returned by DescribeSnapshots. - DataEncryptionKeyId *string - - // The description for the snapshot. - Description *string - - // Indicates whether the snapshot is encrypted. - Encrypted *bool - - // The full size of the snapshot, in bytes. - // - // This is not the incremental size of the snapshot. This is the full snapshot - // size and represents the size of all the blocks that were written to the source - // volume at the time the snapshot was created. - FullSnapshotSizeInBytes *int64 - - // The Amazon Resource Name (ARN) of the KMS key that was used to protect the - // volume encryption key for the parent volume. - KmsKeyId *string - - // The ARN of the Outpost on which the snapshot is stored. For more information, - // see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. - // - // [Amazon EBS local snapshots on Outposts]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html - OutpostArn *string - - // The Amazon Web Services owner alias, from an Amazon-maintained list ( amazon ). - // This is not the user-configured Amazon Web Services account alias set using the - // IAM console. - OwnerAlias *string - - // The ID of the Amazon Web Services account that owns the EBS snapshot. - OwnerId *string - - // The progress of the snapshot, as a percentage. - Progress *string - - // Only for archived snapshots that are temporarily restored. Indicates the date - // and time when a temporarily restored snapshot will be automatically re-archived. - RestoreExpiryTime *time.Time - - // The ID of the snapshot. Each snapshot receives a unique identifier when it is - // created. - SnapshotId *string - - // Reserved for future use. - SseType types.SSEType - - // The time stamp when the snapshot was initiated. - StartTime *time.Time - - // The snapshot state. - State types.SnapshotState - - // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy - // operation fails (for example, if the proper KMS permissions are not obtained) - // this field displays error state details to help you diagnose why the error - // occurred. This parameter is only returned by DescribeSnapshots. - StateMessage *string - - // The storage tier in which the snapshot is stored. standard indicates that the - // snapshot is stored in the standard snapshot storage tier and that it is ready - // for use. archive indicates that the snapshot is currently archived and that it - // must be restored before it can be used. - StorageTier types.StorageTier - - // Any tags assigned to the snapshot. - Tags []types.Tag - - // Only for snapshot copies. - // - // Indicates whether the snapshot copy was created with a standard or time-based - // snapshot copy operation. Time-based snapshot copy operations complete within the - // completion duration specified in the request. Standard snapshot copy operations - // are completed on a best-effort basis. - // - // - standard - The snapshot copy was created with a standard snapshot copy - // operation. - // - // - time-based - The snapshot copy was created with a time-based snapshot copy - // operation. - TransferType types.TransferType - - // The ID of the volume that was used to create the snapshot. Snapshots created by - // the CopySnapshotaction have an arbitrary volume ID that should not be used for any purpose. - VolumeId *string - - // The size of the volume, in GiB. - VolumeSize *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSnapshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSnapshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshots.go deleted file mode 100644 index de40302b8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSnapshots.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates crash-consistent snapshots of multiple EBS volumes attached to an -// Amazon EC2 instance. Volumes are chosen by specifying an instance. Each volume -// attached to the specified instance will produce one snapshot that is -// crash-consistent across the instance. You can include all of the volumes -// currently attached to the instance, or you can exclude the root volume or -// specific data (non-root) volumes from the multi-volume snapshot set. -// -// The location of the source instance determines where you can create the -// snapshots. -// -// - If the source instance is in a Region, you must create the snapshots in the -// same Region as the instance. -// -// - If the source instance is in a Local Zone, you can create the snapshots in -// the same Local Zone or in its parent Amazon Web Services Region. -// -// - If the source instance is on an Outpost, you can create the snapshots on -// the same Outpost or in its parent Amazon Web Services Region. -func (c *Client) CreateSnapshots(ctx context.Context, params *CreateSnapshotsInput, optFns ...func(*Options)) (*CreateSnapshotsOutput, error) { - if params == nil { - params = &CreateSnapshotsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSnapshots", params, optFns, c.addOperationCreateSnapshotsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSnapshotsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSnapshotsInput struct { - - // The instance to specify which volumes should be included in the snapshots. - // - // This member is required. - InstanceSpecification *types.InstanceSpecification - - // Copies the tags from the specified volume to corresponding snapshot. - CopyTagsFromSource types.CopyTagsFromSource - - // A description propagated to every snapshot specified by the instance. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Only supported for instances in Local Zones. If the source instance is not in a - // Local Zone, omit this parameter. - // - // - To create local snapshots in the same Local Zone as the source instance, - // specify local . - // - // - To create regional snapshots in the parent Region of the Local Zone, - // specify regional or omit this parameter. - // - // Default value: regional - Location types.SnapshotLocationEnum - - // Only supported for instances on Outposts. If the source instance is not on an - // Outpost, omit this parameter. - // - // - To create the snapshots on the same Outpost as the source instance, specify - // the ARN of that Outpost. The snapshots must be created on the same Outpost as - // the instance. - // - // - To create the snapshots in the parent Region of the Outpost, omit this - // parameter. - // - // For more information, see [Create local snapshots from volumes on an Outpost] in the Amazon EBS User Guide. - // - // [Create local snapshots from volumes on an Outpost]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot - OutpostArn *string - - // Tags to apply to every snapshot specified by the instance. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateSnapshotsOutput struct { - - // List of snapshots. - Snapshots []types.SnapshotInfo - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSnapshots{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSnapshots{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSnapshots"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSnapshotsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshots(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSnapshots", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSpotDatafeedSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSpotDatafeedSubscription.go deleted file mode 100644 index 082030ba0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSpotDatafeedSubscription.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a data feed for Spot Instances, enabling you to view Spot Instance -// usage logs. You can create one data feed per Amazon Web Services account. For -// more information, see [Spot Instance data feed]in the Amazon EC2 User Guide. -// -// [Spot Instance data feed]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html -func (c *Client) CreateSpotDatafeedSubscription(ctx context.Context, params *CreateSpotDatafeedSubscriptionInput, optFns ...func(*Options)) (*CreateSpotDatafeedSubscriptionOutput, error) { - if params == nil { - params = &CreateSpotDatafeedSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSpotDatafeedSubscription", params, optFns, c.addOperationCreateSpotDatafeedSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSpotDatafeedSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionInput struct { - - // The name of the Amazon S3 bucket in which to store the Spot Instance data feed. - // For more information about bucket names, see [Bucket naming rules]in the Amazon S3 User Guide. - // - // [Bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html - // - // This member is required. - Bucket *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The prefix for the data feed file names. - Prefix *string - - noSmithyDocumentSerde -} - -// Contains the output of CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionOutput struct { - - // The Spot Instance data feed subscription. - SpotDatafeedSubscription *types.SpotDatafeedSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSpotDatafeedSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSpotDatafeedSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSpotDatafeedSubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSpotDatafeedSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSpotDatafeedSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSpotDatafeedSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateStoreImageTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateStoreImageTask.go deleted file mode 100644 index 2d604b130..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateStoreImageTask.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Stores an AMI as a single object in an Amazon S3 bucket. -// -// To use this API, you must have the required permissions. For more information, -// see [Permissions for storing and restoring AMIs using S3]in the Amazon EC2 User Guide. -// -// For more information, see [Store and restore an AMI using S3] in the Amazon EC2 User Guide. -// -// [Store and restore an AMI using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html -// [Permissions for storing and restoring AMIs using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-ami-store-restore.html#ami-s3-permissions -func (c *Client) CreateStoreImageTask(ctx context.Context, params *CreateStoreImageTaskInput, optFns ...func(*Options)) (*CreateStoreImageTaskOutput, error) { - if params == nil { - params = &CreateStoreImageTaskInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateStoreImageTask", params, optFns, c.addOperationCreateStoreImageTaskMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateStoreImageTaskOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateStoreImageTaskInput struct { - - // The name of the Amazon S3 bucket in which the AMI object will be stored. The - // bucket must be in the Region in which the request is being made. The AMI object - // appears in the bucket only after the upload task has completed. - // - // This member is required. - Bucket *string - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the AMI object that will be stored in the Amazon S3 - // bucket. - S3ObjectTags []types.S3ObjectTag - - noSmithyDocumentSerde -} - -type CreateStoreImageTaskOutput struct { - - // The name of the stored AMI object in the S3 bucket. - ObjectKey *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateStoreImageTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateStoreImageTask{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateStoreImageTask{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateStoreImageTask"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateStoreImageTaskValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStoreImageTask(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateStoreImageTask(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateStoreImageTask", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnet.go deleted file mode 100644 index 9ee93678d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnet.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a subnet in the specified VPC. For an IPv4 only subnet, specify an IPv4 -// CIDR block. If the VPC has an IPv6 CIDR block, you can create an IPv6 only -// subnet or a dual stack subnet instead. For an IPv6 only subnet, specify an IPv6 -// CIDR block. For a dual stack subnet, specify both an IPv4 CIDR block and an IPv6 -// CIDR block. -// -// A subnet CIDR block must not overlap the CIDR block of an existing subnet in -// the VPC. After you create a subnet, you can't change its CIDR block. -// -// The allowed size for an IPv4 subnet is between a /28 netmask (16 IP addresses) -// and a /16 netmask (65,536 IP addresses). Amazon Web Services reserves both the -// first four and the last IPv4 address in each subnet's CIDR block. They're not -// available for your use. -// -// If you've associated an IPv6 CIDR block with your VPC, you can associate an -// IPv6 CIDR block with a subnet when you create it. -// -// If you add more than one subnet to a VPC, they're set up in a star topology -// with a logical router in the middle. -// -// When you stop an instance in a subnet, it retains its private IPv4 address. -// It's therefore possible to have a subnet with no running instances (they're all -// stopped), but no remaining IP addresses available. -// -// For more information, see [Subnets] in the Amazon VPC User Guide. -// -// [Subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html -func (c *Client) CreateSubnet(ctx context.Context, params *CreateSubnetInput, optFns ...func(*Options)) (*CreateSubnetOutput, error) { - if params == nil { - params = &CreateSubnetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSubnet", params, optFns, c.addOperationCreateSubnetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSubnetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSubnetInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // The Availability Zone or Local Zone for the subnet. - // - // Default: Amazon Web Services selects one for you. If you create more than one - // subnet in your VPC, we do not necessarily select a different zone for each - // subnet. - // - // To create a subnet in a Local Zone, set this value to the Local Zone ID, for - // example us-west-2-lax-1a . For information about the Regions that support Local - // Zones, see [Available Local Zones]. - // - // To create a subnet in an Outpost, set this value to the Availability Zone for - // the Outpost and specify the Outpost ARN. - // - // [Available Local Zones]: https://docs.aws.amazon.com/local-zones/latest/ug/available-local-zones.html - AvailabilityZone *string - - // The AZ ID or the Local Zone ID of the subnet. - AvailabilityZoneId *string - - // The IPv4 network range for the subnet, in CIDR notation. For example, - // 10.0.0.0/24 . We modify the specified CIDR block to its canonical form; for - // example, if you specify 100.68.0.18/18 , we modify it to 100.68.0.0/18 . - // - // This parameter is not supported for an IPv6 only subnet. - CidrBlock *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // An IPv4 IPAM pool ID for the subnet. - Ipv4IpamPoolId *string - - // An IPv4 netmask length for the subnet. - Ipv4NetmaskLength *int32 - - // The IPv6 network range for the subnet, in CIDR notation. This parameter is - // required for an IPv6 only subnet. - Ipv6CidrBlock *string - - // An IPv6 IPAM pool ID for the subnet. - Ipv6IpamPoolId *string - - // Indicates whether to create an IPv6 only subnet. - Ipv6Native *bool - - // An IPv6 netmask length for the subnet. - Ipv6NetmaskLength *int32 - - // The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, - // you must also specify the Availability Zone of the Outpost subnet. - OutpostArn *string - - // The tags to assign to the subnet. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateSubnetOutput struct { - - // Information about the subnet. - Subnet *types.Subnet - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSubnetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSubnet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSubnet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSubnet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSubnetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSubnet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSubnet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSubnet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnetCidrReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnetCidrReservation.go deleted file mode 100644 index 0b7898d09..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateSubnetCidrReservation.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a subnet CIDR reservation. For more information, see [Subnet CIDR reservations] in the Amazon VPC -// User Guide and [Manage prefixes for your network interfaces]in the Amazon EC2 User Guide. -// -// [Subnet CIDR reservations]: https://docs.aws.amazon.com/vpc/latest/userguide/subnet-cidr-reservation.html -// [Manage prefixes for your network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-prefixes.html -func (c *Client) CreateSubnetCidrReservation(ctx context.Context, params *CreateSubnetCidrReservationInput, optFns ...func(*Options)) (*CreateSubnetCidrReservationOutput, error) { - if params == nil { - params = &CreateSubnetCidrReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSubnetCidrReservation", params, optFns, c.addOperationCreateSubnetCidrReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSubnetCidrReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSubnetCidrReservationInput struct { - - // The IPv4 or IPV6 CIDR range to reserve. - // - // This member is required. - Cidr *string - - // The type of reservation. The reservation type determines how the reserved IP - // addresses are assigned to resources. - // - // - prefix - Amazon Web Services assigns the reserved IP addresses to network - // interfaces. - // - // - explicit - You assign the reserved IP addresses to network interfaces. - // - // This member is required. - ReservationType types.SubnetCidrReservationType - - // The ID of the subnet. - // - // This member is required. - SubnetId *string - - // The description to assign to the subnet CIDR reservation. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to the subnet CIDR reservation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateSubnetCidrReservationOutput struct { - - // Information about the created subnet CIDR reservation. - SubnetCidrReservation *types.SubnetCidrReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSubnetCidrReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateSubnetCidrReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateSubnetCidrReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSubnetCidrReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateSubnetCidrReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSubnetCidrReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateSubnetCidrReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSubnetCidrReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTags.go deleted file mode 100644 index 5f0b00a71..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTags.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds or overwrites only the specified tags for the specified Amazon EC2 -// resource or resources. When you specify an existing tag key, the value is -// overwritten with the new value. Each resource can have a maximum of 50 tags. -// Each tag consists of a key and optional value. Tag keys must be unique per -// resource. -// -// For more information about tags, see [Tag your Amazon EC2 resources] in the Amazon Elastic Compute Cloud User -// Guide. For more information about creating IAM policies that control users' -// access to resources based on tags, see [Supported resource-level permissions for Amazon EC2 API actions]in the Amazon Elastic Compute Cloud User -// Guide. -// -// [Supported resource-level permissions for Amazon EC2 API actions]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html -// [Tag your Amazon EC2 resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html -func (c *Client) CreateTags(ctx context.Context, params *CreateTagsInput, optFns ...func(*Options)) (*CreateTagsOutput, error) { - if params == nil { - params = &CreateTagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTags", params, optFns, c.addOperationCreateTagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTagsInput struct { - - // The IDs of the resources, separated by spaces. - // - // Constraints: Up to 1000 resource IDs. We recommend breaking up this request - // into smaller batches. - // - // This member is required. - Resources []string - - // The tags. The value parameter is required, but if you don't want the tag to - // have a value, specify the parameter with no value, and we set the value to an - // empty string. - // - // This member is required. - Tags []types.Tag - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type CreateTagsOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTagsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilter.go deleted file mode 100644 index 8470f9e74..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilter.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Traffic Mirror filter. -// -// A Traffic Mirror filter is a set of rules that defines the traffic to mirror. -// -// By default, no traffic is mirrored. To mirror traffic, use [CreateTrafficMirrorFilterRule] to add Traffic -// Mirror rules to the filter. The rules you add define what traffic gets mirrored. -// You can also use [ModifyTrafficMirrorFilterNetworkServices]to mirror supported network services. -// -// [CreateTrafficMirrorFilterRule]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilterRule.htm -// [ModifyTrafficMirrorFilterNetworkServices]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyTrafficMirrorFilterNetworkServices.html -func (c *Client) CreateTrafficMirrorFilter(ctx context.Context, params *CreateTrafficMirrorFilterInput, optFns ...func(*Options)) (*CreateTrafficMirrorFilterOutput, error) { - if params == nil { - params = &CreateTrafficMirrorFilterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTrafficMirrorFilter", params, optFns, c.addOperationCreateTrafficMirrorFilterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTrafficMirrorFilterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTrafficMirrorFilterInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The description of the Traffic Mirror filter. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to assign to a Traffic Mirror filter. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTrafficMirrorFilterOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Information about the Traffic Mirror filter. - TrafficMirrorFilter *types.TrafficMirrorFilter - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTrafficMirrorFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTrafficMirrorFilter{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTrafficMirrorFilter{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTrafficMirrorFilter"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateTrafficMirrorFilterMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficMirrorFilter(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateTrafficMirrorFilter struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateTrafficMirrorFilter) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateTrafficMirrorFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateTrafficMirrorFilterInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTrafficMirrorFilterInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateTrafficMirrorFilterMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTrafficMirrorFilter{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateTrafficMirrorFilter(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTrafficMirrorFilter", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilterRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilterRule.go deleted file mode 100644 index 674a696de..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorFilterRule.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Traffic Mirror filter rule. -// -// A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror. -// -// You need the Traffic Mirror filter ID when you create the rule. -func (c *Client) CreateTrafficMirrorFilterRule(ctx context.Context, params *CreateTrafficMirrorFilterRuleInput, optFns ...func(*Options)) (*CreateTrafficMirrorFilterRuleOutput, error) { - if params == nil { - params = &CreateTrafficMirrorFilterRuleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTrafficMirrorFilterRule", params, optFns, c.addOperationCreateTrafficMirrorFilterRuleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTrafficMirrorFilterRuleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTrafficMirrorFilterRuleInput struct { - - // The destination CIDR block to assign to the Traffic Mirror rule. - // - // This member is required. - DestinationCidrBlock *string - - // The action to take on the filtered traffic. - // - // This member is required. - RuleAction types.TrafficMirrorRuleAction - - // The number of the Traffic Mirror rule. This number must be unique for each - // Traffic Mirror rule in a given direction. The rules are processed in ascending - // order by rule number. - // - // This member is required. - RuleNumber *int32 - - // The source CIDR block to assign to the Traffic Mirror rule. - // - // This member is required. - SourceCidrBlock *string - - // The type of traffic. - // - // This member is required. - TrafficDirection types.TrafficDirection - - // The ID of the filter that this rule is associated with. - // - // This member is required. - TrafficMirrorFilterId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The description of the Traffic Mirror rule. - Description *string - - // The destination port range. - DestinationPortRange *types.TrafficMirrorPortRangeRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The protocol, for example UDP, to assign to the Traffic Mirror rule. - // - // For information about the protocol value, see [Protocol Numbers] on the Internet Assigned Numbers - // Authority (IANA) website. - // - // [Protocol Numbers]: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - Protocol *int32 - - // The source port range. - SourcePortRange *types.TrafficMirrorPortRangeRequest - - // Traffic Mirroring tags specifications. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTrafficMirrorFilterRuleOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The Traffic Mirror rule. - TrafficMirrorFilterRule *types.TrafficMirrorFilterRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTrafficMirrorFilterRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTrafficMirrorFilterRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateTrafficMirrorFilterRuleMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateTrafficMirrorFilterRuleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficMirrorFilterRule(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateTrafficMirrorFilterRule struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateTrafficMirrorFilterRule) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateTrafficMirrorFilterRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateTrafficMirrorFilterRuleInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTrafficMirrorFilterRuleInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateTrafficMirrorFilterRuleMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTrafficMirrorFilterRule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateTrafficMirrorFilterRule(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTrafficMirrorFilterRule", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorSession.go deleted file mode 100644 index 57f827c89..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorSession.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Traffic Mirror session. -// -// A Traffic Mirror session actively copies packets from a Traffic Mirror source -// to a Traffic Mirror target. Create a filter, and then assign it to the session -// to define a subset of the traffic to mirror, for example all TCP traffic. -// -// The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) -// can be in the same VPC, or in a different VPC connected via VPC peering or a -// transit gateway. -// -// By default, no traffic is mirrored. Use [CreateTrafficMirrorFilter] to create filter rules that specify -// the traffic to mirror. -// -// [CreateTrafficMirrorFilter]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilter.html -func (c *Client) CreateTrafficMirrorSession(ctx context.Context, params *CreateTrafficMirrorSessionInput, optFns ...func(*Options)) (*CreateTrafficMirrorSessionOutput, error) { - if params == nil { - params = &CreateTrafficMirrorSessionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTrafficMirrorSession", params, optFns, c.addOperationCreateTrafficMirrorSessionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTrafficMirrorSessionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTrafficMirrorSessionInput struct { - - // The ID of the source network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The session number determines the order in which sessions are evaluated when an - // interface is used by multiple sessions. The first session with a matching filter - // is the one that mirrors the packets. - // - // Valid values are 1-32766. - // - // This member is required. - SessionNumber *int32 - - // The ID of the Traffic Mirror filter. - // - // This member is required. - TrafficMirrorFilterId *string - - // The ID of the Traffic Mirror target. - // - // This member is required. - TrafficMirrorTargetId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The description of the Traffic Mirror session. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The number of bytes in each packet to mirror. These are bytes after the VXLAN - // header. Do not specify this parameter when you want to mirror the entire packet. - // To mirror a subset of the packet, set this to the length (in bytes) that you - // want to mirror. For example, if you set this value to 100, then the first 100 - // bytes that meet the filter criteria are copied to the target. - // - // If you do not want to mirror the entire packet, use the PacketLength parameter - // to specify the number of bytes in each packet to mirror. - // - // For sessions with Network Load Balancer (NLB) Traffic Mirror targets the - // default PacketLength will be set to 8500. Valid values are 1-8500. Setting a - // PacketLength greater than 8500 will result in an error response. - PacketLength *int32 - - // The tags to assign to a Traffic Mirror session. - TagSpecifications []types.TagSpecification - - // The VXLAN ID for the Traffic Mirror session. For more information about the - // VXLAN protocol, see [RFC 7348]. If you do not specify a VirtualNetworkId , an account-wide - // unique ID is chosen at random. - // - // [RFC 7348]: https://datatracker.ietf.org/doc/html/rfc7348 - VirtualNetworkId *int32 - - noSmithyDocumentSerde -} - -type CreateTrafficMirrorSessionOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Information about the Traffic Mirror session. - TrafficMirrorSession *types.TrafficMirrorSession - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTrafficMirrorSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTrafficMirrorSession"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateTrafficMirrorSessionMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateTrafficMirrorSessionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficMirrorSession(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateTrafficMirrorSession struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateTrafficMirrorSession) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateTrafficMirrorSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateTrafficMirrorSessionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTrafficMirrorSessionInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateTrafficMirrorSessionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTrafficMirrorSession{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateTrafficMirrorSession(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTrafficMirrorSession", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorTarget.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorTarget.go deleted file mode 100644 index bb08112d3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTrafficMirrorTarget.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a target for your Traffic Mirror session. -// -// A Traffic Mirror target is the destination for mirrored traffic. The Traffic -// Mirror source and the Traffic Mirror target (monitoring appliances) can be in -// the same VPC, or in different VPCs connected via VPC peering or a transit -// gateway. -// -// A Traffic Mirror target can be a network interface, a Network Load Balancer, or -// a Gateway Load Balancer endpoint. -// -// To use the target in a Traffic Mirror session, use [CreateTrafficMirrorSession]. -// -// [CreateTrafficMirrorSession]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorSession.htm -func (c *Client) CreateTrafficMirrorTarget(ctx context.Context, params *CreateTrafficMirrorTargetInput, optFns ...func(*Options)) (*CreateTrafficMirrorTargetOutput, error) { - if params == nil { - params = &CreateTrafficMirrorTargetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTrafficMirrorTarget", params, optFns, c.addOperationCreateTrafficMirrorTargetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTrafficMirrorTargetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTrafficMirrorTargetInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The description of the Traffic Mirror target. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the Gateway Load Balancer endpoint. - GatewayLoadBalancerEndpointId *string - - // The network interface ID that is associated with the target. - NetworkInterfaceId *string - - // The Amazon Resource Name (ARN) of the Network Load Balancer that is associated - // with the target. - NetworkLoadBalancerArn *string - - // The tags to assign to the Traffic Mirror target. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTrafficMirrorTargetOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Information about the Traffic Mirror target. - TrafficMirrorTarget *types.TrafficMirrorTarget - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTrafficMirrorTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTrafficMirrorTarget{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTrafficMirrorTarget{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTrafficMirrorTarget"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateTrafficMirrorTargetMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrafficMirrorTarget(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateTrafficMirrorTarget struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateTrafficMirrorTarget) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateTrafficMirrorTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateTrafficMirrorTargetInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTrafficMirrorTargetInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateTrafficMirrorTargetMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTrafficMirrorTarget{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateTrafficMirrorTarget(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTrafficMirrorTarget", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGateway.go deleted file mode 100644 index f0a85021b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGateway.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a transit gateway. -// -// You can use a transit gateway to interconnect your virtual private clouds (VPC) -// and on-premises networks. After the transit gateway enters the available state, -// you can attach your VPCs and VPN connections to the transit gateway. -// -// To attach your VPCs, use CreateTransitGatewayVpcAttachment. -// -// To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the -// ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection. -// -// When you create a transit gateway, we create a default transit gateway route -// table and use it as the default association route table and the default -// propagation route table. You can use CreateTransitGatewayRouteTableto create additional transit gateway route -// tables. If you disable automatic route propagation, we do not create a default -// transit gateway route table. You can use EnableTransitGatewayRouteTablePropagationto propagate routes from a resource -// attachment to a transit gateway route table. If you disable automatic -// associations, you can use AssociateTransitGatewayRouteTableto associate a resource attachment with a transit -// gateway route table. -func (c *Client) CreateTransitGateway(ctx context.Context, params *CreateTransitGatewayInput, optFns ...func(*Options)) (*CreateTransitGatewayOutput, error) { - if params == nil { - params = &CreateTransitGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGateway", params, optFns, c.addOperationCreateTransitGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayInput struct { - - // A description of the transit gateway. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The transit gateway options. - Options *types.TransitGatewayRequestOptions - - // The tags to apply to the transit gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayOutput struct { - - // Information about the transit gateway. - TransitGateway *types.TransitGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnect.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnect.go deleted file mode 100644 index 3fa5ae971..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnect.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Connect attachment from a specified transit gateway attachment. A -// Connect attachment is a GRE-based tunnel attachment that you can use to -// establish a connection between a transit gateway and an appliance. -// -// A Connect attachment uses an existing VPC or Amazon Web Services Direct Connect -// attachment as the underlying transport mechanism. -func (c *Client) CreateTransitGatewayConnect(ctx context.Context, params *CreateTransitGatewayConnectInput, optFns ...func(*Options)) (*CreateTransitGatewayConnectOutput, error) { - if params == nil { - params = &CreateTransitGatewayConnectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayConnect", params, optFns, c.addOperationCreateTransitGatewayConnectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayConnectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayConnectInput struct { - - // The Connect attachment options. - // - // This member is required. - Options *types.CreateTransitGatewayConnectRequestOptions - - // The ID of the transit gateway attachment. You can specify a VPC attachment or - // Amazon Web Services Direct Connect attachment. - // - // This member is required. - TransportTransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the Connect attachment. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayConnectOutput struct { - - // Information about the Connect attachment. - TransitGatewayConnect *types.TransitGatewayConnect - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayConnectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayConnect{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayConnect{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayConnect"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayConnectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayConnect(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayConnect(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayConnect", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnectPeer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnectPeer.go deleted file mode 100644 index 10c957d2b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayConnectPeer.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Connect peer for a specified transit gateway Connect attachment -// between a transit gateway and an appliance. -// -// The peer address and transit gateway address must be the same IP address family -// (IPv4 or IPv6). -// -// For more information, see [Connect peers] in the Amazon Web Services Transit Gateways Guide. -// -// [Connect peers]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html#tgw-connect-peer -func (c *Client) CreateTransitGatewayConnectPeer(ctx context.Context, params *CreateTransitGatewayConnectPeerInput, optFns ...func(*Options)) (*CreateTransitGatewayConnectPeerOutput, error) { - if params == nil { - params = &CreateTransitGatewayConnectPeerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayConnectPeer", params, optFns, c.addOperationCreateTransitGatewayConnectPeerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayConnectPeerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayConnectPeerInput struct { - - // The range of inside IP addresses that are used for BGP peering. You must - // specify a size /29 IPv4 CIDR block from the 169.254.0.0/16 range. The first - // address from the range must be configured on the appliance as the BGP IP - // address. You can also optionally specify a size /125 IPv6 CIDR block from the - // fd00::/8 range. - // - // This member is required. - InsideCidrBlocks []string - - // The peer IP address (GRE outer IP address) on the appliance side of the Connect - // peer. - // - // This member is required. - PeerAddress *string - - // The ID of the Connect attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The BGP options for the Connect peer. - BgpOptions *types.TransitGatewayConnectRequestBgpOptions - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the Connect peer. - TagSpecifications []types.TagSpecification - - // The peer IP address (GRE outer IP address) on the transit gateway side of the - // Connect peer, which must be specified from a transit gateway CIDR block. If not - // specified, Amazon automatically assigns the first available IP address from the - // transit gateway CIDR block. - TransitGatewayAddress *string - - noSmithyDocumentSerde -} - -type CreateTransitGatewayConnectPeerOutput struct { - - // Information about the Connect peer. - TransitGatewayConnectPeer *types.TransitGatewayConnectPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayConnectPeerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayConnectPeer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayConnectPeer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayConnectPeer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayConnectPeerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayConnectPeer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayConnectPeer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayConnectPeer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayMulticastDomain.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayMulticastDomain.go deleted file mode 100644 index 7108a7350..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayMulticastDomain.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a multicast domain using the specified transit gateway. -// -// The transit gateway must be in the available state before you create a domain. -// Use [DescribeTransitGateways]to see the state of transit gateway. -// -// [DescribeTransitGateways]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGateways.html -func (c *Client) CreateTransitGatewayMulticastDomain(ctx context.Context, params *CreateTransitGatewayMulticastDomainInput, optFns ...func(*Options)) (*CreateTransitGatewayMulticastDomainOutput, error) { - if params == nil { - params = &CreateTransitGatewayMulticastDomainInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayMulticastDomain", params, optFns, c.addOperationCreateTransitGatewayMulticastDomainMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayMulticastDomainOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayMulticastDomainInput struct { - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The options for the transit gateway multicast domain. - Options *types.CreateTransitGatewayMulticastDomainRequestOptions - - // The tags for the transit gateway multicast domain. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayMulticastDomainOutput struct { - - // Information about the transit gateway multicast domain. - TransitGatewayMulticastDomain *types.TransitGatewayMulticastDomain - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayMulticastDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayMulticastDomain"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayMulticastDomainValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayMulticastDomain(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayMulticastDomain(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayMulticastDomain", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPeeringAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPeeringAttachment.go deleted file mode 100644 index 9093d50c4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPeeringAttachment.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Requests a transit gateway peering attachment between the specified transit -// gateway (requester) and a peer transit gateway (accepter). The peer transit -// gateway can be in your account or a different Amazon Web Services account. -// -// After you create the peering attachment, the owner of the accepter transit -// gateway must accept the attachment request. -func (c *Client) CreateTransitGatewayPeeringAttachment(ctx context.Context, params *CreateTransitGatewayPeeringAttachmentInput, optFns ...func(*Options)) (*CreateTransitGatewayPeeringAttachmentOutput, error) { - if params == nil { - params = &CreateTransitGatewayPeeringAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayPeeringAttachment", params, optFns, c.addOperationCreateTransitGatewayPeeringAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayPeeringAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayPeeringAttachmentInput struct { - - // The ID of the Amazon Web Services account that owns the peer transit gateway. - // - // This member is required. - PeerAccountId *string - - // The Region where the peer transit gateway is located. - // - // This member is required. - PeerRegion *string - - // The ID of the peer transit gateway with which to create the peering attachment. - // - // This member is required. - PeerTransitGatewayId *string - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Requests a transit gateway peering attachment. - Options *types.CreateTransitGatewayPeeringAttachmentRequestOptions - - // The tags to apply to the transit gateway peering attachment. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayPeeringAttachmentOutput struct { - - // The transit gateway peering attachment. - TransitGatewayPeeringAttachment *types.TransitGatewayPeeringAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayPeeringAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayPeeringAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayPeeringAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayPeeringAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayPeeringAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayPeeringAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPolicyTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPolicyTable.go deleted file mode 100644 index bbb3a4f58..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPolicyTable.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a transit gateway policy table. -func (c *Client) CreateTransitGatewayPolicyTable(ctx context.Context, params *CreateTransitGatewayPolicyTableInput, optFns ...func(*Options)) (*CreateTransitGatewayPolicyTableOutput, error) { - if params == nil { - params = &CreateTransitGatewayPolicyTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayPolicyTable", params, optFns, c.addOperationCreateTransitGatewayPolicyTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayPolicyTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayPolicyTableInput struct { - - // The ID of the transit gateway used for the policy table. - // - // This member is required. - TransitGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags specification for the transit gateway policy table created during the - // request. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayPolicyTableOutput struct { - - // Describes the created transit gateway policy table. - TransitGatewayPolicyTable *types.TransitGatewayPolicyTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayPolicyTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayPolicyTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayPolicyTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayPolicyTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayPolicyTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayPolicyTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPrefixListReference.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPrefixListReference.go deleted file mode 100644 index b961ec8c3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayPrefixListReference.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a reference (route) to a prefix list in a specified transit gateway -// route table. -func (c *Client) CreateTransitGatewayPrefixListReference(ctx context.Context, params *CreateTransitGatewayPrefixListReferenceInput, optFns ...func(*Options)) (*CreateTransitGatewayPrefixListReferenceOutput, error) { - if params == nil { - params = &CreateTransitGatewayPrefixListReferenceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayPrefixListReference", params, optFns, c.addOperationCreateTransitGatewayPrefixListReferenceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayPrefixListReferenceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayPrefixListReferenceInput struct { - - // The ID of the prefix list that is used for destination matches. - // - // This member is required. - PrefixListId *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Indicates whether to drop traffic that matches this route. - Blackhole *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment to which traffic is routed. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -type CreateTransitGatewayPrefixListReferenceOutput struct { - - // Information about the prefix list reference. - TransitGatewayPrefixListReference *types.TransitGatewayPrefixListReference - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayPrefixListReferenceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayPrefixListReference"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayPrefixListReferenceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayPrefixListReference(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayPrefixListReference(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayPrefixListReference", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRoute.go deleted file mode 100644 index ecc17331a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRoute.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a static route for the specified transit gateway route table. -func (c *Client) CreateTransitGatewayRoute(ctx context.Context, params *CreateTransitGatewayRouteInput, optFns ...func(*Options)) (*CreateTransitGatewayRouteOutput, error) { - if params == nil { - params = &CreateTransitGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayRoute", params, optFns, c.addOperationCreateTransitGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayRouteInput struct { - - // The CIDR range used for destination matches. Routing decisions are based on the - // most specific match. - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Indicates whether to drop traffic that matches this route. - Blackhole *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -type CreateTransitGatewayRouteOutput struct { - - // Information about the route. - Route *types.TransitGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTable.go deleted file mode 100644 index 433367ff3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTable.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a route table for the specified transit gateway. -func (c *Client) CreateTransitGatewayRouteTable(ctx context.Context, params *CreateTransitGatewayRouteTableInput, optFns ...func(*Options)) (*CreateTransitGatewayRouteTableOutput, error) { - if params == nil { - params = &CreateTransitGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayRouteTable", params, optFns, c.addOperationCreateTransitGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayRouteTableInput struct { - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the transit gateway route table. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayRouteTableOutput struct { - - // Information about the transit gateway route table. - TransitGatewayRouteTable *types.TransitGatewayRouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTableAnnouncement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTableAnnouncement.go deleted file mode 100644 index 838a336dd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayRouteTableAnnouncement.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Advertises a new transit gateway route table. -func (c *Client) CreateTransitGatewayRouteTableAnnouncement(ctx context.Context, params *CreateTransitGatewayRouteTableAnnouncementInput, optFns ...func(*Options)) (*CreateTransitGatewayRouteTableAnnouncementOutput, error) { - if params == nil { - params = &CreateTransitGatewayRouteTableAnnouncementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayRouteTableAnnouncement", params, optFns, c.addOperationCreateTransitGatewayRouteTableAnnouncementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayRouteTableAnnouncementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayRouteTableAnnouncementInput struct { - - // The ID of the peering attachment. - // - // This member is required. - PeeringAttachmentId *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags specifications applied to the transit gateway route table announcement. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayRouteTableAnnouncementOutput struct { - - // Provides details about the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncement *types.TransitGatewayRouteTableAnnouncement - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayRouteTableAnnouncementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayRouteTableAnnouncement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayRouteTableAnnouncement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayRouteTableAnnouncement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayRouteTableAnnouncementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayRouteTableAnnouncement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayRouteTableAnnouncement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayRouteTableAnnouncement", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayVpcAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayVpcAttachment.go deleted file mode 100644 index 29cb317c7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateTransitGatewayVpcAttachment.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches the specified VPC to the specified transit gateway. -// -// If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC -// that is already attached, the new VPC CIDR range is not propagated to the -// default propagation route table. -// -// To send VPC traffic to an attached transit gateway, add a route to the VPC -// route table using CreateRoute. -func (c *Client) CreateTransitGatewayVpcAttachment(ctx context.Context, params *CreateTransitGatewayVpcAttachmentInput, optFns ...func(*Options)) (*CreateTransitGatewayVpcAttachmentOutput, error) { - if params == nil { - params = &CreateTransitGatewayVpcAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTransitGatewayVpcAttachment", params, optFns, c.addOperationCreateTransitGatewayVpcAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTransitGatewayVpcAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTransitGatewayVpcAttachmentInput struct { - - // The IDs of one or more subnets. You can specify only one subnet per - // Availability Zone. You must specify at least one subnet, but we recommend that - // you specify two subnets for better availability. The transit gateway uses one IP - // address from each specified subnet. - // - // This member is required. - SubnetIds []string - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The VPC attachment options. - Options *types.CreateTransitGatewayVpcAttachmentRequestOptions - - // The tags to apply to the VPC attachment. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateTransitGatewayVpcAttachmentOutput struct { - - // Information about the VPC attachment. - TransitGatewayVpcAttachment *types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTransitGatewayVpcAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTransitGatewayVpcAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTransitGatewayVpcAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTransitGatewayVpcAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTransitGatewayVpcAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTransitGatewayVpcAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessEndpoint.go deleted file mode 100644 index 5125ae6c9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessEndpoint.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// An Amazon Web Services Verified Access endpoint is where you define your -// application along with an optional endpoint-level access policy. -func (c *Client) CreateVerifiedAccessEndpoint(ctx context.Context, params *CreateVerifiedAccessEndpointInput, optFns ...func(*Options)) (*CreateVerifiedAccessEndpointOutput, error) { - if params == nil { - params = &CreateVerifiedAccessEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVerifiedAccessEndpoint", params, optFns, c.addOperationCreateVerifiedAccessEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVerifiedAccessEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVerifiedAccessEndpointInput struct { - - // The type of attachment. - // - // This member is required. - AttachmentType types.VerifiedAccessEndpointAttachmentType - - // The type of Verified Access endpoint to create. - // - // This member is required. - EndpointType types.VerifiedAccessEndpointType - - // The ID of the Verified Access group to associate the endpoint with. - // - // This member is required. - VerifiedAccessGroupId *string - - // The DNS name for users to reach your application. - ApplicationDomain *string - - // The CIDR options. This parameter is required if the endpoint type is cidr . - CidrOptions *types.CreateVerifiedAccessEndpointCidrOptions - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access endpoint. - Description *string - - // The ARN of the public TLS/SSL certificate in Amazon Web Services Certificate - // Manager to associate with the endpoint. The CN in the certificate must match the - // DNS name your end users will use to reach your application. - DomainCertificateArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // A custom identifier that is prepended to the DNS name that is generated for the - // endpoint. - EndpointDomainPrefix *string - - // The load balancer details. This parameter is required if the endpoint type is - // load-balancer . - LoadBalancerOptions *types.CreateVerifiedAccessEndpointLoadBalancerOptions - - // The network interface details. This parameter is required if the endpoint type - // is network-interface . - NetworkInterfaceOptions *types.CreateVerifiedAccessEndpointEniOptions - - // The Verified Access policy document. - PolicyDocument *string - - // The RDS details. This parameter is required if the endpoint type is rds . - RdsOptions *types.CreateVerifiedAccessEndpointRdsOptions - - // The IDs of the security groups to associate with the Verified Access endpoint. - // Required if AttachmentType is set to vpc . - SecurityGroupIds []string - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - // The tags to assign to the Verified Access endpoint. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVerifiedAccessEndpointOutput struct { - - // Details about the Verified Access endpoint. - VerifiedAccessEndpoint *types.VerifiedAccessEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVerifiedAccessEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVerifiedAccessEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateVerifiedAccessEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateVerifiedAccessEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVerifiedAccessEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateVerifiedAccessEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateVerifiedAccessEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVerifiedAccessEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateVerifiedAccessEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVerifiedAccessEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateVerifiedAccessEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVerifiedAccessEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessGroup.go deleted file mode 100644 index 279065e7c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessGroup.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// An Amazon Web Services Verified Access group is a collection of Amazon Web -// Services Verified Access endpoints who's associated applications have similar -// security requirements. Each instance within a Verified Access group shares an -// Verified Access policy. For example, you can group all Verified Access instances -// associated with "sales" applications together and use one common Verified Access -// policy. -func (c *Client) CreateVerifiedAccessGroup(ctx context.Context, params *CreateVerifiedAccessGroupInput, optFns ...func(*Options)) (*CreateVerifiedAccessGroupOutput, error) { - if params == nil { - params = &CreateVerifiedAccessGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVerifiedAccessGroup", params, optFns, c.addOperationCreateVerifiedAccessGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVerifiedAccessGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVerifiedAccessGroupInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access group. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Verified Access policy document. - PolicyDocument *string - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - // The tags to assign to the Verified Access group. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVerifiedAccessGroupOutput struct { - - // Details about the Verified Access group. - VerifiedAccessGroup *types.VerifiedAccessGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVerifiedAccessGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVerifiedAccessGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateVerifiedAccessGroupMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateVerifiedAccessGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVerifiedAccessGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateVerifiedAccessGroup struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateVerifiedAccessGroup) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVerifiedAccessGroupInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateVerifiedAccessGroupMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVerifiedAccessGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateVerifiedAccessGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVerifiedAccessGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessInstance.go deleted file mode 100644 index f1d2a7ca6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessInstance.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// An Amazon Web Services Verified Access instance is a regional entity that -// evaluates application requests and grants access only when your security -// requirements are met. -func (c *Client) CreateVerifiedAccessInstance(ctx context.Context, params *CreateVerifiedAccessInstanceInput, optFns ...func(*Options)) (*CreateVerifiedAccessInstanceOutput, error) { - if params == nil { - params = &CreateVerifiedAccessInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVerifiedAccessInstance", params, optFns, c.addOperationCreateVerifiedAccessInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVerifiedAccessInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVerifiedAccessInstanceInput struct { - - // The custom subdomain. - CidrEndpointsCustomSubDomain *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access instance. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Enable or disable support for Federal Information Processing Standards (FIPS) - // on the instance. - FIPSEnabled *bool - - // The tags to assign to the Verified Access instance. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVerifiedAccessInstanceOutput struct { - - // Details about the Verified Access instance. - VerifiedAccessInstance *types.VerifiedAccessInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVerifiedAccessInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVerifiedAccessInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateVerifiedAccessInstanceMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVerifiedAccessInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateVerifiedAccessInstance struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateVerifiedAccessInstance) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateVerifiedAccessInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateVerifiedAccessInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVerifiedAccessInstanceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateVerifiedAccessInstanceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVerifiedAccessInstance{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateVerifiedAccessInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVerifiedAccessInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessTrustProvider.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessTrustProvider.go deleted file mode 100644 index 0098b27ac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVerifiedAccessTrustProvider.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// A trust provider is a third-party entity that creates, maintains, and manages -// identity information for users and devices. When an application request is made, -// the identity information sent by the trust provider is evaluated by Verified -// Access before allowing or denying the application request. -func (c *Client) CreateVerifiedAccessTrustProvider(ctx context.Context, params *CreateVerifiedAccessTrustProviderInput, optFns ...func(*Options)) (*CreateVerifiedAccessTrustProviderOutput, error) { - if params == nil { - params = &CreateVerifiedAccessTrustProviderInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVerifiedAccessTrustProvider", params, optFns, c.addOperationCreateVerifiedAccessTrustProviderMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVerifiedAccessTrustProviderOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVerifiedAccessTrustProviderInput struct { - - // The identifier to be used when working with policy rules. - // - // This member is required. - PolicyReferenceName *string - - // The type of trust provider. - // - // This member is required. - TrustProviderType types.TrustProviderType - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access trust provider. - Description *string - - // The options for a device-based trust provider. This parameter is required when - // the provider type is device . - DeviceOptions *types.CreateVerifiedAccessTrustProviderDeviceOptions - - // The type of device-based trust provider. This parameter is required when the - // provider type is device . - DeviceTrustProviderType types.DeviceTrustProviderType - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The OpenID Connect (OIDC) options. - NativeApplicationOidcOptions *types.CreateVerifiedAccessNativeApplicationOidcOptions - - // The options for a OpenID Connect-compatible user-identity trust provider. This - // parameter is required when the provider type is user . - OidcOptions *types.CreateVerifiedAccessTrustProviderOidcOptions - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - // The tags to assign to the Verified Access trust provider. - TagSpecifications []types.TagSpecification - - // The type of user-based trust provider. This parameter is required when the - // provider type is user . - UserTrustProviderType types.UserTrustProviderType - - noSmithyDocumentSerde -} - -type CreateVerifiedAccessTrustProviderOutput struct { - - // Details about the Verified Access trust provider. - VerifiedAccessTrustProvider *types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVerifiedAccessTrustProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVerifiedAccessTrustProvider"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateVerifiedAccessTrustProviderMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateVerifiedAccessTrustProviderValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVerifiedAccessTrustProvider(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateVerifiedAccessTrustProvider struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateVerifiedAccessTrustProvider) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVerifiedAccessTrustProviderInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateVerifiedAccessTrustProviderMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVerifiedAccessTrustProvider{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateVerifiedAccessTrustProvider(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVerifiedAccessTrustProvider", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVolume.go deleted file mode 100644 index 81cd8e4de..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVolume.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates an EBS volume that can be attached to an instance in the same -// Availability Zone. -// -// You can create a new empty volume or restore a volume from an EBS snapshot. Any -// Amazon Web Services Marketplace product codes from the snapshot are propagated -// to the volume. -// -// You can create encrypted volumes. Encrypted volumes must be attached to -// instances that support Amazon EBS encryption. Volumes that are created from -// encrypted snapshots are also automatically encrypted. For more information, see [Amazon EBS encryption] -// in the Amazon EBS User Guide. -// -// You can tag your volumes during creation. For more information, see [Tag your Amazon EC2 resources] in the -// Amazon EC2 User Guide. -// -// For more information, see [Create an Amazon EBS volume] in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -// [Create an Amazon EBS volume]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-creating-volume.html -// [Tag your Amazon EC2 resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html -func (c *Client) CreateVolume(ctx context.Context, params *CreateVolumeInput, optFns ...func(*Options)) (*CreateVolumeOutput, error) { - if params == nil { - params = &CreateVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVolume", params, optFns, c.addOperationCreateVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVolumeInput struct { - - // The ID of the Availability Zone in which to create the volume. For example, - // us-east-1a . - // - // This member is required. - AvailabilityZone *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensure Idempotency]. - // - // [Ensure Idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether the volume should be encrypted. The effect of setting the - // encryption state to true depends on the volume origin (new or from a snapshot), - // starting encryption state, ownership, and whether encryption by default is - // enabled. For more information, see [Encryption by default]in the Amazon EBS User Guide. - // - // Encrypted Amazon EBS volumes must be attached to instances that support Amazon - // EBS encryption. For more information, see [Supported instance types]. - // - // [Supported instance types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances - // [Encryption by default]: https://docs.aws.amazon.com/ebs/latest/userguide/work-with-ebs-encr.html#encryption-by-default - Encrypted *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - // - // The following are the supported values for each volume type: - // - // - gp3 : 3,000 - 16,000 IOPS - // - // - io1 : 100 - 64,000 IOPS - // - // - io2 : 100 - 256,000 IOPS - // - // For io2 volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System]. On other instances, - // you can achieve performance up to 32,000 IOPS. - // - // This parameter is required for io1 and io2 volumes. The default for gp3 volumes - // is 3,000 IOPS. This parameter is not supported for gp2 , st1 , sc1 , or standard - // volumes. - // - // [instances built on the Nitro System]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - Iops *int32 - - // The identifier of the KMS key to use for Amazon EBS encryption. If this - // parameter is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is - // specified, the encrypted state must be true . - // - // You can specify the KMS key using any of the following: - // - // - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Key alias. For example, alias/ExampleAlias. - // - // - Key ARN. For example, - // arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Alias ARN. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you - // specify an ID, alias, or ARN that is not valid, the action can appear to - // complete, but eventually fails. - KmsKeyId *string - - // Indicates whether to enable Amazon EBS Multi-Attach. If you enable - // Multi-Attach, you can attach the volume to up to 16 [Instances built on the Nitro System]in the same Availability - // Zone. This parameter is supported with io1 and io2 volumes only. For more - // information, see [Amazon EBS Multi-Attach]in the Amazon EBS User Guide. - // - // [Instances built on the Nitro System]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - // [Amazon EBS Multi-Attach]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html - MultiAttachEnabled *bool - - // Reserved for internal use. - Operator *types.OperatorRequest - - // The Amazon Resource Name (ARN) of the Outpost on which to create the volume. - // - // If you intend to use a volume with an instance running on an outpost, then you - // must create the volume on the same outpost as the instance. You can't use a - // volume created in an Amazon Web Services Region with an instance on an Amazon - // Web Services outpost, or the other way around. - OutpostArn *string - - // The size of the volume, in GiBs. You must specify either a snapshot ID or a - // volume size. If you specify a snapshot, the default is the snapshot size. You - // can specify a volume size that is equal to or larger than the snapshot size. - // - // The following are the supported volumes sizes for each volume type: - // - // - gp2 and gp3 : 1 - 16,384 GiB - // - // - io1 : 4 - 16,384 GiB - // - // - io2 : 4 - 65,536 GiB - // - // - st1 and sc1 : 125 - 16,384 GiB - // - // - standard : 1 - 1024 GiB - Size *int32 - - // The snapshot from which to create the volume. You must specify either a - // snapshot ID or a volume size. - SnapshotId *string - - // The tags to apply to the volume during creation. - TagSpecifications []types.TagSpecification - - // The throughput to provision for a volume, with a maximum of 1,000 MiB/s. - // - // This parameter is valid only for gp3 volumes. - // - // Valid Range: Minimum value of 125. Maximum value of 1000. - Throughput *int32 - - // Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate), in MiB/s, at which to download the snapshot blocks from - // Amazon S3 to the volume. This is also known as volume initialization. Specifying - // a volume initialization rate ensures that the volume is initialized at a - // predictable and consistent rate after creation. - // - // This parameter is supported only for volumes created from snapshots. Omit this - // parameter if: - // - // - You want to create the volume using fast snapshot restore. You must specify - // a snapshot that is enabled for fast snapshot restore. In this case, the volume - // is fully initialized at creation. - // - // If you specify a snapshot that is enabled for fast snapshot restore and a - // volume initialization rate, the volume will be initialized at the specified rate - // instead of fast snapshot restore. - // - // - You want to create a volume that is initialized at the default rate. - // - // For more information, see [Initialize Amazon EBS volumes] in the Amazon EC2 User Guide. - // - // Valid range: 100 - 300 MiB/s - // - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - VolumeInitializationRate *int32 - - // The volume type. This parameter can be one of the following values: - // - // - General Purpose SSD: gp2 | gp3 - // - // - Provisioned IOPS SSD: io1 | io2 - // - // - Throughput Optimized HDD: st1 - // - // - Cold HDD: sc1 - // - // - Magnetic: standard - // - // Throughput Optimized HDD ( st1 ) and Cold HDD ( sc1 ) volumes can't be used as - // boot volumes. - // - // For more information, see [Amazon EBS volume types] in the Amazon EBS User Guide. - // - // Default: gp2 - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType types.VolumeType - - noSmithyDocumentSerde -} - -// Describes a volume. -type CreateVolumeOutput struct { - - // This parameter is not returned by CreateVolume. - // - // Information about the volume attachments. - Attachments []types.VolumeAttachment - - // The Availability Zone for the volume. - AvailabilityZone *string - - // The time stamp when volume creation was initiated. - CreateTime *time.Time - - // Indicates whether the volume is encrypted. - Encrypted *bool - - // This parameter is not returned by CreateVolume. - // - // Indicates whether the volume was created using fast snapshot restore. - FastRestored *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - Iops *int32 - - // The Amazon Resource Name (ARN) of the KMS key that was used to protect the - // volume encryption key for the volume. - KmsKeyId *string - - // Indicates whether Amazon EBS Multi-Attach is enabled. - MultiAttachEnabled *bool - - // The service provider that manages the volume. - Operator *types.OperatorResponse - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The size of the volume, in GiBs. - Size *int32 - - // The snapshot from which the volume was created, if applicable. - SnapshotId *string - - // This parameter is not returned by CreateVolume. - // - // Reserved for future use. - SseType types.SSEType - - // The volume state. - State types.VolumeState - - // Any tags assigned to the volume. - Tags []types.Tag - - // The throughput that the volume supports, in MiB/s. - Throughput *int32 - - // The ID of the volume. - VolumeId *string - - // The Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate) specified for the volume during creation, in MiB/s. If no - // volume initialization rate was specified, the value is null . - VolumeInitializationRate *int32 - - // The volume type. - VolumeType types.VolumeType - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateVolumeMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateVolume struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateVolume) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVolumeInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateVolumeMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVolume{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpc.go deleted file mode 100644 index c346a24cb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpc.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a VPC with the specified CIDR blocks. For more information, see [IP addressing for your VPCs and subnets] in the -// Amazon VPC User Guide. -// -// You can optionally request an IPv6 CIDR block for the VPC. You can request an -// Amazon-provided IPv6 CIDR block from Amazon's pool of IPv6 addresses or an IPv6 -// CIDR block from an IPv6 address pool that you provisioned through bring your own -// IP addresses ([BYOIP] ). -// -// By default, each instance that you launch in the VPC has the default DHCP -// options, which include only a default DNS server that we provide -// (AmazonProvidedDNS). For more information, see [DHCP option sets]in the Amazon VPC User Guide. -// -// You can specify the instance tenancy value for the VPC when you create it. You -// can't change this value for the VPC after you create it. For more information, -// see [Dedicated Instances]in the Amazon EC2 User Guide. -// -// [BYOIP]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html -// [Dedicated Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html -// [DHCP option sets]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html -// [IP addressing for your VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html -func (c *Client) CreateVpc(ctx context.Context, params *CreateVpcInput, optFns ...func(*Options)) (*CreateVpcOutput, error) { - if params == nil { - params = &CreateVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpc", params, optFns, c.addOperationCreateVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcInput struct { - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the - // VPC. You cannot specify the range of IP addresses, or the size of the CIDR - // block. - AmazonProvidedIpv6CidrBlock *bool - - // The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16 . - // We modify the specified CIDR block to its canonical form; for example, if you - // specify 100.68.0.18/18 , we modify it to 100.68.0.0/18 . - CidrBlock *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tenancy options for instances launched into the VPC. For default , instances - // are launched with shared tenancy by default. You can launch instances with any - // tenancy into a shared tenancy VPC. For dedicated , instances are launched as - // dedicated tenancy instances by default. You can only launch instances with a - // tenancy of dedicated or host into a dedicated tenancy VPC. - // - // Important: The host value cannot be used with this parameter. Use the default - // or dedicated values only. - // - // Default: default - InstanceTenancy types.Tenancy - - // The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For - // more information, see [What is IPAM?]in the Amazon VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv4IpamPoolId *string - - // The netmask length of the IPv4 CIDR you want to allocate to this VPC from an - // Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?] - // in the Amazon VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv4NetmaskLength *int32 - - // The IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool - // in the request. - // - // To let Amazon choose the IPv6 CIDR block for you, omit this parameter. - Ipv6CidrBlock *string - - // The name of the location from which we advertise the IPV6 CIDR block. Use this - // parameter to limit the address to this location. - // - // You must set AmazonProvidedIpv6CidrBlock to true to use this parameter. - Ipv6CidrBlockNetworkBorderGroup *string - - // The ID of an IPv6 IPAM pool which will be used to allocate this VPC an IPv6 - // CIDR. IPAM is a VPC feature that you can use to automate your IP address - // management workflows including assigning, tracking, troubleshooting, and - // auditing IP addresses across Amazon Web Services Regions and accounts throughout - // your Amazon Web Services Organization. For more information, see [What is IPAM?]in the Amazon - // VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv6IpamPoolId *string - - // The netmask length of the IPv6 CIDR you want to allocate to this VPC from an - // Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?] - // in the Amazon VPC IPAM User Guide. - // - // [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html - Ipv6NetmaskLength *int32 - - // The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. - Ipv6Pool *string - - // The tags to assign to the VPC. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVpcOutput struct { - - // Information about the VPC. - Vpc *types.Vpc - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go deleted file mode 100644 index e9484cd77..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Create a VPC Block Public Access (BPA) exclusion. A VPC BPA exclusion is a mode -// that can be applied to a single VPC or subnet that exempts it from the account’s -// BPA mode and will allow bidirectional or egress-only access. You can create BPA -// exclusions for VPCs and subnets even when BPA is not enabled on the account to -// ensure that there is no traffic disruption to the exclusions when VPC BPA is -// turned on. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -func (c *Client) CreateVpcBlockPublicAccessExclusion(ctx context.Context, params *CreateVpcBlockPublicAccessExclusionInput, optFns ...func(*Options)) (*CreateVpcBlockPublicAccessExclusionOutput, error) { - if params == nil { - params = &CreateVpcBlockPublicAccessExclusionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpcBlockPublicAccessExclusion", params, optFns, c.addOperationCreateVpcBlockPublicAccessExclusionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcBlockPublicAccessExclusionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcBlockPublicAccessExclusionInput struct { - - // The exclusion mode for internet gateway traffic. - // - // - allow-bidirectional : Allow all internet traffic to and from the excluded - // VPCs and subnets. - // - // - allow-egress : Allow outbound internet traffic from the excluded VPCs and - // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only - // applies when VPC Block Public Access is set to Bidirectional. - // - // This member is required. - InternetGatewayExclusionMode types.InternetGatewayExclusionMode - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // A subnet ID. - SubnetId *string - - // tag - The key/value combination of a tag assigned to the resource. Use the tag - // key in the filter name and the tag value as the filter value. For example, to - // find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - TagSpecifications []types.TagSpecification - - // A VPC ID. - VpcId *string - - noSmithyDocumentSerde -} - -type CreateVpcBlockPublicAccessExclusionOutput struct { - - // Details about an exclusion. - VpcBlockPublicAccessExclusion *types.VpcBlockPublicAccessExclusion - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcBlockPublicAccessExclusionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpcBlockPublicAccessExclusion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpcBlockPublicAccessExclusionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcBlockPublicAccessExclusion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpcBlockPublicAccessExclusion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpcBlockPublicAccessExclusion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpoint.go deleted file mode 100644 index d03d9ae4a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpoint.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a VPC endpoint. A VPC endpoint provides a private connection between -// the specified VPC and the specified endpoint service. You can use an endpoint -// service provided by Amazon Web Services, an Amazon Web Services Marketplace -// Partner, or another Amazon Web Services account. For more information, see the [Amazon Web Services PrivateLink User Guide]. -// -// [Amazon Web Services PrivateLink User Guide]: https://docs.aws.amazon.com/vpc/latest/privatelink/ -func (c *Client) CreateVpcEndpoint(ctx context.Context, params *CreateVpcEndpointInput, optFns ...func(*Options)) (*CreateVpcEndpointOutput, error) { - if params == nil { - params = &CreateVpcEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpoint", params, optFns, c.addOperationCreateVpcEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcEndpointInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // The DNS options for the endpoint. - DnsOptions *types.DnsOptionsSpecification - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address type for the endpoint. - IpAddressType types.IpAddressType - - // (Interface and gateway endpoints) A policy to attach to the endpoint that - // controls access to the service. The policy must be in valid JSON format. If this - // parameter is not specified, we attach a default policy that allows full access - // to the service. - PolicyDocument *string - - // (Interface endpoint) Indicates whether to associate a private hosted zone with - // the specified VPC. The private hosted zone contains a record set for the default - // public DNS name for the service for the Region (for example, - // kinesis.us-east-1.amazonaws.com ), which resolves to the private IP addresses of - // the endpoint network interfaces in the VPC. This enables you to make requests to - // the default public DNS name for the service instead of the public DNS names that - // are automatically generated by the VPC endpoint service. - // - // To use a private hosted zone, you must set the following VPC attributes to true - // : enableDnsHostnames and enableDnsSupport . Use ModifyVpcAttribute to set the VPC attributes. - PrivateDnsEnabled *bool - - // The Amazon Resource Name (ARN) of a resource configuration that will be - // associated with the VPC endpoint of type resource. - ResourceConfigurationArn *string - - // (Gateway endpoint) The route table IDs. - RouteTableIds []string - - // (Interface endpoint) The IDs of the security groups to associate with the - // endpoint network interfaces. If this parameter is not specified, we use the - // default security group for the VPC. - SecurityGroupIds []string - - // The name of the endpoint service. - ServiceName *string - - // The Amazon Resource Name (ARN) of a service network that will be associated - // with the VPC endpoint of type service-network. - ServiceNetworkArn *string - - // The Region where the service is hosted. The default is the current Region. - ServiceRegion *string - - // The subnet configurations for the endpoint. - SubnetConfigurations []types.SubnetConfiguration - - // (Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which - // to create endpoint network interfaces. For a Gateway Load Balancer endpoint, you - // can specify only one subnet. - SubnetIds []string - - // The tags to associate with the endpoint. - TagSpecifications []types.TagSpecification - - // The type of endpoint. - // - // Default: Gateway - VpcEndpointType types.VpcEndpointType - - noSmithyDocumentSerde -} - -type CreateVpcEndpointOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // Information about the endpoint. - VpcEndpoint *types.VpcEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpcEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpcEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpcEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpcEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpcEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointConnectionNotification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointConnectionNotification.go deleted file mode 100644 index 0d795a017..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointConnectionNotification.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a connection notification for a specified VPC endpoint or VPC endpoint -// service. A connection notification notifies you of specific endpoint events. You -// must create an SNS topic to receive notifications. For more information, see [Creating an Amazon SNS topic]in -// the Amazon SNS Developer Guide. -// -// You can create a connection notification for interface endpoints only. -// -// [Creating an Amazon SNS topic]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html -func (c *Client) CreateVpcEndpointConnectionNotification(ctx context.Context, params *CreateVpcEndpointConnectionNotificationInput, optFns ...func(*Options)) (*CreateVpcEndpointConnectionNotificationOutput, error) { - if params == nil { - params = &CreateVpcEndpointConnectionNotificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpointConnectionNotification", params, optFns, c.addOperationCreateVpcEndpointConnectionNotificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcEndpointConnectionNotificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcEndpointConnectionNotificationInput struct { - - // The endpoint events for which to receive notifications. Valid values are Accept - // , Connect , Delete , and Reject . - // - // This member is required. - ConnectionEvents []string - - // The ARN of the SNS topic for the notifications. - // - // This member is required. - ConnectionNotificationArn *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the endpoint service. - ServiceId *string - - // The ID of the endpoint. - VpcEndpointId *string - - noSmithyDocumentSerde -} - -type CreateVpcEndpointConnectionNotificationOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // Information about the notification. - ConnectionNotification *types.ConnectionNotification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcEndpointConnectionNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpcEndpointConnectionNotification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpcEndpointConnectionNotification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpcEndpointConnectionNotification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpcEndpointConnectionNotificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpointConnectionNotification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpcEndpointConnectionNotification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpcEndpointConnectionNotification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointServiceConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointServiceConfiguration.go deleted file mode 100644 index 27caf777f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcEndpointServiceConfiguration.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a VPC endpoint service to which service consumers (Amazon Web Services -// accounts, users, and IAM roles) can connect. -// -// Before you create an endpoint service, you must create one of the following for -// your service: -// -// - A [Network Load Balancer]. Service consumers connect to your service using an interface endpoint. -// -// - A [Gateway Load Balancer]. Service consumers connect to your service using a Gateway Load Balancer -// endpoint. -// -// If you set the private DNS name, you must prove that you own the private DNS -// domain name. -// -// For more information, see the [Amazon Web Services PrivateLink Guide]. -// -// [Gateway Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/ -// [Network Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/ -// [Amazon Web Services PrivateLink Guide]: https://docs.aws.amazon.com/vpc/latest/privatelink/ -func (c *Client) CreateVpcEndpointServiceConfiguration(ctx context.Context, params *CreateVpcEndpointServiceConfigurationInput, optFns ...func(*Options)) (*CreateVpcEndpointServiceConfigurationOutput, error) { - if params == nil { - params = &CreateVpcEndpointServiceConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpointServiceConfiguration", params, optFns, c.addOperationCreateVpcEndpointServiceConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcEndpointServiceConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcEndpointServiceConfigurationInput struct { - - // Indicates whether requests from service consumers to create an endpoint to your - // service must be accepted manually. - AcceptanceRequired *bool - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Amazon Resource Names (ARNs) of the Gateway Load Balancers. - GatewayLoadBalancerArns []string - - // The Amazon Resource Names (ARNs) of the Network Load Balancers. - NetworkLoadBalancerArns []string - - // (Interface endpoint configuration) The private DNS name to assign to the VPC - // endpoint service. - PrivateDnsName *string - - // The supported IP address types. The possible values are ipv4 and ipv6 . - SupportedIpAddressTypes []string - - // The Regions from which service consumers can access the service. - SupportedRegions []string - - // The tags to associate with the service. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVpcEndpointServiceConfigurationOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. - ClientToken *string - - // Information about the service configuration. - ServiceConfiguration *types.ServiceConfiguration - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcEndpointServiceConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpcEndpointServiceConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpcEndpointServiceConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpcEndpointServiceConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpointServiceConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpcEndpointServiceConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpcEndpointServiceConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcPeeringConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcPeeringConnection.go deleted file mode 100644 index cab19a1f6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpcPeeringConnection.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Requests a VPC peering connection between two VPCs: a requester VPC that you -// own and an accepter VPC with which to create the connection. The accepter VPC -// can belong to another Amazon Web Services account and can be in a different -// Region to the requester VPC. The requester VPC and accepter VPC cannot have -// overlapping CIDR blocks. -// -// Limitations and rules apply to a VPC peering connection. For more information, -// see the [VPC peering limitations]in the VPC Peering Guide. -// -// The owner of the accepter VPC must accept the peering request to activate the -// peering connection. The VPC peering connection request expires after 7 days, -// after which it cannot be accepted or rejected. -// -// If you create a VPC peering connection request between VPCs with overlapping -// CIDR blocks, the VPC peering connection has a status of failed . -// -// [VPC peering limitations]: https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations -func (c *Client) CreateVpcPeeringConnection(ctx context.Context, params *CreateVpcPeeringConnectionInput, optFns ...func(*Options)) (*CreateVpcPeeringConnectionOutput, error) { - if params == nil { - params = &CreateVpcPeeringConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpcPeeringConnection", params, optFns, c.addOperationCreateVpcPeeringConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpcPeeringConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateVpcPeeringConnectionInput struct { - - // The ID of the requester VPC. You must specify this parameter in the request. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Amazon Web Services account ID of the owner of the accepter VPC. - // - // Default: Your Amazon Web Services account ID - PeerOwnerId *string - - // The Region code for the accepter VPC, if the accepter VPC is located in a - // Region other than the Region in which you make the request. - // - // Default: The Region in which you make the request. - PeerRegion *string - - // The ID of the VPC with which you are creating the VPC peering connection. You - // must specify this parameter in the request. - PeerVpcId *string - - // The tags to assign to the peering connection. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type CreateVpcPeeringConnectionOutput struct { - - // Information about the VPC peering connection. - VpcPeeringConnection *types.VpcPeeringConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpcPeeringConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpcPeeringConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpcPeeringConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcPeeringConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpcPeeringConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpcPeeringConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnection.go deleted file mode 100644 index e60f03f00..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnection.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a VPN connection between an existing virtual private gateway or transit -// gateway and a customer gateway. The supported connection type is ipsec.1 . -// -// The response includes information that you need to give to your network -// administrator to configure your customer gateway. -// -// We strongly recommend that you use HTTPS when calling this operation because -// the response contains sensitive cryptographic information for configuring your -// customer gateway device. -// -// If you decide to shut down your VPN connection for any reason and later create -// a new VPN connection, you must reconfigure your customer gateway with the new -// information returned from this call. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) CreateVpnConnection(ctx context.Context, params *CreateVpnConnectionInput, optFns ...func(*Options)) (*CreateVpnConnectionOutput, error) { - if params == nil { - params = &CreateVpnConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpnConnection", params, optFns, c.addOperationCreateVpnConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpnConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateVpnConnection. -type CreateVpnConnectionInput struct { - - // The ID of the customer gateway. - // - // This member is required. - CustomerGatewayId *string - - // The type of VPN connection ( ipsec.1 ). - // - // This member is required. - Type *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The options for the VPN connection. - Options *types.VpnConnectionOptionsSpecification - - // Specifies the storage mode for the pre-shared key (PSK). Valid values are - // Standard " (stored in the Site-to-Site VPN service) or SecretsManager (stored - // in Amazon Web Services Secrets Manager). - PreSharedKeyStorage *string - - // The tags to apply to the VPN connection. - TagSpecifications []types.TagSpecification - - // The ID of the transit gateway. If you specify a transit gateway, you cannot - // specify a virtual private gateway. - TransitGatewayId *string - - // The ID of the virtual private gateway. If you specify a virtual private - // gateway, you cannot specify a transit gateway. - VpnGatewayId *string - - noSmithyDocumentSerde -} - -// Contains the output of CreateVpnConnection. -type CreateVpnConnectionOutput struct { - - // Information about the VPN connection. - VpnConnection *types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpnConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpnConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpnConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpnConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpnConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpnConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpnConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpnConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnectionRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnectionRoute.go deleted file mode 100644 index 17db95b79..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnConnectionRoute.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a static route associated with a VPN connection between an existing -// virtual private gateway and a VPN customer gateway. The static route allows -// traffic to be routed from the virtual private gateway to the VPN customer -// gateway. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) CreateVpnConnectionRoute(ctx context.Context, params *CreateVpnConnectionRouteInput, optFns ...func(*Options)) (*CreateVpnConnectionRouteOutput, error) { - if params == nil { - params = &CreateVpnConnectionRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpnConnectionRoute", params, optFns, c.addOperationCreateVpnConnectionRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpnConnectionRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateVpnConnectionRoute. -type CreateVpnConnectionRouteInput struct { - - // The CIDR block associated with the local subnet of the customer network. - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the VPN connection. - // - // This member is required. - VpnConnectionId *string - - noSmithyDocumentSerde -} - -type CreateVpnConnectionRouteOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpnConnectionRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpnConnectionRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpnConnectionRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpnConnectionRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpnConnectionRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpnConnectionRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpnConnectionRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpnConnectionRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnGateway.go deleted file mode 100644 index a5951f0a0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateVpnGateway.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a virtual private gateway. A virtual private gateway is the endpoint on -// the VPC side of your VPN connection. You can create a virtual private gateway -// before creating the VPC itself. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) CreateVpnGateway(ctx context.Context, params *CreateVpnGatewayInput, optFns ...func(*Options)) (*CreateVpnGatewayOutput, error) { - if params == nil { - params = &CreateVpnGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateVpnGateway", params, optFns, c.addOperationCreateVpnGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateVpnGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for CreateVpnGateway. -type CreateVpnGatewayInput struct { - - // The type of VPN connection this virtual private gateway supports. - // - // This member is required. - Type types.GatewayType - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're - // using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. - // - // Default: 64512 - AmazonSideAsn *int64 - - // The Availability Zone for the virtual private gateway. - AvailabilityZone *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the virtual private gateway. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -// Contains the output of CreateVpnGateway. -type CreateVpnGatewayOutput struct { - - // Information about the virtual private gateway. - VpnGateway *types.VpnGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateVpnGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpCreateVpnGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpCreateVpnGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateVpnGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateVpnGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpnGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateVpnGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateVpnGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCarrierGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCarrierGateway.go deleted file mode 100644 index 3a51bb375..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCarrierGateway.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a carrier gateway. -// -// If you do not delete the route that contains the carrier gateway as the Target, -// the route is a blackhole route. For information about how to delete a route, see -// [DeleteRoute]. -// -// [DeleteRoute]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteRoute.html -func (c *Client) DeleteCarrierGateway(ctx context.Context, params *DeleteCarrierGatewayInput, optFns ...func(*Options)) (*DeleteCarrierGatewayOutput, error) { - if params == nil { - params = &DeleteCarrierGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCarrierGateway", params, optFns, c.addOperationDeleteCarrierGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCarrierGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteCarrierGatewayInput struct { - - // The ID of the carrier gateway. - // - // This member is required. - CarrierGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteCarrierGatewayOutput struct { - - // Information about the carrier gateway. - CarrierGateway *types.CarrierGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCarrierGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteCarrierGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteCarrierGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCarrierGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCarrierGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCarrierGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCarrierGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCarrierGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnEndpoint.go deleted file mode 100644 index 7c1f54322..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnEndpoint.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Client VPN endpoint. You must disassociate all target -// networks before you can delete a Client VPN endpoint. -func (c *Client) DeleteClientVpnEndpoint(ctx context.Context, params *DeleteClientVpnEndpointInput, optFns ...func(*Options)) (*DeleteClientVpnEndpointOutput, error) { - if params == nil { - params = &DeleteClientVpnEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteClientVpnEndpoint", params, optFns, c.addOperationDeleteClientVpnEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteClientVpnEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteClientVpnEndpointInput struct { - - // The ID of the Client VPN to be deleted. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteClientVpnEndpointOutput struct { - - // The current state of the Client VPN endpoint. - Status *types.ClientVpnEndpointStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteClientVpnEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteClientVpnEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteClientVpnEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteClientVpnEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteClientVpnEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteClientVpnEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnRoute.go deleted file mode 100644 index 0568afee7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteClientVpnRoute.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a route from a Client VPN endpoint. You can only delete routes that you -// manually added using the CreateClientVpnRoute action. You cannot delete routes -// that were automatically added when associating a subnet. To remove routes that -// have been automatically added, disassociate the target subnet from the Client -// VPN endpoint. -func (c *Client) DeleteClientVpnRoute(ctx context.Context, params *DeleteClientVpnRouteInput, optFns ...func(*Options)) (*DeleteClientVpnRouteOutput, error) { - if params == nil { - params = &DeleteClientVpnRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteClientVpnRoute", params, optFns, c.addOperationDeleteClientVpnRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteClientVpnRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteClientVpnRouteInput struct { - - // The ID of the Client VPN endpoint from which the route is to be deleted. - // - // This member is required. - ClientVpnEndpointId *string - - // The IPv4 address range, in CIDR notation, of the route to be deleted. - // - // This member is required. - DestinationCidrBlock *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the target subnet used by the route. - TargetVpcSubnetId *string - - noSmithyDocumentSerde -} - -type DeleteClientVpnRouteOutput struct { - - // The current state of the route. - Status *types.ClientVpnRouteStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteClientVpnRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteClientVpnRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteClientVpnRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteClientVpnRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteClientVpnRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteClientVpnRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteClientVpnRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteClientVpnRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipCidr.go deleted file mode 100644 index 674d27637..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipCidr.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a range of customer-owned IP addresses. -func (c *Client) DeleteCoipCidr(ctx context.Context, params *DeleteCoipCidrInput, optFns ...func(*Options)) (*DeleteCoipCidrOutput, error) { - if params == nil { - params = &DeleteCoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCoipCidr", params, optFns, c.addOperationDeleteCoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteCoipCidrInput struct { - - // A customer-owned IP address range that you want to delete. - // - // This member is required. - Cidr *string - - // The ID of the customer-owned address pool. - // - // This member is required. - CoipPoolId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteCoipCidrOutput struct { - - // Information about a range of customer-owned IP addresses. - CoipCidr *types.CoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteCoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteCoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipPool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipPool.go deleted file mode 100644 index 6c4e01453..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCoipPool.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a pool of customer-owned IP (CoIP) addresses. -func (c *Client) DeleteCoipPool(ctx context.Context, params *DeleteCoipPoolInput, optFns ...func(*Options)) (*DeleteCoipPoolOutput, error) { - if params == nil { - params = &DeleteCoipPoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCoipPool", params, optFns, c.addOperationDeleteCoipPoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCoipPoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteCoipPoolInput struct { - - // The ID of the CoIP pool that you want to delete. - // - // This member is required. - CoipPoolId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteCoipPoolOutput struct { - - // Information about the CoIP address pool. - CoipPool *types.CoipPool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCoipPoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteCoipPool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteCoipPool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCoipPool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCoipPoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCoipPool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCoipPool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCoipPool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCustomerGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCustomerGateway.go deleted file mode 100644 index 99055b42c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteCustomerGateway.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified customer gateway. You must delete the VPN connection -// before you can delete the customer gateway. -func (c *Client) DeleteCustomerGateway(ctx context.Context, params *DeleteCustomerGatewayInput, optFns ...func(*Options)) (*DeleteCustomerGatewayOutput, error) { - if params == nil { - params = &DeleteCustomerGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCustomerGateway", params, optFns, c.addOperationDeleteCustomerGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCustomerGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteCustomerGateway. -type DeleteCustomerGatewayInput struct { - - // The ID of the customer gateway. - // - // This member is required. - CustomerGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteCustomerGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCustomerGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteCustomerGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteCustomerGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCustomerGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCustomerGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomerGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCustomerGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCustomerGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteDhcpOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteDhcpOptions.go deleted file mode 100644 index 6268c2344..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteDhcpOptions.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified set of DHCP options. You must disassociate the set of -// DHCP options before you can delete it. You can disassociate the set of DHCP -// options by associating either a new set of options or the default set of options -// with the VPC. -func (c *Client) DeleteDhcpOptions(ctx context.Context, params *DeleteDhcpOptionsInput, optFns ...func(*Options)) (*DeleteDhcpOptionsOutput, error) { - if params == nil { - params = &DeleteDhcpOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteDhcpOptions", params, optFns, c.addOperationDeleteDhcpOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteDhcpOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteDhcpOptionsInput struct { - - // The ID of the DHCP options set. - // - // This member is required. - DhcpOptionsId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteDhcpOptionsOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteDhcpOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteDhcpOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteDhcpOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDhcpOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteDhcpOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDhcpOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteDhcpOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteEgressOnlyInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteEgressOnlyInternetGateway.go deleted file mode 100644 index fba1d447d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteEgressOnlyInternetGateway.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an egress-only internet gateway. -func (c *Client) DeleteEgressOnlyInternetGateway(ctx context.Context, params *DeleteEgressOnlyInternetGatewayInput, optFns ...func(*Options)) (*DeleteEgressOnlyInternetGatewayOutput, error) { - if params == nil { - params = &DeleteEgressOnlyInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteEgressOnlyInternetGateway", params, optFns, c.addOperationDeleteEgressOnlyInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteEgressOnlyInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteEgressOnlyInternetGatewayInput struct { - - // The ID of the egress-only internet gateway. - // - // This member is required. - EgressOnlyInternetGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteEgressOnlyInternetGatewayOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnCode *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteEgressOnlyInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteEgressOnlyInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteEgressOnlyInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEgressOnlyInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteEgressOnlyInternetGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEgressOnlyInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteEgressOnlyInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteEgressOnlyInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFleets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFleets.go deleted file mode 100644 index 127a24e89..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFleets.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified EC2 Fleet request. -// -// After you delete an EC2 Fleet request, it launches no new instances. -// -// You must also specify whether a deleted EC2 Fleet request should terminate its -// instances. If you choose to terminate the instances, the EC2 Fleet request -// enters the deleted_terminating state. Otherwise, it enters the deleted_running -// state, and the instances continue to run until they are interrupted or you -// terminate them manually. -// -// A deleted instant fleet with running instances is not supported. When you -// delete an instant fleet, Amazon EC2 automatically terminates all its instances. -// For fleets with more than 1000 instances, the deletion request might fail. If -// your fleet has more than 1000 instances, first terminate most of the instances -// manually, leaving 1000 or fewer. Then delete the fleet, and the remaining -// instances will be terminated automatically. -// -// Restrictions -// -// - You can delete up to 25 fleets of type instant in a single request. -// -// - You can delete up to 100 fleets of type maintain or request in a single -// request. -// -// - You can delete up to 125 fleets in a single request, provided you do not -// exceed the quota for each fleet type, as specified above. -// -// - If you exceed the specified number of fleets to delete, no fleets are -// deleted. -// -// For more information, see [Delete an EC2 Fleet request and the instances in the fleet] in the Amazon EC2 User Guide. -// -// [Delete an EC2 Fleet request and the instances in the fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/delete-fleet.html -func (c *Client) DeleteFleets(ctx context.Context, params *DeleteFleetsInput, optFns ...func(*Options)) (*DeleteFleetsOutput, error) { - if params == nil { - params = &DeleteFleetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteFleets", params, optFns, c.addOperationDeleteFleetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteFleetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteFleetsInput struct { - - // The IDs of the EC2 Fleets. - // - // Constraints: In a single request, you can specify up to 25 instant fleet IDs - // and up to 100 maintain or request fleet IDs. - // - // This member is required. - FleetIds []string - - // Indicates whether to terminate the associated instances when the EC2 Fleet is - // deleted. The default is to terminate the instances. - // - // To let the instances continue to run after the EC2 Fleet is deleted, specify - // no-terminate-instances . Supported only for fleets of type maintain and request . - // - // For instant fleets, you cannot specify NoTerminateInstances . A deleted instant - // fleet with running instances is not supported. - // - // This member is required. - TerminateInstances *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteFleetsOutput struct { - - // Information about the EC2 Fleets that are successfully deleted. - SuccessfulFleetDeletions []types.DeleteFleetSuccessItem - - // Information about the EC2 Fleets that are not successfully deleted. - UnsuccessfulFleetDeletions []types.DeleteFleetErrorItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteFleets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteFleets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFleets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteFleetsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFleets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteFleets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteFleets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFlowLogs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFlowLogs.go deleted file mode 100644 index 13c315621..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFlowLogs.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes one or more flow logs. -func (c *Client) DeleteFlowLogs(ctx context.Context, params *DeleteFlowLogsInput, optFns ...func(*Options)) (*DeleteFlowLogsOutput, error) { - if params == nil { - params = &DeleteFlowLogsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteFlowLogs", params, optFns, c.addOperationDeleteFlowLogsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteFlowLogsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteFlowLogsInput struct { - - // One or more flow log IDs. - // - // Constraint: Maximum of 1000 flow log IDs. - // - // This member is required. - FlowLogIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteFlowLogsOutput struct { - - // Information about the flow logs that could not be deleted successfully. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteFlowLogsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteFlowLogs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteFlowLogs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFlowLogs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteFlowLogsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFlowLogs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteFlowLogs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteFlowLogs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFpgaImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFpgaImage.go deleted file mode 100644 index 2881935a2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteFpgaImage.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Amazon FPGA Image (AFI). -func (c *Client) DeleteFpgaImage(ctx context.Context, params *DeleteFpgaImageInput, optFns ...func(*Options)) (*DeleteFpgaImageOutput, error) { - if params == nil { - params = &DeleteFpgaImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteFpgaImage", params, optFns, c.addOperationDeleteFpgaImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteFpgaImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteFpgaImageInput struct { - - // The ID of the AFI. - // - // This member is required. - FpgaImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteFpgaImageOutput struct { - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteFpgaImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteFpgaImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteFpgaImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFpgaImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteFpgaImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFpgaImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteFpgaImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteFpgaImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceConnectEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceConnectEndpoint.go deleted file mode 100644 index 72acbf30a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceConnectEndpoint.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified EC2 Instance Connect Endpoint. -func (c *Client) DeleteInstanceConnectEndpoint(ctx context.Context, params *DeleteInstanceConnectEndpointInput, optFns ...func(*Options)) (*DeleteInstanceConnectEndpointOutput, error) { - if params == nil { - params = &DeleteInstanceConnectEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteInstanceConnectEndpoint", params, optFns, c.addOperationDeleteInstanceConnectEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteInstanceConnectEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteInstanceConnectEndpointInput struct { - - // The ID of the EC2 Instance Connect Endpoint to delete. - // - // This member is required. - InstanceConnectEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteInstanceConnectEndpointOutput struct { - - // Information about the EC2 Instance Connect Endpoint. - InstanceConnectEndpoint *types.Ec2InstanceConnectEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteInstanceConnectEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteInstanceConnectEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteInstanceConnectEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteInstanceConnectEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteInstanceConnectEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstanceConnectEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteInstanceConnectEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteInstanceConnectEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceEventWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceEventWindow.go deleted file mode 100644 index fd33b60e5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInstanceEventWindow.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified event window. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) DeleteInstanceEventWindow(ctx context.Context, params *DeleteInstanceEventWindowInput, optFns ...func(*Options)) (*DeleteInstanceEventWindowOutput, error) { - if params == nil { - params = &DeleteInstanceEventWindowInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteInstanceEventWindow", params, optFns, c.addOperationDeleteInstanceEventWindowMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteInstanceEventWindowOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteInstanceEventWindowInput struct { - - // The ID of the event window. - // - // This member is required. - InstanceEventWindowId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specify true to force delete the event window. Use the force delete parameter - // if the event window is currently associated with targets. - ForceDelete *bool - - noSmithyDocumentSerde -} - -type DeleteInstanceEventWindowOutput struct { - - // The state of the event window. - InstanceEventWindowState *types.InstanceEventWindowStateChange - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteInstanceEventWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteInstanceEventWindow"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteInstanceEventWindowValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstanceEventWindow(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteInstanceEventWindow(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteInstanceEventWindow", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInternetGateway.go deleted file mode 100644 index 5f31ceb9d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteInternetGateway.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified internet gateway. You must detach the internet gateway -// from the VPC before you can delete it. -func (c *Client) DeleteInternetGateway(ctx context.Context, params *DeleteInternetGatewayInput, optFns ...func(*Options)) (*DeleteInternetGatewayOutput, error) { - if params == nil { - params = &DeleteInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteInternetGateway", params, optFns, c.addOperationDeleteInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteInternetGatewayInput struct { - - // The ID of the internet gateway. - // - // This member is required. - InternetGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteInternetGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteInternetGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpam.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpam.go deleted file mode 100644 index 3871ff155..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpam.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an IPAM. Deleting an IPAM removes all monitored data associated with the -// IPAM including the historical data for CIDRs. -// -// For more information, see [Delete an IPAM] in the Amazon VPC IPAM User Guide. -// -// [Delete an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/delete-ipam.html -func (c *Client) DeleteIpam(ctx context.Context, params *DeleteIpamInput, optFns ...func(*Options)) (*DeleteIpamOutput, error) { - if params == nil { - params = &DeleteIpamInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteIpam", params, optFns, c.addOperationDeleteIpamMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteIpamOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteIpamInput struct { - - // The ID of the IPAM to delete. - // - // This member is required. - IpamId *string - - // Enables you to quickly delete an IPAM, private scopes, pools in private scopes, - // and any allocations in the pools in private scopes. You cannot delete the IPAM - // with this option if there is a pool in your public scope. If you use this - // option, IPAM does the following: - // - // - Deallocates any CIDRs allocated to VPC resources (such as VPCs) in pools in - // private scopes. - // - // No VPC resources are deleted as a result of enabling this option. The CIDR - // associated with the resource will no longer be allocated from an IPAM pool, but - // the CIDR itself will remain unchanged. - // - // - Deprovisions all IPv4 CIDRs provisioned to IPAM pools in private scopes. - // - // - Deletes all IPAM pools in private scopes. - // - // - Deletes all non-default private scopes in the IPAM. - // - // - Deletes the default public and private scopes and the IPAM. - Cascade *bool - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteIpamOutput struct { - - // Information about the results of the deletion. - Ipam *types.Ipam - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteIpamMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteIpam{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteIpam{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIpam"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteIpamValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIpam(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteIpam(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteIpam", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamExternalResourceVerificationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamExternalResourceVerificationToken.go deleted file mode 100644 index acc901e9f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamExternalResourceVerificationToken.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete a verification token. A verification token is an Amazon Web -// Services-generated random value that you can use to prove ownership of an -// external resource. For example, you can use a verification token to validate -// that you control a public IP address range when you bring an IP address range to -// Amazon Web Services (BYOIP). -func (c *Client) DeleteIpamExternalResourceVerificationToken(ctx context.Context, params *DeleteIpamExternalResourceVerificationTokenInput, optFns ...func(*Options)) (*DeleteIpamExternalResourceVerificationTokenOutput, error) { - if params == nil { - params = &DeleteIpamExternalResourceVerificationTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteIpamExternalResourceVerificationToken", params, optFns, c.addOperationDeleteIpamExternalResourceVerificationTokenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteIpamExternalResourceVerificationTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteIpamExternalResourceVerificationTokenInput struct { - - // The token ID. - // - // This member is required. - IpamExternalResourceVerificationTokenId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteIpamExternalResourceVerificationTokenOutput struct { - - // The verification token. - IpamExternalResourceVerificationToken *types.IpamExternalResourceVerificationToken - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteIpamExternalResourceVerificationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteIpamExternalResourceVerificationToken{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteIpamExternalResourceVerificationToken{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIpamExternalResourceVerificationToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteIpamExternalResourceVerificationTokenValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIpamExternalResourceVerificationToken(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteIpamExternalResourceVerificationToken(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteIpamExternalResourceVerificationToken", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamPool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamPool.go deleted file mode 100644 index 5f54a9f20..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamPool.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an IPAM pool. -// -// You cannot delete an IPAM pool if there are allocations in it or CIDRs -// provisioned to it. To release allocations, see [ReleaseIpamPoolAllocation]. To deprovision pool CIDRs, see [DeprovisionIpamPoolCidr] -// . -// -// For more information, see [Delete a pool] in the Amazon VPC IPAM User Guide. -// -// [ReleaseIpamPoolAllocation]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReleaseIpamPoolAllocation.html -// [Delete a pool]: https://docs.aws.amazon.com/vpc/latest/ipam/delete-pool-ipam.html -// [DeprovisionIpamPoolCidr]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeprovisionIpamPoolCidr.html -func (c *Client) DeleteIpamPool(ctx context.Context, params *DeleteIpamPoolInput, optFns ...func(*Options)) (*DeleteIpamPoolOutput, error) { - if params == nil { - params = &DeleteIpamPoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteIpamPool", params, optFns, c.addOperationDeleteIpamPoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteIpamPoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteIpamPoolInput struct { - - // The ID of the pool to delete. - // - // This member is required. - IpamPoolId *string - - // Enables you to quickly delete an IPAM pool and all resources within that pool, - // including provisioned CIDRs, allocations, and other pools. - // - // You can only use this option to delete pools in the private scope or pools in - // the public scope with a source resource. A source resource is a resource used to - // provision CIDRs to a resource planning pool. - Cascade *bool - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteIpamPoolOutput struct { - - // Information about the results of the deletion. - IpamPool *types.IpamPool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteIpamPoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteIpamPool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteIpamPool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIpamPool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteIpamPoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIpamPool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteIpamPool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteIpamPool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamResourceDiscovery.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamResourceDiscovery.go deleted file mode 100644 index 2b1ad0006..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamResourceDiscovery.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an IPAM resource discovery. A resource discovery is an IPAM component -// that enables IPAM to manage and monitor resources that belong to the owning -// account. -func (c *Client) DeleteIpamResourceDiscovery(ctx context.Context, params *DeleteIpamResourceDiscoveryInput, optFns ...func(*Options)) (*DeleteIpamResourceDiscoveryOutput, error) { - if params == nil { - params = &DeleteIpamResourceDiscoveryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteIpamResourceDiscovery", params, optFns, c.addOperationDeleteIpamResourceDiscoveryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteIpamResourceDiscoveryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteIpamResourceDiscoveryInput struct { - - // The IPAM resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteIpamResourceDiscoveryOutput struct { - - // The IPAM resource discovery. - IpamResourceDiscovery *types.IpamResourceDiscovery - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteIpamResourceDiscoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIpamResourceDiscovery"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteIpamResourceDiscoveryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIpamResourceDiscovery(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteIpamResourceDiscovery(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteIpamResourceDiscovery", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamScope.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamScope.go deleted file mode 100644 index 4f0c79ab2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteIpamScope.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete the scope for an IPAM. You cannot delete the default scopes. -// -// For more information, see [Delete a scope] in the Amazon VPC IPAM User Guide. -// -// [Delete a scope]: https://docs.aws.amazon.com/vpc/latest/ipam/delete-scope-ipam.html -func (c *Client) DeleteIpamScope(ctx context.Context, params *DeleteIpamScopeInput, optFns ...func(*Options)) (*DeleteIpamScopeOutput, error) { - if params == nil { - params = &DeleteIpamScopeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteIpamScope", params, optFns, c.addOperationDeleteIpamScopeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteIpamScopeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteIpamScopeInput struct { - - // The ID of the scope to delete. - // - // This member is required. - IpamScopeId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteIpamScopeOutput struct { - - // Information about the results of the deletion. - IpamScope *types.IpamScope - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteIpamScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteIpamScope{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteIpamScope{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIpamScope"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteIpamScopeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIpamScope(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteIpamScope(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteIpamScope", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteKeyPair.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteKeyPair.go deleted file mode 100644 index e8e64e0a1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteKeyPair.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified key pair, by removing the public key from Amazon EC2. -func (c *Client) DeleteKeyPair(ctx context.Context, params *DeleteKeyPairInput, optFns ...func(*Options)) (*DeleteKeyPairOutput, error) { - if params == nil { - params = &DeleteKeyPairInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteKeyPair", params, optFns, c.addOperationDeleteKeyPairMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteKeyPairOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteKeyPairInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the key pair. - KeyName *string - - // The ID of the key pair. - KeyPairId *string - - noSmithyDocumentSerde -} - -type DeleteKeyPairOutput struct { - - // The ID of the key pair. - KeyPairId *string - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteKeyPairMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteKeyPair{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteKeyPair{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteKeyPair"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKeyPair(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteKeyPair(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteKeyPair", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplate.go deleted file mode 100644 index 7d51783a6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplate.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a launch template. Deleting a launch template deletes all of its -// versions. -func (c *Client) DeleteLaunchTemplate(ctx context.Context, params *DeleteLaunchTemplateInput, optFns ...func(*Options)) (*DeleteLaunchTemplateOutput, error) { - if params == nil { - params = &DeleteLaunchTemplateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLaunchTemplate", params, optFns, c.addOperationDeleteLaunchTemplateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLaunchTemplateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLaunchTemplateInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateName *string - - noSmithyDocumentSerde -} - -type DeleteLaunchTemplateOutput struct { - - // Information about the launch template. - LaunchTemplate *types.LaunchTemplate - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLaunchTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLaunchTemplate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLaunchTemplate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLaunchTemplate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLaunchTemplate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplateVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplateVersions.go deleted file mode 100644 index 07b579ecb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLaunchTemplateVersions.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes one or more versions of a launch template. -// -// You can't delete the default version of a launch template; you must first -// assign a different version as the default. If the default version is the only -// version for the launch template, you must delete the entire launch template -// using DeleteLaunchTemplate. -// -// You can delete up to 200 launch template versions in a single request. To -// delete more than 200 versions in a single request, use DeleteLaunchTemplate, which deletes the -// launch template and all of its versions. -// -// For more information, see [Delete a launch template version] in the Amazon EC2 User Guide. -// -// [Delete a launch template version]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/delete-launch-template.html#delete-launch-template-version -func (c *Client) DeleteLaunchTemplateVersions(ctx context.Context, params *DeleteLaunchTemplateVersionsInput, optFns ...func(*Options)) (*DeleteLaunchTemplateVersionsOutput, error) { - if params == nil { - params = &DeleteLaunchTemplateVersionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLaunchTemplateVersions", params, optFns, c.addOperationDeleteLaunchTemplateVersionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLaunchTemplateVersionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLaunchTemplateVersionsInput struct { - - // The version numbers of one or more launch template versions to delete. You can - // specify up to 200 launch template version numbers. - // - // This member is required. - Versions []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateName *string - - noSmithyDocumentSerde -} - -type DeleteLaunchTemplateVersionsOutput struct { - - // Information about the launch template versions that were successfully deleted. - SuccessfullyDeletedLaunchTemplateVersions []types.DeleteLaunchTemplateVersionsResponseSuccessItem - - // Information about the launch template versions that could not be deleted. - UnsuccessfullyDeletedLaunchTemplateVersions []types.DeleteLaunchTemplateVersionsResponseErrorItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLaunchTemplateVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLaunchTemplateVersions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLaunchTemplateVersions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLaunchTemplateVersions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLaunchTemplateVersionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLaunchTemplateVersions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLaunchTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLaunchTemplateVersions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRoute.go deleted file mode 100644 index e8fb5add0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRoute.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route from the specified local gateway route table. -func (c *Client) DeleteLocalGatewayRoute(ctx context.Context, params *DeleteLocalGatewayRouteInput, optFns ...func(*Options)) (*DeleteLocalGatewayRouteOutput, error) { - if params == nil { - params = &DeleteLocalGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayRoute", params, optFns, c.addOperationDeleteLocalGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayRouteInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // The CIDR range for the route. This must match the CIDR for the route exactly. - DestinationCidrBlock *string - - // Use a prefix list in place of DestinationCidrBlock . You cannot use - // DestinationPrefixListId and DestinationCidrBlock in the same request. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayRouteOutput struct { - - // Information about the route. - Route *types.LocalGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTable.go deleted file mode 100644 index 95c9a6a7d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTable.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a local gateway route table. -func (c *Client) DeleteLocalGatewayRouteTable(ctx context.Context, params *DeleteLocalGatewayRouteTableInput, optFns ...func(*Options)) (*DeleteLocalGatewayRouteTableOutput, error) { - if params == nil { - params = &DeleteLocalGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayRouteTable", params, optFns, c.addOperationDeleteLocalGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayRouteTableInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayRouteTableOutput struct { - - // Information about the local gateway route table. - LocalGatewayRouteTable *types.LocalGatewayRouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go deleted file mode 100644 index 0418ae14c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a local gateway route table virtual interface group association. -func (c *Client) DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(ctx context.Context, params *DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput, optFns ...func(*Options)) (*DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput, error) { - if params == nil { - params = &DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation", params, optFns, c.addOperationDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput struct { - - // The ID of the local gateway route table virtual interface group association. - // - // This member is required. - LocalGatewayRouteTableVirtualInterfaceGroupAssociationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput struct { - - // Information about the association. - LocalGatewayRouteTableVirtualInterfaceGroupAssociation *types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVpcAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVpcAssociation.go deleted file mode 100644 index b64ff1d3f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayRouteTableVpcAssociation.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified association between a VPC and local gateway route table. -func (c *Client) DeleteLocalGatewayRouteTableVpcAssociation(ctx context.Context, params *DeleteLocalGatewayRouteTableVpcAssociationInput, optFns ...func(*Options)) (*DeleteLocalGatewayRouteTableVpcAssociationOutput, error) { - if params == nil { - params = &DeleteLocalGatewayRouteTableVpcAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayRouteTableVpcAssociation", params, optFns, c.addOperationDeleteLocalGatewayRouteTableVpcAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayRouteTableVpcAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayRouteTableVpcAssociationInput struct { - - // The ID of the association. - // - // This member is required. - LocalGatewayRouteTableVpcAssociationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayRouteTableVpcAssociationOutput struct { - - // Information about the association. - LocalGatewayRouteTableVpcAssociation *types.LocalGatewayRouteTableVpcAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayRouteTableVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayRouteTableVpcAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVpcAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayRouteTableVpcAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayRouteTableVpcAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTableVpcAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayRouteTableVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayRouteTableVpcAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterface.go deleted file mode 100644 index f74f6b5cd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterface.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified local gateway virtual interface. -func (c *Client) DeleteLocalGatewayVirtualInterface(ctx context.Context, params *DeleteLocalGatewayVirtualInterfaceInput, optFns ...func(*Options)) (*DeleteLocalGatewayVirtualInterfaceOutput, error) { - if params == nil { - params = &DeleteLocalGatewayVirtualInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayVirtualInterface", params, optFns, c.addOperationDeleteLocalGatewayVirtualInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayVirtualInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayVirtualInterfaceInput struct { - - // The ID of the local virtual interface to delete. - // - // This member is required. - LocalGatewayVirtualInterfaceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayVirtualInterfaceOutput struct { - - // Information about the deleted local gateway virtual interface. - LocalGatewayVirtualInterface *types.LocalGatewayVirtualInterface - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayVirtualInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayVirtualInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayVirtualInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayVirtualInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayVirtualInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayVirtualInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayVirtualInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterfaceGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterfaceGroup.go deleted file mode 100644 index 134948014..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteLocalGatewayVirtualInterfaceGroup.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete the specified local gateway interface group. -func (c *Client) DeleteLocalGatewayVirtualInterfaceGroup(ctx context.Context, params *DeleteLocalGatewayVirtualInterfaceGroupInput, optFns ...func(*Options)) (*DeleteLocalGatewayVirtualInterfaceGroupOutput, error) { - if params == nil { - params = &DeleteLocalGatewayVirtualInterfaceGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteLocalGatewayVirtualInterfaceGroup", params, optFns, c.addOperationDeleteLocalGatewayVirtualInterfaceGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteLocalGatewayVirtualInterfaceGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteLocalGatewayVirtualInterfaceGroupInput struct { - - // The ID of the local gateway virtual interface group to delete. - // - // This member is required. - LocalGatewayVirtualInterfaceGroupId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteLocalGatewayVirtualInterfaceGroupOutput struct { - - // Information about the deleted local gateway virtual interface group. - LocalGatewayVirtualInterfaceGroup *types.LocalGatewayVirtualInterfaceGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteLocalGatewayVirtualInterfaceGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteLocalGatewayVirtualInterfaceGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterfaceGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLocalGatewayVirtualInterfaceGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteLocalGatewayVirtualInterfaceGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocalGatewayVirtualInterfaceGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteLocalGatewayVirtualInterfaceGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteLocalGatewayVirtualInterfaceGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteManagedPrefixList.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteManagedPrefixList.go deleted file mode 100644 index b06035076..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteManagedPrefixList.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified managed prefix list. You must first remove all references -// to the prefix list in your resources. -func (c *Client) DeleteManagedPrefixList(ctx context.Context, params *DeleteManagedPrefixListInput, optFns ...func(*Options)) (*DeleteManagedPrefixListOutput, error) { - if params == nil { - params = &DeleteManagedPrefixListInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteManagedPrefixList", params, optFns, c.addOperationDeleteManagedPrefixListMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteManagedPrefixListOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteManagedPrefixListInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteManagedPrefixListOutput struct { - - // Information about the prefix list. - PrefixList *types.ManagedPrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteManagedPrefixListMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteManagedPrefixList"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteManagedPrefixListValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteManagedPrefixList(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteManagedPrefixList(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteManagedPrefixList", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNatGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNatGateway.go deleted file mode 100644 index be0b89790..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNatGateway.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified NAT gateway. Deleting a public NAT gateway disassociates -// its Elastic IP address, but does not release the address from your account. -// Deleting a NAT gateway does not delete any NAT gateway routes in your route -// tables. -func (c *Client) DeleteNatGateway(ctx context.Context, params *DeleteNatGatewayInput, optFns ...func(*Options)) (*DeleteNatGatewayOutput, error) { - if params == nil { - params = &DeleteNatGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNatGateway", params, optFns, c.addOperationDeleteNatGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNatGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNatGatewayInput struct { - - // The ID of the NAT gateway. - // - // This member is required. - NatGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNatGatewayOutput struct { - - // The ID of the NAT gateway. - NatGatewayId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNatGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNatGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNatGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNatGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNatGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNatGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNatGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNatGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAcl.go deleted file mode 100644 index a73d44b09..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAcl.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified network ACL. You can't delete the ACL if it's associated -// with any subnets. You can't delete the default network ACL. -func (c *Client) DeleteNetworkAcl(ctx context.Context, params *DeleteNetworkAclInput, optFns ...func(*Options)) (*DeleteNetworkAclOutput, error) { - if params == nil { - params = &DeleteNetworkAclInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkAcl", params, optFns, c.addOperationDeleteNetworkAclMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkAclOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkAclInput struct { - - // The ID of the network ACL. - // - // This member is required. - NetworkAclId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkAclOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkAclMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkAcl{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkAcl{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkAcl"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkAclValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkAcl(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkAcl(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkAcl", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAclEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAclEntry.go deleted file mode 100644 index e2818bf9a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkAclEntry.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified ingress or egress entry (rule) from the specified network -// ACL. -func (c *Client) DeleteNetworkAclEntry(ctx context.Context, params *DeleteNetworkAclEntryInput, optFns ...func(*Options)) (*DeleteNetworkAclEntryOutput, error) { - if params == nil { - params = &DeleteNetworkAclEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkAclEntry", params, optFns, c.addOperationDeleteNetworkAclEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkAclEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkAclEntryInput struct { - - // Indicates whether the rule is an egress rule. - // - // This member is required. - Egress *bool - - // The ID of the network ACL. - // - // This member is required. - NetworkAclId *string - - // The rule number of the entry to delete. - // - // This member is required. - RuleNumber *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkAclEntryOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkAclEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkAclEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkAclEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkAclEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkAclEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkAclEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScope.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScope.go deleted file mode 100644 index d8de77338..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScope.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Network Access Scope. -func (c *Client) DeleteNetworkInsightsAccessScope(ctx context.Context, params *DeleteNetworkInsightsAccessScopeInput, optFns ...func(*Options)) (*DeleteNetworkInsightsAccessScopeOutput, error) { - if params == nil { - params = &DeleteNetworkInsightsAccessScopeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInsightsAccessScope", params, optFns, c.addOperationDeleteNetworkInsightsAccessScopeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInsightsAccessScopeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkInsightsAccessScopeInput struct { - - // The ID of the Network Access Scope. - // - // This member is required. - NetworkInsightsAccessScopeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkInsightsAccessScopeOutput struct { - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInsightsAccessScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInsightsAccessScope{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInsightsAccessScope{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInsightsAccessScope"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInsightsAccessScopeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInsightsAccessScope(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInsightsAccessScope(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInsightsAccessScope", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScopeAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScopeAnalysis.go deleted file mode 100644 index 4ca144ef1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAccessScopeAnalysis.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Network Access Scope analysis. -func (c *Client) DeleteNetworkInsightsAccessScopeAnalysis(ctx context.Context, params *DeleteNetworkInsightsAccessScopeAnalysisInput, optFns ...func(*Options)) (*DeleteNetworkInsightsAccessScopeAnalysisOutput, error) { - if params == nil { - params = &DeleteNetworkInsightsAccessScopeAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInsightsAccessScopeAnalysis", params, optFns, c.addOperationDeleteNetworkInsightsAccessScopeAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInsightsAccessScopeAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkInsightsAccessScopeAnalysisInput struct { - - // The ID of the Network Access Scope analysis. - // - // This member is required. - NetworkInsightsAccessScopeAnalysisId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkInsightsAccessScopeAnalysisOutput struct { - - // The ID of the Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysisId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInsightsAccessScopeAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInsightsAccessScopeAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInsightsAccessScopeAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInsightsAccessScopeAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInsightsAccessScopeAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInsightsAccessScopeAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInsightsAccessScopeAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInsightsAccessScopeAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAnalysis.go deleted file mode 100644 index 09f89e155..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsAnalysis.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified network insights analysis. -func (c *Client) DeleteNetworkInsightsAnalysis(ctx context.Context, params *DeleteNetworkInsightsAnalysisInput, optFns ...func(*Options)) (*DeleteNetworkInsightsAnalysisOutput, error) { - if params == nil { - params = &DeleteNetworkInsightsAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInsightsAnalysis", params, optFns, c.addOperationDeleteNetworkInsightsAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInsightsAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkInsightsAnalysisInput struct { - - // The ID of the network insights analysis. - // - // This member is required. - NetworkInsightsAnalysisId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkInsightsAnalysisOutput struct { - - // The ID of the network insights analysis. - NetworkInsightsAnalysisId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInsightsAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInsightsAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInsightsAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInsightsAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInsightsAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInsightsAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInsightsAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInsightsAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsPath.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsPath.go deleted file mode 100644 index a041f51ac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInsightsPath.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified path. -func (c *Client) DeleteNetworkInsightsPath(ctx context.Context, params *DeleteNetworkInsightsPathInput, optFns ...func(*Options)) (*DeleteNetworkInsightsPathOutput, error) { - if params == nil { - params = &DeleteNetworkInsightsPathInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInsightsPath", params, optFns, c.addOperationDeleteNetworkInsightsPathMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInsightsPathOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNetworkInsightsPathInput struct { - - // The ID of the path. - // - // This member is required. - NetworkInsightsPathId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkInsightsPathOutput struct { - - // The ID of the path. - NetworkInsightsPathId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInsightsPathMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInsightsPath{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInsightsPath{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInsightsPath"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInsightsPathValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInsightsPath(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInsightsPath(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInsightsPath", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterface.go deleted file mode 100644 index a6b72b5ad..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterface.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified network interface. You must detach the network interface -// before you can delete it. -func (c *Client) DeleteNetworkInterface(ctx context.Context, params *DeleteNetworkInterfaceInput, optFns ...func(*Options)) (*DeleteNetworkInterfaceOutput, error) { - if params == nil { - params = &DeleteNetworkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInterface", params, optFns, c.addOperationDeleteNetworkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteNetworkInterface. -type DeleteNetworkInterfaceInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteNetworkInterfaceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterfacePermission.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterfacePermission.go deleted file mode 100644 index 18942c811..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteNetworkInterfacePermission.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a permission for a network interface. By default, you cannot delete the -// permission if the account for which you're removing the permission has attached -// the network interface to an instance. However, you can force delete the -// permission, regardless of any attachment. -func (c *Client) DeleteNetworkInterfacePermission(ctx context.Context, params *DeleteNetworkInterfacePermissionInput, optFns ...func(*Options)) (*DeleteNetworkInterfacePermissionOutput, error) { - if params == nil { - params = &DeleteNetworkInterfacePermissionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNetworkInterfacePermission", params, optFns, c.addOperationDeleteNetworkInterfacePermissionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNetworkInterfacePermissionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionInput struct { - - // The ID of the network interface permission. - // - // This member is required. - NetworkInterfacePermissionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specify true to remove the permission even if the network interface is attached - // to an instance. - Force *bool - - noSmithyDocumentSerde -} - -// Contains the output for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionOutput struct { - - // Returns true if the request succeeds, otherwise returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNetworkInterfacePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteNetworkInterfacePermission{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteNetworkInterfacePermission{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNetworkInterfacePermission"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNetworkInterfacePermissionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNetworkInterfacePermission(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNetworkInterfacePermission(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNetworkInterfacePermission", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePlacementGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePlacementGroup.go deleted file mode 100644 index 265e1078e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePlacementGroup.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified placement group. You must terminate all instances in the -// placement group before you can delete the placement group. For more information, -// see [Placement groups]in the Amazon EC2 User Guide. -// -// [Placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html -func (c *Client) DeletePlacementGroup(ctx context.Context, params *DeletePlacementGroupInput, optFns ...func(*Options)) (*DeletePlacementGroupOutput, error) { - if params == nil { - params = &DeletePlacementGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeletePlacementGroup", params, optFns, c.addOperationDeletePlacementGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeletePlacementGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeletePlacementGroupInput struct { - - // The name of the placement group. - // - // This member is required. - GroupName *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeletePlacementGroupOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeletePlacementGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeletePlacementGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeletePlacementGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePlacementGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeletePlacementGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePlacementGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeletePlacementGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeletePlacementGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePublicIpv4Pool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePublicIpv4Pool.go deleted file mode 100644 index 0932f9685..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeletePublicIpv4Pool.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete a public IPv4 pool. A public IPv4 pool is an EC2 IP address pool -// required for the public IPv4 CIDRs that you own and bring to Amazon Web Services -// to manage with IPAM. IPv6 addresses you bring to Amazon Web Services, however, -// use IPAM pools only. -func (c *Client) DeletePublicIpv4Pool(ctx context.Context, params *DeletePublicIpv4PoolInput, optFns ...func(*Options)) (*DeletePublicIpv4PoolOutput, error) { - if params == nil { - params = &DeletePublicIpv4PoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeletePublicIpv4Pool", params, optFns, c.addOperationDeletePublicIpv4PoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeletePublicIpv4PoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeletePublicIpv4PoolInput struct { - - // The ID of the public IPv4 pool you want to delete. - // - // This member is required. - PoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Availability Zone (AZ) or Local Zone (LZ) network border group that the - // resource that the IP address is assigned to is in. Defaults to an AZ network - // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon - // EC2 User Guide. - // - // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - NetworkBorderGroup *string - - noSmithyDocumentSerde -} - -type DeletePublicIpv4PoolOutput struct { - - // Information about the result of deleting the public IPv4 pool. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeletePublicIpv4PoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeletePublicIpv4Pool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeletePublicIpv4Pool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePublicIpv4Pool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeletePublicIpv4PoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePublicIpv4Pool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeletePublicIpv4Pool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeletePublicIpv4Pool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteQueuedReservedInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteQueuedReservedInstances.go deleted file mode 100644 index 80704b3a1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteQueuedReservedInstances.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the queued purchases for the specified Reserved Instances. -func (c *Client) DeleteQueuedReservedInstances(ctx context.Context, params *DeleteQueuedReservedInstancesInput, optFns ...func(*Options)) (*DeleteQueuedReservedInstancesOutput, error) { - if params == nil { - params = &DeleteQueuedReservedInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteQueuedReservedInstances", params, optFns, c.addOperationDeleteQueuedReservedInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteQueuedReservedInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteQueuedReservedInstancesInput struct { - - // The IDs of the Reserved Instances. - // - // This member is required. - ReservedInstancesIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteQueuedReservedInstancesOutput struct { - - // Information about the queued purchases that could not be deleted. - FailedQueuedPurchaseDeletions []types.FailedQueuedPurchaseDeletion - - // Information about the queued purchases that were successfully deleted. - SuccessfulQueuedPurchaseDeletions []types.SuccessfulQueuedPurchaseDeletion - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteQueuedReservedInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteQueuedReservedInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteQueuedReservedInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteQueuedReservedInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteQueuedReservedInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQueuedReservedInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteQueuedReservedInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteQueuedReservedInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRoute.go deleted file mode 100644 index 46460e9ec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRoute.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route from the specified route table. -func (c *Client) DeleteRoute(ctx context.Context, params *DeleteRouteInput, optFns ...func(*Options)) (*DeleteRouteOutput, error) { - if params == nil { - params = &DeleteRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteRoute", params, optFns, c.addOperationDeleteRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteRouteInput struct { - - // The ID of the route table. - // - // This member is required. - RouteTableId *string - - // The IPv4 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationCidrBlock *string - - // The IPv6 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationIpv6CidrBlock *string - - // The ID of the prefix list for the route. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteRouteOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServer.go deleted file mode 100644 index 5d858f4c5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServer.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route server. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) DeleteRouteServer(ctx context.Context, params *DeleteRouteServerInput, optFns ...func(*Options)) (*DeleteRouteServerOutput, error) { - if params == nil { - params = &DeleteRouteServerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteRouteServer", params, optFns, c.addOperationDeleteRouteServerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteRouteServerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteRouteServerInput struct { - - // The ID of the route server to delete. - // - // This member is required. - RouteServerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteRouteServerOutput struct { - - // Information about the deleted route server. - RouteServer *types.RouteServer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteRouteServerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteRouteServer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteRouteServer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRouteServer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteRouteServerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRouteServer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteRouteServer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteRouteServer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerEndpoint.go deleted file mode 100644 index a5f1a0fca..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerEndpoint.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route server endpoint. -// -// A route server endpoint is an Amazon Web Services-managed component inside a -// subnet that facilitates [BGP (Border Gateway Protocol)]connections between your route server and your BGP -// peers. -// -// [BGP (Border Gateway Protocol)]: https://en.wikipedia.org/wiki/Border_Gateway_Protocol -func (c *Client) DeleteRouteServerEndpoint(ctx context.Context, params *DeleteRouteServerEndpointInput, optFns ...func(*Options)) (*DeleteRouteServerEndpointOutput, error) { - if params == nil { - params = &DeleteRouteServerEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteRouteServerEndpoint", params, optFns, c.addOperationDeleteRouteServerEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteRouteServerEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteRouteServerEndpointInput struct { - - // The ID of the route server endpoint to delete. - // - // This member is required. - RouteServerEndpointId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteRouteServerEndpointOutput struct { - - // Information about the deleted route server endpoint. - RouteServerEndpoint *types.RouteServerEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteRouteServerEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteRouteServerEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteRouteServerEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRouteServerEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteRouteServerEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRouteServerEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteRouteServerEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteRouteServerEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerPeer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerPeer.go deleted file mode 100644 index e8cb7ad8d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteServerPeer.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified BGP peer from a route server. -// -// A route server peer is a session between a route server endpoint and the device -// deployed in Amazon Web Services (such as a firewall appliance or other network -// security function running on an EC2 instance). The device must meet these -// requirements: -// -// - Have an elastic network interface in the VPC -// -// - Support BGP (Border Gateway Protocol) -// -// - Can initiate BGP sessions -func (c *Client) DeleteRouteServerPeer(ctx context.Context, params *DeleteRouteServerPeerInput, optFns ...func(*Options)) (*DeleteRouteServerPeerOutput, error) { - if params == nil { - params = &DeleteRouteServerPeerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteRouteServerPeer", params, optFns, c.addOperationDeleteRouteServerPeerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteRouteServerPeerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteRouteServerPeerInput struct { - - // The ID of the route server peer to delete. - // - // This member is required. - RouteServerPeerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteRouteServerPeerOutput struct { - - // Information about the deleted route server peer. - RouteServerPeer *types.RouteServerPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteRouteServerPeerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteRouteServerPeer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteRouteServerPeer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRouteServerPeer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteRouteServerPeerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRouteServerPeer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteRouteServerPeer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteRouteServerPeer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteTable.go deleted file mode 100644 index 81227066a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteRouteTable.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route table. You must disassociate the route table from -// any subnets before you can delete it. You can't delete the main route table. -func (c *Client) DeleteRouteTable(ctx context.Context, params *DeleteRouteTableInput, optFns ...func(*Options)) (*DeleteRouteTableOutput, error) { - if params == nil { - params = &DeleteRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteRouteTable", params, optFns, c.addOperationDeleteRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteRouteTableInput struct { - - // The ID of the route table. - // - // This member is required. - RouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteRouteTableOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSecurityGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSecurityGroup.go deleted file mode 100644 index 4422b1543..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSecurityGroup.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a security group. -// -// If you attempt to delete a security group that is associated with an instance -// or network interface, is referenced by another security group in the same VPC, -// or has a VPC association, the operation fails with DependencyViolation . -func (c *Client) DeleteSecurityGroup(ctx context.Context, params *DeleteSecurityGroupInput, optFns ...func(*Options)) (*DeleteSecurityGroupOutput, error) { - if params == nil { - params = &DeleteSecurityGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSecurityGroup", params, optFns, c.addOperationDeleteSecurityGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSecurityGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteSecurityGroupInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the security group. - GroupId *string - - // [Default VPC] The name of the security group. You can specify either the - // security group name or the security group ID. For security groups in a - // nondefault VPC, you must specify the security group ID. - GroupName *string - - noSmithyDocumentSerde -} - -type DeleteSecurityGroupOutput struct { - - // The ID of the deleted security group. - GroupId *string - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSecurityGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteSecurityGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteSecurityGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSecurityGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSecurityGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSecurityGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSecurityGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSnapshot.go deleted file mode 100644 index f60ed99a0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSnapshot.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified snapshot. -// -// When you make periodic snapshots of a volume, the snapshots are incremental, -// and only the blocks on the device that have changed since your last snapshot are -// saved in the new snapshot. When you delete a snapshot, only the data not needed -// for any other snapshot is removed. So regardless of which prior snapshots have -// been deleted, all active snapshots will have access to all the information -// needed to restore the volume. -// -// You cannot delete a snapshot of the root device of an EBS volume used by a -// registered AMI. You must first deregister the AMI before you can delete the -// snapshot. -// -// For more information, see [Delete an Amazon EBS snapshot] in the Amazon EBS User Guide. -// -// [Delete an Amazon EBS snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-deleting-snapshot.html -func (c *Client) DeleteSnapshot(ctx context.Context, params *DeleteSnapshotInput, optFns ...func(*Options)) (*DeleteSnapshotOutput, error) { - if params == nil { - params = &DeleteSnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSnapshot", params, optFns, c.addOperationDeleteSnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteSnapshotInput struct { - - // The ID of the EBS snapshot. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteSnapshotOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteSnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteSnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteSnapshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSnapshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSpotDatafeedSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSpotDatafeedSubscription.go deleted file mode 100644 index fc1fef6f5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSpotDatafeedSubscription.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the data feed for Spot Instances. -func (c *Client) DeleteSpotDatafeedSubscription(ctx context.Context, params *DeleteSpotDatafeedSubscriptionInput, optFns ...func(*Options)) (*DeleteSpotDatafeedSubscriptionOutput, error) { - if params == nil { - params = &DeleteSpotDatafeedSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSpotDatafeedSubscription", params, optFns, c.addOperationDeleteSpotDatafeedSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSpotDatafeedSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteSpotDatafeedSubscription. -type DeleteSpotDatafeedSubscriptionInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteSpotDatafeedSubscriptionOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSpotDatafeedSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSpotDatafeedSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSpotDatafeedSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSpotDatafeedSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSpotDatafeedSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnet.go deleted file mode 100644 index 192472bb5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnet.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified subnet. You must terminate all running instances in the -// subnet before you can delete the subnet. -func (c *Client) DeleteSubnet(ctx context.Context, params *DeleteSubnetInput, optFns ...func(*Options)) (*DeleteSubnetOutput, error) { - if params == nil { - params = &DeleteSubnetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSubnet", params, optFns, c.addOperationDeleteSubnetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSubnetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteSubnetInput struct { - - // The ID of the subnet. - // - // This member is required. - SubnetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteSubnetOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSubnetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteSubnet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteSubnet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSubnet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteSubnetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSubnet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSubnet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSubnet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnetCidrReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnetCidrReservation.go deleted file mode 100644 index 928b556d9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteSubnetCidrReservation.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a subnet CIDR reservation. -func (c *Client) DeleteSubnetCidrReservation(ctx context.Context, params *DeleteSubnetCidrReservationInput, optFns ...func(*Options)) (*DeleteSubnetCidrReservationOutput, error) { - if params == nil { - params = &DeleteSubnetCidrReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSubnetCidrReservation", params, optFns, c.addOperationDeleteSubnetCidrReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSubnetCidrReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteSubnetCidrReservationInput struct { - - // The ID of the subnet CIDR reservation. - // - // This member is required. - SubnetCidrReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteSubnetCidrReservationOutput struct { - - // Information about the deleted subnet CIDR reservation. - DeletedSubnetCidrReservation *types.SubnetCidrReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSubnetCidrReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteSubnetCidrReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteSubnetCidrReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSubnetCidrReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteSubnetCidrReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSubnetCidrReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSubnetCidrReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSubnetCidrReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTags.go deleted file mode 100644 index b08c304a6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTags.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified set of tags from the specified set of resources. -// -// To list the current tags, use DescribeTags. For more information about tags, see [Tag your Amazon EC2 resources] in the -// Amazon Elastic Compute Cloud User Guide. -// -// [Tag your Amazon EC2 resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html -func (c *Client) DeleteTags(ctx context.Context, params *DeleteTagsInput, optFns ...func(*Options)) (*DeleteTagsOutput, error) { - if params == nil { - params = &DeleteTagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTags", params, optFns, c.addOperationDeleteTagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTagsInput struct { - - // The IDs of the resources, separated by spaces. - // - // Constraints: Up to 1000 resource IDs. We recommend breaking up this request - // into smaller batches. - // - // This member is required. - Resources []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to delete. Specify a tag key and an optional tag value to delete - // specific tags. If you specify a tag key without a tag value, we delete any tag - // with this key regardless of its value. If you specify a tag key with an empty - // string as the tag value, we delete the tag only if its value is an empty string. - // - // If you omit this parameter, we delete all user-defined tags for the specified - // resources. We do not delete Amazon Web Services-generated tags (tags that have - // the aws: prefix). - // - // Constraints: Up to 1000 tags. - Tags []types.Tag - - noSmithyDocumentSerde -} - -type DeleteTagsOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTagsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilter.go deleted file mode 100644 index 1244ed6ec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilter.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Traffic Mirror filter. -// -// You cannot delete a Traffic Mirror filter that is in use by a Traffic Mirror -// session. -func (c *Client) DeleteTrafficMirrorFilter(ctx context.Context, params *DeleteTrafficMirrorFilterInput, optFns ...func(*Options)) (*DeleteTrafficMirrorFilterOutput, error) { - if params == nil { - params = &DeleteTrafficMirrorFilterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTrafficMirrorFilter", params, optFns, c.addOperationDeleteTrafficMirrorFilterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTrafficMirrorFilterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTrafficMirrorFilterInput struct { - - // The ID of the Traffic Mirror filter. - // - // This member is required. - TrafficMirrorFilterId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTrafficMirrorFilterOutput struct { - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTrafficMirrorFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTrafficMirrorFilter{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTrafficMirrorFilter{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrafficMirrorFilter"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTrafficMirrorFilterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrafficMirrorFilter(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTrafficMirrorFilter(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTrafficMirrorFilter", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilterRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilterRule.go deleted file mode 100644 index 37ba2eee5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorFilterRule.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Traffic Mirror rule. -func (c *Client) DeleteTrafficMirrorFilterRule(ctx context.Context, params *DeleteTrafficMirrorFilterRuleInput, optFns ...func(*Options)) (*DeleteTrafficMirrorFilterRuleOutput, error) { - if params == nil { - params = &DeleteTrafficMirrorFilterRuleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTrafficMirrorFilterRule", params, optFns, c.addOperationDeleteTrafficMirrorFilterRuleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTrafficMirrorFilterRuleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTrafficMirrorFilterRuleInput struct { - - // The ID of the Traffic Mirror rule. - // - // This member is required. - TrafficMirrorFilterRuleId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTrafficMirrorFilterRuleOutput struct { - - // The ID of the deleted Traffic Mirror rule. - TrafficMirrorFilterRuleId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTrafficMirrorFilterRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrafficMirrorFilterRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTrafficMirrorFilterRuleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrafficMirrorFilterRule(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTrafficMirrorFilterRule(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTrafficMirrorFilterRule", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorSession.go deleted file mode 100644 index 5da049274..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorSession.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Traffic Mirror session. -func (c *Client) DeleteTrafficMirrorSession(ctx context.Context, params *DeleteTrafficMirrorSessionInput, optFns ...func(*Options)) (*DeleteTrafficMirrorSessionOutput, error) { - if params == nil { - params = &DeleteTrafficMirrorSessionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTrafficMirrorSession", params, optFns, c.addOperationDeleteTrafficMirrorSessionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTrafficMirrorSessionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTrafficMirrorSessionInput struct { - - // The ID of the Traffic Mirror session. - // - // This member is required. - TrafficMirrorSessionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTrafficMirrorSessionOutput struct { - - // The ID of the deleted Traffic Mirror session. - TrafficMirrorSessionId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTrafficMirrorSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrafficMirrorSession"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTrafficMirrorSessionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrafficMirrorSession(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTrafficMirrorSession(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTrafficMirrorSession", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorTarget.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorTarget.go deleted file mode 100644 index 8d989afe7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTrafficMirrorTarget.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Traffic Mirror target. -// -// You cannot delete a Traffic Mirror target that is in use by a Traffic Mirror -// session. -func (c *Client) DeleteTrafficMirrorTarget(ctx context.Context, params *DeleteTrafficMirrorTargetInput, optFns ...func(*Options)) (*DeleteTrafficMirrorTargetOutput, error) { - if params == nil { - params = &DeleteTrafficMirrorTargetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTrafficMirrorTarget", params, optFns, c.addOperationDeleteTrafficMirrorTargetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTrafficMirrorTargetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTrafficMirrorTargetInput struct { - - // The ID of the Traffic Mirror target. - // - // This member is required. - TrafficMirrorTargetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTrafficMirrorTargetOutput struct { - - // The ID of the deleted Traffic Mirror target. - TrafficMirrorTargetId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTrafficMirrorTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTrafficMirrorTarget{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTrafficMirrorTarget{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrafficMirrorTarget"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTrafficMirrorTargetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrafficMirrorTarget(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTrafficMirrorTarget(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTrafficMirrorTarget", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGateway.go deleted file mode 100644 index 1dbab0f91..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGateway.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified transit gateway. -func (c *Client) DeleteTransitGateway(ctx context.Context, params *DeleteTransitGatewayInput, optFns ...func(*Options)) (*DeleteTransitGatewayOutput, error) { - if params == nil { - params = &DeleteTransitGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGateway", params, optFns, c.addOperationDeleteTransitGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayInput struct { - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayOutput struct { - - // Information about the deleted transit gateway. - TransitGateway *types.TransitGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnect.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnect.go deleted file mode 100644 index eb5e51873..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnect.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Connect attachment. You must first delete any Connect -// peers for the attachment. -func (c *Client) DeleteTransitGatewayConnect(ctx context.Context, params *DeleteTransitGatewayConnectInput, optFns ...func(*Options)) (*DeleteTransitGatewayConnectOutput, error) { - if params == nil { - params = &DeleteTransitGatewayConnectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayConnect", params, optFns, c.addOperationDeleteTransitGatewayConnectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayConnectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayConnectInput struct { - - // The ID of the Connect attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayConnectOutput struct { - - // Information about the deleted Connect attachment. - TransitGatewayConnect *types.TransitGatewayConnect - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayConnectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayConnect{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayConnect{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayConnect"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayConnectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayConnect(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayConnect(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayConnect", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnectPeer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnectPeer.go deleted file mode 100644 index 69bb9acec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayConnectPeer.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified Connect peer. -func (c *Client) DeleteTransitGatewayConnectPeer(ctx context.Context, params *DeleteTransitGatewayConnectPeerInput, optFns ...func(*Options)) (*DeleteTransitGatewayConnectPeerOutput, error) { - if params == nil { - params = &DeleteTransitGatewayConnectPeerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayConnectPeer", params, optFns, c.addOperationDeleteTransitGatewayConnectPeerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayConnectPeerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayConnectPeerInput struct { - - // The ID of the Connect peer. - // - // This member is required. - TransitGatewayConnectPeerId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayConnectPeerOutput struct { - - // Information about the deleted Connect peer. - TransitGatewayConnectPeer *types.TransitGatewayConnectPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayConnectPeerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayConnectPeer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayConnectPeer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayConnectPeer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayConnectPeerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayConnectPeer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayConnectPeer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayConnectPeer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayMulticastDomain.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayMulticastDomain.go deleted file mode 100644 index 4c9f83491..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayMulticastDomain.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified transit gateway multicast domain. -func (c *Client) DeleteTransitGatewayMulticastDomain(ctx context.Context, params *DeleteTransitGatewayMulticastDomainInput, optFns ...func(*Options)) (*DeleteTransitGatewayMulticastDomainOutput, error) { - if params == nil { - params = &DeleteTransitGatewayMulticastDomainInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayMulticastDomain", params, optFns, c.addOperationDeleteTransitGatewayMulticastDomainMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayMulticastDomainOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayMulticastDomainInput struct { - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayMulticastDomainOutput struct { - - // Information about the deleted transit gateway multicast domain. - TransitGatewayMulticastDomain *types.TransitGatewayMulticastDomain - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayMulticastDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayMulticastDomain"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayMulticastDomainValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayMulticastDomain(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayMulticastDomain(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayMulticastDomain", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPeeringAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPeeringAttachment.go deleted file mode 100644 index 7b93ab1fd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPeeringAttachment.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a transit gateway peering attachment. -func (c *Client) DeleteTransitGatewayPeeringAttachment(ctx context.Context, params *DeleteTransitGatewayPeeringAttachmentInput, optFns ...func(*Options)) (*DeleteTransitGatewayPeeringAttachmentOutput, error) { - if params == nil { - params = &DeleteTransitGatewayPeeringAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayPeeringAttachment", params, optFns, c.addOperationDeleteTransitGatewayPeeringAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayPeeringAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayPeeringAttachmentInput struct { - - // The ID of the transit gateway peering attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayPeeringAttachmentOutput struct { - - // The transit gateway peering attachment. - TransitGatewayPeeringAttachment *types.TransitGatewayPeeringAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayPeeringAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayPeeringAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayPeeringAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayPeeringAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayPeeringAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayPeeringAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPolicyTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPolicyTable.go deleted file mode 100644 index 787d20fbc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPolicyTable.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified transit gateway policy table. -func (c *Client) DeleteTransitGatewayPolicyTable(ctx context.Context, params *DeleteTransitGatewayPolicyTableInput, optFns ...func(*Options)) (*DeleteTransitGatewayPolicyTableOutput, error) { - if params == nil { - params = &DeleteTransitGatewayPolicyTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayPolicyTable", params, optFns, c.addOperationDeleteTransitGatewayPolicyTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayPolicyTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayPolicyTableInput struct { - - // The transit gateway policy table to delete. - // - // This member is required. - TransitGatewayPolicyTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayPolicyTableOutput struct { - - // Provides details about the deleted transit gateway policy table. - TransitGatewayPolicyTable *types.TransitGatewayPolicyTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayPolicyTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayPolicyTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayPolicyTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayPolicyTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayPolicyTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayPolicyTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPrefixListReference.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPrefixListReference.go deleted file mode 100644 index 1757471ad..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayPrefixListReference.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a reference (route) to a prefix list in a specified transit gateway -// route table. -func (c *Client) DeleteTransitGatewayPrefixListReference(ctx context.Context, params *DeleteTransitGatewayPrefixListReferenceInput, optFns ...func(*Options)) (*DeleteTransitGatewayPrefixListReferenceOutput, error) { - if params == nil { - params = &DeleteTransitGatewayPrefixListReferenceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayPrefixListReference", params, optFns, c.addOperationDeleteTransitGatewayPrefixListReferenceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayPrefixListReferenceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayPrefixListReferenceInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // The ID of the route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayPrefixListReferenceOutput struct { - - // Information about the deleted prefix list reference. - TransitGatewayPrefixListReference *types.TransitGatewayPrefixListReference - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayPrefixListReferenceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayPrefixListReference"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayPrefixListReferenceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayPrefixListReference(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayPrefixListReference(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayPrefixListReference", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRoute.go deleted file mode 100644 index 97c0b6355..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRoute.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified route from the specified transit gateway route table. -func (c *Client) DeleteTransitGatewayRoute(ctx context.Context, params *DeleteTransitGatewayRouteInput, optFns ...func(*Options)) (*DeleteTransitGatewayRouteOutput, error) { - if params == nil { - params = &DeleteTransitGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayRoute", params, optFns, c.addOperationDeleteTransitGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayRouteInput struct { - - // The CIDR range for the route. This must match the CIDR for the route exactly. - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayRouteOutput struct { - - // Information about the route. - Route *types.TransitGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTable.go deleted file mode 100644 index 65a48c4a3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTable.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified transit gateway route table. If there are any route -// tables associated with the transit gateway route table, you must first run DisassociateRouteTable -// before you can delete the transit gateway route table. This removes any route -// tables associated with the transit gateway route table. -func (c *Client) DeleteTransitGatewayRouteTable(ctx context.Context, params *DeleteTransitGatewayRouteTableInput, optFns ...func(*Options)) (*DeleteTransitGatewayRouteTableOutput, error) { - if params == nil { - params = &DeleteTransitGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayRouteTable", params, optFns, c.addOperationDeleteTransitGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayRouteTableInput struct { - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayRouteTableOutput struct { - - // Information about the deleted transit gateway route table. - TransitGatewayRouteTable *types.TransitGatewayRouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTableAnnouncement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTableAnnouncement.go deleted file mode 100644 index 330f164c0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayRouteTableAnnouncement.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Advertises to the transit gateway that a transit gateway route table is deleted. -func (c *Client) DeleteTransitGatewayRouteTableAnnouncement(ctx context.Context, params *DeleteTransitGatewayRouteTableAnnouncementInput, optFns ...func(*Options)) (*DeleteTransitGatewayRouteTableAnnouncementOutput, error) { - if params == nil { - params = &DeleteTransitGatewayRouteTableAnnouncementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayRouteTableAnnouncement", params, optFns, c.addOperationDeleteTransitGatewayRouteTableAnnouncementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayRouteTableAnnouncementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayRouteTableAnnouncementInput struct { - - // The transit gateway route table ID that's being deleted. - // - // This member is required. - TransitGatewayRouteTableAnnouncementId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayRouteTableAnnouncementOutput struct { - - // Provides details about a deleted transit gateway route table. - TransitGatewayRouteTableAnnouncement *types.TransitGatewayRouteTableAnnouncement - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayRouteTableAnnouncementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayRouteTableAnnouncement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayRouteTableAnnouncement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayRouteTableAnnouncement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayRouteTableAnnouncementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayRouteTableAnnouncement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayRouteTableAnnouncement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayRouteTableAnnouncement", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayVpcAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayVpcAttachment.go deleted file mode 100644 index 0e7cfc290..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteTransitGatewayVpcAttachment.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPC attachment. -func (c *Client) DeleteTransitGatewayVpcAttachment(ctx context.Context, params *DeleteTransitGatewayVpcAttachmentInput, optFns ...func(*Options)) (*DeleteTransitGatewayVpcAttachmentOutput, error) { - if params == nil { - params = &DeleteTransitGatewayVpcAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteTransitGatewayVpcAttachment", params, optFns, c.addOperationDeleteTransitGatewayVpcAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteTransitGatewayVpcAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteTransitGatewayVpcAttachmentInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteTransitGatewayVpcAttachmentOutput struct { - - // Information about the deleted VPC attachment. - TransitGatewayVpcAttachment *types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteTransitGatewayVpcAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransitGatewayVpcAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteTransitGatewayVpcAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransitGatewayVpcAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteTransitGatewayVpcAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteTransitGatewayVpcAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessEndpoint.go deleted file mode 100644 index 071a31738..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessEndpoint.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an Amazon Web Services Verified Access endpoint. -func (c *Client) DeleteVerifiedAccessEndpoint(ctx context.Context, params *DeleteVerifiedAccessEndpointInput, optFns ...func(*Options)) (*DeleteVerifiedAccessEndpointOutput, error) { - if params == nil { - params = &DeleteVerifiedAccessEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVerifiedAccessEndpoint", params, optFns, c.addOperationDeleteVerifiedAccessEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVerifiedAccessEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVerifiedAccessEndpointInput struct { - - // The ID of the Verified Access endpoint. - // - // This member is required. - VerifiedAccessEndpointId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVerifiedAccessEndpointOutput struct { - - // Details about the Verified Access endpoint. - VerifiedAccessEndpoint *types.VerifiedAccessEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVerifiedAccessEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVerifiedAccessEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDeleteVerifiedAccessEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpDeleteVerifiedAccessEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVerifiedAccessEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDeleteVerifiedAccessEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDeleteVerifiedAccessEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDeleteVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DeleteVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteVerifiedAccessEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDeleteVerifiedAccessEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteVerifiedAccessEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDeleteVerifiedAccessEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVerifiedAccessEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessGroup.go deleted file mode 100644 index 2e159865d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessGroup.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an Amazon Web Services Verified Access group. -func (c *Client) DeleteVerifiedAccessGroup(ctx context.Context, params *DeleteVerifiedAccessGroupInput, optFns ...func(*Options)) (*DeleteVerifiedAccessGroupOutput, error) { - if params == nil { - params = &DeleteVerifiedAccessGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVerifiedAccessGroup", params, optFns, c.addOperationDeleteVerifiedAccessGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVerifiedAccessGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVerifiedAccessGroupInput struct { - - // The ID of the Verified Access group. - // - // This member is required. - VerifiedAccessGroupId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVerifiedAccessGroupOutput struct { - - // Details about the Verified Access group. - VerifiedAccessGroup *types.VerifiedAccessGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVerifiedAccessGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVerifiedAccessGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDeleteVerifiedAccessGroupMiddleware(stack, options); err != nil { - return err - } - if err = addOpDeleteVerifiedAccessGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVerifiedAccessGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDeleteVerifiedAccessGroup struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDeleteVerifiedAccessGroup) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDeleteVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DeleteVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteVerifiedAccessGroupInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDeleteVerifiedAccessGroupMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteVerifiedAccessGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDeleteVerifiedAccessGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVerifiedAccessGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessInstance.go deleted file mode 100644 index b60833172..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessInstance.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an Amazon Web Services Verified Access instance. -func (c *Client) DeleteVerifiedAccessInstance(ctx context.Context, params *DeleteVerifiedAccessInstanceInput, optFns ...func(*Options)) (*DeleteVerifiedAccessInstanceOutput, error) { - if params == nil { - params = &DeleteVerifiedAccessInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVerifiedAccessInstance", params, optFns, c.addOperationDeleteVerifiedAccessInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVerifiedAccessInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVerifiedAccessInstanceInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVerifiedAccessInstanceOutput struct { - - // Details about the Verified Access instance. - VerifiedAccessInstance *types.VerifiedAccessInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVerifiedAccessInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVerifiedAccessInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDeleteVerifiedAccessInstanceMiddleware(stack, options); err != nil { - return err - } - if err = addOpDeleteVerifiedAccessInstanceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVerifiedAccessInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDeleteVerifiedAccessInstance struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDeleteVerifiedAccessInstance) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDeleteVerifiedAccessInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DeleteVerifiedAccessInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteVerifiedAccessInstanceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDeleteVerifiedAccessInstanceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteVerifiedAccessInstance{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDeleteVerifiedAccessInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVerifiedAccessInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessTrustProvider.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessTrustProvider.go deleted file mode 100644 index 804127497..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVerifiedAccessTrustProvider.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete an Amazon Web Services Verified Access trust provider. -func (c *Client) DeleteVerifiedAccessTrustProvider(ctx context.Context, params *DeleteVerifiedAccessTrustProviderInput, optFns ...func(*Options)) (*DeleteVerifiedAccessTrustProviderOutput, error) { - if params == nil { - params = &DeleteVerifiedAccessTrustProviderInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVerifiedAccessTrustProvider", params, optFns, c.addOperationDeleteVerifiedAccessTrustProviderMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVerifiedAccessTrustProviderOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVerifiedAccessTrustProviderInput struct { - - // The ID of the Verified Access trust provider. - // - // This member is required. - VerifiedAccessTrustProviderId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVerifiedAccessTrustProviderOutput struct { - - // Details about the Verified Access trust provider. - VerifiedAccessTrustProvider *types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVerifiedAccessTrustProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVerifiedAccessTrustProvider"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDeleteVerifiedAccessTrustProviderMiddleware(stack, options); err != nil { - return err - } - if err = addOpDeleteVerifiedAccessTrustProviderValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVerifiedAccessTrustProvider(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDeleteVerifiedAccessTrustProvider struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDeleteVerifiedAccessTrustProvider) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDeleteVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DeleteVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteVerifiedAccessTrustProviderInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDeleteVerifiedAccessTrustProviderMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteVerifiedAccessTrustProvider{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDeleteVerifiedAccessTrustProvider(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVerifiedAccessTrustProvider", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVolume.go deleted file mode 100644 index e6261caeb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVolume.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified EBS volume. The volume must be in the available state -// (not attached to an instance). -// -// The volume can remain in the deleting state for several minutes. -// -// For more information, see [Delete an Amazon EBS volume] in the Amazon EBS User Guide. -// -// [Delete an Amazon EBS volume]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-deleting-volume.html -func (c *Client) DeleteVolume(ctx context.Context, params *DeleteVolumeInput, optFns ...func(*Options)) (*DeleteVolumeOutput, error) { - if params == nil { - params = &DeleteVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVolume", params, optFns, c.addOperationDeleteVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVolumeInput struct { - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVolumeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpc.go deleted file mode 100644 index 626b1d095..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpc.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPC. You must detach or delete all gateways and resources -// that are associated with the VPC before you can delete it. For example, you must -// terminate all instances running in the VPC, delete all security groups -// associated with the VPC (except the default one), delete all route tables -// associated with the VPC (except the default one), and so on. When you delete the -// VPC, it deletes the default security group, network ACL, and route table for the -// VPC. -// -// If you created a flow log for the VPC that you are deleting, note that flow -// logs for deleted VPCs are eventually automatically removed. -func (c *Client) DeleteVpc(ctx context.Context, params *DeleteVpcInput, optFns ...func(*Options)) (*DeleteVpcOutput, error) { - if params == nil { - params = &DeleteVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpc", params, optFns, c.addOperationDeleteVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcBlockPublicAccessExclusion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcBlockPublicAccessExclusion.go deleted file mode 100644 index e2b0a57e7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcBlockPublicAccessExclusion.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Delete a VPC Block Public Access (BPA) exclusion. A VPC BPA exclusion is a mode -// that can be applied to a single VPC or subnet that exempts it from the account’s -// BPA mode and will allow bidirectional or egress-only access. You can create BPA -// exclusions for VPCs and subnets even when BPA is not enabled on the account to -// ensure that there is no traffic disruption to the exclusions when VPC BPA is -// turned on. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -func (c *Client) DeleteVpcBlockPublicAccessExclusion(ctx context.Context, params *DeleteVpcBlockPublicAccessExclusionInput, optFns ...func(*Options)) (*DeleteVpcBlockPublicAccessExclusionOutput, error) { - if params == nil { - params = &DeleteVpcBlockPublicAccessExclusionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpcBlockPublicAccessExclusion", params, optFns, c.addOperationDeleteVpcBlockPublicAccessExclusionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcBlockPublicAccessExclusionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcBlockPublicAccessExclusionInput struct { - - // The ID of the exclusion. - // - // This member is required. - ExclusionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcBlockPublicAccessExclusionOutput struct { - - // Details about an exclusion. - VpcBlockPublicAccessExclusion *types.VpcBlockPublicAccessExclusion - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcBlockPublicAccessExclusionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpcBlockPublicAccessExclusion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcBlockPublicAccessExclusionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcBlockPublicAccessExclusion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpcBlockPublicAccessExclusion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpcBlockPublicAccessExclusion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointConnectionNotifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointConnectionNotifications.go deleted file mode 100644 index 608eba0bc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointConnectionNotifications.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPC endpoint connection notifications. -func (c *Client) DeleteVpcEndpointConnectionNotifications(ctx context.Context, params *DeleteVpcEndpointConnectionNotificationsInput, optFns ...func(*Options)) (*DeleteVpcEndpointConnectionNotificationsOutput, error) { - if params == nil { - params = &DeleteVpcEndpointConnectionNotificationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpointConnectionNotifications", params, optFns, c.addOperationDeleteVpcEndpointConnectionNotificationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcEndpointConnectionNotificationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcEndpointConnectionNotificationsInput struct { - - // The IDs of the notifications. - // - // This member is required. - ConnectionNotificationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcEndpointConnectionNotificationsOutput struct { - - // Information about the notifications that could not be deleted successfully. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcEndpointConnectionNotificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpcEndpointConnectionNotifications{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpcEndpointConnectionNotifications{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpcEndpointConnectionNotifications"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcEndpointConnectionNotificationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpointConnectionNotifications(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpcEndpointConnectionNotifications(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpcEndpointConnectionNotifications", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointServiceConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointServiceConfigurations.go deleted file mode 100644 index 0edda6b47..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpointServiceConfigurations.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPC endpoint service configurations. Before you can -// delete an endpoint service configuration, you must reject any Available or -// PendingAcceptance interface endpoint connections that are attached to the -// service. -func (c *Client) DeleteVpcEndpointServiceConfigurations(ctx context.Context, params *DeleteVpcEndpointServiceConfigurationsInput, optFns ...func(*Options)) (*DeleteVpcEndpointServiceConfigurationsOutput, error) { - if params == nil { - params = &DeleteVpcEndpointServiceConfigurationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpointServiceConfigurations", params, optFns, c.addOperationDeleteVpcEndpointServiceConfigurationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcEndpointServiceConfigurationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcEndpointServiceConfigurationsInput struct { - - // The IDs of the services. - // - // This member is required. - ServiceIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcEndpointServiceConfigurationsOutput struct { - - // Information about the service configurations that were not deleted, if - // applicable. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcEndpointServiceConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpcEndpointServiceConfigurations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpcEndpointServiceConfigurations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpcEndpointServiceConfigurations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcEndpointServiceConfigurationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpointServiceConfigurations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpcEndpointServiceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpcEndpointServiceConfigurations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpoints.go deleted file mode 100644 index dffbb307c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcEndpoints.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPC endpoints. -// -// When you delete a gateway endpoint, we delete the endpoint routes in the route -// tables for the endpoint. -// -// When you delete a Gateway Load Balancer endpoint, we delete its endpoint -// network interfaces. You can only delete Gateway Load Balancer endpoints when the -// routes that are associated with the endpoint are deleted. -// -// When you delete an interface endpoint, we delete its endpoint network -// interfaces. -func (c *Client) DeleteVpcEndpoints(ctx context.Context, params *DeleteVpcEndpointsInput, optFns ...func(*Options)) (*DeleteVpcEndpointsOutput, error) { - if params == nil { - params = &DeleteVpcEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpoints", params, optFns, c.addOperationDeleteVpcEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcEndpointsInput struct { - - // The IDs of the VPC endpoints. - // - // This member is required. - VpcEndpointIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcEndpointsOutput struct { - - // Information about the VPC endpoints that were not successfully deleted. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpcEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpcEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpcEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcEndpointsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpcEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcPeeringConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcPeeringConnection.go deleted file mode 100644 index 197221c62..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpcPeeringConnection.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a VPC peering connection. Either the owner of the requester VPC or the -// owner of the accepter VPC can delete the VPC peering connection if it's in the -// active state. The owner of the requester VPC can delete a VPC peering connection -// in the pending-acceptance state. You cannot delete a VPC peering connection -// that's in the failed or rejected state. -func (c *Client) DeleteVpcPeeringConnection(ctx context.Context, params *DeleteVpcPeeringConnectionInput, optFns ...func(*Options)) (*DeleteVpcPeeringConnectionOutput, error) { - if params == nil { - params = &DeleteVpcPeeringConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpcPeeringConnection", params, optFns, c.addOperationDeleteVpcPeeringConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpcPeeringConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteVpcPeeringConnectionInput struct { - - // The ID of the VPC peering connection. - // - // This member is required. - VpcPeeringConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpcPeeringConnectionOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpcPeeringConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpcPeeringConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpcPeeringConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcPeeringConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpcPeeringConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpcPeeringConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnection.go deleted file mode 100644 index 27040b521..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnection.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified VPN connection. -// -// If you're deleting the VPC and its associated components, we recommend that you -// detach the virtual private gateway from the VPC and delete the VPC before -// deleting the VPN connection. If you believe that the tunnel credentials for your -// VPN connection have been compromised, you can delete the VPN connection and -// create a new one that has new keys, without needing to delete the VPC or virtual -// private gateway. If you create a new VPN connection, you must reconfigure the -// customer gateway device using the new configuration information returned with -// the new VPN connection ID. -// -// For certificate-based authentication, delete all Certificate Manager (ACM) -// private certificates used for the Amazon Web Services-side tunnel endpoints for -// the VPN connection before deleting the VPN connection. -func (c *Client) DeleteVpnConnection(ctx context.Context, params *DeleteVpnConnectionInput, optFns ...func(*Options)) (*DeleteVpnConnectionOutput, error) { - if params == nil { - params = &DeleteVpnConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpnConnection", params, optFns, c.addOperationDeleteVpnConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpnConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteVpnConnection. -type DeleteVpnConnectionInput struct { - - // The ID of the VPN connection. - // - // This member is required. - VpnConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpnConnectionOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpnConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpnConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpnConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpnConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpnConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpnConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpnConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpnConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnectionRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnectionRoute.go deleted file mode 100644 index 2748ce0bf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnConnectionRoute.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified static route associated with a VPN connection between an -// existing virtual private gateway and a VPN customer gateway. The static route -// allows traffic to be routed from the virtual private gateway to the VPN customer -// gateway. -func (c *Client) DeleteVpnConnectionRoute(ctx context.Context, params *DeleteVpnConnectionRouteInput, optFns ...func(*Options)) (*DeleteVpnConnectionRouteOutput, error) { - if params == nil { - params = &DeleteVpnConnectionRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpnConnectionRoute", params, optFns, c.addOperationDeleteVpnConnectionRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpnConnectionRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteVpnConnectionRoute. -type DeleteVpnConnectionRouteInput struct { - - // The CIDR block associated with the local subnet of the customer network. - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the VPN connection. - // - // This member is required. - VpnConnectionId *string - - noSmithyDocumentSerde -} - -type DeleteVpnConnectionRouteOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpnConnectionRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpnConnectionRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpnConnectionRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpnConnectionRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpnConnectionRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpnConnectionRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpnConnectionRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpnConnectionRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnGateway.go deleted file mode 100644 index c09165901..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeleteVpnGateway.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified virtual private gateway. You must first detach the -// virtual private gateway from the VPC. Note that you don't need to delete the -// virtual private gateway if you plan to delete and recreate the VPN connection -// between your VPC and your network. -func (c *Client) DeleteVpnGateway(ctx context.Context, params *DeleteVpnGatewayInput, optFns ...func(*Options)) (*DeleteVpnGatewayOutput, error) { - if params == nil { - params = &DeleteVpnGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteVpnGateway", params, optFns, c.addOperationDeleteVpnGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteVpnGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeleteVpnGateway. -type DeleteVpnGatewayInput struct { - - // The ID of the virtual private gateway. - // - // This member is required. - VpnGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeleteVpnGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteVpnGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeleteVpnGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeleteVpnGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVpnGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteVpnGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpnGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteVpnGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteVpnGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionByoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionByoipCidr.go deleted file mode 100644 index 0f146b8cd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionByoipCidr.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Releases the specified address range that you provisioned for use with your -// Amazon Web Services resources through bring your own IP addresses (BYOIP) and -// deletes the corresponding address pool. -// -// Before you can release an address range, you must stop advertising it using WithdrawByoipCidr -// and you must not have any IP addresses allocated from its address range. -func (c *Client) DeprovisionByoipCidr(ctx context.Context, params *DeprovisionByoipCidrInput, optFns ...func(*Options)) (*DeprovisionByoipCidrOutput, error) { - if params == nil { - params = &DeprovisionByoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeprovisionByoipCidr", params, optFns, c.addOperationDeprovisionByoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeprovisionByoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeprovisionByoipCidrInput struct { - - // The address range, in CIDR notation. The prefix must be the same prefix that - // you specified when you provisioned the address range. - // - // This member is required. - Cidr *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeprovisionByoipCidrOutput struct { - - // Information about the address range. - ByoipCidr *types.ByoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeprovisionByoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeprovisionByoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeprovisionByoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeprovisionByoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeprovisionByoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprovisionByoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeprovisionByoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeprovisionByoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamByoasn.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamByoasn.go deleted file mode 100644 index bbef3e41d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamByoasn.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deprovisions your Autonomous System Number (ASN) from your Amazon Web Services -// account. This action can only be called after any BYOIP CIDR associations are -// removed from your Amazon Web Services account with [DisassociateIpamByoasn]. For more information, see [Tutorial: Bring your ASN to IPAM] -// in the Amazon VPC IPAM guide. -// -// [DisassociateIpamByoasn]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIpamByoasn.html -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -func (c *Client) DeprovisionIpamByoasn(ctx context.Context, params *DeprovisionIpamByoasnInput, optFns ...func(*Options)) (*DeprovisionIpamByoasnOutput, error) { - if params == nil { - params = &DeprovisionIpamByoasnInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeprovisionIpamByoasn", params, optFns, c.addOperationDeprovisionIpamByoasnMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeprovisionIpamByoasnOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeprovisionIpamByoasnInput struct { - - // An ASN. - // - // This member is required. - Asn *string - - // The IPAM ID. - // - // This member is required. - IpamId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeprovisionIpamByoasnOutput struct { - - // An ASN and BYOIP CIDR association. - Byoasn *types.Byoasn - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeprovisionIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeprovisionIpamByoasn{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeprovisionIpamByoasn{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeprovisionIpamByoasn"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeprovisionIpamByoasnValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprovisionIpamByoasn(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeprovisionIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeprovisionIpamByoasn", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamPoolCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamPoolCidr.go deleted file mode 100644 index 930565b74..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionIpamPoolCidr.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deprovision a CIDR provisioned from an IPAM pool. If you deprovision a CIDR -// from a pool that has a source pool, the CIDR is recycled back into the source -// pool. For more information, see [Deprovision pool CIDRs]in the Amazon VPC IPAM User Guide. -// -// [Deprovision pool CIDRs]: https://docs.aws.amazon.com/vpc/latest/ipam/depro-pool-cidr-ipam.html -func (c *Client) DeprovisionIpamPoolCidr(ctx context.Context, params *DeprovisionIpamPoolCidrInput, optFns ...func(*Options)) (*DeprovisionIpamPoolCidrOutput, error) { - if params == nil { - params = &DeprovisionIpamPoolCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeprovisionIpamPoolCidr", params, optFns, c.addOperationDeprovisionIpamPoolCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeprovisionIpamPoolCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeprovisionIpamPoolCidrInput struct { - - // The ID of the pool that has the CIDR you want to deprovision. - // - // This member is required. - IpamPoolId *string - - // The CIDR which you want to deprovision from the pool. - Cidr *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeprovisionIpamPoolCidrOutput struct { - - // The deprovisioned pool CIDR. - IpamPoolCidr *types.IpamPoolCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeprovisionIpamPoolCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeprovisionIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeprovisionIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeprovisionIpamPoolCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeprovisionIpamPoolCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprovisionIpamPoolCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeprovisionIpamPoolCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeprovisionIpamPoolCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionPublicIpv4PoolCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionPublicIpv4PoolCidr.go deleted file mode 100644 index b9bbf3ad0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeprovisionPublicIpv4PoolCidr.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deprovision a CIDR from a public IPv4 pool. -func (c *Client) DeprovisionPublicIpv4PoolCidr(ctx context.Context, params *DeprovisionPublicIpv4PoolCidrInput, optFns ...func(*Options)) (*DeprovisionPublicIpv4PoolCidrOutput, error) { - if params == nil { - params = &DeprovisionPublicIpv4PoolCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeprovisionPublicIpv4PoolCidr", params, optFns, c.addOperationDeprovisionPublicIpv4PoolCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeprovisionPublicIpv4PoolCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeprovisionPublicIpv4PoolCidrInput struct { - - // The CIDR you want to deprovision from the pool. - // - // This member is required. - Cidr *string - - // The ID of the pool that you want to deprovision the CIDR from. - // - // This member is required. - PoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeprovisionPublicIpv4PoolCidrOutput struct { - - // The deprovisioned CIDRs. - DeprovisionedAddresses []string - - // The ID of the pool that you deprovisioned the CIDR from. - PoolId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeprovisionPublicIpv4PoolCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeprovisionPublicIpv4PoolCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeprovisionPublicIpv4PoolCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeprovisionPublicIpv4PoolCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeprovisionPublicIpv4PoolCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprovisionPublicIpv4PoolCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeprovisionPublicIpv4PoolCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeprovisionPublicIpv4PoolCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterImage.go deleted file mode 100644 index 245f8372e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterImage.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deregisters the specified AMI. A deregistered AMI can't be used to launch new -// instances. -// -// If a deregistered EBS-backed AMI matches a Recycle Bin retention rule, it moves -// to the Recycle Bin for the specified retention period. It can be restored before -// its retention period expires, after which it is permanently deleted. If the -// deregistered AMI doesn't match a retention rule, it is permanently deleted -// immediately. For more information, see [Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin]in the Amazon EBS User Guide. -// -// When deregistering an EBS-backed AMI, you can optionally delete its associated -// snapshots at the same time. However, if a snapshot is associated with multiple -// AMIs, it won't be deleted even if specified for deletion, although the AMI will -// still be deregistered. -// -// Deregistering an AMI does not delete the following: -// -// - Instances already launched from the AMI. You'll continue to incur usage -// costs for the instances until you terminate them. -// -// - For EBS-backed AMIs: Snapshots that are associated with multiple AMIs. -// You'll continue to incur snapshot storage costs. -// -// - For instance store-backed AMIs: The files uploaded to Amazon S3 during AMI -// creation. You'll continue to incur S3 storage costs. -// -// For more information, see [Deregister an Amazon EC2 AMI] in the Amazon EC2 User Guide. -// -// [Deregister an Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html -// [Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin.html -func (c *Client) DeregisterImage(ctx context.Context, params *DeregisterImageInput, optFns ...func(*Options)) (*DeregisterImageOutput, error) { - if params == nil { - params = &DeregisterImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterImage", params, optFns, c.addOperationDeregisterImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DeregisterImage. -type DeregisterImageInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Specifies whether to delete the snapshots associated with the AMI during - // deregistration. - // - // If a snapshot is associated with multiple AMIs, it is not deleted, regardless - // of this setting. - // - // Default: The snapshots are not deleted. - DeleteAssociatedSnapshots *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeregisterImageOutput struct { - - // The deletion result for each snapshot associated with the AMI, including the - // snapshot ID and its success or error code. - DeleteSnapshotResults []types.DeleteSnapshotReturnCode - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeregisterImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeregisterImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeregisterImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterInstanceEventNotificationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterInstanceEventNotificationAttributes.go deleted file mode 100644 index 398d0d65b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterInstanceEventNotificationAttributes.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deregisters tag keys to prevent tags that have the specified tag keys from -// being included in scheduled event notifications for resources in the Region. -func (c *Client) DeregisterInstanceEventNotificationAttributes(ctx context.Context, params *DeregisterInstanceEventNotificationAttributesInput, optFns ...func(*Options)) (*DeregisterInstanceEventNotificationAttributesOutput, error) { - if params == nil { - params = &DeregisterInstanceEventNotificationAttributesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterInstanceEventNotificationAttributes", params, optFns, c.addOperationDeregisterInstanceEventNotificationAttributesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterInstanceEventNotificationAttributesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeregisterInstanceEventNotificationAttributesInput struct { - - // Information about the tag keys to deregister. - // - // This member is required. - InstanceTagAttribute *types.DeregisterInstanceTagAttributeRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DeregisterInstanceEventNotificationAttributesOutput struct { - - // The resulting set of tag keys. - InstanceTagAttribute *types.InstanceTagNotificationAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterInstanceEventNotificationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeregisterInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeregisterInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterInstanceEventNotificationAttributes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeregisterInstanceEventNotificationAttributesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterInstanceEventNotificationAttributes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterInstanceEventNotificationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterInstanceEventNotificationAttributes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupMembers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupMembers.go deleted file mode 100644 index 7fb4bcf17..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupMembers.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deregisters the specified members (network interfaces) from the transit gateway -// multicast group. -func (c *Client) DeregisterTransitGatewayMulticastGroupMembers(ctx context.Context, params *DeregisterTransitGatewayMulticastGroupMembersInput, optFns ...func(*Options)) (*DeregisterTransitGatewayMulticastGroupMembersOutput, error) { - if params == nil { - params = &DeregisterTransitGatewayMulticastGroupMembersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterTransitGatewayMulticastGroupMembers", params, optFns, c.addOperationDeregisterTransitGatewayMulticastGroupMembersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterTransitGatewayMulticastGroupMembersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeregisterTransitGatewayMulticastGroupMembersInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The IDs of the group members' network interfaces. - NetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -type DeregisterTransitGatewayMulticastGroupMembersOutput struct { - - // Information about the deregistered members. - DeregisteredMulticastGroupMembers *types.TransitGatewayMulticastDeregisteredGroupMembers - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterTransitGatewayMulticastGroupMembersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupMembers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupMembers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterTransitGatewayMulticastGroupMembers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTransitGatewayMulticastGroupMembers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterTransitGatewayMulticastGroupMembers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterTransitGatewayMulticastGroupMembers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupSources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupSources.go deleted file mode 100644 index 6430fb4c2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DeregisterTransitGatewayMulticastGroupSources.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deregisters the specified sources (network interfaces) from the transit gateway -// multicast group. -func (c *Client) DeregisterTransitGatewayMulticastGroupSources(ctx context.Context, params *DeregisterTransitGatewayMulticastGroupSourcesInput, optFns ...func(*Options)) (*DeregisterTransitGatewayMulticastGroupSourcesOutput, error) { - if params == nil { - params = &DeregisterTransitGatewayMulticastGroupSourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterTransitGatewayMulticastGroupSources", params, optFns, c.addOperationDeregisterTransitGatewayMulticastGroupSourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterTransitGatewayMulticastGroupSourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeregisterTransitGatewayMulticastGroupSourcesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The IDs of the group sources' network interfaces. - NetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -type DeregisterTransitGatewayMulticastGroupSourcesOutput struct { - - // Information about the deregistered group sources. - DeregisteredMulticastGroupSources *types.TransitGatewayMulticastDeregisteredGroupSources - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterTransitGatewayMulticastGroupSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupSources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupSources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterTransitGatewayMulticastGroupSources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTransitGatewayMulticastGroupSources(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterTransitGatewayMulticastGroupSources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterTransitGatewayMulticastGroupSources", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAccountAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAccountAttributes.go deleted file mode 100644 index c8ab04279..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAccountAttributes.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes attributes of your Amazon Web Services account. The following are the -// supported account attributes: -// -// - default-vpc : The ID of the default VPC for your account, or none . -// -// - max-instances : This attribute is no longer supported. The returned value -// does not reflect your actual vCPU limit for running On-Demand Instances. For -// more information, see [On-Demand Instance Limits]in the Amazon Elastic Compute Cloud User Guide. -// -// - max-elastic-ips : The maximum number of Elastic IP addresses that you can -// allocate. -// -// - supported-platforms : This attribute is deprecated. -// -// - vpc-max-elastic-ips : The maximum number of Elastic IP addresses that you -// can allocate. -// -// - vpc-max-security-groups-per-interface : The maximum number of security -// groups that you can assign to a network interface. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [On-Demand Instance Limits]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-on-demand-instances.html#ec2-on-demand-instances-limits -func (c *Client) DescribeAccountAttributes(ctx context.Context, params *DescribeAccountAttributesInput, optFns ...func(*Options)) (*DescribeAccountAttributesOutput, error) { - if params == nil { - params = &DescribeAccountAttributesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAccountAttributes", params, optFns, c.addOperationDescribeAccountAttributesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAccountAttributesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAccountAttributesInput struct { - - // The account attribute names. - AttributeNames []types.AccountAttributeName - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeAccountAttributesOutput struct { - - // Information about the account attributes. - AccountAttributes []types.AccountAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAccountAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAccountAttributes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAccountAttributes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAccountAttributes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccountAttributes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAccountAttributes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAccountAttributes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressTransfers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressTransfers.go deleted file mode 100644 index fe741ed55..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressTransfers.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes an Elastic IP address transfer. For more information, see [Transfer Elastic IP addresses] in the -// Amazon VPC User Guide. -// -// When you transfer an Elastic IP address, there is a two-step handshake between -// the source and transfer Amazon Web Services accounts. When the source account -// starts the transfer, the transfer account has seven days to accept the Elastic -// IP address transfer. During those seven days, the source account can view the -// pending transfer by using this action. After seven days, the transfer expires -// and ownership of the Elastic IP address returns to the source account. Accepted -// transfers are visible to the source account for 14 days after the transfers have -// been accepted. -// -// [Transfer Elastic IP addresses]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro -func (c *Client) DescribeAddressTransfers(ctx context.Context, params *DescribeAddressTransfersInput, optFns ...func(*Options)) (*DescribeAddressTransfersOutput, error) { - if params == nil { - params = &DescribeAddressTransfersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddressTransfers", params, optFns, c.addOperationDescribeAddressTransfersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddressTransfersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddressTransfersInput struct { - - // The allocation IDs of Elastic IP addresses. - AllocationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of address transfers to return in one page of results. - MaxResults *int32 - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeAddressTransfersOutput struct { - - // The Elastic IP address transfer. - AddressTransfers []types.AddressTransfer - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddressTransfersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAddressTransfers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAddressTransfers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddressTransfers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddressTransfers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeAddressTransfersPaginatorOptions is the paginator options for -// DescribeAddressTransfers -type DescribeAddressTransfersPaginatorOptions struct { - // The maximum number of address transfers to return in one page of results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeAddressTransfersPaginator is a paginator for DescribeAddressTransfers -type DescribeAddressTransfersPaginator struct { - options DescribeAddressTransfersPaginatorOptions - client DescribeAddressTransfersAPIClient - params *DescribeAddressTransfersInput - nextToken *string - firstPage bool -} - -// NewDescribeAddressTransfersPaginator returns a new -// DescribeAddressTransfersPaginator -func NewDescribeAddressTransfersPaginator(client DescribeAddressTransfersAPIClient, params *DescribeAddressTransfersInput, optFns ...func(*DescribeAddressTransfersPaginatorOptions)) *DescribeAddressTransfersPaginator { - if params == nil { - params = &DescribeAddressTransfersInput{} - } - - options := DescribeAddressTransfersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeAddressTransfersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeAddressTransfersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeAddressTransfers page. -func (p *DescribeAddressTransfersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddressTransfersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeAddressTransfers(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeAddressTransfersAPIClient is a client that implements the -// DescribeAddressTransfers operation. -type DescribeAddressTransfersAPIClient interface { - DescribeAddressTransfers(context.Context, *DescribeAddressTransfersInput, ...func(*Options)) (*DescribeAddressTransfersOutput, error) -} - -var _ DescribeAddressTransfersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeAddressTransfers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddressTransfers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddresses.go deleted file mode 100644 index 83a3a8f6c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddresses.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Elastic IP addresses or all of your Elastic IP -// addresses. -func (c *Client) DescribeAddresses(ctx context.Context, params *DescribeAddressesInput, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { - if params == nil { - params = &DescribeAddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddresses", params, optFns, c.addOperationDescribeAddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddressesInput struct { - - // Information about the allocation IDs. - AllocationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - allocation-id - The allocation ID for the address. - // - // - association-id - The association ID for the address. - // - // - instance-id - The ID of the instance the address is associated with, if any. - // - // - network-border-group - A unique set of Availability Zones, Local Zones, or - // Wavelength Zones from where Amazon Web Services advertises IP addresses. - // - // - network-interface-id - The ID of the network interface that the address is - // associated with, if any. - // - // - network-interface-owner-id - The Amazon Web Services account ID of the owner. - // - // - private-ip-address - The private IP address associated with the Elastic IP - // address. - // - // - public-ip - The Elastic IP address, or the carrier IP address. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // One or more Elastic IP addresses. - // - // Default: Describes all your Elastic IP addresses. - PublicIps []string - - noSmithyDocumentSerde -} - -type DescribeAddressesOutput struct { - - // Information about the Elastic IP addresses. - Addresses []types.Address - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAddresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAddresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAddresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressesAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressesAttribute.go deleted file mode 100644 index a9d046804..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAddressesAttribute.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the attributes of the specified Elastic IP addresses. For -// requirements, see [Using reverse DNS for email applications]. -// -// [Using reverse DNS for email applications]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS -func (c *Client) DescribeAddressesAttribute(ctx context.Context, params *DescribeAddressesAttributeInput, optFns ...func(*Options)) (*DescribeAddressesAttributeOutput, error) { - if params == nil { - params = &DescribeAddressesAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddressesAttribute", params, optFns, c.addOperationDescribeAddressesAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddressesAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddressesAttributeInput struct { - - // [EC2-VPC] The allocation IDs. - AllocationIds []string - - // The attribute of the IP address. - Attribute types.AddressAttributeName - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeAddressesAttributeOutput struct { - - // Information about the IP addresses. - Addresses []types.AddressAttribute - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddressesAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAddressesAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAddressesAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddressesAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddressesAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeAddressesAttributePaginatorOptions is the paginator options for -// DescribeAddressesAttribute -type DescribeAddressesAttributePaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeAddressesAttributePaginator is a paginator for -// DescribeAddressesAttribute -type DescribeAddressesAttributePaginator struct { - options DescribeAddressesAttributePaginatorOptions - client DescribeAddressesAttributeAPIClient - params *DescribeAddressesAttributeInput - nextToken *string - firstPage bool -} - -// NewDescribeAddressesAttributePaginator returns a new -// DescribeAddressesAttributePaginator -func NewDescribeAddressesAttributePaginator(client DescribeAddressesAttributeAPIClient, params *DescribeAddressesAttributeInput, optFns ...func(*DescribeAddressesAttributePaginatorOptions)) *DescribeAddressesAttributePaginator { - if params == nil { - params = &DescribeAddressesAttributeInput{} - } - - options := DescribeAddressesAttributePaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeAddressesAttributePaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeAddressesAttributePaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeAddressesAttribute page. -func (p *DescribeAddressesAttributePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddressesAttributeOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeAddressesAttribute(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeAddressesAttributeAPIClient is a client that implements the -// DescribeAddressesAttribute operation. -type DescribeAddressesAttributeAPIClient interface { - DescribeAddressesAttribute(context.Context, *DescribeAddressesAttributeInput, ...func(*Options)) (*DescribeAddressesAttributeOutput, error) -} - -var _ DescribeAddressesAttributeAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeAddressesAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddressesAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAggregateIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAggregateIdFormat.go deleted file mode 100644 index 3db068c43..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAggregateIdFormat.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the longer ID format settings for all resource types in a specific -// Region. This request is useful for performing a quick audit to determine whether -// a specific Region is fully opted in for longer IDs (17-character IDs). -// -// This request only returns information about resource types that support longer -// IDs. -// -// The following resource types support longer IDs: bundle | conversion-task | -// customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway | -// network-acl | network-acl-association | network-interface | -// network-interface-attachment | prefix-list | reservation | route-table | -// route-table-association | security-group | snapshot | subnet | -// subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | -// vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway . -func (c *Client) DescribeAggregateIdFormat(ctx context.Context, params *DescribeAggregateIdFormatInput, optFns ...func(*Options)) (*DescribeAggregateIdFormatOutput, error) { - if params == nil { - params = &DescribeAggregateIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAggregateIdFormat", params, optFns, c.addOperationDescribeAggregateIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAggregateIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAggregateIdFormatInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeAggregateIdFormatOutput struct { - - // Information about each resource's ID format. - Statuses []types.IdFormat - - // Indicates whether all resource types in the Region are configured to use longer - // IDs. This value is only true if all users are configured to use longer IDs for - // all resources types in the Region. - UseLongIdsAggregated *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAggregateIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAggregateIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAggregateIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAggregateIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAggregateIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAggregateIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAggregateIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAvailabilityZones.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAvailabilityZones.go deleted file mode 100644 index 24a09a759..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAvailabilityZones.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Availability Zones, Local Zones, and Wavelength Zones that are -// available to you. -// -// For more information about Availability Zones, Local Zones, and Wavelength -// Zones, see [Regions and zones]in the Amazon EC2 User Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Regions and zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html -func (c *Client) DescribeAvailabilityZones(ctx context.Context, params *DescribeAvailabilityZonesInput, optFns ...func(*Options)) (*DescribeAvailabilityZonesOutput, error) { - if params == nil { - params = &DescribeAvailabilityZonesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAvailabilityZones", params, optFns, c.addOperationDescribeAvailabilityZonesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAvailabilityZonesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAvailabilityZonesInput struct { - - // Include all Availability Zones, Local Zones, and Wavelength Zones regardless of - // your opt-in status. - // - // If you do not use this parameter, the results include only the zones for the - // Regions where you have chosen the option to opt in. - AllAvailabilityZones *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - group-long-name - The long name of the zone group for the Availability Zone - // (for example, US West (Oregon) 1 ), the Local Zone (for example, for Zone - // group us-west-2-lax-1 , it is US West (Los Angeles) , or the Wavelength Zone - // (for example, for Zone group us-east-1-wl1 , it is US East (Verizon) . - // - // - group-name - The name of the zone group for the Availability Zone (for - // example, us-east-1-zg-1 ), the Local Zone (for example, us-west-2-lax-1 ), or - // the Wavelength Zone (for example, us-east-1-wl1 ). - // - // - message - The Zone message. - // - // - opt-in-status - The opt-in status ( opted-in | not-opted-in | - // opt-in-not-required ). - // - // - parent-zone-id - The ID of the zone that handles some of the Local Zone and - // Wavelength Zone control plane operations, such as API calls. - // - // - parent-zone-name - The ID of the zone that handles some of the Local Zone - // and Wavelength Zone control plane operations, such as API calls. - // - // - region-name - The name of the Region for the Zone (for example, us-east-1 ). - // - // - state - The state of the Availability Zone, the Local Zone, or the - // Wavelength Zone ( available | unavailable | constrained ). - // - // - zone-id - The ID of the Availability Zone (for example, use1-az1 ), the - // Local Zone (for example, usw2-lax1-az1 ), or the Wavelength Zone (for example, - // us-east-1-wl1-bos-wlz-1 ). - // - // - zone-name - The name of the Availability Zone (for example, us-east-1a ), - // the Local Zone (for example, us-west-2-lax-1a ), or the Wavelength Zone (for - // example, us-east-1-wl1-bos-wlz-1 ). - // - // - zone-type - The type of zone ( availability-zone | local-zone | - // wavelength-zone ). - Filters []types.Filter - - // The IDs of the Availability Zones, Local Zones, and Wavelength Zones. - ZoneIds []string - - // The names of the Availability Zones, Local Zones, and Wavelength Zones. - ZoneNames []string - - noSmithyDocumentSerde -} - -type DescribeAvailabilityZonesOutput struct { - - // Information about the Availability Zones, Local Zones, and Wavelength Zones. - AvailabilityZones []types.AvailabilityZone - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAvailabilityZonesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAvailabilityZones{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAvailabilityZones{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAvailabilityZones"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAvailabilityZones(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAvailabilityZones(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAvailabilityZones", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go deleted file mode 100644 index b5fda910f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the current Infrastructure Performance metric subscriptions. -func (c *Client) DescribeAwsNetworkPerformanceMetricSubscriptions(ctx context.Context, params *DescribeAwsNetworkPerformanceMetricSubscriptionsInput, optFns ...func(*Options)) (*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput, error) { - if params == nil { - params = &DescribeAwsNetworkPerformanceMetricSubscriptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAwsNetworkPerformanceMetricSubscriptions", params, optFns, c.addOperationDescribeAwsNetworkPerformanceMetricSubscriptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAwsNetworkPerformanceMetricSubscriptionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeAwsNetworkPerformanceMetricSubscriptionsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Describes the current Infrastructure Performance subscriptions. - Subscriptions []types.Subscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAwsNetworkPerformanceMetricSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeAwsNetworkPerformanceMetricSubscriptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeAwsNetworkPerformanceMetricSubscriptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAwsNetworkPerformanceMetricSubscriptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAwsNetworkPerformanceMetricSubscriptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeAwsNetworkPerformanceMetricSubscriptionsPaginatorOptions is the -// paginator options for DescribeAwsNetworkPerformanceMetricSubscriptions -type DescribeAwsNetworkPerformanceMetricSubscriptionsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator is a paginator for -// DescribeAwsNetworkPerformanceMetricSubscriptions -type DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator struct { - options DescribeAwsNetworkPerformanceMetricSubscriptionsPaginatorOptions - client DescribeAwsNetworkPerformanceMetricSubscriptionsAPIClient - params *DescribeAwsNetworkPerformanceMetricSubscriptionsInput - nextToken *string - firstPage bool -} - -// NewDescribeAwsNetworkPerformanceMetricSubscriptionsPaginator returns a new -// DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator -func NewDescribeAwsNetworkPerformanceMetricSubscriptionsPaginator(client DescribeAwsNetworkPerformanceMetricSubscriptionsAPIClient, params *DescribeAwsNetworkPerformanceMetricSubscriptionsInput, optFns ...func(*DescribeAwsNetworkPerformanceMetricSubscriptionsPaginatorOptions)) *DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator { - if params == nil { - params = &DescribeAwsNetworkPerformanceMetricSubscriptionsInput{} - } - - options := DescribeAwsNetworkPerformanceMetricSubscriptionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeAwsNetworkPerformanceMetricSubscriptions -// page. -func (p *DescribeAwsNetworkPerformanceMetricSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeAwsNetworkPerformanceMetricSubscriptions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeAwsNetworkPerformanceMetricSubscriptionsAPIClient is a client that -// implements the DescribeAwsNetworkPerformanceMetricSubscriptions operation. -type DescribeAwsNetworkPerformanceMetricSubscriptionsAPIClient interface { - DescribeAwsNetworkPerformanceMetricSubscriptions(context.Context, *DescribeAwsNetworkPerformanceMetricSubscriptionsInput, ...func(*Options)) (*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput, error) -} - -var _ DescribeAwsNetworkPerformanceMetricSubscriptionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeAwsNetworkPerformanceMetricSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAwsNetworkPerformanceMetricSubscriptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeBundleTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeBundleTasks.go deleted file mode 100644 index 96cd8f1d4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeBundleTasks.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified bundle tasks or all of your bundle tasks. -// -// Completed bundle tasks are listed for only a limited time. If your bundle task -// is no longer in the list, you can still register an AMI from it. Just use -// RegisterImage with the Amazon S3 bucket name and image manifest name you -// provided to the bundle task. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -func (c *Client) DescribeBundleTasks(ctx context.Context, params *DescribeBundleTasksInput, optFns ...func(*Options)) (*DescribeBundleTasksOutput, error) { - if params == nil { - params = &DescribeBundleTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeBundleTasks", params, optFns, c.addOperationDescribeBundleTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeBundleTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeBundleTasksInput struct { - - // The bundle task IDs. - // - // Default: Describes all your bundle tasks. - BundleIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - bundle-id - The ID of the bundle task. - // - // - error-code - If the task failed, the error code returned. - // - // - error-message - If the task failed, the error message returned. - // - // - instance-id - The ID of the instance. - // - // - progress - The level of task completion, as a percentage (for example, 20%). - // - // - s3-bucket - The Amazon S3 bucket to store the AMI. - // - // - s3-prefix - The beginning of the AMI name. - // - // - start-time - The time the task started (for example, - // 2013-09-15T17:15:20.000Z). - // - // - state - The state of the task ( pending | waiting-for-shutdown | bundling | - // storing | cancelling | complete | failed ). - // - // - update-time - The time of the most recent update for the task. - Filters []types.Filter - - noSmithyDocumentSerde -} - -type DescribeBundleTasksOutput struct { - - // Information about the bundle tasks. - BundleTasks []types.BundleTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeBundleTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeBundleTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeBundleTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeBundleTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBundleTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// BundleTaskCompleteWaiterOptions are waiter options for BundleTaskCompleteWaiter -type BundleTaskCompleteWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // BundleTaskCompleteWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, BundleTaskCompleteWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeBundleTasksInput, *DescribeBundleTasksOutput, error) (bool, error) -} - -// BundleTaskCompleteWaiter defines the waiters for BundleTaskComplete -type BundleTaskCompleteWaiter struct { - client DescribeBundleTasksAPIClient - - options BundleTaskCompleteWaiterOptions -} - -// NewBundleTaskCompleteWaiter constructs a BundleTaskCompleteWaiter. -func NewBundleTaskCompleteWaiter(client DescribeBundleTasksAPIClient, optFns ...func(*BundleTaskCompleteWaiterOptions)) *BundleTaskCompleteWaiter { - options := BundleTaskCompleteWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = bundleTaskCompleteStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &BundleTaskCompleteWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for BundleTaskComplete waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *BundleTaskCompleteWaiter) Wait(ctx context.Context, params *DescribeBundleTasksInput, maxWaitDur time.Duration, optFns ...func(*BundleTaskCompleteWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for BundleTaskComplete waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *BundleTaskCompleteWaiter) WaitForOutput(ctx context.Context, params *DescribeBundleTasksInput, maxWaitDur time.Duration, optFns ...func(*BundleTaskCompleteWaiterOptions)) (*DescribeBundleTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeBundleTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for BundleTaskComplete waiter") -} - -func bundleTaskCompleteStateRetryable(ctx context.Context, input *DescribeBundleTasksInput, output *DescribeBundleTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.BundleTasks - var v2 []types.BundleTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "complete" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.BundleTasks - var v2 []types.BundleTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeBundleTasksAPIClient is a client that implements the -// DescribeBundleTasks operation. -type DescribeBundleTasksAPIClient interface { - DescribeBundleTasks(context.Context, *DescribeBundleTasksInput, ...func(*Options)) (*DescribeBundleTasksOutput, error) -} - -var _ DescribeBundleTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeBundleTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeBundleTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeByoipCidrs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeByoipCidrs.go deleted file mode 100644 index 4fb42b255..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeByoipCidrs.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the IP address ranges that were specified in calls to ProvisionByoipCidr. -// -// To describe the address pools that were created when you provisioned the -// address ranges, use DescribePublicIpv4Poolsor DescribeIpv6Pools. -func (c *Client) DescribeByoipCidrs(ctx context.Context, params *DescribeByoipCidrsInput, optFns ...func(*Options)) (*DescribeByoipCidrsOutput, error) { - if params == nil { - params = &DescribeByoipCidrsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeByoipCidrs", params, optFns, c.addOperationDescribeByoipCidrsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeByoipCidrsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeByoipCidrsInput struct { - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - // - // This member is required. - MaxResults *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeByoipCidrsOutput struct { - - // Information about your address ranges. - ByoipCidrs []types.ByoipCidr - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeByoipCidrsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeByoipCidrs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeByoipCidrs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeByoipCidrs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeByoipCidrsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeByoipCidrs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeByoipCidrsPaginatorOptions is the paginator options for -// DescribeByoipCidrs -type DescribeByoipCidrsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeByoipCidrsPaginator is a paginator for DescribeByoipCidrs -type DescribeByoipCidrsPaginator struct { - options DescribeByoipCidrsPaginatorOptions - client DescribeByoipCidrsAPIClient - params *DescribeByoipCidrsInput - nextToken *string - firstPage bool -} - -// NewDescribeByoipCidrsPaginator returns a new DescribeByoipCidrsPaginator -func NewDescribeByoipCidrsPaginator(client DescribeByoipCidrsAPIClient, params *DescribeByoipCidrsInput, optFns ...func(*DescribeByoipCidrsPaginatorOptions)) *DescribeByoipCidrsPaginator { - if params == nil { - params = &DescribeByoipCidrsInput{} - } - - options := DescribeByoipCidrsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeByoipCidrsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeByoipCidrsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeByoipCidrs page. -func (p *DescribeByoipCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeByoipCidrsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeByoipCidrs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeByoipCidrsAPIClient is a client that implements the DescribeByoipCidrs -// operation. -type DescribeByoipCidrsAPIClient interface { - DescribeByoipCidrs(context.Context, *DescribeByoipCidrsInput, ...func(*Options)) (*DescribeByoipCidrsOutput, error) -} - -var _ DescribeByoipCidrsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeByoipCidrs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeByoipCidrs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go deleted file mode 100644 index 587de5caf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the events for the specified Capacity Block extension during the -// specified time. -func (c *Client) DescribeCapacityBlockExtensionHistory(ctx context.Context, params *DescribeCapacityBlockExtensionHistoryInput, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) { - if params == nil { - params = &DescribeCapacityBlockExtensionHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockExtensionHistory", params, optFns, c.addOperationDescribeCapacityBlockExtensionHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityBlockExtensionHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityBlockExtensionHistoryInput struct { - - // The IDs of Capacity Block reservations that you want to display the history for. - CapacityReservationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters - // - // - availability-zone - The Availability Zone of the extension. - // - // - availability-zone-id - The Availability Zone ID of the extension. - // - // - capacity-block-extension-offering-id - The ID of the extension offering. - // - // - capacity-block-extension-status - The status of the extension ( - // payment-pending | payment-failed | payment-succeeded ). - // - // - capacity-reservation-id - The reservation ID of the extension. - // - // - instance-type - The instance type of the extension. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityBlockExtensionHistoryOutput struct { - - // Describes one or more of your Capacity Block extensions. The results describe - // only the Capacity Block extensions in the Amazon Web Services Region that you're - // currently using. - CapacityBlockExtensions []types.CapacityBlockExtension - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityBlockExtensionHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockExtensionHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityBlockExtensionHistoryPaginatorOptions is the paginator options -// for DescribeCapacityBlockExtensionHistory -type DescribeCapacityBlockExtensionHistoryPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityBlockExtensionHistoryPaginator is a paginator for -// DescribeCapacityBlockExtensionHistory -type DescribeCapacityBlockExtensionHistoryPaginator struct { - options DescribeCapacityBlockExtensionHistoryPaginatorOptions - client DescribeCapacityBlockExtensionHistoryAPIClient - params *DescribeCapacityBlockExtensionHistoryInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityBlockExtensionHistoryPaginator returns a new -// DescribeCapacityBlockExtensionHistoryPaginator -func NewDescribeCapacityBlockExtensionHistoryPaginator(client DescribeCapacityBlockExtensionHistoryAPIClient, params *DescribeCapacityBlockExtensionHistoryInput, optFns ...func(*DescribeCapacityBlockExtensionHistoryPaginatorOptions)) *DescribeCapacityBlockExtensionHistoryPaginator { - if params == nil { - params = &DescribeCapacityBlockExtensionHistoryInput{} - } - - options := DescribeCapacityBlockExtensionHistoryPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityBlockExtensionHistoryPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityBlockExtensionHistoryPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityBlockExtensionHistory page. -func (p *DescribeCapacityBlockExtensionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityBlockExtensionHistory(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityBlockExtensionHistoryAPIClient is a client that implements the -// DescribeCapacityBlockExtensionHistory operation. -type DescribeCapacityBlockExtensionHistoryAPIClient interface { - DescribeCapacityBlockExtensionHistory(context.Context, *DescribeCapacityBlockExtensionHistoryInput, ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) -} - -var _ DescribeCapacityBlockExtensionHistoryAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityBlockExtensionHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go deleted file mode 100644 index e62032385..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes Capacity Block extension offerings available for purchase in the -// Amazon Web Services Region that you're currently using. -func (c *Client) DescribeCapacityBlockExtensionOfferings(ctx context.Context, params *DescribeCapacityBlockExtensionOfferingsInput, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) { - if params == nil { - params = &DescribeCapacityBlockExtensionOfferingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockExtensionOfferings", params, optFns, c.addOperationDescribeCapacityBlockExtensionOfferingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityBlockExtensionOfferingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityBlockExtensionOfferingsInput struct { - - // The duration of the Capacity Block extension offering in hours. - // - // This member is required. - CapacityBlockExtensionDurationHours *int32 - - // The ID of the Capacity reservation to be extended. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityBlockExtensionOfferingsOutput struct { - - // The recommended Capacity Block extension offerings for the dates specified. - CapacityBlockExtensionOfferings []types.CapacityBlockExtensionOffering - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityBlockExtensionOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockExtensionOfferings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCapacityBlockExtensionOfferingsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionOfferings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityBlockExtensionOfferingsPaginatorOptions is the paginator -// options for DescribeCapacityBlockExtensionOfferings -type DescribeCapacityBlockExtensionOfferingsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityBlockExtensionOfferingsPaginator is a paginator for -// DescribeCapacityBlockExtensionOfferings -type DescribeCapacityBlockExtensionOfferingsPaginator struct { - options DescribeCapacityBlockExtensionOfferingsPaginatorOptions - client DescribeCapacityBlockExtensionOfferingsAPIClient - params *DescribeCapacityBlockExtensionOfferingsInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityBlockExtensionOfferingsPaginator returns a new -// DescribeCapacityBlockExtensionOfferingsPaginator -func NewDescribeCapacityBlockExtensionOfferingsPaginator(client DescribeCapacityBlockExtensionOfferingsAPIClient, params *DescribeCapacityBlockExtensionOfferingsInput, optFns ...func(*DescribeCapacityBlockExtensionOfferingsPaginatorOptions)) *DescribeCapacityBlockExtensionOfferingsPaginator { - if params == nil { - params = &DescribeCapacityBlockExtensionOfferingsInput{} - } - - options := DescribeCapacityBlockExtensionOfferingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityBlockExtensionOfferingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityBlockExtensionOfferingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityBlockExtensionOfferings page. -func (p *DescribeCapacityBlockExtensionOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityBlockExtensionOfferings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityBlockExtensionOfferingsAPIClient is a client that implements -// the DescribeCapacityBlockExtensionOfferings operation. -type DescribeCapacityBlockExtensionOfferingsAPIClient interface { - DescribeCapacityBlockExtensionOfferings(context.Context, *DescribeCapacityBlockExtensionOfferingsInput, ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) -} - -var _ DescribeCapacityBlockExtensionOfferingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionOfferings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityBlockExtensionOfferings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockOfferings.go deleted file mode 100644 index 7cee20c8c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockOfferings.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes Capacity Block offerings available for purchase in the Amazon Web -// Services Region that you're currently using. With Capacity Blocks, you can -// purchase a specific GPU instance type or EC2 UltraServer for a period of time. -// -// To search for an available Capacity Block offering, you specify a reservation -// duration and instance count. -func (c *Client) DescribeCapacityBlockOfferings(ctx context.Context, params *DescribeCapacityBlockOfferingsInput, optFns ...func(*Options)) (*DescribeCapacityBlockOfferingsOutput, error) { - if params == nil { - params = &DescribeCapacityBlockOfferingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockOfferings", params, optFns, c.addOperationDescribeCapacityBlockOfferingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityBlockOfferingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityBlockOfferingsInput struct { - - // The reservation duration for the Capacity Block, in hours. You must specify the - // duration in 1-day increments up 14 days, and in 7-day increments up to 182 days. - // - // This member is required. - CapacityDurationHours *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The latest end date for the Capacity Block offering. - EndDateRange *time.Time - - // The number of instances for which to reserve capacity. Each Capacity Block can - // have up to 64 instances, and you can have up to 256 instances across Capacity - // Blocks. - InstanceCount *int32 - - // The type of instance for which the Capacity Block offering reserves capacity. - InstanceType *string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - // The earliest start date for the Capacity Block offering. - StartDateRange *time.Time - - // The number of EC2 UltraServers in the offerings. - UltraserverCount *int32 - - // The EC2 UltraServer type of the Capacity Block offerings. - UltraserverType *string - - noSmithyDocumentSerde -} - -type DescribeCapacityBlockOfferingsOutput struct { - - // The recommended Capacity Block offering for the dates specified. - CapacityBlockOfferings []types.CapacityBlockOffering - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityBlockOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockOfferings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockOfferings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockOfferings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCapacityBlockOfferingsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockOfferings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityBlockOfferingsPaginatorOptions is the paginator options for -// DescribeCapacityBlockOfferings -type DescribeCapacityBlockOfferingsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityBlockOfferingsPaginator is a paginator for -// DescribeCapacityBlockOfferings -type DescribeCapacityBlockOfferingsPaginator struct { - options DescribeCapacityBlockOfferingsPaginatorOptions - client DescribeCapacityBlockOfferingsAPIClient - params *DescribeCapacityBlockOfferingsInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityBlockOfferingsPaginator returns a new -// DescribeCapacityBlockOfferingsPaginator -func NewDescribeCapacityBlockOfferingsPaginator(client DescribeCapacityBlockOfferingsAPIClient, params *DescribeCapacityBlockOfferingsInput, optFns ...func(*DescribeCapacityBlockOfferingsPaginatorOptions)) *DescribeCapacityBlockOfferingsPaginator { - if params == nil { - params = &DescribeCapacityBlockOfferingsInput{} - } - - options := DescribeCapacityBlockOfferingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityBlockOfferingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityBlockOfferingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityBlockOfferings page. -func (p *DescribeCapacityBlockOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockOfferingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityBlockOfferings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityBlockOfferingsAPIClient is a client that implements the -// DescribeCapacityBlockOfferings operation. -type DescribeCapacityBlockOfferingsAPIClient interface { - DescribeCapacityBlockOfferings(context.Context, *DescribeCapacityBlockOfferingsInput, ...func(*Options)) (*DescribeCapacityBlockOfferingsOutput, error) -} - -var _ DescribeCapacityBlockOfferingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityBlockOfferings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityBlockOfferings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockStatus.go deleted file mode 100644 index b129452fb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlockStatus.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the availability of capacity for the specified Capacity blocks, or -// all of your Capacity Blocks. -func (c *Client) DescribeCapacityBlockStatus(ctx context.Context, params *DescribeCapacityBlockStatusInput, optFns ...func(*Options)) (*DescribeCapacityBlockStatusOutput, error) { - if params == nil { - params = &DescribeCapacityBlockStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockStatus", params, optFns, c.addOperationDescribeCapacityBlockStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityBlockStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityBlockStatusInput struct { - - // The ID of the Capacity Block. - CapacityBlockIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - interconnect-status - The status of the interconnect for the Capacity Block ( - // ok | impaired | insufficient-data ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityBlockStatusOutput struct { - - // The availability of capacity for a Capacity Block. - CapacityBlockStatuses []types.CapacityBlockStatus - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityBlockStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityBlockStatusPaginatorOptions is the paginator options for -// DescribeCapacityBlockStatus -type DescribeCapacityBlockStatusPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityBlockStatusPaginator is a paginator for -// DescribeCapacityBlockStatus -type DescribeCapacityBlockStatusPaginator struct { - options DescribeCapacityBlockStatusPaginatorOptions - client DescribeCapacityBlockStatusAPIClient - params *DescribeCapacityBlockStatusInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityBlockStatusPaginator returns a new -// DescribeCapacityBlockStatusPaginator -func NewDescribeCapacityBlockStatusPaginator(client DescribeCapacityBlockStatusAPIClient, params *DescribeCapacityBlockStatusInput, optFns ...func(*DescribeCapacityBlockStatusPaginatorOptions)) *DescribeCapacityBlockStatusPaginator { - if params == nil { - params = &DescribeCapacityBlockStatusInput{} - } - - options := DescribeCapacityBlockStatusPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityBlockStatusPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityBlockStatusPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityBlockStatus page. -func (p *DescribeCapacityBlockStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockStatusOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityBlockStatus(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityBlockStatusAPIClient is a client that implements the -// DescribeCapacityBlockStatus operation. -type DescribeCapacityBlockStatusAPIClient interface { - DescribeCapacityBlockStatus(context.Context, *DescribeCapacityBlockStatusInput, ...func(*Options)) (*DescribeCapacityBlockStatusOutput, error) -} - -var _ DescribeCapacityBlockStatusAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityBlockStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityBlockStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlocks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlocks.go deleted file mode 100644 index 7180b1949..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityBlocks.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes details about Capacity Blocks in the Amazon Web Services Region that -// you're currently using. -func (c *Client) DescribeCapacityBlocks(ctx context.Context, params *DescribeCapacityBlocksInput, optFns ...func(*Options)) (*DescribeCapacityBlocksOutput, error) { - if params == nil { - params = &DescribeCapacityBlocksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlocks", params, optFns, c.addOperationDescribeCapacityBlocksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityBlocksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityBlocksInput struct { - - // The IDs of the Capacity Blocks. - CapacityBlockIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - capacity-block-id - The ID of the Capacity Block. - // - // - ultraserver-type - The Capacity Block type. The type can be instances or - // ultraservers . - // - // - availability-zone - The Availability Zone of the Capacity Block. - // - // - start-date - The date and time at which the Capacity Block was started. - // - // - end-date - The date and time at which the Capacity Block expires. When a - // Capacity Block expires, all instances in the Capacity Block are terminated. - // - // - create-date - The date and time at which the Capacity Block was created. - // - // - state - The state of the Capacity Block ( active | expired | unavailable | - // cancelled | failed | scheduled | payment-pending | payment-failed ). - // - // - tags - The tags assigned to the Capacity Block. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityBlocksOutput struct { - - // The Capacity Blocks. - CapacityBlocks []types.CapacityBlock - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityBlocksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlocks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlocks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlocks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlocks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityBlocksPaginatorOptions is the paginator options for -// DescribeCapacityBlocks -type DescribeCapacityBlocksPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityBlocksPaginator is a paginator for DescribeCapacityBlocks -type DescribeCapacityBlocksPaginator struct { - options DescribeCapacityBlocksPaginatorOptions - client DescribeCapacityBlocksAPIClient - params *DescribeCapacityBlocksInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityBlocksPaginator returns a new DescribeCapacityBlocksPaginator -func NewDescribeCapacityBlocksPaginator(client DescribeCapacityBlocksAPIClient, params *DescribeCapacityBlocksInput, optFns ...func(*DescribeCapacityBlocksPaginatorOptions)) *DescribeCapacityBlocksPaginator { - if params == nil { - params = &DescribeCapacityBlocksInput{} - } - - options := DescribeCapacityBlocksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityBlocksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityBlocksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityBlocks page. -func (p *DescribeCapacityBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlocksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityBlocks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityBlocksAPIClient is a client that implements the -// DescribeCapacityBlocks operation. -type DescribeCapacityBlocksAPIClient interface { - DescribeCapacityBlocks(context.Context, *DescribeCapacityBlocksInput, ...func(*Options)) (*DescribeCapacityBlocksOutput, error) -} - -var _ DescribeCapacityBlocksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityBlocks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityBlocks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationBillingRequests.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationBillingRequests.go deleted file mode 100644 index 4e4bff5ac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationBillingRequests.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a request to assign the billing of the unused capacity of a Capacity -// Reservation. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations]. -// -// [Billing assignment for shared Amazon EC2 Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/transfer-billing.html -func (c *Client) DescribeCapacityReservationBillingRequests(ctx context.Context, params *DescribeCapacityReservationBillingRequestsInput, optFns ...func(*Options)) (*DescribeCapacityReservationBillingRequestsOutput, error) { - if params == nil { - params = &DescribeCapacityReservationBillingRequestsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityReservationBillingRequests", params, optFns, c.addOperationDescribeCapacityReservationBillingRequestsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityReservationBillingRequestsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityReservationBillingRequestsInput struct { - - // Specify one of the following: - // - // - odcr-owner - If you are the Capacity Reservation owner, specify this value - // to view requests that you have initiated. Not supported with the requested-by - // filter. - // - // - unused-reservation-billing-owner - If you are the consumer account, specify - // this value to view requests that have been sent to you. Not supported with the - // unused-reservation-billing-owner filter. - // - // This member is required. - Role types.CallerRole - - // The ID of the Capacity Reservation. - CapacityReservationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - status - The state of the request ( pending | accepted | rejected | - // cancelled | revoked | expired ). - // - // - requested-by - The account ID of the Capacity Reservation owner that - // initiated the request. Not supported if you specify requested-by for Role. - // - // - unused-reservation-billing-owner - The ID of the consumer account to which - // the request was sent. Not supported if you specify - // unused-reservation-billing-owner for Role. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityReservationBillingRequestsOutput struct { - - // Information about the request. - CapacityReservationBillingRequests []types.CapacityReservationBillingRequest - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityReservationBillingRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityReservationBillingRequests{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityReservationBillingRequests{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityReservationBillingRequests"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCapacityReservationBillingRequestsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityReservationBillingRequests(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityReservationBillingRequestsPaginatorOptions is the paginator -// options for DescribeCapacityReservationBillingRequests -type DescribeCapacityReservationBillingRequestsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityReservationBillingRequestsPaginator is a paginator for -// DescribeCapacityReservationBillingRequests -type DescribeCapacityReservationBillingRequestsPaginator struct { - options DescribeCapacityReservationBillingRequestsPaginatorOptions - client DescribeCapacityReservationBillingRequestsAPIClient - params *DescribeCapacityReservationBillingRequestsInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityReservationBillingRequestsPaginator returns a new -// DescribeCapacityReservationBillingRequestsPaginator -func NewDescribeCapacityReservationBillingRequestsPaginator(client DescribeCapacityReservationBillingRequestsAPIClient, params *DescribeCapacityReservationBillingRequestsInput, optFns ...func(*DescribeCapacityReservationBillingRequestsPaginatorOptions)) *DescribeCapacityReservationBillingRequestsPaginator { - if params == nil { - params = &DescribeCapacityReservationBillingRequestsInput{} - } - - options := DescribeCapacityReservationBillingRequestsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityReservationBillingRequestsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityReservationBillingRequestsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityReservationBillingRequests page. -func (p *DescribeCapacityReservationBillingRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityReservationBillingRequestsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityReservationBillingRequests(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityReservationBillingRequestsAPIClient is a client that implements -// the DescribeCapacityReservationBillingRequests operation. -type DescribeCapacityReservationBillingRequestsAPIClient interface { - DescribeCapacityReservationBillingRequests(context.Context, *DescribeCapacityReservationBillingRequestsInput, ...func(*Options)) (*DescribeCapacityReservationBillingRequestsOutput, error) -} - -var _ DescribeCapacityReservationBillingRequestsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityReservationBillingRequests(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityReservationBillingRequests", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationFleets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationFleets.go deleted file mode 100644 index 1ed6c8482..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservationFleets.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Capacity Reservation Fleets. -func (c *Client) DescribeCapacityReservationFleets(ctx context.Context, params *DescribeCapacityReservationFleetsInput, optFns ...func(*Options)) (*DescribeCapacityReservationFleetsOutput, error) { - if params == nil { - params = &DescribeCapacityReservationFleetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityReservationFleets", params, optFns, c.addOperationDescribeCapacityReservationFleetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityReservationFleetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityReservationFleetsInput struct { - - // The IDs of the Capacity Reservation Fleets to describe. - CapacityReservationFleetIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - state - The state of the Fleet ( submitted | modifying | active | - // partially_fulfilled | expiring | expired | cancelling | cancelled | failed ). - // - // - instance-match-criteria - The instance matching criteria for the Fleet. Only - // open is supported. - // - // - tenancy - The tenancy of the Fleet ( default | dedicated ). - // - // - allocation-strategy - The allocation strategy used by the Fleet. Only - // prioritized is supported. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityReservationFleetsOutput struct { - - // Information about the Capacity Reservation Fleets. - CapacityReservationFleets []types.CapacityReservationFleet - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityReservationFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityReservationFleets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityReservationFleets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityReservationFleets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityReservationFleets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityReservationFleetsPaginatorOptions is the paginator options for -// DescribeCapacityReservationFleets -type DescribeCapacityReservationFleetsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityReservationFleetsPaginator is a paginator for -// DescribeCapacityReservationFleets -type DescribeCapacityReservationFleetsPaginator struct { - options DescribeCapacityReservationFleetsPaginatorOptions - client DescribeCapacityReservationFleetsAPIClient - params *DescribeCapacityReservationFleetsInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityReservationFleetsPaginator returns a new -// DescribeCapacityReservationFleetsPaginator -func NewDescribeCapacityReservationFleetsPaginator(client DescribeCapacityReservationFleetsAPIClient, params *DescribeCapacityReservationFleetsInput, optFns ...func(*DescribeCapacityReservationFleetsPaginatorOptions)) *DescribeCapacityReservationFleetsPaginator { - if params == nil { - params = &DescribeCapacityReservationFleetsInput{} - } - - options := DescribeCapacityReservationFleetsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityReservationFleetsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityReservationFleetsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityReservationFleets page. -func (p *DescribeCapacityReservationFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityReservationFleetsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityReservationFleets(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityReservationFleetsAPIClient is a client that implements the -// DescribeCapacityReservationFleets operation. -type DescribeCapacityReservationFleetsAPIClient interface { - DescribeCapacityReservationFleets(context.Context, *DescribeCapacityReservationFleetsInput, ...func(*Options)) (*DescribeCapacityReservationFleetsOutput, error) -} - -var _ DescribeCapacityReservationFleetsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityReservationFleets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityReservationFleets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservations.go deleted file mode 100644 index b07e2047a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCapacityReservations.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of your Capacity Reservations. The results describe only -// the Capacity Reservations in the Amazon Web Services Region that you're -// currently using. -func (c *Client) DescribeCapacityReservations(ctx context.Context, params *DescribeCapacityReservationsInput, optFns ...func(*Options)) (*DescribeCapacityReservationsOutput, error) { - if params == nil { - params = &DescribeCapacityReservationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityReservations", params, optFns, c.addOperationDescribeCapacityReservationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapacityReservationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapacityReservationsInput struct { - - // The ID of the Capacity Reservation. - CapacityReservationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - instance-type - The type of instance for which the Capacity Reservation - // reserves capacity. - // - // - owner-id - The ID of the Amazon Web Services account that owns the Capacity - // Reservation. - // - // - instance-platform - The type of operating system for which the Capacity - // Reservation reserves capacity. - // - // - availability-zone - The Availability Zone of the Capacity Reservation. - // - // - tenancy - Indicates the tenancy of the Capacity Reservation. A Capacity - // Reservation can have one of the following tenancy settings: - // - // - default - The Capacity Reservation is created on hardware that is shared - // with other Amazon Web Services accounts. - // - // - dedicated - The Capacity Reservation is created on single-tenant hardware - // that is dedicated to a single Amazon Web Services account. - // - // - outpost-arn - The Amazon Resource Name (ARN) of the Outpost on which the - // Capacity Reservation was created. - // - // - state - The current state of the Capacity Reservation. A Capacity - // Reservation can be in one of the following states: - // - // - active - The Capacity Reservation is active and the capacity is available - // for your use. - // - // - expired - The Capacity Reservation expired automatically at the date and - // time specified in your request. The reserved capacity is no longer available for - // your use. - // - // - cancelled - The Capacity Reservation was cancelled. The reserved capacity is - // no longer available for your use. - // - // - pending - The Capacity Reservation request was successful but the capacity - // provisioning is still pending. - // - // - failed - The Capacity Reservation request has failed. A request might fail - // due to invalid request parameters, capacity constraints, or instance limit - // constraints. Failed requests are retained for 60 minutes. - // - // - start-date - The date and time at which the Capacity Reservation was started. - // - // - end-date - The date and time at which the Capacity Reservation expires. When - // a Capacity Reservation expires, the reserved capacity is released and you can no - // longer launch instances into it. The Capacity Reservation's state changes to - // expired when it reaches its end date and time. - // - // - end-date-type - Indicates the way in which the Capacity Reservation ends. A - // Capacity Reservation can have one of the following end types: - // - // - unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. - // - // - limited - The Capacity Reservation expires automatically at a specified date - // and time. - // - // - instance-match-criteria - Indicates the type of instance launches that the - // Capacity Reservation accepts. The options include: - // - // - open - The Capacity Reservation accepts all instances that have matching - // attributes (instance type, platform, and Availability Zone). Instances that have - // matching attributes launch into the Capacity Reservation automatically without - // specifying any additional parameters. - // - // - targeted - The Capacity Reservation only accepts instances that have - // matching attributes (instance type, platform, and Availability Zone), and - // explicitly target the Capacity Reservation. This ensures that only permitted - // instances can use the reserved capacity. - // - // - placement-group-arn - The ARN of the cluster placement group in which the - // Capacity Reservation was created. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCapacityReservationsOutput struct { - - // Information about the Capacity Reservations. - CapacityReservations []types.CapacityReservation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapacityReservationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityReservations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityReservations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityReservations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityReservations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCapacityReservationsPaginatorOptions is the paginator options for -// DescribeCapacityReservations -type DescribeCapacityReservationsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCapacityReservationsPaginator is a paginator for -// DescribeCapacityReservations -type DescribeCapacityReservationsPaginator struct { - options DescribeCapacityReservationsPaginatorOptions - client DescribeCapacityReservationsAPIClient - params *DescribeCapacityReservationsInput - nextToken *string - firstPage bool -} - -// NewDescribeCapacityReservationsPaginator returns a new -// DescribeCapacityReservationsPaginator -func NewDescribeCapacityReservationsPaginator(client DescribeCapacityReservationsAPIClient, params *DescribeCapacityReservationsInput, optFns ...func(*DescribeCapacityReservationsPaginatorOptions)) *DescribeCapacityReservationsPaginator { - if params == nil { - params = &DescribeCapacityReservationsInput{} - } - - options := DescribeCapacityReservationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCapacityReservationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCapacityReservationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCapacityReservations page. -func (p *DescribeCapacityReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityReservationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCapacityReservations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCapacityReservationsAPIClient is a client that implements the -// DescribeCapacityReservations operation. -type DescribeCapacityReservationsAPIClient interface { - DescribeCapacityReservations(context.Context, *DescribeCapacityReservationsInput, ...func(*Options)) (*DescribeCapacityReservationsOutput, error) -} - -var _ DescribeCapacityReservationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCapacityReservations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapacityReservations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCarrierGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCarrierGateways.go deleted file mode 100644 index 2adcf8c45..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCarrierGateways.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of your carrier gateways. -func (c *Client) DescribeCarrierGateways(ctx context.Context, params *DescribeCarrierGatewaysInput, optFns ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) { - if params == nil { - params = &DescribeCarrierGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCarrierGateways", params, optFns, c.addOperationDescribeCarrierGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCarrierGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCarrierGatewaysInput struct { - - // One or more carrier gateway IDs. - CarrierGatewayIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - carrier-gateway-id - The ID of the carrier gateway. - // - // - state - The state of the carrier gateway ( pending | failed | available | - // deleting | deleted ). - // - // - owner-id - The Amazon Web Services account ID of the owner of the carrier - // gateway. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC associated with the carrier gateway. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeCarrierGatewaysOutput struct { - - // Information about the carrier gateway. - CarrierGateways []types.CarrierGateway - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCarrierGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCarrierGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCarrierGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCarrierGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCarrierGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCarrierGatewaysPaginatorOptions is the paginator options for -// DescribeCarrierGateways -type DescribeCarrierGatewaysPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCarrierGatewaysPaginator is a paginator for DescribeCarrierGateways -type DescribeCarrierGatewaysPaginator struct { - options DescribeCarrierGatewaysPaginatorOptions - client DescribeCarrierGatewaysAPIClient - params *DescribeCarrierGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeCarrierGatewaysPaginator returns a new -// DescribeCarrierGatewaysPaginator -func NewDescribeCarrierGatewaysPaginator(client DescribeCarrierGatewaysAPIClient, params *DescribeCarrierGatewaysInput, optFns ...func(*DescribeCarrierGatewaysPaginatorOptions)) *DescribeCarrierGatewaysPaginator { - if params == nil { - params = &DescribeCarrierGatewaysInput{} - } - - options := DescribeCarrierGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCarrierGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCarrierGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCarrierGateways page. -func (p *DescribeCarrierGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCarrierGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCarrierGatewaysAPIClient is a client that implements the -// DescribeCarrierGateways operation. -type DescribeCarrierGatewaysAPIClient interface { - DescribeCarrierGateways(context.Context, *DescribeCarrierGatewaysInput, ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) -} - -var _ DescribeCarrierGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCarrierGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCarrierGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClassicLinkInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClassicLinkInstances.go deleted file mode 100644 index 6d7aa7170..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClassicLinkInstances.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Describes your linked EC2-Classic instances. This request only returns -// information about EC2-Classic instances linked to a VPC through ClassicLink. You -// cannot use this request to return information about other instances. -func (c *Client) DescribeClassicLinkInstances(ctx context.Context, params *DescribeClassicLinkInstancesInput, optFns ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) { - if params == nil { - params = &DescribeClassicLinkInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClassicLinkInstances", params, optFns, c.addOperationDescribeClassicLinkInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClassicLinkInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClassicLinkInstancesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - group-id - The ID of a VPC security group that's associated with the - // instance. - // - // - instance-id - The ID of the instance. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC to which the instance is linked. - Filters []types.Filter - - // The instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClassicLinkInstancesOutput struct { - - // Information about one or more linked EC2-Classic instances. - Instances []types.ClassicLinkInstance - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClassicLinkInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClassicLinkInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClassicLinkInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClassicLinkInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClassicLinkInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClassicLinkInstancesPaginatorOptions is the paginator options for -// DescribeClassicLinkInstances -type DescribeClassicLinkInstancesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClassicLinkInstancesPaginator is a paginator for -// DescribeClassicLinkInstances -type DescribeClassicLinkInstancesPaginator struct { - options DescribeClassicLinkInstancesPaginatorOptions - client DescribeClassicLinkInstancesAPIClient - params *DescribeClassicLinkInstancesInput - nextToken *string - firstPage bool -} - -// NewDescribeClassicLinkInstancesPaginator returns a new -// DescribeClassicLinkInstancesPaginator -func NewDescribeClassicLinkInstancesPaginator(client DescribeClassicLinkInstancesAPIClient, params *DescribeClassicLinkInstancesInput, optFns ...func(*DescribeClassicLinkInstancesPaginatorOptions)) *DescribeClassicLinkInstancesPaginator { - if params == nil { - params = &DescribeClassicLinkInstancesInput{} - } - - options := DescribeClassicLinkInstancesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClassicLinkInstancesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClassicLinkInstancesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClassicLinkInstances page. -func (p *DescribeClassicLinkInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClassicLinkInstances(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClassicLinkInstancesAPIClient is a client that implements the -// DescribeClassicLinkInstances operation. -type DescribeClassicLinkInstancesAPIClient interface { - DescribeClassicLinkInstances(context.Context, *DescribeClassicLinkInstancesInput, ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) -} - -var _ DescribeClassicLinkInstancesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClassicLinkInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClassicLinkInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go deleted file mode 100644 index 65e292c7b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the authorization rules for a specified Client VPN endpoint. -func (c *Client) DescribeClientVpnAuthorizationRules(ctx context.Context, params *DescribeClientVpnAuthorizationRulesInput, optFns ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) { - if params == nil { - params = &DescribeClientVpnAuthorizationRulesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClientVpnAuthorizationRules", params, optFns, c.addOperationDescribeClientVpnAuthorizationRulesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClientVpnAuthorizationRulesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClientVpnAuthorizationRulesInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - description - The description of the authorization rule. - // - // - destination-cidr - The CIDR of the network to which the authorization rule - // applies. - // - // - group-id - The ID of the Active Directory group to which the authorization - // rule grants access. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClientVpnAuthorizationRulesOutput struct { - - // Information about the authorization rules. - AuthorizationRules []types.AuthorizationRule - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClientVpnAuthorizationRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClientVpnAuthorizationRules{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClientVpnAuthorizationRules{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClientVpnAuthorizationRules"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeClientVpnAuthorizationRulesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClientVpnAuthorizationRules(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClientVpnAuthorizationRulesPaginatorOptions is the paginator options -// for DescribeClientVpnAuthorizationRules -type DescribeClientVpnAuthorizationRulesPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClientVpnAuthorizationRulesPaginator is a paginator for -// DescribeClientVpnAuthorizationRules -type DescribeClientVpnAuthorizationRulesPaginator struct { - options DescribeClientVpnAuthorizationRulesPaginatorOptions - client DescribeClientVpnAuthorizationRulesAPIClient - params *DescribeClientVpnAuthorizationRulesInput - nextToken *string - firstPage bool -} - -// NewDescribeClientVpnAuthorizationRulesPaginator returns a new -// DescribeClientVpnAuthorizationRulesPaginator -func NewDescribeClientVpnAuthorizationRulesPaginator(client DescribeClientVpnAuthorizationRulesAPIClient, params *DescribeClientVpnAuthorizationRulesInput, optFns ...func(*DescribeClientVpnAuthorizationRulesPaginatorOptions)) *DescribeClientVpnAuthorizationRulesPaginator { - if params == nil { - params = &DescribeClientVpnAuthorizationRulesInput{} - } - - options := DescribeClientVpnAuthorizationRulesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClientVpnAuthorizationRulesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClientVpnAuthorizationRulesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClientVpnAuthorizationRules page. -func (p *DescribeClientVpnAuthorizationRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClientVpnAuthorizationRules(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClientVpnAuthorizationRulesAPIClient is a client that implements the -// DescribeClientVpnAuthorizationRules operation. -type DescribeClientVpnAuthorizationRulesAPIClient interface { - DescribeClientVpnAuthorizationRules(context.Context, *DescribeClientVpnAuthorizationRulesInput, ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) -} - -var _ DescribeClientVpnAuthorizationRulesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClientVpnAuthorizationRules(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClientVpnAuthorizationRules", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnConnections.go deleted file mode 100644 index f6029c655..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnConnections.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes active client connections and connections that have been terminated -// within the last 60 minutes for the specified Client VPN endpoint. -func (c *Client) DescribeClientVpnConnections(ctx context.Context, params *DescribeClientVpnConnectionsInput, optFns ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) { - if params == nil { - params = &DescribeClientVpnConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClientVpnConnections", params, optFns, c.addOperationDescribeClientVpnConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClientVpnConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClientVpnConnectionsInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - connection-id - The ID of the connection. - // - // - username - For Active Directory client authentication, the user name of the - // client who established the client connection. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClientVpnConnectionsOutput struct { - - // Information about the active and terminated client connections. - Connections []types.ClientVpnConnection - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClientVpnConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClientVpnConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClientVpnConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClientVpnConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeClientVpnConnectionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClientVpnConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClientVpnConnectionsPaginatorOptions is the paginator options for -// DescribeClientVpnConnections -type DescribeClientVpnConnectionsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClientVpnConnectionsPaginator is a paginator for -// DescribeClientVpnConnections -type DescribeClientVpnConnectionsPaginator struct { - options DescribeClientVpnConnectionsPaginatorOptions - client DescribeClientVpnConnectionsAPIClient - params *DescribeClientVpnConnectionsInput - nextToken *string - firstPage bool -} - -// NewDescribeClientVpnConnectionsPaginator returns a new -// DescribeClientVpnConnectionsPaginator -func NewDescribeClientVpnConnectionsPaginator(client DescribeClientVpnConnectionsAPIClient, params *DescribeClientVpnConnectionsInput, optFns ...func(*DescribeClientVpnConnectionsPaginatorOptions)) *DescribeClientVpnConnectionsPaginator { - if params == nil { - params = &DescribeClientVpnConnectionsInput{} - } - - options := DescribeClientVpnConnectionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClientVpnConnectionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClientVpnConnectionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClientVpnConnections page. -func (p *DescribeClientVpnConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClientVpnConnections(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClientVpnConnectionsAPIClient is a client that implements the -// DescribeClientVpnConnections operation. -type DescribeClientVpnConnectionsAPIClient interface { - DescribeClientVpnConnections(context.Context, *DescribeClientVpnConnectionsInput, ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) -} - -var _ DescribeClientVpnConnectionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClientVpnConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClientVpnConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnEndpoints.go deleted file mode 100644 index 7b41afd5e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnEndpoints.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Client VPN endpoints in the account. -func (c *Client) DescribeClientVpnEndpoints(ctx context.Context, params *DescribeClientVpnEndpointsInput, optFns ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) { - if params == nil { - params = &DescribeClientVpnEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClientVpnEndpoints", params, optFns, c.addOperationDescribeClientVpnEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClientVpnEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClientVpnEndpointsInput struct { - - // The ID of the Client VPN endpoint. - ClientVpnEndpointIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - endpoint-id - The ID of the Client VPN endpoint. - // - // - transport-protocol - The transport protocol ( tcp | udp ). - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClientVpnEndpointsOutput struct { - - // Information about the Client VPN endpoints. - ClientVpnEndpoints []types.ClientVpnEndpoint - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClientVpnEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClientVpnEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClientVpnEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClientVpnEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClientVpnEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClientVpnEndpointsPaginatorOptions is the paginator options for -// DescribeClientVpnEndpoints -type DescribeClientVpnEndpointsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClientVpnEndpointsPaginator is a paginator for -// DescribeClientVpnEndpoints -type DescribeClientVpnEndpointsPaginator struct { - options DescribeClientVpnEndpointsPaginatorOptions - client DescribeClientVpnEndpointsAPIClient - params *DescribeClientVpnEndpointsInput - nextToken *string - firstPage bool -} - -// NewDescribeClientVpnEndpointsPaginator returns a new -// DescribeClientVpnEndpointsPaginator -func NewDescribeClientVpnEndpointsPaginator(client DescribeClientVpnEndpointsAPIClient, params *DescribeClientVpnEndpointsInput, optFns ...func(*DescribeClientVpnEndpointsPaginatorOptions)) *DescribeClientVpnEndpointsPaginator { - if params == nil { - params = &DescribeClientVpnEndpointsInput{} - } - - options := DescribeClientVpnEndpointsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClientVpnEndpointsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClientVpnEndpointsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClientVpnEndpoints page. -func (p *DescribeClientVpnEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClientVpnEndpoints(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClientVpnEndpointsAPIClient is a client that implements the -// DescribeClientVpnEndpoints operation. -type DescribeClientVpnEndpointsAPIClient interface { - DescribeClientVpnEndpoints(context.Context, *DescribeClientVpnEndpointsInput, ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) -} - -var _ DescribeClientVpnEndpointsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClientVpnEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClientVpnEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnRoutes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnRoutes.go deleted file mode 100644 index 5216d44d4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnRoutes.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the routes for the specified Client VPN endpoint. -func (c *Client) DescribeClientVpnRoutes(ctx context.Context, params *DescribeClientVpnRoutesInput, optFns ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) { - if params == nil { - params = &DescribeClientVpnRoutesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClientVpnRoutes", params, optFns, c.addOperationDescribeClientVpnRoutesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClientVpnRoutesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClientVpnRoutesInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - destination-cidr - The CIDR of the route destination. - // - // - origin - How the route was associated with the Client VPN endpoint ( - // associate | add-route ). - // - // - target-subnet - The ID of the subnet through which traffic is routed. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClientVpnRoutesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the Client VPN endpoint routes. - Routes []types.ClientVpnRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClientVpnRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClientVpnRoutes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClientVpnRoutes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClientVpnRoutes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeClientVpnRoutesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClientVpnRoutes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClientVpnRoutesPaginatorOptions is the paginator options for -// DescribeClientVpnRoutes -type DescribeClientVpnRoutesPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClientVpnRoutesPaginator is a paginator for DescribeClientVpnRoutes -type DescribeClientVpnRoutesPaginator struct { - options DescribeClientVpnRoutesPaginatorOptions - client DescribeClientVpnRoutesAPIClient - params *DescribeClientVpnRoutesInput - nextToken *string - firstPage bool -} - -// NewDescribeClientVpnRoutesPaginator returns a new -// DescribeClientVpnRoutesPaginator -func NewDescribeClientVpnRoutesPaginator(client DescribeClientVpnRoutesAPIClient, params *DescribeClientVpnRoutesInput, optFns ...func(*DescribeClientVpnRoutesPaginatorOptions)) *DescribeClientVpnRoutesPaginator { - if params == nil { - params = &DescribeClientVpnRoutesInput{} - } - - options := DescribeClientVpnRoutesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClientVpnRoutesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClientVpnRoutesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClientVpnRoutes page. -func (p *DescribeClientVpnRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClientVpnRoutes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClientVpnRoutesAPIClient is a client that implements the -// DescribeClientVpnRoutes operation. -type DescribeClientVpnRoutesAPIClient interface { - DescribeClientVpnRoutes(context.Context, *DescribeClientVpnRoutesInput, ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) -} - -var _ DescribeClientVpnRoutesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClientVpnRoutes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClientVpnRoutes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnTargetNetworks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnTargetNetworks.go deleted file mode 100644 index 4b586cfbb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeClientVpnTargetNetworks.go +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the target networks associated with the specified Client VPN endpoint. -func (c *Client) DescribeClientVpnTargetNetworks(ctx context.Context, params *DescribeClientVpnTargetNetworksInput, optFns ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) { - if params == nil { - params = &DescribeClientVpnTargetNetworksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClientVpnTargetNetworks", params, optFns, c.addOperationDescribeClientVpnTargetNetworksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClientVpnTargetNetworksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClientVpnTargetNetworksInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // The IDs of the target network associations. - AssociationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - association-id - The ID of the association. - // - // - target-network-id - The ID of the subnet specified as the target network. - // - // - vpc-id - The ID of the VPC in which the target network is located. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeClientVpnTargetNetworksOutput struct { - - // Information about the associated target networks. - ClientVpnTargetNetworks []types.TargetNetwork - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClientVpnTargetNetworksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeClientVpnTargetNetworks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeClientVpnTargetNetworks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClientVpnTargetNetworks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeClientVpnTargetNetworksValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClientVpnTargetNetworks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeClientVpnTargetNetworksPaginatorOptions is the paginator options for -// DescribeClientVpnTargetNetworks -type DescribeClientVpnTargetNetworksPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the nextToken - // value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClientVpnTargetNetworksPaginator is a paginator for -// DescribeClientVpnTargetNetworks -type DescribeClientVpnTargetNetworksPaginator struct { - options DescribeClientVpnTargetNetworksPaginatorOptions - client DescribeClientVpnTargetNetworksAPIClient - params *DescribeClientVpnTargetNetworksInput - nextToken *string - firstPage bool -} - -// NewDescribeClientVpnTargetNetworksPaginator returns a new -// DescribeClientVpnTargetNetworksPaginator -func NewDescribeClientVpnTargetNetworksPaginator(client DescribeClientVpnTargetNetworksAPIClient, params *DescribeClientVpnTargetNetworksInput, optFns ...func(*DescribeClientVpnTargetNetworksPaginatorOptions)) *DescribeClientVpnTargetNetworksPaginator { - if params == nil { - params = &DescribeClientVpnTargetNetworksInput{} - } - - options := DescribeClientVpnTargetNetworksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClientVpnTargetNetworksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClientVpnTargetNetworksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClientVpnTargetNetworks page. -func (p *DescribeClientVpnTargetNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClientVpnTargetNetworks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClientVpnTargetNetworksAPIClient is a client that implements the -// DescribeClientVpnTargetNetworks operation. -type DescribeClientVpnTargetNetworksAPIClient interface { - DescribeClientVpnTargetNetworks(context.Context, *DescribeClientVpnTargetNetworksInput, ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) -} - -var _ DescribeClientVpnTargetNetworksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClientVpnTargetNetworks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClientVpnTargetNetworks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCoipPools.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCoipPools.go deleted file mode 100644 index 6da91482e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCoipPools.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified customer-owned address pools or all of your -// customer-owned address pools. -func (c *Client) DescribeCoipPools(ctx context.Context, params *DescribeCoipPoolsInput, optFns ...func(*Options)) (*DescribeCoipPoolsOutput, error) { - if params == nil { - params = &DescribeCoipPoolsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCoipPools", params, optFns, c.addOperationDescribeCoipPoolsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCoipPoolsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCoipPoolsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - coip-pool.local-gateway-route-table-id - The ID of the local gateway route - // table. - // - // - coip-pool.pool-id - The ID of the address pool. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the address pools. - PoolIds []string - - noSmithyDocumentSerde -} - -type DescribeCoipPoolsOutput struct { - - // Information about the address pools. - CoipPools []types.CoipPool - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCoipPoolsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCoipPools{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCoipPools{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCoipPools"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCoipPools(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeCoipPoolsPaginatorOptions is the paginator options for DescribeCoipPools -type DescribeCoipPoolsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeCoipPoolsPaginator is a paginator for DescribeCoipPools -type DescribeCoipPoolsPaginator struct { - options DescribeCoipPoolsPaginatorOptions - client DescribeCoipPoolsAPIClient - params *DescribeCoipPoolsInput - nextToken *string - firstPage bool -} - -// NewDescribeCoipPoolsPaginator returns a new DescribeCoipPoolsPaginator -func NewDescribeCoipPoolsPaginator(client DescribeCoipPoolsAPIClient, params *DescribeCoipPoolsInput, optFns ...func(*DescribeCoipPoolsPaginatorOptions)) *DescribeCoipPoolsPaginator { - if params == nil { - params = &DescribeCoipPoolsInput{} - } - - options := DescribeCoipPoolsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeCoipPoolsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeCoipPoolsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeCoipPools page. -func (p *DescribeCoipPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCoipPoolsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeCoipPools(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeCoipPoolsAPIClient is a client that implements the DescribeCoipPools -// operation. -type DescribeCoipPoolsAPIClient interface { - DescribeCoipPools(context.Context, *DescribeCoipPoolsInput, ...func(*Options)) (*DescribeCoipPoolsOutput, error) -} - -var _ DescribeCoipPoolsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCoipPools(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCoipPools", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeConversionTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeConversionTasks.go deleted file mode 100644 index 17d0d5a55..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeConversionTasks.go +++ /dev/null @@ -1,784 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified conversion tasks or all your conversion tasks. For more -// information, see the [VM Import/Export User Guide]. -// -// For information about the import manifest referenced by this API action, see [VM Import Manifest]. -// -// [VM Import Manifest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html -// [VM Import/Export User Guide]: https://docs.aws.amazon.com/vm-import/latest/userguide/ -func (c *Client) DescribeConversionTasks(ctx context.Context, params *DescribeConversionTasksInput, optFns ...func(*Options)) (*DescribeConversionTasksOutput, error) { - if params == nil { - params = &DescribeConversionTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeConversionTasks", params, optFns, c.addOperationDescribeConversionTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeConversionTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeConversionTasksInput struct { - - // The conversion task IDs. - ConversionTaskIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeConversionTasksOutput struct { - - // Information about the conversion tasks. - ConversionTasks []types.ConversionTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeConversionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeConversionTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeConversionTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeConversionTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConversionTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ConversionTaskCancelledWaiterOptions are waiter options for -// ConversionTaskCancelledWaiter -type ConversionTaskCancelledWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ConversionTaskCancelledWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ConversionTaskCancelledWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeConversionTasksInput, *DescribeConversionTasksOutput, error) (bool, error) -} - -// ConversionTaskCancelledWaiter defines the waiters for ConversionTaskCancelled -type ConversionTaskCancelledWaiter struct { - client DescribeConversionTasksAPIClient - - options ConversionTaskCancelledWaiterOptions -} - -// NewConversionTaskCancelledWaiter constructs a ConversionTaskCancelledWaiter. -func NewConversionTaskCancelledWaiter(client DescribeConversionTasksAPIClient, optFns ...func(*ConversionTaskCancelledWaiterOptions)) *ConversionTaskCancelledWaiter { - options := ConversionTaskCancelledWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = conversionTaskCancelledStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ConversionTaskCancelledWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ConversionTaskCancelled waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *ConversionTaskCancelledWaiter) Wait(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskCancelledWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ConversionTaskCancelled waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *ConversionTaskCancelledWaiter) WaitForOutput(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskCancelledWaiterOptions)) (*DescribeConversionTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeConversionTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ConversionTaskCancelled waiter") -} - -func conversionTaskCancelledStateRetryable(ctx context.Context, input *DescribeConversionTasksInput, output *DescribeConversionTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ConversionTasks - var v2 []types.ConversionTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "cancelled" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// ConversionTaskCompletedWaiterOptions are waiter options for -// ConversionTaskCompletedWaiter -type ConversionTaskCompletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ConversionTaskCompletedWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ConversionTaskCompletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeConversionTasksInput, *DescribeConversionTasksOutput, error) (bool, error) -} - -// ConversionTaskCompletedWaiter defines the waiters for ConversionTaskCompleted -type ConversionTaskCompletedWaiter struct { - client DescribeConversionTasksAPIClient - - options ConversionTaskCompletedWaiterOptions -} - -// NewConversionTaskCompletedWaiter constructs a ConversionTaskCompletedWaiter. -func NewConversionTaskCompletedWaiter(client DescribeConversionTasksAPIClient, optFns ...func(*ConversionTaskCompletedWaiterOptions)) *ConversionTaskCompletedWaiter { - options := ConversionTaskCompletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = conversionTaskCompletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ConversionTaskCompletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ConversionTaskCompleted waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *ConversionTaskCompletedWaiter) Wait(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskCompletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ConversionTaskCompleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *ConversionTaskCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskCompletedWaiterOptions)) (*DescribeConversionTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeConversionTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ConversionTaskCompleted waiter") -} - -func conversionTaskCompletedStateRetryable(ctx context.Context, input *DescribeConversionTasksInput, output *DescribeConversionTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ConversionTasks - var v2 []types.ConversionTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "completed" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.ConversionTasks - var v2 []types.ConversionTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "cancelled" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.ConversionTasks - var v2 []types.ConversionTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "cancelling" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// ConversionTaskDeletedWaiterOptions are waiter options for -// ConversionTaskDeletedWaiter -type ConversionTaskDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ConversionTaskDeletedWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ConversionTaskDeletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeConversionTasksInput, *DescribeConversionTasksOutput, error) (bool, error) -} - -// ConversionTaskDeletedWaiter defines the waiters for ConversionTaskDeleted -type ConversionTaskDeletedWaiter struct { - client DescribeConversionTasksAPIClient - - options ConversionTaskDeletedWaiterOptions -} - -// NewConversionTaskDeletedWaiter constructs a ConversionTaskDeletedWaiter. -func NewConversionTaskDeletedWaiter(client DescribeConversionTasksAPIClient, optFns ...func(*ConversionTaskDeletedWaiterOptions)) *ConversionTaskDeletedWaiter { - options := ConversionTaskDeletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = conversionTaskDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ConversionTaskDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ConversionTaskDeleted waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *ConversionTaskDeletedWaiter) Wait(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ConversionTaskDeleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *ConversionTaskDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeConversionTasksInput, maxWaitDur time.Duration, optFns ...func(*ConversionTaskDeletedWaiterOptions)) (*DescribeConversionTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeConversionTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ConversionTaskDeleted waiter") -} - -func conversionTaskDeletedStateRetryable(ctx context.Context, input *DescribeConversionTasksInput, output *DescribeConversionTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ConversionTasks - var v2 []types.ConversionTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeConversionTasksAPIClient is a client that implements the -// DescribeConversionTasks operation. -type DescribeConversionTasksAPIClient interface { - DescribeConversionTasks(context.Context, *DescribeConversionTasksInput, ...func(*Options)) (*DescribeConversionTasksOutput, error) -} - -var _ DescribeConversionTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeConversionTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeConversionTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCustomerGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCustomerGateways.go deleted file mode 100644 index af39ca3cf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeCustomerGateways.go +++ /dev/null @@ -1,442 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes one or more of your VPN customer gateways. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) DescribeCustomerGateways(ctx context.Context, params *DescribeCustomerGatewaysInput, optFns ...func(*Options)) (*DescribeCustomerGatewaysOutput, error) { - if params == nil { - params = &DescribeCustomerGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCustomerGateways", params, optFns, c.addOperationDescribeCustomerGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCustomerGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeCustomerGateways. -type DescribeCustomerGatewaysInput struct { - - // One or more customer gateway IDs. - // - // Default: Describes all your customer gateways. - CustomerGatewayIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous - // System Number (ASN). - // - // - customer-gateway-id - The ID of the customer gateway. - // - // - ip-address - The IP address of the customer gateway device's external - // interface. - // - // - state - The state of the customer gateway ( pending | available | deleting | - // deleted ). - // - // - type - The type of customer gateway. Currently, the only supported type is - // ipsec.1 . - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - noSmithyDocumentSerde -} - -// Contains the output of DescribeCustomerGateways. -type DescribeCustomerGatewaysOutput struct { - - // Information about one or more customer gateways. - CustomerGateways []types.CustomerGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCustomerGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCustomerGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCustomerGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCustomerGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCustomerGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// CustomerGatewayAvailableWaiterOptions are waiter options for -// CustomerGatewayAvailableWaiter -type CustomerGatewayAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // CustomerGatewayAvailableWaiter will use default minimum delay of 15 seconds. - // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, CustomerGatewayAvailableWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeCustomerGatewaysInput, *DescribeCustomerGatewaysOutput, error) (bool, error) -} - -// CustomerGatewayAvailableWaiter defines the waiters for CustomerGatewayAvailable -type CustomerGatewayAvailableWaiter struct { - client DescribeCustomerGatewaysAPIClient - - options CustomerGatewayAvailableWaiterOptions -} - -// NewCustomerGatewayAvailableWaiter constructs a CustomerGatewayAvailableWaiter. -func NewCustomerGatewayAvailableWaiter(client DescribeCustomerGatewaysAPIClient, optFns ...func(*CustomerGatewayAvailableWaiterOptions)) *CustomerGatewayAvailableWaiter { - options := CustomerGatewayAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = customerGatewayAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &CustomerGatewayAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for CustomerGatewayAvailable waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *CustomerGatewayAvailableWaiter) Wait(ctx context.Context, params *DescribeCustomerGatewaysInput, maxWaitDur time.Duration, optFns ...func(*CustomerGatewayAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for CustomerGatewayAvailable waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *CustomerGatewayAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeCustomerGatewaysInput, maxWaitDur time.Duration, optFns ...func(*CustomerGatewayAvailableWaiterOptions)) (*DescribeCustomerGatewaysOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeCustomerGateways(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for CustomerGatewayAvailable waiter") -} - -func customerGatewayAvailableStateRetryable(ctx context.Context, input *DescribeCustomerGatewaysInput, output *DescribeCustomerGatewaysOutput, err error) (bool, error) { - - if err == nil { - v1 := output.CustomerGateways - var v2 []string - for _, v := range v1 { - v3 := v.State - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.CustomerGateways - var v2 []string - for _, v := range v1 { - v3 := v.State - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "deleted" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.CustomerGateways - var v2 []string - for _, v := range v1 { - v3 := v.State - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "deleting" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeCustomerGatewaysAPIClient is a client that implements the -// DescribeCustomerGateways operation. -type DescribeCustomerGatewaysAPIClient interface { - DescribeCustomerGateways(context.Context, *DescribeCustomerGatewaysInput, ...func(*Options)) (*DescribeCustomerGatewaysOutput, error) -} - -var _ DescribeCustomerGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCustomerGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCustomerGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDeclarativePoliciesReports.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDeclarativePoliciesReports.go deleted file mode 100644 index f17fce607..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDeclarativePoliciesReports.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the metadata of an account status report, including the status of the -// report. -// -// To view the full report, download it from the Amazon S3 bucket where it was -// saved. Reports are accessible only when they have the complete status. Reports -// with other statuses ( running , cancelled , or error ) are not available in the -// S3 bucket. For more information about downloading objects from an S3 bucket, see -// [Downloading objects]in the Amazon Simple Storage Service User Guide. -// -// For more information, see [Generating the account status report for declarative policies] in the Amazon Web Services Organizations User Guide. -// -// [Downloading objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/download-objects.html -// [Generating the account status report for declarative policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative_status-report.html -func (c *Client) DescribeDeclarativePoliciesReports(ctx context.Context, params *DescribeDeclarativePoliciesReportsInput, optFns ...func(*Options)) (*DescribeDeclarativePoliciesReportsOutput, error) { - if params == nil { - params = &DescribeDeclarativePoliciesReportsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeDeclarativePoliciesReports", params, optFns, c.addOperationDescribeDeclarativePoliciesReportsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeDeclarativePoliciesReportsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeDeclarativePoliciesReportsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // One or more report IDs. - ReportIds []string - - noSmithyDocumentSerde -} - -type DescribeDeclarativePoliciesReportsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The report metadata. - Reports []types.DeclarativePoliciesReport - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeDeclarativePoliciesReportsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeDeclarativePoliciesReports{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeDeclarativePoliciesReports{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDeclarativePoliciesReports"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeclarativePoliciesReports(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeDeclarativePoliciesReports(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeDeclarativePoliciesReports", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDhcpOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDhcpOptions.go deleted file mode 100644 index 5d9cd01c1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeDhcpOptions.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your DHCP option sets. The default is to describe all your DHCP -// option sets. Alternatively, you can specify specific DHCP option set IDs or -// filter the results to include only the DHCP option sets that match specific -// criteria. -// -// For more information, see [DHCP option sets] in the Amazon VPC User Guide. -// -// [DHCP option sets]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html -func (c *Client) DescribeDhcpOptions(ctx context.Context, params *DescribeDhcpOptionsInput, optFns ...func(*Options)) (*DescribeDhcpOptionsOutput, error) { - if params == nil { - params = &DescribeDhcpOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeDhcpOptions", params, optFns, c.addOperationDescribeDhcpOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeDhcpOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeDhcpOptionsInput struct { - - // The IDs of DHCP option sets. - DhcpOptionsIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - dhcp-options-id - The ID of a DHCP options set. - // - // - key - The key for one of the options (for example, domain-name ). - // - // - value - The value for one of the options. - // - // - owner-id - The ID of the Amazon Web Services account that owns the DHCP - // options set. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeDhcpOptionsOutput struct { - - // Information about the DHCP options sets. - DhcpOptions []types.DhcpOptions - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeDhcpOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeDhcpOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeDhcpOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDhcpOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDhcpOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeDhcpOptionsPaginatorOptions is the paginator options for -// DescribeDhcpOptions -type DescribeDhcpOptionsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeDhcpOptionsPaginator is a paginator for DescribeDhcpOptions -type DescribeDhcpOptionsPaginator struct { - options DescribeDhcpOptionsPaginatorOptions - client DescribeDhcpOptionsAPIClient - params *DescribeDhcpOptionsInput - nextToken *string - firstPage bool -} - -// NewDescribeDhcpOptionsPaginator returns a new DescribeDhcpOptionsPaginator -func NewDescribeDhcpOptionsPaginator(client DescribeDhcpOptionsAPIClient, params *DescribeDhcpOptionsInput, optFns ...func(*DescribeDhcpOptionsPaginatorOptions)) *DescribeDhcpOptionsPaginator { - if params == nil { - params = &DescribeDhcpOptionsInput{} - } - - options := DescribeDhcpOptionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeDhcpOptionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeDhcpOptionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeDhcpOptions page. -func (p *DescribeDhcpOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDhcpOptionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeDhcpOptions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeDhcpOptionsAPIClient is a client that implements the -// DescribeDhcpOptions operation. -type DescribeDhcpOptionsAPIClient interface { - DescribeDhcpOptions(context.Context, *DescribeDhcpOptionsInput, ...func(*Options)) (*DescribeDhcpOptionsOutput, error) -} - -var _ DescribeDhcpOptionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeDhcpOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go deleted file mode 100644 index 1e3a4d09b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your egress-only internet gateways. The default is to describe all -// your egress-only internet gateways. Alternatively, you can specify specific -// egress-only internet gateway IDs or filter the results to include only the -// egress-only internet gateways that match specific criteria. -func (c *Client) DescribeEgressOnlyInternetGateways(ctx context.Context, params *DescribeEgressOnlyInternetGatewaysInput, optFns ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - if params == nil { - params = &DescribeEgressOnlyInternetGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeEgressOnlyInternetGateways", params, optFns, c.addOperationDescribeEgressOnlyInternetGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeEgressOnlyInternetGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeEgressOnlyInternetGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of the egress-only internet gateways. - EgressOnlyInternetGatewayIds []string - - // The filters. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeEgressOnlyInternetGatewaysOutput struct { - - // Information about the egress-only internet gateways. - EgressOnlyInternetGateways []types.EgressOnlyInternetGateway - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeEgressOnlyInternetGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeEgressOnlyInternetGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeEgressOnlyInternetGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEgressOnlyInternetGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEgressOnlyInternetGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeEgressOnlyInternetGatewaysPaginatorOptions is the paginator options for -// DescribeEgressOnlyInternetGateways -type DescribeEgressOnlyInternetGatewaysPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeEgressOnlyInternetGatewaysPaginator is a paginator for -// DescribeEgressOnlyInternetGateways -type DescribeEgressOnlyInternetGatewaysPaginator struct { - options DescribeEgressOnlyInternetGatewaysPaginatorOptions - client DescribeEgressOnlyInternetGatewaysAPIClient - params *DescribeEgressOnlyInternetGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeEgressOnlyInternetGatewaysPaginator returns a new -// DescribeEgressOnlyInternetGatewaysPaginator -func NewDescribeEgressOnlyInternetGatewaysPaginator(client DescribeEgressOnlyInternetGatewaysAPIClient, params *DescribeEgressOnlyInternetGatewaysInput, optFns ...func(*DescribeEgressOnlyInternetGatewaysPaginatorOptions)) *DescribeEgressOnlyInternetGatewaysPaginator { - if params == nil { - params = &DescribeEgressOnlyInternetGatewaysInput{} - } - - options := DescribeEgressOnlyInternetGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeEgressOnlyInternetGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeEgressOnlyInternetGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeEgressOnlyInternetGateways page. -func (p *DescribeEgressOnlyInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeEgressOnlyInternetGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeEgressOnlyInternetGatewaysAPIClient is a client that implements the -// DescribeEgressOnlyInternetGateways operation. -type DescribeEgressOnlyInternetGatewaysAPIClient interface { - DescribeEgressOnlyInternetGateways(context.Context, *DescribeEgressOnlyInternetGatewaysInput, ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) -} - -var _ DescribeEgressOnlyInternetGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeEgressOnlyInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeEgressOnlyInternetGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeElasticGpus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeElasticGpus.go deleted file mode 100644 index 1daa57499..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeElasticGpus.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Amazon Elastic Graphics reached end of life on January 8, 2024. -// -// Describes the Elastic Graphics accelerator associated with your instances. -func (c *Client) DescribeElasticGpus(ctx context.Context, params *DescribeElasticGpusInput, optFns ...func(*Options)) (*DescribeElasticGpusOutput, error) { - if params == nil { - params = &DescribeElasticGpusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeElasticGpus", params, optFns, c.addOperationDescribeElasticGpusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeElasticGpusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeElasticGpusInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Elastic Graphics accelerator IDs. - ElasticGpuIds []string - - // The filters. - // - // - availability-zone - The Availability Zone in which the Elastic Graphics - // accelerator resides. - // - // - elastic-gpu-health - The status of the Elastic Graphics accelerator ( OK | - // IMPAIRED ). - // - // - elastic-gpu-state - The state of the Elastic Graphics accelerator ( ATTACHED - // ). - // - // - elastic-gpu-type - The type of Elastic Graphics accelerator; for example, - // eg1.medium . - // - // - instance-id - The ID of the instance to which the Elastic Graphics - // accelerator is associated. - Filters []types.Filter - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. - MaxResults *int32 - - // The token to request the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeElasticGpusOutput struct { - - // Information about the Elastic Graphics accelerators. - ElasticGpuSet []types.ElasticGpus - - // The total number of items to return. If the total number of items available is - // more than the value specified in max-items then a Next-Token will be provided in - // the output that you can use to resume pagination. - MaxResults *int32 - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeElasticGpusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeElasticGpus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeElasticGpus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeElasticGpus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeElasticGpus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeElasticGpus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeElasticGpus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportImageTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportImageTasks.go deleted file mode 100644 index 0fb2842c4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportImageTasks.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified export image tasks or all of your export image tasks. -func (c *Client) DescribeExportImageTasks(ctx context.Context, params *DescribeExportImageTasksInput, optFns ...func(*Options)) (*DescribeExportImageTasksOutput, error) { - if params == nil { - params = &DescribeExportImageTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeExportImageTasks", params, optFns, c.addOperationDescribeExportImageTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeExportImageTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeExportImageTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of the export image tasks. - ExportImageTaskIds []string - - // Filter tasks using the task-state filter and one of the following values: active - // , completed , deleting , or deleted . - Filters []types.Filter - - // The maximum number of results to return in a single call. - MaxResults *int32 - - // A token that indicates the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeExportImageTasksOutput struct { - - // Information about the export image tasks. - ExportImageTasks []types.ExportImageTask - - // The token to use to get the next page of results. This value is null when there - // are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeExportImageTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeExportImageTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeExportImageTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeExportImageTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExportImageTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeExportImageTasksPaginatorOptions is the paginator options for -// DescribeExportImageTasks -type DescribeExportImageTasksPaginatorOptions struct { - // The maximum number of results to return in a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeExportImageTasksPaginator is a paginator for DescribeExportImageTasks -type DescribeExportImageTasksPaginator struct { - options DescribeExportImageTasksPaginatorOptions - client DescribeExportImageTasksAPIClient - params *DescribeExportImageTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeExportImageTasksPaginator returns a new -// DescribeExportImageTasksPaginator -func NewDescribeExportImageTasksPaginator(client DescribeExportImageTasksAPIClient, params *DescribeExportImageTasksInput, optFns ...func(*DescribeExportImageTasksPaginatorOptions)) *DescribeExportImageTasksPaginator { - if params == nil { - params = &DescribeExportImageTasksInput{} - } - - options := DescribeExportImageTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeExportImageTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeExportImageTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeExportImageTasks page. -func (p *DescribeExportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportImageTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeExportImageTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeExportImageTasksAPIClient is a client that implements the -// DescribeExportImageTasks operation. -type DescribeExportImageTasksAPIClient interface { - DescribeExportImageTasks(context.Context, *DescribeExportImageTasksInput, ...func(*Options)) (*DescribeExportImageTasksOutput, error) -} - -var _ DescribeExportImageTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeExportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeExportImageTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportTasks.go deleted file mode 100644 index 4ce00435f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeExportTasks.go +++ /dev/null @@ -1,546 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified export instance tasks or all of your export instance -// tasks. -func (c *Client) DescribeExportTasks(ctx context.Context, params *DescribeExportTasksInput, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { - if params == nil { - params = &DescribeExportTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeExportTasks", params, optFns, c.addOperationDescribeExportTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeExportTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeExportTasksInput struct { - - // The export task IDs. - ExportTaskIds []string - - // the filters for the export tasks. - Filters []types.Filter - - noSmithyDocumentSerde -} - -type DescribeExportTasksOutput struct { - - // Information about the export tasks. - ExportTasks []types.ExportTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeExportTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeExportTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeExportTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExportTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ExportTaskCancelledWaiterOptions are waiter options for -// ExportTaskCancelledWaiter -type ExportTaskCancelledWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ExportTaskCancelledWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ExportTaskCancelledWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeExportTasksInput, *DescribeExportTasksOutput, error) (bool, error) -} - -// ExportTaskCancelledWaiter defines the waiters for ExportTaskCancelled -type ExportTaskCancelledWaiter struct { - client DescribeExportTasksAPIClient - - options ExportTaskCancelledWaiterOptions -} - -// NewExportTaskCancelledWaiter constructs a ExportTaskCancelledWaiter. -func NewExportTaskCancelledWaiter(client DescribeExportTasksAPIClient, optFns ...func(*ExportTaskCancelledWaiterOptions)) *ExportTaskCancelledWaiter { - options := ExportTaskCancelledWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = exportTaskCancelledStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ExportTaskCancelledWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ExportTaskCancelled waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *ExportTaskCancelledWaiter) Wait(ctx context.Context, params *DescribeExportTasksInput, maxWaitDur time.Duration, optFns ...func(*ExportTaskCancelledWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ExportTaskCancelled waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *ExportTaskCancelledWaiter) WaitForOutput(ctx context.Context, params *DescribeExportTasksInput, maxWaitDur time.Duration, optFns ...func(*ExportTaskCancelledWaiterOptions)) (*DescribeExportTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeExportTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ExportTaskCancelled waiter") -} - -func exportTaskCancelledStateRetryable(ctx context.Context, input *DescribeExportTasksInput, output *DescribeExportTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ExportTasks - var v2 []types.ExportTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "cancelled" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// ExportTaskCompletedWaiterOptions are waiter options for -// ExportTaskCompletedWaiter -type ExportTaskCompletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ExportTaskCompletedWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ExportTaskCompletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeExportTasksInput, *DescribeExportTasksOutput, error) (bool, error) -} - -// ExportTaskCompletedWaiter defines the waiters for ExportTaskCompleted -type ExportTaskCompletedWaiter struct { - client DescribeExportTasksAPIClient - - options ExportTaskCompletedWaiterOptions -} - -// NewExportTaskCompletedWaiter constructs a ExportTaskCompletedWaiter. -func NewExportTaskCompletedWaiter(client DescribeExportTasksAPIClient, optFns ...func(*ExportTaskCompletedWaiterOptions)) *ExportTaskCompletedWaiter { - options := ExportTaskCompletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = exportTaskCompletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ExportTaskCompletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ExportTaskCompleted waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *ExportTaskCompletedWaiter) Wait(ctx context.Context, params *DescribeExportTasksInput, maxWaitDur time.Duration, optFns ...func(*ExportTaskCompletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ExportTaskCompleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *ExportTaskCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeExportTasksInput, maxWaitDur time.Duration, optFns ...func(*ExportTaskCompletedWaiterOptions)) (*DescribeExportTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeExportTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ExportTaskCompleted waiter") -} - -func exportTaskCompletedStateRetryable(ctx context.Context, input *DescribeExportTasksInput, output *DescribeExportTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ExportTasks - var v2 []types.ExportTaskState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "completed" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeExportTasksAPIClient is a client that implements the -// DescribeExportTasks operation. -type DescribeExportTasksAPIClient interface { - DescribeExportTasks(context.Context, *DescribeExportTasksInput, ...func(*Options)) (*DescribeExportTasksOutput, error) -} - -var _ DescribeExportTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeExportTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeExportTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastLaunchImages.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastLaunchImages.go deleted file mode 100644 index 0494a6d4b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastLaunchImages.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describe details for Windows AMIs that are configured for Windows fast launch. -func (c *Client) DescribeFastLaunchImages(ctx context.Context, params *DescribeFastLaunchImagesInput, optFns ...func(*Options)) (*DescribeFastLaunchImagesOutput, error) { - if params == nil { - params = &DescribeFastLaunchImagesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFastLaunchImages", params, optFns, c.addOperationDescribeFastLaunchImagesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFastLaunchImagesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFastLaunchImagesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Use the following filters to streamline results. - // - // - resource-type - The resource type for pre-provisioning. - // - // - owner-id - The owner ID for the pre-provisioning resource. - // - // - state - The current state of fast launching for the Windows AMI. - Filters []types.Filter - - // Specify one or more Windows AMI image IDs for the request. - ImageIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFastLaunchImagesOutput struct { - - // A collection of details about the fast-launch enabled Windows images that meet - // the requested criteria. - FastLaunchImages []types.DescribeFastLaunchImagesSuccessItem - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFastLaunchImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFastLaunchImages{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFastLaunchImages{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFastLaunchImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFastLaunchImages(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeFastLaunchImagesPaginatorOptions is the paginator options for -// DescribeFastLaunchImages -type DescribeFastLaunchImagesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeFastLaunchImagesPaginator is a paginator for DescribeFastLaunchImages -type DescribeFastLaunchImagesPaginator struct { - options DescribeFastLaunchImagesPaginatorOptions - client DescribeFastLaunchImagesAPIClient - params *DescribeFastLaunchImagesInput - nextToken *string - firstPage bool -} - -// NewDescribeFastLaunchImagesPaginator returns a new -// DescribeFastLaunchImagesPaginator -func NewDescribeFastLaunchImagesPaginator(client DescribeFastLaunchImagesAPIClient, params *DescribeFastLaunchImagesInput, optFns ...func(*DescribeFastLaunchImagesPaginatorOptions)) *DescribeFastLaunchImagesPaginator { - if params == nil { - params = &DescribeFastLaunchImagesInput{} - } - - options := DescribeFastLaunchImagesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeFastLaunchImagesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeFastLaunchImagesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeFastLaunchImages page. -func (p *DescribeFastLaunchImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFastLaunchImagesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeFastLaunchImages(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeFastLaunchImagesAPIClient is a client that implements the -// DescribeFastLaunchImages operation. -type DescribeFastLaunchImagesAPIClient interface { - DescribeFastLaunchImages(context.Context, *DescribeFastLaunchImagesInput, ...func(*Options)) (*DescribeFastLaunchImagesOutput, error) -} - -var _ DescribeFastLaunchImagesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFastLaunchImages(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFastLaunchImages", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastSnapshotRestores.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastSnapshotRestores.go deleted file mode 100644 index 77ff4fbd1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFastSnapshotRestores.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the state of fast snapshot restores for your snapshots. -func (c *Client) DescribeFastSnapshotRestores(ctx context.Context, params *DescribeFastSnapshotRestoresInput, optFns ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) { - if params == nil { - params = &DescribeFastSnapshotRestoresInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFastSnapshotRestores", params, optFns, c.addOperationDescribeFastSnapshotRestoresMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFastSnapshotRestoresOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFastSnapshotRestoresInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. The possible values are: - // - // - availability-zone : The Availability Zone of the snapshot. - // - // - owner-id : The ID of the Amazon Web Services account that enabled fast - // snapshot restore on the snapshot. - // - // - snapshot-id : The ID of the snapshot. - // - // - state : The state of fast snapshot restores for the snapshot ( enabling | - // optimizing | enabled | disabling | disabled ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFastSnapshotRestoresOutput struct { - - // Information about the state of fast snapshot restores. - FastSnapshotRestores []types.DescribeFastSnapshotRestoreSuccessItem - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFastSnapshotRestoresMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFastSnapshotRestores"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFastSnapshotRestores(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeFastSnapshotRestoresPaginatorOptions is the paginator options for -// DescribeFastSnapshotRestores -type DescribeFastSnapshotRestoresPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeFastSnapshotRestoresPaginator is a paginator for -// DescribeFastSnapshotRestores -type DescribeFastSnapshotRestoresPaginator struct { - options DescribeFastSnapshotRestoresPaginatorOptions - client DescribeFastSnapshotRestoresAPIClient - params *DescribeFastSnapshotRestoresInput - nextToken *string - firstPage bool -} - -// NewDescribeFastSnapshotRestoresPaginator returns a new -// DescribeFastSnapshotRestoresPaginator -func NewDescribeFastSnapshotRestoresPaginator(client DescribeFastSnapshotRestoresAPIClient, params *DescribeFastSnapshotRestoresInput, optFns ...func(*DescribeFastSnapshotRestoresPaginatorOptions)) *DescribeFastSnapshotRestoresPaginator { - if params == nil { - params = &DescribeFastSnapshotRestoresInput{} - } - - options := DescribeFastSnapshotRestoresPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeFastSnapshotRestoresPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeFastSnapshotRestoresPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeFastSnapshotRestores page. -func (p *DescribeFastSnapshotRestoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeFastSnapshotRestores(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeFastSnapshotRestoresAPIClient is a client that implements the -// DescribeFastSnapshotRestores operation. -type DescribeFastSnapshotRestoresAPIClient interface { - DescribeFastSnapshotRestores(context.Context, *DescribeFastSnapshotRestoresInput, ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) -} - -var _ DescribeFastSnapshotRestoresAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFastSnapshotRestores(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFastSnapshotRestores", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetHistory.go deleted file mode 100644 index 7c6f12838..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetHistory.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes the events for the specified EC2 Fleet during the specified time. -// -// EC2 Fleet events are delayed by up to 30 seconds before they can be described. -// This ensures that you can query by the last evaluated time and not miss a -// recorded event. EC2 Fleet events are available for 48 hours. -// -// For more information, see [Monitor fleet events using Amazon EventBridge] in the Amazon EC2 User Guide. -// -// [Monitor fleet events using Amazon EventBridge]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/fleet-monitor.html -func (c *Client) DescribeFleetHistory(ctx context.Context, params *DescribeFleetHistoryInput, optFns ...func(*Options)) (*DescribeFleetHistoryOutput, error) { - if params == nil { - params = &DescribeFleetHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFleetHistory", params, optFns, c.addOperationDescribeFleetHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFleetHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFleetHistoryInput struct { - - // The ID of the EC2 Fleet. - // - // This member is required. - FleetId *string - - // The start date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - // - // This member is required. - StartTime *time.Time - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The type of events to describe. By default, all events are described. - EventType types.FleetEventType - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFleetHistoryOutput struct { - - // The ID of the EC Fleet. - FleetId *string - - // Information about the events in the history of the EC2 Fleet. - HistoryRecords []types.HistoryRecordEntry - - // The last date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). All records up to this time were retrieved. - // - // If nextToken indicates that there are more items, this value is not present. - LastEvaluatedTime *time.Time - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The start date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFleetHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFleetHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFleetHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFleetHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeFleetHistoryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFleetHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeFleetHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFleetHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetInstances.go deleted file mode 100644 index a0febff4d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleetInstances.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the running instances for the specified EC2 Fleet. -// -// Currently, DescribeFleetInstances does not support fleets of type instant . -// Instead, use DescribeFleets , specifying the instant fleet ID in the request. -// -// For more information, see [Describe your EC2 Fleet] in the Amazon EC2 User Guide. -// -// [Describe your EC2 Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet -func (c *Client) DescribeFleetInstances(ctx context.Context, params *DescribeFleetInstancesInput, optFns ...func(*Options)) (*DescribeFleetInstancesOutput, error) { - if params == nil { - params = &DescribeFleetInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFleetInstances", params, optFns, c.addOperationDescribeFleetInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFleetInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFleetInstancesInput struct { - - // The ID of the EC2 Fleet. - // - // This member is required. - FleetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - instance-type - The instance type. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFleetInstancesOutput struct { - - // The running instances. This list is refreshed periodically and might be out of - // date. - ActiveInstances []types.ActiveInstance - - // The ID of the EC2 Fleet. - FleetId *string - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFleetInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFleetInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFleetInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFleetInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeFleetInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFleetInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeFleetInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFleetInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleets.go deleted file mode 100644 index a32d0218c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFleets.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified EC2 Fleet or all of your EC2 Fleets. -// -// If a fleet is of type instant , you must specify the fleet ID in the request, -// otherwise the fleet does not appear in the response. -// -// For more information, see [Describe your EC2 Fleet] in the Amazon EC2 User Guide. -// -// [Describe your EC2 Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet -func (c *Client) DescribeFleets(ctx context.Context, params *DescribeFleetsInput, optFns ...func(*Options)) (*DescribeFleetsOutput, error) { - if params == nil { - params = &DescribeFleetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFleets", params, optFns, c.addOperationDescribeFleetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFleetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFleetsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - activity-status - The progress of the EC2 Fleet ( error | - // pending-fulfillment | pending-termination | fulfilled ). - // - // - excess-capacity-termination-policy - Indicates whether to terminate running - // instances if the target capacity is decreased below the current EC2 Fleet size ( - // true | false ). - // - // - fleet-state - The state of the EC2 Fleet ( submitted | active | deleted | - // failed | deleted-running | deleted-terminating | modifying ). - // - // - replace-unhealthy-instances - Indicates whether EC2 Fleet should replace - // unhealthy instances ( true | false ). - // - // - type - The type of request ( instant | request | maintain ). - Filters []types.Filter - - // The IDs of the EC2 Fleets. - // - // If a fleet is of type instant , you must specify the fleet ID, otherwise it does - // not appear in the response. - FleetIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFleetsOutput struct { - - // Information about the EC2 Fleets. - Fleets []types.FleetData - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFleets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFleets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFleets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFleets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeFleetsPaginatorOptions is the paginator options for DescribeFleets -type DescribeFleetsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeFleetsPaginator is a paginator for DescribeFleets -type DescribeFleetsPaginator struct { - options DescribeFleetsPaginatorOptions - client DescribeFleetsAPIClient - params *DescribeFleetsInput - nextToken *string - firstPage bool -} - -// NewDescribeFleetsPaginator returns a new DescribeFleetsPaginator -func NewDescribeFleetsPaginator(client DescribeFleetsAPIClient, params *DescribeFleetsInput, optFns ...func(*DescribeFleetsPaginatorOptions)) *DescribeFleetsPaginator { - if params == nil { - params = &DescribeFleetsInput{} - } - - options := DescribeFleetsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeFleetsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeFleetsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeFleets page. -func (p *DescribeFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeFleets(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeFleetsAPIClient is a client that implements the DescribeFleets -// operation. -type DescribeFleetsAPIClient interface { - DescribeFleets(context.Context, *DescribeFleetsInput, ...func(*Options)) (*DescribeFleetsOutput, error) -} - -var _ DescribeFleetsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFleets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFleets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFlowLogs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFlowLogs.go deleted file mode 100644 index d4dfabd3a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFlowLogs.go +++ /dev/null @@ -1,303 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more flow logs. -// -// To view the published flow log records, you must view the log destination. For -// example, the CloudWatch Logs log group, the Amazon S3 bucket, or the Kinesis -// Data Firehose delivery stream. -func (c *Client) DescribeFlowLogs(ctx context.Context, params *DescribeFlowLogsInput, optFns ...func(*Options)) (*DescribeFlowLogsOutput, error) { - if params == nil { - params = &DescribeFlowLogsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFlowLogs", params, optFns, c.addOperationDescribeFlowLogsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFlowLogsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFlowLogsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - deliver-log-status - The status of the logs delivery ( SUCCESS | FAILED ). - // - // - log-destination-type - The type of destination for the flow log data ( - // cloud-watch-logs | s3 | kinesis-data-firehose ). - // - // - flow-log-id - The ID of the flow log. - // - // - log-group-name - The name of the log group. - // - // - resource-id - The ID of the VPC, subnet, or network interface. - // - // - traffic-type - The type of traffic ( ACCEPT | REJECT | ALL ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filter []types.Filter - - // One or more flow log IDs. - // - // Constraint: Maximum of 1000 flow log IDs. - FlowLogIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to request the next page of items. Pagination continues from the end - // of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeFlowLogsOutput struct { - - // Information about the flow logs. - FlowLogs []types.FlowLog - - // The token to request the next page of items. This value is null when there are - // no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFlowLogsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFlowLogs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFlowLogs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFlowLogs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFlowLogs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeFlowLogsPaginatorOptions is the paginator options for DescribeFlowLogs -type DescribeFlowLogsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeFlowLogsPaginator is a paginator for DescribeFlowLogs -type DescribeFlowLogsPaginator struct { - options DescribeFlowLogsPaginatorOptions - client DescribeFlowLogsAPIClient - params *DescribeFlowLogsInput - nextToken *string - firstPage bool -} - -// NewDescribeFlowLogsPaginator returns a new DescribeFlowLogsPaginator -func NewDescribeFlowLogsPaginator(client DescribeFlowLogsAPIClient, params *DescribeFlowLogsInput, optFns ...func(*DescribeFlowLogsPaginatorOptions)) *DescribeFlowLogsPaginator { - if params == nil { - params = &DescribeFlowLogsInput{} - } - - options := DescribeFlowLogsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeFlowLogsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeFlowLogsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeFlowLogs page. -func (p *DescribeFlowLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFlowLogsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeFlowLogs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeFlowLogsAPIClient is a client that implements the DescribeFlowLogs -// operation. -type DescribeFlowLogsAPIClient interface { - DescribeFlowLogs(context.Context, *DescribeFlowLogsInput, ...func(*Options)) (*DescribeFlowLogsOutput, error) -} - -var _ DescribeFlowLogsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFlowLogs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFlowLogs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImageAttribute.go deleted file mode 100644 index 5118f81c4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImageAttribute.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified Amazon FPGA Image (AFI). -func (c *Client) DescribeFpgaImageAttribute(ctx context.Context, params *DescribeFpgaImageAttributeInput, optFns ...func(*Options)) (*DescribeFpgaImageAttributeOutput, error) { - if params == nil { - params = &DescribeFpgaImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFpgaImageAttribute", params, optFns, c.addOperationDescribeFpgaImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFpgaImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFpgaImageAttributeInput struct { - - // The AFI attribute. - // - // This member is required. - Attribute types.FpgaImageAttributeName - - // The ID of the AFI. - // - // This member is required. - FpgaImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeFpgaImageAttributeOutput struct { - - // Information about the attribute. - FpgaImageAttribute *types.FpgaImageAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFpgaImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFpgaImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeFpgaImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFpgaImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeFpgaImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFpgaImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImages.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImages.go deleted file mode 100644 index 0b4a9ae2c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeFpgaImages.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Amazon FPGA Images (AFIs) available to you. These include public -// AFIs, private AFIs that you own, and AFIs owned by other Amazon Web Services -// accounts for which you have load permissions. -func (c *Client) DescribeFpgaImages(ctx context.Context, params *DescribeFpgaImagesInput, optFns ...func(*Options)) (*DescribeFpgaImagesOutput, error) { - if params == nil { - params = &DescribeFpgaImagesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFpgaImages", params, optFns, c.addOperationDescribeFpgaImagesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFpgaImagesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFpgaImagesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - create-time - The creation time of the AFI. - // - // - fpga-image-id - The FPGA image identifier (AFI ID). - // - // - fpga-image-global-id - The global FPGA image identifier (AGFI ID). - // - // - name - The name of the AFI. - // - // - owner-id - The Amazon Web Services account ID of the AFI owner. - // - // - product-code - The product code. - // - // - shell-version - The version of the Amazon Web Services Shell that was used - // to create the bitstream. - // - // - state - The state of the AFI ( pending | failed | available | unavailable ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - update-time - The time of the most recent update. - Filters []types.Filter - - // The AFI IDs. - FpgaImageIds []string - - // The maximum number of results to return in a single call. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - // Filters the AFI by owner. Specify an Amazon Web Services account ID, self - // (owner is the sender of the request), or an Amazon Web Services owner alias - // (valid values are amazon | aws-marketplace ). - Owners []string - - noSmithyDocumentSerde -} - -type DescribeFpgaImagesOutput struct { - - // Information about the FPGA images. - FpgaImages []types.FpgaImage - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFpgaImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeFpgaImages{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeFpgaImages{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFpgaImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFpgaImages(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeFpgaImagesPaginatorOptions is the paginator options for -// DescribeFpgaImages -type DescribeFpgaImagesPaginatorOptions struct { - // The maximum number of results to return in a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeFpgaImagesPaginator is a paginator for DescribeFpgaImages -type DescribeFpgaImagesPaginator struct { - options DescribeFpgaImagesPaginatorOptions - client DescribeFpgaImagesAPIClient - params *DescribeFpgaImagesInput - nextToken *string - firstPage bool -} - -// NewDescribeFpgaImagesPaginator returns a new DescribeFpgaImagesPaginator -func NewDescribeFpgaImagesPaginator(client DescribeFpgaImagesAPIClient, params *DescribeFpgaImagesInput, optFns ...func(*DescribeFpgaImagesPaginatorOptions)) *DescribeFpgaImagesPaginator { - if params == nil { - params = &DescribeFpgaImagesInput{} - } - - options := DescribeFpgaImagesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeFpgaImagesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeFpgaImagesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeFpgaImages page. -func (p *DescribeFpgaImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFpgaImagesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeFpgaImages(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeFpgaImagesAPIClient is a client that implements the DescribeFpgaImages -// operation. -type DescribeFpgaImagesAPIClient interface { - DescribeFpgaImages(context.Context, *DescribeFpgaImagesInput, ...func(*Options)) (*DescribeFpgaImagesOutput, error) -} - -var _ DescribeFpgaImagesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFpgaImages(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFpgaImages", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservationOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservationOfferings.go deleted file mode 100644 index 618f462db..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservationOfferings.go +++ /dev/null @@ -1,298 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Dedicated Host reservations that are available to purchase. -// -// The results describe all of the Dedicated Host reservation offerings, including -// offerings that might not match the instance family and Region of your Dedicated -// Hosts. When purchasing an offering, ensure that the instance family and Region -// of the offering matches that of the Dedicated Hosts with which it is to be -// associated. For more information about supported instance types, see [Dedicated Hosts]in the -// Amazon EC2 User Guide. -// -// [Dedicated Hosts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html -func (c *Client) DescribeHostReservationOfferings(ctx context.Context, params *DescribeHostReservationOfferingsInput, optFns ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) { - if params == nil { - params = &DescribeHostReservationOfferingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeHostReservationOfferings", params, optFns, c.addOperationDescribeHostReservationOfferingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeHostReservationOfferingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeHostReservationOfferingsInput struct { - - // The filters. - // - // - instance-family - The instance family of the offering (for example, m4 ). - // - // - payment-option - The payment option ( NoUpfront | PartialUpfront | - // AllUpfront ). - Filter []types.Filter - - // This is the maximum duration of the reservation to purchase, specified in - // seconds. Reservations are available in one-year and three-year terms. The number - // of seconds specified must be the number of seconds in a year (365x24x60x60) - // times one of the supported durations (1 or 3). For example, specify 94608000 for - // three years. - MaxDuration *int32 - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - MaxResults *int32 - - // This is the minimum duration of the reservation you'd like to purchase, - // specified in seconds. Reservations are available in one-year and three-year - // terms. The number of seconds specified must be the number of seconds in a year - // (365x24x60x60) times one of the supported durations (1 or 3). For example, - // specify 31536000 for one year. - MinDuration *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - // The ID of the reservation offering. - OfferingId *string - - noSmithyDocumentSerde -} - -type DescribeHostReservationOfferingsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the offerings. - OfferingSet []types.HostOffering - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeHostReservationOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeHostReservationOfferings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeHostReservationOfferings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeHostReservationOfferings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHostReservationOfferings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeHostReservationOfferingsPaginatorOptions is the paginator options for -// DescribeHostReservationOfferings -type DescribeHostReservationOfferingsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeHostReservationOfferingsPaginator is a paginator for -// DescribeHostReservationOfferings -type DescribeHostReservationOfferingsPaginator struct { - options DescribeHostReservationOfferingsPaginatorOptions - client DescribeHostReservationOfferingsAPIClient - params *DescribeHostReservationOfferingsInput - nextToken *string - firstPage bool -} - -// NewDescribeHostReservationOfferingsPaginator returns a new -// DescribeHostReservationOfferingsPaginator -func NewDescribeHostReservationOfferingsPaginator(client DescribeHostReservationOfferingsAPIClient, params *DescribeHostReservationOfferingsInput, optFns ...func(*DescribeHostReservationOfferingsPaginatorOptions)) *DescribeHostReservationOfferingsPaginator { - if params == nil { - params = &DescribeHostReservationOfferingsInput{} - } - - options := DescribeHostReservationOfferingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeHostReservationOfferingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeHostReservationOfferingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeHostReservationOfferings page. -func (p *DescribeHostReservationOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeHostReservationOfferings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeHostReservationOfferingsAPIClient is a client that implements the -// DescribeHostReservationOfferings operation. -type DescribeHostReservationOfferingsAPIClient interface { - DescribeHostReservationOfferings(context.Context, *DescribeHostReservationOfferingsInput, ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) -} - -var _ DescribeHostReservationOfferingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeHostReservationOfferings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeHostReservationOfferings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservations.go deleted file mode 100644 index 691768d3a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHostReservations.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes reservations that are associated with Dedicated Hosts in your account. -func (c *Client) DescribeHostReservations(ctx context.Context, params *DescribeHostReservationsInput, optFns ...func(*Options)) (*DescribeHostReservationsOutput, error) { - if params == nil { - params = &DescribeHostReservationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeHostReservations", params, optFns, c.addOperationDescribeHostReservationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeHostReservationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeHostReservationsInput struct { - - // The filters. - // - // - instance-family - The instance family (for example, m4 ). - // - // - payment-option - The payment option ( NoUpfront | PartialUpfront | - // AllUpfront ). - // - // - state - The state of the reservation ( payment-pending | payment-failed | - // active | retired ). - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filter []types.Filter - - // The host reservation IDs. - HostReservationIdSet []string - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeHostReservationsOutput struct { - - // Details about the reservation's configuration. - HostReservationSet []types.HostReservation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeHostReservationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeHostReservations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeHostReservations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeHostReservations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHostReservations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeHostReservationsPaginatorOptions is the paginator options for -// DescribeHostReservations -type DescribeHostReservationsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeHostReservationsPaginator is a paginator for DescribeHostReservations -type DescribeHostReservationsPaginator struct { - options DescribeHostReservationsPaginatorOptions - client DescribeHostReservationsAPIClient - params *DescribeHostReservationsInput - nextToken *string - firstPage bool -} - -// NewDescribeHostReservationsPaginator returns a new -// DescribeHostReservationsPaginator -func NewDescribeHostReservationsPaginator(client DescribeHostReservationsAPIClient, params *DescribeHostReservationsInput, optFns ...func(*DescribeHostReservationsPaginatorOptions)) *DescribeHostReservationsPaginator { - if params == nil { - params = &DescribeHostReservationsInput{} - } - - options := DescribeHostReservationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeHostReservationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeHostReservationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeHostReservations page. -func (p *DescribeHostReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeHostReservations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeHostReservationsAPIClient is a client that implements the -// DescribeHostReservations operation. -type DescribeHostReservationsAPIClient interface { - DescribeHostReservations(context.Context, *DescribeHostReservationsInput, ...func(*Options)) (*DescribeHostReservationsOutput, error) -} - -var _ DescribeHostReservationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeHostReservations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeHostReservations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHosts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHosts.go deleted file mode 100644 index 07758c6fe..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeHosts.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Dedicated Hosts or all your Dedicated Hosts. -// -// The results describe only the Dedicated Hosts in the Region you're currently -// using. All listed instances consume capacity on your Dedicated Host. Dedicated -// Hosts that have recently been released are listed with the state released . -func (c *Client) DescribeHosts(ctx context.Context, params *DescribeHostsInput, optFns ...func(*Options)) (*DescribeHostsOutput, error) { - if params == nil { - params = &DescribeHostsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeHosts", params, optFns, c.addOperationDescribeHostsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeHostsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeHostsInput struct { - - // The filters. - // - // - auto-placement - Whether auto-placement is enabled or disabled ( on | off ). - // - // - availability-zone - The Availability Zone of the host. - // - // - client-token - The idempotency token that you provided when you allocated - // the host. - // - // - host-reservation-id - The ID of the reservation assigned to this host. - // - // - instance-type - The instance type size that the Dedicated Host is configured - // to support. - // - // - state - The allocation state of the Dedicated Host ( available | - // under-assessment | permanent-failure | released | released-permanent-failure ). - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filter []types.Filter - - // The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches. - HostIds []string - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - // - // You cannot specify this parameter and the host IDs parameter in the same - // request. - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeHostsOutput struct { - - // Information about the Dedicated Hosts. - Hosts []types.Host - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeHostsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeHosts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeHosts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeHosts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHosts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeHostsPaginatorOptions is the paginator options for DescribeHosts -type DescribeHostsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - // - // You cannot specify this parameter and the host IDs parameter in the same - // request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeHostsPaginator is a paginator for DescribeHosts -type DescribeHostsPaginator struct { - options DescribeHostsPaginatorOptions - client DescribeHostsAPIClient - params *DescribeHostsInput - nextToken *string - firstPage bool -} - -// NewDescribeHostsPaginator returns a new DescribeHostsPaginator -func NewDescribeHostsPaginator(client DescribeHostsAPIClient, params *DescribeHostsInput, optFns ...func(*DescribeHostsPaginatorOptions)) *DescribeHostsPaginator { - if params == nil { - params = &DescribeHostsInput{} - } - - options := DescribeHostsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeHostsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeHostsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeHosts page. -func (p *DescribeHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeHosts(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeHostsAPIClient is a client that implements the DescribeHosts operation. -type DescribeHostsAPIClient interface { - DescribeHosts(context.Context, *DescribeHostsInput, ...func(*Options)) (*DescribeHostsOutput, error) -} - -var _ DescribeHostsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeHosts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeHosts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go deleted file mode 100644 index 1a05ef069..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your IAM instance profile associations. -func (c *Client) DescribeIamInstanceProfileAssociations(ctx context.Context, params *DescribeIamInstanceProfileAssociationsInput, optFns ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) { - if params == nil { - params = &DescribeIamInstanceProfileAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIamInstanceProfileAssociations", params, optFns, c.addOperationDescribeIamInstanceProfileAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIamInstanceProfileAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIamInstanceProfileAssociationsInput struct { - - // The IAM instance profile associations. - AssociationIds []string - - // The filters. - // - // - instance-id - The ID of the instance. - // - // - state - The state of the association ( associating | associated | - // disassociating ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIamInstanceProfileAssociationsOutput struct { - - // Information about the IAM instance profile associations. - IamInstanceProfileAssociations []types.IamInstanceProfileAssociation - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIamInstanceProfileAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIamInstanceProfileAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIamInstanceProfileAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIamInstanceProfileAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIamInstanceProfileAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIamInstanceProfileAssociationsPaginatorOptions is the paginator options -// for DescribeIamInstanceProfileAssociations -type DescribeIamInstanceProfileAssociationsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIamInstanceProfileAssociationsPaginator is a paginator for -// DescribeIamInstanceProfileAssociations -type DescribeIamInstanceProfileAssociationsPaginator struct { - options DescribeIamInstanceProfileAssociationsPaginatorOptions - client DescribeIamInstanceProfileAssociationsAPIClient - params *DescribeIamInstanceProfileAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeIamInstanceProfileAssociationsPaginator returns a new -// DescribeIamInstanceProfileAssociationsPaginator -func NewDescribeIamInstanceProfileAssociationsPaginator(client DescribeIamInstanceProfileAssociationsAPIClient, params *DescribeIamInstanceProfileAssociationsInput, optFns ...func(*DescribeIamInstanceProfileAssociationsPaginatorOptions)) *DescribeIamInstanceProfileAssociationsPaginator { - if params == nil { - params = &DescribeIamInstanceProfileAssociationsInput{} - } - - options := DescribeIamInstanceProfileAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIamInstanceProfileAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIamInstanceProfileAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIamInstanceProfileAssociations page. -func (p *DescribeIamInstanceProfileAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIamInstanceProfileAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIamInstanceProfileAssociationsAPIClient is a client that implements the -// DescribeIamInstanceProfileAssociations operation. -type DescribeIamInstanceProfileAssociationsAPIClient interface { - DescribeIamInstanceProfileAssociations(context.Context, *DescribeIamInstanceProfileAssociationsInput, ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) -} - -var _ DescribeIamInstanceProfileAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIamInstanceProfileAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIamInstanceProfileAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdFormat.go deleted file mode 100644 index 58dbb612f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdFormat.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the ID format settings for your resources on a per-Region basis, for -// example, to view which resource types are enabled for longer IDs. This request -// only returns information about resource types whose ID formats can be modified; -// it does not return information about other resource types. -// -// The following resource types support longer IDs: bundle | conversion-task | -// customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway | -// network-acl | network-acl-association | network-interface | -// network-interface-attachment | prefix-list | reservation | route-table | -// route-table-association | security-group | snapshot | subnet | -// subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | -// vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway . -// -// These settings apply to the IAM user who makes the request; they do not apply -// to the entire Amazon Web Services account. By default, an IAM user defaults to -// the same settings as the root user, unless they explicitly override the settings -// by running the ModifyIdFormatcommand. Resources created with longer IDs are visible to all -// IAM users, regardless of these settings and provided that they have permission -// to use the relevant Describe command for the resource type. -func (c *Client) DescribeIdFormat(ctx context.Context, params *DescribeIdFormatInput, optFns ...func(*Options)) (*DescribeIdFormatOutput, error) { - if params == nil { - params = &DescribeIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIdFormat", params, optFns, c.addOperationDescribeIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIdFormatInput struct { - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | - // image | import-task | instance | internet-gateway | network-acl | - // network-acl-association | network-interface | network-interface-attachment | - // prefix-list | reservation | route-table | route-table-association | - // security-group | snapshot | subnet | subnet-cidr-block-association | volume | - // vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | - // vpn-connection | vpn-gateway - Resource *string - - noSmithyDocumentSerde -} - -type DescribeIdFormatOutput struct { - - // Information about the ID format for the resource. - Statuses []types.IdFormat - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdentityIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdentityIdFormat.go deleted file mode 100644 index 4753f2350..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIdentityIdFormat.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the ID format settings for resources for the specified IAM user, IAM -// role, or root user. For example, you can view the resource types that are -// enabled for longer IDs. This request only returns information about resource -// types whose ID formats can be modified; it does not return information about -// other resource types. For more information, see [Resource IDs]in the Amazon Elastic Compute -// Cloud User Guide. -// -// The following resource types support longer IDs: bundle | conversion-task | -// customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway | -// network-acl | network-acl-association | network-interface | -// network-interface-attachment | prefix-list | reservation | route-table | -// route-table-association | security-group | snapshot | subnet | -// subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | -// vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway . -// -// These settings apply to the principal specified in the request. They do not -// apply to the principal that makes the request. -// -// [Resource IDs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html -func (c *Client) DescribeIdentityIdFormat(ctx context.Context, params *DescribeIdentityIdFormatInput, optFns ...func(*Options)) (*DescribeIdentityIdFormatOutput, error) { - if params == nil { - params = &DescribeIdentityIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIdentityIdFormat", params, optFns, c.addOperationDescribeIdentityIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIdentityIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIdentityIdFormatInput struct { - - // The ARN of the principal, which can be an IAM role, IAM user, or the root user. - // - // This member is required. - PrincipalArn *string - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | - // image | import-task | instance | internet-gateway | network-acl | - // network-acl-association | network-interface | network-interface-attachment | - // prefix-list | reservation | route-table | route-table-association | - // security-group | snapshot | subnet | subnet-cidr-block-association | volume | - // vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | - // vpn-connection | vpn-gateway - Resource *string - - noSmithyDocumentSerde -} - -type DescribeIdentityIdFormatOutput struct { - - // Information about the ID format for the resources. - Statuses []types.IdFormat - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIdentityIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIdentityIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIdentityIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIdentityIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeIdentityIdFormatValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIdentityIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeIdentityIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIdentityIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImageAttribute.go deleted file mode 100644 index 04a844ac0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImageAttribute.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified AMI. You can specify only -// one attribute at a time. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -func (c *Client) DescribeImageAttribute(ctx context.Context, params *DescribeImageAttributeInput, optFns ...func(*Options)) (*DescribeImageAttributeOutput, error) { - if params == nil { - params = &DescribeImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeImageAttribute", params, optFns, c.addOperationDescribeImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeImageAttribute. -type DescribeImageAttributeInput struct { - - // The AMI attribute. - // - // Note: The blockDeviceMapping attribute is deprecated. Using this attribute - // returns the Client.AuthFailure error. To get information about the block device - // mappings for an AMI, use the DescribeImagesaction. - // - // This member is required. - Attribute types.ImageAttributeName - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Describes an image attribute. -type DescribeImageAttributeOutput struct { - - // The block device mapping entries. - BlockDeviceMappings []types.BlockDeviceMapping - - // The boot mode. - BootMode *types.AttributeValue - - // Indicates whether deregistration protection is enabled for the AMI. - DeregistrationProtection *types.AttributeValue - - // A description for the AMI. - Description *types.AttributeValue - - // The ID of the AMI. - ImageId *string - - // If v2.0 , it indicates that IMDSv2 is specified in the AMI. Instances launched - // from this AMI will have HttpTokens automatically set to required so that, by - // default, the instance requires that IMDSv2 is used when requesting instance - // metadata. In addition, HttpPutResponseHopLimit is set to 2 . For more - // information, see [Configure the AMI]in the Amazon EC2 User Guide. - // - // [Configure the AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration - ImdsSupport *types.AttributeValue - - // The kernel ID. - KernelId *types.AttributeValue - - // The date and time, in [ISO 8601 date-time format], when the AMI was last used to launch an EC2 instance. - // When the AMI is used to launch an instance, there is a 24-hour delay before that - // usage is reported. - // - // lastLaunchedTime data is available starting April 2017. - // - // [ISO 8601 date-time format]: http://www.iso.org/iso/iso8601 - LastLaunchedTime *types.AttributeValue - - // The launch permissions. - LaunchPermissions []types.LaunchPermission - - // The product codes. - ProductCodes []types.ProductCode - - // The RAM disk ID. - RamdiskId *types.AttributeValue - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *types.AttributeValue - - // If the image is configured for NitroTPM support, the value is v2.0 . - TpmSupport *types.AttributeValue - - // Base64 representation of the non-volatile UEFI variable store. To retrieve the - // UEFI data, use the [GetInstanceUefiData]command. You can inspect and modify the UEFI data by using - // the [python-uefivars tool]on GitHub. For more information, see [UEFI Secure Boot for Amazon EC2 instances] in the Amazon EC2 User Guide. - // - // [UEFI Secure Boot for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/uefi-secure-boot.html - // [GetInstanceUefiData]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceUefiData - // [python-uefivars tool]: https://github.com/awslabs/python-uefivars - UefiData *types.AttributeValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImages.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImages.go deleted file mode 100644 index ba0a7736a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImages.go +++ /dev/null @@ -1,848 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes the specified images (AMIs, AKIs, and ARIs) available to you or all -// of the images available to you. -// -// The images available to you include public images, private images that you own, -// and private images owned by other Amazon Web Services accounts for which you -// have explicit launch permissions. -// -// Recently deregistered images appear in the returned results for a short -// interval and then return empty results. After all instances that reference a -// deregistered AMI are terminated, specifying the ID of the image will eventually -// return an error indicating that the AMI ID cannot be found. -// -// When Allowed AMIs is set to enabled , only allowed images are returned in the -// results, with the imageAllowed field set to true for each image. In audit-mode , -// the imageAllowed field is set to true for images that meet the account's -// Allowed AMIs criteria, and false for images that don't meet the criteria. For -// more information, see EnableAllowedImagesSettings. -// -// The Amazon EC2 API follows an eventual consistency model. This means that the -// result of an API command you run that creates or modifies resources might not be -// immediately available to all subsequent commands you run. For guidance on how to -// manage eventual consistency, see [Eventual consistency in the Amazon EC2 API]in the Amazon EC2 Developer Guide. -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Eventual consistency in the Amazon EC2 API]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -func (c *Client) DescribeImages(ctx context.Context, params *DescribeImagesInput, optFns ...func(*Options)) (*DescribeImagesOutput, error) { - if params == nil { - params = &DescribeImagesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeImages", params, optFns, c.addOperationDescribeImagesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeImagesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeImagesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Scopes the images by users with explicit launch permissions. Specify an Amazon - // Web Services account ID, self (the sender of the request), or all (public AMIs). - // - // - If you specify an Amazon Web Services account ID that is not your own, only - // AMIs shared with that specific Amazon Web Services account ID are returned. - // However, AMIs that are shared with the account’s organization or organizational - // unit (OU) are not returned. - // - // - If you specify self or your own Amazon Web Services account ID, AMIs shared - // with your account are returned. In addition, AMIs that are shared with the - // organization or OU of which you are member are also returned. - // - // - If you specify all , all public AMIs are returned. - ExecutableUsers []string - - // The filters. - // - // - architecture - The image architecture ( i386 | x86_64 | arm64 | x86_64_mac | - // arm64_mac ). - // - // - block-device-mapping.delete-on-termination - A Boolean value that indicates - // whether the Amazon EBS volume is deleted on instance termination. - // - // - block-device-mapping.device-name - The device name specified in the block - // device mapping (for example, /dev/sdh or xvdh ). - // - // - block-device-mapping.snapshot-id - The ID of the snapshot used for the - // Amazon EBS volume. - // - // - block-device-mapping.volume-size - The volume size of the Amazon EBS volume, - // in GiB. - // - // - block-device-mapping.volume-type - The volume type of the Amazon EBS volume ( - // io1 | io2 | gp2 | gp3 | sc1 | st1 | standard ). - // - // - block-device-mapping.encrypted - A Boolean that indicates whether the Amazon - // EBS volume is encrypted. - // - // - creation-date - The time when the image was created, in the ISO 8601 format - // in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, - // 2021-09-29T11:04:43.305Z . You can use a wildcard ( * ), for example, - // 2021-09-29T* , which matches an entire day. - // - // - description - The description of the image (provided during image creation). - // - // - ena-support - A Boolean that indicates whether enhanced networking with ENA - // is enabled. - // - // - free-tier-eligible - A Boolean that indicates whether this image can be used - // under the Amazon Web Services Free Tier ( true | false ). - // - // - hypervisor - The hypervisor type ( ovm | xen ). - // - // - image-allowed - A Boolean that indicates whether the image meets the - // criteria specified for Allowed AMIs. - // - // - image-id - The ID of the image. - // - // - image-type - The image type ( machine | kernel | ramdisk ). - // - // - is-public - A Boolean that indicates whether the image is public. - // - // - kernel-id - The kernel ID. - // - // - manifest-location - The location of the image manifest. - // - // - name - The name of the AMI (provided during image creation). - // - // - owner-alias - The owner alias ( amazon | aws-backup-vault | aws-marketplace - // ). The valid aliases are defined in an Amazon-maintained list. This is not the - // Amazon Web Services account alias that can be set using the IAM console. We - // recommend that you use the Owner request parameter instead of this filter. - // - // - owner-id - The Amazon Web Services account ID of the owner. We recommend - // that you use the Owner request parameter instead of this filter. - // - // - platform - The platform. The only supported value is windows . - // - // - product-code - The product code. - // - // - product-code.type - The type of the product code ( marketplace ). - // - // - ramdisk-id - The RAM disk ID. - // - // - root-device-name - The device name of the root device volume (for example, - // /dev/sda1 ). - // - // - root-device-type - The type of the root device volume ( ebs | instance-store - // ). - // - // - source-image-id - The ID of the source AMI from which the AMI was created. - // - // - source-image-region - The Region of the source AMI. - // - // - source-instance-id - The ID of the instance that the AMI was created from if - // the AMI was created using CreateImage. This filter is applicable only if the AMI - // was created using [CreateImage]. - // - // - state - The state of the image ( available | pending | failed ). - // - // - state-reason-code - The reason code for the state change. - // - // - state-reason-message - The message for the state change. - // - // - sriov-net-support - A value of simple indicates that enhanced networking - // with the Intel 82599 VF interface is enabled. - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - virtualization-type - The virtualization type ( paravirtual | hvm ). - // - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - Filters []types.Filter - - // The image IDs. - // - // Default: Describes all images available to you. - ImageIds []string - - // Specifies whether to include deprecated AMIs. - // - // Default: No deprecated AMIs are included in the response. - // - // If you are the AMI owner, all deprecated AMIs appear in the response regardless - // of what you specify for this parameter. - IncludeDeprecated *bool - - // Specifies whether to include disabled AMIs. - // - // Default: No disabled AMIs are included in the response. - IncludeDisabled *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // Scopes the results to images with the specified owners. You can specify a - // combination of Amazon Web Services account IDs, self , amazon , aws-backup-vault - // , and aws-marketplace . If you omit this parameter, the results include all - // images for which you have launch permissions, regardless of ownership. - Owners []string - - noSmithyDocumentSerde -} - -type DescribeImagesOutput struct { - - // Information about the images. - Images []types.Image - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeImages{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeImages{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImages"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImages(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ImageAvailableWaiterOptions are waiter options for ImageAvailableWaiter -type ImageAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ImageAvailableWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ImageAvailableWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeImagesInput, *DescribeImagesOutput, error) (bool, error) -} - -// ImageAvailableWaiter defines the waiters for ImageAvailable -type ImageAvailableWaiter struct { - client DescribeImagesAPIClient - - options ImageAvailableWaiterOptions -} - -// NewImageAvailableWaiter constructs a ImageAvailableWaiter. -func NewImageAvailableWaiter(client DescribeImagesAPIClient, optFns ...func(*ImageAvailableWaiterOptions)) *ImageAvailableWaiter { - options := ImageAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = imageAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ImageAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ImageAvailable waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *ImageAvailableWaiter) Wait(ctx context.Context, params *DescribeImagesInput, maxWaitDur time.Duration, optFns ...func(*ImageAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ImageAvailable waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *ImageAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeImagesInput, maxWaitDur time.Duration, optFns ...func(*ImageAvailableWaiterOptions)) (*DescribeImagesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeImages(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ImageAvailable waiter") -} - -func imageAvailableStateRetryable(ctx context.Context, input *DescribeImagesInput, output *DescribeImagesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Images - var v2 []types.ImageState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Images - var v2 []types.ImageState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// ImageExistsWaiterOptions are waiter options for ImageExistsWaiter -type ImageExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ImageExistsWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ImageExistsWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeImagesInput, *DescribeImagesOutput, error) (bool, error) -} - -// ImageExistsWaiter defines the waiters for ImageExists -type ImageExistsWaiter struct { - client DescribeImagesAPIClient - - options ImageExistsWaiterOptions -} - -// NewImageExistsWaiter constructs a ImageExistsWaiter. -func NewImageExistsWaiter(client DescribeImagesAPIClient, optFns ...func(*ImageExistsWaiterOptions)) *ImageExistsWaiter { - options := ImageExistsWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = imageExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ImageExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ImageExists waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *ImageExistsWaiter) Wait(ctx context.Context, params *DescribeImagesInput, maxWaitDur time.Duration, optFns ...func(*ImageExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ImageExists waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *ImageExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeImagesInput, maxWaitDur time.Duration, optFns ...func(*ImageExistsWaiterOptions)) (*DescribeImagesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeImages(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ImageExists waiter") -} - -func imageExistsStateRetryable(ctx context.Context, input *DescribeImagesInput, output *DescribeImagesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Images - v2 := len(v1) - v3 := 0 - v4 := int64(v2) > int64(v3) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v4 == bv { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidAMIID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeImagesPaginatorOptions is the paginator options for DescribeImages -type DescribeImagesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeImagesPaginator is a paginator for DescribeImages -type DescribeImagesPaginator struct { - options DescribeImagesPaginatorOptions - client DescribeImagesAPIClient - params *DescribeImagesInput - nextToken *string - firstPage bool -} - -// NewDescribeImagesPaginator returns a new DescribeImagesPaginator -func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { - if params == nil { - params = &DescribeImagesInput{} - } - - options := DescribeImagesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeImagesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeImagesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeImages page. -func (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeImages(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeImagesAPIClient is a client that implements the DescribeImages -// operation. -type DescribeImagesAPIClient interface { - DescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error) -} - -var _ DescribeImagesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeImages", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportImageTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportImageTasks.go deleted file mode 100644 index 39339ad12..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportImageTasks.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Displays details about an import virtual machine or import snapshot tasks that -// are already created. -func (c *Client) DescribeImportImageTasks(ctx context.Context, params *DescribeImportImageTasksInput, optFns ...func(*Options)) (*DescribeImportImageTasksOutput, error) { - if params == nil { - params = &DescribeImportImageTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeImportImageTasks", params, optFns, c.addOperationDescribeImportImageTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeImportImageTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeImportImageTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Filter tasks using the task-state filter and one of the following values: active - // , completed , deleting , or deleted . - Filters []types.Filter - - // The IDs of the import image tasks. - ImportTaskIds []string - - // The maximum number of results to return in a single call. - MaxResults *int32 - - // A token that indicates the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeImportImageTasksOutput struct { - - // A list of zero or more import image tasks that are currently active or were - // completed or canceled in the previous 7 days. - ImportImageTasks []types.ImportImageTask - - // The token to use to get the next page of results. This value is null when there - // are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeImportImageTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeImportImageTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeImportImageTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImportImageTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImportImageTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeImportImageTasksPaginatorOptions is the paginator options for -// DescribeImportImageTasks -type DescribeImportImageTasksPaginatorOptions struct { - // The maximum number of results to return in a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeImportImageTasksPaginator is a paginator for DescribeImportImageTasks -type DescribeImportImageTasksPaginator struct { - options DescribeImportImageTasksPaginatorOptions - client DescribeImportImageTasksAPIClient - params *DescribeImportImageTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeImportImageTasksPaginator returns a new -// DescribeImportImageTasksPaginator -func NewDescribeImportImageTasksPaginator(client DescribeImportImageTasksAPIClient, params *DescribeImportImageTasksInput, optFns ...func(*DescribeImportImageTasksPaginatorOptions)) *DescribeImportImageTasksPaginator { - if params == nil { - params = &DescribeImportImageTasksInput{} - } - - options := DescribeImportImageTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeImportImageTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeImportImageTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeImportImageTasks page. -func (p *DescribeImportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportImageTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeImportImageTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeImportImageTasksAPIClient is a client that implements the -// DescribeImportImageTasks operation. -type DescribeImportImageTasksAPIClient interface { - DescribeImportImageTasks(context.Context, *DescribeImportImageTasksInput, ...func(*Options)) (*DescribeImportImageTasksOutput, error) -} - -var _ DescribeImportImageTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeImportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeImportImageTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportSnapshotTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportSnapshotTasks.go deleted file mode 100644 index d29680d29..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeImportSnapshotTasks.go +++ /dev/null @@ -1,497 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes your import snapshot tasks. -func (c *Client) DescribeImportSnapshotTasks(ctx context.Context, params *DescribeImportSnapshotTasksInput, optFns ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) { - if params == nil { - params = &DescribeImportSnapshotTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeImportSnapshotTasks", params, optFns, c.addOperationDescribeImportSnapshotTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeImportSnapshotTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeImportSnapshotTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - Filters []types.Filter - - // A list of import snapshot task IDs. - ImportTaskIds []string - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int32 - - // A token that indicates the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeImportSnapshotTasksOutput struct { - - // A list of zero or more import snapshot tasks that are currently active or were - // completed or canceled in the previous 7 days. - ImportSnapshotTasks []types.ImportSnapshotTask - - // The token to use to get the next page of results. This value is null when there - // are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeImportSnapshotTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeImportSnapshotTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeImportSnapshotTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeImportSnapshotTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImportSnapshotTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SnapshotImportedWaiterOptions are waiter options for SnapshotImportedWaiter -type SnapshotImportedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SnapshotImportedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SnapshotImportedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeImportSnapshotTasksInput, *DescribeImportSnapshotTasksOutput, error) (bool, error) -} - -// SnapshotImportedWaiter defines the waiters for SnapshotImported -type SnapshotImportedWaiter struct { - client DescribeImportSnapshotTasksAPIClient - - options SnapshotImportedWaiterOptions -} - -// NewSnapshotImportedWaiter constructs a SnapshotImportedWaiter. -func NewSnapshotImportedWaiter(client DescribeImportSnapshotTasksAPIClient, optFns ...func(*SnapshotImportedWaiterOptions)) *SnapshotImportedWaiter { - options := SnapshotImportedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = snapshotImportedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SnapshotImportedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SnapshotImported waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *SnapshotImportedWaiter) Wait(ctx context.Context, params *DescribeImportSnapshotTasksInput, maxWaitDur time.Duration, optFns ...func(*SnapshotImportedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SnapshotImported waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *SnapshotImportedWaiter) WaitForOutput(ctx context.Context, params *DescribeImportSnapshotTasksInput, maxWaitDur time.Duration, optFns ...func(*SnapshotImportedWaiterOptions)) (*DescribeImportSnapshotTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeImportSnapshotTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SnapshotImported waiter") -} - -func snapshotImportedStateRetryable(ctx context.Context, input *DescribeImportSnapshotTasksInput, output *DescribeImportSnapshotTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.ImportSnapshotTasks - var v2 []string - for _, v := range v1 { - v3 := v.SnapshotTaskDetail - var v4 *string - if v3 != nil { - v5 := v3.Status - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "completed" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.ImportSnapshotTasks - var v2 []string - for _, v := range v1 { - v3 := v.SnapshotTaskDetail - var v4 *string - if v3 != nil { - v5 := v3.Status - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "error" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeImportSnapshotTasksPaginatorOptions is the paginator options for -// DescribeImportSnapshotTasks -type DescribeImportSnapshotTasksPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeImportSnapshotTasksPaginator is a paginator for -// DescribeImportSnapshotTasks -type DescribeImportSnapshotTasksPaginator struct { - options DescribeImportSnapshotTasksPaginatorOptions - client DescribeImportSnapshotTasksAPIClient - params *DescribeImportSnapshotTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeImportSnapshotTasksPaginator returns a new -// DescribeImportSnapshotTasksPaginator -func NewDescribeImportSnapshotTasksPaginator(client DescribeImportSnapshotTasksAPIClient, params *DescribeImportSnapshotTasksInput, optFns ...func(*DescribeImportSnapshotTasksPaginatorOptions)) *DescribeImportSnapshotTasksPaginator { - if params == nil { - params = &DescribeImportSnapshotTasksInput{} - } - - options := DescribeImportSnapshotTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeImportSnapshotTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeImportSnapshotTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeImportSnapshotTasks page. -func (p *DescribeImportSnapshotTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeImportSnapshotTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeImportSnapshotTasksAPIClient is a client that implements the -// DescribeImportSnapshotTasks operation. -type DescribeImportSnapshotTasksAPIClient interface { - DescribeImportSnapshotTasks(context.Context, *DescribeImportSnapshotTasksInput, ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) -} - -var _ DescribeImportSnapshotTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeImportSnapshotTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeImportSnapshotTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceAttribute.go deleted file mode 100644 index 4c5bba14f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceAttribute.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified instance. You can specify -// only one attribute at a time. -func (c *Client) DescribeInstanceAttribute(ctx context.Context, params *DescribeInstanceAttributeInput, optFns ...func(*Options)) (*DescribeInstanceAttributeOutput, error) { - if params == nil { - params = &DescribeInstanceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceAttribute", params, optFns, c.addOperationDescribeInstanceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceAttributeInput struct { - - // The instance attribute. - // - // Note that the enaSupport attribute is not supported. - // - // This member is required. - Attribute types.InstanceAttributeName - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Describes an instance attribute. -type DescribeInstanceAttributeOutput struct { - - // The block device mapping of the instance. - BlockDeviceMappings []types.InstanceBlockDeviceMapping - - // Indicates whether stop protection is enabled for the instance. - DisableApiStop *types.AttributeBooleanValue - - // Indicates whether termination protection is enabled. If the value is true , you - // can't terminate the instance using the Amazon EC2 console, command line tools, - // or API. - DisableApiTermination *types.AttributeBooleanValue - - // Indicates whether the instance is optimized for Amazon EBS I/O. - EbsOptimized *types.AttributeBooleanValue - - // Indicates whether enhanced networking with ENA is enabled. - EnaSupport *types.AttributeBooleanValue - - // Indicates whether the instance is enabled for Amazon Web Services Nitro - // Enclaves. - EnclaveOptions *types.EnclaveOptions - - // The security groups associated with the instance. - Groups []types.GroupIdentifier - - // The ID of the instance. - InstanceId *string - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *types.AttributeValue - - // The instance type. - InstanceType *types.AttributeValue - - // The kernel ID. - KernelId *types.AttributeValue - - // The product codes. - ProductCodes []types.ProductCode - - // The RAM disk ID. - RamdiskId *types.AttributeValue - - // The device name of the root device volume (for example, /dev/sda1 ). - RootDeviceName *types.AttributeValue - - // Indicates whether source/destination checks are enabled. - SourceDestCheck *types.AttributeBooleanValue - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *types.AttributeValue - - // The user data. - UserData *types.AttributeValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeInstanceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeInstanceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceConnectEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceConnectEndpoints.go deleted file mode 100644 index d3c83cfe8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceConnectEndpoints.go +++ /dev/null @@ -1,303 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified EC2 Instance Connect Endpoints or all EC2 Instance -// Connect Endpoints. -func (c *Client) DescribeInstanceConnectEndpoints(ctx context.Context, params *DescribeInstanceConnectEndpointsInput, optFns ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, error) { - if params == nil { - params = &DescribeInstanceConnectEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceConnectEndpoints", params, optFns, c.addOperationDescribeInstanceConnectEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceConnectEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceConnectEndpointsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - instance-connect-endpoint-id - The ID of the EC2 Instance Connect Endpoint. - // - // - state - The state of the EC2 Instance Connect Endpoint ( create-in-progress - // | create-complete | create-failed | delete-in-progress | delete-complete | - // delete-failed ). - // - // - subnet-id - The ID of the subnet in which the EC2 Instance Connect Endpoint - // was created. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - tag-value - The value of a tag assigned to the resource. Use this filter to - // find all resources that have a tag with a specific value, regardless of tag key. - // - // - vpc-id - The ID of the VPC in which the EC2 Instance Connect Endpoint was - // created. - Filters []types.Filter - - // One or more EC2 Instance Connect Endpoint IDs. - InstanceConnectEndpointIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceConnectEndpointsOutput struct { - - // Information about the EC2 Instance Connect Endpoints. - InstanceConnectEndpoints []types.Ec2InstanceConnectEndpoint - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceConnectEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceConnectEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceConnectEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceConnectEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceConnectEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceConnectEndpointsPaginatorOptions is the paginator options for -// DescribeInstanceConnectEndpoints -type DescribeInstanceConnectEndpointsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceConnectEndpointsPaginator is a paginator for -// DescribeInstanceConnectEndpoints -type DescribeInstanceConnectEndpointsPaginator struct { - options DescribeInstanceConnectEndpointsPaginatorOptions - client DescribeInstanceConnectEndpointsAPIClient - params *DescribeInstanceConnectEndpointsInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceConnectEndpointsPaginator returns a new -// DescribeInstanceConnectEndpointsPaginator -func NewDescribeInstanceConnectEndpointsPaginator(client DescribeInstanceConnectEndpointsAPIClient, params *DescribeInstanceConnectEndpointsInput, optFns ...func(*DescribeInstanceConnectEndpointsPaginatorOptions)) *DescribeInstanceConnectEndpointsPaginator { - if params == nil { - params = &DescribeInstanceConnectEndpointsInput{} - } - - options := DescribeInstanceConnectEndpointsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceConnectEndpointsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceConnectEndpointsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceConnectEndpoints page. -func (p *DescribeInstanceConnectEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceConnectEndpoints(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceConnectEndpointsAPIClient is a client that implements the -// DescribeInstanceConnectEndpoints operation. -type DescribeInstanceConnectEndpointsAPIClient interface { - DescribeInstanceConnectEndpoints(context.Context, *DescribeInstanceConnectEndpointsInput, ...func(*Options)) (*DescribeInstanceConnectEndpointsOutput, error) -} - -var _ DescribeInstanceConnectEndpointsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceConnectEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceConnectEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceCreditSpecifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceCreditSpecifications.go deleted file mode 100644 index efd0476b3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceCreditSpecifications.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the credit option for CPU usage of the specified burstable -// performance instances. The credit options are standard and unlimited . -// -// If you do not specify an instance ID, Amazon EC2 returns burstable performance -// instances with the unlimited credit option, as well as instances that were -// previously configured as T2, T3, and T3a with the unlimited credit option. For -// example, if you resize a T2 instance, while it is configured as unlimited , to -// an M4 instance, Amazon EC2 returns the M4 instance. -// -// If you specify one or more instance IDs, Amazon EC2 returns the credit option ( -// standard or unlimited ) of those instances. If you specify an instance ID that -// is not valid, such as an instance that is not a burstable performance instance, -// an error is returned. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// If an Availability Zone is experiencing a service disruption and you specify -// instance IDs in the affected zone, or do not specify any instance IDs at all, -// the call fails. If you specify only instance IDs in an unaffected zone, the call -// works normally. -// -// For more information, see [Burstable performance instances] in the Amazon EC2 User Guide. -// -// [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html -func (c *Client) DescribeInstanceCreditSpecifications(ctx context.Context, params *DescribeInstanceCreditSpecificationsInput, optFns ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) { - if params == nil { - params = &DescribeInstanceCreditSpecificationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceCreditSpecifications", params, optFns, c.addOperationDescribeInstanceCreditSpecificationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceCreditSpecificationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceCreditSpecificationsInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - instance-id - The ID of the instance. - Filters []types.Filter - - // The instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 1000 explicitly specified instance IDs. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // call. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceCreditSpecificationsOutput struct { - - // Information about the credit option for CPU usage of an instance. - InstanceCreditSpecifications []types.InstanceCreditSpecification - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceCreditSpecificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceCreditSpecifications{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceCreditSpecifications{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceCreditSpecifications"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceCreditSpecifications(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceCreditSpecificationsPaginatorOptions is the paginator options -// for DescribeInstanceCreditSpecifications -type DescribeInstanceCreditSpecificationsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // call. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceCreditSpecificationsPaginator is a paginator for -// DescribeInstanceCreditSpecifications -type DescribeInstanceCreditSpecificationsPaginator struct { - options DescribeInstanceCreditSpecificationsPaginatorOptions - client DescribeInstanceCreditSpecificationsAPIClient - params *DescribeInstanceCreditSpecificationsInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceCreditSpecificationsPaginator returns a new -// DescribeInstanceCreditSpecificationsPaginator -func NewDescribeInstanceCreditSpecificationsPaginator(client DescribeInstanceCreditSpecificationsAPIClient, params *DescribeInstanceCreditSpecificationsInput, optFns ...func(*DescribeInstanceCreditSpecificationsPaginatorOptions)) *DescribeInstanceCreditSpecificationsPaginator { - if params == nil { - params = &DescribeInstanceCreditSpecificationsInput{} - } - - options := DescribeInstanceCreditSpecificationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceCreditSpecificationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceCreditSpecificationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceCreditSpecifications page. -func (p *DescribeInstanceCreditSpecificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceCreditSpecifications(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceCreditSpecificationsAPIClient is a client that implements the -// DescribeInstanceCreditSpecifications operation. -type DescribeInstanceCreditSpecificationsAPIClient interface { - DescribeInstanceCreditSpecifications(context.Context, *DescribeInstanceCreditSpecificationsInput, ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) -} - -var _ DescribeInstanceCreditSpecificationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceCreditSpecifications(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceCreditSpecifications", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventNotificationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventNotificationAttributes.go deleted file mode 100644 index ff3f7f984..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventNotificationAttributes.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the tag keys that are registered to appear in scheduled event -// notifications for resources in the current Region. -func (c *Client) DescribeInstanceEventNotificationAttributes(ctx context.Context, params *DescribeInstanceEventNotificationAttributesInput, optFns ...func(*Options)) (*DescribeInstanceEventNotificationAttributesOutput, error) { - if params == nil { - params = &DescribeInstanceEventNotificationAttributesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceEventNotificationAttributes", params, optFns, c.addOperationDescribeInstanceEventNotificationAttributesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceEventNotificationAttributesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceEventNotificationAttributesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeInstanceEventNotificationAttributesOutput struct { - - // Information about the registered tag keys. - InstanceTagAttribute *types.InstanceTagNotificationAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceEventNotificationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceEventNotificationAttributes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceEventNotificationAttributes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeInstanceEventNotificationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceEventNotificationAttributes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventWindows.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventWindows.go deleted file mode 100644 index d7286441c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceEventWindows.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified event windows or all event windows. -// -// If you specify event window IDs, the output includes information for only the -// specified event windows. If you specify filters, the output includes information -// for only those event windows that meet the filter criteria. If you do not -// specify event windows IDs or filters, the output includes information for all -// event windows, which can affect performance. We recommend that you use -// pagination to ensure that the operation returns quickly and successfully. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) DescribeInstanceEventWindows(ctx context.Context, params *DescribeInstanceEventWindowsInput, optFns ...func(*Options)) (*DescribeInstanceEventWindowsOutput, error) { - if params == nil { - params = &DescribeInstanceEventWindowsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceEventWindows", params, optFns, c.addOperationDescribeInstanceEventWindowsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceEventWindowsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Describe instance event windows by InstanceEventWindow. -type DescribeInstanceEventWindowsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - dedicated-host-id - The event windows associated with the specified - // Dedicated Host ID. - // - // - event-window-name - The event windows associated with the specified names. - // - // - instance-id - The event windows associated with the specified instance ID. - // - // - instance-tag - The event windows associated with the specified tag and value. - // - // - instance-tag-key - The event windows associated with the specified tag key, - // regardless of the value. - // - // - instance-tag-value - The event windows associated with the specified tag - // value, regardless of the key. - // - // - tag: - The key/value combination of a tag assigned to the event window. Use - // the tag key in the filter name and the tag value as the filter value. For - // example, to find all resources that have a tag with the key Owner and the - // value CMX , specify tag:Owner for the filter name and CMX for the filter - // value. - // - // - tag-key - The key of a tag assigned to the event window. Use this filter to - // find all event windows that have a tag with a specific key, regardless of the - // tag value. - // - // - tag-value - The value of a tag assigned to the event window. Use this filter - // to find all event windows that have a tag with a specific value, regardless of - // the tag key. - Filters []types.Filter - - // The IDs of the event windows. - InstanceEventWindowIds []string - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 20 and 500. You cannot specify this parameter and the event - // window IDs parameter in the same call. - MaxResults *int32 - - // The token to request the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceEventWindowsOutput struct { - - // Information about the event windows. - InstanceEventWindows []types.InstanceEventWindow - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceEventWindowsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceEventWindows{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceEventWindows{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceEventWindows"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceEventWindows(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceEventWindowsPaginatorOptions is the paginator options for -// DescribeInstanceEventWindows -type DescribeInstanceEventWindowsPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 20 and 500. You cannot specify this parameter and the event - // window IDs parameter in the same call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceEventWindowsPaginator is a paginator for -// DescribeInstanceEventWindows -type DescribeInstanceEventWindowsPaginator struct { - options DescribeInstanceEventWindowsPaginatorOptions - client DescribeInstanceEventWindowsAPIClient - params *DescribeInstanceEventWindowsInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceEventWindowsPaginator returns a new -// DescribeInstanceEventWindowsPaginator -func NewDescribeInstanceEventWindowsPaginator(client DescribeInstanceEventWindowsAPIClient, params *DescribeInstanceEventWindowsInput, optFns ...func(*DescribeInstanceEventWindowsPaginatorOptions)) *DescribeInstanceEventWindowsPaginator { - if params == nil { - params = &DescribeInstanceEventWindowsInput{} - } - - options := DescribeInstanceEventWindowsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceEventWindowsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceEventWindowsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceEventWindows page. -func (p *DescribeInstanceEventWindowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceEventWindowsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceEventWindows(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceEventWindowsAPIClient is a client that implements the -// DescribeInstanceEventWindows operation. -type DescribeInstanceEventWindowsAPIClient interface { - DescribeInstanceEventWindows(context.Context, *DescribeInstanceEventWindowsInput, ...func(*Options)) (*DescribeInstanceEventWindowsOutput, error) -} - -var _ DescribeInstanceEventWindowsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceEventWindows(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceEventWindows", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceImageMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceImageMetadata.go deleted file mode 100644 index 4a7901896..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceImageMetadata.go +++ /dev/null @@ -1,348 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the AMI that was used to launch an instance, even if the AMI is -// deprecated, deregistered, made private (no longer public or shared with your -// account), or not allowed. -// -// If you specify instance IDs, the output includes information for only the -// specified instances. If you specify filters, the output includes information for -// only those instances that meet the filter criteria. If you do not specify -// instance IDs or filters, the output includes information for all instances, -// which can affect performance. -// -// If you specify an instance ID that is not valid, an instance that doesn't -// exist, or an instance that you do not own, an error ( InvalidInstanceID.NotFound -// ) is returned. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// In the rare case where an Availability Zone is experiencing a service -// disruption and you specify instance IDs that are in the affected Availability -// Zone, or do not specify any instance IDs at all, the call fails. If you specify -// only instance IDs that are in an unaffected Availability Zone, the call works -// normally. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -func (c *Client) DescribeInstanceImageMetadata(ctx context.Context, params *DescribeInstanceImageMetadataInput, optFns ...func(*Options)) (*DescribeInstanceImageMetadataOutput, error) { - if params == nil { - params = &DescribeInstanceImageMetadataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceImageMetadata", params, optFns, c.addOperationDescribeInstanceImageMetadataMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceImageMetadataOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceImageMetadataInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The name of the Availability Zone (for example, - // us-west-2a ) or Local Zone (for example, us-west-2-lax-1b ) of the instance. - // - // - instance-id - The ID of the instance. - // - // - image-allowed - A Boolean that indicates whether the image meets the - // criteria specified for Allowed AMIs. - // - // - instance-state-name - The state of the instance ( pending | running | - // shutting-down | terminated | stopping | stopped ). - // - // - instance-type - The type of instance (for example, t3.micro ). - // - // - launch-time - The time when the instance was launched, in the ISO 8601 - // format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, - // 2023-09-29T11:04:43.305Z . You can use a wildcard ( * ), for example, - // 2023-09-29T* , which matches an entire day. - // - // - owner-alias - The owner alias ( amazon | aws-marketplace | aws-backup-vault - // ). The valid aliases are defined in an Amazon-maintained list. This is not the - // Amazon Web Services account alias that can be set using the IAM console. We - // recommend that you use the Owner request parameter instead of this filter. - // - // - owner-id - The Amazon Web Services account ID of the owner. We recommend - // that you use the Owner request parameter instead of this filter. - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - zone-id - The ID of the Availability Zone (for example, usw2-az2 ) or Local - // Zone (for example, usw2-lax1-az1 ) of the instance. - Filters []types.Filter - - // The instance IDs. - // - // If you don't specify an instance ID or filters, the output includes information - // for all instances. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // Default: 1000 - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceImageMetadataOutput struct { - - // Information about the instance and the AMI used to launch the instance. - InstanceImageMetadata []types.InstanceImageMetadata - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceImageMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceImageMetadata{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceImageMetadata{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceImageMetadata"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceImageMetadata(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceImageMetadataPaginatorOptions is the paginator options for -// DescribeInstanceImageMetadata -type DescribeInstanceImageMetadataPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // Default: 1000 - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceImageMetadataPaginator is a paginator for -// DescribeInstanceImageMetadata -type DescribeInstanceImageMetadataPaginator struct { - options DescribeInstanceImageMetadataPaginatorOptions - client DescribeInstanceImageMetadataAPIClient - params *DescribeInstanceImageMetadataInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceImageMetadataPaginator returns a new -// DescribeInstanceImageMetadataPaginator -func NewDescribeInstanceImageMetadataPaginator(client DescribeInstanceImageMetadataAPIClient, params *DescribeInstanceImageMetadataInput, optFns ...func(*DescribeInstanceImageMetadataPaginatorOptions)) *DescribeInstanceImageMetadataPaginator { - if params == nil { - params = &DescribeInstanceImageMetadataInput{} - } - - options := DescribeInstanceImageMetadataPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceImageMetadataPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceImageMetadataPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceImageMetadata page. -func (p *DescribeInstanceImageMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceImageMetadataOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceImageMetadata(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceImageMetadataAPIClient is a client that implements the -// DescribeInstanceImageMetadata operation. -type DescribeInstanceImageMetadataAPIClient interface { - DescribeInstanceImageMetadata(context.Context, *DescribeInstanceImageMetadataInput, ...func(*Options)) (*DescribeInstanceImageMetadataOutput, error) -} - -var _ DescribeInstanceImageMetadataAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceImageMetadata(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceImageMetadata", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceStatus.go deleted file mode 100644 index 407713a10..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceStatus.go +++ /dev/null @@ -1,772 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the status of the specified instances or all of your instances. By -// default, only running instances are described, unless you specifically indicate -// to return the status of all instances. -// -// Instance status includes the following components: -// -// - Status checks - Amazon EC2 performs status checks on running EC2 instances -// to identify hardware and software issues. For more information, see [Status checks for your instances]and [Troubleshoot instances with failed status checks]in -// the Amazon EC2 User Guide. -// -// - Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, or -// terminate) for your instances related to hardware issues, software updates, or -// system maintenance. For more information, see [Scheduled events for your instances]in the Amazon EC2 User Guide. -// -// - Instance state - You can manage your instances from the moment you launch -// them through their termination. For more information, see [Instance lifecycle]in the Amazon EC2 -// User Guide. -// -// The Amazon EC2 API follows an eventual consistency model. This means that the -// result of an API command you run that creates or modifies resources might not be -// immediately available to all subsequent commands you run. For guidance on how to -// manage eventual consistency, see [Eventual consistency in the Amazon EC2 API]in the Amazon EC2 Developer Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Troubleshoot instances with failed status checks]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html -// [Instance lifecycle]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html -// [Status checks for your instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html -// [Eventual consistency in the Amazon EC2 API]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -// [Scheduled events for your instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html -func (c *Client) DescribeInstanceStatus(ctx context.Context, params *DescribeInstanceStatusInput, optFns ...func(*Options)) (*DescribeInstanceStatusOutput, error) { - if params == nil { - params = &DescribeInstanceStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceStatus", params, optFns, c.addOperationDescribeInstanceStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceStatusInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The Availability Zone of the instance. - // - // - event.code - The code for the scheduled event ( instance-reboot | - // system-reboot | system-maintenance | instance-retirement | instance-stop ). - // - // - event.description - A description of the event. - // - // - event.instance-event-id - The ID of the event whose date and time you are - // modifying. - // - // - event.not-after - The latest end time for the scheduled event (for example, - // 2014-09-15T17:15:20.000Z ). - // - // - event.not-before - The earliest start time for the scheduled event (for - // example, 2014-09-15T17:15:20.000Z ). - // - // - event.not-before-deadline - The deadline for starting the event (for - // example, 2014-09-15T17:15:20.000Z ). - // - // - instance-state-code - The code for the instance state, as a 16-bit unsigned - // integer. The high byte is used for internal purposes and should be ignored. The - // low byte is set based on the state represented. The valid values are 0 - // (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and - // 80 (stopped). - // - // - instance-state-name - The state of the instance ( pending | running | - // shutting-down | terminated | stopping | stopped ). - // - // - instance-status.reachability - Filters on instance status where the name is - // reachability ( passed | failed | initializing | insufficient-data ). - // - // - instance-status.status - The status of the instance ( ok | impaired | - // initializing | insufficient-data | not-applicable ). - // - // - operator.managed - A Boolean that indicates whether this is a managed - // instance. - // - // - operator.principal - The principal that manages the instance. Only valid for - // managed instances, where managed is true . - // - // - system-status.reachability - Filters on system status where the name is - // reachability ( passed | failed | initializing | insufficient-data ). - // - // - system-status.status - The system status of the instance ( ok | impaired | - // initializing | insufficient-data | not-applicable ). - // - // - attached-ebs-status.status - The status of the attached EBS volume for the - // instance ( ok | impaired | initializing | insufficient-data | not-applicable ). - Filters []types.Filter - - // When true , includes the health status for all instances. When false , includes - // the health status for running instances only. - // - // Default: false - IncludeAllInstances *bool - - // The instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // request. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceStatusOutput struct { - - // Information about the status of the instances. - InstanceStatuses []types.InstanceStatus - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// InstanceStatusOkWaiterOptions are waiter options for InstanceStatusOkWaiter -type InstanceStatusOkWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InstanceStatusOkWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InstanceStatusOkWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstanceStatusInput, *DescribeInstanceStatusOutput, error) (bool, error) -} - -// InstanceStatusOkWaiter defines the waiters for InstanceStatusOk -type InstanceStatusOkWaiter struct { - client DescribeInstanceStatusAPIClient - - options InstanceStatusOkWaiterOptions -} - -// NewInstanceStatusOkWaiter constructs a InstanceStatusOkWaiter. -func NewInstanceStatusOkWaiter(client DescribeInstanceStatusAPIClient, optFns ...func(*InstanceStatusOkWaiterOptions)) *InstanceStatusOkWaiter { - options := InstanceStatusOkWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = instanceStatusOkStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InstanceStatusOkWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InstanceStatusOk waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *InstanceStatusOkWaiter) Wait(ctx context.Context, params *DescribeInstanceStatusInput, maxWaitDur time.Duration, optFns ...func(*InstanceStatusOkWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InstanceStatusOk waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *InstanceStatusOkWaiter) WaitForOutput(ctx context.Context, params *DescribeInstanceStatusInput, maxWaitDur time.Duration, optFns ...func(*InstanceStatusOkWaiterOptions)) (*DescribeInstanceStatusOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstanceStatus(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InstanceStatusOk waiter") -} - -func instanceStatusOkStateRetryable(ctx context.Context, input *DescribeInstanceStatusInput, output *DescribeInstanceStatusOutput, err error) (bool, error) { - - if err == nil { - v1 := output.InstanceStatuses - var v2 []types.SummaryStatus - for _, v := range v1 { - v3 := v.InstanceStatus - var v4 types.SummaryStatus - if v3 != nil { - v5 := v3.Status - v4 = v5 - } - v2 = append(v2, v4) - } - expectedValue := "ok" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidInstanceID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// SystemStatusOkWaiterOptions are waiter options for SystemStatusOkWaiter -type SystemStatusOkWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SystemStatusOkWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SystemStatusOkWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstanceStatusInput, *DescribeInstanceStatusOutput, error) (bool, error) -} - -// SystemStatusOkWaiter defines the waiters for SystemStatusOk -type SystemStatusOkWaiter struct { - client DescribeInstanceStatusAPIClient - - options SystemStatusOkWaiterOptions -} - -// NewSystemStatusOkWaiter constructs a SystemStatusOkWaiter. -func NewSystemStatusOkWaiter(client DescribeInstanceStatusAPIClient, optFns ...func(*SystemStatusOkWaiterOptions)) *SystemStatusOkWaiter { - options := SystemStatusOkWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = systemStatusOkStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SystemStatusOkWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SystemStatusOk waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *SystemStatusOkWaiter) Wait(ctx context.Context, params *DescribeInstanceStatusInput, maxWaitDur time.Duration, optFns ...func(*SystemStatusOkWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SystemStatusOk waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *SystemStatusOkWaiter) WaitForOutput(ctx context.Context, params *DescribeInstanceStatusInput, maxWaitDur time.Duration, optFns ...func(*SystemStatusOkWaiterOptions)) (*DescribeInstanceStatusOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstanceStatus(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SystemStatusOk waiter") -} - -func systemStatusOkStateRetryable(ctx context.Context, input *DescribeInstanceStatusInput, output *DescribeInstanceStatusOutput, err error) (bool, error) { - - if err == nil { - v1 := output.InstanceStatuses - var v2 []types.SummaryStatus - for _, v := range v1 { - v3 := v.SystemStatus - var v4 types.SummaryStatus - if v3 != nil { - v5 := v3.Status - v4 = v5 - } - v2 = append(v2, v4) - } - expectedValue := "ok" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeInstanceStatusPaginatorOptions is the paginator options for -// DescribeInstanceStatus -type DescribeInstanceStatusPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // request. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceStatusPaginator is a paginator for DescribeInstanceStatus -type DescribeInstanceStatusPaginator struct { - options DescribeInstanceStatusPaginatorOptions - client DescribeInstanceStatusAPIClient - params *DescribeInstanceStatusInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceStatusPaginator returns a new DescribeInstanceStatusPaginator -func NewDescribeInstanceStatusPaginator(client DescribeInstanceStatusAPIClient, params *DescribeInstanceStatusInput, optFns ...func(*DescribeInstanceStatusPaginatorOptions)) *DescribeInstanceStatusPaginator { - if params == nil { - params = &DescribeInstanceStatusInput{} - } - - options := DescribeInstanceStatusPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceStatusPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceStatusPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceStatus page. -func (p *DescribeInstanceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceStatusOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceStatus(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceStatusAPIClient is a client that implements the -// DescribeInstanceStatus operation. -type DescribeInstanceStatusAPIClient interface { - DescribeInstanceStatus(context.Context, *DescribeInstanceStatusInput, ...func(*Options)) (*DescribeInstanceStatusOutput, error) -} - -var _ DescribeInstanceStatusAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTopology.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTopology.go deleted file mode 100644 index 26726f3df..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTopology.go +++ /dev/null @@ -1,327 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a tree-based hierarchy that represents the physical host placement of -// your EC2 instances within an Availability Zone or Local Zone. You can use this -// information to determine the relative proximity of your EC2 instances within the -// Amazon Web Services network to support your tightly coupled workloads. -// -// Instance topology is supported for specific instance types only. For more -// information, see [Prerequisites for Amazon EC2 instance topology]in the Amazon EC2 User Guide. -// -// The Amazon EC2 API follows an eventual consistency model due to the distributed -// nature of the system supporting it. As a result, when you call the -// DescribeInstanceTopology API command immediately after launching instances, the -// response might return a null value for capacityBlockId because the data might -// not have fully propagated across all subsystems. For more information, see [Eventual consistency in the Amazon EC2 API]in -// the Amazon EC2 Developer Guide. -// -// For more information, see [Amazon EC2 instance topology] in the Amazon EC2 User Guide. -// -// [Prerequisites for Amazon EC2 instance topology]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology-prerequisites.html -// [Amazon EC2 instance topology]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html -// [Eventual consistency in the Amazon EC2 API]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -func (c *Client) DescribeInstanceTopology(ctx context.Context, params *DescribeInstanceTopologyInput, optFns ...func(*Options)) (*DescribeInstanceTopologyOutput, error) { - if params == nil { - params = &DescribeInstanceTopologyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceTopology", params, optFns, c.addOperationDescribeInstanceTopologyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceTopologyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceTopologyInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The name of the Availability Zone (for example, - // us-west-2a ) or Local Zone (for example, us-west-2-lax-1b ) that the instance - // is in. - // - // - instance-type - The instance type (for example, p4d.24xlarge ) or instance - // family (for example, p4d* ). You can use the * wildcard to match zero or more - // characters, or the ? wildcard to match zero or one character. - // - // - zone-id - The ID of the Availability Zone (for example, usw2-az2 ) or Local - // Zone (for example, usw2-lax1-az1 ) that the instance is in. - Filters []types.Filter - - // The name of the placement group that each instance is in. - // - // Constraints: Maximum 100 explicitly specified placement group names. - GroupNames []string - - // The instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You can't specify this parameter and the instance IDs parameter in the same - // request. - // - // Default: 20 - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceTopologyOutput struct { - - // Information about the topology of each instance. - Instances []types.InstanceTopology - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceTopologyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceTopology{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceTopology{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceTopology"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceTopology(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceTopologyPaginatorOptions is the paginator options for -// DescribeInstanceTopology -type DescribeInstanceTopologyPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You can't specify this parameter and the instance IDs parameter in the same - // request. - // - // Default: 20 - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceTopologyPaginator is a paginator for DescribeInstanceTopology -type DescribeInstanceTopologyPaginator struct { - options DescribeInstanceTopologyPaginatorOptions - client DescribeInstanceTopologyAPIClient - params *DescribeInstanceTopologyInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceTopologyPaginator returns a new -// DescribeInstanceTopologyPaginator -func NewDescribeInstanceTopologyPaginator(client DescribeInstanceTopologyAPIClient, params *DescribeInstanceTopologyInput, optFns ...func(*DescribeInstanceTopologyPaginatorOptions)) *DescribeInstanceTopologyPaginator { - if params == nil { - params = &DescribeInstanceTopologyInput{} - } - - options := DescribeInstanceTopologyPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceTopologyPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceTopologyPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceTopology page. -func (p *DescribeInstanceTopologyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTopologyOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceTopology(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceTopologyAPIClient is a client that implements the -// DescribeInstanceTopology operation. -type DescribeInstanceTopologyAPIClient interface { - DescribeInstanceTopology(context.Context, *DescribeInstanceTopologyInput, ...func(*Options)) (*DescribeInstanceTopologyOutput, error) -} - -var _ DescribeInstanceTopologyAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceTopology(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceTopology", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypeOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypeOfferings.go deleted file mode 100644 index 6e09eb761..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypeOfferings.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the instance types that are offered for the specified location. If no -// location is specified, the default is to list the instance types that are -// offered in the current Region. -func (c *Client) DescribeInstanceTypeOfferings(ctx context.Context, params *DescribeInstanceTypeOfferingsInput, optFns ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) { - if params == nil { - params = &DescribeInstanceTypeOfferingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceTypeOfferings", params, optFns, c.addOperationDescribeInstanceTypeOfferingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceTypeOfferingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceTypeOfferingsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - instance-type - The instance type. For a list of possible values, see [Instance]. - // - // - location - The location. For a list of possible identifiers, see [Regions and Zones]. - // - // [Instance]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html - // [Regions and Zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html - Filters []types.Filter - - // The location type. - // - // - availability-zone - The Availability Zone. When you specify a location - // filter, it must be an Availability Zone for the current Region. - // - // - availability-zone-id - The AZ ID. When you specify a location filter, it - // must be an AZ ID for the current Region. - // - // - outpost - The Outpost ARN. When you specify a location filter, it must be an - // Outpost ARN for the current Region. - // - // - region - The current Region. If you specify a location filter, it must match - // the current Region. - LocationType types.LocationType - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceTypeOfferingsOutput struct { - - // The instance types offered in the location. - InstanceTypeOfferings []types.InstanceTypeOffering - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceTypeOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceTypeOfferings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceTypeOfferings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceTypeOfferings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceTypeOfferings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceTypeOfferingsPaginatorOptions is the paginator options for -// DescribeInstanceTypeOfferings -type DescribeInstanceTypeOfferingsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceTypeOfferingsPaginator is a paginator for -// DescribeInstanceTypeOfferings -type DescribeInstanceTypeOfferingsPaginator struct { - options DescribeInstanceTypeOfferingsPaginatorOptions - client DescribeInstanceTypeOfferingsAPIClient - params *DescribeInstanceTypeOfferingsInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceTypeOfferingsPaginator returns a new -// DescribeInstanceTypeOfferingsPaginator -func NewDescribeInstanceTypeOfferingsPaginator(client DescribeInstanceTypeOfferingsAPIClient, params *DescribeInstanceTypeOfferingsInput, optFns ...func(*DescribeInstanceTypeOfferingsPaginatorOptions)) *DescribeInstanceTypeOfferingsPaginator { - if params == nil { - params = &DescribeInstanceTypeOfferingsInput{} - } - - options := DescribeInstanceTypeOfferingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceTypeOfferingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceTypeOfferingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceTypeOfferings page. -func (p *DescribeInstanceTypeOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceTypeOfferings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceTypeOfferingsAPIClient is a client that implements the -// DescribeInstanceTypeOfferings operation. -type DescribeInstanceTypeOfferingsAPIClient interface { - DescribeInstanceTypeOfferings(context.Context, *DescribeInstanceTypeOfferingsInput, ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) -} - -var _ DescribeInstanceTypeOfferingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceTypeOfferings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceTypeOfferings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypes.go deleted file mode 100644 index 50cb30890..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstanceTypes.go +++ /dev/null @@ -1,432 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified instance types. By default, all instance types for the -// current Region are described. Alternatively, you can filter the results. -func (c *Client) DescribeInstanceTypes(ctx context.Context, params *DescribeInstanceTypesInput, optFns ...func(*Options)) (*DescribeInstanceTypesOutput, error) { - if params == nil { - params = &DescribeInstanceTypesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceTypes", params, optFns, c.addOperationDescribeInstanceTypesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstanceTypesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstanceTypesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - // - // - auto-recovery-supported - Indicates whether Amazon CloudWatch action based - // recovery is supported ( true | false ). - // - // - bare-metal - Indicates whether it is a bare metal instance type ( true | - // false ). - // - // - burstable-performance-supported - Indicates whether the instance type is a - // burstable performance T instance type ( true | false ). - // - // - current-generation - Indicates whether this instance type is the latest - // generation instance type of an instance family ( true | false ). - // - // - dedicated-hosts-supported - Indicates whether the instance type supports - // Dedicated Hosts. ( true | false ) - // - // - ebs-info.ebs-optimized-info.baseline-bandwidth-in-mbps - The baseline - // bandwidth performance for an EBS-optimized instance type, in Mbps. - // - // - ebs-info.ebs-optimized-info.baseline-iops - The baseline input/output - // storage operations per second for an EBS-optimized instance type. - // - // - ebs-info.ebs-optimized-info.baseline-throughput-in-mbps - The baseline - // throughput performance for an EBS-optimized instance type, in MB/s. - // - // - ebs-info.ebs-optimized-info.maximum-bandwidth-in-mbps - The maximum - // bandwidth performance for an EBS-optimized instance type, in Mbps. - // - // - ebs-info.ebs-optimized-info.maximum-iops - The maximum input/output storage - // operations per second for an EBS-optimized instance type. - // - // - ebs-info.ebs-optimized-info.maximum-throughput-in-mbps - The maximum - // throughput performance for an EBS-optimized instance type, in MB/s. - // - // - ebs-info.ebs-optimized-support - Indicates whether the instance type is - // EBS-optimized ( supported | unsupported | default ). - // - // - ebs-info.encryption-support - Indicates whether EBS encryption is supported ( - // supported | unsupported ). - // - // - ebs-info.nvme-support - Indicates whether non-volatile memory express (NVMe) - // is supported for EBS volumes ( required | supported | unsupported ). - // - // - free-tier-eligible - Indicates whether the instance type is eligible to use - // in the free tier ( true | false ). - // - // - hibernation-supported - Indicates whether On-Demand hibernation is supported - // ( true | false ). - // - // - hypervisor - The hypervisor ( nitro | xen ). - // - // - instance-storage-info.disk.count - The number of local disks. - // - // - instance-storage-info.disk.size-in-gb - The storage size of each instance - // storage disk, in GB. - // - // - instance-storage-info.disk.type - The storage technology for the local - // instance storage disks ( hdd | ssd ). - // - // - instance-storage-info.encryption-support - Indicates whether data is - // encrypted at rest ( required | supported | unsupported ). - // - // - instance-storage-info.nvme-support - Indicates whether non-volatile memory - // express (NVMe) is supported for instance store ( required | supported | - // unsupported ). - // - // - instance-storage-info.total-size-in-gb - The total amount of storage - // available from all local instance storage, in GB. - // - // - instance-storage-supported - Indicates whether the instance type has local - // instance storage ( true | false ). - // - // - instance-type - The instance type (for example c5.2xlarge or c5*). - // - // - memory-info.size-in-mib - The memory size. - // - // - network-info.bandwidth-weightings - For instances that support bandwidth - // weighting to boost performance ( default , vpc-1 , ebs-1 ). - // - // - network-info.efa-info.maximum-efa-interfaces - The maximum number of Elastic - // Fabric Adapters (EFAs) per instance. - // - // - network-info.efa-supported - Indicates whether the instance type supports - // Elastic Fabric Adapter (EFA) ( true | false ). - // - // - network-info.ena-support - Indicates whether Elastic Network Adapter (ENA) - // is supported or required ( required | supported | unsupported ). - // - // - network-info.flexible-ena-queues-support - Indicates whether an instance - // supports flexible ENA queues ( supported | unsupported ). - // - // - network-info.encryption-in-transit-supported - Indicates whether the - // instance type automatically encrypts in-transit traffic between instances ( - // true | false ). - // - // - network-info.ipv4-addresses-per-interface - The maximum number of private - // IPv4 addresses per network interface. - // - // - network-info.ipv6-addresses-per-interface - The maximum number of private - // IPv6 addresses per network interface. - // - // - network-info.ipv6-supported - Indicates whether the instance type supports - // IPv6 ( true | false ). - // - // - network-info.maximum-network-cards - The maximum number of network cards per - // instance. - // - // - network-info.maximum-network-interfaces - The maximum number of network - // interfaces per instance. - // - // - network-info.network-performance - The network performance (for example, "25 - // Gigabit"). - // - // - nitro-enclaves-support - Indicates whether Nitro Enclaves is supported ( - // supported | unsupported ). - // - // - nitro-tpm-support - Indicates whether NitroTPM is supported ( supported | - // unsupported ). - // - // - nitro-tpm-info.supported-versions - The supported NitroTPM version ( 2.0 ). - // - // - processor-info.supported-architecture - The CPU architecture ( arm64 | i386 - // | x86_64 ). - // - // - processor-info.sustained-clock-speed-in-ghz - The CPU clock speed, in GHz. - // - // - processor-info.supported-features - The supported CPU features ( amd-sev-snp - // ). - // - // - reboot-migration-support - Indicates whether enabling reboot migration is - // supported ( supported | unsupported ). - // - // - supported-boot-mode - The boot mode ( legacy-bios | uefi ). - // - // - supported-root-device-type - The root device type ( ebs | instance-store ). - // - // - supported-usage-class - The usage class ( on-demand | spot | capacity-block - // ). - // - // - supported-virtualization-type - The virtualization type ( hvm | paravirtual - // ). - // - // - vcpu-info.default-cores - The default number of cores for the instance type. - // - // - vcpu-info.default-threads-per-core - The default number of threads per core - // for the instance type. - // - // - vcpu-info.default-vcpus - The default number of vCPUs for the instance type. - // - // - vcpu-info.valid-cores - The number of cores that can be configured for the - // instance type. - // - // - vcpu-info.valid-threads-per-core - The number of threads per core that can - // be configured for the instance type. For example, "1" or "1,2". - Filters []types.Filter - - // The instance types. - InstanceTypes []types.InstanceType - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstanceTypesOutput struct { - - // The instance type. - InstanceTypes []types.InstanceTypeInfo - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstanceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstanceTypes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstanceTypes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceTypes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceTypes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeInstanceTypesPaginatorOptions is the paginator options for -// DescribeInstanceTypes -type DescribeInstanceTypesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstanceTypesPaginator is a paginator for DescribeInstanceTypes -type DescribeInstanceTypesPaginator struct { - options DescribeInstanceTypesPaginatorOptions - client DescribeInstanceTypesAPIClient - params *DescribeInstanceTypesInput - nextToken *string - firstPage bool -} - -// NewDescribeInstanceTypesPaginator returns a new DescribeInstanceTypesPaginator -func NewDescribeInstanceTypesPaginator(client DescribeInstanceTypesAPIClient, params *DescribeInstanceTypesInput, optFns ...func(*DescribeInstanceTypesPaginatorOptions)) *DescribeInstanceTypesPaginator { - if params == nil { - params = &DescribeInstanceTypesInput{} - } - - options := DescribeInstanceTypesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstanceTypesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstanceTypesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstanceTypes page. -func (p *DescribeInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstanceTypes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstanceTypesAPIClient is a client that implements the -// DescribeInstanceTypes operation. -type DescribeInstanceTypesAPIClient interface { - DescribeInstanceTypes(context.Context, *DescribeInstanceTypesInput, ...func(*Options)) (*DescribeInstanceTypesOutput, error) -} - -var _ DescribeInstanceTypesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstanceTypes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstances.go deleted file mode 100644 index 95f59c7fc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInstances.go +++ /dev/null @@ -1,1772 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes the specified instances or all instances. -// -// If you specify instance IDs, the output includes information for only the -// specified instances. If you specify filters, the output includes information for -// only those instances that meet the filter criteria. If you do not specify -// instance IDs or filters, the output includes information for all instances, -// which can affect performance. We recommend that you use pagination to ensure -// that the operation returns quickly and successfully. -// -// If you specify an instance ID that is not valid, an error is returned. If you -// specify an instance that you do not own, it is not included in the output. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// If you describe instances in the rare case where an Availability Zone is -// experiencing a service disruption and you specify instance IDs that are in the -// affected zone, or do not specify any instance IDs at all, the call fails. If you -// describe instances and specify only instance IDs that are in an unaffected zone, -// the call works normally. -// -// The Amazon EC2 API follows an eventual consistency model. This means that the -// result of an API command you run that creates or modifies resources might not be -// immediately available to all subsequent commands you run. For guidance on how to -// manage eventual consistency, see [Eventual consistency in the Amazon EC2 API]in the Amazon EC2 Developer Guide. -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Eventual consistency in the Amazon EC2 API]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -func (c *Client) DescribeInstances(ctx context.Context, params *DescribeInstancesInput, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { - if params == nil { - params = &DescribeInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInstances", params, optFns, c.addOperationDescribeInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInstancesInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - affinity - The affinity setting for an instance running on a Dedicated Host ( - // default | host ). - // - // - architecture - The instance architecture ( i386 | x86_64 | arm64 ). - // - // - availability-zone - The Availability Zone of the instance. - // - // - block-device-mapping.attach-time - The attach time for an EBS volume mapped - // to the instance, for example, 2022-09-15T17:15:20.000Z . - // - // - block-device-mapping.delete-on-termination - A Boolean that indicates - // whether the EBS volume is deleted on instance termination. - // - // - block-device-mapping.device-name - The device name specified in the block - // device mapping (for example, /dev/sdh or xvdh ). - // - // - block-device-mapping.status - The status for the EBS volume ( attaching | - // attached | detaching | detached ). - // - // - block-device-mapping.volume-id - The volume ID of the EBS volume. - // - // - boot-mode - The boot mode that was specified by the AMI ( legacy-bios | uefi - // | uefi-preferred ). - // - // - capacity-reservation-id - The ID of the Capacity Reservation into which the - // instance was launched. - // - // - capacity-reservation-specification.capacity-reservation-preference - The - // instance's Capacity Reservation preference ( open | none ). - // - // - - // capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id - // - The ID of the targeted Capacity Reservation. - // - // - - // capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn - // - The ARN of the targeted Capacity Reservation group. - // - // - client-token - The idempotency token you provided when you launched the - // instance. - // - // - current-instance-boot-mode - The boot mode that is used to launch the - // instance at launch or start ( legacy-bios | uefi ). - // - // - dns-name - The public DNS name of the instance. - // - // - ebs-optimized - A Boolean that indicates whether the instance is optimized - // for Amazon EBS I/O. - // - // - ena-support - A Boolean that indicates whether the instance is enabled for - // enhanced networking with ENA. - // - // - enclave-options.enabled - A Boolean that indicates whether the instance is - // enabled for Amazon Web Services Nitro Enclaves. - // - // - hibernation-options.configured - A Boolean that indicates whether the - // instance is enabled for hibernation. A value of true means that the instance - // is enabled for hibernation. - // - // - host-id - The ID of the Dedicated Host on which the instance is running, if - // applicable. - // - // - hypervisor - The hypervisor type of the instance ( ovm | xen ). The value - // xen is used for both Xen and Nitro hypervisors. - // - // - iam-instance-profile.arn - The instance profile associated with the - // instance. Specified as an ARN. - // - // - iam-instance-profile.id - The instance profile associated with the instance. - // Specified as an ID. - // - // - image-id - The ID of the image used to launch the instance. - // - // - instance-id - The ID of the instance. - // - // - instance-lifecycle - Indicates whether this is a Spot Instance, a Scheduled - // Instance, or a Capacity Block ( spot | scheduled | capacity-block ). - // - // - instance-state-code - The state of the instance, as a 16-bit unsigned - // integer. The high byte is used for internal purposes and should be ignored. The - // low byte is set based on the state represented. The valid values are: 0 - // (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and - // 80 (stopped). - // - // - instance-state-name - The state of the instance ( pending | running | - // shutting-down | terminated | stopping | stopped ). - // - // - instance-type - The type of instance (for example, t2.micro ). - // - // - instance.group-id - The ID of the security group for the instance. - // - // - instance.group-name - The name of the security group for the instance. - // - // - ip-address - The public IPv4 address of the instance. - // - // - ipv6-address - The IPv6 address of the instance. - // - // - kernel-id - The kernel ID. - // - // - key-name - The name of the key pair used when the instance was launched. - // - // - launch-index - When launching multiple instances, this is the index for the - // instance in the launch group (for example, 0, 1, 2, and so on). - // - // - launch-time - The time when the instance was launched, in the ISO 8601 - // format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, - // 2021-09-29T11:04:43.305Z . You can use a wildcard ( * ), for example, - // 2021-09-29T* , which matches an entire day. - // - // - maintenance-options.auto-recovery - The current automatic recovery behavior - // of the instance ( disabled | default ). - // - // - metadata-options.http-endpoint - The status of access to the HTTP metadata - // endpoint on your instance ( enabled | disabled ) - // - // - metadata-options.http-protocol-ipv4 - Indicates whether the IPv4 endpoint is - // enabled ( disabled | enabled ). - // - // - metadata-options.http-protocol-ipv6 - Indicates whether the IPv6 endpoint is - // enabled ( disabled | enabled ). - // - // - metadata-options.http-put-response-hop-limit - The HTTP metadata request put - // response hop limit (integer, possible values 1 to 64 ) - // - // - metadata-options.http-tokens - The metadata request authorization state ( - // optional | required ) - // - // - metadata-options.instance-metadata-tags - The status of access to instance - // tags from the instance metadata ( enabled | disabled ) - // - // - metadata-options.state - The state of the metadata option changes ( pending - // | applied ). - // - // - monitoring-state - Indicates whether detailed monitoring is enabled ( - // disabled | enabled ). - // - // - network-interface.addresses.association.allocation-id - The allocation ID. - // - // - network-interface.addresses.association.association-id - The association ID. - // - // - network-interface.addresses.association.carrier-ip - The carrier IP address. - // - // - network-interface.addresses.association.customer-owned-ip - The - // customer-owned IP address. - // - // - network-interface.addresses.association.ip-owner-id - The owner ID of the - // private IPv4 address associated with the network interface. - // - // - network-interface.addresses.association.public-dns-name - The public DNS - // name. - // - // - network-interface.addresses.association.public-ip - The ID of the - // association of an Elastic IP address (IPv4) with a network interface. - // - // - network-interface.addresses.primary - Specifies whether the IPv4 address of - // the network interface is the primary private IPv4 address. - // - // - network-interface.addresses.private-dns-name - The private DNS name. - // - // - network-interface.addresses.private-ip-address - The private IPv4 address - // associated with the network interface. - // - // - network-interface.association.allocation-id - The allocation ID returned - // when you allocated the Elastic IP address (IPv4) for your network interface. - // - // - network-interface.association.association-id - The association ID returned - // when the network interface was associated with an IPv4 address. - // - // - network-interface.association.carrier-ip - The customer-owned IP address. - // - // - network-interface.association.customer-owned-ip - The customer-owned IP - // address. - // - // - network-interface.association.ip-owner-id - The owner of the Elastic IP - // address (IPv4) associated with the network interface. - // - // - network-interface.association.public-dns-name - The public DNS name. - // - // - network-interface.association.public-ip - The address of the Elastic IP - // address (IPv4) bound to the network interface. - // - // - network-interface.attachment.attach-time - The time that the network - // interface was attached to an instance. - // - // - network-interface.attachment.attachment-id - The ID of the interface - // attachment. - // - // - network-interface.attachment.delete-on-termination - Specifies whether the - // attachment is deleted when an instance is terminated. - // - // - network-interface.attachment.device-index - The device index to which the - // network interface is attached. - // - // - network-interface.attachment.instance-id - The ID of the instance to which - // the network interface is attached. - // - // - network-interface.attachment.instance-owner-id - The owner ID of the - // instance to which the network interface is attached. - // - // - network-interface.attachment.network-card-index - The index of the network - // card. - // - // - network-interface.attachment.status - The status of the attachment ( - // attaching | attached | detaching | detached ). - // - // - network-interface.availability-zone - The Availability Zone for the network - // interface. - // - // - network-interface.deny-all-igw-traffic - A Boolean that indicates whether a - // network interface with an IPv6 address is unreachable from the public internet. - // - // - network-interface.description - The description of the network interface. - // - // - network-interface.group-id - The ID of a security group associated with the - // network interface. - // - // - network-interface.group-name - The name of a security group associated with - // the network interface. - // - // - network-interface.ipv4-prefixes.ipv4-prefix - The IPv4 prefixes that are - // assigned to the network interface. - // - // - network-interface.ipv6-address - The IPv6 address associated with the - // network interface. - // - // - network-interface.ipv6-addresses.ipv6-address - The IPv6 address associated - // with the network interface. - // - // - network-interface.ipv6-addresses.is-primary-ipv6 - A Boolean that indicates - // whether this is the primary IPv6 address. - // - // - network-interface.ipv6-native - A Boolean that indicates whether this is an - // IPv6 only network interface. - // - // - network-interface.ipv6-prefixes.ipv6-prefix - The IPv6 prefix assigned to - // the network interface. - // - // - network-interface.mac-address - The MAC address of the network interface. - // - // - network-interface.network-interface-id - The ID of the network interface. - // - // - network-interface.operator.managed - A Boolean that indicates whether the - // instance has a managed network interface. - // - // - network-interface.operator.principal - The principal that manages the - // network interface. Only valid for instances with managed network interfaces, - // where managed is true . - // - // - network-interface.outpost-arn - The ARN of the Outpost. - // - // - network-interface.owner-id - The ID of the owner of the network interface. - // - // - network-interface.private-dns-name - The private DNS name of the network - // interface. - // - // - network-interface.private-ip-address - The private IPv4 address. - // - // - network-interface.public-dns-name - The public DNS name. - // - // - network-interface.requester-id - The requester ID for the network interface. - // - // - network-interface.requester-managed - Indicates whether the network - // interface is being managed by Amazon Web Services. - // - // - network-interface.status - The status of the network interface ( available ) - // | in-use ). - // - // - network-interface.source-dest-check - Whether the network interface performs - // source/destination checking. A value of true means that checking is enabled, - // and false means that checking is disabled. The value must be false for the - // network interface to perform network address translation (NAT) in your VPC. - // - // - network-interface.subnet-id - The ID of the subnet for the network interface. - // - // - network-interface.tag-key - The key of a tag assigned to the network - // interface. - // - // - network-interface.tag-value - The value of a tag assigned to the network - // interface. - // - // - network-interface.vpc-id - The ID of the VPC for the network interface. - // - // - network-performance-options.bandwidth-weighting - Where the performance - // boost is applied, if applicable. Valid values: default , vpc-1 , ebs-1 . - // - // - operator.managed - A Boolean that indicates whether this is a managed - // instance. - // - // - operator.principal - The principal that manages the instance. Only valid for - // managed instances, where managed is true . - // - // - outpost-arn - The Amazon Resource Name (ARN) of the Outpost. - // - // - owner-id - The Amazon Web Services account ID of the instance owner. - // - // - placement-group-name - The name of the placement group for the instance. - // - // - placement-partition-number - The partition in which the instance is located. - // - // - platform - The platform. To list only Windows instances, use windows . - // - // - platform-details - The platform ( Linux/UNIX | Red Hat BYOL Linux | Red Hat - // Enterprise Linux | Red Hat Enterprise Linux with HA | Red Hat Enterprise - // Linux with SQL Server Standard and HA | Red Hat Enterprise Linux with SQL - // Server Enterprise and HA | Red Hat Enterprise Linux with SQL Server Standard | - // Red Hat Enterprise Linux with SQL Server Web | Red Hat Enterprise Linux with - // SQL Server Enterprise | SQL Server Enterprise | SQL Server Standard | SQL - // Server Web | SUSE Linux | Ubuntu Pro | Windows | Windows BYOL | Windows with - // SQL Server Enterprise | Windows with SQL Server Standard | Windows with SQL - // Server Web ). - // - // - private-dns-name - The private IPv4 DNS name of the instance. - // - // - private-dns-name-options.enable-resource-name-dns-a-record - A Boolean that - // indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - // - // - private-dns-name-options.enable-resource-name-dns-aaaa-record - A Boolean - // that indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - // - // - private-dns-name-options.hostname-type - The type of hostname ( ip-name | - // resource-name ). - // - // - private-ip-address - The private IPv4 address of the instance. This can only - // be used to filter by the primary IP address of the network interface attached to - // the instance. To filter by additional IP addresses assigned to the network - // interface, use the filter network-interface.addresses.private-ip-address . - // - // - product-code - The product code associated with the AMI used to launch the - // instance. - // - // - product-code.type - The type of product code ( devpay | marketplace ). - // - // - ramdisk-id - The RAM disk ID. - // - // - reason - The reason for the current state of the instance (for example, - // shows "User Initiated [date]" when you stop or terminate the instance). Similar - // to the state-reason-code filter. - // - // - requester-id - The ID of the entity that launched the instance on your - // behalf (for example, Amazon Web Services Management Console, Auto Scaling, and - // so on). - // - // - reservation-id - The ID of the instance's reservation. A reservation ID is - // created any time you launch an instance. A reservation ID has a one-to-one - // relationship with an instance launch request, but can be associated with more - // than one instance if you launch multiple instances using the same launch - // request. For example, if you launch one instance, you get one reservation ID. If - // you launch ten instances using the same launch request, you also get one - // reservation ID. - // - // - root-device-name - The device name of the root device volume (for example, - // /dev/sda1 ). - // - // - root-device-type - The type of the root device volume ( ebs | instance-store - // ). - // - // - source-dest-check - Indicates whether the instance performs - // source/destination checking. A value of true means that checking is enabled, - // and false means that checking is disabled. The value must be false for the - // instance to perform network address translation (NAT) in your VPC. - // - // - spot-instance-request-id - The ID of the Spot Instance request. - // - // - state-reason-code - The reason code for the state change. - // - // - state-reason-message - A message that describes the state change. - // - // - subnet-id - The ID of the subnet for the instance. - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources that have a tag with a specific key, regardless of the tag value. - // - // - tenancy - The tenancy of an instance ( dedicated | default | host ). - // - // - tpm-support - Indicates if the instance is configured for NitroTPM support ( - // v2.0 ). - // - // - usage-operation - The usage operation value for the instance ( RunInstances - // | RunInstances:00g0 | RunInstances:0010 | RunInstances:1010 | - // RunInstances:1014 | RunInstances:1110 | RunInstances:0014 | RunInstances:0210 - // | RunInstances:0110 | RunInstances:0100 | RunInstances:0004 | - // RunInstances:0200 | RunInstances:000g | RunInstances:0g00 | RunInstances:0002 - // | RunInstances:0800 | RunInstances:0102 | RunInstances:0006 | - // RunInstances:0202 ). - // - // - usage-operation-update-time - The time that the usage operation was last - // updated, for example, 2022-09-15T17:15:20.000Z . - // - // - virtualization-type - The virtualization type of the instance ( paravirtual - // | hvm ). - // - // - vpc-id - The ID of the VPC that the instance is running in. - Filters []types.Filter - - // The instance IDs. - // - // Default: Describes all your instances. - InstanceIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // request. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInstancesOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the reservations. - Reservations []types.Reservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// InstanceExistsWaiterOptions are waiter options for InstanceExistsWaiter -type InstanceExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InstanceExistsWaiter will use default minimum delay of 5 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InstanceExistsWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstancesInput, *DescribeInstancesOutput, error) (bool, error) -} - -// InstanceExistsWaiter defines the waiters for InstanceExists -type InstanceExistsWaiter struct { - client DescribeInstancesAPIClient - - options InstanceExistsWaiterOptions -} - -// NewInstanceExistsWaiter constructs a InstanceExistsWaiter. -func NewInstanceExistsWaiter(client DescribeInstancesAPIClient, optFns ...func(*InstanceExistsWaiterOptions)) *InstanceExistsWaiter { - options := InstanceExistsWaiterOptions{} - options.MinDelay = 5 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = instanceExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InstanceExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InstanceExists waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *InstanceExistsWaiter) Wait(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InstanceExists waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *InstanceExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceExistsWaiterOptions)) (*DescribeInstancesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstances(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InstanceExists waiter") -} - -func instanceExistsStateRetryable(ctx context.Context, input *DescribeInstancesInput, output *DescribeInstancesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Reservations - v2 := len(v1) - v3 := 0 - v4 := int64(v2) > int64(v3) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v4 == bv { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidInstanceID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// InstanceRunningWaiterOptions are waiter options for InstanceRunningWaiter -type InstanceRunningWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InstanceRunningWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InstanceRunningWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstancesInput, *DescribeInstancesOutput, error) (bool, error) -} - -// InstanceRunningWaiter defines the waiters for InstanceRunning -type InstanceRunningWaiter struct { - client DescribeInstancesAPIClient - - options InstanceRunningWaiterOptions -} - -// NewInstanceRunningWaiter constructs a InstanceRunningWaiter. -func NewInstanceRunningWaiter(client DescribeInstancesAPIClient, optFns ...func(*InstanceRunningWaiterOptions)) *InstanceRunningWaiter { - options := InstanceRunningWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = instanceRunningStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InstanceRunningWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InstanceRunning waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *InstanceRunningWaiter) Wait(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceRunningWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InstanceRunning waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *InstanceRunningWaiter) WaitForOutput(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceRunningWaiterOptions)) (*DescribeInstancesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstances(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InstanceRunning waiter") -} - -func instanceRunningStateRetryable(ctx context.Context, input *DescribeInstancesInput, output *DescribeInstancesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "running" - match := len(v5) > 0 - for _, v := range v5 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "shutting-down" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "terminated" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "stopping" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidInstanceID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// InstanceStoppedWaiterOptions are waiter options for InstanceStoppedWaiter -type InstanceStoppedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InstanceStoppedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InstanceStoppedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstancesInput, *DescribeInstancesOutput, error) (bool, error) -} - -// InstanceStoppedWaiter defines the waiters for InstanceStopped -type InstanceStoppedWaiter struct { - client DescribeInstancesAPIClient - - options InstanceStoppedWaiterOptions -} - -// NewInstanceStoppedWaiter constructs a InstanceStoppedWaiter. -func NewInstanceStoppedWaiter(client DescribeInstancesAPIClient, optFns ...func(*InstanceStoppedWaiterOptions)) *InstanceStoppedWaiter { - options := InstanceStoppedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = instanceStoppedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InstanceStoppedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InstanceStopped waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *InstanceStoppedWaiter) Wait(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceStoppedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InstanceStopped waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *InstanceStoppedWaiter) WaitForOutput(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceStoppedWaiterOptions)) (*DescribeInstancesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstances(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InstanceStopped waiter") -} - -func instanceStoppedStateRetryable(ctx context.Context, input *DescribeInstancesInput, output *DescribeInstancesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "stopped" - match := len(v5) > 0 - for _, v := range v5 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "pending" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "terminated" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// InstanceTerminatedWaiterOptions are waiter options for InstanceTerminatedWaiter -type InstanceTerminatedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InstanceTerminatedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InstanceTerminatedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInstancesInput, *DescribeInstancesOutput, error) (bool, error) -} - -// InstanceTerminatedWaiter defines the waiters for InstanceTerminated -type InstanceTerminatedWaiter struct { - client DescribeInstancesAPIClient - - options InstanceTerminatedWaiterOptions -} - -// NewInstanceTerminatedWaiter constructs a InstanceTerminatedWaiter. -func NewInstanceTerminatedWaiter(client DescribeInstancesAPIClient, optFns ...func(*InstanceTerminatedWaiterOptions)) *InstanceTerminatedWaiter { - options := InstanceTerminatedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = instanceTerminatedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InstanceTerminatedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InstanceTerminated waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *InstanceTerminatedWaiter) Wait(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceTerminatedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InstanceTerminated waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *InstanceTerminatedWaiter) WaitForOutput(ctx context.Context, params *DescribeInstancesInput, maxWaitDur time.Duration, optFns ...func(*InstanceTerminatedWaiterOptions)) (*DescribeInstancesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInstances(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InstanceTerminated waiter") -} - -func instanceTerminatedStateRetryable(ctx context.Context, input *DescribeInstancesInput, output *DescribeInstancesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "terminated" - match := len(v5) > 0 - for _, v := range v5 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "pending" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Reservations - var v2 [][]types.Instance - for _, v := range v1 { - v3 := v.Instances - v2 = append(v2, v3) - } - var v4 []types.Instance - for _, v := range v2 { - v4 = append(v4, v...) - } - var v5 []types.InstanceStateName - for _, v := range v4 { - v6 := v.State - var v7 types.InstanceStateName - if v6 != nil { - v8 := v6.Name - v7 = v8 - } - v5 = append(v5, v7) - } - expectedValue := "stopping" - var match bool - for _, v := range v5 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeInstancesPaginatorOptions is the paginator options for DescribeInstances -type DescribeInstancesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the instance IDs parameter in the same - // request. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInstancesPaginator is a paginator for DescribeInstances -type DescribeInstancesPaginator struct { - options DescribeInstancesPaginatorOptions - client DescribeInstancesAPIClient - params *DescribeInstancesInput - nextToken *string - firstPage bool -} - -// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator -func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { - if params == nil { - params = &DescribeInstancesInput{} - } - - options := DescribeInstancesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInstancesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInstancesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInstances page. -func (p *DescribeInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInstances(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInstancesAPIClient is a client that implements the DescribeInstances -// operation. -type DescribeInstancesAPIClient interface { - DescribeInstances(context.Context, *DescribeInstancesInput, ...func(*Options)) (*DescribeInstancesOutput, error) -} - -var _ DescribeInstancesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInternetGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInternetGateways.go deleted file mode 100644 index b8a246ec4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeInternetGateways.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes your internet gateways. The default is to describe all your internet -// gateways. Alternatively, you can specify specific internet gateway IDs or filter -// the results to include only the internet gateways that match specific criteria. -func (c *Client) DescribeInternetGateways(ctx context.Context, params *DescribeInternetGatewaysInput, optFns ...func(*Options)) (*DescribeInternetGatewaysOutput, error) { - if params == nil { - params = &DescribeInternetGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInternetGateways", params, optFns, c.addOperationDescribeInternetGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInternetGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInternetGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - attachment.state - The current state of the attachment between the gateway - // and the VPC ( available ). Present only if a VPC is attached. - // - // - attachment.vpc-id - The ID of an attached VPC. - // - // - internet-gateway-id - The ID of the Internet gateway. - // - // - owner-id - The ID of the Amazon Web Services account that owns the internet - // gateway. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The IDs of the internet gateways. - // - // Default: Describes all your internet gateways. - InternetGatewayIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeInternetGatewaysOutput struct { - - // Information about the internet gateways. - InternetGateways []types.InternetGateway - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInternetGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeInternetGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeInternetGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInternetGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInternetGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// InternetGatewayExistsWaiterOptions are waiter options for -// InternetGatewayExistsWaiter -type InternetGatewayExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // InternetGatewayExistsWaiter will use default minimum delay of 5 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InternetGatewayExistsWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeInternetGatewaysInput, *DescribeInternetGatewaysOutput, error) (bool, error) -} - -// InternetGatewayExistsWaiter defines the waiters for InternetGatewayExists -type InternetGatewayExistsWaiter struct { - client DescribeInternetGatewaysAPIClient - - options InternetGatewayExistsWaiterOptions -} - -// NewInternetGatewayExistsWaiter constructs a InternetGatewayExistsWaiter. -func NewInternetGatewayExistsWaiter(client DescribeInternetGatewaysAPIClient, optFns ...func(*InternetGatewayExistsWaiterOptions)) *InternetGatewayExistsWaiter { - options := InternetGatewayExistsWaiterOptions{} - options.MinDelay = 5 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = internetGatewayExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &InternetGatewayExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for InternetGatewayExists waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *InternetGatewayExistsWaiter) Wait(ctx context.Context, params *DescribeInternetGatewaysInput, maxWaitDur time.Duration, optFns ...func(*InternetGatewayExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for InternetGatewayExists waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *InternetGatewayExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeInternetGatewaysInput, maxWaitDur time.Duration, optFns ...func(*InternetGatewayExistsWaiterOptions)) (*DescribeInternetGatewaysOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeInternetGateways(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for InternetGatewayExists waiter") -} - -func internetGatewayExistsStateRetryable(ctx context.Context, input *DescribeInternetGatewaysInput, output *DescribeInternetGatewaysOutput, err error) (bool, error) { - - if err == nil { - v1 := output.InternetGateways - var v2 []string - for _, v := range v1 { - v3 := v.InternetGatewayId - if v3 != nil { - v2 = append(v2, *v3) - } - } - v4 := len(v2) - v5 := 0 - v6 := int64(v4) > int64(v5) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v6 == bv { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidInternetGateway.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeInternetGatewaysPaginatorOptions is the paginator options for -// DescribeInternetGateways -type DescribeInternetGatewaysPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeInternetGatewaysPaginator is a paginator for DescribeInternetGateways -type DescribeInternetGatewaysPaginator struct { - options DescribeInternetGatewaysPaginatorOptions - client DescribeInternetGatewaysAPIClient - params *DescribeInternetGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeInternetGatewaysPaginator returns a new -// DescribeInternetGatewaysPaginator -func NewDescribeInternetGatewaysPaginator(client DescribeInternetGatewaysAPIClient, params *DescribeInternetGatewaysInput, optFns ...func(*DescribeInternetGatewaysPaginatorOptions)) *DescribeInternetGatewaysPaginator { - if params == nil { - params = &DescribeInternetGatewaysInput{} - } - - options := DescribeInternetGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeInternetGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeInternetGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeInternetGateways page. -func (p *DescribeInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInternetGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeInternetGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeInternetGatewaysAPIClient is a client that implements the -// DescribeInternetGateways operation. -type DescribeInternetGatewaysAPIClient interface { - DescribeInternetGateways(context.Context, *DescribeInternetGatewaysInput, ...func(*Options)) (*DescribeInternetGatewaysOutput, error) -} - -var _ DescribeInternetGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInternetGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamByoasn.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamByoasn.go deleted file mode 100644 index 73ff267a1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamByoasn.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your Autonomous System Numbers (ASNs), their provisioning statuses, -// and the BYOIP CIDRs with which they are associated. For more information, see [Tutorial: Bring your ASN to IPAM] -// in the Amazon VPC IPAM guide. -// -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -func (c *Client) DescribeIpamByoasn(ctx context.Context, params *DescribeIpamByoasnInput, optFns ...func(*Options)) (*DescribeIpamByoasnOutput, error) { - if params == nil { - params = &DescribeIpamByoasnInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamByoasn", params, optFns, c.addOperationDescribeIpamByoasnMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamByoasnOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamByoasnInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamByoasnOutput struct { - - // ASN and BYOIP CIDR associations. - Byoasns []types.Byoasn - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamByoasn{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamByoasn{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamByoasn"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamByoasn(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamByoasn", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamExternalResourceVerificationTokens.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamExternalResourceVerificationTokens.go deleted file mode 100644 index a86e9b168..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamExternalResourceVerificationTokens.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describe verification tokens. A verification token is an Amazon Web -// Services-generated random value that you can use to prove ownership of an -// external resource. For example, you can use a verification token to validate -// that you control a public IP address range when you bring an IP address range to -// Amazon Web Services (BYOIP). -func (c *Client) DescribeIpamExternalResourceVerificationTokens(ctx context.Context, params *DescribeIpamExternalResourceVerificationTokensInput, optFns ...func(*Options)) (*DescribeIpamExternalResourceVerificationTokensOutput, error) { - if params == nil { - params = &DescribeIpamExternalResourceVerificationTokensInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamExternalResourceVerificationTokens", params, optFns, c.addOperationDescribeIpamExternalResourceVerificationTokensMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamExternalResourceVerificationTokensOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamExternalResourceVerificationTokensInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // Available filters: - // - // - ipam-arn - // - // - ipam-external-resource-verification-token-arn - // - // - ipam-external-resource-verification-token-id - // - // - ipam-id - // - // - ipam-region - // - // - state - // - // - status - // - // - token-name - // - // - token-value - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // Verification token IDs. - IpamExternalResourceVerificationTokenIds []string - - // The maximum number of tokens to return in one page of results. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamExternalResourceVerificationTokensOutput struct { - - // Verification tokens. - IpamExternalResourceVerificationTokens []types.IpamExternalResourceVerificationToken - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamExternalResourceVerificationTokensMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamExternalResourceVerificationTokens{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamExternalResourceVerificationTokens{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamExternalResourceVerificationTokens"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamExternalResourceVerificationTokens(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeIpamExternalResourceVerificationTokens(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamExternalResourceVerificationTokens", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamPools.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamPools.go deleted file mode 100644 index 471e20f9f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamPools.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get information about your IPAM pools. -func (c *Client) DescribeIpamPools(ctx context.Context, params *DescribeIpamPoolsInput, optFns ...func(*Options)) (*DescribeIpamPoolsOutput, error) { - if params == nil { - params = &DescribeIpamPoolsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamPools", params, optFns, c.addOperationDescribeIpamPoolsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamPoolsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamPoolsInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The IDs of the IPAM pools you would like information on. - IpamPoolIds []string - - // The maximum number of results to return in the request. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamPoolsOutput struct { - - // Information about the IPAM pools. - IpamPools []types.IpamPool - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamPoolsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamPools{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamPools{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamPools"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamPools(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpamPoolsPaginatorOptions is the paginator options for DescribeIpamPools -type DescribeIpamPoolsPaginatorOptions struct { - // The maximum number of results to return in the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpamPoolsPaginator is a paginator for DescribeIpamPools -type DescribeIpamPoolsPaginator struct { - options DescribeIpamPoolsPaginatorOptions - client DescribeIpamPoolsAPIClient - params *DescribeIpamPoolsInput - nextToken *string - firstPage bool -} - -// NewDescribeIpamPoolsPaginator returns a new DescribeIpamPoolsPaginator -func NewDescribeIpamPoolsPaginator(client DescribeIpamPoolsAPIClient, params *DescribeIpamPoolsInput, optFns ...func(*DescribeIpamPoolsPaginatorOptions)) *DescribeIpamPoolsPaginator { - if params == nil { - params = &DescribeIpamPoolsInput{} - } - - options := DescribeIpamPoolsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpamPoolsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpamPoolsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpamPools page. -func (p *DescribeIpamPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpamPoolsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpamPools(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpamPoolsAPIClient is a client that implements the DescribeIpamPools -// operation. -type DescribeIpamPoolsAPIClient interface { - DescribeIpamPools(context.Context, *DescribeIpamPoolsInput, ...func(*Options)) (*DescribeIpamPoolsOutput, error) -} - -var _ DescribeIpamPoolsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpamPools(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamPools", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveries.go deleted file mode 100644 index a05766632..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveries.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes IPAM resource discoveries. A resource discovery is an IPAM component -// that enables IPAM to manage and monitor resources that belong to the owning -// account. -func (c *Client) DescribeIpamResourceDiscoveries(ctx context.Context, params *DescribeIpamResourceDiscoveriesInput, optFns ...func(*Options)) (*DescribeIpamResourceDiscoveriesOutput, error) { - if params == nil { - params = &DescribeIpamResourceDiscoveriesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamResourceDiscoveries", params, optFns, c.addOperationDescribeIpamResourceDiscoveriesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamResourceDiscoveriesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamResourceDiscoveriesInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The resource discovery filters. - Filters []types.Filter - - // The IPAM resource discovery IDs. - IpamResourceDiscoveryIds []string - - // The maximum number of resource discoveries to return in one page of results. - MaxResults *int32 - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamResourceDiscoveriesOutput struct { - - // The resource discoveries. - IpamResourceDiscoveries []types.IpamResourceDiscovery - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamResourceDiscoveriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamResourceDiscoveries{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamResourceDiscoveries{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamResourceDiscoveries"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamResourceDiscoveries(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpamResourceDiscoveriesPaginatorOptions is the paginator options for -// DescribeIpamResourceDiscoveries -type DescribeIpamResourceDiscoveriesPaginatorOptions struct { - // The maximum number of resource discoveries to return in one page of results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpamResourceDiscoveriesPaginator is a paginator for -// DescribeIpamResourceDiscoveries -type DescribeIpamResourceDiscoveriesPaginator struct { - options DescribeIpamResourceDiscoveriesPaginatorOptions - client DescribeIpamResourceDiscoveriesAPIClient - params *DescribeIpamResourceDiscoveriesInput - nextToken *string - firstPage bool -} - -// NewDescribeIpamResourceDiscoveriesPaginator returns a new -// DescribeIpamResourceDiscoveriesPaginator -func NewDescribeIpamResourceDiscoveriesPaginator(client DescribeIpamResourceDiscoveriesAPIClient, params *DescribeIpamResourceDiscoveriesInput, optFns ...func(*DescribeIpamResourceDiscoveriesPaginatorOptions)) *DescribeIpamResourceDiscoveriesPaginator { - if params == nil { - params = &DescribeIpamResourceDiscoveriesInput{} - } - - options := DescribeIpamResourceDiscoveriesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpamResourceDiscoveriesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpamResourceDiscoveriesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpamResourceDiscoveries page. -func (p *DescribeIpamResourceDiscoveriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpamResourceDiscoveriesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpamResourceDiscoveries(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpamResourceDiscoveriesAPIClient is a client that implements the -// DescribeIpamResourceDiscoveries operation. -type DescribeIpamResourceDiscoveriesAPIClient interface { - DescribeIpamResourceDiscoveries(context.Context, *DescribeIpamResourceDiscoveriesInput, ...func(*Options)) (*DescribeIpamResourceDiscoveriesOutput, error) -} - -var _ DescribeIpamResourceDiscoveriesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpamResourceDiscoveries(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamResourceDiscoveries", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveryAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveryAssociations.go deleted file mode 100644 index 0eb7134e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamResourceDiscoveryAssociations.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes resource discovery association with an Amazon VPC IPAM. An associated -// resource discovery is a resource discovery that has been associated with an -// IPAM.. -func (c *Client) DescribeIpamResourceDiscoveryAssociations(ctx context.Context, params *DescribeIpamResourceDiscoveryAssociationsInput, optFns ...func(*Options)) (*DescribeIpamResourceDiscoveryAssociationsOutput, error) { - if params == nil { - params = &DescribeIpamResourceDiscoveryAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamResourceDiscoveryAssociations", params, optFns, c.addOperationDescribeIpamResourceDiscoveryAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamResourceDiscoveryAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamResourceDiscoveryAssociationsInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The resource discovery association filters. - Filters []types.Filter - - // The resource discovery association IDs. - IpamResourceDiscoveryAssociationIds []string - - // The maximum number of resource discovery associations to return in one page of - // results. - MaxResults *int32 - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamResourceDiscoveryAssociationsOutput struct { - - // The resource discovery associations. - IpamResourceDiscoveryAssociations []types.IpamResourceDiscoveryAssociation - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamResourceDiscoveryAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamResourceDiscoveryAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamResourceDiscoveryAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamResourceDiscoveryAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamResourceDiscoveryAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpamResourceDiscoveryAssociationsPaginatorOptions is the paginator -// options for DescribeIpamResourceDiscoveryAssociations -type DescribeIpamResourceDiscoveryAssociationsPaginatorOptions struct { - // The maximum number of resource discovery associations to return in one page of - // results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpamResourceDiscoveryAssociationsPaginator is a paginator for -// DescribeIpamResourceDiscoveryAssociations -type DescribeIpamResourceDiscoveryAssociationsPaginator struct { - options DescribeIpamResourceDiscoveryAssociationsPaginatorOptions - client DescribeIpamResourceDiscoveryAssociationsAPIClient - params *DescribeIpamResourceDiscoveryAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeIpamResourceDiscoveryAssociationsPaginator returns a new -// DescribeIpamResourceDiscoveryAssociationsPaginator -func NewDescribeIpamResourceDiscoveryAssociationsPaginator(client DescribeIpamResourceDiscoveryAssociationsAPIClient, params *DescribeIpamResourceDiscoveryAssociationsInput, optFns ...func(*DescribeIpamResourceDiscoveryAssociationsPaginatorOptions)) *DescribeIpamResourceDiscoveryAssociationsPaginator { - if params == nil { - params = &DescribeIpamResourceDiscoveryAssociationsInput{} - } - - options := DescribeIpamResourceDiscoveryAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpamResourceDiscoveryAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpamResourceDiscoveryAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpamResourceDiscoveryAssociations page. -func (p *DescribeIpamResourceDiscoveryAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpamResourceDiscoveryAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpamResourceDiscoveryAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpamResourceDiscoveryAssociationsAPIClient is a client that implements -// the DescribeIpamResourceDiscoveryAssociations operation. -type DescribeIpamResourceDiscoveryAssociationsAPIClient interface { - DescribeIpamResourceDiscoveryAssociations(context.Context, *DescribeIpamResourceDiscoveryAssociationsInput, ...func(*Options)) (*DescribeIpamResourceDiscoveryAssociationsOutput, error) -} - -var _ DescribeIpamResourceDiscoveryAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpamResourceDiscoveryAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamResourceDiscoveryAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamScopes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamScopes.go deleted file mode 100644 index 2dfa57ea8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpamScopes.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get information about your IPAM scopes. -func (c *Client) DescribeIpamScopes(ctx context.Context, params *DescribeIpamScopesInput, optFns ...func(*Options)) (*DescribeIpamScopesOutput, error) { - if params == nil { - params = &DescribeIpamScopesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpamScopes", params, optFns, c.addOperationDescribeIpamScopesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamScopesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamScopesInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The IDs of the scopes you want information on. - IpamScopeIds []string - - // The maximum number of results to return in the request. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamScopesOutput struct { - - // The scopes you want information on. - IpamScopes []types.IpamScope - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamScopesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamScopes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamScopes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamScopes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamScopes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpamScopesPaginatorOptions is the paginator options for -// DescribeIpamScopes -type DescribeIpamScopesPaginatorOptions struct { - // The maximum number of results to return in the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpamScopesPaginator is a paginator for DescribeIpamScopes -type DescribeIpamScopesPaginator struct { - options DescribeIpamScopesPaginatorOptions - client DescribeIpamScopesAPIClient - params *DescribeIpamScopesInput - nextToken *string - firstPage bool -} - -// NewDescribeIpamScopesPaginator returns a new DescribeIpamScopesPaginator -func NewDescribeIpamScopesPaginator(client DescribeIpamScopesAPIClient, params *DescribeIpamScopesInput, optFns ...func(*DescribeIpamScopesPaginatorOptions)) *DescribeIpamScopesPaginator { - if params == nil { - params = &DescribeIpamScopesInput{} - } - - options := DescribeIpamScopesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpamScopesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpamScopesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpamScopes page. -func (p *DescribeIpamScopesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpamScopesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpamScopes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpamScopesAPIClient is a client that implements the DescribeIpamScopes -// operation. -type DescribeIpamScopesAPIClient interface { - DescribeIpamScopes(context.Context, *DescribeIpamScopesInput, ...func(*Options)) (*DescribeIpamScopesOutput, error) -} - -var _ DescribeIpamScopesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpamScopes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpamScopes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpams.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpams.go deleted file mode 100644 index 2e071f051..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpams.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get information about your IPAM pools. -// -// For more information, see [What is IPAM?] in the Amazon VPC IPAM User Guide. -// -// [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html -func (c *Client) DescribeIpams(ctx context.Context, params *DescribeIpamsInput, optFns ...func(*Options)) (*DescribeIpamsOutput, error) { - if params == nil { - params = &DescribeIpamsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpams", params, optFns, c.addOperationDescribeIpamsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpamsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpamsInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The IDs of the IPAMs you want information on. - IpamIds []string - - // The maximum number of results to return in the request. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeIpamsOutput struct { - - // Information about the IPAMs. - Ipams []types.Ipam - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpamsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpams{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpams{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpams"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpams(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpamsPaginatorOptions is the paginator options for DescribeIpams -type DescribeIpamsPaginatorOptions struct { - // The maximum number of results to return in the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpamsPaginator is a paginator for DescribeIpams -type DescribeIpamsPaginator struct { - options DescribeIpamsPaginatorOptions - client DescribeIpamsAPIClient - params *DescribeIpamsInput - nextToken *string - firstPage bool -} - -// NewDescribeIpamsPaginator returns a new DescribeIpamsPaginator -func NewDescribeIpamsPaginator(client DescribeIpamsAPIClient, params *DescribeIpamsInput, optFns ...func(*DescribeIpamsPaginatorOptions)) *DescribeIpamsPaginator { - if params == nil { - params = &DescribeIpamsInput{} - } - - options := DescribeIpamsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpamsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpamsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpams page. -func (p *DescribeIpamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpamsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpams(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpamsAPIClient is a client that implements the DescribeIpams operation. -type DescribeIpamsAPIClient interface { - DescribeIpams(context.Context, *DescribeIpamsInput, ...func(*Options)) (*DescribeIpamsOutput, error) -} - -var _ DescribeIpamsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpams(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpams", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpv6Pools.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpv6Pools.go deleted file mode 100644 index efc198981..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeIpv6Pools.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your IPv6 address pools. -func (c *Client) DescribeIpv6Pools(ctx context.Context, params *DescribeIpv6PoolsInput, optFns ...func(*Options)) (*DescribeIpv6PoolsOutput, error) { - if params == nil { - params = &DescribeIpv6PoolsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIpv6Pools", params, optFns, c.addOperationDescribeIpv6PoolsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIpv6PoolsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIpv6PoolsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the IPv6 address pools. - PoolIds []string - - noSmithyDocumentSerde -} - -type DescribeIpv6PoolsOutput struct { - - // Information about the IPv6 address pools. - Ipv6Pools []types.Ipv6Pool - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIpv6PoolsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpv6Pools{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpv6Pools{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpv6Pools"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpv6Pools(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeIpv6PoolsPaginatorOptions is the paginator options for DescribeIpv6Pools -type DescribeIpv6PoolsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeIpv6PoolsPaginator is a paginator for DescribeIpv6Pools -type DescribeIpv6PoolsPaginator struct { - options DescribeIpv6PoolsPaginatorOptions - client DescribeIpv6PoolsAPIClient - params *DescribeIpv6PoolsInput - nextToken *string - firstPage bool -} - -// NewDescribeIpv6PoolsPaginator returns a new DescribeIpv6PoolsPaginator -func NewDescribeIpv6PoolsPaginator(client DescribeIpv6PoolsAPIClient, params *DescribeIpv6PoolsInput, optFns ...func(*DescribeIpv6PoolsPaginatorOptions)) *DescribeIpv6PoolsPaginator { - if params == nil { - params = &DescribeIpv6PoolsInput{} - } - - options := DescribeIpv6PoolsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeIpv6PoolsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeIpv6PoolsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeIpv6Pools page. -func (p *DescribeIpv6PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpv6PoolsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeIpv6Pools(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeIpv6PoolsAPIClient is a client that implements the DescribeIpv6Pools -// operation. -type DescribeIpv6PoolsAPIClient interface { - DescribeIpv6Pools(context.Context, *DescribeIpv6PoolsInput, ...func(*Options)) (*DescribeIpv6PoolsOutput, error) -} - -var _ DescribeIpv6PoolsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeIpv6Pools(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIpv6Pools", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeKeyPairs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeKeyPairs.go deleted file mode 100644 index 13f13a7b2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeKeyPairs.go +++ /dev/null @@ -1,405 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes the specified key pairs or all of your key pairs. -// -// For more information about key pairs, see [Amazon EC2 key pairs] in the Amazon EC2 User Guide. -// -// [Amazon EC2 key pairs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html -func (c *Client) DescribeKeyPairs(ctx context.Context, params *DescribeKeyPairsInput, optFns ...func(*Options)) (*DescribeKeyPairsOutput, error) { - if params == nil { - params = &DescribeKeyPairsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeKeyPairs", params, optFns, c.addOperationDescribeKeyPairsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeKeyPairsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeKeyPairsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - key-pair-id - The ID of the key pair. - // - // - fingerprint - The fingerprint of the key pair. - // - // - key-name - The name of the key pair. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - Filters []types.Filter - - // If true , the public key material is included in the response. - // - // Default: false - IncludePublicKey *bool - - // The key pair names. - // - // Default: Describes all of your key pairs. - KeyNames []string - - // The IDs of the key pairs. - KeyPairIds []string - - noSmithyDocumentSerde -} - -type DescribeKeyPairsOutput struct { - - // Information about the key pairs. - KeyPairs []types.KeyPairInfo - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeKeyPairsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeKeyPairs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeKeyPairs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeKeyPairs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeKeyPairs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// KeyPairExistsWaiterOptions are waiter options for KeyPairExistsWaiter -type KeyPairExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // KeyPairExistsWaiter will use default minimum delay of 5 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, KeyPairExistsWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeKeyPairsInput, *DescribeKeyPairsOutput, error) (bool, error) -} - -// KeyPairExistsWaiter defines the waiters for KeyPairExists -type KeyPairExistsWaiter struct { - client DescribeKeyPairsAPIClient - - options KeyPairExistsWaiterOptions -} - -// NewKeyPairExistsWaiter constructs a KeyPairExistsWaiter. -func NewKeyPairExistsWaiter(client DescribeKeyPairsAPIClient, optFns ...func(*KeyPairExistsWaiterOptions)) *KeyPairExistsWaiter { - options := KeyPairExistsWaiterOptions{} - options.MinDelay = 5 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = keyPairExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &KeyPairExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for KeyPairExists waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *KeyPairExistsWaiter) Wait(ctx context.Context, params *DescribeKeyPairsInput, maxWaitDur time.Duration, optFns ...func(*KeyPairExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for KeyPairExists waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *KeyPairExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeKeyPairsInput, maxWaitDur time.Duration, optFns ...func(*KeyPairExistsWaiterOptions)) (*DescribeKeyPairsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeKeyPairs(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for KeyPairExists waiter") -} - -func keyPairExistsStateRetryable(ctx context.Context, input *DescribeKeyPairsInput, output *DescribeKeyPairsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.KeyPairs - var v2 []string - for _, v := range v1 { - v3 := v.KeyName - if v3 != nil { - v2 = append(v2, *v3) - } - } - v4 := len(v2) - v5 := 0 - v6 := int64(v4) > int64(v5) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v6 == bv { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidKeyPair.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeKeyPairsAPIClient is a client that implements the DescribeKeyPairs -// operation. -type DescribeKeyPairsAPIClient interface { - DescribeKeyPairs(context.Context, *DescribeKeyPairsInput, ...func(*Options)) (*DescribeKeyPairsOutput, error) -} - -var _ DescribeKeyPairsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeKeyPairs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeKeyPairs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplateVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplateVersions.go deleted file mode 100644 index 8ada63ca1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplateVersions.go +++ /dev/null @@ -1,359 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more versions of a specified launch template. You can describe -// all versions, individual versions, or a range of versions. You can also describe -// all the latest versions or all the default versions of all the launch templates -// in your account. -func (c *Client) DescribeLaunchTemplateVersions(ctx context.Context, params *DescribeLaunchTemplateVersionsInput, optFns ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) { - if params == nil { - params = &DescribeLaunchTemplateVersionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLaunchTemplateVersions", params, optFns, c.addOperationDescribeLaunchTemplateVersionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLaunchTemplateVersionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLaunchTemplateVersionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - create-time - The time the launch template version was created. - // - // - ebs-optimized - A boolean that indicates whether the instance is optimized - // for Amazon EBS I/O. - // - // - http-endpoint - Indicates whether the HTTP metadata endpoint on your - // instances is enabled ( enabled | disabled ). - // - // - http-protocol-ipv4 - Indicates whether the IPv4 endpoint for the instance - // metadata service is enabled ( enabled | disabled ). - // - // - host-resource-group-arn - The ARN of the host resource group in which to - // launch the instances. - // - // - http-tokens - The state of token usage for your instance metadata requests ( - // optional | required ). - // - // - iam-instance-profile - The ARN of the IAM instance profile. - // - // - image-id - The ID of the AMI. - // - // - instance-type - The instance type. - // - // - is-default-version - A boolean that indicates whether the launch template - // version is the default version. - // - // - kernel-id - The kernel ID. - // - // - license-configuration-arn - The ARN of the license configuration. - // - // - network-card-index - The index of the network card. - // - // - ram-disk-id - The RAM disk ID. - Filters []types.Filter - - // The ID of the launch template. - // - // To describe one or more versions of a specified launch template, you must - // specify either the launch template ID or the launch template name, but not both. - // - // To describe all the latest or default launch template versions in your account, - // you must omit this parameter. - LaunchTemplateId *string - - // The name of the launch template. - // - // To describe one or more versions of a specified launch template, you must - // specify either the launch template name or the launch template ID, but not both. - // - // To describe all the latest or default launch template versions in your account, - // you must omit this parameter. - LaunchTemplateName *string - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 1 and 200. - MaxResults *int32 - - // The version number up to which to describe launch template versions. - MaxVersion *string - - // The version number after which to describe launch template versions. - MinVersion *string - - // The token to request the next page of results. - NextToken *string - - // If true , and if a Systems Manager parameter is specified for ImageId , the AMI - // ID is displayed in the response for imageId . - // - // If false , and if a Systems Manager parameter is specified for ImageId , the - // parameter is displayed in the response for imageId . - // - // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. - // - // Default: false - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ResolveAlias *bool - - // One or more versions of the launch template. Valid values depend on whether you - // are describing a specified launch template (by ID or name) or all launch - // templates in your account. - // - // To describe one or more versions of a specified launch template, valid values - // are $Latest , $Default , and numbers. - // - // To describe all launch templates in your account that are defined as the latest - // version, the valid value is $Latest . To describe all launch templates in your - // account that are defined as the default version, the valid value is $Default . - // You can specify $Latest and $Default in the same request. You cannot specify - // numbers. - Versions []string - - noSmithyDocumentSerde -} - -type DescribeLaunchTemplateVersionsOutput struct { - - // Information about the launch template versions. - LaunchTemplateVersions []types.LaunchTemplateVersion - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLaunchTemplateVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLaunchTemplateVersions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLaunchTemplateVersions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLaunchTemplateVersions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLaunchTemplateVersions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLaunchTemplateVersionsPaginatorOptions is the paginator options for -// DescribeLaunchTemplateVersions -type DescribeLaunchTemplateVersionsPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 1 and 200. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLaunchTemplateVersionsPaginator is a paginator for -// DescribeLaunchTemplateVersions -type DescribeLaunchTemplateVersionsPaginator struct { - options DescribeLaunchTemplateVersionsPaginatorOptions - client DescribeLaunchTemplateVersionsAPIClient - params *DescribeLaunchTemplateVersionsInput - nextToken *string - firstPage bool -} - -// NewDescribeLaunchTemplateVersionsPaginator returns a new -// DescribeLaunchTemplateVersionsPaginator -func NewDescribeLaunchTemplateVersionsPaginator(client DescribeLaunchTemplateVersionsAPIClient, params *DescribeLaunchTemplateVersionsInput, optFns ...func(*DescribeLaunchTemplateVersionsPaginatorOptions)) *DescribeLaunchTemplateVersionsPaginator { - if params == nil { - params = &DescribeLaunchTemplateVersionsInput{} - } - - options := DescribeLaunchTemplateVersionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLaunchTemplateVersionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLaunchTemplateVersionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLaunchTemplateVersions page. -func (p *DescribeLaunchTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLaunchTemplateVersions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLaunchTemplateVersionsAPIClient is a client that implements the -// DescribeLaunchTemplateVersions operation. -type DescribeLaunchTemplateVersionsAPIClient interface { - DescribeLaunchTemplateVersions(context.Context, *DescribeLaunchTemplateVersionsInput, ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) -} - -var _ DescribeLaunchTemplateVersionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLaunchTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLaunchTemplateVersions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplates.go deleted file mode 100644 index 9e972034c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLaunchTemplates.go +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more launch templates. -func (c *Client) DescribeLaunchTemplates(ctx context.Context, params *DescribeLaunchTemplatesInput, optFns ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) { - if params == nil { - params = &DescribeLaunchTemplatesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLaunchTemplates", params, optFns, c.addOperationDescribeLaunchTemplatesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLaunchTemplatesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLaunchTemplatesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - create-time - The time the launch template was created. - // - // - launch-template-name - The name of the launch template. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // One or more launch template IDs. - LaunchTemplateIds []string - - // One or more launch template names. - LaunchTemplateNames []string - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 1 and 200. - MaxResults *int32 - - // The token to request the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLaunchTemplatesOutput struct { - - // Information about the launch templates. - LaunchTemplates []types.LaunchTemplate - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLaunchTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLaunchTemplates{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLaunchTemplates{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLaunchTemplates"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLaunchTemplates(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLaunchTemplatesPaginatorOptions is the paginator options for -// DescribeLaunchTemplates -type DescribeLaunchTemplatesPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 1 and 200. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLaunchTemplatesPaginator is a paginator for DescribeLaunchTemplates -type DescribeLaunchTemplatesPaginator struct { - options DescribeLaunchTemplatesPaginatorOptions - client DescribeLaunchTemplatesAPIClient - params *DescribeLaunchTemplatesInput - nextToken *string - firstPage bool -} - -// NewDescribeLaunchTemplatesPaginator returns a new -// DescribeLaunchTemplatesPaginator -func NewDescribeLaunchTemplatesPaginator(client DescribeLaunchTemplatesAPIClient, params *DescribeLaunchTemplatesInput, optFns ...func(*DescribeLaunchTemplatesPaginatorOptions)) *DescribeLaunchTemplatesPaginator { - if params == nil { - params = &DescribeLaunchTemplatesInput{} - } - - options := DescribeLaunchTemplatesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLaunchTemplatesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLaunchTemplatesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLaunchTemplates page. -func (p *DescribeLaunchTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLaunchTemplates(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLaunchTemplatesAPIClient is a client that implements the -// DescribeLaunchTemplates operation. -type DescribeLaunchTemplatesAPIClient interface { - DescribeLaunchTemplates(context.Context, *DescribeLaunchTemplatesInput, ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) -} - -var _ DescribeLaunchTemplatesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLaunchTemplates(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLaunchTemplates", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go deleted file mode 100644 index 2779c2a8e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the associations between virtual interface groups and local gateway -// route tables. -func (c *Client) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(ctx context.Context, params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { - if params == nil { - params = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations", params, optFns, c.addOperationDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-gateway-id - The ID of a local gateway. - // - // - local-gateway-route-table-arn - The Amazon Resource Name (ARN) of the local - // gateway route table for the virtual interface group. - // - // - local-gateway-route-table-id - The ID of the local gateway route table. - // - // - local-gateway-route-table-virtual-interface-group-association-id - The ID of - // the association. - // - // - local-gateway-route-table-virtual-interface-group-id - The ID of the virtual - // interface group. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway virtual interface group association. - // - // - state - The state of the association. - Filters []types.Filter - - // The IDs of the associations. - LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput struct { - - // Information about the associations. - LocalGatewayRouteTableVirtualInterfaceGroupAssociations []types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions -// is the paginator options for -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations -type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator is a -// paginator for DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations -type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator struct { - options DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions - client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient - params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator -// returns a new -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator -func NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator(client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator { - if params == nil { - params = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput{} - } - - options := DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations page. -func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient is a -// client that implements the -// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation. -type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient interface { - DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(context.Context, *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) -} - -var _ DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go deleted file mode 100644 index 3bee2c82a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified associations between VPCs and local gateway route -// tables. -func (c *Client) DescribeLocalGatewayRouteTableVpcAssociations(ctx context.Context, params *DescribeLocalGatewayRouteTableVpcAssociationsInput, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { - if params == nil { - params = &DescribeLocalGatewayRouteTableVpcAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGatewayRouteTableVpcAssociations", params, optFns, c.addOperationDescribeLocalGatewayRouteTableVpcAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewayRouteTableVpcAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewayRouteTableVpcAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-gateway-id - The ID of a local gateway. - // - // - local-gateway-route-table-arn - The Amazon Resource Name (ARN) of the local - // gateway route table for the association. - // - // - local-gateway-route-table-id - The ID of the local gateway route table. - // - // - local-gateway-route-table-vpc-association-id - The ID of the association. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway route table for the association. - // - // - state - The state of the association. - // - // - vpc-id - The ID of the VPC. - Filters []types.Filter - - // The IDs of the associations. - LocalGatewayRouteTableVpcAssociationIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewayRouteTableVpcAssociationsOutput struct { - - // Information about the associations. - LocalGatewayRouteTableVpcAssociations []types.LocalGatewayRouteTableVpcAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewayRouteTableVpcAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGatewayRouteTableVpcAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVpcAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGatewayRouteTableVpcAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVpcAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions is the paginator -// options for DescribeLocalGatewayRouteTableVpcAssociations -type DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewayRouteTableVpcAssociationsPaginator is a paginator for -// DescribeLocalGatewayRouteTableVpcAssociations -type DescribeLocalGatewayRouteTableVpcAssociationsPaginator struct { - options DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions - client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient - params *DescribeLocalGatewayRouteTableVpcAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator returns a new -// DescribeLocalGatewayRouteTableVpcAssociationsPaginator -func NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator(client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVpcAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVpcAssociationsPaginator { - if params == nil { - params = &DescribeLocalGatewayRouteTableVpcAssociationsInput{} - } - - options := DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewayRouteTableVpcAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLocalGatewayRouteTableVpcAssociations page. -func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGatewayRouteTableVpcAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewayRouteTableVpcAssociationsAPIClient is a client that -// implements the DescribeLocalGatewayRouteTableVpcAssociations operation. -type DescribeLocalGatewayRouteTableVpcAssociationsAPIClient interface { - DescribeLocalGatewayRouteTableVpcAssociations(context.Context, *DescribeLocalGatewayRouteTableVpcAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) -} - -var _ DescribeLocalGatewayRouteTableVpcAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGatewayRouteTableVpcAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTables.go deleted file mode 100644 index 08f7a1fa2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayRouteTables.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more local gateway route tables. By default, all local gateway -// route tables are described. Alternatively, you can filter the results. -func (c *Client) DescribeLocalGatewayRouteTables(ctx context.Context, params *DescribeLocalGatewayRouteTablesInput, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) { - if params == nil { - params = &DescribeLocalGatewayRouteTablesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGatewayRouteTables", params, optFns, c.addOperationDescribeLocalGatewayRouteTablesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewayRouteTablesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewayRouteTablesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-gateway-id - The ID of a local gateway. - // - // - local-gateway-route-table-arn - The Amazon Resource Name (ARN) of the local - // gateway route table. - // - // - local-gateway-route-table-id - The ID of a local gateway route table. - // - // - outpost-arn - The Amazon Resource Name (ARN) of the Outpost. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway route table. - // - // - state - The state of the local gateway route table. - Filters []types.Filter - - // The IDs of the local gateway route tables. - LocalGatewayRouteTableIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewayRouteTablesOutput struct { - - // Information about the local gateway route tables. - LocalGatewayRouteTables []types.LocalGatewayRouteTable - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewayRouteTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGatewayRouteTables{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGatewayRouteTables{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGatewayRouteTables"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTables(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewayRouteTablesPaginatorOptions is the paginator options for -// DescribeLocalGatewayRouteTables -type DescribeLocalGatewayRouteTablesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewayRouteTablesPaginator is a paginator for -// DescribeLocalGatewayRouteTables -type DescribeLocalGatewayRouteTablesPaginator struct { - options DescribeLocalGatewayRouteTablesPaginatorOptions - client DescribeLocalGatewayRouteTablesAPIClient - params *DescribeLocalGatewayRouteTablesInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewayRouteTablesPaginator returns a new -// DescribeLocalGatewayRouteTablesPaginator -func NewDescribeLocalGatewayRouteTablesPaginator(client DescribeLocalGatewayRouteTablesAPIClient, params *DescribeLocalGatewayRouteTablesInput, optFns ...func(*DescribeLocalGatewayRouteTablesPaginatorOptions)) *DescribeLocalGatewayRouteTablesPaginator { - if params == nil { - params = &DescribeLocalGatewayRouteTablesInput{} - } - - options := DescribeLocalGatewayRouteTablesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewayRouteTablesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewayRouteTablesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLocalGatewayRouteTables page. -func (p *DescribeLocalGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGatewayRouteTables(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewayRouteTablesAPIClient is a client that implements the -// DescribeLocalGatewayRouteTables operation. -type DescribeLocalGatewayRouteTablesAPIClient interface { - DescribeLocalGatewayRouteTables(context.Context, *DescribeLocalGatewayRouteTablesInput, ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) -} - -var _ DescribeLocalGatewayRouteTablesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGatewayRouteTables", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go deleted file mode 100644 index 0c23a9035..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified local gateway virtual interface groups. -func (c *Client) DescribeLocalGatewayVirtualInterfaceGroups(ctx context.Context, params *DescribeLocalGatewayVirtualInterfaceGroupsInput, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { - if params == nil { - params = &DescribeLocalGatewayVirtualInterfaceGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGatewayVirtualInterfaceGroups", params, optFns, c.addOperationDescribeLocalGatewayVirtualInterfaceGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewayVirtualInterfaceGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewayVirtualInterfaceGroupsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-gateway-id - The ID of a local gateway. - // - // - local-gateway-virtual-interface-group-id - The ID of the virtual interface - // group. - // - // - local-gateway-virtual-interface-id - The ID of the virtual interface. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway virtual interface group. - Filters []types.Filter - - // The IDs of the virtual interface groups. - LocalGatewayVirtualInterfaceGroupIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewayVirtualInterfaceGroupsOutput struct { - - // The virtual interface groups. - LocalGatewayVirtualInterfaceGroups []types.LocalGatewayVirtualInterfaceGroup - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewayVirtualInterfaceGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaceGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaceGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGatewayVirtualInterfaceGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaceGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions is the paginator -// options for DescribeLocalGatewayVirtualInterfaceGroups -type DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewayVirtualInterfaceGroupsPaginator is a paginator for -// DescribeLocalGatewayVirtualInterfaceGroups -type DescribeLocalGatewayVirtualInterfaceGroupsPaginator struct { - options DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions - client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient - params *DescribeLocalGatewayVirtualInterfaceGroupsInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator returns a new -// DescribeLocalGatewayVirtualInterfaceGroupsPaginator -func NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator(client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient, params *DescribeLocalGatewayVirtualInterfaceGroupsInput, optFns ...func(*DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions)) *DescribeLocalGatewayVirtualInterfaceGroupsPaginator { - if params == nil { - params = &DescribeLocalGatewayVirtualInterfaceGroupsInput{} - } - - options := DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewayVirtualInterfaceGroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaceGroups page. -func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGatewayVirtualInterfaceGroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewayVirtualInterfaceGroupsAPIClient is a client that implements -// the DescribeLocalGatewayVirtualInterfaceGroups operation. -type DescribeLocalGatewayVirtualInterfaceGroupsAPIClient interface { - DescribeLocalGatewayVirtualInterfaceGroups(context.Context, *DescribeLocalGatewayVirtualInterfaceGroupsInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) -} - -var _ DescribeLocalGatewayVirtualInterfaceGroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaceGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGatewayVirtualInterfaceGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go deleted file mode 100644 index 324ccdeaf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified local gateway virtual interfaces. -func (c *Client) DescribeLocalGatewayVirtualInterfaces(ctx context.Context, params *DescribeLocalGatewayVirtualInterfacesInput, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { - if params == nil { - params = &DescribeLocalGatewayVirtualInterfacesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGatewayVirtualInterfaces", params, optFns, c.addOperationDescribeLocalGatewayVirtualInterfacesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewayVirtualInterfacesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewayVirtualInterfacesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-address - The local address. - // - // - local-bgp-asn - The Border Gateway Protocol (BGP) Autonomous System Number - // (ASN) of the local gateway. - // - // - local-gateway-id - The ID of the local gateway. - // - // - local-gateway-virtual-interface-id - The ID of the virtual interface. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway virtual interface. - // - // - peer-address - The peer address. - // - // - peer-bgp-asn - The peer BGP ASN. - // - // - vlan - The ID of the VLAN. - Filters []types.Filter - - // The IDs of the virtual interfaces. - LocalGatewayVirtualInterfaceIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewayVirtualInterfacesOutput struct { - - // Information about the virtual interfaces. - LocalGatewayVirtualInterfaces []types.LocalGatewayVirtualInterface - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewayVirtualInterfacesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaces{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaces{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGatewayVirtualInterfaces"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaces(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewayVirtualInterfacesPaginatorOptions is the paginator options -// for DescribeLocalGatewayVirtualInterfaces -type DescribeLocalGatewayVirtualInterfacesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewayVirtualInterfacesPaginator is a paginator for -// DescribeLocalGatewayVirtualInterfaces -type DescribeLocalGatewayVirtualInterfacesPaginator struct { - options DescribeLocalGatewayVirtualInterfacesPaginatorOptions - client DescribeLocalGatewayVirtualInterfacesAPIClient - params *DescribeLocalGatewayVirtualInterfacesInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewayVirtualInterfacesPaginator returns a new -// DescribeLocalGatewayVirtualInterfacesPaginator -func NewDescribeLocalGatewayVirtualInterfacesPaginator(client DescribeLocalGatewayVirtualInterfacesAPIClient, params *DescribeLocalGatewayVirtualInterfacesInput, optFns ...func(*DescribeLocalGatewayVirtualInterfacesPaginatorOptions)) *DescribeLocalGatewayVirtualInterfacesPaginator { - if params == nil { - params = &DescribeLocalGatewayVirtualInterfacesInput{} - } - - options := DescribeLocalGatewayVirtualInterfacesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewayVirtualInterfacesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewayVirtualInterfacesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaces page. -func (p *DescribeLocalGatewayVirtualInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGatewayVirtualInterfaces(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewayVirtualInterfacesAPIClient is a client that implements the -// DescribeLocalGatewayVirtualInterfaces operation. -type DescribeLocalGatewayVirtualInterfacesAPIClient interface { - DescribeLocalGatewayVirtualInterfaces(context.Context, *DescribeLocalGatewayVirtualInterfacesInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) -} - -var _ DescribeLocalGatewayVirtualInterfacesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGatewayVirtualInterfaces", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGateways.go deleted file mode 100644 index 149c9a316..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLocalGateways.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more local gateways. By default, all local gateways are -// described. Alternatively, you can filter the results. -func (c *Client) DescribeLocalGateways(ctx context.Context, params *DescribeLocalGatewaysInput, optFns ...func(*Options)) (*DescribeLocalGatewaysOutput, error) { - if params == nil { - params = &DescribeLocalGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLocalGateways", params, optFns, c.addOperationDescribeLocalGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLocalGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLocalGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - local-gateway-id - The ID of a local gateway. - // - // - outpost-arn - The Amazon Resource Name (ARN) of the Outpost. - // - // - owner-id - The ID of the Amazon Web Services account that owns the local - // gateway. - // - // - state - The state of the association. - Filters []types.Filter - - // The IDs of the local gateways. - LocalGatewayIds []string - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeLocalGatewaysOutput struct { - - // Information about the local gateways. - LocalGateways []types.LocalGateway - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLocalGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLocalGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLocalGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLocalGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLocalGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeLocalGatewaysPaginatorOptions is the paginator options for -// DescribeLocalGateways -type DescribeLocalGatewaysPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeLocalGatewaysPaginator is a paginator for DescribeLocalGateways -type DescribeLocalGatewaysPaginator struct { - options DescribeLocalGatewaysPaginatorOptions - client DescribeLocalGatewaysAPIClient - params *DescribeLocalGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeLocalGatewaysPaginator returns a new DescribeLocalGatewaysPaginator -func NewDescribeLocalGatewaysPaginator(client DescribeLocalGatewaysAPIClient, params *DescribeLocalGatewaysInput, optFns ...func(*DescribeLocalGatewaysPaginatorOptions)) *DescribeLocalGatewaysPaginator { - if params == nil { - params = &DescribeLocalGatewaysInput{} - } - - options := DescribeLocalGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeLocalGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeLocalGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeLocalGateways page. -func (p *DescribeLocalGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeLocalGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeLocalGatewaysAPIClient is a client that implements the -// DescribeLocalGateways operation. -type DescribeLocalGatewaysAPIClient interface { - DescribeLocalGateways(context.Context, *DescribeLocalGatewaysInput, ...func(*Options)) (*DescribeLocalGatewaysOutput, error) -} - -var _ DescribeLocalGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeLocalGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLocalGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLockedSnapshots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLockedSnapshots.go deleted file mode 100644 index 5ad0e5f0e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeLockedSnapshots.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the lock status for a snapshot. -func (c *Client) DescribeLockedSnapshots(ctx context.Context, params *DescribeLockedSnapshotsInput, optFns ...func(*Options)) (*DescribeLockedSnapshotsOutput, error) { - if params == nil { - params = &DescribeLockedSnapshotsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeLockedSnapshots", params, optFns, c.addOperationDescribeLockedSnapshotsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeLockedSnapshotsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeLockedSnapshotsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - lock-state - The state of the snapshot lock ( compliance-cooloff | - // governance | compliance | expired ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the snapshots for which to view the lock status. - SnapshotIds []string - - noSmithyDocumentSerde -} - -type DescribeLockedSnapshotsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the snapshots. - Snapshots []types.LockedSnapshotsInfo - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeLockedSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeLockedSnapshots{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeLockedSnapshots{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLockedSnapshots"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLockedSnapshots(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeLockedSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeLockedSnapshots", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacHosts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacHosts.go deleted file mode 100644 index d5a8111a0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacHosts.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified EC2 Mac Dedicated Host or all of your EC2 Mac Dedicated -// Hosts. -func (c *Client) DescribeMacHosts(ctx context.Context, params *DescribeMacHostsInput, optFns ...func(*Options)) (*DescribeMacHostsOutput, error) { - if params == nil { - params = &DescribeMacHostsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeMacHosts", params, optFns, c.addOperationDescribeMacHostsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeMacHostsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeMacHostsInput struct { - - // The filters. - // - // - availability-zone - The Availability Zone of the EC2 Mac Dedicated Host. - // - // - instance-type - The instance type size that the EC2 Mac Dedicated Host is - // configured to support. - Filters []types.Filter - - // The IDs of the EC2 Mac Dedicated Hosts. - HostIds []string - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeMacHostsOutput struct { - - // Information about the EC2 Mac Dedicated Hosts. - MacHosts []types.MacHost - - // The token to use to retrieve the next page of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeMacHostsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeMacHosts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeMacHosts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMacHosts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMacHosts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeMacHostsPaginatorOptions is the paginator options for DescribeMacHosts -type DescribeMacHostsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeMacHostsPaginator is a paginator for DescribeMacHosts -type DescribeMacHostsPaginator struct { - options DescribeMacHostsPaginatorOptions - client DescribeMacHostsAPIClient - params *DescribeMacHostsInput - nextToken *string - firstPage bool -} - -// NewDescribeMacHostsPaginator returns a new DescribeMacHostsPaginator -func NewDescribeMacHostsPaginator(client DescribeMacHostsAPIClient, params *DescribeMacHostsInput, optFns ...func(*DescribeMacHostsPaginatorOptions)) *DescribeMacHostsPaginator { - if params == nil { - params = &DescribeMacHostsInput{} - } - - options := DescribeMacHostsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeMacHostsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeMacHostsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeMacHosts page. -func (p *DescribeMacHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMacHostsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeMacHosts(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeMacHostsAPIClient is a client that implements the DescribeMacHosts -// operation. -type DescribeMacHostsAPIClient interface { - DescribeMacHosts(context.Context, *DescribeMacHostsInput, ...func(*Options)) (*DescribeMacHostsOutput, error) -} - -var _ DescribeMacHostsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeMacHosts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeMacHosts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacModificationTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacModificationTasks.go deleted file mode 100644 index 7735bdd53..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMacModificationTasks.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a System Integrity Protection (SIP) modification task or volume -// ownership delegation task for an Amazon EC2 Mac instance. For more information, -// see [Configure SIP for Amazon EC2 instances]in the Amazon EC2 User Guide. -// -// [Configure SIP for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mac-sip-settings.html#mac-sip-configure -func (c *Client) DescribeMacModificationTasks(ctx context.Context, params *DescribeMacModificationTasksInput, optFns ...func(*Options)) (*DescribeMacModificationTasksOutput, error) { - if params == nil { - params = &DescribeMacModificationTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeMacModificationTasks", params, optFns, c.addOperationDescribeMacModificationTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeMacModificationTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeMacModificationTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies one or more filters for the request: - // - // - instance-id - The ID of the instance for which the task was created. - // - // - task-state - The state of the task ( successful | failed | in-progress | - // pending ). - // - // - mac-system-integrity-protection-configuration.sip-status - The overall SIP - // state requested in the task ( enabled | disabled ). - // - // - start-time - The date and time the task was created. - // - // - task-type - The type of task ( sip-modification | - // volume-ownership-delegation ). - Filters []types.Filter - - // The ID of task. - MacModificationTaskIds []string - - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeMacModificationTasksOutput struct { - - // Information about the tasks. - MacModificationTasks []types.MacModificationTask - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeMacModificationTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeMacModificationTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeMacModificationTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMacModificationTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMacModificationTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeMacModificationTasksPaginatorOptions is the paginator options for -// DescribeMacModificationTasks -type DescribeMacModificationTasksPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500. If maxResults is given a - // larger value than 500, you receive an error. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeMacModificationTasksPaginator is a paginator for -// DescribeMacModificationTasks -type DescribeMacModificationTasksPaginator struct { - options DescribeMacModificationTasksPaginatorOptions - client DescribeMacModificationTasksAPIClient - params *DescribeMacModificationTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeMacModificationTasksPaginator returns a new -// DescribeMacModificationTasksPaginator -func NewDescribeMacModificationTasksPaginator(client DescribeMacModificationTasksAPIClient, params *DescribeMacModificationTasksInput, optFns ...func(*DescribeMacModificationTasksPaginatorOptions)) *DescribeMacModificationTasksPaginator { - if params == nil { - params = &DescribeMacModificationTasksInput{} - } - - options := DescribeMacModificationTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeMacModificationTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeMacModificationTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeMacModificationTasks page. -func (p *DescribeMacModificationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMacModificationTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeMacModificationTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeMacModificationTasksAPIClient is a client that implements the -// DescribeMacModificationTasks operation. -type DescribeMacModificationTasksAPIClient interface { - DescribeMacModificationTasks(context.Context, *DescribeMacModificationTasksInput, ...func(*Options)) (*DescribeMacModificationTasksOutput, error) -} - -var _ DescribeMacModificationTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeMacModificationTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeMacModificationTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeManagedPrefixLists.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeManagedPrefixLists.go deleted file mode 100644 index ae7d45ca5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeManagedPrefixLists.go +++ /dev/null @@ -1,281 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your managed prefix lists and any Amazon Web Services-managed prefix -// lists. -// -// To view the entries for your prefix list, use GetManagedPrefixListEntries. -func (c *Client) DescribeManagedPrefixLists(ctx context.Context, params *DescribeManagedPrefixListsInput, optFns ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) { - if params == nil { - params = &DescribeManagedPrefixListsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeManagedPrefixLists", params, optFns, c.addOperationDescribeManagedPrefixListsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeManagedPrefixListsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeManagedPrefixListsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - owner-id - The ID of the prefix list owner. - // - // - prefix-list-id - The ID of the prefix list. - // - // - prefix-list-name - The name of the prefix list. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // One or more prefix list IDs. - PrefixListIds []string - - noSmithyDocumentSerde -} - -type DescribeManagedPrefixListsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the prefix lists. - PrefixLists []types.ManagedPrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeManagedPrefixListsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeManagedPrefixLists{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeManagedPrefixLists{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeManagedPrefixLists"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeManagedPrefixLists(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeManagedPrefixListsPaginatorOptions is the paginator options for -// DescribeManagedPrefixLists -type DescribeManagedPrefixListsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeManagedPrefixListsPaginator is a paginator for -// DescribeManagedPrefixLists -type DescribeManagedPrefixListsPaginator struct { - options DescribeManagedPrefixListsPaginatorOptions - client DescribeManagedPrefixListsAPIClient - params *DescribeManagedPrefixListsInput - nextToken *string - firstPage bool -} - -// NewDescribeManagedPrefixListsPaginator returns a new -// DescribeManagedPrefixListsPaginator -func NewDescribeManagedPrefixListsPaginator(client DescribeManagedPrefixListsAPIClient, params *DescribeManagedPrefixListsInput, optFns ...func(*DescribeManagedPrefixListsPaginatorOptions)) *DescribeManagedPrefixListsPaginator { - if params == nil { - params = &DescribeManagedPrefixListsInput{} - } - - options := DescribeManagedPrefixListsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeManagedPrefixListsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeManagedPrefixListsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeManagedPrefixLists page. -func (p *DescribeManagedPrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeManagedPrefixLists(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeManagedPrefixListsAPIClient is a client that implements the -// DescribeManagedPrefixLists operation. -type DescribeManagedPrefixListsAPIClient interface { - DescribeManagedPrefixLists(context.Context, *DescribeManagedPrefixListsInput, ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) -} - -var _ DescribeManagedPrefixListsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeManagedPrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeManagedPrefixLists", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMovingAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMovingAddresses.go deleted file mode 100644 index 32c78c828..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeMovingAddresses.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Describes your Elastic IP addresses that are being moved from or being restored -// to the EC2-Classic platform. This request does not return information about any -// other Elastic IP addresses in your account. -func (c *Client) DescribeMovingAddresses(ctx context.Context, params *DescribeMovingAddressesInput, optFns ...func(*Options)) (*DescribeMovingAddressesOutput, error) { - if params == nil { - params = &DescribeMovingAddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeMovingAddresses", params, optFns, c.addOperationDescribeMovingAddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeMovingAddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeMovingAddressesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - moving-status - The status of the Elastic IP address ( MovingToVpc | - // RestoringToClassic ). - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1000; if - // MaxResults is given a value outside of this range, an error is returned. - // - // Default: If no value is provided, the default is 1000. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // One or more Elastic IP addresses. - PublicIps []string - - noSmithyDocumentSerde -} - -type DescribeMovingAddressesOutput struct { - - // The status for each Elastic IP address. - MovingAddressStatuses []types.MovingAddressStatus - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeMovingAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeMovingAddresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeMovingAddresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMovingAddresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMovingAddresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeMovingAddressesPaginatorOptions is the paginator options for -// DescribeMovingAddresses -type DescribeMovingAddressesPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1000; if - // MaxResults is given a value outside of this range, an error is returned. - // - // Default: If no value is provided, the default is 1000. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeMovingAddressesPaginator is a paginator for DescribeMovingAddresses -type DescribeMovingAddressesPaginator struct { - options DescribeMovingAddressesPaginatorOptions - client DescribeMovingAddressesAPIClient - params *DescribeMovingAddressesInput - nextToken *string - firstPage bool -} - -// NewDescribeMovingAddressesPaginator returns a new -// DescribeMovingAddressesPaginator -func NewDescribeMovingAddressesPaginator(client DescribeMovingAddressesAPIClient, params *DescribeMovingAddressesInput, optFns ...func(*DescribeMovingAddressesPaginatorOptions)) *DescribeMovingAddressesPaginator { - if params == nil { - params = &DescribeMovingAddressesInput{} - } - - options := DescribeMovingAddressesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeMovingAddressesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeMovingAddressesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeMovingAddresses page. -func (p *DescribeMovingAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMovingAddressesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeMovingAddresses(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeMovingAddressesAPIClient is a client that implements the -// DescribeMovingAddresses operation. -type DescribeMovingAddressesAPIClient interface { - DescribeMovingAddresses(context.Context, *DescribeMovingAddressesInput, ...func(*Options)) (*DescribeMovingAddressesOutput, error) -} - -var _ DescribeMovingAddressesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeMovingAddresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeMovingAddresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNatGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNatGateways.go deleted file mode 100644 index 1a7ff3e95..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNatGateways.go +++ /dev/null @@ -1,762 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes your NAT gateways. The default is to describe all your NAT gateways. -// Alternatively, you can specify specific NAT gateway IDs or filter the results to -// include only the NAT gateways that match specific criteria. -func (c *Client) DescribeNatGateways(ctx context.Context, params *DescribeNatGatewaysInput, optFns ...func(*Options)) (*DescribeNatGatewaysOutput, error) { - if params == nil { - params = &DescribeNatGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNatGateways", params, optFns, c.addOperationDescribeNatGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNatGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNatGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - nat-gateway-id - The ID of the NAT gateway. - // - // - state - The state of the NAT gateway ( pending | failed | available | - // deleting | deleted ). - // - // - subnet-id - The ID of the subnet in which the NAT gateway resides. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC in which the NAT gateway resides. - Filter []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The IDs of the NAT gateways. - NatGatewayIds []string - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNatGatewaysOutput struct { - - // Information about the NAT gateways. - NatGateways []types.NatGateway - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNatGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNatGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNatGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNatGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNatGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// NatGatewayAvailableWaiterOptions are waiter options for -// NatGatewayAvailableWaiter -type NatGatewayAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // NatGatewayAvailableWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, NatGatewayAvailableWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeNatGatewaysInput, *DescribeNatGatewaysOutput, error) (bool, error) -} - -// NatGatewayAvailableWaiter defines the waiters for NatGatewayAvailable -type NatGatewayAvailableWaiter struct { - client DescribeNatGatewaysAPIClient - - options NatGatewayAvailableWaiterOptions -} - -// NewNatGatewayAvailableWaiter constructs a NatGatewayAvailableWaiter. -func NewNatGatewayAvailableWaiter(client DescribeNatGatewaysAPIClient, optFns ...func(*NatGatewayAvailableWaiterOptions)) *NatGatewayAvailableWaiter { - options := NatGatewayAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = natGatewayAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &NatGatewayAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for NatGatewayAvailable waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *NatGatewayAvailableWaiter) Wait(ctx context.Context, params *DescribeNatGatewaysInput, maxWaitDur time.Duration, optFns ...func(*NatGatewayAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for NatGatewayAvailable waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *NatGatewayAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeNatGatewaysInput, maxWaitDur time.Duration, optFns ...func(*NatGatewayAvailableWaiterOptions)) (*DescribeNatGatewaysOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeNatGateways(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for NatGatewayAvailable waiter") -} - -func natGatewayAvailableStateRetryable(ctx context.Context, input *DescribeNatGatewaysInput, output *DescribeNatGatewaysOutput, err error) (bool, error) { - - if err == nil { - v1 := output.NatGateways - var v2 []types.NatGatewayState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.NatGateways - var v2 []types.NatGatewayState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.NatGateways - var v2 []types.NatGatewayState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleting" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.NatGateways - var v2 []types.NatGatewayState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "NatGatewayNotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// NatGatewayDeletedWaiterOptions are waiter options for NatGatewayDeletedWaiter -type NatGatewayDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // NatGatewayDeletedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, NatGatewayDeletedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeNatGatewaysInput, *DescribeNatGatewaysOutput, error) (bool, error) -} - -// NatGatewayDeletedWaiter defines the waiters for NatGatewayDeleted -type NatGatewayDeletedWaiter struct { - client DescribeNatGatewaysAPIClient - - options NatGatewayDeletedWaiterOptions -} - -// NewNatGatewayDeletedWaiter constructs a NatGatewayDeletedWaiter. -func NewNatGatewayDeletedWaiter(client DescribeNatGatewaysAPIClient, optFns ...func(*NatGatewayDeletedWaiterOptions)) *NatGatewayDeletedWaiter { - options := NatGatewayDeletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = natGatewayDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &NatGatewayDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for NatGatewayDeleted waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *NatGatewayDeletedWaiter) Wait(ctx context.Context, params *DescribeNatGatewaysInput, maxWaitDur time.Duration, optFns ...func(*NatGatewayDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for NatGatewayDeleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *NatGatewayDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeNatGatewaysInput, maxWaitDur time.Duration, optFns ...func(*NatGatewayDeletedWaiterOptions)) (*DescribeNatGatewaysOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeNatGateways(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for NatGatewayDeleted waiter") -} - -func natGatewayDeletedStateRetryable(ctx context.Context, input *DescribeNatGatewaysInput, output *DescribeNatGatewaysOutput, err error) (bool, error) { - - if err == nil { - v1 := output.NatGateways - var v2 []types.NatGatewayState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "NatGatewayNotFound" == apiErr.ErrorCode() { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeNatGatewaysPaginatorOptions is the paginator options for -// DescribeNatGateways -type DescribeNatGatewaysPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNatGatewaysPaginator is a paginator for DescribeNatGateways -type DescribeNatGatewaysPaginator struct { - options DescribeNatGatewaysPaginatorOptions - client DescribeNatGatewaysAPIClient - params *DescribeNatGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeNatGatewaysPaginator returns a new DescribeNatGatewaysPaginator -func NewDescribeNatGatewaysPaginator(client DescribeNatGatewaysAPIClient, params *DescribeNatGatewaysInput, optFns ...func(*DescribeNatGatewaysPaginatorOptions)) *DescribeNatGatewaysPaginator { - if params == nil { - params = &DescribeNatGatewaysInput{} - } - - options := DescribeNatGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNatGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNatGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNatGateways page. -func (p *DescribeNatGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNatGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNatGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNatGatewaysAPIClient is a client that implements the -// DescribeNatGateways operation. -type DescribeNatGatewaysAPIClient interface { - DescribeNatGateways(context.Context, *DescribeNatGatewaysInput, ...func(*Options)) (*DescribeNatGatewaysOutput, error) -} - -var _ DescribeNatGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNatGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNatGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkAcls.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkAcls.go deleted file mode 100644 index 20d11aa0c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkAcls.go +++ /dev/null @@ -1,330 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your network ACLs. The default is to describe all your network ACLs. -// Alternatively, you can specify specific network ACL IDs or filter the results to -// include only the network ACLs that match specific criteria. -// -// For more information, see [Network ACLs] in the Amazon VPC User Guide. -// -// [Network ACLs]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html -func (c *Client) DescribeNetworkAcls(ctx context.Context, params *DescribeNetworkAclsInput, optFns ...func(*Options)) (*DescribeNetworkAclsOutput, error) { - if params == nil { - params = &DescribeNetworkAclsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkAcls", params, optFns, c.addOperationDescribeNetworkAclsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkAclsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNetworkAclsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - association.association-id - The ID of an association ID for the ACL. - // - // - association.network-acl-id - The ID of the network ACL involved in the - // association. - // - // - association.subnet-id - The ID of the subnet involved in the association. - // - // - default - Indicates whether the ACL is the default network ACL for the VPC. - // - // - entry.cidr - The IPv4 CIDR range specified in the entry. - // - // - entry.icmp.code - The ICMP code specified in the entry, if any. - // - // - entry.icmp.type - The ICMP type specified in the entry, if any. - // - // - entry.ipv6-cidr - The IPv6 CIDR range specified in the entry. - // - // - entry.port-range.from - The start of the port range specified in the entry. - // - // - entry.port-range.to - The end of the port range specified in the entry. - // - // - entry.protocol - The protocol specified in the entry ( tcp | udp | icmp or a - // protocol number). - // - // - entry.rule-action - Allows or denies the matching traffic ( allow | deny ). - // - // - entry.egress - A Boolean that indicates the type of rule. Specify true for - // egress rules, or false for ingress rules. - // - // - entry.rule-number - The number of an entry (in other words, rule) in the set - // of ACL entries. - // - // - network-acl-id - The ID of the network ACL. - // - // - owner-id - The ID of the Amazon Web Services account that owns the network - // ACL. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC for the network ACL. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The IDs of the network ACLs. - NetworkAclIds []string - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkAclsOutput struct { - - // Information about the network ACLs. - NetworkAcls []types.NetworkAcl - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkAclsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkAcls{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkAcls{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkAcls"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkAcls(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkAclsPaginatorOptions is the paginator options for -// DescribeNetworkAcls -type DescribeNetworkAclsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkAclsPaginator is a paginator for DescribeNetworkAcls -type DescribeNetworkAclsPaginator struct { - options DescribeNetworkAclsPaginatorOptions - client DescribeNetworkAclsAPIClient - params *DescribeNetworkAclsInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkAclsPaginator returns a new DescribeNetworkAclsPaginator -func NewDescribeNetworkAclsPaginator(client DescribeNetworkAclsAPIClient, params *DescribeNetworkAclsInput, optFns ...func(*DescribeNetworkAclsPaginatorOptions)) *DescribeNetworkAclsPaginator { - if params == nil { - params = &DescribeNetworkAclsInput{} - } - - options := DescribeNetworkAclsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkAclsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkAclsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkAcls page. -func (p *DescribeNetworkAclsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkAclsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkAcls(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkAclsAPIClient is a client that implements the -// DescribeNetworkAcls operation. -type DescribeNetworkAclsAPIClient interface { - DescribeNetworkAcls(context.Context, *DescribeNetworkAclsInput, ...func(*Options)) (*DescribeNetworkAclsOutput, error) -} - -var _ DescribeNetworkAclsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkAcls(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkAcls", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopeAnalyses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopeAnalyses.go deleted file mode 100644 index 65390b5ce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopeAnalyses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes the specified Network Access Scope analyses. -func (c *Client) DescribeNetworkInsightsAccessScopeAnalyses(ctx context.Context, params *DescribeNetworkInsightsAccessScopeAnalysesInput, optFns ...func(*Options)) (*DescribeNetworkInsightsAccessScopeAnalysesOutput, error) { - if params == nil { - params = &DescribeNetworkInsightsAccessScopeAnalysesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInsightsAccessScopeAnalyses", params, optFns, c.addOperationDescribeNetworkInsightsAccessScopeAnalysesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInsightsAccessScopeAnalysesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNetworkInsightsAccessScopeAnalysesInput struct { - - // Filters the results based on the start time. The analysis must have started on - // or after this time. - AnalysisStartTimeBegin *time.Time - - // Filters the results based on the start time. The analysis must have started on - // or before this time. - AnalysisStartTimeEnd *time.Time - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // There are no supported filters. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The IDs of the Network Access Scope analyses. - NetworkInsightsAccessScopeAnalysisIds []string - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkInsightsAccessScopeAnalysesOutput struct { - - // The Network Access Scope analyses. - NetworkInsightsAccessScopeAnalyses []types.NetworkInsightsAccessScopeAnalysis - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInsightsAccessScopeAnalysesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInsightsAccessScopeAnalyses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopeAnalyses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInsightsAccessScopeAnalyses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInsightsAccessScopeAnalyses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkInsightsAccessScopeAnalysesPaginatorOptions is the paginator -// options for DescribeNetworkInsightsAccessScopeAnalyses -type DescribeNetworkInsightsAccessScopeAnalysesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInsightsAccessScopeAnalysesPaginator is a paginator for -// DescribeNetworkInsightsAccessScopeAnalyses -type DescribeNetworkInsightsAccessScopeAnalysesPaginator struct { - options DescribeNetworkInsightsAccessScopeAnalysesPaginatorOptions - client DescribeNetworkInsightsAccessScopeAnalysesAPIClient - params *DescribeNetworkInsightsAccessScopeAnalysesInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInsightsAccessScopeAnalysesPaginator returns a new -// DescribeNetworkInsightsAccessScopeAnalysesPaginator -func NewDescribeNetworkInsightsAccessScopeAnalysesPaginator(client DescribeNetworkInsightsAccessScopeAnalysesAPIClient, params *DescribeNetworkInsightsAccessScopeAnalysesInput, optFns ...func(*DescribeNetworkInsightsAccessScopeAnalysesPaginatorOptions)) *DescribeNetworkInsightsAccessScopeAnalysesPaginator { - if params == nil { - params = &DescribeNetworkInsightsAccessScopeAnalysesInput{} - } - - options := DescribeNetworkInsightsAccessScopeAnalysesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInsightsAccessScopeAnalysesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInsightsAccessScopeAnalysesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInsightsAccessScopeAnalyses page. -func (p *DescribeNetworkInsightsAccessScopeAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInsightsAccessScopeAnalysesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInsightsAccessScopeAnalyses(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInsightsAccessScopeAnalysesAPIClient is a client that implements -// the DescribeNetworkInsightsAccessScopeAnalyses operation. -type DescribeNetworkInsightsAccessScopeAnalysesAPIClient interface { - DescribeNetworkInsightsAccessScopeAnalyses(context.Context, *DescribeNetworkInsightsAccessScopeAnalysesInput, ...func(*Options)) (*DescribeNetworkInsightsAccessScopeAnalysesOutput, error) -} - -var _ DescribeNetworkInsightsAccessScopeAnalysesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInsightsAccessScopeAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInsightsAccessScopeAnalyses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopes.go deleted file mode 100644 index f18f0f544..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAccessScopes.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Network Access Scopes. -func (c *Client) DescribeNetworkInsightsAccessScopes(ctx context.Context, params *DescribeNetworkInsightsAccessScopesInput, optFns ...func(*Options)) (*DescribeNetworkInsightsAccessScopesOutput, error) { - if params == nil { - params = &DescribeNetworkInsightsAccessScopesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInsightsAccessScopes", params, optFns, c.addOperationDescribeNetworkInsightsAccessScopesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInsightsAccessScopesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNetworkInsightsAccessScopesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // There are no supported filters. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The IDs of the Network Access Scopes. - NetworkInsightsAccessScopeIds []string - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkInsightsAccessScopesOutput struct { - - // The Network Access Scopes. - NetworkInsightsAccessScopes []types.NetworkInsightsAccessScope - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInsightsAccessScopesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInsightsAccessScopes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInsightsAccessScopes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInsightsAccessScopes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkInsightsAccessScopesPaginatorOptions is the paginator options -// for DescribeNetworkInsightsAccessScopes -type DescribeNetworkInsightsAccessScopesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInsightsAccessScopesPaginator is a paginator for -// DescribeNetworkInsightsAccessScopes -type DescribeNetworkInsightsAccessScopesPaginator struct { - options DescribeNetworkInsightsAccessScopesPaginatorOptions - client DescribeNetworkInsightsAccessScopesAPIClient - params *DescribeNetworkInsightsAccessScopesInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInsightsAccessScopesPaginator returns a new -// DescribeNetworkInsightsAccessScopesPaginator -func NewDescribeNetworkInsightsAccessScopesPaginator(client DescribeNetworkInsightsAccessScopesAPIClient, params *DescribeNetworkInsightsAccessScopesInput, optFns ...func(*DescribeNetworkInsightsAccessScopesPaginatorOptions)) *DescribeNetworkInsightsAccessScopesPaginator { - if params == nil { - params = &DescribeNetworkInsightsAccessScopesInput{} - } - - options := DescribeNetworkInsightsAccessScopesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInsightsAccessScopesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInsightsAccessScopesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInsightsAccessScopes page. -func (p *DescribeNetworkInsightsAccessScopesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInsightsAccessScopesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInsightsAccessScopes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInsightsAccessScopesAPIClient is a client that implements the -// DescribeNetworkInsightsAccessScopes operation. -type DescribeNetworkInsightsAccessScopesAPIClient interface { - DescribeNetworkInsightsAccessScopes(context.Context, *DescribeNetworkInsightsAccessScopesInput, ...func(*Options)) (*DescribeNetworkInsightsAccessScopesOutput, error) -} - -var _ DescribeNetworkInsightsAccessScopesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInsightsAccessScopes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInsightsAccessScopes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAnalyses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAnalyses.go deleted file mode 100644 index a53cffe6c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsAnalyses.go +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes one or more of your network insights analyses. -func (c *Client) DescribeNetworkInsightsAnalyses(ctx context.Context, params *DescribeNetworkInsightsAnalysesInput, optFns ...func(*Options)) (*DescribeNetworkInsightsAnalysesOutput, error) { - if params == nil { - params = &DescribeNetworkInsightsAnalysesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInsightsAnalyses", params, optFns, c.addOperationDescribeNetworkInsightsAnalysesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInsightsAnalysesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNetworkInsightsAnalysesInput struct { - - // The time when the network insights analyses ended. - AnalysisEndTime *time.Time - - // The time when the network insights analyses started. - AnalysisStartTime *time.Time - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. The following are the possible values: - // - // - path-found - A Boolean value that indicates whether a feasible path is - // found. - // - // - status - The status of the analysis (running | succeeded | failed). - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The ID of the network insights analyses. You must specify either analysis IDs - // or a path ID. - NetworkInsightsAnalysisIds []string - - // The ID of the path. You must specify either a path ID or analysis IDs. - NetworkInsightsPathId *string - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkInsightsAnalysesOutput struct { - - // Information about the network insights analyses. - NetworkInsightsAnalyses []types.NetworkInsightsAnalysis - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInsightsAnalysesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInsightsAnalyses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInsightsAnalyses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInsightsAnalyses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInsightsAnalyses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkInsightsAnalysesPaginatorOptions is the paginator options for -// DescribeNetworkInsightsAnalyses -type DescribeNetworkInsightsAnalysesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInsightsAnalysesPaginator is a paginator for -// DescribeNetworkInsightsAnalyses -type DescribeNetworkInsightsAnalysesPaginator struct { - options DescribeNetworkInsightsAnalysesPaginatorOptions - client DescribeNetworkInsightsAnalysesAPIClient - params *DescribeNetworkInsightsAnalysesInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInsightsAnalysesPaginator returns a new -// DescribeNetworkInsightsAnalysesPaginator -func NewDescribeNetworkInsightsAnalysesPaginator(client DescribeNetworkInsightsAnalysesAPIClient, params *DescribeNetworkInsightsAnalysesInput, optFns ...func(*DescribeNetworkInsightsAnalysesPaginatorOptions)) *DescribeNetworkInsightsAnalysesPaginator { - if params == nil { - params = &DescribeNetworkInsightsAnalysesInput{} - } - - options := DescribeNetworkInsightsAnalysesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInsightsAnalysesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInsightsAnalysesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInsightsAnalyses page. -func (p *DescribeNetworkInsightsAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInsightsAnalysesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInsightsAnalyses(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInsightsAnalysesAPIClient is a client that implements the -// DescribeNetworkInsightsAnalyses operation. -type DescribeNetworkInsightsAnalysesAPIClient interface { - DescribeNetworkInsightsAnalyses(context.Context, *DescribeNetworkInsightsAnalysesInput, ...func(*Options)) (*DescribeNetworkInsightsAnalysesOutput, error) -} - -var _ DescribeNetworkInsightsAnalysesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInsightsAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInsightsAnalyses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsPaths.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsPaths.go deleted file mode 100644 index b0094826b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInsightsPaths.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of your paths. -func (c *Client) DescribeNetworkInsightsPaths(ctx context.Context, params *DescribeNetworkInsightsPathsInput, optFns ...func(*Options)) (*DescribeNetworkInsightsPathsOutput, error) { - if params == nil { - params = &DescribeNetworkInsightsPathsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInsightsPaths", params, optFns, c.addOperationDescribeNetworkInsightsPathsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInsightsPathsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNetworkInsightsPathsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. The following are the possible values: - // - // - destination - The ID of the resource. - // - // - filter-at-source.source-address - The source IPv4 address at the source. - // - // - filter-at-source.source-port-range - The source port range at the source. - // - // - filter-at-source.destination-address - The destination IPv4 address at the - // source. - // - // - filter-at-source.destination-port-range - The destination port range at the - // source. - // - // - filter-at-destination.source-address - The source IPv4 address at the - // destination. - // - // - filter-at-destination.source-port-range - The source port range at the - // destination. - // - // - filter-at-destination.destination-address - The destination IPv4 address at - // the destination. - // - // - filter-at-destination.destination-port-range - The destination port range - // at the destination. - // - // - protocol - The protocol. - // - // - source - The ID of the resource. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The IDs of the paths. - NetworkInsightsPathIds []string - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkInsightsPathsOutput struct { - - // Information about the paths. - NetworkInsightsPaths []types.NetworkInsightsPath - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInsightsPathsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInsightsPaths{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInsightsPaths{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInsightsPaths"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInsightsPaths(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkInsightsPathsPaginatorOptions is the paginator options for -// DescribeNetworkInsightsPaths -type DescribeNetworkInsightsPathsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInsightsPathsPaginator is a paginator for -// DescribeNetworkInsightsPaths -type DescribeNetworkInsightsPathsPaginator struct { - options DescribeNetworkInsightsPathsPaginatorOptions - client DescribeNetworkInsightsPathsAPIClient - params *DescribeNetworkInsightsPathsInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInsightsPathsPaginator returns a new -// DescribeNetworkInsightsPathsPaginator -func NewDescribeNetworkInsightsPathsPaginator(client DescribeNetworkInsightsPathsAPIClient, params *DescribeNetworkInsightsPathsInput, optFns ...func(*DescribeNetworkInsightsPathsPaginatorOptions)) *DescribeNetworkInsightsPathsPaginator { - if params == nil { - params = &DescribeNetworkInsightsPathsInput{} - } - - options := DescribeNetworkInsightsPathsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInsightsPathsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInsightsPathsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInsightsPaths page. -func (p *DescribeNetworkInsightsPathsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInsightsPathsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInsightsPaths(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInsightsPathsAPIClient is a client that implements the -// DescribeNetworkInsightsPaths operation. -type DescribeNetworkInsightsPathsAPIClient interface { - DescribeNetworkInsightsPaths(context.Context, *DescribeNetworkInsightsPathsInput, ...func(*Options)) (*DescribeNetworkInsightsPathsOutput, error) -} - -var _ DescribeNetworkInsightsPathsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInsightsPaths(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInsightsPaths", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaceAttribute.go deleted file mode 100644 index 2d4709a52..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaceAttribute.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a network interface attribute. You can specify only one attribute at -// a time. -func (c *Client) DescribeNetworkInterfaceAttribute(ctx context.Context, params *DescribeNetworkInterfaceAttributeInput, optFns ...func(*Options)) (*DescribeNetworkInterfaceAttributeOutput, error) { - if params == nil { - params = &DescribeNetworkInterfaceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInterfaceAttribute", params, optFns, c.addOperationDescribeNetworkInterfaceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInterfaceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeNetworkInterfaceAttribute. -type DescribeNetworkInterfaceAttributeInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The attribute of the network interface. This parameter is required. - Attribute types.NetworkInterfaceAttribute - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of DescribeNetworkInterfaceAttribute. -type DescribeNetworkInterfaceAttributeOutput struct { - - // Indicates whether to assign a public IPv4 address to a network interface. This - // option can be enabled for any network interface but will only apply to the - // primary network interface (eth0). - AssociatePublicIpAddress *bool - - // The attachment (if any) of the network interface. - Attachment *types.NetworkInterfaceAttachment - - // The description of the network interface. - Description *types.AttributeValue - - // The security groups associated with the network interface. - Groups []types.GroupIdentifier - - // The ID of the network interface. - NetworkInterfaceId *string - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *types.AttributeBooleanValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInterfaceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInterfaceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeNetworkInterfaceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInterfaceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeNetworkInterfaceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInterfaceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfacePermissions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfacePermissions.go deleted file mode 100644 index c9d088e27..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfacePermissions.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the permissions for your network interfaces. -func (c *Client) DescribeNetworkInterfacePermissions(ctx context.Context, params *DescribeNetworkInterfacePermissionsInput, optFns ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) { - if params == nil { - params = &DescribeNetworkInterfacePermissionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInterfacePermissions", params, optFns, c.addOperationDescribeNetworkInterfacePermissionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInterfacePermissionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeNetworkInterfacePermissions. -type DescribeNetworkInterfacePermissionsInput struct { - - // One or more filters. - // - // - network-interface-permission.network-interface-permission-id - The ID of the - // permission. - // - // - network-interface-permission.network-interface-id - The ID of the network - // interface. - // - // - network-interface-permission.aws-account-id - The Amazon Web Services - // account ID. - // - // - network-interface-permission.aws-service - The Amazon Web Services service. - // - // - network-interface-permission.permission - The type of permission ( - // INSTANCE-ATTACH | EIP-ASSOCIATE ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. If this - // parameter is not specified, up to 50 results are returned by default. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The network interface permission IDs. - NetworkInterfacePermissionIds []string - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -// Contains the output for DescribeNetworkInterfacePermissions. -type DescribeNetworkInterfacePermissionsOutput struct { - - // The network interface permissions. - NetworkInterfacePermissions []types.NetworkInterfacePermission - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInterfacePermissionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInterfacePermissions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInterfacePermissions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInterfacePermissions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInterfacePermissions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeNetworkInterfacePermissionsPaginatorOptions is the paginator options -// for DescribeNetworkInterfacePermissions -type DescribeNetworkInterfacePermissionsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. If this - // parameter is not specified, up to 50 results are returned by default. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInterfacePermissionsPaginator is a paginator for -// DescribeNetworkInterfacePermissions -type DescribeNetworkInterfacePermissionsPaginator struct { - options DescribeNetworkInterfacePermissionsPaginatorOptions - client DescribeNetworkInterfacePermissionsAPIClient - params *DescribeNetworkInterfacePermissionsInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInterfacePermissionsPaginator returns a new -// DescribeNetworkInterfacePermissionsPaginator -func NewDescribeNetworkInterfacePermissionsPaginator(client DescribeNetworkInterfacePermissionsAPIClient, params *DescribeNetworkInterfacePermissionsInput, optFns ...func(*DescribeNetworkInterfacePermissionsPaginatorOptions)) *DescribeNetworkInterfacePermissionsPaginator { - if params == nil { - params = &DescribeNetworkInterfacePermissionsInput{} - } - - options := DescribeNetworkInterfacePermissionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInterfacePermissionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInterfacePermissionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInterfacePermissions page. -func (p *DescribeNetworkInterfacePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInterfacePermissions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInterfacePermissionsAPIClient is a client that implements the -// DescribeNetworkInterfacePermissions operation. -type DescribeNetworkInterfacePermissionsAPIClient interface { - DescribeNetworkInterfacePermissions(context.Context, *DescribeNetworkInterfacePermissionsInput, ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) -} - -var _ DescribeNetworkInterfacePermissionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInterfacePermissions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInterfacePermissions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaces.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaces.go deleted file mode 100644 index 4ef897907..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeNetworkInterfaces.go +++ /dev/null @@ -1,604 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified network interfaces or all your network interfaces. -// -// If you have a large number of network interfaces, the operation fails unless -// you use pagination or one of the following filters: group-id , mac-address , -// private-dns-name , private-ip-address , subnet-id , or vpc-id . -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -func (c *Client) DescribeNetworkInterfaces(ctx context.Context, params *DescribeNetworkInterfacesInput, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) { - if params == nil { - params = &DescribeNetworkInterfacesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInterfaces", params, optFns, c.addOperationDescribeNetworkInterfacesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNetworkInterfacesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeNetworkInterfaces. -type DescribeNetworkInterfacesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - association.allocation-id - The allocation ID returned when you allocated - // the Elastic IP address (IPv4) for your network interface. - // - // - association.association-id - The association ID returned when the network - // interface was associated with an IPv4 address. - // - // - addresses.association.owner-id - The owner ID of the addresses associated - // with the network interface. - // - // - addresses.association.public-ip - The association ID returned when the - // network interface was associated with the Elastic IP address (IPv4). - // - // - addresses.primary - Whether the private IPv4 address is the primary IP - // address associated with the network interface. - // - // - addresses.private-ip-address - The private IPv4 addresses associated with - // the network interface. - // - // - association.ip-owner-id - The owner of the Elastic IP address (IPv4) - // associated with the network interface. - // - // - association.public-ip - The address of the Elastic IP address (IPv4) bound - // to the network interface. - // - // - association.public-dns-name - The public DNS name for the network interface - // (IPv4). - // - // - attachment.attach-time - The time that the network interface was attached to - // an instance. - // - // - attachment.attachment-id - The ID of the interface attachment. - // - // - attachment.delete-on-termination - Indicates whether the attachment is - // deleted when an instance is terminated. - // - // - attachment.device-index - The device index to which the network interface is - // attached. - // - // - attachment.instance-id - The ID of the instance to which the network - // interface is attached. - // - // - attachment.instance-owner-id - The owner ID of the instance to which the - // network interface is attached. - // - // - attachment.status - The status of the attachment ( attaching | attached | - // detaching | detached ). - // - // - availability-zone - The Availability Zone of the network interface. - // - // - description - The description of the network interface. - // - // - group-id - The ID of a security group associated with the network interface. - // - // - ipv6-addresses.ipv6-address - An IPv6 address associated with the network - // interface. - // - // - interface-type - The type of network interface ( api_gateway_managed | - // aws_codestar_connections_managed | branch | ec2_instance_connect_endpoint | - // efa | efa-only | efs | evs | gateway_load_balancer | - // gateway_load_balancer_endpoint | global_accelerator_managed | interface | - // iot_rules_managed | lambda | load_balancer | nat_gateway | - // network_load_balancer | quicksight | transit_gateway | trunk | vpc_endpoint ). - // - // - mac-address - The MAC address of the network interface. - // - // - network-interface-id - The ID of the network interface. - // - // - operator.managed - A Boolean that indicates whether this is a managed - // network interface. - // - // - operator.principal - The principal that manages the network interface. Only - // valid for managed network interfaces, where managed is true . - // - // - owner-id - The Amazon Web Services account ID of the network interface owner. - // - // - private-dns-name - The private DNS name of the network interface (IPv4). - // - // - private-ip-address - The private IPv4 address or addresses of the network - // interface. - // - // - requester-id - The alias or Amazon Web Services account ID of the principal - // or service that created the network interface. - // - // - requester-managed - Indicates whether the network interface is being managed - // by an Amazon Web Services service (for example, Amazon Web Services Management - // Console, Auto Scaling, and so on). - // - // - source-dest-check - Indicates whether the network interface performs - // source/destination checking. A value of true means checking is enabled, and - // false means checking is disabled. The value must be false for the network - // interface to perform network address translation (NAT) in your VPC. - // - // - status - The status of the network interface. If the network interface is - // not attached to an instance, the status is available ; if a network interface - // is attached to an instance the status is in-use . - // - // - subnet-id - The ID of the subnet for the network interface. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC for the network interface. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. You cannot - // specify this parameter and the network interface IDs parameter in the same - // request. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The network interface IDs. - // - // Default: Describes all your network interfaces. - NetworkInterfaceIds []string - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeNetworkInterfacesOutput struct { - - // Information about the network interfaces. - NetworkInterfaces []types.NetworkInterface - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNetworkInterfacesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeNetworkInterfaces{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeNetworkInterfaces{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNetworkInterfaces"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNetworkInterfaces(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// NetworkInterfaceAvailableWaiterOptions are waiter options for -// NetworkInterfaceAvailableWaiter -type NetworkInterfaceAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // NetworkInterfaceAvailableWaiter will use default minimum delay of 20 seconds. - // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, NetworkInterfaceAvailableWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeNetworkInterfacesInput, *DescribeNetworkInterfacesOutput, error) (bool, error) -} - -// NetworkInterfaceAvailableWaiter defines the waiters for -// NetworkInterfaceAvailable -type NetworkInterfaceAvailableWaiter struct { - client DescribeNetworkInterfacesAPIClient - - options NetworkInterfaceAvailableWaiterOptions -} - -// NewNetworkInterfaceAvailableWaiter constructs a NetworkInterfaceAvailableWaiter. -func NewNetworkInterfaceAvailableWaiter(client DescribeNetworkInterfacesAPIClient, optFns ...func(*NetworkInterfaceAvailableWaiterOptions)) *NetworkInterfaceAvailableWaiter { - options := NetworkInterfaceAvailableWaiterOptions{} - options.MinDelay = 20 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = networkInterfaceAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &NetworkInterfaceAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for NetworkInterfaceAvailable waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *NetworkInterfaceAvailableWaiter) Wait(ctx context.Context, params *DescribeNetworkInterfacesInput, maxWaitDur time.Duration, optFns ...func(*NetworkInterfaceAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for NetworkInterfaceAvailable waiter -// and returns the output of the successful operation. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *NetworkInterfaceAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeNetworkInterfacesInput, maxWaitDur time.Duration, optFns ...func(*NetworkInterfaceAvailableWaiterOptions)) (*DescribeNetworkInterfacesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeNetworkInterfaces(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for NetworkInterfaceAvailable waiter") -} - -func networkInterfaceAvailableStateRetryable(ctx context.Context, input *DescribeNetworkInterfacesInput, output *DescribeNetworkInterfacesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.NetworkInterfaces - var v2 []types.NetworkInterfaceStatus - for _, v := range v1 { - v3 := v.Status - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidNetworkInterfaceID.NotFound" == apiErr.ErrorCode() { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeNetworkInterfacesPaginatorOptions is the paginator options for -// DescribeNetworkInterfaces -type DescribeNetworkInterfacesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. You cannot - // specify this parameter and the network interface IDs parameter in the same - // request. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeNetworkInterfacesPaginator is a paginator for DescribeNetworkInterfaces -type DescribeNetworkInterfacesPaginator struct { - options DescribeNetworkInterfacesPaginatorOptions - client DescribeNetworkInterfacesAPIClient - params *DescribeNetworkInterfacesInput - nextToken *string - firstPage bool -} - -// NewDescribeNetworkInterfacesPaginator returns a new -// DescribeNetworkInterfacesPaginator -func NewDescribeNetworkInterfacesPaginator(client DescribeNetworkInterfacesAPIClient, params *DescribeNetworkInterfacesInput, optFns ...func(*DescribeNetworkInterfacesPaginatorOptions)) *DescribeNetworkInterfacesPaginator { - if params == nil { - params = &DescribeNetworkInterfacesInput{} - } - - options := DescribeNetworkInterfacesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeNetworkInterfacesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeNetworkInterfacesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeNetworkInterfaces page. -func (p *DescribeNetworkInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeNetworkInterfaces(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeNetworkInterfacesAPIClient is a client that implements the -// DescribeNetworkInterfaces operation. -type DescribeNetworkInterfacesAPIClient interface { - DescribeNetworkInterfaces(context.Context, *DescribeNetworkInterfacesInput, ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) -} - -var _ DescribeNetworkInterfacesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNetworkInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNetworkInterfaces", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeOutpostLags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeOutpostLags.go deleted file mode 100644 index cbcf158e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeOutpostLags.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Outposts link aggregation groups (LAGs). -// -// LAGs are only available for second-generation Outposts racks at this time. -func (c *Client) DescribeOutpostLags(ctx context.Context, params *DescribeOutpostLagsInput, optFns ...func(*Options)) (*DescribeOutpostLagsOutput, error) { - if params == nil { - params = &DescribeOutpostLagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeOutpostLags", params, optFns, c.addOperationDescribeOutpostLagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeOutpostLagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeOutpostLagsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters to use for narrowing down the request. The following filters are - // supported: - // - // - service-link-virtual-interface-id - The ID of the service link virtual - // interface. - // - // - service-link-virtual-interface-arn - The ARN of the service link virtual - // interface. - // - // - outpost-id - The Outpost ID. - // - // - outpost-arn - The Outpost ARN. - // - // - owner-id - The ID of the Amazon Web Services account that owns the service - // link virtual interface. - // - // - vlan - The ID of the address pool. - // - // - local-address - The local address. - // - // - peer-address - The peer address. - // - // - peer-bgp-asn - The peer BGP ASN. - // - // - outpost-lag-id - The Outpost LAG ID. - // - // - configuration-state - The configuration state of the service link virtual - // interface. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the Outpost LAGs. - OutpostLagIds []string - - noSmithyDocumentSerde -} - -type DescribeOutpostLagsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The Outpost LAGs. - OutpostLags []types.OutpostLag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeOutpostLagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeOutpostLags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeOutpostLags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOutpostLags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOutpostLags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeOutpostLags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeOutpostLags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePlacementGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePlacementGroups.go deleted file mode 100644 index 36c492b1a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePlacementGroups.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified placement groups or all of your placement groups. -// -// To describe a specific placement group that is shared with your account, you -// must specify the ID of the placement group using the GroupId parameter. -// Specifying the name of a shared placement group using the GroupNames parameter -// will result in an error. -// -// For more information, see [Placement groups] in the Amazon EC2 User Guide. -// -// [Placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html -func (c *Client) DescribePlacementGroups(ctx context.Context, params *DescribePlacementGroupsInput, optFns ...func(*Options)) (*DescribePlacementGroupsOutput, error) { - if params == nil { - params = &DescribePlacementGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePlacementGroups", params, optFns, c.addOperationDescribePlacementGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePlacementGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePlacementGroupsInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - group-name - The name of the placement group. - // - // - group-arn - The Amazon Resource Name (ARN) of the placement group. - // - // - spread-level - The spread level for the placement group ( host | rack ). - // - // - state - The state of the placement group ( pending | available | deleting | - // deleted ). - // - // - strategy - The strategy of the placement group ( cluster | spread | - // partition ). - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources that have a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The IDs of the placement groups. - GroupIds []string - - // The names of the placement groups. - // - // Constraints: - // - // - You can specify a name only if the placement group is owned by your account. - // - // - If a placement group is shared with your account, specifying the name - // results in an error. You must use the GroupId parameter instead. - GroupNames []string - - noSmithyDocumentSerde -} - -type DescribePlacementGroupsOutput struct { - - // Information about the placement groups. - PlacementGroups []types.PlacementGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePlacementGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribePlacementGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribePlacementGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePlacementGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePlacementGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribePlacementGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePlacementGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrefixLists.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrefixLists.go deleted file mode 100644 index 0deb7e144..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrefixLists.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes available Amazon Web Services services in a prefix list format, which -// includes the prefix list name and prefix list ID of the service and the IP -// address range for the service. -// -// We recommend that you use DescribeManagedPrefixLists instead. -func (c *Client) DescribePrefixLists(ctx context.Context, params *DescribePrefixListsInput, optFns ...func(*Options)) (*DescribePrefixListsOutput, error) { - if params == nil { - params = &DescribePrefixListsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePrefixLists", params, optFns, c.addOperationDescribePrefixListsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePrefixListsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePrefixListsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - prefix-list-id : The ID of a prefix list. - // - // - prefix-list-name : The name of a prefix list. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // One or more prefix list IDs. - PrefixListIds []string - - noSmithyDocumentSerde -} - -type DescribePrefixListsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // All available prefix lists. - PrefixLists []types.PrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePrefixListsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribePrefixLists{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribePrefixLists{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePrefixLists"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePrefixLists(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribePrefixListsPaginatorOptions is the paginator options for -// DescribePrefixLists -type DescribePrefixListsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribePrefixListsPaginator is a paginator for DescribePrefixLists -type DescribePrefixListsPaginator struct { - options DescribePrefixListsPaginatorOptions - client DescribePrefixListsAPIClient - params *DescribePrefixListsInput - nextToken *string - firstPage bool -} - -// NewDescribePrefixListsPaginator returns a new DescribePrefixListsPaginator -func NewDescribePrefixListsPaginator(client DescribePrefixListsAPIClient, params *DescribePrefixListsInput, optFns ...func(*DescribePrefixListsPaginatorOptions)) *DescribePrefixListsPaginator { - if params == nil { - params = &DescribePrefixListsInput{} - } - - options := DescribePrefixListsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribePrefixListsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribePrefixListsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribePrefixLists page. -func (p *DescribePrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrefixListsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribePrefixLists(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribePrefixListsAPIClient is a client that implements the -// DescribePrefixLists operation. -type DescribePrefixListsAPIClient interface { - DescribePrefixLists(context.Context, *DescribePrefixListsInput, ...func(*Options)) (*DescribePrefixListsOutput, error) -} - -var _ DescribePrefixListsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribePrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePrefixLists", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrincipalIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrincipalIdFormat.go deleted file mode 100644 index e4a5c9618..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePrincipalIdFormat.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the ID format settings for the root user and all IAM roles and IAM -// users that have explicitly specified a longer ID (17-character ID) preference. -// -// By default, all IAM roles and IAM users default to the same ID settings as the -// root user, unless they explicitly override the settings. This request is useful -// for identifying those IAM users and IAM roles that have overridden the default -// ID settings. -// -// The following resource types support longer IDs: bundle | conversion-task | -// customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway | -// network-acl | network-acl-association | network-interface | -// network-interface-attachment | prefix-list | reservation | route-table | -// route-table-association | security-group | snapshot | subnet | -// subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | -// vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway . -func (c *Client) DescribePrincipalIdFormat(ctx context.Context, params *DescribePrincipalIdFormatInput, optFns ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) { - if params == nil { - params = &DescribePrincipalIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePrincipalIdFormat", params, optFns, c.addOperationDescribePrincipalIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePrincipalIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePrincipalIdFormatInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int32 - - // The token to request the next page of results. - NextToken *string - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | - // image | import-task | instance | internet-gateway | network-acl | - // network-acl-association | network-interface | network-interface-attachment | - // prefix-list | reservation | route-table | route-table-association | - // security-group | snapshot | subnet | subnet-cidr-block-association | volume | - // vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | - // vpn-connection | vpn-gateway - Resources []string - - noSmithyDocumentSerde -} - -type DescribePrincipalIdFormatOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the ID format settings for the ARN. - Principals []types.PrincipalIdFormat - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePrincipalIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribePrincipalIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribePrincipalIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePrincipalIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePrincipalIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribePrincipalIdFormatPaginatorOptions is the paginator options for -// DescribePrincipalIdFormat -type DescribePrincipalIdFormatPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribePrincipalIdFormatPaginator is a paginator for DescribePrincipalIdFormat -type DescribePrincipalIdFormatPaginator struct { - options DescribePrincipalIdFormatPaginatorOptions - client DescribePrincipalIdFormatAPIClient - params *DescribePrincipalIdFormatInput - nextToken *string - firstPage bool -} - -// NewDescribePrincipalIdFormatPaginator returns a new -// DescribePrincipalIdFormatPaginator -func NewDescribePrincipalIdFormatPaginator(client DescribePrincipalIdFormatAPIClient, params *DescribePrincipalIdFormatInput, optFns ...func(*DescribePrincipalIdFormatPaginatorOptions)) *DescribePrincipalIdFormatPaginator { - if params == nil { - params = &DescribePrincipalIdFormatInput{} - } - - options := DescribePrincipalIdFormatPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribePrincipalIdFormatPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribePrincipalIdFormatPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribePrincipalIdFormat page. -func (p *DescribePrincipalIdFormatPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribePrincipalIdFormat(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribePrincipalIdFormatAPIClient is a client that implements the -// DescribePrincipalIdFormat operation. -type DescribePrincipalIdFormatAPIClient interface { - DescribePrincipalIdFormat(context.Context, *DescribePrincipalIdFormatInput, ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) -} - -var _ DescribePrincipalIdFormatAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribePrincipalIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePrincipalIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePublicIpv4Pools.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePublicIpv4Pools.go deleted file mode 100644 index c230b91d2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribePublicIpv4Pools.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified IPv4 address pools. -func (c *Client) DescribePublicIpv4Pools(ctx context.Context, params *DescribePublicIpv4PoolsInput, optFns ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) { - if params == nil { - params = &DescribePublicIpv4PoolsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePublicIpv4Pools", params, optFns, c.addOperationDescribePublicIpv4PoolsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePublicIpv4PoolsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePublicIpv4PoolsInput struct { - - // One or more filters. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the address pools. - PoolIds []string - - noSmithyDocumentSerde -} - -type DescribePublicIpv4PoolsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the address pools. - PublicIpv4Pools []types.PublicIpv4Pool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePublicIpv4PoolsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribePublicIpv4Pools{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribePublicIpv4Pools{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePublicIpv4Pools"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePublicIpv4Pools(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribePublicIpv4PoolsPaginatorOptions is the paginator options for -// DescribePublicIpv4Pools -type DescribePublicIpv4PoolsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribePublicIpv4PoolsPaginator is a paginator for DescribePublicIpv4Pools -type DescribePublicIpv4PoolsPaginator struct { - options DescribePublicIpv4PoolsPaginatorOptions - client DescribePublicIpv4PoolsAPIClient - params *DescribePublicIpv4PoolsInput - nextToken *string - firstPage bool -} - -// NewDescribePublicIpv4PoolsPaginator returns a new -// DescribePublicIpv4PoolsPaginator -func NewDescribePublicIpv4PoolsPaginator(client DescribePublicIpv4PoolsAPIClient, params *DescribePublicIpv4PoolsInput, optFns ...func(*DescribePublicIpv4PoolsPaginatorOptions)) *DescribePublicIpv4PoolsPaginator { - if params == nil { - params = &DescribePublicIpv4PoolsInput{} - } - - options := DescribePublicIpv4PoolsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribePublicIpv4PoolsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribePublicIpv4PoolsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribePublicIpv4Pools page. -func (p *DescribePublicIpv4PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribePublicIpv4Pools(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribePublicIpv4PoolsAPIClient is a client that implements the -// DescribePublicIpv4Pools operation. -type DescribePublicIpv4PoolsAPIClient interface { - DescribePublicIpv4Pools(context.Context, *DescribePublicIpv4PoolsInput, ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) -} - -var _ DescribePublicIpv4PoolsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribePublicIpv4Pools(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePublicIpv4Pools", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRegions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRegions.go deleted file mode 100644 index 3176e0cf3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRegions.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Regions that are enabled for your account, or all Regions. -// -// For a list of the Regions supported by Amazon EC2, see [Amazon EC2 service endpoints]. -// -// For information about enabling and disabling Regions for your account, see [Specify which Amazon Web Services Regions your account can use] in -// the Amazon Web Services Account Management Reference Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Specify which Amazon Web Services Regions your account can use]: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html -// [Amazon EC2 service endpoints]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-endpoints.html -func (c *Client) DescribeRegions(ctx context.Context, params *DescribeRegionsInput, optFns ...func(*Options)) (*DescribeRegionsOutput, error) { - if params == nil { - params = &DescribeRegionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeRegions", params, optFns, c.addOperationDescribeRegionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeRegionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeRegionsInput struct { - - // Indicates whether to display all Regions, including Regions that are disabled - // for your account. - AllRegions *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - endpoint - The endpoint of the Region (for example, - // ec2.us-east-1.amazonaws.com ). - // - // - opt-in-status - The opt-in status of the Region ( opt-in-not-required | - // opted-in | not-opted-in ). - // - // - region-name - The name of the Region (for example, us-east-1 ). - Filters []types.Filter - - // The names of the Regions. You can specify any Regions, whether they are enabled - // and disabled for your account. - RegionNames []string - - noSmithyDocumentSerde -} - -type DescribeRegionsOutput struct { - - // Information about the Regions. - Regions []types.Region - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeRegionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeRegions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeRegions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRegions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRegions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeRegions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeRegions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReplaceRootVolumeTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReplaceRootVolumeTasks.go deleted file mode 100644 index 0209a20ab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReplaceRootVolumeTasks.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a root volume replacement task. For more information, see [Replace a root volume] in the -// Amazon EC2 User Guide. -// -// [Replace a root volume]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html -func (c *Client) DescribeReplaceRootVolumeTasks(ctx context.Context, params *DescribeReplaceRootVolumeTasksInput, optFns ...func(*Options)) (*DescribeReplaceRootVolumeTasksOutput, error) { - if params == nil { - params = &DescribeReplaceRootVolumeTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeReplaceRootVolumeTasks", params, optFns, c.addOperationDescribeReplaceRootVolumeTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeReplaceRootVolumeTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeReplaceRootVolumeTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Filter to use: - // - // - instance-id - The ID of the instance for which the root volume replacement - // task was created. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The ID of the root volume replacement task to view. - ReplaceRootVolumeTaskIds []string - - noSmithyDocumentSerde -} - -type DescribeReplaceRootVolumeTasksOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the root volume replacement task. - ReplaceRootVolumeTasks []types.ReplaceRootVolumeTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeReplaceRootVolumeTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeReplaceRootVolumeTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeReplaceRootVolumeTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReplaceRootVolumeTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReplaceRootVolumeTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeReplaceRootVolumeTasksPaginatorOptions is the paginator options for -// DescribeReplaceRootVolumeTasks -type DescribeReplaceRootVolumeTasksPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeReplaceRootVolumeTasksPaginator is a paginator for -// DescribeReplaceRootVolumeTasks -type DescribeReplaceRootVolumeTasksPaginator struct { - options DescribeReplaceRootVolumeTasksPaginatorOptions - client DescribeReplaceRootVolumeTasksAPIClient - params *DescribeReplaceRootVolumeTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeReplaceRootVolumeTasksPaginator returns a new -// DescribeReplaceRootVolumeTasksPaginator -func NewDescribeReplaceRootVolumeTasksPaginator(client DescribeReplaceRootVolumeTasksAPIClient, params *DescribeReplaceRootVolumeTasksInput, optFns ...func(*DescribeReplaceRootVolumeTasksPaginatorOptions)) *DescribeReplaceRootVolumeTasksPaginator { - if params == nil { - params = &DescribeReplaceRootVolumeTasksInput{} - } - - options := DescribeReplaceRootVolumeTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeReplaceRootVolumeTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeReplaceRootVolumeTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeReplaceRootVolumeTasks page. -func (p *DescribeReplaceRootVolumeTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplaceRootVolumeTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeReplaceRootVolumeTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeReplaceRootVolumeTasksAPIClient is a client that implements the -// DescribeReplaceRootVolumeTasks operation. -type DescribeReplaceRootVolumeTasksAPIClient interface { - DescribeReplaceRootVolumeTasks(context.Context, *DescribeReplaceRootVolumeTasksInput, ...func(*Options)) (*DescribeReplaceRootVolumeTasksOutput, error) -} - -var _ DescribeReplaceRootVolumeTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeReplaceRootVolumeTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeReplaceRootVolumeTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstances.go deleted file mode 100644 index 7e120c1d6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstances.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of the Reserved Instances that you purchased. -// -// For more information about Reserved Instances, see [Reserved Instances] in the Amazon EC2 User -// Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Reserved Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html -func (c *Client) DescribeReservedInstances(ctx context.Context, params *DescribeReservedInstancesInput, optFns ...func(*Options)) (*DescribeReservedInstancesOutput, error) { - if params == nil { - params = &DescribeReservedInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeReservedInstances", params, optFns, c.addOperationDescribeReservedInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeReservedInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeReservedInstances. -type DescribeReservedInstancesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - availability-zone - The Availability Zone where the Reserved Instance can be - // used. - // - // - availability-zone-id - The ID of the Availability Zone where the Reserved - // Instance can be used. - // - // - duration - The duration of the Reserved Instance (one year or three years), - // in seconds ( 31536000 | 94608000 ). - // - // - end - The time when the Reserved Instance expires (for example, - // 2015-08-07T11:54:42.000Z). - // - // - fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // - instance-type - The instance type that is covered by the reservation. - // - // - scope - The scope of the Reserved Instance ( Region or Availability Zone ). - // - // - product-description - The Reserved Instance product platform description ( - // Linux/UNIX | Linux with SQL Server Standard | Linux with SQL Server Web | - // Linux with SQL Server Enterprise | SUSE Linux | Red Hat Enterprise Linux | - // Red Hat Enterprise Linux with HA | Windows | Windows with SQL Server Standard - // | Windows with SQL Server Web | Windows with SQL Server Enterprise ). - // - // - reserved-instances-id - The ID of the Reserved Instance. - // - // - start - The time at which the Reserved Instance purchase request was placed - // (for example, 2014-08-07T11:54:42.000Z). - // - // - state - The state of the Reserved Instance ( payment-pending | active | - // payment-failed | retired ). - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []types.Filter - - // Describes whether the Reserved Instance is Standard or Convertible. - OfferingClass types.OfferingClassType - - // The Reserved Instance offering type. If you are using tools that predate the - // 2011-11-01 API version, you only have access to the Medium Utilization Reserved - // Instance offering type. - OfferingType types.OfferingTypeValues - - // One or more Reserved Instance IDs. - // - // Default: Describes all your Reserved Instances, or only those otherwise - // specified. - ReservedInstancesIds []string - - noSmithyDocumentSerde -} - -// Contains the output for DescribeReservedInstances. -type DescribeReservedInstancesOutput struct { - - // A list of Reserved Instances. - ReservedInstances []types.ReservedInstances - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeReservedInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeReservedInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeReservedInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeReservedInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeReservedInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesListings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesListings.go deleted file mode 100644 index f1b25d597..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesListings.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your account's Reserved Instance listings in the Reserved Instance -// Marketplace. -// -// The Reserved Instance Marketplace matches sellers who want to resell Reserved -// Instance capacity that they no longer need with buyers who want to purchase -// additional capacity. Reserved Instances bought and sold through the Reserved -// Instance Marketplace work like any other Reserved Instances. -// -// As a seller, you choose to list some or all of your Reserved Instances, and you -// specify the upfront price to receive for them. Your Reserved Instances are then -// listed in the Reserved Instance Marketplace and are available for purchase. -// -// As a buyer, you specify the configuration of the Reserved Instance to purchase, -// and the Marketplace matches what you're searching for with what's available. The -// Marketplace first sells the lowest priced Reserved Instances to you, and -// continues to sell available Reserved Instance listings to you until your demand -// is met. You are charged based on the total price of all of the listings that you -// purchase. -// -// For more information, see [Sell in the Reserved Instance Marketplace] in the Amazon EC2 User Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Sell in the Reserved Instance Marketplace]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html -func (c *Client) DescribeReservedInstancesListings(ctx context.Context, params *DescribeReservedInstancesListingsInput, optFns ...func(*Options)) (*DescribeReservedInstancesListingsOutput, error) { - if params == nil { - params = &DescribeReservedInstancesListingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeReservedInstancesListings", params, optFns, c.addOperationDescribeReservedInstancesListingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeReservedInstancesListingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeReservedInstancesListings. -type DescribeReservedInstancesListingsInput struct { - - // One or more filters. - // - // - reserved-instances-id - The ID of the Reserved Instances. - // - // - reserved-instances-listing-id - The ID of the Reserved Instances listing. - // - // - status - The status of the Reserved Instance listing ( pending | active | - // cancelled | closed ). - // - // - status-message - The reason for the status. - Filters []types.Filter - - // One or more Reserved Instance IDs. - ReservedInstancesId *string - - // One or more Reserved Instance listing IDs. - ReservedInstancesListingId *string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeReservedInstancesListings. -type DescribeReservedInstancesListingsOutput struct { - - // Information about the Reserved Instance listing. - ReservedInstancesListings []types.ReservedInstancesListing - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeReservedInstancesListingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeReservedInstancesListings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeReservedInstancesListings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedInstancesListings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedInstancesListings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeReservedInstancesListings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeReservedInstancesListings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesModifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesModifications.go deleted file mode 100644 index 5c6a12b50..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesModifications.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the modifications made to your Reserved Instances. If no parameter is -// specified, information about all your Reserved Instances modification requests -// is returned. If a modification ID is specified, only information about the -// specific modification is returned. -// -// For more information, see [Modify Reserved Instances] in the Amazon EC2 User Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Modify Reserved Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html -func (c *Client) DescribeReservedInstancesModifications(ctx context.Context, params *DescribeReservedInstancesModificationsInput, optFns ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) { - if params == nil { - params = &DescribeReservedInstancesModificationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeReservedInstancesModifications", params, optFns, c.addOperationDescribeReservedInstancesModificationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeReservedInstancesModificationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeReservedInstancesModifications. -type DescribeReservedInstancesModificationsInput struct { - - // One or more filters. - // - // - client-token - The idempotency token for the modification request. - // - // - create-date - The time when the modification request was created. - // - // - effective-date - The time when the modification becomes effective. - // - // - modification-result.reserved-instances-id - The ID for the Reserved - // Instances created as part of the modification request. This ID is only available - // when the status of the modification is fulfilled . - // - // - modification-result.target-configuration.availability-zone - The - // Availability Zone for the new Reserved Instances. - // - // - modification-result.target-configuration.availability-zone-id - The ID of - // the Availability Zone for the new Reserved Instances. - // - // - modification-result.target-configuration.instance-count - The number of new - // Reserved Instances. - // - // - modification-result.target-configuration.instance-type - The instance type - // of the new Reserved Instances. - // - // - reserved-instances-id - The ID of the Reserved Instances modified. - // - // - reserved-instances-modification-id - The ID of the modification request. - // - // - status - The status of the Reserved Instances modification request ( - // processing | fulfilled | failed ). - // - // - status-message - The reason for the status. - // - // - update-date - The time when the modification request was last updated. - Filters []types.Filter - - // The token to retrieve the next page of results. - NextToken *string - - // IDs for the submitted modification request. - ReservedInstancesModificationIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeReservedInstancesModifications. -type DescribeReservedInstancesModificationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The Reserved Instance modification information. - ReservedInstancesModifications []types.ReservedInstancesModification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeReservedInstancesModificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeReservedInstancesModifications{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeReservedInstancesModifications{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedInstancesModifications"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedInstancesModifications(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeReservedInstancesModificationsPaginatorOptions is the paginator options -// for DescribeReservedInstancesModifications -type DescribeReservedInstancesModificationsPaginatorOptions struct { - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeReservedInstancesModificationsPaginator is a paginator for -// DescribeReservedInstancesModifications -type DescribeReservedInstancesModificationsPaginator struct { - options DescribeReservedInstancesModificationsPaginatorOptions - client DescribeReservedInstancesModificationsAPIClient - params *DescribeReservedInstancesModificationsInput - nextToken *string - firstPage bool -} - -// NewDescribeReservedInstancesModificationsPaginator returns a new -// DescribeReservedInstancesModificationsPaginator -func NewDescribeReservedInstancesModificationsPaginator(client DescribeReservedInstancesModificationsAPIClient, params *DescribeReservedInstancesModificationsInput, optFns ...func(*DescribeReservedInstancesModificationsPaginatorOptions)) *DescribeReservedInstancesModificationsPaginator { - if params == nil { - params = &DescribeReservedInstancesModificationsInput{} - } - - options := DescribeReservedInstancesModificationsPaginatorOptions{} - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeReservedInstancesModificationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeReservedInstancesModificationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeReservedInstancesModifications page. -func (p *DescribeReservedInstancesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeReservedInstancesModifications(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeReservedInstancesModificationsAPIClient is a client that implements the -// DescribeReservedInstancesModifications operation. -type DescribeReservedInstancesModificationsAPIClient interface { - DescribeReservedInstancesModifications(context.Context, *DescribeReservedInstancesModificationsInput, ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) -} - -var _ DescribeReservedInstancesModificationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeReservedInstancesModifications(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeReservedInstancesModifications", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesOfferings.go deleted file mode 100644 index 3e5ecd1b1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeReservedInstancesOfferings.go +++ /dev/null @@ -1,384 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes Reserved Instance offerings that are available for purchase. With -// Reserved Instances, you purchase the right to launch instances for a period of -// time. During that time period, you do not receive insufficient capacity errors, -// and you pay a lower usage rate than the rate charged for On-Demand instances for -// the actual time used. -// -// If you have listed your own Reserved Instances for sale in the Reserved -// Instance Marketplace, they will be excluded from these results. This is to -// ensure that you do not purchase your own Reserved Instances. -// -// For more information, see [Sell in the Reserved Instance Marketplace] in the Amazon EC2 User Guide. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Sell in the Reserved Instance Marketplace]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html -func (c *Client) DescribeReservedInstancesOfferings(ctx context.Context, params *DescribeReservedInstancesOfferingsInput, optFns ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) { - if params == nil { - params = &DescribeReservedInstancesOfferingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeReservedInstancesOfferings", params, optFns, c.addOperationDescribeReservedInstancesOfferingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeReservedInstancesOfferingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeReservedInstancesOfferings. -type DescribeReservedInstancesOfferingsInput struct { - - // The Availability Zone in which the Reserved Instance can be used. - // - // Either AvailabilityZone or AvailabilityZoneId can be specified, but not both. - AvailabilityZone *string - - // The ID of the Availability Zone. - // - // Either AvailabilityZone or AvailabilityZoneId can be specified, but not both. - AvailabilityZoneId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - availability-zone - The Availability Zone where the Reserved Instance can be - // used. - // - // - availability-zone-id - The ID of the Availability Zone where the Reserved - // Instance can be used. - // - // - duration - The duration of the Reserved Instance (for example, one year or - // three years), in seconds ( 31536000 | 94608000 ). - // - // - fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // - instance-type - The instance type that is covered by the reservation. - // - // - marketplace - Set to true to show only Reserved Instance Marketplace - // offerings. When this filter is not used, which is the default behavior, all - // offerings from both Amazon Web Services and the Reserved Instance Marketplace - // are listed. - // - // - product-description - The Reserved Instance product platform description ( - // Linux/UNIX | Linux with SQL Server Standard | Linux with SQL Server Web | - // Linux with SQL Server Enterprise | SUSE Linux | Red Hat Enterprise Linux | - // Red Hat Enterprise Linux with HA | Windows | Windows with SQL Server Standard - // | Windows with SQL Server Web | Windows with SQL Server Enterprise ). - // - // - reserved-instances-offering-id - The Reserved Instances offering ID. - // - // - scope - The scope of the Reserved Instance ( Availability Zone or Region ). - // - // - usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []types.Filter - - // Include Reserved Instance Marketplace offerings in the response. - IncludeMarketplace *bool - - // The tenancy of the instances covered by the reservation. A Reserved Instance - // with a tenancy of dedicated is applied to instances that run in a VPC on - // single-tenant hardware (i.e., Dedicated Instances). - // - // Important: The host value cannot be used with this parameter. Use the default - // or dedicated values only. - // - // Default: default - InstanceTenancy types.Tenancy - - // The instance type that the reservation will cover (for example, m1.small ). For - // more information, see [Amazon EC2 instance types]in the Amazon EC2 User Guide. - // - // [Amazon EC2 instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType types.InstanceType - - // The maximum duration (in seconds) to filter when searching for offerings. - // - // Default: 94608000 (3 years) - MaxDuration *int64 - - // The maximum number of instances to filter when searching for offerings. - // - // Default: 20 - MaxInstanceCount *int32 - - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. The maximum is 100. - // - // Default: 100 - MaxResults *int32 - - // The minimum duration (in seconds) to filter when searching for offerings. - // - // Default: 2592000 (1 month) - MinDuration *int64 - - // The token to retrieve the next page of results. - NextToken *string - - // The offering class of the Reserved Instance. Can be standard or convertible . - OfferingClass types.OfferingClassType - - // The Reserved Instance offering type. If you are using tools that predate the - // 2011-11-01 API version, you only have access to the Medium Utilization Reserved - // Instance offering type. - OfferingType types.OfferingTypeValues - - // The Reserved Instance product platform description. Instances that include - // (Amazon VPC) in the description are for use with Amazon VPC. - ProductDescription types.RIProductDescription - - // One or more Reserved Instances offering IDs. - ReservedInstancesOfferingIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeReservedInstancesOfferings. -type DescribeReservedInstancesOfferingsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // A list of Reserved Instances offerings. - ReservedInstancesOfferings []types.ReservedInstancesOffering - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeReservedInstancesOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeReservedInstancesOfferings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeReservedInstancesOfferings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedInstancesOfferings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedInstancesOfferings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeReservedInstancesOfferingsPaginatorOptions is the paginator options for -// DescribeReservedInstancesOfferings -type DescribeReservedInstancesOfferingsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. The maximum is 100. - // - // Default: 100 - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeReservedInstancesOfferingsPaginator is a paginator for -// DescribeReservedInstancesOfferings -type DescribeReservedInstancesOfferingsPaginator struct { - options DescribeReservedInstancesOfferingsPaginatorOptions - client DescribeReservedInstancesOfferingsAPIClient - params *DescribeReservedInstancesOfferingsInput - nextToken *string - firstPage bool -} - -// NewDescribeReservedInstancesOfferingsPaginator returns a new -// DescribeReservedInstancesOfferingsPaginator -func NewDescribeReservedInstancesOfferingsPaginator(client DescribeReservedInstancesOfferingsAPIClient, params *DescribeReservedInstancesOfferingsInput, optFns ...func(*DescribeReservedInstancesOfferingsPaginatorOptions)) *DescribeReservedInstancesOfferingsPaginator { - if params == nil { - params = &DescribeReservedInstancesOfferingsInput{} - } - - options := DescribeReservedInstancesOfferingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeReservedInstancesOfferingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeReservedInstancesOfferingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeReservedInstancesOfferings page. -func (p *DescribeReservedInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeReservedInstancesOfferings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeReservedInstancesOfferingsAPIClient is a client that implements the -// DescribeReservedInstancesOfferings operation. -type DescribeReservedInstancesOfferingsAPIClient interface { - DescribeReservedInstancesOfferings(context.Context, *DescribeReservedInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) -} - -var _ DescribeReservedInstancesOfferingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeReservedInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeReservedInstancesOfferings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerEndpoints.go deleted file mode 100644 index fc17a9038..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerEndpoints.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more route server endpoints. -// -// A route server endpoint is an Amazon Web Services-managed component inside a -// subnet that facilitates [BGP (Border Gateway Protocol)]connections between your route server and your BGP -// peers. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [BGP (Border Gateway Protocol)]: https://en.wikipedia.org/wiki/Border_Gateway_Protocol -func (c *Client) DescribeRouteServerEndpoints(ctx context.Context, params *DescribeRouteServerEndpointsInput, optFns ...func(*Options)) (*DescribeRouteServerEndpointsOutput, error) { - if params == nil { - params = &DescribeRouteServerEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeRouteServerEndpoints", params, optFns, c.addOperationDescribeRouteServerEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeRouteServerEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeRouteServerEndpointsInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters to apply to the describe request. - Filters []types.Filter - - // The maximum number of results to return with a single call. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the route server endpoints to describe. - RouteServerEndpointIds []string - - noSmithyDocumentSerde -} - -type DescribeRouteServerEndpointsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the described route server endpoints. - RouteServerEndpoints []types.RouteServerEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeRouteServerEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeRouteServerEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeRouteServerEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRouteServerEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRouteServerEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeRouteServerEndpointsPaginatorOptions is the paginator options for -// DescribeRouteServerEndpoints -type DescribeRouteServerEndpointsPaginatorOptions struct { - // The maximum number of results to return with a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeRouteServerEndpointsPaginator is a paginator for -// DescribeRouteServerEndpoints -type DescribeRouteServerEndpointsPaginator struct { - options DescribeRouteServerEndpointsPaginatorOptions - client DescribeRouteServerEndpointsAPIClient - params *DescribeRouteServerEndpointsInput - nextToken *string - firstPage bool -} - -// NewDescribeRouteServerEndpointsPaginator returns a new -// DescribeRouteServerEndpointsPaginator -func NewDescribeRouteServerEndpointsPaginator(client DescribeRouteServerEndpointsAPIClient, params *DescribeRouteServerEndpointsInput, optFns ...func(*DescribeRouteServerEndpointsPaginatorOptions)) *DescribeRouteServerEndpointsPaginator { - if params == nil { - params = &DescribeRouteServerEndpointsInput{} - } - - options := DescribeRouteServerEndpointsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeRouteServerEndpointsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeRouteServerEndpointsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeRouteServerEndpoints page. -func (p *DescribeRouteServerEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteServerEndpointsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeRouteServerEndpoints(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeRouteServerEndpointsAPIClient is a client that implements the -// DescribeRouteServerEndpoints operation. -type DescribeRouteServerEndpointsAPIClient interface { - DescribeRouteServerEndpoints(context.Context, *DescribeRouteServerEndpointsInput, ...func(*Options)) (*DescribeRouteServerEndpointsOutput, error) -} - -var _ DescribeRouteServerEndpointsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeRouteServerEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeRouteServerEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerPeers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerPeers.go deleted file mode 100644 index a8e4c2499..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServerPeers.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more route server peers. -// -// A route server peer is a session between a route server endpoint and the device -// deployed in Amazon Web Services (such as a firewall appliance or other network -// security function running on an EC2 instance). The device must meet these -// requirements: -// -// - Have an elastic network interface in the VPC -// -// - Support BGP (Border Gateway Protocol) -// -// - Can initiate BGP sessions -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) DescribeRouteServerPeers(ctx context.Context, params *DescribeRouteServerPeersInput, optFns ...func(*Options)) (*DescribeRouteServerPeersOutput, error) { - if params == nil { - params = &DescribeRouteServerPeersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeRouteServerPeers", params, optFns, c.addOperationDescribeRouteServerPeersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeRouteServerPeersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeRouteServerPeersInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters to apply to the describe request. - Filters []types.Filter - - // The maximum number of results to return with a single call. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the route server peers to describe. - RouteServerPeerIds []string - - noSmithyDocumentSerde -} - -type DescribeRouteServerPeersOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the described route server peers. - RouteServerPeers []types.RouteServerPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeRouteServerPeersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeRouteServerPeers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeRouteServerPeers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRouteServerPeers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRouteServerPeers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeRouteServerPeersPaginatorOptions is the paginator options for -// DescribeRouteServerPeers -type DescribeRouteServerPeersPaginatorOptions struct { - // The maximum number of results to return with a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeRouteServerPeersPaginator is a paginator for DescribeRouteServerPeers -type DescribeRouteServerPeersPaginator struct { - options DescribeRouteServerPeersPaginatorOptions - client DescribeRouteServerPeersAPIClient - params *DescribeRouteServerPeersInput - nextToken *string - firstPage bool -} - -// NewDescribeRouteServerPeersPaginator returns a new -// DescribeRouteServerPeersPaginator -func NewDescribeRouteServerPeersPaginator(client DescribeRouteServerPeersAPIClient, params *DescribeRouteServerPeersInput, optFns ...func(*DescribeRouteServerPeersPaginatorOptions)) *DescribeRouteServerPeersPaginator { - if params == nil { - params = &DescribeRouteServerPeersInput{} - } - - options := DescribeRouteServerPeersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeRouteServerPeersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeRouteServerPeersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeRouteServerPeers page. -func (p *DescribeRouteServerPeersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteServerPeersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeRouteServerPeers(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeRouteServerPeersAPIClient is a client that implements the -// DescribeRouteServerPeers operation. -type DescribeRouteServerPeersAPIClient interface { - DescribeRouteServerPeers(context.Context, *DescribeRouteServerPeersInput, ...func(*Options)) (*DescribeRouteServerPeersOutput, error) -} - -var _ DescribeRouteServerPeersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeRouteServerPeers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeRouteServerPeers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServers.go deleted file mode 100644 index 707aa374c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteServers.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more route servers. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) DescribeRouteServers(ctx context.Context, params *DescribeRouteServersInput, optFns ...func(*Options)) (*DescribeRouteServersOutput, error) { - if params == nil { - params = &DescribeRouteServersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeRouteServers", params, optFns, c.addOperationDescribeRouteServersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeRouteServersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeRouteServersInput struct { - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters to apply to the describe request. - Filters []types.Filter - - // The maximum number of results to return with a single call. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the route servers to describe. - RouteServerIds []string - - noSmithyDocumentSerde -} - -type DescribeRouteServersOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the described route servers. - RouteServers []types.RouteServer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeRouteServersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeRouteServers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeRouteServers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRouteServers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRouteServers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeRouteServersPaginatorOptions is the paginator options for -// DescribeRouteServers -type DescribeRouteServersPaginatorOptions struct { - // The maximum number of results to return with a single call. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeRouteServersPaginator is a paginator for DescribeRouteServers -type DescribeRouteServersPaginator struct { - options DescribeRouteServersPaginatorOptions - client DescribeRouteServersAPIClient - params *DescribeRouteServersInput - nextToken *string - firstPage bool -} - -// NewDescribeRouteServersPaginator returns a new DescribeRouteServersPaginator -func NewDescribeRouteServersPaginator(client DescribeRouteServersAPIClient, params *DescribeRouteServersInput, optFns ...func(*DescribeRouteServersPaginatorOptions)) *DescribeRouteServersPaginator { - if params == nil { - params = &DescribeRouteServersInput{} - } - - options := DescribeRouteServersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeRouteServersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeRouteServersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeRouteServers page. -func (p *DescribeRouteServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteServersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeRouteServers(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeRouteServersAPIClient is a client that implements the -// DescribeRouteServers operation. -type DescribeRouteServersAPIClient interface { - DescribeRouteServers(context.Context, *DescribeRouteServersInput, ...func(*Options)) (*DescribeRouteServersOutput, error) -} - -var _ DescribeRouteServersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeRouteServers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeRouteServers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteTables.go deleted file mode 100644 index 03215958a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeRouteTables.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your route tables. The default is to describe all your route tables. -// Alternatively, you can specify specific route table IDs or filter the results to -// include only the route tables that match specific criteria. -// -// Each subnet in your VPC must be associated with a route table. If a subnet is -// not explicitly associated with any route table, it is implicitly associated with -// the main route table. This command does not return the subnet ID for implicit -// associations. -// -// For more information, see [Route tables] in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) DescribeRouteTables(ctx context.Context, params *DescribeRouteTablesInput, optFns ...func(*Options)) (*DescribeRouteTablesOutput, error) { - if params == nil { - params = &DescribeRouteTablesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeRouteTables", params, optFns, c.addOperationDescribeRouteTablesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeRouteTablesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeRouteTablesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - association.gateway-id - The ID of the gateway involved in the association. - // - // - association.route-table-association-id - The ID of an association ID for the - // route table. - // - // - association.route-table-id - The ID of the route table involved in the - // association. - // - // - association.subnet-id - The ID of the subnet involved in the association. - // - // - association.main - Indicates whether the route table is the main route table - // for the VPC ( true | false ). Route tables that do not have an association ID - // are not returned in the response. - // - // - owner-id - The ID of the Amazon Web Services account that owns the route - // table. - // - // - route-table-id - The ID of the route table. - // - // - route.destination-cidr-block - The IPv4 CIDR range specified in a route in - // the table. - // - // - route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in a route - // in the route table. - // - // - route.destination-prefix-list-id - The ID (prefix) of the Amazon Web - // Services service specified in a route in the table. - // - // - route.egress-only-internet-gateway-id - The ID of an egress-only Internet - // gateway specified in a route in the route table. - // - // - route.gateway-id - The ID of a gateway specified in a route in the table. - // - // - route.instance-id - The ID of an instance specified in a route in the table. - // - // - route.nat-gateway-id - The ID of a NAT gateway. - // - // - route.transit-gateway-id - The ID of a transit gateway. - // - // - route.origin - Describes how the route was created. CreateRouteTable - // indicates that the route was automatically created when the route table was - // created; CreateRoute indicates that the route was manually added to the route - // table; EnableVgwRoutePropagation indicates that the route was propagated by - // route propagation. - // - // - route.state - The state of a route in the route table ( active | blackhole - // ). The blackhole state indicates that the route's target isn't available (for - // example, the specified gateway isn't attached to the VPC, the specified NAT - // instance has been terminated, and so on). - // - // - route.vpc-peering-connection-id - The ID of a VPC peering connection - // specified in a route in the table. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC for the route table. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the route tables. - RouteTableIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeRouteTables. -type DescribeRouteTablesOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the route tables. - RouteTables []types.RouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeRouteTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeRouteTables{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeRouteTables{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRouteTables"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRouteTables(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeRouteTablesPaginatorOptions is the paginator options for -// DescribeRouteTables -type DescribeRouteTablesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeRouteTablesPaginator is a paginator for DescribeRouteTables -type DescribeRouteTablesPaginator struct { - options DescribeRouteTablesPaginatorOptions - client DescribeRouteTablesAPIClient - params *DescribeRouteTablesInput - nextToken *string - firstPage bool -} - -// NewDescribeRouteTablesPaginator returns a new DescribeRouteTablesPaginator -func NewDescribeRouteTablesPaginator(client DescribeRouteTablesAPIClient, params *DescribeRouteTablesInput, optFns ...func(*DescribeRouteTablesPaginatorOptions)) *DescribeRouteTablesPaginator { - if params == nil { - params = &DescribeRouteTablesInput{} - } - - options := DescribeRouteTablesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeRouteTablesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeRouteTablesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeRouteTables page. -func (p *DescribeRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteTablesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeRouteTables(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeRouteTablesAPIClient is a client that implements the -// DescribeRouteTables operation. -type DescribeRouteTablesAPIClient interface { - DescribeRouteTables(context.Context, *DescribeRouteTablesInput, ...func(*Options)) (*DescribeRouteTablesOutput, error) -} - -var _ DescribeRouteTablesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeRouteTables", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstanceAvailability.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstanceAvailability.go deleted file mode 100644 index 90c65d3a6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstanceAvailability.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Finds available schedules that meet the specified criteria. -// -// You can search for an available schedule no more than 3 months in advance. You -// must meet the minimum required duration of 1,200 hours per year. For example, -// the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, -// and the minimum monthly schedule is 100 hours. -// -// After you find a schedule that meets your needs, call PurchaseScheduledInstances to purchase Scheduled -// Instances with that schedule. -func (c *Client) DescribeScheduledInstanceAvailability(ctx context.Context, params *DescribeScheduledInstanceAvailabilityInput, optFns ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) { - if params == nil { - params = &DescribeScheduledInstanceAvailabilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeScheduledInstanceAvailability", params, optFns, c.addOperationDescribeScheduledInstanceAvailabilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeScheduledInstanceAvailabilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeScheduledInstanceAvailability. -type DescribeScheduledInstanceAvailabilityInput struct { - - // The time period for the first schedule to start. - // - // This member is required. - FirstSlotStartTimeRange *types.SlotDateTimeRangeRequest - - // The schedule recurrence. - // - // This member is required. - Recurrence *types.ScheduledInstanceRecurrenceRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The Availability Zone (for example, us-west-2a ). - // - // - instance-type - The instance type (for example, c4.large ). - // - // - platform - The platform ( Linux/UNIX or Windows ). - Filters []types.Filter - - // The maximum number of results to return in a single call. This value can be - // between 5 and 300. The default value is 300. To retrieve the remaining results, - // make another call with the returned NextToken value. - MaxResults *int32 - - // The maximum available duration, in hours. This value must be greater than - // MinSlotDurationInHours and less than 1,720. - MaxSlotDurationInHours *int32 - - // The minimum available duration, in hours. The minimum required duration is - // 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the - // minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 - // hours. - MinSlotDurationInHours *int32 - - // The token for the next set of results. - NextToken *string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeScheduledInstanceAvailability. -type DescribeScheduledInstanceAvailabilityOutput struct { - - // The token required to retrieve the next set of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the available Scheduled Instances. - ScheduledInstanceAvailabilitySet []types.ScheduledInstanceAvailability - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeScheduledInstanceAvailabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeScheduledInstanceAvailability{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeScheduledInstanceAvailability{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeScheduledInstanceAvailability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeScheduledInstanceAvailabilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeScheduledInstanceAvailability(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeScheduledInstanceAvailabilityPaginatorOptions is the paginator options -// for DescribeScheduledInstanceAvailability -type DescribeScheduledInstanceAvailabilityPaginatorOptions struct { - // The maximum number of results to return in a single call. This value can be - // between 5 and 300. The default value is 300. To retrieve the remaining results, - // make another call with the returned NextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeScheduledInstanceAvailabilityPaginator is a paginator for -// DescribeScheduledInstanceAvailability -type DescribeScheduledInstanceAvailabilityPaginator struct { - options DescribeScheduledInstanceAvailabilityPaginatorOptions - client DescribeScheduledInstanceAvailabilityAPIClient - params *DescribeScheduledInstanceAvailabilityInput - nextToken *string - firstPage bool -} - -// NewDescribeScheduledInstanceAvailabilityPaginator returns a new -// DescribeScheduledInstanceAvailabilityPaginator -func NewDescribeScheduledInstanceAvailabilityPaginator(client DescribeScheduledInstanceAvailabilityAPIClient, params *DescribeScheduledInstanceAvailabilityInput, optFns ...func(*DescribeScheduledInstanceAvailabilityPaginatorOptions)) *DescribeScheduledInstanceAvailabilityPaginator { - if params == nil { - params = &DescribeScheduledInstanceAvailabilityInput{} - } - - options := DescribeScheduledInstanceAvailabilityPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeScheduledInstanceAvailabilityPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeScheduledInstanceAvailabilityPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeScheduledInstanceAvailability page. -func (p *DescribeScheduledInstanceAvailabilityPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeScheduledInstanceAvailability(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeScheduledInstanceAvailabilityAPIClient is a client that implements the -// DescribeScheduledInstanceAvailability operation. -type DescribeScheduledInstanceAvailabilityAPIClient interface { - DescribeScheduledInstanceAvailability(context.Context, *DescribeScheduledInstanceAvailabilityInput, ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) -} - -var _ DescribeScheduledInstanceAvailabilityAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeScheduledInstanceAvailability(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeScheduledInstanceAvailability", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstances.go deleted file mode 100644 index 815204803..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeScheduledInstances.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Scheduled Instances or all your Scheduled Instances. -func (c *Client) DescribeScheduledInstances(ctx context.Context, params *DescribeScheduledInstancesInput, optFns ...func(*Options)) (*DescribeScheduledInstancesOutput, error) { - if params == nil { - params = &DescribeScheduledInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeScheduledInstances", params, optFns, c.addOperationDescribeScheduledInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeScheduledInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeScheduledInstances. -type DescribeScheduledInstancesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The Availability Zone (for example, us-west-2a ). - // - // - instance-type - The instance type (for example, c4.large ). - // - // - platform - The platform ( Linux/UNIX or Windows ). - Filters []types.Filter - - // The maximum number of results to return in a single call. This value can be - // between 5 and 300. The default value is 100. To retrieve the remaining results, - // make another call with the returned NextToken value. - MaxResults *int32 - - // The token for the next set of results. - NextToken *string - - // The Scheduled Instance IDs. - ScheduledInstanceIds []string - - // The time period for the first schedule to start. - SlotStartTimeRange *types.SlotStartTimeRangeRequest - - noSmithyDocumentSerde -} - -// Contains the output of DescribeScheduledInstances. -type DescribeScheduledInstancesOutput struct { - - // The token required to retrieve the next set of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the Scheduled Instances. - ScheduledInstanceSet []types.ScheduledInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeScheduledInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeScheduledInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeScheduledInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeScheduledInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeScheduledInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeScheduledInstancesPaginatorOptions is the paginator options for -// DescribeScheduledInstances -type DescribeScheduledInstancesPaginatorOptions struct { - // The maximum number of results to return in a single call. This value can be - // between 5 and 300. The default value is 100. To retrieve the remaining results, - // make another call with the returned NextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeScheduledInstancesPaginator is a paginator for -// DescribeScheduledInstances -type DescribeScheduledInstancesPaginator struct { - options DescribeScheduledInstancesPaginatorOptions - client DescribeScheduledInstancesAPIClient - params *DescribeScheduledInstancesInput - nextToken *string - firstPage bool -} - -// NewDescribeScheduledInstancesPaginator returns a new -// DescribeScheduledInstancesPaginator -func NewDescribeScheduledInstancesPaginator(client DescribeScheduledInstancesAPIClient, params *DescribeScheduledInstancesInput, optFns ...func(*DescribeScheduledInstancesPaginatorOptions)) *DescribeScheduledInstancesPaginator { - if params == nil { - params = &DescribeScheduledInstancesInput{} - } - - options := DescribeScheduledInstancesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeScheduledInstancesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeScheduledInstancesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeScheduledInstances page. -func (p *DescribeScheduledInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstancesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeScheduledInstances(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeScheduledInstancesAPIClient is a client that implements the -// DescribeScheduledInstances operation. -type DescribeScheduledInstancesAPIClient interface { - DescribeScheduledInstances(context.Context, *DescribeScheduledInstancesInput, ...func(*Options)) (*DescribeScheduledInstancesOutput, error) -} - -var _ DescribeScheduledInstancesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeScheduledInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeScheduledInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupReferences.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupReferences.go deleted file mode 100644 index 2622e7886..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupReferences.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the VPCs on the other side of a VPC peering or Transit Gateway -// connection that are referencing the security groups you've specified in this -// request. -func (c *Client) DescribeSecurityGroupReferences(ctx context.Context, params *DescribeSecurityGroupReferencesInput, optFns ...func(*Options)) (*DescribeSecurityGroupReferencesOutput, error) { - if params == nil { - params = &DescribeSecurityGroupReferencesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityGroupReferences", params, optFns, c.addOperationDescribeSecurityGroupReferencesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSecurityGroupReferencesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSecurityGroupReferencesInput struct { - - // The IDs of the security groups in your account. - // - // This member is required. - GroupId []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeSecurityGroupReferencesOutput struct { - - // Information about the VPCs with the referencing security groups. - SecurityGroupReferenceSet []types.SecurityGroupReference - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSecurityGroupReferencesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSecurityGroupReferences{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSecurityGroupReferences{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecurityGroupReferences"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeSecurityGroupReferencesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityGroupReferences(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeSecurityGroupReferences(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSecurityGroupReferences", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupRules.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupRules.go deleted file mode 100644 index 07b729055..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupRules.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of your security group rules. -func (c *Client) DescribeSecurityGroupRules(ctx context.Context, params *DescribeSecurityGroupRulesInput, optFns ...func(*Options)) (*DescribeSecurityGroupRulesOutput, error) { - if params == nil { - params = &DescribeSecurityGroupRulesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityGroupRules", params, optFns, c.addOperationDescribeSecurityGroupRulesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSecurityGroupRulesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSecurityGroupRulesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - group-id - The ID of the security group. - // - // - security-group-rule-id - The ID of the security group rule. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. This value - // can be between 5 and 1000. If this parameter is not specified, then all items - // are returned. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the security group rules. - SecurityGroupRuleIds []string - - noSmithyDocumentSerde -} - -type DescribeSecurityGroupRulesOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about security group rules. - SecurityGroupRules []types.SecurityGroupRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSecurityGroupRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSecurityGroupRules{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSecurityGroupRules{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecurityGroupRules"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityGroupRules(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeSecurityGroupRulesPaginatorOptions is the paginator options for -// DescribeSecurityGroupRules -type DescribeSecurityGroupRulesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. This value - // can be between 5 and 1000. If this parameter is not specified, then all items - // are returned. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSecurityGroupRulesPaginator is a paginator for -// DescribeSecurityGroupRules -type DescribeSecurityGroupRulesPaginator struct { - options DescribeSecurityGroupRulesPaginatorOptions - client DescribeSecurityGroupRulesAPIClient - params *DescribeSecurityGroupRulesInput - nextToken *string - firstPage bool -} - -// NewDescribeSecurityGroupRulesPaginator returns a new -// DescribeSecurityGroupRulesPaginator -func NewDescribeSecurityGroupRulesPaginator(client DescribeSecurityGroupRulesAPIClient, params *DescribeSecurityGroupRulesInput, optFns ...func(*DescribeSecurityGroupRulesPaginatorOptions)) *DescribeSecurityGroupRulesPaginator { - if params == nil { - params = &DescribeSecurityGroupRulesInput{} - } - - options := DescribeSecurityGroupRulesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSecurityGroupRulesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSecurityGroupRulesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSecurityGroupRules page. -func (p *DescribeSecurityGroupRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupRulesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSecurityGroupRules(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSecurityGroupRulesAPIClient is a client that implements the -// DescribeSecurityGroupRules operation. -type DescribeSecurityGroupRulesAPIClient interface { - DescribeSecurityGroupRules(context.Context, *DescribeSecurityGroupRulesInput, ...func(*Options)) (*DescribeSecurityGroupRulesOutput, error) -} - -var _ DescribeSecurityGroupRulesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSecurityGroupRules(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSecurityGroupRules", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go deleted file mode 100644 index 515e97135..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go +++ /dev/null @@ -1,781 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes security group VPC associations made with [AssociateSecurityGroupVpc]. -// -// [AssociateSecurityGroupVpc]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateSecurityGroupVpc.html -func (c *Client) DescribeSecurityGroupVpcAssociations(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, optFns ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, error) { - if params == nil { - params = &DescribeSecurityGroupVpcAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityGroupVpcAssociations", params, optFns, c.addOperationDescribeSecurityGroupVpcAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSecurityGroupVpcAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSecurityGroupVpcAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Security group VPC association filters. - // - // - group-id : The security group ID. - // - // - group-owner-id : The group owner ID. - // - // - vpc-id : The ID of the associated VPC. - // - // - vpc-owner-id : The account ID of the VPC owner. - // - // - state : The state of the association. - // - // - tag: : The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key : The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeSecurityGroupVpcAssociationsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The security group VPC associations. - SecurityGroupVpcAssociations []types.SecurityGroupVpcAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSecurityGroupVpcAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecurityGroupVpcAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityGroupVpcAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SecurityGroupVpcAssociationAssociatedWaiterOptions are waiter options for -// SecurityGroupVpcAssociationAssociatedWaiter -type SecurityGroupVpcAssociationAssociatedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SecurityGroupVpcAssociationAssociatedWaiter will use default minimum delay of 10 - // seconds. Note that MinDelay must resolve to a value lesser than or equal to the - // MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SecurityGroupVpcAssociationAssociatedWaiter will use default max - // delay of 120 seconds. Note that MaxDelay must resolve to value greater than or - // equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSecurityGroupVpcAssociationsInput, *DescribeSecurityGroupVpcAssociationsOutput, error) (bool, error) -} - -// SecurityGroupVpcAssociationAssociatedWaiter defines the waiters for -// SecurityGroupVpcAssociationAssociated -type SecurityGroupVpcAssociationAssociatedWaiter struct { - client DescribeSecurityGroupVpcAssociationsAPIClient - - options SecurityGroupVpcAssociationAssociatedWaiterOptions -} - -// NewSecurityGroupVpcAssociationAssociatedWaiter constructs a -// SecurityGroupVpcAssociationAssociatedWaiter. -func NewSecurityGroupVpcAssociationAssociatedWaiter(client DescribeSecurityGroupVpcAssociationsAPIClient, optFns ...func(*SecurityGroupVpcAssociationAssociatedWaiterOptions)) *SecurityGroupVpcAssociationAssociatedWaiter { - options := SecurityGroupVpcAssociationAssociatedWaiterOptions{} - options.MinDelay = 10 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = securityGroupVpcAssociationAssociatedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SecurityGroupVpcAssociationAssociatedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SecurityGroupVpcAssociationAssociated -// waiter. The maxWaitDur is the maximum wait duration the waiter will wait. The -// maxWaitDur is required and must be greater than zero. -func (w *SecurityGroupVpcAssociationAssociatedWaiter) Wait(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupVpcAssociationAssociatedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for -// SecurityGroupVpcAssociationAssociated waiter and returns the output of the -// successful operation. The maxWaitDur is the maximum wait duration the waiter -// will wait. The maxWaitDur is required and must be greater than zero. -func (w *SecurityGroupVpcAssociationAssociatedWaiter) WaitForOutput(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupVpcAssociationAssociatedWaiterOptions)) (*DescribeSecurityGroupVpcAssociationsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSecurityGroupVpcAssociations(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SecurityGroupVpcAssociationAssociated waiter") -} - -func securityGroupVpcAssociationAssociatedStateRetryable(ctx context.Context, input *DescribeSecurityGroupVpcAssociationsInput, output *DescribeSecurityGroupVpcAssociationsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "associated" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "associating" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return true, nil - } - } - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "association-failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// SecurityGroupVpcAssociationDisassociatedWaiterOptions are waiter options for -// SecurityGroupVpcAssociationDisassociatedWaiter -type SecurityGroupVpcAssociationDisassociatedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SecurityGroupVpcAssociationDisassociatedWaiter will use default minimum delay of - // 10 seconds. Note that MinDelay must resolve to a value lesser than or equal to - // the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SecurityGroupVpcAssociationDisassociatedWaiter will use default max - // delay of 120 seconds. Note that MaxDelay must resolve to value greater than or - // equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSecurityGroupVpcAssociationsInput, *DescribeSecurityGroupVpcAssociationsOutput, error) (bool, error) -} - -// SecurityGroupVpcAssociationDisassociatedWaiter defines the waiters for -// SecurityGroupVpcAssociationDisassociated -type SecurityGroupVpcAssociationDisassociatedWaiter struct { - client DescribeSecurityGroupVpcAssociationsAPIClient - - options SecurityGroupVpcAssociationDisassociatedWaiterOptions -} - -// NewSecurityGroupVpcAssociationDisassociatedWaiter constructs a -// SecurityGroupVpcAssociationDisassociatedWaiter. -func NewSecurityGroupVpcAssociationDisassociatedWaiter(client DescribeSecurityGroupVpcAssociationsAPIClient, optFns ...func(*SecurityGroupVpcAssociationDisassociatedWaiterOptions)) *SecurityGroupVpcAssociationDisassociatedWaiter { - options := SecurityGroupVpcAssociationDisassociatedWaiterOptions{} - options.MinDelay = 10 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = securityGroupVpcAssociationDisassociatedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SecurityGroupVpcAssociationDisassociatedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SecurityGroupVpcAssociationDisassociated -// waiter. The maxWaitDur is the maximum wait duration the waiter will wait. The -// maxWaitDur is required and must be greater than zero. -func (w *SecurityGroupVpcAssociationDisassociatedWaiter) Wait(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupVpcAssociationDisassociatedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for -// SecurityGroupVpcAssociationDisassociated waiter and returns the output of the -// successful operation. The maxWaitDur is the maximum wait duration the waiter -// will wait. The maxWaitDur is required and must be greater than zero. -func (w *SecurityGroupVpcAssociationDisassociatedWaiter) WaitForOutput(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupVpcAssociationDisassociatedWaiterOptions)) (*DescribeSecurityGroupVpcAssociationsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSecurityGroupVpcAssociations(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SecurityGroupVpcAssociationDisassociated waiter") -} - -func securityGroupVpcAssociationDisassociatedStateRetryable(ctx context.Context, input *DescribeSecurityGroupVpcAssociationsInput, output *DescribeSecurityGroupVpcAssociationsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "disassociated" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "disassociating" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return true, nil - } - } - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - var v2 []types.SecurityGroupVpcAssociationState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "disassociation-failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.SecurityGroupVpcAssociations - v2 := len(v1) - v3 := 0 - v4 := int64(v2) == int64(v3) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v4 == bv { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeSecurityGroupVpcAssociationsPaginatorOptions is the paginator options -// for DescribeSecurityGroupVpcAssociations -type DescribeSecurityGroupVpcAssociationsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSecurityGroupVpcAssociationsPaginator is a paginator for -// DescribeSecurityGroupVpcAssociations -type DescribeSecurityGroupVpcAssociationsPaginator struct { - options DescribeSecurityGroupVpcAssociationsPaginatorOptions - client DescribeSecurityGroupVpcAssociationsAPIClient - params *DescribeSecurityGroupVpcAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeSecurityGroupVpcAssociationsPaginator returns a new -// DescribeSecurityGroupVpcAssociationsPaginator -func NewDescribeSecurityGroupVpcAssociationsPaginator(client DescribeSecurityGroupVpcAssociationsAPIClient, params *DescribeSecurityGroupVpcAssociationsInput, optFns ...func(*DescribeSecurityGroupVpcAssociationsPaginatorOptions)) *DescribeSecurityGroupVpcAssociationsPaginator { - if params == nil { - params = &DescribeSecurityGroupVpcAssociationsInput{} - } - - options := DescribeSecurityGroupVpcAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSecurityGroupVpcAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSecurityGroupVpcAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSecurityGroupVpcAssociations page. -func (p *DescribeSecurityGroupVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSecurityGroupVpcAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSecurityGroupVpcAssociationsAPIClient is a client that implements the -// DescribeSecurityGroupVpcAssociations operation. -type DescribeSecurityGroupVpcAssociationsAPIClient interface { - DescribeSecurityGroupVpcAssociations(context.Context, *DescribeSecurityGroupVpcAssociationsInput, ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, error) -} - -var _ DescribeSecurityGroupVpcAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSecurityGroupVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSecurityGroupVpcAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroups.go deleted file mode 100644 index d2df992bc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSecurityGroups.go +++ /dev/null @@ -1,569 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Describes the specified security groups or all of your security groups. -func (c *Client) DescribeSecurityGroups(ctx context.Context, params *DescribeSecurityGroupsInput, optFns ...func(*Options)) (*DescribeSecurityGroupsOutput, error) { - if params == nil { - params = &DescribeSecurityGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityGroups", params, optFns, c.addOperationDescribeSecurityGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSecurityGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSecurityGroupsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. If using multiple filters for rules, the results include security - // groups for which any combination of rules - not necessarily a single rule - - // match all filters. - // - // - description - The description of the security group. - // - // - egress.ip-permission.cidr - An IPv4 CIDR block for an outbound security - // group rule. - // - // - egress.ip-permission.from-port - For an outbound rule, the start of port - // range for the TCP and UDP protocols, or an ICMP type number. - // - // - egress.ip-permission.group-id - The ID of a security group that has been - // referenced in an outbound security group rule. - // - // - egress.ip-permission.group-name - The name of a security group that is - // referenced in an outbound security group rule. - // - // - egress.ip-permission.ipv6-cidr - An IPv6 CIDR block for an outbound security - // group rule. - // - // - egress.ip-permission.prefix-list-id - The ID of a prefix list to which a - // security group rule allows outbound access. - // - // - egress.ip-permission.protocol - The IP protocol for an outbound security - // group rule ( tcp | udp | icmp , a protocol number, or -1 for all protocols). - // - // - egress.ip-permission.to-port - For an outbound rule, the end of port range - // for the TCP and UDP protocols, or an ICMP code. - // - // - egress.ip-permission.user-id - The ID of an Amazon Web Services account that - // has been referenced in an outbound security group rule. - // - // - group-id - The ID of the security group. - // - // - group-name - The name of the security group. - // - // - ip-permission.cidr - An IPv4 CIDR block for an inbound security group rule. - // - // - ip-permission.from-port - For an inbound rule, the start of port range for - // the TCP and UDP protocols, or an ICMP type number. - // - // - ip-permission.group-id - The ID of a security group that has been referenced - // in an inbound security group rule. - // - // - ip-permission.group-name - The name of a security group that is referenced - // in an inbound security group rule. - // - // - ip-permission.ipv6-cidr - An IPv6 CIDR block for an inbound security group - // rule. - // - // - ip-permission.prefix-list-id - The ID of a prefix list from which a security - // group rule allows inbound access. - // - // - ip-permission.protocol - The IP protocol for an inbound security group rule ( - // tcp | udp | icmp , a protocol number, or -1 for all protocols). - // - // - ip-permission.to-port - For an inbound rule, the end of port range for the - // TCP and UDP protocols, or an ICMP code. - // - // - ip-permission.user-id - The ID of an Amazon Web Services account that has - // been referenced in an inbound security group rule. - // - // - owner-id - The Amazon Web Services account ID of the owner of the security - // group. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC specified when the security group was created. - Filters []types.Filter - - // The IDs of the security groups. Required for security groups in a nondefault - // VPC. - // - // Default: Describes all of your security groups. - GroupIds []string - - // [Default VPC] The names of the security groups. You can specify either the - // security group name or the security group ID. - // - // Default: Describes all of your security groups. - GroupNames []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. This value - // can be between 5 and 1000. If this parameter is not specified, then all items - // are returned. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeSecurityGroupsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the security groups. - SecurityGroups []types.SecurityGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSecurityGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSecurityGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSecurityGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecurityGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SecurityGroupExistsWaiterOptions are waiter options for -// SecurityGroupExistsWaiter -type SecurityGroupExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SecurityGroupExistsWaiter will use default minimum delay of 5 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SecurityGroupExistsWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSecurityGroupsInput, *DescribeSecurityGroupsOutput, error) (bool, error) -} - -// SecurityGroupExistsWaiter defines the waiters for SecurityGroupExists -type SecurityGroupExistsWaiter struct { - client DescribeSecurityGroupsAPIClient - - options SecurityGroupExistsWaiterOptions -} - -// NewSecurityGroupExistsWaiter constructs a SecurityGroupExistsWaiter. -func NewSecurityGroupExistsWaiter(client DescribeSecurityGroupsAPIClient, optFns ...func(*SecurityGroupExistsWaiterOptions)) *SecurityGroupExistsWaiter { - options := SecurityGroupExistsWaiterOptions{} - options.MinDelay = 5 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = securityGroupExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SecurityGroupExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SecurityGroupExists waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *SecurityGroupExistsWaiter) Wait(ctx context.Context, params *DescribeSecurityGroupsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SecurityGroupExists waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *SecurityGroupExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeSecurityGroupsInput, maxWaitDur time.Duration, optFns ...func(*SecurityGroupExistsWaiterOptions)) (*DescribeSecurityGroupsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSecurityGroups(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SecurityGroupExists waiter") -} - -func securityGroupExistsStateRetryable(ctx context.Context, input *DescribeSecurityGroupsInput, output *DescribeSecurityGroupsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.SecurityGroups - var v2 []string - for _, v := range v1 { - v3 := v.GroupId - if v3 != nil { - v2 = append(v2, *v3) - } - } - v4 := len(v2) - v5 := 0 - v6 := int64(v4) > int64(v5) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v6 == bv { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidGroup.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeSecurityGroupsPaginatorOptions is the paginator options for -// DescribeSecurityGroups -type DescribeSecurityGroupsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. This value - // can be between 5 and 1000. If this parameter is not specified, then all items - // are returned. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSecurityGroupsPaginator is a paginator for DescribeSecurityGroups -type DescribeSecurityGroupsPaginator struct { - options DescribeSecurityGroupsPaginatorOptions - client DescribeSecurityGroupsAPIClient - params *DescribeSecurityGroupsInput - nextToken *string - firstPage bool -} - -// NewDescribeSecurityGroupsPaginator returns a new DescribeSecurityGroupsPaginator -func NewDescribeSecurityGroupsPaginator(client DescribeSecurityGroupsAPIClient, params *DescribeSecurityGroupsInput, optFns ...func(*DescribeSecurityGroupsPaginatorOptions)) *DescribeSecurityGroupsPaginator { - if params == nil { - params = &DescribeSecurityGroupsInput{} - } - - options := DescribeSecurityGroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSecurityGroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSecurityGroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSecurityGroups page. -func (p *DescribeSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSecurityGroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSecurityGroupsAPIClient is a client that implements the -// DescribeSecurityGroups operation. -type DescribeSecurityGroupsAPIClient interface { - DescribeSecurityGroups(context.Context, *DescribeSecurityGroupsInput, ...func(*Options)) (*DescribeSecurityGroupsOutput, error) -} - -var _ DescribeSecurityGroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSecurityGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeServiceLinkVirtualInterfaces.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeServiceLinkVirtualInterfaces.go deleted file mode 100644 index 5c7bd7a46..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeServiceLinkVirtualInterfaces.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the Outpost service link virtual interfaces. -func (c *Client) DescribeServiceLinkVirtualInterfaces(ctx context.Context, params *DescribeServiceLinkVirtualInterfacesInput, optFns ...func(*Options)) (*DescribeServiceLinkVirtualInterfacesOutput, error) { - if params == nil { - params = &DescribeServiceLinkVirtualInterfacesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeServiceLinkVirtualInterfaces", params, optFns, c.addOperationDescribeServiceLinkVirtualInterfacesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeServiceLinkVirtualInterfacesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeServiceLinkVirtualInterfacesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters to use for narrowing down the request. The following filters are - // supported: - // - // - outpost-lag-id - The ID of the Outpost LAG. - // - // - outpost-arn - The Outpost ARN. - // - // - owner-id - The ID of the Amazon Web Services account that owns the service - // link virtual interface. - // - // - state - The state of the Outpost LAG. - // - // - vlan - The ID of the address pool. - // - // - service-link-virtual-interface-id - The ID of the service link virtual - // interface. - // - // - local-gateway-virtual-interface-id - The ID of the local gateway virtual - // interface. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the service link virtual interfaces. - ServiceLinkVirtualInterfaceIds []string - - noSmithyDocumentSerde -} - -type DescribeServiceLinkVirtualInterfacesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Describes the service link virtual interfaces. - ServiceLinkVirtualInterfaces []types.ServiceLinkVirtualInterface - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeServiceLinkVirtualInterfacesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeServiceLinkVirtualInterfaces{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeServiceLinkVirtualInterfaces{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeServiceLinkVirtualInterfaces"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeServiceLinkVirtualInterfaces(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeServiceLinkVirtualInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeServiceLinkVirtualInterfaces", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotAttribute.go deleted file mode 100644 index c602e5ee9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotAttribute.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified snapshot. You can specify -// only one attribute at a time. -// -// For more information about EBS snapshots, see [Amazon EBS snapshots] in the Amazon EBS User Guide. -// -// [Amazon EBS snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html -func (c *Client) DescribeSnapshotAttribute(ctx context.Context, params *DescribeSnapshotAttributeInput, optFns ...func(*Options)) (*DescribeSnapshotAttributeOutput, error) { - if params == nil { - params = &DescribeSnapshotAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSnapshotAttribute", params, optFns, c.addOperationDescribeSnapshotAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSnapshotAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSnapshotAttributeInput struct { - - // The snapshot attribute you would like to view. - // - // This member is required. - Attribute types.SnapshotAttributeName - - // The ID of the EBS snapshot. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeSnapshotAttributeOutput struct { - - // The users and groups that have the permissions for creating volumes from the - // snapshot. - CreateVolumePermissions []types.CreateVolumePermission - - // The product codes. - ProductCodes []types.ProductCode - - // The ID of the EBS snapshot. - SnapshotId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSnapshotAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeSnapshotAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSnapshotAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeSnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSnapshotAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotTierStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotTierStatus.go deleted file mode 100644 index 01e185f0f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshotTierStatus.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the storage tier status of one or more Amazon EBS snapshots. -func (c *Client) DescribeSnapshotTierStatus(ctx context.Context, params *DescribeSnapshotTierStatusInput, optFns ...func(*Options)) (*DescribeSnapshotTierStatusOutput, error) { - if params == nil { - params = &DescribeSnapshotTierStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSnapshotTierStatus", params, optFns, c.addOperationDescribeSnapshotTierStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSnapshotTierStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSnapshotTierStatusInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - snapshot-id - The snapshot ID. - // - // - volume-id - The ID of the volume the snapshot is for. - // - // - last-tiering-operation - The state of the last archive or restore action. ( - // archival-in-progress | archival-completed | archival-failed | - // permanent-restore-in-progress | permanent-restore-completed | - // permanent-restore-failed | temporary-restore-in-progress | - // temporary-restore-completed | temporary-restore-failed ) - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeSnapshotTierStatusOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the snapshot's storage tier. - SnapshotTierStatuses []types.SnapshotTierStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSnapshotTierStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSnapshotTierStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSnapshotTierStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSnapshotTierStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSnapshotTierStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeSnapshotTierStatusPaginatorOptions is the paginator options for -// DescribeSnapshotTierStatus -type DescribeSnapshotTierStatusPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSnapshotTierStatusPaginator is a paginator for -// DescribeSnapshotTierStatus -type DescribeSnapshotTierStatusPaginator struct { - options DescribeSnapshotTierStatusPaginatorOptions - client DescribeSnapshotTierStatusAPIClient - params *DescribeSnapshotTierStatusInput - nextToken *string - firstPage bool -} - -// NewDescribeSnapshotTierStatusPaginator returns a new -// DescribeSnapshotTierStatusPaginator -func NewDescribeSnapshotTierStatusPaginator(client DescribeSnapshotTierStatusAPIClient, params *DescribeSnapshotTierStatusInput, optFns ...func(*DescribeSnapshotTierStatusPaginatorOptions)) *DescribeSnapshotTierStatusPaginator { - if params == nil { - params = &DescribeSnapshotTierStatusInput{} - } - - options := DescribeSnapshotTierStatusPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSnapshotTierStatusPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSnapshotTierStatusPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSnapshotTierStatus page. -func (p *DescribeSnapshotTierStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotTierStatusOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSnapshotTierStatus(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSnapshotTierStatusAPIClient is a client that implements the -// DescribeSnapshotTierStatus operation. -type DescribeSnapshotTierStatusAPIClient interface { - DescribeSnapshotTierStatus(context.Context, *DescribeSnapshotTierStatusInput, ...func(*Options)) (*DescribeSnapshotTierStatusOutput, error) -} - -var _ DescribeSnapshotTierStatusAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSnapshotTierStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSnapshotTierStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshots.go deleted file mode 100644 index 7616f534c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSnapshots.go +++ /dev/null @@ -1,584 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified EBS snapshots available to you or all of the EBS -// snapshots available to you. -// -// The snapshots available to you include public snapshots, private snapshots that -// you own, and private snapshots owned by other Amazon Web Services accounts for -// which you have explicit create volume permissions. -// -// The create volume permissions fall into the following categories: -// -// - public: The owner of the snapshot granted create volume permissions for the -// snapshot to the all group. All Amazon Web Services accounts have create volume -// permissions for these snapshots. -// -// - explicit: The owner of the snapshot granted create volume permissions to a -// specific Amazon Web Services account. -// -// - implicit: An Amazon Web Services account has implicit create volume -// permissions for all snapshots it owns. -// -// The list of snapshots returned can be filtered by specifying snapshot IDs, -// snapshot owners, or Amazon Web Services accounts with create volume permissions. -// If no options are specified, Amazon EC2 returns all snapshots for which you have -// create volume permissions. -// -// If you specify one or more snapshot IDs, only snapshots that have the specified -// IDs are returned. If you specify an invalid snapshot ID, an error is returned. -// If you specify a snapshot ID for which you do not have access, it is not -// included in the returned results. -// -// If you specify one or more snapshot owners using the OwnerIds option, only -// snapshots from the specified owners and for which you have access are returned. -// The results can include the Amazon Web Services account IDs of the specified -// owners, amazon for snapshots owned by Amazon, or self for snapshots that you -// own. -// -// If you specify a list of restorable users, only snapshots with create snapshot -// permissions for those users are returned. You can specify Amazon Web Services -// account IDs (if you own the snapshots), self for snapshots for which you own or -// have explicit permissions, or all for public snapshots. -// -// If you are describing a long list of snapshots, we recommend that you paginate -// the output to make the list more manageable. For more information, see [Pagination]. -// -// To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores. -// -// For more information about EBS snapshots, see [Amazon EBS snapshots] in the Amazon EBS User Guide. -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -// -// [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination -// [Amazon EBS snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html -func (c *Client) DescribeSnapshots(ctx context.Context, params *DescribeSnapshotsInput, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { - if params == nil { - params = &DescribeSnapshotsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSnapshots", params, optFns, c.addOperationDescribeSnapshotsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSnapshotsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSnapshotsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - description - A description of the snapshot. - // - // - encrypted - Indicates whether the snapshot is encrypted ( true | false ) - // - // - owner-alias - The owner alias, from an Amazon-maintained list ( amazon ). - // This is not the user-configured Amazon Web Services account alias set using the - // IAM console. We recommend that you use the related parameter instead of this - // filter. - // - // - owner-id - The Amazon Web Services account ID of the owner. We recommend - // that you use the related parameter instead of this filter. - // - // - progress - The progress of the snapshot, as a percentage (for example, 80%). - // - // - snapshot-id - The snapshot ID. - // - // - start-time - The time stamp when the snapshot was initiated. - // - // - status - The status of the snapshot ( pending | completed | error ). - // - // - storage-tier - The storage tier of the snapshot ( archive | standard ). - // - // - transfer-type - The type of operation used to create the snapshot ( - // time-based | standard ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - volume-id - The ID of the volume the snapshot is for. - // - // - volume-size - The size of the volume, in GiB. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // Scopes the results to snapshots with the specified owners. You can specify a - // combination of Amazon Web Services account IDs, self , and amazon . - OwnerIds []string - - // The IDs of the Amazon Web Services accounts that can create volumes from the - // snapshot. - RestorableByUserIds []string - - // The snapshot IDs. - // - // Default: Describes the snapshots for which you have create volume permissions. - SnapshotIds []string - - noSmithyDocumentSerde -} - -type DescribeSnapshotsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the snapshots. - Snapshots []types.Snapshot - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSnapshots{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSnapshots{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSnapshots"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSnapshots(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SnapshotCompletedWaiterOptions are waiter options for SnapshotCompletedWaiter -type SnapshotCompletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SnapshotCompletedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SnapshotCompletedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSnapshotsInput, *DescribeSnapshotsOutput, error) (bool, error) -} - -// SnapshotCompletedWaiter defines the waiters for SnapshotCompleted -type SnapshotCompletedWaiter struct { - client DescribeSnapshotsAPIClient - - options SnapshotCompletedWaiterOptions -} - -// NewSnapshotCompletedWaiter constructs a SnapshotCompletedWaiter. -func NewSnapshotCompletedWaiter(client DescribeSnapshotsAPIClient, optFns ...func(*SnapshotCompletedWaiterOptions)) *SnapshotCompletedWaiter { - options := SnapshotCompletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = snapshotCompletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SnapshotCompletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SnapshotCompleted waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *SnapshotCompletedWaiter) Wait(ctx context.Context, params *DescribeSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*SnapshotCompletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SnapshotCompleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *SnapshotCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*SnapshotCompletedWaiterOptions)) (*DescribeSnapshotsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSnapshots(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SnapshotCompleted waiter") -} - -func snapshotCompletedStateRetryable(ctx context.Context, input *DescribeSnapshotsInput, output *DescribeSnapshotsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Snapshots - var v2 []types.SnapshotState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "completed" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Snapshots - var v2 []types.SnapshotState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "error" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeSnapshotsPaginatorOptions is the paginator options for DescribeSnapshots -type DescribeSnapshotsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSnapshotsPaginator is a paginator for DescribeSnapshots -type DescribeSnapshotsPaginator struct { - options DescribeSnapshotsPaginatorOptions - client DescribeSnapshotsAPIClient - params *DescribeSnapshotsInput - nextToken *string - firstPage bool -} - -// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator -func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { - if params == nil { - params = &DescribeSnapshotsInput{} - } - - options := DescribeSnapshotsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSnapshotsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSnapshotsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSnapshots page. -func (p *DescribeSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSnapshots(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSnapshotsAPIClient is a client that implements the DescribeSnapshots -// operation. -type DescribeSnapshotsAPIClient interface { - DescribeSnapshots(context.Context, *DescribeSnapshotsInput, ...func(*Options)) (*DescribeSnapshotsOutput, error) -} - -var _ DescribeSnapshotsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSnapshots", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotDatafeedSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotDatafeedSubscription.go deleted file mode 100644 index 67132b123..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotDatafeedSubscription.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the data feed for Spot Instances. For more information, see [Spot Instance data feed] in the -// Amazon EC2 User Guide. -// -// [Spot Instance data feed]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html -func (c *Client) DescribeSpotDatafeedSubscription(ctx context.Context, params *DescribeSpotDatafeedSubscriptionInput, optFns ...func(*Options)) (*DescribeSpotDatafeedSubscriptionOutput, error) { - if params == nil { - params = &DescribeSpotDatafeedSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotDatafeedSubscription", params, optFns, c.addOperationDescribeSpotDatafeedSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotDatafeedSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotDatafeedSubscription. -type DescribeSpotDatafeedSubscriptionInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotDatafeedSubscription. -type DescribeSpotDatafeedSubscriptionOutput struct { - - // The Spot Instance data feed subscription. - SpotDatafeedSubscription *types.SpotDatafeedSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotDatafeedSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotDatafeedSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotDatafeedSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotDatafeedSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeSpotDatafeedSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotDatafeedSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetInstances.go deleted file mode 100644 index 35e558b2a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetInstances.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the running instances for the specified Spot Fleet. -func (c *Client) DescribeSpotFleetInstances(ctx context.Context, params *DescribeSpotFleetInstancesInput, optFns ...func(*Options)) (*DescribeSpotFleetInstancesOutput, error) { - if params == nil { - params = &DescribeSpotFleetInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotFleetInstances", params, optFns, c.addOperationDescribeSpotFleetInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotFleetInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotFleetInstances. -type DescribeSpotFleetInstancesInput struct { - - // The ID of the Spot Fleet request. - // - // This member is required. - SpotFleetRequestId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotFleetInstances. -type DescribeSpotFleetInstancesOutput struct { - - // The running instances. This list is refreshed periodically and might be out of - // date. - ActiveInstances []types.ActiveInstance - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotFleetInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotFleetInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotFleetInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotFleetInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeSpotFleetInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotFleetInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeSpotFleetInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotFleetInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequestHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequestHistory.go deleted file mode 100644 index 8a72bb8b2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequestHistory.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes the events for the specified Spot Fleet request during the specified -// time. -// -// Spot Fleet events are delayed by up to 30 seconds before they can be described. -// This ensures that you can query by the last evaluated time and not miss a -// recorded event. Spot Fleet events are available for 48 hours. -// -// For more information, see [Monitor fleet events using Amazon EventBridge] in the Amazon EC2 User Guide. -// -// [Monitor fleet events using Amazon EventBridge]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/fleet-monitor.html -func (c *Client) DescribeSpotFleetRequestHistory(ctx context.Context, params *DescribeSpotFleetRequestHistoryInput, optFns ...func(*Options)) (*DescribeSpotFleetRequestHistoryOutput, error) { - if params == nil { - params = &DescribeSpotFleetRequestHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotFleetRequestHistory", params, optFns, c.addOperationDescribeSpotFleetRequestHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotFleetRequestHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotFleetRequestHistory. -type DescribeSpotFleetRequestHistoryInput struct { - - // The ID of the Spot Fleet request. - // - // This member is required. - SpotFleetRequestId *string - - // The starting date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - // - // This member is required. - StartTime *time.Time - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The type of events to describe. By default, all events are described. - EventType types.EventType - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotFleetRequestHistory. -type DescribeSpotFleetRequestHistoryOutput struct { - - // Information about the events in the history of the Spot Fleet request. - HistoryRecords []types.HistoryRecord - - // The last date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). All records up to this time were retrieved. - // - // If nextToken indicates that there are more items, this value is not present. - LastEvaluatedTime *time.Time - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - // The starting date and time for the events, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotFleetRequestHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotFleetRequestHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotFleetRequestHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotFleetRequestHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeSpotFleetRequestHistoryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotFleetRequestHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeSpotFleetRequestHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotFleetRequestHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequests.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequests.go deleted file mode 100644 index b97954c79..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotFleetRequests.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your Spot Fleet requests. -// -// Spot Fleet requests are deleted 48 hours after they are canceled and their -// instances are terminated. -func (c *Client) DescribeSpotFleetRequests(ctx context.Context, params *DescribeSpotFleetRequestsInput, optFns ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) { - if params == nil { - params = &DescribeSpotFleetRequestsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotFleetRequests", params, optFns, c.addOperationDescribeSpotFleetRequestsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotFleetRequestsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotFleetRequests. -type DescribeSpotFleetRequestsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The IDs of the Spot Fleet requests. - SpotFleetRequestIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotFleetRequests. -type DescribeSpotFleetRequestsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the configuration of your Spot Fleet. - SpotFleetRequestConfigs []types.SpotFleetRequestConfig - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotFleetRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotFleetRequests{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotFleetRequests{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotFleetRequests"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotFleetRequests(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeSpotFleetRequestsPaginatorOptions is the paginator options for -// DescribeSpotFleetRequests -type DescribeSpotFleetRequestsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSpotFleetRequestsPaginator is a paginator for DescribeSpotFleetRequests -type DescribeSpotFleetRequestsPaginator struct { - options DescribeSpotFleetRequestsPaginatorOptions - client DescribeSpotFleetRequestsAPIClient - params *DescribeSpotFleetRequestsInput - nextToken *string - firstPage bool -} - -// NewDescribeSpotFleetRequestsPaginator returns a new -// DescribeSpotFleetRequestsPaginator -func NewDescribeSpotFleetRequestsPaginator(client DescribeSpotFleetRequestsAPIClient, params *DescribeSpotFleetRequestsInput, optFns ...func(*DescribeSpotFleetRequestsPaginatorOptions)) *DescribeSpotFleetRequestsPaginator { - if params == nil { - params = &DescribeSpotFleetRequestsInput{} - } - - options := DescribeSpotFleetRequestsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSpotFleetRequestsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSpotFleetRequestsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSpotFleetRequests page. -func (p *DescribeSpotFleetRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSpotFleetRequests(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSpotFleetRequestsAPIClient is a client that implements the -// DescribeSpotFleetRequests operation. -type DescribeSpotFleetRequestsAPIClient interface { - DescribeSpotFleetRequests(context.Context, *DescribeSpotFleetRequestsInput, ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) -} - -var _ DescribeSpotFleetRequestsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSpotFleetRequests(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotFleetRequests", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotInstanceRequests.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotInstanceRequests.go deleted file mode 100644 index 01c017919..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotInstanceRequests.go +++ /dev/null @@ -1,756 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified Spot Instance requests. -// -// You can use DescribeSpotInstanceRequests to find a running Spot Instance by -// examining the response. If the status of the Spot Instance is fulfilled , the -// instance ID appears in the response and contains the identifier of the instance. -// Alternatively, you can use [DescribeInstances]with a filter to look for instances where the -// instance lifecycle is spot . -// -// We recommend that you set MaxResults to a value between 5 and 1000 to limit the -// number of items returned. This paginates the output, which makes the list more -// manageable and returns the items faster. If the list of items exceeds your -// MaxResults value, then that number of items is returned along with a NextToken -// value that can be passed to a subsequent DescribeSpotInstanceRequests request -// to retrieve the remaining items. -// -// Spot Instance requests are deleted four hours after they are canceled and their -// instances are terminated. -// -// [DescribeInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances -func (c *Client) DescribeSpotInstanceRequests(ctx context.Context, params *DescribeSpotInstanceRequestsInput, optFns ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) { - if params == nil { - params = &DescribeSpotInstanceRequestsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotInstanceRequests", params, optFns, c.addOperationDescribeSpotInstanceRequestsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotInstanceRequestsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotInstanceRequests. -type DescribeSpotInstanceRequestsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone-group - The Availability Zone group. - // - // - create-time - The time stamp when the Spot Instance request was created. - // - // - fault-code - The fault code related to the request. - // - // - fault-message - The fault message related to the request. - // - // - instance-id - The ID of the instance that fulfilled the request. - // - // - launch-group - The Spot Instance launch group. - // - // - launch.block-device-mapping.delete-on-termination - Indicates whether the - // EBS volume is deleted on instance termination. - // - // - launch.block-device-mapping.device-name - The device name for the volume in - // the block device mapping (for example, /dev/sdh or xvdh ). - // - // - launch.block-device-mapping.snapshot-id - The ID of the snapshot for the EBS - // volume. - // - // - launch.block-device-mapping.volume-size - The size of the EBS volume, in GiB. - // - // - launch.block-device-mapping.volume-type - The type of EBS volume: gp2 or gp3 - // for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for - // Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic. - // - // - launch.group-id - The ID of the security group for the instance. - // - // - launch.group-name - The name of the security group for the instance. - // - // - launch.image-id - The ID of the AMI. - // - // - launch.instance-type - The type of instance (for example, m3.medium ). - // - // - launch.kernel-id - The kernel ID. - // - // - launch.key-name - The name of the key pair the instance launched with. - // - // - launch.monitoring-enabled - Whether detailed monitoring is enabled for the - // Spot Instance. - // - // - launch.ramdisk-id - The RAM disk ID. - // - // - launched-availability-zone - The Availability Zone in which the request is - // launched. - // - // - network-interface.addresses.primary - Indicates whether the IP address is - // the primary private IP address. - // - // - network-interface.delete-on-termination - Indicates whether the network - // interface is deleted when the instance is terminated. - // - // - network-interface.description - A description of the network interface. - // - // - network-interface.device-index - The index of the device for the network - // interface attachment on the instance. - // - // - network-interface.group-id - The ID of the security group associated with - // the network interface. - // - // - network-interface.network-interface-id - The ID of the network interface. - // - // - network-interface.private-ip-address - The primary private IP address of the - // network interface. - // - // - network-interface.subnet-id - The ID of the subnet for the instance. - // - // - product-description - The product description associated with the instance ( - // Linux/UNIX | Windows ). - // - // - spot-instance-request-id - The Spot Instance request ID. - // - // - spot-price - The maximum hourly price for any Spot Instance launched to - // fulfill the request. - // - // - state - The state of the Spot Instance request ( open | active | closed | - // cancelled | failed ). Spot request status information can help you track your - // Amazon EC2 Spot Instance requests. For more information, see [Spot request status]in the Amazon - // EC2 User Guide. - // - // - status-code - The short code describing the most recent evaluation of your - // Spot Instance request. - // - // - status-message - The message explaining the status of the Spot Instance - // request. - // - // - tag: - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - type - The type of Spot Instance request ( one-time | persistent ). - // - // - valid-from - The start date of the request. - // - // - valid-until - The end date of the request. - // - // [Spot request status]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the Spot Instance requests. - SpotInstanceRequestIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotInstanceRequests. -type DescribeSpotInstanceRequestsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The Spot Instance requests. - SpotInstanceRequests []types.SpotInstanceRequest - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotInstanceRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotInstanceRequests{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotInstanceRequests{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotInstanceRequests"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotInstanceRequests(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SpotInstanceRequestFulfilledWaiterOptions are waiter options for -// SpotInstanceRequestFulfilledWaiter -type SpotInstanceRequestFulfilledWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SpotInstanceRequestFulfilledWaiter will use default minimum delay of 15 seconds. - // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SpotInstanceRequestFulfilledWaiter will use default max delay of - // 120 seconds. Note that MaxDelay must resolve to value greater than or equal to - // the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSpotInstanceRequestsInput, *DescribeSpotInstanceRequestsOutput, error) (bool, error) -} - -// SpotInstanceRequestFulfilledWaiter defines the waiters for -// SpotInstanceRequestFulfilled -type SpotInstanceRequestFulfilledWaiter struct { - client DescribeSpotInstanceRequestsAPIClient - - options SpotInstanceRequestFulfilledWaiterOptions -} - -// NewSpotInstanceRequestFulfilledWaiter constructs a -// SpotInstanceRequestFulfilledWaiter. -func NewSpotInstanceRequestFulfilledWaiter(client DescribeSpotInstanceRequestsAPIClient, optFns ...func(*SpotInstanceRequestFulfilledWaiterOptions)) *SpotInstanceRequestFulfilledWaiter { - options := SpotInstanceRequestFulfilledWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = spotInstanceRequestFulfilledStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SpotInstanceRequestFulfilledWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SpotInstanceRequestFulfilled waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *SpotInstanceRequestFulfilledWaiter) Wait(ctx context.Context, params *DescribeSpotInstanceRequestsInput, maxWaitDur time.Duration, optFns ...func(*SpotInstanceRequestFulfilledWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SpotInstanceRequestFulfilled waiter -// and returns the output of the successful operation. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *SpotInstanceRequestFulfilledWaiter) WaitForOutput(ctx context.Context, params *DescribeSpotInstanceRequestsInput, maxWaitDur time.Duration, optFns ...func(*SpotInstanceRequestFulfilledWaiterOptions)) (*DescribeSpotInstanceRequestsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSpotInstanceRequests(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SpotInstanceRequestFulfilled waiter") -} - -func spotInstanceRequestFulfilledStateRetryable(ctx context.Context, input *DescribeSpotInstanceRequestsInput, output *DescribeSpotInstanceRequestsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "fulfilled" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "request-canceled-and-instance-running" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "schedule-expired" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "canceled-before-fulfillment" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "bad-parameters" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.SpotInstanceRequests - var v2 []string - for _, v := range v1 { - v3 := v.Status - var v4 *string - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - if v4 != nil { - v2 = append(v2, *v4) - } - } - expectedValue := "system-error" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidSpotInstanceRequestID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeSpotInstanceRequestsPaginatorOptions is the paginator options for -// DescribeSpotInstanceRequests -type DescribeSpotInstanceRequestsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSpotInstanceRequestsPaginator is a paginator for -// DescribeSpotInstanceRequests -type DescribeSpotInstanceRequestsPaginator struct { - options DescribeSpotInstanceRequestsPaginatorOptions - client DescribeSpotInstanceRequestsAPIClient - params *DescribeSpotInstanceRequestsInput - nextToken *string - firstPage bool -} - -// NewDescribeSpotInstanceRequestsPaginator returns a new -// DescribeSpotInstanceRequestsPaginator -func NewDescribeSpotInstanceRequestsPaginator(client DescribeSpotInstanceRequestsAPIClient, params *DescribeSpotInstanceRequestsInput, optFns ...func(*DescribeSpotInstanceRequestsPaginatorOptions)) *DescribeSpotInstanceRequestsPaginator { - if params == nil { - params = &DescribeSpotInstanceRequestsInput{} - } - - options := DescribeSpotInstanceRequestsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSpotInstanceRequestsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSpotInstanceRequestsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSpotInstanceRequests page. -func (p *DescribeSpotInstanceRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSpotInstanceRequests(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSpotInstanceRequestsAPIClient is a client that implements the -// DescribeSpotInstanceRequests operation. -type DescribeSpotInstanceRequestsAPIClient interface { - DescribeSpotInstanceRequests(context.Context, *DescribeSpotInstanceRequestsInput, ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) -} - -var _ DescribeSpotInstanceRequestsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSpotInstanceRequests(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotInstanceRequests", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotPriceHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotPriceHistory.go deleted file mode 100644 index fe8400c64..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSpotPriceHistory.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Describes the Spot price history. For more information, see [Spot Instance pricing history] in the Amazon EC2 -// User Guide. -// -// When you specify a start and end time, the operation returns the prices of the -// instance types within that time range. It also returns the last price change -// before the start time, which is the effective price as of the start time. -// -// [Spot Instance pricing history]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html -func (c *Client) DescribeSpotPriceHistory(ctx context.Context, params *DescribeSpotPriceHistoryInput, optFns ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) { - if params == nil { - params = &DescribeSpotPriceHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSpotPriceHistory", params, optFns, c.addOperationDescribeSpotPriceHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSpotPriceHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeSpotPriceHistory. -type DescribeSpotPriceHistoryInput struct { - - // Filters the results by the specified Availability Zone. - AvailabilityZone *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The date and time, up to the current date, from which to stop retrieving the - // price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - EndTime *time.Time - - // The filters. - // - // - availability-zone - The Availability Zone for which prices should be - // returned. - // - // - instance-type - The type of instance (for example, m3.medium ). - // - // - product-description - The product description for the Spot price ( Linux/UNIX - // | Red Hat Enterprise Linux | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | - // Red Hat Enterprise Linux (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows - // (Amazon VPC) ). - // - // - spot-price - The Spot price. The value must match exactly (or use wildcards; - // greater than or less than comparison is not supported). - // - // - timestamp - The time stamp of the Spot price history, in UTC format (for - // example, ddd MMM dd HH:mm:ss UTC YYYY). You can use wildcards ( * and ? ). - // Greater than or less than comparison is not supported. - Filters []types.Filter - - // Filters the results by the specified instance types. - InstanceTypes []types.InstanceType - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // Filters the results by the specified basic product descriptions. - ProductDescriptions []string - - // The date and time, up to the past 90 days, from which to start retrieving the - // price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time - - noSmithyDocumentSerde -} - -// Contains the output of DescribeSpotPriceHistory. -type DescribeSpotPriceHistoryOutput struct { - - // The token to include in another request to get the next page of items. This - // value is an empty string ( "" ) or null when there are no more items to return. - NextToken *string - - // The historical Spot prices. - SpotPriceHistory []types.SpotPrice - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSpotPriceHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSpotPriceHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSpotPriceHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSpotPriceHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpotPriceHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeSpotPriceHistoryPaginatorOptions is the paginator options for -// DescribeSpotPriceHistory -type DescribeSpotPriceHistoryPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSpotPriceHistoryPaginator is a paginator for DescribeSpotPriceHistory -type DescribeSpotPriceHistoryPaginator struct { - options DescribeSpotPriceHistoryPaginatorOptions - client DescribeSpotPriceHistoryAPIClient - params *DescribeSpotPriceHistoryInput - nextToken *string - firstPage bool -} - -// NewDescribeSpotPriceHistoryPaginator returns a new -// DescribeSpotPriceHistoryPaginator -func NewDescribeSpotPriceHistoryPaginator(client DescribeSpotPriceHistoryAPIClient, params *DescribeSpotPriceHistoryInput, optFns ...func(*DescribeSpotPriceHistoryPaginatorOptions)) *DescribeSpotPriceHistoryPaginator { - if params == nil { - params = &DescribeSpotPriceHistoryInput{} - } - - options := DescribeSpotPriceHistoryPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSpotPriceHistoryPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSpotPriceHistoryPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSpotPriceHistory page. -func (p *DescribeSpotPriceHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSpotPriceHistory(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSpotPriceHistoryAPIClient is a client that implements the -// DescribeSpotPriceHistory operation. -type DescribeSpotPriceHistoryAPIClient interface { - DescribeSpotPriceHistory(context.Context, *DescribeSpotPriceHistoryInput, ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) -} - -var _ DescribeSpotPriceHistoryAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSpotPriceHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSpotPriceHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStaleSecurityGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStaleSecurityGroups.go deleted file mode 100644 index 20cd68344..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStaleSecurityGroups.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the stale security group rules for security groups referenced across -// a VPC peering connection, transit gateway connection, or with a security group -// VPC association. Rules are stale when they reference a deleted security group. -// Rules can also be stale if they reference a security group in a peer VPC for -// which the VPC peering connection has been deleted, across a transit gateway -// where the transit gateway has been deleted (or [the transit gateway security group referencing feature]has been disabled), or if a -// security group VPC association has been disassociated. -// -// [the transit gateway security group referencing feature]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security -func (c *Client) DescribeStaleSecurityGroups(ctx context.Context, params *DescribeStaleSecurityGroupsInput, optFns ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) { - if params == nil { - params = &DescribeStaleSecurityGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeStaleSecurityGroups", params, optFns, c.addOperationDescribeStaleSecurityGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeStaleSecurityGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeStaleSecurityGroupsInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeStaleSecurityGroupsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the stale security groups. - StaleSecurityGroupSet []types.StaleSecurityGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeStaleSecurityGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeStaleSecurityGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeStaleSecurityGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeStaleSecurityGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeStaleSecurityGroupsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStaleSecurityGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeStaleSecurityGroupsPaginatorOptions is the paginator options for -// DescribeStaleSecurityGroups -type DescribeStaleSecurityGroupsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeStaleSecurityGroupsPaginator is a paginator for -// DescribeStaleSecurityGroups -type DescribeStaleSecurityGroupsPaginator struct { - options DescribeStaleSecurityGroupsPaginatorOptions - client DescribeStaleSecurityGroupsAPIClient - params *DescribeStaleSecurityGroupsInput - nextToken *string - firstPage bool -} - -// NewDescribeStaleSecurityGroupsPaginator returns a new -// DescribeStaleSecurityGroupsPaginator -func NewDescribeStaleSecurityGroupsPaginator(client DescribeStaleSecurityGroupsAPIClient, params *DescribeStaleSecurityGroupsInput, optFns ...func(*DescribeStaleSecurityGroupsPaginatorOptions)) *DescribeStaleSecurityGroupsPaginator { - if params == nil { - params = &DescribeStaleSecurityGroupsInput{} - } - - options := DescribeStaleSecurityGroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeStaleSecurityGroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeStaleSecurityGroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeStaleSecurityGroups page. -func (p *DescribeStaleSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeStaleSecurityGroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeStaleSecurityGroupsAPIClient is a client that implements the -// DescribeStaleSecurityGroups operation. -type DescribeStaleSecurityGroupsAPIClient interface { - DescribeStaleSecurityGroups(context.Context, *DescribeStaleSecurityGroupsInput, ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) -} - -var _ DescribeStaleSecurityGroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeStaleSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeStaleSecurityGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStoreImageTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStoreImageTasks.go deleted file mode 100644 index c0b00346a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeStoreImageTasks.go +++ /dev/null @@ -1,548 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the progress of the AMI store tasks. You can describe the store tasks -// for specified AMIs. If you don't specify the AMIs, you get a paginated list of -// store tasks from the last 31 days. -// -// For each AMI task, the response indicates if the task is InProgress , Completed -// , or Failed . For tasks InProgress , the response shows the estimated progress -// as a percentage. -// -// Tasks are listed in reverse chronological order. Currently, only tasks from the -// past 31 days can be viewed. -// -// To use this API, you must have the required permissions. For more information, -// see [Permissions for storing and restoring AMIs using S3]in the Amazon EC2 User Guide. -// -// For more information, see [Store and restore an AMI using S3] in the Amazon EC2 User Guide. -// -// [Store and restore an AMI using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html -// [Permissions for storing and restoring AMIs using S3]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-ami-store-restore.html#ami-s3-permissions -func (c *Client) DescribeStoreImageTasks(ctx context.Context, params *DescribeStoreImageTasksInput, optFns ...func(*Options)) (*DescribeStoreImageTasksOutput, error) { - if params == nil { - params = &DescribeStoreImageTasksInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeStoreImageTasks", params, optFns, c.addOperationDescribeStoreImageTasksMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeStoreImageTasksOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeStoreImageTasksInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - task-state - Returns tasks in a certain state ( InProgress | Completed | - // Failed ) - // - // - bucket - Returns task information for tasks that targeted a specific bucket. - // For the filter value, specify the bucket name. - // - // When you specify the ImageIds parameter, any filters that you specify are - // ignored. To use the filters, you must remove the ImageIds parameter. - Filters []types.Filter - - // The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a - // request. - ImageIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the ImageIds parameter in the same call. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeStoreImageTasksOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The information about the AMI store tasks. - StoreImageTaskResults []types.StoreImageTaskResult - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeStoreImageTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeStoreImageTasks{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeStoreImageTasks{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeStoreImageTasks"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStoreImageTasks(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// StoreImageTaskCompleteWaiterOptions are waiter options for -// StoreImageTaskCompleteWaiter -type StoreImageTaskCompleteWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // StoreImageTaskCompleteWaiter will use default minimum delay of 5 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, StoreImageTaskCompleteWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeStoreImageTasksInput, *DescribeStoreImageTasksOutput, error) (bool, error) -} - -// StoreImageTaskCompleteWaiter defines the waiters for StoreImageTaskComplete -type StoreImageTaskCompleteWaiter struct { - client DescribeStoreImageTasksAPIClient - - options StoreImageTaskCompleteWaiterOptions -} - -// NewStoreImageTaskCompleteWaiter constructs a StoreImageTaskCompleteWaiter. -func NewStoreImageTaskCompleteWaiter(client DescribeStoreImageTasksAPIClient, optFns ...func(*StoreImageTaskCompleteWaiterOptions)) *StoreImageTaskCompleteWaiter { - options := StoreImageTaskCompleteWaiterOptions{} - options.MinDelay = 5 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = storeImageTaskCompleteStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &StoreImageTaskCompleteWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for StoreImageTaskComplete waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *StoreImageTaskCompleteWaiter) Wait(ctx context.Context, params *DescribeStoreImageTasksInput, maxWaitDur time.Duration, optFns ...func(*StoreImageTaskCompleteWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for StoreImageTaskComplete waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *StoreImageTaskCompleteWaiter) WaitForOutput(ctx context.Context, params *DescribeStoreImageTasksInput, maxWaitDur time.Duration, optFns ...func(*StoreImageTaskCompleteWaiterOptions)) (*DescribeStoreImageTasksOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeStoreImageTasks(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for StoreImageTaskComplete waiter") -} - -func storeImageTaskCompleteStateRetryable(ctx context.Context, input *DescribeStoreImageTasksInput, output *DescribeStoreImageTasksOutput, err error) (bool, error) { - - if err == nil { - v1 := output.StoreImageTaskResults - var v2 []string - for _, v := range v1 { - v3 := v.StoreTaskState - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "Completed" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.StoreImageTaskResults - var v2 []string - for _, v := range v1 { - v3 := v.StoreTaskState - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "Failed" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.StoreImageTaskResults - var v2 []string - for _, v := range v1 { - v3 := v.StoreTaskState - if v3 != nil { - v2 = append(v2, *v3) - } - } - expectedValue := "InProgress" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeStoreImageTasksPaginatorOptions is the paginator options for -// DescribeStoreImageTasks -type DescribeStoreImageTasksPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // You cannot specify this parameter and the ImageIds parameter in the same call. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeStoreImageTasksPaginator is a paginator for DescribeStoreImageTasks -type DescribeStoreImageTasksPaginator struct { - options DescribeStoreImageTasksPaginatorOptions - client DescribeStoreImageTasksAPIClient - params *DescribeStoreImageTasksInput - nextToken *string - firstPage bool -} - -// NewDescribeStoreImageTasksPaginator returns a new -// DescribeStoreImageTasksPaginator -func NewDescribeStoreImageTasksPaginator(client DescribeStoreImageTasksAPIClient, params *DescribeStoreImageTasksInput, optFns ...func(*DescribeStoreImageTasksPaginatorOptions)) *DescribeStoreImageTasksPaginator { - if params == nil { - params = &DescribeStoreImageTasksInput{} - } - - options := DescribeStoreImageTasksPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeStoreImageTasksPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeStoreImageTasksPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeStoreImageTasks page. -func (p *DescribeStoreImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStoreImageTasksOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeStoreImageTasks(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeStoreImageTasksAPIClient is a client that implements the -// DescribeStoreImageTasks operation. -type DescribeStoreImageTasksAPIClient interface { - DescribeStoreImageTasks(context.Context, *DescribeStoreImageTasksInput, ...func(*Options)) (*DescribeStoreImageTasksOutput, error) -} - -var _ DescribeStoreImageTasksAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeStoreImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeStoreImageTasks", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSubnets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSubnets.go deleted file mode 100644 index 7772da2b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeSubnets.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes your subnets. The default is to describe all your subnets. -// Alternatively, you can specify specific subnet IDs or filter the results to -// include only the subnets that match specific criteria. -// -// For more information, see [Subnets] in the Amazon VPC User Guide. -// -// [Subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html -func (c *Client) DescribeSubnets(ctx context.Context, params *DescribeSubnetsInput, optFns ...func(*Options)) (*DescribeSubnetsOutput, error) { - if params == nil { - params = &DescribeSubnetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeSubnets", params, optFns, c.addOperationDescribeSubnetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeSubnetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeSubnetsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - availability-zone - The Availability Zone for the subnet. You can also use - // availabilityZone as the filter name. - // - // - availability-zone-id - The ID of the Availability Zone for the subnet. You - // can also use availabilityZoneId as the filter name. - // - // - available-ip-address-count - The number of IPv4 addresses in the subnet that - // are available. - // - // - cidr-block - The IPv4 CIDR block of the subnet. The CIDR block you specify - // must exactly match the subnet's CIDR block for information to be returned for - // the subnet. You can also use cidr or cidrBlock as the filter names. - // - // - customer-owned-ipv4-pool - The customer-owned IPv4 address pool associated - // with the subnet. - // - // - default-for-az - Indicates whether this is the default subnet for the - // Availability Zone ( true | false ). You can also use defaultForAz as the - // filter name. - // - // - enable-dns64 - Indicates whether DNS queries made to the Amazon-provided DNS - // Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only - // destinations. - // - // - enable-lni-at-device-index - Indicates the device position for local network - // interfaces in this subnet. For example, 1 indicates local network interfaces - // in this subnet are the secondary network interface (eth1). - // - // - ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the subnet. - // - // - ipv6-cidr-block-association.association-id - An association ID for an IPv6 - // CIDR block associated with the subnet. - // - // - ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the subnet. - // - // - ipv6-native - Indicates whether this is an IPv6 only subnet ( true | false ). - // - // - map-customer-owned-ip-on-launch - Indicates whether a network interface - // created in this subnet (including a network interface created by RunInstances) receives a - // customer-owned IPv4 address. - // - // - map-public-ip-on-launch - Indicates whether instances launched in this - // subnet receive a public IPv4 address. - // - // - outpost-arn - The Amazon Resource Name (ARN) of the Outpost. - // - // - owner-id - The ID of the Amazon Web Services account that owns the subnet. - // - // - private-dns-name-options-on-launch.hostname-type - The type of hostname to - // assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 - // and IPv6) subnets, an instance DNS name can be based on the instance IPv4 - // address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an - // instance DNS name must be based on the instance ID (resource-name). - // - // - private-dns-name-options-on-launch.enable-resource-name-dns-a-record - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - // - // - private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record - - // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA - // records. - // - // - state - The state of the subnet ( pending | available ). - // - // - subnet-arn - The Amazon Resource Name (ARN) of the subnet. - // - // - subnet-id - The ID of the subnet. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC for the subnet. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the subnets. - // - // Default: Describes all your subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -type DescribeSubnetsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the subnets. - Subnets []types.Subnet - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeSubnetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSubnets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSubnets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSubnets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSubnets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SubnetAvailableWaiterOptions are waiter options for SubnetAvailableWaiter -type SubnetAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // SubnetAvailableWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, SubnetAvailableWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeSubnetsInput, *DescribeSubnetsOutput, error) (bool, error) -} - -// SubnetAvailableWaiter defines the waiters for SubnetAvailable -type SubnetAvailableWaiter struct { - client DescribeSubnetsAPIClient - - options SubnetAvailableWaiterOptions -} - -// NewSubnetAvailableWaiter constructs a SubnetAvailableWaiter. -func NewSubnetAvailableWaiter(client DescribeSubnetsAPIClient, optFns ...func(*SubnetAvailableWaiterOptions)) *SubnetAvailableWaiter { - options := SubnetAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = subnetAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &SubnetAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for SubnetAvailable waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *SubnetAvailableWaiter) Wait(ctx context.Context, params *DescribeSubnetsInput, maxWaitDur time.Duration, optFns ...func(*SubnetAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for SubnetAvailable waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *SubnetAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeSubnetsInput, maxWaitDur time.Duration, optFns ...func(*SubnetAvailableWaiterOptions)) (*DescribeSubnetsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeSubnets(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for SubnetAvailable waiter") -} - -func subnetAvailableStateRetryable(ctx context.Context, input *DescribeSubnetsInput, output *DescribeSubnetsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Subnets - var v2 []types.SubnetState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeSubnetsPaginatorOptions is the paginator options for DescribeSubnets -type DescribeSubnetsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeSubnetsPaginator is a paginator for DescribeSubnets -type DescribeSubnetsPaginator struct { - options DescribeSubnetsPaginatorOptions - client DescribeSubnetsAPIClient - params *DescribeSubnetsInput - nextToken *string - firstPage bool -} - -// NewDescribeSubnetsPaginator returns a new DescribeSubnetsPaginator -func NewDescribeSubnetsPaginator(client DescribeSubnetsAPIClient, params *DescribeSubnetsInput, optFns ...func(*DescribeSubnetsPaginatorOptions)) *DescribeSubnetsPaginator { - if params == nil { - params = &DescribeSubnetsInput{} - } - - options := DescribeSubnetsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeSubnetsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeSubnetsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeSubnets page. -func (p *DescribeSubnetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubnetsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeSubnets(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeSubnetsAPIClient is a client that implements the DescribeSubnets -// operation. -type DescribeSubnetsAPIClient interface { - DescribeSubnets(context.Context, *DescribeSubnetsInput, ...func(*Options)) (*DescribeSubnetsOutput, error) -} - -var _ DescribeSubnetsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeSubnets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeSubnets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTags.go deleted file mode 100644 index 59193f8c6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTags.go +++ /dev/null @@ -1,298 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified tags for your EC2 resources. -// -// For more information about tags, see [Tag your Amazon EC2 resources] in the Amazon Elastic Compute Cloud User -// Guide. -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Tag your Amazon EC2 resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html -func (c *Client) DescribeTags(ctx context.Context, params *DescribeTagsInput, optFns ...func(*Options)) (*DescribeTagsOutput, error) { - if params == nil { - params = &DescribeTagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTags", params, optFns, c.addOperationDescribeTagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTagsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - key - The tag key. - // - // - resource-id - The ID of the resource. - // - // - resource-type - The resource type. For a list of possible values, see [TagSpecification]. - // - // - tag : - The key/value combination of the tag. For example, specify - // "tag:Owner" for the filter name and "TeamA" for the filter value to find - // resources with the tag "Owner=TeamA". - // - // - value - The tag value. - // - // [TagSpecification]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TagSpecification.html - Filters []types.Filter - - // The maximum number of items to return for this request. This value can be - // between 5 and 1000. To get the next page of items, make another request with the - // token returned in the output. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeTagsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The tags. - Tags []types.TagDescription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTagsPaginatorOptions is the paginator options for DescribeTags -type DescribeTagsPaginatorOptions struct { - // The maximum number of items to return for this request. This value can be - // between 5 and 1000. To get the next page of items, make another request with the - // token returned in the output. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTagsPaginator is a paginator for DescribeTags -type DescribeTagsPaginator struct { - options DescribeTagsPaginatorOptions - client DescribeTagsAPIClient - params *DescribeTagsInput - nextToken *string - firstPage bool -} - -// NewDescribeTagsPaginator returns a new DescribeTagsPaginator -func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { - if params == nil { - params = &DescribeTagsInput{} - } - - options := DescribeTagsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTagsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTagsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTags page. -func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTagsAPIClient is a client that implements the DescribeTags operation. -type DescribeTagsAPIClient interface { - DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) -} - -var _ DescribeTagsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilterRules.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilterRules.go deleted file mode 100644 index 3baf1a572..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilterRules.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describe traffic mirror filters that determine the traffic that is mirrored. -func (c *Client) DescribeTrafficMirrorFilterRules(ctx context.Context, params *DescribeTrafficMirrorFilterRulesInput, optFns ...func(*Options)) (*DescribeTrafficMirrorFilterRulesOutput, error) { - if params == nil { - params = &DescribeTrafficMirrorFilterRulesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTrafficMirrorFilterRules", params, optFns, c.addOperationDescribeTrafficMirrorFilterRulesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTrafficMirrorFilterRulesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTrafficMirrorFilterRulesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Traffic mirror filters. - // - // - traffic-mirror-filter-rule-id : The ID of the Traffic Mirror rule. - // - // - traffic-mirror-filter-id : The ID of the filter that this rule is associated - // with. - // - // - rule-number : The number of the Traffic Mirror rule. - // - // - rule-action : The action taken on the filtered traffic. Possible actions are - // accept and reject . - // - // - traffic-direction : The traffic direction. Possible directions are ingress - // and egress . - // - // - protocol : The protocol, for example UDP, assigned to the Traffic Mirror - // rule. - // - // - source-cidr-block : The source CIDR block assigned to the Traffic Mirror - // rule. - // - // - destination-cidr-block : The destination CIDR block assigned to the Traffic - // Mirror rule. - // - // - description : The description of the Traffic Mirror rule. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // Traffic filter ID. - TrafficMirrorFilterId *string - - // Traffic filter rule IDs. - TrafficMirrorFilterRuleIds []string - - noSmithyDocumentSerde -} - -type DescribeTrafficMirrorFilterRulesOutput struct { - - // The token to use to retrieve the next page of results. The value is null when - // there are no more results to return. - NextToken *string - - // Traffic mirror rules. - TrafficMirrorFilterRules []types.TrafficMirrorFilterRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTrafficMirrorFilterRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTrafficMirrorFilterRules{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTrafficMirrorFilterRules{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrafficMirrorFilterRules"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrafficMirrorFilterRules(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeTrafficMirrorFilterRules(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTrafficMirrorFilterRules", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilters.go deleted file mode 100644 index ce1db7e72..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorFilters.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Traffic Mirror filters. -func (c *Client) DescribeTrafficMirrorFilters(ctx context.Context, params *DescribeTrafficMirrorFiltersInput, optFns ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) { - if params == nil { - params = &DescribeTrafficMirrorFiltersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTrafficMirrorFilters", params, optFns, c.addOperationDescribeTrafficMirrorFiltersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTrafficMirrorFiltersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTrafficMirrorFiltersInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - description : The Traffic Mirror filter description. - // - // - traffic-mirror-filter-id : The ID of the Traffic Mirror filter. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterIds []string - - noSmithyDocumentSerde -} - -type DescribeTrafficMirrorFiltersOutput struct { - - // The token to use to retrieve the next page of results. The value is null when - // there are no more results to return. - NextToken *string - - // Information about one or more Traffic Mirror filters. - TrafficMirrorFilters []types.TrafficMirrorFilter - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTrafficMirrorFiltersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTrafficMirrorFilters{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTrafficMirrorFilters{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrafficMirrorFilters"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrafficMirrorFilters(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTrafficMirrorFiltersPaginatorOptions is the paginator options for -// DescribeTrafficMirrorFilters -type DescribeTrafficMirrorFiltersPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTrafficMirrorFiltersPaginator is a paginator for -// DescribeTrafficMirrorFilters -type DescribeTrafficMirrorFiltersPaginator struct { - options DescribeTrafficMirrorFiltersPaginatorOptions - client DescribeTrafficMirrorFiltersAPIClient - params *DescribeTrafficMirrorFiltersInput - nextToken *string - firstPage bool -} - -// NewDescribeTrafficMirrorFiltersPaginator returns a new -// DescribeTrafficMirrorFiltersPaginator -func NewDescribeTrafficMirrorFiltersPaginator(client DescribeTrafficMirrorFiltersAPIClient, params *DescribeTrafficMirrorFiltersInput, optFns ...func(*DescribeTrafficMirrorFiltersPaginatorOptions)) *DescribeTrafficMirrorFiltersPaginator { - if params == nil { - params = &DescribeTrafficMirrorFiltersInput{} - } - - options := DescribeTrafficMirrorFiltersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTrafficMirrorFiltersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTrafficMirrorFiltersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTrafficMirrorFilters page. -func (p *DescribeTrafficMirrorFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTrafficMirrorFilters(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTrafficMirrorFiltersAPIClient is a client that implements the -// DescribeTrafficMirrorFilters operation. -type DescribeTrafficMirrorFiltersAPIClient interface { - DescribeTrafficMirrorFilters(context.Context, *DescribeTrafficMirrorFiltersInput, ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) -} - -var _ DescribeTrafficMirrorFiltersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTrafficMirrorFilters(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTrafficMirrorFilters", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorSessions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorSessions.go deleted file mode 100644 index 5146c65fb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorSessions.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror -// sessions are described. Alternatively, you can filter the results. -func (c *Client) DescribeTrafficMirrorSessions(ctx context.Context, params *DescribeTrafficMirrorSessionsInput, optFns ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) { - if params == nil { - params = &DescribeTrafficMirrorSessionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTrafficMirrorSessions", params, optFns, c.addOperationDescribeTrafficMirrorSessionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTrafficMirrorSessionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTrafficMirrorSessionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - description : The Traffic Mirror session description. - // - // - network-interface-id : The ID of the Traffic Mirror session network - // interface. - // - // - owner-id : The ID of the account that owns the Traffic Mirror session. - // - // - packet-length : The assigned number of packets to mirror. - // - // - session-number : The assigned session number. - // - // - traffic-mirror-filter-id : The ID of the Traffic Mirror filter. - // - // - traffic-mirror-session-id : The ID of the Traffic Mirror session. - // - // - traffic-mirror-target-id : The ID of the Traffic Mirror target. - // - // - virtual-network-id : The virtual network ID of the Traffic Mirror session. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the Traffic Mirror session. - TrafficMirrorSessionIds []string - - noSmithyDocumentSerde -} - -type DescribeTrafficMirrorSessionsOutput struct { - - // The token to use to retrieve the next page of results. The value is null when - // there are no more results to return. - NextToken *string - - // Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror - // sessions are described. Alternatively, you can filter the results. - TrafficMirrorSessions []types.TrafficMirrorSession - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTrafficMirrorSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTrafficMirrorSessions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTrafficMirrorSessions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrafficMirrorSessions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrafficMirrorSessions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTrafficMirrorSessionsPaginatorOptions is the paginator options for -// DescribeTrafficMirrorSessions -type DescribeTrafficMirrorSessionsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTrafficMirrorSessionsPaginator is a paginator for -// DescribeTrafficMirrorSessions -type DescribeTrafficMirrorSessionsPaginator struct { - options DescribeTrafficMirrorSessionsPaginatorOptions - client DescribeTrafficMirrorSessionsAPIClient - params *DescribeTrafficMirrorSessionsInput - nextToken *string - firstPage bool -} - -// NewDescribeTrafficMirrorSessionsPaginator returns a new -// DescribeTrafficMirrorSessionsPaginator -func NewDescribeTrafficMirrorSessionsPaginator(client DescribeTrafficMirrorSessionsAPIClient, params *DescribeTrafficMirrorSessionsInput, optFns ...func(*DescribeTrafficMirrorSessionsPaginatorOptions)) *DescribeTrafficMirrorSessionsPaginator { - if params == nil { - params = &DescribeTrafficMirrorSessionsInput{} - } - - options := DescribeTrafficMirrorSessionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTrafficMirrorSessionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTrafficMirrorSessionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTrafficMirrorSessions page. -func (p *DescribeTrafficMirrorSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTrafficMirrorSessions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTrafficMirrorSessionsAPIClient is a client that implements the -// DescribeTrafficMirrorSessions operation. -type DescribeTrafficMirrorSessionsAPIClient interface { - DescribeTrafficMirrorSessions(context.Context, *DescribeTrafficMirrorSessionsInput, ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) -} - -var _ DescribeTrafficMirrorSessionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTrafficMirrorSessions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTrafficMirrorSessions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorTargets.go deleted file mode 100644 index a36cc59ff..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrafficMirrorTargets.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Information about one or more Traffic Mirror targets. -func (c *Client) DescribeTrafficMirrorTargets(ctx context.Context, params *DescribeTrafficMirrorTargetsInput, optFns ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) { - if params == nil { - params = &DescribeTrafficMirrorTargetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTrafficMirrorTargets", params, optFns, c.addOperationDescribeTrafficMirrorTargetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTrafficMirrorTargetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTrafficMirrorTargetsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - description : The Traffic Mirror target description. - // - // - network-interface-id : The ID of the Traffic Mirror session network - // interface. - // - // - network-load-balancer-arn : The Amazon Resource Name (ARN) of the Network - // Load Balancer that is associated with the session. - // - // - owner-id : The ID of the account that owns the Traffic Mirror session. - // - // - traffic-mirror-target-id : The ID of the Traffic Mirror target. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the Traffic Mirror targets. - TrafficMirrorTargetIds []string - - noSmithyDocumentSerde -} - -type DescribeTrafficMirrorTargetsOutput struct { - - // The token to use to retrieve the next page of results. The value is null when - // there are no more results to return. - NextToken *string - - // Information about one or more Traffic Mirror targets. - TrafficMirrorTargets []types.TrafficMirrorTarget - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTrafficMirrorTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTrafficMirrorTargets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTrafficMirrorTargets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrafficMirrorTargets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrafficMirrorTargets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTrafficMirrorTargetsPaginatorOptions is the paginator options for -// DescribeTrafficMirrorTargets -type DescribeTrafficMirrorTargetsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTrafficMirrorTargetsPaginator is a paginator for -// DescribeTrafficMirrorTargets -type DescribeTrafficMirrorTargetsPaginator struct { - options DescribeTrafficMirrorTargetsPaginatorOptions - client DescribeTrafficMirrorTargetsAPIClient - params *DescribeTrafficMirrorTargetsInput - nextToken *string - firstPage bool -} - -// NewDescribeTrafficMirrorTargetsPaginator returns a new -// DescribeTrafficMirrorTargetsPaginator -func NewDescribeTrafficMirrorTargetsPaginator(client DescribeTrafficMirrorTargetsAPIClient, params *DescribeTrafficMirrorTargetsInput, optFns ...func(*DescribeTrafficMirrorTargetsPaginatorOptions)) *DescribeTrafficMirrorTargetsPaginator { - if params == nil { - params = &DescribeTrafficMirrorTargetsInput{} - } - - options := DescribeTrafficMirrorTargetsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTrafficMirrorTargetsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTrafficMirrorTargetsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTrafficMirrorTargets page. -func (p *DescribeTrafficMirrorTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTrafficMirrorTargets(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTrafficMirrorTargetsAPIClient is a client that implements the -// DescribeTrafficMirrorTargets operation. -type DescribeTrafficMirrorTargetsAPIClient interface { - DescribeTrafficMirrorTargets(context.Context, *DescribeTrafficMirrorTargetsInput, ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) -} - -var _ DescribeTrafficMirrorTargetsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTrafficMirrorTargets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTrafficMirrorTargets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayAttachments.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayAttachments.go deleted file mode 100644 index 6e4406be0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayAttachments.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more attachments between resources and transit gateways. By -// default, all attachments are described. Alternatively, you can filter the -// results by attachment ID, attachment state, resource ID, or resource owner. -func (c *Client) DescribeTransitGatewayAttachments(ctx context.Context, params *DescribeTransitGatewayAttachmentsInput, optFns ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayAttachmentsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayAttachments", params, optFns, c.addOperationDescribeTransitGatewayAttachmentsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayAttachmentsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayAttachmentsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - association.state - The state of the association ( associating | associated - // | disassociating ). - // - // - association.transit-gateway-route-table-id - The ID of the route table for - // the transit gateway. - // - // - resource-id - The ID of the resource. - // - // - resource-owner-id - The ID of the Amazon Web Services account that owns the - // resource. - // - // - resource-type - The resource type. Valid values are vpc | vpn | - // direct-connect-gateway | peering | connect . - // - // - state - The state of the attachment. Valid values are available | deleted | - // deleting | failed | failing | initiatingRequest | modifying | - // pendingAcceptance | pending | rollingBack | rejected | rejecting . - // - // - transit-gateway-attachment-id - The ID of the attachment. - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - transit-gateway-owner-id - The ID of the Amazon Web Services account that - // owns the transit gateway. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the attachments. - TransitGatewayAttachmentIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayAttachmentsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the attachments. - TransitGatewayAttachments []types.TransitGatewayAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayAttachmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayAttachments{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayAttachments{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayAttachments"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayAttachments(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayAttachmentsPaginatorOptions is the paginator options for -// DescribeTransitGatewayAttachments -type DescribeTransitGatewayAttachmentsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayAttachmentsPaginator is a paginator for -// DescribeTransitGatewayAttachments -type DescribeTransitGatewayAttachmentsPaginator struct { - options DescribeTransitGatewayAttachmentsPaginatorOptions - client DescribeTransitGatewayAttachmentsAPIClient - params *DescribeTransitGatewayAttachmentsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayAttachmentsPaginator returns a new -// DescribeTransitGatewayAttachmentsPaginator -func NewDescribeTransitGatewayAttachmentsPaginator(client DescribeTransitGatewayAttachmentsAPIClient, params *DescribeTransitGatewayAttachmentsInput, optFns ...func(*DescribeTransitGatewayAttachmentsPaginatorOptions)) *DescribeTransitGatewayAttachmentsPaginator { - if params == nil { - params = &DescribeTransitGatewayAttachmentsInput{} - } - - options := DescribeTransitGatewayAttachmentsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayAttachmentsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayAttachmentsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayAttachments page. -func (p *DescribeTransitGatewayAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayAttachments(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayAttachmentsAPIClient is a client that implements the -// DescribeTransitGatewayAttachments operation. -type DescribeTransitGatewayAttachmentsAPIClient interface { - DescribeTransitGatewayAttachments(context.Context, *DescribeTransitGatewayAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) -} - -var _ DescribeTransitGatewayAttachmentsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayAttachments(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayAttachments", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnectPeers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnectPeers.go deleted file mode 100644 index e09b552c5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnectPeers.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Connect peers. -func (c *Client) DescribeTransitGatewayConnectPeers(ctx context.Context, params *DescribeTransitGatewayConnectPeersInput, optFns ...func(*Options)) (*DescribeTransitGatewayConnectPeersOutput, error) { - if params == nil { - params = &DescribeTransitGatewayConnectPeersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayConnectPeers", params, optFns, c.addOperationDescribeTransitGatewayConnectPeersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayConnectPeersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayConnectPeersInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - state - The state of the Connect peer ( pending | available | deleting | - // deleted ). - // - // - transit-gateway-attachment-id - The ID of the attachment. - // - // - transit-gateway-connect-peer-id - The ID of the Connect peer. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the Connect peers. - TransitGatewayConnectPeerIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayConnectPeersOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the Connect peers. - TransitGatewayConnectPeers []types.TransitGatewayConnectPeer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayConnectPeersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayConnectPeers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayConnectPeers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayConnectPeers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayConnectPeers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayConnectPeersPaginatorOptions is the paginator options for -// DescribeTransitGatewayConnectPeers -type DescribeTransitGatewayConnectPeersPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayConnectPeersPaginator is a paginator for -// DescribeTransitGatewayConnectPeers -type DescribeTransitGatewayConnectPeersPaginator struct { - options DescribeTransitGatewayConnectPeersPaginatorOptions - client DescribeTransitGatewayConnectPeersAPIClient - params *DescribeTransitGatewayConnectPeersInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayConnectPeersPaginator returns a new -// DescribeTransitGatewayConnectPeersPaginator -func NewDescribeTransitGatewayConnectPeersPaginator(client DescribeTransitGatewayConnectPeersAPIClient, params *DescribeTransitGatewayConnectPeersInput, optFns ...func(*DescribeTransitGatewayConnectPeersPaginatorOptions)) *DescribeTransitGatewayConnectPeersPaginator { - if params == nil { - params = &DescribeTransitGatewayConnectPeersInput{} - } - - options := DescribeTransitGatewayConnectPeersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayConnectPeersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayConnectPeersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayConnectPeers page. -func (p *DescribeTransitGatewayConnectPeersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayConnectPeersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayConnectPeers(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayConnectPeersAPIClient is a client that implements the -// DescribeTransitGatewayConnectPeers operation. -type DescribeTransitGatewayConnectPeersAPIClient interface { - DescribeTransitGatewayConnectPeers(context.Context, *DescribeTransitGatewayConnectPeersInput, ...func(*Options)) (*DescribeTransitGatewayConnectPeersOutput, error) -} - -var _ DescribeTransitGatewayConnectPeersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayConnectPeers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayConnectPeers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnects.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnects.go deleted file mode 100644 index 4af640cac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayConnects.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more Connect attachments. -func (c *Client) DescribeTransitGatewayConnects(ctx context.Context, params *DescribeTransitGatewayConnectsInput, optFns ...func(*Options)) (*DescribeTransitGatewayConnectsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayConnectsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayConnects", params, optFns, c.addOperationDescribeTransitGatewayConnectsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayConnectsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayConnectsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - options.protocol - The tunnel protocol ( gre ). - // - // - state - The state of the attachment ( initiating | initiatingRequest | - // pendingAcceptance | rollingBack | pending | available | modifying | deleting | - // deleted | failed | rejected | rejecting | failing ). - // - // - transit-gateway-attachment-id - The ID of the Connect attachment. - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - transport-transit-gateway-attachment-id - The ID of the transit gateway - // attachment from which the Connect attachment was created. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the attachments. - TransitGatewayAttachmentIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayConnectsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the Connect attachments. - TransitGatewayConnects []types.TransitGatewayConnect - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayConnectsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayConnects{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayConnects{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayConnects"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayConnects(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayConnectsPaginatorOptions is the paginator options for -// DescribeTransitGatewayConnects -type DescribeTransitGatewayConnectsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayConnectsPaginator is a paginator for -// DescribeTransitGatewayConnects -type DescribeTransitGatewayConnectsPaginator struct { - options DescribeTransitGatewayConnectsPaginatorOptions - client DescribeTransitGatewayConnectsAPIClient - params *DescribeTransitGatewayConnectsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayConnectsPaginator returns a new -// DescribeTransitGatewayConnectsPaginator -func NewDescribeTransitGatewayConnectsPaginator(client DescribeTransitGatewayConnectsAPIClient, params *DescribeTransitGatewayConnectsInput, optFns ...func(*DescribeTransitGatewayConnectsPaginatorOptions)) *DescribeTransitGatewayConnectsPaginator { - if params == nil { - params = &DescribeTransitGatewayConnectsInput{} - } - - options := DescribeTransitGatewayConnectsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayConnectsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayConnectsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayConnects page. -func (p *DescribeTransitGatewayConnectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayConnectsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayConnects(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayConnectsAPIClient is a client that implements the -// DescribeTransitGatewayConnects operation. -type DescribeTransitGatewayConnectsAPIClient interface { - DescribeTransitGatewayConnects(context.Context, *DescribeTransitGatewayConnectsInput, ...func(*Options)) (*DescribeTransitGatewayConnectsOutput, error) -} - -var _ DescribeTransitGatewayConnectsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayConnects(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayConnects", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go deleted file mode 100644 index 60d911ac6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more transit gateway multicast domains. -func (c *Client) DescribeTransitGatewayMulticastDomains(ctx context.Context, params *DescribeTransitGatewayMulticastDomainsInput, optFns ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayMulticastDomainsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayMulticastDomains", params, optFns, c.addOperationDescribeTransitGatewayMulticastDomainsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayMulticastDomainsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayMulticastDomainsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - state - The state of the transit gateway multicast domain. Valid values are - // pending | available | deleting | deleted . - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - transit-gateway-multicast-domain-id - The ID of the transit gateway - // multicast domain. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayMulticastDomainsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the transit gateway multicast domains. - TransitGatewayMulticastDomains []types.TransitGatewayMulticastDomain - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayMulticastDomainsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayMulticastDomains{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayMulticastDomains{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayMulticastDomains"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayMulticastDomains(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayMulticastDomainsPaginatorOptions is the paginator options -// for DescribeTransitGatewayMulticastDomains -type DescribeTransitGatewayMulticastDomainsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayMulticastDomainsPaginator is a paginator for -// DescribeTransitGatewayMulticastDomains -type DescribeTransitGatewayMulticastDomainsPaginator struct { - options DescribeTransitGatewayMulticastDomainsPaginatorOptions - client DescribeTransitGatewayMulticastDomainsAPIClient - params *DescribeTransitGatewayMulticastDomainsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayMulticastDomainsPaginator returns a new -// DescribeTransitGatewayMulticastDomainsPaginator -func NewDescribeTransitGatewayMulticastDomainsPaginator(client DescribeTransitGatewayMulticastDomainsAPIClient, params *DescribeTransitGatewayMulticastDomainsInput, optFns ...func(*DescribeTransitGatewayMulticastDomainsPaginatorOptions)) *DescribeTransitGatewayMulticastDomainsPaginator { - if params == nil { - params = &DescribeTransitGatewayMulticastDomainsInput{} - } - - options := DescribeTransitGatewayMulticastDomainsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayMulticastDomainsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayMulticastDomainsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayMulticastDomains page. -func (p *DescribeTransitGatewayMulticastDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayMulticastDomains(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayMulticastDomainsAPIClient is a client that implements the -// DescribeTransitGatewayMulticastDomains operation. -type DescribeTransitGatewayMulticastDomainsAPIClient interface { - DescribeTransitGatewayMulticastDomains(context.Context, *DescribeTransitGatewayMulticastDomainsInput, ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) -} - -var _ DescribeTransitGatewayMulticastDomainsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayMulticastDomains(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayMulticastDomains", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go deleted file mode 100644 index e15d5c6e4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your transit gateway peering attachments. -func (c *Client) DescribeTransitGatewayPeeringAttachments(ctx context.Context, params *DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayPeeringAttachmentsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayPeeringAttachments", params, optFns, c.addOperationDescribeTransitGatewayPeeringAttachmentsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayPeeringAttachmentsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayPeeringAttachmentsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - transit-gateway-attachment-id - The ID of the transit gateway attachment. - // - // - local-owner-id - The ID of your Amazon Web Services account. - // - // - remote-owner-id - The ID of the Amazon Web Services account in the remote - // Region that owns the transit gateway. - // - // - state - The state of the peering attachment. Valid values are available | - // deleted | deleting | failed | failing | initiatingRequest | modifying | - // pendingAcceptance | pending | rollingBack | rejected | rejecting ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources that have a tag with a specific key, regardless of the tag value. - // - // - transit-gateway-id - The ID of the transit gateway. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // One or more IDs of the transit gateway peering attachments. - TransitGatewayAttachmentIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayPeeringAttachmentsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The transit gateway peering attachments. - TransitGatewayPeeringAttachments []types.TransitGatewayPeeringAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayPeeringAttachmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayPeeringAttachments{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayPeeringAttachments{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayPeeringAttachments"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayPeeringAttachments(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayPeeringAttachmentsPaginatorOptions is the paginator -// options for DescribeTransitGatewayPeeringAttachments -type DescribeTransitGatewayPeeringAttachmentsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayPeeringAttachmentsPaginator is a paginator for -// DescribeTransitGatewayPeeringAttachments -type DescribeTransitGatewayPeeringAttachmentsPaginator struct { - options DescribeTransitGatewayPeeringAttachmentsPaginatorOptions - client DescribeTransitGatewayPeeringAttachmentsAPIClient - params *DescribeTransitGatewayPeeringAttachmentsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayPeeringAttachmentsPaginator returns a new -// DescribeTransitGatewayPeeringAttachmentsPaginator -func NewDescribeTransitGatewayPeeringAttachmentsPaginator(client DescribeTransitGatewayPeeringAttachmentsAPIClient, params *DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*DescribeTransitGatewayPeeringAttachmentsPaginatorOptions)) *DescribeTransitGatewayPeeringAttachmentsPaginator { - if params == nil { - params = &DescribeTransitGatewayPeeringAttachmentsInput{} - } - - options := DescribeTransitGatewayPeeringAttachmentsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayPeeringAttachmentsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayPeeringAttachments page. -func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayPeeringAttachments(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayPeeringAttachmentsAPIClient is a client that implements -// the DescribeTransitGatewayPeeringAttachments operation. -type DescribeTransitGatewayPeeringAttachmentsAPIClient interface { - DescribeTransitGatewayPeeringAttachments(context.Context, *DescribeTransitGatewayPeeringAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) -} - -var _ DescribeTransitGatewayPeeringAttachmentsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayPeeringAttachments(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayPeeringAttachments", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPolicyTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPolicyTables.go deleted file mode 100644 index 60fe0dcf7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayPolicyTables.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more transit gateway route policy tables. -func (c *Client) DescribeTransitGatewayPolicyTables(ctx context.Context, params *DescribeTransitGatewayPolicyTablesInput, optFns ...func(*Options)) (*DescribeTransitGatewayPolicyTablesOutput, error) { - if params == nil { - params = &DescribeTransitGatewayPolicyTablesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayPolicyTables", params, optFns, c.addOperationDescribeTransitGatewayPolicyTablesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayPolicyTablesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayPolicyTablesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters associated with the transit gateway policy table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the transit gateway policy tables. - TransitGatewayPolicyTableIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayPolicyTablesOutput struct { - - // The token for the next page of results. - NextToken *string - - // Describes the transit gateway policy tables. - TransitGatewayPolicyTables []types.TransitGatewayPolicyTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayPolicyTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayPolicyTables{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayPolicyTables{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayPolicyTables"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayPolicyTables(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayPolicyTablesPaginatorOptions is the paginator options for -// DescribeTransitGatewayPolicyTables -type DescribeTransitGatewayPolicyTablesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayPolicyTablesPaginator is a paginator for -// DescribeTransitGatewayPolicyTables -type DescribeTransitGatewayPolicyTablesPaginator struct { - options DescribeTransitGatewayPolicyTablesPaginatorOptions - client DescribeTransitGatewayPolicyTablesAPIClient - params *DescribeTransitGatewayPolicyTablesInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayPolicyTablesPaginator returns a new -// DescribeTransitGatewayPolicyTablesPaginator -func NewDescribeTransitGatewayPolicyTablesPaginator(client DescribeTransitGatewayPolicyTablesAPIClient, params *DescribeTransitGatewayPolicyTablesInput, optFns ...func(*DescribeTransitGatewayPolicyTablesPaginatorOptions)) *DescribeTransitGatewayPolicyTablesPaginator { - if params == nil { - params = &DescribeTransitGatewayPolicyTablesInput{} - } - - options := DescribeTransitGatewayPolicyTablesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayPolicyTablesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayPolicyTablesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayPolicyTables page. -func (p *DescribeTransitGatewayPolicyTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayPolicyTablesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayPolicyTables(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayPolicyTablesAPIClient is a client that implements the -// DescribeTransitGatewayPolicyTables operation. -type DescribeTransitGatewayPolicyTablesAPIClient interface { - DescribeTransitGatewayPolicyTables(context.Context, *DescribeTransitGatewayPolicyTablesInput, ...func(*Options)) (*DescribeTransitGatewayPolicyTablesOutput, error) -} - -var _ DescribeTransitGatewayPolicyTablesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayPolicyTables(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayPolicyTables", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTableAnnouncements.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTableAnnouncements.go deleted file mode 100644 index ce275c6e7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTableAnnouncements.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more transit gateway route table advertisements. -func (c *Client) DescribeTransitGatewayRouteTableAnnouncements(ctx context.Context, params *DescribeTransitGatewayRouteTableAnnouncementsInput, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTableAnnouncementsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayRouteTableAnnouncementsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayRouteTableAnnouncements", params, optFns, c.addOperationDescribeTransitGatewayRouteTableAnnouncementsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayRouteTableAnnouncementsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayRouteTableAnnouncementsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters associated with the transit gateway policy table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the transit gateway route tables that are being advertised. - TransitGatewayRouteTableAnnouncementIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayRouteTableAnnouncementsOutput struct { - - // The token for the next page of results. - NextToken *string - - // Describes the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncements []types.TransitGatewayRouteTableAnnouncement - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayRouteTableAnnouncementsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayRouteTableAnnouncements{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayRouteTableAnnouncements{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayRouteTableAnnouncements"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTableAnnouncements(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayRouteTableAnnouncementsPaginatorOptions is the paginator -// options for DescribeTransitGatewayRouteTableAnnouncements -type DescribeTransitGatewayRouteTableAnnouncementsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayRouteTableAnnouncementsPaginator is a paginator for -// DescribeTransitGatewayRouteTableAnnouncements -type DescribeTransitGatewayRouteTableAnnouncementsPaginator struct { - options DescribeTransitGatewayRouteTableAnnouncementsPaginatorOptions - client DescribeTransitGatewayRouteTableAnnouncementsAPIClient - params *DescribeTransitGatewayRouteTableAnnouncementsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayRouteTableAnnouncementsPaginator returns a new -// DescribeTransitGatewayRouteTableAnnouncementsPaginator -func NewDescribeTransitGatewayRouteTableAnnouncementsPaginator(client DescribeTransitGatewayRouteTableAnnouncementsAPIClient, params *DescribeTransitGatewayRouteTableAnnouncementsInput, optFns ...func(*DescribeTransitGatewayRouteTableAnnouncementsPaginatorOptions)) *DescribeTransitGatewayRouteTableAnnouncementsPaginator { - if params == nil { - params = &DescribeTransitGatewayRouteTableAnnouncementsInput{} - } - - options := DescribeTransitGatewayRouteTableAnnouncementsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayRouteTableAnnouncementsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayRouteTableAnnouncementsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayRouteTableAnnouncements page. -func (p *DescribeTransitGatewayRouteTableAnnouncementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTableAnnouncementsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayRouteTableAnnouncements(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayRouteTableAnnouncementsAPIClient is a client that -// implements the DescribeTransitGatewayRouteTableAnnouncements operation. -type DescribeTransitGatewayRouteTableAnnouncementsAPIClient interface { - DescribeTransitGatewayRouteTableAnnouncements(context.Context, *DescribeTransitGatewayRouteTableAnnouncementsInput, ...func(*Options)) (*DescribeTransitGatewayRouteTableAnnouncementsOutput, error) -} - -var _ DescribeTransitGatewayRouteTableAnnouncementsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTableAnnouncements(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayRouteTableAnnouncements", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTables.go deleted file mode 100644 index 93217a6e3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayRouteTables.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more transit gateway route tables. By default, all transit -// gateway route tables are described. Alternatively, you can filter the results. -func (c *Client) DescribeTransitGatewayRouteTables(ctx context.Context, params *DescribeTransitGatewayRouteTablesInput, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) { - if params == nil { - params = &DescribeTransitGatewayRouteTablesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayRouteTables", params, optFns, c.addOperationDescribeTransitGatewayRouteTablesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayRouteTablesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayRouteTablesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - default-association-route-table - Indicates whether this is the default - // association route table for the transit gateway ( true | false ). - // - // - default-propagation-route-table - Indicates whether this is the default - // propagation route table for the transit gateway ( true | false ). - // - // - state - The state of the route table ( available | deleting | deleted | - // pending ). - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - transit-gateway-route-table-id - The ID of the transit gateway route table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the transit gateway route tables. - TransitGatewayRouteTableIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayRouteTablesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the transit gateway route tables. - TransitGatewayRouteTables []types.TransitGatewayRouteTable - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayRouteTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayRouteTables{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayRouteTables{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayRouteTables"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTables(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayRouteTablesPaginatorOptions is the paginator options for -// DescribeTransitGatewayRouteTables -type DescribeTransitGatewayRouteTablesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayRouteTablesPaginator is a paginator for -// DescribeTransitGatewayRouteTables -type DescribeTransitGatewayRouteTablesPaginator struct { - options DescribeTransitGatewayRouteTablesPaginatorOptions - client DescribeTransitGatewayRouteTablesAPIClient - params *DescribeTransitGatewayRouteTablesInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayRouteTablesPaginator returns a new -// DescribeTransitGatewayRouteTablesPaginator -func NewDescribeTransitGatewayRouteTablesPaginator(client DescribeTransitGatewayRouteTablesAPIClient, params *DescribeTransitGatewayRouteTablesInput, optFns ...func(*DescribeTransitGatewayRouteTablesPaginatorOptions)) *DescribeTransitGatewayRouteTablesPaginator { - if params == nil { - params = &DescribeTransitGatewayRouteTablesInput{} - } - - options := DescribeTransitGatewayRouteTablesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayRouteTablesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayRouteTablesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayRouteTables page. -func (p *DescribeTransitGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayRouteTables(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayRouteTablesAPIClient is a client that implements the -// DescribeTransitGatewayRouteTables operation. -type DescribeTransitGatewayRouteTablesAPIClient interface { - DescribeTransitGatewayRouteTables(context.Context, *DescribeTransitGatewayRouteTablesInput, ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) -} - -var _ DescribeTransitGatewayRouteTablesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayRouteTables", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go deleted file mode 100644 index 0a540fe13..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go +++ /dev/null @@ -1,283 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more VPC attachments. By default, all VPC attachments are -// described. Alternatively, you can filter the results. -func (c *Client) DescribeTransitGatewayVpcAttachments(ctx context.Context, params *DescribeTransitGatewayVpcAttachmentsInput, optFns ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { - if params == nil { - params = &DescribeTransitGatewayVpcAttachmentsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGatewayVpcAttachments", params, optFns, c.addOperationDescribeTransitGatewayVpcAttachmentsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewayVpcAttachmentsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewayVpcAttachmentsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - state - The state of the attachment. Valid values are available | deleted | - // deleting | failed | failing | initiatingRequest | modifying | - // pendingAcceptance | pending | rollingBack | rejected | rejecting . - // - // - transit-gateway-attachment-id - The ID of the attachment. - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - vpc-id - The ID of the VPC. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the attachments. - TransitGatewayAttachmentIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewayVpcAttachmentsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the VPC attachments. - TransitGatewayVpcAttachments []types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewayVpcAttachmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGatewayVpcAttachments{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGatewayVpcAttachments{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGatewayVpcAttachments"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGatewayVpcAttachments(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewayVpcAttachmentsPaginatorOptions is the paginator options -// for DescribeTransitGatewayVpcAttachments -type DescribeTransitGatewayVpcAttachmentsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewayVpcAttachmentsPaginator is a paginator for -// DescribeTransitGatewayVpcAttachments -type DescribeTransitGatewayVpcAttachmentsPaginator struct { - options DescribeTransitGatewayVpcAttachmentsPaginatorOptions - client DescribeTransitGatewayVpcAttachmentsAPIClient - params *DescribeTransitGatewayVpcAttachmentsInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewayVpcAttachmentsPaginator returns a new -// DescribeTransitGatewayVpcAttachmentsPaginator -func NewDescribeTransitGatewayVpcAttachmentsPaginator(client DescribeTransitGatewayVpcAttachmentsAPIClient, params *DescribeTransitGatewayVpcAttachmentsInput, optFns ...func(*DescribeTransitGatewayVpcAttachmentsPaginatorOptions)) *DescribeTransitGatewayVpcAttachmentsPaginator { - if params == nil { - params = &DescribeTransitGatewayVpcAttachmentsInput{} - } - - options := DescribeTransitGatewayVpcAttachmentsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewayVpcAttachmentsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewayVpcAttachmentsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGatewayVpcAttachments page. -func (p *DescribeTransitGatewayVpcAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGatewayVpcAttachments(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewayVpcAttachmentsAPIClient is a client that implements the -// DescribeTransitGatewayVpcAttachments operation. -type DescribeTransitGatewayVpcAttachmentsAPIClient interface { - DescribeTransitGatewayVpcAttachments(context.Context, *DescribeTransitGatewayVpcAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) -} - -var _ DescribeTransitGatewayVpcAttachmentsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGatewayVpcAttachments(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGatewayVpcAttachments", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGateways.go deleted file mode 100644 index 1e2990d94..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTransitGateways.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more transit gateways. By default, all transit gateways are -// described. Alternatively, you can filter the results. -func (c *Client) DescribeTransitGateways(ctx context.Context, params *DescribeTransitGatewaysInput, optFns ...func(*Options)) (*DescribeTransitGatewaysOutput, error) { - if params == nil { - params = &DescribeTransitGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTransitGateways", params, optFns, c.addOperationDescribeTransitGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTransitGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTransitGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - options.propagation-default-route-table-id - The ID of the default - // propagation route table. - // - // - options.amazon-side-asn - The private ASN for the Amazon side of a BGP - // session. - // - // - options.association-default-route-table-id - The ID of the default - // association route table. - // - // - options.auto-accept-shared-attachments - Indicates whether there is - // automatic acceptance of attachment requests ( enable | disable ). - // - // - options.default-route-table-association - Indicates whether resource - // attachments are automatically associated with the default association route - // table ( enable | disable ). - // - // - options.default-route-table-propagation - Indicates whether resource - // attachments automatically propagate routes to the default propagation route - // table ( enable | disable ). - // - // - options.dns-support - Indicates whether DNS support is enabled ( enable | - // disable ). - // - // - options.vpn-ecmp-support - Indicates whether Equal Cost Multipath Protocol - // support is enabled ( enable | disable ). - // - // - owner-id - The ID of the Amazon Web Services account that owns the transit - // gateway. - // - // - state - The state of the transit gateway ( available | deleted | deleting | - // modifying | pending ). - // - // - transit-gateway-id - The ID of the transit gateway. - // - // - tag-key - The key/value combination of a tag assigned to the resource. Use - // the tag key in the filter name and the tag value as the filter value. For - // example, to find all resources that have a tag with the key Owner and the - // value TeamA , specify tag:Owner for the filter name and TeamA for the filter - // value. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the transit gateways. - TransitGatewayIds []string - - noSmithyDocumentSerde -} - -type DescribeTransitGatewaysOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the transit gateways. - TransitGateways []types.TransitGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTransitGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTransitGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTransitGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTransitGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTransitGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTransitGatewaysPaginatorOptions is the paginator options for -// DescribeTransitGateways -type DescribeTransitGatewaysPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTransitGatewaysPaginator is a paginator for DescribeTransitGateways -type DescribeTransitGatewaysPaginator struct { - options DescribeTransitGatewaysPaginatorOptions - client DescribeTransitGatewaysAPIClient - params *DescribeTransitGatewaysInput - nextToken *string - firstPage bool -} - -// NewDescribeTransitGatewaysPaginator returns a new -// DescribeTransitGatewaysPaginator -func NewDescribeTransitGatewaysPaginator(client DescribeTransitGatewaysAPIClient, params *DescribeTransitGatewaysInput, optFns ...func(*DescribeTransitGatewaysPaginatorOptions)) *DescribeTransitGatewaysPaginator { - if params == nil { - params = &DescribeTransitGatewaysInput{} - } - - options := DescribeTransitGatewaysPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTransitGatewaysPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTransitGatewaysPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTransitGateways page. -func (p *DescribeTransitGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewaysOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTransitGateways(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTransitGatewaysAPIClient is a client that implements the -// DescribeTransitGateways operation. -type DescribeTransitGatewaysAPIClient interface { - DescribeTransitGateways(context.Context, *DescribeTransitGatewaysInput, ...func(*Options)) (*DescribeTransitGatewaysOutput, error) -} - -var _ DescribeTransitGatewaysAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTransitGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTransitGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go deleted file mode 100644 index a97b3b82d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more network interface trunk associations. -func (c *Client) DescribeTrunkInterfaceAssociations(ctx context.Context, params *DescribeTrunkInterfaceAssociationsInput, optFns ...func(*Options)) (*DescribeTrunkInterfaceAssociationsOutput, error) { - if params == nil { - params = &DescribeTrunkInterfaceAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeTrunkInterfaceAssociations", params, optFns, c.addOperationDescribeTrunkInterfaceAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeTrunkInterfaceAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeTrunkInterfaceAssociationsInput struct { - - // The IDs of the associations. - AssociationIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - gre-key - The ID of a trunk interface association. - // - // - interface-protocol - The interface protocol. Valid values are VLAN and GRE . - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeTrunkInterfaceAssociationsOutput struct { - - // Information about the trunk associations. - InterfaceAssociations []types.TrunkInterfaceAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeTrunkInterfaceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeTrunkInterfaceAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeTrunkInterfaceAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrunkInterfaceAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrunkInterfaceAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeTrunkInterfaceAssociationsPaginatorOptions is the paginator options for -// DescribeTrunkInterfaceAssociations -type DescribeTrunkInterfaceAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeTrunkInterfaceAssociationsPaginator is a paginator for -// DescribeTrunkInterfaceAssociations -type DescribeTrunkInterfaceAssociationsPaginator struct { - options DescribeTrunkInterfaceAssociationsPaginatorOptions - client DescribeTrunkInterfaceAssociationsAPIClient - params *DescribeTrunkInterfaceAssociationsInput - nextToken *string - firstPage bool -} - -// NewDescribeTrunkInterfaceAssociationsPaginator returns a new -// DescribeTrunkInterfaceAssociationsPaginator -func NewDescribeTrunkInterfaceAssociationsPaginator(client DescribeTrunkInterfaceAssociationsAPIClient, params *DescribeTrunkInterfaceAssociationsInput, optFns ...func(*DescribeTrunkInterfaceAssociationsPaginatorOptions)) *DescribeTrunkInterfaceAssociationsPaginator { - if params == nil { - params = &DescribeTrunkInterfaceAssociationsInput{} - } - - options := DescribeTrunkInterfaceAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeTrunkInterfaceAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeTrunkInterfaceAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeTrunkInterfaceAssociations page. -func (p *DescribeTrunkInterfaceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrunkInterfaceAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeTrunkInterfaceAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeTrunkInterfaceAssociationsAPIClient is a client that implements the -// DescribeTrunkInterfaceAssociations operation. -type DescribeTrunkInterfaceAssociationsAPIClient interface { - DescribeTrunkInterfaceAssociations(context.Context, *DescribeTrunkInterfaceAssociationsInput, ...func(*Options)) (*DescribeTrunkInterfaceAssociationsOutput, error) -} - -var _ DescribeTrunkInterfaceAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeTrunkInterfaceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeTrunkInterfaceAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessEndpoints.go deleted file mode 100644 index cbe9f60a2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessEndpoints.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Amazon Web Services Verified Access endpoints. -func (c *Client) DescribeVerifiedAccessEndpoints(ctx context.Context, params *DescribeVerifiedAccessEndpointsInput, optFns ...func(*Options)) (*DescribeVerifiedAccessEndpointsOutput, error) { - if params == nil { - params = &DescribeVerifiedAccessEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVerifiedAccessEndpoints", params, optFns, c.addOperationDescribeVerifiedAccessEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVerifiedAccessEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVerifiedAccessEndpointsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the Verified Access endpoint. - VerifiedAccessEndpointIds []string - - // The ID of the Verified Access group. - VerifiedAccessGroupId *string - - // The ID of the Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -type DescribeVerifiedAccessEndpointsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Details about the Verified Access endpoints. - VerifiedAccessEndpoints []types.VerifiedAccessEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVerifiedAccessEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVerifiedAccessEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVerifiedAccessEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVerifiedAccessEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVerifiedAccessEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVerifiedAccessEndpointsPaginatorOptions is the paginator options for -// DescribeVerifiedAccessEndpoints -type DescribeVerifiedAccessEndpointsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVerifiedAccessEndpointsPaginator is a paginator for -// DescribeVerifiedAccessEndpoints -type DescribeVerifiedAccessEndpointsPaginator struct { - options DescribeVerifiedAccessEndpointsPaginatorOptions - client DescribeVerifiedAccessEndpointsAPIClient - params *DescribeVerifiedAccessEndpointsInput - nextToken *string - firstPage bool -} - -// NewDescribeVerifiedAccessEndpointsPaginator returns a new -// DescribeVerifiedAccessEndpointsPaginator -func NewDescribeVerifiedAccessEndpointsPaginator(client DescribeVerifiedAccessEndpointsAPIClient, params *DescribeVerifiedAccessEndpointsInput, optFns ...func(*DescribeVerifiedAccessEndpointsPaginatorOptions)) *DescribeVerifiedAccessEndpointsPaginator { - if params == nil { - params = &DescribeVerifiedAccessEndpointsInput{} - } - - options := DescribeVerifiedAccessEndpointsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVerifiedAccessEndpointsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVerifiedAccessEndpointsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVerifiedAccessEndpoints page. -func (p *DescribeVerifiedAccessEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVerifiedAccessEndpointsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVerifiedAccessEndpoints(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVerifiedAccessEndpointsAPIClient is a client that implements the -// DescribeVerifiedAccessEndpoints operation. -type DescribeVerifiedAccessEndpointsAPIClient interface { - DescribeVerifiedAccessEndpoints(context.Context, *DescribeVerifiedAccessEndpointsInput, ...func(*Options)) (*DescribeVerifiedAccessEndpointsOutput, error) -} - -var _ DescribeVerifiedAccessEndpointsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVerifiedAccessEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVerifiedAccessEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessGroups.go deleted file mode 100644 index e51f27b5b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessGroups.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Verified Access groups. -func (c *Client) DescribeVerifiedAccessGroups(ctx context.Context, params *DescribeVerifiedAccessGroupsInput, optFns ...func(*Options)) (*DescribeVerifiedAccessGroupsOutput, error) { - if params == nil { - params = &DescribeVerifiedAccessGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVerifiedAccessGroups", params, optFns, c.addOperationDescribeVerifiedAccessGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVerifiedAccessGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVerifiedAccessGroupsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the Verified Access groups. - VerifiedAccessGroupIds []string - - // The ID of the Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -type DescribeVerifiedAccessGroupsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Details about the Verified Access groups. - VerifiedAccessGroups []types.VerifiedAccessGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVerifiedAccessGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVerifiedAccessGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVerifiedAccessGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVerifiedAccessGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVerifiedAccessGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVerifiedAccessGroupsPaginatorOptions is the paginator options for -// DescribeVerifiedAccessGroups -type DescribeVerifiedAccessGroupsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVerifiedAccessGroupsPaginator is a paginator for -// DescribeVerifiedAccessGroups -type DescribeVerifiedAccessGroupsPaginator struct { - options DescribeVerifiedAccessGroupsPaginatorOptions - client DescribeVerifiedAccessGroupsAPIClient - params *DescribeVerifiedAccessGroupsInput - nextToken *string - firstPage bool -} - -// NewDescribeVerifiedAccessGroupsPaginator returns a new -// DescribeVerifiedAccessGroupsPaginator -func NewDescribeVerifiedAccessGroupsPaginator(client DescribeVerifiedAccessGroupsAPIClient, params *DescribeVerifiedAccessGroupsInput, optFns ...func(*DescribeVerifiedAccessGroupsPaginatorOptions)) *DescribeVerifiedAccessGroupsPaginator { - if params == nil { - params = &DescribeVerifiedAccessGroupsInput{} - } - - options := DescribeVerifiedAccessGroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVerifiedAccessGroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVerifiedAccessGroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVerifiedAccessGroups page. -func (p *DescribeVerifiedAccessGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVerifiedAccessGroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVerifiedAccessGroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVerifiedAccessGroupsAPIClient is a client that implements the -// DescribeVerifiedAccessGroups operation. -type DescribeVerifiedAccessGroupsAPIClient interface { - DescribeVerifiedAccessGroups(context.Context, *DescribeVerifiedAccessGroupsInput, ...func(*Options)) (*DescribeVerifiedAccessGroupsOutput, error) -} - -var _ DescribeVerifiedAccessGroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVerifiedAccessGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVerifiedAccessGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstanceLoggingConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstanceLoggingConfigurations.go deleted file mode 100644 index bb555f04f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstanceLoggingConfigurations.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Amazon Web Services Verified Access instances. -func (c *Client) DescribeVerifiedAccessInstanceLoggingConfigurations(ctx context.Context, params *DescribeVerifiedAccessInstanceLoggingConfigurationsInput, optFns ...func(*Options)) (*DescribeVerifiedAccessInstanceLoggingConfigurationsOutput, error) { - if params == nil { - params = &DescribeVerifiedAccessInstanceLoggingConfigurationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVerifiedAccessInstanceLoggingConfigurations", params, optFns, c.addOperationDescribeVerifiedAccessInstanceLoggingConfigurationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVerifiedAccessInstanceLoggingConfigurationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVerifiedAccessInstanceLoggingConfigurationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the Verified Access instances. - VerifiedAccessInstanceIds []string - - noSmithyDocumentSerde -} - -type DescribeVerifiedAccessInstanceLoggingConfigurationsOutput struct { - - // The logging configuration for the Verified Access instances. - LoggingConfigurations []types.VerifiedAccessInstanceLoggingConfiguration - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVerifiedAccessInstanceLoggingConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVerifiedAccessInstanceLoggingConfigurations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVerifiedAccessInstanceLoggingConfigurations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVerifiedAccessInstanceLoggingConfigurations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVerifiedAccessInstanceLoggingConfigurations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVerifiedAccessInstanceLoggingConfigurationsPaginatorOptions is the -// paginator options for DescribeVerifiedAccessInstanceLoggingConfigurations -type DescribeVerifiedAccessInstanceLoggingConfigurationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator is a paginator for -// DescribeVerifiedAccessInstanceLoggingConfigurations -type DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator struct { - options DescribeVerifiedAccessInstanceLoggingConfigurationsPaginatorOptions - client DescribeVerifiedAccessInstanceLoggingConfigurationsAPIClient - params *DescribeVerifiedAccessInstanceLoggingConfigurationsInput - nextToken *string - firstPage bool -} - -// NewDescribeVerifiedAccessInstanceLoggingConfigurationsPaginator returns a new -// DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator -func NewDescribeVerifiedAccessInstanceLoggingConfigurationsPaginator(client DescribeVerifiedAccessInstanceLoggingConfigurationsAPIClient, params *DescribeVerifiedAccessInstanceLoggingConfigurationsInput, optFns ...func(*DescribeVerifiedAccessInstanceLoggingConfigurationsPaginatorOptions)) *DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator { - if params == nil { - params = &DescribeVerifiedAccessInstanceLoggingConfigurationsInput{} - } - - options := DescribeVerifiedAccessInstanceLoggingConfigurationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVerifiedAccessInstanceLoggingConfigurations -// page. -func (p *DescribeVerifiedAccessInstanceLoggingConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVerifiedAccessInstanceLoggingConfigurationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVerifiedAccessInstanceLoggingConfigurations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVerifiedAccessInstanceLoggingConfigurationsAPIClient is a client that -// implements the DescribeVerifiedAccessInstanceLoggingConfigurations operation. -type DescribeVerifiedAccessInstanceLoggingConfigurationsAPIClient interface { - DescribeVerifiedAccessInstanceLoggingConfigurations(context.Context, *DescribeVerifiedAccessInstanceLoggingConfigurationsInput, ...func(*Options)) (*DescribeVerifiedAccessInstanceLoggingConfigurationsOutput, error) -} - -var _ DescribeVerifiedAccessInstanceLoggingConfigurationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVerifiedAccessInstanceLoggingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVerifiedAccessInstanceLoggingConfigurations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstances.go deleted file mode 100644 index 7e1114ba3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessInstances.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Amazon Web Services Verified Access instances. -func (c *Client) DescribeVerifiedAccessInstances(ctx context.Context, params *DescribeVerifiedAccessInstancesInput, optFns ...func(*Options)) (*DescribeVerifiedAccessInstancesOutput, error) { - if params == nil { - params = &DescribeVerifiedAccessInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVerifiedAccessInstances", params, optFns, c.addOperationDescribeVerifiedAccessInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVerifiedAccessInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVerifiedAccessInstancesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the Verified Access instances. - VerifiedAccessInstanceIds []string - - noSmithyDocumentSerde -} - -type DescribeVerifiedAccessInstancesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Details about the Verified Access instances. - VerifiedAccessInstances []types.VerifiedAccessInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVerifiedAccessInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVerifiedAccessInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVerifiedAccessInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVerifiedAccessInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVerifiedAccessInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVerifiedAccessInstancesPaginatorOptions is the paginator options for -// DescribeVerifiedAccessInstances -type DescribeVerifiedAccessInstancesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVerifiedAccessInstancesPaginator is a paginator for -// DescribeVerifiedAccessInstances -type DescribeVerifiedAccessInstancesPaginator struct { - options DescribeVerifiedAccessInstancesPaginatorOptions - client DescribeVerifiedAccessInstancesAPIClient - params *DescribeVerifiedAccessInstancesInput - nextToken *string - firstPage bool -} - -// NewDescribeVerifiedAccessInstancesPaginator returns a new -// DescribeVerifiedAccessInstancesPaginator -func NewDescribeVerifiedAccessInstancesPaginator(client DescribeVerifiedAccessInstancesAPIClient, params *DescribeVerifiedAccessInstancesInput, optFns ...func(*DescribeVerifiedAccessInstancesPaginatorOptions)) *DescribeVerifiedAccessInstancesPaginator { - if params == nil { - params = &DescribeVerifiedAccessInstancesInput{} - } - - options := DescribeVerifiedAccessInstancesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVerifiedAccessInstancesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVerifiedAccessInstancesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVerifiedAccessInstances page. -func (p *DescribeVerifiedAccessInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVerifiedAccessInstancesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVerifiedAccessInstances(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVerifiedAccessInstancesAPIClient is a client that implements the -// DescribeVerifiedAccessInstances operation. -type DescribeVerifiedAccessInstancesAPIClient interface { - DescribeVerifiedAccessInstances(context.Context, *DescribeVerifiedAccessInstancesInput, ...func(*Options)) (*DescribeVerifiedAccessInstancesOutput, error) -} - -var _ DescribeVerifiedAccessInstancesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVerifiedAccessInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVerifiedAccessInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessTrustProviders.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessTrustProviders.go deleted file mode 100644 index 52f195203..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVerifiedAccessTrustProviders.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified Amazon Web Services Verified Access trust providers. -func (c *Client) DescribeVerifiedAccessTrustProviders(ctx context.Context, params *DescribeVerifiedAccessTrustProvidersInput, optFns ...func(*Options)) (*DescribeVerifiedAccessTrustProvidersOutput, error) { - if params == nil { - params = &DescribeVerifiedAccessTrustProvidersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVerifiedAccessTrustProviders", params, optFns, c.addOperationDescribeVerifiedAccessTrustProvidersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVerifiedAccessTrustProvidersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVerifiedAccessTrustProvidersInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. Filter names and values are case-sensitive. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The IDs of the Verified Access trust providers. - VerifiedAccessTrustProviderIds []string - - noSmithyDocumentSerde -} - -type DescribeVerifiedAccessTrustProvidersOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Details about the Verified Access trust providers. - VerifiedAccessTrustProviders []types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVerifiedAccessTrustProvidersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVerifiedAccessTrustProviders{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVerifiedAccessTrustProviders{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVerifiedAccessTrustProviders"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVerifiedAccessTrustProviders(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVerifiedAccessTrustProvidersPaginatorOptions is the paginator options -// for DescribeVerifiedAccessTrustProviders -type DescribeVerifiedAccessTrustProvidersPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVerifiedAccessTrustProvidersPaginator is a paginator for -// DescribeVerifiedAccessTrustProviders -type DescribeVerifiedAccessTrustProvidersPaginator struct { - options DescribeVerifiedAccessTrustProvidersPaginatorOptions - client DescribeVerifiedAccessTrustProvidersAPIClient - params *DescribeVerifiedAccessTrustProvidersInput - nextToken *string - firstPage bool -} - -// NewDescribeVerifiedAccessTrustProvidersPaginator returns a new -// DescribeVerifiedAccessTrustProvidersPaginator -func NewDescribeVerifiedAccessTrustProvidersPaginator(client DescribeVerifiedAccessTrustProvidersAPIClient, params *DescribeVerifiedAccessTrustProvidersInput, optFns ...func(*DescribeVerifiedAccessTrustProvidersPaginatorOptions)) *DescribeVerifiedAccessTrustProvidersPaginator { - if params == nil { - params = &DescribeVerifiedAccessTrustProvidersInput{} - } - - options := DescribeVerifiedAccessTrustProvidersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVerifiedAccessTrustProvidersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVerifiedAccessTrustProvidersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVerifiedAccessTrustProviders page. -func (p *DescribeVerifiedAccessTrustProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVerifiedAccessTrustProvidersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVerifiedAccessTrustProviders(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVerifiedAccessTrustProvidersAPIClient is a client that implements the -// DescribeVerifiedAccessTrustProviders operation. -type DescribeVerifiedAccessTrustProvidersAPIClient interface { - DescribeVerifiedAccessTrustProviders(context.Context, *DescribeVerifiedAccessTrustProvidersInput, ...func(*Options)) (*DescribeVerifiedAccessTrustProvidersOutput, error) -} - -var _ DescribeVerifiedAccessTrustProvidersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVerifiedAccessTrustProviders(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVerifiedAccessTrustProviders", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeAttribute.go deleted file mode 100644 index 5834d5dae..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeAttribute.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified volume. You can specify only -// one attribute at a time. -// -// For more information about EBS volumes, see [Amazon EBS volumes] in the Amazon EBS User Guide. -// -// [Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes.html -func (c *Client) DescribeVolumeAttribute(ctx context.Context, params *DescribeVolumeAttributeInput, optFns ...func(*Options)) (*DescribeVolumeAttributeOutput, error) { - if params == nil { - params = &DescribeVolumeAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVolumeAttribute", params, optFns, c.addOperationDescribeVolumeAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVolumeAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVolumeAttributeInput struct { - - // The attribute of the volume. This parameter is required. - // - // This member is required. - Attribute types.VolumeAttributeName - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeVolumeAttributeOutput struct { - - // The state of autoEnableIO attribute. - AutoEnableIO *types.AttributeBooleanValue - - // A list of product codes. - ProductCodes []types.ProductCode - - // The ID of the volume. - VolumeId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVolumeAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVolumeAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVolumeAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVolumeAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeVolumeAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVolumeAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVolumeAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVolumeAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeStatus.go deleted file mode 100644 index fa6238e61..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumeStatus.go +++ /dev/null @@ -1,348 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the status of the specified volumes. Volume status provides the -// result of the checks performed on your volumes to determine events that can -// impair the performance of your volumes. The performance of a volume can be -// affected if an issue occurs on the volume's underlying host. If the volume's -// underlying host experiences a power outage or system issue, after the system is -// restored, there could be data inconsistencies on the volume. Volume events -// notify you if this occurs. Volume actions notify you if any action needs to be -// taken in response to the event. -// -// The DescribeVolumeStatus operation provides the following information about the -// specified volumes: -// -// Status: Reflects the current status of the volume. The possible values are ok , -// impaired , warning , or insufficient-data . If all checks pass, the overall -// status of the volume is ok . If the check fails, the overall status is impaired -// . If the status is insufficient-data , then the checks might still be taking -// place on your volume at the time. We recommend that you retry the request. For -// more information about volume status, see [Monitor the status of your volumes]in the Amazon EBS User Guide. -// -// Events: Reflect the cause of a volume status and might require you to take -// action. For example, if your volume returns an impaired status, then the volume -// event might be potential-data-inconsistency . This means that your volume has -// been affected by an issue with the underlying host, has all I/O operations -// disabled, and might have inconsistent data. -// -// Actions: Reflect the actions you might have to take in response to an event. -// For example, if the status of the volume is impaired and the volume event shows -// potential-data-inconsistency , then the action shows enable-volume-io . This -// means that you may want to enable the I/O operations for the volume by calling -// the EnableVolumeIOaction and then check the volume for data consistency. -// -// Volume status is based on the volume status checks, and does not reflect the -// volume state. Therefore, volume status does not indicate volumes in the error -// state (for example, when a volume is incapable of accepting I/O.) -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Monitor the status of your volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-status.html -func (c *Client) DescribeVolumeStatus(ctx context.Context, params *DescribeVolumeStatusInput, optFns ...func(*Options)) (*DescribeVolumeStatusOutput, error) { - if params == nil { - params = &DescribeVolumeStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVolumeStatus", params, optFns, c.addOperationDescribeVolumeStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVolumeStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVolumeStatusInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - action.code - The action code for the event (for example, enable-volume-io ). - // - // - action.description - A description of the action. - // - // - action.event-id - The event ID associated with the action. - // - // - availability-zone - The Availability Zone of the instance. - // - // - event.description - A description of the event. - // - // - event.event-id - The event ID. - // - // - event.event-type - The event type (for io-enabled : passed | failed ; for - // io-performance : io-performance:degraded | io-performance:severely-degraded | - // io-performance:stalled ). - // - // - event.not-after - The latest end time for the event. - // - // - event.not-before - The earliest start time for the event. - // - // - volume-status.details-name - The cause for volume-status.status ( io-enabled - // | io-performance ). - // - // - volume-status.details-status - The status of volume-status.details-name (for - // io-enabled : passed | failed ; for io-performance : normal | degraded | - // severely-degraded | stalled ). - // - // - volume-status.status - The status of the volume ( ok | impaired | warning | - // insufficient-data ). - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the volumes. - // - // Default: Describes all your volumes. - VolumeIds []string - - noSmithyDocumentSerde -} - -type DescribeVolumeStatusOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the status of the volumes. - VolumeStatuses []types.VolumeStatusItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVolumeStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVolumeStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVolumeStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVolumeStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVolumeStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVolumeStatusPaginatorOptions is the paginator options for -// DescribeVolumeStatus -type DescribeVolumeStatusPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVolumeStatusPaginator is a paginator for DescribeVolumeStatus -type DescribeVolumeStatusPaginator struct { - options DescribeVolumeStatusPaginatorOptions - client DescribeVolumeStatusAPIClient - params *DescribeVolumeStatusInput - nextToken *string - firstPage bool -} - -// NewDescribeVolumeStatusPaginator returns a new DescribeVolumeStatusPaginator -func NewDescribeVolumeStatusPaginator(client DescribeVolumeStatusAPIClient, params *DescribeVolumeStatusInput, optFns ...func(*DescribeVolumeStatusPaginatorOptions)) *DescribeVolumeStatusPaginator { - if params == nil { - params = &DescribeVolumeStatusInput{} - } - - options := DescribeVolumeStatusPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVolumeStatusPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVolumeStatusPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVolumeStatus page. -func (p *DescribeVolumeStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumeStatusOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVolumeStatus(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVolumeStatusAPIClient is a client that implements the -// DescribeVolumeStatus operation. -type DescribeVolumeStatusAPIClient interface { - DescribeVolumeStatus(context.Context, *DescribeVolumeStatusInput, ...func(*Options)) (*DescribeVolumeStatusOutput, error) -} - -var _ DescribeVolumeStatusAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVolumeStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVolumeStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumes.go deleted file mode 100644 index 13b6f6246..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumes.go +++ /dev/null @@ -1,957 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes the specified EBS volumes or all of your EBS volumes. -// -// If you are describing a long list of volumes, we recommend that you paginate -// the output to make the list more manageable. For more information, see [Pagination]. -// -// For more information about EBS volumes, see [Amazon EBS volumes] in the Amazon EBS User Guide. -// -// We strongly recommend using only paginated requests. Unpaginated requests are -// susceptible to throttling and timeouts. -// -// The order of the elements in the response, including those within nested -// structures, might vary. Applications should not assume the elements appear in a -// particular order. -// -// [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination -// [Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes.html -func (c *Client) DescribeVolumes(ctx context.Context, params *DescribeVolumesInput, optFns ...func(*Options)) (*DescribeVolumesOutput, error) { - if params == nil { - params = &DescribeVolumesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVolumes", params, optFns, c.addOperationDescribeVolumesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVolumesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVolumesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - attachment.attach-time - The time stamp when the attachment initiated. - // - // - attachment.delete-on-termination - Whether the volume is deleted on instance - // termination. - // - // - attachment.device - The device name specified in the block device mapping - // (for example, /dev/sda1 ). - // - // - attachment.instance-id - The ID of the instance the volume is attached to. - // - // - attachment.status - The attachment state ( attaching | attached | detaching - // ). - // - // - availability-zone - The Availability Zone in which the volume was created. - // - // - create-time - The time stamp when the volume was created. - // - // - encrypted - Indicates whether the volume is encrypted ( true | false ) - // - // - fast-restored - Indicates whether the volume was created from a snapshot - // that is enabled for fast snapshot restore ( true | false ). - // - // - multi-attach-enabled - Indicates whether the volume is enabled for - // Multi-Attach ( true | false ) - // - // - operator.managed - A Boolean that indicates whether this is a managed volume. - // - // - operator.principal - The principal that manages the volume. Only valid for - // managed volumes, where managed is true . - // - // - size - The size of the volume, in GiB. - // - // - snapshot-id - The snapshot from which the volume was created. - // - // - status - The state of the volume ( creating | available | in-use | deleting - // | deleted | error ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - volume-id - The volume ID. - // - // - volume-type - The Amazon EBS volume type ( gp2 | gp3 | io1 | io2 | st1 | sc1 - // | standard ) - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The volume IDs. If not specified, then all volumes are included in the response. - VolumeIds []string - - noSmithyDocumentSerde -} - -type DescribeVolumesOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the volumes. - Volumes []types.Volume - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVolumesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVolumes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVolumes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVolumes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVolumes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// VolumeAvailableWaiterOptions are waiter options for VolumeAvailableWaiter -type VolumeAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VolumeAvailableWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VolumeAvailableWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVolumesInput, *DescribeVolumesOutput, error) (bool, error) -} - -// VolumeAvailableWaiter defines the waiters for VolumeAvailable -type VolumeAvailableWaiter struct { - client DescribeVolumesAPIClient - - options VolumeAvailableWaiterOptions -} - -// NewVolumeAvailableWaiter constructs a VolumeAvailableWaiter. -func NewVolumeAvailableWaiter(client DescribeVolumesAPIClient, optFns ...func(*VolumeAvailableWaiterOptions)) *VolumeAvailableWaiter { - options := VolumeAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = volumeAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VolumeAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VolumeAvailable waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *VolumeAvailableWaiter) Wait(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VolumeAvailable waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *VolumeAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeAvailableWaiterOptions)) (*DescribeVolumesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVolumes(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VolumeAvailable waiter") -} - -func volumeAvailableStateRetryable(ctx context.Context, input *DescribeVolumesInput, output *DescribeVolumesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Volumes - var v2 []types.VolumeState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Volumes - var v2 []types.VolumeState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// VolumeDeletedWaiterOptions are waiter options for VolumeDeletedWaiter -type VolumeDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VolumeDeletedWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VolumeDeletedWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVolumesInput, *DescribeVolumesOutput, error) (bool, error) -} - -// VolumeDeletedWaiter defines the waiters for VolumeDeleted -type VolumeDeletedWaiter struct { - client DescribeVolumesAPIClient - - options VolumeDeletedWaiterOptions -} - -// NewVolumeDeletedWaiter constructs a VolumeDeletedWaiter. -func NewVolumeDeletedWaiter(client DescribeVolumesAPIClient, optFns ...func(*VolumeDeletedWaiterOptions)) *VolumeDeletedWaiter { - options := VolumeDeletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = volumeDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VolumeDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VolumeDeleted waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VolumeDeletedWaiter) Wait(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VolumeDeleted waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *VolumeDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeDeletedWaiterOptions)) (*DescribeVolumesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVolumes(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VolumeDeleted waiter") -} - -func volumeDeletedStateRetryable(ctx context.Context, input *DescribeVolumesInput, output *DescribeVolumesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Volumes - var v2 []types.VolumeState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidVolume.NotFound" == apiErr.ErrorCode() { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// VolumeInUseWaiterOptions are waiter options for VolumeInUseWaiter -type VolumeInUseWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VolumeInUseWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VolumeInUseWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVolumesInput, *DescribeVolumesOutput, error) (bool, error) -} - -// VolumeInUseWaiter defines the waiters for VolumeInUse -type VolumeInUseWaiter struct { - client DescribeVolumesAPIClient - - options VolumeInUseWaiterOptions -} - -// NewVolumeInUseWaiter constructs a VolumeInUseWaiter. -func NewVolumeInUseWaiter(client DescribeVolumesAPIClient, optFns ...func(*VolumeInUseWaiterOptions)) *VolumeInUseWaiter { - options := VolumeInUseWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = volumeInUseStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VolumeInUseWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VolumeInUse waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VolumeInUseWaiter) Wait(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeInUseWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VolumeInUse waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *VolumeInUseWaiter) WaitForOutput(ctx context.Context, params *DescribeVolumesInput, maxWaitDur time.Duration, optFns ...func(*VolumeInUseWaiterOptions)) (*DescribeVolumesOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVolumes(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VolumeInUse waiter") -} - -func volumeInUseStateRetryable(ctx context.Context, input *DescribeVolumesInput, output *DescribeVolumesOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Volumes - var v2 []types.VolumeState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "in-use" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.Volumes - var v2 []types.VolumeState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeVolumesPaginatorOptions is the paginator options for DescribeVolumes -type DescribeVolumesPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVolumesPaginator is a paginator for DescribeVolumes -type DescribeVolumesPaginator struct { - options DescribeVolumesPaginatorOptions - client DescribeVolumesAPIClient - params *DescribeVolumesInput - nextToken *string - firstPage bool -} - -// NewDescribeVolumesPaginator returns a new DescribeVolumesPaginator -func NewDescribeVolumesPaginator(client DescribeVolumesAPIClient, params *DescribeVolumesInput, optFns ...func(*DescribeVolumesPaginatorOptions)) *DescribeVolumesPaginator { - if params == nil { - params = &DescribeVolumesInput{} - } - - options := DescribeVolumesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVolumesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVolumesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVolumes page. -func (p *DescribeVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVolumes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVolumesAPIClient is a client that implements the DescribeVolumes -// operation. -type DescribeVolumesAPIClient interface { - DescribeVolumes(context.Context, *DescribeVolumesInput, ...func(*Options)) (*DescribeVolumesOutput, error) -} - -var _ DescribeVolumesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVolumes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVolumes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumesModifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumesModifications.go deleted file mode 100644 index 69e2e7ad8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVolumesModifications.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the most recent volume modification request for the specified EBS -// volumes. -// -// For more information, see [Monitor the progress of volume modifications] in the Amazon EBS User Guide. -// -// [Monitor the progress of volume modifications]: https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html -func (c *Client) DescribeVolumesModifications(ctx context.Context, params *DescribeVolumesModificationsInput, optFns ...func(*Options)) (*DescribeVolumesModificationsOutput, error) { - if params == nil { - params = &DescribeVolumesModificationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVolumesModifications", params, optFns, c.addOperationDescribeVolumesModificationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVolumesModificationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVolumesModificationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - modification-state - The current modification state (modifying | optimizing - // | completed | failed). - // - // - original-iops - The original IOPS rate of the volume. - // - // - original-size - The original size of the volume, in GiB. - // - // - original-volume-type - The original volume type of the volume (standard | - // io1 | io2 | gp2 | sc1 | st1). - // - // - originalMultiAttachEnabled - Indicates whether Multi-Attach support was - // enabled (true | false). - // - // - start-time - The modification start time. - // - // - target-iops - The target IOPS rate of the volume. - // - // - target-size - The target size of the volume, in GiB. - // - // - target-volume-type - The target volume type of the volume (standard | io1 | - // io2 | gp2 | sc1 | st1). - // - // - targetMultiAttachEnabled - Indicates whether Multi-Attach support is to be - // enabled (true | false). - // - // - volume-id - The ID of the volume. - Filters []types.Filter - - // The maximum number of results (up to a limit of 500) to be returned in a - // paginated request. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the volumes. - VolumeIds []string - - noSmithyDocumentSerde -} - -type DescribeVolumesModificationsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the volume modifications. - VolumesModifications []types.VolumeModification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVolumesModificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVolumesModifications{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVolumesModifications{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVolumesModifications"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVolumesModifications(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVolumesModificationsPaginatorOptions is the paginator options for -// DescribeVolumesModifications -type DescribeVolumesModificationsPaginatorOptions struct { - // The maximum number of results (up to a limit of 500) to be returned in a - // paginated request. For more information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVolumesModificationsPaginator is a paginator for -// DescribeVolumesModifications -type DescribeVolumesModificationsPaginator struct { - options DescribeVolumesModificationsPaginatorOptions - client DescribeVolumesModificationsAPIClient - params *DescribeVolumesModificationsInput - nextToken *string - firstPage bool -} - -// NewDescribeVolumesModificationsPaginator returns a new -// DescribeVolumesModificationsPaginator -func NewDescribeVolumesModificationsPaginator(client DescribeVolumesModificationsAPIClient, params *DescribeVolumesModificationsInput, optFns ...func(*DescribeVolumesModificationsPaginatorOptions)) *DescribeVolumesModificationsPaginator { - if params == nil { - params = &DescribeVolumesModificationsInput{} - } - - options := DescribeVolumesModificationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVolumesModificationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVolumesModificationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVolumesModifications page. -func (p *DescribeVolumesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesModificationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVolumesModifications(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVolumesModificationsAPIClient is a client that implements the -// DescribeVolumesModifications operation. -type DescribeVolumesModificationsAPIClient interface { - DescribeVolumesModifications(context.Context, *DescribeVolumesModificationsInput, ...func(*Options)) (*DescribeVolumesModificationsOutput, error) -} - -var _ DescribeVolumesModificationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVolumesModifications(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVolumesModifications", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcAttribute.go deleted file mode 100644 index 8dfa29556..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcAttribute.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. -func (c *Client) DescribeVpcAttribute(ctx context.Context, params *DescribeVpcAttributeInput, optFns ...func(*Options)) (*DescribeVpcAttributeOutput, error) { - if params == nil { - params = &DescribeVpcAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcAttribute", params, optFns, c.addOperationDescribeVpcAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcAttributeInput struct { - - // The VPC attribute. - // - // This member is required. - Attribute types.VpcAttributeName - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeVpcAttributeOutput struct { - - // Indicates whether the instances launched in the VPC get DNS hostnames. If this - // attribute is true , instances in the VPC get DNS hostnames; otherwise, they do - // not. - EnableDnsHostnames *types.AttributeBooleanValue - - // Indicates whether DNS resolution is enabled for the VPC. If this attribute is - // true , the Amazon DNS server resolves DNS hostnames for your instances to their - // corresponding IP addresses; otherwise, it does not. - EnableDnsSupport *types.AttributeBooleanValue - - // Indicates whether Network Address Usage metrics are enabled for your VPC. - EnableNetworkAddressUsageMetrics *types.AttributeBooleanValue - - // The ID of the VPC. - VpcId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeVpcAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go deleted file mode 100644 index 5f7868172..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describe VPC Block Public Access (BPA) exclusions. A VPC BPA exclusion is a -// mode that can be applied to a single VPC or subnet that exempts it from the -// account’s BPA mode and will allow bidirectional or egress-only access. You can -// create BPA exclusions for VPCs and subnets even when BPA is not enabled on the -// account to ensure that there is no traffic disruption to the exclusions when VPC -// BPA is turned on. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -func (c *Client) DescribeVpcBlockPublicAccessExclusions(ctx context.Context, params *DescribeVpcBlockPublicAccessExclusionsInput, optFns ...func(*Options)) (*DescribeVpcBlockPublicAccessExclusionsOutput, error) { - if params == nil { - params = &DescribeVpcBlockPublicAccessExclusionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcBlockPublicAccessExclusions", params, optFns, c.addOperationDescribeVpcBlockPublicAccessExclusionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcBlockPublicAccessExclusionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcBlockPublicAccessExclusionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // IDs of exclusions. - ExclusionIds []string - - // Filters for the request: - // - // - resource-arn - The Amazon Resource Name (ARN) of a exclusion. - // - // - internet-gateway-exclusion-mode - The mode of a VPC BPA exclusion. Possible - // values: allow-bidirectional | allow-egress . - // - // - state - The state of VPC BPA. Possible values: create-in-progress | - // create-complete | update-in-progress | update-complete | delete-in-progress | - // deleted-complete | disable-in-progress | disable-complete - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - tag-value : The value of a tag assigned to the resource. Use this filter to - // find all resources assigned a tag with a specific value, regardless of the tag - // key. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeVpcBlockPublicAccessExclusionsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Details related to the exclusions. - VpcBlockPublicAccessExclusions []types.VpcBlockPublicAccessExclusion - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcBlockPublicAccessExclusionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcBlockPublicAccessExclusions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcBlockPublicAccessExclusions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcBlockPublicAccessExclusions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcBlockPublicAccessExclusions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcBlockPublicAccessExclusions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcBlockPublicAccessExclusions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go deleted file mode 100644 index 16267e889..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describe VPC Block Public Access (BPA) options. VPC Block Public Access (BPA) -// enables you to block resources in VPCs and subnets that you own in a Region from -// reaching or being reached from the internet through internet gateways and -// egress-only internet gateways. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon -// VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -func (c *Client) DescribeVpcBlockPublicAccessOptions(ctx context.Context, params *DescribeVpcBlockPublicAccessOptionsInput, optFns ...func(*Options)) (*DescribeVpcBlockPublicAccessOptionsOutput, error) { - if params == nil { - params = &DescribeVpcBlockPublicAccessOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcBlockPublicAccessOptions", params, optFns, c.addOperationDescribeVpcBlockPublicAccessOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcBlockPublicAccessOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcBlockPublicAccessOptionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DescribeVpcBlockPublicAccessOptionsOutput struct { - - // Details related to the options. - VpcBlockPublicAccessOptions *types.VpcBlockPublicAccessOptions - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcBlockPublicAccessOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcBlockPublicAccessOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcBlockPublicAccessOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcBlockPublicAccessOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcBlockPublicAccessOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcBlockPublicAccessOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcBlockPublicAccessOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLink.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLink.go deleted file mode 100644 index 3e61ed0b0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLink.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Describes the ClassicLink status of the specified VPCs. -func (c *Client) DescribeVpcClassicLink(ctx context.Context, params *DescribeVpcClassicLinkInput, optFns ...func(*Options)) (*DescribeVpcClassicLinkOutput, error) { - if params == nil { - params = &DescribeVpcClassicLinkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcClassicLink", params, optFns, c.addOperationDescribeVpcClassicLinkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcClassicLinkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcClassicLinkInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - is-classic-link-enabled - Whether the VPC is enabled for ClassicLink ( true - // | false ). - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The VPCs for which you want to describe the ClassicLink status. - VpcIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcClassicLinkOutput struct { - - // The ClassicLink status of the VPCs. - Vpcs []types.VpcClassicLink - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcClassicLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcClassicLink"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcClassicLink(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcClassicLink(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcClassicLink", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go deleted file mode 100644 index f68bed780..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Describes the ClassicLink DNS support status of one or more VPCs. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private IP -// address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private IP -// address when addressed from a linked EC2-Classic instance. -func (c *Client) DescribeVpcClassicLinkDnsSupport(ctx context.Context, params *DescribeVpcClassicLinkDnsSupportInput, optFns ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - if params == nil { - params = &DescribeVpcClassicLinkDnsSupportInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcClassicLinkDnsSupport", params, optFns, c.addOperationDescribeVpcClassicLinkDnsSupportMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcClassicLinkDnsSupportOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcClassicLinkDnsSupportInput struct { - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the VPCs. - VpcIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcClassicLinkDnsSupportOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the ClassicLink DNS support status of the VPCs. - Vpcs []types.ClassicLinkDnsSupport - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcClassicLinkDnsSupportMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcClassicLinkDnsSupport"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcClassicLinkDnsSupport(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcClassicLinkDnsSupportPaginatorOptions is the paginator options for -// DescribeVpcClassicLinkDnsSupport -type DescribeVpcClassicLinkDnsSupportPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcClassicLinkDnsSupportPaginator is a paginator for -// DescribeVpcClassicLinkDnsSupport -type DescribeVpcClassicLinkDnsSupportPaginator struct { - options DescribeVpcClassicLinkDnsSupportPaginatorOptions - client DescribeVpcClassicLinkDnsSupportAPIClient - params *DescribeVpcClassicLinkDnsSupportInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcClassicLinkDnsSupportPaginator returns a new -// DescribeVpcClassicLinkDnsSupportPaginator -func NewDescribeVpcClassicLinkDnsSupportPaginator(client DescribeVpcClassicLinkDnsSupportAPIClient, params *DescribeVpcClassicLinkDnsSupportInput, optFns ...func(*DescribeVpcClassicLinkDnsSupportPaginatorOptions)) *DescribeVpcClassicLinkDnsSupportPaginator { - if params == nil { - params = &DescribeVpcClassicLinkDnsSupportInput{} - } - - options := DescribeVpcClassicLinkDnsSupportPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcClassicLinkDnsSupportPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcClassicLinkDnsSupportPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcClassicLinkDnsSupport page. -func (p *DescribeVpcClassicLinkDnsSupportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcClassicLinkDnsSupport(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcClassicLinkDnsSupportAPIClient is a client that implements the -// DescribeVpcClassicLinkDnsSupport operation. -type DescribeVpcClassicLinkDnsSupportAPIClient interface { - DescribeVpcClassicLinkDnsSupport(context.Context, *DescribeVpcClassicLinkDnsSupportInput, ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) -} - -var _ DescribeVpcClassicLinkDnsSupportAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcClassicLinkDnsSupport(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcClassicLinkDnsSupport", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointAssociations.go deleted file mode 100644 index e8b27f231..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointAssociations.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the VPC resources, VPC endpoint services, Amazon Lattice services, or -// service networks associated with the VPC endpoint. -func (c *Client) DescribeVpcEndpointAssociations(ctx context.Context, params *DescribeVpcEndpointAssociationsInput, optFns ...func(*Options)) (*DescribeVpcEndpointAssociationsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointAssociations", params, optFns, c.addOperationDescribeVpcEndpointAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - vpc-endpoint-id - The ID of the VPC endpoint. - // - // - associated-resource-accessibility - The association state. When the state is - // accessible , it returns AVAILABLE . When the state is inaccessible , it - // returns PENDING or FAILED . - // - // - association-id - The ID of the VPC endpoint association. - // - // - associated-resource-id - The ID of the associated resource configuration. - // - // - service-network-arn - The Amazon Resource Name (ARN) of the associated - // service network. Only VPC endpoints of type service network will be returned. - // - // - resource-configuration-group-arn - The Amazon Resource Name (ARN) of the - // resource configuration of type GROUP. - // - // - service-network-resource-association-id - The ID of the association. - Filters []types.Filter - - // The maximum page size. - MaxResults *int32 - - // The pagination token. - NextToken *string - - // The IDs of the VPC endpoints. - VpcEndpointIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointAssociationsOutput struct { - - // The pagination token. - NextToken *string - - // Details of the endpoint associations. - VpcEndpointAssociations []types.VpcEndpointAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcEndpointAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go deleted file mode 100644 index 01ab89185..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the connection notifications for VPC endpoints and VPC endpoint -// services. -func (c *Client) DescribeVpcEndpointConnectionNotifications(ctx context.Context, params *DescribeVpcEndpointConnectionNotificationsInput, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointConnectionNotificationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointConnectionNotifications", params, optFns, c.addOperationDescribeVpcEndpointConnectionNotificationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointConnectionNotificationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointConnectionNotificationsInput struct { - - // The ID of the notification. - ConnectionNotificationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - connection-notification-arn - The ARN of the SNS topic for the notification. - // - // - connection-notification-id - The ID of the notification. - // - // - connection-notification-state - The state of the notification ( Enabled | - // Disabled ). - // - // - connection-notification-type - The type of notification ( Topic ). - // - // - service-id - The ID of the endpoint service. - // - // - vpc-endpoint-id - The ID of the VPC endpoint. - Filters []types.Filter - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another request with the returned NextToken value. - MaxResults *int32 - - // The token to request the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointConnectionNotificationsOutput struct { - - // The notifications. - ConnectionNotificationSet []types.ConnectionNotification - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointConnectionNotificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointConnectionNotifications{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointConnectionNotifications{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointConnectionNotifications"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointConnectionNotifications(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcEndpointConnectionNotificationsPaginatorOptions is the paginator -// options for DescribeVpcEndpointConnectionNotifications -type DescribeVpcEndpointConnectionNotificationsPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another request with the returned NextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcEndpointConnectionNotificationsPaginator is a paginator for -// DescribeVpcEndpointConnectionNotifications -type DescribeVpcEndpointConnectionNotificationsPaginator struct { - options DescribeVpcEndpointConnectionNotificationsPaginatorOptions - client DescribeVpcEndpointConnectionNotificationsAPIClient - params *DescribeVpcEndpointConnectionNotificationsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcEndpointConnectionNotificationsPaginator returns a new -// DescribeVpcEndpointConnectionNotificationsPaginator -func NewDescribeVpcEndpointConnectionNotificationsPaginator(client DescribeVpcEndpointConnectionNotificationsAPIClient, params *DescribeVpcEndpointConnectionNotificationsInput, optFns ...func(*DescribeVpcEndpointConnectionNotificationsPaginatorOptions)) *DescribeVpcEndpointConnectionNotificationsPaginator { - if params == nil { - params = &DescribeVpcEndpointConnectionNotificationsInput{} - } - - options := DescribeVpcEndpointConnectionNotificationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcEndpointConnectionNotificationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcEndpointConnectionNotificationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcEndpointConnectionNotifications page. -func (p *DescribeVpcEndpointConnectionNotificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcEndpointConnectionNotifications(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcEndpointConnectionNotificationsAPIClient is a client that implements -// the DescribeVpcEndpointConnectionNotifications operation. -type DescribeVpcEndpointConnectionNotificationsAPIClient interface { - DescribeVpcEndpointConnectionNotifications(context.Context, *DescribeVpcEndpointConnectionNotificationsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) -} - -var _ DescribeVpcEndpointConnectionNotificationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcEndpointConnectionNotifications(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointConnectionNotifications", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnections.go deleted file mode 100644 index cc75904c3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointConnections.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the VPC endpoint connections to your VPC endpoint services, including -// any endpoints that are pending your acceptance. -func (c *Client) DescribeVpcEndpointConnections(ctx context.Context, params *DescribeVpcEndpointConnectionsInput, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointConnections", params, optFns, c.addOperationDescribeVpcEndpointConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointConnectionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - ip-address-type - The IP address type ( ipv4 | ipv6 ). - // - // - service-id - The ID of the service. - // - // - vpc-endpoint-owner - The ID of the Amazon Web Services account ID that owns - // the endpoint. - // - // - vpc-endpoint-region - The Region of the endpoint or cross-region to find - // endpoints for other Regions. - // - // - vpc-endpoint-state - The state of the endpoint ( pendingAcceptance | pending - // | available | deleting | deleted | rejected | failed ). - // - // - vpc-endpoint-id - The ID of the endpoint. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointConnectionsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the VPC endpoint connections. - VpcEndpointConnections []types.VpcEndpointConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcEndpointConnectionsPaginatorOptions is the paginator options for -// DescribeVpcEndpointConnections -type DescribeVpcEndpointConnectionsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcEndpointConnectionsPaginator is a paginator for -// DescribeVpcEndpointConnections -type DescribeVpcEndpointConnectionsPaginator struct { - options DescribeVpcEndpointConnectionsPaginatorOptions - client DescribeVpcEndpointConnectionsAPIClient - params *DescribeVpcEndpointConnectionsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcEndpointConnectionsPaginator returns a new -// DescribeVpcEndpointConnectionsPaginator -func NewDescribeVpcEndpointConnectionsPaginator(client DescribeVpcEndpointConnectionsAPIClient, params *DescribeVpcEndpointConnectionsInput, optFns ...func(*DescribeVpcEndpointConnectionsPaginatorOptions)) *DescribeVpcEndpointConnectionsPaginator { - if params == nil { - params = &DescribeVpcEndpointConnectionsInput{} - } - - options := DescribeVpcEndpointConnectionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcEndpointConnectionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcEndpointConnectionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcEndpointConnections page. -func (p *DescribeVpcEndpointConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcEndpointConnections(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcEndpointConnectionsAPIClient is a client that implements the -// DescribeVpcEndpointConnections operation. -type DescribeVpcEndpointConnectionsAPIClient interface { - DescribeVpcEndpointConnections(context.Context, *DescribeVpcEndpointConnectionsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) -} - -var _ DescribeVpcEndpointConnectionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcEndpointConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go deleted file mode 100644 index 55f818ffe..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the VPC endpoint service configurations in your account (your -// services). -func (c *Client) DescribeVpcEndpointServiceConfigurations(ctx context.Context, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointServiceConfigurationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointServiceConfigurations", params, optFns, c.addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointServiceConfigurationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointServiceConfigurationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - service-name - The name of the service. - // - // - service-id - The ID of the service. - // - // - service-state - The state of the service ( Pending | Available | Deleting | - // Deleted | Failed ). - // - // - supported-ip-address-types - The IP address type ( ipv4 | ipv6 ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - // The IDs of the endpoint services. - ServiceIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointServiceConfigurationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the services. - ServiceConfigurations []types.ServiceConfiguration - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointServiceConfigurations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointServiceConfigurations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointServiceConfigurations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcEndpointServiceConfigurationsPaginatorOptions is the paginator -// options for DescribeVpcEndpointServiceConfigurations -type DescribeVpcEndpointServiceConfigurationsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcEndpointServiceConfigurationsPaginator is a paginator for -// DescribeVpcEndpointServiceConfigurations -type DescribeVpcEndpointServiceConfigurationsPaginator struct { - options DescribeVpcEndpointServiceConfigurationsPaginatorOptions - client DescribeVpcEndpointServiceConfigurationsAPIClient - params *DescribeVpcEndpointServiceConfigurationsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcEndpointServiceConfigurationsPaginator returns a new -// DescribeVpcEndpointServiceConfigurationsPaginator -func NewDescribeVpcEndpointServiceConfigurationsPaginator(client DescribeVpcEndpointServiceConfigurationsAPIClient, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*DescribeVpcEndpointServiceConfigurationsPaginatorOptions)) *DescribeVpcEndpointServiceConfigurationsPaginator { - if params == nil { - params = &DescribeVpcEndpointServiceConfigurationsInput{} - } - - options := DescribeVpcEndpointServiceConfigurationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcEndpointServiceConfigurationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcEndpointServiceConfigurationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcEndpointServiceConfigurations page. -func (p *DescribeVpcEndpointServiceConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcEndpointServiceConfigurations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcEndpointServiceConfigurationsAPIClient is a client that implements -// the DescribeVpcEndpointServiceConfigurations operation. -type DescribeVpcEndpointServiceConfigurationsAPIClient interface { - DescribeVpcEndpointServiceConfigurations(context.Context, *DescribeVpcEndpointServiceConfigurationsInput, ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) -} - -var _ DescribeVpcEndpointServiceConfigurationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointServiceConfigurations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go deleted file mode 100644 index 899d4b5f4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the principals (service consumers) that are permitted to discover -// your VPC endpoint service. Principal ARNs with path components aren't supported. -func (c *Client) DescribeVpcEndpointServicePermissions(ctx context.Context, params *DescribeVpcEndpointServicePermissionsInput, optFns ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointServicePermissionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointServicePermissions", params, optFns, c.addOperationDescribeVpcEndpointServicePermissionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointServicePermissionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointServicePermissionsInput struct { - - // The ID of the service. - // - // This member is required. - ServiceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - principal - The ARN of the principal. - // - // - principal-type - The principal type ( All | Service | OrganizationUnit | - // Account | User | Role ). - Filters []types.Filter - - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - MaxResults *int32 - - // The token to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointServicePermissionsOutput struct { - - // Information about the allowed principals. - AllowedPrincipals []types.AllowedPrincipal - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointServicePermissionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointServicePermissions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointServicePermissions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointServicePermissions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeVpcEndpointServicePermissionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointServicePermissions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcEndpointServicePermissionsPaginatorOptions is the paginator options -// for DescribeVpcEndpointServicePermissions -type DescribeVpcEndpointServicePermissionsPaginatorOptions struct { - // The maximum number of results to return for the request in a single page. The - // remaining results of the initial request can be seen by sending another request - // with the returned NextToken value. This value can be between 5 and 1,000; if - // MaxResults is given a value larger than 1,000, only 1,000 results are returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcEndpointServicePermissionsPaginator is a paginator for -// DescribeVpcEndpointServicePermissions -type DescribeVpcEndpointServicePermissionsPaginator struct { - options DescribeVpcEndpointServicePermissionsPaginatorOptions - client DescribeVpcEndpointServicePermissionsAPIClient - params *DescribeVpcEndpointServicePermissionsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcEndpointServicePermissionsPaginator returns a new -// DescribeVpcEndpointServicePermissionsPaginator -func NewDescribeVpcEndpointServicePermissionsPaginator(client DescribeVpcEndpointServicePermissionsAPIClient, params *DescribeVpcEndpointServicePermissionsInput, optFns ...func(*DescribeVpcEndpointServicePermissionsPaginatorOptions)) *DescribeVpcEndpointServicePermissionsPaginator { - if params == nil { - params = &DescribeVpcEndpointServicePermissionsInput{} - } - - options := DescribeVpcEndpointServicePermissionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcEndpointServicePermissionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcEndpointServicePermissionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcEndpointServicePermissions page. -func (p *DescribeVpcEndpointServicePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcEndpointServicePermissions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcEndpointServicePermissionsAPIClient is a client that implements the -// DescribeVpcEndpointServicePermissions operation. -type DescribeVpcEndpointServicePermissionsAPIClient interface { - DescribeVpcEndpointServicePermissions(context.Context, *DescribeVpcEndpointServicePermissionsInput, ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) -} - -var _ DescribeVpcEndpointServicePermissionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcEndpointServicePermissions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointServicePermissions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServices.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServices.go deleted file mode 100644 index 5485d0018..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpointServices.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes available services to which you can create a VPC endpoint. -// -// When the service provider and the consumer have different accounts in multiple -// Availability Zones, and the consumer views the VPC endpoint service information, -// the response only includes the common Availability Zones. For example, when the -// service provider account uses us-east-1a and us-east-1c and the consumer uses -// us-east-1a and us-east-1b , the response includes the VPC endpoint services in -// the common Availability Zone, us-east-1a . -func (c *Client) DescribeVpcEndpointServices(ctx context.Context, params *DescribeVpcEndpointServicesInput, optFns ...func(*Options)) (*DescribeVpcEndpointServicesOutput, error) { - if params == nil { - params = &DescribeVpcEndpointServicesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointServices", params, optFns, c.addOperationDescribeVpcEndpointServicesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointServicesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointServicesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - owner - The ID or alias of the Amazon Web Services account that owns the - // service. - // - // - service-name - The name of the service. - // - // - service-region - The Region of the service. - // - // - service-type - The type of service ( Interface | Gateway | - // GatewayLoadBalancer ). - // - // - supported-ip-address-types - The IP address type ( ipv4 | ipv6 ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of items to return for this request. The request returns a - // token that you can specify in a subsequent call to get the next set of results. - // - // Constraint: If the value is greater than 1,000, we return only 1,000 items. - MaxResults *int32 - - // The token for the next set of items to return. (You received this token from a - // prior call.) - NextToken *string - - // The service names. - ServiceNames []string - - // The service Regions. - ServiceRegions []string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointServicesOutput struct { - - // The token to use when requesting the next set of items. If there are no - // additional items to return, the string is empty. - NextToken *string - - // Information about the service. - ServiceDetails []types.ServiceDetail - - // The supported services. - ServiceNames []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointServicesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointServices{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointServices{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpointServices"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointServices(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpcEndpointServices(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpointServices", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpoints.go deleted file mode 100644 index 304b7b895..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcEndpoints.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes your VPC endpoints. The default is to describe all your VPC -// endpoints. Alternatively, you can specify specific VPC endpoint IDs or filter -// the results to include only the VPC endpoints that match specific criteria. -func (c *Client) DescribeVpcEndpoints(ctx context.Context, params *DescribeVpcEndpointsInput, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { - if params == nil { - params = &DescribeVpcEndpointsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpoints", params, optFns, c.addOperationDescribeVpcEndpointsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcEndpointsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcEndpointsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - ip-address-type - The IP address type ( ipv4 | ipv6 ). - // - // - service-name - The name of the service. - // - // - service-region - The Region of the service. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC in which the endpoint resides. - // - // - vpc-endpoint-id - The ID of the endpoint. - // - // - vpc-endpoint-state - The state of the endpoint ( pendingAcceptance | pending - // | available | deleting | deleted | rejected | failed ). - // - // - vpc-endpoint-type - The type of VPC endpoint ( Interface | Gateway | - // GatewayLoadBalancer | Resource | ServiceNetwork ). - Filters []types.Filter - - // The maximum number of items to return for this request. The request returns a - // token that you can specify in a subsequent call to get the next set of results. - // - // Constraint: If the value is greater than 1,000, we return only 1,000 items. - MaxResults *int32 - - // The token for the next set of items to return. (You received this token from a - // prior call.) - NextToken *string - - // The IDs of the VPC endpoints. - VpcEndpointIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcEndpointsOutput struct { - - // The token to use when requesting the next set of items. If there are no - // additional items to return, the string is empty. - NextToken *string - - // Information about the VPC endpoints. - VpcEndpoints []types.VpcEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpoints{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpoints{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcEndpoints"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpoints(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// DescribeVpcEndpointsPaginatorOptions is the paginator options for -// DescribeVpcEndpoints -type DescribeVpcEndpointsPaginatorOptions struct { - // The maximum number of items to return for this request. The request returns a - // token that you can specify in a subsequent call to get the next set of results. - // - // Constraint: If the value is greater than 1,000, we return only 1,000 items. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcEndpointsPaginator is a paginator for DescribeVpcEndpoints -type DescribeVpcEndpointsPaginator struct { - options DescribeVpcEndpointsPaginatorOptions - client DescribeVpcEndpointsAPIClient - params *DescribeVpcEndpointsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcEndpointsPaginator returns a new DescribeVpcEndpointsPaginator -func NewDescribeVpcEndpointsPaginator(client DescribeVpcEndpointsAPIClient, params *DescribeVpcEndpointsInput, optFns ...func(*DescribeVpcEndpointsPaginatorOptions)) *DescribeVpcEndpointsPaginator { - if params == nil { - params = &DescribeVpcEndpointsInput{} - } - - options := DescribeVpcEndpointsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcEndpointsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcEndpointsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcEndpoints page. -func (p *DescribeVpcEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcEndpoints(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcEndpointsAPIClient is a client that implements the -// DescribeVpcEndpoints operation. -type DescribeVpcEndpointsAPIClient interface { - DescribeVpcEndpoints(context.Context, *DescribeVpcEndpointsInput, ...func(*Options)) (*DescribeVpcEndpointsOutput, error) -} - -var _ DescribeVpcEndpointsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcEndpoints", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcPeeringConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcPeeringConnections.go deleted file mode 100644 index 29ae4ebd8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcPeeringConnections.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes your VPC peering connections. The default is to describe all your VPC -// peering connections. Alternatively, you can specify specific VPC peering -// connection IDs or filter the results to include only the VPC peering connections -// that match specific criteria. -func (c *Client) DescribeVpcPeeringConnections(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) { - if params == nil { - params = &DescribeVpcPeeringConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcPeeringConnections", params, optFns, c.addOperationDescribeVpcPeeringConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcPeeringConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcPeeringConnectionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - accepter-vpc-info.cidr-block - The IPv4 CIDR block of the accepter VPC. - // - // - accepter-vpc-info.owner-id - The ID of the Amazon Web Services account that - // owns the accepter VPC. - // - // - accepter-vpc-info.vpc-id - The ID of the accepter VPC. - // - // - expiration-time - The expiration date and time for the VPC peering - // connection. - // - // - requester-vpc-info.cidr-block - The IPv4 CIDR block of the requester's VPC. - // - // - requester-vpc-info.owner-id - The ID of the Amazon Web Services account that - // owns the requester VPC. - // - // - requester-vpc-info.vpc-id - The ID of the requester VPC. - // - // - status-code - The status of the VPC peering connection ( pending-acceptance - // | failed | expired | provisioning | active | deleting | deleted | rejected ). - // - // - status-message - A message that provides more information about the status - // of the VPC peering connection, if applicable. - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-peering-connection-id - The ID of the VPC peering connection. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the VPC peering connections. - // - // Default: Describes all your VPC peering connections. - VpcPeeringConnectionIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcPeeringConnectionsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the VPC peering connections. - VpcPeeringConnections []types.VpcPeeringConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcPeeringConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcPeeringConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcPeeringConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcPeeringConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcPeeringConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// VpcPeeringConnectionDeletedWaiterOptions are waiter options for -// VpcPeeringConnectionDeletedWaiter -type VpcPeeringConnectionDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpcPeeringConnectionDeletedWaiter will use default minimum delay of 15 seconds. - // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpcPeeringConnectionDeletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpcPeeringConnectionsInput, *DescribeVpcPeeringConnectionsOutput, error) (bool, error) -} - -// VpcPeeringConnectionDeletedWaiter defines the waiters for -// VpcPeeringConnectionDeleted -type VpcPeeringConnectionDeletedWaiter struct { - client DescribeVpcPeeringConnectionsAPIClient - - options VpcPeeringConnectionDeletedWaiterOptions -} - -// NewVpcPeeringConnectionDeletedWaiter constructs a -// VpcPeeringConnectionDeletedWaiter. -func NewVpcPeeringConnectionDeletedWaiter(client DescribeVpcPeeringConnectionsAPIClient, optFns ...func(*VpcPeeringConnectionDeletedWaiterOptions)) *VpcPeeringConnectionDeletedWaiter { - options := VpcPeeringConnectionDeletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpcPeeringConnectionDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpcPeeringConnectionDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpcPeeringConnectionDeleted waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *VpcPeeringConnectionDeletedWaiter) Wait(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpcPeeringConnectionDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpcPeeringConnectionDeleted waiter -// and returns the output of the successful operation. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VpcPeeringConnectionDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpcPeeringConnectionDeletedWaiterOptions)) (*DescribeVpcPeeringConnectionsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpcPeeringConnections(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpcPeeringConnectionDeleted waiter") -} - -func vpcPeeringConnectionDeletedStateRetryable(ctx context.Context, input *DescribeVpcPeeringConnectionsInput, output *DescribeVpcPeeringConnectionsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.VpcPeeringConnections - var v2 []types.VpcPeeringConnectionStateReasonCode - for _, v := range v1 { - v3 := v.Status - var v4 types.VpcPeeringConnectionStateReasonCode - if v3 != nil { - v5 := v3.Code - v4 = v5 - } - v2 = append(v2, v4) - } - expectedValue := "deleted" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidVpcPeeringConnectionID.NotFound" == apiErr.ErrorCode() { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// VpcPeeringConnectionExistsWaiterOptions are waiter options for -// VpcPeeringConnectionExistsWaiter -type VpcPeeringConnectionExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpcPeeringConnectionExistsWaiter will use default minimum delay of 15 seconds. - // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpcPeeringConnectionExistsWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpcPeeringConnectionsInput, *DescribeVpcPeeringConnectionsOutput, error) (bool, error) -} - -// VpcPeeringConnectionExistsWaiter defines the waiters for -// VpcPeeringConnectionExists -type VpcPeeringConnectionExistsWaiter struct { - client DescribeVpcPeeringConnectionsAPIClient - - options VpcPeeringConnectionExistsWaiterOptions -} - -// NewVpcPeeringConnectionExistsWaiter constructs a -// VpcPeeringConnectionExistsWaiter. -func NewVpcPeeringConnectionExistsWaiter(client DescribeVpcPeeringConnectionsAPIClient, optFns ...func(*VpcPeeringConnectionExistsWaiterOptions)) *VpcPeeringConnectionExistsWaiter { - options := VpcPeeringConnectionExistsWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpcPeeringConnectionExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpcPeeringConnectionExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpcPeeringConnectionExists waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *VpcPeeringConnectionExistsWaiter) Wait(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpcPeeringConnectionExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpcPeeringConnectionExists waiter -// and returns the output of the successful operation. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VpcPeeringConnectionExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpcPeeringConnectionExistsWaiterOptions)) (*DescribeVpcPeeringConnectionsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpcPeeringConnections(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpcPeeringConnectionExists waiter") -} - -func vpcPeeringConnectionExistsStateRetryable(ctx context.Context, input *DescribeVpcPeeringConnectionsInput, output *DescribeVpcPeeringConnectionsOutput, err error) (bool, error) { - - if err == nil { - return false, nil - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidVpcPeeringConnectionID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeVpcPeeringConnectionsPaginatorOptions is the paginator options for -// DescribeVpcPeeringConnections -type DescribeVpcPeeringConnectionsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcPeeringConnectionsPaginator is a paginator for -// DescribeVpcPeeringConnections -type DescribeVpcPeeringConnectionsPaginator struct { - options DescribeVpcPeeringConnectionsPaginatorOptions - client DescribeVpcPeeringConnectionsAPIClient - params *DescribeVpcPeeringConnectionsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcPeeringConnectionsPaginator returns a new -// DescribeVpcPeeringConnectionsPaginator -func NewDescribeVpcPeeringConnectionsPaginator(client DescribeVpcPeeringConnectionsAPIClient, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*DescribeVpcPeeringConnectionsPaginatorOptions)) *DescribeVpcPeeringConnectionsPaginator { - if params == nil { - params = &DescribeVpcPeeringConnectionsInput{} - } - - options := DescribeVpcPeeringConnectionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcPeeringConnectionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcPeeringConnectionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcPeeringConnections page. -func (p *DescribeVpcPeeringConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcPeeringConnections(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcPeeringConnectionsAPIClient is a client that implements the -// DescribeVpcPeeringConnections operation. -type DescribeVpcPeeringConnectionsAPIClient interface { - DescribeVpcPeeringConnections(context.Context, *DescribeVpcPeeringConnectionsInput, ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) -} - -var _ DescribeVpcPeeringConnectionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcPeeringConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcPeeringConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcs.go deleted file mode 100644 index 09b4bdcda..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpcs.go +++ /dev/null @@ -1,690 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes your VPCs. The default is to describe all your VPCs. Alternatively, -// you can specify specific VPC IDs or filter the results to include only the VPCs -// that match specific criteria. -func (c *Client) DescribeVpcs(ctx context.Context, params *DescribeVpcsInput, optFns ...func(*Options)) (*DescribeVpcsOutput, error) { - if params == nil { - params = &DescribeVpcsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpcs", params, optFns, c.addOperationDescribeVpcsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpcsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeVpcsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. - // - // - cidr - The primary IPv4 CIDR block of the VPC. The CIDR block you specify - // must exactly match the VPC's CIDR block for information to be returned for the - // VPC. Must contain the slash followed by one or two digits (for example, /28 ). - // - // - cidr-block-association.cidr-block - An IPv4 CIDR block associated with the - // VPC. - // - // - cidr-block-association.association-id - The association ID for an IPv4 CIDR - // block associated with the VPC. - // - // - cidr-block-association.state - The state of an IPv4 CIDR block associated - // with the VPC. - // - // - dhcp-options-id - The ID of a set of DHCP options. - // - // - ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the VPC. - // - // - ipv6-cidr-block-association.ipv6-pool - The ID of the IPv6 address pool from - // which the IPv6 CIDR block is allocated. - // - // - ipv6-cidr-block-association.association-id - The association ID for an IPv6 - // CIDR block associated with the VPC. - // - // - ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the VPC. - // - // - is-default - Indicates whether the VPC is the default VPC. - // - // - owner-id - The ID of the Amazon Web Services account that owns the VPC. - // - // - state - The state of the VPC ( pending | available ). - // - // - tag - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - vpc-id - The ID of the VPC. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the VPCs. - VpcIds []string - - noSmithyDocumentSerde -} - -type DescribeVpcsOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the VPCs. - Vpcs []types.Vpc - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpcsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpcs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// VpcAvailableWaiterOptions are waiter options for VpcAvailableWaiter -type VpcAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpcAvailableWaiter will use default minimum delay of 15 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpcAvailableWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpcsInput, *DescribeVpcsOutput, error) (bool, error) -} - -// VpcAvailableWaiter defines the waiters for VpcAvailable -type VpcAvailableWaiter struct { - client DescribeVpcsAPIClient - - options VpcAvailableWaiterOptions -} - -// NewVpcAvailableWaiter constructs a VpcAvailableWaiter. -func NewVpcAvailableWaiter(client DescribeVpcsAPIClient, optFns ...func(*VpcAvailableWaiterOptions)) *VpcAvailableWaiter { - options := VpcAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpcAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpcAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpcAvailable waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VpcAvailableWaiter) Wait(ctx context.Context, params *DescribeVpcsInput, maxWaitDur time.Duration, optFns ...func(*VpcAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpcAvailable waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *VpcAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeVpcsInput, maxWaitDur time.Duration, optFns ...func(*VpcAvailableWaiterOptions)) (*DescribeVpcsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpcs(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpcAvailable waiter") -} - -func vpcAvailableStateRetryable(ctx context.Context, input *DescribeVpcsInput, output *DescribeVpcsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Vpcs - var v2 []types.VpcState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// VpcExistsWaiterOptions are waiter options for VpcExistsWaiter -type VpcExistsWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpcExistsWaiter will use default minimum delay of 1 seconds. Note that MinDelay - // must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpcExistsWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpcsInput, *DescribeVpcsOutput, error) (bool, error) -} - -// VpcExistsWaiter defines the waiters for VpcExists -type VpcExistsWaiter struct { - client DescribeVpcsAPIClient - - options VpcExistsWaiterOptions -} - -// NewVpcExistsWaiter constructs a VpcExistsWaiter. -func NewVpcExistsWaiter(client DescribeVpcsAPIClient, optFns ...func(*VpcExistsWaiterOptions)) *VpcExistsWaiter { - options := VpcExistsWaiterOptions{} - options.MinDelay = 1 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpcExistsStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpcExistsWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpcExists waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *VpcExistsWaiter) Wait(ctx context.Context, params *DescribeVpcsInput, maxWaitDur time.Duration, optFns ...func(*VpcExistsWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpcExists waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *VpcExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeVpcsInput, maxWaitDur time.Duration, optFns ...func(*VpcExistsWaiterOptions)) (*DescribeVpcsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpcs(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpcExists waiter") -} - -func vpcExistsStateRetryable(ctx context.Context, input *DescribeVpcsInput, output *DescribeVpcsOutput, err error) (bool, error) { - - if err == nil { - return false, nil - } - - if err != nil { - var apiErr smithy.APIError - ok := errors.As(err, &apiErr) - if !ok { - return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) - } - - if "InvalidVpcID.NotFound" == apiErr.ErrorCode() { - return true, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeVpcsPaginatorOptions is the paginator options for DescribeVpcs -type DescribeVpcsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeVpcsPaginator is a paginator for DescribeVpcs -type DescribeVpcsPaginator struct { - options DescribeVpcsPaginatorOptions - client DescribeVpcsAPIClient - params *DescribeVpcsInput - nextToken *string - firstPage bool -} - -// NewDescribeVpcsPaginator returns a new DescribeVpcsPaginator -func NewDescribeVpcsPaginator(client DescribeVpcsAPIClient, params *DescribeVpcsInput, optFns ...func(*DescribeVpcsPaginatorOptions)) *DescribeVpcsPaginator { - if params == nil { - params = &DescribeVpcsInput{} - } - - options := DescribeVpcsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeVpcsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeVpcsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeVpcs page. -func (p *DescribeVpcsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeVpcs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeVpcsAPIClient is a client that implements the DescribeVpcs operation. -type DescribeVpcsAPIClient interface { - DescribeVpcs(context.Context, *DescribeVpcsInput, ...func(*Options)) (*DescribeVpcsOutput, error) -} - -var _ DescribeVpcsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpcs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpcs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnConnections.go deleted file mode 100644 index 79cd9cfd4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnConnections.go +++ /dev/null @@ -1,660 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes one or more of your VPN connections. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) DescribeVpnConnections(ctx context.Context, params *DescribeVpnConnectionsInput, optFns ...func(*Options)) (*DescribeVpnConnectionsOutput, error) { - if params == nil { - params = &DescribeVpnConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpnConnections", params, optFns, c.addOperationDescribeVpnConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpnConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeVpnConnections. -type DescribeVpnConnectionsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - customer-gateway-configuration - The configuration information for the - // customer gateway. - // - // - customer-gateway-id - The ID of a customer gateway associated with the VPN - // connection. - // - // - state - The state of the VPN connection ( pending | available | deleting | - // deleted ). - // - // - option.static-routes-only - Indicates whether the connection has static - // routes only. Used for devices that do not support Border Gateway Protocol (BGP). - // - // - route.destination-cidr-block - The destination CIDR block. This corresponds - // to the subnet used in a customer data center. - // - // - bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP - // device. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - type - The type of VPN connection. Currently the only supported type is - // ipsec.1 . - // - // - vpn-connection-id - The ID of the VPN connection. - // - // - vpn-gateway-id - The ID of a virtual private gateway associated with the VPN - // connection. - // - // - transit-gateway-id - The ID of a transit gateway associated with the VPN - // connection. - Filters []types.Filter - - // One or more VPN connection IDs. - // - // Default: Describes your VPN connections. - VpnConnectionIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeVpnConnections. -type DescribeVpnConnectionsOutput struct { - - // Information about one or more VPN connections. - VpnConnections []types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpnConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpnConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpnConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpnConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpnConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// VpnConnectionAvailableWaiterOptions are waiter options for -// VpnConnectionAvailableWaiter -type VpnConnectionAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpnConnectionAvailableWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpnConnectionAvailableWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpnConnectionsInput, *DescribeVpnConnectionsOutput, error) (bool, error) -} - -// VpnConnectionAvailableWaiter defines the waiters for VpnConnectionAvailable -type VpnConnectionAvailableWaiter struct { - client DescribeVpnConnectionsAPIClient - - options VpnConnectionAvailableWaiterOptions -} - -// NewVpnConnectionAvailableWaiter constructs a VpnConnectionAvailableWaiter. -func NewVpnConnectionAvailableWaiter(client DescribeVpnConnectionsAPIClient, optFns ...func(*VpnConnectionAvailableWaiterOptions)) *VpnConnectionAvailableWaiter { - options := VpnConnectionAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpnConnectionAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpnConnectionAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpnConnectionAvailable waiter. The -// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is -// required and must be greater than zero. -func (w *VpnConnectionAvailableWaiter) Wait(ctx context.Context, params *DescribeVpnConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpnConnectionAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpnConnectionAvailable waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *VpnConnectionAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeVpnConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpnConnectionAvailableWaiterOptions)) (*DescribeVpnConnectionsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpnConnections(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpnConnectionAvailable waiter") -} - -func vpnConnectionAvailableStateRetryable(ctx context.Context, input *DescribeVpnConnectionsInput, output *DescribeVpnConnectionsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.VpnConnections - var v2 []types.VpnState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "available" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.VpnConnections - var v2 []types.VpnState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleting" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.VpnConnections - var v2 []types.VpnState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// VpnConnectionDeletedWaiterOptions are waiter options for -// VpnConnectionDeletedWaiter -type VpnConnectionDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // VpnConnectionDeletedWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, VpnConnectionDeletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeVpnConnectionsInput, *DescribeVpnConnectionsOutput, error) (bool, error) -} - -// VpnConnectionDeletedWaiter defines the waiters for VpnConnectionDeleted -type VpnConnectionDeletedWaiter struct { - client DescribeVpnConnectionsAPIClient - - options VpnConnectionDeletedWaiterOptions -} - -// NewVpnConnectionDeletedWaiter constructs a VpnConnectionDeletedWaiter. -func NewVpnConnectionDeletedWaiter(client DescribeVpnConnectionsAPIClient, optFns ...func(*VpnConnectionDeletedWaiterOptions)) *VpnConnectionDeletedWaiter { - options := VpnConnectionDeletedWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = vpnConnectionDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &VpnConnectionDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for VpnConnectionDeleted waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *VpnConnectionDeletedWaiter) Wait(ctx context.Context, params *DescribeVpnConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpnConnectionDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for VpnConnectionDeleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *VpnConnectionDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeVpnConnectionsInput, maxWaitDur time.Duration, optFns ...func(*VpnConnectionDeletedWaiterOptions)) (*DescribeVpnConnectionsOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeVpnConnections(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for VpnConnectionDeleted waiter") -} - -func vpnConnectionDeletedStateRetryable(ctx context.Context, input *DescribeVpnConnectionsInput, output *DescribeVpnConnectionsOutput, err error) (bool, error) { - - if err == nil { - v1 := output.VpnConnections - var v2 []types.VpnState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "deleted" - match := len(v2) > 0 - for _, v := range v2 { - if string(v) != expectedValue { - match = false - break - } - } - - if match { - return false, nil - } - } - - if err == nil { - v1 := output.VpnConnections - var v2 []types.VpnState - for _, v := range v1 { - v3 := v.State - v2 = append(v2, v3) - } - expectedValue := "pending" - var match bool - for _, v := range v2 { - if string(v) == expectedValue { - match = true - break - } - } - - if match { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeVpnConnectionsAPIClient is a client that implements the -// DescribeVpnConnections operation. -type DescribeVpnConnectionsAPIClient interface { - DescribeVpnConnections(context.Context, *DescribeVpnConnectionsInput, ...func(*Options)) (*DescribeVpnConnectionsOutput, error) -} - -var _ DescribeVpnConnectionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeVpnConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpnConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnGateways.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnGateways.go deleted file mode 100644 index 956fc7bf5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DescribeVpnGateways.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes one or more of your virtual private gateways. -// -// For more information, see [Amazon Web Services Site-to-Site VPN] in the Amazon Web Services Site-to-Site VPN User -// Guide. -// -// [Amazon Web Services Site-to-Site VPN]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html -func (c *Client) DescribeVpnGateways(ctx context.Context, params *DescribeVpnGatewaysInput, optFns ...func(*Options)) (*DescribeVpnGatewaysOutput, error) { - if params == nil { - params = &DescribeVpnGatewaysInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeVpnGateways", params, optFns, c.addOperationDescribeVpnGatewaysMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeVpnGatewaysOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DescribeVpnGateways. -type DescribeVpnGatewaysInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - amazon-side-asn - The Autonomous System Number (ASN) for the Amazon side of - // the gateway. - // - // - attachment.state - The current state of the attachment between the gateway - // and the VPC ( attaching | attached | detaching | detached ). - // - // - attachment.vpc-id - The ID of an attached VPC. - // - // - availability-zone - The Availability Zone for the virtual private gateway - // (if applicable). - // - // - state - The state of the virtual private gateway ( pending | available | - // deleting | deleted ). - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - // - // - type - The type of virtual private gateway. Currently the only supported - // type is ipsec.1 . - // - // - vpn-gateway-id - The ID of the virtual private gateway. - Filters []types.Filter - - // One or more virtual private gateway IDs. - // - // Default: Describes all your virtual private gateways. - VpnGatewayIds []string - - noSmithyDocumentSerde -} - -// Contains the output of DescribeVpnGateways. -type DescribeVpnGatewaysOutput struct { - - // Information about one or more virtual private gateways. - VpnGateways []types.VpnGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeVpnGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpnGateways{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpnGateways{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeVpnGateways"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpnGateways(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeVpnGateways(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeVpnGateways", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachClassicLinkVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachClassicLinkVpc.go deleted file mode 100644 index ac0911eaf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachClassicLinkVpc.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance -// has been unlinked, the VPC security groups are no longer associated with it. An -// instance is automatically unlinked from a VPC when it's stopped. -func (c *Client) DetachClassicLinkVpc(ctx context.Context, params *DetachClassicLinkVpcInput, optFns ...func(*Options)) (*DetachClassicLinkVpcOutput, error) { - if params == nil { - params = &DetachClassicLinkVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachClassicLinkVpc", params, optFns, c.addOperationDetachClassicLinkVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachClassicLinkVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DetachClassicLinkVpcInput struct { - - // The ID of the instance to unlink from the VPC. - // - // This member is required. - InstanceId *string - - // The ID of the VPC to which the instance is linked. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DetachClassicLinkVpcOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachClassicLinkVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachClassicLinkVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachClassicLinkVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachClassicLinkVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachClassicLinkVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachClassicLinkVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachClassicLinkVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachClassicLinkVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachInternetGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachInternetGateway.go deleted file mode 100644 index f7768be5f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachInternetGateway.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Detaches an internet gateway from a VPC, disabling connectivity between the -// internet and the VPC. The VPC must not contain any running instances with -// Elastic IP addresses or public IPv4 addresses. -func (c *Client) DetachInternetGateway(ctx context.Context, params *DetachInternetGatewayInput, optFns ...func(*Options)) (*DetachInternetGatewayOutput, error) { - if params == nil { - params = &DetachInternetGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachInternetGateway", params, optFns, c.addOperationDetachInternetGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachInternetGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DetachInternetGatewayInput struct { - - // The ID of the internet gateway. - // - // This member is required. - InternetGatewayId *string - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DetachInternetGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachInternetGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachInternetGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachInternetGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachInternetGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachInternetGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachInternetGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachInternetGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachInternetGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachNetworkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachNetworkInterface.go deleted file mode 100644 index 02b589a58..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachNetworkInterface.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Detaches a network interface from an instance. -func (c *Client) DetachNetworkInterface(ctx context.Context, params *DetachNetworkInterfaceInput, optFns ...func(*Options)) (*DetachNetworkInterfaceOutput, error) { - if params == nil { - params = &DetachNetworkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachNetworkInterface", params, optFns, c.addOperationDetachNetworkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachNetworkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DetachNetworkInterface. -type DetachNetworkInterfaceInput struct { - - // The ID of the attachment. - // - // This member is required. - AttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether to force a detachment. - // - // - Use the Force parameter only as a last resort to detach a network interface - // from a failed instance. - // - // - If you use the Force parameter to detach a network interface, you might not - // be able to attach a different network interface to the same index on the - // instance without first stopping and starting the instance. - // - // - If you force the detachment of a network interface, the [instance metadata]might not get - // updated. This means that the attributes associated with the detached network - // interface might still be visible. The instance metadata will get updated when - // you stop and start the instance. - // - // [instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html - Force *bool - - noSmithyDocumentSerde -} - -type DetachNetworkInterfaceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachNetworkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachNetworkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachNetworkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachNetworkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachNetworkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachNetworkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachNetworkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachNetworkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVerifiedAccessTrustProvider.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVerifiedAccessTrustProvider.go deleted file mode 100644 index 76e0562bc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVerifiedAccessTrustProvider.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Detaches the specified Amazon Web Services Verified Access trust provider from -// the specified Amazon Web Services Verified Access instance. -func (c *Client) DetachVerifiedAccessTrustProvider(ctx context.Context, params *DetachVerifiedAccessTrustProviderInput, optFns ...func(*Options)) (*DetachVerifiedAccessTrustProviderOutput, error) { - if params == nil { - params = &DetachVerifiedAccessTrustProviderInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachVerifiedAccessTrustProvider", params, optFns, c.addOperationDetachVerifiedAccessTrustProviderMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachVerifiedAccessTrustProviderOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DetachVerifiedAccessTrustProviderInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // The ID of the Verified Access trust provider. - // - // This member is required. - VerifiedAccessTrustProviderId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DetachVerifiedAccessTrustProviderOutput struct { - - // Details about the Verified Access instance. - VerifiedAccessInstance *types.VerifiedAccessInstance - - // Details about the Verified Access trust provider. - VerifiedAccessTrustProvider *types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachVerifiedAccessTrustProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachVerifiedAccessTrustProvider"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDetachVerifiedAccessTrustProviderMiddleware(stack, options); err != nil { - return err - } - if err = addOpDetachVerifiedAccessTrustProviderValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachVerifiedAccessTrustProvider(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDetachVerifiedAccessTrustProvider struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDetachVerifiedAccessTrustProvider) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDetachVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DetachVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DetachVerifiedAccessTrustProviderInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDetachVerifiedAccessTrustProviderMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDetachVerifiedAccessTrustProvider{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDetachVerifiedAccessTrustProvider(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachVerifiedAccessTrustProvider", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVolume.go deleted file mode 100644 index 798abc385..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVolume.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Detaches an EBS volume from an instance. Make sure to unmount any file systems -// on the device within your operating system before detaching the volume. Failure -// to do so can result in the volume becoming stuck in the busy state while -// detaching. If this happens, detachment can be delayed indefinitely until you -// unmount the volume, force detachment, reboot the instance, or all three. If an -// EBS volume is the root device of an instance, it can't be detached while the -// instance is running. To detach the root volume, stop the instance first. -// -// When a volume with an Amazon Web Services Marketplace product code is detached -// from an instance, the product code is no longer associated with the instance. -// -// You can't detach or force detach volumes that are attached to Amazon Web -// Services-managed resources. Attempting to do this results in the -// UnsupportedOperationException exception. -// -// For more information, see [Detach an Amazon EBS volume] in the Amazon EBS User Guide. -// -// [Detach an Amazon EBS volume]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-detaching-volume.html -func (c *Client) DetachVolume(ctx context.Context, params *DetachVolumeInput, optFns ...func(*Options)) (*DetachVolumeOutput, error) { - if params == nil { - params = &DetachVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachVolume", params, optFns, c.addOperationDetachVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DetachVolumeInput struct { - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // The device name. - Device *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Forces detachment if the previous detachment attempt did not occur cleanly (for - // example, logging into an instance, unmounting the volume, and detaching - // normally). This option can lead to data loss or a corrupted file system. Use - // this option only as a last resort to detach a volume from a failed instance. The - // instance won't have an opportunity to flush file system caches or file system - // metadata. If you use this option, you must perform file system check and repair - // procedures. - Force *bool - - // The ID of the instance. If you are detaching a Multi-Attach enabled volume, you - // must specify an instance ID. - InstanceId *string - - noSmithyDocumentSerde -} - -// Describes volume attachment details. -type DetachVolumeOutput struct { - - // The ARN of the Amazon Web Services-managed resource to which the volume is - // attached. - AssociatedResource *string - - // The time stamp when the attachment initiated. - AttachTime *time.Time - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool - - // The device name. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - Device *string - - // The ID of the instance. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - InstanceId *string - - // The service principal of the Amazon Web Services service that owns the - // underlying resource to which the volume is attached. - // - // This parameter is returned only for volumes that are attached to Amazon Web - // Services-managed resources. - InstanceOwningService *string - - // The attachment state of the volume. - State types.VolumeAttachmentState - - // The ID of the volume. - VolumeId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVpnGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVpnGateway.go deleted file mode 100644 index 71bfe7cc7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DetachVpnGateway.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Detaches a virtual private gateway from a VPC. You do this if you're planning -// to turn off the VPC and not use it anymore. You can confirm a virtual private -// gateway has been completely detached from a VPC by describing the virtual -// private gateway (any attachments to the virtual private gateway are also -// described). -// -// You must wait for the attachment's state to switch to detached before you can -// delete the VPC or attach a different VPC to the virtual private gateway. -func (c *Client) DetachVpnGateway(ctx context.Context, params *DetachVpnGatewayInput, optFns ...func(*Options)) (*DetachVpnGatewayOutput, error) { - if params == nil { - params = &DetachVpnGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachVpnGateway", params, optFns, c.addOperationDetachVpnGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachVpnGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DetachVpnGateway. -type DetachVpnGatewayInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // The ID of the virtual private gateway. - // - // This member is required. - VpnGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DetachVpnGatewayOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachVpnGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDetachVpnGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDetachVpnGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachVpnGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachVpnGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachVpnGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachVpnGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachVpnGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAddressTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAddressTransfer.go deleted file mode 100644 index e6bb42eea..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAddressTransfer.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables Elastic IP address transfer. For more information, see [Transfer Elastic IP addresses] in the Amazon -// VPC User Guide. -// -// [Transfer Elastic IP addresses]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro -func (c *Client) DisableAddressTransfer(ctx context.Context, params *DisableAddressTransferInput, optFns ...func(*Options)) (*DisableAddressTransferOutput, error) { - if params == nil { - params = &DisableAddressTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableAddressTransfer", params, optFns, c.addOperationDisableAddressTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableAddressTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableAddressTransferInput struct { - - // The allocation ID of an Elastic IP address. - // - // This member is required. - AllocationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableAddressTransferOutput struct { - - // An Elastic IP address transfer. - AddressTransfer *types.AddressTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableAddressTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableAddressTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableAddressTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableAddressTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableAddressTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAddressTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableAddressTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableAddressTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAllowedImagesSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAllowedImagesSettings.go deleted file mode 100644 index 48c950aac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAllowedImagesSettings.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables Allowed AMIs for your account in the specified Amazon Web Services -// Region. When set to disabled , the image criteria in your Allowed AMIs settings -// do not apply, and no restrictions are placed on AMI discoverability or usage. -// Users in your account can launch instances using any public AMI or AMI shared -// with your account. -// -// The Allowed AMIs feature does not restrict the AMIs owned by your account. -// Regardless of the criteria you set, the AMIs created by your account will always -// be discoverable and usable by users in your account. -// -// For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. -// -// [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html -func (c *Client) DisableAllowedImagesSettings(ctx context.Context, params *DisableAllowedImagesSettingsInput, optFns ...func(*Options)) (*DisableAllowedImagesSettingsOutput, error) { - if params == nil { - params = &DisableAllowedImagesSettingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableAllowedImagesSettings", params, optFns, c.addOperationDisableAllowedImagesSettingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableAllowedImagesSettingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableAllowedImagesSettingsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableAllowedImagesSettingsOutput struct { - - // Returns disabled if the request succeeds; otherwise, it returns an error. - AllowedImagesSettingsState types.AllowedImagesSettingsDisabledState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableAllowedImagesSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableAllowedImagesSettings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAllowedImagesSettings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableAllowedImagesSettings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableAllowedImagesSettings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAwsNetworkPerformanceMetricSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAwsNetworkPerformanceMetricSubscription.go deleted file mode 100644 index 97e67a75e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableAwsNetworkPerformanceMetricSubscription.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables Infrastructure Performance metric subscriptions. -func (c *Client) DisableAwsNetworkPerformanceMetricSubscription(ctx context.Context, params *DisableAwsNetworkPerformanceMetricSubscriptionInput, optFns ...func(*Options)) (*DisableAwsNetworkPerformanceMetricSubscriptionOutput, error) { - if params == nil { - params = &DisableAwsNetworkPerformanceMetricSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableAwsNetworkPerformanceMetricSubscription", params, optFns, c.addOperationDisableAwsNetworkPerformanceMetricSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableAwsNetworkPerformanceMetricSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableAwsNetworkPerformanceMetricSubscriptionInput struct { - - // The target Region or Availability Zone that the metric subscription is disabled - // for. For example, eu-north-1 . - Destination *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The metric used for the disabled subscription. - Metric types.MetricType - - // The source Region or Availability Zone that the metric subscription is disabled - // for. For example, us-east-1 . - Source *string - - // The statistic used for the disabled subscription. - Statistic types.StatisticType - - noSmithyDocumentSerde -} - -type DisableAwsNetworkPerformanceMetricSubscriptionOutput struct { - - // Indicates whether the unsubscribe action was successful. - Output *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableAwsNetworkPerformanceMetricSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableAwsNetworkPerformanceMetricSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableAwsNetworkPerformanceMetricSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableAwsNetworkPerformanceMetricSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAwsNetworkPerformanceMetricSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableAwsNetworkPerformanceMetricSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableAwsNetworkPerformanceMetricSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableEbsEncryptionByDefault.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableEbsEncryptionByDefault.go deleted file mode 100644 index ae1ee7b02..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableEbsEncryptionByDefault.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables EBS encryption by default for your account in the current Region. -// -// After you disable encryption by default, you can still create encrypted volumes -// by enabling encryption when you create each volume. -// -// Disabling encryption by default does not change the encryption status of your -// existing volumes. -// -// For more information, see [Amazon EBS encryption] in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) DisableEbsEncryptionByDefault(ctx context.Context, params *DisableEbsEncryptionByDefaultInput, optFns ...func(*Options)) (*DisableEbsEncryptionByDefaultOutput, error) { - if params == nil { - params = &DisableEbsEncryptionByDefaultInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableEbsEncryptionByDefault", params, optFns, c.addOperationDisableEbsEncryptionByDefaultMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableEbsEncryptionByDefaultOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableEbsEncryptionByDefaultInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableEbsEncryptionByDefaultOutput struct { - - // The updated status of encryption by default. - EbsEncryptionByDefault *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableEbsEncryptionByDefaultMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableEbsEncryptionByDefault"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableEbsEncryptionByDefault(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableEbsEncryptionByDefault(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableEbsEncryptionByDefault", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastLaunch.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastLaunch.go deleted file mode 100644 index d693db3cd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastLaunch.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Discontinue Windows fast launch for a Windows AMI, and clean up existing -// pre-provisioned snapshots. After you disable Windows fast launch, the AMI uses -// the standard launch process for each new instance. Amazon EC2 must remove all -// pre-provisioned snapshots before you can enable Windows fast launch again. -// -// You can only change these settings for Windows AMIs that you own or that have -// been shared with you. -func (c *Client) DisableFastLaunch(ctx context.Context, params *DisableFastLaunchInput, optFns ...func(*Options)) (*DisableFastLaunchOutput, error) { - if params == nil { - params = &DisableFastLaunchInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableFastLaunch", params, optFns, c.addOperationDisableFastLaunchMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableFastLaunchOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableFastLaunchInput struct { - - // Specify the ID of the image for which to disable Windows fast launch. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Forces the image settings to turn off Windows fast launch for your Windows AMI. - // This parameter overrides any errors that are encountered while cleaning up - // resources in your account. - Force *bool - - noSmithyDocumentSerde -} - -type DisableFastLaunchOutput struct { - - // The ID of the image for which Windows fast launch was disabled. - ImageId *string - - // The launch template that was used to launch Windows instances from - // pre-provisioned snapshots. - LaunchTemplate *types.FastLaunchLaunchTemplateSpecificationResponse - - // The maximum number of instances that Amazon EC2 can launch at the same time to - // create pre-provisioned snapshots for Windows fast launch. - MaxParallelLaunches *int32 - - // The owner of the Windows AMI for which Windows fast launch was disabled. - OwnerId *string - - // The pre-provisioning resource type that must be cleaned after turning off - // Windows fast launch for the Windows AMI. Supported values include: snapshot . - ResourceType types.FastLaunchResourceType - - // Parameters that were used for Windows fast launch for the Windows AMI before - // Windows fast launch was disabled. This informs the clean-up process. - SnapshotConfiguration *types.FastLaunchSnapshotConfigurationResponse - - // The current state of Windows fast launch for the specified Windows AMI. - State types.FastLaunchStateCode - - // The reason that the state changed for Windows fast launch for the Windows AMI. - StateTransitionReason *string - - // The time that the state changed for Windows fast launch for the Windows AMI. - StateTransitionTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableFastLaunchMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableFastLaunch{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableFastLaunch{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableFastLaunch"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableFastLaunchValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableFastLaunch(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableFastLaunch(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableFastLaunch", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastSnapshotRestores.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastSnapshotRestores.go deleted file mode 100644 index 284c8da6a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableFastSnapshotRestores.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables fast snapshot restores for the specified snapshots in the specified -// Availability Zones. -func (c *Client) DisableFastSnapshotRestores(ctx context.Context, params *DisableFastSnapshotRestoresInput, optFns ...func(*Options)) (*DisableFastSnapshotRestoresOutput, error) { - if params == nil { - params = &DisableFastSnapshotRestoresInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableFastSnapshotRestores", params, optFns, c.addOperationDisableFastSnapshotRestoresMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableFastSnapshotRestoresOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableFastSnapshotRestoresInput struct { - - // One or more Availability Zones. For example, us-east-2a . - // - // This member is required. - AvailabilityZones []string - - // The IDs of one or more snapshots. For example, snap-1234567890abcdef0 . - // - // This member is required. - SourceSnapshotIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableFastSnapshotRestoresOutput struct { - - // Information about the snapshots for which fast snapshot restores were - // successfully disabled. - Successful []types.DisableFastSnapshotRestoreSuccessItem - - // Information about the snapshots for which fast snapshot restores could not be - // disabled. - Unsuccessful []types.DisableFastSnapshotRestoreErrorItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableFastSnapshotRestoresMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableFastSnapshotRestores"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableFastSnapshotRestoresValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableFastSnapshotRestores(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableFastSnapshotRestores(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableFastSnapshotRestores", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImage.go deleted file mode 100644 index e109e4aaf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImage.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Sets the AMI state to disabled and removes all launch permissions from the AMI. -// A disabled AMI can't be used for instance launches. -// -// A disabled AMI can't be shared. If an AMI was public or previously shared, it -// is made private. If an AMI was shared with an Amazon Web Services account, -// organization, or Organizational Unit, they lose access to the disabled AMI. -// -// A disabled AMI does not appear in [DescribeImages] API calls by default. -// -// Only the AMI owner can disable an AMI. -// -// You can re-enable a disabled AMI using [EnableImage]. -// -// For more information, see [Disable an AMI] in the Amazon EC2 User Guide. -// -// [DescribeImages]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html -// [Disable an AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html -// [EnableImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableImage.html -func (c *Client) DisableImage(ctx context.Context, params *DisableImageInput, optFns ...func(*Options)) (*DisableImageOutput, error) { - if params == nil { - params = &DisableImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableImage", params, optFns, c.addOperationDisableImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableImageInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableImageOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageBlockPublicAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageBlockPublicAccess.go deleted file mode 100644 index 11315eeb1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageBlockPublicAccess.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables block public access for AMIs at the account level in the specified -// Amazon Web Services Region. This removes the block public access restriction -// from your account. With the restriction removed, you can publicly share your -// AMIs in the specified Amazon Web Services Region. -// -// The API can take up to 10 minutes to configure this setting. During this time, -// if you run [GetImageBlockPublicAccessState], the response will be block-new-sharing . When the API has completed -// the configuration, the response will be unblocked . -// -// For more information, see [Block public access to your AMIs] in the Amazon EC2 User Guide. -// -// [Block public access to your AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-to-amis.html -// [GetImageBlockPublicAccessState]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html -func (c *Client) DisableImageBlockPublicAccess(ctx context.Context, params *DisableImageBlockPublicAccessInput, optFns ...func(*Options)) (*DisableImageBlockPublicAccessOutput, error) { - if params == nil { - params = &DisableImageBlockPublicAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableImageBlockPublicAccess", params, optFns, c.addOperationDisableImageBlockPublicAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableImageBlockPublicAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableImageBlockPublicAccessInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableImageBlockPublicAccessOutput struct { - - // Returns unblocked if the request succeeds; otherwise, it returns an error. - ImageBlockPublicAccessState types.ImageBlockPublicAccessDisabledState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableImageBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableImageBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableImageBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableImageBlockPublicAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableImageBlockPublicAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableImageBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableImageBlockPublicAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeprecation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeprecation.go deleted file mode 100644 index d563db90a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeprecation.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels the deprecation of the specified AMI. -// -// For more information, see [Deprecate an Amazon EC2 AMI] in the Amazon EC2 User Guide. -// -// [Deprecate an Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-deprecate.html -func (c *Client) DisableImageDeprecation(ctx context.Context, params *DisableImageDeprecationInput, optFns ...func(*Options)) (*DisableImageDeprecationOutput, error) { - if params == nil { - params = &DisableImageDeprecationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableImageDeprecation", params, optFns, c.addOperationDisableImageDeprecationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableImageDeprecationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableImageDeprecationInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableImageDeprecationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableImageDeprecationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableImageDeprecation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableImageDeprecation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableImageDeprecation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableImageDeprecationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableImageDeprecation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableImageDeprecation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableImageDeprecation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeregistrationProtection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeregistrationProtection.go deleted file mode 100644 index 245b7e158..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableImageDeregistrationProtection.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables deregistration protection for an AMI. When deregistration protection -// is disabled, the AMI can be deregistered. -// -// If you chose to include a 24-hour cooldown period when you enabled -// deregistration protection for the AMI, then, when you disable deregistration -// protection, you won’t immediately be able to deregister the AMI. -// -// For more information, see [Protect an Amazon EC2 AMI from deregistration] in the Amazon EC2 User Guide. -// -// [Protect an Amazon EC2 AMI from deregistration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-deregistration-protection.html -func (c *Client) DisableImageDeregistrationProtection(ctx context.Context, params *DisableImageDeregistrationProtectionInput, optFns ...func(*Options)) (*DisableImageDeregistrationProtectionOutput, error) { - if params == nil { - params = &DisableImageDeregistrationProtectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableImageDeregistrationProtection", params, optFns, c.addOperationDisableImageDeregistrationProtectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableImageDeregistrationProtectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableImageDeregistrationProtectionInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableImageDeregistrationProtectionOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableImageDeregistrationProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableImageDeregistrationProtection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableImageDeregistrationProtection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableImageDeregistrationProtection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableImageDeregistrationProtectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableImageDeregistrationProtection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableImageDeregistrationProtection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableImageDeregistrationProtection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableIpamOrganizationAdminAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableIpamOrganizationAdminAccount.go deleted file mode 100644 index ecb450eb3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableIpamOrganizationAdminAccount.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disable the IPAM account. For more information, see [Enable integration with Organizations] in the Amazon VPC IPAM -// User Guide. -// -// [Enable integration with Organizations]: https://docs.aws.amazon.com/vpc/latest/ipam/enable-integ-ipam.html -func (c *Client) DisableIpamOrganizationAdminAccount(ctx context.Context, params *DisableIpamOrganizationAdminAccountInput, optFns ...func(*Options)) (*DisableIpamOrganizationAdminAccountOutput, error) { - if params == nil { - params = &DisableIpamOrganizationAdminAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableIpamOrganizationAdminAccount", params, optFns, c.addOperationDisableIpamOrganizationAdminAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableIpamOrganizationAdminAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableIpamOrganizationAdminAccountInput struct { - - // The Organizations member account ID that you want to disable as IPAM account. - // - // This member is required. - DelegatedAdminAccountId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableIpamOrganizationAdminAccountOutput struct { - - // The result of disabling the IPAM account. - Success *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableIpamOrganizationAdminAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableIpamOrganizationAdminAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableIpamOrganizationAdminAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableIpamOrganizationAdminAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableIpamOrganizationAdminAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableIpamOrganizationAdminAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableIpamOrganizationAdminAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableIpamOrganizationAdminAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableRouteServerPropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableRouteServerPropagation.go deleted file mode 100644 index 8e4b3a081..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableRouteServerPropagation.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables route propagation from a route server to a specified route table. -// -// When enabled, route server propagation installs the routes in the FIB on the -// route table you've specified. Route server supports IPv4 and IPv6 route -// propagation. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) DisableRouteServerPropagation(ctx context.Context, params *DisableRouteServerPropagationInput, optFns ...func(*Options)) (*DisableRouteServerPropagationOutput, error) { - if params == nil { - params = &DisableRouteServerPropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableRouteServerPropagation", params, optFns, c.addOperationDisableRouteServerPropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableRouteServerPropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableRouteServerPropagationInput struct { - - // The ID of the route server for which to disable propagation. - // - // This member is required. - RouteServerId *string - - // The ID of the route table for which to disable route server propagation. - // - // This member is required. - RouteTableId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableRouteServerPropagationOutput struct { - - // Information about the disabled route server propagation. - RouteServerPropagation *types.RouteServerPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableRouteServerPropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableRouteServerPropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableRouteServerPropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableRouteServerPropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableRouteServerPropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableRouteServerPropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableRouteServerPropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableRouteServerPropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSerialConsoleAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSerialConsoleAccess.go deleted file mode 100644 index 18a80126e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSerialConsoleAccess.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables access to the EC2 serial console of all instances for your account. By -// default, access to the EC2 serial console is disabled for your account. For more -// information, see [Manage account access to the EC2 serial console]in the Amazon EC2 User Guide. -// -// [Manage account access to the EC2 serial console]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access -func (c *Client) DisableSerialConsoleAccess(ctx context.Context, params *DisableSerialConsoleAccessInput, optFns ...func(*Options)) (*DisableSerialConsoleAccessOutput, error) { - if params == nil { - params = &DisableSerialConsoleAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableSerialConsoleAccess", params, optFns, c.addOperationDisableSerialConsoleAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableSerialConsoleAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableSerialConsoleAccessInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableSerialConsoleAccessOutput struct { - - // If true , access to the EC2 serial console of all instances is enabled for your - // account. If false , access to the EC2 serial console of all instances is - // disabled for your account. - SerialConsoleAccessEnabled *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableSerialConsoleAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableSerialConsoleAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableSerialConsoleAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableSerialConsoleAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableSerialConsoleAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableSerialConsoleAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableSerialConsoleAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go deleted file mode 100644 index 6a7134c62..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables the block public access for snapshots setting at the account level for -// the specified Amazon Web Services Region. After you disable block public access -// for snapshots in a Region, users can publicly share snapshots in that Region. -// -// Enabling block public access for snapshots in block-all-sharing mode does not -// change the permissions for snapshots that are already publicly shared. Instead, -// it prevents these snapshots from be publicly visible and publicly accessible. -// Therefore, the attributes for these snapshots still indicate that they are -// publicly shared, even though they are not publicly available. -// -// If you disable block public access , these snapshots will become publicly -// available again. -// -// For more information, see [Block public access for snapshots] in the Amazon EBS User Guide . -// -// [Block public access for snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html -func (c *Client) DisableSnapshotBlockPublicAccess(ctx context.Context, params *DisableSnapshotBlockPublicAccessInput, optFns ...func(*Options)) (*DisableSnapshotBlockPublicAccessOutput, error) { - if params == nil { - params = &DisableSnapshotBlockPublicAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableSnapshotBlockPublicAccess", params, optFns, c.addOperationDisableSnapshotBlockPublicAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableSnapshotBlockPublicAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableSnapshotBlockPublicAccessInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableSnapshotBlockPublicAccessOutput struct { - - // Returns unblocked if the request succeeds. - State types.SnapshotBlockPublicAccessState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableSnapshotBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableSnapshotBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableSnapshotBlockPublicAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableSnapshotBlockPublicAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableSnapshotBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableSnapshotBlockPublicAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableTransitGatewayRouteTablePropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableTransitGatewayRouteTablePropagation.go deleted file mode 100644 index b09984fe6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableTransitGatewayRouteTablePropagation.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables the specified resource attachment from propagating routes to the -// specified propagation route table. -func (c *Client) DisableTransitGatewayRouteTablePropagation(ctx context.Context, params *DisableTransitGatewayRouteTablePropagationInput, optFns ...func(*Options)) (*DisableTransitGatewayRouteTablePropagationOutput, error) { - if params == nil { - params = &DisableTransitGatewayRouteTablePropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableTransitGatewayRouteTablePropagation", params, optFns, c.addOperationDisableTransitGatewayRouteTablePropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableTransitGatewayRouteTablePropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableTransitGatewayRouteTablePropagationInput struct { - - // The ID of the propagation route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - noSmithyDocumentSerde -} - -type DisableTransitGatewayRouteTablePropagationOutput struct { - - // Information about route propagation. - Propagation *types.TransitGatewayPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableTransitGatewayRouteTablePropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableTransitGatewayRouteTablePropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableTransitGatewayRouteTablePropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableTransitGatewayRouteTablePropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableTransitGatewayRouteTablePropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableTransitGatewayRouteTablePropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableTransitGatewayRouteTablePropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableTransitGatewayRouteTablePropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVgwRoutePropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVgwRoutePropagation.go deleted file mode 100644 index 227fe0f1d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVgwRoutePropagation.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables a virtual private gateway (VGW) from propagating routes to a specified -// route table of a VPC. -func (c *Client) DisableVgwRoutePropagation(ctx context.Context, params *DisableVgwRoutePropagationInput, optFns ...func(*Options)) (*DisableVgwRoutePropagationOutput, error) { - if params == nil { - params = &DisableVgwRoutePropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableVgwRoutePropagation", params, optFns, c.addOperationDisableVgwRoutePropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableVgwRoutePropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for DisableVgwRoutePropagation. -type DisableVgwRoutePropagationInput struct { - - // The ID of the virtual private gateway. - // - // This member is required. - GatewayId *string - - // The ID of the route table. - // - // This member is required. - RouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableVgwRoutePropagationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableVgwRoutePropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableVgwRoutePropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableVgwRoutePropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableVgwRoutePropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableVgwRoutePropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableVgwRoutePropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableVgwRoutePropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableVgwRoutePropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLink.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLink.go deleted file mode 100644 index 73f51e901..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLink.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that -// has EC2-Classic instances linked to it. -func (c *Client) DisableVpcClassicLink(ctx context.Context, params *DisableVpcClassicLinkInput, optFns ...func(*Options)) (*DisableVpcClassicLinkOutput, error) { - if params == nil { - params = &DisableVpcClassicLinkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableVpcClassicLink", params, optFns, c.addOperationDisableVpcClassicLinkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableVpcClassicLinkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableVpcClassicLinkInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisableVpcClassicLinkOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableVpcClassicLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableVpcClassicLink"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableVpcClassicLinkValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableVpcClassicLink(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableVpcClassicLink(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableVpcClassicLink", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLinkDnsSupport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLinkDnsSupport.go deleted file mode 100644 index f5f2c0fbd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisableVpcClassicLinkDnsSupport.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve -// to public IP addresses when addressed between a linked EC2-Classic instance and -// instances in the VPC to which it's linked. -// -// You must specify a VPC ID in the request. -func (c *Client) DisableVpcClassicLinkDnsSupport(ctx context.Context, params *DisableVpcClassicLinkDnsSupportInput, optFns ...func(*Options)) (*DisableVpcClassicLinkDnsSupportOutput, error) { - if params == nil { - params = &DisableVpcClassicLinkDnsSupportInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableVpcClassicLinkDnsSupport", params, optFns, c.addOperationDisableVpcClassicLinkDnsSupportMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableVpcClassicLinkDnsSupportOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableVpcClassicLinkDnsSupportInput struct { - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -type DisableVpcClassicLinkDnsSupportOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableVpcClassicLinkDnsSupportMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisableVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableVpcClassicLinkDnsSupport"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableVpcClassicLinkDnsSupport(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableVpcClassicLinkDnsSupport(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableVpcClassicLinkDnsSupport", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateAddress.go deleted file mode 100644 index bdebb83c2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateAddress.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates an Elastic IP address from the instance or network interface it's -// associated with. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// An address cannot be disassociated if the all of the following conditions are -// met: -// -// - Network interface has a publicDualStackDnsName publicDnsName -// -// - Public IPv4 address is the primary public IPv4 address -// -// - Network interface only has one remaining public IPv4 address -func (c *Client) DisassociateAddress(ctx context.Context, params *DisassociateAddressInput, optFns ...func(*Options)) (*DisassociateAddressOutput, error) { - if params == nil { - params = &DisassociateAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateAddress", params, optFns, c.addOperationDisassociateAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateAddressInput struct { - - // The association ID. This parameter is required. - AssociationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Deprecated. - PublicIp *string - - noSmithyDocumentSerde -} - -type DisassociateAddressOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateCapacityReservationBillingOwner.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateCapacityReservationBillingOwner.go deleted file mode 100644 index 88d764f31..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateCapacityReservationBillingOwner.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels a pending request to assign billing of the unused capacity of a -// Capacity Reservation to a consumer account, or revokes a request that has -// already been accepted. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations]. -// -// [Billing assignment for shared Amazon EC2 Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html -func (c *Client) DisassociateCapacityReservationBillingOwner(ctx context.Context, params *DisassociateCapacityReservationBillingOwnerInput, optFns ...func(*Options)) (*DisassociateCapacityReservationBillingOwnerOutput, error) { - if params == nil { - params = &DisassociateCapacityReservationBillingOwnerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateCapacityReservationBillingOwner", params, optFns, c.addOperationDisassociateCapacityReservationBillingOwnerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateCapacityReservationBillingOwnerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateCapacityReservationBillingOwnerInput struct { - - // The ID of the Capacity Reservation. - // - // This member is required. - CapacityReservationId *string - - // The ID of the consumer account to which the request was sent. - // - // This member is required. - UnusedReservationBillingOwnerId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateCapacityReservationBillingOwnerOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateCapacityReservationBillingOwnerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateCapacityReservationBillingOwner{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateCapacityReservationBillingOwner{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateCapacityReservationBillingOwner"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateCapacityReservationBillingOwnerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateCapacityReservationBillingOwner(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateCapacityReservationBillingOwner(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateCapacityReservationBillingOwner", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateClientVpnTargetNetwork.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateClientVpnTargetNetwork.go deleted file mode 100644 index f3bb15c73..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateClientVpnTargetNetwork.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a target network from the specified Client VPN endpoint. When you -// disassociate the last target network from a Client VPN, the following happens: -// -// - The route that was automatically added for the VPC is deleted -// -// - All active client connections are terminated -// -// - New client connections are disallowed -// -// - The Client VPN endpoint's status changes to pending-associate -func (c *Client) DisassociateClientVpnTargetNetwork(ctx context.Context, params *DisassociateClientVpnTargetNetworkInput, optFns ...func(*Options)) (*DisassociateClientVpnTargetNetworkOutput, error) { - if params == nil { - params = &DisassociateClientVpnTargetNetworkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateClientVpnTargetNetwork", params, optFns, c.addOperationDisassociateClientVpnTargetNetworkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateClientVpnTargetNetworkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateClientVpnTargetNetworkInput struct { - - // The ID of the target network association. - // - // This member is required. - AssociationId *string - - // The ID of the Client VPN endpoint from which to disassociate the target network. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateClientVpnTargetNetworkOutput struct { - - // The ID of the target network association. - AssociationId *string - - // The current state of the target network association. - Status *types.AssociationStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateClientVpnTargetNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateClientVpnTargetNetwork{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateClientVpnTargetNetwork"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateClientVpnTargetNetworkValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateClientVpnTargetNetwork(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateClientVpnTargetNetwork(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateClientVpnTargetNetwork", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateEnclaveCertificateIamRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateEnclaveCertificateIamRole.go deleted file mode 100644 index b833ea019..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateEnclaveCertificateIamRole.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates an IAM role from an Certificate Manager (ACM) certificate. -// Disassociating an IAM role from an ACM certificate removes the Amazon S3 object -// that contains the certificate, certificate chain, and encrypted private key from -// the Amazon S3 bucket. It also revokes the IAM role's permission to use the KMS -// key used to encrypt the private key. This effectively revokes the role's -// permission to use the certificate. -func (c *Client) DisassociateEnclaveCertificateIamRole(ctx context.Context, params *DisassociateEnclaveCertificateIamRoleInput, optFns ...func(*Options)) (*DisassociateEnclaveCertificateIamRoleOutput, error) { - if params == nil { - params = &DisassociateEnclaveCertificateIamRoleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateEnclaveCertificateIamRole", params, optFns, c.addOperationDisassociateEnclaveCertificateIamRoleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateEnclaveCertificateIamRoleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateEnclaveCertificateIamRoleInput struct { - - // The ARN of the ACM certificate from which to disassociate the IAM role. - // - // This member is required. - CertificateArn *string - - // The ARN of the IAM role to disassociate. - // - // This member is required. - RoleArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateEnclaveCertificateIamRoleOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateEnclaveCertificateIamRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateEnclaveCertificateIamRole{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateEnclaveCertificateIamRole{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateEnclaveCertificateIamRole"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateEnclaveCertificateIamRoleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateEnclaveCertificateIamRole(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateEnclaveCertificateIamRole(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateEnclaveCertificateIamRole", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIamInstanceProfile.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIamInstanceProfile.go deleted file mode 100644 index 5c17867eb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIamInstanceProfile.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates an IAM instance profile from a running or stopped instance. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -func (c *Client) DisassociateIamInstanceProfile(ctx context.Context, params *DisassociateIamInstanceProfileInput, optFns ...func(*Options)) (*DisassociateIamInstanceProfileOutput, error) { - if params == nil { - params = &DisassociateIamInstanceProfileInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateIamInstanceProfile", params, optFns, c.addOperationDisassociateIamInstanceProfileMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateIamInstanceProfileOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateIamInstanceProfileInput struct { - - // The ID of the IAM instance profile association. - // - // This member is required. - AssociationId *string - - noSmithyDocumentSerde -} - -type DisassociateIamInstanceProfileOutput struct { - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *types.IamInstanceProfileAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateIamInstanceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateIamInstanceProfile{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateIamInstanceProfile{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateIamInstanceProfile"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateIamInstanceProfileValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateIamInstanceProfile(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateIamInstanceProfile(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateIamInstanceProfile", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateInstanceEventWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateInstanceEventWindow.go deleted file mode 100644 index e4736d4de..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateInstanceEventWindow.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates one or more targets from an event window. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) DisassociateInstanceEventWindow(ctx context.Context, params *DisassociateInstanceEventWindowInput, optFns ...func(*Options)) (*DisassociateInstanceEventWindowOutput, error) { - if params == nil { - params = &DisassociateInstanceEventWindowInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateInstanceEventWindow", params, optFns, c.addOperationDisassociateInstanceEventWindowMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateInstanceEventWindowOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateInstanceEventWindowInput struct { - - // One or more targets to disassociate from the specified event window. - // - // This member is required. - AssociationTarget *types.InstanceEventWindowDisassociationRequest - - // The ID of the event window. - // - // This member is required. - InstanceEventWindowId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateInstanceEventWindowOutput struct { - - // Information about the event window. - InstanceEventWindow *types.InstanceEventWindow - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateInstanceEventWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateInstanceEventWindow"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateInstanceEventWindowValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateInstanceEventWindow(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateInstanceEventWindow(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateInstanceEventWindow", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamByoasn.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamByoasn.go deleted file mode 100644 index 99237e515..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamByoasn.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Remove the association between your Autonomous System Number (ASN) and your -// BYOIP CIDR. You may want to use this action to disassociate an ASN from a CIDR -// or if you want to swap ASNs. For more information, see [Tutorial: Bring your ASN to IPAM]in the Amazon VPC IPAM -// guide. -// -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -func (c *Client) DisassociateIpamByoasn(ctx context.Context, params *DisassociateIpamByoasnInput, optFns ...func(*Options)) (*DisassociateIpamByoasnOutput, error) { - if params == nil { - params = &DisassociateIpamByoasnInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateIpamByoasn", params, optFns, c.addOperationDisassociateIpamByoasnMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateIpamByoasnOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateIpamByoasnInput struct { - - // A public 2-byte or 4-byte ASN. - // - // This member is required. - Asn *string - - // A BYOIP CIDR. - // - // This member is required. - Cidr *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateIpamByoasnOutput struct { - - // An ASN and BYOIP CIDR association. - AsnAssociation *types.AsnAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateIpamByoasn{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateIpamByoasn{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateIpamByoasn"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateIpamByoasnValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateIpamByoasn(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateIpamByoasn", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamResourceDiscovery.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamResourceDiscovery.go deleted file mode 100644 index 7dd604072..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateIpamResourceDiscovery.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a resource discovery from an Amazon VPC IPAM. A resource -// discovery is an IPAM component that enables IPAM to manage and monitor resources -// that belong to the owning account. -func (c *Client) DisassociateIpamResourceDiscovery(ctx context.Context, params *DisassociateIpamResourceDiscoveryInput, optFns ...func(*Options)) (*DisassociateIpamResourceDiscoveryOutput, error) { - if params == nil { - params = &DisassociateIpamResourceDiscoveryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateIpamResourceDiscovery", params, optFns, c.addOperationDisassociateIpamResourceDiscoveryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateIpamResourceDiscoveryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateIpamResourceDiscoveryInput struct { - - // A resource discovery association ID. - // - // This member is required. - IpamResourceDiscoveryAssociationId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateIpamResourceDiscoveryOutput struct { - - // A resource discovery association. - IpamResourceDiscoveryAssociation *types.IpamResourceDiscoveryAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateIpamResourceDiscoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateIpamResourceDiscovery"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateIpamResourceDiscoveryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateIpamResourceDiscovery(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateIpamResourceDiscovery(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateIpamResourceDiscovery", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateNatGatewayAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateNatGatewayAddress.go deleted file mode 100644 index d084720b9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateNatGatewayAddress.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. -// You cannot disassociate your primary EIP. For more information, see [Edit secondary IP address associations]in the -// Amazon VPC User Guide. -// -// While disassociating is in progress, you cannot associate/disassociate -// additional EIPs while the connections are being drained. You are, however, -// allowed to delete the NAT gateway. -// -// An EIP is released only at the end of MaxDrainDurationSeconds. It stays -// associated and supports the existing connections but does not support any new -// connections (new connections are distributed across the remaining associated -// EIPs). As the existing connections drain out, the EIPs (and the corresponding -// private IP addresses mapped to them) are released. -// -// [Edit secondary IP address associations]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html#nat-gateway-edit-secondary -func (c *Client) DisassociateNatGatewayAddress(ctx context.Context, params *DisassociateNatGatewayAddressInput, optFns ...func(*Options)) (*DisassociateNatGatewayAddressOutput, error) { - if params == nil { - params = &DisassociateNatGatewayAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateNatGatewayAddress", params, optFns, c.addOperationDisassociateNatGatewayAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateNatGatewayAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateNatGatewayAddressInput struct { - - // The association IDs of EIPs that have been associated with the NAT gateway. - // - // This member is required. - AssociationIds []string - - // The ID of the NAT gateway. - // - // This member is required. - NatGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum amount of time to wait (in seconds) before forcibly releasing the - // IP addresses if connections are still in progress. Default value is 350 seconds. - MaxDrainDurationSeconds *int32 - - noSmithyDocumentSerde -} - -type DisassociateNatGatewayAddressOutput struct { - - // Information about the NAT gateway IP addresses. - NatGatewayAddresses []types.NatGatewayAddress - - // The ID of the NAT gateway. - NatGatewayId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateNatGatewayAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateNatGatewayAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateNatGatewayAddressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateNatGatewayAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateNatGatewayAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateNatGatewayAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteServer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteServer.go deleted file mode 100644 index 5cfbad09e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteServer.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a route server from a VPC. -// -// A route server association is the connection established between a route server -// and a VPC. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) DisassociateRouteServer(ctx context.Context, params *DisassociateRouteServerInput, optFns ...func(*Options)) (*DisassociateRouteServerOutput, error) { - if params == nil { - params = &DisassociateRouteServerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateRouteServer", params, optFns, c.addOperationDisassociateRouteServerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateRouteServerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateRouteServerInput struct { - - // The ID of the route server to disassociate. - // - // This member is required. - RouteServerId *string - - // The ID of the VPC to disassociate from the route server. - // - // This member is required. - VpcId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateRouteServerOutput struct { - - // Information about the disassociated route server. - RouteServerAssociation *types.RouteServerAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateRouteServerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateRouteServer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateRouteServer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateRouteServer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateRouteServerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateRouteServer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateRouteServer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateRouteServer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteTable.go deleted file mode 100644 index 3961e9ec6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateRouteTable.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a subnet or gateway from a route table. -// -// After you perform this action, the subnet no longer uses the routes in the -// route table. Instead, it uses the routes in the VPC's main route table. For more -// information about route tables, see [Route tables]in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) DisassociateRouteTable(ctx context.Context, params *DisassociateRouteTableInput, optFns ...func(*Options)) (*DisassociateRouteTableOutput, error) { - if params == nil { - params = &DisassociateRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateRouteTable", params, optFns, c.addOperationDisassociateRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateRouteTableInput struct { - - // The association ID representing the current association between the route table - // and subnet or gateway. - // - // This member is required. - AssociationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateRouteTableOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSecurityGroupVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSecurityGroupVpc.go deleted file mode 100644 index 1f8b2088e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSecurityGroupVpc.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a security group from a VPC. You cannot disassociate the security -// group if any Elastic network interfaces in the associated VPC are still -// associated with the security group. -// -// Note that the disassociation is asynchronous and you can check the status of -// the request with [DescribeSecurityGroupVpcAssociations]. -// -// [DescribeSecurityGroupVpcAssociations]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupVpcAssociations.html -func (c *Client) DisassociateSecurityGroupVpc(ctx context.Context, params *DisassociateSecurityGroupVpcInput, optFns ...func(*Options)) (*DisassociateSecurityGroupVpcOutput, error) { - if params == nil { - params = &DisassociateSecurityGroupVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateSecurityGroupVpc", params, optFns, c.addOperationDisassociateSecurityGroupVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateSecurityGroupVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateSecurityGroupVpcInput struct { - - // A security group ID. - // - // This member is required. - GroupId *string - - // A VPC ID. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateSecurityGroupVpcOutput struct { - - // The state of the disassociation. - State types.SecurityGroupVpcAssociationState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateSecurityGroupVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateSecurityGroupVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateSecurityGroupVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateSecurityGroupVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateSecurityGroupVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateSecurityGroupVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateSecurityGroupVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateSecurityGroupVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSubnetCidrBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSubnetCidrBlock.go deleted file mode 100644 index 61006bdc8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateSubnetCidrBlock.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a CIDR block from a subnet. Currently, you can disassociate an -// IPv6 CIDR block only. You must detach or delete all gateways and resources that -// are associated with the CIDR block before you can disassociate it. -func (c *Client) DisassociateSubnetCidrBlock(ctx context.Context, params *DisassociateSubnetCidrBlockInput, optFns ...func(*Options)) (*DisassociateSubnetCidrBlockOutput, error) { - if params == nil { - params = &DisassociateSubnetCidrBlockInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateSubnetCidrBlock", params, optFns, c.addOperationDisassociateSubnetCidrBlockMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateSubnetCidrBlockOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateSubnetCidrBlockInput struct { - - // The association ID for the CIDR block. - // - // This member is required. - AssociationId *string - - noSmithyDocumentSerde -} - -type DisassociateSubnetCidrBlockOutput struct { - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *types.SubnetIpv6CidrBlockAssociation - - // The ID of the subnet. - SubnetId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateSubnetCidrBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateSubnetCidrBlock{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateSubnetCidrBlock{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateSubnetCidrBlock"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateSubnetCidrBlockValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateSubnetCidrBlock(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateSubnetCidrBlock(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateSubnetCidrBlock", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayMulticastDomain.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayMulticastDomain.go deleted file mode 100644 index ec2ef2cc6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayMulticastDomain.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates the specified subnets from the transit gateway multicast domain. -func (c *Client) DisassociateTransitGatewayMulticastDomain(ctx context.Context, params *DisassociateTransitGatewayMulticastDomainInput, optFns ...func(*Options)) (*DisassociateTransitGatewayMulticastDomainOutput, error) { - if params == nil { - params = &DisassociateTransitGatewayMulticastDomainInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateTransitGatewayMulticastDomain", params, optFns, c.addOperationDisassociateTransitGatewayMulticastDomainMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateTransitGatewayMulticastDomainOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateTransitGatewayMulticastDomainInput struct { - - // The IDs of the subnets; - // - // This member is required. - SubnetIds []string - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateTransitGatewayMulticastDomainOutput struct { - - // Information about the association. - Associations *types.TransitGatewayMulticastDomainAssociations - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateTransitGatewayMulticastDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateTransitGatewayMulticastDomain"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateTransitGatewayMulticastDomainValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTransitGatewayMulticastDomain(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateTransitGatewayMulticastDomain(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateTransitGatewayMulticastDomain", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayPolicyTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayPolicyTable.go deleted file mode 100644 index 9f6293829..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayPolicyTable.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the association between an an attachment and a policy table. -func (c *Client) DisassociateTransitGatewayPolicyTable(ctx context.Context, params *DisassociateTransitGatewayPolicyTableInput, optFns ...func(*Options)) (*DisassociateTransitGatewayPolicyTableOutput, error) { - if params == nil { - params = &DisassociateTransitGatewayPolicyTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateTransitGatewayPolicyTable", params, optFns, c.addOperationDisassociateTransitGatewayPolicyTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateTransitGatewayPolicyTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateTransitGatewayPolicyTableInput struct { - - // The ID of the transit gateway attachment to disassociate from the policy table. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the disassociated policy table. - // - // This member is required. - TransitGatewayPolicyTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateTransitGatewayPolicyTableOutput struct { - - // Returns details about the transit gateway policy table disassociation. - Association *types.TransitGatewayPolicyTableAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateTransitGatewayPolicyTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateTransitGatewayPolicyTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateTransitGatewayPolicyTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTransitGatewayPolicyTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateTransitGatewayPolicyTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateTransitGatewayPolicyTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayRouteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayRouteTable.go deleted file mode 100644 index 328e067d1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTransitGatewayRouteTable.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a resource attachment from a transit gateway route table. -func (c *Client) DisassociateTransitGatewayRouteTable(ctx context.Context, params *DisassociateTransitGatewayRouteTableInput, optFns ...func(*Options)) (*DisassociateTransitGatewayRouteTableOutput, error) { - if params == nil { - params = &DisassociateTransitGatewayRouteTableInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateTransitGatewayRouteTable", params, optFns, c.addOperationDisassociateTransitGatewayRouteTableMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateTransitGatewayRouteTableOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateTransitGatewayRouteTableInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateTransitGatewayRouteTableOutput struct { - - // Information about the association. - Association *types.TransitGatewayAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateTransitGatewayRouteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateTransitGatewayRouteTable"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateTransitGatewayRouteTableValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTransitGatewayRouteTable(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateTransitGatewayRouteTable(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateTransitGatewayRouteTable", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTrunkInterface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTrunkInterface.go deleted file mode 100644 index 1ad27ed39..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateTrunkInterface.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes an association between a branch network interface with a trunk network -// interface. -func (c *Client) DisassociateTrunkInterface(ctx context.Context, params *DisassociateTrunkInterfaceInput, optFns ...func(*Options)) (*DisassociateTrunkInterfaceOutput, error) { - if params == nil { - params = &DisassociateTrunkInterfaceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateTrunkInterface", params, optFns, c.addOperationDisassociateTrunkInterfaceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateTrunkInterfaceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateTrunkInterfaceInput struct { - - // The ID of the association - // - // This member is required. - AssociationId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type DisassociateTrunkInterfaceOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateTrunkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateTrunkInterface{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateTrunkInterface{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateTrunkInterface"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDisassociateTrunkInterfaceMiddleware(stack, options); err != nil { - return err - } - if err = addOpDisassociateTrunkInterfaceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTrunkInterface(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDisassociateTrunkInterface struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDisassociateTrunkInterface) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDisassociateTrunkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DisassociateTrunkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DisassociateTrunkInterfaceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDisassociateTrunkInterfaceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDisassociateTrunkInterface{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDisassociateTrunkInterface(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateTrunkInterface", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateVpcCidrBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateVpcCidrBlock.go deleted file mode 100644 index 7373a7a2b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_DisassociateVpcCidrBlock.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a CIDR block from a VPC. To disassociate the CIDR block, you must -// specify its association ID. You can get the association ID by using DescribeVpcs. You must -// detach or delete all gateways and resources that are associated with the CIDR -// block before you can disassociate it. -// -// You cannot disassociate the CIDR block with which you originally created the -// VPC (the primary CIDR block). -func (c *Client) DisassociateVpcCidrBlock(ctx context.Context, params *DisassociateVpcCidrBlockInput, optFns ...func(*Options)) (*DisassociateVpcCidrBlockOutput, error) { - if params == nil { - params = &DisassociateVpcCidrBlockInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateVpcCidrBlock", params, optFns, c.addOperationDisassociateVpcCidrBlockMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateVpcCidrBlockOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateVpcCidrBlockInput struct { - - // The association ID for the CIDR block. - // - // This member is required. - AssociationId *string - - noSmithyDocumentSerde -} - -type DisassociateVpcCidrBlockOutput struct { - - // Information about the IPv4 CIDR block association. - CidrBlockAssociation *types.VpcCidrBlockAssociation - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *types.VpcIpv6CidrBlockAssociation - - // The ID of the VPC. - VpcId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateVpcCidrBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateVpcCidrBlock{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateVpcCidrBlock{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateVpcCidrBlock"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateVpcCidrBlockValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateVpcCidrBlock(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateVpcCidrBlock(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateVpcCidrBlock", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAddressTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAddressTransfer.go deleted file mode 100644 index 2639464f5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAddressTransfer.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables Elastic IP address transfer. For more information, see [Transfer Elastic IP addresses] in the Amazon -// VPC User Guide. -// -// [Transfer Elastic IP addresses]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro -func (c *Client) EnableAddressTransfer(ctx context.Context, params *EnableAddressTransferInput, optFns ...func(*Options)) (*EnableAddressTransferOutput, error) { - if params == nil { - params = &EnableAddressTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableAddressTransfer", params, optFns, c.addOperationEnableAddressTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableAddressTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableAddressTransferInput struct { - - // The allocation ID of an Elastic IP address. - // - // This member is required. - AllocationId *string - - // The ID of the account that you want to transfer the Elastic IP address to. - // - // This member is required. - TransferAccountId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableAddressTransferOutput struct { - - // An Elastic IP address transfer. - AddressTransfer *types.AddressTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableAddressTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableAddressTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableAddressTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAddressTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableAddressTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAddressTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableAddressTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableAddressTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAllowedImagesSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAllowedImagesSettings.go deleted file mode 100644 index ef61e08b6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAllowedImagesSettings.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables Allowed AMIs for your account in the specified Amazon Web Services -// Region. Two values are accepted: -// -// - enabled : The image criteria in your Allowed AMIs settings are applied. As a -// result, only AMIs matching these criteria are discoverable and can be used by -// your account to launch instances. -// -// - audit-mode : The image criteria in your Allowed AMIs settings are not -// applied. No restrictions are placed on AMI discoverability or usage. Users in -// your account can launch instances using any public AMI or AMI shared with your -// account. -// -// The purpose of audit-mode is to indicate which AMIs will be affected when -// -// Allowed AMIs is enabled . In audit-mode , each AMI displays either -// "ImageAllowed": true or "ImageAllowed": false to indicate whether the AMI will -// be discoverable and available to users in the account when Allowed AMIs is -// enabled. -// -// The Allowed AMIs feature does not restrict the AMIs owned by your account. -// Regardless of the criteria you set, the AMIs created by your account will always -// be discoverable and usable by users in your account. -// -// For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. -// -// [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html -func (c *Client) EnableAllowedImagesSettings(ctx context.Context, params *EnableAllowedImagesSettingsInput, optFns ...func(*Options)) (*EnableAllowedImagesSettingsOutput, error) { - if params == nil { - params = &EnableAllowedImagesSettingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableAllowedImagesSettings", params, optFns, c.addOperationEnableAllowedImagesSettingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableAllowedImagesSettingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableAllowedImagesSettingsInput struct { - - // Specify enabled to apply the image criteria specified by the Allowed AMIs - // settings. Specify audit-mode so that you can check which AMIs will be allowed - // or not allowed by the image criteria. - // - // This member is required. - AllowedImagesSettingsState types.AllowedImagesSettingsEnabledState - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableAllowedImagesSettingsOutput struct { - - // Returns enabled or audit-mode if the request succeeds; otherwise, it returns an - // error. - AllowedImagesSettingsState types.AllowedImagesSettingsEnabledState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableAllowedImagesSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAllowedImagesSettings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableAllowedImagesSettingsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAllowedImagesSettings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableAllowedImagesSettings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableAllowedImagesSettings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAwsNetworkPerformanceMetricSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAwsNetworkPerformanceMetricSubscription.go deleted file mode 100644 index 8e5ba6700..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableAwsNetworkPerformanceMetricSubscription.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables Infrastructure Performance subscriptions. -func (c *Client) EnableAwsNetworkPerformanceMetricSubscription(ctx context.Context, params *EnableAwsNetworkPerformanceMetricSubscriptionInput, optFns ...func(*Options)) (*EnableAwsNetworkPerformanceMetricSubscriptionOutput, error) { - if params == nil { - params = &EnableAwsNetworkPerformanceMetricSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableAwsNetworkPerformanceMetricSubscription", params, optFns, c.addOperationEnableAwsNetworkPerformanceMetricSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableAwsNetworkPerformanceMetricSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableAwsNetworkPerformanceMetricSubscriptionInput struct { - - // The target Region (like us-east-2 ) or Availability Zone ID (like use2-az2 ) - // that the metric subscription is enabled for. If you use Availability Zone IDs, - // the Source and Destination Availability Zones must be in the same Region. - Destination *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The metric used for the enabled subscription. - Metric types.MetricType - - // The source Region (like us-east-1 ) or Availability Zone ID (like use1-az1 ) - // that the metric subscription is enabled for. If you use Availability Zone IDs, - // the Source and Destination Availability Zones must be in the same Region. - Source *string - - // The statistic used for the enabled subscription. - Statistic types.StatisticType - - noSmithyDocumentSerde -} - -type EnableAwsNetworkPerformanceMetricSubscriptionOutput struct { - - // Indicates whether the subscribe action was successful. - Output *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableAwsNetworkPerformanceMetricSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableAwsNetworkPerformanceMetricSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAwsNetworkPerformanceMetricSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAwsNetworkPerformanceMetricSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableAwsNetworkPerformanceMetricSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableAwsNetworkPerformanceMetricSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableEbsEncryptionByDefault.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableEbsEncryptionByDefault.go deleted file mode 100644 index e9ada8f0d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableEbsEncryptionByDefault.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables EBS encryption by default for your account in the current Region. -// -// After you enable encryption by default, the EBS volumes that you create are -// always encrypted, either using the default KMS key or the KMS key that you -// specified when you created each volume. For more information, see [Amazon EBS encryption]in the Amazon -// EBS User Guide. -// -// You can specify the default KMS key for encryption by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId. -// -// Enabling encryption by default has no effect on the encryption status of your -// existing volumes. -// -// After you enable encryption by default, you can no longer launch instances -// using instance types that do not support encryption. For more information, see [Supported instance types]. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -// [Supported instance types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances -func (c *Client) EnableEbsEncryptionByDefault(ctx context.Context, params *EnableEbsEncryptionByDefaultInput, optFns ...func(*Options)) (*EnableEbsEncryptionByDefaultOutput, error) { - if params == nil { - params = &EnableEbsEncryptionByDefaultInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableEbsEncryptionByDefault", params, optFns, c.addOperationEnableEbsEncryptionByDefaultMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableEbsEncryptionByDefaultOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableEbsEncryptionByDefaultInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableEbsEncryptionByDefaultOutput struct { - - // The updated status of encryption by default. - EbsEncryptionByDefault *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableEbsEncryptionByDefaultMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableEbsEncryptionByDefault"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableEbsEncryptionByDefault(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableEbsEncryptionByDefault(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableEbsEncryptionByDefault", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastLaunch.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastLaunch.go deleted file mode 100644 index c0d164578..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastLaunch.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// When you enable Windows fast launch for a Windows AMI, images are -// pre-provisioned, using snapshots to launch instances up to 65% faster. To create -// the optimized Windows image, Amazon EC2 launches an instance and runs through -// Sysprep steps, rebooting as required. Then it creates a set of reserved -// snapshots that are used for subsequent launches. The reserved snapshots are -// automatically replenished as they are used, depending on your settings for -// launch frequency. -// -// You can only change these settings for Windows AMIs that you own or that have -// been shared with you. -func (c *Client) EnableFastLaunch(ctx context.Context, params *EnableFastLaunchInput, optFns ...func(*Options)) (*EnableFastLaunchOutput, error) { - if params == nil { - params = &EnableFastLaunchInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableFastLaunch", params, optFns, c.addOperationEnableFastLaunchMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableFastLaunchOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableFastLaunchInput struct { - - // Specify the ID of the image for which to enable Windows fast launch. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The launch template to use when launching Windows instances from - // pre-provisioned snapshots. Launch template parameters can include either the - // name or ID of the launch template, but not both. - LaunchTemplate *types.FastLaunchLaunchTemplateSpecificationRequest - - // The maximum number of instances that Amazon EC2 can launch at the same time to - // create pre-provisioned snapshots for Windows fast launch. Value must be 6 or - // greater. - MaxParallelLaunches *int32 - - // The type of resource to use for pre-provisioning the AMI for Windows fast - // launch. Supported values include: snapshot , which is the default value. - ResourceType *string - - // Configuration settings for creating and managing the snapshots that are used - // for pre-provisioning the AMI for Windows fast launch. The associated - // ResourceType must be snapshot . - SnapshotConfiguration *types.FastLaunchSnapshotConfigurationRequest - - noSmithyDocumentSerde -} - -type EnableFastLaunchOutput struct { - - // The image ID that identifies the AMI for which Windows fast launch was enabled. - ImageId *string - - // The launch template that is used when launching Windows instances from - // pre-provisioned snapshots. - LaunchTemplate *types.FastLaunchLaunchTemplateSpecificationResponse - - // The maximum number of instances that Amazon EC2 can launch at the same time to - // create pre-provisioned snapshots for Windows fast launch. - MaxParallelLaunches *int32 - - // The owner ID for the AMI for which Windows fast launch was enabled. - OwnerId *string - - // The type of resource that was defined for pre-provisioning the AMI for Windows - // fast launch. - ResourceType types.FastLaunchResourceType - - // Settings to create and manage the pre-provisioned snapshots that Amazon EC2 - // uses for faster launches from the Windows AMI. This property is returned when - // the associated resourceType is snapshot . - SnapshotConfiguration *types.FastLaunchSnapshotConfigurationResponse - - // The current state of Windows fast launch for the specified AMI. - State types.FastLaunchStateCode - - // The reason that the state changed for Windows fast launch for the AMI. - StateTransitionReason *string - - // The time that the state changed for Windows fast launch for the AMI. - StateTransitionTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableFastLaunchMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableFastLaunch{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableFastLaunch{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableFastLaunch"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableFastLaunchValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableFastLaunch(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableFastLaunch(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableFastLaunch", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastSnapshotRestores.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastSnapshotRestores.go deleted file mode 100644 index 57c77bbe1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableFastSnapshotRestores.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables fast snapshot restores for the specified snapshots in the specified -// Availability Zones. -// -// You get the full benefit of fast snapshot restores after they enter the enabled -// state. To get the current state of fast snapshot restores, use DescribeFastSnapshotRestores. To disable -// fast snapshot restores, use DisableFastSnapshotRestores. -// -// For more information, see [Amazon EBS fast snapshot restore] in the Amazon EBS User Guide. -// -// [Amazon EBS fast snapshot restore]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-fast-snapshot-restore.html -func (c *Client) EnableFastSnapshotRestores(ctx context.Context, params *EnableFastSnapshotRestoresInput, optFns ...func(*Options)) (*EnableFastSnapshotRestoresOutput, error) { - if params == nil { - params = &EnableFastSnapshotRestoresInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableFastSnapshotRestores", params, optFns, c.addOperationEnableFastSnapshotRestoresMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableFastSnapshotRestoresOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableFastSnapshotRestoresInput struct { - - // One or more Availability Zones. For example, us-east-2a . - // - // This member is required. - AvailabilityZones []string - - // The IDs of one or more snapshots. For example, snap-1234567890abcdef0 . You can - // specify a snapshot that was shared with you from another Amazon Web Services - // account. - // - // This member is required. - SourceSnapshotIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableFastSnapshotRestoresOutput struct { - - // Information about the snapshots for which fast snapshot restores were - // successfully enabled. - Successful []types.EnableFastSnapshotRestoreSuccessItem - - // Information about the snapshots for which fast snapshot restores could not be - // enabled. - Unsuccessful []types.EnableFastSnapshotRestoreErrorItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableFastSnapshotRestoresMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableFastSnapshotRestores{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableFastSnapshotRestores"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableFastSnapshotRestoresValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableFastSnapshotRestores(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableFastSnapshotRestores(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableFastSnapshotRestores", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImage.go deleted file mode 100644 index 94afc1ea4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImage.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Re-enables a disabled AMI. The re-enabled AMI is marked as available and can be -// used for instance launches, appears in describe operations, and can be shared. -// Amazon Web Services accounts, organizations, and Organizational Units that lost -// access to the AMI when it was disabled do not regain access automatically. Once -// the AMI is available, it can be shared with them again. -// -// Only the AMI owner can re-enable a disabled AMI. -// -// For more information, see [Disable an Amazon EC2 AMI] in the Amazon EC2 User Guide. -// -// [Disable an Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html -func (c *Client) EnableImage(ctx context.Context, params *EnableImageInput, optFns ...func(*Options)) (*EnableImageOutput, error) { - if params == nil { - params = &EnableImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableImage", params, optFns, c.addOperationEnableImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableImageInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableImageOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageBlockPublicAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageBlockPublicAccess.go deleted file mode 100644 index 920979dd8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageBlockPublicAccess.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables block public access for AMIs at the account level in the specified -// Amazon Web Services Region. This prevents the public sharing of your AMIs. -// However, if you already have public AMIs, they will remain publicly available. -// -// The API can take up to 10 minutes to configure this setting. During this time, -// if you run [GetImageBlockPublicAccessState], the response will be unblocked . When the API has completed the -// configuration, the response will be block-new-sharing . -// -// For more information, see [Block public access to your AMIs] in the Amazon EC2 User Guide. -// -// [Block public access to your AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-to-amis.html -// [GetImageBlockPublicAccessState]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html -func (c *Client) EnableImageBlockPublicAccess(ctx context.Context, params *EnableImageBlockPublicAccessInput, optFns ...func(*Options)) (*EnableImageBlockPublicAccessOutput, error) { - if params == nil { - params = &EnableImageBlockPublicAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableImageBlockPublicAccess", params, optFns, c.addOperationEnableImageBlockPublicAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableImageBlockPublicAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableImageBlockPublicAccessInput struct { - - // Specify block-new-sharing to enable block public access for AMIs at the account - // level in the specified Region. This will block any attempt to publicly share - // your AMIs in the specified Region. - // - // This member is required. - ImageBlockPublicAccessState types.ImageBlockPublicAccessEnabledState - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableImageBlockPublicAccessOutput struct { - - // Returns block-new-sharing if the request succeeds; otherwise, it returns an - // error. - ImageBlockPublicAccessState types.ImageBlockPublicAccessEnabledState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableImageBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableImageBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableImageBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableImageBlockPublicAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableImageBlockPublicAccessValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableImageBlockPublicAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableImageBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableImageBlockPublicAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeprecation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeprecation.go deleted file mode 100644 index 33a3d746c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeprecation.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Enables deprecation of the specified AMI at the specified date and time. -// -// For more information, see [Deprecate an AMI] in the Amazon EC2 User Guide. -// -// [Deprecate an AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-deprecate.html -func (c *Client) EnableImageDeprecation(ctx context.Context, params *EnableImageDeprecationInput, optFns ...func(*Options)) (*EnableImageDeprecationOutput, error) { - if params == nil { - params = &EnableImageDeprecationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableImageDeprecation", params, optFns, c.addOperationEnableImageDeprecationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableImageDeprecationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableImageDeprecationInput struct { - - // The date and time to deprecate the AMI, in UTC, in the following format: - // YYYY-MM-DDTHH:MM:SSZ. If you specify a value for seconds, Amazon EC2 rounds the - // seconds to the nearest minute. - // - // You can’t specify a date in the past. The upper limit for DeprecateAt is 10 - // years from now, except for public AMIs, where the upper limit is 2 years from - // the creation date. - // - // This member is required. - DeprecateAt *time.Time - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableImageDeprecationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableImageDeprecationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableImageDeprecation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableImageDeprecation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableImageDeprecation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableImageDeprecationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableImageDeprecation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableImageDeprecation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableImageDeprecation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeregistrationProtection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeregistrationProtection.go deleted file mode 100644 index e4bc17644..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableImageDeregistrationProtection.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables deregistration protection for an AMI. When deregistration protection is -// enabled, the AMI can't be deregistered. -// -// To allow the AMI to be deregistered, you must first disable deregistration -// protection using DisableImageDeregistrationProtection. -// -// For more information, see [Protect an Amazon EC2 AMI from deregistration] in the Amazon EC2 User Guide. -// -// [Protect an Amazon EC2 AMI from deregistration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-deregistration-protection.html -func (c *Client) EnableImageDeregistrationProtection(ctx context.Context, params *EnableImageDeregistrationProtectionInput, optFns ...func(*Options)) (*EnableImageDeregistrationProtectionOutput, error) { - if params == nil { - params = &EnableImageDeregistrationProtectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableImageDeregistrationProtection", params, optFns, c.addOperationEnableImageDeregistrationProtectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableImageDeregistrationProtectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableImageDeregistrationProtectionInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // If true , enforces deregistration protection for 24 hours after deregistration - // protection is disabled. - WithCooldown *bool - - noSmithyDocumentSerde -} - -type EnableImageDeregistrationProtectionOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableImageDeregistrationProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableImageDeregistrationProtection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableImageDeregistrationProtection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableImageDeregistrationProtection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableImageDeregistrationProtectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableImageDeregistrationProtection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableImageDeregistrationProtection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableImageDeregistrationProtection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableIpamOrganizationAdminAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableIpamOrganizationAdminAccount.go deleted file mode 100644 index 1d2cd5a2b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableIpamOrganizationAdminAccount.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enable an Organizations member account as the IPAM admin account. You cannot -// select the Organizations management account as the IPAM admin account. For more -// information, see [Enable integration with Organizations]in the Amazon VPC IPAM User Guide. -// -// [Enable integration with Organizations]: https://docs.aws.amazon.com/vpc/latest/ipam/enable-integ-ipam.html -func (c *Client) EnableIpamOrganizationAdminAccount(ctx context.Context, params *EnableIpamOrganizationAdminAccountInput, optFns ...func(*Options)) (*EnableIpamOrganizationAdminAccountOutput, error) { - if params == nil { - params = &EnableIpamOrganizationAdminAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableIpamOrganizationAdminAccount", params, optFns, c.addOperationEnableIpamOrganizationAdminAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableIpamOrganizationAdminAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableIpamOrganizationAdminAccountInput struct { - - // The Organizations member account ID that you want to enable as the IPAM account. - // - // This member is required. - DelegatedAdminAccountId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableIpamOrganizationAdminAccountOutput struct { - - // The result of enabling the IPAM account. - Success *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableIpamOrganizationAdminAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableIpamOrganizationAdminAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableIpamOrganizationAdminAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableIpamOrganizationAdminAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableIpamOrganizationAdminAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableIpamOrganizationAdminAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableIpamOrganizationAdminAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableReachabilityAnalyzerOrganizationSharing.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableReachabilityAnalyzerOrganizationSharing.go deleted file mode 100644 index a4ae0990f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableReachabilityAnalyzerOrganizationSharing.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Establishes a trust relationship between Reachability Analyzer and -// Organizations. This operation must be performed by the management account for -// the organization. -// -// After you establish a trust relationship, a user in the management account or a -// delegated administrator account can run a cross-account analysis using resources -// from the member accounts. -func (c *Client) EnableReachabilityAnalyzerOrganizationSharing(ctx context.Context, params *EnableReachabilityAnalyzerOrganizationSharingInput, optFns ...func(*Options)) (*EnableReachabilityAnalyzerOrganizationSharingOutput, error) { - if params == nil { - params = &EnableReachabilityAnalyzerOrganizationSharingInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableReachabilityAnalyzerOrganizationSharing", params, optFns, c.addOperationEnableReachabilityAnalyzerOrganizationSharingMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableReachabilityAnalyzerOrganizationSharingOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableReachabilityAnalyzerOrganizationSharingInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableReachabilityAnalyzerOrganizationSharingOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableReachabilityAnalyzerOrganizationSharingMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableReachabilityAnalyzerOrganizationSharing{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableReachabilityAnalyzerOrganizationSharing"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableReachabilityAnalyzerOrganizationSharing(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableReachabilityAnalyzerOrganizationSharing(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableReachabilityAnalyzerOrganizationSharing", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableRouteServerPropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableRouteServerPropagation.go deleted file mode 100644 index 88cb0e989..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableRouteServerPropagation.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Defines which route tables the route server can update with routes. -// -// When enabled, route server propagation installs the routes in the FIB on the -// route table you've specified. Route server supports IPv4 and IPv6 route -// propagation. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) EnableRouteServerPropagation(ctx context.Context, params *EnableRouteServerPropagationInput, optFns ...func(*Options)) (*EnableRouteServerPropagationOutput, error) { - if params == nil { - params = &EnableRouteServerPropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableRouteServerPropagation", params, optFns, c.addOperationEnableRouteServerPropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableRouteServerPropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableRouteServerPropagationInput struct { - - // The ID of the route server for which to enable propagation. - // - // This member is required. - RouteServerId *string - - // The ID of the route table to which route server will propagate routes. - // - // This member is required. - RouteTableId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableRouteServerPropagationOutput struct { - - // Information about the enabled route server propagation. - RouteServerPropagation *types.RouteServerPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableRouteServerPropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableRouteServerPropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableRouteServerPropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableRouteServerPropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableRouteServerPropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableRouteServerPropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableRouteServerPropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableRouteServerPropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSerialConsoleAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSerialConsoleAccess.go deleted file mode 100644 index 942421c62..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSerialConsoleAccess.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables access to the EC2 serial console of all instances for your account. By -// default, access to the EC2 serial console is disabled for your account. For more -// information, see [Manage account access to the EC2 serial console]in the Amazon EC2 User Guide. -// -// [Manage account access to the EC2 serial console]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access -func (c *Client) EnableSerialConsoleAccess(ctx context.Context, params *EnableSerialConsoleAccessInput, optFns ...func(*Options)) (*EnableSerialConsoleAccessOutput, error) { - if params == nil { - params = &EnableSerialConsoleAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableSerialConsoleAccess", params, optFns, c.addOperationEnableSerialConsoleAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableSerialConsoleAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableSerialConsoleAccessInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableSerialConsoleAccessOutput struct { - - // If true , access to the EC2 serial console of all instances is enabled for your - // account. If false , access to the EC2 serial console of all instances is - // disabled for your account. - SerialConsoleAccessEnabled *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableSerialConsoleAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableSerialConsoleAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableSerialConsoleAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableSerialConsoleAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableSerialConsoleAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableSerialConsoleAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableSerialConsoleAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go deleted file mode 100644 index 2333c0264..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables or modifies the block public access for snapshots setting at the -// account level for the specified Amazon Web Services Region. After you enable -// block public access for snapshots in a Region, users can no longer request -// public sharing for snapshots in that Region. Snapshots that are already publicly -// shared are either treated as private or they remain publicly shared, depending -// on the State that you specify. -// -// Enabling block public access for snapshots in block all sharing mode does not -// change the permissions for snapshots that are already publicly shared. Instead, -// it prevents these snapshots from be publicly visible and publicly accessible. -// Therefore, the attributes for these snapshots still indicate that they are -// publicly shared, even though they are not publicly available. -// -// If you later disable block public access or change the mode to block new -// sharing, these snapshots will become publicly available again. -// -// For more information, see [Block public access for snapshots] in the Amazon EBS User Guide. -// -// [Block public access for snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html -func (c *Client) EnableSnapshotBlockPublicAccess(ctx context.Context, params *EnableSnapshotBlockPublicAccessInput, optFns ...func(*Options)) (*EnableSnapshotBlockPublicAccessOutput, error) { - if params == nil { - params = &EnableSnapshotBlockPublicAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableSnapshotBlockPublicAccess", params, optFns, c.addOperationEnableSnapshotBlockPublicAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableSnapshotBlockPublicAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableSnapshotBlockPublicAccessInput struct { - - // The mode in which to enable block public access for snapshots for the Region. - // Specify one of the following values: - // - // - block-all-sharing - Prevents all public sharing of snapshots in the Region. - // Users in the account will no longer be able to request new public sharing. - // Additionally, snapshots that are already publicly shared are treated as private - // and they are no longer publicly available. - // - // - block-new-sharing - Prevents only new public sharing of snapshots in the - // Region. Users in the account will no longer be able to request new public - // sharing. However, snapshots that are already publicly shared, remain publicly - // available. - // - // unblocked is not a valid value for EnableSnapshotBlockPublicAccess. - // - // This member is required. - State types.SnapshotBlockPublicAccessState - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableSnapshotBlockPublicAccessOutput struct { - - // The state of block public access for snapshots for the account and Region. - // Returns either block-all-sharing or block-new-sharing if the request succeeds. - State types.SnapshotBlockPublicAccessState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableSnapshotBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableSnapshotBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableSnapshotBlockPublicAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableSnapshotBlockPublicAccessValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableSnapshotBlockPublicAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableSnapshotBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableSnapshotBlockPublicAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableTransitGatewayRouteTablePropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableTransitGatewayRouteTablePropagation.go deleted file mode 100644 index aa3159320..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableTransitGatewayRouteTablePropagation.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables the specified attachment to propagate routes to the specified -// propagation route table. -func (c *Client) EnableTransitGatewayRouteTablePropagation(ctx context.Context, params *EnableTransitGatewayRouteTablePropagationInput, optFns ...func(*Options)) (*EnableTransitGatewayRouteTablePropagationOutput, error) { - if params == nil { - params = &EnableTransitGatewayRouteTablePropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableTransitGatewayRouteTablePropagation", params, optFns, c.addOperationEnableTransitGatewayRouteTablePropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableTransitGatewayRouteTablePropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableTransitGatewayRouteTablePropagationInput struct { - - // The ID of the propagation route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - noSmithyDocumentSerde -} - -type EnableTransitGatewayRouteTablePropagationOutput struct { - - // Information about route propagation. - Propagation *types.TransitGatewayPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableTransitGatewayRouteTablePropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableTransitGatewayRouteTablePropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableTransitGatewayRouteTablePropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableTransitGatewayRouteTablePropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableTransitGatewayRouteTablePropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableTransitGatewayRouteTablePropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVgwRoutePropagation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVgwRoutePropagation.go deleted file mode 100644 index 05d0131a3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVgwRoutePropagation.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables a virtual private gateway (VGW) to propagate routes to the specified -// route table of a VPC. -func (c *Client) EnableVgwRoutePropagation(ctx context.Context, params *EnableVgwRoutePropagationInput, optFns ...func(*Options)) (*EnableVgwRoutePropagationOutput, error) { - if params == nil { - params = &EnableVgwRoutePropagationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableVgwRoutePropagation", params, optFns, c.addOperationEnableVgwRoutePropagationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableVgwRoutePropagationOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for EnableVgwRoutePropagation. -type EnableVgwRoutePropagationInput struct { - - // The ID of the virtual private gateway that is attached to a VPC. The virtual - // private gateway must be attached to the same VPC that the routing tables are - // associated with. - // - // This member is required. - GatewayId *string - - // The ID of the route table. The routing table must be associated with the same - // VPC that the virtual private gateway is attached to. - // - // This member is required. - RouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableVgwRoutePropagationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableVgwRoutePropagationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableVgwRoutePropagation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableVgwRoutePropagation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableVgwRoutePropagation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableVgwRoutePropagationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableVgwRoutePropagation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableVgwRoutePropagation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableVgwRoutePropagation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVolumeIO.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVolumeIO.go deleted file mode 100644 index 10c65f795..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVolumeIO.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables I/O operations for a volume that had I/O operations disabled because -// the data on the volume was potentially inconsistent. -func (c *Client) EnableVolumeIO(ctx context.Context, params *EnableVolumeIOInput, optFns ...func(*Options)) (*EnableVolumeIOOutput, error) { - if params == nil { - params = &EnableVolumeIOInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableVolumeIO", params, optFns, c.addOperationEnableVolumeIOMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableVolumeIOOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableVolumeIOInput struct { - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableVolumeIOOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableVolumeIOMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableVolumeIO{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableVolumeIO{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableVolumeIO"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableVolumeIOValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableVolumeIO(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableVolumeIO(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableVolumeIO", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLink.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLink.go deleted file mode 100644 index 1bc2c50b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLink.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your -// ClassicLink-enabled VPC to allow communication over private IP addresses. You -// cannot enable your VPC for ClassicLink if any of your VPC route tables have -// existing routes for address ranges within the 10.0.0.0/8 IP address range, -// excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 IP address -// ranges. -func (c *Client) EnableVpcClassicLink(ctx context.Context, params *EnableVpcClassicLinkInput, optFns ...func(*Options)) (*EnableVpcClassicLinkOutput, error) { - if params == nil { - params = &EnableVpcClassicLinkInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableVpcClassicLink", params, optFns, c.addOperationEnableVpcClassicLinkMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableVpcClassicLinkOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableVpcClassicLinkInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type EnableVpcClassicLinkOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableVpcClassicLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableVpcClassicLink{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableVpcClassicLink"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableVpcClassicLinkValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableVpcClassicLink(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableVpcClassicLink(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableVpcClassicLink", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLinkDnsSupport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLinkDnsSupport.go deleted file mode 100644 index 9f7f0856b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_EnableVpcClassicLinkDnsSupport.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private IP -// address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private IP -// address when addressed from a linked EC2-Classic instance. -// -// You must specify a VPC ID in the request. -func (c *Client) EnableVpcClassicLinkDnsSupport(ctx context.Context, params *EnableVpcClassicLinkDnsSupportInput, optFns ...func(*Options)) (*EnableVpcClassicLinkDnsSupportOutput, error) { - if params == nil { - params = &EnableVpcClassicLinkDnsSupportInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableVpcClassicLinkDnsSupport", params, optFns, c.addOperationEnableVpcClassicLinkDnsSupportMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableVpcClassicLinkDnsSupportOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableVpcClassicLinkDnsSupportInput struct { - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -type EnableVpcClassicLinkDnsSupportOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableVpcClassicLinkDnsSupportMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpEnableVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableVpcClassicLinkDnsSupport"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableVpcClassicLinkDnsSupport(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableVpcClassicLinkDnsSupport(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableVpcClassicLinkDnsSupport", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientCertificateRevocationList.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientCertificateRevocationList.go deleted file mode 100644 index c1ee512d6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientCertificateRevocationList.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Downloads the client certificate revocation list for the specified Client VPN -// endpoint. -func (c *Client) ExportClientVpnClientCertificateRevocationList(ctx context.Context, params *ExportClientVpnClientCertificateRevocationListInput, optFns ...func(*Options)) (*ExportClientVpnClientCertificateRevocationListOutput, error) { - if params == nil { - params = &ExportClientVpnClientCertificateRevocationListInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ExportClientVpnClientCertificateRevocationList", params, optFns, c.addOperationExportClientVpnClientCertificateRevocationListMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ExportClientVpnClientCertificateRevocationListOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ExportClientVpnClientCertificateRevocationListInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ExportClientVpnClientCertificateRevocationListOutput struct { - - // Information about the client certificate revocation list. - CertificateRevocationList *string - - // The current state of the client certificate revocation list. - Status *types.ClientCertificateRevocationListStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationExportClientVpnClientCertificateRevocationListMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpExportClientVpnClientCertificateRevocationList{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ExportClientVpnClientCertificateRevocationList"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpExportClientVpnClientCertificateRevocationListValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportClientVpnClientCertificateRevocationList(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opExportClientVpnClientCertificateRevocationList(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ExportClientVpnClientCertificateRevocationList", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientConfiguration.go deleted file mode 100644 index 2a4b2c6c6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportClientVpnClientConfiguration.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Downloads the contents of the Client VPN endpoint configuration file for the -// specified Client VPN endpoint. The Client VPN endpoint configuration file -// includes the Client VPN endpoint and certificate information clients need to -// establish a connection with the Client VPN endpoint. -func (c *Client) ExportClientVpnClientConfiguration(ctx context.Context, params *ExportClientVpnClientConfigurationInput, optFns ...func(*Options)) (*ExportClientVpnClientConfigurationOutput, error) { - if params == nil { - params = &ExportClientVpnClientConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ExportClientVpnClientConfiguration", params, optFns, c.addOperationExportClientVpnClientConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ExportClientVpnClientConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ExportClientVpnClientConfigurationInput struct { - - // The ID of the Client VPN endpoint. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ExportClientVpnClientConfigurationOutput struct { - - // The contents of the Client VPN endpoint configuration file. - ClientConfiguration *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationExportClientVpnClientConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpExportClientVpnClientConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpExportClientVpnClientConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ExportClientVpnClientConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpExportClientVpnClientConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportClientVpnClientConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opExportClientVpnClientConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ExportClientVpnClientConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportImage.go deleted file mode 100644 index ffd9f2e32..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportImage.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Exports an Amazon Machine Image (AMI) to a VM file. For more information, see [Exporting a VM directly from an Amazon Machine Image (AMI)] -// in the VM Import/Export User Guide. -// -// [Exporting a VM directly from an Amazon Machine Image (AMI)]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.html -func (c *Client) ExportImage(ctx context.Context, params *ExportImageInput, optFns ...func(*Options)) (*ExportImageOutput, error) { - if params == nil { - params = &ExportImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ExportImage", params, optFns, c.addOperationExportImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ExportImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ExportImageInput struct { - - // The disk image format. - // - // This member is required. - DiskImageFormat types.DiskImageFormat - - // The ID of the image. - // - // This member is required. - ImageId *string - - // The Amazon S3 bucket for the destination image. The destination bucket must - // exist. - // - // This member is required. - S3ExportLocation *types.ExportTaskS3LocationRequest - - // Token to enable idempotency for export image requests. - ClientToken *string - - // A description of the image being exported. The maximum length is 255 characters. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the role that grants VM Import/Export permission to export images - // to your Amazon S3 bucket. If this parameter is not specified, the default role - // is named 'vmimport'. - RoleName *string - - // The tags to apply to the export image task during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type ExportImageOutput struct { - - // A description of the image being exported. - Description *string - - // The disk image format for the exported image. - DiskImageFormat types.DiskImageFormat - - // The ID of the export image task. - ExportImageTaskId *string - - // The ID of the image. - ImageId *string - - // The percent complete of the export image task. - Progress *string - - // The name of the role that grants VM Import/Export permission to export images - // to your Amazon S3 bucket. - RoleName *string - - // Information about the destination Amazon S3 bucket. - S3ExportLocation *types.ExportTaskS3Location - - // The status of the export image task. The possible values are active , completed - // , deleting , and deleted . - Status *string - - // The status message for the export image task. - StatusMessage *string - - // Any tags assigned to the export image task. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationExportImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpExportImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpExportImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ExportImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opExportImageMiddleware(stack, options); err != nil { - return err - } - if err = addOpExportImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpExportImage struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpExportImage) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpExportImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ExportImageInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ExportImageInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opExportImageMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpExportImage{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opExportImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ExportImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportTransitGatewayRoutes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportTransitGatewayRoutes.go deleted file mode 100644 index 4761de005..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportTransitGatewayRoutes.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Exports routes from the specified transit gateway route table to the specified -// S3 bucket. By default, all routes are exported. Alternatively, you can filter by -// CIDR range. -// -// The routes are saved to the specified bucket in a JSON file. For more -// information, see [Export route tables to Amazon S3]in the Amazon Web Services Transit Gateways Guide. -// -// [Export route tables to Amazon S3]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-export-route-tables -func (c *Client) ExportTransitGatewayRoutes(ctx context.Context, params *ExportTransitGatewayRoutesInput, optFns ...func(*Options)) (*ExportTransitGatewayRoutesOutput, error) { - if params == nil { - params = &ExportTransitGatewayRoutesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ExportTransitGatewayRoutes", params, optFns, c.addOperationExportTransitGatewayRoutesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ExportTransitGatewayRoutesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ExportTransitGatewayRoutesInput struct { - - // The name of the S3 bucket. - // - // This member is required. - S3Bucket *string - - // The ID of the route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - attachment.transit-gateway-attachment-id - The id of the transit gateway - // attachment. - // - // - attachment.resource-id - The resource id of the transit gateway attachment. - // - // - route-search.exact-match - The exact match of the specified filter. - // - // - route-search.longest-prefix-match - The longest prefix that matches the - // route. - // - // - route-search.subnet-of-match - The routes with a subnet that match the - // specified CIDR filter. - // - // - route-search.supernet-of-match - The routes with a CIDR that encompass the - // CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your - // route table and you specify supernet-of-match as 10.0.1.0/30, then the result - // returns 10.0.1.0/29. - // - // - state - The state of the route ( active | blackhole ). - // - // - transit-gateway-route-destination-cidr-block - The CIDR range. - // - // - type - The type of route ( propagated | static ). - Filters []types.Filter - - noSmithyDocumentSerde -} - -type ExportTransitGatewayRoutesOutput struct { - - // The URL of the exported file in Amazon S3. For example, - // s3://bucket_name/VPCTransitGateway/TransitGatewayRouteTables/file_name. - S3Location *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationExportTransitGatewayRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpExportTransitGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpExportTransitGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ExportTransitGatewayRoutes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpExportTransitGatewayRoutesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportTransitGatewayRoutes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opExportTransitGatewayRoutes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ExportTransitGatewayRoutes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportVerifiedAccessInstanceClientConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportVerifiedAccessInstanceClientConfiguration.go deleted file mode 100644 index 4aafbe3c6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ExportVerifiedAccessInstanceClientConfiguration.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Exports the client configuration for a Verified Access instance. -func (c *Client) ExportVerifiedAccessInstanceClientConfiguration(ctx context.Context, params *ExportVerifiedAccessInstanceClientConfigurationInput, optFns ...func(*Options)) (*ExportVerifiedAccessInstanceClientConfigurationOutput, error) { - if params == nil { - params = &ExportVerifiedAccessInstanceClientConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ExportVerifiedAccessInstanceClientConfiguration", params, optFns, c.addOperationExportVerifiedAccessInstanceClientConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ExportVerifiedAccessInstanceClientConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ExportVerifiedAccessInstanceClientConfigurationInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ExportVerifiedAccessInstanceClientConfigurationOutput struct { - - // The device trust providers. - DeviceTrustProviders []types.DeviceTrustProviderType - - // The Open VPN configuration. - OpenVpnConfigurations []types.VerifiedAccessInstanceOpenVpnClientConfiguration - - // The Region. - Region *string - - // The user identity trust provider. - UserTrustProvider *types.VerifiedAccessInstanceUserTrustProviderClientConfiguration - - // The ID of the Verified Access instance. - VerifiedAccessInstanceId *string - - // The version. - Version *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationExportVerifiedAccessInstanceClientConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpExportVerifiedAccessInstanceClientConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpExportVerifiedAccessInstanceClientConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ExportVerifiedAccessInstanceClientConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpExportVerifiedAccessInstanceClientConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportVerifiedAccessInstanceClientConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opExportVerifiedAccessInstanceClientConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ExportVerifiedAccessInstanceClientConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetActiveVpnTunnelStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetActiveVpnTunnelStatus.go deleted file mode 100644 index b291830f2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetActiveVpnTunnelStatus.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the currently negotiated security parameters for an active VPN tunnel, -// including IKE version, DH groups, encryption algorithms, and integrity -// algorithms. -func (c *Client) GetActiveVpnTunnelStatus(ctx context.Context, params *GetActiveVpnTunnelStatusInput, optFns ...func(*Options)) (*GetActiveVpnTunnelStatusOutput, error) { - if params == nil { - params = &GetActiveVpnTunnelStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetActiveVpnTunnelStatus", params, optFns, c.addOperationGetActiveVpnTunnelStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetActiveVpnTunnelStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetActiveVpnTunnelStatusInput struct { - - // The ID of the VPN connection for which to retrieve the active tunnel status. - // - // This member is required. - VpnConnectionId *string - - // The external IP address of the VPN tunnel for which to retrieve the active - // status. - // - // This member is required. - VpnTunnelOutsideIpAddress *string - - // Checks whether you have the required permissions for the action, without - // actually making the request. - DryRun *bool - - noSmithyDocumentSerde -} - -type GetActiveVpnTunnelStatusOutput struct { - - // Information about the current security configuration of the VPN tunnel. - ActiveVpnTunnelStatus *types.ActiveVpnTunnelStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetActiveVpnTunnelStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetActiveVpnTunnelStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetActiveVpnTunnelStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetActiveVpnTunnelStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetActiveVpnTunnelStatusValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetActiveVpnTunnelStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetActiveVpnTunnelStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetActiveVpnTunnelStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAllowedImagesSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAllowedImagesSettings.go deleted file mode 100644 index 75a40caf2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAllowedImagesSettings.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the current state of the Allowed AMIs setting and the list of Allowed AMIs -// criteria at the account level in the specified Region. -// -// The Allowed AMIs feature does not restrict the AMIs owned by your account. -// Regardless of the criteria you set, the AMIs created by your account will always -// be discoverable and usable by users in your account. -// -// For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. -// -// [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html -func (c *Client) GetAllowedImagesSettings(ctx context.Context, params *GetAllowedImagesSettingsInput, optFns ...func(*Options)) (*GetAllowedImagesSettingsOutput, error) { - if params == nil { - params = &GetAllowedImagesSettingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAllowedImagesSettings", params, optFns, c.addOperationGetAllowedImagesSettingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAllowedImagesSettingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAllowedImagesSettingsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetAllowedImagesSettingsOutput struct { - - // The list of criteria for images that are discoverable and usable in the account - // in the specified Amazon Web Services Region. - ImageCriteria []types.ImageCriterion - - // The entity that manages the Allowed AMIs settings. Possible values include: - // - // - account - The Allowed AMIs settings is managed by the account. - // - // - declarative-policy - The Allowed AMIs settings is managed by a declarative - // policy and can't be modified by the account. - ManagedBy types.ManagedBy - - // The current state of the Allowed AMIs setting at the account level in the - // specified Amazon Web Services Region. - // - // Possible values: - // - // - disabled : All AMIs are allowed. - // - // - audit-mode : All AMIs are allowed, but the ImageAllowed field is set to true - // if the AMI would be allowed with the current list of criteria if allowed AMIs - // was enabled. - // - // - enabled : Only AMIs matching the image criteria are discoverable and - // available for use. - State *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAllowedImagesSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAllowedImagesSettings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAllowedImagesSettings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetAllowedImagesSettings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAllowedImagesSettings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedEnclaveCertificateIamRoles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedEnclaveCertificateIamRoles.go deleted file mode 100644 index 6fbad3128..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedEnclaveCertificateIamRoles.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the IAM roles that are associated with the specified ACM (ACM) -// certificate. It also returns the name of the Amazon S3 bucket and the Amazon S3 -// object key where the certificate, certificate chain, and encrypted private key -// bundle are stored, and the ARN of the KMS key that's used to encrypt the private -// key. -func (c *Client) GetAssociatedEnclaveCertificateIamRoles(ctx context.Context, params *GetAssociatedEnclaveCertificateIamRolesInput, optFns ...func(*Options)) (*GetAssociatedEnclaveCertificateIamRolesOutput, error) { - if params == nil { - params = &GetAssociatedEnclaveCertificateIamRolesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAssociatedEnclaveCertificateIamRoles", params, optFns, c.addOperationGetAssociatedEnclaveCertificateIamRolesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAssociatedEnclaveCertificateIamRolesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAssociatedEnclaveCertificateIamRolesInput struct { - - // The ARN of the ACM certificate for which to view the associated IAM roles, - // encryption keys, and Amazon S3 object information. - // - // This member is required. - CertificateArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetAssociatedEnclaveCertificateIamRolesOutput struct { - - // Information about the associated IAM roles. - AssociatedRoles []types.AssociatedRole - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAssociatedEnclaveCertificateIamRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetAssociatedEnclaveCertificateIamRoles{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAssociatedEnclaveCertificateIamRoles"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetAssociatedEnclaveCertificateIamRolesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssociatedEnclaveCertificateIamRoles(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetAssociatedEnclaveCertificateIamRoles(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAssociatedEnclaveCertificateIamRoles", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go deleted file mode 100644 index d43e72399..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the IPv6 CIDR block associations for a specified IPv6 -// address pool. -func (c *Client) GetAssociatedIpv6PoolCidrs(ctx context.Context, params *GetAssociatedIpv6PoolCidrsInput, optFns ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) { - if params == nil { - params = &GetAssociatedIpv6PoolCidrsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAssociatedIpv6PoolCidrs", params, optFns, c.addOperationGetAssociatedIpv6PoolCidrsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAssociatedIpv6PoolCidrsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAssociatedIpv6PoolCidrsInput struct { - - // The ID of the IPv6 address pool. - // - // This member is required. - PoolId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetAssociatedIpv6PoolCidrsOutput struct { - - // Information about the IPv6 CIDR block associations. - Ipv6CidrAssociations []types.Ipv6CidrAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAssociatedIpv6PoolCidrsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetAssociatedIpv6PoolCidrs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAssociatedIpv6PoolCidrs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetAssociatedIpv6PoolCidrsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssociatedIpv6PoolCidrs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetAssociatedIpv6PoolCidrsPaginatorOptions is the paginator options for -// GetAssociatedIpv6PoolCidrs -type GetAssociatedIpv6PoolCidrsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetAssociatedIpv6PoolCidrsPaginator is a paginator for -// GetAssociatedIpv6PoolCidrs -type GetAssociatedIpv6PoolCidrsPaginator struct { - options GetAssociatedIpv6PoolCidrsPaginatorOptions - client GetAssociatedIpv6PoolCidrsAPIClient - params *GetAssociatedIpv6PoolCidrsInput - nextToken *string - firstPage bool -} - -// NewGetAssociatedIpv6PoolCidrsPaginator returns a new -// GetAssociatedIpv6PoolCidrsPaginator -func NewGetAssociatedIpv6PoolCidrsPaginator(client GetAssociatedIpv6PoolCidrsAPIClient, params *GetAssociatedIpv6PoolCidrsInput, optFns ...func(*GetAssociatedIpv6PoolCidrsPaginatorOptions)) *GetAssociatedIpv6PoolCidrsPaginator { - if params == nil { - params = &GetAssociatedIpv6PoolCidrsInput{} - } - - options := GetAssociatedIpv6PoolCidrsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetAssociatedIpv6PoolCidrsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetAssociatedIpv6PoolCidrsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetAssociatedIpv6PoolCidrs page. -func (p *GetAssociatedIpv6PoolCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetAssociatedIpv6PoolCidrs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetAssociatedIpv6PoolCidrsAPIClient is a client that implements the -// GetAssociatedIpv6PoolCidrs operation. -type GetAssociatedIpv6PoolCidrsAPIClient interface { - GetAssociatedIpv6PoolCidrs(context.Context, *GetAssociatedIpv6PoolCidrsInput, ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) -} - -var _ GetAssociatedIpv6PoolCidrsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetAssociatedIpv6PoolCidrs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAssociatedIpv6PoolCidrs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAwsNetworkPerformanceData.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAwsNetworkPerformanceData.go deleted file mode 100644 index 9274dc314..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetAwsNetworkPerformanceData.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Gets network performance data. -func (c *Client) GetAwsNetworkPerformanceData(ctx context.Context, params *GetAwsNetworkPerformanceDataInput, optFns ...func(*Options)) (*GetAwsNetworkPerformanceDataOutput, error) { - if params == nil { - params = &GetAwsNetworkPerformanceDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAwsNetworkPerformanceData", params, optFns, c.addOperationGetAwsNetworkPerformanceDataMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAwsNetworkPerformanceDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAwsNetworkPerformanceDataInput struct { - - // A list of network performance data queries. - DataQueries []types.DataQuery - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ending time for the performance data request. The end time must be - // formatted as yyyy-mm-ddThh:mm:ss . For example, 2022-06-12T12:00:00.000Z . - EndTime *time.Time - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The starting time for the performance data request. The starting time must be - // formatted as yyyy-mm-ddThh:mm:ss . For example, 2022-06-10T12:00:00.000Z . - StartTime *time.Time - - noSmithyDocumentSerde -} - -type GetAwsNetworkPerformanceDataOutput struct { - - // The list of data responses. - DataResponses []types.DataResponse - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAwsNetworkPerformanceDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetAwsNetworkPerformanceData{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetAwsNetworkPerformanceData{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAwsNetworkPerformanceData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAwsNetworkPerformanceData(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetAwsNetworkPerformanceDataPaginatorOptions is the paginator options for -// GetAwsNetworkPerformanceData -type GetAwsNetworkPerformanceDataPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetAwsNetworkPerformanceDataPaginator is a paginator for -// GetAwsNetworkPerformanceData -type GetAwsNetworkPerformanceDataPaginator struct { - options GetAwsNetworkPerformanceDataPaginatorOptions - client GetAwsNetworkPerformanceDataAPIClient - params *GetAwsNetworkPerformanceDataInput - nextToken *string - firstPage bool -} - -// NewGetAwsNetworkPerformanceDataPaginator returns a new -// GetAwsNetworkPerformanceDataPaginator -func NewGetAwsNetworkPerformanceDataPaginator(client GetAwsNetworkPerformanceDataAPIClient, params *GetAwsNetworkPerformanceDataInput, optFns ...func(*GetAwsNetworkPerformanceDataPaginatorOptions)) *GetAwsNetworkPerformanceDataPaginator { - if params == nil { - params = &GetAwsNetworkPerformanceDataInput{} - } - - options := GetAwsNetworkPerformanceDataPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetAwsNetworkPerformanceDataPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetAwsNetworkPerformanceDataPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetAwsNetworkPerformanceData page. -func (p *GetAwsNetworkPerformanceDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAwsNetworkPerformanceDataOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetAwsNetworkPerformanceData(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetAwsNetworkPerformanceDataAPIClient is a client that implements the -// GetAwsNetworkPerformanceData operation. -type GetAwsNetworkPerformanceDataAPIClient interface { - GetAwsNetworkPerformanceData(context.Context, *GetAwsNetworkPerformanceDataInput, ...func(*Options)) (*GetAwsNetworkPerformanceDataOutput, error) -} - -var _ GetAwsNetworkPerformanceDataAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetAwsNetworkPerformanceData(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAwsNetworkPerformanceData", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCapacityReservationUsage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCapacityReservationUsage.go deleted file mode 100644 index 69b2f8605..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCapacityReservationUsage.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets usage information about a Capacity Reservation. If the Capacity -// Reservation is shared, it shows usage information for the Capacity Reservation -// owner and each Amazon Web Services account that is currently using the shared -// capacity. If the Capacity Reservation is not shared, it shows only the Capacity -// Reservation owner's usage. -func (c *Client) GetCapacityReservationUsage(ctx context.Context, params *GetCapacityReservationUsageInput, optFns ...func(*Options)) (*GetCapacityReservationUsageOutput, error) { - if params == nil { - params = &GetCapacityReservationUsageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCapacityReservationUsage", params, optFns, c.addOperationGetCapacityReservationUsageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCapacityReservationUsageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCapacityReservationUsageInput struct { - - // The ID of the Capacity Reservation. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetCapacityReservationUsageOutput struct { - - // The remaining capacity. Indicates the number of instances that can be launched - // in the Capacity Reservation. - AvailableInstanceCount *int32 - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // The type of instance for which the Capacity Reservation reserves capacity. - InstanceType *string - - // Information about the Capacity Reservation usage. - InstanceUsages []types.InstanceUsage - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The current state of the Capacity Reservation. A Capacity Reservation can be in - // one of the following states: - // - // - active - The capacity is available for use. - // - // - expired - The Capacity Reservation expired automatically at the date and - // time specified in your reservation request. The reserved capacity is no longer - // available for your use. - // - // - cancelled - The Capacity Reservation was canceled. The reserved capacity is - // no longer available for your use. - // - // - pending - The Capacity Reservation request was successful but the capacity - // provisioning is still pending. - // - // - failed - The Capacity Reservation request has failed. A request can fail due - // to request parameters that are not valid, capacity constraints, or instance - // limit constraints. You can view a failed request for 60 minutes. - // - // - scheduled - (Future-dated Capacity Reservations) The future-dated Capacity - // Reservation request was approved and the Capacity Reservation is scheduled for - // delivery on the requested start date. - // - // - payment-pending - (Capacity Blocks) The upfront payment has not been - // processed yet. - // - // - payment-failed - (Capacity Blocks) The upfront payment was not processed in - // the 12-hour time frame. Your Capacity Block was released. - // - // - assessing - (Future-dated Capacity Reservations) Amazon EC2 is assessing - // your request for a future-dated Capacity Reservation. - // - // - delayed - (Future-dated Capacity Reservations) Amazon EC2 encountered a - // delay in provisioning the requested future-dated Capacity Reservation. Amazon - // EC2 is unable to deliver the requested capacity by the requested start date and - // time. - // - // - unsupported - (Future-dated Capacity Reservations) Amazon EC2 can't support - // the future-dated Capacity Reservation request due to capacity constraints. You - // can view unsupported requests for 30 days. The Capacity Reservation will not be - // delivered. - State types.CapacityReservationState - - // The number of instances for which the Capacity Reservation reserves capacity. - TotalInstanceCount *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCapacityReservationUsageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetCapacityReservationUsage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetCapacityReservationUsage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCapacityReservationUsage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCapacityReservationUsageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCapacityReservationUsage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCapacityReservationUsage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCapacityReservationUsage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCoipPoolUsage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCoipPoolUsage.go deleted file mode 100644 index 0d8d7a4c6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetCoipPoolUsage.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the allocations from the specified customer-owned address pool. -func (c *Client) GetCoipPoolUsage(ctx context.Context, params *GetCoipPoolUsageInput, optFns ...func(*Options)) (*GetCoipPoolUsageOutput, error) { - if params == nil { - params = &GetCoipPoolUsageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCoipPoolUsage", params, optFns, c.addOperationGetCoipPoolUsageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCoipPoolUsageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCoipPoolUsageInput struct { - - // The ID of the address pool. - // - // This member is required. - PoolId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - coip-address-usage.allocation-id - The allocation ID of the address. - // - // - coip-address-usage.aws-account-id - The ID of the Amazon Web Services - // account that is using the customer-owned IP address. - // - // - coip-address-usage.aws-service - The Amazon Web Services service that is - // using the customer-owned IP address. - // - // - coip-address-usage.co-ip - The customer-owned IP address. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetCoipPoolUsageOutput struct { - - // Information about the address usage. - CoipAddressUsages []types.CoipAddressUsage - - // The ID of the customer-owned address pool. - CoipPoolId *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCoipPoolUsageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetCoipPoolUsage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetCoipPoolUsage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCoipPoolUsage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCoipPoolUsageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCoipPoolUsage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCoipPoolUsage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCoipPoolUsage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleOutput.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleOutput.go deleted file mode 100644 index 7f185b9bc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleOutput.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Gets the console output for the specified instance. For Linux instances, the -// instance console output displays the exact console output that would normally be -// displayed on a physical monitor attached to a computer. For Windows instances, -// the instance console output includes the last three system event log errors. -// -// For more information, see [Instance console output] in the Amazon EC2 User Guide. -// -// [Instance console output]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output -func (c *Client) GetConsoleOutput(ctx context.Context, params *GetConsoleOutputInput, optFns ...func(*Options)) (*GetConsoleOutputOutput, error) { - if params == nil { - params = &GetConsoleOutputInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetConsoleOutput", params, optFns, c.addOperationGetConsoleOutputMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetConsoleOutputOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetConsoleOutputInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // When enabled, retrieves the latest console output for the instance. - // - // Default: disabled ( false ) - Latest *bool - - noSmithyDocumentSerde -} - -type GetConsoleOutputOutput struct { - - // The ID of the instance. - InstanceId *string - - // The console output, base64-encoded. If you are using a command line tool, the - // tool decodes the output for you. - Output *string - - // The time at which the output was last updated. - Timestamp *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetConsoleOutputMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetConsoleOutput{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetConsoleOutput{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetConsoleOutput"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetConsoleOutputValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConsoleOutput(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetConsoleOutput(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetConsoleOutput", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleScreenshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleScreenshot.go deleted file mode 100644 index e113f64d6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetConsoleScreenshot.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieve a JPG-format screenshot of a running instance to help with -// troubleshooting. -// -// The returned content is Base64-encoded. -// -// For more information, see [Instance console output] in the Amazon EC2 User Guide. -// -// [Instance console output]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshoot-unreachable-instance.html#instance-console-console-output -func (c *Client) GetConsoleScreenshot(ctx context.Context, params *GetConsoleScreenshotInput, optFns ...func(*Options)) (*GetConsoleScreenshotOutput, error) { - if params == nil { - params = &GetConsoleScreenshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetConsoleScreenshot", params, optFns, c.addOperationGetConsoleScreenshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetConsoleScreenshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetConsoleScreenshotInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // When set to true , acts as keystroke input and wakes up an instance that's in - // standby or "sleep" mode. - WakeUp *bool - - noSmithyDocumentSerde -} - -type GetConsoleScreenshotOutput struct { - - // The data that comprises the image. - ImageData *string - - // The ID of the instance. - InstanceId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetConsoleScreenshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetConsoleScreenshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetConsoleScreenshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetConsoleScreenshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetConsoleScreenshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConsoleScreenshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetConsoleScreenshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetConsoleScreenshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDeclarativePoliciesReportSummary.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDeclarativePoliciesReportSummary.go deleted file mode 100644 index d4ce0b169..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDeclarativePoliciesReportSummary.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Retrieves a summary of the account status report. -// -// To view the full report, download it from the Amazon S3 bucket where it was -// saved. Reports are accessible only when they have the complete status. Reports -// with other statuses ( running , cancelled , or error ) are not available in the -// S3 bucket. For more information about downloading objects from an S3 bucket, see -// [Downloading objects]in the Amazon Simple Storage Service User Guide. -// -// For more information, see [Generating the account status report for declarative policies] in the Amazon Web Services Organizations User Guide. -// -// [Downloading objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/download-objects.html -// [Generating the account status report for declarative policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative_status-report.html -func (c *Client) GetDeclarativePoliciesReportSummary(ctx context.Context, params *GetDeclarativePoliciesReportSummaryInput, optFns ...func(*Options)) (*GetDeclarativePoliciesReportSummaryOutput, error) { - if params == nil { - params = &GetDeclarativePoliciesReportSummaryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDeclarativePoliciesReportSummary", params, optFns, c.addOperationGetDeclarativePoliciesReportSummaryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDeclarativePoliciesReportSummaryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDeclarativePoliciesReportSummaryInput struct { - - // The ID of the report. - // - // This member is required. - ReportId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetDeclarativePoliciesReportSummaryOutput struct { - - // The attributes described in the report. - AttributeSummaries []types.AttributeSummary - - // The time when the report generation ended. - EndTime *time.Time - - // The total number of accounts associated with the specified targetId . - NumberOfAccounts *int32 - - // The number of accounts where attributes could not be retrieved in any Region. - NumberOfFailedAccounts *int32 - - // The ID of the report. - ReportId *string - - // The name of the Amazon S3 bucket where the report is located. - S3Bucket *string - - // The prefix for your S3 object. - S3Prefix *string - - // The time when the report generation started. - StartTime *time.Time - - // The root ID, organizational unit ID, or account ID. - // - // Format: - // - // - For root: r-ab12 - // - // - For OU: ou-ab12-cdef1234 - // - // - For account: 123456789012 - TargetId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDeclarativePoliciesReportSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetDeclarativePoliciesReportSummary{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetDeclarativePoliciesReportSummary{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDeclarativePoliciesReportSummary"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetDeclarativePoliciesReportSummaryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeclarativePoliciesReportSummary(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetDeclarativePoliciesReportSummary(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDeclarativePoliciesReportSummary", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDefaultCreditSpecification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDefaultCreditSpecification.go deleted file mode 100644 index 10cc79343..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetDefaultCreditSpecification.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the default credit option for CPU usage of a burstable performance -// instance family. -// -// For more information, see [Burstable performance instances] in the Amazon EC2 User Guide. -// -// [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html -func (c *Client) GetDefaultCreditSpecification(ctx context.Context, params *GetDefaultCreditSpecificationInput, optFns ...func(*Options)) (*GetDefaultCreditSpecificationOutput, error) { - if params == nil { - params = &GetDefaultCreditSpecificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDefaultCreditSpecification", params, optFns, c.addOperationGetDefaultCreditSpecificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDefaultCreditSpecificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDefaultCreditSpecificationInput struct { - - // The instance family. - // - // This member is required. - InstanceFamily types.UnlimitedSupportedInstanceFamily - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetDefaultCreditSpecificationOutput struct { - - // The default credit option for CPU usage of the instance family. - InstanceFamilyCreditSpecification *types.InstanceFamilyCreditSpecification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDefaultCreditSpecificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetDefaultCreditSpecification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetDefaultCreditSpecification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDefaultCreditSpecification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetDefaultCreditSpecificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDefaultCreditSpecification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetDefaultCreditSpecification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDefaultCreditSpecification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsDefaultKmsKeyId.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsDefaultKmsKeyId.go deleted file mode 100644 index d5b131b6b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsDefaultKmsKeyId.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the default KMS key for EBS encryption by default for your account in -// this Region. You can change the default KMS key for encryption by default using ModifyEbsDefaultKmsKeyId -// or ResetEbsDefaultKmsKeyId. -// -// For more information, see [Amazon EBS encryption] in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) GetEbsDefaultKmsKeyId(ctx context.Context, params *GetEbsDefaultKmsKeyIdInput, optFns ...func(*Options)) (*GetEbsDefaultKmsKeyIdOutput, error) { - if params == nil { - params = &GetEbsDefaultKmsKeyIdInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetEbsDefaultKmsKeyId", params, optFns, c.addOperationGetEbsDefaultKmsKeyIdMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetEbsDefaultKmsKeyIdOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetEbsDefaultKmsKeyIdInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetEbsDefaultKmsKeyIdOutput struct { - - // The Amazon Resource Name (ARN) of the default KMS key for encryption by default. - KmsKeyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetEbsDefaultKmsKeyIdMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetEbsDefaultKmsKeyId"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEbsDefaultKmsKeyId(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetEbsDefaultKmsKeyId(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetEbsDefaultKmsKeyId", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsEncryptionByDefault.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsEncryptionByDefault.go deleted file mode 100644 index 2a0a14552..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetEbsEncryptionByDefault.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes whether EBS encryption by default is enabled for your account in the -// current Region. -// -// For more information, see [Amazon EBS encryption] in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) GetEbsEncryptionByDefault(ctx context.Context, params *GetEbsEncryptionByDefaultInput, optFns ...func(*Options)) (*GetEbsEncryptionByDefaultOutput, error) { - if params == nil { - params = &GetEbsEncryptionByDefaultInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetEbsEncryptionByDefault", params, optFns, c.addOperationGetEbsEncryptionByDefaultMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetEbsEncryptionByDefaultOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetEbsEncryptionByDefaultInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetEbsEncryptionByDefaultOutput struct { - - // Indicates whether encryption by default is enabled. - EbsEncryptionByDefault *bool - - // Reserved for future use. - SseType types.SSEType - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetEbsEncryptionByDefaultMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetEbsEncryptionByDefault{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetEbsEncryptionByDefault"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEbsEncryptionByDefault(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetEbsEncryptionByDefault(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetEbsEncryptionByDefault", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetFlowLogsIntegrationTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetFlowLogsIntegrationTemplate.go deleted file mode 100644 index bed8eadd9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetFlowLogsIntegrationTemplate.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Generates a CloudFormation template that streamlines and automates the -// integration of VPC flow logs with Amazon Athena. This make it easier for you to -// query and gain insights from VPC flow logs data. Based on the information that -// you provide, we configure resources in the template to do the following: -// -// - Create a table in Athena that maps fields to a custom log format -// -// - Create a Lambda function that updates the table with new partitions on a -// daily, weekly, or monthly basis -// -// - Create a table partitioned between two timestamps in the past -// -// - Create a set of named queries in Athena that you can use to get started -// quickly -// -// GetFlowLogsIntegrationTemplate does not support integration between Amazon Web -// Services Transit Gateway Flow Logs and Amazon Athena. -func (c *Client) GetFlowLogsIntegrationTemplate(ctx context.Context, params *GetFlowLogsIntegrationTemplateInput, optFns ...func(*Options)) (*GetFlowLogsIntegrationTemplateOutput, error) { - if params == nil { - params = &GetFlowLogsIntegrationTemplateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetFlowLogsIntegrationTemplate", params, optFns, c.addOperationGetFlowLogsIntegrationTemplateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetFlowLogsIntegrationTemplateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetFlowLogsIntegrationTemplateInput struct { - - // To store the CloudFormation template in Amazon S3, specify the location in - // Amazon S3. - // - // This member is required. - ConfigDeliveryS3DestinationArn *string - - // The ID of the flow log. - // - // This member is required. - FlowLogId *string - - // Information about the service integration. - // - // This member is required. - IntegrateServices *types.IntegrateServices - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetFlowLogsIntegrationTemplateOutput struct { - - // The generated CloudFormation template. - Result *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetFlowLogsIntegrationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetFlowLogsIntegrationTemplate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetFlowLogsIntegrationTemplate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetFlowLogsIntegrationTemplateValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlowLogsIntegrationTemplate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetFlowLogsIntegrationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetFlowLogsIntegrationTemplate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetGroupsForCapacityReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetGroupsForCapacityReservation.go deleted file mode 100644 index d7075fd85..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetGroupsForCapacityReservation.go +++ /dev/null @@ -1,283 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the resource groups to which a Capacity Reservation has been added. -func (c *Client) GetGroupsForCapacityReservation(ctx context.Context, params *GetGroupsForCapacityReservationInput, optFns ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) { - if params == nil { - params = &GetGroupsForCapacityReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetGroupsForCapacityReservation", params, optFns, c.addOperationGetGroupsForCapacityReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetGroupsForCapacityReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetGroupsForCapacityReservationInput struct { - - // The ID of the Capacity Reservation. If you specify a Capacity Reservation that - // is shared with you, the operation returns only Capacity Reservation groups that - // you own. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token to use to retrieve the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetGroupsForCapacityReservationOutput struct { - - // Information about the resource groups to which the Capacity Reservation has - // been added. - CapacityReservationGroups []types.CapacityReservationGroup - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetGroupsForCapacityReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetGroupsForCapacityReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetGroupsForCapacityReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetGroupsForCapacityReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetGroupsForCapacityReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGroupsForCapacityReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetGroupsForCapacityReservationPaginatorOptions is the paginator options for -// GetGroupsForCapacityReservation -type GetGroupsForCapacityReservationPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetGroupsForCapacityReservationPaginator is a paginator for -// GetGroupsForCapacityReservation -type GetGroupsForCapacityReservationPaginator struct { - options GetGroupsForCapacityReservationPaginatorOptions - client GetGroupsForCapacityReservationAPIClient - params *GetGroupsForCapacityReservationInput - nextToken *string - firstPage bool -} - -// NewGetGroupsForCapacityReservationPaginator returns a new -// GetGroupsForCapacityReservationPaginator -func NewGetGroupsForCapacityReservationPaginator(client GetGroupsForCapacityReservationAPIClient, params *GetGroupsForCapacityReservationInput, optFns ...func(*GetGroupsForCapacityReservationPaginatorOptions)) *GetGroupsForCapacityReservationPaginator { - if params == nil { - params = &GetGroupsForCapacityReservationInput{} - } - - options := GetGroupsForCapacityReservationPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetGroupsForCapacityReservationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetGroupsForCapacityReservationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetGroupsForCapacityReservation page. -func (p *GetGroupsForCapacityReservationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetGroupsForCapacityReservation(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetGroupsForCapacityReservationAPIClient is a client that implements the -// GetGroupsForCapacityReservation operation. -type GetGroupsForCapacityReservationAPIClient interface { - GetGroupsForCapacityReservation(context.Context, *GetGroupsForCapacityReservationInput, ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) -} - -var _ GetGroupsForCapacityReservationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetGroupsForCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetGroupsForCapacityReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetHostReservationPurchasePreview.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetHostReservationPurchasePreview.go deleted file mode 100644 index f4bc61b4b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetHostReservationPurchasePreview.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Preview a reservation purchase with configurations that match those of your -// Dedicated Host. You must have active Dedicated Hosts in your account before you -// purchase a reservation. -// -// This is a preview of the PurchaseHostReservation action and does not result in the offering being -// purchased. -func (c *Client) GetHostReservationPurchasePreview(ctx context.Context, params *GetHostReservationPurchasePreviewInput, optFns ...func(*Options)) (*GetHostReservationPurchasePreviewOutput, error) { - if params == nil { - params = &GetHostReservationPurchasePreviewInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetHostReservationPurchasePreview", params, optFns, c.addOperationGetHostReservationPurchasePreviewMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetHostReservationPurchasePreviewOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetHostReservationPurchasePreviewInput struct { - - // The IDs of the Dedicated Hosts with which the reservation is associated. - // - // This member is required. - HostIdSet []string - - // The offering ID of the reservation. - // - // This member is required. - OfferingId *string - - noSmithyDocumentSerde -} - -type GetHostReservationPurchasePreviewOutput struct { - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts are - // specified. At this time, the only supported currency is USD . - CurrencyCode types.CurrencyCodeValues - - // The purchase information of the Dedicated Host reservation and the Dedicated - // Hosts associated with it. - Purchase []types.Purchase - - // The potential total hourly price of the reservation per hour. - TotalHourlyPrice *string - - // The potential total upfront price. This is billed immediately. - TotalUpfrontPrice *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetHostReservationPurchasePreviewMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetHostReservationPurchasePreview{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetHostReservationPurchasePreview{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetHostReservationPurchasePreview"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetHostReservationPurchasePreviewValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHostReservationPurchasePreview(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetHostReservationPurchasePreview(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetHostReservationPurchasePreview", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetImageBlockPublicAccessState.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetImageBlockPublicAccessState.go deleted file mode 100644 index b6b4439e0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetImageBlockPublicAccessState.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the current state of block public access for AMIs at the account level in -// the specified Amazon Web Services Region. -// -// For more information, see [Block public access to your AMIs] in the Amazon EC2 User Guide. -// -// [Block public access to your AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-to-amis.html -func (c *Client) GetImageBlockPublicAccessState(ctx context.Context, params *GetImageBlockPublicAccessStateInput, optFns ...func(*Options)) (*GetImageBlockPublicAccessStateOutput, error) { - if params == nil { - params = &GetImageBlockPublicAccessStateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetImageBlockPublicAccessState", params, optFns, c.addOperationGetImageBlockPublicAccessStateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetImageBlockPublicAccessStateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetImageBlockPublicAccessStateInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetImageBlockPublicAccessStateOutput struct { - - // The current state of block public access for AMIs at the account level in the - // specified Amazon Web Services Region. - // - // Possible values: - // - // - block-new-sharing - Any attempt to publicly share your AMIs in the specified - // Region is blocked. - // - // - unblocked - Your AMIs in the specified Region can be publicly shared. - ImageBlockPublicAccessState *string - - // The entity that manages the state for block public access for AMIs. Possible - // values include: - // - // - account - The state is managed by the account. - // - // - declarative-policy - The state is managed by a declarative policy and can't - // be modified by the account. - ManagedBy types.ManagedBy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetImageBlockPublicAccessStateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetImageBlockPublicAccessState{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetImageBlockPublicAccessState{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetImageBlockPublicAccessState"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImageBlockPublicAccessState(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetImageBlockPublicAccessState(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetImageBlockPublicAccessState", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceMetadataDefaults.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceMetadataDefaults.go deleted file mode 100644 index 44b922e06..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceMetadataDefaults.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the default instance metadata service (IMDS) settings that are set at the -// account level in the specified Amazon Web Services
 Region. -// -// For more information, see [Order of precedence for instance metadata options] in the Amazon EC2 User Guide. -// -// [Order of precedence for instance metadata options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence -func (c *Client) GetInstanceMetadataDefaults(ctx context.Context, params *GetInstanceMetadataDefaultsInput, optFns ...func(*Options)) (*GetInstanceMetadataDefaultsOutput, error) { - if params == nil { - params = &GetInstanceMetadataDefaultsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetInstanceMetadataDefaults", params, optFns, c.addOperationGetInstanceMetadataDefaultsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetInstanceMetadataDefaultsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetInstanceMetadataDefaultsInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetInstanceMetadataDefaultsOutput struct { - - // The account-level default IMDS settings. - AccountLevel *types.InstanceMetadataDefaultsResponse - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetInstanceMetadataDefaultsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetInstanceMetadataDefaults{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetInstanceMetadataDefaults{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceMetadataDefaults"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceMetadataDefaults(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetInstanceMetadataDefaults(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetInstanceMetadataDefaults", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTpmEkPub.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTpmEkPub.go deleted file mode 100644 index ee5c2cb6f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTpmEkPub.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the public endorsement key associated with the Nitro Trusted Platform -// Module (NitroTPM) for the specified instance. -func (c *Client) GetInstanceTpmEkPub(ctx context.Context, params *GetInstanceTpmEkPubInput, optFns ...func(*Options)) (*GetInstanceTpmEkPubOutput, error) { - if params == nil { - params = &GetInstanceTpmEkPubInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetInstanceTpmEkPub", params, optFns, c.addOperationGetInstanceTpmEkPubMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetInstanceTpmEkPubOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetInstanceTpmEkPubInput struct { - - // The ID of the instance for which to get the public endorsement key. - // - // This member is required. - InstanceId *string - - // The required public endorsement key format. Specify der for a DER-encoded - // public key that is compatible with OpenSSL. Specify tpmt for a TPM 2.0 format - // that is compatible with tpm2-tools. The returned key is base64 encoded. - // - // This member is required. - KeyFormat types.EkPubKeyFormat - - // The required public endorsement key type. - // - // This member is required. - KeyType types.EkPubKeyType - - // Specify this parameter to verify whether the request will succeed, without - // actually making the request. If the request will succeed, the response is - // DryRunOperation . Otherwise, the response is UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetInstanceTpmEkPubOutput struct { - - // The ID of the instance. - InstanceId *string - - // The public endorsement key format. - KeyFormat types.EkPubKeyFormat - - // The public endorsement key type. - KeyType types.EkPubKeyType - - // The public endorsement key material. - KeyValue *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetInstanceTpmEkPubMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetInstanceTpmEkPub{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetInstanceTpmEkPub{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceTpmEkPub"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetInstanceTpmEkPubValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceTpmEkPub(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetInstanceTpmEkPub(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetInstanceTpmEkPub", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTypesFromInstanceRequirements.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTypesFromInstanceRequirements.go deleted file mode 100644 index 49a70ecbd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceTypesFromInstanceRequirements.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a list of instance types with the specified instance attributes. You -// can use the response to preview the instance types without launching instances. -// Note that the response does not consider capacity. -// -// When you specify multiple parameters, you get instance types that satisfy all -// of the specified parameters. If you specify multiple values for a parameter, you -// get instance types that satisfy any of the specified values. -// -// For more information, see [Preview instance types with specified attributes], [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet], and [Spot placement score] in the Amazon EC2 User Guide, and [Creating mixed instance groups using attribute-based instance type selection] in the -// Amazon EC2 Auto Scaling User Guide. -// -// [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html -// [Preview instance types with specified attributes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-get-instance-types-from-instance-requirements -// [Creating mixed instance groups using attribute-based instance type selection]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html -// [Spot placement score]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html -func (c *Client) GetInstanceTypesFromInstanceRequirements(ctx context.Context, params *GetInstanceTypesFromInstanceRequirementsInput, optFns ...func(*Options)) (*GetInstanceTypesFromInstanceRequirementsOutput, error) { - if params == nil { - params = &GetInstanceTypesFromInstanceRequirementsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetInstanceTypesFromInstanceRequirements", params, optFns, c.addOperationGetInstanceTypesFromInstanceRequirementsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetInstanceTypesFromInstanceRequirementsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetInstanceTypesFromInstanceRequirementsInput struct { - - // The processor architecture type. - // - // This member is required. - ArchitectureTypes []types.ArchitectureType - - // The attributes required for the instance types. - // - // This member is required. - InstanceRequirements *types.InstanceRequirementsRequest - - // The virtualization type. - // - // This member is required. - VirtualizationTypes []types.VirtualizationType - - // Reserved. - Context *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type GetInstanceTypesFromInstanceRequirementsOutput struct { - - // The instance types with the specified instance attributes. - InstanceTypes []types.InstanceTypeInfoFromInstanceRequirements - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetInstanceTypesFromInstanceRequirementsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetInstanceTypesFromInstanceRequirements{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceTypesFromInstanceRequirements"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetInstanceTypesFromInstanceRequirementsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceTypesFromInstanceRequirements(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetInstanceTypesFromInstanceRequirementsPaginatorOptions is the paginator -// options for GetInstanceTypesFromInstanceRequirements -type GetInstanceTypesFromInstanceRequirementsPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetInstanceTypesFromInstanceRequirementsPaginator is a paginator for -// GetInstanceTypesFromInstanceRequirements -type GetInstanceTypesFromInstanceRequirementsPaginator struct { - options GetInstanceTypesFromInstanceRequirementsPaginatorOptions - client GetInstanceTypesFromInstanceRequirementsAPIClient - params *GetInstanceTypesFromInstanceRequirementsInput - nextToken *string - firstPage bool -} - -// NewGetInstanceTypesFromInstanceRequirementsPaginator returns a new -// GetInstanceTypesFromInstanceRequirementsPaginator -func NewGetInstanceTypesFromInstanceRequirementsPaginator(client GetInstanceTypesFromInstanceRequirementsAPIClient, params *GetInstanceTypesFromInstanceRequirementsInput, optFns ...func(*GetInstanceTypesFromInstanceRequirementsPaginatorOptions)) *GetInstanceTypesFromInstanceRequirementsPaginator { - if params == nil { - params = &GetInstanceTypesFromInstanceRequirementsInput{} - } - - options := GetInstanceTypesFromInstanceRequirementsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetInstanceTypesFromInstanceRequirementsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetInstanceTypesFromInstanceRequirementsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetInstanceTypesFromInstanceRequirements page. -func (p *GetInstanceTypesFromInstanceRequirementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInstanceTypesFromInstanceRequirementsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetInstanceTypesFromInstanceRequirements(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetInstanceTypesFromInstanceRequirementsAPIClient is a client that implements -// the GetInstanceTypesFromInstanceRequirements operation. -type GetInstanceTypesFromInstanceRequirementsAPIClient interface { - GetInstanceTypesFromInstanceRequirements(context.Context, *GetInstanceTypesFromInstanceRequirementsInput, ...func(*Options)) (*GetInstanceTypesFromInstanceRequirementsOutput, error) -} - -var _ GetInstanceTypesFromInstanceRequirementsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetInstanceTypesFromInstanceRequirements(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetInstanceTypesFromInstanceRequirements", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceUefiData.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceUefiData.go deleted file mode 100644 index 81726ac3b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetInstanceUefiData.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// A binary representation of the UEFI variable store. Only non-volatile variables -// are stored. This is a base64 encoded and zlib compressed binary value that must -// be properly encoded. -// -// When you use [register-image] to create an AMI, you can create an exact copy of your variable -// store by passing the UEFI data in the UefiData parameter. You can modify the -// UEFI data by using the [python-uefivars tool]on GitHub. You can use the tool to convert the UEFI data -// into a human-readable format (JSON), which you can inspect and modify, and then -// convert back into the binary format to use with register-image. -// -// For more information, see [UEFI Secure Boot] in the Amazon EC2 User Guide. -// -// [UEFI Secure Boot]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/uefi-secure-boot.html -// [python-uefivars tool]: https://github.com/awslabs/python-uefivars -// [register-image]: https://docs.aws.amazon.com/cli/latest/reference/ec2/register-image.html -func (c *Client) GetInstanceUefiData(ctx context.Context, params *GetInstanceUefiDataInput, optFns ...func(*Options)) (*GetInstanceUefiDataOutput, error) { - if params == nil { - params = &GetInstanceUefiDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetInstanceUefiData", params, optFns, c.addOperationGetInstanceUefiDataMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetInstanceUefiDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetInstanceUefiDataInput struct { - - // The ID of the instance from which to retrieve the UEFI data. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetInstanceUefiDataOutput struct { - - // The ID of the instance from which to retrieve the UEFI data. - InstanceId *string - - // Base64 representation of the non-volatile UEFI variable store. - UefiData *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetInstanceUefiDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetInstanceUefiData{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetInstanceUefiData{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceUefiData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetInstanceUefiDataValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceUefiData(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetInstanceUefiData(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetInstanceUefiData", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamAddressHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamAddressHistory.go deleted file mode 100644 index 84b547046..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamAddressHistory.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Retrieve historical information about a CIDR within an IPAM scope. For more -// information, see [View the history of IP addresses]in the Amazon VPC IPAM User Guide. -// -// [View the history of IP addresses]: https://docs.aws.amazon.com/vpc/latest/ipam/view-history-cidr-ipam.html -func (c *Client) GetIpamAddressHistory(ctx context.Context, params *GetIpamAddressHistoryInput, optFns ...func(*Options)) (*GetIpamAddressHistoryOutput, error) { - if params == nil { - params = &GetIpamAddressHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamAddressHistory", params, optFns, c.addOperationGetIpamAddressHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamAddressHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamAddressHistoryInput struct { - - // The CIDR you want the history of. The CIDR can be an IPv4 or IPv6 IP address - // range. If you enter a /16 IPv4 CIDR, you will get records that match it exactly. - // You will not get records for any subnets within the /16 CIDR. - // - // This member is required. - Cidr *string - - // The ID of the IPAM scope that the CIDR is in. - // - // This member is required. - IpamScopeId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The end of the time period for which you are looking for history. If you omit - // this option, it will default to the current time. - EndTime *time.Time - - // The maximum number of historical results you would like returned per page. - // Defaults to 100. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The start of the time period for which you are looking for history. If you omit - // this option, it will default to the value of EndTime. - StartTime *time.Time - - // The ID of the VPC you want your history records filtered by. - VpcId *string - - noSmithyDocumentSerde -} - -type GetIpamAddressHistoryOutput struct { - - // A historical record for a CIDR within an IPAM scope. If the CIDR is associated - // with an EC2 instance, you will see an object in the response for the instance - // and one for the network interface. - HistoryRecords []types.IpamAddressHistoryRecord - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamAddressHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamAddressHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamAddressHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamAddressHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamAddressHistoryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamAddressHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamAddressHistoryPaginatorOptions is the paginator options for -// GetIpamAddressHistory -type GetIpamAddressHistoryPaginatorOptions struct { - // The maximum number of historical results you would like returned per page. - // Defaults to 100. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamAddressHistoryPaginator is a paginator for GetIpamAddressHistory -type GetIpamAddressHistoryPaginator struct { - options GetIpamAddressHistoryPaginatorOptions - client GetIpamAddressHistoryAPIClient - params *GetIpamAddressHistoryInput - nextToken *string - firstPage bool -} - -// NewGetIpamAddressHistoryPaginator returns a new GetIpamAddressHistoryPaginator -func NewGetIpamAddressHistoryPaginator(client GetIpamAddressHistoryAPIClient, params *GetIpamAddressHistoryInput, optFns ...func(*GetIpamAddressHistoryPaginatorOptions)) *GetIpamAddressHistoryPaginator { - if params == nil { - params = &GetIpamAddressHistoryInput{} - } - - options := GetIpamAddressHistoryPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamAddressHistoryPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamAddressHistoryPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamAddressHistory page. -func (p *GetIpamAddressHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamAddressHistoryOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamAddressHistory(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamAddressHistoryAPIClient is a client that implements the -// GetIpamAddressHistory operation. -type GetIpamAddressHistoryAPIClient interface { - GetIpamAddressHistory(context.Context, *GetIpamAddressHistoryInput, ...func(*Options)) (*GetIpamAddressHistoryOutput, error) -} - -var _ GetIpamAddressHistoryAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamAddressHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamAddressHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredAccounts.go deleted file mode 100644 index 0ca614048..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredAccounts.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets IPAM discovered accounts. A discovered account is an Amazon Web Services -// account that is monitored under a resource discovery. If you have integrated -// IPAM with Amazon Web Services Organizations, all accounts in the organization -// are discovered accounts. Only the IPAM account can get all discovered accounts -// in the organization. -func (c *Client) GetIpamDiscoveredAccounts(ctx context.Context, params *GetIpamDiscoveredAccountsInput, optFns ...func(*Options)) (*GetIpamDiscoveredAccountsOutput, error) { - if params == nil { - params = &GetIpamDiscoveredAccountsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamDiscoveredAccounts", params, optFns, c.addOperationGetIpamDiscoveredAccountsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamDiscoveredAccountsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamDiscoveredAccountsInput struct { - - // The Amazon Web Services Region that the account information is returned from. - // - // This member is required. - DiscoveryRegion *string - - // A resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Discovered account filters. - Filters []types.Filter - - // The maximum number of discovered accounts to return in one page of results. - MaxResults *int32 - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetIpamDiscoveredAccountsOutput struct { - - // Discovered accounts. - IpamDiscoveredAccounts []types.IpamDiscoveredAccount - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamDiscoveredAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamDiscoveredAccounts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamDiscoveredAccounts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamDiscoveredAccounts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamDiscoveredAccountsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamDiscoveredAccounts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamDiscoveredAccountsPaginatorOptions is the paginator options for -// GetIpamDiscoveredAccounts -type GetIpamDiscoveredAccountsPaginatorOptions struct { - // The maximum number of discovered accounts to return in one page of results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamDiscoveredAccountsPaginator is a paginator for GetIpamDiscoveredAccounts -type GetIpamDiscoveredAccountsPaginator struct { - options GetIpamDiscoveredAccountsPaginatorOptions - client GetIpamDiscoveredAccountsAPIClient - params *GetIpamDiscoveredAccountsInput - nextToken *string - firstPage bool -} - -// NewGetIpamDiscoveredAccountsPaginator returns a new -// GetIpamDiscoveredAccountsPaginator -func NewGetIpamDiscoveredAccountsPaginator(client GetIpamDiscoveredAccountsAPIClient, params *GetIpamDiscoveredAccountsInput, optFns ...func(*GetIpamDiscoveredAccountsPaginatorOptions)) *GetIpamDiscoveredAccountsPaginator { - if params == nil { - params = &GetIpamDiscoveredAccountsInput{} - } - - options := GetIpamDiscoveredAccountsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamDiscoveredAccountsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamDiscoveredAccountsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamDiscoveredAccounts page. -func (p *GetIpamDiscoveredAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamDiscoveredAccountsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamDiscoveredAccounts(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamDiscoveredAccountsAPIClient is a client that implements the -// GetIpamDiscoveredAccounts operation. -type GetIpamDiscoveredAccountsAPIClient interface { - GetIpamDiscoveredAccounts(context.Context, *GetIpamDiscoveredAccountsInput, ...func(*Options)) (*GetIpamDiscoveredAccountsOutput, error) -} - -var _ GetIpamDiscoveredAccountsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamDiscoveredAccounts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamDiscoveredAccounts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go deleted file mode 100644 index d9195575b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Gets the public IP addresses that have been discovered by IPAM. -func (c *Client) GetIpamDiscoveredPublicAddresses(ctx context.Context, params *GetIpamDiscoveredPublicAddressesInput, optFns ...func(*Options)) (*GetIpamDiscoveredPublicAddressesOutput, error) { - if params == nil { - params = &GetIpamDiscoveredPublicAddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamDiscoveredPublicAddresses", params, optFns, c.addOperationGetIpamDiscoveredPublicAddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamDiscoveredPublicAddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamDiscoveredPublicAddressesInput struct { - - // The Amazon Web Services Region for the IP address. - // - // This member is required. - AddressRegion *string - - // An IPAM resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Filters. - Filters []types.Filter - - // The maximum number of IPAM discovered public addresses to return in one page of - // results. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetIpamDiscoveredPublicAddressesOutput struct { - - // IPAM discovered public addresses. - IpamDiscoveredPublicAddresses []types.IpamDiscoveredPublicAddress - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The oldest successful resource discovery time. - OldestSampleTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamDiscoveredPublicAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamDiscoveredPublicAddresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamDiscoveredPublicAddressesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamDiscoveredPublicAddresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetIpamDiscoveredPublicAddresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamDiscoveredPublicAddresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredResourceCidrs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredResourceCidrs.go deleted file mode 100644 index 5fe6bc08f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamDiscoveredResourceCidrs.go +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the resource CIDRs that are monitored as part of a resource discovery. -// A discovered resource is a resource CIDR monitored under a resource discovery. -// The following resources can be discovered: VPCs, Public IPv4 pools, VPC subnets, -// and Elastic IP addresses. -func (c *Client) GetIpamDiscoveredResourceCidrs(ctx context.Context, params *GetIpamDiscoveredResourceCidrsInput, optFns ...func(*Options)) (*GetIpamDiscoveredResourceCidrsOutput, error) { - if params == nil { - params = &GetIpamDiscoveredResourceCidrsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamDiscoveredResourceCidrs", params, optFns, c.addOperationGetIpamDiscoveredResourceCidrsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamDiscoveredResourceCidrsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamDiscoveredResourceCidrsInput struct { - - // A resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // A resource Region. - // - // This member is required. - ResourceRegion *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Filters. - Filters []types.Filter - - // The maximum number of discovered resource CIDRs to return in one page of - // results. - MaxResults *int32 - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetIpamDiscoveredResourceCidrsOutput struct { - - // Discovered resource CIDRs. - IpamDiscoveredResourceCidrs []types.IpamDiscoveredResourceCidr - - // Specify the pagination token from a previous request to retrieve the next page - // of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamDiscoveredResourceCidrsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamDiscoveredResourceCidrs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamDiscoveredResourceCidrsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamDiscoveredResourceCidrs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamDiscoveredResourceCidrsPaginatorOptions is the paginator options for -// GetIpamDiscoveredResourceCidrs -type GetIpamDiscoveredResourceCidrsPaginatorOptions struct { - // The maximum number of discovered resource CIDRs to return in one page of - // results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamDiscoveredResourceCidrsPaginator is a paginator for -// GetIpamDiscoveredResourceCidrs -type GetIpamDiscoveredResourceCidrsPaginator struct { - options GetIpamDiscoveredResourceCidrsPaginatorOptions - client GetIpamDiscoveredResourceCidrsAPIClient - params *GetIpamDiscoveredResourceCidrsInput - nextToken *string - firstPage bool -} - -// NewGetIpamDiscoveredResourceCidrsPaginator returns a new -// GetIpamDiscoveredResourceCidrsPaginator -func NewGetIpamDiscoveredResourceCidrsPaginator(client GetIpamDiscoveredResourceCidrsAPIClient, params *GetIpamDiscoveredResourceCidrsInput, optFns ...func(*GetIpamDiscoveredResourceCidrsPaginatorOptions)) *GetIpamDiscoveredResourceCidrsPaginator { - if params == nil { - params = &GetIpamDiscoveredResourceCidrsInput{} - } - - options := GetIpamDiscoveredResourceCidrsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamDiscoveredResourceCidrsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamDiscoveredResourceCidrsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamDiscoveredResourceCidrs page. -func (p *GetIpamDiscoveredResourceCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamDiscoveredResourceCidrsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamDiscoveredResourceCidrs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamDiscoveredResourceCidrsAPIClient is a client that implements the -// GetIpamDiscoveredResourceCidrs operation. -type GetIpamDiscoveredResourceCidrsAPIClient interface { - GetIpamDiscoveredResourceCidrs(context.Context, *GetIpamDiscoveredResourceCidrsInput, ...func(*Options)) (*GetIpamDiscoveredResourceCidrsOutput, error) -} - -var _ GetIpamDiscoveredResourceCidrsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamDiscoveredResourceCidrs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamDiscoveredResourceCidrs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolAllocations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolAllocations.go deleted file mode 100644 index ef1d1f0ca..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolAllocations.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get a list of all the CIDR allocations in an IPAM pool. The Region you use -// should be the IPAM pool locale. The locale is the Amazon Web Services Region -// where this IPAM pool is available for allocations. -// -// If you use this action after [AllocateIpamPoolCidr] or [ReleaseIpamPoolAllocation], note that all EC2 API actions follow an [eventual consistency] -// model. -// -// [ReleaseIpamPoolAllocation]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReleaseIpamPoolAllocation.html -// [AllocateIpamPoolCidr]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AllocateIpamPoolCidr.html -// [eventual consistency]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -func (c *Client) GetIpamPoolAllocations(ctx context.Context, params *GetIpamPoolAllocationsInput, optFns ...func(*Options)) (*GetIpamPoolAllocationsOutput, error) { - if params == nil { - params = &GetIpamPoolAllocationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamPoolAllocations", params, optFns, c.addOperationGetIpamPoolAllocationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamPoolAllocationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamPoolAllocationsInput struct { - - // The ID of the IPAM pool you want to see the allocations for. - // - // This member is required. - IpamPoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The ID of the allocation. - IpamPoolAllocationId *string - - // The maximum number of results you would like returned per page. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetIpamPoolAllocationsOutput struct { - - // The IPAM pool allocations you want information on. - IpamPoolAllocations []types.IpamPoolAllocation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamPoolAllocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamPoolAllocations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamPoolAllocations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamPoolAllocations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamPoolAllocationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamPoolAllocations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamPoolAllocationsPaginatorOptions is the paginator options for -// GetIpamPoolAllocations -type GetIpamPoolAllocationsPaginatorOptions struct { - // The maximum number of results you would like returned per page. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamPoolAllocationsPaginator is a paginator for GetIpamPoolAllocations -type GetIpamPoolAllocationsPaginator struct { - options GetIpamPoolAllocationsPaginatorOptions - client GetIpamPoolAllocationsAPIClient - params *GetIpamPoolAllocationsInput - nextToken *string - firstPage bool -} - -// NewGetIpamPoolAllocationsPaginator returns a new GetIpamPoolAllocationsPaginator -func NewGetIpamPoolAllocationsPaginator(client GetIpamPoolAllocationsAPIClient, params *GetIpamPoolAllocationsInput, optFns ...func(*GetIpamPoolAllocationsPaginatorOptions)) *GetIpamPoolAllocationsPaginator { - if params == nil { - params = &GetIpamPoolAllocationsInput{} - } - - options := GetIpamPoolAllocationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamPoolAllocationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamPoolAllocationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamPoolAllocations page. -func (p *GetIpamPoolAllocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamPoolAllocationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamPoolAllocations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamPoolAllocationsAPIClient is a client that implements the -// GetIpamPoolAllocations operation. -type GetIpamPoolAllocationsAPIClient interface { - GetIpamPoolAllocations(context.Context, *GetIpamPoolAllocationsInput, ...func(*Options)) (*GetIpamPoolAllocationsOutput, error) -} - -var _ GetIpamPoolAllocationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamPoolAllocations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamPoolAllocations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolCidrs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolCidrs.go deleted file mode 100644 index b0d8904f8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamPoolCidrs.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get the CIDRs provisioned to an IPAM pool. -func (c *Client) GetIpamPoolCidrs(ctx context.Context, params *GetIpamPoolCidrsInput, optFns ...func(*Options)) (*GetIpamPoolCidrsOutput, error) { - if params == nil { - params = &GetIpamPoolCidrsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamPoolCidrs", params, optFns, c.addOperationGetIpamPoolCidrsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamPoolCidrsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamPoolCidrsInput struct { - - // The ID of the IPAM pool you want the CIDR for. - // - // This member is required. - IpamPoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The maximum number of results to return in the request. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetIpamPoolCidrsOutput struct { - - // Information about the CIDRs provisioned to an IPAM pool. - IpamPoolCidrs []types.IpamPoolCidr - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamPoolCidrsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamPoolCidrs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamPoolCidrs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamPoolCidrs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamPoolCidrsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamPoolCidrs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamPoolCidrsPaginatorOptions is the paginator options for GetIpamPoolCidrs -type GetIpamPoolCidrsPaginatorOptions struct { - // The maximum number of results to return in the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamPoolCidrsPaginator is a paginator for GetIpamPoolCidrs -type GetIpamPoolCidrsPaginator struct { - options GetIpamPoolCidrsPaginatorOptions - client GetIpamPoolCidrsAPIClient - params *GetIpamPoolCidrsInput - nextToken *string - firstPage bool -} - -// NewGetIpamPoolCidrsPaginator returns a new GetIpamPoolCidrsPaginator -func NewGetIpamPoolCidrsPaginator(client GetIpamPoolCidrsAPIClient, params *GetIpamPoolCidrsInput, optFns ...func(*GetIpamPoolCidrsPaginatorOptions)) *GetIpamPoolCidrsPaginator { - if params == nil { - params = &GetIpamPoolCidrsInput{} - } - - options := GetIpamPoolCidrsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamPoolCidrsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamPoolCidrsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamPoolCidrs page. -func (p *GetIpamPoolCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamPoolCidrsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamPoolCidrs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamPoolCidrsAPIClient is a client that implements the GetIpamPoolCidrs -// operation. -type GetIpamPoolCidrsAPIClient interface { - GetIpamPoolCidrs(context.Context, *GetIpamPoolCidrsInput, ...func(*Options)) (*GetIpamPoolCidrsOutput, error) -} - -var _ GetIpamPoolCidrsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamPoolCidrs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamPoolCidrs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamResourceCidrs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamResourceCidrs.go deleted file mode 100644 index 6fcebbdd7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetIpamResourceCidrs.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns resource CIDRs managed by IPAM in a given scope. If an IPAM is -// associated with more than one resource discovery, the resource CIDRs across all -// of the resource discoveries is returned. A resource discovery is an IPAM -// component that enables IPAM to manage and monitor resources that belong to the -// owning account. -func (c *Client) GetIpamResourceCidrs(ctx context.Context, params *GetIpamResourceCidrsInput, optFns ...func(*Options)) (*GetIpamResourceCidrsOutput, error) { - if params == nil { - params = &GetIpamResourceCidrsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetIpamResourceCidrs", params, optFns, c.addOperationGetIpamResourceCidrsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetIpamResourceCidrsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetIpamResourceCidrsInput struct { - - // The ID of the scope that the resource is in. - // - // This member is required. - IpamScopeId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters for the request. For more information about filtering, see [Filtering CLI output]. - // - // [Filtering CLI output]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html - Filters []types.Filter - - // The ID of the IPAM pool that the resource is in. - IpamPoolId *string - - // The maximum number of results to return in the request. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The ID of the resource. - ResourceId *string - - // The ID of the Amazon Web Services account that owns the resource. - ResourceOwner *string - - // The resource tag. - ResourceTag *types.RequestIpamResourceTag - - // The resource type. - ResourceType types.IpamResourceType - - noSmithyDocumentSerde -} - -type GetIpamResourceCidrsOutput struct { - - // The resource CIDRs. - IpamResourceCidrs []types.IpamResourceCidr - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetIpamResourceCidrsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamResourceCidrs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamResourceCidrs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamResourceCidrs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetIpamResourceCidrsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamResourceCidrs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetIpamResourceCidrsPaginatorOptions is the paginator options for -// GetIpamResourceCidrs -type GetIpamResourceCidrsPaginatorOptions struct { - // The maximum number of results to return in the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetIpamResourceCidrsPaginator is a paginator for GetIpamResourceCidrs -type GetIpamResourceCidrsPaginator struct { - options GetIpamResourceCidrsPaginatorOptions - client GetIpamResourceCidrsAPIClient - params *GetIpamResourceCidrsInput - nextToken *string - firstPage bool -} - -// NewGetIpamResourceCidrsPaginator returns a new GetIpamResourceCidrsPaginator -func NewGetIpamResourceCidrsPaginator(client GetIpamResourceCidrsAPIClient, params *GetIpamResourceCidrsInput, optFns ...func(*GetIpamResourceCidrsPaginatorOptions)) *GetIpamResourceCidrsPaginator { - if params == nil { - params = &GetIpamResourceCidrsInput{} - } - - options := GetIpamResourceCidrsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetIpamResourceCidrsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetIpamResourceCidrsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetIpamResourceCidrs page. -func (p *GetIpamResourceCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIpamResourceCidrsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetIpamResourceCidrs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetIpamResourceCidrsAPIClient is a client that implements the -// GetIpamResourceCidrs operation. -type GetIpamResourceCidrsAPIClient interface { - GetIpamResourceCidrs(context.Context, *GetIpamResourceCidrsInput, ...func(*Options)) (*GetIpamResourceCidrsOutput, error) -} - -var _ GetIpamResourceCidrsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetIpamResourceCidrs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetIpamResourceCidrs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetLaunchTemplateData.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetLaunchTemplateData.go deleted file mode 100644 index 3cf2728f8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetLaunchTemplateData.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the configuration data of the specified instance. You can use this -// data to create a launch template. -// -// This action calls on other describe actions to get instance information. -// Depending on your instance configuration, you may need to allow the following -// actions in your IAM policy: DescribeSpotInstanceRequests , -// DescribeInstanceCreditSpecifications , DescribeVolumes , and -// DescribeInstanceAttribute . Or, you can allow describe* depending on your -// instance requirements. -func (c *Client) GetLaunchTemplateData(ctx context.Context, params *GetLaunchTemplateDataInput, optFns ...func(*Options)) (*GetLaunchTemplateDataOutput, error) { - if params == nil { - params = &GetLaunchTemplateDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetLaunchTemplateData", params, optFns, c.addOperationGetLaunchTemplateDataMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetLaunchTemplateDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetLaunchTemplateDataInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetLaunchTemplateDataOutput struct { - - // The instance data. - LaunchTemplateData *types.ResponseLaunchTemplateData - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetLaunchTemplateDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetLaunchTemplateData{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetLaunchTemplateData{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetLaunchTemplateData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetLaunchTemplateDataValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLaunchTemplateData(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetLaunchTemplateData(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetLaunchTemplateData", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListAssociations.go deleted file mode 100644 index 2c72a29d8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListAssociations.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the resources that are associated with the specified -// managed prefix list. -func (c *Client) GetManagedPrefixListAssociations(ctx context.Context, params *GetManagedPrefixListAssociationsInput, optFns ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) { - if params == nil { - params = &GetManagedPrefixListAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetManagedPrefixListAssociations", params, optFns, c.addOperationGetManagedPrefixListAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetManagedPrefixListAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetManagedPrefixListAssociationsInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetManagedPrefixListAssociationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the associations. - PrefixListAssociations []types.PrefixListAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetManagedPrefixListAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetManagedPrefixListAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetManagedPrefixListAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetManagedPrefixListAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetManagedPrefixListAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetManagedPrefixListAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetManagedPrefixListAssociationsPaginatorOptions is the paginator options for -// GetManagedPrefixListAssociations -type GetManagedPrefixListAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetManagedPrefixListAssociationsPaginator is a paginator for -// GetManagedPrefixListAssociations -type GetManagedPrefixListAssociationsPaginator struct { - options GetManagedPrefixListAssociationsPaginatorOptions - client GetManagedPrefixListAssociationsAPIClient - params *GetManagedPrefixListAssociationsInput - nextToken *string - firstPage bool -} - -// NewGetManagedPrefixListAssociationsPaginator returns a new -// GetManagedPrefixListAssociationsPaginator -func NewGetManagedPrefixListAssociationsPaginator(client GetManagedPrefixListAssociationsAPIClient, params *GetManagedPrefixListAssociationsInput, optFns ...func(*GetManagedPrefixListAssociationsPaginatorOptions)) *GetManagedPrefixListAssociationsPaginator { - if params == nil { - params = &GetManagedPrefixListAssociationsInput{} - } - - options := GetManagedPrefixListAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetManagedPrefixListAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetManagedPrefixListAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetManagedPrefixListAssociations page. -func (p *GetManagedPrefixListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetManagedPrefixListAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetManagedPrefixListAssociationsAPIClient is a client that implements the -// GetManagedPrefixListAssociations operation. -type GetManagedPrefixListAssociationsAPIClient interface { - GetManagedPrefixListAssociations(context.Context, *GetManagedPrefixListAssociationsInput, ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) -} - -var _ GetManagedPrefixListAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetManagedPrefixListAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetManagedPrefixListAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListEntries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListEntries.go deleted file mode 100644 index b9e52a382..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetManagedPrefixListEntries.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the entries for a specified managed prefix list. -func (c *Client) GetManagedPrefixListEntries(ctx context.Context, params *GetManagedPrefixListEntriesInput, optFns ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) { - if params == nil { - params = &GetManagedPrefixListEntriesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetManagedPrefixListEntries", params, optFns, c.addOperationGetManagedPrefixListEntriesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetManagedPrefixListEntriesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetManagedPrefixListEntriesInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - // The version of the prefix list for which to return the entries. The default is - // the current version. - TargetVersion *int64 - - noSmithyDocumentSerde -} - -type GetManagedPrefixListEntriesOutput struct { - - // Information about the prefix list entries. - Entries []types.PrefixListEntry - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetManagedPrefixListEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetManagedPrefixListEntries{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetManagedPrefixListEntries{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetManagedPrefixListEntries"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetManagedPrefixListEntriesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetManagedPrefixListEntries(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetManagedPrefixListEntriesPaginatorOptions is the paginator options for -// GetManagedPrefixListEntries -type GetManagedPrefixListEntriesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetManagedPrefixListEntriesPaginator is a paginator for -// GetManagedPrefixListEntries -type GetManagedPrefixListEntriesPaginator struct { - options GetManagedPrefixListEntriesPaginatorOptions - client GetManagedPrefixListEntriesAPIClient - params *GetManagedPrefixListEntriesInput - nextToken *string - firstPage bool -} - -// NewGetManagedPrefixListEntriesPaginator returns a new -// GetManagedPrefixListEntriesPaginator -func NewGetManagedPrefixListEntriesPaginator(client GetManagedPrefixListEntriesAPIClient, params *GetManagedPrefixListEntriesInput, optFns ...func(*GetManagedPrefixListEntriesPaginatorOptions)) *GetManagedPrefixListEntriesPaginator { - if params == nil { - params = &GetManagedPrefixListEntriesInput{} - } - - options := GetManagedPrefixListEntriesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetManagedPrefixListEntriesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetManagedPrefixListEntriesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetManagedPrefixListEntries page. -func (p *GetManagedPrefixListEntriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetManagedPrefixListEntries(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetManagedPrefixListEntriesAPIClient is a client that implements the -// GetManagedPrefixListEntries operation. -type GetManagedPrefixListEntriesAPIClient interface { - GetManagedPrefixListEntries(context.Context, *GetManagedPrefixListEntriesInput, ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) -} - -var _ GetManagedPrefixListEntriesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetManagedPrefixListEntries(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetManagedPrefixListEntries", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeAnalysisFindings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeAnalysisFindings.go deleted file mode 100644 index 28a222611..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeAnalysisFindings.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the findings for the specified Network Access Scope analysis. -func (c *Client) GetNetworkInsightsAccessScopeAnalysisFindings(ctx context.Context, params *GetNetworkInsightsAccessScopeAnalysisFindingsInput, optFns ...func(*Options)) (*GetNetworkInsightsAccessScopeAnalysisFindingsOutput, error) { - if params == nil { - params = &GetNetworkInsightsAccessScopeAnalysisFindingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetNetworkInsightsAccessScopeAnalysisFindings", params, optFns, c.addOperationGetNetworkInsightsAccessScopeAnalysisFindingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetNetworkInsightsAccessScopeAnalysisFindingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetNetworkInsightsAccessScopeAnalysisFindingsInput struct { - - // The ID of the Network Access Scope analysis. - // - // This member is required. - NetworkInsightsAccessScopeAnalysisId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetNetworkInsightsAccessScopeAnalysisFindingsOutput struct { - - // The findings associated with Network Access Scope Analysis. - AnalysisFindings []types.AccessScopeAnalysisFinding - - // The status of Network Access Scope Analysis. - AnalysisStatus types.AnalysisStatus - - // The ID of the Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysisId *string - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetNetworkInsightsAccessScopeAnalysisFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetNetworkInsightsAccessScopeAnalysisFindings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetNetworkInsightsAccessScopeAnalysisFindings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetNetworkInsightsAccessScopeAnalysisFindingsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNetworkInsightsAccessScopeAnalysisFindings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetNetworkInsightsAccessScopeAnalysisFindingsPaginatorOptions is the paginator -// options for GetNetworkInsightsAccessScopeAnalysisFindings -type GetNetworkInsightsAccessScopeAnalysisFindingsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetNetworkInsightsAccessScopeAnalysisFindingsPaginator is a paginator for -// GetNetworkInsightsAccessScopeAnalysisFindings -type GetNetworkInsightsAccessScopeAnalysisFindingsPaginator struct { - options GetNetworkInsightsAccessScopeAnalysisFindingsPaginatorOptions - client GetNetworkInsightsAccessScopeAnalysisFindingsAPIClient - params *GetNetworkInsightsAccessScopeAnalysisFindingsInput - nextToken *string - firstPage bool -} - -// NewGetNetworkInsightsAccessScopeAnalysisFindingsPaginator returns a new -// GetNetworkInsightsAccessScopeAnalysisFindingsPaginator -func NewGetNetworkInsightsAccessScopeAnalysisFindingsPaginator(client GetNetworkInsightsAccessScopeAnalysisFindingsAPIClient, params *GetNetworkInsightsAccessScopeAnalysisFindingsInput, optFns ...func(*GetNetworkInsightsAccessScopeAnalysisFindingsPaginatorOptions)) *GetNetworkInsightsAccessScopeAnalysisFindingsPaginator { - if params == nil { - params = &GetNetworkInsightsAccessScopeAnalysisFindingsInput{} - } - - options := GetNetworkInsightsAccessScopeAnalysisFindingsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetNetworkInsightsAccessScopeAnalysisFindingsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetNetworkInsightsAccessScopeAnalysisFindingsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetNetworkInsightsAccessScopeAnalysisFindings page. -func (p *GetNetworkInsightsAccessScopeAnalysisFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetNetworkInsightsAccessScopeAnalysisFindingsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetNetworkInsightsAccessScopeAnalysisFindings(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetNetworkInsightsAccessScopeAnalysisFindingsAPIClient is a client that -// implements the GetNetworkInsightsAccessScopeAnalysisFindings operation. -type GetNetworkInsightsAccessScopeAnalysisFindingsAPIClient interface { - GetNetworkInsightsAccessScopeAnalysisFindings(context.Context, *GetNetworkInsightsAccessScopeAnalysisFindingsInput, ...func(*Options)) (*GetNetworkInsightsAccessScopeAnalysisFindingsOutput, error) -} - -var _ GetNetworkInsightsAccessScopeAnalysisFindingsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetNetworkInsightsAccessScopeAnalysisFindings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetNetworkInsightsAccessScopeAnalysisFindings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeContent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeContent.go deleted file mode 100644 index c191bd80c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetNetworkInsightsAccessScopeContent.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the content for the specified Network Access Scope. -func (c *Client) GetNetworkInsightsAccessScopeContent(ctx context.Context, params *GetNetworkInsightsAccessScopeContentInput, optFns ...func(*Options)) (*GetNetworkInsightsAccessScopeContentOutput, error) { - if params == nil { - params = &GetNetworkInsightsAccessScopeContentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetNetworkInsightsAccessScopeContent", params, optFns, c.addOperationGetNetworkInsightsAccessScopeContentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetNetworkInsightsAccessScopeContentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetNetworkInsightsAccessScopeContentInput struct { - - // The ID of the Network Access Scope. - // - // This member is required. - NetworkInsightsAccessScopeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetNetworkInsightsAccessScopeContentOutput struct { - - // The Network Access Scope content. - NetworkInsightsAccessScopeContent *types.NetworkInsightsAccessScopeContent - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetNetworkInsightsAccessScopeContentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetNetworkInsightsAccessScopeContent{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetNetworkInsightsAccessScopeContent"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetNetworkInsightsAccessScopeContentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNetworkInsightsAccessScopeContent(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetNetworkInsightsAccessScopeContent(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetNetworkInsightsAccessScopeContent", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetPasswordData.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetPasswordData.go deleted file mode 100644 index 9941ceda8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetPasswordData.go +++ /dev/null @@ -1,389 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "strconv" - "time" -) - -// Retrieves the encrypted administrator password for a running Windows instance. -// -// The Windows password is generated at boot by the EC2Config service or EC2Launch -// scripts (Windows Server 2016 and later). This usually only happens the first -// time an instance is launched. For more information, see [EC2Config]and [EC2Launch] in the Amazon EC2 -// User Guide. -// -// For the EC2Config service, the password is not generated for rebundled AMIs -// unless Ec2SetPassword is enabled before bundling. -// -// The password is encrypted using the key pair that you specified when you -// launched the instance. You must provide the corresponding key pair file. -// -// When you launch an instance, password generation and encryption may take a few -// minutes. If you try to retrieve the password before it's available, the output -// returns an empty string. We recommend that you wait up to 15 minutes after -// launching an instance before trying to retrieve the generated password. -// -// [EC2Launch]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2launch.html -// [EC2Config]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingConfig_WinAMI.html -func (c *Client) GetPasswordData(ctx context.Context, params *GetPasswordDataInput, optFns ...func(*Options)) (*GetPasswordDataOutput, error) { - if params == nil { - params = &GetPasswordDataInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetPasswordData", params, optFns, c.addOperationGetPasswordDataMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetPasswordDataOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetPasswordDataInput struct { - - // The ID of the Windows instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetPasswordDataOutput struct { - - // The ID of the Windows instance. - InstanceId *string - - // The password of the instance. Returns an empty string if the password is not - // available. - PasswordData *string - - // The time the data was last updated. - Timestamp *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetPasswordDataMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetPasswordData{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetPasswordData{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetPasswordData"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetPasswordDataValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPasswordData(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// PasswordDataAvailableWaiterOptions are waiter options for -// PasswordDataAvailableWaiter -type PasswordDataAvailableWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // PasswordDataAvailableWaiter will use default minimum delay of 15 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, PasswordDataAvailableWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *GetPasswordDataInput, *GetPasswordDataOutput, error) (bool, error) -} - -// PasswordDataAvailableWaiter defines the waiters for PasswordDataAvailable -type PasswordDataAvailableWaiter struct { - client GetPasswordDataAPIClient - - options PasswordDataAvailableWaiterOptions -} - -// NewPasswordDataAvailableWaiter constructs a PasswordDataAvailableWaiter. -func NewPasswordDataAvailableWaiter(client GetPasswordDataAPIClient, optFns ...func(*PasswordDataAvailableWaiterOptions)) *PasswordDataAvailableWaiter { - options := PasswordDataAvailableWaiterOptions{} - options.MinDelay = 15 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = passwordDataAvailableStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &PasswordDataAvailableWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for PasswordDataAvailable waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *PasswordDataAvailableWaiter) Wait(ctx context.Context, params *GetPasswordDataInput, maxWaitDur time.Duration, optFns ...func(*PasswordDataAvailableWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for PasswordDataAvailable waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *PasswordDataAvailableWaiter) WaitForOutput(ctx context.Context, params *GetPasswordDataInput, maxWaitDur time.Duration, optFns ...func(*PasswordDataAvailableWaiterOptions)) (*GetPasswordDataOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.GetPasswordData(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for PasswordDataAvailable waiter") -} - -func passwordDataAvailableStateRetryable(ctx context.Context, input *GetPasswordDataInput, output *GetPasswordDataOutput, err error) (bool, error) { - - if err == nil { - v1 := output.PasswordData - var _v1 string - if v1 != nil { - _v1 = *v1 - } - v2 := len(_v1) - v3 := 0 - v4 := int64(v2) > int64(v3) - expectedValue := "true" - bv, err := strconv.ParseBool(expectedValue) - if err != nil { - return false, fmt.Errorf("error parsing boolean from string %w", err) - } - if v4 == bv { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// GetPasswordDataAPIClient is a client that implements the GetPasswordData -// operation. -type GetPasswordDataAPIClient interface { - GetPasswordData(context.Context, *GetPasswordDataInput, ...func(*Options)) (*GetPasswordDataOutput, error) -} - -var _ GetPasswordDataAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetPasswordData(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetPasswordData", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetReservedInstancesExchangeQuote.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetReservedInstancesExchangeQuote.go deleted file mode 100644 index f259cc0db..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetReservedInstancesExchangeQuote.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Returns a quote and exchange information for exchanging one or more specified -// Convertible Reserved Instances for a new Convertible Reserved Instance. If the -// exchange cannot be performed, the reason is returned in the response. Use AcceptReservedInstancesExchangeQuoteto -// perform the exchange. -func (c *Client) GetReservedInstancesExchangeQuote(ctx context.Context, params *GetReservedInstancesExchangeQuoteInput, optFns ...func(*Options)) (*GetReservedInstancesExchangeQuoteOutput, error) { - if params == nil { - params = &GetReservedInstancesExchangeQuoteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetReservedInstancesExchangeQuote", params, optFns, c.addOperationGetReservedInstancesExchangeQuoteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetReservedInstancesExchangeQuoteOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for GetReservedInstanceExchangeQuote. -type GetReservedInstancesExchangeQuoteInput struct { - - // The IDs of the Convertible Reserved Instances to exchange. - // - // This member is required. - ReservedInstanceIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The configuration of the target Convertible Reserved Instance to exchange for - // your current Convertible Reserved Instances. - TargetConfigurations []types.TargetConfigurationRequest - - noSmithyDocumentSerde -} - -// Contains the output of GetReservedInstancesExchangeQuote. -type GetReservedInstancesExchangeQuoteOutput struct { - - // The currency of the transaction. - CurrencyCode *string - - // If true , the exchange is valid. If false , the exchange cannot be completed. - IsValidExchange *bool - - // The new end date of the reservation term. - OutputReservedInstancesWillExpireAt *time.Time - - // The total true upfront charge for the exchange. - PaymentDue *string - - // The cost associated with the Reserved Instance. - ReservedInstanceValueRollup *types.ReservationValue - - // The configuration of your Convertible Reserved Instances. - ReservedInstanceValueSet []types.ReservedInstanceReservationValue - - // The cost associated with the Reserved Instance. - TargetConfigurationValueRollup *types.ReservationValue - - // The values of the target Convertible Reserved Instances. - TargetConfigurationValueSet []types.TargetReservationValue - - // Describes the reason why the exchange cannot be completed. - ValidationFailureReason *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetReservedInstancesExchangeQuoteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetReservedInstancesExchangeQuote{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetReservedInstancesExchangeQuote{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetReservedInstancesExchangeQuote"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetReservedInstancesExchangeQuoteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReservedInstancesExchangeQuote(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetReservedInstancesExchangeQuote(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetReservedInstancesExchangeQuote", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerAssociations.go deleted file mode 100644 index e83eaee6b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerAssociations.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the associations for the specified route server. -// -// A route server association is the connection established between a route server -// and a VPC. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -func (c *Client) GetRouteServerAssociations(ctx context.Context, params *GetRouteServerAssociationsInput, optFns ...func(*Options)) (*GetRouteServerAssociationsOutput, error) { - if params == nil { - params = &GetRouteServerAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRouteServerAssociations", params, optFns, c.addOperationGetRouteServerAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetRouteServerAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetRouteServerAssociationsInput struct { - - // The ID of the route server for which to get association information. - // - // This member is required. - RouteServerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetRouteServerAssociationsOutput struct { - - // Information about the associations for the specified route server. - RouteServerAssociations []types.RouteServerAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetRouteServerAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetRouteServerAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetRouteServerAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRouteServerAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetRouteServerAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRouteServerAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetRouteServerAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetRouteServerAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerPropagations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerPropagations.go deleted file mode 100644 index 365d1b36d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerPropagations.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the route propagations for the specified route server. -// -// When enabled, route server propagation installs the routes in the FIB on the -// route table you've specified. Route server supports IPv4 and IPv6 route -// propagation. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) GetRouteServerPropagations(ctx context.Context, params *GetRouteServerPropagationsInput, optFns ...func(*Options)) (*GetRouteServerPropagationsOutput, error) { - if params == nil { - params = &GetRouteServerPropagationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRouteServerPropagations", params, optFns, c.addOperationGetRouteServerPropagationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetRouteServerPropagationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetRouteServerPropagationsInput struct { - - // The ID of the route server for which to get propagation information. - // - // This member is required. - RouteServerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the route table for which to get propagation information. - RouteTableId *string - - noSmithyDocumentSerde -} - -type GetRouteServerPropagationsOutput struct { - - // Information about the route propagations for the specified route server. - RouteServerPropagations []types.RouteServerPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetRouteServerPropagationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetRouteServerPropagations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetRouteServerPropagations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRouteServerPropagations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetRouteServerPropagationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRouteServerPropagations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetRouteServerPropagations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetRouteServerPropagations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerRoutingDatabase.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerRoutingDatabase.go deleted file mode 100644 index 9505b4e92..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetRouteServerRoutingDatabase.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the routing database for the specified route server. The [Routing Information Base (RIB)] serves as a -// database that stores all the routing information and network topology data -// collected by a router or routing system, such as routes learned from BGP peers. -// The RIB is constantly updated as new routing information is received or existing -// routes change. This ensures that the route server always has the most current -// view of the network topology and can make optimal routing decisions. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// [Routing Information Base (RIB)]: https://en.wikipedia.org/wiki/Routing_table -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) GetRouteServerRoutingDatabase(ctx context.Context, params *GetRouteServerRoutingDatabaseInput, optFns ...func(*Options)) (*GetRouteServerRoutingDatabaseOutput, error) { - if params == nil { - params = &GetRouteServerRoutingDatabaseInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRouteServerRoutingDatabase", params, optFns, c.addOperationGetRouteServerRoutingDatabaseMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetRouteServerRoutingDatabaseOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetRouteServerRoutingDatabaseInput struct { - - // The ID of the route server for which to get the routing database. - // - // This member is required. - RouteServerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Filters to apply to the routing database query. - Filters []types.Filter - - // The maximum number of routing database entries to return in a single response. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetRouteServerRoutingDatabaseOutput struct { - - // Indicates whether routes are being persisted in the routing database. - AreRoutesPersisted *bool - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The collection of routes in the route server's routing database. - Routes []types.RouteServerRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetRouteServerRoutingDatabaseMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetRouteServerRoutingDatabase{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetRouteServerRoutingDatabase{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRouteServerRoutingDatabase"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetRouteServerRoutingDatabaseValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRouteServerRoutingDatabase(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetRouteServerRoutingDatabase(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetRouteServerRoutingDatabase", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSecurityGroupsForVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSecurityGroupsForVpc.go deleted file mode 100644 index 75d065c35..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSecurityGroupsForVpc.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets security groups that can be associated by the Amazon Web Services account -// making the request with network interfaces in the specified VPC. -func (c *Client) GetSecurityGroupsForVpc(ctx context.Context, params *GetSecurityGroupsForVpcInput, optFns ...func(*Options)) (*GetSecurityGroupsForVpcOutput, error) { - if params == nil { - params = &GetSecurityGroupsForVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSecurityGroupsForVpc", params, optFns, c.addOperationGetSecurityGroupsForVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSecurityGroupsForVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSecurityGroupsForVpcInput struct { - - // The VPC ID where the security group can be used. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters. If using multiple filters, the results include security groups - // which match all filters. - // - // - group-id : The security group ID. - // - // - description : The security group's description. - // - // - group-name : The security group name. - // - // - owner-id : The security group owner ID. - // - // - primary-vpc-id : The VPC ID in which the security group was created. - Filters []types.Filter - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type GetSecurityGroupsForVpcOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The security group that can be used by interfaces in the VPC. - SecurityGroupForVpcs []types.SecurityGroupForVpc - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSecurityGroupsForVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetSecurityGroupsForVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSecurityGroupsForVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSecurityGroupsForVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSecurityGroupsForVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecurityGroupsForVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetSecurityGroupsForVpcPaginatorOptions is the paginator options for -// GetSecurityGroupsForVpc -type GetSecurityGroupsForVpcPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetSecurityGroupsForVpcPaginator is a paginator for GetSecurityGroupsForVpc -type GetSecurityGroupsForVpcPaginator struct { - options GetSecurityGroupsForVpcPaginatorOptions - client GetSecurityGroupsForVpcAPIClient - params *GetSecurityGroupsForVpcInput - nextToken *string - firstPage bool -} - -// NewGetSecurityGroupsForVpcPaginator returns a new -// GetSecurityGroupsForVpcPaginator -func NewGetSecurityGroupsForVpcPaginator(client GetSecurityGroupsForVpcAPIClient, params *GetSecurityGroupsForVpcInput, optFns ...func(*GetSecurityGroupsForVpcPaginatorOptions)) *GetSecurityGroupsForVpcPaginator { - if params == nil { - params = &GetSecurityGroupsForVpcInput{} - } - - options := GetSecurityGroupsForVpcPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetSecurityGroupsForVpcPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetSecurityGroupsForVpcPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetSecurityGroupsForVpc page. -func (p *GetSecurityGroupsForVpcPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSecurityGroupsForVpcOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetSecurityGroupsForVpc(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetSecurityGroupsForVpcAPIClient is a client that implements the -// GetSecurityGroupsForVpc operation. -type GetSecurityGroupsForVpcAPIClient interface { - GetSecurityGroupsForVpc(context.Context, *GetSecurityGroupsForVpcInput, ...func(*Options)) (*GetSecurityGroupsForVpcOutput, error) -} - -var _ GetSecurityGroupsForVpcAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetSecurityGroupsForVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSecurityGroupsForVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSerialConsoleAccessStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSerialConsoleAccessStatus.go deleted file mode 100644 index 763d97618..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSerialConsoleAccessStatus.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the access status of your account to the EC2 serial console of all -// instances. By default, access to the EC2 serial console is disabled for your -// account. For more information, see [Manage account access to the EC2 serial console]in the Amazon EC2 User Guide. -// -// [Manage account access to the EC2 serial console]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access -func (c *Client) GetSerialConsoleAccessStatus(ctx context.Context, params *GetSerialConsoleAccessStatusInput, optFns ...func(*Options)) (*GetSerialConsoleAccessStatusOutput, error) { - if params == nil { - params = &GetSerialConsoleAccessStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSerialConsoleAccessStatus", params, optFns, c.addOperationGetSerialConsoleAccessStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSerialConsoleAccessStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSerialConsoleAccessStatusInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetSerialConsoleAccessStatusOutput struct { - - // The entity that manages access to the serial console. Possible values include: - // - // - account - Access is managed by the account. - // - // - declarative-policy - Access is managed by a declarative policy and can't be - // modified by the account. - ManagedBy types.ManagedBy - - // If true , access to the EC2 serial console of all instances is enabled for your - // account. If false , access to the EC2 serial console of all instances is - // disabled for your account. - SerialConsoleAccessEnabled *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSerialConsoleAccessStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetSerialConsoleAccessStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSerialConsoleAccessStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSerialConsoleAccessStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSerialConsoleAccessStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSerialConsoleAccessStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSerialConsoleAccessStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go deleted file mode 100644 index e30b96096..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the current state of block public access for snapshots setting for the -// account and Region. -// -// For more information, see [Block public access for snapshots] in the Amazon EBS User Guide. -// -// [Block public access for snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html -func (c *Client) GetSnapshotBlockPublicAccessState(ctx context.Context, params *GetSnapshotBlockPublicAccessStateInput, optFns ...func(*Options)) (*GetSnapshotBlockPublicAccessStateOutput, error) { - if params == nil { - params = &GetSnapshotBlockPublicAccessStateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSnapshotBlockPublicAccessState", params, optFns, c.addOperationGetSnapshotBlockPublicAccessStateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSnapshotBlockPublicAccessStateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSnapshotBlockPublicAccessStateInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetSnapshotBlockPublicAccessStateOutput struct { - - // The entity that manages the state for block public access for snapshots. - // Possible values include: - // - // - account - The state is managed by the account. - // - // - declarative-policy - The state is managed by a declarative policy and can't - // be modified by the account. - ManagedBy types.ManagedBy - - // The current state of block public access for snapshots. Possible values include: - // - // - block-all-sharing - All public sharing of snapshots is blocked. Users in the - // account can't request new public sharing. Additionally, snapshots that were - // already publicly shared are treated as private and are not publicly available. - // - // - block-new-sharing - Only new public sharing of snapshots is blocked. Users - // in the account can't request new public sharing. However, snapshots that were - // already publicly shared, remain publicly available. - // - // - unblocked - Public sharing is not blocked. Users can publicly share - // snapshots. - State types.SnapshotBlockPublicAccessState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSnapshotBlockPublicAccessStateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetSnapshotBlockPublicAccessState{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSnapshotBlockPublicAccessState"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSnapshotBlockPublicAccessState(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSnapshotBlockPublicAccessState(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSnapshotBlockPublicAccessState", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSpotPlacementScores.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSpotPlacementScores.go deleted file mode 100644 index 053b67154..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSpotPlacementScores.go +++ /dev/null @@ -1,336 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Calculates the Spot placement score for a Region or Availability Zone based on -// the specified target capacity and compute requirements. -// -// You can specify your compute requirements either by using -// InstanceRequirementsWithMetadata and letting Amazon EC2 choose the optimal -// instance types to fulfill your Spot request, or you can specify the instance -// types by using InstanceTypes . -// -// For more information, see [Spot placement score] in the Amazon EC2 User Guide. -// -// [Spot placement score]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html -func (c *Client) GetSpotPlacementScores(ctx context.Context, params *GetSpotPlacementScoresInput, optFns ...func(*Options)) (*GetSpotPlacementScoresOutput, error) { - if params == nil { - params = &GetSpotPlacementScoresInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSpotPlacementScores", params, optFns, c.addOperationGetSpotPlacementScoresMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSpotPlacementScoresOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSpotPlacementScoresInput struct { - - // The target capacity. - // - // This member is required. - TargetCapacity *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with those attributes. - // - // If you specify InstanceRequirementsWithMetadata , you can't specify - // InstanceTypes . - InstanceRequirementsWithMetadata *types.InstanceRequirementsWithMetadataRequest - - // The instance types. We recommend that you specify at least three instance - // types. If you specify one or two instance types, or specify variations of a - // single instance type (for example, an m3.xlarge with and without instance - // storage), the returned placement score will always be low. - // - // If you specify InstanceTypes , you can't specify - // InstanceRequirementsWithMetadata . - InstanceTypes []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The Regions used to narrow down the list of Regions to be scored. Enter the - // Region code, for example, us-east-1 . - RegionNames []string - - // Specify true so that the response returns a list of scored Availability Zones. - // Otherwise, the response returns a list of scored Regions. - // - // A list of scored Availability Zones is useful if you want to launch all of your - // Spot capacity into a single Availability Zone. - SingleAvailabilityZone *bool - - // The unit for the target capacity. - TargetCapacityUnitType types.TargetCapacityUnitType - - noSmithyDocumentSerde -} - -type GetSpotPlacementScoresOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // The Spot placement score for the top 10 Regions or Availability Zones, scored - // on a scale from 1 to 10. Each score
 reflects how likely it is that each Region - // or Availability Zone will succeed at fulfilling the specified target capacity - // at the time of the Spot placement score request. A score of 10 means that your - // Spot capacity request is highly likely to succeed in that Region or Availability - // Zone. - // - // If you request a Spot placement score for Regions, a high score assumes that - // your fleet request will be configured to use all Availability Zones and the - // capacity-optimized allocation strategy. If you request a Spot placement score - // for Availability Zones, a high score assumes that your fleet request will be - // configured to use a single Availability Zone and the capacity-optimized - // allocation strategy. - // - // Different
 Regions or Availability Zones might return the same score. - // - // The Spot placement score serves as a recommendation only. No score guarantees - // that your Spot request will be fully or partially fulfilled. - SpotPlacementScores []types.SpotPlacementScore - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSpotPlacementScoresMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetSpotPlacementScores{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSpotPlacementScores{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSpotPlacementScores"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSpotPlacementScoresValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSpotPlacementScores(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetSpotPlacementScoresPaginatorOptions is the paginator options for -// GetSpotPlacementScores -type GetSpotPlacementScoresPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetSpotPlacementScoresPaginator is a paginator for GetSpotPlacementScores -type GetSpotPlacementScoresPaginator struct { - options GetSpotPlacementScoresPaginatorOptions - client GetSpotPlacementScoresAPIClient - params *GetSpotPlacementScoresInput - nextToken *string - firstPage bool -} - -// NewGetSpotPlacementScoresPaginator returns a new GetSpotPlacementScoresPaginator -func NewGetSpotPlacementScoresPaginator(client GetSpotPlacementScoresAPIClient, params *GetSpotPlacementScoresInput, optFns ...func(*GetSpotPlacementScoresPaginatorOptions)) *GetSpotPlacementScoresPaginator { - if params == nil { - params = &GetSpotPlacementScoresInput{} - } - - options := GetSpotPlacementScoresPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetSpotPlacementScoresPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetSpotPlacementScoresPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetSpotPlacementScores page. -func (p *GetSpotPlacementScoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSpotPlacementScoresOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetSpotPlacementScores(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetSpotPlacementScoresAPIClient is a client that implements the -// GetSpotPlacementScores operation. -type GetSpotPlacementScoresAPIClient interface { - GetSpotPlacementScores(context.Context, *GetSpotPlacementScoresInput, ...func(*Options)) (*GetSpotPlacementScoresOutput, error) -} - -var _ GetSpotPlacementScoresAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetSpotPlacementScores(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSpotPlacementScores", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSubnetCidrReservations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSubnetCidrReservations.go deleted file mode 100644 index 3d9822ec7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetSubnetCidrReservations.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the subnet CIDR reservations. -func (c *Client) GetSubnetCidrReservations(ctx context.Context, params *GetSubnetCidrReservationsInput, optFns ...func(*Options)) (*GetSubnetCidrReservationsOutput, error) { - if params == nil { - params = &GetSubnetCidrReservationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSubnetCidrReservations", params, optFns, c.addOperationGetSubnetCidrReservationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSubnetCidrReservationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSubnetCidrReservationsInput struct { - - // The ID of the subnet. - // - // This member is required. - SubnetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - reservationType - The type of reservation ( prefix | explicit ). - // - // - subnet-id - The ID of the subnet. - // - // - tag : - The key/value combination of a tag assigned to the resource. Use the - // tag key in the filter name and the tag value as the filter value. For example, - // to find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - // - // - tag-key - The key of a tag assigned to the resource. Use this filter to find - // all resources assigned a tag with a specific key, regardless of the tag value. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetSubnetCidrReservationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the IPv4 subnet CIDR reservations. - SubnetIpv4CidrReservations []types.SubnetCidrReservation - - // Information about the IPv6 subnet CIDR reservations. - SubnetIpv6CidrReservations []types.SubnetCidrReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSubnetCidrReservationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetSubnetCidrReservations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSubnetCidrReservations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSubnetCidrReservations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSubnetCidrReservationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSubnetCidrReservations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSubnetCidrReservations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSubnetCidrReservations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go deleted file mode 100644 index 96f7ca3cd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the route tables to which the specified resource attachment propagates -// routes. -func (c *Client) GetTransitGatewayAttachmentPropagations(ctx context.Context, params *GetTransitGatewayAttachmentPropagationsInput, optFns ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) { - if params == nil { - params = &GetTransitGatewayAttachmentPropagationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayAttachmentPropagations", params, optFns, c.addOperationGetTransitGatewayAttachmentPropagationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayAttachmentPropagationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayAttachmentPropagationsInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - transit-gateway-route-table-id - The ID of the transit gateway route table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayAttachmentPropagationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the propagation route tables. - TransitGatewayAttachmentPropagations []types.TransitGatewayAttachmentPropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayAttachmentPropagationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayAttachmentPropagations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayAttachmentPropagations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayAttachmentPropagationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayAttachmentPropagations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayAttachmentPropagationsPaginatorOptions is the paginator -// options for GetTransitGatewayAttachmentPropagations -type GetTransitGatewayAttachmentPropagationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayAttachmentPropagationsPaginator is a paginator for -// GetTransitGatewayAttachmentPropagations -type GetTransitGatewayAttachmentPropagationsPaginator struct { - options GetTransitGatewayAttachmentPropagationsPaginatorOptions - client GetTransitGatewayAttachmentPropagationsAPIClient - params *GetTransitGatewayAttachmentPropagationsInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayAttachmentPropagationsPaginator returns a new -// GetTransitGatewayAttachmentPropagationsPaginator -func NewGetTransitGatewayAttachmentPropagationsPaginator(client GetTransitGatewayAttachmentPropagationsAPIClient, params *GetTransitGatewayAttachmentPropagationsInput, optFns ...func(*GetTransitGatewayAttachmentPropagationsPaginatorOptions)) *GetTransitGatewayAttachmentPropagationsPaginator { - if params == nil { - params = &GetTransitGatewayAttachmentPropagationsInput{} - } - - options := GetTransitGatewayAttachmentPropagationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayAttachmentPropagationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayAttachmentPropagationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayAttachmentPropagations page. -func (p *GetTransitGatewayAttachmentPropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayAttachmentPropagations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayAttachmentPropagationsAPIClient is a client that implements -// the GetTransitGatewayAttachmentPropagations operation. -type GetTransitGatewayAttachmentPropagationsAPIClient interface { - GetTransitGatewayAttachmentPropagations(context.Context, *GetTransitGatewayAttachmentPropagationsInput, ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) -} - -var _ GetTransitGatewayAttachmentPropagationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayAttachmentPropagations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayAttachmentPropagations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go deleted file mode 100644 index 7ad4876cb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the associations for the transit gateway multicast -// domain. -func (c *Client) GetTransitGatewayMulticastDomainAssociations(ctx context.Context, params *GetTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { - if params == nil { - params = &GetTransitGatewayMulticastDomainAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayMulticastDomainAssociations", params, optFns, c.addOperationGetTransitGatewayMulticastDomainAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayMulticastDomainAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayMulticastDomainAssociationsInput struct { - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - resource-id - The ID of the resource. - // - // - resource-type - The type of resource. The valid value is: vpc . - // - // - state - The state of the subnet association. Valid values are associated | - // associating | disassociated | disassociating . - // - // - subnet-id - The ID of the subnet. - // - // - transit-gateway-attachment-id - The id of the transit gateway attachment. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayMulticastDomainAssociationsOutput struct { - - // Information about the multicast domain associations. - MulticastDomainAssociations []types.TransitGatewayMulticastDomainAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayMulticastDomainAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayMulticastDomainAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayMulticastDomainAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayMulticastDomainAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayMulticastDomainAssociationsPaginatorOptions is the paginator -// options for GetTransitGatewayMulticastDomainAssociations -type GetTransitGatewayMulticastDomainAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayMulticastDomainAssociationsPaginator is a paginator for -// GetTransitGatewayMulticastDomainAssociations -type GetTransitGatewayMulticastDomainAssociationsPaginator struct { - options GetTransitGatewayMulticastDomainAssociationsPaginatorOptions - client GetTransitGatewayMulticastDomainAssociationsAPIClient - params *GetTransitGatewayMulticastDomainAssociationsInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayMulticastDomainAssociationsPaginator returns a new -// GetTransitGatewayMulticastDomainAssociationsPaginator -func NewGetTransitGatewayMulticastDomainAssociationsPaginator(client GetTransitGatewayMulticastDomainAssociationsAPIClient, params *GetTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*GetTransitGatewayMulticastDomainAssociationsPaginatorOptions)) *GetTransitGatewayMulticastDomainAssociationsPaginator { - if params == nil { - params = &GetTransitGatewayMulticastDomainAssociationsInput{} - } - - options := GetTransitGatewayMulticastDomainAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayMulticastDomainAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayMulticastDomainAssociations page. -func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayMulticastDomainAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayMulticastDomainAssociationsAPIClient is a client that -// implements the GetTransitGatewayMulticastDomainAssociations operation. -type GetTransitGatewayMulticastDomainAssociationsAPIClient interface { - GetTransitGatewayMulticastDomainAssociations(context.Context, *GetTransitGatewayMulticastDomainAssociationsInput, ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) -} - -var _ GetTransitGatewayMulticastDomainAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayMulticastDomainAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayMulticastDomainAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableAssociations.go deleted file mode 100644 index 17f7b8790..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableAssociations.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets a list of the transit gateway policy table associations. -func (c *Client) GetTransitGatewayPolicyTableAssociations(ctx context.Context, params *GetTransitGatewayPolicyTableAssociationsInput, optFns ...func(*Options)) (*GetTransitGatewayPolicyTableAssociationsOutput, error) { - if params == nil { - params = &GetTransitGatewayPolicyTableAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayPolicyTableAssociations", params, optFns, c.addOperationGetTransitGatewayPolicyTableAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayPolicyTableAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayPolicyTableAssociationsInput struct { - - // The ID of the transit gateway policy table. - // - // This member is required. - TransitGatewayPolicyTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters associated with the transit gateway policy table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayPolicyTableAssociationsOutput struct { - - // Returns details about the transit gateway policy table association. - Associations []types.TransitGatewayPolicyTableAssociation - - // The token for the next page of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayPolicyTableAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayPolicyTableAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayPolicyTableAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayPolicyTableAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayPolicyTableAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayPolicyTableAssociationsPaginatorOptions is the paginator -// options for GetTransitGatewayPolicyTableAssociations -type GetTransitGatewayPolicyTableAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayPolicyTableAssociationsPaginator is a paginator for -// GetTransitGatewayPolicyTableAssociations -type GetTransitGatewayPolicyTableAssociationsPaginator struct { - options GetTransitGatewayPolicyTableAssociationsPaginatorOptions - client GetTransitGatewayPolicyTableAssociationsAPIClient - params *GetTransitGatewayPolicyTableAssociationsInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayPolicyTableAssociationsPaginator returns a new -// GetTransitGatewayPolicyTableAssociationsPaginator -func NewGetTransitGatewayPolicyTableAssociationsPaginator(client GetTransitGatewayPolicyTableAssociationsAPIClient, params *GetTransitGatewayPolicyTableAssociationsInput, optFns ...func(*GetTransitGatewayPolicyTableAssociationsPaginatorOptions)) *GetTransitGatewayPolicyTableAssociationsPaginator { - if params == nil { - params = &GetTransitGatewayPolicyTableAssociationsInput{} - } - - options := GetTransitGatewayPolicyTableAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayPolicyTableAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayPolicyTableAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayPolicyTableAssociations page. -func (p *GetTransitGatewayPolicyTableAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayPolicyTableAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayPolicyTableAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayPolicyTableAssociationsAPIClient is a client that implements -// the GetTransitGatewayPolicyTableAssociations operation. -type GetTransitGatewayPolicyTableAssociationsAPIClient interface { - GetTransitGatewayPolicyTableAssociations(context.Context, *GetTransitGatewayPolicyTableAssociationsInput, ...func(*Options)) (*GetTransitGatewayPolicyTableAssociationsOutput, error) -} - -var _ GetTransitGatewayPolicyTableAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayPolicyTableAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayPolicyTableAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableEntries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableEntries.go deleted file mode 100644 index ae1130e8c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPolicyTableEntries.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a list of transit gateway policy table entries. -func (c *Client) GetTransitGatewayPolicyTableEntries(ctx context.Context, params *GetTransitGatewayPolicyTableEntriesInput, optFns ...func(*Options)) (*GetTransitGatewayPolicyTableEntriesOutput, error) { - if params == nil { - params = &GetTransitGatewayPolicyTableEntriesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayPolicyTableEntries", params, optFns, c.addOperationGetTransitGatewayPolicyTableEntriesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayPolicyTableEntriesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayPolicyTableEntriesInput struct { - - // The ID of the transit gateway policy table. - // - // This member is required. - TransitGatewayPolicyTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The filters associated with the transit gateway policy table. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayPolicyTableEntriesOutput struct { - - // The entries for the transit gateway policy table. - TransitGatewayPolicyTableEntries []types.TransitGatewayPolicyTableEntry - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayPolicyTableEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayPolicyTableEntries{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayPolicyTableEntries"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayPolicyTableEntriesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayPolicyTableEntries(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetTransitGatewayPolicyTableEntries(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayPolicyTableEntries", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go deleted file mode 100644 index cbd83aacf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the prefix list references in a specified transit -// gateway route table. -func (c *Client) GetTransitGatewayPrefixListReferences(ctx context.Context, params *GetTransitGatewayPrefixListReferencesInput, optFns ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) { - if params == nil { - params = &GetTransitGatewayPrefixListReferencesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayPrefixListReferences", params, optFns, c.addOperationGetTransitGatewayPrefixListReferencesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayPrefixListReferencesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayPrefixListReferencesInput struct { - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - attachment.resource-id - The ID of the resource for the attachment. - // - // - attachment.resource-type - The type of resource for the attachment. Valid - // values are vpc | vpn | direct-connect-gateway | peering . - // - // - attachment.transit-gateway-attachment-id - The ID of the attachment. - // - // - is-blackhole - Whether traffic matching the route is blocked ( true | false - // ). - // - // - prefix-list-id - The ID of the prefix list. - // - // - prefix-list-owner-id - The ID of the owner of the prefix list. - // - // - state - The state of the prefix list reference ( pending | available | - // modifying | deleting ). - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayPrefixListReferencesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the prefix list references. - TransitGatewayPrefixListReferences []types.TransitGatewayPrefixListReference - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayPrefixListReferencesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayPrefixListReferences{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayPrefixListReferences"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayPrefixListReferencesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayPrefixListReferences(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayPrefixListReferencesPaginatorOptions is the paginator options -// for GetTransitGatewayPrefixListReferences -type GetTransitGatewayPrefixListReferencesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayPrefixListReferencesPaginator is a paginator for -// GetTransitGatewayPrefixListReferences -type GetTransitGatewayPrefixListReferencesPaginator struct { - options GetTransitGatewayPrefixListReferencesPaginatorOptions - client GetTransitGatewayPrefixListReferencesAPIClient - params *GetTransitGatewayPrefixListReferencesInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayPrefixListReferencesPaginator returns a new -// GetTransitGatewayPrefixListReferencesPaginator -func NewGetTransitGatewayPrefixListReferencesPaginator(client GetTransitGatewayPrefixListReferencesAPIClient, params *GetTransitGatewayPrefixListReferencesInput, optFns ...func(*GetTransitGatewayPrefixListReferencesPaginatorOptions)) *GetTransitGatewayPrefixListReferencesPaginator { - if params == nil { - params = &GetTransitGatewayPrefixListReferencesInput{} - } - - options := GetTransitGatewayPrefixListReferencesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayPrefixListReferencesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayPrefixListReferencesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayPrefixListReferences page. -func (p *GetTransitGatewayPrefixListReferencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayPrefixListReferences(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayPrefixListReferencesAPIClient is a client that implements the -// GetTransitGatewayPrefixListReferences operation. -type GetTransitGatewayPrefixListReferencesAPIClient interface { - GetTransitGatewayPrefixListReferences(context.Context, *GetTransitGatewayPrefixListReferencesInput, ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) -} - -var _ GetTransitGatewayPrefixListReferencesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayPrefixListReferences(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayPrefixListReferences", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go deleted file mode 100644 index d3fea7c8c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the associations for the specified transit gateway route -// table. -func (c *Client) GetTransitGatewayRouteTableAssociations(ctx context.Context, params *GetTransitGatewayRouteTableAssociationsInput, optFns ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) { - if params == nil { - params = &GetTransitGatewayRouteTableAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayRouteTableAssociations", params, optFns, c.addOperationGetTransitGatewayRouteTableAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayRouteTableAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayRouteTableAssociationsInput struct { - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - resource-id - The ID of the resource. - // - // - resource-type - The resource type. Valid values are vpc | vpn | - // direct-connect-gateway | peering | connect . - // - // - transit-gateway-attachment-id - The ID of the attachment. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayRouteTableAssociationsOutput struct { - - // Information about the associations. - Associations []types.TransitGatewayRouteTableAssociation - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayRouteTableAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayRouteTableAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayRouteTableAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayRouteTableAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayRouteTableAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayRouteTableAssociationsPaginatorOptions is the paginator -// options for GetTransitGatewayRouteTableAssociations -type GetTransitGatewayRouteTableAssociationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayRouteTableAssociationsPaginator is a paginator for -// GetTransitGatewayRouteTableAssociations -type GetTransitGatewayRouteTableAssociationsPaginator struct { - options GetTransitGatewayRouteTableAssociationsPaginatorOptions - client GetTransitGatewayRouteTableAssociationsAPIClient - params *GetTransitGatewayRouteTableAssociationsInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayRouteTableAssociationsPaginator returns a new -// GetTransitGatewayRouteTableAssociationsPaginator -func NewGetTransitGatewayRouteTableAssociationsPaginator(client GetTransitGatewayRouteTableAssociationsAPIClient, params *GetTransitGatewayRouteTableAssociationsInput, optFns ...func(*GetTransitGatewayRouteTableAssociationsPaginatorOptions)) *GetTransitGatewayRouteTableAssociationsPaginator { - if params == nil { - params = &GetTransitGatewayRouteTableAssociationsInput{} - } - - options := GetTransitGatewayRouteTableAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayRouteTableAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayRouteTableAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayRouteTableAssociations page. -func (p *GetTransitGatewayRouteTableAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayRouteTableAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayRouteTableAssociationsAPIClient is a client that implements -// the GetTransitGatewayRouteTableAssociations operation. -type GetTransitGatewayRouteTableAssociationsAPIClient interface { - GetTransitGatewayRouteTableAssociations(context.Context, *GetTransitGatewayRouteTableAssociationsInput, ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) -} - -var _ GetTransitGatewayRouteTableAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayRouteTableAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayRouteTableAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go deleted file mode 100644 index f8cf786a3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets information about the route table propagations for the specified transit -// gateway route table. -func (c *Client) GetTransitGatewayRouteTablePropagations(ctx context.Context, params *GetTransitGatewayRouteTablePropagationsInput, optFns ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) { - if params == nil { - params = &GetTransitGatewayRouteTablePropagationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTransitGatewayRouteTablePropagations", params, optFns, c.addOperationGetTransitGatewayRouteTablePropagationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTransitGatewayRouteTablePropagationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTransitGatewayRouteTablePropagationsInput struct { - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - resource-id - The ID of the resource. - // - // - resource-type - The resource type. Valid values are vpc | vpn | - // direct-connect-gateway | peering | connect . - // - // - transit-gateway-attachment-id - The ID of the attachment. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetTransitGatewayRouteTablePropagationsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the route table propagations. - TransitGatewayRouteTablePropagations []types.TransitGatewayRouteTablePropagation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTransitGatewayRouteTablePropagationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetTransitGatewayRouteTablePropagations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransitGatewayRouteTablePropagations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTransitGatewayRouteTablePropagationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransitGatewayRouteTablePropagations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetTransitGatewayRouteTablePropagationsPaginatorOptions is the paginator -// options for GetTransitGatewayRouteTablePropagations -type GetTransitGatewayRouteTablePropagationsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetTransitGatewayRouteTablePropagationsPaginator is a paginator for -// GetTransitGatewayRouteTablePropagations -type GetTransitGatewayRouteTablePropagationsPaginator struct { - options GetTransitGatewayRouteTablePropagationsPaginatorOptions - client GetTransitGatewayRouteTablePropagationsAPIClient - params *GetTransitGatewayRouteTablePropagationsInput - nextToken *string - firstPage bool -} - -// NewGetTransitGatewayRouteTablePropagationsPaginator returns a new -// GetTransitGatewayRouteTablePropagationsPaginator -func NewGetTransitGatewayRouteTablePropagationsPaginator(client GetTransitGatewayRouteTablePropagationsAPIClient, params *GetTransitGatewayRouteTablePropagationsInput, optFns ...func(*GetTransitGatewayRouteTablePropagationsPaginatorOptions)) *GetTransitGatewayRouteTablePropagationsPaginator { - if params == nil { - params = &GetTransitGatewayRouteTablePropagationsInput{} - } - - options := GetTransitGatewayRouteTablePropagationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetTransitGatewayRouteTablePropagationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetTransitGatewayRouteTablePropagationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetTransitGatewayRouteTablePropagations page. -func (p *GetTransitGatewayRouteTablePropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetTransitGatewayRouteTablePropagations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetTransitGatewayRouteTablePropagationsAPIClient is a client that implements -// the GetTransitGatewayRouteTablePropagations operation. -type GetTransitGatewayRouteTablePropagationsAPIClient interface { - GetTransitGatewayRouteTablePropagations(context.Context, *GetTransitGatewayRouteTablePropagationsInput, ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) -} - -var _ GetTransitGatewayRouteTablePropagationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetTransitGatewayRouteTablePropagations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTransitGatewayRouteTablePropagations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointPolicy.go deleted file mode 100644 index fb46192f8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointPolicy.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get the Verified Access policy associated with the endpoint. -func (c *Client) GetVerifiedAccessEndpointPolicy(ctx context.Context, params *GetVerifiedAccessEndpointPolicyInput, optFns ...func(*Options)) (*GetVerifiedAccessEndpointPolicyOutput, error) { - if params == nil { - params = &GetVerifiedAccessEndpointPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVerifiedAccessEndpointPolicy", params, optFns, c.addOperationGetVerifiedAccessEndpointPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVerifiedAccessEndpointPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVerifiedAccessEndpointPolicyInput struct { - - // The ID of the Verified Access endpoint. - // - // This member is required. - VerifiedAccessEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetVerifiedAccessEndpointPolicyOutput struct { - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVerifiedAccessEndpointPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVerifiedAccessEndpointPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVerifiedAccessEndpointPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetVerifiedAccessEndpointPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVerifiedAccessEndpointPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetVerifiedAccessEndpointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVerifiedAccessEndpointPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointTargets.go deleted file mode 100644 index eabdea908..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessEndpointTargets.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets the targets for the specified network CIDR endpoint for Verified Access. -func (c *Client) GetVerifiedAccessEndpointTargets(ctx context.Context, params *GetVerifiedAccessEndpointTargetsInput, optFns ...func(*Options)) (*GetVerifiedAccessEndpointTargetsOutput, error) { - if params == nil { - params = &GetVerifiedAccessEndpointTargetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVerifiedAccessEndpointTargets", params, optFns, c.addOperationGetVerifiedAccessEndpointTargetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVerifiedAccessEndpointTargetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVerifiedAccessEndpointTargetsInput struct { - - // The ID of the network CIDR endpoint. - // - // This member is required. - VerifiedAccessEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type GetVerifiedAccessEndpointTargetsOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // The Verified Access targets. - VerifiedAccessEndpointTargets []types.VerifiedAccessEndpointTarget - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVerifiedAccessEndpointTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVerifiedAccessEndpointTargets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVerifiedAccessEndpointTargets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVerifiedAccessEndpointTargets"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetVerifiedAccessEndpointTargetsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVerifiedAccessEndpointTargets(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetVerifiedAccessEndpointTargets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVerifiedAccessEndpointTargets", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessGroupPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessGroupPolicy.go deleted file mode 100644 index eb2bca1d5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVerifiedAccessGroupPolicy.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Shows the contents of the Verified Access policy associated with the group. -func (c *Client) GetVerifiedAccessGroupPolicy(ctx context.Context, params *GetVerifiedAccessGroupPolicyInput, optFns ...func(*Options)) (*GetVerifiedAccessGroupPolicyOutput, error) { - if params == nil { - params = &GetVerifiedAccessGroupPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVerifiedAccessGroupPolicy", params, optFns, c.addOperationGetVerifiedAccessGroupPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVerifiedAccessGroupPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVerifiedAccessGroupPolicyInput struct { - - // The ID of the Verified Access group. - // - // This member is required. - VerifiedAccessGroupId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetVerifiedAccessGroupPolicyOutput struct { - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVerifiedAccessGroupPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVerifiedAccessGroupPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVerifiedAccessGroupPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetVerifiedAccessGroupPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVerifiedAccessGroupPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetVerifiedAccessGroupPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVerifiedAccessGroupPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceSampleConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceSampleConfiguration.go deleted file mode 100644 index a300f935e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceSampleConfiguration.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Download an Amazon Web Services-provided sample configuration file to be used -// with the customer gateway device specified for your Site-to-Site VPN connection. -func (c *Client) GetVpnConnectionDeviceSampleConfiguration(ctx context.Context, params *GetVpnConnectionDeviceSampleConfigurationInput, optFns ...func(*Options)) (*GetVpnConnectionDeviceSampleConfigurationOutput, error) { - if params == nil { - params = &GetVpnConnectionDeviceSampleConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVpnConnectionDeviceSampleConfiguration", params, optFns, c.addOperationGetVpnConnectionDeviceSampleConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVpnConnectionDeviceSampleConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVpnConnectionDeviceSampleConfigurationInput struct { - - // Device identifier provided by the GetVpnConnectionDeviceTypes API. - // - // This member is required. - VpnConnectionDeviceTypeId *string - - // The VpnConnectionId specifies the Site-to-Site VPN connection used for the - // sample configuration. - // - // This member is required. - VpnConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IKE version to be used in the sample configuration file for your customer - // gateway device. You can specify one of the following versions: ikev1 or ikev2 . - InternetKeyExchangeVersion *string - - // The type of sample configuration to generate. Valid values are "compatibility" - // (includes IKEv1) or "recommended" (throws UnsupportedOperationException for - // IKEv1). - SampleType *string - - noSmithyDocumentSerde -} - -type GetVpnConnectionDeviceSampleConfigurationOutput struct { - - // Sample configuration file for the specified customer gateway device. - VpnConnectionDeviceSampleConfiguration *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVpnConnectionDeviceSampleConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVpnConnectionDeviceSampleConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVpnConnectionDeviceSampleConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetVpnConnectionDeviceSampleConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVpnConnectionDeviceSampleConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetVpnConnectionDeviceSampleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVpnConnectionDeviceSampleConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceTypes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceTypes.go deleted file mode 100644 index 8212f0c21..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnConnectionDeviceTypes.go +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Obtain a list of customer gateway devices for which sample configuration files -// can be provided. The request has no additional parameters. You can also see the -// list of device types with sample configuration files available under [Your customer gateway device]in the -// Amazon Web Services Site-to-Site VPN User Guide. -// -// [Your customer gateway device]: https://docs.aws.amazon.com/vpn/latest/s2svpn/your-cgw.html -func (c *Client) GetVpnConnectionDeviceTypes(ctx context.Context, params *GetVpnConnectionDeviceTypesInput, optFns ...func(*Options)) (*GetVpnConnectionDeviceTypesOutput, error) { - if params == nil { - params = &GetVpnConnectionDeviceTypesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVpnConnectionDeviceTypes", params, optFns, c.addOperationGetVpnConnectionDeviceTypesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVpnConnectionDeviceTypesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVpnConnectionDeviceTypesInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of results returned by GetVpnConnectionDeviceTypes in - // paginated output. When this parameter is used, GetVpnConnectionDeviceTypes only - // returns MaxResults results in a single page along with a NextToken response - // element. The remaining results of the initial request can be seen by sending - // another GetVpnConnectionDeviceTypes request with the returned NextToken value. - // This value can be between 200 and 1000. If this parameter is not used, then - // GetVpnConnectionDeviceTypes returns all results. - MaxResults *int32 - - // The NextToken value returned from a previous paginated - // GetVpnConnectionDeviceTypes request where MaxResults was used and the results - // exceeded the value of that parameter. Pagination continues from the end of the - // previous results that returned the NextToken value. This value is null when - // there are no more results to return. - NextToken *string - - noSmithyDocumentSerde -} - -type GetVpnConnectionDeviceTypesOutput struct { - - // The NextToken value to include in a future GetVpnConnectionDeviceTypes request. - // When the results of a GetVpnConnectionDeviceTypes request exceed MaxResults , - // this value can be used to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string - - // List of customer gateway devices that have a sample configuration file - // available for use. - VpnConnectionDeviceTypes []types.VpnConnectionDeviceType - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVpnConnectionDeviceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVpnConnectionDeviceTypes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVpnConnectionDeviceTypes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVpnConnectionDeviceTypes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVpnConnectionDeviceTypes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// GetVpnConnectionDeviceTypesPaginatorOptions is the paginator options for -// GetVpnConnectionDeviceTypes -type GetVpnConnectionDeviceTypesPaginatorOptions struct { - // The maximum number of results returned by GetVpnConnectionDeviceTypes in - // paginated output. When this parameter is used, GetVpnConnectionDeviceTypes only - // returns MaxResults results in a single page along with a NextToken response - // element. The remaining results of the initial request can be seen by sending - // another GetVpnConnectionDeviceTypes request with the returned NextToken value. - // This value can be between 200 and 1000. If this parameter is not used, then - // GetVpnConnectionDeviceTypes returns all results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetVpnConnectionDeviceTypesPaginator is a paginator for -// GetVpnConnectionDeviceTypes -type GetVpnConnectionDeviceTypesPaginator struct { - options GetVpnConnectionDeviceTypesPaginatorOptions - client GetVpnConnectionDeviceTypesAPIClient - params *GetVpnConnectionDeviceTypesInput - nextToken *string - firstPage bool -} - -// NewGetVpnConnectionDeviceTypesPaginator returns a new -// GetVpnConnectionDeviceTypesPaginator -func NewGetVpnConnectionDeviceTypesPaginator(client GetVpnConnectionDeviceTypesAPIClient, params *GetVpnConnectionDeviceTypesInput, optFns ...func(*GetVpnConnectionDeviceTypesPaginatorOptions)) *GetVpnConnectionDeviceTypesPaginator { - if params == nil { - params = &GetVpnConnectionDeviceTypesInput{} - } - - options := GetVpnConnectionDeviceTypesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetVpnConnectionDeviceTypesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetVpnConnectionDeviceTypesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetVpnConnectionDeviceTypes page. -func (p *GetVpnConnectionDeviceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetVpnConnectionDeviceTypesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetVpnConnectionDeviceTypes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetVpnConnectionDeviceTypesAPIClient is a client that implements the -// GetVpnConnectionDeviceTypes operation. -type GetVpnConnectionDeviceTypesAPIClient interface { - GetVpnConnectionDeviceTypes(context.Context, *GetVpnConnectionDeviceTypesInput, ...func(*Options)) (*GetVpnConnectionDeviceTypesOutput, error) -} - -var _ GetVpnConnectionDeviceTypesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetVpnConnectionDeviceTypes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVpnConnectionDeviceTypes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnTunnelReplacementStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnTunnelReplacementStatus.go deleted file mode 100644 index a55e3d9b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_GetVpnTunnelReplacementStatus.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get details of available tunnel endpoint maintenance. -func (c *Client) GetVpnTunnelReplacementStatus(ctx context.Context, params *GetVpnTunnelReplacementStatusInput, optFns ...func(*Options)) (*GetVpnTunnelReplacementStatusOutput, error) { - if params == nil { - params = &GetVpnTunnelReplacementStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetVpnTunnelReplacementStatus", params, optFns, c.addOperationGetVpnTunnelReplacementStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetVpnTunnelReplacementStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetVpnTunnelReplacementStatusInput struct { - - // The ID of the Site-to-Site VPN connection. - // - // This member is required. - VpnConnectionId *string - - // The external IP address of the VPN tunnel. - // - // This member is required. - VpnTunnelOutsideIpAddress *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type GetVpnTunnelReplacementStatusOutput struct { - - // The ID of the customer gateway. - CustomerGatewayId *string - - // Get details of pending tunnel endpoint maintenance. - MaintenanceDetails *types.MaintenanceDetails - - // The ID of the transit gateway associated with the VPN connection. - TransitGatewayId *string - - // The ID of the Site-to-Site VPN connection. - VpnConnectionId *string - - // The ID of the virtual private gateway. - VpnGatewayId *string - - // The external IP address of the VPN tunnel. - VpnTunnelOutsideIpAddress *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetVpnTunnelReplacementStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpGetVpnTunnelReplacementStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVpnTunnelReplacementStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetVpnTunnelReplacementStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetVpnTunnelReplacementStatusValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVpnTunnelReplacementStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetVpnTunnelReplacementStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetVpnTunnelReplacementStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportClientVpnClientCertificateRevocationList.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportClientVpnClientCertificateRevocationList.go deleted file mode 100644 index f5ff8033d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportClientVpnClientCertificateRevocationList.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Uploads a client certificate revocation list to the specified Client VPN -// endpoint. Uploading a client certificate revocation list overwrites the existing -// client certificate revocation list. -// -// Uploading a client certificate revocation list resets existing client -// connections. -func (c *Client) ImportClientVpnClientCertificateRevocationList(ctx context.Context, params *ImportClientVpnClientCertificateRevocationListInput, optFns ...func(*Options)) (*ImportClientVpnClientCertificateRevocationListOutput, error) { - if params == nil { - params = &ImportClientVpnClientCertificateRevocationListInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportClientVpnClientCertificateRevocationList", params, optFns, c.addOperationImportClientVpnClientCertificateRevocationListMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportClientVpnClientCertificateRevocationListOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportClientVpnClientCertificateRevocationListInput struct { - - // The client certificate revocation list file. For more information, see [Generate a Client Certificate Revocation List] in the - // Client VPN Administrator Guide. - // - // [Generate a Client Certificate Revocation List]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-certificates.html#cvpn-working-certificates-generate - // - // This member is required. - CertificateRevocationList *string - - // The ID of the Client VPN endpoint to which the client certificate revocation - // list applies. - // - // This member is required. - ClientVpnEndpointId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ImportClientVpnClientCertificateRevocationListOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportClientVpnClientCertificateRevocationListMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportClientVpnClientCertificateRevocationList{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportClientVpnClientCertificateRevocationList"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpImportClientVpnClientCertificateRevocationListValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportClientVpnClientCertificateRevocationList(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportClientVpnClientCertificateRevocationList(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportClientVpnClientCertificateRevocationList", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportImage.go deleted file mode 100644 index 92bb8b38a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportImage.go +++ /dev/null @@ -1,325 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// To import your virtual machines (VMs) with a console-based experience, you can -// use the Import virtual machine images to Amazon Web Services template in the [Migration Hub Orchestrator console]. -// For more information, see the [Migration Hub Orchestrator User Guide]. -// -// Import single or multi-volume disk images or EBS snapshots into an Amazon -// Machine Image (AMI). -// -// Amazon Web Services VM Import/Export strongly recommends specifying a value for -// either the --license-type or --usage-operation parameter when you create a new -// VM Import task. This ensures your operating system is licensed appropriately and -// your billing is optimized. -// -// For more information, see [Importing a VM as an image using VM Import/Export] in the VM Import/Export User Guide. -// -// [Migration Hub Orchestrator console]: https://console.aws.amazon.com/migrationhub/orchestrator -// [Importing a VM as an image using VM Import/Export]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html -// [Migration Hub Orchestrator User Guide]: https://docs.aws.amazon.com/migrationhub-orchestrator/latest/userguide/import-vm-images.html -func (c *Client) ImportImage(ctx context.Context, params *ImportImageInput, optFns ...func(*Options)) (*ImportImageOutput, error) { - if params == nil { - params = &ImportImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportImage", params, optFns, c.addOperationImportImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportImageInput struct { - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 - Architecture *string - - // The boot mode of the virtual machine. - // - // The uefi-preferred boot mode isn't supported for importing images. For more - // information, see [Boot modes]in the VM Import/Export User Guide. - // - // [Boot modes]: https://docs.aws.amazon.com/vm-import/latest/userguide/prerequisites.html#vmimport-boot-modes - BootMode types.BootModeValues - - // The client-specific data. - ClientData *types.ClientData - - // The token to enable idempotency for VM import requests. - ClientToken *string - - // A description string for the import image task. - Description *string - - // Information about the disk containers. - DiskContainers []types.ImageDiskContainer - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether the destination AMI of the imported image should be - // encrypted. The default KMS key for EBS is used unless you specify a non-default - // KMS key using KmsKeyId . For more information, see [Amazon EBS Encryption] in the Amazon Elastic - // Compute Cloud User Guide. - // - // [Amazon EBS Encryption]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html - Encrypted *bool - - // The target hypervisor platform. - // - // Valid values: xen - Hypervisor *string - - // An identifier for the symmetric KMS key to use when creating the encrypted AMI. - // This parameter is only required if you want to use a non-default KMS key; if - // this parameter is not specified, the default KMS key for EBS is used. If a - // KmsKeyId is specified, the Encrypted flag must also be set. - // - // The KMS key identifier may be provided in any of the following formats: - // - // - Key ID - // - // - Key alias - // - // - ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by - // the Region of the key, the Amazon Web Services account ID of the key owner, the - // key namespace, and then the key ID. For example, - // arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // - ARN using key alias. The alias ARN contains the arn:aws:kms namespace, - // followed by the Region of the key, the Amazon Web Services account ID of the key - // owner, the alias namespace, and then the key alias. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you - // call may appear to complete even though you provided an invalid identifier. This - // action will eventually report failure. - // - // The specified KMS key must exist in the Region that the AMI is being copied to. - // - // Amazon EBS does not support asymmetric KMS keys. - KmsKeyId *string - - // The ARNs of the license configurations. - LicenseSpecifications []types.ImportImageLicenseConfigurationRequest - - // The license type to be used for the Amazon Machine Image (AMI) after importing. - // - // Specify AWS to replace the source-system license with an Amazon Web Services - // license or BYOL to retain the source-system license. Leaving this parameter - // undefined is the same as choosing AWS when importing a Windows Server operating - // system, and the same as choosing BYOL when importing a Windows client operating - // system (such as Windows 10) or a Linux operating system. - // - // To use BYOL , you must have existing licenses with rights to use these licenses - // in a third party cloud, such as Amazon Web Services. For more information, see [Prerequisites] - // in the VM Import/Export User Guide. - // - // [Prerequisites]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#prerequisites-image - LicenseType *string - - // The operating system of the virtual machine. If you import a VM that is - // compatible with Unified Extensible Firmware Interface (UEFI) using an EBS - // snapshot, you must specify a value for the platform. - // - // Valid values: Windows | Linux - Platform *string - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string - - // The tags to apply to the import image task during creation. - TagSpecifications []types.TagSpecification - - // The usage operation value. For more information, see [Licensing options] in the VM Import/Export - // User Guide. - // - // [Licensing options]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#prerequisites - UsageOperation *string - - noSmithyDocumentSerde -} - -type ImportImageOutput struct { - - // The architecture of the virtual machine. - Architecture *string - - // A description of the import task. - Description *string - - // Indicates whether the AMI is encrypted. - Encrypted *bool - - // The target hypervisor of the import task. - Hypervisor *string - - // The ID of the Amazon Machine Image (AMI) created by the import task. - ImageId *string - - // The task ID of the import image task. - ImportTaskId *string - - // The identifier for the symmetric KMS key that was used to create the encrypted - // AMI. - KmsKeyId *string - - // The ARNs of the license configurations. - LicenseSpecifications []types.ImportImageLicenseConfigurationResponse - - // The license type of the virtual machine. - LicenseType *string - - // The operating system of the virtual machine. - Platform *string - - // The progress of the task. - Progress *string - - // Information about the snapshots. - SnapshotDetails []types.SnapshotDetail - - // A brief status of the task. - Status *string - - // A detailed status message of the import task. - StatusMessage *string - - // Any tags assigned to the import image task. - Tags []types.Tag - - // The usage operation value. - UsageOperation *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportInstance.go deleted file mode 100644 index 2f95e9140..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportInstance.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// We recommend that you use the [ImportImage]ImportImage API instead. For more information, -// see [Importing a VM as an image using VM Import/Export]in the VM Import/Export User Guide. -// -// Creates an import instance task using metadata from the specified disk image. -// -// This API action supports only single-volume VMs. To import multi-volume VMs, -// use ImportImageinstead. -// -// For information about the import manifest referenced by this API action, see [VM Import Manifest]. -// -// This API action is not supported by the Command Line Interface (CLI). -// -// [Importing a VM as an image using VM Import/Export]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html -// [ImportImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportImage.html -// [VM Import Manifest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html -func (c *Client) ImportInstance(ctx context.Context, params *ImportInstanceInput, optFns ...func(*Options)) (*ImportInstanceOutput, error) { - if params == nil { - params = &ImportInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportInstance", params, optFns, c.addOperationImportInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportInstanceInput struct { - - // The instance operating system. - // - // This member is required. - Platform types.PlatformValues - - // A description for the instance being imported. - Description *string - - // The disk image. - DiskImages []types.DiskImage - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The launch specification. - LaunchSpecification *types.ImportInstanceLaunchSpecification - - noSmithyDocumentSerde -} - -type ImportInstanceOutput struct { - - // Information about the conversion task. - ConversionTask *types.ConversionTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpImportInstanceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportKeyPair.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportKeyPair.go deleted file mode 100644 index aa86e1013..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportKeyPair.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Imports the public key from an RSA or ED25519 key pair that you created using a -// third-party tool. You give Amazon Web Services only the public key. The private -// key is never transferred between you and Amazon Web Services. -// -// For more information about the requirements for importing a key pair, see [Create a key pair and import the public key to Amazon EC2] in -// the Amazon EC2 User Guide. -// -// [Create a key pair and import the public key to Amazon EC2]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws -func (c *Client) ImportKeyPair(ctx context.Context, params *ImportKeyPairInput, optFns ...func(*Options)) (*ImportKeyPairOutput, error) { - if params == nil { - params = &ImportKeyPairInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportKeyPair", params, optFns, c.addOperationImportKeyPairMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportKeyPairOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportKeyPairInput struct { - - // A unique name for the key pair. - // - // This member is required. - KeyName *string - - // The public key. - // - // This member is required. - PublicKeyMaterial []byte - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the imported key pair. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type ImportKeyPairOutput struct { - - // - For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as - // specified in section 4 of RFC 4716. - // - // - For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 - // digest, which is the default for OpenSSH, starting with [OpenSSH 6.8]. - // - // [OpenSSH 6.8]: http://www.openssh.com/txt/release-6.8 - KeyFingerprint *string - - // The key pair name that you provided. - KeyName *string - - // The ID of the resulting key pair. - KeyPairId *string - - // The tags applied to the imported key pair. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportKeyPairMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportKeyPair{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportKeyPair{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportKeyPair"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpImportKeyPairValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportKeyPair(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportKeyPair(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportKeyPair", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportSnapshot.go deleted file mode 100644 index f2219bf88..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportSnapshot.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Imports a disk into an EBS snapshot. -// -// For more information, see [Importing a disk as a snapshot using VM Import/Export] in the VM Import/Export User Guide. -// -// [Importing a disk as a snapshot using VM Import/Export]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-import-snapshot.html -func (c *Client) ImportSnapshot(ctx context.Context, params *ImportSnapshotInput, optFns ...func(*Options)) (*ImportSnapshotOutput, error) { - if params == nil { - params = &ImportSnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportSnapshot", params, optFns, c.addOperationImportSnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportSnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportSnapshotInput struct { - - // The client-specific data. - ClientData *types.ClientData - - // Token to enable idempotency for VM import requests. - ClientToken *string - - // The description string for the import snapshot task. - Description *string - - // Information about the disk container. - DiskContainer *types.SnapshotDiskContainer - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether the destination snapshot of the imported image should be - // encrypted. The default KMS key for EBS is used unless you specify a non-default - // KMS key using KmsKeyId . For more information, see [Amazon EBS Encryption] in the Amazon Elastic - // Compute Cloud User Guide. - // - // [Amazon EBS Encryption]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html - Encrypted *bool - - // An identifier for the symmetric KMS key to use when creating the encrypted - // snapshot. This parameter is only required if you want to use a non-default KMS - // key; if this parameter is not specified, the default KMS key for EBS is used. If - // a KmsKeyId is specified, the Encrypted flag must also be set. - // - // The KMS key identifier may be provided in any of the following formats: - // - // - Key ID - // - // - Key alias - // - // - ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by - // the Region of the key, the Amazon Web Services account ID of the key owner, the - // key namespace, and then the key ID. For example, - // arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // - ARN using key alias. The alias ARN contains the arn:aws:kms namespace, - // followed by the Region of the key, the Amazon Web Services account ID of the key - // owner, the alias namespace, and then the key alias. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you - // call may appear to complete even though you provided an invalid identifier. This - // action will eventually report failure. - // - // The specified KMS key must exist in the Region that the snapshot is being - // copied to. - // - // Amazon EBS does not support asymmetric KMS keys. - KmsKeyId *string - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string - - // The tags to apply to the import snapshot task during creation. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type ImportSnapshotOutput struct { - - // A description of the import snapshot task. - Description *string - - // The ID of the import snapshot task. - ImportTaskId *string - - // Information about the import snapshot task. - SnapshotTaskDetail *types.SnapshotTaskDetail - - // Any tags assigned to the import snapshot task. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportSnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportSnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportSnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportSnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportSnapshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportVolume.go deleted file mode 100644 index a079c4f95..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ImportVolume.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This API action supports only single-volume VMs. To import multi-volume VMs, -// use ImportImageinstead. To import a disk to a snapshot, use ImportSnapshot instead. -// -// Creates an import volume task using metadata from the specified disk image. -// -// For information about the import manifest referenced by this API action, see [VM Import Manifest]. -// -// This API action is not supported by the Command Line Interface (CLI). -// -// [VM Import Manifest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html -func (c *Client) ImportVolume(ctx context.Context, params *ImportVolumeInput, optFns ...func(*Options)) (*ImportVolumeOutput, error) { - if params == nil { - params = &ImportVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ImportVolume", params, optFns, c.addOperationImportVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ImportVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ImportVolumeInput struct { - - // The Availability Zone for the resulting EBS volume. - // - // This member is required. - AvailabilityZone *string - - // The disk image. - // - // This member is required. - Image *types.DiskImageDetail - - // The volume size. - // - // This member is required. - Volume *types.VolumeDetail - - // A description of the volume. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ImportVolumeOutput struct { - - // Information about the conversion task. - ConversionTask *types.ConversionTask - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationImportVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpImportVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpImportVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ImportVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpImportVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opImportVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ImportVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListImagesInRecycleBin.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListImagesInRecycleBin.go deleted file mode 100644 index 274d87e22..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListImagesInRecycleBin.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists one or more AMIs that are currently in the Recycle Bin. For more -// information, see [Recycle Bin]in the Amazon EC2 User Guide. -// -// [Recycle Bin]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin.html -func (c *Client) ListImagesInRecycleBin(ctx context.Context, params *ListImagesInRecycleBinInput, optFns ...func(*Options)) (*ListImagesInRecycleBinOutput, error) { - if params == nil { - params = &ListImagesInRecycleBinInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListImagesInRecycleBin", params, optFns, c.addOperationListImagesInRecycleBinMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListImagesInRecycleBinOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListImagesInRecycleBinInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of the AMIs to list. Omit this parameter to list all of the AMIs that - // are in the Recycle Bin. You can specify up to 20 IDs in a single request. - ImageIds []string - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - noSmithyDocumentSerde -} - -type ListImagesInRecycleBinOutput struct { - - // Information about the AMIs. - Images []types.ImageRecycleBinInfo - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListImagesInRecycleBinMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpListImagesInRecycleBin{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpListImagesInRecycleBin{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListImagesInRecycleBin"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImagesInRecycleBin(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListImagesInRecycleBinPaginatorOptions is the paginator options for -// ListImagesInRecycleBin -type ListImagesInRecycleBinPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListImagesInRecycleBinPaginator is a paginator for ListImagesInRecycleBin -type ListImagesInRecycleBinPaginator struct { - options ListImagesInRecycleBinPaginatorOptions - client ListImagesInRecycleBinAPIClient - params *ListImagesInRecycleBinInput - nextToken *string - firstPage bool -} - -// NewListImagesInRecycleBinPaginator returns a new ListImagesInRecycleBinPaginator -func NewListImagesInRecycleBinPaginator(client ListImagesInRecycleBinAPIClient, params *ListImagesInRecycleBinInput, optFns ...func(*ListImagesInRecycleBinPaginatorOptions)) *ListImagesInRecycleBinPaginator { - if params == nil { - params = &ListImagesInRecycleBinInput{} - } - - options := ListImagesInRecycleBinPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListImagesInRecycleBinPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListImagesInRecycleBinPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListImagesInRecycleBin page. -func (p *ListImagesInRecycleBinPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesInRecycleBinOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListImagesInRecycleBin(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListImagesInRecycleBinAPIClient is a client that implements the -// ListImagesInRecycleBin operation. -type ListImagesInRecycleBinAPIClient interface { - ListImagesInRecycleBin(context.Context, *ListImagesInRecycleBinInput, ...func(*Options)) (*ListImagesInRecycleBinOutput, error) -} - -var _ ListImagesInRecycleBinAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListImagesInRecycleBin(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListImagesInRecycleBin", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListSnapshotsInRecycleBin.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListSnapshotsInRecycleBin.go deleted file mode 100644 index 34fc82851..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ListSnapshotsInRecycleBin.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists one or more snapshots that are currently in the Recycle Bin. -func (c *Client) ListSnapshotsInRecycleBin(ctx context.Context, params *ListSnapshotsInRecycleBinInput, optFns ...func(*Options)) (*ListSnapshotsInRecycleBinOutput, error) { - if params == nil { - params = &ListSnapshotsInRecycleBinInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListSnapshotsInRecycleBin", params, optFns, c.addOperationListSnapshotsInRecycleBinMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListSnapshotsInRecycleBinOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListSnapshotsInRecycleBinInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - MaxResults *int32 - - // The token returned from a previous paginated request. Pagination continues from - // the end of the items returned by the previous request. - NextToken *string - - // The IDs of the snapshots to list. Omit this parameter to list all of the - // snapshots that are in the Recycle Bin. - SnapshotIds []string - - noSmithyDocumentSerde -} - -type ListSnapshotsInRecycleBinOutput struct { - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string - - // Information about the snapshots. - Snapshots []types.SnapshotRecycleBinInfo - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListSnapshotsInRecycleBinMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpListSnapshotsInRecycleBin{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpListSnapshotsInRecycleBin{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListSnapshotsInRecycleBin"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSnapshotsInRecycleBin(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListSnapshotsInRecycleBinPaginatorOptions is the paginator options for -// ListSnapshotsInRecycleBin -type ListSnapshotsInRecycleBinPaginatorOptions struct { - // The maximum number of items to return for this request. To get the next page of - // items, make another request with the token returned in the output. For more - // information, see [Pagination]. - // - // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListSnapshotsInRecycleBinPaginator is a paginator for ListSnapshotsInRecycleBin -type ListSnapshotsInRecycleBinPaginator struct { - options ListSnapshotsInRecycleBinPaginatorOptions - client ListSnapshotsInRecycleBinAPIClient - params *ListSnapshotsInRecycleBinInput - nextToken *string - firstPage bool -} - -// NewListSnapshotsInRecycleBinPaginator returns a new -// ListSnapshotsInRecycleBinPaginator -func NewListSnapshotsInRecycleBinPaginator(client ListSnapshotsInRecycleBinAPIClient, params *ListSnapshotsInRecycleBinInput, optFns ...func(*ListSnapshotsInRecycleBinPaginatorOptions)) *ListSnapshotsInRecycleBinPaginator { - if params == nil { - params = &ListSnapshotsInRecycleBinInput{} - } - - options := ListSnapshotsInRecycleBinPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListSnapshotsInRecycleBinPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListSnapshotsInRecycleBinPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListSnapshotsInRecycleBin page. -func (p *ListSnapshotsInRecycleBinPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSnapshotsInRecycleBinOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListSnapshotsInRecycleBin(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListSnapshotsInRecycleBinAPIClient is a client that implements the -// ListSnapshotsInRecycleBin operation. -type ListSnapshotsInRecycleBinAPIClient interface { - ListSnapshotsInRecycleBin(context.Context, *ListSnapshotsInRecycleBinInput, ...func(*Options)) (*ListSnapshotsInRecycleBinOutput, error) -} - -var _ ListSnapshotsInRecycleBinAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListSnapshotsInRecycleBin(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListSnapshotsInRecycleBin", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_LockSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_LockSnapshot.go deleted file mode 100644 index 682fe3e19..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_LockSnapshot.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Locks an Amazon EBS snapshot in either governance or compliance mode to protect -// it against accidental or malicious deletions for a specific duration. A locked -// snapshot can't be deleted. -// -// You can also use this action to modify the lock settings for a snapshot that is -// already locked. The allowed modifications depend on the lock mode and lock -// state: -// -// - If the snapshot is locked in governance mode, you can modify the lock mode -// and the lock duration or lock expiration date. -// -// - If the snapshot is locked in compliance mode and it is in the cooling-off -// period, you can modify the lock mode and the lock duration or lock expiration -// date. -// -// - If the snapshot is locked in compliance mode and the cooling-off period has -// lapsed, you can only increase the lock duration or extend the lock expiration -// date. -func (c *Client) LockSnapshot(ctx context.Context, params *LockSnapshotInput, optFns ...func(*Options)) (*LockSnapshotOutput, error) { - if params == nil { - params = &LockSnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "LockSnapshot", params, optFns, c.addOperationLockSnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*LockSnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type LockSnapshotInput struct { - - // The mode in which to lock the snapshot. Specify one of the following: - // - // - governance - Locks the snapshot in governance mode. Snapshots locked in - // governance mode can't be deleted until one of the following conditions are met: - // - // - The lock duration expires. - // - // - The snapshot is unlocked by a user with the appropriate permissions. - // - // Users with the appropriate IAM permissions can unlock the snapshot, increase or - // decrease the lock duration, and change the lock mode to compliance at any time. - // - // If you lock a snapshot in governance mode, omit CoolOffPeriod. - // - // - compliance - Locks the snapshot in compliance mode. Snapshots locked in - // compliance mode can't be unlocked by any user. They can be deleted only after - // the lock duration expires. Users can't decrease the lock duration or change the - // lock mode to governance . However, users with appropriate IAM permissions can - // increase the lock duration at any time. - // - // If you lock a snapshot in compliance mode, you can optionally specify - // CoolOffPeriod. - // - // This member is required. - LockMode types.LockMode - - // The ID of the snapshot to lock. - // - // This member is required. - SnapshotId *string - - // The cooling-off period during which you can unlock the snapshot or modify the - // lock settings after locking the snapshot in compliance mode, in hours. After the - // cooling-off period expires, you can't unlock or delete the snapshot, decrease - // the lock duration, or change the lock mode. You can increase the lock duration - // after the cooling-off period expires. - // - // The cooling-off period is optional when locking a snapshot in compliance mode. - // If you are locking the snapshot in governance mode, omit this parameter. - // - // To lock the snapshot in compliance mode immediately without a cooling-off - // period, omit this parameter. - // - // If you are extending the lock duration for a snapshot that is locked in - // compliance mode after the cooling-off period has expired, omit this parameter. - // If you specify a cooling-period in a such a request, the request fails. - // - // Allowed values: Min 1, max 72. - CoolOffPeriod *int32 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The date and time at which the snapshot lock is to automatically expire, in the - // UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ ). - // - // You must specify either this parameter or LockDuration, but not both. - ExpirationDate *time.Time - - // The period of time for which to lock the snapshot, in days. The snapshot lock - // will automatically expire after this period lapses. - // - // You must specify either this parameter or ExpirationDate, but not both. - // - // Allowed values: Min: 1, max 36500 - LockDuration *int32 - - noSmithyDocumentSerde -} - -type LockSnapshotOutput struct { - - // The compliance mode cooling-off period, in hours. - CoolOffPeriod *int32 - - // The date and time at which the compliance mode cooling-off period expires, in - // the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ ). - CoolOffPeriodExpiresOn *time.Time - - // The date and time at which the snapshot was locked, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - LockCreatedOn *time.Time - - // The period of time for which the snapshot is locked, in days. - LockDuration *int32 - - // The date and time at which the lock duration started, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - LockDurationStartTime *time.Time - - // The date and time at which the lock will expire, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - LockExpiresOn *time.Time - - // The state of the snapshot lock. Valid states include: - // - // - compliance-cooloff - The snapshot has been locked in compliance mode but it - // is still within the cooling-off period. The snapshot can't be deleted, but it - // can be unlocked and the lock settings can be modified by users with appropriate - // permissions. - // - // - governance - The snapshot is locked in governance mode. The snapshot can't - // be deleted, but it can be unlocked and the lock settings can be modified by - // users with appropriate permissions. - // - // - compliance - The snapshot is locked in compliance mode and the cooling-off - // period has expired. The snapshot can't be unlocked or deleted. The lock duration - // can only be increased by users with appropriate permissions. - // - // - expired - The snapshot was locked in compliance or governance mode but the - // lock duration has expired. The snapshot is not locked and can be deleted. - LockState types.LockState - - // The ID of the snapshot - SnapshotId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationLockSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpLockSnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpLockSnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "LockSnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpLockSnapshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLockSnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opLockSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "LockSnapshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAddressAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAddressAttribute.go deleted file mode 100644 index 84f8863e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAddressAttribute.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies an attribute of the specified Elastic IP address. For requirements, -// see [Using reverse DNS for email applications]. -// -// [Using reverse DNS for email applications]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS -func (c *Client) ModifyAddressAttribute(ctx context.Context, params *ModifyAddressAttributeInput, optFns ...func(*Options)) (*ModifyAddressAttributeOutput, error) { - if params == nil { - params = &ModifyAddressAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyAddressAttribute", params, optFns, c.addOperationModifyAddressAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyAddressAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyAddressAttributeInput struct { - - // [EC2-VPC] The allocation ID. - // - // This member is required. - AllocationId *string - - // The domain name to modify for the IP address. - DomainName *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyAddressAttributeOutput struct { - - // Information about the Elastic IP address. - Address *types.AddressAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyAddressAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyAddressAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyAddressAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyAddressAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyAddressAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyAddressAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyAddressAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyAddressAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAvailabilityZoneGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAvailabilityZoneGroup.go deleted file mode 100644 index afb33c524..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyAvailabilityZoneGroup.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Changes the opt-in status of the specified zone group for your account. -func (c *Client) ModifyAvailabilityZoneGroup(ctx context.Context, params *ModifyAvailabilityZoneGroupInput, optFns ...func(*Options)) (*ModifyAvailabilityZoneGroupOutput, error) { - if params == nil { - params = &ModifyAvailabilityZoneGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyAvailabilityZoneGroup", params, optFns, c.addOperationModifyAvailabilityZoneGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyAvailabilityZoneGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyAvailabilityZoneGroupInput struct { - - // The name of the Availability Zone group, Local Zone group, or Wavelength Zone - // group. - // - // This member is required. - GroupName *string - - // Indicates whether to opt in to the zone group. The only valid value is opted-in - // . You must contact Amazon Web Services Support to opt out of a Local Zone or - // Wavelength Zone group. - // - // This member is required. - OptInStatus types.ModifyAvailabilityZoneOptInStatus - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyAvailabilityZoneGroupOutput struct { - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyAvailabilityZoneGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyAvailabilityZoneGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyAvailabilityZoneGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyAvailabilityZoneGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyAvailabilityZoneGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyAvailabilityZoneGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyAvailabilityZoneGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyAvailabilityZoneGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservation.go deleted file mode 100644 index b0087674b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservation.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Modifies a Capacity Reservation's capacity, instance eligibility, and the -// conditions under which it is to be released. You can't modify a Capacity -// Reservation's instance type, EBS optimization, platform, instance store -// settings, Availability Zone, or tenancy. If you need to modify any of these -// attributes, we recommend that you cancel the Capacity Reservation, and then -// create a new one with the required attributes. For more information, see [Modify an active Capacity Reservation]. -// -// The allowed modifications depend on the state of the Capacity Reservation: -// -// - assessing or scheduled state - You can modify the tags only. -// -// - pending state - You can't modify the Capacity Reservation in any way. -// -// - active state but still within the commitment duration - You can't decrease -// the instance count or set an end date that is within the commitment duration. -// All other modifications are allowed. -// -// - active state with no commitment duration or elapsed commitment duration - -// All modifications are allowed. -// -// - expired , cancelled , unsupported , or failed state - You can't modify the -// Capacity Reservation in any way. -// -// [Modify an active Capacity Reservation]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-modify.html -func (c *Client) ModifyCapacityReservation(ctx context.Context, params *ModifyCapacityReservationInput, optFns ...func(*Options)) (*ModifyCapacityReservationOutput, error) { - if params == nil { - params = &ModifyCapacityReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyCapacityReservation", params, optFns, c.addOperationModifyCapacityReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyCapacityReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyCapacityReservationInput struct { - - // The ID of the Capacity Reservation. - // - // This member is required. - CapacityReservationId *string - - // Reserved. Capacity Reservations you have created are accepted by default. - Accept *bool - - // Reserved for future use. - AdditionalInfo *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The date and time at which the Capacity Reservation expires. When a Capacity - // Reservation expires, the reserved capacity is released and you can no longer - // launch instances into it. The Capacity Reservation's state changes to expired - // when it reaches its end date and time. - // - // The Capacity Reservation is cancelled within an hour from the specified time. - // For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is - // guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019. - // - // You must provide an EndDate value if EndDateType is limited . Omit EndDate if - // EndDateType is unlimited . - EndDate *time.Time - - // Indicates the way in which the Capacity Reservation ends. A Capacity - // Reservation can have one of the following end types: - // - // - unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. Do not provide an EndDate value if EndDateType is unlimited . - // - // - limited - The Capacity Reservation expires automatically at a specified date - // and time. You must provide an EndDate value if EndDateType is limited . - EndDateType types.EndDateType - - // The number of instances for which to reserve capacity. The number of instances - // can't be increased or decreased by more than 1000 in a single request. - InstanceCount *int32 - - // The matching criteria (instance eligibility) that you want to use in the - // modified Capacity Reservation. If you change the instance eligibility of an - // existing Capacity Reservation from targeted to open , any running instances that - // match the attributes of the Capacity Reservation, have the - // CapacityReservationPreference set to open , and are not yet running in the - // Capacity Reservation, will automatically use the modified Capacity Reservation. - // - // To modify the instance eligibility, the Capacity Reservation must be completely - // idle (zero usage). - InstanceMatchCriteria types.InstanceMatchCriteria - - noSmithyDocumentSerde -} - -type ModifyCapacityReservationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyCapacityReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyCapacityReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyCapacityReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyCapacityReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyCapacityReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCapacityReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyCapacityReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservationFleet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservationFleet.go deleted file mode 100644 index 76bc192a8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyCapacityReservationFleet.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Modifies a Capacity Reservation Fleet. -// -// When you modify the total target capacity of a Capacity Reservation Fleet, the -// Fleet automatically creates new Capacity Reservations, or modifies or cancels -// existing Capacity Reservations in the Fleet to meet the new total target -// capacity. When you modify the end date for the Fleet, the end dates for all of -// the individual Capacity Reservations in the Fleet are updated accordingly. -func (c *Client) ModifyCapacityReservationFleet(ctx context.Context, params *ModifyCapacityReservationFleetInput, optFns ...func(*Options)) (*ModifyCapacityReservationFleetOutput, error) { - if params == nil { - params = &ModifyCapacityReservationFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyCapacityReservationFleet", params, optFns, c.addOperationModifyCapacityReservationFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyCapacityReservationFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyCapacityReservationFleetInput struct { - - // The ID of the Capacity Reservation Fleet to modify. - // - // This member is required. - CapacityReservationFleetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The date and time at which the Capacity Reservation Fleet expires. When the - // Capacity Reservation Fleet expires, its state changes to expired and all of the - // Capacity Reservations in the Fleet expire. - // - // The Capacity Reservation Fleet expires within an hour after the specified time. - // For example, if you specify 5/31/2019 , 13:30:55 , the Capacity Reservation - // Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019 . - // - // You can't specify EndDate and RemoveEndDate in the same request. - EndDate *time.Time - - // Indicates whether to remove the end date from the Capacity Reservation Fleet. - // If you remove the end date, the Capacity Reservation Fleet does not expire and - // it remains active until you explicitly cancel it using the - // CancelCapacityReservationFleet action. - // - // You can't specify RemoveEndDate and EndDate in the same request. - RemoveEndDate *bool - - // The total number of capacity units to be reserved by the Capacity Reservation - // Fleet. This value, together with the instance type weights that you assign to - // each instance type used by the Fleet determine the number of instances for which - // the Fleet reserves capacity. Both values are based on units that make sense for - // your workload. For more information, see [Total target capacity]in the Amazon EC2 User Guide. - // - // [Total target capacity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity - TotalTargetCapacity *int32 - - noSmithyDocumentSerde -} - -type ModifyCapacityReservationFleetOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyCapacityReservationFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyCapacityReservationFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyCapacityReservationFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyCapacityReservationFleet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyCapacityReservationFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCapacityReservationFleet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyCapacityReservationFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyCapacityReservationFleet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyClientVpnEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyClientVpnEndpoint.go deleted file mode 100644 index df4363418..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyClientVpnEndpoint.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Client VPN endpoint. Modifying the DNS server resets -// existing client connections. -func (c *Client) ModifyClientVpnEndpoint(ctx context.Context, params *ModifyClientVpnEndpointInput, optFns ...func(*Options)) (*ModifyClientVpnEndpointOutput, error) { - if params == nil { - params = &ModifyClientVpnEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyClientVpnEndpoint", params, optFns, c.addOperationModifyClientVpnEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyClientVpnEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyClientVpnEndpointInput struct { - - // The ID of the Client VPN endpoint to modify. - // - // This member is required. - ClientVpnEndpointId *string - - // The options for managing connection authorization for new client connections. - ClientConnectOptions *types.ClientConnectOptions - - // Options for enabling a customizable text banner that will be displayed on - // Amazon Web Services provided clients when a VPN session is established. - ClientLoginBannerOptions *types.ClientLoginBannerOptions - - // Client route enforcement is a feature of the Client VPN service that helps - // enforce administrator defined routes on devices connected through the VPN. T his - // feature helps improve your security posture by ensuring that network traffic - // originating from a connected client is not inadvertently sent outside the VPN - // tunnel. - // - // Client route enforcement works by monitoring the route table of a connected - // device for routing policy changes to the VPN connection. If the feature detects - // any VPN routing policy modifications, it will automatically force an update to - // the route table, reverting it back to the expected route configurations. - ClientRouteEnforcementOptions *types.ClientRouteEnforcementOptions - - // Information about the client connection logging options. - // - // If you enable client connection logging, data about client connections is sent - // to a Cloudwatch Logs log stream. The following information is logged: - // - // - Client connection requests - // - // - Client connection results (successful and unsuccessful) - // - // - Reasons for unsuccessful client connection requests - // - // - Client connection termination time - ConnectionLogOptions *types.ConnectionLogOptions - - // A brief description of the Client VPN endpoint. - Description *string - - // Indicates whether the client VPN session is disconnected after the maximum - // timeout specified in sessionTimeoutHours is reached. If true , users are - // prompted to reconnect client VPN. If false , client VPN attempts to reconnect - // automatically. The default value is true . - DisconnectOnSessionTimeout *bool - - // Information about the DNS servers to be used by Client VPN connections. A - // Client VPN endpoint can have up to two DNS servers. - DnsServers *types.DnsServersOptionsModifyStructure - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of one or more security groups to apply to the target network. - SecurityGroupIds []string - - // Specify whether to enable the self-service portal for the Client VPN endpoint. - SelfServicePortal types.SelfServicePortal - - // The ARN of the server certificate to be used. The server certificate must be - // provisioned in Certificate Manager (ACM). - ServerCertificateArn *string - - // The maximum VPN session duration time in hours. - // - // Valid values: 8 | 10 | 12 | 24 - // - // Default value: 24 - SessionTimeoutHours *int32 - - // Indicates whether the VPN is split-tunnel. - // - // For information about split-tunnel VPN endpoints, see [Split-tunnel Client VPN endpoint] in the Client VPN - // Administrator Guide. - // - // [Split-tunnel Client VPN endpoint]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html - SplitTunnel *bool - - // The ID of the VPC to associate with the Client VPN endpoint. - VpcId *string - - // The port number to assign to the Client VPN endpoint for TCP and UDP traffic. - // - // Valid Values: 443 | 1194 - // - // Default Value: 443 - VpnPort *int32 - - noSmithyDocumentSerde -} - -type ModifyClientVpnEndpointOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyClientVpnEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyClientVpnEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyClientVpnEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyClientVpnEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyClientVpnEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyClientVpnEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyClientVpnEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyDefaultCreditSpecification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyDefaultCreditSpecification.go deleted file mode 100644 index a422898f6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyDefaultCreditSpecification.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the default credit option for CPU usage of burstable performance -// instances. The default credit option is set at the account level per Amazon Web -// Services Region, and is specified per instance family. All new burstable -// performance instances in the account launch using the default credit option. -// -// ModifyDefaultCreditSpecification is an asynchronous operation, which works at -// an Amazon Web Services Region level and modifies the credit option for each -// Availability Zone. All zones in a Region are updated within five minutes. But if -// instances are launched during this operation, they might not get the new credit -// option until the zone is updated. To verify whether the update has occurred, you -// can call GetDefaultCreditSpecification and check DefaultCreditSpecification for -// updates. -// -// For more information, see [Burstable performance instances] in the Amazon EC2 User Guide. -// -// [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html -func (c *Client) ModifyDefaultCreditSpecification(ctx context.Context, params *ModifyDefaultCreditSpecificationInput, optFns ...func(*Options)) (*ModifyDefaultCreditSpecificationOutput, error) { - if params == nil { - params = &ModifyDefaultCreditSpecificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyDefaultCreditSpecification", params, optFns, c.addOperationModifyDefaultCreditSpecificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyDefaultCreditSpecificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyDefaultCreditSpecificationInput struct { - - // The credit option for CPU usage of the instance family. - // - // Valid Values: standard | unlimited - // - // This member is required. - CpuCredits *string - - // The instance family. - // - // This member is required. - InstanceFamily types.UnlimitedSupportedInstanceFamily - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyDefaultCreditSpecificationOutput struct { - - // The default credit option for CPU usage of the instance family. - InstanceFamilyCreditSpecification *types.InstanceFamilyCreditSpecification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyDefaultCreditSpecificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyDefaultCreditSpecification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyDefaultCreditSpecification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDefaultCreditSpecification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyDefaultCreditSpecificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDefaultCreditSpecification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyDefaultCreditSpecification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyDefaultCreditSpecification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyEbsDefaultKmsKeyId.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyEbsDefaultKmsKeyId.go deleted file mode 100644 index 62ef2035d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyEbsDefaultKmsKeyId.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Changes the default KMS key for EBS encryption by default for your account in -// this Region. -// -// Amazon Web Services creates a unique Amazon Web Services managed KMS key in -// each Region for use with encryption by default. If you change the default KMS -// key to a symmetric customer managed KMS key, it is used instead of the Amazon -// Web Services managed KMS key. To reset the default KMS key to the Amazon Web -// Services managed KMS key for EBS, use ResetEbsDefaultKmsKeyId. Amazon EBS does not support asymmetric -// KMS keys. -// -// If you delete or disable the customer managed KMS key that you specified for -// use with encryption by default, your instances will fail to launch. -// -// For more information, see [Amazon EBS encryption] in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) ModifyEbsDefaultKmsKeyId(ctx context.Context, params *ModifyEbsDefaultKmsKeyIdInput, optFns ...func(*Options)) (*ModifyEbsDefaultKmsKeyIdOutput, error) { - if params == nil { - params = &ModifyEbsDefaultKmsKeyIdInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyEbsDefaultKmsKeyId", params, optFns, c.addOperationModifyEbsDefaultKmsKeyIdMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyEbsDefaultKmsKeyIdOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyEbsDefaultKmsKeyIdInput struct { - - // The identifier of the KMS key to use for Amazon EBS encryption. If this - // parameter is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is - // specified, the encrypted state must be true . - // - // You can specify the KMS key using any of the following: - // - // - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Key alias. For example, alias/ExampleAlias. - // - // - Key ARN. For example, - // arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // - Alias ARN. For example, - // arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you - // specify an ID, alias, or ARN that is not valid, the action can appear to - // complete, but eventually fails. - // - // Amazon EBS does not support asymmetric KMS keys. - // - // This member is required. - KmsKeyId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyEbsDefaultKmsKeyIdOutput struct { - - // The Amazon Resource Name (ARN) of the default KMS key for encryption by default. - KmsKeyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyEbsDefaultKmsKeyIdMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyEbsDefaultKmsKeyId"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyEbsDefaultKmsKeyIdValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyEbsDefaultKmsKeyId(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyEbsDefaultKmsKeyId(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyEbsDefaultKmsKeyId", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFleet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFleet.go deleted file mode 100644 index 04e733958..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFleet.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified EC2 Fleet. -// -// You can only modify an EC2 Fleet request of type maintain . -// -// While the EC2 Fleet is being modified, it is in the modifying state. -// -// To scale up your EC2 Fleet, increase its target capacity. The EC2 Fleet -// launches the additional Spot Instances according to the allocation strategy for -// the EC2 Fleet request. If the allocation strategy is lowest-price , the EC2 -// Fleet launches instances using the Spot Instance pool with the lowest price. If -// the allocation strategy is diversified , the EC2 Fleet distributes the instances -// across the Spot Instance pools. If the allocation strategy is capacity-optimized -// , EC2 Fleet launches instances from Spot Instance pools with optimal capacity -// for the number of instances that are launching. -// -// To scale down your EC2 Fleet, decrease its target capacity. First, the EC2 -// Fleet cancels any open requests that exceed the new target capacity. You can -// request that the EC2 Fleet terminate Spot Instances until the size of the fleet -// no longer exceeds the new target capacity. If the allocation strategy is -// lowest-price , the EC2 Fleet terminates the instances with the highest price per -// unit. If the allocation strategy is capacity-optimized , the EC2 Fleet -// terminates the instances in the Spot Instance pools that have the least -// available Spot Instance capacity. If the allocation strategy is diversified , -// the EC2 Fleet terminates instances across the Spot Instance pools. -// Alternatively, you can request that the EC2 Fleet keep the fleet at its current -// size, but not replace any Spot Instances that are interrupted or that you -// terminate manually. -// -// If you are finished with your EC2 Fleet for now, but will use it again later, -// you can set the target capacity to 0. -func (c *Client) ModifyFleet(ctx context.Context, params *ModifyFleetInput, optFns ...func(*Options)) (*ModifyFleetOutput, error) { - if params == nil { - params = &ModifyFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyFleet", params, optFns, c.addOperationModifyFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyFleetInput struct { - - // The ID of the EC2 Fleet. - // - // This member is required. - FleetId *string - - // Reserved. - Context *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether running instances should be terminated if the total target - // capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet. - // - // Supported only for fleets of type maintain . - ExcessCapacityTerminationPolicy types.FleetExcessCapacityTerminationPolicy - - // The launch template and overrides. - LaunchTemplateConfigs []types.FleetLaunchTemplateConfigRequest - - // The size of the EC2 Fleet. - TargetCapacitySpecification *types.TargetCapacitySpecificationRequest - - noSmithyDocumentSerde -} - -type ModifyFleetOutput struct { - - // If the request succeeds, the response returns true . If the request fails, no - // response is returned, and instead an error message is returned. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyFleet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyFleet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyFleet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFpgaImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFpgaImageAttribute.go deleted file mode 100644 index b7b7d01d0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyFpgaImageAttribute.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified attribute of the specified Amazon FPGA Image (AFI). -func (c *Client) ModifyFpgaImageAttribute(ctx context.Context, params *ModifyFpgaImageAttributeInput, optFns ...func(*Options)) (*ModifyFpgaImageAttributeOutput, error) { - if params == nil { - params = &ModifyFpgaImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyFpgaImageAttribute", params, optFns, c.addOperationModifyFpgaImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyFpgaImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyFpgaImageAttributeInput struct { - - // The ID of the AFI. - // - // This member is required. - FpgaImageId *string - - // The name of the attribute. - Attribute types.FpgaImageAttributeName - - // A description for the AFI. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The load permission for the AFI. - LoadPermission *types.LoadPermissionModifications - - // A name for the AFI. - Name *string - - // The operation type. - OperationType types.OperationType - - // The product codes. After you add a product code to an AFI, it can't be removed. - // This parameter is valid only when modifying the productCodes attribute. - ProductCodes []string - - // The user groups. This parameter is valid only when modifying the loadPermission - // attribute. - UserGroups []string - - // The Amazon Web Services account IDs. This parameter is valid only when - // modifying the loadPermission attribute. - UserIds []string - - noSmithyDocumentSerde -} - -type ModifyFpgaImageAttributeOutput struct { - - // Information about the attribute. - FpgaImageAttribute *types.FpgaImageAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyFpgaImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyFpgaImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyFpgaImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyFpgaImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyFpgaImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyFpgaImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyHosts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyHosts.go deleted file mode 100644 index db9e7e60a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyHosts.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify the auto-placement setting of a Dedicated Host. When auto-placement is -// enabled, any instances that you launch with a tenancy of host but without a -// specific host ID are placed onto any available Dedicated Host in your account -// that has auto-placement enabled. When auto-placement is disabled, you need to -// provide a host ID to have the instance launch onto a specific host. If no host -// ID is provided, the instance is launched onto a suitable host with -// auto-placement enabled. -// -// You can also use this API action to modify a Dedicated Host to support either -// multiple instance types in an instance family, or to support a specific instance -// type only. -func (c *Client) ModifyHosts(ctx context.Context, params *ModifyHostsInput, optFns ...func(*Options)) (*ModifyHostsOutput, error) { - if params == nil { - params = &ModifyHostsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyHosts", params, optFns, c.addOperationModifyHostsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyHostsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyHostsInput struct { - - // The IDs of the Dedicated Hosts to modify. - // - // This member is required. - HostIds []string - - // Specify whether to enable or disable auto-placement. - AutoPlacement types.AutoPlacement - - // Indicates whether to enable or disable host maintenance for the Dedicated Host. - // For more information, see [Host maintenance]in the Amazon EC2 User Guide. - // - // [Host maintenance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html - HostMaintenance types.HostMaintenance - - // Indicates whether to enable or disable host recovery for the Dedicated Host. - // For more information, see [Host recovery]in the Amazon EC2 User Guide. - // - // [Host recovery]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html - HostRecovery types.HostRecovery - - // Specifies the instance family to be supported by the Dedicated Host. Specify - // this parameter to modify a Dedicated Host to support multiple instance types - // within its current instance family. - // - // If you want to modify a Dedicated Host to support a specific instance type - // only, omit this parameter and specify InstanceType instead. You cannot specify - // InstanceFamily and InstanceType in the same request. - InstanceFamily *string - - // Specifies the instance type to be supported by the Dedicated Host. Specify this - // parameter to modify a Dedicated Host to support only a specific instance type. - // - // If you want to modify a Dedicated Host to support multiple instance types in - // its current instance family, omit this parameter and specify InstanceFamily - // instead. You cannot specify InstanceType and InstanceFamily in the same request. - InstanceType *string - - noSmithyDocumentSerde -} - -type ModifyHostsOutput struct { - - // The IDs of the Dedicated Hosts that were successfully modified. - Successful []string - - // The IDs of the Dedicated Hosts that could not be modified. Check whether the - // setting you requested can be used. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyHostsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyHosts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyHosts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyHosts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyHostsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyHosts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyHosts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyHosts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdFormat.go deleted file mode 100644 index 671b64a91..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdFormat.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the ID format for the specified resource on a per-Region basis. You -// can specify that resources should receive longer IDs (17-character IDs) when -// they are created. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | -// elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image -// | import-task | internet-gateway | network-acl | network-acl-association | -// network-interface | network-interface-attachment | prefix-list | route-table | -// route-table-association | security-group | subnet | -// subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint -// | vpc-peering-connection | vpn-connection | vpn-gateway . -// -// This setting applies to the IAM user who makes the request; it does not apply -// to the entire Amazon Web Services account. By default, an IAM user defaults to -// the same settings as the root user. If you're using this action as the root -// user, then these settings apply to the entire account, unless an IAM user -// explicitly overrides these settings for themselves. For more information, see [Resource IDs] -// in the Amazon Elastic Compute Cloud User Guide. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use the -// relevant Describe command for the resource type. -// -// [Resource IDs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html -func (c *Client) ModifyIdFormat(ctx context.Context, params *ModifyIdFormatInput, optFns ...func(*Options)) (*ModifyIdFormatOutput, error) { - if params == nil { - params = &ModifyIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIdFormat", params, optFns, c.addOperationModifyIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIdFormatInput struct { - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | - // image | import-task | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | route-table - // | route-table-association | security-group | subnet | - // subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint - // | vpc-peering-connection | vpn-connection | vpn-gateway . - // - // Alternatively, use the all-current option to include all resource types that - // are currently within their opt-in period for longer IDs. - // - // This member is required. - Resource *string - - // Indicate whether the resource should use longer IDs (17-character IDs). - // - // This member is required. - UseLongIds *bool - - noSmithyDocumentSerde -} - -type ModifyIdFormatOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIdFormatValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdentityIdFormat.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdentityIdFormat.go deleted file mode 100644 index 62072ad52..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIdentityIdFormat.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the ID format of a resource for a specified IAM user, IAM role, or the -// root user for an account; or all IAM users, IAM roles, and the root user for an -// account. You can specify that resources should receive longer IDs (17-character -// IDs) when they are created. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | -// elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image -// | import-task | internet-gateway | network-acl | network-acl-association | -// network-interface | network-interface-attachment | prefix-list | route-table | -// route-table-association | security-group | subnet | -// subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint -// | vpc-peering-connection | vpn-connection | vpn-gateway . -// -// For more information, see [Resource IDs] in the Amazon Elastic Compute Cloud User Guide. -// -// This setting applies to the principal specified in the request; it does not -// apply to the principal that makes the request. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use the -// relevant Describe command for the resource type. -// -// [Resource IDs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html -func (c *Client) ModifyIdentityIdFormat(ctx context.Context, params *ModifyIdentityIdFormatInput, optFns ...func(*Options)) (*ModifyIdentityIdFormatOutput, error) { - if params == nil { - params = &ModifyIdentityIdFormatInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIdentityIdFormat", params, optFns, c.addOperationModifyIdentityIdFormatMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIdentityIdFormatOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIdentityIdFormatInput struct { - - // The ARN of the principal, which can be an IAM user, IAM role, or the root user. - // Specify all to modify the ID format for all IAM users, IAM roles, and the root - // user of the account. - // - // This member is required. - PrincipalArn *string - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | - // image | import-task | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | route-table - // | route-table-association | security-group | subnet | - // subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint - // | vpc-peering-connection | vpn-connection | vpn-gateway . - // - // Alternatively, use the all-current option to include all resource types that - // are currently within their opt-in period for longer IDs. - // - // This member is required. - Resource *string - - // Indicates whether the resource should use longer IDs (17-character IDs) - // - // This member is required. - UseLongIds *bool - - noSmithyDocumentSerde -} - -type ModifyIdentityIdFormatOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIdentityIdFormatMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIdentityIdFormat{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIdentityIdFormat{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIdentityIdFormat"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIdentityIdFormatValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIdentityIdFormat(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIdentityIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIdentityIdFormat", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyImageAttribute.go deleted file mode 100644 index 3f92bf30c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyImageAttribute.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified attribute of the specified AMI. You can specify only one -// attribute at a time. -// -// To specify the attribute, you can use the Attribute parameter, or one of the -// following parameters: Description , ImdsSupport , or LaunchPermission . -// -// Images with an Amazon Web Services Marketplace product code cannot be made -// public. -// -// To enable the SriovNetSupport enhanced networking attribute of an image, enable -// SriovNetSupport on an instance and create an AMI from the instance. -func (c *Client) ModifyImageAttribute(ctx context.Context, params *ModifyImageAttributeInput, optFns ...func(*Options)) (*ModifyImageAttributeOutput, error) { - if params == nil { - params = &ModifyImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyImageAttribute", params, optFns, c.addOperationModifyImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ModifyImageAttribute. -type ModifyImageAttributeInput struct { - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // The name of the attribute to modify. - // - // Valid values: description | imdsSupport | launchPermission - Attribute *string - - // A new description for the AMI. - Description *types.AttributeValue - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched - // from this AMI will have HttpTokens automatically set to required so that, by - // default, the instance requires that IMDSv2 is used when requesting instance - // metadata. In addition, HttpPutResponseHopLimit is set to 2 . For more - // information, see [Configure the AMI]in the Amazon EC2 User Guide. - // - // Do not use this parameter unless your AMI software supports IMDSv2. After you - // set the value to v2.0 , you can't undo it. The only way to “reset” your AMI is - // to create a new AMI from the underlying snapshot. - // - // [Configure the AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration - ImdsSupport *types.AttributeValue - - // A new launch permission for the AMI. - LaunchPermission *types.LaunchPermissionModifications - - // The operation type. This parameter can be used only when the Attribute - // parameter is launchPermission . - OperationType types.OperationType - - // The Amazon Resource Name (ARN) of an organization. This parameter can be used - // only when the Attribute parameter is launchPermission . - OrganizationArns []string - - // The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter - // can be used only when the Attribute parameter is launchPermission . - OrganizationalUnitArns []string - - // Not supported. - ProductCodes []string - - // The user groups. This parameter can be used only when the Attribute parameter - // is launchPermission . - UserGroups []string - - // The Amazon Web Services account IDs. This parameter can be used only when the - // Attribute parameter is launchPermission . - UserIds []string - - // The value of the attribute being modified. This parameter can be used only when - // the Attribute parameter is description or imdsSupport . - Value *string - - noSmithyDocumentSerde -} - -type ModifyImageAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceAttribute.go deleted file mode 100644 index 2dbe811d3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceAttribute.go +++ /dev/null @@ -1,281 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified attribute of the specified instance. You can specify -// only one attribute at a time. -// -// Note: Using this action to change the security groups associated with an -// elastic network interface (ENI) attached to an instance can result in an error -// if the instance has more than one ENI. To change the security groups associated -// with an ENI attached to an instance that has multiple ENIs, we recommend that -// you use the ModifyNetworkInterfaceAttributeaction. -// -// To modify some attributes, the instance must be stopped. For more information, -// see [Modify a stopped instance]in the Amazon EC2 User Guide. -// -// [Modify a stopped instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html -func (c *Client) ModifyInstanceAttribute(ctx context.Context, params *ModifyInstanceAttributeInput, optFns ...func(*Options)) (*ModifyInstanceAttributeOutput, error) { - if params == nil { - params = &ModifyInstanceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceAttribute", params, optFns, c.addOperationModifyInstanceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceAttributeInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The name of the attribute to modify. - // - // When changing the instance type: If the original instance type is configured - // for configurable bandwidth, and the desired instance type doesn't support - // configurable bandwidth, first set the existing bandwidth configuration to - // default using the ModifyInstanceNetworkPerformanceOptions operation. - // - // You can modify the following attributes only: disableApiTermination | - // instanceType | kernel | ramdisk | instanceInitiatedShutdownBehavior | - // blockDeviceMapping | userData | sourceDestCheck | groupSet | ebsOptimized | - // sriovNetSupport | enaSupport | nvmeSupport | disableApiStop | enclaveOptions - Attribute types.InstanceAttributeName - - // Modifies the DeleteOnTermination attribute for volumes that are currently - // attached. The volume must be owned by the caller. If no value is specified for - // DeleteOnTermination , the default is true and the volume is deleted when the - // instance is terminated. You can't modify the DeleteOnTermination attribute for - // volumes that are attached to Amazon Web Services-managed resources. - // - // To add instance store volumes to an Amazon EBS-backed instance, you must add - // them when you launch the instance. For more information, see [Update the block device mapping when launching an instance]in the Amazon EC2 - // User Guide. - // - // [Update the block device mapping when launching an instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM - BlockDeviceMappings []types.InstanceBlockDeviceMappingSpecification - - // Indicates whether an instance is enabled for stop protection. For more - // information, see [Enable stop protection for your instance]. - // - // [Enable stop protection for your instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html - DisableApiStop *types.AttributeBooleanValue - - // Enable or disable termination protection for the instance. If the value is true - // , you can't terminate the instance using the Amazon EC2 console, command line - // interface, or API. You can't enable termination protection for Spot Instances. - DisableApiTermination *types.AttributeBooleanValue - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether the instance is optimized for Amazon EBS I/O. This - // optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal EBS I/O performance. This optimization - // isn't available with all instance types. Additional usage charges apply when - // using an EBS Optimized instance. - EbsOptimized *types.AttributeBooleanValue - - // Set to true to enable enhanced networking with ENA for the instance. - // - // This option is supported only for HVM instances. Specifying this option with a - // PV instance can make it unreachable. - EnaSupport *types.AttributeBooleanValue - - // Replaces the security groups of the instance with the specified security - // groups. You must specify the ID of at least one security group, even if it's - // just the default security group for the VPC. - Groups []string - - // Specifies whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *types.AttributeValue - - // Changes the instance type to the specified value. For more information, see [Instance types] in - // the Amazon EC2 User Guide. If the instance type is not valid, the error returned - // is InvalidInstanceAttributeValue . - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType *types.AttributeValue - - // Changes the instance's kernel to the specified value. We recommend that you use - // PV-GRUB instead of kernels and RAM disks. For more information, see [PV-GRUB]. - // - // [PV-GRUB]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html - Kernel *types.AttributeValue - - // Changes the instance's RAM disk to the specified value. We recommend that you - // use PV-GRUB instead of kernels and RAM disks. For more information, see [PV-GRUB]. - // - // [PV-GRUB]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html - Ramdisk *types.AttributeValue - - // Enable or disable source/destination checks, which ensure that the instance is - // either the source or the destination of any traffic that it receives. If the - // value is true , source/destination checks are enabled; otherwise, they are - // disabled. The default value is true . You must disable source/destination checks - // if the instance runs services such as network address translation, routing, or - // firewalls. - SourceDestCheck *types.AttributeBooleanValue - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the instance. - // - // There is no way to disable enhanced networking with the Intel 82599 Virtual - // Function interface at this time. - // - // This option is supported only for HVM instances. Specifying this option with a - // PV instance can make it unreachable. - SriovNetSupport *types.AttributeValue - - // Changes the instance's user data to the specified value. User data must be - // base64-encoded. Depending on the tool or SDK that you're using, the - // base64-encoding might be performed for you. For more information, see [Work with instance user data]. - // - // [Work with instance user data]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-user-data.html - UserData *types.BlobAttributeValue - - // A new value for the attribute. Use only with the kernel , ramdisk , userData , - // disableApiTermination , or instanceInitiatedShutdownBehavior attribute. - Value *string - - noSmithyDocumentSerde -} - -type ModifyInstanceAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCapacityReservationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCapacityReservationAttributes.go deleted file mode 100644 index 58ab3247e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCapacityReservationAttributes.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the Capacity Reservation settings for a stopped instance. Use this -// action to configure an instance to target a specific Capacity Reservation, run -// in any open Capacity Reservation with matching attributes, run in On-Demand -// Instance capacity, or only run in a Capacity Reservation. -func (c *Client) ModifyInstanceCapacityReservationAttributes(ctx context.Context, params *ModifyInstanceCapacityReservationAttributesInput, optFns ...func(*Options)) (*ModifyInstanceCapacityReservationAttributesOutput, error) { - if params == nil { - params = &ModifyInstanceCapacityReservationAttributesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceCapacityReservationAttributes", params, optFns, c.addOperationModifyInstanceCapacityReservationAttributesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceCapacityReservationAttributesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceCapacityReservationAttributesInput struct { - - // Information about the Capacity Reservation targeting option. - // - // This member is required. - CapacityReservationSpecification *types.CapacityReservationSpecification - - // The ID of the instance to be modified. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyInstanceCapacityReservationAttributesOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceCapacityReservationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceCapacityReservationAttributes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceCapacityReservationAttributes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceCapacityReservationAttributesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceCapacityReservationAttributes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceCapacityReservationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceCapacityReservationAttributes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCpuOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCpuOptions.go deleted file mode 100644 index b5344013c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCpuOptions.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// By default, all vCPUs for the instance type are active when you launch an -// instance. When you configure the number of active vCPUs for the instance, it can -// help you save on licensing costs and optimize performance. The base cost of the -// instance remains unchanged. -// -// The number of active vCPUs equals the number of threads per CPU core multiplied -// by the number of cores. The instance must be in a Stopped state before you make -// changes. -// -// Some instance type options do not support this capability. For more -// information, see [Supported CPU options]in the Amazon EC2 User Guide. -// -// [Supported CPU options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html -func (c *Client) ModifyInstanceCpuOptions(ctx context.Context, params *ModifyInstanceCpuOptionsInput, optFns ...func(*Options)) (*ModifyInstanceCpuOptionsOutput, error) { - if params == nil { - params = &ModifyInstanceCpuOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceCpuOptions", params, optFns, c.addOperationModifyInstanceCpuOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceCpuOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceCpuOptionsInput struct { - - // The number of CPU cores to activate for the specified instance. - // - // This member is required. - CoreCount *int32 - - // The ID of the instance to update. - // - // This member is required. - InstanceId *string - - // The number of threads to run for each CPU core. - // - // This member is required. - ThreadsPerCore *int32 - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyInstanceCpuOptionsOutput struct { - - // The number of CPU cores that are running for the specified instance after the - // update. - CoreCount *int32 - - // The ID of the instance that was updated. - InstanceId *string - - // The number of threads that are running per CPU core for the specified instance - // after the update. - ThreadsPerCore *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceCpuOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceCpuOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceCpuOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceCpuOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceCpuOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceCpuOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceCpuOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceCpuOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCreditSpecification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCreditSpecification.go deleted file mode 100644 index 37d2ef4be..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceCreditSpecification.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the credit option for CPU usage on a running or stopped burstable -// performance instance. The credit options are standard and unlimited . -// -// For more information, see [Burstable performance instances] in the Amazon EC2 User Guide. -// -// [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html -func (c *Client) ModifyInstanceCreditSpecification(ctx context.Context, params *ModifyInstanceCreditSpecificationInput, optFns ...func(*Options)) (*ModifyInstanceCreditSpecificationOutput, error) { - if params == nil { - params = &ModifyInstanceCreditSpecificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceCreditSpecification", params, optFns, c.addOperationModifyInstanceCreditSpecificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceCreditSpecificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceCreditSpecificationInput struct { - - // Information about the credit option for CPU usage. - // - // This member is required. - InstanceCreditSpecifications []types.InstanceCreditSpecificationRequest - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyInstanceCreditSpecificationOutput struct { - - // Information about the instances whose credit option for CPU usage was - // successfully modified. - SuccessfulInstanceCreditSpecifications []types.SuccessfulInstanceCreditSpecificationItem - - // Information about the instances whose credit option for CPU usage was not - // modified. - UnsuccessfulInstanceCreditSpecifications []types.UnsuccessfulInstanceCreditSpecificationItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceCreditSpecificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceCreditSpecification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceCreditSpecification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceCreditSpecification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceCreditSpecificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceCreditSpecification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceCreditSpecification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceCreditSpecification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventStartTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventStartTime.go deleted file mode 100644 index 448cd409b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventStartTime.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Modifies the start time for a scheduled Amazon EC2 instance event. -func (c *Client) ModifyInstanceEventStartTime(ctx context.Context, params *ModifyInstanceEventStartTimeInput, optFns ...func(*Options)) (*ModifyInstanceEventStartTimeOutput, error) { - if params == nil { - params = &ModifyInstanceEventStartTimeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceEventStartTime", params, optFns, c.addOperationModifyInstanceEventStartTimeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceEventStartTimeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceEventStartTimeInput struct { - - // The ID of the event whose date and time you are modifying. - // - // This member is required. - InstanceEventId *string - - // The ID of the instance with the scheduled event. - // - // This member is required. - InstanceId *string - - // The new date and time when the event will take place. - // - // This member is required. - NotBefore *time.Time - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyInstanceEventStartTimeOutput struct { - - // Information about the event. - Event *types.InstanceStatusEvent - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceEventStartTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceEventStartTime{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceEventStartTime{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceEventStartTime"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceEventStartTimeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceEventStartTime(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceEventStartTime(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceEventStartTime", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventWindow.go deleted file mode 100644 index 7bf3386ba..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceEventWindow.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified event window. -// -// You can define either a set of time ranges or a cron expression when modifying -// the event window, but not both. -// -// To modify the targets associated with the event window, use the AssociateInstanceEventWindow and DisassociateInstanceEventWindow API. -// -// If Amazon Web Services has already scheduled an event, modifying an event -// window won't change the time of the scheduled event. -// -// For more information, see [Define event windows for scheduled events] in the Amazon EC2 User Guide. -// -// [Define event windows for scheduled events]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html -func (c *Client) ModifyInstanceEventWindow(ctx context.Context, params *ModifyInstanceEventWindowInput, optFns ...func(*Options)) (*ModifyInstanceEventWindowOutput, error) { - if params == nil { - params = &ModifyInstanceEventWindowInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceEventWindow", params, optFns, c.addOperationModifyInstanceEventWindowMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceEventWindowOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceEventWindowInput struct { - - // The ID of the event window. - // - // This member is required. - InstanceEventWindowId *string - - // The cron expression of the event window, for example, * 0-4,20-23 * * 1,5 . - // - // Constraints: - // - // - Only hour and day of the week values are supported. - // - // - For day of the week values, you can specify either integers 0 through 6 , or - // alternative single values SUN through SAT . - // - // - The minute, month, and year must be specified by * . - // - // - The hour value must be one or a multiple range, for example, 0-4 or - // 0-4,20-23 . - // - // - Each hour range must be >= 2 hours, for example, 0-2 or 20-23 . - // - // - The event window must be >= 4 hours. The combined total time ranges in the - // event window must be >= 4 hours. - // - // For more information about cron expressions, see [cron] on the Wikipedia website. - // - // [cron]: https://en.wikipedia.org/wiki/Cron - CronExpression *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the event window. - Name *string - - // The time ranges of the event window. - TimeRanges []types.InstanceEventWindowTimeRangeRequest - - noSmithyDocumentSerde -} - -type ModifyInstanceEventWindowOutput struct { - - // Information about the event window. - InstanceEventWindow *types.InstanceEventWindow - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceEventWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceEventWindow{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceEventWindow"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceEventWindowValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceEventWindow(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceEventWindow(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceEventWindow", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMaintenanceOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMaintenanceOptions.go deleted file mode 100644 index 8a0426c02..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMaintenanceOptions.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the recovery behavior of your instance to disable simplified automatic -// recovery or set the recovery behavior to default. The default configuration will -// not enable simplified automatic recovery for an unsupported instance type. For -// more information, see [Simplified automatic recovery]. -// -// Modifies the reboot migration behavior during a user-initiated reboot of an -// instance that has a pending system-reboot event. For more information, see [Enable or disable reboot migration]. -// -// [Simplified automatic recovery]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery -// [Enable or disable reboot migration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/schedevents_actions_reboot.html#reboot-migration -func (c *Client) ModifyInstanceMaintenanceOptions(ctx context.Context, params *ModifyInstanceMaintenanceOptionsInput, optFns ...func(*Options)) (*ModifyInstanceMaintenanceOptionsOutput, error) { - if params == nil { - params = &ModifyInstanceMaintenanceOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceMaintenanceOptions", params, optFns, c.addOperationModifyInstanceMaintenanceOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceMaintenanceOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceMaintenanceOptionsInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Disables the automatic recovery behavior of your instance or sets it to default. - AutoRecovery types.InstanceAutoRecoveryState - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether to attempt reboot migration during a user-initiated reboot of - // an instance that has a scheduled system-reboot event: - // - // - default - Amazon EC2 attempts to migrate the instance to new hardware - // (reboot migration). If successful, the system-reboot event is cleared. If - // unsuccessful, an in-place reboot occurs and the event remains scheduled. - // - // - disabled - Amazon EC2 keeps the instance on the same hardware (in-place - // reboot). The system-reboot event remains scheduled. - // - // This setting only applies to supported instances that have a scheduled reboot - // event. For more information, see [Enable or disable reboot migration]in the Amazon EC2 User Guide. - // - // [Enable or disable reboot migration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/schedevents_actions_reboot.html#reboot-migration - RebootMigration types.InstanceRebootMigrationState - - noSmithyDocumentSerde -} - -type ModifyInstanceMaintenanceOptionsOutput struct { - - // Provides information on the current automatic recovery behavior of your - // instance. - AutoRecovery types.InstanceAutoRecoveryState - - // The ID of the instance. - InstanceId *string - - // Specifies whether to attempt reboot migration during a user-initiated reboot of - // an instance that has a scheduled system-reboot event: - // - // - default - Amazon EC2 attempts to migrate the instance to new hardware - // (reboot migration). If successful, the system-reboot event is cleared. If - // unsuccessful, an in-place reboot occurs and the event remains scheduled. - // - // - disabled - Amazon EC2 keeps the instance on the same hardware (in-place - // reboot). The system-reboot event remains scheduled. - // - // This setting only applies to supported instances that have a scheduled reboot - // event. For more information, see [Enable or disable reboot migration]in the Amazon EC2 User Guide. - // - // [Enable or disable reboot migration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/schedevents_actions_reboot.html#reboot-migration - RebootMigration types.InstanceRebootMigrationState - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceMaintenanceOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceMaintenanceOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceMaintenanceOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceMaintenanceOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceMaintenanceOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceMaintenanceOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceMaintenanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceMaintenanceOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataDefaults.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataDefaults.go deleted file mode 100644 index a1b3e5b75..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataDefaults.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the default instance metadata service (IMDS) settings at the account -// level in the specified Amazon Web Services
 Region. -// -// To remove a parameter's account-level default setting, specify no-preference . -// If an account-level setting is cleared with no-preference , then the instance -// launch considers the other instance metadata settings. For more information, see -// [Order of precedence for instance metadata options]in the Amazon EC2 User Guide. -// -// [Order of precedence for instance metadata options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence -func (c *Client) ModifyInstanceMetadataDefaults(ctx context.Context, params *ModifyInstanceMetadataDefaultsInput, optFns ...func(*Options)) (*ModifyInstanceMetadataDefaultsOutput, error) { - if params == nil { - params = &ModifyInstanceMetadataDefaultsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceMetadataDefaults", params, optFns, c.addOperationModifyInstanceMetadataDefaultsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceMetadataDefaultsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceMetadataDefaultsInput struct { - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Enables or disables the IMDS endpoint on an instance. When disabled, the - // instance metadata can't be accessed. - HttpEndpoint types.DefaultInstanceMetadataEndpointState - - // The maximum number of hops that the metadata token can travel. To indicate no - // preference, specify -1 . - // - // Possible values: Integers from 1 to 64 , and -1 to indicate no preference - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional – IMDSv2 is optional, which means that you can use either IMDSv2 or - // IMDSv1. - // - // - required – IMDSv2 is required, which means that IMDSv1 is disabled, and you - // must use IMDSv2. - HttpTokens types.MetadataDefaultHttpTokensState - - // Enables or disables access to an instance's tags from the instance metadata. - // For more information, see [Work with instance tags using the instance metadata]in the Amazon EC2 User Guide. - // - // [Work with instance tags using the instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS - InstanceMetadataTags types.DefaultInstanceMetadataTagsState - - noSmithyDocumentSerde -} - -type ModifyInstanceMetadataDefaultsOutput struct { - - // If the request succeeds, the response returns true . If the request fails, no - // response is returned, and instead an error message is returned. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceMetadataDefaultsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceMetadataDefaults{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceMetadataDefaults{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceMetadataDefaults"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceMetadataDefaults(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceMetadataDefaults(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceMetadataDefaults", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataOptions.go deleted file mode 100644 index 476a09559..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceMetadataOptions.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify the instance metadata parameters on a running or stopped instance. When -// you modify the parameters on a stopped instance, they are applied when the -// instance is started. When you modify the parameters on a running instance, the -// API responds with a state of “pending”. After the parameter modifications are -// successfully applied to the instance, the state of the modifications changes -// from “pending” to “applied” in subsequent describe-instances API calls. For more -// information, see [Instance metadata and user data]in the Amazon EC2 User Guide. -// -// [Instance metadata and user data]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html -func (c *Client) ModifyInstanceMetadataOptions(ctx context.Context, params *ModifyInstanceMetadataOptionsInput, optFns ...func(*Options)) (*ModifyInstanceMetadataOptionsOutput, error) { - if params == nil { - params = &ModifyInstanceMetadataOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceMetadataOptions", params, optFns, c.addOperationModifyInstanceMetadataOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceMetadataOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceMetadataOptionsInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Enables or disables the HTTP metadata endpoint on your instances. If this - // parameter is not specified, the existing state is maintained. - // - // If you specify a value of disabled , you cannot access your instance metadata. - HttpEndpoint types.InstanceMetadataEndpointState - - // Enables or disables the IPv6 endpoint for the instance metadata service. - // Applies only if you enabled the HTTP metadata endpoint. - HttpProtocolIpv6 types.InstanceMetadataProtocolState - - // The desired HTTP PUT response hop limit for instance metadata requests. The - // larger the number, the further instance metadata requests can travel. If no - // parameter is specified, the existing state is maintained. - // - // Possible values: Integers from 1 to 64 - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional - IMDSv2 is optional. You can choose whether to send a session - // token in your instance metadata retrieval requests. If you retrieve IAM role - // credentials without a session token, you receive the IMDSv1 role credentials. If - // you retrieve IAM role credentials using a valid session token, you receive the - // IMDSv2 role credentials. - // - // - required - IMDSv2 is required. You must send a session token in your - // instance metadata retrieval requests. With this option, retrieving the IAM role - // credentials always returns IMDSv2 credentials; IMDSv1 credentials are not - // available. - // - // Default: - // - // - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your - // instance is v2.0 and the account level default is set to no-preference , the - // default is required . - // - // - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your - // instance is v2.0 , but the account level default is set to V1 or V2 , the - // default is optional . - // - // The default value can also be affected by other combinations of parameters. For - // more information, see [Order of precedence for instance metadata options]in the Amazon EC2 User Guide. - // - // [Order of precedence for instance metadata options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence - HttpTokens types.HttpTokensState - - // Set to enabled to allow access to instance tags from the instance metadata. Set - // to disabled to turn off access to instance tags from the instance metadata. For - // more information, see [Work with instance tags using the instance metadata]. - // - // [Work with instance tags using the instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS - InstanceMetadataTags types.InstanceMetadataTagsState - - noSmithyDocumentSerde -} - -type ModifyInstanceMetadataOptionsOutput struct { - - // The ID of the instance. - InstanceId *string - - // The metadata options for the instance. - InstanceMetadataOptions *types.InstanceMetadataOptionsResponse - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceMetadataOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceMetadataOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceMetadataOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceMetadataOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceMetadataOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceMetadataOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceMetadataOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceMetadataOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceNetworkPerformanceOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceNetworkPerformanceOptions.go deleted file mode 100644 index 91ae753ce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstanceNetworkPerformanceOptions.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Change the configuration of the network performance options for an existing -// instance. -func (c *Client) ModifyInstanceNetworkPerformanceOptions(ctx context.Context, params *ModifyInstanceNetworkPerformanceOptionsInput, optFns ...func(*Options)) (*ModifyInstanceNetworkPerformanceOptionsOutput, error) { - if params == nil { - params = &ModifyInstanceNetworkPerformanceOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceNetworkPerformanceOptions", params, optFns, c.addOperationModifyInstanceNetworkPerformanceOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstanceNetworkPerformanceOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstanceNetworkPerformanceOptionsInput struct { - - // Specify the bandwidth weighting option to boost the associated type of baseline - // bandwidth, as follows: - // - // default This option uses the standard bandwidth configuration for your instance - // type. - // - // vpc-1 This option boosts your networking baseline bandwidth and reduces your - // EBS baseline bandwidth. - // - // ebs-1 This option boosts your EBS baseline bandwidth and reduces your - // networking baseline bandwidth. - // - // This member is required. - BandwidthWeighting types.InstanceBandwidthWeighting - - // The ID of the instance to update. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyInstanceNetworkPerformanceOptionsOutput struct { - - // Contains the updated configuration for bandwidth weighting on the specified - // instance. - BandwidthWeighting types.InstanceBandwidthWeighting - - // The instance ID that was updated. - InstanceId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstanceNetworkPerformanceOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstanceNetworkPerformanceOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstanceNetworkPerformanceOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstanceNetworkPerformanceOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstanceNetworkPerformanceOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceNetworkPerformanceOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstanceNetworkPerformanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstanceNetworkPerformanceOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstancePlacement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstancePlacement.go deleted file mode 100644 index 54db51f36..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyInstancePlacement.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the placement attributes for a specified instance. You can do the -// following: -// -// - Modify the affinity between an instance and a [Dedicated Host]. When affinity is set to host -// and the instance is not associated with a specific Dedicated Host, the next time -// the instance is started, it is automatically associated with the host on which -// it lands. If the instance is restarted or rebooted, this relationship persists. -// -// - Change the Dedicated Host with which an instance is associated. -// -// - Change the instance tenancy of an instance. -// -// - Move an instance to or from a [placement group]. -// -// At least one attribute for affinity, host ID, tenancy, or placement group name -// must be specified in the request. Affinity and tenancy can be modified in the -// same request. -// -// To modify the host ID, tenancy, placement group, or partition for an instance, -// the instance must be in the stopped state. -// -// [Dedicated Host]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html -// [placement group]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html -func (c *Client) ModifyInstancePlacement(ctx context.Context, params *ModifyInstancePlacementInput, optFns ...func(*Options)) (*ModifyInstancePlacementOutput, error) { - if params == nil { - params = &ModifyInstancePlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyInstancePlacement", params, optFns, c.addOperationModifyInstancePlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyInstancePlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyInstancePlacementInput struct { - - // The ID of the instance that you are modifying. - // - // This member is required. - InstanceId *string - - // The affinity setting for the instance. For more information, see [Host affinity] in the Amazon - // EC2 User Guide. - // - // [Host affinity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity - Affinity types.Affinity - - // The Group Id of a placement group. You must specify the Placement Group Group - // Id to launch an instance in a shared placement group. - GroupId *string - - // The name of the placement group in which to place the instance. For spread - // placement groups, the instance must have a tenancy of default . For cluster and - // partition placement groups, the instance must have a tenancy of default or - // dedicated . - // - // To remove an instance from a placement group, specify an empty string (""). - GroupName *string - - // The ID of the Dedicated Host with which to associate the instance. - HostId *string - - // The ARN of the host resource group in which to place the instance. The instance - // must have a tenancy of host to specify this parameter. - HostResourceGroupArn *string - - // The number of the partition in which to place the instance. Valid only if the - // placement group strategy is set to partition . - PartitionNumber *int32 - - // The tenancy for the instance. - // - // For T3 instances, you must launch the instance on a Dedicated Host to use a - // tenancy of host . You can't change the tenancy from host to dedicated or default - // . Attempting to make one of these unsupported tenancy changes results in an - // InvalidRequest error code. - Tenancy types.HostTenancy - - noSmithyDocumentSerde -} - -type ModifyInstancePlacementOutput struct { - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyInstancePlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyInstancePlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyInstancePlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyInstancePlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyInstancePlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstancePlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyInstancePlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyInstancePlacement", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpam.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpam.go deleted file mode 100644 index 1fabbe16d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpam.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify the configurations of an IPAM. -func (c *Client) ModifyIpam(ctx context.Context, params *ModifyIpamInput, optFns ...func(*Options)) (*ModifyIpamOutput, error) { - if params == nil { - params = &ModifyIpamInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIpam", params, optFns, c.addOperationModifyIpamMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIpamOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIpamInput struct { - - // The ID of the IPAM you want to modify. - // - // This member is required. - IpamId *string - - // Choose the operating Regions for the IPAM. Operating Regions are Amazon Web - // Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only - // discovers and monitors resources in the Amazon Web Services Regions you select - // as operating Regions. - // - // For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User - // Guide. - // - // [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html - AddOperatingRegions []types.AddIpamOperatingRegion - - // The description of the IPAM you want to modify. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Enable this option to use your own GUA ranges as private IPv6 addresses. This - // option is disabled by default. - EnablePrivateGua *bool - - // A metered account is an Amazon Web Services account that is charged for active - // IP addresses managed in IPAM. For more information, see [Enable cost distribution]in the Amazon VPC IPAM - // User Guide. - // - // Possible values: - // - // - ipam-owner (default): The Amazon Web Services account which owns the IPAM is - // charged for all active IP addresses managed in IPAM. - // - // - resource-owner : The Amazon Web Services account that owns the IP address is - // charged for the active IP address. - // - // [Enable cost distribution]: https://docs.aws.amazon.com/vpc/latest/ipam/ipam-enable-cost-distro.html - MeteredAccount types.IpamMeteredAccount - - // The operating Regions to remove. - RemoveOperatingRegions []types.RemoveIpamOperatingRegion - - // IPAM is offered in a Free Tier and an Advanced Tier. For more information about - // the features available in each tier and the costs associated with the tiers, see - // [Amazon VPC pricing > IPAM tab]. - // - // [Amazon VPC pricing > IPAM tab]: http://aws.amazon.com/vpc/pricing/ - Tier types.IpamTier - - noSmithyDocumentSerde -} - -type ModifyIpamOutput struct { - - // The results of the modification. - Ipam *types.Ipam - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIpamMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIpam{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIpam{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIpam"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIpamValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIpam(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIpam(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIpam", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamPool.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamPool.go deleted file mode 100644 index 438d0e61a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamPool.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify the configurations of an IPAM pool. -// -// For more information, see [Modify a pool] in the Amazon VPC IPAM User Guide. -// -// [Modify a pool]: https://docs.aws.amazon.com/vpc/latest/ipam/mod-pool-ipam.html -func (c *Client) ModifyIpamPool(ctx context.Context, params *ModifyIpamPoolInput, optFns ...func(*Options)) (*ModifyIpamPoolOutput, error) { - if params == nil { - params = &ModifyIpamPoolInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIpamPool", params, optFns, c.addOperationModifyIpamPoolMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIpamPoolOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIpamPoolInput struct { - - // The ID of the IPAM pool you want to modify. - // - // This member is required. - IpamPoolId *string - - // Add tag allocation rules to a pool. For more information about allocation - // rules, see [Create a top-level pool]in the Amazon VPC IPAM User Guide. - // - // [Create a top-level pool]: https://docs.aws.amazon.com/vpc/latest/ipam/create-top-ipam.html - AddAllocationResourceTags []types.RequestIpamResourceTag - - // The default netmask length for allocations added to this pool. If, for example, - // the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new - // allocations will default to 10.0.0.0/16. - AllocationDefaultNetmaskLength *int32 - - // The maximum netmask length possible for CIDR allocations in this IPAM pool to - // be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible - // netmask lengths for IPv6 addresses are 0 - 128.The maximum netmask length must - // be greater than the minimum netmask length. - AllocationMaxNetmaskLength *int32 - - // The minimum netmask length required for CIDR allocations in this IPAM pool to - // be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible - // netmask lengths for IPv6 addresses are 0 - 128. The minimum netmask length must - // be less than the maximum netmask length. - AllocationMinNetmaskLength *int32 - - // If true, IPAM will continuously look for resources within the CIDR range of - // this pool and automatically import them as allocations into your IPAM. The CIDRs - // that will be allocated for these resources must not already be allocated to - // other resources in order for the import to succeed. IPAM will import a CIDR - // regardless of its compliance with the pool's allocation rules, so a resource - // might be imported and subsequently marked as noncompliant. If IPAM discovers - // multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM - // discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of - // them only. - // - // A locale must be set on the pool for this feature to work. - AutoImport *bool - - // Clear the default netmask length allocation rule for this pool. - ClearAllocationDefaultNetmaskLength *bool - - // The description of the IPAM pool you want to modify. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Remove tag allocation rules from a pool. - RemoveAllocationResourceTags []types.RequestIpamResourceTag - - noSmithyDocumentSerde -} - -type ModifyIpamPoolOutput struct { - - // The results of the modification. - IpamPool *types.IpamPool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIpamPoolMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIpamPool{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIpamPool{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIpamPool"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIpamPoolValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIpamPool(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIpamPool(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIpamPool", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceCidr.go deleted file mode 100644 index 87d45f4fb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceCidr.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify a resource CIDR. You can use this action to transfer resource CIDRs -// between scopes and ignore resource CIDRs that you do not want to manage. If set -// to false, the resource will not be tracked for overlap, it cannot be -// auto-imported into a pool, and it will be removed from any pool it has an -// allocation in. -// -// For more information, see [Move resource CIDRs between scopes] and [Change the monitoring state of resource CIDRs] in the Amazon VPC IPAM User Guide. -// -// [Change the monitoring state of resource CIDRs]: https://docs.aws.amazon.com/vpc/latest/ipam/change-monitoring-state-ipam.html -// [Move resource CIDRs between scopes]: https://docs.aws.amazon.com/vpc/latest/ipam/move-resource-ipam.html -func (c *Client) ModifyIpamResourceCidr(ctx context.Context, params *ModifyIpamResourceCidrInput, optFns ...func(*Options)) (*ModifyIpamResourceCidrOutput, error) { - if params == nil { - params = &ModifyIpamResourceCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIpamResourceCidr", params, optFns, c.addOperationModifyIpamResourceCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIpamResourceCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIpamResourceCidrInput struct { - - // The ID of the current scope that the resource CIDR is in. - // - // This member is required. - CurrentIpamScopeId *string - - // Determines if the resource is monitored by IPAM. If a resource is monitored, - // the resource is discovered by IPAM and you can view details about the resource’s - // CIDR. - // - // This member is required. - Monitored *bool - - // The CIDR of the resource you want to modify. - // - // This member is required. - ResourceCidr *string - - // The ID of the resource you want to modify. - // - // This member is required. - ResourceId *string - - // The Amazon Web Services Region of the resource you want to modify. - // - // This member is required. - ResourceRegion *string - - // The ID of the scope you want to transfer the resource CIDR to. - DestinationIpamScopeId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyIpamResourceCidrOutput struct { - - // The CIDR of the resource. - IpamResourceCidr *types.IpamResourceCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIpamResourceCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIpamResourceCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIpamResourceCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIpamResourceCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIpamResourceCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIpamResourceCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIpamResourceCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIpamResourceCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceDiscovery.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceDiscovery.go deleted file mode 100644 index d124fb84d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamResourceDiscovery.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a resource discovery. A resource discovery is an IPAM component that -// enables IPAM to manage and monitor resources that belong to the owning account. -func (c *Client) ModifyIpamResourceDiscovery(ctx context.Context, params *ModifyIpamResourceDiscoveryInput, optFns ...func(*Options)) (*ModifyIpamResourceDiscoveryOutput, error) { - if params == nil { - params = &ModifyIpamResourceDiscoveryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIpamResourceDiscovery", params, optFns, c.addOperationModifyIpamResourceDiscoveryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIpamResourceDiscoveryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIpamResourceDiscoveryInput struct { - - // A resource discovery ID. - // - // This member is required. - IpamResourceDiscoveryId *string - - // Add operating Regions to the resource discovery. Operating Regions are Amazon - // Web Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM - // only discovers and monitors resources in the Amazon Web Services Regions you - // select as operating Regions. - AddOperatingRegions []types.AddIpamOperatingRegion - - // Add an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is - // integrated with Amazon Web Services Organizations and you add an organizational - // unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that - // OU exclusion. There is a limit on the number of exclusions you can create. For - // more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. - // - // The resulting set of exclusions must not result in "overlap", meaning two or - // more OU exclusions must not exclude the same OU. For more information and - // examples, see the Amazon Web Services CLI request process in [Add or remove OU exclusions]in the Amazon VPC - // User Guide. - // - // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - // [Add or remove OU exclusions]: https://docs.aws.amazon.com/vpc/latest/ipam/exclude-ous.html#exclude-ous-create-delete - AddOrganizationalUnitExclusions []types.AddIpamOrganizationalUnitExclusion - - // A resource discovery description. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Remove operating Regions. - RemoveOperatingRegions []types.RemoveIpamOperatingRegion - - // Remove an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is - // integrated with Amazon Web Services Organizations and you add an organizational - // unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that - // OU exclusion. There is a limit on the number of exclusions you can create. For - // more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. - // - // The resulting set of exclusions must not result in "overlap", meaning two or - // more OU exclusions must not exclude the same OU. For more information and - // examples, see the Amazon Web Services CLI request process in [Add or remove OU exclusions]in the Amazon VPC - // User Guide. - // - // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - // [Add or remove OU exclusions]: https://docs.aws.amazon.com/vpc/latest/ipam/exclude-ous.html#exclude-ous-create-delete - RemoveOrganizationalUnitExclusions []types.RemoveIpamOrganizationalUnitExclusion - - noSmithyDocumentSerde -} - -type ModifyIpamResourceDiscoveryOutput struct { - - // A resource discovery. - IpamResourceDiscovery *types.IpamResourceDiscovery - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIpamResourceDiscoveryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIpamResourceDiscovery{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIpamResourceDiscovery"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIpamResourceDiscoveryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIpamResourceDiscovery(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIpamResourceDiscovery(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIpamResourceDiscovery", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamScope.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamScope.go deleted file mode 100644 index c47c242d7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyIpamScope.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify an IPAM scope. -func (c *Client) ModifyIpamScope(ctx context.Context, params *ModifyIpamScopeInput, optFns ...func(*Options)) (*ModifyIpamScopeOutput, error) { - if params == nil { - params = &ModifyIpamScopeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyIpamScope", params, optFns, c.addOperationModifyIpamScopeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyIpamScopeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyIpamScopeInput struct { - - // The ID of the scope you want to modify. - // - // This member is required. - IpamScopeId *string - - // The description of the scope you want to modify. - Description *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyIpamScopeOutput struct { - - // The results of the modification. - IpamScope *types.IpamScope - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyIpamScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyIpamScope{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyIpamScope{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIpamScope"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyIpamScopeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIpamScope(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyIpamScope(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyIpamScope", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLaunchTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLaunchTemplate.go deleted file mode 100644 index aec93e538..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLaunchTemplate.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a launch template. You can specify which version of the launch -// template to set as the default version. When launching an instance, the default -// version applies when a launch template version is not specified. -func (c *Client) ModifyLaunchTemplate(ctx context.Context, params *ModifyLaunchTemplateInput, optFns ...func(*Options)) (*ModifyLaunchTemplateOutput, error) { - if params == nil { - params = &ModifyLaunchTemplateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyLaunchTemplate", params, optFns, c.addOperationModifyLaunchTemplateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyLaunchTemplateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyLaunchTemplateInput struct { - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. If a client token isn't specified, a randomly generated token is used - // in the request to ensure idempotency. - // - // For more information, see [Ensuring idempotency]. - // - // Constraint: Maximum 128 ASCII characters. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The version number of the launch template to set as the default version. - DefaultVersion *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateName *string - - noSmithyDocumentSerde -} - -type ModifyLaunchTemplateOutput struct { - - // Information about the launch template. - LaunchTemplate *types.LaunchTemplate - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyLaunchTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyLaunchTemplate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyLaunchTemplate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyLaunchTemplateMiddleware(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyLaunchTemplate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyLaunchTemplate struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyLaunchTemplate) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyLaunchTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyLaunchTemplateInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyLaunchTemplateInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyLaunchTemplateMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyLaunchTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyLaunchTemplate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyLaunchTemplate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLocalGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLocalGatewayRoute.go deleted file mode 100644 index f4c0ea688..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyLocalGatewayRoute.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified local gateway route. -func (c *Client) ModifyLocalGatewayRoute(ctx context.Context, params *ModifyLocalGatewayRouteInput, optFns ...func(*Options)) (*ModifyLocalGatewayRouteOutput, error) { - if params == nil { - params = &ModifyLocalGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyLocalGatewayRoute", params, optFns, c.addOperationModifyLocalGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyLocalGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyLocalGatewayRouteInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // The CIDR block used for destination matches. The value that you provide must - // match the CIDR of an existing route in the table. - DestinationCidrBlock *string - - // The ID of the prefix list. Use a prefix list in place of DestinationCidrBlock . - // You cannot use DestinationPrefixListId and DestinationCidrBlock in the same - // request. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The ID of the network interface. - NetworkInterfaceId *string - - noSmithyDocumentSerde -} - -type ModifyLocalGatewayRouteOutput struct { - - // Information about the local gateway route table. - Route *types.LocalGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyLocalGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyLocalGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyLocalGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyLocalGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyLocalGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyLocalGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyLocalGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyManagedPrefixList.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyManagedPrefixList.go deleted file mode 100644 index e732a83ae..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyManagedPrefixList.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified managed prefix list. -// -// Adding or removing entries in a prefix list creates a new version of the prefix -// list. Changing the name of the prefix list does not affect the version. -// -// If you specify a current version number that does not match the true current -// version number, the request fails. -func (c *Client) ModifyManagedPrefixList(ctx context.Context, params *ModifyManagedPrefixListInput, optFns ...func(*Options)) (*ModifyManagedPrefixListOutput, error) { - if params == nil { - params = &ModifyManagedPrefixListInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyManagedPrefixList", params, optFns, c.addOperationModifyManagedPrefixListMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyManagedPrefixListOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyManagedPrefixListInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // One or more entries to add to the prefix list. - AddEntries []types.AddPrefixListEntry - - // The current version of the prefix list. - CurrentVersion *int64 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of entries for the prefix list. You cannot modify the - // entries of a prefix list and modify the size of a prefix list at the same time. - // - // If any of the resources that reference the prefix list cannot support the new - // maximum size, the modify operation fails. Check the state message for the IDs of - // the first ten resources that do not support the new maximum size. - MaxEntries *int32 - - // A name for the prefix list. - PrefixListName *string - - // One or more entries to remove from the prefix list. - RemoveEntries []types.RemovePrefixListEntry - - noSmithyDocumentSerde -} - -type ModifyManagedPrefixListOutput struct { - - // Information about the prefix list. - PrefixList *types.ManagedPrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyManagedPrefixListMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyManagedPrefixList{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyManagedPrefixList"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyManagedPrefixListValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyManagedPrefixList(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyManagedPrefixList(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyManagedPrefixList", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go deleted file mode 100644 index 5491817ae..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified network interface attribute. You can specify only one -// attribute at a time. You can use this action to attach and detach security -// groups from an existing EC2 instance. -func (c *Client) ModifyNetworkInterfaceAttribute(ctx context.Context, params *ModifyNetworkInterfaceAttributeInput, optFns ...func(*Options)) (*ModifyNetworkInterfaceAttributeOutput, error) { - if params == nil { - params = &ModifyNetworkInterfaceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyNetworkInterfaceAttribute", params, optFns, c.addOperationModifyNetworkInterfaceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyNetworkInterfaceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ModifyNetworkInterfaceAttribute. -type ModifyNetworkInterfaceAttributeInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // Indicates whether to assign a public IPv4 address to a network interface. This - // option can be enabled for any network interface but will only apply to the - // primary network interface (eth0). - AssociatePublicIpAddress *bool - - // A list of subnet IDs to associate with the network interface. - AssociatedSubnetIds []string - - // Information about the interface attachment. If modifying the delete on - // termination attribute, you must specify the ID of the interface attachment. - Attachment *types.NetworkInterfaceAttachmentChanges - - // A connection tracking specification. - ConnectionTrackingSpecification *types.ConnectionTrackingSpecificationRequest - - // A description for the network interface. - Description *types.AttributeValue - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Updates the ENA Express configuration for the network interface that’s attached - // to the instance. - EnaSrdSpecification *types.EnaSrdSpecification - - // If you’re modifying a network interface in a dual-stack or IPv6-only subnet, - // you have the option to assign a primary IPv6 IP address. A primary IPv6 address - // is an IPv6 GUA address associated with an ENI that you have enabled to use a - // primary IPv6 address. Use this option if the instance that this ENI will be - // attached to relies on its IPv6 address not changing. Amazon Web Services will - // automatically assign an IPv6 address associated with the ENI attached to your - // instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to - // be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to - // be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address - // until the instance is terminated or the network interface is detached. If you - // have multiple IPv6 addresses associated with an ENI attached to your instance - // and you enable a primary IPv6 address, the first IPv6 GUA address associated - // with the ENI becomes the primary IPv6 address. - EnablePrimaryIpv6 *bool - - // Changes the security groups for the network interface. The new set of groups - // you specify replaces the current set. You must specify at least one group, even - // if it's just the default security group in the VPC. You must specify the ID of - // the security group, not the name. - Groups []string - - // Enable or disable source/destination checks, which ensure that the instance is - // either the source or the destination of any traffic that it receives. If the - // value is true , source/destination checks are enabled; otherwise, they are - // disabled. The default value is true . You must disable source/destination checks - // if the instance runs services such as network address translation, routing, or - // firewalls. - SourceDestCheck *types.AttributeBooleanValue - - noSmithyDocumentSerde -} - -type ModifyNetworkInterfaceAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyNetworkInterfaceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyNetworkInterfaceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyNetworkInterfaceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyNetworkInterfaceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyNetworkInterfaceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyNetworkInterfaceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPrivateDnsNameOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPrivateDnsNameOptions.go deleted file mode 100644 index db6750b86..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPrivateDnsNameOptions.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the options for instance hostnames for the specified instance. -func (c *Client) ModifyPrivateDnsNameOptions(ctx context.Context, params *ModifyPrivateDnsNameOptionsInput, optFns ...func(*Options)) (*ModifyPrivateDnsNameOptionsOutput, error) { - if params == nil { - params = &ModifyPrivateDnsNameOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyPrivateDnsNameOptions", params, optFns, c.addOperationModifyPrivateDnsNameOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyPrivateDnsNameOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyPrivateDnsNameOptionsInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS - // name must be based on the instance IPv4 address. For IPv6 only subnets, an - // instance DNS name must be based on the instance ID. For dual-stack subnets, you - // can specify whether DNS names use the instance IPv4 address or the instance ID. - PrivateDnsHostnameType types.HostnameType - - noSmithyDocumentSerde -} - -type ModifyPrivateDnsNameOptionsOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyPrivateDnsNameOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyPrivateDnsNameOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyPrivateDnsNameOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyPrivateDnsNameOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyPrivateDnsNameOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyPrivateDnsNameOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyPrivateDnsNameOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyPrivateDnsNameOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPublicIpDnsNameOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPublicIpDnsNameOptions.go deleted file mode 100644 index 5e667c7fc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyPublicIpDnsNameOptions.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify public hostname options for a network interface. For more information, -// see [EC2 instance hostnames, DNS names, and domains]in the Amazon EC2 User Guide. -// -// [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html -func (c *Client) ModifyPublicIpDnsNameOptions(ctx context.Context, params *ModifyPublicIpDnsNameOptionsInput, optFns ...func(*Options)) (*ModifyPublicIpDnsNameOptionsOutput, error) { - if params == nil { - params = &ModifyPublicIpDnsNameOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyPublicIpDnsNameOptions", params, optFns, c.addOperationModifyPublicIpDnsNameOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyPublicIpDnsNameOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyPublicIpDnsNameOptionsInput struct { - - // The public hostname type. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User - // Guide. - // - // - public-dual-stack-dns-name : A dual-stack public hostname for a network - // interface. Requests from within the VPC resolve to both the private IPv4 address - // and the IPv6 Global Unicast Address of the network interface. Requests from the - // internet resolve to both the public IPv4 and the IPv6 GUA address of the network - // interface. - // - // - public-ipv4-dns-name : An IPv4-enabled public hostname for a network - // interface. Requests from within the VPC resolve to the private primary IPv4 - // address of the network interface. Requests from the internet resolve to the - // public IPv4 address of the network interface. - // - // - public-ipv6-dns-name : An IPv6-enabled public hostname for a network - // interface. Requests from within the VPC or from the internet resolve to the IPv6 - // GUA of the network interface. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - // - // This member is required. - HostnameType types.PublicIpDnsOption - - // A network interface ID. - // - // This member is required. - NetworkInterfaceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyPublicIpDnsNameOptionsOutput struct { - - // Whether or not the request was successful. - Successful *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyPublicIpDnsNameOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyPublicIpDnsNameOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyPublicIpDnsNameOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyPublicIpDnsNameOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyPublicIpDnsNameOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyPublicIpDnsNameOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyPublicIpDnsNameOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyPublicIpDnsNameOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyReservedInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyReservedInstances.go deleted file mode 100644 index baa6b3a3c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyReservedInstances.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the configuration of your Reserved Instances, such as the Availability -// Zone, instance count, or instance type. The Reserved Instances to be modified -// must be identical, except for Availability Zone, network platform, and instance -// type. -// -// For more information, see [Modify Reserved Instances] in the Amazon EC2 User Guide. -// -// [Modify Reserved Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html -func (c *Client) ModifyReservedInstances(ctx context.Context, params *ModifyReservedInstancesInput, optFns ...func(*Options)) (*ModifyReservedInstancesOutput, error) { - if params == nil { - params = &ModifyReservedInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyReservedInstances", params, optFns, c.addOperationModifyReservedInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyReservedInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ModifyReservedInstances. -type ModifyReservedInstancesInput struct { - - // The IDs of the Reserved Instances to modify. - // - // This member is required. - ReservedInstancesIds []string - - // The configuration settings for the Reserved Instances to modify. - // - // This member is required. - TargetConfigurations []types.ReservedInstancesConfiguration - - // A unique, case-sensitive token you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - noSmithyDocumentSerde -} - -// Contains the output of ModifyReservedInstances. -type ModifyReservedInstancesOutput struct { - - // The ID for the modification. - ReservedInstancesModificationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyReservedInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyReservedInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyReservedInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyReservedInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyReservedInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyReservedInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyReservedInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyReservedInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyRouteServer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyRouteServer.go deleted file mode 100644 index 43566c5cd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyRouteServer.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the configuration of an existing route server. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// For more information see [Dynamic routing in your VPC with VPC Route Server] in the Amazon VPC User Guide. -// -// [Dynamic routing in your VPC with VPC Route Server]: https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -func (c *Client) ModifyRouteServer(ctx context.Context, params *ModifyRouteServerInput, optFns ...func(*Options)) (*ModifyRouteServerOutput, error) { - if params == nil { - params = &ModifyRouteServerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyRouteServer", params, optFns, c.addOperationModifyRouteServerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyRouteServerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyRouteServerInput struct { - - // The ID of the route server to modify. - // - // This member is required. - RouteServerId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies whether to persist routes after all BGP sessions are terminated. - // - // - enable: Routes will be persisted in FIB and RIB after all BGP sessions are - // terminated. - // - // - disable: Routes will not be persisted in FIB and RIB after all BGP sessions - // are terminated. - // - // - reset: If a route server has persisted routes due to all BGP sessions - // having ended, reset will withdraw all routes and reset route server to an empty - // FIB and RIB. - PersistRoutes types.RouteServerPersistRoutesAction - - // The number of minutes a route server will wait after BGP is re-established to - // unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. - // Required if PersistRoutes is enabled . - // - // If you set the duration to 1 minute, then when your network appliance - // re-establishes BGP with route server, it has 1 minute to relearn it's adjacent - // network and advertise those routes to route server before route server resumes - // normal functionality. In most cases, 1 minute is probably sufficient. If, - // however, you have concerns that your BGP network may not be capable of fully - // re-establishing and re-learning everything in 1 minute, you can increase the - // duration up to 5 minutes. - PersistRoutesDuration *int64 - - // Specifies whether to enable SNS notifications for route server events. Enabling - // SNS notifications persists BGP status changes to an SNS topic provisioned by - // Amazon Web Services. - SnsNotificationsEnabled *bool - - noSmithyDocumentSerde -} - -type ModifyRouteServerOutput struct { - - // Information about the modified route server. - RouteServer *types.RouteServer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyRouteServerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyRouteServer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyRouteServer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyRouteServer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyRouteServerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyRouteServer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyRouteServer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyRouteServer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySecurityGroupRules.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySecurityGroupRules.go deleted file mode 100644 index 6fdcf6bf4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySecurityGroupRules.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the rules of a security group. -func (c *Client) ModifySecurityGroupRules(ctx context.Context, params *ModifySecurityGroupRulesInput, optFns ...func(*Options)) (*ModifySecurityGroupRulesOutput, error) { - if params == nil { - params = &ModifySecurityGroupRulesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifySecurityGroupRules", params, optFns, c.addOperationModifySecurityGroupRulesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifySecurityGroupRulesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifySecurityGroupRulesInput struct { - - // The ID of the security group. - // - // This member is required. - GroupId *string - - // Information about the security group properties to update. - // - // This member is required. - SecurityGroupRules []types.SecurityGroupRuleUpdate - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifySecurityGroupRulesOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifySecurityGroupRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifySecurityGroupRules{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifySecurityGroupRules{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifySecurityGroupRules"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifySecurityGroupRulesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifySecurityGroupRules(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifySecurityGroupRules(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifySecurityGroupRules", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotAttribute.go deleted file mode 100644 index 7859686eb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotAttribute.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds or removes permission settings for the specified snapshot. You may add or -// remove specified Amazon Web Services account IDs from a snapshot's list of -// create volume permissions, but you cannot do both in a single operation. If you -// need to both add and remove account IDs for a snapshot, you must use multiple -// operations. You can make up to 500 modifications to a snapshot in a single -// operation. -// -// Encrypted snapshots and snapshots with Amazon Web Services Marketplace product -// codes cannot be made public. Snapshots encrypted with your default KMS key -// cannot be shared with other accounts. -// -// For more information about modifying snapshot permissions, see [Share a snapshot] in the Amazon -// EBS User Guide. -// -// [Share a snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html -func (c *Client) ModifySnapshotAttribute(ctx context.Context, params *ModifySnapshotAttributeInput, optFns ...func(*Options)) (*ModifySnapshotAttributeOutput, error) { - if params == nil { - params = &ModifySnapshotAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifySnapshotAttribute", params, optFns, c.addOperationModifySnapshotAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifySnapshotAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifySnapshotAttributeInput struct { - - // The ID of the snapshot. - // - // This member is required. - SnapshotId *string - - // The snapshot attribute to modify. Only volume creation permissions can be - // modified. - Attribute types.SnapshotAttributeName - - // A JSON representation of the snapshot attribute modification. - CreateVolumePermission *types.CreateVolumePermissionModifications - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The group to modify for the snapshot. - GroupNames []string - - // The type of operation to perform to the attribute. - OperationType types.OperationType - - // The account ID to modify for the snapshot. - UserIds []string - - noSmithyDocumentSerde -} - -type ModifySnapshotAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifySnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifySnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifySnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifySnapshotAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifySnapshotAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifySnapshotAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifySnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifySnapshotAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotTier.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotTier.go deleted file mode 100644 index f7a5638ab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySnapshotTier.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Archives an Amazon EBS snapshot. When you archive a snapshot, it is converted -// to a full snapshot that includes all of the blocks of data that were written to -// the volume at the time the snapshot was created, and moved from the standard -// tier to the archive tier. For more information, see [Archive Amazon EBS snapshots]in the Amazon EBS User -// Guide. -// -// [Archive Amazon EBS snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-archive.html -func (c *Client) ModifySnapshotTier(ctx context.Context, params *ModifySnapshotTierInput, optFns ...func(*Options)) (*ModifySnapshotTierOutput, error) { - if params == nil { - params = &ModifySnapshotTierInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifySnapshotTier", params, optFns, c.addOperationModifySnapshotTierMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifySnapshotTierOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifySnapshotTierInput struct { - - // The ID of the snapshot. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the storage tier. You must specify archive . - StorageTier types.TargetStorageTier - - noSmithyDocumentSerde -} - -type ModifySnapshotTierOutput struct { - - // The ID of the snapshot. - SnapshotId *string - - // The date and time when the archive process was started. - TieringStartTime *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifySnapshotTierMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifySnapshotTier{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifySnapshotTier{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifySnapshotTier"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifySnapshotTierValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifySnapshotTier(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifySnapshotTier(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifySnapshotTier", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySpotFleetRequest.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySpotFleetRequest.go deleted file mode 100644 index ade6b27e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySpotFleetRequest.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Spot Fleet request. -// -// You can only modify a Spot Fleet request of type maintain . -// -// While the Spot Fleet request is being modified, it is in the modifying state. -// -// To scale up your Spot Fleet, increase its target capacity. The Spot Fleet -// launches the additional Spot Instances according to the allocation strategy for -// the Spot Fleet request. If the allocation strategy is lowestPrice , the Spot -// Fleet launches instances using the Spot Instance pool with the lowest price. If -// the allocation strategy is diversified , the Spot Fleet distributes the -// instances across the Spot Instance pools. If the allocation strategy is -// capacityOptimized , Spot Fleet launches instances from Spot Instance pools with -// optimal capacity for the number of instances that are launching. -// -// To scale down your Spot Fleet, decrease its target capacity. First, the Spot -// Fleet cancels any open requests that exceed the new target capacity. You can -// request that the Spot Fleet terminate Spot Instances until the size of the fleet -// no longer exceeds the new target capacity. If the allocation strategy is -// lowestPrice , the Spot Fleet terminates the instances with the highest price per -// unit. If the allocation strategy is capacityOptimized , the Spot Fleet -// terminates the instances in the Spot Instance pools that have the least -// available Spot Instance capacity. If the allocation strategy is diversified , -// the Spot Fleet terminates instances across the Spot Instance pools. -// Alternatively, you can request that the Spot Fleet keep the fleet at its current -// size, but not replace any Spot Instances that are interrupted or that you -// terminate manually. -// -// If you are finished with your Spot Fleet for now, but will use it again later, -// you can set the target capacity to 0. -func (c *Client) ModifySpotFleetRequest(ctx context.Context, params *ModifySpotFleetRequestInput, optFns ...func(*Options)) (*ModifySpotFleetRequestOutput, error) { - if params == nil { - params = &ModifySpotFleetRequestInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifySpotFleetRequest", params, optFns, c.addOperationModifySpotFleetRequestMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifySpotFleetRequestOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ModifySpotFleetRequest. -type ModifySpotFleetRequestInput struct { - - // The ID of the Spot Fleet request. - // - // This member is required. - SpotFleetRequestId *string - - // Reserved. - Context *string - - // Indicates whether running instances should be terminated if the target capacity - // of the Spot Fleet request is decreased below the current size of the Spot Fleet. - // - // Supported only for fleets of type maintain . - ExcessCapacityTerminationPolicy types.ExcessCapacityTerminationPolicy - - // The launch template and overrides. You can only use this parameter if you - // specified a launch template ( LaunchTemplateConfigs ) in your Spot Fleet - // request. If you specified LaunchSpecifications in your Spot Fleet request, then - // omit this parameter. - LaunchTemplateConfigs []types.LaunchTemplateConfig - - // The number of On-Demand Instances in the fleet. - OnDemandTargetCapacity *int32 - - // The size of the fleet. - TargetCapacity *int32 - - noSmithyDocumentSerde -} - -// Contains the output of ModifySpotFleetRequest. -type ModifySpotFleetRequestOutput struct { - - // If the request succeeds, the response returns true . If the request fails, no - // response is returned, and instead an error message is returned. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifySpotFleetRequestMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifySpotFleetRequest{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifySpotFleetRequest{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifySpotFleetRequest"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifySpotFleetRequestValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifySpotFleetRequest(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifySpotFleetRequest(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifySpotFleetRequest", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySubnetAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySubnetAttribute.go deleted file mode 100644 index 084623a55..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifySubnetAttribute.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a subnet attribute. You can only modify one attribute at a time. -// -// Use this action to modify subnets on Amazon Web Services Outposts. -// -// - To modify a subnet on an Outpost rack, set both MapCustomerOwnedIpOnLaunch -// and CustomerOwnedIpv4Pool . These two parameters act as a single attribute. -// -// - To modify a subnet on an Outpost server, set either EnableLniAtDeviceIndex -// or DisableLniAtDeviceIndex . -// -// For more information about Amazon Web Services Outposts, see the following: -// -// [Outpost servers] -// -// [Outpost racks] -// -// [Outpost servers]: https://docs.aws.amazon.com/outposts/latest/userguide/how-servers-work.html -// [Outpost racks]: https://docs.aws.amazon.com/outposts/latest/userguide/how-racks-work.html -func (c *Client) ModifySubnetAttribute(ctx context.Context, params *ModifySubnetAttributeInput, optFns ...func(*Options)) (*ModifySubnetAttributeOutput, error) { - if params == nil { - params = &ModifySubnetAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifySubnetAttribute", params, optFns, c.addOperationModifySubnetAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifySubnetAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifySubnetAttributeInput struct { - - // The ID of the subnet. - // - // This member is required. - SubnetId *string - - // Specify true to indicate that network interfaces created in the specified - // subnet should be assigned an IPv6 address. This includes a network interface - // that's created when launching an instance into the subnet (the instance - // therefore receives an IPv6 address). - // - // If you enable the IPv6 addressing feature for your subnet, your network - // interface or instance only receives an IPv6 address if it's created using - // version 2016-11-15 or later of the Amazon EC2 API. - AssignIpv6AddressOnCreation *types.AttributeBooleanValue - - // The customer-owned IPv4 address pool associated with the subnet. - // - // You must set this value when you specify true for MapCustomerOwnedIpOnLaunch . - CustomerOwnedIpv4Pool *string - - // Specify true to indicate that local network interfaces at the current position - // should be disabled. - DisableLniAtDeviceIndex *types.AttributeBooleanValue - - // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this - // subnet should return synthetic IPv6 addresses for IPv4-only destinations. - // - // You must first configure a NAT gateway in a public subnet (separate from the - // subnet containing the IPv6-only workloads). For example, the subnet containing - // the NAT gateway should have a 0.0.0.0/0 route pointing to the internet gateway. - // For more information, see [Configure DNS64 and NAT64]in the Amazon VPC User Guide. - // - // [Configure DNS64 and NAT64]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html#nat-gateway-nat64-dns64-walkthrough - EnableDns64 *types.AttributeBooleanValue - - // Indicates the device position for local network interfaces in this subnet. For - // example, 1 indicates local network interfaces in this subnet are the secondary - // network interface (eth1). A local network interface cannot be the primary - // network interface (eth0). - EnableLniAtDeviceIndex *int32 - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecordOnLaunch *types.AttributeBooleanValue - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecordOnLaunch *types.AttributeBooleanValue - - // Specify true to indicate that network interfaces attached to instances created - // in the specified subnet should be assigned a customer-owned IPv4 address. - // - // When this value is true , you must specify the customer-owned IP pool using - // CustomerOwnedIpv4Pool . - MapCustomerOwnedIpOnLaunch *types.AttributeBooleanValue - - // Specify true to indicate that network interfaces attached to instances created - // in the specified subnet should be assigned a public IPv4 address. - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - MapPublicIpOnLaunch *types.AttributeBooleanValue - - // The type of hostname to assign to instances in the subnet at launch. For - // IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be - // based on the instance IPv4 address (ip-name) or the instance ID (resource-name). - // For IPv6 only subnets, an instance DNS name must be based on the instance ID - // (resource-name). - PrivateDnsHostnameTypeOnLaunch types.HostnameType - - noSmithyDocumentSerde -} - -type ModifySubnetAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifySubnetAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifySubnetAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifySubnetAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifySubnetAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifySubnetAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifySubnetAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifySubnetAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifySubnetAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterNetworkServices.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterNetworkServices.go deleted file mode 100644 index 0b0aff75a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterNetworkServices.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Allows or restricts mirroring network services. -// -// By default, Amazon DNS network services are not eligible for Traffic Mirror. -// Use AddNetworkServices to add network services to a Traffic Mirror filter. When -// a network service is added to the Traffic Mirror filter, all traffic related to -// that network service will be mirrored. When you no longer want to mirror network -// services, use RemoveNetworkServices to remove the network services from the -// Traffic Mirror filter. -func (c *Client) ModifyTrafficMirrorFilterNetworkServices(ctx context.Context, params *ModifyTrafficMirrorFilterNetworkServicesInput, optFns ...func(*Options)) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) { - if params == nil { - params = &ModifyTrafficMirrorFilterNetworkServicesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTrafficMirrorFilterNetworkServices", params, optFns, c.addOperationModifyTrafficMirrorFilterNetworkServicesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTrafficMirrorFilterNetworkServicesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTrafficMirrorFilterNetworkServicesInput struct { - - // The ID of the Traffic Mirror filter. - // - // This member is required. - TrafficMirrorFilterId *string - - // The network service, for example Amazon DNS, that you want to mirror. - AddNetworkServices []types.TrafficMirrorNetworkService - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The network service, for example Amazon DNS, that you no longer want to mirror. - RemoveNetworkServices []types.TrafficMirrorNetworkService - - noSmithyDocumentSerde -} - -type ModifyTrafficMirrorFilterNetworkServicesOutput struct { - - // The Traffic Mirror filter that the network service is associated with. - TrafficMirrorFilter *types.TrafficMirrorFilter - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTrafficMirrorFilterNetworkServicesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTrafficMirrorFilterNetworkServices{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTrafficMirrorFilterNetworkServices"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTrafficMirrorFilterNetworkServicesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTrafficMirrorFilterNetworkServices(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTrafficMirrorFilterNetworkServices(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTrafficMirrorFilterNetworkServices", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterRule.go deleted file mode 100644 index d53823b59..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorFilterRule.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Traffic Mirror rule. -// -// DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an IPv6 -// range. -func (c *Client) ModifyTrafficMirrorFilterRule(ctx context.Context, params *ModifyTrafficMirrorFilterRuleInput, optFns ...func(*Options)) (*ModifyTrafficMirrorFilterRuleOutput, error) { - if params == nil { - params = &ModifyTrafficMirrorFilterRuleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTrafficMirrorFilterRule", params, optFns, c.addOperationModifyTrafficMirrorFilterRuleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTrafficMirrorFilterRuleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTrafficMirrorFilterRuleInput struct { - - // The ID of the Traffic Mirror rule. - // - // This member is required. - TrafficMirrorFilterRuleId *string - - // The description to assign to the Traffic Mirror rule. - Description *string - - // The destination CIDR block to assign to the Traffic Mirror rule. - DestinationCidrBlock *string - - // The destination ports that are associated with the Traffic Mirror rule. - DestinationPortRange *types.TrafficMirrorPortRangeRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The protocol, for example TCP, to assign to the Traffic Mirror rule. - Protocol *int32 - - // The properties that you want to remove from the Traffic Mirror filter rule. - // - // When you remove a property from a Traffic Mirror filter rule, the property is - // set to the default. - RemoveFields []types.TrafficMirrorFilterRuleField - - // The action to assign to the rule. - RuleAction types.TrafficMirrorRuleAction - - // The number of the Traffic Mirror rule. This number must be unique for each - // Traffic Mirror rule in a given direction. The rules are processed in ascending - // order by rule number. - RuleNumber *int32 - - // The source CIDR block to assign to the Traffic Mirror rule. - SourceCidrBlock *string - - // The port range to assign to the Traffic Mirror rule. - SourcePortRange *types.TrafficMirrorPortRangeRequest - - // The type of traffic to assign to the rule. - TrafficDirection types.TrafficDirection - - noSmithyDocumentSerde -} - -type ModifyTrafficMirrorFilterRuleOutput struct { - - // Tags are not returned for ModifyTrafficMirrorFilterRule. - // - // A Traffic Mirror rule. - TrafficMirrorFilterRule *types.TrafficMirrorFilterRule - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTrafficMirrorFilterRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTrafficMirrorFilterRule{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTrafficMirrorFilterRule"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTrafficMirrorFilterRuleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTrafficMirrorFilterRule(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTrafficMirrorFilterRule(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTrafficMirrorFilterRule", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorSession.go deleted file mode 100644 index 42dc53e19..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTrafficMirrorSession.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a Traffic Mirror session. -func (c *Client) ModifyTrafficMirrorSession(ctx context.Context, params *ModifyTrafficMirrorSessionInput, optFns ...func(*Options)) (*ModifyTrafficMirrorSessionOutput, error) { - if params == nil { - params = &ModifyTrafficMirrorSessionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTrafficMirrorSession", params, optFns, c.addOperationModifyTrafficMirrorSessionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTrafficMirrorSessionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTrafficMirrorSessionInput struct { - - // The ID of the Traffic Mirror session. - // - // This member is required. - TrafficMirrorSessionId *string - - // The description to assign to the Traffic Mirror session. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The number of bytes in each packet to mirror. These are bytes after the VXLAN - // header. To mirror a subset, set this to the length (in bytes) to mirror. For - // example, if you set this value to 100, then the first 100 bytes that meet the - // filter criteria are copied to the target. Do not specify this parameter when you - // want to mirror the entire packet. - // - // For sessions with Network Load Balancer (NLB) traffic mirror targets, the - // default PacketLength will be set to 8500. Valid values are 1-8500. Setting a - // PacketLength greater than 8500 will result in an error response. - PacketLength *int32 - - // The properties that you want to remove from the Traffic Mirror session. - // - // When you remove a property from a Traffic Mirror session, the property is set - // to the default. - RemoveFields []types.TrafficMirrorSessionField - - // The session number determines the order in which sessions are evaluated when an - // interface is used by multiple sessions. The first session with a matching filter - // is the one that mirrors the packets. - // - // Valid values are 1-32766. - SessionNumber *int32 - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterId *string - - // The Traffic Mirror target. The target must be in the same VPC as the source, or - // have a VPC peering connection with the source. - TrafficMirrorTargetId *string - - // The virtual network ID of the Traffic Mirror session. - VirtualNetworkId *int32 - - noSmithyDocumentSerde -} - -type ModifyTrafficMirrorSessionOutput struct { - - // Information about the Traffic Mirror session. - TrafficMirrorSession *types.TrafficMirrorSession - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTrafficMirrorSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTrafficMirrorSession{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTrafficMirrorSession"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTrafficMirrorSessionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTrafficMirrorSession(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTrafficMirrorSession(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTrafficMirrorSession", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGateway.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGateway.go deleted file mode 100644 index 60e23b5cf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGateway.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified transit gateway. When you modify a transit gateway, the -// modified options are applied to new transit gateway attachments only. Your -// existing transit gateway attachments are not modified. -func (c *Client) ModifyTransitGateway(ctx context.Context, params *ModifyTransitGatewayInput, optFns ...func(*Options)) (*ModifyTransitGatewayOutput, error) { - if params == nil { - params = &ModifyTransitGatewayInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTransitGateway", params, optFns, c.addOperationModifyTransitGatewayMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTransitGatewayOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTransitGatewayInput struct { - - // The ID of the transit gateway. - // - // This member is required. - TransitGatewayId *string - - // The description for the transit gateway. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The options to modify. - Options *types.ModifyTransitGatewayOptions - - noSmithyDocumentSerde -} - -type ModifyTransitGatewayOutput struct { - - // Information about the transit gateway. - TransitGateway *types.TransitGateway - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTransitGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTransitGateway{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTransitGateway{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTransitGateway"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTransitGatewayValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTransitGateway(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTransitGateway(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTransitGateway", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayPrefixListReference.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayPrefixListReference.go deleted file mode 100644 index 9e4ea672b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayPrefixListReference.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a reference (route) to a prefix list in a specified transit gateway -// route table. -func (c *Client) ModifyTransitGatewayPrefixListReference(ctx context.Context, params *ModifyTransitGatewayPrefixListReferenceInput, optFns ...func(*Options)) (*ModifyTransitGatewayPrefixListReferenceOutput, error) { - if params == nil { - params = &ModifyTransitGatewayPrefixListReferenceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTransitGatewayPrefixListReference", params, optFns, c.addOperationModifyTransitGatewayPrefixListReferenceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTransitGatewayPrefixListReferenceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTransitGatewayPrefixListReferenceInput struct { - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Indicates whether to drop traffic that matches this route. - Blackhole *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment to which traffic is routed. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -type ModifyTransitGatewayPrefixListReferenceOutput struct { - - // Information about the prefix list reference. - TransitGatewayPrefixListReference *types.TransitGatewayPrefixListReference - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTransitGatewayPrefixListReferenceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTransitGatewayPrefixListReference"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTransitGatewayPrefixListReferenceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTransitGatewayPrefixListReference(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTransitGatewayPrefixListReference(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTransitGatewayPrefixListReference", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayVpcAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayVpcAttachment.go deleted file mode 100644 index 47cb7f654..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyTransitGatewayVpcAttachment.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified VPC attachment. -func (c *Client) ModifyTransitGatewayVpcAttachment(ctx context.Context, params *ModifyTransitGatewayVpcAttachmentInput, optFns ...func(*Options)) (*ModifyTransitGatewayVpcAttachmentOutput, error) { - if params == nil { - params = &ModifyTransitGatewayVpcAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyTransitGatewayVpcAttachment", params, optFns, c.addOperationModifyTransitGatewayVpcAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyTransitGatewayVpcAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyTransitGatewayVpcAttachmentInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // The IDs of one or more subnets to add. You can specify at most one subnet per - // Availability Zone. - AddSubnetIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The new VPC attachment options. - Options *types.ModifyTransitGatewayVpcAttachmentRequestOptions - - // The IDs of one or more subnets to remove. - RemoveSubnetIds []string - - noSmithyDocumentSerde -} - -type ModifyTransitGatewayVpcAttachmentOutput struct { - - // Information about the modified attachment. - TransitGatewayVpcAttachment *types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyTransitGatewayVpcAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTransitGatewayVpcAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyTransitGatewayVpcAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTransitGatewayVpcAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyTransitGatewayVpcAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyTransitGatewayVpcAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpoint.go deleted file mode 100644 index 5e55777e4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpoint.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the configuration of the specified Amazon Web Services Verified Access -// endpoint. -func (c *Client) ModifyVerifiedAccessEndpoint(ctx context.Context, params *ModifyVerifiedAccessEndpointInput, optFns ...func(*Options)) (*ModifyVerifiedAccessEndpointOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessEndpoint", params, optFns, c.addOperationModifyVerifiedAccessEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessEndpointInput struct { - - // The ID of the Verified Access endpoint. - // - // This member is required. - VerifiedAccessEndpointId *string - - // The CIDR options. - CidrOptions *types.ModifyVerifiedAccessEndpointCidrOptions - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access endpoint. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The load balancer details if creating the Verified Access endpoint as - // load-balancer type. - LoadBalancerOptions *types.ModifyVerifiedAccessEndpointLoadBalancerOptions - - // The network interface options. - NetworkInterfaceOptions *types.ModifyVerifiedAccessEndpointEniOptions - - // The RDS options. - RdsOptions *types.ModifyVerifiedAccessEndpointRdsOptions - - // The ID of the Verified Access group. - VerifiedAccessGroupId *string - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessEndpointOutput struct { - - // Details about the Verified Access endpoint. - VerifiedAccessEndpoint *types.VerifiedAccessEndpoint - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessEndpoint struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessEndpoint) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessEndpointInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessEndpointMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpointPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpointPolicy.go deleted file mode 100644 index 28d75f54d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessEndpointPolicy.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Amazon Web Services Verified Access endpoint policy. -func (c *Client) ModifyVerifiedAccessEndpointPolicy(ctx context.Context, params *ModifyVerifiedAccessEndpointPolicyInput, optFns ...func(*Options)) (*ModifyVerifiedAccessEndpointPolicyOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessEndpointPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessEndpointPolicy", params, optFns, c.addOperationModifyVerifiedAccessEndpointPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessEndpointPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessEndpointPolicyInput struct { - - // The ID of the Verified Access endpoint. - // - // This member is required. - VerifiedAccessEndpointId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessEndpointPolicyOutput struct { - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // The options in use for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationResponse - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessEndpointPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessEndpointPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessEndpointPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessEndpointPolicyMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessEndpointPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessEndpointPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessEndpointPolicy struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessEndpointPolicy) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessEndpointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessEndpointPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessEndpointPolicyInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessEndpointPolicyMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessEndpointPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessEndpointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessEndpointPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroup.go deleted file mode 100644 index 36eb30823..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroup.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Amazon Web Services Verified Access group configuration. -func (c *Client) ModifyVerifiedAccessGroup(ctx context.Context, params *ModifyVerifiedAccessGroupInput, optFns ...func(*Options)) (*ModifyVerifiedAccessGroupOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessGroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessGroup", params, optFns, c.addOperationModifyVerifiedAccessGroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessGroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessGroupInput struct { - - // The ID of the Verified Access group. - // - // This member is required. - VerifiedAccessGroupId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access group. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessGroupOutput struct { - - // Details about the Verified Access group. - VerifiedAccessGroup *types.VerifiedAccessGroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessGroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessGroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessGroupMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessGroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessGroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessGroup struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessGroup) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessGroupInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessGroupMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessGroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessGroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroupPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroupPolicy.go deleted file mode 100644 index 2b9352893..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessGroupPolicy.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified Amazon Web Services Verified Access group policy. -func (c *Client) ModifyVerifiedAccessGroupPolicy(ctx context.Context, params *ModifyVerifiedAccessGroupPolicyInput, optFns ...func(*Options)) (*ModifyVerifiedAccessGroupPolicyOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessGroupPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessGroupPolicy", params, optFns, c.addOperationModifyVerifiedAccessGroupPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessGroupPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessGroupPolicyInput struct { - - // The ID of the Verified Access group. - // - // This member is required. - VerifiedAccessGroupId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessGroupPolicyOutput struct { - - // The Verified Access policy document. - PolicyDocument *string - - // The status of the Verified Access policy. - PolicyEnabled *bool - - // The options in use for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationResponse - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessGroupPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessGroupPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessGroupPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessGroupPolicyMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessGroupPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessGroupPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessGroupPolicy struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessGroupPolicy) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessGroupPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessGroupPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessGroupPolicyInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessGroupPolicyMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessGroupPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessGroupPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessGroupPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstance.go deleted file mode 100644 index 492d54e4e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstance.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the configuration of the specified Amazon Web Services Verified Access -// instance. -func (c *Client) ModifyVerifiedAccessInstance(ctx context.Context, params *ModifyVerifiedAccessInstanceInput, optFns ...func(*Options)) (*ModifyVerifiedAccessInstanceOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessInstanceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessInstance", params, optFns, c.addOperationModifyVerifiedAccessInstanceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessInstanceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessInstanceInput struct { - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // The custom subdomain. - CidrEndpointsCustomSubDomain *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access instance. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessInstanceOutput struct { - - // Details about the Verified Access instance. - VerifiedAccessInstance *types.VerifiedAccessInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessInstance{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessInstance"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessInstanceMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessInstanceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessInstance(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessInstance struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessInstance) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessInstanceInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessInstanceMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessInstance{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessInstance(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessInstance", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstanceLoggingConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstanceLoggingConfiguration.go deleted file mode 100644 index ca23d8f2e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessInstanceLoggingConfiguration.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the logging configuration for the specified Amazon Web Services -// Verified Access instance. -func (c *Client) ModifyVerifiedAccessInstanceLoggingConfiguration(ctx context.Context, params *ModifyVerifiedAccessInstanceLoggingConfigurationInput, optFns ...func(*Options)) (*ModifyVerifiedAccessInstanceLoggingConfigurationOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessInstanceLoggingConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessInstanceLoggingConfiguration", params, optFns, c.addOperationModifyVerifiedAccessInstanceLoggingConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessInstanceLoggingConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessInstanceLoggingConfigurationInput struct { - - // The configuration options for Verified Access instances. - // - // This member is required. - AccessLogs *types.VerifiedAccessLogOptions - - // The ID of the Verified Access instance. - // - // This member is required. - VerifiedAccessInstanceId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessInstanceLoggingConfigurationOutput struct { - - // The logging configuration for the Verified Access instance. - LoggingConfiguration *types.VerifiedAccessInstanceLoggingConfiguration - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessInstanceLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessInstanceLoggingConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessInstanceLoggingConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessInstanceLoggingConfigurationMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessInstanceLoggingConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessInstanceLoggingConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessInstanceLoggingConfiguration struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessInstanceLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessInstanceLoggingConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessInstanceLoggingConfigurationInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessInstanceLoggingConfigurationMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessInstanceLoggingConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessInstanceLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessInstanceLoggingConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessTrustProvider.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessTrustProvider.go deleted file mode 100644 index 5e8be30d6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVerifiedAccessTrustProvider.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the configuration of the specified Amazon Web Services Verified Access -// trust provider. -func (c *Client) ModifyVerifiedAccessTrustProvider(ctx context.Context, params *ModifyVerifiedAccessTrustProviderInput, optFns ...func(*Options)) (*ModifyVerifiedAccessTrustProviderOutput, error) { - if params == nil { - params = &ModifyVerifiedAccessTrustProviderInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVerifiedAccessTrustProvider", params, optFns, c.addOperationModifyVerifiedAccessTrustProviderMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVerifiedAccessTrustProviderOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVerifiedAccessTrustProviderInput struct { - - // The ID of the Verified Access trust provider. - // - // This member is required. - VerifiedAccessTrustProviderId *string - - // A unique, case-sensitive token that you provide to ensure idempotency of your - // modification request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A description for the Verified Access trust provider. - Description *string - - // The options for a device-based trust provider. This parameter is required when - // the provider type is device . - DeviceOptions *types.ModifyVerifiedAccessTrustProviderDeviceOptions - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The OpenID Connect (OIDC) options. - NativeApplicationOidcOptions *types.ModifyVerifiedAccessNativeApplicationOidcOptions - - // The options for an OpenID Connect-compatible user-identity trust provider. - OidcOptions *types.ModifyVerifiedAccessTrustProviderOidcOptions - - // The options for server side encryption. - SseSpecification *types.VerifiedAccessSseSpecificationRequest - - noSmithyDocumentSerde -} - -type ModifyVerifiedAccessTrustProviderOutput struct { - - // Details about the Verified Access trust provider. - VerifiedAccessTrustProvider *types.VerifiedAccessTrustProvider - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVerifiedAccessTrustProviderMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVerifiedAccessTrustProvider"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opModifyVerifiedAccessTrustProviderMiddleware(stack, options); err != nil { - return err - } - if err = addOpModifyVerifiedAccessTrustProviderValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVerifiedAccessTrustProvider(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpModifyVerifiedAccessTrustProvider struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpModifyVerifiedAccessTrustProvider) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpModifyVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ModifyVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ModifyVerifiedAccessTrustProviderInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opModifyVerifiedAccessTrustProviderMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpModifyVerifiedAccessTrustProvider{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opModifyVerifiedAccessTrustProvider(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVerifiedAccessTrustProvider", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolume.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolume.go deleted file mode 100644 index ce905f1fa..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolume.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// You can modify several parameters of an existing EBS volume, including volume -// size, volume type, and IOPS capacity. If your EBS volume is attached to a -// current-generation EC2 instance type, you might be able to apply these changes -// without stopping the instance or detaching the volume from it. For more -// information about modifying EBS volumes, see [Amazon EBS Elastic Volumes]in the Amazon EBS User Guide. -// -// When you complete a resize operation on your volume, you need to extend the -// volume's file-system size to take advantage of the new storage capacity. For -// more information, see [Extend the file system]. -// -// For more information, see [Monitor the progress of volume modifications] in the Amazon EBS User Guide. -// -// With previous-generation instance types, resizing an EBS volume might require -// detaching and reattaching the volume or stopping and restarting the instance. -// -// After modifying a volume, you must wait at least six hours and ensure that the -// volume is in the in-use or available state before you can modify the same -// volume. This is sometimes referred to as a cooldown period. -// -// [Monitor the progress of volume modifications]: https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html -// [Amazon EBS Elastic Volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modify-volume.html -// [Extend the file system]: https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html -func (c *Client) ModifyVolume(ctx context.Context, params *ModifyVolumeInput, optFns ...func(*Options)) (*ModifyVolumeOutput, error) { - if params == nil { - params = &ModifyVolumeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVolume", params, optFns, c.addOperationModifyVolumeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVolumeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVolumeInput struct { - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The target IOPS rate of the volume. This parameter is valid only for gp3 , io1 , - // and io2 volumes. - // - // The following are the supported values for each volume type: - // - // - gp3 : 3,000 - 16,000 IOPS - // - // - io1 : 100 - 64,000 IOPS - // - // - io2 : 100 - 256,000 IOPS - // - // For io2 volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System]. On other instances, - // you can achieve performance up to 32,000 IOPS. - // - // Default: The existing value is retained if you keep the same volume type. If - // you change the volume type to io1 , io2 , or gp3 , the default is 3,000. - // - // [instances built on the Nitro System]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - Iops *int32 - - // Specifies whether to enable Amazon EBS Multi-Attach. If you enable - // Multi-Attach, you can attach the volume to up to 16 [Nitro-based instances]in the same Availability - // Zone. This parameter is supported with io1 and io2 volumes only. For more - // information, see [Amazon EBS Multi-Attach]in the Amazon EBS User Guide. - // - // [Amazon EBS Multi-Attach]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html - // [Nitro-based instances]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - MultiAttachEnabled *bool - - // The target size of the volume, in GiB. The target volume size must be greater - // than or equal to the existing size of the volume. - // - // The following are the supported volumes sizes for each volume type: - // - // - gp2 and gp3 : 1 - 16,384 GiB - // - // - io1 : 4 - 16,384 GiB - // - // - io2 : 4 - 65,536 GiB - // - // - st1 and sc1 : 125 - 16,384 GiB - // - // - standard : 1 - 1024 GiB - // - // Default: The existing size is retained. - Size *int32 - - // The target throughput of the volume, in MiB/s. This parameter is valid only for - // gp3 volumes. The maximum value is 1,000. - // - // Default: The existing value is retained if the source and target volume type is - // gp3 . Otherwise, the default value is 125. - // - // Valid Range: Minimum value of 125. Maximum value of 1000. - Throughput *int32 - - // The target EBS volume type of the volume. For more information, see [Amazon EBS volume types] in the - // Amazon EBS User Guide. - // - // Default: The existing type is retained. - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType types.VolumeType - - noSmithyDocumentSerde -} - -type ModifyVolumeOutput struct { - - // Information about the volume modification. - VolumeModification *types.VolumeModification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVolume{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVolume{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVolume"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVolumeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVolume(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVolume(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVolume", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolumeAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolumeAttribute.go deleted file mode 100644 index c15a08d12..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVolumeAttribute.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a volume attribute. -// -// By default, all I/O operations for the volume are suspended when the data on -// the volume is determined to be potentially inconsistent, to prevent -// undetectable, latent data corruption. The I/O access to the volume can be -// resumed by first enabling I/O access and then checking the data consistency on -// your volume. -// -// You can change the default behavior to resume I/O operations. We recommend that -// you change this only for boot volumes or for volumes that are stateless or -// disposable. -func (c *Client) ModifyVolumeAttribute(ctx context.Context, params *ModifyVolumeAttributeInput, optFns ...func(*Options)) (*ModifyVolumeAttributeOutput, error) { - if params == nil { - params = &ModifyVolumeAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVolumeAttribute", params, optFns, c.addOperationModifyVolumeAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVolumeAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVolumeAttributeInput struct { - - // The ID of the volume. - // - // This member is required. - VolumeId *string - - // Indicates whether the volume should be auto-enabled for I/O operations. - AutoEnableIO *types.AttributeBooleanValue - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVolumeAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVolumeAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVolumeAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVolumeAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVolumeAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVolumeAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVolumeAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVolumeAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVolumeAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcAttribute.go deleted file mode 100644 index d75e7d116..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcAttribute.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the specified attribute of the specified VPC. -func (c *Client) ModifyVpcAttribute(ctx context.Context, params *ModifyVpcAttributeInput, optFns ...func(*Options)) (*ModifyVpcAttributeOutput, error) { - if params == nil { - params = &ModifyVpcAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcAttribute", params, optFns, c.addOperationModifyVpcAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcAttributeInput struct { - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the same - // request. Use separate requests for each attribute. You can only enable DNS - // hostnames if you've enabled DNS support. - EnableDnsHostnames *types.AttributeBooleanValue - - // Indicates whether the DNS resolution is supported for the VPC. If enabled, - // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or - // the reserved IP address at the base of the VPC network range "plus two" succeed. - // If disabled, the Amazon provided DNS service in the VPC that resolves public DNS - // hostnames to IP addresses is not enabled. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the same - // request. Use separate requests for each attribute. - EnableDnsSupport *types.AttributeBooleanValue - - // Indicates whether Network Address Usage metrics are enabled for your VPC. - EnableNetworkAddressUsageMetrics *types.AttributeBooleanValue - - noSmithyDocumentSerde -} - -type ModifyVpcAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go deleted file mode 100644 index b70c3f466..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify VPC Block Public Access (BPA) exclusions. A VPC BPA exclusion is a mode -// that can be applied to a single VPC or subnet that exempts it from the account’s -// BPA mode and will allow bidirectional or egress-only access. You can create BPA -// exclusions for VPCs and subnets even when BPA is not enabled on the account to -// ensure that there is no traffic disruption to the exclusions when VPC BPA is -// turned on. -func (c *Client) ModifyVpcBlockPublicAccessExclusion(ctx context.Context, params *ModifyVpcBlockPublicAccessExclusionInput, optFns ...func(*Options)) (*ModifyVpcBlockPublicAccessExclusionOutput, error) { - if params == nil { - params = &ModifyVpcBlockPublicAccessExclusionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcBlockPublicAccessExclusion", params, optFns, c.addOperationModifyVpcBlockPublicAccessExclusionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcBlockPublicAccessExclusionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcBlockPublicAccessExclusionInput struct { - - // The ID of an exclusion. - // - // This member is required. - ExclusionId *string - - // The exclusion mode for internet gateway traffic. - // - // - allow-bidirectional : Allow all internet traffic to and from the excluded - // VPCs and subnets. - // - // - allow-egress : Allow outbound internet traffic from the excluded VPCs and - // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only - // applies when VPC Block Public Access is set to Bidirectional. - // - // This member is required. - InternetGatewayExclusionMode types.InternetGatewayExclusionMode - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpcBlockPublicAccessExclusionOutput struct { - - // Details related to the exclusion. - VpcBlockPublicAccessExclusion *types.VpcBlockPublicAccessExclusion - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcBlockPublicAccessExclusionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcBlockPublicAccessExclusion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcBlockPublicAccessExclusion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcBlockPublicAccessExclusionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcBlockPublicAccessExclusion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcBlockPublicAccessExclusion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcBlockPublicAccessExclusion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go deleted file mode 100644 index 0bfd6b6f6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modify VPC Block Public Access (BPA) options. VPC Block Public Access (BPA) -// enables you to block resources in VPCs and subnets that you own in a Region from -// reaching or being reached from the internet through internet gateways and -// egress-only internet gateways. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon -// VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -func (c *Client) ModifyVpcBlockPublicAccessOptions(ctx context.Context, params *ModifyVpcBlockPublicAccessOptionsInput, optFns ...func(*Options)) (*ModifyVpcBlockPublicAccessOptionsOutput, error) { - if params == nil { - params = &ModifyVpcBlockPublicAccessOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcBlockPublicAccessOptions", params, optFns, c.addOperationModifyVpcBlockPublicAccessOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcBlockPublicAccessOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcBlockPublicAccessOptionsInput struct { - - // The mode of VPC BPA. - // - // - off : VPC BPA is not enabled and traffic is allowed to and from internet - // gateways and egress-only internet gateways in this Region. - // - // - block-bidirectional : Block all traffic to and from internet gateways and - // egress-only internet gateways in this Region (except for excluded VPCs and - // subnets). - // - // - block-ingress : Block all internet traffic to the VPCs in this Region - // (except for VPCs or subnets which are excluded). Only traffic to and from NAT - // gateways and egress-only internet gateways is allowed because these gateways - // only allow outbound connections to be established. - // - // This member is required. - InternetGatewayBlockMode types.InternetGatewayBlockMode - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpcBlockPublicAccessOptionsOutput struct { - - // Details related to the VPC Block Public Access (BPA) options. - VpcBlockPublicAccessOptions *types.VpcBlockPublicAccessOptions - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcBlockPublicAccessOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcBlockPublicAccessOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcBlockPublicAccessOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcBlockPublicAccessOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcBlockPublicAccessOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcBlockPublicAccessOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcBlockPublicAccessOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcBlockPublicAccessOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpoint.go deleted file mode 100644 index 19f783008..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpoint.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies attributes of a specified VPC endpoint. The attributes that you can -// modify depend on the type of VPC endpoint (interface, gateway, or Gateway Load -// Balancer). For more information, see the [Amazon Web Services PrivateLink Guide]. -// -// [Amazon Web Services PrivateLink Guide]: https://docs.aws.amazon.com/vpc/latest/privatelink/ -func (c *Client) ModifyVpcEndpoint(ctx context.Context, params *ModifyVpcEndpointInput, optFns ...func(*Options)) (*ModifyVpcEndpointOutput, error) { - if params == nil { - params = &ModifyVpcEndpointInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpoint", params, optFns, c.addOperationModifyVpcEndpointMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcEndpointOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcEndpointInput struct { - - // The ID of the endpoint. - // - // This member is required. - VpcEndpointId *string - - // (Gateway endpoint) The IDs of the route tables to associate with the endpoint. - AddRouteTableIds []string - - // (Interface endpoint) The IDs of the security groups to associate with the - // endpoint network interfaces. - AddSecurityGroupIds []string - - // (Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which - // to serve the endpoint. For a Gateway Load Balancer endpoint, you can specify - // only one subnet. - AddSubnetIds []string - - // The DNS options for the endpoint. - DnsOptions *types.DnsOptionsSpecification - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address type for the endpoint. - IpAddressType types.IpAddressType - - // (Interface and gateway endpoints) A policy to attach to the endpoint that - // controls access to the service. The policy must be in valid JSON format. - PolicyDocument *string - - // (Interface endpoint) Indicates whether a private hosted zone is associated with - // the VPC. - PrivateDnsEnabled *bool - - // (Gateway endpoint) The IDs of the route tables to disassociate from the - // endpoint. - RemoveRouteTableIds []string - - // (Interface endpoint) The IDs of the security groups to disassociate from the - // endpoint network interfaces. - RemoveSecurityGroupIds []string - - // (Interface endpoint) The IDs of the subnets from which to remove the endpoint. - RemoveSubnetIds []string - - // (Gateway endpoint) Specify true to reset the policy document to the default - // policy. The default policy allows full access to the service. - ResetPolicy *bool - - // The subnet configurations for the endpoint. - SubnetConfigurations []types.SubnetConfiguration - - noSmithyDocumentSerde -} - -type ModifyVpcEndpointOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpoint{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpoint{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcEndpoint"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcEndpointValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpoint(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcEndpoint", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointConnectionNotification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointConnectionNotification.go deleted file mode 100644 index 34ad32959..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointConnectionNotification.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies a connection notification for VPC endpoint or VPC endpoint service. -// You can change the SNS topic for the notification, or the events for which to be -// notified. -func (c *Client) ModifyVpcEndpointConnectionNotification(ctx context.Context, params *ModifyVpcEndpointConnectionNotificationInput, optFns ...func(*Options)) (*ModifyVpcEndpointConnectionNotificationOutput, error) { - if params == nil { - params = &ModifyVpcEndpointConnectionNotificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpointConnectionNotification", params, optFns, c.addOperationModifyVpcEndpointConnectionNotificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcEndpointConnectionNotificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcEndpointConnectionNotificationInput struct { - - // The ID of the notification. - // - // This member is required. - ConnectionNotificationId *string - - // The events for the endpoint. Valid values are Accept , Connect , Delete , and - // Reject . - ConnectionEvents []string - - // The ARN for the SNS topic for the notification. - ConnectionNotificationArn *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpcEndpointConnectionNotificationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcEndpointConnectionNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpointConnectionNotification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcEndpointConnectionNotification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcEndpointConnectionNotificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpointConnectionNotification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcEndpointConnectionNotification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcEndpointConnectionNotification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServiceConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServiceConfiguration.go deleted file mode 100644 index f47c1d0db..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServiceConfiguration.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the attributes of the specified VPC endpoint service configuration. -// -// If you set or modify the private DNS name, you must prove that you own the -// private DNS domain name. -func (c *Client) ModifyVpcEndpointServiceConfiguration(ctx context.Context, params *ModifyVpcEndpointServiceConfigurationInput, optFns ...func(*Options)) (*ModifyVpcEndpointServiceConfigurationOutput, error) { - if params == nil { - params = &ModifyVpcEndpointServiceConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpointServiceConfiguration", params, optFns, c.addOperationModifyVpcEndpointServiceConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcEndpointServiceConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcEndpointServiceConfigurationInput struct { - - // The ID of the service. - // - // This member is required. - ServiceId *string - - // Indicates whether requests to create an endpoint to the service must be - // accepted. - AcceptanceRequired *bool - - // The Amazon Resource Names (ARNs) of Gateway Load Balancers to add to the - // service configuration. - AddGatewayLoadBalancerArns []string - - // The Amazon Resource Names (ARNs) of Network Load Balancers to add to the - // service configuration. - AddNetworkLoadBalancerArns []string - - // The IP address types to add to the service configuration. - AddSupportedIpAddressTypes []string - - // The supported Regions to add to the service configuration. - AddSupportedRegions []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // (Interface endpoint configuration) The private DNS name to assign to the - // endpoint service. - PrivateDnsName *string - - // The Amazon Resource Names (ARNs) of Gateway Load Balancers to remove from the - // service configuration. - RemoveGatewayLoadBalancerArns []string - - // The Amazon Resource Names (ARNs) of Network Load Balancers to remove from the - // service configuration. - RemoveNetworkLoadBalancerArns []string - - // (Interface endpoint configuration) Removes the private DNS name of the endpoint - // service. - RemovePrivateDnsName *bool - - // The IP address types to remove from the service configuration. - RemoveSupportedIpAddressTypes []string - - // The supported Regions to remove from the service configuration. - RemoveSupportedRegions []string - - noSmithyDocumentSerde -} - -type ModifyVpcEndpointServiceConfigurationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcEndpointServiceConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpointServiceConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcEndpointServiceConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcEndpointServiceConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpointServiceConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcEndpointServiceConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcEndpointServiceConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePayerResponsibility.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePayerResponsibility.go deleted file mode 100644 index 0623bbe71..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePayerResponsibility.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the payer responsibility for your VPC endpoint service. -func (c *Client) ModifyVpcEndpointServicePayerResponsibility(ctx context.Context, params *ModifyVpcEndpointServicePayerResponsibilityInput, optFns ...func(*Options)) (*ModifyVpcEndpointServicePayerResponsibilityOutput, error) { - if params == nil { - params = &ModifyVpcEndpointServicePayerResponsibilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpointServicePayerResponsibility", params, optFns, c.addOperationModifyVpcEndpointServicePayerResponsibilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcEndpointServicePayerResponsibilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcEndpointServicePayerResponsibilityInput struct { - - // The entity that is responsible for the endpoint costs. The default is the - // endpoint owner. If you set the payer responsibility to the service owner, you - // cannot set it back to the endpoint owner. - // - // This member is required. - PayerResponsibility types.PayerResponsibility - - // The ID of the service. - // - // This member is required. - ServiceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpcEndpointServicePayerResponsibilityOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcEndpointServicePayerResponsibilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpointServicePayerResponsibility{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcEndpointServicePayerResponsibility"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcEndpointServicePayerResponsibilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpointServicePayerResponsibility(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcEndpointServicePayerResponsibility(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcEndpointServicePayerResponsibility", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePermissions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePermissions.go deleted file mode 100644 index 356aecfe9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcEndpointServicePermissions.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the permissions for your VPC endpoint service. You can add or remove -// permissions for service consumers (Amazon Web Services accounts, users, and IAM -// roles) to connect to your endpoint service. Principal ARNs with path components -// aren't supported. -// -// If you grant permissions to all principals, the service is public. Any users -// who know the name of a public service can send a request to attach an endpoint. -// If the service does not require manual approval, attachments are automatically -// approved. -func (c *Client) ModifyVpcEndpointServicePermissions(ctx context.Context, params *ModifyVpcEndpointServicePermissionsInput, optFns ...func(*Options)) (*ModifyVpcEndpointServicePermissionsOutput, error) { - if params == nil { - params = &ModifyVpcEndpointServicePermissionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpointServicePermissions", params, optFns, c.addOperationModifyVpcEndpointServicePermissionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcEndpointServicePermissionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcEndpointServicePermissionsInput struct { - - // The ID of the service. - // - // This member is required. - ServiceId *string - - // The Amazon Resource Names (ARN) of the principals. Permissions are granted to - // the principals in this list. To grant permissions to all principals, specify an - // asterisk (*). - AddAllowedPrincipals []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Amazon Resource Names (ARN) of the principals. Permissions are revoked for - // principals in this list. - RemoveAllowedPrincipals []string - - noSmithyDocumentSerde -} - -type ModifyVpcEndpointServicePermissionsOutput struct { - - // Information about the added principals. - AddedPrincipals []types.AddedPrincipal - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcEndpointServicePermissionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpointServicePermissions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpointServicePermissions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcEndpointServicePermissions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcEndpointServicePermissionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpointServicePermissions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcEndpointServicePermissions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcEndpointServicePermissions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcPeeringConnectionOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcPeeringConnectionOptions.go deleted file mode 100644 index e90c06c55..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcPeeringConnectionOptions.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the VPC peering connection options on one side of a VPC peering -// connection. -// -// If the peered VPCs are in the same Amazon Web Services account, you can enable -// DNS resolution for queries from the local VPC. This ensures that queries from -// the local VPC resolve to private IP addresses in the peer VPC. This option is -// not available if the peered VPCs are in different Amazon Web Services accounts -// or different Regions. For peered VPCs in different Amazon Web Services accounts, -// each Amazon Web Services account owner must initiate a separate request to -// modify the peering connection options. For inter-region peering connections, you -// must use the Region for the requester VPC to modify the requester VPC peering -// options and the Region for the accepter VPC to modify the accepter VPC peering -// options. To verify which VPCs are the accepter and the requester for a VPC -// peering connection, use the DescribeVpcPeeringConnectionscommand. -func (c *Client) ModifyVpcPeeringConnectionOptions(ctx context.Context, params *ModifyVpcPeeringConnectionOptionsInput, optFns ...func(*Options)) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - if params == nil { - params = &ModifyVpcPeeringConnectionOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcPeeringConnectionOptions", params, optFns, c.addOperationModifyVpcPeeringConnectionOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcPeeringConnectionOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcPeeringConnectionOptionsInput struct { - - // The ID of the VPC peering connection. - // - // This member is required. - VpcPeeringConnectionId *string - - // The VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *types.PeeringConnectionOptionsRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *types.PeeringConnectionOptionsRequest - - noSmithyDocumentSerde -} - -type ModifyVpcPeeringConnectionOptionsOutput struct { - - // Information about the VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *types.PeeringConnectionOptions - - // Information about the VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *types.PeeringConnectionOptions - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcPeeringConnectionOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcPeeringConnectionOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcPeeringConnectionOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcPeeringConnectionOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcPeeringConnectionOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcPeeringConnectionOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcPeeringConnectionOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcTenancy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcTenancy.go deleted file mode 100644 index 9ff055442..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpcTenancy.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the instance tenancy attribute of the specified VPC. You can change -// the instance tenancy attribute of a VPC to default only. You cannot change the -// instance tenancy attribute to dedicated . -// -// After you modify the tenancy of the VPC, any new instances that you launch into -// the VPC have a tenancy of default , unless you specify otherwise during launch. -// The tenancy of any existing instances in the VPC is not affected. -// -// For more information, see [Dedicated Instances] in the Amazon EC2 User Guide. -// -// [Dedicated Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html -func (c *Client) ModifyVpcTenancy(ctx context.Context, params *ModifyVpcTenancyInput, optFns ...func(*Options)) (*ModifyVpcTenancyOutput, error) { - if params == nil { - params = &ModifyVpcTenancyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpcTenancy", params, optFns, c.addOperationModifyVpcTenancyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpcTenancyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpcTenancyInput struct { - - // The instance tenancy attribute for the VPC. - // - // This member is required. - InstanceTenancy types.VpcTenancy - - // The ID of the VPC. - // - // This member is required. - VpcId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpcTenancyOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpcTenancyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcTenancy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcTenancy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpcTenancy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpcTenancyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcTenancy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpcTenancy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpcTenancy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnection.go deleted file mode 100644 index eb47726b8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnection.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the customer gateway or the target gateway of an Amazon Web Services -// Site-to-Site VPN connection. To modify the target gateway, the following -// migration options are available: -// -// - An existing virtual private gateway to a new virtual private gateway -// -// - An existing virtual private gateway to a transit gateway -// -// - An existing transit gateway to a new transit gateway -// -// - An existing transit gateway to a virtual private gateway -// -// Before you perform the migration to the new gateway, you must configure the new -// gateway. Use CreateVpnGatewayto create a virtual private gateway, or CreateTransitGateway to create a transit -// gateway. -// -// This step is required when you migrate from a virtual private gateway with -// static routes to a transit gateway. -// -// You must delete the static routes before you migrate to the new gateway. -// -// Keep a copy of the static route before you delete it. You will need to add back -// these routes to the transit gateway after the VPN connection migration is -// complete. -// -// After you migrate to the new gateway, you might need to modify your VPC route -// table. Use CreateRouteand DeleteRoute to make the changes described in [Update VPC route tables] in the Amazon Web Services -// Site-to-Site VPN User Guide. -// -// When the new gateway is a transit gateway, modify the transit gateway route -// table to allow traffic between the VPC and the Amazon Web Services Site-to-Site -// VPN connection. Use CreateTransitGatewayRouteto add the routes. -// -// If you deleted VPN static routes, you must add the static routes to the transit -// gateway route table. -// -// After you perform this operation, the VPN endpoint's IP addresses on the Amazon -// Web Services side and the tunnel options remain intact. Your Amazon Web Services -// Site-to-Site VPN connection will be temporarily unavailable for a brief period -// while we provision the new endpoints. -// -// [Update VPC route tables]: https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing -func (c *Client) ModifyVpnConnection(ctx context.Context, params *ModifyVpnConnectionInput, optFns ...func(*Options)) (*ModifyVpnConnectionOutput, error) { - if params == nil { - params = &ModifyVpnConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpnConnection", params, optFns, c.addOperationModifyVpnConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpnConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpnConnectionInput struct { - - // The ID of the VPN connection. - // - // This member is required. - VpnConnectionId *string - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the virtual private gateway at the Amazon Web Services side of the - // VPN connection. - VpnGatewayId *string - - noSmithyDocumentSerde -} - -type ModifyVpnConnectionOutput struct { - - // Information about the VPN connection. - VpnConnection *types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpnConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpnConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpnConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpnConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpnConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpnConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpnConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpnConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnectionOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnectionOptions.go deleted file mode 100644 index 492a64585..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnConnectionOptions.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the connection options for your Site-to-Site VPN connection. -// -// When you modify the VPN connection options, the VPN endpoint IP addresses on -// the Amazon Web Services side do not change, and the tunnel options do not -// change. Your VPN connection will be temporarily unavailable for a brief period -// while the VPN connection is updated. -func (c *Client) ModifyVpnConnectionOptions(ctx context.Context, params *ModifyVpnConnectionOptionsInput, optFns ...func(*Options)) (*ModifyVpnConnectionOptionsOutput, error) { - if params == nil { - params = &ModifyVpnConnectionOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpnConnectionOptions", params, optFns, c.addOperationModifyVpnConnectionOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpnConnectionOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpnConnectionOptionsInput struct { - - // The ID of the Site-to-Site VPN connection. - // - // This member is required. - VpnConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. - // - // Default: 0.0.0.0/0 - LocalIpv4NetworkCidr *string - - // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. - // - // Default: ::/0 - LocalIpv6NetworkCidr *string - - // The IPv4 CIDR on the Amazon Web Services side of the VPN connection. - // - // Default: 0.0.0.0/0 - RemoteIpv4NetworkCidr *string - - // The IPv6 CIDR on the Amazon Web Services side of the VPN connection. - // - // Default: ::/0 - RemoteIpv6NetworkCidr *string - - noSmithyDocumentSerde -} - -type ModifyVpnConnectionOptionsOutput struct { - - // Information about the VPN connection. - VpnConnection *types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpnConnectionOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpnConnectionOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpnConnectionOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpnConnectionOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpnConnectionOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpnConnectionOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpnConnectionOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpnConnectionOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelCertificate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelCertificate.go deleted file mode 100644 index 41fd1b700..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelCertificate.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the VPN tunnel endpoint certificate. -func (c *Client) ModifyVpnTunnelCertificate(ctx context.Context, params *ModifyVpnTunnelCertificateInput, optFns ...func(*Options)) (*ModifyVpnTunnelCertificateOutput, error) { - if params == nil { - params = &ModifyVpnTunnelCertificateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpnTunnelCertificate", params, optFns, c.addOperationModifyVpnTunnelCertificateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpnTunnelCertificateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpnTunnelCertificateInput struct { - - // The ID of the Amazon Web Services Site-to-Site VPN connection. - // - // This member is required. - VpnConnectionId *string - - // The external IP address of the VPN tunnel. - // - // This member is required. - VpnTunnelOutsideIpAddress *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ModifyVpnTunnelCertificateOutput struct { - - // Information about the VPN connection. - VpnConnection *types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpnTunnelCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpnTunnelCertificate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpnTunnelCertificate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpnTunnelCertificate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpnTunnelCertificateValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpnTunnelCertificate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpnTunnelCertificate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpnTunnelCertificate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelOptions.go deleted file mode 100644 index 16ebe0c17..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ModifyVpnTunnelOptions.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the options for a VPN tunnel in an Amazon Web Services Site-to-Site -// VPN connection. You can modify multiple options for a tunnel in a single -// request, but you can only modify one tunnel at a time. For more information, see -// [Site-to-Site VPN tunnel options for your Site-to-Site VPN connection]in the Amazon Web Services Site-to-Site VPN User Guide. -// -// [Site-to-Site VPN tunnel options for your Site-to-Site VPN connection]: https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNTunnels.html -func (c *Client) ModifyVpnTunnelOptions(ctx context.Context, params *ModifyVpnTunnelOptionsInput, optFns ...func(*Options)) (*ModifyVpnTunnelOptionsOutput, error) { - if params == nil { - params = &ModifyVpnTunnelOptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ModifyVpnTunnelOptions", params, optFns, c.addOperationModifyVpnTunnelOptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ModifyVpnTunnelOptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ModifyVpnTunnelOptionsInput struct { - - // The tunnel options to modify. - // - // This member is required. - TunnelOptions *types.ModifyVpnTunnelOptionsSpecification - - // The ID of the Amazon Web Services Site-to-Site VPN connection. - // - // This member is required. - VpnConnectionId *string - - // The external IP address of the VPN tunnel. - // - // This member is required. - VpnTunnelOutsideIpAddress *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specifies the storage mode for the pre-shared key (PSK). Valid values are - // Standard (stored in Site-to-Site VPN service) or SecretsManager (stored in - // Amazon Web Services Secrets Manager). - PreSharedKeyStorage *string - - // Choose whether or not to trigger immediate tunnel replacement. This is only - // applicable when turning on or off EnableTunnelLifecycleControl . - // - // Valid values: True | False - SkipTunnelReplacement *bool - - noSmithyDocumentSerde -} - -type ModifyVpnTunnelOptionsOutput struct { - - // Information about the VPN connection. - VpnConnection *types.VpnConnection - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationModifyVpnTunnelOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpnTunnelOptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpnTunnelOptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyVpnTunnelOptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpModifyVpnTunnelOptionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpnTunnelOptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opModifyVpnTunnelOptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ModifyVpnTunnelOptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MonitorInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MonitorInstances.go deleted file mode 100644 index 9c1fc3efc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MonitorInstances.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables detailed monitoring for a running instance. Otherwise, basic monitoring -// is enabled. For more information, see [Monitor your instances using CloudWatch]in the Amazon EC2 User Guide. -// -// To disable detailed monitoring, see [UnmonitorInstances]. -// -// [Monitor your instances using CloudWatch]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html -// [UnmonitorInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_UnmonitorInstances.html -func (c *Client) MonitorInstances(ctx context.Context, params *MonitorInstancesInput, optFns ...func(*Options)) (*MonitorInstancesOutput, error) { - if params == nil { - params = &MonitorInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "MonitorInstances", params, optFns, c.addOperationMonitorInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*MonitorInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type MonitorInstancesInput struct { - - // The IDs of the instances. - // - // This member is required. - InstanceIds []string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type MonitorInstancesOutput struct { - - // The monitoring information. - InstanceMonitorings []types.InstanceMonitoring - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationMonitorInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpMonitorInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpMonitorInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "MonitorInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpMonitorInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMonitorInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opMonitorInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "MonitorInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveAddressToVpc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveAddressToVpc.go deleted file mode 100644 index d48870507..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveAddressToVpc.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC -// platform. The Elastic IP address must be allocated to your account for more than -// 24 hours, and it must not be associated with an instance. After the Elastic IP -// address is moved, it is no longer available for use in the EC2-Classic platform, -// unless you move it back using the RestoreAddressToClassicrequest. You cannot move an Elastic IP -// address that was originally allocated for use in the EC2-VPC platform to the -// EC2-Classic platform. -func (c *Client) MoveAddressToVpc(ctx context.Context, params *MoveAddressToVpcInput, optFns ...func(*Options)) (*MoveAddressToVpcOutput, error) { - if params == nil { - params = &MoveAddressToVpcInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "MoveAddressToVpc", params, optFns, c.addOperationMoveAddressToVpcMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*MoveAddressToVpcOutput) - out.ResultMetadata = metadata - return out, nil -} - -type MoveAddressToVpcInput struct { - - // The Elastic IP address. - // - // This member is required. - PublicIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type MoveAddressToVpcOutput struct { - - // The allocation ID for the Elastic IP address. - AllocationId *string - - // The status of the move of the IP address. - Status types.Status - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationMoveAddressToVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpMoveAddressToVpc{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpMoveAddressToVpc{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "MoveAddressToVpc"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpMoveAddressToVpcValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMoveAddressToVpc(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opMoveAddressToVpc(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "MoveAddressToVpc", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveByoipCidrToIpam.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveByoipCidrToIpam.go deleted file mode 100644 index 9820d6159..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveByoipCidrToIpam.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Move a BYOIPv4 CIDR to IPAM from a public IPv4 pool. -// -// If you already have a BYOIPv4 CIDR with Amazon Web Services, you can move the -// CIDR to IPAM from a public IPv4 pool. You cannot move an IPv6 CIDR to IPAM. If -// you are bringing a new IP address to Amazon Web Services for the first time, -// complete the steps in [Tutorial: BYOIP address CIDRs to IPAM]. -// -// [Tutorial: BYOIP address CIDRs to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoip-ipam.html -func (c *Client) MoveByoipCidrToIpam(ctx context.Context, params *MoveByoipCidrToIpamInput, optFns ...func(*Options)) (*MoveByoipCidrToIpamOutput, error) { - if params == nil { - params = &MoveByoipCidrToIpamInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "MoveByoipCidrToIpam", params, optFns, c.addOperationMoveByoipCidrToIpamMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*MoveByoipCidrToIpamOutput) - out.ResultMetadata = metadata - return out, nil -} - -type MoveByoipCidrToIpamInput struct { - - // The BYOIP CIDR. - // - // This member is required. - Cidr *string - - // The IPAM pool ID. - // - // This member is required. - IpamPoolId *string - - // The Amazon Web Services account ID of the owner of the IPAM pool. - // - // This member is required. - IpamPoolOwner *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type MoveByoipCidrToIpamOutput struct { - - // The BYOIP CIDR. - ByoipCidr *types.ByoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationMoveByoipCidrToIpamMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpMoveByoipCidrToIpam{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpMoveByoipCidrToIpam{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "MoveByoipCidrToIpam"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpMoveByoipCidrToIpamValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMoveByoipCidrToIpam(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opMoveByoipCidrToIpam(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "MoveByoipCidrToIpam", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveCapacityReservationInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveCapacityReservationInstances.go deleted file mode 100644 index 831794af7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_MoveCapacityReservationInstances.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Move available capacity from a source Capacity Reservation to a destination -// Capacity Reservation. The source Capacity Reservation and the destination -// Capacity Reservation must be active , owned by your Amazon Web Services account, -// and share the following: -// -// - Instance type -// -// - Platform -// -// - Availability Zone -// -// - Tenancy -// -// - Placement group -// -// - Capacity Reservation end time - At specific time or Manually . -func (c *Client) MoveCapacityReservationInstances(ctx context.Context, params *MoveCapacityReservationInstancesInput, optFns ...func(*Options)) (*MoveCapacityReservationInstancesOutput, error) { - if params == nil { - params = &MoveCapacityReservationInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "MoveCapacityReservationInstances", params, optFns, c.addOperationMoveCapacityReservationInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*MoveCapacityReservationInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type MoveCapacityReservationInstancesInput struct { - - // The ID of the Capacity Reservation that you want to move capacity into. - // - // This member is required. - DestinationCapacityReservationId *string - - // The number of instances that you want to move from the source Capacity - // Reservation. - // - // This member is required. - InstanceCount *int32 - - // The ID of the Capacity Reservation from which you want to move capacity. - // - // This member is required. - SourceCapacityReservationId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensure Idempotency]. - // - // [Ensure Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type MoveCapacityReservationInstancesOutput struct { - - // Information about the destination Capacity Reservation. - DestinationCapacityReservation *types.CapacityReservation - - // The number of instances that were moved from the source Capacity Reservation - // to the destination Capacity Reservation. - InstanceCount *int32 - - // Information about the source Capacity Reservation. - SourceCapacityReservation *types.CapacityReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationMoveCapacityReservationInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpMoveCapacityReservationInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpMoveCapacityReservationInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "MoveCapacityReservationInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opMoveCapacityReservationInstancesMiddleware(stack, options); err != nil { - return err - } - if err = addOpMoveCapacityReservationInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMoveCapacityReservationInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpMoveCapacityReservationInstances struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpMoveCapacityReservationInstances) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpMoveCapacityReservationInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*MoveCapacityReservationInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *MoveCapacityReservationInstancesInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opMoveCapacityReservationInstancesMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpMoveCapacityReservationInstances{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opMoveCapacityReservationInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "MoveCapacityReservationInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionByoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionByoipCidr.go deleted file mode 100644 index ebb73589d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionByoipCidr.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provisions an IPv4 or IPv6 address range for use with your Amazon Web Services -// resources through bring your own IP addresses (BYOIP) and creates a -// corresponding address pool. After the address range is provisioned, it is ready -// to be advertised using AdvertiseByoipCidr. -// -// Amazon Web Services verifies that you own the address range and are authorized -// to advertise it. You must ensure that the address range is registered to you and -// that you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618 to -// advertise the address range. For more information, see [Bring your own IP addresses (BYOIP)]in the Amazon EC2 User -// Guide. -// -// Provisioning an address range is an asynchronous operation, so the call returns -// immediately, but the address range is not ready to use until its status changes -// from pending-provision to provisioned . To monitor the status of an address -// range, use DescribeByoipCidrs. To allocate an Elastic IP address from your IPv4 address pool, use AllocateAddress -// with either the specific address from the address pool or the ID of the address -// pool. -// -// [Bring your own IP addresses (BYOIP)]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html -func (c *Client) ProvisionByoipCidr(ctx context.Context, params *ProvisionByoipCidrInput, optFns ...func(*Options)) (*ProvisionByoipCidrOutput, error) { - if params == nil { - params = &ProvisionByoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ProvisionByoipCidr", params, optFns, c.addOperationProvisionByoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ProvisionByoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ProvisionByoipCidrInput struct { - - // The public IPv4 or IPv6 address range, in CIDR notation. The most specific IPv4 - // prefix that you can specify is /24. The most specific IPv6 address range that - // you can bring is /48 for CIDRs that are publicly advertisable and /56 for CIDRs - // that are not publicly advertisable. The address range cannot overlap with - // another address range that you've brought to this or another Region. - // - // This member is required. - Cidr *string - - // A signed document that proves that you are authorized to bring the specified IP - // address range to Amazon using BYOIP. - CidrAuthorizationContext *types.CidrAuthorizationContext - - // A description for the address range and the address pool. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Reserved. - MultiRegion *bool - - // If you have [Local Zones] enabled, you can choose a network border group for Local Zones - // when you provision and advertise a BYOIPv4 CIDR. Choose the network border group - // carefully as the EIP and the Amazon Web Services resource it is associated with - // must reside in the same network border group. - // - // You can provision BYOIP address ranges to and advertise them in the following - // Local Zone network border groups: - // - // - us-east-1-dfw-2 - // - // - us-west-2-lax-1 - // - // - us-west-2-phx-2 - // - // You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this - // time. - // - // [Local Zones]: https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html - NetworkBorderGroup *string - - // The tags to apply to the address pool. - PoolTagSpecifications []types.TagSpecification - - // (IPv6 only) Indicate whether the address range will be publicly advertised to - // the internet. - // - // Default: true - PubliclyAdvertisable *bool - - noSmithyDocumentSerde -} - -type ProvisionByoipCidrOutput struct { - - // Information about the address range. - ByoipCidr *types.ByoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationProvisionByoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpProvisionByoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpProvisionByoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ProvisionByoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpProvisionByoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvisionByoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opProvisionByoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ProvisionByoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamByoasn.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamByoasn.go deleted file mode 100644 index e07342273..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamByoasn.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provisions your Autonomous System Number (ASN) for use in your Amazon Web -// Services account. This action requires authorization context for Amazon to bring -// the ASN to an Amazon Web Services account. For more information, see [Tutorial: Bring your ASN to IPAM]in the -// Amazon VPC IPAM guide. -// -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -func (c *Client) ProvisionIpamByoasn(ctx context.Context, params *ProvisionIpamByoasnInput, optFns ...func(*Options)) (*ProvisionIpamByoasnOutput, error) { - if params == nil { - params = &ProvisionIpamByoasnInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ProvisionIpamByoasn", params, optFns, c.addOperationProvisionIpamByoasnMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ProvisionIpamByoasnOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ProvisionIpamByoasnInput struct { - - // A public 2-byte or 4-byte ASN. - // - // This member is required. - Asn *string - - // An ASN authorization context. - // - // This member is required. - AsnAuthorizationContext *types.AsnAuthorizationContext - - // An IPAM ID. - // - // This member is required. - IpamId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ProvisionIpamByoasnOutput struct { - - // An ASN and BYOIP CIDR association. - Byoasn *types.Byoasn - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationProvisionIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpProvisionIpamByoasn{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpProvisionIpamByoasn{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ProvisionIpamByoasn"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpProvisionIpamByoasnValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvisionIpamByoasn(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opProvisionIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ProvisionIpamByoasn", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamPoolCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamPoolCidr.go deleted file mode 100644 index 85e722c61..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionIpamPoolCidr.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provision a CIDR to an IPAM pool. You can use this action to provision new -// CIDRs to a top-level pool or to transfer a CIDR from a top-level pool to a pool -// within it. -// -// For more information, see [Provision CIDRs to pools] in the Amazon VPC IPAM User Guide. -// -// [Provision CIDRs to pools]: https://docs.aws.amazon.com/vpc/latest/ipam/prov-cidr-ipam.html -func (c *Client) ProvisionIpamPoolCidr(ctx context.Context, params *ProvisionIpamPoolCidrInput, optFns ...func(*Options)) (*ProvisionIpamPoolCidrOutput, error) { - if params == nil { - params = &ProvisionIpamPoolCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ProvisionIpamPoolCidr", params, optFns, c.addOperationProvisionIpamPoolCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ProvisionIpamPoolCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ProvisionIpamPoolCidrInput struct { - - // The ID of the IPAM pool to which you want to assign a CIDR. - // - // This member is required. - IpamPoolId *string - - // The CIDR you want to assign to the IPAM pool. Either "NetmaskLength" or "Cidr" - // is required. This value will be null if you specify "NetmaskLength" and will be - // filled in during the provisioning process. - Cidr *string - - // A signed document that proves that you are authorized to bring a specified IP - // address range to Amazon using BYOIP. This option only applies to IPv4 and IPv6 - // pools in the public scope. - CidrAuthorizationContext *types.IpamCidrAuthorizationContext - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see [Ensuring idempotency]. - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - ClientToken *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Verification token ID. This option only applies to IPv4 and IPv6 pools in the - // public scope. - IpamExternalResourceVerificationTokenId *string - - // The netmask length of the CIDR you'd like to provision to a pool. Can be used - // for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for - // provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP - // CIDRs to top-level pools. Either "NetmaskLength" or "Cidr" is required. - NetmaskLength *int32 - - // The method for verifying control of a public IP address range. Defaults to - // remarks-x509 if not specified. This option only applies to IPv4 and IPv6 pools - // in the public scope. - VerificationMethod types.VerificationMethod - - noSmithyDocumentSerde -} - -type ProvisionIpamPoolCidrOutput struct { - - // Information about the provisioned CIDR. - IpamPoolCidr *types.IpamPoolCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationProvisionIpamPoolCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpProvisionIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpProvisionIpamPoolCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ProvisionIpamPoolCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opProvisionIpamPoolCidrMiddleware(stack, options); err != nil { - return err - } - if err = addOpProvisionIpamPoolCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvisionIpamPoolCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpProvisionIpamPoolCidr struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpProvisionIpamPoolCidr) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpProvisionIpamPoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*ProvisionIpamPoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *ProvisionIpamPoolCidrInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opProvisionIpamPoolCidrMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpProvisionIpamPoolCidr{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opProvisionIpamPoolCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ProvisionIpamPoolCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go deleted file mode 100644 index 03dac86a6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ProvisionPublicIpv4PoolCidr.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provision a CIDR to a public IPv4 pool. -// -// For more information about IPAM, see [What is IPAM?] in the Amazon VPC IPAM User Guide. -// -// [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html -func (c *Client) ProvisionPublicIpv4PoolCidr(ctx context.Context, params *ProvisionPublicIpv4PoolCidrInput, optFns ...func(*Options)) (*ProvisionPublicIpv4PoolCidrOutput, error) { - if params == nil { - params = &ProvisionPublicIpv4PoolCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ProvisionPublicIpv4PoolCidr", params, optFns, c.addOperationProvisionPublicIpv4PoolCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ProvisionPublicIpv4PoolCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ProvisionPublicIpv4PoolCidrInput struct { - - // The ID of the IPAM pool you would like to use to allocate this CIDR. - // - // This member is required. - IpamPoolId *string - - // The netmask length of the CIDR you would like to allocate to the public IPv4 - // pool. The least specific netmask length you can define is 24. - // - // This member is required. - NetmaskLength *int32 - - // The ID of the public IPv4 pool you would like to use for this CIDR. - // - // This member is required. - PoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Availability Zone (AZ) or Local Zone (LZ) network border group that the - // resource that the IP address is assigned to is in. Defaults to an AZ network - // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon - // EC2 User Guide. - // - // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - NetworkBorderGroup *string - - noSmithyDocumentSerde -} - -type ProvisionPublicIpv4PoolCidrOutput struct { - - // Information about the address range of the public IPv4 pool. - PoolAddressRange *types.PublicIpv4PoolRange - - // The ID of the pool that you want to provision the CIDR to. - PoolId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationProvisionPublicIpv4PoolCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpProvisionPublicIpv4PoolCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ProvisionPublicIpv4PoolCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpProvisionPublicIpv4PoolCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvisionPublicIpv4PoolCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opProvisionPublicIpv4PoolCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ProvisionPublicIpv4PoolCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlock.go deleted file mode 100644 index 2314cb751..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlock.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Purchase the Capacity Block for use with your account. With Capacity Blocks you -// ensure GPU capacity is available for machine learning (ML) workloads. You must -// specify the ID of the Capacity Block offering you are purchasing. -func (c *Client) PurchaseCapacityBlock(ctx context.Context, params *PurchaseCapacityBlockInput, optFns ...func(*Options)) (*PurchaseCapacityBlockOutput, error) { - if params == nil { - params = &PurchaseCapacityBlockInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PurchaseCapacityBlock", params, optFns, c.addOperationPurchaseCapacityBlockMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PurchaseCapacityBlockOutput) - out.ResultMetadata = metadata - return out, nil -} - -type PurchaseCapacityBlockInput struct { - - // The ID of the Capacity Block offering. - // - // This member is required. - CapacityBlockOfferingId *string - - // The type of operating system for which to reserve capacity. - // - // This member is required. - InstancePlatform types.CapacityReservationInstancePlatform - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply to the Capacity Block during launch. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type PurchaseCapacityBlockOutput struct { - - // The Capacity Block. - CapacityBlocks []types.CapacityBlock - - // The Capacity Reservation. - CapacityReservation *types.CapacityReservation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPurchaseCapacityBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseCapacityBlock{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseCapacityBlock{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseCapacityBlock"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpPurchaseCapacityBlockValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseCapacityBlock(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opPurchaseCapacityBlock(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PurchaseCapacityBlock", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlockExtension.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlockExtension.go deleted file mode 100644 index 36a59a061..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseCapacityBlockExtension.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Purchase the Capacity Block extension for use with your account. You must -// specify the ID of the Capacity Block extension offering you are purchasing. -func (c *Client) PurchaseCapacityBlockExtension(ctx context.Context, params *PurchaseCapacityBlockExtensionInput, optFns ...func(*Options)) (*PurchaseCapacityBlockExtensionOutput, error) { - if params == nil { - params = &PurchaseCapacityBlockExtensionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PurchaseCapacityBlockExtension", params, optFns, c.addOperationPurchaseCapacityBlockExtensionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PurchaseCapacityBlockExtensionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type PurchaseCapacityBlockExtensionInput struct { - - // The ID of the Capacity Block extension offering to purchase. - // - // This member is required. - CapacityBlockExtensionOfferingId *string - - // The ID of the Capacity reservation to be extended. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type PurchaseCapacityBlockExtensionOutput struct { - - // The purchased Capacity Block extensions. - CapacityBlockExtensions []types.CapacityBlockExtension - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPurchaseCapacityBlockExtensionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseCapacityBlockExtension{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseCapacityBlockExtension{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseCapacityBlockExtension"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpPurchaseCapacityBlockExtensionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseCapacityBlockExtension(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opPurchaseCapacityBlockExtension(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PurchaseCapacityBlockExtension", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseHostReservation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseHostReservation.go deleted file mode 100644 index eeb6c7320..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseHostReservation.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Purchase a reservation with configurations that match those of your Dedicated -// Host. You must have active Dedicated Hosts in your account before you purchase a -// reservation. This action results in the specified reservation being purchased -// and charged to your account. -func (c *Client) PurchaseHostReservation(ctx context.Context, params *PurchaseHostReservationInput, optFns ...func(*Options)) (*PurchaseHostReservationOutput, error) { - if params == nil { - params = &PurchaseHostReservationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PurchaseHostReservation", params, optFns, c.addOperationPurchaseHostReservationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PurchaseHostReservationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type PurchaseHostReservationInput struct { - - // The IDs of the Dedicated Hosts with which the reservation will be associated. - // - // This member is required. - HostIdSet []string - - // The ID of the offering. - // - // This member is required. - OfferingId *string - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The currency in which the totalUpfrontPrice , LimitPrice , and totalHourlyPrice - // amounts are specified. At this time, the only supported currency is USD . - CurrencyCode types.CurrencyCodeValues - - // The specified limit is checked against the total upfront cost of the - // reservation (calculated as the offering's upfront cost multiplied by the host - // count). If the total upfront cost is greater than the specified price limit, the - // request fails. This is used to ensure that the purchase does not exceed the - // expected upfront cost of the purchase. At this time, the only supported currency - // is USD . For example, to indicate a limit price of USD 100, specify 100.00. - LimitPrice *string - - // The tags to apply to the Dedicated Host Reservation during purchase. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type PurchaseHostReservationOutput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts are - // specified. At this time, the only supported currency is USD . - CurrencyCode types.CurrencyCodeValues - - // Describes the details of the purchase. - Purchase []types.Purchase - - // The total hourly price of the reservation calculated per hour. - TotalHourlyPrice *string - - // The total amount charged to your account when you purchase the reservation. - TotalUpfrontPrice *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPurchaseHostReservationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseHostReservation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseHostReservation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseHostReservation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpPurchaseHostReservationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseHostReservation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opPurchaseHostReservation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PurchaseHostReservation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseReservedInstancesOffering.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseReservedInstancesOffering.go deleted file mode 100644 index 08fef06a1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseReservedInstancesOffering.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Purchases a Reserved Instance for use with your account. With Reserved -// Instances, you pay a lower hourly rate compared to On-Demand instance pricing. -// -// Use DescribeReservedInstancesOfferings to get a list of Reserved Instance offerings that match your -// specifications. After you've purchased a Reserved Instance, you can check for -// your new Reserved Instance with DescribeReservedInstances. -// -// To queue a purchase for a future date and time, specify a purchase time. If you -// do not specify a purchase time, the default is the current time. -// -// For more information, see [Reserved Instances] and [Sell in the Reserved Instance Marketplace] in the Amazon EC2 User Guide. -// -// [Reserved Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html -// [Sell in the Reserved Instance Marketplace]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html -func (c *Client) PurchaseReservedInstancesOffering(ctx context.Context, params *PurchaseReservedInstancesOfferingInput, optFns ...func(*Options)) (*PurchaseReservedInstancesOfferingOutput, error) { - if params == nil { - params = &PurchaseReservedInstancesOfferingInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PurchaseReservedInstancesOffering", params, optFns, c.addOperationPurchaseReservedInstancesOfferingMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PurchaseReservedInstancesOfferingOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for PurchaseReservedInstancesOffering. -type PurchaseReservedInstancesOfferingInput struct { - - // The number of Reserved Instances to purchase. - // - // This member is required. - InstanceCount *int32 - - // The ID of the Reserved Instance offering to purchase. - // - // This member is required. - ReservedInstancesOfferingId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Specified for Reserved Instance Marketplace offerings to limit the total order - // and ensure that the Reserved Instances are not purchased at unexpected prices. - LimitPrice *types.ReservedInstanceLimitPrice - - // The time at which to purchase the Reserved Instance, in UTC format (for - // example, YYYY-MM-DDTHH:MM:SSZ). - PurchaseTime *time.Time - - noSmithyDocumentSerde -} - -// Contains the output of PurchaseReservedInstancesOffering. -type PurchaseReservedInstancesOfferingOutput struct { - - // The IDs of the purchased Reserved Instances. If your purchase crosses into a - // discounted pricing tier, the final Reserved Instances IDs might change. For more - // information, see [Crossing pricing tiers]in the Amazon EC2 User Guide. - // - // [Crossing pricing tiers]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-reserved-instances-application.html#crossing-pricing-tiers - ReservedInstancesId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPurchaseReservedInstancesOfferingMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseReservedInstancesOffering{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseReservedInstancesOffering{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseReservedInstancesOffering"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpPurchaseReservedInstancesOfferingValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseReservedInstancesOffering(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opPurchaseReservedInstancesOffering(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PurchaseReservedInstancesOffering", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseScheduledInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseScheduledInstances.go deleted file mode 100644 index 0a7a12d9d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_PurchaseScheduledInstances.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// You can no longer purchase Scheduled Instances. -// -// Purchases the Scheduled Instances with the specified schedule. -// -// Scheduled Instances enable you to purchase Amazon EC2 compute capacity by the -// hour for a one-year term. Before you can purchase a Scheduled Instance, you must -// call DescribeScheduledInstanceAvailabilityto check for available schedules and obtain a purchase token. After you -// purchase a Scheduled Instance, you must call RunScheduledInstancesduring each scheduled time period. -// -// After you purchase a Scheduled Instance, you can't cancel, modify, or resell -// your purchase. -func (c *Client) PurchaseScheduledInstances(ctx context.Context, params *PurchaseScheduledInstancesInput, optFns ...func(*Options)) (*PurchaseScheduledInstancesOutput, error) { - if params == nil { - params = &PurchaseScheduledInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PurchaseScheduledInstances", params, optFns, c.addOperationPurchaseScheduledInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PurchaseScheduledInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for PurchaseScheduledInstances. -type PurchaseScheduledInstancesInput struct { - - // The purchase requests. - // - // This member is required. - PurchaseRequests []types.PurchaseRequest - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of PurchaseScheduledInstances. -type PurchaseScheduledInstancesOutput struct { - - // Information about the Scheduled Instances. - ScheduledInstanceSet []types.ScheduledInstance - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPurchaseScheduledInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseScheduledInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseScheduledInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseScheduledInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opPurchaseScheduledInstancesMiddleware(stack, options); err != nil { - return err - } - if err = addOpPurchaseScheduledInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseScheduledInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpPurchaseScheduledInstances struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpPurchaseScheduledInstances) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpPurchaseScheduledInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*PurchaseScheduledInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *PurchaseScheduledInstancesInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opPurchaseScheduledInstancesMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpPurchaseScheduledInstances{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opPurchaseScheduledInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PurchaseScheduledInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RebootInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RebootInstances.go deleted file mode 100644 index 4535284b0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RebootInstances.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Requests a reboot of the specified instances. This operation is asynchronous; -// it only queues a request to reboot the specified instances. The operation -// succeeds if the instances are valid and belong to you. Requests to reboot -// terminated instances are ignored. -// -// If an instance does not cleanly shut down within a few minutes, Amazon EC2 -// performs a hard reboot. -// -// For more information about troubleshooting, see [Troubleshoot an unreachable instance] in the Amazon EC2 User Guide. -// -// [Troubleshoot an unreachable instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html -func (c *Client) RebootInstances(ctx context.Context, params *RebootInstancesInput, optFns ...func(*Options)) (*RebootInstancesOutput, error) { - if params == nil { - params = &RebootInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RebootInstances", params, optFns, c.addOperationRebootInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RebootInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RebootInstancesInput struct { - - // The instance IDs. - // - // This member is required. - InstanceIds []string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RebootInstancesOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRebootInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRebootInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRebootInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RebootInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRebootInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRebootInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RebootInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterImage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterImage.go deleted file mode 100644 index 0daabd0b6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterImage.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Registers an AMI. When you're creating an instance-store backed AMI, -// registering the AMI is the final step in the creation process. For more -// information about creating AMIs, see [Create an AMI from a snapshot]and [Create an instance-store backed AMI] in the Amazon EC2 User Guide. -// -// For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single -// request, so you don't have to register the AMI yourself. We recommend that you -// always use CreateImageunless you have a specific reason to use RegisterImage. -// -// If needed, you can deregister an AMI at any time. Any modifications you make to -// an AMI backed by an instance store volume invalidates its registration. If you -// make changes to an image, deregister the previous image and register the new -// image. -// -// # Register a snapshot of a root device volume -// -// You can use RegisterImage to create an Amazon EBS-backed Linux AMI from a -// snapshot of a root device volume. You specify the snapshot using a block device -// mapping. You can't set the encryption state of the volume using the block device -// mapping. If the snapshot is encrypted, or encryption by default is enabled, the -// root volume of an instance launched from the AMI is encrypted. -// -// For more information, see [Create an AMI from a snapshot] and [Use encryption with EBS-backed AMIs] in the Amazon EC2 User Guide. -// -// # Amazon Web Services Marketplace product codes -// -// If any snapshots have Amazon Web Services Marketplace product codes, they are -// copied to the new AMI. -// -// In most cases, AMIs for Windows, RedHat, SUSE, and SQL Server require correct -// licensing information to be present on the AMI. For more information, see [Understand AMI billing information]in -// the Amazon EC2 User Guide. When creating an AMI from a snapshot, the -// RegisterImage operation derives the correct billing information from the -// snapshot's metadata, but this requires the appropriate metadata to be present. -// To verify if the correct billing information was applied, check the -// PlatformDetails field on the new AMI. If the field is empty or doesn't match the -// expected operating system code (for example, Windows, RedHat, SUSE, or SQL), the -// AMI creation was unsuccessful, and you should discard the AMI and instead create -// the AMI from an instance using CreateImage. For more information, see [Create an AMI from an instance] in the Amazon EC2 -// User Guide. -// -// If you purchase a Reserved Instance to apply to an On-Demand Instance that was -// launched from an AMI with a billing product code, make sure that the Reserved -// Instance has the matching billing product code. If you purchase a Reserved -// Instance without the matching billing product code, the Reserved Instance will -// not be applied to the On-Demand Instance. For information about how to obtain -// the platform details and billing information of an AMI, see [Understand AMI billing information]in the Amazon EC2 -// User Guide. -// -// [Use encryption with EBS-backed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html -// [Understand AMI billing information]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html -// [Create an instance-store backed AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-instance-store.html -// [Create an AMI from an instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#how-to-create-ebs-ami -// [Create an AMI from a snapshot]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#creating-launching-ami-from-snapshot -func (c *Client) RegisterImage(ctx context.Context, params *RegisterImageInput, optFns ...func(*Options)) (*RegisterImageOutput, error) { - if params == nil { - params = &RegisterImageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterImage", params, optFns, c.addOperationRegisterImageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterImageOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for RegisterImage. -type RegisterImageInput struct { - - // A name for your AMI. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // This member is required. - Name *string - - // The architecture of the AMI. - // - // Default: For Amazon EBS-backed AMIs, i386 . For instance store-backed AMIs, the - // architecture specified in the manifest file. - Architecture types.ArchitectureValues - - // The billing product codes. Your account must be authorized to specify billing - // product codes. - // - // If your account is not authorized to specify billing product codes, you can - // publish AMIs that include billable software and list them on the Amazon Web - // Services Marketplace. You must first register as a seller on the Amazon Web - // Services Marketplace. For more information, see [Getting started as an Amazon Web Services Marketplace seller]and [AMI-based products in Amazon Web Services Marketplace] in the Amazon Web Services - // Marketplace Seller Guide. - // - // [AMI-based products in Amazon Web Services Marketplace]: https://docs.aws.amazon.com/marketplace/latest/userguide/ami-products.html - // [Getting started as an Amazon Web Services Marketplace seller]: https://docs.aws.amazon.com/marketplace/latest/userguide/user-guide-for-sellers.html - BillingProducts []string - - // The block device mapping entries. - // - // If you specify an Amazon EBS volume using the ID of an Amazon EBS snapshot, you - // can't specify the encryption state of the volume. - // - // If you create an AMI on an Outpost, then all backing snapshots must be on the - // same Outpost or in the Region of that Outpost. AMIs on an Outpost that include - // local snapshots can be used to launch instances on the same Outpost only. For - // more information, [Create AMIs from local snapshots]in the Amazon EBS User Guide. - // - // [Create AMIs from local snapshots]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#ami - BlockDeviceMappings []types.BlockDeviceMapping - - // The boot mode of the AMI. A value of uefi-preferred indicates that the AMI - // supports both UEFI and Legacy BIOS. - // - // The operating system contained in the AMI must be configured to support the - // specified boot mode. - // - // For more information, see [Instance launch behavior with Amazon EC2 boot modes] in the Amazon EC2 User Guide. - // - // [Instance launch behavior with Amazon EC2 boot modes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html - BootMode types.BootModeValues - - // A description for your AMI. - Description *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Set to true to enable enhanced networking with ENA for the AMI and any - // instances that you launch from the AMI. - // - // This option is supported only for HVM AMIs. Specifying this option with a PV - // AMI can make instances launched from the AMI unreachable. - EnaSupport *bool - - // The full path to your AMI manifest in Amazon S3 storage. The specified bucket - // must have the aws-exec-read canned access control list (ACL) to ensure that it - // can be accessed by Amazon EC2. For more information, see [Canned ACL]in the Amazon S3 - // Service Developer Guide. - // - // [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - ImageLocation *string - - // Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched - // from this AMI will have HttpTokens automatically set to required so that, by - // default, the instance requires that IMDSv2 is used when requesting instance - // metadata. In addition, HttpPutResponseHopLimit is set to 2 . For more - // information, see [Configure the AMI]in the Amazon EC2 User Guide. - // - // If you set the value to v2.0 , make sure that your AMI software can support - // IMDSv2. - // - // [Configure the AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration - ImdsSupport types.ImdsSupportValues - - // The ID of the kernel. - KernelId *string - - // The ID of the RAM disk. - RamdiskId *string - - // The device name of the root device volume (for example, /dev/sda1 ). - RootDeviceName *string - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the AMI and any instances that you launch from the AMI. - // - // There is no way to disable sriovNetSupport at this time. - // - // This option is supported only for HVM AMIs. Specifying this option with a PV - // AMI can make instances launched from the AMI unreachable. - SriovNetSupport *string - - // The tags to apply to the AMI. - // - // To tag the AMI, the value for ResourceType must be image . If you specify - // another value for ResourceType , the request fails. - // - // To tag an AMI after it has been registered, see [CreateTags]. - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - TagSpecifications []types.TagSpecification - - // Set to v2.0 to enable Trusted Platform Module (TPM) support. For more - // information, see [NitroTPM]in the Amazon EC2 User Guide. - // - // [NitroTPM]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html - TpmSupport types.TpmSupportValues - - // Base64 representation of the non-volatile UEFI variable store. To retrieve the - // UEFI data, use the [GetInstanceUefiData]command. You can inspect and modify the UEFI data by using - // the [python-uefivars tool]on GitHub. For more information, see [UEFI Secure Boot for Amazon EC2 instances] in the Amazon EC2 User Guide. - // - // [UEFI Secure Boot for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/uefi-secure-boot.html - // [GetInstanceUefiData]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceUefiData - // [python-uefivars tool]: https://github.com/awslabs/python-uefivars - UefiData *string - - // The type of virtualization ( hvm | paravirtual ). - // - // Default: paravirtual - VirtualizationType *string - - noSmithyDocumentSerde -} - -// Contains the output of RegisterImage. -type RegisterImageOutput struct { - - // The ID of the newly registered AMI. - ImageId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterImageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRegisterImage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRegisterImage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterImage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterImageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterImage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterImage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterImage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterInstanceEventNotificationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterInstanceEventNotificationAttributes.go deleted file mode 100644 index 8b75f8e1a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterInstanceEventNotificationAttributes.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Registers a set of tag keys to include in scheduled event notifications for -// your resources. -// -// To remove tags, use [DeregisterInstanceEventNotificationAttributes]. -// -// [DeregisterInstanceEventNotificationAttributes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeregisterInstanceEventNotificationAttributes.html -func (c *Client) RegisterInstanceEventNotificationAttributes(ctx context.Context, params *RegisterInstanceEventNotificationAttributesInput, optFns ...func(*Options)) (*RegisterInstanceEventNotificationAttributesOutput, error) { - if params == nil { - params = &RegisterInstanceEventNotificationAttributesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterInstanceEventNotificationAttributes", params, optFns, c.addOperationRegisterInstanceEventNotificationAttributesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterInstanceEventNotificationAttributesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterInstanceEventNotificationAttributesInput struct { - - // Information about the tag keys to register. - // - // This member is required. - InstanceTagAttribute *types.RegisterInstanceTagAttributeRequest - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RegisterInstanceEventNotificationAttributesOutput struct { - - // The resulting set of tag keys. - InstanceTagAttribute *types.InstanceTagNotificationAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterInstanceEventNotificationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRegisterInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterInstanceEventNotificationAttributes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterInstanceEventNotificationAttributesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterInstanceEventNotificationAttributes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterInstanceEventNotificationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterInstanceEventNotificationAttributes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupMembers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupMembers.go deleted file mode 100644 index e4023f878..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupMembers.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Registers members (network interfaces) with the transit gateway multicast -// group. A member is a network interface associated with a supported EC2 instance -// that receives multicast traffic. For more information, see [Multicast on transit gateways]in the Amazon Web -// Services Transit Gateways Guide. -// -// After you add the members, use [SearchTransitGatewayMulticastGroups] to verify that the members were added to the -// transit gateway multicast group. -// -// [SearchTransitGatewayMulticastGroups]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html -// [Multicast on transit gateways]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-multicast-overview.html -func (c *Client) RegisterTransitGatewayMulticastGroupMembers(ctx context.Context, params *RegisterTransitGatewayMulticastGroupMembersInput, optFns ...func(*Options)) (*RegisterTransitGatewayMulticastGroupMembersOutput, error) { - if params == nil { - params = &RegisterTransitGatewayMulticastGroupMembersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterTransitGatewayMulticastGroupMembers", params, optFns, c.addOperationRegisterTransitGatewayMulticastGroupMembersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterTransitGatewayMulticastGroupMembersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterTransitGatewayMulticastGroupMembersInput struct { - - // The group members' network interface IDs to register with the transit gateway - // multicast group. - // - // This member is required. - NetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - noSmithyDocumentSerde -} - -type RegisterTransitGatewayMulticastGroupMembersOutput struct { - - // Information about the registered transit gateway multicast group members. - RegisteredMulticastGroupMembers *types.TransitGatewayMulticastRegisteredGroupMembers - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterTransitGatewayMulticastGroupMembersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupMembers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterTransitGatewayMulticastGroupMembers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterTransitGatewayMulticastGroupMembersValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTransitGatewayMulticastGroupMembers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterTransitGatewayMulticastGroupMembers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterTransitGatewayMulticastGroupMembers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupSources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupSources.go deleted file mode 100644 index 139c3f445..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RegisterTransitGatewayMulticastGroupSources.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Registers sources (network interfaces) with the specified transit gateway -// multicast group. -// -// A multicast source is a network interface attached to a supported instance that -// sends multicast traffic. For more information about supported instances, see [Multicast on transit gateways]in -// the Amazon Web Services Transit Gateways Guide. -// -// After you add the source, use [SearchTransitGatewayMulticastGroups] to verify that the source was added to the -// multicast group. -// -// [SearchTransitGatewayMulticastGroups]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html -// [Multicast on transit gateways]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-multicast-overview.html -func (c *Client) RegisterTransitGatewayMulticastGroupSources(ctx context.Context, params *RegisterTransitGatewayMulticastGroupSourcesInput, optFns ...func(*Options)) (*RegisterTransitGatewayMulticastGroupSourcesOutput, error) { - if params == nil { - params = &RegisterTransitGatewayMulticastGroupSourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterTransitGatewayMulticastGroupSources", params, optFns, c.addOperationRegisterTransitGatewayMulticastGroupSourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterTransitGatewayMulticastGroupSourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterTransitGatewayMulticastGroupSourcesInput struct { - - // The group sources' network interface IDs to register with the transit gateway - // multicast group. - // - // This member is required. - NetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - noSmithyDocumentSerde -} - -type RegisterTransitGatewayMulticastGroupSourcesOutput struct { - - // Information about the transit gateway multicast group sources. - RegisteredMulticastGroupSources *types.TransitGatewayMulticastRegisteredGroupSources - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterTransitGatewayMulticastGroupSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupSources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterTransitGatewayMulticastGroupSources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterTransitGatewayMulticastGroupSourcesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTransitGatewayMulticastGroupSources(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterTransitGatewayMulticastGroupSources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterTransitGatewayMulticastGroupSources", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectCapacityReservationBillingOwnership.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectCapacityReservationBillingOwnership.go deleted file mode 100644 index e81596144..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectCapacityReservationBillingOwnership.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects a request to assign billing of the available capacity of a shared -// Capacity Reservation to your account. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations]. -// -// [Billing assignment for shared Amazon EC2 Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html -func (c *Client) RejectCapacityReservationBillingOwnership(ctx context.Context, params *RejectCapacityReservationBillingOwnershipInput, optFns ...func(*Options)) (*RejectCapacityReservationBillingOwnershipOutput, error) { - if params == nil { - params = &RejectCapacityReservationBillingOwnershipInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectCapacityReservationBillingOwnership", params, optFns, c.addOperationRejectCapacityReservationBillingOwnershipMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectCapacityReservationBillingOwnershipOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectCapacityReservationBillingOwnershipInput struct { - - // The ID of the Capacity Reservation for which to reject the request. - // - // This member is required. - CapacityReservationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RejectCapacityReservationBillingOwnershipOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectCapacityReservationBillingOwnershipMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectCapacityReservationBillingOwnership{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectCapacityReservationBillingOwnership"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRejectCapacityReservationBillingOwnershipValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectCapacityReservationBillingOwnership(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectCapacityReservationBillingOwnership(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectCapacityReservationBillingOwnership", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayMulticastDomainAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayMulticastDomainAssociations.go deleted file mode 100644 index fa6546e94..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayMulticastDomainAssociations.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects a request to associate cross-account subnets with a transit gateway -// multicast domain. -func (c *Client) RejectTransitGatewayMulticastDomainAssociations(ctx context.Context, params *RejectTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*Options)) (*RejectTransitGatewayMulticastDomainAssociationsOutput, error) { - if params == nil { - params = &RejectTransitGatewayMulticastDomainAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectTransitGatewayMulticastDomainAssociations", params, optFns, c.addOperationRejectTransitGatewayMulticastDomainAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectTransitGatewayMulticastDomainAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectTransitGatewayMulticastDomainAssociationsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The IDs of the subnets to associate with the transit gateway multicast domain. - SubnetIds []string - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -type RejectTransitGatewayMulticastDomainAssociationsOutput struct { - - // Information about the multicast domain associations. - Associations *types.TransitGatewayMulticastDomainAssociations - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectTransitGatewayMulticastDomainAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectTransitGatewayMulticastDomainAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectTransitGatewayMulticastDomainAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectTransitGatewayMulticastDomainAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectTransitGatewayMulticastDomainAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayPeeringAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayPeeringAttachment.go deleted file mode 100644 index 6d1f1b8d4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayPeeringAttachment.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects a transit gateway peering attachment request. -func (c *Client) RejectTransitGatewayPeeringAttachment(ctx context.Context, params *RejectTransitGatewayPeeringAttachmentInput, optFns ...func(*Options)) (*RejectTransitGatewayPeeringAttachmentOutput, error) { - if params == nil { - params = &RejectTransitGatewayPeeringAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectTransitGatewayPeeringAttachment", params, optFns, c.addOperationRejectTransitGatewayPeeringAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectTransitGatewayPeeringAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectTransitGatewayPeeringAttachmentInput struct { - - // The ID of the transit gateway peering attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RejectTransitGatewayPeeringAttachmentOutput struct { - - // The transit gateway peering attachment. - TransitGatewayPeeringAttachment *types.TransitGatewayPeeringAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectTransitGatewayPeeringAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectTransitGatewayPeeringAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRejectTransitGatewayPeeringAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectTransitGatewayPeeringAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectTransitGatewayPeeringAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectTransitGatewayPeeringAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayVpcAttachment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayVpcAttachment.go deleted file mode 100644 index 7bbe41ef9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectTransitGatewayVpcAttachment.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects a request to attach a VPC to a transit gateway. -// -// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your -// pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachmentto accept a VPC attachment request. -func (c *Client) RejectTransitGatewayVpcAttachment(ctx context.Context, params *RejectTransitGatewayVpcAttachmentInput, optFns ...func(*Options)) (*RejectTransitGatewayVpcAttachmentOutput, error) { - if params == nil { - params = &RejectTransitGatewayVpcAttachmentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectTransitGatewayVpcAttachment", params, optFns, c.addOperationRejectTransitGatewayVpcAttachmentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectTransitGatewayVpcAttachmentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectTransitGatewayVpcAttachmentInput struct { - - // The ID of the attachment. - // - // This member is required. - TransitGatewayAttachmentId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RejectTransitGatewayVpcAttachmentOutput struct { - - // Information about the attachment. - TransitGatewayVpcAttachment *types.TransitGatewayVpcAttachment - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectTransitGatewayVpcAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectTransitGatewayVpcAttachment"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRejectTransitGatewayVpcAttachmentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectTransitGatewayVpcAttachment(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectTransitGatewayVpcAttachment(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectTransitGatewayVpcAttachment", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcEndpointConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcEndpointConnections.go deleted file mode 100644 index c869dae06..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcEndpointConnections.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects VPC endpoint connection requests to your VPC endpoint service. -func (c *Client) RejectVpcEndpointConnections(ctx context.Context, params *RejectVpcEndpointConnectionsInput, optFns ...func(*Options)) (*RejectVpcEndpointConnectionsOutput, error) { - if params == nil { - params = &RejectVpcEndpointConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectVpcEndpointConnections", params, optFns, c.addOperationRejectVpcEndpointConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectVpcEndpointConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectVpcEndpointConnectionsInput struct { - - // The ID of the service. - // - // This member is required. - ServiceId *string - - // The IDs of the VPC endpoints. - // - // This member is required. - VpcEndpointIds []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RejectVpcEndpointConnectionsOutput struct { - - // Information about the endpoints that were not rejected, if applicable. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectVpcEndpointConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectVpcEndpointConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectVpcEndpointConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRejectVpcEndpointConnectionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectVpcEndpointConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectVpcEndpointConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectVpcEndpointConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcPeeringConnection.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcPeeringConnection.go deleted file mode 100644 index 16313c5ce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RejectVpcPeeringConnection.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Rejects a VPC peering connection request. The VPC peering connection must be in -// the pending-acceptance state. Use the DescribeVpcPeeringConnections request to view your outstanding VPC -// peering connection requests. To delete an active VPC peering connection, or to -// delete a VPC peering connection request that you initiated, use DeleteVpcPeeringConnection. -func (c *Client) RejectVpcPeeringConnection(ctx context.Context, params *RejectVpcPeeringConnectionInput, optFns ...func(*Options)) (*RejectVpcPeeringConnectionOutput, error) { - if params == nil { - params = &RejectVpcPeeringConnectionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RejectVpcPeeringConnection", params, optFns, c.addOperationRejectVpcPeeringConnectionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RejectVpcPeeringConnectionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RejectVpcPeeringConnectionInput struct { - - // The ID of the VPC peering connection. - // - // This member is required. - VpcPeeringConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RejectVpcPeeringConnectionOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRejectVpcPeeringConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRejectVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRejectVpcPeeringConnection{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RejectVpcPeeringConnection"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRejectVpcPeeringConnectionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectVpcPeeringConnection(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRejectVpcPeeringConnection(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RejectVpcPeeringConnection", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseAddress.go deleted file mode 100644 index 5adfacaac..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseAddress.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Releases the specified Elastic IP address. -// -// [Default VPC] Releasing an Elastic IP address automatically disassociates it -// from any instance that it's associated with. To disassociate an Elastic IP -// address without releasing it, use DisassociateAddress. -// -// [Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address before -// you can release it. Otherwise, Amazon EC2 returns an error ( -// InvalidIPAddress.InUse ). -// -// After releasing an Elastic IP address, it is released to the IP address pool. -// Be sure to update your DNS records and any servers or devices that communicate -// with the address. If you attempt to release an Elastic IP address that you -// already released, you'll get an AuthFailure error if the address is already -// allocated to another Amazon Web Services account. -// -// After you release an Elastic IP address, you might be able to recover it. For -// more information, see AllocateAddress. -func (c *Client) ReleaseAddress(ctx context.Context, params *ReleaseAddressInput, optFns ...func(*Options)) (*ReleaseAddressOutput, error) { - if params == nil { - params = &ReleaseAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReleaseAddress", params, optFns, c.addOperationReleaseAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReleaseAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReleaseAddressInput struct { - - // The allocation ID. This parameter is required. - AllocationId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The set of Availability Zones, Local Zones, or Wavelength Zones from which - // Amazon Web Services advertises IP addresses. - // - // If you provide an incorrect network border group, you receive an - // InvalidAddress.NotFound error. - NetworkBorderGroup *string - - // Deprecated. - PublicIp *string - - noSmithyDocumentSerde -} - -type ReleaseAddressOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReleaseAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReleaseAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReleaseAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReleaseAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReleaseAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReleaseAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReleaseAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseHosts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseHosts.go deleted file mode 100644 index 212b99180..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseHosts.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// When you no longer want to use an On-Demand Dedicated Host it can be released. -// On-Demand billing is stopped and the host goes into released state. The host ID -// of Dedicated Hosts that have been released can no longer be specified in another -// request, for example, to modify the host. You must stop or terminate all -// instances on a host before it can be released. -// -// When Dedicated Hosts are released, it may take some time for them to stop -// counting toward your limit and you may receive capacity errors when trying to -// allocate new Dedicated Hosts. Wait a few minutes and then try again. -// -// Released hosts still appear in a DescribeHosts response. -func (c *Client) ReleaseHosts(ctx context.Context, params *ReleaseHostsInput, optFns ...func(*Options)) (*ReleaseHostsOutput, error) { - if params == nil { - params = &ReleaseHostsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReleaseHosts", params, optFns, c.addOperationReleaseHostsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReleaseHostsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReleaseHostsInput struct { - - // The IDs of the Dedicated Hosts to release. - // - // This member is required. - HostIds []string - - noSmithyDocumentSerde -} - -type ReleaseHostsOutput struct { - - // The IDs of the Dedicated Hosts that were successfully released. - Successful []string - - // The IDs of the Dedicated Hosts that could not be released, including an error - // message. - Unsuccessful []types.UnsuccessfulItem - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReleaseHostsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReleaseHosts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReleaseHosts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReleaseHosts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReleaseHostsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReleaseHosts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReleaseHosts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReleaseHosts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseIpamPoolAllocation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseIpamPoolAllocation.go deleted file mode 100644 index a063b06a9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReleaseIpamPoolAllocation.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Release an allocation within an IPAM pool. The Region you use should be the -// IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM -// pool is available for allocations. You can only use this action to release -// manual allocations. To remove an allocation for a resource without deleting the -// resource, set its monitored state to false using [ModifyIpamResourceCidr]. For more information, see [Release an allocation] -// in the Amazon VPC IPAM User Guide. -// -// All EC2 API actions follow an [eventual consistency] model. -// -// [Release an allocation]: https://docs.aws.amazon.com/vpc/latest/ipam/release-alloc-ipam.html -// [eventual consistency]: https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html -// [ModifyIpamResourceCidr]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyIpamResourceCidr.html -func (c *Client) ReleaseIpamPoolAllocation(ctx context.Context, params *ReleaseIpamPoolAllocationInput, optFns ...func(*Options)) (*ReleaseIpamPoolAllocationOutput, error) { - if params == nil { - params = &ReleaseIpamPoolAllocationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReleaseIpamPoolAllocation", params, optFns, c.addOperationReleaseIpamPoolAllocationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReleaseIpamPoolAllocationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReleaseIpamPoolAllocationInput struct { - - // The CIDR of the allocation you want to release. - // - // This member is required. - Cidr *string - - // The ID of the allocation. - // - // This member is required. - IpamPoolAllocationId *string - - // The ID of the IPAM pool which contains the allocation you want to release. - // - // This member is required. - IpamPoolId *string - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ReleaseIpamPoolAllocationOutput struct { - - // Indicates if the release was successful. - Success *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReleaseIpamPoolAllocationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReleaseIpamPoolAllocation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReleaseIpamPoolAllocation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReleaseIpamPoolAllocation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReleaseIpamPoolAllocationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReleaseIpamPoolAllocation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReleaseIpamPoolAllocation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReleaseIpamPoolAllocation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceIamInstanceProfileAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceIamInstanceProfileAssociation.go deleted file mode 100644 index c7e6be166..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceIamInstanceProfileAssociation.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Replaces an IAM instance profile for the specified running instance. You can -// use this action to change the IAM instance profile that's associated with an -// instance without having to disassociate the existing IAM instance profile first. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -func (c *Client) ReplaceIamInstanceProfileAssociation(ctx context.Context, params *ReplaceIamInstanceProfileAssociationInput, optFns ...func(*Options)) (*ReplaceIamInstanceProfileAssociationOutput, error) { - if params == nil { - params = &ReplaceIamInstanceProfileAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceIamInstanceProfileAssociation", params, optFns, c.addOperationReplaceIamInstanceProfileAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceIamInstanceProfileAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceIamInstanceProfileAssociationInput struct { - - // The ID of the existing IAM instance profile association. - // - // This member is required. - AssociationId *string - - // The IAM instance profile. - // - // This member is required. - IamInstanceProfile *types.IamInstanceProfileSpecification - - noSmithyDocumentSerde -} - -type ReplaceIamInstanceProfileAssociationOutput struct { - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *types.IamInstanceProfileAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceIamInstanceProfileAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceIamInstanceProfileAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceIamInstanceProfileAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceIamInstanceProfileAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceIamInstanceProfileAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceIamInstanceProfileAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceIamInstanceProfileAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceImageCriteriaInAllowedImagesSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceImageCriteriaInAllowedImagesSettings.go deleted file mode 100644 index e3eb32c73..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceImageCriteriaInAllowedImagesSettings.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Sets or replaces the criteria for Allowed AMIs. -// -// The Allowed AMIs feature does not restrict the AMIs owned by your account. -// Regardless of the criteria you set, the AMIs created by your account will always -// be discoverable and usable by users in your account. -// -// For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. -// -// [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html -func (c *Client) ReplaceImageCriteriaInAllowedImagesSettings(ctx context.Context, params *ReplaceImageCriteriaInAllowedImagesSettingsInput, optFns ...func(*Options)) (*ReplaceImageCriteriaInAllowedImagesSettingsOutput, error) { - if params == nil { - params = &ReplaceImageCriteriaInAllowedImagesSettingsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceImageCriteriaInAllowedImagesSettings", params, optFns, c.addOperationReplaceImageCriteriaInAllowedImagesSettingsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceImageCriteriaInAllowedImagesSettingsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceImageCriteriaInAllowedImagesSettingsInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The list of criteria that are evaluated to determine whether AMIs are - // discoverable and usable in the account in the specified Amazon Web Services - // Region. - ImageCriteria []types.ImageCriterionRequest - - noSmithyDocumentSerde -} - -type ReplaceImageCriteriaInAllowedImagesSettingsOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceImageCriteriaInAllowedImagesSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceImageCriteriaInAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceImageCriteriaInAllowedImagesSettings{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceImageCriteriaInAllowedImagesSettings"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceImageCriteriaInAllowedImagesSettings(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceImageCriteriaInAllowedImagesSettings(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceImageCriteriaInAllowedImagesSettings", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclAssociation.go deleted file mode 100644 index 5b34fd45a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclAssociation.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Changes which network ACL a subnet is associated with. By default when you -// create a subnet, it's automatically associated with the default network ACL. For -// more information, see [Network ACLs]in the Amazon VPC User Guide. -// -// This is an idempotent operation. -// -// [Network ACLs]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html -func (c *Client) ReplaceNetworkAclAssociation(ctx context.Context, params *ReplaceNetworkAclAssociationInput, optFns ...func(*Options)) (*ReplaceNetworkAclAssociationOutput, error) { - if params == nil { - params = &ReplaceNetworkAclAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceNetworkAclAssociation", params, optFns, c.addOperationReplaceNetworkAclAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceNetworkAclAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceNetworkAclAssociationInput struct { - - // The ID of the current association between the original network ACL and the - // subnet. - // - // This member is required. - AssociationId *string - - // The ID of the new network ACL to associate with the subnet. - // - // This member is required. - NetworkAclId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ReplaceNetworkAclAssociationOutput struct { - - // The ID of the new association. - NewAssociationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceNetworkAclAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceNetworkAclAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceNetworkAclAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceNetworkAclAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceNetworkAclAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceNetworkAclAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceNetworkAclAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceNetworkAclAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclEntry.go deleted file mode 100644 index 0d1d256b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceNetworkAclEntry.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Replaces an entry (rule) in a network ACL. For more information, see [Network ACLs] in the -// Amazon VPC User Guide. -// -// [Network ACLs]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html -func (c *Client) ReplaceNetworkAclEntry(ctx context.Context, params *ReplaceNetworkAclEntryInput, optFns ...func(*Options)) (*ReplaceNetworkAclEntryOutput, error) { - if params == nil { - params = &ReplaceNetworkAclEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceNetworkAclEntry", params, optFns, c.addOperationReplaceNetworkAclEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceNetworkAclEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceNetworkAclEntryInput struct { - - // Indicates whether to replace the egress rule. - // - // Default: If no value is specified, we replace the ingress rule. - // - // This member is required. - Egress *bool - - // The ID of the ACL. - // - // This member is required. - NetworkAclId *string - - // The protocol number. A value of "-1" means all protocols. If you specify "-1" - // or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on - // all ports is allowed, regardless of any ports or ICMP types or codes that you - // specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, - // traffic for all ICMP types and codes allowed, regardless of any that you - // specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, - // you must specify an ICMP type and code. - // - // This member is required. - Protocol *string - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // This member is required. - RuleAction types.RuleAction - - // The rule number of the entry to replace. - // - // This member is required. - RuleNumber *int32 - - // The IPv4 network range to allow or deny, in CIDR notation (for example - // 172.16.0.0/24 ). - CidrBlock *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying - // protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *types.IcmpTypeCode - - // The IPv6 network range to allow or deny, in CIDR notation (for example - // 2001:bd8:1234:1a00::/64 ). - Ipv6CidrBlock *string - - // TCP or UDP protocols: The range of ports the rule applies to. Required if - // specifying protocol 6 (TCP) or 17 (UDP). - PortRange *types.PortRange - - noSmithyDocumentSerde -} - -type ReplaceNetworkAclEntryOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceNetworkAclEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceNetworkAclEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceNetworkAclEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceNetworkAclEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceNetworkAclEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceNetworkAclEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceNetworkAclEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRoute.go deleted file mode 100644 index 04eb1598c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRoute.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Replaces an existing route within a route table in a VPC. -// -// You must specify either a destination CIDR block or a prefix list ID. You must -// also specify exactly one of the resources from the parameter list, or reset the -// local route to its default target. -// -// For more information, see [Route tables] in the Amazon VPC User Guide. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) ReplaceRoute(ctx context.Context, params *ReplaceRouteInput, optFns ...func(*Options)) (*ReplaceRouteOutput, error) { - if params == nil { - params = &ReplaceRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceRoute", params, optFns, c.addOperationReplaceRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceRouteInput struct { - - // The ID of the route table. - // - // This member is required. - RouteTableId *string - - // [IPv4 traffic only] The ID of a carrier gateway. - CarrierGatewayId *string - - // The Amazon Resource Name (ARN) of the core network. - CoreNetworkArn *string - - // The IPv4 CIDR address block used for the destination match. The value that you - // provide must match the CIDR of an existing route in the table. - DestinationCidrBlock *string - - // The IPv6 CIDR address block used for the destination match. The value that you - // provide must match the CIDR of an existing route in the table. - DestinationIpv6CidrBlock *string - - // The ID of the prefix list for the route. - DestinationPrefixListId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // [IPv6 traffic only] The ID of an egress-only internet gateway. - EgressOnlyInternetGatewayId *string - - // The ID of an internet gateway or virtual private gateway. - GatewayId *string - - // The ID of a NAT instance in your VPC. - InstanceId *string - - // The ID of the local gateway. - LocalGatewayId *string - - // Specifies whether to reset the local route to its default target ( local ). - LocalTarget *bool - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string - - // The ID of a network interface. - NetworkInterfaceId *string - - // The Amazon Resource Name (ARN) of the ODB network. - OdbNetworkArn *string - - // The ID of a transit gateway. - TransitGatewayId *string - - // The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only. - VpcEndpointId *string - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -type ReplaceRouteOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRouteTableAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRouteTableAssociation.go deleted file mode 100644 index fb79fc094..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceRouteTableAssociation.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Changes the route table associated with a given subnet, internet gateway, or -// virtual private gateway in a VPC. After the operation completes, the subnet or -// gateway uses the routes in the new route table. For more information about route -// tables, see [Route tables]in the Amazon VPC User Guide. -// -// You can also use this operation to change which table is the main route table -// in the VPC. Specify the main route table's association ID and the route table ID -// of the new main route table. -// -// [Route tables]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html -func (c *Client) ReplaceRouteTableAssociation(ctx context.Context, params *ReplaceRouteTableAssociationInput, optFns ...func(*Options)) (*ReplaceRouteTableAssociationOutput, error) { - if params == nil { - params = &ReplaceRouteTableAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceRouteTableAssociation", params, optFns, c.addOperationReplaceRouteTableAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceRouteTableAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceRouteTableAssociationInput struct { - - // The association ID. - // - // This member is required. - AssociationId *string - - // The ID of the new route table to associate with the subnet. - // - // This member is required. - RouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ReplaceRouteTableAssociationOutput struct { - - // The state of the association. - AssociationState *types.RouteTableAssociationState - - // The ID of the new association. - NewAssociationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceRouteTableAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceRouteTableAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceRouteTableAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceRouteTableAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceRouteTableAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceRouteTableAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceRouteTableAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceRouteTableAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceTransitGatewayRoute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceTransitGatewayRoute.go deleted file mode 100644 index 06c369180..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceTransitGatewayRoute.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Replaces the specified route in the specified transit gateway route table. -func (c *Client) ReplaceTransitGatewayRoute(ctx context.Context, params *ReplaceTransitGatewayRouteInput, optFns ...func(*Options)) (*ReplaceTransitGatewayRouteOutput, error) { - if params == nil { - params = &ReplaceTransitGatewayRouteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceTransitGatewayRoute", params, optFns, c.addOperationReplaceTransitGatewayRouteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceTransitGatewayRouteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceTransitGatewayRouteInput struct { - - // The CIDR range used for the destination match. Routing decisions are based on - // the most specific match. - // - // This member is required. - DestinationCidrBlock *string - - // The ID of the route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Indicates whether traffic matching this route is to be dropped. - Blackhole *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -type ReplaceTransitGatewayRouteOutput struct { - - // Information about the modified route. - Route *types.TransitGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceTransitGatewayRouteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceTransitGatewayRoute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceTransitGatewayRoute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceTransitGatewayRouteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceTransitGatewayRoute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceTransitGatewayRoute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceTransitGatewayRoute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceVpnTunnel.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceVpnTunnel.go deleted file mode 100644 index 84bed6dc2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReplaceVpnTunnel.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Trigger replacement of specified VPN tunnel. -func (c *Client) ReplaceVpnTunnel(ctx context.Context, params *ReplaceVpnTunnelInput, optFns ...func(*Options)) (*ReplaceVpnTunnelOutput, error) { - if params == nil { - params = &ReplaceVpnTunnelInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReplaceVpnTunnel", params, optFns, c.addOperationReplaceVpnTunnelMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReplaceVpnTunnelOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReplaceVpnTunnelInput struct { - - // The ID of the Site-to-Site VPN connection. - // - // This member is required. - VpnConnectionId *string - - // The external IP address of the VPN tunnel. - // - // This member is required. - VpnTunnelOutsideIpAddress *string - - // Trigger pending tunnel endpoint maintenance. - ApplyPendingMaintenance *bool - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ReplaceVpnTunnelOutput struct { - - // Confirmation of replace tunnel operation. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReplaceVpnTunnelMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceVpnTunnel{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceVpnTunnel{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReplaceVpnTunnel"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReplaceVpnTunnelValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceVpnTunnel(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReplaceVpnTunnel(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReplaceVpnTunnel", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReportInstanceStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReportInstanceStatus.go deleted file mode 100644 index 2172db87f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ReportInstanceStatus.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Submits feedback about the status of an instance. The instance must be in the -// running state. If your experience with the instance differs from the instance -// status returned by DescribeInstanceStatus, use ReportInstanceStatus to report your experience with the instance. Amazon -// EC2 collects this information to improve the accuracy of status checks. -// -// Use of this action does not change the value returned by DescribeInstanceStatus. -func (c *Client) ReportInstanceStatus(ctx context.Context, params *ReportInstanceStatusInput, optFns ...func(*Options)) (*ReportInstanceStatusOutput, error) { - if params == nil { - params = &ReportInstanceStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ReportInstanceStatus", params, optFns, c.addOperationReportInstanceStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ReportInstanceStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ReportInstanceStatusInput struct { - - // The instances. - // - // This member is required. - Instances []string - - // The reason codes that describe the health state of your instance. - // - // - instance-stuck-in-state : My instance is stuck in a state. - // - // - unresponsive : My instance is unresponsive. - // - // - not-accepting-credentials : My instance is not accepting my credentials. - // - // - password-not-available : A password is not available for my instance. - // - // - performance-network : My instance is experiencing performance problems that - // I believe are network related. - // - // - performance-instance-store : My instance is experiencing performance - // problems that I believe are related to the instance stores. - // - // - performance-ebs-volume : My instance is experiencing performance problems - // that I believe are related to an EBS volume. - // - // - performance-other : My instance is experiencing performance problems. - // - // - other : [explain using the description parameter] - // - // This member is required. - ReasonCodes []types.ReportInstanceReasonCodes - - // The status of all instances listed. - // - // This member is required. - Status types.ReportStatusType - - // Descriptive text about the health state of your instance. - // - // Deprecated: This member has been deprecated - Description *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The time at which the reported instance health state ended. - EndTime *time.Time - - // The time at which the reported instance health state began. - StartTime *time.Time - - noSmithyDocumentSerde -} - -type ReportInstanceStatusOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationReportInstanceStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpReportInstanceStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpReportInstanceStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ReportInstanceStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpReportInstanceStatusValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReportInstanceStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opReportInstanceStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ReportInstanceStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotFleet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotFleet.go deleted file mode 100644 index 5db4d2505..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotFleet.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a Spot Fleet request. -// -// The Spot Fleet request specifies the total target capacity and the On-Demand -// target capacity. Amazon EC2 calculates the difference between the total capacity -// and On-Demand capacity, and launches the difference as Spot capacity. -// -// You can submit a single request that includes multiple launch specifications -// that vary by instance type, AMI, Availability Zone, or subnet. -// -// By default, the Spot Fleet requests Spot Instances in the Spot Instance pool -// where the price per unit is the lowest. Each launch specification can include -// its own instance weighting that reflects the value of the instance type to your -// application workload. -// -// Alternatively, you can specify that the Spot Fleet distribute the target -// capacity across the Spot pools included in its launch specifications. By -// ensuring that the Spot Instances in your Spot Fleet are in different Spot pools, -// you can improve the availability of your fleet. -// -// You can specify tags for the Spot Fleet request and instances launched by the -// fleet. You cannot tag other resource types in a Spot Fleet request because only -// the spot-fleet-request and instance resource types are supported. -// -// For more information, see [Spot Fleet requests] in the Amazon EC2 User Guide. -// -// We strongly discourage using the RequestSpotFleet API because it is a legacy -// API with no planned investment. For options for requesting Spot Instances, see [Which is the best Spot request method to use?] -// in the Amazon EC2 User Guide. -// -// [Spot Fleet requests]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html -// [Which is the best Spot request method to use?]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use -func (c *Client) RequestSpotFleet(ctx context.Context, params *RequestSpotFleetInput, optFns ...func(*Options)) (*RequestSpotFleetOutput, error) { - if params == nil { - params = &RequestSpotFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RequestSpotFleet", params, optFns, c.addOperationRequestSpotFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RequestSpotFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for RequestSpotFleet. -type RequestSpotFleetInput struct { - - // The configuration for the Spot Fleet request. - // - // This member is required. - SpotFleetRequestConfig *types.SpotFleetRequestConfigData - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -// Contains the output of RequestSpotFleet. -type RequestSpotFleetOutput struct { - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRequestSpotFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRequestSpotFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRequestSpotFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RequestSpotFleet"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRequestSpotFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRequestSpotFleet(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRequestSpotFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RequestSpotFleet", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotInstances.go deleted file mode 100644 index f0abba7ab..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RequestSpotInstances.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Creates a Spot Instance request. -// -// For more information, see [Work with Spot Instance] in the Amazon EC2 User Guide. -// -// We strongly discourage using the RequestSpotInstances API because it is a -// legacy API with no planned investment. For options for requesting Spot -// Instances, see [Which is the best Spot request method to use?]in the Amazon EC2 User Guide. -// -// [Work with Spot Instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html -// [Which is the best Spot request method to use?]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use -func (c *Client) RequestSpotInstances(ctx context.Context, params *RequestSpotInstancesInput, optFns ...func(*Options)) (*RequestSpotInstancesOutput, error) { - if params == nil { - params = &RequestSpotInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RequestSpotInstances", params, optFns, c.addOperationRequestSpotInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RequestSpotInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for RequestSpotInstances. -type RequestSpotInstancesInput struct { - - // The user-specified name for a logical grouping of requests. - // - // When you specify an Availability Zone group in a Spot Instance request, all - // Spot Instances in the request are launched in the same Availability Zone. - // Instance proximity is maintained with this parameter, but the choice of - // Availability Zone is not. The group applies only to requests for Spot Instances - // of the same instance type. Any additional Spot Instance requests that are - // specified with the same Availability Zone group name are launched in that same - // Availability Zone, as long as at least one instance from the group is still - // active. - // - // If there is no active instance running in the Availability Zone group that you - // specify for a new Spot Instance request (all instances are terminated, the - // request is expired, or the maximum price you specified falls below current Spot - // price), then Amazon EC2 launches the instance in any Availability Zone where the - // constraint can be met. Consequently, the subsequent set of Spot Instances could - // be placed in a different zone from the original request, even if you specified - // the same Availability Zone group. - // - // Default: Instances are launched in any available Availability Zone. - AvailabilityZoneGroup *string - - // Deprecated. - BlockDurationMinutes *int32 - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency in Amazon EC2 API requests]in the Amazon EC2 User Guide. - // - // [Ensuring idempotency in Amazon EC2 API requests]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of Spot Instances to launch. - // - // Default: 1 - InstanceCount *int32 - - // The behavior when a Spot Instance is interrupted. The default is terminate . - InstanceInterruptionBehavior types.InstanceInterruptionBehavior - - // The instance launch group. Launch groups are Spot Instances that launch - // together and terminate together. - // - // Default: Instances are launched and terminated individually - LaunchGroup *string - - // The launch specification. - LaunchSpecification *types.RequestSpotLaunchSpecification - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The key-value pair for tagging the Spot Instance request on creation. The value - // for ResourceType must be spot-instances-request , otherwise the Spot Instance - // request fails. To tag the Spot Instance request after it has been created, see [CreateTags] - // . - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - TagSpecifications []types.TagSpecification - - // The Spot Instance request type. - // - // Default: one-time - Type types.SpotInstanceType - - // The start date of the request. If this is a one-time request, the request - // becomes active at this date and time and remains active until all instances - // launch, the request expires, or the request is canceled. If the request is - // persistent, the request becomes active at this date and time and remains active - // until it expires or is canceled. - // - // The specified start date and time cannot be equal to the current date and time. - // You must specify a start date and time that occurs after the current date and - // time. - ValidFrom *time.Time - - // The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). - // - // - For a persistent request, the request remains active until the ValidUntil - // date and time is reached. Otherwise, the request remains active until you cancel - // it. - // - // - For a one-time request, the request remains active until all instances - // launch, the request is canceled, or the ValidUntil date and time is reached. - // By default, the request is valid for 7 days from the date the request was - // created. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// Contains the output of RequestSpotInstances. -type RequestSpotInstancesOutput struct { - - // The Spot Instance requests. - SpotInstanceRequests []types.SpotInstanceRequest - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRequestSpotInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRequestSpotInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRequestSpotInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RequestSpotInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRequestSpotInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRequestSpotInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRequestSpotInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RequestSpotInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetAddressAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetAddressAttribute.go deleted file mode 100644 index 97839a172..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetAddressAttribute.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets the attribute of the specified IP address. For requirements, see [Using reverse DNS for email applications]. -// -// [Using reverse DNS for email applications]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS -func (c *Client) ResetAddressAttribute(ctx context.Context, params *ResetAddressAttributeInput, optFns ...func(*Options)) (*ResetAddressAttributeOutput, error) { - if params == nil { - params = &ResetAddressAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetAddressAttribute", params, optFns, c.addOperationResetAddressAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetAddressAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ResetAddressAttributeInput struct { - - // [EC2-VPC] The allocation ID. - // - // This member is required. - AllocationId *string - - // The attribute of the IP address. - // - // This member is required. - Attribute types.AddressAttributeName - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetAddressAttributeOutput struct { - - // Information about the IP address. - Address *types.AddressAttribute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetAddressAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetAddressAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetAddressAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetAddressAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetAddressAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetAddressAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetAddressAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetAddressAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetEbsDefaultKmsKeyId.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetEbsDefaultKmsKeyId.go deleted file mode 100644 index 70613ad59..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetEbsDefaultKmsKeyId.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets the default KMS key for EBS encryption for your account in this Region -// to the Amazon Web Services managed KMS key for EBS. -// -// After resetting the default KMS key to the Amazon Web Services managed KMS key, -// you can continue to encrypt by a customer managed KMS key by specifying it when -// you create the volume. For more information, see [Amazon EBS encryption]in the Amazon EBS User Guide. -// -// [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html -func (c *Client) ResetEbsDefaultKmsKeyId(ctx context.Context, params *ResetEbsDefaultKmsKeyIdInput, optFns ...func(*Options)) (*ResetEbsDefaultKmsKeyIdOutput, error) { - if params == nil { - params = &ResetEbsDefaultKmsKeyIdInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetEbsDefaultKmsKeyId", params, optFns, c.addOperationResetEbsDefaultKmsKeyIdMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetEbsDefaultKmsKeyIdOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ResetEbsDefaultKmsKeyIdInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetEbsDefaultKmsKeyIdOutput struct { - - // The Amazon Resource Name (ARN) of the default KMS key for EBS encryption by - // default. - KmsKeyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetEbsDefaultKmsKeyIdMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetEbsDefaultKmsKeyId{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetEbsDefaultKmsKeyId"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetEbsDefaultKmsKeyId(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetEbsDefaultKmsKeyId(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetEbsDefaultKmsKeyId", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetFpgaImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetFpgaImageAttribute.go deleted file mode 100644 index cce50b258..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetFpgaImageAttribute.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets the specified attribute of the specified Amazon FPGA Image (AFI) to its -// default value. You can only reset the load permission attribute. -func (c *Client) ResetFpgaImageAttribute(ctx context.Context, params *ResetFpgaImageAttributeInput, optFns ...func(*Options)) (*ResetFpgaImageAttributeOutput, error) { - if params == nil { - params = &ResetFpgaImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetFpgaImageAttribute", params, optFns, c.addOperationResetFpgaImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetFpgaImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ResetFpgaImageAttributeInput struct { - - // The ID of the AFI. - // - // This member is required. - FpgaImageId *string - - // The attribute. - Attribute types.ResetFpgaImageAttributeName - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetFpgaImageAttributeOutput struct { - - // Is true if the request succeeds, and an error otherwise. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetFpgaImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetFpgaImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetFpgaImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetFpgaImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetFpgaImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetFpgaImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetFpgaImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetImageAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetImageAttribute.go deleted file mode 100644 index 4782499b2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetImageAttribute.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets an attribute of an AMI to its default value. -func (c *Client) ResetImageAttribute(ctx context.Context, params *ResetImageAttributeInput, optFns ...func(*Options)) (*ResetImageAttributeOutput, error) { - if params == nil { - params = &ResetImageAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetImageAttribute", params, optFns, c.addOperationResetImageAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetImageAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ResetImageAttribute. -type ResetImageAttributeInput struct { - - // The attribute to reset (currently you can only reset the launch permission - // attribute). - // - // This member is required. - Attribute types.ResetImageAttributeName - - // The ID of the AMI. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetImageAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetImageAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetImageAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetImageAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetImageAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetImageAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetImageAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetImageAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetImageAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetInstanceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetInstanceAttribute.go deleted file mode 100644 index dfbae0e39..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetInstanceAttribute.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets an attribute of an instance to its default value. To reset the kernel or -// ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck -// , the instance can be either running or stopped. -// -// The sourceDestCheck attribute controls whether source/destination checking is -// enabled. The default value is true , which means checking is enabled. This value -// must be false for a NAT instance to perform NAT. For more information, see [NAT instances] in -// the Amazon VPC User Guide. -// -// [NAT instances]: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html -func (c *Client) ResetInstanceAttribute(ctx context.Context, params *ResetInstanceAttributeInput, optFns ...func(*Options)) (*ResetInstanceAttributeOutput, error) { - if params == nil { - params = &ResetInstanceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetInstanceAttribute", params, optFns, c.addOperationResetInstanceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetInstanceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ResetInstanceAttributeInput struct { - - // The attribute to reset. - // - // You can only reset the following attributes: kernel | ramdisk | sourceDestCheck . - // - // This member is required. - Attribute types.InstanceAttributeName - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetInstanceAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetInstanceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetInstanceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetInstanceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetInstanceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetInstanceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetInstanceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetInstanceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetNetworkInterfaceAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetNetworkInterfaceAttribute.go deleted file mode 100644 index 741d64102..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetNetworkInterfaceAttribute.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets a network interface attribute. You can specify only one attribute at a -// time. -func (c *Client) ResetNetworkInterfaceAttribute(ctx context.Context, params *ResetNetworkInterfaceAttributeInput, optFns ...func(*Options)) (*ResetNetworkInterfaceAttributeOutput, error) { - if params == nil { - params = &ResetNetworkInterfaceAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetNetworkInterfaceAttribute", params, optFns, c.addOperationResetNetworkInterfaceAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetNetworkInterfaceAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for ResetNetworkInterfaceAttribute. -type ResetNetworkInterfaceAttributeInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The source/destination checking attribute. Resets the value to true . - SourceDestCheck *string - - noSmithyDocumentSerde -} - -type ResetNetworkInterfaceAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetNetworkInterfaceAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetNetworkInterfaceAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetNetworkInterfaceAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetNetworkInterfaceAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetNetworkInterfaceAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetNetworkInterfaceAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetNetworkInterfaceAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetSnapshotAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetSnapshotAttribute.go deleted file mode 100644 index b44d4b725..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ResetSnapshotAttribute.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Resets permission settings for the specified snapshot. -// -// For more information about modifying snapshot permissions, see [Share a snapshot] in the Amazon -// EBS User Guide. -// -// [Share a snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html -func (c *Client) ResetSnapshotAttribute(ctx context.Context, params *ResetSnapshotAttributeInput, optFns ...func(*Options)) (*ResetSnapshotAttributeOutput, error) { - if params == nil { - params = &ResetSnapshotAttributeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ResetSnapshotAttribute", params, optFns, c.addOperationResetSnapshotAttributeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ResetSnapshotAttributeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ResetSnapshotAttributeInput struct { - - // The attribute to reset. Currently, only the attribute for permission to create - // volumes can be reset. - // - // This member is required. - Attribute types.SnapshotAttributeName - - // The ID of the snapshot. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type ResetSnapshotAttributeOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationResetSnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpResetSnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpResetSnapshotAttribute{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ResetSnapshotAttribute"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpResetSnapshotAttributeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetSnapshotAttribute(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opResetSnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ResetSnapshotAttribute", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreAddressToClassic.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreAddressToClassic.go deleted file mode 100644 index afdf13c84..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreAddressToClassic.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is deprecated. -// -// Restores an Elastic IP address that was previously moved to the EC2-VPC -// platform back to the EC2-Classic platform. You cannot move an Elastic IP address -// that was originally allocated for use in EC2-VPC. The Elastic IP address must -// not be associated with an instance or network interface. -func (c *Client) RestoreAddressToClassic(ctx context.Context, params *RestoreAddressToClassicInput, optFns ...func(*Options)) (*RestoreAddressToClassicOutput, error) { - if params == nil { - params = &RestoreAddressToClassicInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RestoreAddressToClassic", params, optFns, c.addOperationRestoreAddressToClassicMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RestoreAddressToClassicOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RestoreAddressToClassicInput struct { - - // The Elastic IP address. - // - // This member is required. - PublicIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RestoreAddressToClassicOutput struct { - - // The Elastic IP address. - PublicIp *string - - // The move status for the IP address. - Status types.Status - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRestoreAddressToClassicMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRestoreAddressToClassic{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRestoreAddressToClassic{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreAddressToClassic"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRestoreAddressToClassicValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreAddressToClassic(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRestoreAddressToClassic(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RestoreAddressToClassic", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreImageFromRecycleBin.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreImageFromRecycleBin.go deleted file mode 100644 index b590b0143..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreImageFromRecycleBin.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Restores an AMI from the Recycle Bin. For more information, see [Recover deleted Amazon EBS snapshots and EBS-back AMIs with Recycle Bin] in the Amazon -// EC2 User Guide. -// -// [Recover deleted Amazon EBS snapshots and EBS-back AMIs with Recycle Bin]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin.html -func (c *Client) RestoreImageFromRecycleBin(ctx context.Context, params *RestoreImageFromRecycleBinInput, optFns ...func(*Options)) (*RestoreImageFromRecycleBinOutput, error) { - if params == nil { - params = &RestoreImageFromRecycleBinInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RestoreImageFromRecycleBin", params, optFns, c.addOperationRestoreImageFromRecycleBinMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RestoreImageFromRecycleBinOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RestoreImageFromRecycleBinInput struct { - - // The ID of the AMI to restore. - // - // This member is required. - ImageId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RestoreImageFromRecycleBinOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRestoreImageFromRecycleBinMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRestoreImageFromRecycleBin{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRestoreImageFromRecycleBin{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreImageFromRecycleBin"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRestoreImageFromRecycleBinValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreImageFromRecycleBin(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRestoreImageFromRecycleBin(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RestoreImageFromRecycleBin", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreManagedPrefixListVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreManagedPrefixListVersion.go deleted file mode 100644 index e712cecd9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreManagedPrefixListVersion.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Restores the entries from a previous version of a managed prefix list to a new -// version of the prefix list. -func (c *Client) RestoreManagedPrefixListVersion(ctx context.Context, params *RestoreManagedPrefixListVersionInput, optFns ...func(*Options)) (*RestoreManagedPrefixListVersionOutput, error) { - if params == nil { - params = &RestoreManagedPrefixListVersionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RestoreManagedPrefixListVersion", params, optFns, c.addOperationRestoreManagedPrefixListVersionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RestoreManagedPrefixListVersionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RestoreManagedPrefixListVersionInput struct { - - // The current version number for the prefix list. - // - // This member is required. - CurrentVersion *int64 - - // The ID of the prefix list. - // - // This member is required. - PrefixListId *string - - // The version to restore. - // - // This member is required. - PreviousVersion *int64 - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RestoreManagedPrefixListVersionOutput struct { - - // Information about the prefix list. - PrefixList *types.ManagedPrefixList - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRestoreManagedPrefixListVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRestoreManagedPrefixListVersion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRestoreManagedPrefixListVersion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreManagedPrefixListVersion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRestoreManagedPrefixListVersionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreManagedPrefixListVersion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRestoreManagedPrefixListVersion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RestoreManagedPrefixListVersion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotFromRecycleBin.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotFromRecycleBin.go deleted file mode 100644 index 5e5e0e28c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotFromRecycleBin.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Restores a snapshot from the Recycle Bin. For more information, see [Restore snapshots from the Recycle Bin] in the -// Amazon EBS User Guide. -// -// [Restore snapshots from the Recycle Bin]: https://docs.aws.amazon.com/ebs/latest/userguide/recycle-bin-working-with-snaps.html#recycle-bin-restore-snaps -func (c *Client) RestoreSnapshotFromRecycleBin(ctx context.Context, params *RestoreSnapshotFromRecycleBinInput, optFns ...func(*Options)) (*RestoreSnapshotFromRecycleBinOutput, error) { - if params == nil { - params = &RestoreSnapshotFromRecycleBinInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RestoreSnapshotFromRecycleBin", params, optFns, c.addOperationRestoreSnapshotFromRecycleBinMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RestoreSnapshotFromRecycleBinOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RestoreSnapshotFromRecycleBinInput struct { - - // The ID of the snapshot to restore. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type RestoreSnapshotFromRecycleBinOutput struct { - - // The description for the snapshot. - Description *string - - // Indicates whether the snapshot is encrypted. - Encrypted *bool - - // The ARN of the Outpost on which the snapshot is stored. For more information, - // see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. - // - // [Amazon EBS local snapshots on Outposts]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the EBS snapshot. - OwnerId *string - - // The progress of the snapshot, as a percentage. - Progress *string - - // The ID of the snapshot. - SnapshotId *string - - // Reserved for future use. - SseType types.SSEType - - // The time stamp when the snapshot was initiated. - StartTime *time.Time - - // The state of the snapshot. - State types.SnapshotState - - // The ID of the volume that was used to create the snapshot. - VolumeId *string - - // The size of the volume, in GiB. - VolumeSize *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRestoreSnapshotFromRecycleBinMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRestoreSnapshotFromRecycleBin{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreSnapshotFromRecycleBin"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRestoreSnapshotFromRecycleBinValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreSnapshotFromRecycleBin(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRestoreSnapshotFromRecycleBin(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RestoreSnapshotFromRecycleBin", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotTier.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotTier.go deleted file mode 100644 index 159304187..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RestoreSnapshotTier.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Restores an archived Amazon EBS snapshot for use temporarily or permanently, or -// modifies the restore period or restore type for a snapshot that was previously -// temporarily restored. -// -// For more information see [Restore an archived snapshot] and [modify the restore period or restore type for a temporarily restored snapshot] in the Amazon EBS User Guide. -// -// [Restore an archived snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/working-with-snapshot-archiving.html#restore-archived-snapshot -// [modify the restore period or restore type for a temporarily restored snapshot]: https://docs.aws.amazon.com/ebs/latest/userguide/working-with-snapshot-archiving.html#modify-temp-restore-period -func (c *Client) RestoreSnapshotTier(ctx context.Context, params *RestoreSnapshotTierInput, optFns ...func(*Options)) (*RestoreSnapshotTierOutput, error) { - if params == nil { - params = &RestoreSnapshotTierInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RestoreSnapshotTier", params, optFns, c.addOperationRestoreSnapshotTierMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RestoreSnapshotTierOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RestoreSnapshotTierInput struct { - - // The ID of the snapshot to restore. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether to permanently restore an archived snapshot. To permanently - // restore an archived snapshot, specify true and omit the - // RestoreSnapshotTierRequest$TemporaryRestoreDays parameter. - PermanentRestore *bool - - // Specifies the number of days for which to temporarily restore an archived - // snapshot. Required for temporary restores only. The snapshot will be - // automatically re-archived after this period. - // - // To temporarily restore an archived snapshot, specify the number of days and - // omit the PermanentRestore parameter or set it to false . - TemporaryRestoreDays *int32 - - noSmithyDocumentSerde -} - -type RestoreSnapshotTierOutput struct { - - // Indicates whether the snapshot is permanently restored. true indicates a - // permanent restore. false indicates a temporary restore. - IsPermanentRestore *bool - - // For temporary restores only. The number of days for which the archived snapshot - // is temporarily restored. - RestoreDuration *int32 - - // The date and time when the snapshot restore process started. - RestoreStartTime *time.Time - - // The ID of the snapshot. - SnapshotId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRestoreSnapshotTierMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRestoreSnapshotTier{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRestoreSnapshotTier{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreSnapshotTier"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRestoreSnapshotTierValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreSnapshotTier(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRestoreSnapshotTier(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RestoreSnapshotTier", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeClientVpnIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeClientVpnIngress.go deleted file mode 100644 index 7a287609a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeClientVpnIngress.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes an ingress authorization rule from a Client VPN endpoint. -func (c *Client) RevokeClientVpnIngress(ctx context.Context, params *RevokeClientVpnIngressInput, optFns ...func(*Options)) (*RevokeClientVpnIngressOutput, error) { - if params == nil { - params = &RevokeClientVpnIngressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RevokeClientVpnIngress", params, optFns, c.addOperationRevokeClientVpnIngressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RevokeClientVpnIngressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RevokeClientVpnIngressInput struct { - - // The ID of the Client VPN endpoint with which the authorization rule is - // associated. - // - // This member is required. - ClientVpnEndpointId *string - - // The IPv4 address range, in CIDR notation, of the network for which access is - // being removed. - // - // This member is required. - TargetNetworkCidr *string - - // The ID of the Active Directory group for which to revoke access. - AccessGroupId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether access should be revoked for all groups for a single - // TargetNetworkCidr that earlier authorized ingress for all groups using - // AuthorizeAllGroups . This does not impact other authorization rules that allowed - // ingress to the same TargetNetworkCidr with a specific AccessGroupId . - RevokeAllGroups *bool - - noSmithyDocumentSerde -} - -type RevokeClientVpnIngressOutput struct { - - // The current state of the authorization rule. - Status *types.ClientVpnAuthorizationRuleStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRevokeClientVpnIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRevokeClientVpnIngress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRevokeClientVpnIngress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RevokeClientVpnIngress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRevokeClientVpnIngressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeClientVpnIngress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRevokeClientVpnIngress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RevokeClientVpnIngress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupEgress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupEgress.go deleted file mode 100644 index 4b95eae30..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupEgress.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the specified outbound (egress) rules from the specified security group. -// -// You can specify rules using either rule IDs or security group rule properties. -// If you use rule properties, the values that you specify (for example, ports) -// must match the existing rule's values exactly. Each rule has a protocol, from -// and to ports, and destination (CIDR range, security group, or prefix list). For -// the TCP and UDP protocols, you must also specify the destination port or range -// of ports. For the ICMP protocol, you must also specify the ICMP type and code. -// If the security group rule has a description, you do not need to specify the -// description to revoke the rule. -// -// For a default VPC, if the values you specify do not match the existing rule's -// values, no error is returned, and the output describes the security group rules -// that were not revoked. -// -// Amazon Web Services recommends that you describe the security group to verify -// that the rules were removed. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -func (c *Client) RevokeSecurityGroupEgress(ctx context.Context, params *RevokeSecurityGroupEgressInput, optFns ...func(*Options)) (*RevokeSecurityGroupEgressOutput, error) { - if params == nil { - params = &RevokeSecurityGroupEgressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RevokeSecurityGroupEgress", params, optFns, c.addOperationRevokeSecurityGroupEgressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RevokeSecurityGroupEgressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RevokeSecurityGroupEgressInput struct { - - // The ID of the security group. - // - // This member is required. - GroupId *string - - // Not supported. Use a set of IP permissions to specify the CIDR. - CidrIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Not supported. Use a set of IP permissions to specify the port. - FromPort *int32 - - // The sets of IP permissions. You can't specify a destination security group and - // a CIDR IP address range in the same set of permissions. - IpPermissions []types.IpPermission - - // Not supported. Use a set of IP permissions to specify the protocol name or - // number. - IpProtocol *string - - // The IDs of the security group rules. - SecurityGroupRuleIds []string - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupName *string - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupOwnerId *string - - // Not supported. Use a set of IP permissions to specify the port. - ToPort *int32 - - noSmithyDocumentSerde -} - -type RevokeSecurityGroupEgressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Details about the revoked security group rules. - RevokedSecurityGroupRules []types.RevokedSecurityGroupRule - - // The outbound rules that were unknown to the service. In some cases, - // unknownIpPermissionSet might be in a different format from the request - // parameter. - UnknownIpPermissions []types.IpPermission - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRevokeSecurityGroupEgressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRevokeSecurityGroupEgress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRevokeSecurityGroupEgress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RevokeSecurityGroupEgress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRevokeSecurityGroupEgressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeSecurityGroupEgress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRevokeSecurityGroupEgress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RevokeSecurityGroupEgress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupIngress.go deleted file mode 100644 index 0d29a58a2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RevokeSecurityGroupIngress.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the specified inbound (ingress) rules from a security group. -// -// You can specify rules using either rule IDs or security group rule properties. -// If you use rule properties, the values that you specify (for example, ports) -// must match the existing rule's values exactly. Each rule has a protocol, from -// and to ports, and source (CIDR range, security group, or prefix list). For the -// TCP and UDP protocols, you must also specify the destination port or range of -// ports. For the ICMP protocol, you must also specify the ICMP type and code. If -// the security group rule has a description, you do not need to specify the -// description to revoke the rule. -// -// For a default VPC, if the values you specify do not match the existing rule's -// values, no error is returned, and the output describes the security group rules -// that were not revoked. -// -// For a non-default VPC, if the values you specify do not match the existing -// rule's values, an InvalidPermission.NotFound client error is returned, and no -// rules are revoked. -// -// Amazon Web Services recommends that you describe the security group to verify -// that the rules were removed. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -func (c *Client) RevokeSecurityGroupIngress(ctx context.Context, params *RevokeSecurityGroupIngressInput, optFns ...func(*Options)) (*RevokeSecurityGroupIngressOutput, error) { - if params == nil { - params = &RevokeSecurityGroupIngressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RevokeSecurityGroupIngress", params, optFns, c.addOperationRevokeSecurityGroupIngressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RevokeSecurityGroupIngressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RevokeSecurityGroupIngressInput struct { - - // The CIDR IP address range. You can't specify this parameter when specifying a - // source security group. - CidrIp *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP, this is the ICMP type or -1 (all ICMP types). - FromPort *int32 - - // The ID of the security group. - GroupId *string - - // [Default VPC] The name of the security group. You must specify either the - // security group ID or the security group name in the request. For security groups - // in a nondefault VPC, you must specify the security group ID. - GroupName *string - - // The sets of IP permissions. You can't specify a source security group and a - // CIDR IP address range in the same set of permissions. - IpPermissions []types.IpPermission - - // The IP protocol name ( tcp , udp , icmp ) or number (see [Protocol Numbers]). Use -1 to specify - // all. - // - // [Protocol Numbers]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // The IDs of the security group rules. - SecurityGroupRuleIds []string - - // [Default VPC] The name of the source security group. You can't specify this - // parameter in combination with the following parameters: the CIDR IP address - // range, the start of the port range, the IP protocol, and the end of the port - // range. The source security group must be in the same VPC. To revoke a specific - // rule for an IP protocol and port range, use a set of IP permissions instead. - SourceSecurityGroupName *string - - // Not supported. - SourceSecurityGroupOwnerId *string - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP, this is the ICMP code or -1 (all ICMP codes). - ToPort *int32 - - noSmithyDocumentSerde -} - -type RevokeSecurityGroupIngressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Details about the revoked security group rules. - RevokedSecurityGroupRules []types.RevokedSecurityGroupRule - - // The inbound rules that were unknown to the service. In some cases, - // unknownIpPermissionSet might be in a different format from the request - // parameter. - UnknownIpPermissions []types.IpPermission - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRevokeSecurityGroupIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRevokeSecurityGroupIngress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRevokeSecurityGroupIngress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RevokeSecurityGroupIngress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeSecurityGroupIngress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRevokeSecurityGroupIngress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RevokeSecurityGroupIngress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunInstances.go deleted file mode 100644 index fb3d480ae..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunInstances.go +++ /dev/null @@ -1,566 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Launches the specified number of instances using an AMI for which you have -// permissions. -// -// You can specify a number of options, or leave the default options. The -// following rules apply: -// -// - If you don't specify a subnet ID, we choose a default subnet from your -// default VPC for you. If you don't have a default VPC, you must specify a subnet -// ID in the request. -// -// - All instances have a network interface with a primary private IPv4 address. -// If you don't specify this address, we choose one from the IPv4 range of your -// subnet. -// -// - Not all instance types support IPv6 addresses. For more information, see [Instance types]. -// -// - If you don't specify a security group ID, we use the default security group -// for the VPC. For more information, see [Security groups]. -// -// - If any of the AMIs have a product code attached for which the user has not -// subscribed, the request fails. -// -// You can create a [launch template], which is a resource that contains the parameters to launch -// an instance. When you launch an instance using RunInstances, you can specify the launch -// template instead of specifying the launch parameters. -// -// To ensure faster instance launches, break up large requests into smaller -// batches. For example, create five separate launch requests for 100 instances -// each instead of one launch request for 500 instances. -// -// RunInstances is subject to both request rate limiting and resource rate -// limiting. For more information, see [Request throttling]. -// -// An instance is ready for you to use when it's in the running state. You can -// check the state of your instance using DescribeInstances. You can tag instances and EBS volumes -// during launch, after launch, or both. For more information, see CreateTagsand [Tagging your Amazon EC2 resources]. -// -// Linux instances have access to the public key of the key pair at boot. You can -// use this key to provide secure access to the instance. Amazon EC2 public images -// use this feature to provide secure access without passwords. For more -// information, see [Key pairs]. -// -// For troubleshooting, see [What to do if an instance immediately terminates], and [Troubleshooting connecting to your instance]. -// -// [Key pairs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html -// [What to do if an instance immediately terminates]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html -// [Tagging your Amazon EC2 resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html -// [launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html -// [Security groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html -// [Request throttling]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-throttling.html -// [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html -// [Troubleshooting connecting to your instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html -func (c *Client) RunInstances(ctx context.Context, params *RunInstancesInput, optFns ...func(*Options)) (*RunInstancesOutput, error) { - if params == nil { - params = &RunInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RunInstances", params, optFns, c.addOperationRunInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RunInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RunInstancesInput struct { - - // The maximum number of instances to launch. If you specify a value that is more - // capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 - // launches the largest possible number of instances above the specified minimum - // count. - // - // Constraints: Between 1 and the quota for the specified instance type for your - // account for this Region. For more information, see [Amazon EC2 instance type quotas]. - // - // [Amazon EC2 instance type quotas]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html - // - // This member is required. - MaxCount *int32 - - // The minimum number of instances to launch. If you specify a value that is more - // capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 - // does not launch any instances. - // - // Constraints: Between 1 and the quota for the specified instance type for your - // account for this Region. For more information, see [Amazon EC2 instance type quotas]. - // - // [Amazon EC2 instance type quotas]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html - // - // This member is required. - MinCount *int32 - - // Reserved. - AdditionalInfo *string - - // The block device mapping, which defines the EBS volumes and instance store - // volumes to attach to the instance at launch. For more information, see [Block device mappings]in the - // Amazon EC2 User Guide. - // - // [Block device mappings]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html - BlockDeviceMappings []types.BlockDeviceMapping - - // Information about the Capacity Reservation targeting option. If you do not - // specify this parameter, the instance's Capacity Reservation preference defaults - // to open , which enables it to run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone, and tenancy). - CapacityReservationSpecification *types.CapacityReservationSpecification - - // Unique, case-sensitive identifier you provide to ensure the idempotency of the - // request. If you do not specify a client token, a randomly generated token is - // used for the request to ensure idempotency. - // - // For more information, see [Ensuring Idempotency]. - // - // Constraints: Maximum 64 ASCII characters - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The CPU options for the instance. For more information, see [Optimize CPU options] in the Amazon EC2 - // User Guide. - // - // [Optimize CPU options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html - CpuOptions *types.CpuOptionsRequest - - // The credit option for CPU usage of the burstable performance instance. Valid - // values are standard and unlimited . To change this attribute after launch, use [ModifyInstanceCreditSpecification] - // . For more information, see [Burstable performance instances]in the Amazon EC2 User Guide. - // - // Default: standard (T2 instances) or unlimited (T3/T3a/T4g instances) - // - // For T3 instances with host tenancy, only standard is supported. - // - // [ModifyInstanceCreditSpecification]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html - // [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html - CreditSpecification *types.CreditSpecificationRequest - - // Indicates whether an instance is enabled for stop protection. For more - // information, see [Stop protection]. - // - // [Stop protection]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection - DisableApiStop *bool - - // Indicates whether termination protection is enabled for the instance. The - // default is false , which means that you can terminate the instance using the - // Amazon EC2 console, command line tools, or API. You can enable termination - // protection when you launch an instance, while the instance is running, or while - // the instance is stopped. - DisableApiTermination *bool - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Indicates whether the instance is optimized for Amazon EBS I/O. This - // optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal Amazon EBS I/O performance. This - // optimization isn't available with all instance types. Additional usage charges - // apply when using an EBS-optimized instance. - // - // Default: false - EbsOptimized *bool - - // An elastic GPU to associate with the instance. - // - // Amazon Elastic Graphics reached end of life on January 8, 2024. - ElasticGpuSpecification []types.ElasticGpuSpecification - - // An elastic inference accelerator to associate with the instance. - // - // Amazon Elastic Inference is no longer available. - ElasticInferenceAccelerators []types.ElasticInferenceAccelerator - - // If you’re launching an instance into a dual-stack or IPv6-only subnet, you can - // enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA - // address associated with an ENI that you have enabled to use a primary IPv6 - // address. Use this option if an instance relies on its IPv6 address not changing. - // When you launch the instance, Amazon Web Services will automatically assign an - // IPv6 address associated with the ENI attached to your instance to be the primary - // IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you - // cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the - // first IPv6 GUA will be made the primary IPv6 address until the instance is - // terminated or the network interface is detached. If you have multiple IPv6 - // addresses associated with an ENI attached to your instance and you enable a - // primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes - // the primary IPv6 address. - EnablePrimaryIpv6 *bool - - // Indicates whether the instance is enabled for Amazon Web Services Nitro - // Enclaves. For more information, see [What is Amazon Web Services Nitro Enclaves?]in the Amazon Web Services Nitro Enclaves - // User Guide. - // - // You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same - // instance. - // - // [What is Amazon Web Services Nitro Enclaves?]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html - EnclaveOptions *types.EnclaveOptionsRequest - - // Indicates whether an instance is enabled for hibernation. This parameter is - // valid only if the instance meets the [hibernation prerequisites]. For more information, see [Hibernate your Amazon EC2 instance] in the Amazon - // EC2 User Guide. - // - // You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same - // instance. - // - // [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html - // [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html - HibernationOptions *types.HibernationOptionsRequest - - // The name or Amazon Resource Name (ARN) of an IAM instance profile. - IamInstanceProfile *types.IamInstanceProfileSpecification - - // The ID of the AMI. An AMI ID is required to launch an instance and must be - // specified here or in a launch template. - ImageId *string - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - // - // Default: stop - InstanceInitiatedShutdownBehavior types.ShutdownBehavior - - // The market (purchasing) option for the instances. - // - // For RunInstances, persistent Spot Instance requests are only supported when - // InstanceInterruptionBehavior is set to either hibernate or stop . - InstanceMarketOptions *types.InstanceMarketOptionsRequest - - // The instance type. For more information, see [Amazon EC2 instance types] in the Amazon EC2 User Guide. - // - // [Amazon EC2 instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType types.InstanceType - - // The number of IPv6 addresses to associate with the primary network interface. - // Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot - // specify this option and the option to assign specific IPv6 addresses in the same - // request. You can specify this option if you've specified a minimum number of - // instances to launch. - // - // You cannot specify this option and the network interfaces option in the same - // request. - Ipv6AddressCount *int32 - - // The IPv6 addresses from the range of the subnet to associate with the primary - // network interface. You cannot specify this option and the option to assign a - // number of IPv6 addresses in the same request. You cannot specify this option if - // you've specified a minimum number of instances to launch. - // - // You cannot specify this option and the network interfaces option in the same - // request. - Ipv6Addresses []types.InstanceIpv6Address - - // The ID of the kernel. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see [PV-GRUB]in the Amazon EC2 User Guide. - // - // [PV-GRUB]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html - KernelId *string - - // The name of the key pair. You can create a key pair using [CreateKeyPair] or [ImportKeyPair]. - // - // If you do not specify a key pair, you can't connect to the instance unless you - // choose an AMI that is configured to allow users another way to log in. - // - // [ImportKeyPair]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html - // [CreateKeyPair]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html - KeyName *string - - // The launch template. Any additional parameters that you specify for the new - // instance overwrite the corresponding parameters included in the launch template. - LaunchTemplate *types.LaunchTemplateSpecification - - // The license configurations. - LicenseSpecifications []types.LicenseConfigurationRequest - - // The maintenance and recovery options for the instance. - MaintenanceOptions *types.InstanceMaintenanceOptionsRequest - - // The metadata options for the instance. For more information, see [Instance metadata and user data]. - // - // [Instance metadata and user data]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html - MetadataOptions *types.InstanceMetadataOptionsRequest - - // Specifies whether detailed monitoring is enabled for the instance. - Monitoring *types.RunInstancesMonitoringEnabled - - // The network interfaces to associate with the instance. - NetworkInterfaces []types.InstanceNetworkInterfaceSpecification - - // Contains settings for the network performance options for the instance. - NetworkPerformanceOptions *types.InstanceNetworkPerformanceOptionsRequest - - // Reserved for internal use. - Operator *types.OperatorRequest - - // The placement for the instance. - Placement *types.Placement - - // The options for the instance hostname. The default values are inherited from - // the subnet. Applies only if creating a network interface, not attaching an - // existing one. - PrivateDnsNameOptions *types.PrivateDnsNameOptionsRequest - - // The primary IPv4 address. You must specify a value from the IPv4 address range - // of the subnet. - // - // Only one private IP address can be designated as primary. You can't specify - // this option if you've specified the option to designate a private IP address as - // the primary IP address in a network interface specification. You cannot specify - // this option if you're launching more than one instance in the request. - // - // You cannot specify this option and the network interfaces option in the same - // request. - PrivateIpAddress *string - - // The ID of the RAM disk to select. Some kernels require additional drivers at - // launch. Check the kernel requirements for information about whether you need to - // specify a RAM disk. To find kernel requirements, go to the Amazon Web Services - // Resource Center and search for the kernel ID. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see [PV-GRUB]in the Amazon EC2 User Guide. - // - // [PV-GRUB]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html - RamdiskId *string - - // The IDs of the security groups. You can create a security group using [CreateSecurityGroup]. - // - // If you specify a network interface, you must specify any security groups as - // part of the network interface instead of using this parameter. - // - // [CreateSecurityGroup]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html - SecurityGroupIds []string - - // [Default VPC] The names of the security groups. - // - // If you specify a network interface, you must specify any security groups as - // part of the network interface instead of using this parameter. - // - // Default: Amazon EC2 uses the default security group. - SecurityGroups []string - - // The ID of the subnet to launch the instance into. - // - // If you specify a network interface, you must specify any subnets as part of the - // network interface instead of using this parameter. - SubnetId *string - - // The tags to apply to the resources that are created during instance launch. - // - // You can specify tags for the following resources only: - // - // - Instances - // - // - Volumes - // - // - Spot Instance requests - // - // - Network interfaces - // - // To tag a resource after it has been created, see [CreateTags]. - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - TagSpecifications []types.TagSpecification - - // The user data to make available to the instance. User data must be - // base64-encoded. Depending on the tool or SDK that you're using, the - // base64-encoding might be performed for you. For more information, see [Work with instance user data]. - // - // [Work with instance user data]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-user-data.html - UserData *string - - noSmithyDocumentSerde -} - -// Describes a launch request for one or more instances, and includes owner, -// requester, and security group information that applies to all instances in the -// launch request. -type RunInstancesOutput struct { - - // Not supported. - Groups []types.GroupIdentifier - - // The instances. - Instances []types.Instance - - // The ID of the Amazon Web Services account that owns the reservation. - OwnerId *string - - // The ID of the requester that launched the instances on your behalf (for - // example, Amazon Web Services Management Console or Auto Scaling). - RequesterId *string - - // The ID of the reservation. - ReservationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRunInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRunInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRunInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RunInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opRunInstancesMiddleware(stack, options); err != nil { - return err - } - if err = addOpRunInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRunInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpRunInstances struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpRunInstances) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpRunInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*RunInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *RunInstancesInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opRunInstancesMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpRunInstances{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opRunInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RunInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunScheduledInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunScheduledInstances.go deleted file mode 100644 index 115a5ea02..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_RunScheduledInstances.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Launches the specified Scheduled Instances. -// -// Before you can launch a Scheduled Instance, you must purchase it and obtain an -// identifier using PurchaseScheduledInstances. -// -// You must launch a Scheduled Instance during its scheduled time period. You -// can't stop or reboot a Scheduled Instance, but you can terminate it as needed. -// If you terminate a Scheduled Instance before the current scheduled time period -// ends, you can launch it again after a few minutes. -func (c *Client) RunScheduledInstances(ctx context.Context, params *RunScheduledInstancesInput, optFns ...func(*Options)) (*RunScheduledInstancesOutput, error) { - if params == nil { - params = &RunScheduledInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RunScheduledInstances", params, optFns, c.addOperationRunScheduledInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RunScheduledInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for RunScheduledInstances. -type RunScheduledInstancesInput struct { - - // The launch specification. You must match the instance type, Availability Zone, - // network, and platform of the schedule that you purchased. - // - // This member is required. - LaunchSpecification *types.ScheduledInstancesLaunchSpecification - - // The Scheduled Instance ID. - // - // This member is required. - ScheduledInstanceId *string - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The number of instances. - // - // Default: 1 - InstanceCount *int32 - - noSmithyDocumentSerde -} - -// Contains the output of RunScheduledInstances. -type RunScheduledInstancesOutput struct { - - // The IDs of the newly launched instances. - InstanceIdSet []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRunScheduledInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpRunScheduledInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpRunScheduledInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RunScheduledInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opRunScheduledInstancesMiddleware(stack, options); err != nil { - return err - } - if err = addOpRunScheduledInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRunScheduledInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpRunScheduledInstances struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpRunScheduledInstances) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpRunScheduledInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*RunScheduledInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *RunScheduledInstancesInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opRunScheduledInstancesMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpRunScheduledInstances{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opRunScheduledInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RunScheduledInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchLocalGatewayRoutes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchLocalGatewayRoutes.go deleted file mode 100644 index ce524019c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchLocalGatewayRoutes.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Searches for routes in the specified local gateway route table. -func (c *Client) SearchLocalGatewayRoutes(ctx context.Context, params *SearchLocalGatewayRoutesInput, optFns ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) { - if params == nil { - params = &SearchLocalGatewayRoutesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "SearchLocalGatewayRoutes", params, optFns, c.addOperationSearchLocalGatewayRoutesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*SearchLocalGatewayRoutesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type SearchLocalGatewayRoutesInput struct { - - // The ID of the local gateway route table. - // - // This member is required. - LocalGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. - // - // - prefix-list-id - The ID of the prefix list. - // - // - route-search.exact-match - The exact match of the specified filter. - // - // - route-search.longest-prefix-match - The longest prefix that matches the - // route. - // - // - route-search.subnet-of-match - The routes with a subnet that match the - // specified CIDR filter. - // - // - route-search.supernet-of-match - The routes with a CIDR that encompass the - // CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your - // route table and you specify supernet-of-match as 10.0.1.0/30, then the result - // returns 10.0.1.0/29. - // - // - state - The state of the route. - // - // - type - The route type. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type SearchLocalGatewayRoutesOutput struct { - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Information about the routes. - Routes []types.LocalGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationSearchLocalGatewayRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpSearchLocalGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpSearchLocalGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "SearchLocalGatewayRoutes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpSearchLocalGatewayRoutesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchLocalGatewayRoutes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SearchLocalGatewayRoutesPaginatorOptions is the paginator options for -// SearchLocalGatewayRoutes -type SearchLocalGatewayRoutesPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// SearchLocalGatewayRoutesPaginator is a paginator for SearchLocalGatewayRoutes -type SearchLocalGatewayRoutesPaginator struct { - options SearchLocalGatewayRoutesPaginatorOptions - client SearchLocalGatewayRoutesAPIClient - params *SearchLocalGatewayRoutesInput - nextToken *string - firstPage bool -} - -// NewSearchLocalGatewayRoutesPaginator returns a new -// SearchLocalGatewayRoutesPaginator -func NewSearchLocalGatewayRoutesPaginator(client SearchLocalGatewayRoutesAPIClient, params *SearchLocalGatewayRoutesInput, optFns ...func(*SearchLocalGatewayRoutesPaginatorOptions)) *SearchLocalGatewayRoutesPaginator { - if params == nil { - params = &SearchLocalGatewayRoutesInput{} - } - - options := SearchLocalGatewayRoutesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &SearchLocalGatewayRoutesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *SearchLocalGatewayRoutesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next SearchLocalGatewayRoutes page. -func (p *SearchLocalGatewayRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.SearchLocalGatewayRoutes(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// SearchLocalGatewayRoutesAPIClient is a client that implements the -// SearchLocalGatewayRoutes operation. -type SearchLocalGatewayRoutesAPIClient interface { - SearchLocalGatewayRoutes(context.Context, *SearchLocalGatewayRoutesInput, ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) -} - -var _ SearchLocalGatewayRoutesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opSearchLocalGatewayRoutes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "SearchLocalGatewayRoutes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go deleted file mode 100644 index bbb9cdef5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Searches one or more transit gateway multicast groups and returns the group -// membership information. -func (c *Client) SearchTransitGatewayMulticastGroups(ctx context.Context, params *SearchTransitGatewayMulticastGroupsInput, optFns ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) { - if params == nil { - params = &SearchTransitGatewayMulticastGroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "SearchTransitGatewayMulticastGroups", params, optFns, c.addOperationSearchTransitGatewayMulticastGroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*SearchTransitGatewayMulticastGroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type SearchTransitGatewayMulticastGroupsInput struct { - - // The ID of the transit gateway multicast domain. - // - // This member is required. - TransitGatewayMulticastDomainId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // One or more filters. The possible values are: - // - // - group-ip-address - The IP address of the transit gateway multicast group. - // - // - is-group-member - The resource is a group member. Valid values are true | - // false . - // - // - is-group-source - The resource is a group source. Valid values are true | - // false . - // - // - member-type - The member type. Valid values are igmp | static . - // - // - resource-id - The ID of the resource. - // - // - resource-type - The type of resource. Valid values are vpc | vpn | - // direct-connect-gateway | tgw-peering . - // - // - source-type - The source type. Valid values are igmp | static . - // - // - subnet-id - The ID of the subnet. - // - // - transit-gateway-attachment-id - The id of the transit gateway attachment. - Filters []types.Filter - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int32 - - // The token for the next page of results. - NextToken *string - - noSmithyDocumentSerde -} - -type SearchTransitGatewayMulticastGroupsOutput struct { - - // Information about the transit gateway multicast group. - MulticastGroups []types.TransitGatewayMulticastGroup - - // The token to use to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationSearchTransitGatewayMulticastGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpSearchTransitGatewayMulticastGroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "SearchTransitGatewayMulticastGroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpSearchTransitGatewayMulticastGroupsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchTransitGatewayMulticastGroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// SearchTransitGatewayMulticastGroupsPaginatorOptions is the paginator options -// for SearchTransitGatewayMulticastGroups -type SearchTransitGatewayMulticastGroupsPaginatorOptions struct { - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// SearchTransitGatewayMulticastGroupsPaginator is a paginator for -// SearchTransitGatewayMulticastGroups -type SearchTransitGatewayMulticastGroupsPaginator struct { - options SearchTransitGatewayMulticastGroupsPaginatorOptions - client SearchTransitGatewayMulticastGroupsAPIClient - params *SearchTransitGatewayMulticastGroupsInput - nextToken *string - firstPage bool -} - -// NewSearchTransitGatewayMulticastGroupsPaginator returns a new -// SearchTransitGatewayMulticastGroupsPaginator -func NewSearchTransitGatewayMulticastGroupsPaginator(client SearchTransitGatewayMulticastGroupsAPIClient, params *SearchTransitGatewayMulticastGroupsInput, optFns ...func(*SearchTransitGatewayMulticastGroupsPaginatorOptions)) *SearchTransitGatewayMulticastGroupsPaginator { - if params == nil { - params = &SearchTransitGatewayMulticastGroupsInput{} - } - - options := SearchTransitGatewayMulticastGroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &SearchTransitGatewayMulticastGroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *SearchTransitGatewayMulticastGroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next SearchTransitGatewayMulticastGroups page. -func (p *SearchTransitGatewayMulticastGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.SearchTransitGatewayMulticastGroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// SearchTransitGatewayMulticastGroupsAPIClient is a client that implements the -// SearchTransitGatewayMulticastGroups operation. -type SearchTransitGatewayMulticastGroupsAPIClient interface { - SearchTransitGatewayMulticastGroups(context.Context, *SearchTransitGatewayMulticastGroupsInput, ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) -} - -var _ SearchTransitGatewayMulticastGroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opSearchTransitGatewayMulticastGroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "SearchTransitGatewayMulticastGroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayRoutes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayRoutes.go deleted file mode 100644 index d74b9d0eb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SearchTransitGatewayRoutes.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Searches for routes in the specified transit gateway route table. -func (c *Client) SearchTransitGatewayRoutes(ctx context.Context, params *SearchTransitGatewayRoutesInput, optFns ...func(*Options)) (*SearchTransitGatewayRoutesOutput, error) { - if params == nil { - params = &SearchTransitGatewayRoutesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "SearchTransitGatewayRoutes", params, optFns, c.addOperationSearchTransitGatewayRoutesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*SearchTransitGatewayRoutesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type SearchTransitGatewayRoutesInput struct { - - // One or more filters. The possible values are: - // - // - attachment.transit-gateway-attachment-id - The id of the transit gateway - // attachment. - // - // - attachment.resource-id - The resource id of the transit gateway attachment. - // - // - attachment.resource-type - The attachment resource type. Valid values are - // vpc | vpn | direct-connect-gateway | peering | connect . - // - // - prefix-list-id - The ID of the prefix list. - // - // - route-search.exact-match - The exact match of the specified filter. - // - // - route-search.longest-prefix-match - The longest prefix that matches the - // route. - // - // - route-search.subnet-of-match - The routes with a subnet that match the - // specified CIDR filter. - // - // - route-search.supernet-of-match - The routes with a CIDR that encompass the - // CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your - // route table and you specify supernet-of-match as 10.0.1.0/30, then the result - // returns 10.0.1.0/29. - // - // - state - The state of the route ( active | blackhole ). - // - // - type - The type of route ( propagated | static ). - // - // This member is required. - Filters []types.Filter - - // The ID of the transit gateway route table. - // - // This member is required. - TransitGatewayRouteTableId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum number of routes to return. If a value is not provided, the default - // is 1000. - MaxResults *int32 - - noSmithyDocumentSerde -} - -type SearchTransitGatewayRoutesOutput struct { - - // Indicates whether there are additional routes available. - AdditionalRoutesAvailable *bool - - // Information about the routes. - Routes []types.TransitGatewayRoute - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationSearchTransitGatewayRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpSearchTransitGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpSearchTransitGatewayRoutes{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "SearchTransitGatewayRoutes"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpSearchTransitGatewayRoutesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchTransitGatewayRoutes(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opSearchTransitGatewayRoutes(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "SearchTransitGatewayRoutes", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SendDiagnosticInterrupt.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SendDiagnosticInterrupt.go deleted file mode 100644 index 564dea3bd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_SendDiagnosticInterrupt.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Sends a diagnostic interrupt to the specified Amazon EC2 instance to trigger a -// kernel panic (on Linux instances), or a blue screen/stop error (on Windows -// instances). For instances based on Intel and AMD processors, the interrupt is -// received as a non-maskable interrupt (NMI). -// -// In general, the operating system crashes and reboots when a kernel panic or -// stop error is triggered. The operating system can also be configured to perform -// diagnostic tasks, such as generating a memory dump file, loading a secondary -// kernel, or obtaining a call trace. -// -// Before sending a diagnostic interrupt to your instance, ensure that its -// operating system is configured to perform the required diagnostic tasks. -// -// For more information about configuring your operating system to generate a -// crash dump when a kernel panic or stop error occurs, see [Send a diagnostic interrupt (for advanced users)]in the Amazon EC2 User -// Guide. -// -// [Send a diagnostic interrupt (for advanced users)]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html -func (c *Client) SendDiagnosticInterrupt(ctx context.Context, params *SendDiagnosticInterruptInput, optFns ...func(*Options)) (*SendDiagnosticInterruptOutput, error) { - if params == nil { - params = &SendDiagnosticInterruptInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "SendDiagnosticInterrupt", params, optFns, c.addOperationSendDiagnosticInterruptMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*SendDiagnosticInterruptOutput) - out.ResultMetadata = metadata - return out, nil -} - -type SendDiagnosticInterruptInput struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type SendDiagnosticInterruptOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationSendDiagnosticInterruptMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpSendDiagnosticInterrupt{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpSendDiagnosticInterrupt{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "SendDiagnosticInterrupt"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpSendDiagnosticInterruptValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendDiagnosticInterrupt(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opSendDiagnosticInterrupt(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "SendDiagnosticInterrupt", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartDeclarativePoliciesReport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartDeclarativePoliciesReport.go deleted file mode 100644 index 8a9a9618d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartDeclarativePoliciesReport.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Generates an account status report. The report is generated asynchronously, and -// can take several hours to complete. -// -// The report provides the current status of all attributes supported by -// declarative policies for the accounts within the specified scope. The scope is -// determined by the specified TargetId , which can represent an individual -// account, or all the accounts that fall under the specified organizational unit -// (OU) or root (the entire Amazon Web Services Organization). -// -// The report is saved to your specified S3 bucket, using the following path -// structure (with the italicized placeholders representing your specific values): -// -// s3://amzn-s3-demo-bucket/your-optional-s3-prefix/ec2_targetId_reportId_yyyyMMddThhmmZ.csv -// -// Prerequisites for generating a report -// -// - The StartDeclarativePoliciesReport API can only be called by the management -// account or delegated administrators for the organization. -// -// - An S3 bucket must be available before generating the report (you can create -// a new one or use an existing one), it must be in the same Region where the -// report generation request is made, and it must have an appropriate bucket -// policy. For a sample S3 policy, see Sample Amazon S3 policy under [Examples]. -// -// - Trusted access must be enabled for the service for which the declarative -// policy will enforce a baseline configuration. If you use the Amazon Web Services -// Organizations console, this is done automatically when you enable declarative -// policies. The API uses the following service principal to identify the EC2 -// service: ec2.amazonaws.com . For more information on how to enable trusted -// access with the Amazon Web Services CLI and Amazon Web Services SDKs, see [Using Organizations with other Amazon Web Services services]in -// the Amazon Web Services Organizations User Guide. -// -// - Only one report per organization can be generated at a time. Attempting to -// generate a report while another is in progress will result in an error. -// -// For more information, including the required IAM permissions to run this API, -// see [Generating the account status report for declarative policies]in the Amazon Web Services Organizations User Guide. -// -// [Generating the account status report for declarative policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative_status-report.html -// [Using Organizations with other Amazon Web Services services]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html -// [Examples]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StartDeclarativePoliciesReport.html#API_StartDeclarativePoliciesReport_Examples -func (c *Client) StartDeclarativePoliciesReport(ctx context.Context, params *StartDeclarativePoliciesReportInput, optFns ...func(*Options)) (*StartDeclarativePoliciesReportOutput, error) { - if params == nil { - params = &StartDeclarativePoliciesReportInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartDeclarativePoliciesReport", params, optFns, c.addOperationStartDeclarativePoliciesReportMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartDeclarativePoliciesReportOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartDeclarativePoliciesReportInput struct { - - // The name of the S3 bucket where the report will be saved. The bucket must be in - // the same Region where the report generation request is made. - // - // This member is required. - S3Bucket *string - - // The root ID, organizational unit ID, or account ID. - // - // Format: - // - // - For root: r-ab12 - // - // - For OU: ou-ab12-cdef1234 - // - // - For account: 123456789012 - // - // This member is required. - TargetId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The prefix for your S3 object. - S3Prefix *string - - // The tags to apply. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type StartDeclarativePoliciesReportOutput struct { - - // The ID of the report. - ReportId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartDeclarativePoliciesReportMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStartDeclarativePoliciesReport{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStartDeclarativePoliciesReport{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartDeclarativePoliciesReport"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartDeclarativePoliciesReportValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeclarativePoliciesReport(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartDeclarativePoliciesReport(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartDeclarativePoliciesReport", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartInstances.go deleted file mode 100644 index c1b55560c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartInstances.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Starts an Amazon EBS-backed instance that you've previously stopped. -// -// Instances that use Amazon EBS volumes as their root devices can be quickly -// stopped and started. When an instance is stopped, the compute resources are -// released and you are not billed for instance usage. However, your root partition -// Amazon EBS volume remains and continues to persist your data, and you are -// charged for Amazon EBS volume usage. You can restart your instance at any time. -// Every time you start your instance, Amazon EC2 charges a one-minute minimum for -// instance usage, and thereafter charges per second for instance usage. -// -// Before stopping an instance, make sure it is in a state from which it can be -// restarted. Stopping an instance does not preserve data stored in RAM. -// -// Performing this operation on an instance that uses an instance store as its -// root device returns an error. -// -// If you attempt to start a T3 instance with host tenancy and the unlimited CPU -// credit option, the request fails. The unlimited CPU credit option is not -// supported on Dedicated Hosts. Before you start the instance, either change its -// CPU credit option to standard , or change its tenancy to default or dedicated . -// -// For more information, see [Stop and start Amazon EC2 instances] in the Amazon EC2 User Guide. -// -// [Stop and start Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html -func (c *Client) StartInstances(ctx context.Context, params *StartInstancesInput, optFns ...func(*Options)) (*StartInstancesOutput, error) { - if params == nil { - params = &StartInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartInstances", params, optFns, c.addOperationStartInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartInstancesInput struct { - - // The IDs of the instances. - // - // This member is required. - InstanceIds []string - - // Reserved. - AdditionalInfo *string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type StartInstancesOutput struct { - - // Information about the started instances. - StartingInstances []types.InstanceStateChange - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStartInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStartInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAccessScopeAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAccessScopeAnalysis.go deleted file mode 100644 index dab841f97..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAccessScopeAnalysis.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Starts analyzing the specified Network Access Scope. -func (c *Client) StartNetworkInsightsAccessScopeAnalysis(ctx context.Context, params *StartNetworkInsightsAccessScopeAnalysisInput, optFns ...func(*Options)) (*StartNetworkInsightsAccessScopeAnalysisOutput, error) { - if params == nil { - params = &StartNetworkInsightsAccessScopeAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartNetworkInsightsAccessScopeAnalysis", params, optFns, c.addOperationStartNetworkInsightsAccessScopeAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartNetworkInsightsAccessScopeAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartNetworkInsightsAccessScopeAnalysisInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - // - // This member is required. - ClientToken *string - - // The ID of the Network Access Scope. - // - // This member is required. - NetworkInsightsAccessScopeId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The tags to apply. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type StartNetworkInsightsAccessScopeAnalysisOutput struct { - - // The Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysis *types.NetworkInsightsAccessScopeAnalysis - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartNetworkInsightsAccessScopeAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStartNetworkInsightsAccessScopeAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartNetworkInsightsAccessScopeAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opStartNetworkInsightsAccessScopeAnalysisMiddleware(stack, options); err != nil { - return err - } - if err = addOpStartNetworkInsightsAccessScopeAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartNetworkInsightsAccessScopeAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpStartNetworkInsightsAccessScopeAnalysis struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpStartNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpStartNetworkInsightsAccessScopeAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*StartNetworkInsightsAccessScopeAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *StartNetworkInsightsAccessScopeAnalysisInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opStartNetworkInsightsAccessScopeAnalysisMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpStartNetworkInsightsAccessScopeAnalysis{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opStartNetworkInsightsAccessScopeAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartNetworkInsightsAccessScopeAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAnalysis.go deleted file mode 100644 index 53918d51f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartNetworkInsightsAnalysis.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Starts analyzing the specified path. If the path is reachable, the operation -// returns the shortest feasible path. -func (c *Client) StartNetworkInsightsAnalysis(ctx context.Context, params *StartNetworkInsightsAnalysisInput, optFns ...func(*Options)) (*StartNetworkInsightsAnalysisOutput, error) { - if params == nil { - params = &StartNetworkInsightsAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartNetworkInsightsAnalysis", params, optFns, c.addOperationStartNetworkInsightsAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartNetworkInsightsAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartNetworkInsightsAnalysisInput struct { - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [How to ensure idempotency]. - // - // [How to ensure idempotency]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html - // - // This member is required. - ClientToken *string - - // The ID of the path. - // - // This member is required. - NetworkInsightsPathId *string - - // The member accounts that contain resources that the path can traverse. - AdditionalAccounts []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The Amazon Resource Names (ARN) of the resources that the path must traverse. - FilterInArns []string - - // The Amazon Resource Names (ARN) of the resources that the path will ignore. - FilterOutArns []string - - // The tags to apply. - TagSpecifications []types.TagSpecification - - noSmithyDocumentSerde -} - -type StartNetworkInsightsAnalysisOutput struct { - - // Information about the network insights analysis. - NetworkInsightsAnalysis *types.NetworkInsightsAnalysis - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartNetworkInsightsAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStartNetworkInsightsAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStartNetworkInsightsAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartNetworkInsightsAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opStartNetworkInsightsAnalysisMiddleware(stack, options); err != nil { - return err - } - if err = addOpStartNetworkInsightsAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartNetworkInsightsAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpStartNetworkInsightsAnalysis struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpStartNetworkInsightsAnalysis) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpStartNetworkInsightsAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*StartNetworkInsightsAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *StartNetworkInsightsAnalysisInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opStartNetworkInsightsAnalysisMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpStartNetworkInsightsAnalysis{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opStartNetworkInsightsAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartNetworkInsightsAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartVpcEndpointServicePrivateDnsVerification.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartVpcEndpointServicePrivateDnsVerification.go deleted file mode 100644 index 8ee0dff8b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StartVpcEndpointServicePrivateDnsVerification.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Initiates the verification process to prove that the service provider owns the -// private DNS name domain for the endpoint service. -// -// The service provider must successfully perform the verification before the -// consumer can use the name to access the service. -// -// Before the service provider runs this command, they must add a record to the -// DNS server. -func (c *Client) StartVpcEndpointServicePrivateDnsVerification(ctx context.Context, params *StartVpcEndpointServicePrivateDnsVerificationInput, optFns ...func(*Options)) (*StartVpcEndpointServicePrivateDnsVerificationOutput, error) { - if params == nil { - params = &StartVpcEndpointServicePrivateDnsVerificationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartVpcEndpointServicePrivateDnsVerification", params, optFns, c.addOperationStartVpcEndpointServicePrivateDnsVerificationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartVpcEndpointServicePrivateDnsVerificationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartVpcEndpointServicePrivateDnsVerificationInput struct { - - // The ID of the endpoint service. - // - // This member is required. - ServiceId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type StartVpcEndpointServicePrivateDnsVerificationOutput struct { - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartVpcEndpointServicePrivateDnsVerificationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStartVpcEndpointServicePrivateDnsVerification{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartVpcEndpointServicePrivateDnsVerification"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartVpcEndpointServicePrivateDnsVerificationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartVpcEndpointServicePrivateDnsVerification(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartVpcEndpointServicePrivateDnsVerification(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartVpcEndpointServicePrivateDnsVerification", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StopInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StopInstances.go deleted file mode 100644 index 1aac0e22c..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_StopInstances.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Stops an Amazon EBS-backed instance. You can restart your instance at any time -// using the [StartInstances]API. For more information, see [Stop and start Amazon EC2 instances] in the Amazon EC2 User Guide. -// -// When you stop an instance, we shut it down. -// -// You can use the Stop operation together with the Hibernate parameter to -// hibernate an instance if the instance is [enabled for hibernation]and meets the [hibernation prerequisites]. Stopping an instance -// doesn't preserve data stored in RAM, while hibernation does. If hibernation -// fails, a normal shutdown occurs. For more information, see [Hibernate your Amazon EC2 instance]in the Amazon EC2 -// User Guide. -// -// If your instance appears stuck in the stopping state, there might be an issue -// with the underlying host computer. You can use the Stop operation together with -// the Force parameter to force stop your instance. For more information, see [Troubleshoot Amazon EC2 instance stop issues]in -// the Amazon EC2 User Guide. -// -// Stopping and hibernating an instance differs from rebooting or terminating it. -// For example, a stopped or hibernated instance retains its root volume and any -// data volumes, unlike terminated instances where these volumes are automatically -// deleted. For more information about the differences between stopping, -// hibernating, rebooting, and terminating instances, see [Amazon EC2 instance state changes]in the Amazon EC2 User -// Guide. -// -// We don't charge for instance usage or data transfer fees when an instance is -// stopped. However, the root volume and any data volumes remain and continue to -// persist your data, and you're charged for volume usage. Every time you start -// your instance, Amazon EC2 charges a one-minute minimum for instance usage, -// followed by per-second billing. -// -// You can't stop or hibernate instance store-backed instances. -// -// [Troubleshoot Amazon EC2 instance stop issues]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html -// [Stop and start Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html -// [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html -// [Amazon EC2 instance state changes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html -// [enabled for hibernation]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enabling-hibernation.html -// [StartInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StartInstances.html -// [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html -func (c *Client) StopInstances(ctx context.Context, params *StopInstancesInput, optFns ...func(*Options)) (*StopInstancesOutput, error) { - if params == nil { - params = &StopInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StopInstances", params, optFns, c.addOperationStopInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StopInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StopInstancesInput struct { - - // The IDs of the instances. - // - // This member is required. - InstanceIds []string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // Forces the instance to stop. The instance will first attempt a graceful - // shutdown, which includes flushing file system caches and metadata. If the - // graceful shutdown fails to complete within the timeout period, the instance - // shuts down forcibly without flushing the file system caches and metadata. - // - // After using this option, you must perform file system check and repair - // procedures. This option is not recommended for Windows instances. For more - // information, see [Troubleshoot Amazon EC2 instance stop issues]in the Amazon EC2 User Guide. - // - // Default: false - // - // [Troubleshoot Amazon EC2 instance stop issues]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html - Force *bool - - // Hibernates the instance if the instance was enabled for hibernation at launch. - // If the instance cannot hibernate successfully, a normal shutdown occurs. For - // more information, see [Hibernate your instance]in the Amazon EC2 User Guide. - // - // Default: false - // - // [Hibernate your instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html - Hibernate *bool - - noSmithyDocumentSerde -} - -type StopInstancesOutput struct { - - // Information about the stopped instances. - StoppingInstances []types.InstanceStateChange - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStopInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpStopInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpStopInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StopInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStopInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStopInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StopInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateClientVpnConnections.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateClientVpnConnections.go deleted file mode 100644 index 02c9fc6c7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateClientVpnConnections.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Terminates active Client VPN endpoint connections. This action can be used to -// terminate a specific client connection, or up to five connections established by -// a specific user. -func (c *Client) TerminateClientVpnConnections(ctx context.Context, params *TerminateClientVpnConnectionsInput, optFns ...func(*Options)) (*TerminateClientVpnConnectionsOutput, error) { - if params == nil { - params = &TerminateClientVpnConnectionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TerminateClientVpnConnections", params, optFns, c.addOperationTerminateClientVpnConnectionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TerminateClientVpnConnectionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TerminateClientVpnConnectionsInput struct { - - // The ID of the Client VPN endpoint to which the client is connected. - // - // This member is required. - ClientVpnEndpointId *string - - // The ID of the client connection to be terminated. - ConnectionId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The name of the user who initiated the connection. Use this option to terminate - // all active connections for the specified user. This option can only be used if - // the user has established up to five connections. - Username *string - - noSmithyDocumentSerde -} - -type TerminateClientVpnConnectionsOutput struct { - - // The ID of the Client VPN endpoint. - ClientVpnEndpointId *string - - // The current state of the client connections. - ConnectionStatuses []types.TerminateConnectionStatus - - // The user who established the terminated client connections. - Username *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTerminateClientVpnConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpTerminateClientVpnConnections{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpTerminateClientVpnConnections{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TerminateClientVpnConnections"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTerminateClientVpnConnectionsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateClientVpnConnections(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTerminateClientVpnConnections(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TerminateClientVpnConnections", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateInstances.go deleted file mode 100644 index d95d6be95..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_TerminateInstances.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Shuts down the specified instances. This operation is [idempotent]; if you terminate an -// instance more than once, each call succeeds. -// -// If you specify multiple instances and the request fails (for example, because -// of a single incorrect instance ID), none of the instances are terminated. -// -// If you terminate multiple instances across multiple Availability Zones, and one -// or more of the specified instances are enabled for termination protection, the -// request fails with the following results: -// -// - The specified instances that are in the same Availability Zone as the -// protected instance are not terminated. -// -// - The specified instances that are in different Availability Zones, where no -// other specified instances are protected, are successfully terminated. -// -// For example, say you have the following instances: -// -// - Instance A: us-east-1a ; Not protected -// -// - Instance B: us-east-1a ; Not protected -// -// - Instance C: us-east-1b ; Protected -// -// - Instance D: us-east-1b ; not protected -// -// If you attempt to terminate all of these instances in the same request, the -// request reports failure with the following results: -// -// - Instance A and Instance B are successfully terminated because none of the -// specified instances in us-east-1a are enabled for termination protection. -// -// - Instance C and Instance D fail to terminate because at least one of the -// specified instances in us-east-1b (Instance C) is enabled for termination -// protection. -// -// Terminated instances remain visible after termination (for approximately one -// hour). -// -// By default, Amazon EC2 deletes all EBS volumes that were attached when the -// instance launched. Volumes attached after instance launch continue running. -// -// You can stop, start, and terminate EBS-backed instances. You can only terminate -// instance store-backed instances. What happens to an instance differs if you stop -// or terminate it. For example, when you stop an instance, the root device and any -// other devices attached to the instance persist. When you terminate an instance, -// any attached EBS volumes with the DeleteOnTermination block device mapping -// parameter set to true are automatically deleted. For more information about the -// differences between stopping and terminating instances, see [Instance lifecycle]in the Amazon EC2 -// User Guide. -// -// For more information about troubleshooting, see [Troubleshooting terminating your instance] in the Amazon EC2 User Guide. -// -// [idempotent]: https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html -// [Instance lifecycle]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html -// [Troubleshooting terminating your instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html -func (c *Client) TerminateInstances(ctx context.Context, params *TerminateInstancesInput, optFns ...func(*Options)) (*TerminateInstancesOutput, error) { - if params == nil { - params = &TerminateInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TerminateInstances", params, optFns, c.addOperationTerminateInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TerminateInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TerminateInstancesInput struct { - - // The IDs of the instances. - // - // Constraints: Up to 1000 instance IDs. We recommend breaking up this request - // into smaller batches. - // - // This member is required. - InstanceIds []string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type TerminateInstancesOutput struct { - - // Information about the terminated instances. - TerminatingInstances []types.InstanceStateChange - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTerminateInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpTerminateInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpTerminateInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TerminateInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTerminateInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTerminateInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TerminateInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignIpv6Addresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignIpv6Addresses.go deleted file mode 100644 index 9391b4ea7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignIpv6Addresses.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Unassigns the specified IPv6 addresses or Prefix Delegation prefixes from a -// network interface. -func (c *Client) UnassignIpv6Addresses(ctx context.Context, params *UnassignIpv6AddressesInput, optFns ...func(*Options)) (*UnassignIpv6AddressesOutput, error) { - if params == nil { - params = &UnassignIpv6AddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnassignIpv6Addresses", params, optFns, c.addOperationUnassignIpv6AddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnassignIpv6AddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UnassignIpv6AddressesInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The IPv6 addresses to unassign from the network interface. - Ipv6Addresses []string - - // The IPv6 prefixes to unassign from the network interface. - Ipv6Prefixes []string - - noSmithyDocumentSerde -} - -type UnassignIpv6AddressesOutput struct { - - // The ID of the network interface. - NetworkInterfaceId *string - - // The IPv6 addresses that have been unassigned from the network interface. - UnassignedIpv6Addresses []string - - // The IPv6 prefixes that have been unassigned from the network interface. - UnassignedIpv6Prefixes []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnassignIpv6AddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUnassignIpv6Addresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUnassignIpv6Addresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnassignIpv6Addresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUnassignIpv6AddressesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnassignIpv6Addresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnassignIpv6Addresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnassignIpv6Addresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateIpAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateIpAddresses.go deleted file mode 100644 index 5e0947232..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateIpAddresses.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Unassigns the specified secondary private IP addresses or IPv4 Prefix -// Delegation prefixes from a network interface. -func (c *Client) UnassignPrivateIpAddresses(ctx context.Context, params *UnassignPrivateIpAddressesInput, optFns ...func(*Options)) (*UnassignPrivateIpAddressesOutput, error) { - if params == nil { - params = &UnassignPrivateIpAddressesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnassignPrivateIpAddresses", params, optFns, c.addOperationUnassignPrivateIpAddressesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnassignPrivateIpAddressesOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Contains the parameters for UnassignPrivateIpAddresses. -type UnassignPrivateIpAddressesInput struct { - - // The ID of the network interface. - // - // This member is required. - NetworkInterfaceId *string - - // The IPv4 prefixes to unassign from the network interface. - Ipv4Prefixes []string - - // The secondary private IP addresses to unassign from the network interface. You - // can specify this option multiple times to unassign more than one IP address. - PrivateIpAddresses []string - - noSmithyDocumentSerde -} - -type UnassignPrivateIpAddressesOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnassignPrivateIpAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUnassignPrivateIpAddresses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUnassignPrivateIpAddresses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnassignPrivateIpAddresses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUnassignPrivateIpAddressesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnassignPrivateIpAddresses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnassignPrivateIpAddresses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnassignPrivateIpAddresses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateNatGatewayAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateNatGatewayAddress.go deleted file mode 100644 index bda920aef..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnassignPrivateNatGatewayAddress.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Unassigns secondary private IPv4 addresses from a private NAT gateway. You -// cannot unassign your primary private IP. For more information, see [Edit secondary IP address associations]in the -// Amazon VPC User Guide. -// -// While unassigning is in progress, you cannot assign/unassign additional IP -// addresses while the connections are being drained. You are, however, allowed to -// delete the NAT gateway. -// -// A private IP address will only be released at the end of -// MaxDrainDurationSeconds. The private IP addresses stay associated and support -// the existing connections, but do not support any new connections (new -// connections are distributed across the remaining assigned private IP address). -// After the existing connections drain out, the private IP addresses are released. -// -// [Edit secondary IP address associations]: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html#nat-gateway-edit-secondary -func (c *Client) UnassignPrivateNatGatewayAddress(ctx context.Context, params *UnassignPrivateNatGatewayAddressInput, optFns ...func(*Options)) (*UnassignPrivateNatGatewayAddressOutput, error) { - if params == nil { - params = &UnassignPrivateNatGatewayAddressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnassignPrivateNatGatewayAddress", params, optFns, c.addOperationUnassignPrivateNatGatewayAddressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnassignPrivateNatGatewayAddressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UnassignPrivateNatGatewayAddressInput struct { - - // The ID of the NAT gateway. - // - // This member is required. - NatGatewayId *string - - // The private IPv4 addresses you want to unassign. - // - // This member is required. - PrivateIpAddresses []string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The maximum amount of time to wait (in seconds) before forcibly releasing the - // IP addresses if connections are still in progress. Default value is 350 seconds. - MaxDrainDurationSeconds *int32 - - noSmithyDocumentSerde -} - -type UnassignPrivateNatGatewayAddressOutput struct { - - // Information about the NAT gateway IP addresses. - NatGatewayAddresses []types.NatGatewayAddress - - // The ID of the NAT gateway. - NatGatewayId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnassignPrivateNatGatewayAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUnassignPrivateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnassignPrivateNatGatewayAddress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUnassignPrivateNatGatewayAddressValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnassignPrivateNatGatewayAddress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnassignPrivateNatGatewayAddress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnassignPrivateNatGatewayAddress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnlockSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnlockSnapshot.go deleted file mode 100644 index f012a89ca..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnlockSnapshot.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Unlocks a snapshot that is locked in governance mode or that is locked in -// compliance mode but still in the cooling-off period. You can't unlock a snapshot -// that is locked in compliance mode after the cooling-off period has expired. -func (c *Client) UnlockSnapshot(ctx context.Context, params *UnlockSnapshotInput, optFns ...func(*Options)) (*UnlockSnapshotOutput, error) { - if params == nil { - params = &UnlockSnapshotInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnlockSnapshot", params, optFns, c.addOperationUnlockSnapshotMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnlockSnapshotOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UnlockSnapshotInput struct { - - // The ID of the snapshot to unlock. - // - // This member is required. - SnapshotId *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type UnlockSnapshotOutput struct { - - // The ID of the snapshot. - SnapshotId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnlockSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUnlockSnapshot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUnlockSnapshot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnlockSnapshot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUnlockSnapshotValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnlockSnapshot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnlockSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnlockSnapshot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnmonitorInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnmonitorInstances.go deleted file mode 100644 index 35e27ca55..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UnmonitorInstances.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables detailed monitoring for a running instance. For more information, see [Monitoring your instances and volumes] -// in the Amazon EC2 User Guide. -// -// [Monitoring your instances and volumes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html -func (c *Client) UnmonitorInstances(ctx context.Context, params *UnmonitorInstancesInput, optFns ...func(*Options)) (*UnmonitorInstancesOutput, error) { - if params == nil { - params = &UnmonitorInstancesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnmonitorInstances", params, optFns, c.addOperationUnmonitorInstancesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnmonitorInstancesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UnmonitorInstancesInput struct { - - // The IDs of the instances. - // - // This member is required. - InstanceIds []string - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type UnmonitorInstancesOutput struct { - - // The monitoring information. - InstanceMonitorings []types.InstanceMonitoring - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnmonitorInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUnmonitorInstances{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUnmonitorInstances{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnmonitorInstances"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUnmonitorInstancesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnmonitorInstances(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnmonitorInstances(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnmonitorInstances", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsEgress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsEgress.go deleted file mode 100644 index 690480f66..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsEgress.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates the description of an egress (outbound) security group rule. You can -// replace an existing description, or add a description to a rule that did not -// have one previously. You can remove a description for a security group rule by -// omitting the description parameter in the request. -func (c *Client) UpdateSecurityGroupRuleDescriptionsEgress(ctx context.Context, params *UpdateSecurityGroupRuleDescriptionsEgressInput, optFns ...func(*Options)) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { - if params == nil { - params = &UpdateSecurityGroupRuleDescriptionsEgressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateSecurityGroupRuleDescriptionsEgress", params, optFns, c.addOperationUpdateSecurityGroupRuleDescriptionsEgressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateSecurityGroupRuleDescriptionsEgressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateSecurityGroupRuleDescriptionsEgressInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the security group. You must specify either the security group ID or - // the security group name in the request. For security groups in a nondefault VPC, - // you must specify the security group ID. - GroupId *string - - // [Default VPC] The name of the security group. You must specify either the - // security group ID or the security group name. - GroupName *string - - // The IP permissions for the security group rule. You must specify either the IP - // permissions or the description. - IpPermissions []types.IpPermission - - // The description for the egress security group rules. You must specify either - // the description or the IP permissions. - SecurityGroupRuleDescriptions []types.SecurityGroupRuleDescription - - noSmithyDocumentSerde -} - -type UpdateSecurityGroupRuleDescriptionsEgressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateSecurityGroupRuleDescriptionsEgressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsEgress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecurityGroupRuleDescriptionsEgress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurityGroupRuleDescriptionsEgress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateSecurityGroupRuleDescriptionsEgress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateSecurityGroupRuleDescriptionsEgress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsIngress.go deleted file mode 100644 index f2ee39e81..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_UpdateSecurityGroupRuleDescriptionsIngress.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates the description of an ingress (inbound) security group rule. You can -// replace an existing description, or add a description to a rule that did not -// have one previously. You can remove a description for a security group rule by -// omitting the description parameter in the request. -func (c *Client) UpdateSecurityGroupRuleDescriptionsIngress(ctx context.Context, params *UpdateSecurityGroupRuleDescriptionsIngressInput, optFns ...func(*Options)) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { - if params == nil { - params = &UpdateSecurityGroupRuleDescriptionsIngressInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateSecurityGroupRuleDescriptionsIngress", params, optFns, c.addOperationUpdateSecurityGroupRuleDescriptionsIngressMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateSecurityGroupRuleDescriptionsIngressOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateSecurityGroupRuleDescriptionsIngressInput struct { - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - // The ID of the security group. You must specify either the security group ID or - // the security group name in the request. For security groups in a nondefault VPC, - // you must specify the security group ID. - GroupId *string - - // [Default VPC] The name of the security group. You must specify either the - // security group ID or the security group name. For security groups in a - // nondefault VPC, you must specify the security group ID. - GroupName *string - - // The IP permissions for the security group rule. You must specify either IP - // permissions or a description. - IpPermissions []types.IpPermission - - // The description for the ingress security group rules. You must specify either a - // description or IP permissions. - SecurityGroupRuleDescriptions []types.SecurityGroupRuleDescription - - noSmithyDocumentSerde -} - -type UpdateSecurityGroupRuleDescriptionsIngressOutput struct { - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateSecurityGroupRuleDescriptionsIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsIngress{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecurityGroupRuleDescriptionsIngress"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurityGroupRuleDescriptionsIngress(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateSecurityGroupRuleDescriptionsIngress(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateSecurityGroupRuleDescriptionsIngress", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_WithdrawByoipCidr.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_WithdrawByoipCidr.go deleted file mode 100644 index abb6d6536..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_WithdrawByoipCidr.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Stops advertising an address range that is provisioned as an address pool. -// -// You can perform this operation at most once every 10 seconds, even if you -// specify different address ranges each time. -// -// It can take a few minutes before traffic to the specified addresses stops -// routing to Amazon Web Services because of BGP propagation delays. -func (c *Client) WithdrawByoipCidr(ctx context.Context, params *WithdrawByoipCidrInput, optFns ...func(*Options)) (*WithdrawByoipCidrOutput, error) { - if params == nil { - params = &WithdrawByoipCidrInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "WithdrawByoipCidr", params, optFns, c.addOperationWithdrawByoipCidrMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*WithdrawByoipCidrOutput) - out.ResultMetadata = metadata - return out, nil -} - -type WithdrawByoipCidrInput struct { - - // The address range, in CIDR notation. - // - // This member is required. - Cidr *string - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have the - // required permissions, the error response is DryRunOperation . Otherwise, it is - // UnauthorizedOperation . - DryRun *bool - - noSmithyDocumentSerde -} - -type WithdrawByoipCidrOutput struct { - - // Information about the address pool. - ByoipCidr *types.ByoipCidr - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationWithdrawByoipCidrMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsEc2query_serializeOpWithdrawByoipCidr{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsEc2query_deserializeOpWithdrawByoipCidr{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "WithdrawByoipCidr"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpWithdrawByoipCidrValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opWithdrawByoipCidr(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opWithdrawByoipCidr(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "WithdrawByoipCidr", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/auth.go deleted file mode 100644 index 1fe418e02..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/auth.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "ec2") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/deserializers.go deleted file mode 100644 index 0057ce0ea..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/deserializers.go +++ /dev/null @@ -1,194326 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "bytes" - "context" - "encoding/base64" - "encoding/xml" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - smithyxml "github.com/aws/smithy-go/encoding/xml" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "io/ioutil" - "strconv" - "strings" - "time" -) - -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - -type awsEc2query_deserializeOpAcceptAddressTransfer struct { -} - -func (*awsEc2query_deserializeOpAcceptAddressTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptAddressTransfer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptAddressTransfer(response, &metadata) - } - output := &AcceptAddressTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptAddressTransferOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptAddressTransfer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptCapacityReservationBillingOwnership struct { -} - -func (*awsEc2query_deserializeOpAcceptCapacityReservationBillingOwnership) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptCapacityReservationBillingOwnership) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptCapacityReservationBillingOwnership(response, &metadata) - } - output := &AcceptCapacityReservationBillingOwnershipOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptCapacityReservationBillingOwnershipOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptCapacityReservationBillingOwnership(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptReservedInstancesExchangeQuote struct { -} - -func (*awsEc2query_deserializeOpAcceptReservedInstancesExchangeQuote) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptReservedInstancesExchangeQuote) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptReservedInstancesExchangeQuote(response, &metadata) - } - output := &AcceptReservedInstancesExchangeQuoteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptReservedInstancesExchangeQuoteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptReservedInstancesExchangeQuote(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_deserializeOpAcceptTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptTransitGatewayMulticastDomainAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptTransitGatewayMulticastDomainAssociations(response, &metadata) - } - output := &AcceptTransitGatewayMulticastDomainAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptTransitGatewayMulticastDomainAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptTransitGatewayMulticastDomainAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_deserializeOpAcceptTransitGatewayPeeringAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptTransitGatewayPeeringAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptTransitGatewayPeeringAttachment(response, &metadata) - } - output := &AcceptTransitGatewayPeeringAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptTransitGatewayPeeringAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptTransitGatewayPeeringAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_deserializeOpAcceptTransitGatewayVpcAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptTransitGatewayVpcAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptTransitGatewayVpcAttachment(response, &metadata) - } - output := &AcceptTransitGatewayVpcAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptTransitGatewayVpcAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptTransitGatewayVpcAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptVpcEndpointConnections struct { -} - -func (*awsEc2query_deserializeOpAcceptVpcEndpointConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptVpcEndpointConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptVpcEndpointConnections(response, &metadata) - } - output := &AcceptVpcEndpointConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptVpcEndpointConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptVpcEndpointConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAcceptVpcPeeringConnection struct { -} - -func (*awsEc2query_deserializeOpAcceptVpcPeeringConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAcceptVpcPeeringConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAcceptVpcPeeringConnection(response, &metadata) - } - output := &AcceptVpcPeeringConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAcceptVpcPeeringConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAcceptVpcPeeringConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAdvertiseByoipCidr struct { -} - -func (*awsEc2query_deserializeOpAdvertiseByoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAdvertiseByoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAdvertiseByoipCidr(response, &metadata) - } - output := &AdvertiseByoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAdvertiseByoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAdvertiseByoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAllocateAddress struct { -} - -func (*awsEc2query_deserializeOpAllocateAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAllocateAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAllocateAddress(response, &metadata) - } - output := &AllocateAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAllocateAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAllocateAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAllocateHosts struct { -} - -func (*awsEc2query_deserializeOpAllocateHosts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAllocateHosts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAllocateHosts(response, &metadata) - } - output := &AllocateHostsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAllocateHostsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAllocateHosts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAllocateIpamPoolCidr struct { -} - -func (*awsEc2query_deserializeOpAllocateIpamPoolCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAllocateIpamPoolCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAllocateIpamPoolCidr(response, &metadata) - } - output := &AllocateIpamPoolCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAllocateIpamPoolCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAllocateIpamPoolCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpApplySecurityGroupsToClientVpnTargetNetwork struct { -} - -func (*awsEc2query_deserializeOpApplySecurityGroupsToClientVpnTargetNetwork) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpApplySecurityGroupsToClientVpnTargetNetwork) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorApplySecurityGroupsToClientVpnTargetNetwork(response, &metadata) - } - output := &ApplySecurityGroupsToClientVpnTargetNetworkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentApplySecurityGroupsToClientVpnTargetNetworkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorApplySecurityGroupsToClientVpnTargetNetwork(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssignIpv6Addresses struct { -} - -func (*awsEc2query_deserializeOpAssignIpv6Addresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssignIpv6Addresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssignIpv6Addresses(response, &metadata) - } - output := &AssignIpv6AddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssignIpv6AddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssignIpv6Addresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssignPrivateIpAddresses struct { -} - -func (*awsEc2query_deserializeOpAssignPrivateIpAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssignPrivateIpAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssignPrivateIpAddresses(response, &metadata) - } - output := &AssignPrivateIpAddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssignPrivateIpAddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssignPrivateIpAddresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssignPrivateNatGatewayAddress struct { -} - -func (*awsEc2query_deserializeOpAssignPrivateNatGatewayAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssignPrivateNatGatewayAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssignPrivateNatGatewayAddress(response, &metadata) - } - output := &AssignPrivateNatGatewayAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssignPrivateNatGatewayAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssignPrivateNatGatewayAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateAddress struct { -} - -func (*awsEc2query_deserializeOpAssociateAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateAddress(response, &metadata) - } - output := &AssociateAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateCapacityReservationBillingOwner struct { -} - -func (*awsEc2query_deserializeOpAssociateCapacityReservationBillingOwner) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateCapacityReservationBillingOwner) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateCapacityReservationBillingOwner(response, &metadata) - } - output := &AssociateCapacityReservationBillingOwnerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateCapacityReservationBillingOwnerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateCapacityReservationBillingOwner(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateClientVpnTargetNetwork struct { -} - -func (*awsEc2query_deserializeOpAssociateClientVpnTargetNetwork) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateClientVpnTargetNetwork) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateClientVpnTargetNetwork(response, &metadata) - } - output := &AssociateClientVpnTargetNetworkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateClientVpnTargetNetworkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateClientVpnTargetNetwork(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateDhcpOptions struct { -} - -func (*awsEc2query_deserializeOpAssociateDhcpOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateDhcpOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateDhcpOptions(response, &metadata) - } - output := &AssociateDhcpOptionsOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateDhcpOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateEnclaveCertificateIamRole struct { -} - -func (*awsEc2query_deserializeOpAssociateEnclaveCertificateIamRole) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateEnclaveCertificateIamRole) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateEnclaveCertificateIamRole(response, &metadata) - } - output := &AssociateEnclaveCertificateIamRoleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateEnclaveCertificateIamRoleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateEnclaveCertificateIamRole(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateIamInstanceProfile struct { -} - -func (*awsEc2query_deserializeOpAssociateIamInstanceProfile) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateIamInstanceProfile) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateIamInstanceProfile(response, &metadata) - } - output := &AssociateIamInstanceProfileOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateIamInstanceProfileOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateIamInstanceProfile(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateInstanceEventWindow struct { -} - -func (*awsEc2query_deserializeOpAssociateInstanceEventWindow) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateInstanceEventWindow) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateInstanceEventWindow(response, &metadata) - } - output := &AssociateInstanceEventWindowOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateInstanceEventWindowOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateInstanceEventWindow(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateIpamByoasn struct { -} - -func (*awsEc2query_deserializeOpAssociateIpamByoasn) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateIpamByoasn) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateIpamByoasn(response, &metadata) - } - output := &AssociateIpamByoasnOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateIpamByoasnOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateIpamByoasn(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateIpamResourceDiscovery struct { -} - -func (*awsEc2query_deserializeOpAssociateIpamResourceDiscovery) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateIpamResourceDiscovery) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateIpamResourceDiscovery(response, &metadata) - } - output := &AssociateIpamResourceDiscoveryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateIpamResourceDiscoveryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateIpamResourceDiscovery(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateNatGatewayAddress struct { -} - -func (*awsEc2query_deserializeOpAssociateNatGatewayAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateNatGatewayAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateNatGatewayAddress(response, &metadata) - } - output := &AssociateNatGatewayAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateNatGatewayAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateNatGatewayAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateRouteServer struct { -} - -func (*awsEc2query_deserializeOpAssociateRouteServer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateRouteServer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateRouteServer(response, &metadata) - } - output := &AssociateRouteServerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateRouteServerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateRouteServer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateRouteTable struct { -} - -func (*awsEc2query_deserializeOpAssociateRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateRouteTable(response, &metadata) - } - output := &AssociateRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateSecurityGroupVpc struct { -} - -func (*awsEc2query_deserializeOpAssociateSecurityGroupVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateSecurityGroupVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateSecurityGroupVpc(response, &metadata) - } - output := &AssociateSecurityGroupVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateSecurityGroupVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateSecurityGroupVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateSubnetCidrBlock struct { -} - -func (*awsEc2query_deserializeOpAssociateSubnetCidrBlock) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(response, &metadata) - } - output := &AssociateSubnetCidrBlockOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateSubnetCidrBlockOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(response, &metadata) - } - output := &AssociateTransitGatewayMulticastDomainOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayMulticastDomainOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(response, &metadata) - } - output := &AssociateTransitGatewayPolicyTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayPolicyTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(response, &metadata) - } - output := &AssociateTransitGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateTrunkInterface struct { -} - -func (*awsEc2query_deserializeOpAssociateTrunkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateTrunkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTrunkInterface(response, &metadata) - } - output := &AssociateTrunkInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTrunkInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateTrunkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAssociateVpcCidrBlock struct { -} - -func (*awsEc2query_deserializeOpAssociateVpcCidrBlock) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(response, &metadata) - } - output := &AssociateVpcCidrBlockOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateVpcCidrBlockOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachClassicLinkVpc struct { -} - -func (*awsEc2query_deserializeOpAttachClassicLinkVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachClassicLinkVpc(response, &metadata) - } - output := &AttachClassicLinkVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachClassicLinkVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachClassicLinkVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachInternetGateway struct { -} - -func (*awsEc2query_deserializeOpAttachInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachInternetGateway(response, &metadata) - } - output := &AttachInternetGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachNetworkInterface struct { -} - -func (*awsEc2query_deserializeOpAttachNetworkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachNetworkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachNetworkInterface(response, &metadata) - } - output := &AttachNetworkInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachNetworkInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachNetworkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(response, &metadata) - } - output := &AttachVerifiedAccessTrustProviderOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachVerifiedAccessTrustProviderOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachVolume struct { -} - -func (*awsEc2query_deserializeOpAttachVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVolume(response, &metadata) - } - output := &AttachVolumeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachVolumeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAttachVpnGateway struct { -} - -func (*awsEc2query_deserializeOpAttachVpnGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachVpnGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVpnGateway(response, &metadata) - } - output := &AttachVpnGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachVpnGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachVpnGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAuthorizeClientVpnIngress struct { -} - -func (*awsEc2query_deserializeOpAuthorizeClientVpnIngress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAuthorizeClientVpnIngress(response, &metadata) - } - output := &AuthorizeClientVpnIngressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAuthorizeClientVpnIngressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAuthorizeClientVpnIngress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAuthorizeSecurityGroupEgress struct { -} - -func (*awsEc2query_deserializeOpAuthorizeSecurityGroupEgress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAuthorizeSecurityGroupEgress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAuthorizeSecurityGroupEgress(response, &metadata) - } - output := &AuthorizeSecurityGroupEgressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAuthorizeSecurityGroupEgressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAuthorizeSecurityGroupEgress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpAuthorizeSecurityGroupIngress struct { -} - -func (*awsEc2query_deserializeOpAuthorizeSecurityGroupIngress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAuthorizeSecurityGroupIngress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAuthorizeSecurityGroupIngress(response, &metadata) - } - output := &AuthorizeSecurityGroupIngressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAuthorizeSecurityGroupIngressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAuthorizeSecurityGroupIngress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpBundleInstance struct { -} - -func (*awsEc2query_deserializeOpBundleInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpBundleInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorBundleInstance(response, &metadata) - } - output := &BundleInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentBundleInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorBundleInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelBundleTask struct { -} - -func (*awsEc2query_deserializeOpCancelBundleTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelBundleTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelBundleTask(response, &metadata) - } - output := &CancelBundleTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelBundleTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelBundleTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelCapacityReservation struct { -} - -func (*awsEc2query_deserializeOpCancelCapacityReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelCapacityReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelCapacityReservation(response, &metadata) - } - output := &CancelCapacityReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelCapacityReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelCapacityReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelCapacityReservationFleets struct { -} - -func (*awsEc2query_deserializeOpCancelCapacityReservationFleets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelCapacityReservationFleets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelCapacityReservationFleets(response, &metadata) - } - output := &CancelCapacityReservationFleetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelCapacityReservationFleetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelCapacityReservationFleets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelConversionTask struct { -} - -func (*awsEc2query_deserializeOpCancelConversionTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelConversionTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelConversionTask(response, &metadata) - } - output := &CancelConversionTaskOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelConversionTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelDeclarativePoliciesReport struct { -} - -func (*awsEc2query_deserializeOpCancelDeclarativePoliciesReport) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelDeclarativePoliciesReport) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelDeclarativePoliciesReport(response, &metadata) - } - output := &CancelDeclarativePoliciesReportOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelDeclarativePoliciesReportOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelDeclarativePoliciesReport(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelExportTask struct { -} - -func (*awsEc2query_deserializeOpCancelExportTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelExportTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelExportTask(response, &metadata) - } - output := &CancelExportTaskOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelExportTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelImageLaunchPermission struct { -} - -func (*awsEc2query_deserializeOpCancelImageLaunchPermission) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelImageLaunchPermission) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelImageLaunchPermission(response, &metadata) - } - output := &CancelImageLaunchPermissionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelImageLaunchPermissionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelImageLaunchPermission(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelImportTask struct { -} - -func (*awsEc2query_deserializeOpCancelImportTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelImportTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelImportTask(response, &metadata) - } - output := &CancelImportTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelImportTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelImportTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelReservedInstancesListing struct { -} - -func (*awsEc2query_deserializeOpCancelReservedInstancesListing) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelReservedInstancesListing) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelReservedInstancesListing(response, &metadata) - } - output := &CancelReservedInstancesListingOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelReservedInstancesListingOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelReservedInstancesListing(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelSpotFleetRequests struct { -} - -func (*awsEc2query_deserializeOpCancelSpotFleetRequests) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelSpotFleetRequests) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelSpotFleetRequests(response, &metadata) - } - output := &CancelSpotFleetRequestsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelSpotFleetRequestsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelSpotFleetRequests(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCancelSpotInstanceRequests struct { -} - -func (*awsEc2query_deserializeOpCancelSpotInstanceRequests) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCancelSpotInstanceRequests) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCancelSpotInstanceRequests(response, &metadata) - } - output := &CancelSpotInstanceRequestsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCancelSpotInstanceRequestsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCancelSpotInstanceRequests(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpConfirmProductInstance struct { -} - -func (*awsEc2query_deserializeOpConfirmProductInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpConfirmProductInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorConfirmProductInstance(response, &metadata) - } - output := &ConfirmProductInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentConfirmProductInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorConfirmProductInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCopyFpgaImage struct { -} - -func (*awsEc2query_deserializeOpCopyFpgaImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCopyFpgaImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCopyFpgaImage(response, &metadata) - } - output := &CopyFpgaImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCopyFpgaImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCopyFpgaImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCopyImage struct { -} - -func (*awsEc2query_deserializeOpCopyImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCopyImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCopyImage(response, &metadata) - } - output := &CopyImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCopyImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCopyImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCopySnapshot struct { -} - -func (*awsEc2query_deserializeOpCopySnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCopySnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCopySnapshot(response, &metadata) - } - output := &CopySnapshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCopySnapshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCopySnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCapacityReservation struct { -} - -func (*awsEc2query_deserializeOpCreateCapacityReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCapacityReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCapacityReservation(response, &metadata) - } - output := &CreateCapacityReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCapacityReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCapacityReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCapacityReservationBySplitting struct { -} - -func (*awsEc2query_deserializeOpCreateCapacityReservationBySplitting) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCapacityReservationBySplitting) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCapacityReservationBySplitting(response, &metadata) - } - output := &CreateCapacityReservationBySplittingOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCapacityReservationBySplittingOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCapacityReservationBySplitting(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCapacityReservationFleet struct { -} - -func (*awsEc2query_deserializeOpCreateCapacityReservationFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCapacityReservationFleet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCapacityReservationFleet(response, &metadata) - } - output := &CreateCapacityReservationFleetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCapacityReservationFleetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCapacityReservationFleet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCarrierGateway struct { -} - -func (*awsEc2query_deserializeOpCreateCarrierGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCarrierGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCarrierGateway(response, &metadata) - } - output := &CreateCarrierGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCarrierGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCarrierGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateClientVpnEndpoint struct { -} - -func (*awsEc2query_deserializeOpCreateClientVpnEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateClientVpnEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateClientVpnEndpoint(response, &metadata) - } - output := &CreateClientVpnEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateClientVpnEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateClientVpnEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateClientVpnRoute struct { -} - -func (*awsEc2query_deserializeOpCreateClientVpnRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateClientVpnRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateClientVpnRoute(response, &metadata) - } - output := &CreateClientVpnRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateClientVpnRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateClientVpnRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCoipCidr struct { -} - -func (*awsEc2query_deserializeOpCreateCoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCoipCidr(response, &metadata) - } - output := &CreateCoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCoipPool struct { -} - -func (*awsEc2query_deserializeOpCreateCoipPool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCoipPool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCoipPool(response, &metadata) - } - output := &CreateCoipPoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCoipPoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCoipPool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateCustomerGateway struct { -} - -func (*awsEc2query_deserializeOpCreateCustomerGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateCustomerGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateCustomerGateway(response, &metadata) - } - output := &CreateCustomerGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateCustomerGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateCustomerGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateDefaultSubnet struct { -} - -func (*awsEc2query_deserializeOpCreateDefaultSubnet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateDefaultSubnet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateDefaultSubnet(response, &metadata) - } - output := &CreateDefaultSubnetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateDefaultSubnetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateDefaultSubnet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateDefaultVpc struct { -} - -func (*awsEc2query_deserializeOpCreateDefaultVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateDefaultVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateDefaultVpc(response, &metadata) - } - output := &CreateDefaultVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateDefaultVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateDefaultVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateDelegateMacVolumeOwnershipTask struct { -} - -func (*awsEc2query_deserializeOpCreateDelegateMacVolumeOwnershipTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateDelegateMacVolumeOwnershipTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateDelegateMacVolumeOwnershipTask(response, &metadata) - } - output := &CreateDelegateMacVolumeOwnershipTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateDelegateMacVolumeOwnershipTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateDelegateMacVolumeOwnershipTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateDhcpOptions struct { -} - -func (*awsEc2query_deserializeOpCreateDhcpOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateDhcpOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateDhcpOptions(response, &metadata) - } - output := &CreateDhcpOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateDhcpOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateDhcpOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateEgressOnlyInternetGateway struct { -} - -func (*awsEc2query_deserializeOpCreateEgressOnlyInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateEgressOnlyInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateEgressOnlyInternetGateway(response, &metadata) - } - output := &CreateEgressOnlyInternetGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateEgressOnlyInternetGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateEgressOnlyInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateFleet struct { -} - -func (*awsEc2query_deserializeOpCreateFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateFleet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateFleet(response, &metadata) - } - output := &CreateFleetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateFleetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateFleet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateFlowLogs struct { -} - -func (*awsEc2query_deserializeOpCreateFlowLogs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateFlowLogs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateFlowLogs(response, &metadata) - } - output := &CreateFlowLogsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateFlowLogsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateFlowLogs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateFpgaImage struct { -} - -func (*awsEc2query_deserializeOpCreateFpgaImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateFpgaImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateFpgaImage(response, &metadata) - } - output := &CreateFpgaImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateFpgaImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateFpgaImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateImage struct { -} - -func (*awsEc2query_deserializeOpCreateImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateImage(response, &metadata) - } - output := &CreateImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateInstanceConnectEndpoint struct { -} - -func (*awsEc2query_deserializeOpCreateInstanceConnectEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateInstanceConnectEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateInstanceConnectEndpoint(response, &metadata) - } - output := &CreateInstanceConnectEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateInstanceConnectEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateInstanceConnectEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateInstanceEventWindow struct { -} - -func (*awsEc2query_deserializeOpCreateInstanceEventWindow) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateInstanceEventWindow) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateInstanceEventWindow(response, &metadata) - } - output := &CreateInstanceEventWindowOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateInstanceEventWindowOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateInstanceEventWindow(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateInstanceExportTask struct { -} - -func (*awsEc2query_deserializeOpCreateInstanceExportTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateInstanceExportTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateInstanceExportTask(response, &metadata) - } - output := &CreateInstanceExportTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateInstanceExportTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateInstanceExportTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateInternetGateway struct { -} - -func (*awsEc2query_deserializeOpCreateInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateInternetGateway(response, &metadata) - } - output := &CreateInternetGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateInternetGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateIpam struct { -} - -func (*awsEc2query_deserializeOpCreateIpam) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateIpam) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateIpam(response, &metadata) - } - output := &CreateIpamOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateIpamOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateIpam(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateIpamExternalResourceVerificationToken struct { -} - -func (*awsEc2query_deserializeOpCreateIpamExternalResourceVerificationToken) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateIpamExternalResourceVerificationToken) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateIpamExternalResourceVerificationToken(response, &metadata) - } - output := &CreateIpamExternalResourceVerificationTokenOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateIpamExternalResourceVerificationTokenOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateIpamExternalResourceVerificationToken(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateIpamPool struct { -} - -func (*awsEc2query_deserializeOpCreateIpamPool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateIpamPool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateIpamPool(response, &metadata) - } - output := &CreateIpamPoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateIpamPoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateIpamPool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateIpamResourceDiscovery struct { -} - -func (*awsEc2query_deserializeOpCreateIpamResourceDiscovery) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateIpamResourceDiscovery) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateIpamResourceDiscovery(response, &metadata) - } - output := &CreateIpamResourceDiscoveryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateIpamResourceDiscoveryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateIpamResourceDiscovery(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateIpamScope struct { -} - -func (*awsEc2query_deserializeOpCreateIpamScope) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateIpamScope) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateIpamScope(response, &metadata) - } - output := &CreateIpamScopeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateIpamScopeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateIpamScope(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateKeyPair struct { -} - -func (*awsEc2query_deserializeOpCreateKeyPair) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateKeyPair) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateKeyPair(response, &metadata) - } - output := &CreateKeyPairOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateKeyPairOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateKeyPair(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLaunchTemplate struct { -} - -func (*awsEc2query_deserializeOpCreateLaunchTemplate) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLaunchTemplate) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLaunchTemplate(response, &metadata) - } - output := &CreateLaunchTemplateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLaunchTemplateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLaunchTemplate(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLaunchTemplateVersion struct { -} - -func (*awsEc2query_deserializeOpCreateLaunchTemplateVersion) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLaunchTemplateVersion) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLaunchTemplateVersion(response, &metadata) - } - output := &CreateLaunchTemplateVersionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLaunchTemplateVersionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLaunchTemplateVersion(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayRoute(response, &metadata) - } - output := &CreateLocalGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTable(response, &metadata) - } - output := &CreateLocalGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(response, &metadata) - } - output := &CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayRouteTableVpcAssociation struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayRouteTableVpcAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTableVpcAssociation(response, &metadata) - } - output := &CreateLocalGatewayRouteTableVpcAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableVpcAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayRouteTableVpcAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayVirtualInterface struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayVirtualInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayVirtualInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayVirtualInterface(response, &metadata) - } - output := &CreateLocalGatewayVirtualInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayVirtualInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayVirtualInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateLocalGatewayVirtualInterfaceGroup struct { -} - -func (*awsEc2query_deserializeOpCreateLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateLocalGatewayVirtualInterfaceGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateLocalGatewayVirtualInterfaceGroup(response, &metadata) - } - output := &CreateLocalGatewayVirtualInterfaceGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateLocalGatewayVirtualInterfaceGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateLocalGatewayVirtualInterfaceGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateMacSystemIntegrityProtectionModificationTask struct { -} - -func (*awsEc2query_deserializeOpCreateMacSystemIntegrityProtectionModificationTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateMacSystemIntegrityProtectionModificationTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateMacSystemIntegrityProtectionModificationTask(response, &metadata) - } - output := &CreateMacSystemIntegrityProtectionModificationTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateMacSystemIntegrityProtectionModificationTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateMacSystemIntegrityProtectionModificationTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateManagedPrefixList struct { -} - -func (*awsEc2query_deserializeOpCreateManagedPrefixList) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateManagedPrefixList) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateManagedPrefixList(response, &metadata) - } - output := &CreateManagedPrefixListOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateManagedPrefixListOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateManagedPrefixList(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNatGateway struct { -} - -func (*awsEc2query_deserializeOpCreateNatGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNatGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNatGateway(response, &metadata) - } - output := &CreateNatGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNatGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNatGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkAcl struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkAcl) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkAcl) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkAcl(response, &metadata) - } - output := &CreateNetworkAclOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNetworkAclOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkAcl(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkAclEntry struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkAclEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkAclEntry) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkAclEntry(response, &metadata) - } - output := &CreateNetworkAclEntryOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkAclEntry(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkInsightsAccessScope struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkInsightsAccessScope) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkInsightsAccessScope) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkInsightsAccessScope(response, &metadata) - } - output := &CreateNetworkInsightsAccessScopeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNetworkInsightsAccessScopeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkInsightsAccessScope(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkInsightsPath struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkInsightsPath) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkInsightsPath) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkInsightsPath(response, &metadata) - } - output := &CreateNetworkInsightsPathOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNetworkInsightsPathOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkInsightsPath(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkInterface struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkInterface(response, &metadata) - } - output := &CreateNetworkInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNetworkInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateNetworkInterfacePermission struct { -} - -func (*awsEc2query_deserializeOpCreateNetworkInterfacePermission) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateNetworkInterfacePermission) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateNetworkInterfacePermission(response, &metadata) - } - output := &CreateNetworkInterfacePermissionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateNetworkInterfacePermissionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateNetworkInterfacePermission(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreatePlacementGroup struct { -} - -func (*awsEc2query_deserializeOpCreatePlacementGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreatePlacementGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreatePlacementGroup(response, &metadata) - } - output := &CreatePlacementGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreatePlacementGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreatePlacementGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreatePublicIpv4Pool struct { -} - -func (*awsEc2query_deserializeOpCreatePublicIpv4Pool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreatePublicIpv4Pool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreatePublicIpv4Pool(response, &metadata) - } - output := &CreatePublicIpv4PoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreatePublicIpv4PoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreatePublicIpv4Pool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateReplaceRootVolumeTask struct { -} - -func (*awsEc2query_deserializeOpCreateReplaceRootVolumeTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateReplaceRootVolumeTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateReplaceRootVolumeTask(response, &metadata) - } - output := &CreateReplaceRootVolumeTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateReplaceRootVolumeTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateReplaceRootVolumeTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateReservedInstancesListing struct { -} - -func (*awsEc2query_deserializeOpCreateReservedInstancesListing) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateReservedInstancesListing) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateReservedInstancesListing(response, &metadata) - } - output := &CreateReservedInstancesListingOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateReservedInstancesListingOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateReservedInstancesListing(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRestoreImageTask struct { -} - -func (*awsEc2query_deserializeOpCreateRestoreImageTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRestoreImageTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRestoreImageTask(response, &metadata) - } - output := &CreateRestoreImageTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRestoreImageTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRestoreImageTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRoute struct { -} - -func (*awsEc2query_deserializeOpCreateRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRoute(response, &metadata) - } - output := &CreateRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRouteServer struct { -} - -func (*awsEc2query_deserializeOpCreateRouteServer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRouteServer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRouteServer(response, &metadata) - } - output := &CreateRouteServerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRouteServerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRouteServer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRouteServerEndpoint struct { -} - -func (*awsEc2query_deserializeOpCreateRouteServerEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRouteServerEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRouteServerEndpoint(response, &metadata) - } - output := &CreateRouteServerEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRouteServerEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRouteServerEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRouteServerPeer struct { -} - -func (*awsEc2query_deserializeOpCreateRouteServerPeer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRouteServerPeer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRouteServerPeer(response, &metadata) - } - output := &CreateRouteServerPeerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRouteServerPeerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRouteServerPeer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateRouteTable struct { -} - -func (*awsEc2query_deserializeOpCreateRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateRouteTable(response, &metadata) - } - output := &CreateRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSecurityGroup struct { -} - -func (*awsEc2query_deserializeOpCreateSecurityGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSecurityGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSecurityGroup(response, &metadata) - } - output := &CreateSecurityGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSecurityGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSecurityGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSnapshot struct { -} - -func (*awsEc2query_deserializeOpCreateSnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSnapshot(response, &metadata) - } - output := &CreateSnapshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSnapshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSnapshots struct { -} - -func (*awsEc2query_deserializeOpCreateSnapshots) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSnapshots) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSnapshots(response, &metadata) - } - output := &CreateSnapshotsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSnapshotsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSnapshots(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSpotDatafeedSubscription struct { -} - -func (*awsEc2query_deserializeOpCreateSpotDatafeedSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSpotDatafeedSubscription) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSpotDatafeedSubscription(response, &metadata) - } - output := &CreateSpotDatafeedSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSpotDatafeedSubscriptionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSpotDatafeedSubscription(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateStoreImageTask struct { -} - -func (*awsEc2query_deserializeOpCreateStoreImageTask) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateStoreImageTask) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateStoreImageTask(response, &metadata) - } - output := &CreateStoreImageTaskOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateStoreImageTaskOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateStoreImageTask(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSubnet struct { -} - -func (*awsEc2query_deserializeOpCreateSubnet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSubnet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSubnet(response, &metadata) - } - output := &CreateSubnetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSubnetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSubnet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateSubnetCidrReservation struct { -} - -func (*awsEc2query_deserializeOpCreateSubnetCidrReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateSubnetCidrReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateSubnetCidrReservation(response, &metadata) - } - output := &CreateSubnetCidrReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateSubnetCidrReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateSubnetCidrReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTags struct { -} - -func (*awsEc2query_deserializeOpCreateTags) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTags) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTags(response, &metadata) - } - output := &CreateTagsOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTags(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTrafficMirrorFilter struct { -} - -func (*awsEc2query_deserializeOpCreateTrafficMirrorFilter) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTrafficMirrorFilter) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTrafficMirrorFilter(response, &metadata) - } - output := &CreateTrafficMirrorFilterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTrafficMirrorFilterOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTrafficMirrorFilter(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_deserializeOpCreateTrafficMirrorFilterRule) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTrafficMirrorFilterRule) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTrafficMirrorFilterRule(response, &metadata) - } - output := &CreateTrafficMirrorFilterRuleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTrafficMirrorFilterRuleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTrafficMirrorFilterRule(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTrafficMirrorSession struct { -} - -func (*awsEc2query_deserializeOpCreateTrafficMirrorSession) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTrafficMirrorSession) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTrafficMirrorSession(response, &metadata) - } - output := &CreateTrafficMirrorSessionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTrafficMirrorSessionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTrafficMirrorSession(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTrafficMirrorTarget struct { -} - -func (*awsEc2query_deserializeOpCreateTrafficMirrorTarget) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTrafficMirrorTarget) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTrafficMirrorTarget(response, &metadata) - } - output := &CreateTrafficMirrorTargetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTrafficMirrorTargetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTrafficMirrorTarget(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGateway struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGateway(response, &metadata) - } - output := &CreateTransitGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayConnect struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayConnect) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayConnect) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayConnect(response, &metadata) - } - output := &CreateTransitGatewayConnectOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayConnectOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayConnect(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayConnectPeer struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayConnectPeer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayConnectPeer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayConnectPeer(response, &metadata) - } - output := &CreateTransitGatewayConnectPeerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayConnectPeerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayConnectPeer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayMulticastDomain) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayMulticastDomain) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayMulticastDomain(response, &metadata) - } - output := &CreateTransitGatewayMulticastDomainOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayMulticastDomainOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayMulticastDomain(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayPeeringAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayPeeringAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayPeeringAttachment(response, &metadata) - } - output := &CreateTransitGatewayPeeringAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayPeeringAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayPeeringAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayPolicyTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayPolicyTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayPolicyTable(response, &metadata) - } - output := &CreateTransitGatewayPolicyTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayPolicyTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayPolicyTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayPrefixListReference) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayPrefixListReference) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayPrefixListReference(response, &metadata) - } - output := &CreateTransitGatewayPrefixListReferenceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayPrefixListReferenceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayPrefixListReference(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayRoute(response, &metadata) - } - output := &CreateTransitGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayRouteTable(response, &metadata) - } - output := &CreateTransitGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayRouteTableAnnouncement struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayRouteTableAnnouncement) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayRouteTableAnnouncement(response, &metadata) - } - output := &CreateTransitGatewayRouteTableAnnouncementOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteTableAnnouncementOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayRouteTableAnnouncement(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_deserializeOpCreateTransitGatewayVpcAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateTransitGatewayVpcAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateTransitGatewayVpcAttachment(response, &metadata) - } - output := &CreateTransitGatewayVpcAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateTransitGatewayVpcAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateTransitGatewayVpcAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_deserializeOpCreateVerifiedAccessEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVerifiedAccessEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVerifiedAccessEndpoint(response, &metadata) - } - output := &CreateVerifiedAccessEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVerifiedAccessEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVerifiedAccessEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVerifiedAccessGroup struct { -} - -func (*awsEc2query_deserializeOpCreateVerifiedAccessGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVerifiedAccessGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVerifiedAccessGroup(response, &metadata) - } - output := &CreateVerifiedAccessGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVerifiedAccessGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVerifiedAccessGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVerifiedAccessInstance struct { -} - -func (*awsEc2query_deserializeOpCreateVerifiedAccessInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVerifiedAccessInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVerifiedAccessInstance(response, &metadata) - } - output := &CreateVerifiedAccessInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVerifiedAccessInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVerifiedAccessInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_deserializeOpCreateVerifiedAccessTrustProvider) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVerifiedAccessTrustProvider) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVerifiedAccessTrustProvider(response, &metadata) - } - output := &CreateVerifiedAccessTrustProviderOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVerifiedAccessTrustProviderOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVerifiedAccessTrustProvider(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVolume struct { -} - -func (*awsEc2query_deserializeOpCreateVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVolume(response, &metadata) - } - output := &CreateVolumeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVolumeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpc struct { -} - -func (*awsEc2query_deserializeOpCreateVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpc(response, &metadata) - } - output := &CreateVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_deserializeOpCreateVpcBlockPublicAccessExclusion) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpcBlockPublicAccessExclusion) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpcBlockPublicAccessExclusion(response, &metadata) - } - output := &CreateVpcBlockPublicAccessExclusionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcBlockPublicAccessExclusionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpcBlockPublicAccessExclusion(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpcEndpoint struct { -} - -func (*awsEc2query_deserializeOpCreateVpcEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpcEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpcEndpoint(response, &metadata) - } - output := &CreateVpcEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpcEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpcEndpointConnectionNotification struct { -} - -func (*awsEc2query_deserializeOpCreateVpcEndpointConnectionNotification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpcEndpointConnectionNotification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpcEndpointConnectionNotification(response, &metadata) - } - output := &CreateVpcEndpointConnectionNotificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcEndpointConnectionNotificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpcEndpointConnectionNotification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpcEndpointServiceConfiguration struct { -} - -func (*awsEc2query_deserializeOpCreateVpcEndpointServiceConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpcEndpointServiceConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpcEndpointServiceConfiguration(response, &metadata) - } - output := &CreateVpcEndpointServiceConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcEndpointServiceConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpcEndpointServiceConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpcPeeringConnection struct { -} - -func (*awsEc2query_deserializeOpCreateVpcPeeringConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpcPeeringConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpcPeeringConnection(response, &metadata) - } - output := &CreateVpcPeeringConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpcPeeringConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpcPeeringConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpnConnection struct { -} - -func (*awsEc2query_deserializeOpCreateVpnConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpnConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpnConnection(response, &metadata) - } - output := &CreateVpnConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpnConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpnConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpnConnectionRoute struct { -} - -func (*awsEc2query_deserializeOpCreateVpnConnectionRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpnConnectionRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpnConnectionRoute(response, &metadata) - } - output := &CreateVpnConnectionRouteOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpnConnectionRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpCreateVpnGateway struct { -} - -func (*awsEc2query_deserializeOpCreateVpnGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpCreateVpnGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorCreateVpnGateway(response, &metadata) - } - output := &CreateVpnGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentCreateVpnGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorCreateVpnGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteCarrierGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteCarrierGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteCarrierGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteCarrierGateway(response, &metadata) - } - output := &DeleteCarrierGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteCarrierGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteCarrierGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteClientVpnEndpoint struct { -} - -func (*awsEc2query_deserializeOpDeleteClientVpnEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteClientVpnEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteClientVpnEndpoint(response, &metadata) - } - output := &DeleteClientVpnEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteClientVpnEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteClientVpnEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteClientVpnRoute struct { -} - -func (*awsEc2query_deserializeOpDeleteClientVpnRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteClientVpnRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteClientVpnRoute(response, &metadata) - } - output := &DeleteClientVpnRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteClientVpnRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteClientVpnRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteCoipCidr struct { -} - -func (*awsEc2query_deserializeOpDeleteCoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteCoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteCoipCidr(response, &metadata) - } - output := &DeleteCoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteCoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteCoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteCoipPool struct { -} - -func (*awsEc2query_deserializeOpDeleteCoipPool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteCoipPool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteCoipPool(response, &metadata) - } - output := &DeleteCoipPoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteCoipPoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteCoipPool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteCustomerGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteCustomerGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteCustomerGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteCustomerGateway(response, &metadata) - } - output := &DeleteCustomerGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteCustomerGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteDhcpOptions struct { -} - -func (*awsEc2query_deserializeOpDeleteDhcpOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteDhcpOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteDhcpOptions(response, &metadata) - } - output := &DeleteDhcpOptionsOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteDhcpOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteEgressOnlyInternetGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteEgressOnlyInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteEgressOnlyInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteEgressOnlyInternetGateway(response, &metadata) - } - output := &DeleteEgressOnlyInternetGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteEgressOnlyInternetGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteEgressOnlyInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteFleets struct { -} - -func (*awsEc2query_deserializeOpDeleteFleets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteFleets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteFleets(response, &metadata) - } - output := &DeleteFleetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteFleetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteFleets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteFlowLogs struct { -} - -func (*awsEc2query_deserializeOpDeleteFlowLogs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteFlowLogs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteFlowLogs(response, &metadata) - } - output := &DeleteFlowLogsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteFlowLogsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteFlowLogs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteFpgaImage struct { -} - -func (*awsEc2query_deserializeOpDeleteFpgaImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteFpgaImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteFpgaImage(response, &metadata) - } - output := &DeleteFpgaImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteFpgaImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteFpgaImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteInstanceConnectEndpoint struct { -} - -func (*awsEc2query_deserializeOpDeleteInstanceConnectEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteInstanceConnectEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteInstanceConnectEndpoint(response, &metadata) - } - output := &DeleteInstanceConnectEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteInstanceConnectEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteInstanceConnectEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteInstanceEventWindow struct { -} - -func (*awsEc2query_deserializeOpDeleteInstanceEventWindow) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteInstanceEventWindow) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteInstanceEventWindow(response, &metadata) - } - output := &DeleteInstanceEventWindowOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteInstanceEventWindowOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteInstanceEventWindow(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteInternetGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteInternetGateway(response, &metadata) - } - output := &DeleteInternetGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteIpam struct { -} - -func (*awsEc2query_deserializeOpDeleteIpam) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteIpam) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteIpam(response, &metadata) - } - output := &DeleteIpamOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteIpamOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteIpam(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteIpamExternalResourceVerificationToken struct { -} - -func (*awsEc2query_deserializeOpDeleteIpamExternalResourceVerificationToken) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteIpamExternalResourceVerificationToken) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteIpamExternalResourceVerificationToken(response, &metadata) - } - output := &DeleteIpamExternalResourceVerificationTokenOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteIpamExternalResourceVerificationTokenOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteIpamExternalResourceVerificationToken(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteIpamPool struct { -} - -func (*awsEc2query_deserializeOpDeleteIpamPool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteIpamPool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteIpamPool(response, &metadata) - } - output := &DeleteIpamPoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteIpamPoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteIpamPool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteIpamResourceDiscovery struct { -} - -func (*awsEc2query_deserializeOpDeleteIpamResourceDiscovery) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteIpamResourceDiscovery) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteIpamResourceDiscovery(response, &metadata) - } - output := &DeleteIpamResourceDiscoveryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteIpamResourceDiscoveryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteIpamResourceDiscovery(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteIpamScope struct { -} - -func (*awsEc2query_deserializeOpDeleteIpamScope) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteIpamScope) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteIpamScope(response, &metadata) - } - output := &DeleteIpamScopeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteIpamScopeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteIpamScope(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteKeyPair struct { -} - -func (*awsEc2query_deserializeOpDeleteKeyPair) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteKeyPair) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteKeyPair(response, &metadata) - } - output := &DeleteKeyPairOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteKeyPairOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteKeyPair(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLaunchTemplate struct { -} - -func (*awsEc2query_deserializeOpDeleteLaunchTemplate) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLaunchTemplate) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLaunchTemplate(response, &metadata) - } - output := &DeleteLaunchTemplateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLaunchTemplateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLaunchTemplate(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLaunchTemplateVersions struct { -} - -func (*awsEc2query_deserializeOpDeleteLaunchTemplateVersions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLaunchTemplateVersions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLaunchTemplateVersions(response, &metadata) - } - output := &DeleteLaunchTemplateVersionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLaunchTemplateVersionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLaunchTemplateVersions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayRoute(response, &metadata) - } - output := &DeleteLocalGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTable(response, &metadata) - } - output := &DeleteLocalGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(response, &metadata) - } - output := &DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVpcAssociation struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayRouteTableVpcAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTableVpcAssociation(response, &metadata) - } - output := &DeleteLocalGatewayRouteTableVpcAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableVpcAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayRouteTableVpcAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterface struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayVirtualInterface(response, &metadata) - } - output := &DeleteLocalGatewayVirtualInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayVirtualInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayVirtualInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterfaceGroup struct { -} - -func (*awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteLocalGatewayVirtualInterfaceGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteLocalGatewayVirtualInterfaceGroup(response, &metadata) - } - output := &DeleteLocalGatewayVirtualInterfaceGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteLocalGatewayVirtualInterfaceGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteLocalGatewayVirtualInterfaceGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteManagedPrefixList struct { -} - -func (*awsEc2query_deserializeOpDeleteManagedPrefixList) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteManagedPrefixList) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteManagedPrefixList(response, &metadata) - } - output := &DeleteManagedPrefixListOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteManagedPrefixListOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteManagedPrefixList(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNatGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteNatGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNatGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNatGateway(response, &metadata) - } - output := &DeleteNatGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNatGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNatGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkAcl struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkAcl) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkAcl) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkAcl(response, &metadata) - } - output := &DeleteNetworkAclOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkAcl(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkAclEntry struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkAclEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkAclEntry) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkAclEntry(response, &metadata) - } - output := &DeleteNetworkAclEntryOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkAclEntry(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInsightsAccessScope struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInsightsAccessScope) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInsightsAccessScope) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInsightsAccessScope(response, &metadata) - } - output := &DeleteNetworkInsightsAccessScopeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAccessScopeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInsightsAccessScope(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInsightsAccessScopeAnalysis struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInsightsAccessScopeAnalysis) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInsightsAccessScopeAnalysis(response, &metadata) - } - output := &DeleteNetworkInsightsAccessScopeAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAccessScopeAnalysisOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInsightsAccessScopeAnalysis(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInsightsAnalysis struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInsightsAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInsightsAnalysis) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInsightsAnalysis(response, &metadata) - } - output := &DeleteNetworkInsightsAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAnalysisOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInsightsAnalysis(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInsightsPath struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInsightsPath) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInsightsPath) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInsightsPath(response, &metadata) - } - output := &DeleteNetworkInsightsPathOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNetworkInsightsPathOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInsightsPath(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInterface struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInterface(response, &metadata) - } - output := &DeleteNetworkInterfaceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteNetworkInterfacePermission struct { -} - -func (*awsEc2query_deserializeOpDeleteNetworkInterfacePermission) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteNetworkInterfacePermission) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteNetworkInterfacePermission(response, &metadata) - } - output := &DeleteNetworkInterfacePermissionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteNetworkInterfacePermissionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteNetworkInterfacePermission(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeletePlacementGroup struct { -} - -func (*awsEc2query_deserializeOpDeletePlacementGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeletePlacementGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeletePlacementGroup(response, &metadata) - } - output := &DeletePlacementGroupOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeletePlacementGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeletePublicIpv4Pool struct { -} - -func (*awsEc2query_deserializeOpDeletePublicIpv4Pool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeletePublicIpv4Pool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeletePublicIpv4Pool(response, &metadata) - } - output := &DeletePublicIpv4PoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeletePublicIpv4PoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeletePublicIpv4Pool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteQueuedReservedInstances struct { -} - -func (*awsEc2query_deserializeOpDeleteQueuedReservedInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteQueuedReservedInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteQueuedReservedInstances(response, &metadata) - } - output := &DeleteQueuedReservedInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteQueuedReservedInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteQueuedReservedInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteRoute struct { -} - -func (*awsEc2query_deserializeOpDeleteRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteRoute(response, &metadata) - } - output := &DeleteRouteOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteRouteServer struct { -} - -func (*awsEc2query_deserializeOpDeleteRouteServer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteRouteServer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteRouteServer(response, &metadata) - } - output := &DeleteRouteServerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteRouteServerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteRouteServer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteRouteServerEndpoint struct { -} - -func (*awsEc2query_deserializeOpDeleteRouteServerEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteRouteServerEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteRouteServerEndpoint(response, &metadata) - } - output := &DeleteRouteServerEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteRouteServerEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteRouteServerEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteRouteServerPeer struct { -} - -func (*awsEc2query_deserializeOpDeleteRouteServerPeer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteRouteServerPeer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteRouteServerPeer(response, &metadata) - } - output := &DeleteRouteServerPeerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteRouteServerPeerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteRouteServerPeer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteRouteTable struct { -} - -func (*awsEc2query_deserializeOpDeleteRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteRouteTable(response, &metadata) - } - output := &DeleteRouteTableOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteSecurityGroup struct { -} - -func (*awsEc2query_deserializeOpDeleteSecurityGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteSecurityGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteSecurityGroup(response, &metadata) - } - output := &DeleteSecurityGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteSecurityGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteSecurityGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteSnapshot struct { -} - -func (*awsEc2query_deserializeOpDeleteSnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteSnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteSnapshot(response, &metadata) - } - output := &DeleteSnapshotOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteSnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteSpotDatafeedSubscription struct { -} - -func (*awsEc2query_deserializeOpDeleteSpotDatafeedSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteSpotDatafeedSubscription) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteSpotDatafeedSubscription(response, &metadata) - } - output := &DeleteSpotDatafeedSubscriptionOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteSpotDatafeedSubscription(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteSubnet struct { -} - -func (*awsEc2query_deserializeOpDeleteSubnet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteSubnet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteSubnet(response, &metadata) - } - output := &DeleteSubnetOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteSubnet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteSubnetCidrReservation struct { -} - -func (*awsEc2query_deserializeOpDeleteSubnetCidrReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteSubnetCidrReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteSubnetCidrReservation(response, &metadata) - } - output := &DeleteSubnetCidrReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteSubnetCidrReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteSubnetCidrReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTags struct { -} - -func (*awsEc2query_deserializeOpDeleteTags) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTags) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTags(response, &metadata) - } - output := &DeleteTagsOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTags(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTrafficMirrorFilter struct { -} - -func (*awsEc2query_deserializeOpDeleteTrafficMirrorFilter) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTrafficMirrorFilter) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTrafficMirrorFilter(response, &metadata) - } - output := &DeleteTrafficMirrorFilterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTrafficMirrorFilterOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTrafficMirrorFilter(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_deserializeOpDeleteTrafficMirrorFilterRule) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTrafficMirrorFilterRule) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTrafficMirrorFilterRule(response, &metadata) - } - output := &DeleteTrafficMirrorFilterRuleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTrafficMirrorFilterRuleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTrafficMirrorFilterRule(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTrafficMirrorSession struct { -} - -func (*awsEc2query_deserializeOpDeleteTrafficMirrorSession) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTrafficMirrorSession) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTrafficMirrorSession(response, &metadata) - } - output := &DeleteTrafficMirrorSessionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTrafficMirrorSessionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTrafficMirrorSession(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTrafficMirrorTarget struct { -} - -func (*awsEc2query_deserializeOpDeleteTrafficMirrorTarget) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTrafficMirrorTarget) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTrafficMirrorTarget(response, &metadata) - } - output := &DeleteTrafficMirrorTargetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTrafficMirrorTargetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTrafficMirrorTarget(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGateway(response, &metadata) - } - output := &DeleteTransitGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayConnect struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayConnect) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayConnect) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayConnect(response, &metadata) - } - output := &DeleteTransitGatewayConnectOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayConnectOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayConnect(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayConnectPeer struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayConnectPeer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayConnectPeer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayConnectPeer(response, &metadata) - } - output := &DeleteTransitGatewayConnectPeerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayConnectPeerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayConnectPeer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayMulticastDomain) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayMulticastDomain) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayMulticastDomain(response, &metadata) - } - output := &DeleteTransitGatewayMulticastDomainOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayMulticastDomainOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayMulticastDomain(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayPeeringAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayPeeringAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayPeeringAttachment(response, &metadata) - } - output := &DeleteTransitGatewayPeeringAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayPeeringAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayPeeringAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayPolicyTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayPolicyTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayPolicyTable(response, &metadata) - } - output := &DeleteTransitGatewayPolicyTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayPolicyTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayPolicyTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayPrefixListReference) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayPrefixListReference) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayPrefixListReference(response, &metadata) - } - output := &DeleteTransitGatewayPrefixListReferenceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayPrefixListReferenceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayPrefixListReference(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayRoute(response, &metadata) - } - output := &DeleteTransitGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayRouteTable(response, &metadata) - } - output := &DeleteTransitGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayRouteTableAnnouncement struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayRouteTableAnnouncement) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayRouteTableAnnouncement(response, &metadata) - } - output := &DeleteTransitGatewayRouteTableAnnouncementOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteTableAnnouncementOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayRouteTableAnnouncement(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_deserializeOpDeleteTransitGatewayVpcAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteTransitGatewayVpcAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteTransitGatewayVpcAttachment(response, &metadata) - } - output := &DeleteTransitGatewayVpcAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteTransitGatewayVpcAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteTransitGatewayVpcAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_deserializeOpDeleteVerifiedAccessEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVerifiedAccessEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVerifiedAccessEndpoint(response, &metadata) - } - output := &DeleteVerifiedAccessEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVerifiedAccessEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVerifiedAccessEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVerifiedAccessGroup struct { -} - -func (*awsEc2query_deserializeOpDeleteVerifiedAccessGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVerifiedAccessGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVerifiedAccessGroup(response, &metadata) - } - output := &DeleteVerifiedAccessGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVerifiedAccessGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVerifiedAccessGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVerifiedAccessInstance struct { -} - -func (*awsEc2query_deserializeOpDeleteVerifiedAccessInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVerifiedAccessInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVerifiedAccessInstance(response, &metadata) - } - output := &DeleteVerifiedAccessInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVerifiedAccessInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVerifiedAccessInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_deserializeOpDeleteVerifiedAccessTrustProvider) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVerifiedAccessTrustProvider) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVerifiedAccessTrustProvider(response, &metadata) - } - output := &DeleteVerifiedAccessTrustProviderOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVerifiedAccessTrustProviderOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVerifiedAccessTrustProvider(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVolume struct { -} - -func (*awsEc2query_deserializeOpDeleteVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVolume(response, &metadata) - } - output := &DeleteVolumeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpc struct { -} - -func (*awsEc2query_deserializeOpDeleteVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpc(response, &metadata) - } - output := &DeleteVpcOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_deserializeOpDeleteVpcBlockPublicAccessExclusion) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpcBlockPublicAccessExclusion) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpcBlockPublicAccessExclusion(response, &metadata) - } - output := &DeleteVpcBlockPublicAccessExclusionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVpcBlockPublicAccessExclusionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpcBlockPublicAccessExclusion(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpcEndpointConnectionNotifications struct { -} - -func (*awsEc2query_deserializeOpDeleteVpcEndpointConnectionNotifications) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpcEndpointConnectionNotifications) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpcEndpointConnectionNotifications(response, &metadata) - } - output := &DeleteVpcEndpointConnectionNotificationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVpcEndpointConnectionNotificationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpcEndpointConnectionNotifications(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpcEndpoints struct { -} - -func (*awsEc2query_deserializeOpDeleteVpcEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpcEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpcEndpoints(response, &metadata) - } - output := &DeleteVpcEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVpcEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpcEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpcEndpointServiceConfigurations struct { -} - -func (*awsEc2query_deserializeOpDeleteVpcEndpointServiceConfigurations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpcEndpointServiceConfigurations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpcEndpointServiceConfigurations(response, &metadata) - } - output := &DeleteVpcEndpointServiceConfigurationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVpcEndpointServiceConfigurationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpcEndpointServiceConfigurations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpcPeeringConnection struct { -} - -func (*awsEc2query_deserializeOpDeleteVpcPeeringConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpcPeeringConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpcPeeringConnection(response, &metadata) - } - output := &DeleteVpcPeeringConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeleteVpcPeeringConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpcPeeringConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpnConnection struct { -} - -func (*awsEc2query_deserializeOpDeleteVpnConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpnConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpnConnection(response, &metadata) - } - output := &DeleteVpnConnectionOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpnConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpnConnectionRoute struct { -} - -func (*awsEc2query_deserializeOpDeleteVpnConnectionRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpnConnectionRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpnConnectionRoute(response, &metadata) - } - output := &DeleteVpnConnectionRouteOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpnConnectionRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeleteVpnGateway struct { -} - -func (*awsEc2query_deserializeOpDeleteVpnGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeleteVpnGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeleteVpnGateway(response, &metadata) - } - output := &DeleteVpnGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeleteVpnGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeprovisionByoipCidr struct { -} - -func (*awsEc2query_deserializeOpDeprovisionByoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeprovisionByoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeprovisionByoipCidr(response, &metadata) - } - output := &DeprovisionByoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeprovisionByoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeprovisionByoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeprovisionIpamByoasn struct { -} - -func (*awsEc2query_deserializeOpDeprovisionIpamByoasn) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeprovisionIpamByoasn) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeprovisionIpamByoasn(response, &metadata) - } - output := &DeprovisionIpamByoasnOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeprovisionIpamByoasnOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeprovisionIpamByoasn(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeprovisionIpamPoolCidr struct { -} - -func (*awsEc2query_deserializeOpDeprovisionIpamPoolCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeprovisionIpamPoolCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeprovisionIpamPoolCidr(response, &metadata) - } - output := &DeprovisionIpamPoolCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeprovisionIpamPoolCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeprovisionIpamPoolCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeprovisionPublicIpv4PoolCidr struct { -} - -func (*awsEc2query_deserializeOpDeprovisionPublicIpv4PoolCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeprovisionPublicIpv4PoolCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeprovisionPublicIpv4PoolCidr(response, &metadata) - } - output := &DeprovisionPublicIpv4PoolCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeprovisionPublicIpv4PoolCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeprovisionPublicIpv4PoolCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeregisterImage struct { -} - -func (*awsEc2query_deserializeOpDeregisterImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeregisterImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeregisterImage(response, &metadata) - } - output := &DeregisterImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeregisterImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeregisterImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeregisterInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_deserializeOpDeregisterInstanceEventNotificationAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeregisterInstanceEventNotificationAttributes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeregisterInstanceEventNotificationAttributes(response, &metadata) - } - output := &DeregisterInstanceEventNotificationAttributesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeregisterInstanceEventNotificationAttributesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeregisterInstanceEventNotificationAttributes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupMembers struct { -} - -func (*awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupMembers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupMembers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeregisterTransitGatewayMulticastGroupMembers(response, &metadata) - } - output := &DeregisterTransitGatewayMulticastGroupMembersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeregisterTransitGatewayMulticastGroupMembersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeregisterTransitGatewayMulticastGroupMembers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupSources struct { -} - -func (*awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupSources) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDeregisterTransitGatewayMulticastGroupSources) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDeregisterTransitGatewayMulticastGroupSources(response, &metadata) - } - output := &DeregisterTransitGatewayMulticastGroupSourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDeregisterTransitGatewayMulticastGroupSourcesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDeregisterTransitGatewayMulticastGroupSources(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAccountAttributes struct { -} - -func (*awsEc2query_deserializeOpDescribeAccountAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAccountAttributes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAccountAttributes(response, &metadata) - } - output := &DescribeAccountAttributesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAccountAttributesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAccountAttributes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAddresses struct { -} - -func (*awsEc2query_deserializeOpDescribeAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAddresses(response, &metadata) - } - output := &DescribeAddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAddresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAddressesAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeAddressesAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAddressesAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAddressesAttribute(response, &metadata) - } - output := &DescribeAddressesAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAddressesAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAddressesAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAddressTransfers struct { -} - -func (*awsEc2query_deserializeOpDescribeAddressTransfers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAddressTransfers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAddressTransfers(response, &metadata) - } - output := &DescribeAddressTransfersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAddressTransfersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAddressTransfers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAggregateIdFormat struct { -} - -func (*awsEc2query_deserializeOpDescribeAggregateIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAggregateIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAggregateIdFormat(response, &metadata) - } - output := &DescribeAggregateIdFormatOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAggregateIdFormatOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAggregateIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAvailabilityZones struct { -} - -func (*awsEc2query_deserializeOpDescribeAvailabilityZones) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAvailabilityZones) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAvailabilityZones(response, &metadata) - } - output := &DescribeAvailabilityZonesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAvailabilityZonesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAvailabilityZones(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeAwsNetworkPerformanceMetricSubscriptions struct { -} - -func (*awsEc2query_deserializeOpDescribeAwsNetworkPerformanceMetricSubscriptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeAwsNetworkPerformanceMetricSubscriptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeAwsNetworkPerformanceMetricSubscriptions(response, &metadata) - } - output := &DescribeAwsNetworkPerformanceMetricSubscriptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeAwsNetworkPerformanceMetricSubscriptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeAwsNetworkPerformanceMetricSubscriptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeBundleTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeBundleTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeBundleTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeBundleTasks(response, &metadata) - } - output := &DescribeBundleTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeBundleTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeBundleTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeByoipCidrs struct { -} - -func (*awsEc2query_deserializeOpDescribeByoipCidrs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeByoipCidrs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeByoipCidrs(response, &metadata) - } - output := &DescribeByoipCidrsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeByoipCidrsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeByoipCidrs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionHistory(response, &metadata) - } - output := &DescribeCapacityBlockExtensionHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionHistoryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionHistory(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionOfferings(response, &metadata) - } - output := &DescribeCapacityBlockExtensionOfferingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionOfferingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionOfferings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityBlockOfferings struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityBlockOfferings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityBlockOfferings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockOfferings(response, &metadata) - } - output := &DescribeCapacityBlockOfferingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockOfferingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityBlockOfferings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityBlocks struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityBlocks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityBlocks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlocks(response, &metadata) - } - output := &DescribeCapacityBlocksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityBlocksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityBlocks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityBlockStatus struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityBlockStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityBlockStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockStatus(response, &metadata) - } - output := &DescribeCapacityBlockStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityBlockStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityReservationBillingRequests struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityReservationBillingRequests) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityReservationBillingRequests) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityReservationBillingRequests(response, &metadata) - } - output := &DescribeCapacityReservationBillingRequestsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityReservationBillingRequestsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityReservationBillingRequests(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityReservationFleets struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityReservationFleets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityReservationFleets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityReservationFleets(response, &metadata) - } - output := &DescribeCapacityReservationFleetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityReservationFleetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityReservationFleets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCapacityReservations struct { -} - -func (*awsEc2query_deserializeOpDescribeCapacityReservations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCapacityReservations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityReservations(response, &metadata) - } - output := &DescribeCapacityReservationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCapacityReservationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCapacityReservations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCarrierGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeCarrierGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCarrierGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCarrierGateways(response, &metadata) - } - output := &DescribeCarrierGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCarrierGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCarrierGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClassicLinkInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeClassicLinkInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClassicLinkInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClassicLinkInstances(response, &metadata) - } - output := &DescribeClassicLinkInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClassicLinkInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClassicLinkInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClientVpnAuthorizationRules struct { -} - -func (*awsEc2query_deserializeOpDescribeClientVpnAuthorizationRules) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClientVpnAuthorizationRules) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClientVpnAuthorizationRules(response, &metadata) - } - output := &DescribeClientVpnAuthorizationRulesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClientVpnAuthorizationRulesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClientVpnAuthorizationRules(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClientVpnConnections struct { -} - -func (*awsEc2query_deserializeOpDescribeClientVpnConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClientVpnConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClientVpnConnections(response, &metadata) - } - output := &DescribeClientVpnConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClientVpnConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClientVpnConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClientVpnEndpoints struct { -} - -func (*awsEc2query_deserializeOpDescribeClientVpnEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClientVpnEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClientVpnEndpoints(response, &metadata) - } - output := &DescribeClientVpnEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClientVpnEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClientVpnEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClientVpnRoutes struct { -} - -func (*awsEc2query_deserializeOpDescribeClientVpnRoutes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClientVpnRoutes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClientVpnRoutes(response, &metadata) - } - output := &DescribeClientVpnRoutesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClientVpnRoutesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClientVpnRoutes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeClientVpnTargetNetworks struct { -} - -func (*awsEc2query_deserializeOpDescribeClientVpnTargetNetworks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeClientVpnTargetNetworks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeClientVpnTargetNetworks(response, &metadata) - } - output := &DescribeClientVpnTargetNetworksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeClientVpnTargetNetworksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeClientVpnTargetNetworks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCoipPools struct { -} - -func (*awsEc2query_deserializeOpDescribeCoipPools) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCoipPools) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCoipPools(response, &metadata) - } - output := &DescribeCoipPoolsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCoipPoolsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCoipPools(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeConversionTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeConversionTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeConversionTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeConversionTasks(response, &metadata) - } - output := &DescribeConversionTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeConversionTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeConversionTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeCustomerGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeCustomerGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeCustomerGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeCustomerGateways(response, &metadata) - } - output := &DescribeCustomerGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeCustomerGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeCustomerGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeDeclarativePoliciesReports struct { -} - -func (*awsEc2query_deserializeOpDescribeDeclarativePoliciesReports) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeDeclarativePoliciesReports) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeDeclarativePoliciesReports(response, &metadata) - } - output := &DescribeDeclarativePoliciesReportsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeDeclarativePoliciesReportsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeDeclarativePoliciesReports(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeDhcpOptions struct { -} - -func (*awsEc2query_deserializeOpDescribeDhcpOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeDhcpOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeDhcpOptions(response, &metadata) - } - output := &DescribeDhcpOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeDhcpOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeDhcpOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeEgressOnlyInternetGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeEgressOnlyInternetGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeEgressOnlyInternetGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeEgressOnlyInternetGateways(response, &metadata) - } - output := &DescribeEgressOnlyInternetGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeEgressOnlyInternetGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeEgressOnlyInternetGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeElasticGpus struct { -} - -func (*awsEc2query_deserializeOpDescribeElasticGpus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeElasticGpus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeElasticGpus(response, &metadata) - } - output := &DescribeElasticGpusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeElasticGpusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeElasticGpus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeExportImageTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeExportImageTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeExportImageTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeExportImageTasks(response, &metadata) - } - output := &DescribeExportImageTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeExportImageTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeExportImageTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeExportTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeExportTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeExportTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeExportTasks(response, &metadata) - } - output := &DescribeExportTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeExportTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeExportTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFastLaunchImages struct { -} - -func (*awsEc2query_deserializeOpDescribeFastLaunchImages) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFastLaunchImages) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFastLaunchImages(response, &metadata) - } - output := &DescribeFastLaunchImagesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFastLaunchImagesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFastLaunchImages(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFastSnapshotRestores struct { -} - -func (*awsEc2query_deserializeOpDescribeFastSnapshotRestores) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFastSnapshotRestores) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFastSnapshotRestores(response, &metadata) - } - output := &DescribeFastSnapshotRestoresOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFastSnapshotRestoresOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFastSnapshotRestores(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFleetHistory struct { -} - -func (*awsEc2query_deserializeOpDescribeFleetHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFleetHistory) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFleetHistory(response, &metadata) - } - output := &DescribeFleetHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFleetHistoryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFleetHistory(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFleetInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeFleetInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFleetInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFleetInstances(response, &metadata) - } - output := &DescribeFleetInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFleetInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFleetInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFleets struct { -} - -func (*awsEc2query_deserializeOpDescribeFleets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFleets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFleets(response, &metadata) - } - output := &DescribeFleetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFleetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFleets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFlowLogs struct { -} - -func (*awsEc2query_deserializeOpDescribeFlowLogs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFlowLogs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFlowLogs(response, &metadata) - } - output := &DescribeFlowLogsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFlowLogsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFlowLogs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFpgaImageAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeFpgaImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFpgaImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFpgaImageAttribute(response, &metadata) - } - output := &DescribeFpgaImageAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFpgaImageAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFpgaImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeFpgaImages struct { -} - -func (*awsEc2query_deserializeOpDescribeFpgaImages) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeFpgaImages) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeFpgaImages(response, &metadata) - } - output := &DescribeFpgaImagesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeFpgaImagesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeFpgaImages(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeHostReservationOfferings struct { -} - -func (*awsEc2query_deserializeOpDescribeHostReservationOfferings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeHostReservationOfferings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeHostReservationOfferings(response, &metadata) - } - output := &DescribeHostReservationOfferingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeHostReservationOfferingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeHostReservationOfferings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeHostReservations struct { -} - -func (*awsEc2query_deserializeOpDescribeHostReservations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeHostReservations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeHostReservations(response, &metadata) - } - output := &DescribeHostReservationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeHostReservationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeHostReservations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeHosts struct { -} - -func (*awsEc2query_deserializeOpDescribeHosts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeHosts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeHosts(response, &metadata) - } - output := &DescribeHostsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeHostsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeHosts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIamInstanceProfileAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeIamInstanceProfileAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIamInstanceProfileAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIamInstanceProfileAssociations(response, &metadata) - } - output := &DescribeIamInstanceProfileAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIamInstanceProfileAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIamInstanceProfileAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIdentityIdFormat struct { -} - -func (*awsEc2query_deserializeOpDescribeIdentityIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIdentityIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIdentityIdFormat(response, &metadata) - } - output := &DescribeIdentityIdFormatOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIdentityIdFormatOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIdentityIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIdFormat struct { -} - -func (*awsEc2query_deserializeOpDescribeIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIdFormat(response, &metadata) - } - output := &DescribeIdFormatOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIdFormatOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeImageAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeImageAttribute(response, &metadata) - } - output := &DescribeImageAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeImageAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeImages struct { -} - -func (*awsEc2query_deserializeOpDescribeImages) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeImages) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeImages(response, &metadata) - } - output := &DescribeImagesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeImagesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeImages(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeImportImageTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeImportImageTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeImportImageTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeImportImageTasks(response, &metadata) - } - output := &DescribeImportImageTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeImportImageTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeImportImageTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeImportSnapshotTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeImportSnapshotTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeImportSnapshotTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeImportSnapshotTasks(response, &metadata) - } - output := &DescribeImportSnapshotTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeImportSnapshotTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeImportSnapshotTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceAttribute(response, &metadata) - } - output := &DescribeInstanceAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceConnectEndpoints struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceConnectEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceConnectEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceConnectEndpoints(response, &metadata) - } - output := &DescribeInstanceConnectEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceConnectEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceConnectEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceCreditSpecifications struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceCreditSpecifications) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(response, &metadata) - } - output := &DescribeInstanceCreditSpecificationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceCreditSpecificationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceCreditSpecifications(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceEventNotificationAttributes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(response, &metadata) - } - output := &DescribeInstanceEventNotificationAttributesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceEventNotificationAttributesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceEventNotificationAttributes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceEventWindows struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceEventWindows) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceEventWindows) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(response, &metadata) - } - output := &DescribeInstanceEventWindowsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceEventWindowsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceEventWindows(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceImageMetadata struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceImageMetadata) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceImageMetadata) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceImageMetadata(response, &metadata) - } - output := &DescribeInstanceImageMetadataOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceImageMetadataOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceImageMetadata(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstances(response, &metadata) - } - output := &DescribeInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceStatus struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceStatus(response, &metadata) - } - output := &DescribeInstanceStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceTopology struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceTopology) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceTopology) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTopology(response, &metadata) - } - output := &DescribeInstanceTopologyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceTopologyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceTopology(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceTypeOfferings struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceTypeOfferings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceTypeOfferings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(response, &metadata) - } - output := &DescribeInstanceTypeOfferingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceTypeOfferingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceTypeOfferings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInstanceTypes struct { -} - -func (*awsEc2query_deserializeOpDescribeInstanceTypes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInstanceTypes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInstanceTypes(response, &metadata) - } - output := &DescribeInstanceTypesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInstanceTypesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInstanceTypes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeInternetGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeInternetGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeInternetGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeInternetGateways(response, &metadata) - } - output := &DescribeInternetGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeInternetGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeInternetGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamByoasn struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamByoasn) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamByoasn) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamByoasn(response, &metadata) - } - output := &DescribeIpamByoasnOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamByoasnOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamByoasn(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamExternalResourceVerificationTokens struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamExternalResourceVerificationTokens) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamExternalResourceVerificationTokens) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamExternalResourceVerificationTokens(response, &metadata) - } - output := &DescribeIpamExternalResourceVerificationTokensOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamExternalResourceVerificationTokensOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamExternalResourceVerificationTokens(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamPools struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamPools) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamPools) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamPools(response, &metadata) - } - output := &DescribeIpamPoolsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamPoolsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamPools(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamResourceDiscoveries struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamResourceDiscoveries) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamResourceDiscoveries) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamResourceDiscoveries(response, &metadata) - } - output := &DescribeIpamResourceDiscoveriesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveriesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamResourceDiscoveries(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamResourceDiscoveryAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamResourceDiscoveryAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamResourceDiscoveryAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamResourceDiscoveryAssociations(response, &metadata) - } - output := &DescribeIpamResourceDiscoveryAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamResourceDiscoveryAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpams struct { -} - -func (*awsEc2query_deserializeOpDescribeIpams) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpams) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpams(response, &metadata) - } - output := &DescribeIpamsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpams(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpamScopes struct { -} - -func (*awsEc2query_deserializeOpDescribeIpamScopes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpamScopes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamScopes(response, &metadata) - } - output := &DescribeIpamScopesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpamScopes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeIpv6Pools struct { -} - -func (*awsEc2query_deserializeOpDescribeIpv6Pools) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeIpv6Pools) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeIpv6Pools(response, &metadata) - } - output := &DescribeIpv6PoolsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeIpv6Pools(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeKeyPairs struct { -} - -func (*awsEc2query_deserializeOpDescribeKeyPairs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeKeyPairs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeKeyPairs(response, &metadata) - } - output := &DescribeKeyPairsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeKeyPairs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLaunchTemplates struct { -} - -func (*awsEc2query_deserializeOpDescribeLaunchTemplates) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLaunchTemplates) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLaunchTemplates(response, &metadata) - } - output := &DescribeLaunchTemplatesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLaunchTemplates(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLaunchTemplateVersions struct { -} - -func (*awsEc2query_deserializeOpDescribeLaunchTemplateVersions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLaunchTemplateVersions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLaunchTemplateVersions(response, &metadata) - } - output := &DescribeLaunchTemplateVersionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLaunchTemplateVersions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGatewayRouteTables struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGatewayRouteTables) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGatewayRouteTables) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTables(response, &metadata) - } - output := &DescribeLocalGatewayRouteTablesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTables(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(response, &metadata) - } - output := &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVpcAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVpcAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGatewayRouteTableVpcAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTableVpcAssociations(response, &metadata) - } - output := &DescribeLocalGatewayRouteTableVpcAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGatewayRouteTableVpcAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGateways(response, &metadata) - } - output := &DescribeLocalGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaceGroups struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaceGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaceGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGatewayVirtualInterfaceGroups(response, &metadata) - } - output := &DescribeLocalGatewayVirtualInterfaceGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGatewayVirtualInterfaceGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaces struct { -} - -func (*awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaces) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLocalGatewayVirtualInterfaces) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLocalGatewayVirtualInterfaces(response, &metadata) - } - output := &DescribeLocalGatewayVirtualInterfacesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLocalGatewayVirtualInterfaces(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeLockedSnapshots struct { -} - -func (*awsEc2query_deserializeOpDescribeLockedSnapshots) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeLockedSnapshots) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeLockedSnapshots(response, &metadata) - } - output := &DescribeLockedSnapshotsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeLockedSnapshots(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeMacHosts struct { -} - -func (*awsEc2query_deserializeOpDescribeMacHosts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeMacHosts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeMacHosts(response, &metadata) - } - output := &DescribeMacHostsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeMacHosts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeMacModificationTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeMacModificationTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeMacModificationTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeMacModificationTasks(response, &metadata) - } - output := &DescribeMacModificationTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeMacModificationTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeMacModificationTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeManagedPrefixLists struct { -} - -func (*awsEc2query_deserializeOpDescribeManagedPrefixLists) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeManagedPrefixLists) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeManagedPrefixLists(response, &metadata) - } - output := &DescribeManagedPrefixListsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeManagedPrefixLists(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeMovingAddresses struct { -} - -func (*awsEc2query_deserializeOpDescribeMovingAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeMovingAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeMovingAddresses(response, &metadata) - } - output := &DescribeMovingAddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeMovingAddresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNatGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeNatGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNatGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNatGateways(response, &metadata) - } - output := &DescribeNatGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNatGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkAcls struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkAcls) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkAcls) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkAcls(response, &metadata) - } - output := &DescribeNetworkAclsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkAcls(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopeAnalyses struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopeAnalyses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopeAnalyses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInsightsAccessScopeAnalyses(response, &metadata) - } - output := &DescribeNetworkInsightsAccessScopeAnalysesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInsightsAccessScopeAnalyses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopes struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInsightsAccessScopes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInsightsAccessScopes(response, &metadata) - } - output := &DescribeNetworkInsightsAccessScopesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInsightsAccessScopes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInsightsAnalyses struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInsightsAnalyses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInsightsAnalyses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInsightsAnalyses(response, &metadata) - } - output := &DescribeNetworkInsightsAnalysesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInsightsAnalyses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInsightsPaths struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInsightsPaths) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInsightsPaths) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInsightsPaths(response, &metadata) - } - output := &DescribeNetworkInsightsPathsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInsightsPaths(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInterfaceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInterfaceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInterfaceAttribute(response, &metadata) - } - output := &DescribeNetworkInterfaceAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInterfaceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInterfacePermissions struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInterfacePermissions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInterfacePermissions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInterfacePermissions(response, &metadata) - } - output := &DescribeNetworkInterfacePermissionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInterfacePermissions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeNetworkInterfaces struct { -} - -func (*awsEc2query_deserializeOpDescribeNetworkInterfaces) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeNetworkInterfaces) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeNetworkInterfaces(response, &metadata) - } - output := &DescribeNetworkInterfacesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeNetworkInterfaces(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeOutpostLags struct { -} - -func (*awsEc2query_deserializeOpDescribeOutpostLags) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeOutpostLags) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeOutpostLags(response, &metadata) - } - output := &DescribeOutpostLagsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeOutpostLagsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeOutpostLags(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribePlacementGroups struct { -} - -func (*awsEc2query_deserializeOpDescribePlacementGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribePlacementGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribePlacementGroups(response, &metadata) - } - output := &DescribePlacementGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribePlacementGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribePrefixLists struct { -} - -func (*awsEc2query_deserializeOpDescribePrefixLists) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribePrefixLists) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribePrefixLists(response, &metadata) - } - output := &DescribePrefixListsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribePrefixLists(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribePrincipalIdFormat struct { -} - -func (*awsEc2query_deserializeOpDescribePrincipalIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribePrincipalIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribePrincipalIdFormat(response, &metadata) - } - output := &DescribePrincipalIdFormatOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribePrincipalIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribePublicIpv4Pools struct { -} - -func (*awsEc2query_deserializeOpDescribePublicIpv4Pools) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribePublicIpv4Pools) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribePublicIpv4Pools(response, &metadata) - } - output := &DescribePublicIpv4PoolsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribePublicIpv4PoolsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribePublicIpv4Pools(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeRegions struct { -} - -func (*awsEc2query_deserializeOpDescribeRegions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeRegions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeRegions(response, &metadata) - } - output := &DescribeRegionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeRegionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeRegions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeReplaceRootVolumeTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeReplaceRootVolumeTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeReplaceRootVolumeTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeReplaceRootVolumeTasks(response, &metadata) - } - output := &DescribeReplaceRootVolumeTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeReplaceRootVolumeTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeReservedInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeReservedInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeReservedInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeReservedInstances(response, &metadata) - } - output := &DescribeReservedInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeReservedInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeReservedInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeReservedInstancesListings struct { -} - -func (*awsEc2query_deserializeOpDescribeReservedInstancesListings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeReservedInstancesListings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeReservedInstancesListings(response, &metadata) - } - output := &DescribeReservedInstancesListingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeReservedInstancesListings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeReservedInstancesModifications struct { -} - -func (*awsEc2query_deserializeOpDescribeReservedInstancesModifications) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeReservedInstancesModifications) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeReservedInstancesModifications(response, &metadata) - } - output := &DescribeReservedInstancesModificationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeReservedInstancesModifications(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeReservedInstancesOfferings struct { -} - -func (*awsEc2query_deserializeOpDescribeReservedInstancesOfferings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeReservedInstancesOfferings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeReservedInstancesOfferings(response, &metadata) - } - output := &DescribeReservedInstancesOfferingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeReservedInstancesOfferingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeReservedInstancesOfferings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeRouteServerEndpoints struct { -} - -func (*awsEc2query_deserializeOpDescribeRouteServerEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeRouteServerEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeRouteServerEndpoints(response, &metadata) - } - output := &DescribeRouteServerEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeRouteServerEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeRouteServerEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeRouteServerPeers struct { -} - -func (*awsEc2query_deserializeOpDescribeRouteServerPeers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeRouteServerPeers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeRouteServerPeers(response, &metadata) - } - output := &DescribeRouteServerPeersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeRouteServerPeersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeRouteServerPeers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeRouteServers struct { -} - -func (*awsEc2query_deserializeOpDescribeRouteServers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeRouteServers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeRouteServers(response, &metadata) - } - output := &DescribeRouteServersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeRouteServersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeRouteServers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeRouteTables struct { -} - -func (*awsEc2query_deserializeOpDescribeRouteTables) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeRouteTables) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeRouteTables(response, &metadata) - } - output := &DescribeRouteTablesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeRouteTables(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeScheduledInstanceAvailability struct { -} - -func (*awsEc2query_deserializeOpDescribeScheduledInstanceAvailability) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeScheduledInstanceAvailability) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeScheduledInstanceAvailability(response, &metadata) - } - output := &DescribeScheduledInstanceAvailabilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeScheduledInstanceAvailability(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeScheduledInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeScheduledInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeScheduledInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeScheduledInstances(response, &metadata) - } - output := &DescribeScheduledInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeScheduledInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeScheduledInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSecurityGroupReferences struct { -} - -func (*awsEc2query_deserializeOpDescribeSecurityGroupReferences) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSecurityGroupReferences) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSecurityGroupReferences(response, &metadata) - } - output := &DescribeSecurityGroupReferencesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSecurityGroupReferencesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSecurityGroupReferences(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSecurityGroupRules struct { -} - -func (*awsEc2query_deserializeOpDescribeSecurityGroupRules) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSecurityGroupRules) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSecurityGroupRules(response, &metadata) - } - output := &DescribeSecurityGroupRulesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSecurityGroupRules(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSecurityGroups struct { -} - -func (*awsEc2query_deserializeOpDescribeSecurityGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSecurityGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSecurityGroups(response, &metadata) - } - output := &DescribeSecurityGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSecurityGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSecurityGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSecurityGroupVpcAssociations(response, &metadata) - } - output := &DescribeSecurityGroupVpcAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSecurityGroupVpcAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSecurityGroupVpcAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeServiceLinkVirtualInterfaces struct { -} - -func (*awsEc2query_deserializeOpDescribeServiceLinkVirtualInterfaces) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeServiceLinkVirtualInterfaces) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeServiceLinkVirtualInterfaces(response, &metadata) - } - output := &DescribeServiceLinkVirtualInterfacesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeServiceLinkVirtualInterfacesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeServiceLinkVirtualInterfaces(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSnapshotAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeSnapshotAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(response, &metadata) - } - output := &DescribeSnapshotAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSnapshots struct { -} - -func (*awsEc2query_deserializeOpDescribeSnapshots) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSnapshots) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshots(response, &metadata) - } - output := &DescribeSnapshotsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSnapshots(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSnapshotTierStatus struct { -} - -func (*awsEc2query_deserializeOpDescribeSnapshotTierStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(response, &metadata) - } - output := &DescribeSnapshotTierStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotTierStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotDatafeedSubscription struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(response, &metadata) - } - output := &DescribeSpotDatafeedSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotDatafeedSubscriptionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotFleetInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotFleetInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(response, &metadata) - } - output := &DescribeSpotFleetInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotFleetInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotFleetRequestHistory struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetRequestHistory(response, &metadata) - } - output := &DescribeSpotFleetRequestHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotFleetRequestHistoryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotFleetRequestHistory(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotFleetRequests struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotFleetRequests) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotFleetRequests) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetRequests(response, &metadata) - } - output := &DescribeSpotFleetRequestsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotFleetRequestsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotFleetRequests(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotInstanceRequests struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotInstanceRequests) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotInstanceRequests) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotInstanceRequests(response, &metadata) - } - output := &DescribeSpotInstanceRequestsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotInstanceRequestsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotInstanceRequests(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSpotPriceHistory struct { -} - -func (*awsEc2query_deserializeOpDescribeSpotPriceHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSpotPriceHistory) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotPriceHistory(response, &metadata) - } - output := &DescribeSpotPriceHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotPriceHistoryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSpotPriceHistory(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeStaleSecurityGroups struct { -} - -func (*awsEc2query_deserializeOpDescribeStaleSecurityGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeStaleSecurityGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeStaleSecurityGroups(response, &metadata) - } - output := &DescribeStaleSecurityGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeStaleSecurityGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeStaleSecurityGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeStoreImageTasks struct { -} - -func (*awsEc2query_deserializeOpDescribeStoreImageTasks) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeStoreImageTasks) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeStoreImageTasks(response, &metadata) - } - output := &DescribeStoreImageTasksOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeStoreImageTasksOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeStoreImageTasks(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeSubnets struct { -} - -func (*awsEc2query_deserializeOpDescribeSubnets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeSubnets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSubnets(response, &metadata) - } - output := &DescribeSubnetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSubnetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeSubnets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTags struct { -} - -func (*awsEc2query_deserializeOpDescribeTags) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTags) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTags(response, &metadata) - } - output := &DescribeTagsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTagsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTags(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTrafficMirrorFilterRules struct { -} - -func (*awsEc2query_deserializeOpDescribeTrafficMirrorFilterRules) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTrafficMirrorFilterRules) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTrafficMirrorFilterRules(response, &metadata) - } - output := &DescribeTrafficMirrorFilterRulesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTrafficMirrorFilterRulesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTrafficMirrorFilterRules(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTrafficMirrorFilters struct { -} - -func (*awsEc2query_deserializeOpDescribeTrafficMirrorFilters) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTrafficMirrorFilters) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTrafficMirrorFilters(response, &metadata) - } - output := &DescribeTrafficMirrorFiltersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTrafficMirrorFiltersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTrafficMirrorFilters(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTrafficMirrorSessions struct { -} - -func (*awsEc2query_deserializeOpDescribeTrafficMirrorSessions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTrafficMirrorSessions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTrafficMirrorSessions(response, &metadata) - } - output := &DescribeTrafficMirrorSessionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTrafficMirrorSessionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTrafficMirrorSessions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTrafficMirrorTargets struct { -} - -func (*awsEc2query_deserializeOpDescribeTrafficMirrorTargets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTrafficMirrorTargets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTrafficMirrorTargets(response, &metadata) - } - output := &DescribeTrafficMirrorTargetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTrafficMirrorTargetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTrafficMirrorTargets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayAttachments struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayAttachments) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayAttachments) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayAttachments(response, &metadata) - } - output := &DescribeTransitGatewayAttachmentsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayAttachmentsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayAttachments(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayConnectPeers struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayConnectPeers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayConnectPeers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayConnectPeers(response, &metadata) - } - output := &DescribeTransitGatewayConnectPeersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayConnectPeersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayConnectPeers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayConnects struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayConnects) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayConnects) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayConnects(response, &metadata) - } - output := &DescribeTransitGatewayConnectsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayConnectsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayConnects(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayMulticastDomains struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayMulticastDomains) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayMulticastDomains) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayMulticastDomains(response, &metadata) - } - output := &DescribeTransitGatewayMulticastDomainsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayMulticastDomainsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayMulticastDomains(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayPeeringAttachments struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayPeeringAttachments) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayPeeringAttachments) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayPeeringAttachments(response, &metadata) - } - output := &DescribeTransitGatewayPeeringAttachmentsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayPeeringAttachmentsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayPeeringAttachments(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayPolicyTables struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayPolicyTables) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayPolicyTables) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayPolicyTables(response, &metadata) - } - output := &DescribeTransitGatewayPolicyTablesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayPolicyTablesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayPolicyTables(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayRouteTableAnnouncements struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayRouteTableAnnouncements) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayRouteTableAnnouncements) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayRouteTableAnnouncements(response, &metadata) - } - output := &DescribeTransitGatewayRouteTableAnnouncementsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayRouteTableAnnouncementsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayRouteTableAnnouncements(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayRouteTables struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayRouteTables) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayRouteTables) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayRouteTables(response, &metadata) - } - output := &DescribeTransitGatewayRouteTablesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayRouteTablesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayRouteTables(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGateways(response, &metadata) - } - output := &DescribeTransitGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTransitGatewayVpcAttachments struct { -} - -func (*awsEc2query_deserializeOpDescribeTransitGatewayVpcAttachments) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTransitGatewayVpcAttachments) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTransitGatewayVpcAttachments(response, &metadata) - } - output := &DescribeTransitGatewayVpcAttachmentsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTransitGatewayVpcAttachmentsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTransitGatewayVpcAttachments(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeTrunkInterfaceAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeTrunkInterfaceAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeTrunkInterfaceAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeTrunkInterfaceAssociations(response, &metadata) - } - output := &DescribeTrunkInterfaceAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeTrunkInterfaceAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeTrunkInterfaceAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVerifiedAccessEndpoints struct { -} - -func (*awsEc2query_deserializeOpDescribeVerifiedAccessEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVerifiedAccessEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVerifiedAccessEndpoints(response, &metadata) - } - output := &DescribeVerifiedAccessEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVerifiedAccessEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVerifiedAccessEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVerifiedAccessGroups struct { -} - -func (*awsEc2query_deserializeOpDescribeVerifiedAccessGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVerifiedAccessGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVerifiedAccessGroups(response, &metadata) - } - output := &DescribeVerifiedAccessGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVerifiedAccessGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVerifiedAccessGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVerifiedAccessInstanceLoggingConfigurations struct { -} - -func (*awsEc2query_deserializeOpDescribeVerifiedAccessInstanceLoggingConfigurations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVerifiedAccessInstanceLoggingConfigurations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVerifiedAccessInstanceLoggingConfigurations(response, &metadata) - } - output := &DescribeVerifiedAccessInstanceLoggingConfigurationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVerifiedAccessInstanceLoggingConfigurationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVerifiedAccessInstanceLoggingConfigurations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVerifiedAccessInstances struct { -} - -func (*awsEc2query_deserializeOpDescribeVerifiedAccessInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVerifiedAccessInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVerifiedAccessInstances(response, &metadata) - } - output := &DescribeVerifiedAccessInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVerifiedAccessInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVerifiedAccessInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVerifiedAccessTrustProviders struct { -} - -func (*awsEc2query_deserializeOpDescribeVerifiedAccessTrustProviders) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVerifiedAccessTrustProviders) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVerifiedAccessTrustProviders(response, &metadata) - } - output := &DescribeVerifiedAccessTrustProvidersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVerifiedAccessTrustProvidersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVerifiedAccessTrustProviders(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVolumeAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeVolumeAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVolumeAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVolumeAttribute(response, &metadata) - } - output := &DescribeVolumeAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVolumeAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVolumeAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVolumes struct { -} - -func (*awsEc2query_deserializeOpDescribeVolumes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVolumes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVolumes(response, &metadata) - } - output := &DescribeVolumesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVolumesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVolumes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVolumesModifications struct { -} - -func (*awsEc2query_deserializeOpDescribeVolumesModifications) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVolumesModifications) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVolumesModifications(response, &metadata) - } - output := &DescribeVolumesModificationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVolumesModificationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVolumesModifications(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVolumeStatus struct { -} - -func (*awsEc2query_deserializeOpDescribeVolumeStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVolumeStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVolumeStatus(response, &metadata) - } - output := &DescribeVolumeStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVolumeStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVolumeStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcAttribute struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcAttribute(response, &metadata) - } - output := &DescribeVpcAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcBlockPublicAccessExclusions struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcBlockPublicAccessExclusions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcBlockPublicAccessExclusions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcBlockPublicAccessExclusions(response, &metadata) - } - output := &DescribeVpcBlockPublicAccessExclusionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcBlockPublicAccessExclusionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcBlockPublicAccessExclusions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcBlockPublicAccessOptions struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcBlockPublicAccessOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcBlockPublicAccessOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcBlockPublicAccessOptions(response, &metadata) - } - output := &DescribeVpcBlockPublicAccessOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcBlockPublicAccessOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcBlockPublicAccessOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcClassicLink struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcClassicLink) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcClassicLink) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcClassicLink(response, &metadata) - } - output := &DescribeVpcClassicLinkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcClassicLinkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcClassicLink(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcClassicLinkDnsSupport) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcClassicLinkDnsSupport) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcClassicLinkDnsSupport(response, &metadata) - } - output := &DescribeVpcClassicLinkDnsSupportOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcClassicLinkDnsSupportOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcClassicLinkDnsSupport(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointAssociations struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointAssociations(response, &metadata) - } - output := &DescribeVpcEndpointAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointConnectionNotifications struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointConnectionNotifications) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointConnectionNotifications) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointConnectionNotifications(response, &metadata) - } - output := &DescribeVpcEndpointConnectionNotificationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointConnectionNotificationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointConnectionNotifications(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointConnections struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointConnections(response, &metadata) - } - output := &DescribeVpcEndpointConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpoints struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpoints) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpoints) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpoints(response, &metadata) - } - output := &DescribeVpcEndpointsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpoints(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointServiceConfigurations struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointServiceConfigurations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointServiceConfigurations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointServiceConfigurations(response, &metadata) - } - output := &DescribeVpcEndpointServiceConfigurationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointServiceConfigurationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointServiceConfigurations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointServicePermissions struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointServicePermissions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointServicePermissions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointServicePermissions(response, &metadata) - } - output := &DescribeVpcEndpointServicePermissionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointServicePermissionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointServicePermissions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcEndpointServices struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcEndpointServices) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcEndpointServices) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcEndpointServices(response, &metadata) - } - output := &DescribeVpcEndpointServicesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcEndpointServicesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcEndpointServices(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcPeeringConnections struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcPeeringConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcPeeringConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcPeeringConnections(response, &metadata) - } - output := &DescribeVpcPeeringConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcPeeringConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcPeeringConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpcs struct { -} - -func (*awsEc2query_deserializeOpDescribeVpcs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpcs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpcs(response, &metadata) - } - output := &DescribeVpcsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpcsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpcs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpnConnections struct { -} - -func (*awsEc2query_deserializeOpDescribeVpnConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpnConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpnConnections(response, &metadata) - } - output := &DescribeVpnConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpnConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpnConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDescribeVpnGateways struct { -} - -func (*awsEc2query_deserializeOpDescribeVpnGateways) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDescribeVpnGateways) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeVpnGateways(response, &metadata) - } - output := &DescribeVpnGatewaysOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeVpnGatewaysOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDescribeVpnGateways(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachClassicLinkVpc struct { -} - -func (*awsEc2query_deserializeOpDetachClassicLinkVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachClassicLinkVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachClassicLinkVpc(response, &metadata) - } - output := &DetachClassicLinkVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDetachClassicLinkVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachClassicLinkVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachInternetGateway struct { -} - -func (*awsEc2query_deserializeOpDetachInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachInternetGateway(response, &metadata) - } - output := &DetachInternetGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachInternetGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachNetworkInterface struct { -} - -func (*awsEc2query_deserializeOpDetachNetworkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachNetworkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachNetworkInterface(response, &metadata) - } - output := &DetachNetworkInterfaceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachNetworkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_deserializeOpDetachVerifiedAccessTrustProvider) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachVerifiedAccessTrustProvider) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachVerifiedAccessTrustProvider(response, &metadata) - } - output := &DetachVerifiedAccessTrustProviderOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDetachVerifiedAccessTrustProviderOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachVerifiedAccessTrustProvider(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachVolume struct { -} - -func (*awsEc2query_deserializeOpDetachVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachVolume(response, &metadata) - } - output := &DetachVolumeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDetachVolumeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDetachVpnGateway struct { -} - -func (*awsEc2query_deserializeOpDetachVpnGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDetachVpnGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDetachVpnGateway(response, &metadata) - } - output := &DetachVpnGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDetachVpnGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableAddressTransfer struct { -} - -func (*awsEc2query_deserializeOpDisableAddressTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableAddressTransfer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableAddressTransfer(response, &metadata) - } - output := &DisableAddressTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableAddressTransferOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableAddressTransfer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableAllowedImagesSettings struct { -} - -func (*awsEc2query_deserializeOpDisableAllowedImagesSettings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableAllowedImagesSettings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableAllowedImagesSettings(response, &metadata) - } - output := &DisableAllowedImagesSettingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableAllowedImagesSettingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableAllowedImagesSettings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableAwsNetworkPerformanceMetricSubscription struct { -} - -func (*awsEc2query_deserializeOpDisableAwsNetworkPerformanceMetricSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableAwsNetworkPerformanceMetricSubscription) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableAwsNetworkPerformanceMetricSubscription(response, &metadata) - } - output := &DisableAwsNetworkPerformanceMetricSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableAwsNetworkPerformanceMetricSubscriptionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableAwsNetworkPerformanceMetricSubscription(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableEbsEncryptionByDefault struct { -} - -func (*awsEc2query_deserializeOpDisableEbsEncryptionByDefault) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableEbsEncryptionByDefault) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableEbsEncryptionByDefault(response, &metadata) - } - output := &DisableEbsEncryptionByDefaultOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableEbsEncryptionByDefaultOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableEbsEncryptionByDefault(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableFastLaunch struct { -} - -func (*awsEc2query_deserializeOpDisableFastLaunch) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableFastLaunch) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableFastLaunch(response, &metadata) - } - output := &DisableFastLaunchOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableFastLaunchOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableFastLaunch(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableFastSnapshotRestores struct { -} - -func (*awsEc2query_deserializeOpDisableFastSnapshotRestores) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableFastSnapshotRestores) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableFastSnapshotRestores(response, &metadata) - } - output := &DisableFastSnapshotRestoresOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableFastSnapshotRestoresOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableFastSnapshotRestores(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableImage struct { -} - -func (*awsEc2query_deserializeOpDisableImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableImage(response, &metadata) - } - output := &DisableImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableImageBlockPublicAccess struct { -} - -func (*awsEc2query_deserializeOpDisableImageBlockPublicAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableImageBlockPublicAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableImageBlockPublicAccess(response, &metadata) - } - output := &DisableImageBlockPublicAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableImageBlockPublicAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableImageBlockPublicAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableImageDeprecation struct { -} - -func (*awsEc2query_deserializeOpDisableImageDeprecation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableImageDeprecation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableImageDeprecation(response, &metadata) - } - output := &DisableImageDeprecationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableImageDeprecationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableImageDeprecation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableImageDeregistrationProtection struct { -} - -func (*awsEc2query_deserializeOpDisableImageDeregistrationProtection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableImageDeregistrationProtection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableImageDeregistrationProtection(response, &metadata) - } - output := &DisableImageDeregistrationProtectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableImageDeregistrationProtectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableImageDeregistrationProtection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableIpamOrganizationAdminAccount struct { -} - -func (*awsEc2query_deserializeOpDisableIpamOrganizationAdminAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableIpamOrganizationAdminAccount) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableIpamOrganizationAdminAccount(response, &metadata) - } - output := &DisableIpamOrganizationAdminAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableIpamOrganizationAdminAccountOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableIpamOrganizationAdminAccount(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableRouteServerPropagation struct { -} - -func (*awsEc2query_deserializeOpDisableRouteServerPropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableRouteServerPropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableRouteServerPropagation(response, &metadata) - } - output := &DisableRouteServerPropagationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableRouteServerPropagationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableRouteServerPropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableSerialConsoleAccess struct { -} - -func (*awsEc2query_deserializeOpDisableSerialConsoleAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableSerialConsoleAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableSerialConsoleAccess(response, &metadata) - } - output := &DisableSerialConsoleAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableSerialConsoleAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableSerialConsoleAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess struct { -} - -func (*awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableSnapshotBlockPublicAccess(response, &metadata) - } - output := &DisableSnapshotBlockPublicAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableSnapshotBlockPublicAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableSnapshotBlockPublicAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableTransitGatewayRouteTablePropagation struct { -} - -func (*awsEc2query_deserializeOpDisableTransitGatewayRouteTablePropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableTransitGatewayRouteTablePropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableTransitGatewayRouteTablePropagation(response, &metadata) - } - output := &DisableTransitGatewayRouteTablePropagationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableTransitGatewayRouteTablePropagationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableTransitGatewayRouteTablePropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableVgwRoutePropagation struct { -} - -func (*awsEc2query_deserializeOpDisableVgwRoutePropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableVgwRoutePropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableVgwRoutePropagation(response, &metadata) - } - output := &DisableVgwRoutePropagationOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableVgwRoutePropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableVpcClassicLink struct { -} - -func (*awsEc2query_deserializeOpDisableVpcClassicLink) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableVpcClassicLink) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableVpcClassicLink(response, &metadata) - } - output := &DisableVpcClassicLinkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableVpcClassicLinkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableVpcClassicLink(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisableVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_deserializeOpDisableVpcClassicLinkDnsSupport) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisableVpcClassicLinkDnsSupport) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisableVpcClassicLinkDnsSupport(response, &metadata) - } - output := &DisableVpcClassicLinkDnsSupportOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisableVpcClassicLinkDnsSupportOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisableVpcClassicLinkDnsSupport(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateAddress struct { -} - -func (*awsEc2query_deserializeOpDisassociateAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateAddress(response, &metadata) - } - output := &DisassociateAddressOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateCapacityReservationBillingOwner struct { -} - -func (*awsEc2query_deserializeOpDisassociateCapacityReservationBillingOwner) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateCapacityReservationBillingOwner) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateCapacityReservationBillingOwner(response, &metadata) - } - output := &DisassociateCapacityReservationBillingOwnerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateCapacityReservationBillingOwnerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateCapacityReservationBillingOwner(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateClientVpnTargetNetwork struct { -} - -func (*awsEc2query_deserializeOpDisassociateClientVpnTargetNetwork) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateClientVpnTargetNetwork) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateClientVpnTargetNetwork(response, &metadata) - } - output := &DisassociateClientVpnTargetNetworkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateClientVpnTargetNetworkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateClientVpnTargetNetwork(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateEnclaveCertificateIamRole struct { -} - -func (*awsEc2query_deserializeOpDisassociateEnclaveCertificateIamRole) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateEnclaveCertificateIamRole) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateEnclaveCertificateIamRole(response, &metadata) - } - output := &DisassociateEnclaveCertificateIamRoleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateEnclaveCertificateIamRoleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateEnclaveCertificateIamRole(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateIamInstanceProfile struct { -} - -func (*awsEc2query_deserializeOpDisassociateIamInstanceProfile) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateIamInstanceProfile) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateIamInstanceProfile(response, &metadata) - } - output := &DisassociateIamInstanceProfileOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateIamInstanceProfileOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateIamInstanceProfile(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateInstanceEventWindow struct { -} - -func (*awsEc2query_deserializeOpDisassociateInstanceEventWindow) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateInstanceEventWindow) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateInstanceEventWindow(response, &metadata) - } - output := &DisassociateInstanceEventWindowOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateInstanceEventWindowOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateInstanceEventWindow(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateIpamByoasn struct { -} - -func (*awsEc2query_deserializeOpDisassociateIpamByoasn) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateIpamByoasn) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateIpamByoasn(response, &metadata) - } - output := &DisassociateIpamByoasnOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateIpamByoasnOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateIpamByoasn(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateIpamResourceDiscovery struct { -} - -func (*awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(response, &metadata) - } - output := &DisassociateIpamResourceDiscoveryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateIpamResourceDiscoveryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateNatGatewayAddress struct { -} - -func (*awsEc2query_deserializeOpDisassociateNatGatewayAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateNatGatewayAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateNatGatewayAddress(response, &metadata) - } - output := &DisassociateNatGatewayAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateNatGatewayAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateNatGatewayAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateRouteServer struct { -} - -func (*awsEc2query_deserializeOpDisassociateRouteServer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateRouteServer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateRouteServer(response, &metadata) - } - output := &DisassociateRouteServerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateRouteServerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateRouteServer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateRouteTable struct { -} - -func (*awsEc2query_deserializeOpDisassociateRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateRouteTable(response, &metadata) - } - output := &DisassociateRouteTableOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateSecurityGroupVpc struct { -} - -func (*awsEc2query_deserializeOpDisassociateSecurityGroupVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateSecurityGroupVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateSecurityGroupVpc(response, &metadata) - } - output := &DisassociateSecurityGroupVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateSecurityGroupVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateSecurityGroupVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateSubnetCidrBlock struct { -} - -func (*awsEc2query_deserializeOpDisassociateSubnetCidrBlock) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(response, &metadata) - } - output := &DisassociateSubnetCidrBlockOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateSubnetCidrBlockOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(response, &metadata) - } - output := &DisassociateTransitGatewayMulticastDomainOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayMulticastDomainOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(response, &metadata) - } - output := &DisassociateTransitGatewayPolicyTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayPolicyTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(response, &metadata) - } - output := &DisassociateTransitGatewayRouteTableOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayRouteTableOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateTrunkInterface struct { -} - -func (*awsEc2query_deserializeOpDisassociateTrunkInterface) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTrunkInterface(response, &metadata) - } - output := &DisassociateTrunkInterfaceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTrunkInterfaceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateTrunkInterface(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpDisassociateVpcCidrBlock struct { -} - -func (*awsEc2query_deserializeOpDisassociateVpcCidrBlock) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(response, &metadata) - } - output := &DisassociateVpcCidrBlockOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateVpcCidrBlockOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableAddressTransfer struct { -} - -func (*awsEc2query_deserializeOpEnableAddressTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableAddressTransfer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableAddressTransfer(response, &metadata) - } - output := &EnableAddressTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableAddressTransferOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableAddressTransfer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableAllowedImagesSettings struct { -} - -func (*awsEc2query_deserializeOpEnableAllowedImagesSettings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableAllowedImagesSettings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableAllowedImagesSettings(response, &metadata) - } - output := &EnableAllowedImagesSettingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableAllowedImagesSettingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableAllowedImagesSettings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription struct { -} - -func (*awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(response, &metadata) - } - output := &EnableAwsNetworkPerformanceMetricSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableEbsEncryptionByDefault struct { -} - -func (*awsEc2query_deserializeOpEnableEbsEncryptionByDefault) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(response, &metadata) - } - output := &EnableEbsEncryptionByDefaultOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableEbsEncryptionByDefaultOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableFastLaunch struct { -} - -func (*awsEc2query_deserializeOpEnableFastLaunch) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableFastLaunch) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableFastLaunch(response, &metadata) - } - output := &EnableFastLaunchOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableFastLaunchOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableFastLaunch(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableFastSnapshotRestores struct { -} - -func (*awsEc2query_deserializeOpEnableFastSnapshotRestores) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response, &metadata) - } - output := &EnableFastSnapshotRestoresOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableFastSnapshotRestoresOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableImage struct { -} - -func (*awsEc2query_deserializeOpEnableImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImage(response, &metadata) - } - output := &EnableImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableImageBlockPublicAccess struct { -} - -func (*awsEc2query_deserializeOpEnableImageBlockPublicAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(response, &metadata) - } - output := &EnableImageBlockPublicAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageBlockPublicAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableImageDeprecation struct { -} - -func (*awsEc2query_deserializeOpEnableImageDeprecation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableImageDeprecation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeprecation(response, &metadata) - } - output := &EnableImageDeprecationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageDeprecationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableImageDeprecation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableImageDeregistrationProtection struct { -} - -func (*awsEc2query_deserializeOpEnableImageDeregistrationProtection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(response, &metadata) - } - output := &EnableImageDeregistrationProtectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageDeregistrationProtectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount struct { -} - -func (*awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(response, &metadata) - } - output := &EnableIpamOrganizationAdminAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableIpamOrganizationAdminAccountOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing struct { -} - -func (*awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(response, &metadata) - } - output := &EnableReachabilityAnalyzerOrganizationSharingOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableRouteServerPropagation struct { -} - -func (*awsEc2query_deserializeOpEnableRouteServerPropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableRouteServerPropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableRouteServerPropagation(response, &metadata) - } - output := &EnableRouteServerPropagationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableRouteServerPropagationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableRouteServerPropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableSerialConsoleAccess struct { -} - -func (*awsEc2query_deserializeOpEnableSerialConsoleAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response, &metadata) - } - output := &EnableSerialConsoleAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableSerialConsoleAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess struct { -} - -func (*awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response, &metadata) - } - output := &EnableSnapshotBlockPublicAccessOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation struct { -} - -func (*awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(response, &metadata) - } - output := &EnableTransitGatewayRouteTablePropagationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableTransitGatewayRouteTablePropagationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableVgwRoutePropagation struct { -} - -func (*awsEc2query_deserializeOpEnableVgwRoutePropagation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableVgwRoutePropagation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(response, &metadata) - } - output := &EnableVgwRoutePropagationOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableVolumeIO struct { -} - -func (*awsEc2query_deserializeOpEnableVolumeIO) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableVolumeIO) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVolumeIO(response, &metadata) - } - output := &EnableVolumeIOOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableVolumeIO(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableVpcClassicLink struct { -} - -func (*awsEc2query_deserializeOpEnableVpcClassicLink) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableVpcClassicLink) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLink(response, &metadata) - } - output := &EnableVpcClassicLinkOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableVpcClassicLinkOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableVpcClassicLink(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(response, &metadata) - } - output := &EnableVpcClassicLinkDnsSupportOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableVpcClassicLinkDnsSupportOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList struct { -} - -func (*awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(response, &metadata) - } - output := &ExportClientVpnClientCertificateRevocationListOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportClientVpnClientCertificateRevocationListOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpExportClientVpnClientConfiguration struct { -} - -func (*awsEc2query_deserializeOpExportClientVpnClientConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(response, &metadata) - } - output := &ExportClientVpnClientConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportClientVpnClientConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpExportImage struct { -} - -func (*awsEc2query_deserializeOpExportImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpExportImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportImage(response, &metadata) - } - output := &ExportImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorExportImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpExportTransitGatewayRoutes struct { -} - -func (*awsEc2query_deserializeOpExportTransitGatewayRoutes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(response, &metadata) - } - output := &ExportTransitGatewayRoutesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportTransitGatewayRoutesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpExportVerifiedAccessInstanceClientConfiguration struct { -} - -func (*awsEc2query_deserializeOpExportVerifiedAccessInstanceClientConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpExportVerifiedAccessInstanceClientConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportVerifiedAccessInstanceClientConfiguration(response, &metadata) - } - output := &ExportVerifiedAccessInstanceClientConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportVerifiedAccessInstanceClientConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorExportVerifiedAccessInstanceClientConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetActiveVpnTunnelStatus struct { -} - -func (*awsEc2query_deserializeOpGetActiveVpnTunnelStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetActiveVpnTunnelStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetActiveVpnTunnelStatus(response, &metadata) - } - output := &GetActiveVpnTunnelStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetActiveVpnTunnelStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetActiveVpnTunnelStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetAllowedImagesSettings struct { -} - -func (*awsEc2query_deserializeOpGetAllowedImagesSettings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetAllowedImagesSettings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAllowedImagesSettings(response, &metadata) - } - output := &GetAllowedImagesSettingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAllowedImagesSettingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetAllowedImagesSettings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles struct { -} - -func (*awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(response, &metadata) - } - output := &GetAssociatedEnclaveCertificateIamRolesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAssociatedEnclaveCertificateIamRolesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs struct { -} - -func (*awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(response, &metadata) - } - output := &GetAssociatedIpv6PoolCidrsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAssociatedIpv6PoolCidrsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetAwsNetworkPerformanceData struct { -} - -func (*awsEc2query_deserializeOpGetAwsNetworkPerformanceData) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(response, &metadata) - } - output := &GetAwsNetworkPerformanceDataOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAwsNetworkPerformanceDataOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetCapacityReservationUsage struct { -} - -func (*awsEc2query_deserializeOpGetCapacityReservationUsage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetCapacityReservationUsage(response, &metadata) - } - output := &GetCapacityReservationUsageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetCapacityReservationUsageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetCapacityReservationUsage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetCoipPoolUsage struct { -} - -func (*awsEc2query_deserializeOpGetCoipPoolUsage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetCoipPoolUsage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetCoipPoolUsage(response, &metadata) - } - output := &GetCoipPoolUsageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetCoipPoolUsageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetCoipPoolUsage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetConsoleOutput struct { -} - -func (*awsEc2query_deserializeOpGetConsoleOutput) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetConsoleOutput) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetConsoleOutput(response, &metadata) - } - output := &GetConsoleOutputOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetConsoleOutputOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetConsoleOutput(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetConsoleScreenshot struct { -} - -func (*awsEc2query_deserializeOpGetConsoleScreenshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetConsoleScreenshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetConsoleScreenshot(response, &metadata) - } - output := &GetConsoleScreenshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetConsoleScreenshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetConsoleScreenshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetDeclarativePoliciesReportSummary struct { -} - -func (*awsEc2query_deserializeOpGetDeclarativePoliciesReportSummary) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetDeclarativePoliciesReportSummary) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetDeclarativePoliciesReportSummary(response, &metadata) - } - output := &GetDeclarativePoliciesReportSummaryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetDeclarativePoliciesReportSummaryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetDeclarativePoliciesReportSummary(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetDefaultCreditSpecification struct { -} - -func (*awsEc2query_deserializeOpGetDefaultCreditSpecification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(response, &metadata) - } - output := &GetDefaultCreditSpecificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetDefaultCreditSpecificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(response, &metadata) - } - output := &GetEbsDefaultKmsKeyIdOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetEbsDefaultKmsKeyIdOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetEbsEncryptionByDefault struct { -} - -func (*awsEc2query_deserializeOpGetEbsEncryptionByDefault) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(response, &metadata) - } - output := &GetEbsEncryptionByDefaultOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetEbsEncryptionByDefaultOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate struct { -} - -func (*awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(response, &metadata) - } - output := &GetFlowLogsIntegrationTemplateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetFlowLogsIntegrationTemplateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetGroupsForCapacityReservation struct { -} - -func (*awsEc2query_deserializeOpGetGroupsForCapacityReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(response, &metadata) - } - output := &GetGroupsForCapacityReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetGroupsForCapacityReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetHostReservationPurchasePreview struct { -} - -func (*awsEc2query_deserializeOpGetHostReservationPurchasePreview) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(response, &metadata) - } - output := &GetHostReservationPurchasePreviewOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetHostReservationPurchasePreviewOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetImageBlockPublicAccessState struct { -} - -func (*awsEc2query_deserializeOpGetImageBlockPublicAccessState) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(response, &metadata) - } - output := &GetImageBlockPublicAccessStateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetImageBlockPublicAccessStateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetInstanceMetadataDefaults struct { -} - -func (*awsEc2query_deserializeOpGetInstanceMetadataDefaults) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response, &metadata) - } - output := &GetInstanceMetadataDefaultsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceMetadataDefaultsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetInstanceTpmEkPub struct { -} - -func (*awsEc2query_deserializeOpGetInstanceTpmEkPub) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response, &metadata) - } - output := &GetInstanceTpmEkPubOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements struct { -} - -func (*awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(response, &metadata) - } - output := &GetInstanceTypesFromInstanceRequirementsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceTypesFromInstanceRequirementsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetInstanceUefiData struct { -} - -func (*awsEc2query_deserializeOpGetInstanceUefiData) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetInstanceUefiData) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceUefiData(response, &metadata) - } - output := &GetInstanceUefiDataOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceUefiDataOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetInstanceUefiData(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamAddressHistory struct { -} - -func (*awsEc2query_deserializeOpGetIpamAddressHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamAddressHistory) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamAddressHistory(response, &metadata) - } - output := &GetIpamAddressHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamAddressHistoryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamAddressHistory(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamDiscoveredAccounts struct { -} - -func (*awsEc2query_deserializeOpGetIpamDiscoveredAccounts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response, &metadata) - } - output := &GetIpamDiscoveredAccountsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredAccountsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses struct { -} - -func (*awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response, &metadata) - } - output := &GetIpamDiscoveredPublicAddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs struct { -} - -func (*awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(response, &metadata) - } - output := &GetIpamDiscoveredResourceCidrsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredResourceCidrsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamPoolAllocations struct { -} - -func (*awsEc2query_deserializeOpGetIpamPoolAllocations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolAllocations(response, &metadata) - } - output := &GetIpamPoolAllocationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamPoolAllocationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamPoolAllocations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamPoolCidrs struct { -} - -func (*awsEc2query_deserializeOpGetIpamPoolCidrs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolCidrs(response, &metadata) - } - output := &GetIpamPoolCidrsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamPoolCidrsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamPoolCidrs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetIpamResourceCidrs struct { -} - -func (*awsEc2query_deserializeOpGetIpamResourceCidrs) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamResourceCidrs(response, &metadata) - } - output := &GetIpamResourceCidrsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamResourceCidrsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetIpamResourceCidrs(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetLaunchTemplateData struct { -} - -func (*awsEc2query_deserializeOpGetLaunchTemplateData) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetLaunchTemplateData) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetLaunchTemplateData(response, &metadata) - } - output := &GetLaunchTemplateDataOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetLaunchTemplateDataOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetLaunchTemplateData(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetManagedPrefixListAssociations struct { -} - -func (*awsEc2query_deserializeOpGetManagedPrefixListAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(response, &metadata) - } - output := &GetManagedPrefixListAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetManagedPrefixListAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetManagedPrefixListEntries struct { -} - -func (*awsEc2query_deserializeOpGetManagedPrefixListEntries) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(response, &metadata) - } - output := &GetManagedPrefixListEntriesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetManagedPrefixListEntriesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings struct { -} - -func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(response, &metadata) - } - output := &GetNetworkInsightsAccessScopeAnalysisFindingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent struct { -} - -func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(response, &metadata) - } - output := &GetNetworkInsightsAccessScopeContentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeContentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetPasswordData struct { -} - -func (*awsEc2query_deserializeOpGetPasswordData) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetPasswordData) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetPasswordData(response, &metadata) - } - output := &GetPasswordDataOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetPasswordDataOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetPasswordData(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetReservedInstancesExchangeQuote struct { -} - -func (*awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(response, &metadata) - } - output := &GetReservedInstancesExchangeQuoteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetReservedInstancesExchangeQuoteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetRouteServerAssociations struct { -} - -func (*awsEc2query_deserializeOpGetRouteServerAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetRouteServerAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetRouteServerAssociations(response, &metadata) - } - output := &GetRouteServerAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetRouteServerAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetRouteServerAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetRouteServerPropagations struct { -} - -func (*awsEc2query_deserializeOpGetRouteServerPropagations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetRouteServerPropagations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetRouteServerPropagations(response, &metadata) - } - output := &GetRouteServerPropagationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetRouteServerPropagationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetRouteServerPropagations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetRouteServerRoutingDatabase struct { -} - -func (*awsEc2query_deserializeOpGetRouteServerRoutingDatabase) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetRouteServerRoutingDatabase) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetRouteServerRoutingDatabase(response, &metadata) - } - output := &GetRouteServerRoutingDatabaseOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetRouteServerRoutingDatabaseOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetRouteServerRoutingDatabase(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetSecurityGroupsForVpc struct { -} - -func (*awsEc2query_deserializeOpGetSecurityGroupsForVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(response, &metadata) - } - output := &GetSecurityGroupsForVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSecurityGroupsForVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetSerialConsoleAccessStatus struct { -} - -func (*awsEc2query_deserializeOpGetSerialConsoleAccessStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response, &metadata) - } - output := &GetSerialConsoleAccessStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSerialConsoleAccessStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState struct { -} - -func (*awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response, &metadata) - } - output := &GetSnapshotBlockPublicAccessStateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetSpotPlacementScores struct { -} - -func (*awsEc2query_deserializeOpGetSpotPlacementScores) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetSpotPlacementScores) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSpotPlacementScores(response, &metadata) - } - output := &GetSpotPlacementScoresOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSpotPlacementScoresOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetSpotPlacementScores(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetSubnetCidrReservations struct { -} - -func (*awsEc2query_deserializeOpGetSubnetCidrReservations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSubnetCidrReservations(response, &metadata) - } - output := &GetSubnetCidrReservationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSubnetCidrReservationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetSubnetCidrReservations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(response, &metadata) - } - output := &GetTransitGatewayAttachmentPropagationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayAttachmentPropagationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(response, &metadata) - } - output := &GetTransitGatewayMulticastDomainAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayMulticastDomainAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(response, &metadata) - } - output := &GetTransitGatewayPolicyTableAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(response, &metadata) - } - output := &GetTransitGatewayPolicyTableEntriesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableEntriesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(response, &metadata) - } - output := &GetTransitGatewayPrefixListReferencesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPrefixListReferencesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(response, &metadata) - } - output := &GetTransitGatewayRouteTableAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTableAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations struct { -} - -func (*awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(response, &metadata) - } - output := &GetTransitGatewayRouteTablePropagationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTablePropagationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy struct { -} - -func (*awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(response, &metadata) - } - output := &GetVerifiedAccessEndpointPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointPolicyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVerifiedAccessEndpointTargets struct { -} - -func (*awsEc2query_deserializeOpGetVerifiedAccessEndpointTargets) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointTargets) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointTargets(response, &metadata) - } - output := &GetVerifiedAccessEndpointTargetsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointTargetsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointTargets(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy struct { -} - -func (*awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(response, &metadata) - } - output := &GetVerifiedAccessGroupPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVerifiedAccessGroupPolicyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration struct { -} - -func (*awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(response, &metadata) - } - output := &GetVpnConnectionDeviceSampleConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceSampleConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVpnConnectionDeviceTypes struct { -} - -func (*awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response, &metadata) - } - output := &GetVpnConnectionDeviceTypesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceTypesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpGetVpnTunnelReplacementStatus struct { -} - -func (*awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response, &metadata) - } - output := &GetVpnTunnelReplacementStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList struct { -} - -func (*awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(response, &metadata) - } - output := &ImportClientVpnClientCertificateRevocationListOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportClientVpnClientCertificateRevocationListOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportImage struct { -} - -func (*awsEc2query_deserializeOpImportImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportImage(response, &metadata) - } - output := &ImportImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportInstance struct { -} - -func (*awsEc2query_deserializeOpImportInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportInstance(response, &metadata) - } - output := &ImportInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportKeyPair struct { -} - -func (*awsEc2query_deserializeOpImportKeyPair) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportKeyPair) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportKeyPair(response, &metadata) - } - output := &ImportKeyPairOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportKeyPairOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportKeyPair(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportSnapshot struct { -} - -func (*awsEc2query_deserializeOpImportSnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportSnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportSnapshot(response, &metadata) - } - output := &ImportSnapshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportSnapshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportSnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpImportVolume struct { -} - -func (*awsEc2query_deserializeOpImportVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpImportVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportVolume(response, &metadata) - } - output := &ImportVolumeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportVolumeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorImportVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpListImagesInRecycleBin struct { -} - -func (*awsEc2query_deserializeOpListImagesInRecycleBin) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpListImagesInRecycleBin) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorListImagesInRecycleBin(response, &metadata) - } - output := &ListImagesInRecycleBinOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentListImagesInRecycleBinOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorListImagesInRecycleBin(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpListSnapshotsInRecycleBin struct { -} - -func (*awsEc2query_deserializeOpListSnapshotsInRecycleBin) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(response, &metadata) - } - output := &ListSnapshotsInRecycleBinOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentListSnapshotsInRecycleBinOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpLockSnapshot struct { -} - -func (*awsEc2query_deserializeOpLockSnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpLockSnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorLockSnapshot(response, &metadata) - } - output := &LockSnapshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentLockSnapshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorLockSnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyAddressAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyAddressAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyAddressAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyAddressAttribute(response, &metadata) - } - output := &ModifyAddressAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyAddressAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyAddressAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyAvailabilityZoneGroup struct { -} - -func (*awsEc2query_deserializeOpModifyAvailabilityZoneGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(response, &metadata) - } - output := &ModifyAvailabilityZoneGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyAvailabilityZoneGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyCapacityReservation struct { -} - -func (*awsEc2query_deserializeOpModifyCapacityReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyCapacityReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservation(response, &metadata) - } - output := &ModifyCapacityReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyCapacityReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyCapacityReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyCapacityReservationFleet struct { -} - -func (*awsEc2query_deserializeOpModifyCapacityReservationFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(response, &metadata) - } - output := &ModifyCapacityReservationFleetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyCapacityReservationFleetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyClientVpnEndpoint struct { -} - -func (*awsEc2query_deserializeOpModifyClientVpnEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(response, &metadata) - } - output := &ModifyClientVpnEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyClientVpnEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyDefaultCreditSpecification struct { -} - -func (*awsEc2query_deserializeOpModifyDefaultCreditSpecification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(response, &metadata) - } - output := &ModifyDefaultCreditSpecificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyDefaultCreditSpecificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(response, &metadata) - } - output := &ModifyEbsDefaultKmsKeyIdOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyEbsDefaultKmsKeyIdOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyFleet struct { -} - -func (*awsEc2query_deserializeOpModifyFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyFleet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyFleet(response, &metadata) - } - output := &ModifyFleetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyFleetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyFleet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyFpgaImageAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyFpgaImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(response, &metadata) - } - output := &ModifyFpgaImageAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyFpgaImageAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyHosts struct { -} - -func (*awsEc2query_deserializeOpModifyHosts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyHosts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyHosts(response, &metadata) - } - output := &ModifyHostsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyHostsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyHosts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIdentityIdFormat struct { -} - -func (*awsEc2query_deserializeOpModifyIdentityIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIdentityIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIdentityIdFormat(response, &metadata) - } - output := &ModifyIdentityIdFormatOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIdentityIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIdFormat struct { -} - -func (*awsEc2query_deserializeOpModifyIdFormat) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIdFormat) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIdFormat(response, &metadata) - } - output := &ModifyIdFormatOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIdFormat(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyImageAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyImageAttribute(response, &metadata) - } - output := &ModifyImageAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceAttribute(response, &metadata) - } - output := &ModifyInstanceAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(response, &metadata) - } - output := &ModifyInstanceCapacityReservationAttributesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceCapacityReservationAttributesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceCpuOptions struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceCpuOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceCpuOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(response, &metadata) - } - output := &ModifyInstanceCpuOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceCpuOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceCreditSpecification struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceCreditSpecification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(response, &metadata) - } - output := &ModifyInstanceCreditSpecificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceCreditSpecificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceEventStartTime struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceEventStartTime) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(response, &metadata) - } - output := &ModifyInstanceEventStartTimeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceEventStartTimeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceEventWindow struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceEventWindow) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventWindow(response, &metadata) - } - output := &ModifyInstanceEventWindowOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceEventWindowOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceEventWindow(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceMaintenanceOptions struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(response, &metadata) - } - output := &ModifyInstanceMaintenanceOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMaintenanceOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceMetadataDefaults struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceMetadataDefaults) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(response, &metadata) - } - output := &ModifyInstanceMetadataDefaultsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataDefaultsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceMetadataOptions struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceMetadataOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(response, &metadata) - } - output := &ModifyInstanceMetadataOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstanceNetworkPerformanceOptions struct { -} - -func (*awsEc2query_deserializeOpModifyInstanceNetworkPerformanceOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstanceNetworkPerformanceOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceNetworkPerformanceOptions(response, &metadata) - } - output := &ModifyInstanceNetworkPerformanceOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceNetworkPerformanceOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstanceNetworkPerformanceOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyInstancePlacement struct { -} - -func (*awsEc2query_deserializeOpModifyInstancePlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyInstancePlacement) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstancePlacement(response, &metadata) - } - output := &ModifyInstancePlacementOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstancePlacementOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyInstancePlacement(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIpam struct { -} - -func (*awsEc2query_deserializeOpModifyIpam) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIpam) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpam(response, &metadata) - } - output := &ModifyIpamOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIpam(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIpamPool struct { -} - -func (*awsEc2query_deserializeOpModifyIpamPool) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIpamPool) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamPool(response, &metadata) - } - output := &ModifyIpamPoolOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamPoolOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIpamPool(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIpamResourceCidr struct { -} - -func (*awsEc2query_deserializeOpModifyIpamResourceCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceCidr(response, &metadata) - } - output := &ModifyIpamResourceCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamResourceCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIpamResourceCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIpamResourceDiscovery struct { -} - -func (*awsEc2query_deserializeOpModifyIpamResourceDiscovery) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(response, &metadata) - } - output := &ModifyIpamResourceDiscoveryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamResourceDiscoveryOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyIpamScope struct { -} - -func (*awsEc2query_deserializeOpModifyIpamScope) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyIpamScope) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamScope(response, &metadata) - } - output := &ModifyIpamScopeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamScopeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyIpamScope(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyLaunchTemplate struct { -} - -func (*awsEc2query_deserializeOpModifyLaunchTemplate) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyLaunchTemplate) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyLaunchTemplate(response, &metadata) - } - output := &ModifyLaunchTemplateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyLaunchTemplateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyLaunchTemplate(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyLocalGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpModifyLocalGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(response, &metadata) - } - output := &ModifyLocalGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyLocalGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyManagedPrefixList struct { -} - -func (*awsEc2query_deserializeOpModifyManagedPrefixList) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyManagedPrefixList) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyManagedPrefixList(response, &metadata) - } - output := &ModifyManagedPrefixListOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyManagedPrefixListOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyManagedPrefixList(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(response, &metadata) - } - output := &ModifyNetworkInterfaceAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyPrivateDnsNameOptions struct { -} - -func (*awsEc2query_deserializeOpModifyPrivateDnsNameOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(response, &metadata) - } - output := &ModifyPrivateDnsNameOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyPrivateDnsNameOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyPublicIpDnsNameOptions struct { -} - -func (*awsEc2query_deserializeOpModifyPublicIpDnsNameOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyPublicIpDnsNameOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyPublicIpDnsNameOptions(response, &metadata) - } - output := &ModifyPublicIpDnsNameOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyPublicIpDnsNameOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyPublicIpDnsNameOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyReservedInstances struct { -} - -func (*awsEc2query_deserializeOpModifyReservedInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyReservedInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyReservedInstances(response, &metadata) - } - output := &ModifyReservedInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyReservedInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyReservedInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyRouteServer struct { -} - -func (*awsEc2query_deserializeOpModifyRouteServer) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyRouteServer) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyRouteServer(response, &metadata) - } - output := &ModifyRouteServerOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyRouteServerOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyRouteServer(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifySecurityGroupRules struct { -} - -func (*awsEc2query_deserializeOpModifySecurityGroupRules) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifySecurityGroupRules) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySecurityGroupRules(response, &metadata) - } - output := &ModifySecurityGroupRulesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifySecurityGroupRulesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifySecurityGroupRules(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifySnapshotAttribute struct { -} - -func (*awsEc2query_deserializeOpModifySnapshotAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifySnapshotAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotAttribute(response, &metadata) - } - output := &ModifySnapshotAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifySnapshotAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifySnapshotTier struct { -} - -func (*awsEc2query_deserializeOpModifySnapshotTier) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifySnapshotTier) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotTier(response, &metadata) - } - output := &ModifySnapshotTierOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifySnapshotTierOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifySnapshotTier(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifySpotFleetRequest struct { -} - -func (*awsEc2query_deserializeOpModifySpotFleetRequest) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifySpotFleetRequest) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySpotFleetRequest(response, &metadata) - } - output := &ModifySpotFleetRequestOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifySpotFleetRequestOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifySpotFleetRequest(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifySubnetAttribute struct { -} - -func (*awsEc2query_deserializeOpModifySubnetAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifySubnetAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySubnetAttribute(response, &metadata) - } - output := &ModifySubnetAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifySubnetAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices struct { -} - -func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(response, &metadata) - } - output := &ModifyTrafficMirrorFilterNetworkServicesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterNetworkServicesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(response, &metadata) - } - output := &ModifyTrafficMirrorFilterRuleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterRuleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTrafficMirrorSession struct { -} - -func (*awsEc2query_deserializeOpModifyTrafficMirrorSession) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTrafficMirrorSession) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(response, &metadata) - } - output := &ModifyTrafficMirrorSessionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorSessionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTransitGateway struct { -} - -func (*awsEc2query_deserializeOpModifyTransitGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTransitGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGateway(response, &metadata) - } - output := &ModifyTransitGatewayOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTransitGateway(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(response, &metadata) - } - output := &ModifyTransitGatewayPrefixListReferenceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayPrefixListReferenceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(response, &metadata) - } - output := &ModifyTransitGatewayVpcAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayVpcAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(response, &metadata) - } - output := &ModifyVerifiedAccessEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(response, &metadata) - } - output := &ModifyVerifiedAccessEndpointPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointPolicyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessGroup struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(response, &metadata) - } - output := &ModifyVerifiedAccessGroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(response, &metadata) - } - output := &ModifyVerifiedAccessGroupPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupPolicyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessInstance struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessInstance) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(response, &metadata) - } - output := &ModifyVerifiedAccessInstanceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(response, &metadata) - } - output := &ModifyVerifiedAccessInstanceLoggingConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(response, &metadata) - } - output := &ModifyVerifiedAccessTrustProviderOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessTrustProviderOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVolume struct { -} - -func (*awsEc2query_deserializeOpModifyVolume) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVolume) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVolume(response, &metadata) - } - output := &ModifyVolumeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVolumeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVolume(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVolumeAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyVolumeAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVolumeAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVolumeAttribute(response, &metadata) - } - output := &ModifyVolumeAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVolumeAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyVpcAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcAttribute(response, &metadata) - } - output := &ModifyVpcAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_deserializeOpModifyVpcBlockPublicAccessExclusion) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcBlockPublicAccessExclusion) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcBlockPublicAccessExclusion(response, &metadata) - } - output := &ModifyVpcBlockPublicAccessExclusionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcBlockPublicAccessExclusionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcBlockPublicAccessExclusion(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcBlockPublicAccessOptions struct { -} - -func (*awsEc2query_deserializeOpModifyVpcBlockPublicAccessOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcBlockPublicAccessOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcBlockPublicAccessOptions(response, &metadata) - } - output := &ModifyVpcBlockPublicAccessOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcBlockPublicAccessOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcBlockPublicAccessOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcEndpoint struct { -} - -func (*awsEc2query_deserializeOpModifyVpcEndpoint) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcEndpoint) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpoint(response, &metadata) - } - output := &ModifyVpcEndpointOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcEndpoint(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification struct { -} - -func (*awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(response, &metadata) - } - output := &ModifyVpcEndpointConnectionNotificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointConnectionNotificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration struct { -} - -func (*awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(response, &metadata) - } - output := &ModifyVpcEndpointServiceConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServiceConfigurationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility struct { -} - -func (*awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(response, &metadata) - } - output := &ModifyVpcEndpointServicePayerResponsibilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePayerResponsibilityOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcEndpointServicePermissions struct { -} - -func (*awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(response, &metadata) - } - output := &ModifyVpcEndpointServicePermissionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePermissionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions struct { -} - -func (*awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(response, &metadata) - } - output := &ModifyVpcPeeringConnectionOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcPeeringConnectionOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpcTenancy struct { -} - -func (*awsEc2query_deserializeOpModifyVpcTenancy) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpcTenancy) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcTenancy(response, &metadata) - } - output := &ModifyVpcTenancyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcTenancyOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpcTenancy(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpnConnection struct { -} - -func (*awsEc2query_deserializeOpModifyVpnConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpnConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnection(response, &metadata) - } - output := &ModifyVpnConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpnConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpnConnectionOptions struct { -} - -func (*awsEc2query_deserializeOpModifyVpnConnectionOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(response, &metadata) - } - output := &ModifyVpnConnectionOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpnTunnelCertificate struct { -} - -func (*awsEc2query_deserializeOpModifyVpnTunnelCertificate) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(response, &metadata) - } - output := &ModifyVpnTunnelCertificateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnTunnelCertificateOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpModifyVpnTunnelOptions struct { -} - -func (*awsEc2query_deserializeOpModifyVpnTunnelOptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(response, &metadata) - } - output := &ModifyVpnTunnelOptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnTunnelOptionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpMonitorInstances struct { -} - -func (*awsEc2query_deserializeOpMonitorInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpMonitorInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMonitorInstances(response, &metadata) - } - output := &MonitorInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMonitorInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorMonitorInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpMoveAddressToVpc struct { -} - -func (*awsEc2query_deserializeOpMoveAddressToVpc) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpMoveAddressToVpc) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveAddressToVpc(response, &metadata) - } - output := &MoveAddressToVpcOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveAddressToVpcOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorMoveAddressToVpc(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpMoveByoipCidrToIpam struct { -} - -func (*awsEc2query_deserializeOpMoveByoipCidrToIpam) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(response, &metadata) - } - output := &MoveByoipCidrToIpamOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveByoipCidrToIpamOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpMoveCapacityReservationInstances struct { -} - -func (*awsEc2query_deserializeOpMoveCapacityReservationInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(response, &metadata) - } - output := &MoveCapacityReservationInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveCapacityReservationInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpProvisionByoipCidr struct { -} - -func (*awsEc2query_deserializeOpProvisionByoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpProvisionByoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionByoipCidr(response, &metadata) - } - output := &ProvisionByoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionByoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorProvisionByoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpProvisionIpamByoasn struct { -} - -func (*awsEc2query_deserializeOpProvisionIpamByoasn) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpProvisionIpamByoasn) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamByoasn(response, &metadata) - } - output := &ProvisionIpamByoasnOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorProvisionIpamByoasn(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpProvisionIpamPoolCidr struct { -} - -func (*awsEc2query_deserializeOpProvisionIpamPoolCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(response, &metadata) - } - output := &ProvisionIpamPoolCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionIpamPoolCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr struct { -} - -func (*awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(response, &metadata) - } - output := &ProvisionPublicIpv4PoolCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionPublicIpv4PoolCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpPurchaseCapacityBlock struct { -} - -func (*awsEc2query_deserializeOpPurchaseCapacityBlock) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response, &metadata) - } - output := &PurchaseCapacityBlockOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseCapacityBlockOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorPurchaseCapacityBlock(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpPurchaseCapacityBlockExtension struct { -} - -func (*awsEc2query_deserializeOpPurchaseCapacityBlockExtension) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpPurchaseCapacityBlockExtension) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseCapacityBlockExtension(response, &metadata) - } - output := &PurchaseCapacityBlockExtensionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseCapacityBlockExtensionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorPurchaseCapacityBlockExtension(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpPurchaseHostReservation struct { -} - -func (*awsEc2query_deserializeOpPurchaseHostReservation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpPurchaseHostReservation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseHostReservation(response, &metadata) - } - output := &PurchaseHostReservationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseHostReservationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorPurchaseHostReservation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpPurchaseReservedInstancesOffering struct { -} - -func (*awsEc2query_deserializeOpPurchaseReservedInstancesOffering) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(response, &metadata) - } - output := &PurchaseReservedInstancesOfferingOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseReservedInstancesOfferingOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpPurchaseScheduledInstances struct { -} - -func (*awsEc2query_deserializeOpPurchaseScheduledInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseScheduledInstances(response, &metadata) - } - output := &PurchaseScheduledInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseScheduledInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorPurchaseScheduledInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRebootInstances struct { -} - -func (*awsEc2query_deserializeOpRebootInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRebootInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRebootInstances(response, &metadata) - } - output := &RebootInstancesOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRebootInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRegisterImage struct { -} - -func (*awsEc2query_deserializeOpRegisterImage) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRegisterImage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterImage(response, &metadata) - } - output := &RegisterImageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterImageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRegisterImage(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(response, &metadata) - } - output := &RegisterInstanceEventNotificationAttributesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterInstanceEventNotificationAttributesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers struct { -} - -func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(response, &metadata) - } - output := &RegisterTransitGatewayMulticastGroupMembersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupMembersOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources struct { -} - -func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(response, &metadata) - } - output := &RegisterTransitGatewayMulticastGroupSourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership struct { -} - -func (*awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(response, &metadata) - } - output := &RejectCapacityReservationBillingOwnershipOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectCapacityReservationBillingOwnershipOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(response, &metadata) - } - output := &RejectTransitGatewayMulticastDomainAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(response, &metadata) - } - output := &RejectTransitGatewayPeeringAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayPeeringAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(response, &metadata) - } - output := &RejectTransitGatewayVpcAttachmentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayVpcAttachmentOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectVpcEndpointConnections struct { -} - -func (*awsEc2query_deserializeOpRejectVpcEndpointConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(response, &metadata) - } - output := &RejectVpcEndpointConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectVpcEndpointConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRejectVpcPeeringConnection struct { -} - -func (*awsEc2query_deserializeOpRejectVpcPeeringConnection) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(response, &metadata) - } - output := &RejectVpcPeeringConnectionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectVpcPeeringConnectionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReleaseAddress struct { -} - -func (*awsEc2query_deserializeOpReleaseAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReleaseAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseAddress(response, &metadata) - } - output := &ReleaseAddressOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReleaseAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReleaseHosts struct { -} - -func (*awsEc2query_deserializeOpReleaseHosts) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReleaseHosts) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseHosts(response, &metadata) - } - output := &ReleaseHostsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReleaseHostsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReleaseHosts(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReleaseIpamPoolAllocation struct { -} - -func (*awsEc2query_deserializeOpReleaseIpamPoolAllocation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(response, &metadata) - } - output := &ReleaseIpamPoolAllocationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReleaseIpamPoolAllocationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation struct { -} - -func (*awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(response, &metadata) - } - output := &ReplaceIamInstanceProfileAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceIamInstanceProfileAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceImageCriteriaInAllowedImagesSettings struct { -} - -func (*awsEc2query_deserializeOpReplaceImageCriteriaInAllowedImagesSettings) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceImageCriteriaInAllowedImagesSettings) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceImageCriteriaInAllowedImagesSettings(response, &metadata) - } - output := &ReplaceImageCriteriaInAllowedImagesSettingsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceImageCriteriaInAllowedImagesSettingsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceImageCriteriaInAllowedImagesSettings(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceNetworkAclAssociation struct { -} - -func (*awsEc2query_deserializeOpReplaceNetworkAclAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(response, &metadata) - } - output := &ReplaceNetworkAclAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceNetworkAclAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceNetworkAclEntry struct { -} - -func (*awsEc2query_deserializeOpReplaceNetworkAclEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceNetworkAclEntry) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(response, &metadata) - } - output := &ReplaceNetworkAclEntryOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceRoute struct { -} - -func (*awsEc2query_deserializeOpReplaceRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceRoute(response, &metadata) - } - output := &ReplaceRouteOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceRouteTableAssociation struct { -} - -func (*awsEc2query_deserializeOpReplaceRouteTableAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(response, &metadata) - } - output := &ReplaceRouteTableAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceRouteTableAssociationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceTransitGatewayRoute struct { -} - -func (*awsEc2query_deserializeOpReplaceTransitGatewayRoute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceTransitGatewayRoute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response, &metadata) - } - output := &ReplaceTransitGatewayRouteOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceTransitGatewayRouteOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReplaceVpnTunnel struct { -} - -func (*awsEc2query_deserializeOpReplaceVpnTunnel) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReplaceVpnTunnel) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceVpnTunnel(response, &metadata) - } - output := &ReplaceVpnTunnelOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReplaceVpnTunnel(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpReportInstanceStatus struct { -} - -func (*awsEc2query_deserializeOpReportInstanceStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpReportInstanceStatus) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReportInstanceStatus(response, &metadata) - } - output := &ReportInstanceStatusOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorReportInstanceStatus(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRequestSpotFleet struct { -} - -func (*awsEc2query_deserializeOpRequestSpotFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRequestSpotFleet) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRequestSpotFleet(response, &metadata) - } - output := &RequestSpotFleetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRequestSpotFleetOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRequestSpotFleet(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRequestSpotInstances struct { -} - -func (*awsEc2query_deserializeOpRequestSpotInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRequestSpotInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRequestSpotInstances(response, &metadata) - } - output := &RequestSpotInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRequestSpotInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRequestSpotInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetAddressAttribute struct { -} - -func (*awsEc2query_deserializeOpResetAddressAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetAddressAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetAddressAttribute(response, &metadata) - } - output := &ResetAddressAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetAddressAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetAddressAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(response, &metadata) - } - output := &ResetEbsDefaultKmsKeyIdOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetEbsDefaultKmsKeyIdOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetFpgaImageAttribute struct { -} - -func (*awsEc2query_deserializeOpResetFpgaImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetFpgaImageAttribute(response, &metadata) - } - output := &ResetFpgaImageAttributeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetFpgaImageAttributeOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetFpgaImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetImageAttribute struct { -} - -func (*awsEc2query_deserializeOpResetImageAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetImageAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetImageAttribute(response, &metadata) - } - output := &ResetImageAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetImageAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetInstanceAttribute struct { -} - -func (*awsEc2query_deserializeOpResetInstanceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetInstanceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetInstanceAttribute(response, &metadata) - } - output := &ResetInstanceAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetInstanceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_deserializeOpResetNetworkInterfaceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetNetworkInterfaceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(response, &metadata) - } - output := &ResetNetworkInterfaceAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpResetSnapshotAttribute struct { -} - -func (*awsEc2query_deserializeOpResetSnapshotAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpResetSnapshotAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetSnapshotAttribute(response, &metadata) - } - output := &ResetSnapshotAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorResetSnapshotAttribute(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRestoreAddressToClassic struct { -} - -func (*awsEc2query_deserializeOpRestoreAddressToClassic) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRestoreAddressToClassic) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreAddressToClassic(response, &metadata) - } - output := &RestoreAddressToClassicOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreAddressToClassicOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRestoreAddressToClassic(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRestoreImageFromRecycleBin struct { -} - -func (*awsEc2query_deserializeOpRestoreImageFromRecycleBin) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(response, &metadata) - } - output := &RestoreImageFromRecycleBinOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreImageFromRecycleBinOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRestoreManagedPrefixListVersion struct { -} - -func (*awsEc2query_deserializeOpRestoreManagedPrefixListVersion) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(response, &metadata) - } - output := &RestoreManagedPrefixListVersionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreManagedPrefixListVersionOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin struct { -} - -func (*awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(response, &metadata) - } - output := &RestoreSnapshotFromRecycleBinOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreSnapshotFromRecycleBinOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRestoreSnapshotTier struct { -} - -func (*awsEc2query_deserializeOpRestoreSnapshotTier) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRestoreSnapshotTier) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotTier(response, &metadata) - } - output := &RestoreSnapshotTierOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreSnapshotTierOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRestoreSnapshotTier(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRevokeClientVpnIngress struct { -} - -func (*awsEc2query_deserializeOpRevokeClientVpnIngress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeClientVpnIngress(response, &metadata) - } - output := &RevokeClientVpnIngressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeClientVpnIngressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRevokeClientVpnIngress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRevokeSecurityGroupEgress struct { -} - -func (*awsEc2query_deserializeOpRevokeSecurityGroupEgress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(response, &metadata) - } - output := &RevokeSecurityGroupEgressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupEgressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRevokeSecurityGroupIngress struct { -} - -func (*awsEc2query_deserializeOpRevokeSecurityGroupIngress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(response, &metadata) - } - output := &RevokeSecurityGroupIngressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupIngressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRunInstances struct { -} - -func (*awsEc2query_deserializeOpRunInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRunInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRunInstances(response, &metadata) - } - output := &RunInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRunInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRunInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpRunScheduledInstances struct { -} - -func (*awsEc2query_deserializeOpRunScheduledInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpRunScheduledInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRunScheduledInstances(response, &metadata) - } - output := &RunScheduledInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRunScheduledInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorRunScheduledInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpSearchLocalGatewayRoutes struct { -} - -func (*awsEc2query_deserializeOpSearchLocalGatewayRoutes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(response, &metadata) - } - output := &SearchLocalGatewayRoutesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchLocalGatewayRoutesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups struct { -} - -func (*awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(response, &metadata) - } - output := &SearchTransitGatewayMulticastGroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchTransitGatewayMulticastGroupsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpSearchTransitGatewayRoutes struct { -} - -func (*awsEc2query_deserializeOpSearchTransitGatewayRoutes) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(response, &metadata) - } - output := &SearchTransitGatewayRoutesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchTransitGatewayRoutesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpSendDiagnosticInterrupt struct { -} - -func (*awsEc2query_deserializeOpSendDiagnosticInterrupt) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpSendDiagnosticInterrupt) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(response, &metadata) - } - output := &SendDiagnosticInterruptOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStartDeclarativePoliciesReport struct { -} - -func (*awsEc2query_deserializeOpStartDeclarativePoliciesReport) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStartDeclarativePoliciesReport) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartDeclarativePoliciesReport(response, &metadata) - } - output := &StartDeclarativePoliciesReportOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartDeclarativePoliciesReportOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStartDeclarativePoliciesReport(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStartInstances struct { -} - -func (*awsEc2query_deserializeOpStartInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStartInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartInstances(response, &metadata) - } - output := &StartInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStartInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis struct { -} - -func (*awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(response, &metadata) - } - output := &StartNetworkInsightsAccessScopeAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartNetworkInsightsAccessScopeAnalysisOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStartNetworkInsightsAnalysis struct { -} - -func (*awsEc2query_deserializeOpStartNetworkInsightsAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(response, &metadata) - } - output := &StartNetworkInsightsAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartNetworkInsightsAnalysisOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification struct { -} - -func (*awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(response, &metadata) - } - output := &StartVpcEndpointServicePrivateDnsVerificationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpStopInstances struct { -} - -func (*awsEc2query_deserializeOpStopInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpStopInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStopInstances(response, &metadata) - } - output := &StopInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStopInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorStopInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpTerminateClientVpnConnections struct { -} - -func (*awsEc2query_deserializeOpTerminateClientVpnConnections) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorTerminateClientVpnConnections(response, &metadata) - } - output := &TerminateClientVpnConnectionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentTerminateClientVpnConnectionsOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorTerminateClientVpnConnections(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpTerminateInstances struct { -} - -func (*awsEc2query_deserializeOpTerminateInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpTerminateInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorTerminateInstances(response, &metadata) - } - output := &TerminateInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentTerminateInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorTerminateInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUnassignIpv6Addresses struct { -} - -func (*awsEc2query_deserializeOpUnassignIpv6Addresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnassignIpv6Addresses(response, &metadata) - } - output := &UnassignIpv6AddressesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnassignIpv6AddressesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnassignIpv6Addresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUnassignPrivateIpAddresses struct { -} - -func (*awsEc2query_deserializeOpUnassignPrivateIpAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnassignPrivateIpAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(response, &metadata) - } - output := &UnassignPrivateIpAddressesOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress struct { -} - -func (*awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(response, &metadata) - } - output := &UnassignPrivateNatGatewayAddressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnassignPrivateNatGatewayAddressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUnlockSnapshot struct { -} - -func (*awsEc2query_deserializeOpUnlockSnapshot) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnlockSnapshot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnlockSnapshot(response, &metadata) - } - output := &UnlockSnapshotOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnlockSnapshotOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnlockSnapshot(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUnmonitorInstances struct { -} - -func (*awsEc2query_deserializeOpUnmonitorInstances) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnmonitorInstances) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnmonitorInstances(response, &metadata) - } - output := &UnmonitorInstancesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnmonitorInstancesOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnmonitorInstances(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress struct { -} - -func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(response, &metadata) - } - output := &UpdateSecurityGroupRuleDescriptionsEgressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress struct { -} - -func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(response, &metadata) - } - output := &UpdateSecurityGroupRuleDescriptionsIngressOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsEc2query_deserializeOpWithdrawByoipCidr struct { -} - -func (*awsEc2query_deserializeOpWithdrawByoipCidr) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpWithdrawByoipCidr) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorWithdrawByoipCidr(response, &metadata) - } - output := &WithdrawByoipCidrOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentWithdrawByoipCidrOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorWithdrawByoipCidr(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 - - errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) - if err != nil { - return err - } - awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsEc2query_deserializeDocumentAcceleratorCount(v **types.AcceleratorCount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AcceleratorCount - if *v == nil { - sv = &types.AcceleratorCount{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAcceleratorManufacturerSet(v *[]types.AcceleratorManufacturer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AcceleratorManufacturer - if *v == nil { - sv = make([]types.AcceleratorManufacturer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AcceleratorManufacturer - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.AcceleratorManufacturer(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAcceleratorManufacturerSetUnwrapped(v *[]types.AcceleratorManufacturer, decoder smithyxml.NodeDecoder) error { - var sv []types.AcceleratorManufacturer - if *v == nil { - sv = make([]types.AcceleratorManufacturer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AcceleratorManufacturer - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.AcceleratorManufacturer(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAcceleratorNameSet(v *[]types.AcceleratorName, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AcceleratorName - if *v == nil { - sv = make([]types.AcceleratorName, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AcceleratorName - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.AcceleratorName(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAcceleratorNameSetUnwrapped(v *[]types.AcceleratorName, decoder smithyxml.NodeDecoder) error { - var sv []types.AcceleratorName - if *v == nil { - sv = make([]types.AcceleratorName, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AcceleratorName - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.AcceleratorName(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAcceleratorTotalMemoryMiB(v **types.AcceleratorTotalMemoryMiB, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AcceleratorTotalMemoryMiB - if *v == nil { - sv = &types.AcceleratorTotalMemoryMiB{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAcceleratorTypeSet(v *[]types.AcceleratorType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AcceleratorType - if *v == nil { - sv = make([]types.AcceleratorType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AcceleratorType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.AcceleratorType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAcceleratorTypeSetUnwrapped(v *[]types.AcceleratorType, decoder smithyxml.NodeDecoder) error { - var sv []types.AcceleratorType - if *v == nil { - sv = make([]types.AcceleratorType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AcceleratorType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.AcceleratorType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAccessScopeAnalysisFinding(v **types.AccessScopeAnalysisFinding, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AccessScopeAnalysisFinding - if *v == nil { - sv = &types.AccessScopeAnalysisFinding{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("findingComponentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathComponentList(&sv.FindingComponents, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("findingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FindingId = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeAnalysisId = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccessScopeAnalysisFindingList(v *[]types.AccessScopeAnalysisFinding, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AccessScopeAnalysisFinding - if *v == nil { - sv = make([]types.AccessScopeAnalysisFinding, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AccessScopeAnalysisFinding - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAccessScopeAnalysisFinding(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccessScopeAnalysisFindingListUnwrapped(v *[]types.AccessScopeAnalysisFinding, decoder smithyxml.NodeDecoder) error { - var sv []types.AccessScopeAnalysisFinding - if *v == nil { - sv = make([]types.AccessScopeAnalysisFinding, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AccessScopeAnalysisFinding - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAccessScopeAnalysisFinding(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAccessScopePath(v **types.AccessScopePath, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AccessScopePath - if *v == nil { - sv = &types.AccessScopePath{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destination", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathStatement(&sv.Destination, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("source", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathStatement(&sv.Source, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("throughResourceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentThroughResourcesStatementList(&sv.ThroughResources, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccessScopePathList(v *[]types.AccessScopePath, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AccessScopePath - if *v == nil { - sv = make([]types.AccessScopePath, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AccessScopePath - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAccessScopePath(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccessScopePathListUnwrapped(v *[]types.AccessScopePath, decoder smithyxml.NodeDecoder) error { - var sv []types.AccessScopePath - if *v == nil { - sv = make([]types.AccessScopePath, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AccessScopePath - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAccessScopePath(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAccountAttribute(v **types.AccountAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AccountAttribute - if *v == nil { - sv = &types.AccountAttribute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attributeName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttributeName = ptr.String(xtv) - } - - case strings.EqualFold("attributeValueSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAccountAttributeValueList(&sv.AttributeValues, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccountAttributeList(v *[]types.AccountAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AccountAttribute - if *v == nil { - sv = make([]types.AccountAttribute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AccountAttribute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAccountAttribute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccountAttributeListUnwrapped(v *[]types.AccountAttribute, decoder smithyxml.NodeDecoder) error { - var sv []types.AccountAttribute - if *v == nil { - sv = make([]types.AccountAttribute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AccountAttribute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAccountAttribute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAccountAttributeValue(v **types.AccountAttributeValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AccountAttributeValue - if *v == nil { - sv = &types.AccountAttributeValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attributeValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttributeValue = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccountAttributeValueList(v *[]types.AccountAttributeValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AccountAttributeValue - if *v == nil { - sv = make([]types.AccountAttributeValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AccountAttributeValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAccountAttributeValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAccountAttributeValueListUnwrapped(v *[]types.AccountAttributeValue, decoder smithyxml.NodeDecoder) error { - var sv []types.AccountAttributeValue - if *v == nil { - sv = make([]types.AccountAttributeValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AccountAttributeValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAccountAttributeValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentActiveInstance(v **types.ActiveInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ActiveInstance - if *v == nil { - sv = &types.ActiveInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceHealth", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceHealth = types.InstanceHealthStatus(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("spotInstanceRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotInstanceRequestId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentActiveInstanceSet(v *[]types.ActiveInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ActiveInstance - if *v == nil { - sv = make([]types.ActiveInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ActiveInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentActiveInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentActiveInstanceSetUnwrapped(v *[]types.ActiveInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.ActiveInstance - if *v == nil { - sv = make([]types.ActiveInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ActiveInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentActiveInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentActiveVpnTunnelStatus(v **types.ActiveVpnTunnelStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ActiveVpnTunnelStatus - if *v == nil { - sv = &types.ActiveVpnTunnelStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ikeVersion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IkeVersion = ptr.String(xtv) - } - - case strings.EqualFold("phase1DHGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Phase1DHGroup = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("phase1EncryptionAlgorithm", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Phase1EncryptionAlgorithm = ptr.String(xtv) - } - - case strings.EqualFold("phase1IntegrityAlgorithm", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Phase1IntegrityAlgorithm = ptr.String(xtv) - } - - case strings.EqualFold("phase2DHGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Phase2DHGroup = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("phase2EncryptionAlgorithm", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Phase2EncryptionAlgorithm = ptr.String(xtv) - } - - case strings.EqualFold("phase2IntegrityAlgorithm", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Phase2IntegrityAlgorithm = ptr.String(xtv) - } - - case strings.EqualFold("provisioningStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProvisioningStatus = types.VpnTunnelProvisioningStatus(xtv) - } - - case strings.EqualFold("provisioningStatusReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProvisioningStatusReason = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddedPrincipal(v **types.AddedPrincipal, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AddedPrincipal - if *v == nil { - sv = &types.AddedPrincipal{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("principal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Principal = ptr.String(xtv) - } - - case strings.EqualFold("principalType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrincipalType = types.PrincipalType(xtv) - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("servicePermissionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServicePermissionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddedPrincipalSet(v *[]types.AddedPrincipal, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AddedPrincipal - if *v == nil { - sv = make([]types.AddedPrincipal, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AddedPrincipal - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAddedPrincipal(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddedPrincipalSetUnwrapped(v *[]types.AddedPrincipal, decoder smithyxml.NodeDecoder) error { - var sv []types.AddedPrincipal - if *v == nil { - sv = make([]types.AddedPrincipal, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AddedPrincipal - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAddedPrincipal(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAdditionalDetail(v **types.AdditionalDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AdditionalDetail - if *v == nil { - sv = &types.AdditionalDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("additionalDetailType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AdditionalDetailType = ptr.String(xtv) - } - - case strings.EqualFold("component", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Component, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponentList(&sv.LoadBalancers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ruleGroupRuleOptionsPairSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRuleGroupRuleOptionsPairList(&sv.RuleGroupRuleOptionsPairs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ruleGroupTypePairSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRuleGroupTypePairList(&sv.RuleGroupTypePairs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ruleOptionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRuleOptionList(&sv.RuleOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("serviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceName = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointService", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.VpcEndpointService, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAdditionalDetailList(v *[]types.AdditionalDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AdditionalDetail - if *v == nil { - sv = make([]types.AdditionalDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AdditionalDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAdditionalDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAdditionalDetailListUnwrapped(v *[]types.AdditionalDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.AdditionalDetail - if *v == nil { - sv = make([]types.AdditionalDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AdditionalDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAdditionalDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAddress(v **types.Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Address - if *v == nil { - sv = &types.Address{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("carrierIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIpv4Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIpv4Pool = ptr.String(xtv) - } - - case strings.EqualFold("domain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Domain = types.DomainType(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv4Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv4Pool = ptr.String(xtv) - } - - case strings.EqualFold("serviceManaged", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceManaged = types.ServiceManaged(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressAttribute(v **types.AddressAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AddressAttribute - if *v == nil { - sv = &types.AddressAttribute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("ptrRecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PtrRecord = ptr.String(xtv) - } - - case strings.EqualFold("ptrRecordUpdate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPtrUpdateStatus(&sv.PtrRecordUpdate, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressList(v *[]types.Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Address - if *v == nil { - sv = make([]types.Address, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Address - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressListUnwrapped(v *[]types.Address, decoder smithyxml.NodeDecoder) error { - var sv []types.Address - if *v == nil { - sv = make([]types.Address, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Address - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAddressSet(v *[]types.AddressAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AddressAttribute - if *v == nil { - sv = make([]types.AddressAttribute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AddressAttribute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAddressAttribute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressSetUnwrapped(v *[]types.AddressAttribute, decoder smithyxml.NodeDecoder) error { - var sv []types.AddressAttribute - if *v == nil { - sv = make([]types.AddressAttribute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AddressAttribute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAddressAttribute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAddressTransfer(v **types.AddressTransfer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AddressTransfer - if *v == nil { - sv = &types.AddressTransfer{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressTransferStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressTransferStatus = types.AddressTransferStatus(xtv) - } - - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - case strings.EqualFold("transferAccountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransferAccountId = ptr.String(xtv) - } - - case strings.EqualFold("transferOfferAcceptedTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TransferOfferAcceptedTimestamp = ptr.Time(t) - } - - case strings.EqualFold("transferOfferExpirationTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TransferOfferExpirationTimestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressTransferList(v *[]types.AddressTransfer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AddressTransfer - if *v == nil { - sv = make([]types.AddressTransfer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AddressTransfer - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAddressTransfer(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAddressTransferListUnwrapped(v *[]types.AddressTransfer, decoder smithyxml.NodeDecoder) error { - var sv []types.AddressTransfer - if *v == nil { - sv = make([]types.AddressTransfer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AddressTransfer - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAddressTransfer(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAllowedInstanceTypeSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAllowedInstanceTypeSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAllowedPrincipal(v **types.AllowedPrincipal, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AllowedPrincipal - if *v == nil { - sv = &types.AllowedPrincipal{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("principal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Principal = ptr.String(xtv) - } - - case strings.EqualFold("principalType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrincipalType = types.PrincipalType(xtv) - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("servicePermissionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServicePermissionId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAllowedPrincipalSet(v *[]types.AllowedPrincipal, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AllowedPrincipal - if *v == nil { - sv = make([]types.AllowedPrincipal, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AllowedPrincipal - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAllowedPrincipal(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAllowedPrincipalSetUnwrapped(v *[]types.AllowedPrincipal, decoder smithyxml.NodeDecoder) error { - var sv []types.AllowedPrincipal - if *v == nil { - sv = make([]types.AllowedPrincipal, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AllowedPrincipal - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAllowedPrincipal(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAlternatePathHint(v **types.AlternatePathHint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AlternatePathHint - if *v == nil { - sv = &types.AlternatePathHint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("componentArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComponentArn = ptr.String(xtv) - } - - case strings.EqualFold("componentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComponentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAlternatePathHintList(v *[]types.AlternatePathHint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AlternatePathHint - if *v == nil { - sv = make([]types.AlternatePathHint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AlternatePathHint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAlternatePathHint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAlternatePathHintListUnwrapped(v *[]types.AlternatePathHint, decoder smithyxml.NodeDecoder) error { - var sv []types.AlternatePathHint - if *v == nil { - sv = make([]types.AlternatePathHint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AlternatePathHint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAlternatePathHint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAnalysisAclRule(v **types.AnalysisAclRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisAclRule - if *v == nil { - sv = &types.AnalysisAclRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("egress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Egress = ptr.Bool(xtv) - } - - case strings.EqualFold("portRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRange(&sv.PortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("ruleAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleAction = ptr.String(xtv) - } - - case strings.EqualFold("ruleNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RuleNumber = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisComponent(v **types.AnalysisComponent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisComponent - if *v == nil { - sv = &types.AnalysisComponent{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisComponentList(v *[]types.AnalysisComponent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AnalysisComponent - if *v == nil { - sv = make([]types.AnalysisComponent, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AnalysisComponent - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAnalysisComponent(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisComponentListUnwrapped(v *[]types.AnalysisComponent, decoder smithyxml.NodeDecoder) error { - var sv []types.AnalysisComponent - if *v == nil { - sv = make([]types.AnalysisComponent, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AnalysisComponent - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAnalysisComponent(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAnalysisLoadBalancerListener(v **types.AnalysisLoadBalancerListener, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisLoadBalancerListener - if *v == nil { - sv = &types.AnalysisLoadBalancerListener{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancePort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstancePort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("loadBalancerPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LoadBalancerPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisLoadBalancerTarget(v **types.AnalysisLoadBalancerTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisLoadBalancerTarget - if *v == nil { - sv = &types.AnalysisLoadBalancerTarget{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Address = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("instance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Instance, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("port", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisPacketHeader(v **types.AnalysisPacketHeader, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisPacketHeader - if *v == nil { - sv = &types.AnalysisPacketHeader{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpAddressList(&sv.DestinationAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationPortRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.DestinationPortRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("sourceAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpAddressList(&sv.SourceAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourcePortRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.SourcePortRanges, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisRouteTableRoute(v **types.AnalysisRouteTableRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisRouteTableRoute - if *v == nil { - sv = &types.AnalysisRouteTableRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("coreNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidr = ptr.String(xtv) - } - - case strings.EqualFold("destinationPrefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationPrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("egressOnlyInternetGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EgressOnlyInternetGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("gatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayId = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("origin", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Origin = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAnalysisSecurityGroupRule(v **types.AnalysisSecurityGroupRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AnalysisSecurityGroupRule - if *v == nil { - sv = &types.AnalysisSecurityGroupRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("direction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Direction = ptr.String(xtv) - } - - case strings.EqualFold("portRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRange(&sv.PortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentArchitectureTypeList(v *[]types.ArchitectureType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ArchitectureType - if *v == nil { - sv = make([]types.ArchitectureType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ArchitectureType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.ArchitectureType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentArchitectureTypeListUnwrapped(v *[]types.ArchitectureType, decoder smithyxml.NodeDecoder) error { - var sv []types.ArchitectureType - if *v == nil { - sv = make([]types.ArchitectureType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ArchitectureType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.ArchitectureType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentArnList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentArnListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAsnAssociation(v **types.AsnAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AsnAssociation - if *v == nil { - sv = &types.AsnAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Asn = ptr.String(xtv) - } - - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AsnAssociationState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAsnAssociationSet(v *[]types.AsnAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AsnAssociation - if *v == nil { - sv = make([]types.AsnAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AsnAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAsnAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAsnAssociationSetUnwrapped(v *[]types.AsnAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.AsnAssociation - if *v == nil { - sv = make([]types.AsnAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AsnAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAsnAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAsPath(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAsPathUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAssignedPrivateIpAddress(v **types.AssignedPrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AssignedPrivateIpAddress - if *v == nil { - sv = &types.AssignedPrivateIpAddress{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssignedPrivateIpAddressList(v *[]types.AssignedPrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AssignedPrivateIpAddress - if *v == nil { - sv = make([]types.AssignedPrivateIpAddress, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AssignedPrivateIpAddress - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAssignedPrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssignedPrivateIpAddressListUnwrapped(v *[]types.AssignedPrivateIpAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.AssignedPrivateIpAddress - if *v == nil { - sv = make([]types.AssignedPrivateIpAddress, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AssignedPrivateIpAddress - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAssignedPrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAssociatedRole(v **types.AssociatedRole, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AssociatedRole - if *v == nil { - sv = &types.AssociatedRole{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedRoleArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedRoleArn = ptr.String(xtv) - } - - case strings.EqualFold("certificateS3BucketName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateS3BucketName = ptr.String(xtv) - } - - case strings.EqualFold("certificateS3ObjectKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateS3ObjectKey = ptr.String(xtv) - } - - case strings.EqualFold("encryptionKmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EncryptionKmsKeyId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssociatedRolesList(v *[]types.AssociatedRole, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AssociatedRole - if *v == nil { - sv = make([]types.AssociatedRole, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AssociatedRole - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAssociatedRole(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssociatedRolesListUnwrapped(v *[]types.AssociatedRole, decoder smithyxml.NodeDecoder) error { - var sv []types.AssociatedRole - if *v == nil { - sv = make([]types.AssociatedRole, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AssociatedRole - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAssociatedRole(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAssociatedSubnetList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssociatedSubnetListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAssociatedTargetNetwork(v **types.AssociatedTargetNetwork, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AssociatedTargetNetwork - if *v == nil { - sv = &types.AssociatedTargetNetwork{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkId = ptr.String(xtv) - } - - case strings.EqualFold("networkType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkType = types.AssociatedNetworkType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssociatedTargetNetworkSet(v *[]types.AssociatedTargetNetwork, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AssociatedTargetNetwork - if *v == nil { - sv = make([]types.AssociatedTargetNetwork, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AssociatedTargetNetwork - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAssociatedTargetNetwork(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAssociatedTargetNetworkSetUnwrapped(v *[]types.AssociatedTargetNetwork, decoder smithyxml.NodeDecoder) error { - var sv []types.AssociatedTargetNetwork - if *v == nil { - sv = make([]types.AssociatedTargetNetwork, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AssociatedTargetNetwork - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAssociatedTargetNetwork(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAssociationStatus(v **types.AssociationStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AssociationStatus - if *v == nil { - sv = &types.AssociationStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.AssociationStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttachmentEnaSrdSpecification(v **types.AttachmentEnaSrdSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AttachmentEnaSrdSpecification - if *v == nil { - sv = &types.AttachmentEnaSrdSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("enaSrdUdpSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttachmentEnaSrdUdpSpecification(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttachmentEnaSrdUdpSpecification(v **types.AttachmentEnaSrdUdpSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AttachmentEnaSrdUdpSpecification - if *v == nil { - sv = &types.AttachmentEnaSrdUdpSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdUdpEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdUdpEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttributeBooleanValue(v **types.AttributeBooleanValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AttributeBooleanValue - if *v == nil { - sv = &types.AttributeBooleanValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Value = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttributeSummary(v **types.AttributeSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AttributeSummary - if *v == nil { - sv = &types.AttributeSummary{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attributeName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttributeName = ptr.String(xtv) - } - - case strings.EqualFold("mostFrequentValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MostFrequentValue = ptr.String(xtv) - } - - case strings.EqualFold("numberOfMatchedAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfMatchedAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("numberOfUnmatchedAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfUnmatchedAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("regionalSummarySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRegionalSummaryList(&sv.RegionalSummaries, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttributeSummaryList(v *[]types.AttributeSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AttributeSummary - if *v == nil { - sv = make([]types.AttributeSummary, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AttributeSummary - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAttributeSummary(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAttributeSummaryListUnwrapped(v *[]types.AttributeSummary, decoder smithyxml.NodeDecoder) error { - var sv []types.AttributeSummary - if *v == nil { - sv = make([]types.AttributeSummary, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AttributeSummary - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAttributeSummary(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAttributeValue(v **types.AttributeValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AttributeValue - if *v == nil { - sv = &types.AttributeValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAuthorizationRule(v **types.AuthorizationRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AuthorizationRule - if *v == nil { - sv = &types.AuthorizationRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accessAll", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AccessAll = ptr.Bool(xtv) - } - - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidr = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnAuthorizationRuleStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAuthorizationRuleSet(v *[]types.AuthorizationRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AuthorizationRule - if *v == nil { - sv = make([]types.AuthorizationRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AuthorizationRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAuthorizationRule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAuthorizationRuleSetUnwrapped(v *[]types.AuthorizationRule, decoder smithyxml.NodeDecoder) error { - var sv []types.AuthorizationRule - if *v == nil { - sv = make([]types.AuthorizationRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AuthorizationRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAuthorizationRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AvailabilityZone - if *v == nil { - sv = &types.AvailabilityZone{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupLongName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupLongName = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("messageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAvailabilityZoneMessageList(&sv.Messages, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("optInStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OptInStatus = types.AvailabilityZoneOptInStatus(xtv) - } - - case strings.EqualFold("parentZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ParentZoneId = ptr.String(xtv) - } - - case strings.EqualFold("parentZoneName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ParentZoneName = ptr.String(xtv) - } - - case strings.EqualFold("regionName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RegionName = ptr.String(xtv) - } - - case strings.EqualFold("zoneState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AvailabilityZoneState(xtv) - } - - case strings.EqualFold("zoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ZoneId = ptr.String(xtv) - } - - case strings.EqualFold("zoneName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ZoneName = ptr.String(xtv) - } - - case strings.EqualFold("zoneType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ZoneType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailabilityZoneList(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AvailabilityZone - if *v == nil { - sv = make([]types.AvailabilityZone, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AvailabilityZone - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailabilityZoneListUnwrapped(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { - var sv []types.AvailabilityZone - if *v == nil { - sv = make([]types.AvailabilityZone, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AvailabilityZone - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAvailabilityZoneMessage(v **types.AvailabilityZoneMessage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AvailabilityZoneMessage - if *v == nil { - sv = &types.AvailabilityZoneMessage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailabilityZoneMessageList(v *[]types.AvailabilityZoneMessage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AvailabilityZoneMessage - if *v == nil { - sv = make([]types.AvailabilityZoneMessage, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AvailabilityZoneMessage - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAvailabilityZoneMessage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailabilityZoneMessageListUnwrapped(v *[]types.AvailabilityZoneMessage, decoder smithyxml.NodeDecoder) error { - var sv []types.AvailabilityZoneMessage - if *v == nil { - sv = make([]types.AvailabilityZoneMessage, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AvailabilityZoneMessage - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAvailabilityZoneMessage(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentAvailableCapacity(v **types.AvailableCapacity, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AvailableCapacity - if *v == nil { - sv = &types.AvailableCapacity{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availableInstanceCapacity", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAvailableInstanceCapacityList(&sv.AvailableInstanceCapacity, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availableVCpus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableVCpus = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailableInstanceCapacityList(v *[]types.InstanceCapacity, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceCapacity - if *v == nil { - sv = make([]types.InstanceCapacity, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceCapacity - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceCapacity(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentAvailableInstanceCapacityListUnwrapped(v *[]types.InstanceCapacity, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceCapacity - if *v == nil { - sv = make([]types.InstanceCapacity, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceCapacity - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceCapacity(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentBandwidthWeightingTypeList(v *[]types.BandwidthWeightingType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.BandwidthWeightingType - if *v == nil { - sv = make([]types.BandwidthWeightingType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.BandwidthWeightingType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.BandwidthWeightingType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBandwidthWeightingTypeListUnwrapped(v *[]types.BandwidthWeightingType, decoder smithyxml.NodeDecoder) error { - var sv []types.BandwidthWeightingType - if *v == nil { - sv = make([]types.BandwidthWeightingType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.BandwidthWeightingType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.BandwidthWeightingType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentBaselineEbsBandwidthMbps(v **types.BaselineEbsBandwidthMbps, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BaselineEbsBandwidthMbps - if *v == nil { - sv = &types.BaselineEbsBandwidthMbps{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBaselinePerformanceFactors(v **types.BaselinePerformanceFactors, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BaselinePerformanceFactors - if *v == nil { - sv = &types.BaselinePerformanceFactors{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cpu", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCpuPerformanceFactor(&sv.Cpu, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBlockDeviceMapping(v **types.BlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BlockDeviceMapping - if *v == nil { - sv = &types.BlockDeviceMapping{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("ebs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsBlockDevice(&sv.Ebs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("noDevice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NoDevice = ptr.String(xtv) - } - - case strings.EqualFold("virtualName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VirtualName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBlockDeviceMappingList(v *[]types.BlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.BlockDeviceMapping - if *v == nil { - sv = make([]types.BlockDeviceMapping, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.BlockDeviceMapping - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBlockDeviceMappingListUnwrapped(v *[]types.BlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - var sv []types.BlockDeviceMapping - if *v == nil { - sv = make([]types.BlockDeviceMapping, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.BlockDeviceMapping - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentBlockDeviceMappingResponse(v **types.BlockDeviceMappingResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BlockDeviceMappingResponse - if *v == nil { - sv = &types.BlockDeviceMappingResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("ebs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsBlockDeviceResponse(&sv.Ebs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("noDevice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NoDevice = ptr.String(xtv) - } - - case strings.EqualFold("virtualName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VirtualName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBlockDeviceMappingResponseList(v *[]types.BlockDeviceMappingResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.BlockDeviceMappingResponse - if *v == nil { - sv = make([]types.BlockDeviceMappingResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.BlockDeviceMappingResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentBlockDeviceMappingResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBlockDeviceMappingResponseListUnwrapped(v *[]types.BlockDeviceMappingResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.BlockDeviceMappingResponse - if *v == nil { - sv = make([]types.BlockDeviceMappingResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.BlockDeviceMappingResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentBlockDeviceMappingResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentBlockPublicAccessStates(v **types.BlockPublicAccessStates, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BlockPublicAccessStates - if *v == nil { - sv = &types.BlockPublicAccessStates{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("internetGatewayBlockMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InternetGatewayBlockMode = types.BlockPublicAccessMode(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBootModeTypeList(v *[]types.BootModeType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.BootModeType - if *v == nil { - sv = make([]types.BootModeType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.BootModeType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.BootModeType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBootModeTypeListUnwrapped(v *[]types.BootModeType, decoder smithyxml.NodeDecoder) error { - var sv []types.BootModeType - if *v == nil { - sv = make([]types.BootModeType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.BootModeType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.BootModeType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentBundleTask(v **types.BundleTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BundleTask - if *v == nil { - sv = &types.BundleTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bundleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BundleId = ptr.String(xtv) - } - - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBundleTaskError(&sv.BundleTaskError, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.BundleTaskState(xtv) - } - - case strings.EqualFold("storage", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStorage(&sv.Storage, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("updateTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdateTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBundleTaskError(v **types.BundleTaskError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.BundleTaskError - if *v == nil { - sv = &types.BundleTaskError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBundleTaskList(v *[]types.BundleTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.BundleTask - if *v == nil { - sv = make([]types.BundleTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.BundleTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentBundleTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentBundleTaskListUnwrapped(v *[]types.BundleTask, decoder smithyxml.NodeDecoder) error { - var sv []types.BundleTask - if *v == nil { - sv = make([]types.BundleTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.BundleTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentBundleTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentByoasn(v **types.Byoasn, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Byoasn - if *v == nil { - sv = &types.Byoasn{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Asn = ptr.String(xtv) - } - - case strings.EqualFold("ipamId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AsnState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentByoasnSet(v *[]types.Byoasn, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Byoasn - if *v == nil { - sv = make([]types.Byoasn, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Byoasn - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentByoasn(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentByoasnSetUnwrapped(v *[]types.Byoasn, decoder smithyxml.NodeDecoder) error { - var sv []types.Byoasn - if *v == nil { - sv = make([]types.Byoasn, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Byoasn - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentByoasn(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentByoipCidr(v **types.ByoipCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ByoipCidr - if *v == nil { - sv = &types.ByoipCidr{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asnAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAsnAssociationSet(&sv.AsnAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ByoipCidrState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentByoipCidrSet(v *[]types.ByoipCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ByoipCidr - if *v == nil { - sv = make([]types.ByoipCidr, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ByoipCidr - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentByoipCidr(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentByoipCidrSetUnwrapped(v *[]types.ByoipCidr, decoder smithyxml.NodeDecoder) error { - var sv []types.ByoipCidr - if *v == nil { - sv = make([]types.ByoipCidr, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ByoipCidr - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentByoipCidr(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCancelCapacityReservationFleetError(v **types.CancelCapacityReservationFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CancelCapacityReservationFleetError - if *v == nil { - sv = &types.CancelCapacityReservationFleetError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelledSpotInstanceRequest(v **types.CancelledSpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CancelledSpotInstanceRequest - if *v == nil { - sv = &types.CancelledSpotInstanceRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotInstanceRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotInstanceRequestId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CancelSpotInstanceRequestState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelledSpotInstanceRequestList(v *[]types.CancelledSpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CancelledSpotInstanceRequest - if *v == nil { - sv = make([]types.CancelledSpotInstanceRequest, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CancelledSpotInstanceRequest - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCancelledSpotInstanceRequest(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelledSpotInstanceRequestListUnwrapped(v *[]types.CancelledSpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - var sv []types.CancelledSpotInstanceRequest - if *v == nil { - sv = make([]types.CancelledSpotInstanceRequest, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CancelledSpotInstanceRequest - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCancelledSpotInstanceRequest(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsError(v **types.CancelSpotFleetRequestsError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CancelSpotFleetRequestsError - if *v == nil { - sv = &types.CancelSpotFleetRequestsError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.CancelBatchErrorCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorItem(v **types.CancelSpotFleetRequestsErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CancelSpotFleetRequestsErrorItem - if *v == nil { - sv = &types.CancelSpotFleetRequestsErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsError(&sv.Error, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorSet(v *[]types.CancelSpotFleetRequestsErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CancelSpotFleetRequestsErrorItem - if *v == nil { - sv = make([]types.CancelSpotFleetRequestsErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CancelSpotFleetRequestsErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorSetUnwrapped(v *[]types.CancelSpotFleetRequestsErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.CancelSpotFleetRequestsErrorItem - if *v == nil { - sv = make([]types.CancelSpotFleetRequestsErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CancelSpotFleetRequestsErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessItem(v **types.CancelSpotFleetRequestsSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CancelSpotFleetRequestsSuccessItem - if *v == nil { - sv = &types.CancelSpotFleetRequestsSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currentSpotFleetRequestState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrentSpotFleetRequestState = types.BatchState(xtv) - } - - case strings.EqualFold("previousSpotFleetRequestState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreviousSpotFleetRequestState = types.BatchState(xtv) - } - - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessSet(v *[]types.CancelSpotFleetRequestsSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CancelSpotFleetRequestsSuccessItem - if *v == nil { - sv = make([]types.CancelSpotFleetRequestsSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CancelSpotFleetRequestsSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessSetUnwrapped(v *[]types.CancelSpotFleetRequestsSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.CancelSpotFleetRequestsSuccessItem - if *v == nil { - sv = make([]types.CancelSpotFleetRequestsSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CancelSpotFleetRequestsSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityAllocation(v **types.CapacityAllocation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityAllocation - if *v == nil { - sv = &types.CapacityAllocation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationType = types.AllocationType(xtv) - } - - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityAllocations(v *[]types.CapacityAllocation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityAllocation - if *v == nil { - sv = make([]types.CapacityAllocation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityAllocation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityAllocation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityAllocationsUnwrapped(v *[]types.CapacityAllocation, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityAllocation - if *v == nil { - sv = make([]types.CapacityAllocation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityAllocation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityAllocation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityBlock(v **types.CapacityBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityBlock - if *v == nil { - sv = &types.CapacityBlock{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationIdSet(&sv.CapacityReservationIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CapacityBlockResourceState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ultraserverType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UltraserverType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockExtension(v **types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityBlockExtension - if *v == nil { - sv = &types.CapacityBlockExtension{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockExtensionDurationHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CapacityBlockExtensionDurationHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityBlockExtensionEndDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CapacityBlockExtensionEndDate = ptr.Time(t) - } - - case strings.EqualFold("capacityBlockExtensionOfferingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockExtensionOfferingId = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockExtensionPurchaseDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CapacityBlockExtensionPurchaseDate = ptr.Time(t) - } - - case strings.EqualFold("capacityBlockExtensionStartDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CapacityBlockExtensionStartDate = ptr.Time(t) - } - - case strings.EqualFold("capacityBlockExtensionStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockExtensionStatus = types.CapacityBlockExtensionStatus(xtv) - } - - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = ptr.String(xtv) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("upfrontFee", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontFee = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(v **types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityBlockExtensionOffering - if *v == nil { - sv = &types.CapacityBlockExtensionOffering{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockExtensionDurationHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CapacityBlockExtensionDurationHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityBlockExtensionEndDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CapacityBlockExtensionEndDate = ptr.Time(t) - } - - case strings.EqualFold("capacityBlockExtensionOfferingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockExtensionOfferingId = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockExtensionStartDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CapacityBlockExtensionStartDate = ptr.Time(t) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = ptr.String(xtv) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.CapacityReservationTenancy(xtv) - } - - case strings.EqualFold("upfrontFee", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontFee = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSet(v *[]types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityBlockExtensionOffering - if *v == nil { - sv = make([]types.CapacityBlockExtensionOffering, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityBlockExtensionOffering - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSetUnwrapped(v *[]types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityBlockExtensionOffering - if *v == nil { - sv = make([]types.CapacityBlockExtensionOffering, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityBlockExtensionOffering - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityBlockExtensionSet(v *[]types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityBlockExtension - if *v == nil { - sv = make([]types.CapacityBlockExtension, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityBlockExtension - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityBlockExtension(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockExtensionSetUnwrapped(v *[]types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityBlockExtension - if *v == nil { - sv = make([]types.CapacityBlockExtension, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityBlockExtension - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityBlockExtension(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityBlockOffering(v **types.CapacityBlockOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityBlockOffering - if *v == nil { - sv = &types.CapacityBlockOffering{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockDurationHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CapacityBlockDurationHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityBlockDurationMinutes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CapacityBlockDurationMinutes = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityBlockOfferingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockOfferingId = ptr.String(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = ptr.String(xtv) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.CapacityReservationTenancy(xtv) - } - - case strings.EqualFold("ultraserverCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UltraserverCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ultraserverType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UltraserverType = ptr.String(xtv) - } - - case strings.EqualFold("upfrontFee", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontFee = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockOfferingSet(v *[]types.CapacityBlockOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityBlockOffering - if *v == nil { - sv = make([]types.CapacityBlockOffering, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityBlockOffering - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityBlockOffering(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockOfferingSetUnwrapped(v *[]types.CapacityBlockOffering, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityBlockOffering - if *v == nil { - sv = make([]types.CapacityBlockOffering, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityBlockOffering - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityBlockOffering(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityBlockSet(v *[]types.CapacityBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityBlock - if *v == nil { - sv = make([]types.CapacityBlock, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityBlock - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityBlock(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockSetUnwrapped(v *[]types.CapacityBlock, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityBlock - if *v == nil { - sv = make([]types.CapacityBlock, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityBlock - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityBlock(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityBlockStatus(v **types.CapacityBlockStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityBlockStatus - if *v == nil { - sv = &types.CapacityBlockStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationStatusSet(&sv.CapacityReservationStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("interconnectStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterconnectStatus = types.CapacityBlockInterconnectStatus(xtv) - } - - case strings.EqualFold("totalAvailableCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalAvailableCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalUnavailableCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalUnavailableCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockStatusSet(v *[]types.CapacityBlockStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityBlockStatus - if *v == nil { - sv = make([]types.CapacityBlockStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityBlockStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityBlockStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityBlockStatusSetUnwrapped(v *[]types.CapacityBlockStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityBlockStatus - if *v == nil { - sv = make([]types.CapacityBlockStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityBlockStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityBlockStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservation(v **types.CapacityReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservation - if *v == nil { - sv = &types.CapacityReservation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("availableInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableInstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityAllocationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityAllocations(&sv.CapacityAllocations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("capacityBlockId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationArn = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationFleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("commitmentInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationCommitmentInfo(&sv.CommitmentInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("deliveryPreference", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliveryPreference = types.CapacityReservationDeliveryPreference(xtv) - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("endDateType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndDateType = types.EndDateType(xtv) - } - - case strings.EqualFold("ephemeralStorage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EphemeralStorage = ptr.Bool(xtv) - } - - case strings.EqualFold("instanceMatchCriteria", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMatchCriteria = types.InstanceMatchCriteria(xtv) - } - - case strings.EqualFold("instancePlatform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstancePlatform = types.CapacityReservationInstancePlatform(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("placementGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PlacementGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("reservationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservationType = types.CapacityReservationType(xtv) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CapacityReservationState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.CapacityReservationTenancy(xtv) - } - - case strings.EqualFold("totalInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalInstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("unusedReservationBillingOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UnusedReservationBillingOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationBillingRequest(v **types.CapacityReservationBillingRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationBillingRequest - if *v == nil { - sv = &types.CapacityReservationBillingRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationInfo(&sv.CapacityReservationInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastUpdateTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastUpdateTime = ptr.Time(t) - } - - case strings.EqualFold("requestedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RequestedBy = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.CapacityReservationBillingRequestStatus(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("unusedReservationBillingOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UnusedReservationBillingOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationBillingRequestSet(v *[]types.CapacityReservationBillingRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservationBillingRequest - if *v == nil { - sv = make([]types.CapacityReservationBillingRequest, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservationBillingRequest - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservationBillingRequest(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationBillingRequestSetUnwrapped(v *[]types.CapacityReservationBillingRequest, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservationBillingRequest - if *v == nil { - sv = make([]types.CapacityReservationBillingRequest, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservationBillingRequest - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservationBillingRequest(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationCommitmentInfo(v **types.CapacityReservationCommitmentInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationCommitmentInfo - if *v == nil { - sv = &types.CapacityReservationCommitmentInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("commitmentEndDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CommitmentEndDate = ptr.Time(t) - } - - case strings.EqualFold("committedInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CommittedInstanceCount = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationFleet(v **types.CapacityReservationFleet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationFleet - if *v == nil { - sv = &types.CapacityReservationFleet{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationStrategy = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationFleetArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetArn = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationFleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetId = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("instanceMatchCriteria", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMatchCriteria = types.FleetInstanceMatchCriteria(xtv) - } - - case strings.EqualFold("instanceTypeSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetCapacityReservationSet(&sv.InstanceTypeSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CapacityReservationFleetState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.FleetCapacityReservationTenancy(xtv) - } - - case strings.EqualFold("totalFulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.TotalFulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("totalTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalTargetCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationFleetCancellationState(v **types.CapacityReservationFleetCancellationState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationFleetCancellationState - if *v == nil { - sv = &types.CapacityReservationFleetCancellationState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationFleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetId = ptr.String(xtv) - } - - case strings.EqualFold("currentFleetState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrentFleetState = types.CapacityReservationFleetState(xtv) - } - - case strings.EqualFold("previousFleetState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreviousFleetState = types.CapacityReservationFleetState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationFleetCancellationStateSet(v *[]types.CapacityReservationFleetCancellationState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservationFleetCancellationState - if *v == nil { - sv = make([]types.CapacityReservationFleetCancellationState, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservationFleetCancellationState - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservationFleetCancellationState(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationFleetCancellationStateSetUnwrapped(v *[]types.CapacityReservationFleetCancellationState, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservationFleetCancellationState - if *v == nil { - sv = make([]types.CapacityReservationFleetCancellationState, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservationFleetCancellationState - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservationFleetCancellationState(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationFleetSet(v *[]types.CapacityReservationFleet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservationFleet - if *v == nil { - sv = make([]types.CapacityReservationFleet, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservationFleet - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservationFleet(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationFleetSetUnwrapped(v *[]types.CapacityReservationFleet, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservationFleet - if *v == nil { - sv = make([]types.CapacityReservationFleet, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservationFleet - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservationFleet(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationGroup(v **types.CapacityReservationGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationGroup - if *v == nil { - sv = &types.CapacityReservationGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationGroupSet(v *[]types.CapacityReservationGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservationGroup - if *v == nil { - sv = make([]types.CapacityReservationGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservationGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservationGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationGroupSetUnwrapped(v *[]types.CapacityReservationGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservationGroup - if *v == nil { - sv = make([]types.CapacityReservationGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservationGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservationGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationInfo(v **types.CapacityReservationInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationInfo - if *v == nil { - sv = &types.CapacityReservationInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.CapacityReservationTenancy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationOptions(v **types.CapacityReservationOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationOptions - if *v == nil { - sv = &types.CapacityReservationOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("usageStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UsageStrategy = types.FleetCapacityReservationUsageStrategy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationSet(v *[]types.CapacityReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservation - if *v == nil { - sv = make([]types.CapacityReservation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationSetUnwrapped(v *[]types.CapacityReservation, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservation - if *v == nil { - sv = make([]types.CapacityReservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationSpecificationResponse(v **types.CapacityReservationSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationSpecificationResponse - if *v == nil { - sv = &types.CapacityReservationSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationPreference", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationPreference = types.CapacityReservationPreference(xtv) - } - - case strings.EqualFold("capacityReservationTarget", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationTargetResponse(&sv.CapacityReservationTarget, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationStatus(v **types.CapacityReservationStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationStatus - if *v == nil { - sv = &types.CapacityReservationStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("totalAvailableCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalAvailableCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalUnavailableCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalUnavailableCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationStatusSet(v *[]types.CapacityReservationStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CapacityReservationStatus - if *v == nil { - sv = make([]types.CapacityReservationStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CapacityReservationStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCapacityReservationStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCapacityReservationStatusSetUnwrapped(v *[]types.CapacityReservationStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.CapacityReservationStatus - if *v == nil { - sv = make([]types.CapacityReservationStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CapacityReservationStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCapacityReservationStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCapacityReservationTargetResponse(v **types.CapacityReservationTargetResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CapacityReservationTargetResponse - if *v == nil { - sv = &types.CapacityReservationTargetResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationResourceGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationResourceGroupArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCarrierGateway(v **types.CarrierGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CarrierGateway - if *v == nil { - sv = &types.CarrierGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CarrierGatewayState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCarrierGatewaySet(v *[]types.CarrierGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CarrierGateway - if *v == nil { - sv = make([]types.CarrierGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CarrierGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCarrierGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCarrierGatewaySetUnwrapped(v *[]types.CarrierGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.CarrierGateway - if *v == nil { - sv = make([]types.CarrierGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CarrierGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCarrierGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCertificateAuthentication(v **types.CertificateAuthentication, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CertificateAuthentication - if *v == nil { - sv = &types.CertificateAuthentication{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientRootCertificateChain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientRootCertificateChain = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCidrBlock(v **types.CidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CidrBlock - if *v == nil { - sv = &types.CidrBlock{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCidrBlockSet(v *[]types.CidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CidrBlock - if *v == nil { - sv = make([]types.CidrBlock, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CidrBlock - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCidrBlockSetUnwrapped(v *[]types.CidrBlock, decoder smithyxml.NodeDecoder) error { - var sv []types.CidrBlock - if *v == nil { - sv = make([]types.CidrBlock, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CidrBlock - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClassicLinkDnsSupport(v **types.ClassicLinkDnsSupport, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClassicLinkDnsSupport - if *v == nil { - sv = &types.ClassicLinkDnsSupport{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("classicLinkDnsSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ClassicLinkDnsSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLinkDnsSupportList(v *[]types.ClassicLinkDnsSupport, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClassicLinkDnsSupport - if *v == nil { - sv = make([]types.ClassicLinkDnsSupport, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClassicLinkDnsSupport - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClassicLinkDnsSupport(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLinkDnsSupportListUnwrapped(v *[]types.ClassicLinkDnsSupport, decoder smithyxml.NodeDecoder) error { - var sv []types.ClassicLinkDnsSupport - if *v == nil { - sv = make([]types.ClassicLinkDnsSupport, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClassicLinkDnsSupport - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClassicLinkDnsSupport(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClassicLinkInstance(v **types.ClassicLinkInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClassicLinkInstance - if *v == nil { - sv = &types.ClassicLinkInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLinkInstanceList(v *[]types.ClassicLinkInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClassicLinkInstance - if *v == nil { - sv = make([]types.ClassicLinkInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClassicLinkInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClassicLinkInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLinkInstanceListUnwrapped(v *[]types.ClassicLinkInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.ClassicLinkInstance - if *v == nil { - sv = make([]types.ClassicLinkInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClassicLinkInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClassicLinkInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClassicLoadBalancer(v **types.ClassicLoadBalancer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClassicLoadBalancer - if *v == nil { - sv = &types.ClassicLoadBalancer{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLoadBalancers(v *[]types.ClassicLoadBalancer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClassicLoadBalancer - if *v == nil { - sv = make([]types.ClassicLoadBalancer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClassicLoadBalancer - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClassicLoadBalancer(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClassicLoadBalancersUnwrapped(v *[]types.ClassicLoadBalancer, decoder smithyxml.NodeDecoder) error { - var sv []types.ClassicLoadBalancer - if *v == nil { - sv = make([]types.ClassicLoadBalancer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClassicLoadBalancer - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClassicLoadBalancer(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClassicLoadBalancersConfig(v **types.ClassicLoadBalancersConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClassicLoadBalancersConfig - if *v == nil { - sv = &types.ClassicLoadBalancersConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("classicLoadBalancers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClassicLoadBalancers(&sv.ClassicLoadBalancers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientCertificateRevocationListStatus(v **types.ClientCertificateRevocationListStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientCertificateRevocationListStatus - if *v == nil { - sv = &types.ClientCertificateRevocationListStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientCertificateRevocationListStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientConnectResponseOptions(v **types.ClientConnectResponseOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientConnectResponseOptions - if *v == nil { - sv = &types.ClientConnectResponseOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - case strings.EqualFold("lambdaFunctionArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LambdaFunctionArn = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnEndpointAttributeStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientLoginBannerResponseOptions(v **types.ClientLoginBannerResponseOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientLoginBannerResponseOptions - if *v == nil { - sv = &types.ClientLoginBannerResponseOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bannerText", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BannerText = ptr.String(xtv) - } - - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientRouteEnforcementResponseOptions(v **types.ClientRouteEnforcementResponseOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientRouteEnforcementResponseOptions - if *v == nil { - sv = &types.ClientRouteEnforcementResponseOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enforced", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enforced = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnAuthentication(v **types.ClientVpnAuthentication, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnAuthentication - if *v == nil { - sv = &types.ClientVpnAuthentication{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activeDirectory", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDirectoryServiceAuthentication(&sv.ActiveDirectory, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("federatedAuthentication", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFederatedAuthentication(&sv.FederatedAuthentication, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("mutualAuthentication", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCertificateAuthentication(&sv.MutualAuthentication, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.ClientVpnAuthenticationType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnAuthenticationList(v *[]types.ClientVpnAuthentication, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClientVpnAuthentication - if *v == nil { - sv = make([]types.ClientVpnAuthentication, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClientVpnAuthentication - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClientVpnAuthentication(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnAuthenticationListUnwrapped(v *[]types.ClientVpnAuthentication, decoder smithyxml.NodeDecoder) error { - var sv []types.ClientVpnAuthentication - if *v == nil { - sv = make([]types.ClientVpnAuthentication, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClientVpnAuthentication - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClientVpnAuthentication(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClientVpnAuthorizationRuleStatus(v **types.ClientVpnAuthorizationRuleStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnAuthorizationRuleStatus - if *v == nil { - sv = &types.ClientVpnAuthorizationRuleStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientVpnAuthorizationRuleStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnConnection(v **types.ClientVpnConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnConnection - if *v == nil { - sv = &types.ClientVpnConnection{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientIp = ptr.String(xtv) - } - - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("commonName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CommonName = ptr.String(xtv) - } - - case strings.EqualFold("connectionEndTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionEndTime = ptr.String(xtv) - } - - case strings.EqualFold("connectionEstablishedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionEstablishedTime = ptr.String(xtv) - } - - case strings.EqualFold("connectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionId = ptr.String(xtv) - } - - case strings.EqualFold("egressBytes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EgressBytes = ptr.String(xtv) - } - - case strings.EqualFold("egressPackets", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EgressPackets = ptr.String(xtv) - } - - case strings.EqualFold("ingressBytes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IngressBytes = ptr.String(xtv) - } - - case strings.EqualFold("ingressPackets", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IngressPackets = ptr.String(xtv) - } - - case strings.EqualFold("postureComplianceStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.PostureComplianceStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnConnectionStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Timestamp = ptr.String(xtv) - } - - case strings.EqualFold("username", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Username = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnConnectionSet(v *[]types.ClientVpnConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClientVpnConnection - if *v == nil { - sv = make([]types.ClientVpnConnection, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClientVpnConnection - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClientVpnConnection(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnConnectionSetUnwrapped(v *[]types.ClientVpnConnection, decoder smithyxml.NodeDecoder) error { - var sv []types.ClientVpnConnection - if *v == nil { - sv = make([]types.ClientVpnConnection, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClientVpnConnection - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClientVpnConnection(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClientVpnConnectionStatus(v **types.ClientVpnConnectionStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnConnectionStatus - if *v == nil { - sv = &types.ClientVpnConnectionStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientVpnConnectionStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnEndpoint(v **types.ClientVpnEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnEndpoint - if *v == nil { - sv = &types.ClientVpnEndpoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedTargetNetwork", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociatedTargetNetworkSet(&sv.AssociatedTargetNetworks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("authenticationOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnAuthenticationList(&sv.AuthenticationOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("clientConnectOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientConnectResponseOptions(&sv.ClientConnectOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientLoginBannerOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientLoginBannerResponseOptions(&sv.ClientLoginBannerOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientRouteEnforcementOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientRouteEnforcementResponseOptions(&sv.ClientRouteEnforcementOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("connectionLogOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionLogResponseOptions(&sv.ConnectionLogOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationTime = ptr.String(xtv) - } - - case strings.EqualFold("deletionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeletionTime = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("disconnectOnSessionTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DisconnectOnSessionTimeout = ptr.Bool(xtv) - } - - case strings.EqualFold("dnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsName = ptr.String(xtv) - } - - case strings.EqualFold("dnsServer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DnsServers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnSecurityGroupIdSet(&sv.SecurityGroupIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("selfServicePortalUrl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SelfServicePortalUrl = ptr.String(xtv) - } - - case strings.EqualFold("serverCertificateArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServerCertificateArn = ptr.String(xtv) - } - - case strings.EqualFold("sessionTimeoutHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SessionTimeoutHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("splitTunnel", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SplitTunnel = ptr.Bool(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnEndpointStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transportProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransportProtocol = types.TransportProtocol(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - case strings.EqualFold("vpnPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VpnPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("vpnProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnProtocol = types.VpnProtocol(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnEndpointAttributeStatus(v **types.ClientVpnEndpointAttributeStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnEndpointAttributeStatus - if *v == nil { - sv = &types.ClientVpnEndpointAttributeStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientVpnEndpointAttributeStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnEndpointStatus(v **types.ClientVpnEndpointStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnEndpointStatus - if *v == nil { - sv = &types.ClientVpnEndpointStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientVpnEndpointStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnRoute(v **types.ClientVpnRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnRoute - if *v == nil { - sv = &types.ClientVpnRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidr = ptr.String(xtv) - } - - case strings.EqualFold("origin", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Origin = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnRouteStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetSubnet", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetSubnet = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnRouteSet(v *[]types.ClientVpnRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClientVpnRoute - if *v == nil { - sv = make([]types.ClientVpnRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClientVpnRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClientVpnRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnRouteSetUnwrapped(v *[]types.ClientVpnRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.ClientVpnRoute - if *v == nil { - sv = make([]types.ClientVpnRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClientVpnRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClientVpnRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentClientVpnRouteStatus(v **types.ClientVpnRouteStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ClientVpnRouteStatus - if *v == nil { - sv = &types.ClientVpnRouteStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.ClientVpnRouteStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnSecurityGroupIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentClientVpnSecurityGroupIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCloudWatchLogOptions(v **types.CloudWatchLogOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CloudWatchLogOptions - if *v == nil { - sv = &types.CloudWatchLogOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("logEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.LogEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("logGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("logOutputFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogOutputFormat = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipAddressUsage(v **types.CoipAddressUsage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CoipAddressUsage - if *v == nil { - sv = &types.CoipAddressUsage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("awsAccountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsAccountId = ptr.String(xtv) - } - - case strings.EqualFold("awsService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsService = ptr.String(xtv) - } - - case strings.EqualFold("coIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoIp = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipAddressUsageSet(v *[]types.CoipAddressUsage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CoipAddressUsage - if *v == nil { - sv = make([]types.CoipAddressUsage, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CoipAddressUsage - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCoipAddressUsage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipAddressUsageSetUnwrapped(v *[]types.CoipAddressUsage, decoder smithyxml.NodeDecoder) error { - var sv []types.CoipAddressUsage - if *v == nil { - sv = make([]types.CoipAddressUsage, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CoipAddressUsage - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCoipAddressUsage(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCoipCidr(v **types.CoipCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CoipCidr - if *v == nil { - sv = &types.CoipCidr{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("coipPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoipPoolId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipPool(v **types.CoipPool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CoipPool - if *v == nil { - sv = &types.CoipPool{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("poolArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolArn = ptr.String(xtv) - } - - case strings.EqualFold("poolCidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.PoolCidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipPoolSet(v *[]types.CoipPool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CoipPool - if *v == nil { - sv = make([]types.CoipPool, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CoipPool - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCoipPool(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoipPoolSetUnwrapped(v *[]types.CoipPool, decoder smithyxml.NodeDecoder) error { - var sv []types.CoipPool - if *v == nil { - sv = make([]types.CoipPool, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CoipPool - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCoipPool(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentConnectionLogResponseOptions(v **types.ConnectionLogResponseOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionLogResponseOptions - if *v == nil { - sv = &types.ConnectionLogResponseOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("CloudwatchLogGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CloudwatchLogGroup = ptr.String(xtv) - } - - case strings.EqualFold("CloudwatchLogStream", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CloudwatchLogStream = ptr.String(xtv) - } - - case strings.EqualFold("Enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionNotification(v **types.ConnectionNotification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionNotification - if *v == nil { - sv = &types.ConnectionNotification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connectionEvents", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.ConnectionEvents, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("connectionNotificationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionNotificationArn = ptr.String(xtv) - } - - case strings.EqualFold("connectionNotificationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionNotificationId = ptr.String(xtv) - } - - case strings.EqualFold("connectionNotificationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionNotificationState = types.ConnectionNotificationState(xtv) - } - - case strings.EqualFold("connectionNotificationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionNotificationType = types.ConnectionNotificationType(xtv) - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("serviceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceRegion = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionNotificationSet(v *[]types.ConnectionNotification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ConnectionNotification - if *v == nil { - sv = make([]types.ConnectionNotification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ConnectionNotification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentConnectionNotification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionNotificationSetUnwrapped(v *[]types.ConnectionNotification, decoder smithyxml.NodeDecoder) error { - var sv []types.ConnectionNotification - if *v == nil { - sv = make([]types.ConnectionNotification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ConnectionNotification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentConnectionNotification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentConnectionTrackingConfiguration(v **types.ConnectionTrackingConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionTrackingConfiguration - if *v == nil { - sv = &types.ConnectionTrackingConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpStreamTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpStreamTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpTimeout = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionTrackingSpecification(v **types.ConnectionTrackingSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionTrackingSpecification - if *v == nil { - sv = &types.ConnectionTrackingSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpStreamTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpStreamTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpTimeout = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionTrackingSpecificationRequest(v **types.ConnectionTrackingSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionTrackingSpecificationRequest - if *v == nil { - sv = &types.ConnectionTrackingSpecificationRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("TcpEstablishedTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("UdpStreamTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpStreamTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("UdpTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpTimeout = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConnectionTrackingSpecificationResponse(v **types.ConnectionTrackingSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConnectionTrackingSpecificationResponse - if *v == nil { - sv = &types.ConnectionTrackingSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpStreamTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpStreamTimeout = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("udpTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UdpTimeout = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentConversionTask(v **types.ConversionTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ConversionTask - if *v == nil { - sv = &types.ConversionTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("conversionTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConversionTaskId = ptr.String(xtv) - } - - case strings.EqualFold("expirationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExpirationTime = ptr.String(xtv) - } - - case strings.EqualFold("importInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportInstanceTaskDetails(&sv.ImportInstance, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("importVolume", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportVolumeTaskDetails(&sv.ImportVolume, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ConversionTaskState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoreCountList(v *[]int32, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col int32 - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - col = int32(i64) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCoreCountListUnwrapped(v *[]int32, decoder smithyxml.NodeDecoder) error { - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - switch { - default: - var mv int32 - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - mv = int32(i64) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCpuManufacturerSet(v *[]types.CpuManufacturer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CpuManufacturer - if *v == nil { - sv = make([]types.CpuManufacturer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CpuManufacturer - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.CpuManufacturer(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCpuManufacturerSetUnwrapped(v *[]types.CpuManufacturer, decoder smithyxml.NodeDecoder) error { - var sv []types.CpuManufacturer - if *v == nil { - sv = make([]types.CpuManufacturer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CpuManufacturer - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.CpuManufacturer(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCpuOptions(v **types.CpuOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CpuOptions - if *v == nil { - sv = &types.CpuOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amdSevSnp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AmdSevSnp = types.AmdSevSnpSpecification(xtv) - } - - case strings.EqualFold("coreCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CoreCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("threadsPerCore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ThreadsPerCore = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCpuPerformanceFactor(v **types.CpuPerformanceFactor, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CpuPerformanceFactor - if *v == nil { - sv = &types.CpuPerformanceFactor{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("referenceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPerformanceFactorReferenceSet(&sv.References, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateFleetError(v **types.CreateFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CreateFleetError - if *v == nil { - sv = &types.CreateFleetError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("errorCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ErrorCode = ptr.String(xtv) - } - - case strings.EqualFold("errorMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ErrorMessage = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateAndOverrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateAndOverridesResponse(&sv.LaunchTemplateAndOverrides, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lifecycle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Lifecycle = types.InstanceLifecycle(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateFleetErrorsSet(v *[]types.CreateFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CreateFleetError - if *v == nil { - sv = make([]types.CreateFleetError, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CreateFleetError - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCreateFleetError(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateFleetErrorsSetUnwrapped(v *[]types.CreateFleetError, decoder smithyxml.NodeDecoder) error { - var sv []types.CreateFleetError - if *v == nil { - sv = make([]types.CreateFleetError, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CreateFleetError - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCreateFleetError(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCreateFleetInstance(v **types.CreateFleetInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CreateFleetInstance - if *v == nil { - sv = &types.CreateFleetInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIdsSet(&sv.InstanceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("launchTemplateAndOverrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateAndOverridesResponse(&sv.LaunchTemplateAndOverrides, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lifecycle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Lifecycle = types.InstanceLifecycle(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = types.PlatformValues(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateFleetInstancesSet(v *[]types.CreateFleetInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CreateFleetInstance - if *v == nil { - sv = make([]types.CreateFleetInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CreateFleetInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCreateFleetInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateFleetInstancesSetUnwrapped(v *[]types.CreateFleetInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.CreateFleetInstance - if *v == nil { - sv = make([]types.CreateFleetInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CreateFleetInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCreateFleetInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCreateVolumePermission(v **types.CreateVolumePermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CreateVolumePermission - if *v == nil { - sv = &types.CreateVolumePermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("group", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Group = types.PermissionGroup(xtv) - } - - case strings.EqualFold("userId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateVolumePermissionList(v *[]types.CreateVolumePermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CreateVolumePermission - if *v == nil { - sv = make([]types.CreateVolumePermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CreateVolumePermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCreateVolumePermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCreateVolumePermissionListUnwrapped(v *[]types.CreateVolumePermission, decoder smithyxml.NodeDecoder) error { - var sv []types.CreateVolumePermission - if *v == nil { - sv = make([]types.CreateVolumePermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CreateVolumePermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCreateVolumePermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentCreditSpecification(v **types.CreditSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CreditSpecification - if *v == nil { - sv = &types.CreditSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cpuCredits", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CpuCredits = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCustomerGateway(v **types.CustomerGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.CustomerGateway - if *v == nil { - sv = &types.CustomerGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bgpAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BgpAsn = ptr.String(xtv) - } - - case strings.EqualFold("bgpAsnExtended", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BgpAsnExtended = ptr.String(xtv) - } - - case strings.EqualFold("certificateArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateArn = ptr.String(xtv) - } - - case strings.EqualFold("customerGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("ipAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpAddress = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCustomerGatewayList(v *[]types.CustomerGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.CustomerGateway - if *v == nil { - sv = make([]types.CustomerGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.CustomerGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentCustomerGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentCustomerGatewayListUnwrapped(v *[]types.CustomerGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.CustomerGateway - if *v == nil { - sv = make([]types.CustomerGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.CustomerGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentCustomerGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDataResponse(v **types.DataResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DataResponse - if *v == nil { - sv = &types.DataResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Destination = ptr.String(xtv) - } - - case strings.EqualFold("id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("metric", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Metric = types.MetricType(xtv) - } - - case strings.EqualFold("metricPointSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMetricPoints(&sv.MetricPoints, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("period", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Period = types.PeriodType(xtv) - } - - case strings.EqualFold("source", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Source = ptr.String(xtv) - } - - case strings.EqualFold("statistic", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Statistic = types.StatisticType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDataResponses(v *[]types.DataResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DataResponse - if *v == nil { - sv = make([]types.DataResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DataResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDataResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDataResponsesUnwrapped(v *[]types.DataResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.DataResponse - if *v == nil { - sv = make([]types.DataResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DataResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDataResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeclarativePoliciesReport(v **types.DeclarativePoliciesReport, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeclarativePoliciesReport - if *v == nil { - sv = &types.DeclarativePoliciesReport{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("endTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndTime = ptr.Time(t) - } - - case strings.EqualFold("reportId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReportId = ptr.String(xtv) - } - - case strings.EqualFold("s3Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Bucket = ptr.String(xtv) - } - - case strings.EqualFold("s3Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Prefix = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.ReportState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeclarativePoliciesReportList(v *[]types.DeclarativePoliciesReport, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeclarativePoliciesReport - if *v == nil { - sv = make([]types.DeclarativePoliciesReport, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeclarativePoliciesReport - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeclarativePoliciesReport(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeclarativePoliciesReportListUnwrapped(v *[]types.DeclarativePoliciesReport, decoder smithyxml.NodeDecoder) error { - var sv []types.DeclarativePoliciesReport - if *v == nil { - sv = make([]types.DeclarativePoliciesReport, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeclarativePoliciesReport - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeclarativePoliciesReport(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDedicatedHostIdList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDedicatedHostIdListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteFleetError(v **types.DeleteFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteFleetError - if *v == nil { - sv = &types.DeleteFleetError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.DeleteFleetErrorCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteFleetErrorItem(v **types.DeleteFleetErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteFleetErrorItem - if *v == nil { - sv = &types.DeleteFleetErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteFleetError(&sv.Error, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteFleetErrorSet(v *[]types.DeleteFleetErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeleteFleetErrorItem - if *v == nil { - sv = make([]types.DeleteFleetErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeleteFleetErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeleteFleetErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteFleetErrorSetUnwrapped(v *[]types.DeleteFleetErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteFleetErrorItem - if *v == nil { - sv = make([]types.DeleteFleetErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeleteFleetErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeleteFleetErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteFleetSuccessItem(v **types.DeleteFleetSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteFleetSuccessItem - if *v == nil { - sv = &types.DeleteFleetSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currentFleetState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrentFleetState = types.FleetStateCode(xtv) - } - - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - case strings.EqualFold("previousFleetState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreviousFleetState = types.FleetStateCode(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteFleetSuccessSet(v *[]types.DeleteFleetSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeleteFleetSuccessItem - if *v == nil { - sv = make([]types.DeleteFleetSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeleteFleetSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeleteFleetSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteFleetSuccessSetUnwrapped(v *[]types.DeleteFleetSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteFleetSuccessItem - if *v == nil { - sv = make([]types.DeleteFleetSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeleteFleetSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeleteFleetSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorItem(v **types.DeleteLaunchTemplateVersionsResponseErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteLaunchTemplateVersionsResponseErrorItem - if *v == nil { - sv = &types.DeleteLaunchTemplateVersionsResponseErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("responseError", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseError(&sv.ResponseError, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("versionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VersionNumber = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorSet(v *[]types.DeleteLaunchTemplateVersionsResponseErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeleteLaunchTemplateVersionsResponseErrorItem - if *v == nil { - sv = make([]types.DeleteLaunchTemplateVersionsResponseErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeleteLaunchTemplateVersionsResponseErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorSetUnwrapped(v *[]types.DeleteLaunchTemplateVersionsResponseErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteLaunchTemplateVersionsResponseErrorItem - if *v == nil { - sv = make([]types.DeleteLaunchTemplateVersionsResponseErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeleteLaunchTemplateVersionsResponseErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessItem(v **types.DeleteLaunchTemplateVersionsResponseSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteLaunchTemplateVersionsResponseSuccessItem - if *v == nil { - sv = &types.DeleteLaunchTemplateVersionsResponseSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("versionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VersionNumber = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessSet(v *[]types.DeleteLaunchTemplateVersionsResponseSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeleteLaunchTemplateVersionsResponseSuccessItem - if *v == nil { - sv = make([]types.DeleteLaunchTemplateVersionsResponseSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeleteLaunchTemplateVersionsResponseSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessSetUnwrapped(v *[]types.DeleteLaunchTemplateVersionsResponseSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteLaunchTemplateVersionsResponseSuccessItem - if *v == nil { - sv = make([]types.DeleteLaunchTemplateVersionsResponseSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeleteLaunchTemplateVersionsResponseSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteQueuedReservedInstancesError(v **types.DeleteQueuedReservedInstancesError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteQueuedReservedInstancesError - if *v == nil { - sv = &types.DeleteQueuedReservedInstancesError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.DeleteQueuedReservedInstancesErrorCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteSnapshotResultSet(v *[]types.DeleteSnapshotReturnCode, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeleteSnapshotReturnCode - if *v == nil { - sv = make([]types.DeleteSnapshotReturnCode, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeleteSnapshotReturnCode - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDeleteSnapshotReturnCode(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeleteSnapshotResultSetUnwrapped(v *[]types.DeleteSnapshotReturnCode, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteSnapshotReturnCode - if *v == nil { - sv = make([]types.DeleteSnapshotReturnCode, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeleteSnapshotReturnCode - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDeleteSnapshotReturnCode(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDeleteSnapshotReturnCode(v **types.DeleteSnapshotReturnCode, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeleteSnapshotReturnCode - if *v == nil { - sv = &types.DeleteSnapshotReturnCode{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("returnCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReturnCode = types.SnapshotReturnCodes(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeprovisionedAddressSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeprovisionedAddressSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDescribeConversionTaskList(v *[]types.ConversionTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ConversionTask - if *v == nil { - sv = make([]types.ConversionTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ConversionTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentConversionTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeConversionTaskListUnwrapped(v *[]types.ConversionTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ConversionTask - if *v == nil { - sv = make([]types.ConversionTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ConversionTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentConversionTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessItem(v **types.DescribeFastLaunchImagesSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DescribeFastLaunchImagesSuccessItem - if *v == nil { - sv = &types.DescribeFastLaunchImagesSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchLaunchTemplateSpecificationResponse(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxParallelLaunches", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxParallelLaunches = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.FastLaunchResourceType(xtv) - } - - case strings.EqualFold("snapshotConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchSnapshotConfigurationResponse(&sv.SnapshotConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastLaunchStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - case strings.EqualFold("stateTransitionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StateTransitionTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessSet(v *[]types.DescribeFastLaunchImagesSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DescribeFastLaunchImagesSuccessItem - if *v == nil { - sv = make([]types.DescribeFastLaunchImagesSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DescribeFastLaunchImagesSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessSetUnwrapped(v *[]types.DescribeFastLaunchImagesSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DescribeFastLaunchImagesSuccessItem - if *v == nil { - sv = make([]types.DescribeFastLaunchImagesSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DescribeFastLaunchImagesSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessItem(v **types.DescribeFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DescribeFastSnapshotRestoreSuccessItem - if *v == nil { - sv = &types.DescribeFastSnapshotRestoreSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("disabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisabledTime = ptr.Time(t) - } - - case strings.EqualFold("disablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisablingTime = ptr.Time(t) - } - - case strings.EqualFold("enabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnabledTime = ptr.Time(t) - } - - case strings.EqualFold("enablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnablingTime = ptr.Time(t) - } - - case strings.EqualFold("optimizingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.OptimizingTime = ptr.Time(t) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastSnapshotRestoreStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessSet(v *[]types.DescribeFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DescribeFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.DescribeFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DescribeFastSnapshotRestoreSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessSetUnwrapped(v *[]types.DescribeFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DescribeFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.DescribeFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DescribeFastSnapshotRestoreSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDescribeFleetError(v **types.DescribeFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DescribeFleetError - if *v == nil { - sv = &types.DescribeFleetError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("errorCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ErrorCode = ptr.String(xtv) - } - - case strings.EqualFold("errorMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ErrorMessage = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateAndOverrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateAndOverridesResponse(&sv.LaunchTemplateAndOverrides, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lifecycle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Lifecycle = types.InstanceLifecycle(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFleetsErrorSet(v *[]types.DescribeFleetError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DescribeFleetError - if *v == nil { - sv = make([]types.DescribeFleetError, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DescribeFleetError - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDescribeFleetError(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFleetsErrorSetUnwrapped(v *[]types.DescribeFleetError, decoder smithyxml.NodeDecoder) error { - var sv []types.DescribeFleetError - if *v == nil { - sv = make([]types.DescribeFleetError, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DescribeFleetError - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDescribeFleetError(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDescribeFleetsInstances(v **types.DescribeFleetsInstances, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DescribeFleetsInstances - if *v == nil { - sv = &types.DescribeFleetsInstances{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIdsSet(&sv.InstanceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("launchTemplateAndOverrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateAndOverridesResponse(&sv.LaunchTemplateAndOverrides, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lifecycle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Lifecycle = types.InstanceLifecycle(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = types.PlatformValues(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFleetsInstancesSet(v *[]types.DescribeFleetsInstances, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DescribeFleetsInstances - if *v == nil { - sv = make([]types.DescribeFleetsInstances, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DescribeFleetsInstances - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDescribeFleetsInstances(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDescribeFleetsInstancesSetUnwrapped(v *[]types.DescribeFleetsInstances, decoder smithyxml.NodeDecoder) error { - var sv []types.DescribeFleetsInstances - if *v == nil { - sv = make([]types.DescribeFleetsInstances, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DescribeFleetsInstances - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDescribeFleetsInstances(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDestinationOptionsResponse(v **types.DestinationOptionsResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DestinationOptionsResponse - if *v == nil { - sv = &types.DestinationOptionsResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fileFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FileFormat = types.DestinationFileFormat(xtv) - } - - case strings.EqualFold("hiveCompatiblePartitions", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.HiveCompatiblePartitions = ptr.Bool(xtv) - } - - case strings.EqualFold("perHourPartition", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PerHourPartition = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeviceOptions(v **types.DeviceOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DeviceOptions - if *v == nil { - sv = &types.DeviceOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("publicSigningKeyUrl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicSigningKeyUrl = ptr.String(xtv) - } - - case strings.EqualFold("tenantId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TenantId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeviceTrustProviderTypeList(v *[]types.DeviceTrustProviderType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DeviceTrustProviderType - if *v == nil { - sv = make([]types.DeviceTrustProviderType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DeviceTrustProviderType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.DeviceTrustProviderType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDeviceTrustProviderTypeListUnwrapped(v *[]types.DeviceTrustProviderType, decoder smithyxml.NodeDecoder) error { - var sv []types.DeviceTrustProviderType - if *v == nil { - sv = make([]types.DeviceTrustProviderType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DeviceTrustProviderType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.DeviceTrustProviderType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDhcpConfiguration(v **types.DhcpConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DhcpConfiguration - if *v == nil { - sv = &types.DhcpConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Key = ptr.String(xtv) - } - - case strings.EqualFold("valueSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDhcpConfigurationValueList(&sv.Values, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDhcpConfigurationList(v *[]types.DhcpConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DhcpConfiguration - if *v == nil { - sv = make([]types.DhcpConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DhcpConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDhcpConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDhcpConfigurationListUnwrapped(v *[]types.DhcpConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.DhcpConfiguration - if *v == nil { - sv = make([]types.DhcpConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DhcpConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDhcpConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDhcpConfigurationValueList(v *[]types.AttributeValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.AttributeValue - if *v == nil { - sv = make([]types.AttributeValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.AttributeValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentAttributeValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDhcpConfigurationValueListUnwrapped(v *[]types.AttributeValue, decoder smithyxml.NodeDecoder) error { - var sv []types.AttributeValue - if *v == nil { - sv = make([]types.AttributeValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.AttributeValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentAttributeValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDhcpOptions(v **types.DhcpOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DhcpOptions - if *v == nil { - sv = &types.DhcpOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dhcpConfigurationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDhcpConfigurationList(&sv.DhcpConfigurations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("dhcpOptionsId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DhcpOptionsId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDhcpOptionsList(v *[]types.DhcpOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DhcpOptions - if *v == nil { - sv = make([]types.DhcpOptions, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DhcpOptions - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDhcpOptions(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDhcpOptionsListUnwrapped(v *[]types.DhcpOptions, decoder smithyxml.NodeDecoder) error { - var sv []types.DhcpOptions - if *v == nil { - sv = make([]types.DhcpOptions, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DhcpOptions - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDhcpOptions(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDirectoryServiceAuthentication(v **types.DirectoryServiceAuthentication, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DirectoryServiceAuthentication - if *v == nil { - sv = &types.DirectoryServiceAuthentication{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("directoryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DirectoryId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorItem(v **types.DisableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DisableFastSnapshotRestoreErrorItem - if *v == nil { - sv = &types.DisableFastSnapshotRestoreErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fastSnapshotRestoreStateErrorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorSet(&sv.FastSnapshotRestoreStateErrors, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorSet(v *[]types.DisableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DisableFastSnapshotRestoreErrorItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DisableFastSnapshotRestoreErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorSetUnwrapped(v *[]types.DisableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DisableFastSnapshotRestoreErrorItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DisableFastSnapshotRestoreErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateError(v **types.DisableFastSnapshotRestoreStateError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DisableFastSnapshotRestoreStateError - if *v == nil { - sv = &types.DisableFastSnapshotRestoreStateError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorItem(v **types.DisableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DisableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = &types.DisableFastSnapshotRestoreStateErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateError(&sv.Error, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorSet(v *[]types.DisableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DisableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreStateErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DisableFastSnapshotRestoreStateErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorSetUnwrapped(v *[]types.DisableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DisableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreStateErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DisableFastSnapshotRestoreStateErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreStateErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessItem(v **types.DisableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DisableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = &types.DisableFastSnapshotRestoreSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("disabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisabledTime = ptr.Time(t) - } - - case strings.EqualFold("disablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisablingTime = ptr.Time(t) - } - - case strings.EqualFold("enabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnabledTime = ptr.Time(t) - } - - case strings.EqualFold("enablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnablingTime = ptr.Time(t) - } - - case strings.EqualFold("optimizingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.OptimizingTime = ptr.Time(t) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastSnapshotRestoreStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessSet(v *[]types.DisableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DisableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DisableFastSnapshotRestoreSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessSetUnwrapped(v *[]types.DisableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.DisableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.DisableFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DisableFastSnapshotRestoreSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDiskImageDescription(v **types.DiskImageDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DiskImageDescription - if *v == nil { - sv = &types.DiskImageDescription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("checksum", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Checksum = ptr.String(xtv) - } - - case strings.EqualFold("format", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Format = types.DiskImageFormat(xtv) - } - - case strings.EqualFold("importManifestUrl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportManifestUrl = ptr.String(xtv) - } - - case strings.EqualFold("size", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Size = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDiskImageVolumeDescription(v **types.DiskImageVolumeDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DiskImageVolumeDescription - if *v == nil { - sv = &types.DiskImageVolumeDescription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("size", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Size = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDiskInfo(v **types.DiskInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DiskInfo - if *v == nil { - sv = &types.DiskInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("sizeInGB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInGB = ptr.Int64(i64) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.DiskType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDiskInfoList(v *[]types.DiskInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DiskInfo - if *v == nil { - sv = make([]types.DiskInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DiskInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDiskInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDiskInfoListUnwrapped(v *[]types.DiskInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.DiskInfo - if *v == nil { - sv = make([]types.DiskInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DiskInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDiskInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDnsEntry(v **types.DnsEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DnsEntry - if *v == nil { - sv = &types.DnsEntry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsName = ptr.String(xtv) - } - - case strings.EqualFold("hostedZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostedZoneId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDnsEntrySet(v *[]types.DnsEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DnsEntry - if *v == nil { - sv = make([]types.DnsEntry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.DnsEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentDnsEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentDnsEntrySetUnwrapped(v *[]types.DnsEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.DnsEntry - if *v == nil { - sv = make([]types.DnsEntry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.DnsEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentDnsEntry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentDnsOptions(v **types.DnsOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DnsOptions - if *v == nil { - sv = &types.DnsOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dnsRecordIpType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsRecordIpType = types.DnsRecordIpType(xtv) - } - - case strings.EqualFold("privateDnsOnlyForInboundResolverEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PrivateDnsOnlyForInboundResolverEndpoint = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsBlockDevice(v **types.EbsBlockDevice, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsBlockDevice - if *v == nil { - sv = &types.EbsBlockDevice{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("AvailabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("iops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Iops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("throughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("VolumeInitializationRate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeInitializationRate = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeType = types.VolumeType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsBlockDeviceResponse(v **types.EbsBlockDeviceResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsBlockDeviceResponse - if *v == nil { - sv = &types.EbsBlockDeviceResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("iops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Iops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("throughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeType = types.VolumeType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsInfo(v **types.EbsInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsInfo - if *v == nil { - sv = &types.EbsInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ebsOptimizedInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsOptimizedInfo(&sv.EbsOptimizedInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ebsOptimizedSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EbsOptimizedSupport = types.EbsOptimizedSupport(xtv) - } - - case strings.EqualFold("encryptionSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EncryptionSupport = types.EbsEncryptionSupport(xtv) - } - - case strings.EqualFold("nvmeSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NvmeSupport = types.EbsNvmeSupport(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsInstanceBlockDevice(v **types.EbsInstanceBlockDevice, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsInstanceBlockDevice - if *v == nil { - sv = &types.EbsInstanceBlockDevice{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResource = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.AttachmentStatus(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsOptimizedInfo(v **types.EbsOptimizedInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsOptimizedInfo - if *v == nil { - sv = &types.EbsOptimizedInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("baselineBandwidthInMbps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BaselineBandwidthInMbps = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("baselineIops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BaselineIops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("baselineThroughputInMBps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.BaselineThroughputInMBps = ptr.Float64(f64) - } - - case strings.EqualFold("maximumBandwidthInMbps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumBandwidthInMbps = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumIops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumIops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumThroughputInMBps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.MaximumThroughputInMBps = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsStatusDetails(v **types.EbsStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsStatusDetails - if *v == nil { - sv = &types.EbsStatusDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("impairedSince", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ImpairedSince = ptr.Time(t) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = types.StatusName(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.StatusType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsStatusDetailsList(v *[]types.EbsStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.EbsStatusDetails - if *v == nil { - sv = make([]types.EbsStatusDetails, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.EbsStatusDetails - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEbsStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEbsStatusDetailsListUnwrapped(v *[]types.EbsStatusDetails, decoder smithyxml.NodeDecoder) error { - var sv []types.EbsStatusDetails - if *v == nil { - sv = make([]types.EbsStatusDetails, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.EbsStatusDetails - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEbsStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEbsStatusSummary(v **types.EbsStatusSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EbsStatusSummary - if *v == nil { - sv = &types.EbsStatusSummary{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("details", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsStatusDetailsList(&sv.Details, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.SummaryStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(v **types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ec2InstanceConnectEndpoint - if *v == nil { - sv = &types.Ec2InstanceConnectEndpoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("createdAt", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(t) - } - - case strings.EqualFold("dnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsName = ptr.String(xtv) - } - - case strings.EqualFold("fipsDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FipsDnsName = ptr.String(xtv) - } - - case strings.EqualFold("instanceConnectEndpointArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceConnectEndpointArn = ptr.String(xtv) - } - - case strings.EqualFold("instanceConnectEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceConnectEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("ipAddressType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpAddressType = types.IpAddressType(xtv) - } - - case strings.EqualFold("networkInterfaceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceIdSet(&sv.NetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("preserveClientIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PreserveClientIp = ptr.Bool(xtv) - } - - case strings.EqualFold("securityGroupIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupIdSet(&sv.SecurityGroupIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.Ec2InstanceConnectEndpointState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEfaInfo(v **types.EfaInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EfaInfo - if *v == nil { - sv = &types.EfaInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("maximumEfaInterfaces", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumEfaInterfaces = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEgressOnlyInternetGateway(v **types.EgressOnlyInternetGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EgressOnlyInternetGateway - if *v == nil { - sv = &types.EgressOnlyInternetGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInternetGatewayAttachmentList(&sv.Attachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("egressOnlyInternetGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EgressOnlyInternetGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEgressOnlyInternetGatewayList(v *[]types.EgressOnlyInternetGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.EgressOnlyInternetGateway - if *v == nil { - sv = make([]types.EgressOnlyInternetGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.EgressOnlyInternetGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEgressOnlyInternetGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEgressOnlyInternetGatewayListUnwrapped(v *[]types.EgressOnlyInternetGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.EgressOnlyInternetGateway - if *v == nil { - sv = make([]types.EgressOnlyInternetGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.EgressOnlyInternetGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEgressOnlyInternetGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentElasticGpuAssociation(v **types.ElasticGpuAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ElasticGpuAssociation - if *v == nil { - sv = &types.ElasticGpuAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("elasticGpuAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("elasticGpuAssociationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuAssociationState = ptr.String(xtv) - } - - case strings.EqualFold("elasticGpuAssociationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuAssociationTime = ptr.String(xtv) - } - - case strings.EqualFold("elasticGpuId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuAssociationList(v *[]types.ElasticGpuAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ElasticGpuAssociation - if *v == nil { - sv = make([]types.ElasticGpuAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ElasticGpuAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentElasticGpuAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuAssociationListUnwrapped(v *[]types.ElasticGpuAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.ElasticGpuAssociation - if *v == nil { - sv = make([]types.ElasticGpuAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ElasticGpuAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentElasticGpuAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentElasticGpuHealth(v **types.ElasticGpuHealth, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ElasticGpuHealth - if *v == nil { - sv = &types.ElasticGpuHealth{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.ElasticGpuStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpus(v **types.ElasticGpus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ElasticGpus - if *v == nil { - sv = &types.ElasticGpus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("elasticGpuHealth", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentElasticGpuHealth(&sv.ElasticGpuHealth, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("elasticGpuId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuId = ptr.String(xtv) - } - - case strings.EqualFold("elasticGpuState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuState = types.ElasticGpuState(xtv) - } - - case strings.EqualFold("elasticGpuType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticGpuType = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuSet(v *[]types.ElasticGpus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ElasticGpus - if *v == nil { - sv = make([]types.ElasticGpus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ElasticGpus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentElasticGpus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuSetUnwrapped(v *[]types.ElasticGpus, decoder smithyxml.NodeDecoder) error { - var sv []types.ElasticGpus - if *v == nil { - sv = make([]types.ElasticGpus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ElasticGpus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentElasticGpus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentElasticGpuSpecificationResponse(v **types.ElasticGpuSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ElasticGpuSpecificationResponse - if *v == nil { - sv = &types.ElasticGpuSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuSpecificationResponseList(v *[]types.ElasticGpuSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ElasticGpuSpecificationResponse - if *v == nil { - sv = make([]types.ElasticGpuSpecificationResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ElasticGpuSpecificationResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentElasticGpuSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticGpuSpecificationResponseListUnwrapped(v *[]types.ElasticGpuSpecificationResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.ElasticGpuSpecificationResponse - if *v == nil { - sv = make([]types.ElasticGpuSpecificationResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ElasticGpuSpecificationResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentElasticGpuSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociation(v **types.ElasticInferenceAcceleratorAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ElasticInferenceAcceleratorAssociation - if *v == nil { - sv = &types.ElasticInferenceAcceleratorAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("elasticInferenceAcceleratorArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticInferenceAcceleratorArn = ptr.String(xtv) - } - - case strings.EqualFold("elasticInferenceAcceleratorAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticInferenceAcceleratorAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("elasticInferenceAcceleratorAssociationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ElasticInferenceAcceleratorAssociationState = ptr.String(xtv) - } - - case strings.EqualFold("elasticInferenceAcceleratorAssociationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ElasticInferenceAcceleratorAssociationTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociationList(v *[]types.ElasticInferenceAcceleratorAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ElasticInferenceAcceleratorAssociation - if *v == nil { - sv = make([]types.ElasticInferenceAcceleratorAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ElasticInferenceAcceleratorAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociationListUnwrapped(v *[]types.ElasticInferenceAcceleratorAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.ElasticInferenceAcceleratorAssociation - if *v == nil { - sv = make([]types.ElasticInferenceAcceleratorAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ElasticInferenceAcceleratorAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorItem(v **types.EnableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnableFastSnapshotRestoreErrorItem - if *v == nil { - sv = &types.EnableFastSnapshotRestoreErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fastSnapshotRestoreStateErrorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorSet(&sv.FastSnapshotRestoreStateErrors, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorSet(v *[]types.EnableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.EnableFastSnapshotRestoreErrorItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.EnableFastSnapshotRestoreErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorSetUnwrapped(v *[]types.EnableFastSnapshotRestoreErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.EnableFastSnapshotRestoreErrorItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.EnableFastSnapshotRestoreErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateError(v **types.EnableFastSnapshotRestoreStateError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnableFastSnapshotRestoreStateError - if *v == nil { - sv = &types.EnableFastSnapshotRestoreStateError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorItem(v **types.EnableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = &types.EnableFastSnapshotRestoreStateErrorItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateError(&sv.Error, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorSet(v *[]types.EnableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.EnableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreStateErrorItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.EnableFastSnapshotRestoreStateErrorItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorSetUnwrapped(v *[]types.EnableFastSnapshotRestoreStateErrorItem, decoder smithyxml.NodeDecoder) error { - var sv []types.EnableFastSnapshotRestoreStateErrorItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreStateErrorItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.EnableFastSnapshotRestoreStateErrorItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreStateErrorItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessItem(v **types.EnableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = &types.EnableFastSnapshotRestoreSuccessItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("disabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisabledTime = ptr.Time(t) - } - - case strings.EqualFold("disablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DisablingTime = ptr.Time(t) - } - - case strings.EqualFold("enabledTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnabledTime = ptr.Time(t) - } - - case strings.EqualFold("enablingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EnablingTime = ptr.Time(t) - } - - case strings.EqualFold("optimizingTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.OptimizingTime = ptr.Time(t) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastSnapshotRestoreStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessSet(v *[]types.EnableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.EnableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.EnableFastSnapshotRestoreSuccessItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessSetUnwrapped(v *[]types.EnableFastSnapshotRestoreSuccessItem, decoder smithyxml.NodeDecoder) error { - var sv []types.EnableFastSnapshotRestoreSuccessItem - if *v == nil { - sv = make([]types.EnableFastSnapshotRestoreSuccessItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.EnableFastSnapshotRestoreSuccessItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEnaSrdSpecificationRequest(v **types.EnaSrdSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnaSrdSpecificationRequest - if *v == nil { - sv = &types.EnaSrdSpecificationRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("EnaSrdEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("EnaSrdUdpSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnaSrdUdpSpecificationRequest(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnaSrdUdpSpecificationRequest(v **types.EnaSrdUdpSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnaSrdUdpSpecificationRequest - if *v == nil { - sv = &types.EnaSrdUdpSpecificationRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("EnaSrdUdpEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdUdpEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEnclaveOptions(v **types.EnclaveOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EnclaveOptions - if *v == nil { - sv = &types.EnclaveOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEndpointSet(v *[]types.ClientVpnEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ClientVpnEndpoint - if *v == nil { - sv = make([]types.ClientVpnEndpoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ClientVpnEndpoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentClientVpnEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentEndpointSetUnwrapped(v *[]types.ClientVpnEndpoint, decoder smithyxml.NodeDecoder) error { - var sv []types.ClientVpnEndpoint - if *v == nil { - sv = make([]types.ClientVpnEndpoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ClientVpnEndpoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentClientVpnEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentErrorSet(v *[]types.ValidationError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ValidationError - if *v == nil { - sv = make([]types.ValidationError, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ValidationError - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentValidationError(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentErrorSetUnwrapped(v *[]types.ValidationError, decoder smithyxml.NodeDecoder) error { - var sv []types.ValidationError - if *v == nil { - sv = make([]types.ValidationError, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ValidationError - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentValidationError(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentEventInformation(v **types.EventInformation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.EventInformation - if *v == nil { - sv = &types.EventInformation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("eventDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventDescription = ptr.String(xtv) - } - - case strings.EqualFold("eventSubType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventSubType = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExcludedInstanceTypeSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExcludedInstanceTypeSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentExplanation(v **types.Explanation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Explanation - if *v == nil { - sv = &types.Explanation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("acl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Acl, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("aclRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisAclRule(&sv.AclRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Address = ptr.String(xtv) - } - - case strings.EqualFold("addressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpAddressList(&sv.Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("attachedTo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.AttachedTo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZoneIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.AvailabilityZoneIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZoneSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.AvailabilityZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Cidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("classicLoadBalancerListener", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisLoadBalancerListener(&sv.ClassicLoadBalancerListener, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("component", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Component, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("componentAccount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComponentAccount = ptr.String(xtv) - } - - case strings.EqualFold("componentRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComponentRegion = ptr.String(xtv) - } - - case strings.EqualFold("customerGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.CustomerGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destination", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Destination, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationVpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.DestinationVpc, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("direction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Direction = ptr.String(xtv) - } - - case strings.EqualFold("elasticLoadBalancerListener", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.ElasticLoadBalancerListener, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("explanationCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExplanationCode = ptr.String(xtv) - } - - case strings.EqualFold("firewallStatefulRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFirewallStatefulRule(&sv.FirewallStatefulRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("firewallStatelessRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFirewallStatelessRule(&sv.FirewallStatelessRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ingressRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.IngressRouteTable, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("internetGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.InternetGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancerArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LoadBalancerArn = ptr.String(xtv) - } - - case strings.EqualFold("loadBalancerListenerPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LoadBalancerListenerPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("loadBalancerTarget", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisLoadBalancerTarget(&sv.LoadBalancerTarget, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancerTargetGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.LoadBalancerTargetGroup, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancerTargetGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponentList(&sv.LoadBalancerTargetGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancerTargetPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LoadBalancerTargetPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("missingComponent", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MissingComponent = ptr.String(xtv) - } - - case strings.EqualFold("natGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.NatGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterface", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.NetworkInterface, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("packetField", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PacketField = ptr.String(xtv) - } - - case strings.EqualFold("port", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("portRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.PortRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("prefixList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.PrefixList, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStringList(&sv.Protocols, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.RouteTable, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeTableRoute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisRouteTableRoute(&sv.RouteTableRoute, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.SecurityGroup, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisSecurityGroupRule(&sv.SecurityGroupRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponentList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceVpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.SourceVpc, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("subnet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Subnet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.SubnetRouteTable, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.TransitGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.TransitGatewayAttachment, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.TransitGatewayRouteTable, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayRouteTableRoute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableRoute(&sv.TransitGatewayRouteTableRoute, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Vpc, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.VpcEndpoint, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcPeeringConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.VpcPeeringConnection, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpnGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.VpnGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExplanationList(v *[]types.Explanation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Explanation - if *v == nil { - sv = make([]types.Explanation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Explanation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentExplanation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExplanationListUnwrapped(v *[]types.Explanation, decoder smithyxml.NodeDecoder) error { - var sv []types.Explanation - if *v == nil { - sv = make([]types.Explanation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Explanation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentExplanation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentExportImageTask(v **types.ExportImageTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ExportImageTask - if *v == nil { - sv = &types.ExportImageTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("exportImageTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExportImageTaskId = ptr.String(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("s3ExportLocation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportTaskS3Location(&sv.S3ExportLocation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExportImageTaskList(v *[]types.ExportImageTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ExportImageTask - if *v == nil { - sv = make([]types.ExportImageTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ExportImageTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentExportImageTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExportImageTaskListUnwrapped(v *[]types.ExportImageTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ExportImageTask - if *v == nil { - sv = make([]types.ExportImageTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ExportImageTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentExportImageTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentExportTask(v **types.ExportTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ExportTask - if *v == nil { - sv = &types.ExportTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("exportTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("exportToS3", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportToS3Task(&sv.ExportToS3Task, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceExport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceExportDetails(&sv.InstanceExportDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ExportTaskState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExportTaskList(v *[]types.ExportTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ExportTask - if *v == nil { - sv = make([]types.ExportTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ExportTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentExportTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExportTaskListUnwrapped(v *[]types.ExportTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ExportTask - if *v == nil { - sv = make([]types.ExportTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ExportTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentExportTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentExportTaskS3Location(v **types.ExportTaskS3Location, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ExportTaskS3Location - if *v == nil { - sv = &types.ExportTaskS3Location{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("s3Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Bucket = ptr.String(xtv) - } - - case strings.EqualFold("s3Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentExportToS3Task(v **types.ExportToS3Task, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ExportToS3Task - if *v == nil { - sv = &types.ExportToS3Task{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("containerFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ContainerFormat = types.ContainerFormat(xtv) - } - - case strings.EqualFold("diskImageFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DiskImageFormat = types.DiskImageFormat(xtv) - } - - case strings.EqualFold("s3Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Bucket = ptr.String(xtv) - } - - case strings.EqualFold("s3Key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Key = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResult(v **types.FailedCapacityReservationFleetCancellationResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FailedCapacityReservationFleetCancellationResult - if *v == nil { - sv = &types.FailedCapacityReservationFleetCancellationResult{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cancelCapacityReservationFleetError", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCancelCapacityReservationFleetError(&sv.CancelCapacityReservationFleetError, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("capacityReservationFleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResultSet(v *[]types.FailedCapacityReservationFleetCancellationResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FailedCapacityReservationFleetCancellationResult - if *v == nil { - sv = make([]types.FailedCapacityReservationFleetCancellationResult, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FailedCapacityReservationFleetCancellationResult - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResult(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResultSetUnwrapped(v *[]types.FailedCapacityReservationFleetCancellationResult, decoder smithyxml.NodeDecoder) error { - var sv []types.FailedCapacityReservationFleetCancellationResult - if *v == nil { - sv = make([]types.FailedCapacityReservationFleetCancellationResult, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FailedCapacityReservationFleetCancellationResult - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResult(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletion(v **types.FailedQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FailedQueuedPurchaseDeletion - if *v == nil { - sv = &types.FailedQueuedPurchaseDeletion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteQueuedReservedInstancesError(&sv.Error, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletionSet(v *[]types.FailedQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FailedQueuedPurchaseDeletion - if *v == nil { - sv = make([]types.FailedQueuedPurchaseDeletion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FailedQueuedPurchaseDeletion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletionSetUnwrapped(v *[]types.FailedQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - var sv []types.FailedQueuedPurchaseDeletion - if *v == nil { - sv = make([]types.FailedQueuedPurchaseDeletion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FailedQueuedPurchaseDeletion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFastLaunchLaunchTemplateSpecificationResponse(v **types.FastLaunchLaunchTemplateSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FastLaunchLaunchTemplateSpecificationResponse - if *v == nil { - sv = &types.FastLaunchLaunchTemplateSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("version", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Version = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFastLaunchSnapshotConfigurationResponse(v **types.FastLaunchSnapshotConfigurationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FastLaunchSnapshotConfigurationResponse - if *v == nil { - sv = &types.FastLaunchSnapshotConfigurationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("targetResourceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TargetResourceCount = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFederatedAuthentication(v **types.FederatedAuthentication, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FederatedAuthentication - if *v == nil { - sv = &types.FederatedAuthentication{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("samlProviderArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SamlProviderArn = ptr.String(xtv) - } - - case strings.EqualFold("selfServiceSamlProviderArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SelfServiceSamlProviderArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFilterPortRange(v **types.FilterPortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FilterPortRange - if *v == nil { - sv = &types.FilterPortRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFirewallStatefulRule(v **types.FirewallStatefulRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FirewallStatefulRule - if *v == nil { - sv = &types.FirewallStatefulRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationPortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.DestinationPorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Destinations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("direction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Direction = ptr.String(xtv) - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("ruleAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleAction = ptr.String(xtv) - } - - case strings.EqualFold("ruleGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("sourcePortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.SourcePorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Sources, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFirewallStatelessRule(v **types.FirewallStatelessRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FirewallStatelessRule - if *v == nil { - sv = &types.FirewallStatelessRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationPortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.DestinationPorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Destinations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("priority", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Priority = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("protocolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProtocolIntList(&sv.Protocols, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ruleAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleAction = ptr.String(xtv) - } - - case strings.EqualFold("ruleGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("sourcePortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRangeList(&sv.SourcePorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Sources, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetCapacityReservation(v **types.FleetCapacityReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetCapacityReservation - if *v == nil { - sv = &types.FleetCapacityReservation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("fulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("instancePlatform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstancePlatform = types.CapacityReservationInstancePlatform(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("priority", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Priority = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalInstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("weight", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Weight = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetCapacityReservationSet(v *[]types.FleetCapacityReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FleetCapacityReservation - if *v == nil { - sv = make([]types.FleetCapacityReservation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FleetCapacityReservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFleetCapacityReservation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetCapacityReservationSetUnwrapped(v *[]types.FleetCapacityReservation, decoder smithyxml.NodeDecoder) error { - var sv []types.FleetCapacityReservation - if *v == nil { - sv = make([]types.FleetCapacityReservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FleetCapacityReservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFleetCapacityReservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFleetData(v **types.FleetData, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetData - if *v == nil { - sv = &types.FleetData{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activityStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ActivityStatus = types.FleetActivityStatus(xtv) - } - - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("context", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Context = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("errorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDescribeFleetsErrorSet(&sv.Errors, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("excessCapacityTerminationPolicy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExcessCapacityTerminationPolicy = types.FleetExcessCapacityTerminationPolicy(xtv) - } - - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - case strings.EqualFold("fleetState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetState = types.FleetStateCode(xtv) - } - - case strings.EqualFold("fulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("fulfilledOnDemandCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FulfilledOnDemandCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("fleetInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDescribeFleetsInstancesSet(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("launchTemplateConfigs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateConfigList(&sv.LaunchTemplateConfigs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("onDemandOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOnDemandOptions(&sv.OnDemandOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("replaceUnhealthyInstances", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReplaceUnhealthyInstances = ptr.Bool(xtv) - } - - case strings.EqualFold("spotOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotOptions(&sv.SpotOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetCapacitySpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetCapacitySpecification(&sv.TargetCapacitySpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("terminateInstancesWithExpiration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.TerminateInstancesWithExpiration = ptr.Bool(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.FleetType(xtv) - } - - case strings.EqualFold("validFrom", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidFrom = ptr.Time(t) - } - - case strings.EqualFold("validUntil", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidUntil = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetLaunchTemplateConfig(v **types.FleetLaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetLaunchTemplateConfig - if *v == nil { - sv = &types.FleetLaunchTemplateConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateSpecification(&sv.LaunchTemplateSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("overrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateOverridesList(&sv.Overrides, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetLaunchTemplateConfigList(v *[]types.FleetLaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FleetLaunchTemplateConfig - if *v == nil { - sv = make([]types.FleetLaunchTemplateConfig, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FleetLaunchTemplateConfig - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateConfig(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetLaunchTemplateConfigListUnwrapped(v *[]types.FleetLaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - var sv []types.FleetLaunchTemplateConfig - if *v == nil { - sv = make([]types.FleetLaunchTemplateConfig, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FleetLaunchTemplateConfig - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateConfig(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFleetLaunchTemplateOverrides(v **types.FleetLaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetLaunchTemplateOverrides - if *v == nil { - sv = &types.FleetLaunchTemplateOverrides{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("blockDeviceMappingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockDeviceMappingResponseList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceRequirements", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceRequirements(&sv.InstanceRequirements, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("maxPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MaxPrice = ptr.String(xtv) - } - - case strings.EqualFold("placement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementResponse(&sv.Placement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("priority", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Priority = ptr.Float64(f64) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("weightedCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.WeightedCapacity = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetLaunchTemplateOverridesList(v *[]types.FleetLaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FleetLaunchTemplateOverrides - if *v == nil { - sv = make([]types.FleetLaunchTemplateOverrides, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FleetLaunchTemplateOverrides - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateOverrides(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetLaunchTemplateOverridesListUnwrapped(v *[]types.FleetLaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - var sv []types.FleetLaunchTemplateOverrides - if *v == nil { - sv = make([]types.FleetLaunchTemplateOverrides, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FleetLaunchTemplateOverrides - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateOverrides(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFleetLaunchTemplateSpecification(v **types.FleetLaunchTemplateSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetLaunchTemplateSpecification - if *v == nil { - sv = &types.FleetLaunchTemplateSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("version", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Version = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetSet(v *[]types.FleetData, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FleetData - if *v == nil { - sv = make([]types.FleetData, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FleetData - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFleetData(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetSetUnwrapped(v *[]types.FleetData, decoder smithyxml.NodeDecoder) error { - var sv []types.FleetData - if *v == nil { - sv = make([]types.FleetData, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FleetData - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFleetData(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFleetSpotCapacityRebalance(v **types.FleetSpotCapacityRebalance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetSpotCapacityRebalance - if *v == nil { - sv = &types.FleetSpotCapacityRebalance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("replacementStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReplacementStrategy = types.FleetReplacementStrategy(xtv) - } - - case strings.EqualFold("terminationDelay", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TerminationDelay = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFleetSpotMaintenanceStrategies(v **types.FleetSpotMaintenanceStrategies, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FleetSpotMaintenanceStrategies - if *v == nil { - sv = &types.FleetSpotMaintenanceStrategies{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityRebalance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetSpotCapacityRebalance(&sv.CapacityRebalance, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFlowLog(v **types.FlowLog, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FlowLog - if *v == nil { - sv = &types.FlowLog{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("deliverCrossAccountRole", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliverCrossAccountRole = ptr.String(xtv) - } - - case strings.EqualFold("deliverLogsErrorMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliverLogsErrorMessage = ptr.String(xtv) - } - - case strings.EqualFold("deliverLogsPermissionArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliverLogsPermissionArn = ptr.String(xtv) - } - - case strings.EqualFold("deliverLogsStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliverLogsStatus = ptr.String(xtv) - } - - case strings.EqualFold("destinationOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDestinationOptionsResponse(&sv.DestinationOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("flowLogId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FlowLogId = ptr.String(xtv) - } - - case strings.EqualFold("flowLogStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FlowLogStatus = ptr.String(xtv) - } - - case strings.EqualFold("logDestination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogDestination = ptr.String(xtv) - } - - case strings.EqualFold("logDestinationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogDestinationType = types.LogDestinationType(xtv) - } - - case strings.EqualFold("logFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogFormat = ptr.String(xtv) - } - - case strings.EqualFold("logGroupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogGroupName = ptr.String(xtv) - } - - case strings.EqualFold("maxAggregationInterval", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxAggregationInterval = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trafficType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficType = types.TrafficType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFlowLogSet(v *[]types.FlowLog, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FlowLog - if *v == nil { - sv = make([]types.FlowLog, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FlowLog - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFlowLog(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFlowLogSetUnwrapped(v *[]types.FlowLog, decoder smithyxml.NodeDecoder) error { - var sv []types.FlowLog - if *v == nil { - sv = make([]types.FlowLog, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FlowLog - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFlowLog(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFpgaDeviceInfo(v **types.FpgaDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaDeviceInfo - if *v == nil { - sv = &types.FpgaDeviceInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("manufacturer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Manufacturer = ptr.String(xtv) - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaDeviceMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaDeviceInfoList(v *[]types.FpgaDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FpgaDeviceInfo - if *v == nil { - sv = make([]types.FpgaDeviceInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FpgaDeviceInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFpgaDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaDeviceInfoListUnwrapped(v *[]types.FpgaDeviceInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.FpgaDeviceInfo - if *v == nil { - sv = make([]types.FpgaDeviceInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FpgaDeviceInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFpgaDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFpgaDeviceMemoryInfo(v **types.FpgaDeviceMemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaDeviceMemoryInfo - if *v == nil { - sv = &types.FpgaDeviceMemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaImage(v **types.FpgaImage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaImage - if *v == nil { - sv = &types.FpgaImage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("dataRetentionSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DataRetentionSupport = ptr.Bool(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("fpgaImageGlobalId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageGlobalId = ptr.String(xtv) - } - - case strings.EqualFold("fpgaImageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceTypes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTypesList(&sv.InstanceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("pciId", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPciId(&sv.PciId, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("public", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Public = ptr.Bool(xtv) - } - - case strings.EqualFold("shellVersion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ShellVersion = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaImageState(&sv.State, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tags", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("updateTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdateTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaImageAttribute(v **types.FpgaImageAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaImageAttribute - if *v == nil { - sv = &types.FpgaImageAttribute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("fpgaImageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageId = ptr.String(xtv) - } - - case strings.EqualFold("loadPermissions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLoadPermissionList(&sv.LoadPermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaImageList(v *[]types.FpgaImage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.FpgaImage - if *v == nil { - sv = make([]types.FpgaImage, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.FpgaImage - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentFpgaImage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaImageListUnwrapped(v *[]types.FpgaImage, decoder smithyxml.NodeDecoder) error { - var sv []types.FpgaImage - if *v == nil { - sv = make([]types.FpgaImage, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.FpgaImage - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentFpgaImage(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentFpgaImageState(v **types.FpgaImageState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaImageState - if *v == nil { - sv = &types.FpgaImageState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.FpgaImageStateCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentFpgaInfo(v **types.FpgaInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FpgaInfo - if *v == nil { - sv = &types.FpgaInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgas", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaDeviceInfoList(&sv.Fpgas, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalFpgaMemoryInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalFpgaMemoryInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGpuDeviceInfo(v **types.GpuDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.GpuDeviceInfo - if *v == nil { - sv = &types.GpuDeviceInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("manufacturer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Manufacturer = ptr.String(xtv) - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGpuDeviceMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGpuDeviceInfoList(v *[]types.GpuDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.GpuDeviceInfo - if *v == nil { - sv = make([]types.GpuDeviceInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.GpuDeviceInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentGpuDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGpuDeviceInfoListUnwrapped(v *[]types.GpuDeviceInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.GpuDeviceInfo - if *v == nil { - sv = make([]types.GpuDeviceInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.GpuDeviceInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentGpuDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentGpuDeviceMemoryInfo(v **types.GpuDeviceMemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.GpuDeviceMemoryInfo - if *v == nil { - sv = &types.GpuDeviceMemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGpuInfo(v **types.GpuInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.GpuInfo - if *v == nil { - sv = &types.GpuInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("gpus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGpuDeviceInfoList(&sv.Gpus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalGpuMemoryInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalGpuMemoryInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGroupIdentifier(v **types.GroupIdentifier, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.GroupIdentifier - if *v == nil { - sv = &types.GroupIdentifier{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGroupIdentifierList(v *[]types.GroupIdentifier, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.GroupIdentifier - if *v == nil { - sv = make([]types.GroupIdentifier, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.GroupIdentifier - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentGroupIdentifier(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGroupIdentifierListUnwrapped(v *[]types.GroupIdentifier, decoder smithyxml.NodeDecoder) error { - var sv []types.GroupIdentifier - if *v == nil { - sv = make([]types.GroupIdentifier, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.GroupIdentifier - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentGroupIdentifier(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentGroupIdentifierSet(v *[]types.SecurityGroupIdentifier, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroupIdentifier - if *v == nil { - sv = make([]types.SecurityGroupIdentifier, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroupIdentifier - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroupIdentifier(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGroupIdentifierSetUnwrapped(v *[]types.SecurityGroupIdentifier, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroupIdentifier - if *v == nil { - sv = make([]types.SecurityGroupIdentifier, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroupIdentifier - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroupIdentifier(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentGroupIdStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("groupId", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentGroupIdStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHibernationOptions(v **types.HibernationOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HibernationOptions - if *v == nil { - sv = &types.HibernationOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("configured", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Configured = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHistoryRecord(v **types.HistoryRecord, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HistoryRecord - if *v == nil { - sv = &types.HistoryRecord{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("eventInformation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEventInformation(&sv.EventInformation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("eventType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventType = types.EventType(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHistoryRecordEntry(v **types.HistoryRecordEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HistoryRecordEntry - if *v == nil { - sv = &types.HistoryRecordEntry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("eventInformation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEventInformation(&sv.EventInformation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("eventType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventType = types.FleetEventType(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHistoryRecords(v *[]types.HistoryRecord, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.HistoryRecord - if *v == nil { - sv = make([]types.HistoryRecord, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.HistoryRecord - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHistoryRecord(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHistoryRecordsUnwrapped(v *[]types.HistoryRecord, decoder smithyxml.NodeDecoder) error { - var sv []types.HistoryRecord - if *v == nil { - sv = make([]types.HistoryRecord, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HistoryRecord - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHistoryRecord(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHistoryRecordSet(v *[]types.HistoryRecordEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.HistoryRecordEntry - if *v == nil { - sv = make([]types.HistoryRecordEntry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.HistoryRecordEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHistoryRecordEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHistoryRecordSetUnwrapped(v *[]types.HistoryRecordEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.HistoryRecordEntry - if *v == nil { - sv = make([]types.HistoryRecordEntry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HistoryRecordEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHistoryRecordEntry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHost(v **types.Host, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Host - if *v == nil { - sv = &types.Host{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AllocationTime = ptr.Time(t) - } - - case strings.EqualFold("allowsMultipleInstanceTypes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllowsMultipleInstanceTypes = types.AllowsMultipleInstanceTypes(xtv) - } - - case strings.EqualFold("assetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssetId = ptr.String(xtv) - } - - case strings.EqualFold("autoPlacement", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoPlacement = types.AutoPlacement(xtv) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("availableCapacity", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAvailableCapacity(&sv.AvailableCapacity, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("hostId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostId = ptr.String(xtv) - } - - case strings.EqualFold("hostMaintenance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostMaintenance = types.HostMaintenance(xtv) - } - - case strings.EqualFold("hostProperties", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHostProperties(&sv.HostProperties, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hostRecovery", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostRecovery = types.HostRecovery(xtv) - } - - case strings.EqualFold("hostReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostReservationId = ptr.String(xtv) - } - - case strings.EqualFold("instances", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHostInstanceList(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("memberOfServiceLinkedResourceGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.MemberOfServiceLinkedResourceGroup = ptr.Bool(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("releaseTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ReleaseTime = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AllocationState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostInstance(v **types.HostInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HostInstance - if *v == nil { - sv = &types.HostInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostInstanceList(v *[]types.HostInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.HostInstance - if *v == nil { - sv = make([]types.HostInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.HostInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHostInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostInstanceListUnwrapped(v *[]types.HostInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.HostInstance - if *v == nil { - sv = make([]types.HostInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HostInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHostInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHostList(v *[]types.Host, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Host - if *v == nil { - sv = make([]types.Host, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Host - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHost(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostListUnwrapped(v *[]types.Host, decoder smithyxml.NodeDecoder) error { - var sv []types.Host - if *v == nil { - sv = make([]types.Host, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Host - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHost(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHostOffering(v **types.HostOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HostOffering - if *v == nil { - sv = &types.HostOffering{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = ptr.String(xtv) - } - - case strings.EqualFold("offeringId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingId = ptr.String(xtv) - } - - case strings.EqualFold("paymentOption", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PaymentOption = types.PaymentOption(xtv) - } - - case strings.EqualFold("upfrontPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontPrice = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostOfferingSet(v *[]types.HostOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.HostOffering - if *v == nil { - sv = make([]types.HostOffering, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.HostOffering - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHostOffering(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostOfferingSetUnwrapped(v *[]types.HostOffering, decoder smithyxml.NodeDecoder) error { - var sv []types.HostOffering - if *v == nil { - sv = make([]types.HostOffering, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HostOffering - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHostOffering(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentHostProperties(v **types.HostProperties, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HostProperties - if *v == nil { - sv = &types.HostProperties{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cores", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Cores = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("sockets", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Sockets = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalVCpus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalVCpus = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostReservation(v **types.HostReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HostReservation - if *v == nil { - sv = &types.HostReservation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("end", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.End = ptr.Time(t) - } - - case strings.EqualFold("hostIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseHostIdSet(&sv.HostIdSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hostReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostReservationId = ptr.String(xtv) - } - - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = ptr.String(xtv) - } - - case strings.EqualFold("offeringId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingId = ptr.String(xtv) - } - - case strings.EqualFold("paymentOption", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PaymentOption = types.PaymentOption(xtv) - } - - case strings.EqualFold("start", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Start = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ReservationState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("upfrontPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontPrice = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostReservationSet(v *[]types.HostReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.HostReservation - if *v == nil { - sv = make([]types.HostReservation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.HostReservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentHostReservation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentHostReservationSetUnwrapped(v *[]types.HostReservation, decoder smithyxml.NodeDecoder) error { - var sv []types.HostReservation - if *v == nil { - sv = make([]types.HostReservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HostReservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentHostReservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIamInstanceProfile(v **types.IamInstanceProfile, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IamInstanceProfile - if *v == nil { - sv = &types.IamInstanceProfile{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIamInstanceProfileAssociation(v **types.IamInstanceProfileAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IamInstanceProfileAssociation - if *v == nil { - sv = &types.IamInstanceProfileAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("iamInstanceProfile", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfile(&sv.IamInstanceProfile, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IamInstanceProfileAssociationState(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIamInstanceProfileAssociationSet(v *[]types.IamInstanceProfileAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IamInstanceProfileAssociation - if *v == nil { - sv = make([]types.IamInstanceProfileAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IamInstanceProfileAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIamInstanceProfileAssociationSetUnwrapped(v *[]types.IamInstanceProfileAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.IamInstanceProfileAssociation - if *v == nil { - sv = make([]types.IamInstanceProfileAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IamInstanceProfileAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIamInstanceProfileSpecification(v **types.IamInstanceProfileSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IamInstanceProfileSpecification - if *v == nil { - sv = &types.IamInstanceProfileSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIcmpTypeCode(v **types.IcmpTypeCode, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IcmpTypeCode - if *v == nil { - sv = &types.IcmpTypeCode{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Code = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Type = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIdFormat(v **types.IdFormat, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IdFormat - if *v == nil { - sv = &types.IdFormat{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deadline", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Deadline = ptr.Time(t) - } - - case strings.EqualFold("resource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Resource = ptr.String(xtv) - } - - case strings.EqualFold("useLongIds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.UseLongIds = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIdFormatList(v *[]types.IdFormat, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IdFormat - if *v == nil { - sv = make([]types.IdFormat, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IdFormat - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIdFormat(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIdFormatListUnwrapped(v *[]types.IdFormat, decoder smithyxml.NodeDecoder) error { - var sv []types.IdFormat - if *v == nil { - sv = make([]types.IdFormat, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IdFormat - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIdFormat(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIKEVersionsList(v *[]types.IKEVersionsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IKEVersionsListValue - if *v == nil { - sv = make([]types.IKEVersionsListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IKEVersionsListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIKEVersionsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIKEVersionsListUnwrapped(v *[]types.IKEVersionsListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.IKEVersionsListValue - if *v == nil { - sv = make([]types.IKEVersionsListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IKEVersionsListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIKEVersionsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIKEVersionsListValue(v **types.IKEVersionsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IKEVersionsListValue - if *v == nil { - sv = &types.IKEVersionsListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImage(v **types.Image, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Image - if *v == nil { - sv = &types.Image{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("architecture", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Architecture = types.ArchitectureValues(xtv) - } - - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bootMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BootMode = types.BootModeValues(xtv) - } - - case strings.EqualFold("creationDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationDate = ptr.String(xtv) - } - - case strings.EqualFold("deprecationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeprecationTime = ptr.String(xtv) - } - - case strings.EqualFold("deregistrationProtection", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeregistrationProtection = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("enaSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSupport = ptr.Bool(xtv) - } - - case strings.EqualFold("freeTierEligible", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.FreeTierEligible = ptr.Bool(xtv) - } - - case strings.EqualFold("hypervisor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Hypervisor = types.HypervisorType(xtv) - } - - case strings.EqualFold("imageAllowed", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ImageAllowed = ptr.Bool(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("imageLocation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageLocation = ptr.String(xtv) - } - - case strings.EqualFold("imageOwnerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageOwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("imageType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageType = types.ImageTypeValues(xtv) - } - - case strings.EqualFold("imdsSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImdsSupport = types.ImdsSupportValues(xtv) - } - - case strings.EqualFold("kernelId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KernelId = ptr.String(xtv) - } - - case strings.EqualFold("lastLaunchedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastLaunchedTime = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("imageOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = types.PlatformValues(xtv) - } - - case strings.EqualFold("platformDetails", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PlatformDetails = ptr.String(xtv) - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("isPublic", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Public = ptr.Bool(xtv) - } - - case strings.EqualFold("ramdiskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RamdiskId = ptr.String(xtv) - } - - case strings.EqualFold("rootDeviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RootDeviceName = ptr.String(xtv) - } - - case strings.EqualFold("rootDeviceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RootDeviceType = types.DeviceType(xtv) - } - - case strings.EqualFold("sourceImageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceImageId = ptr.String(xtv) - } - - case strings.EqualFold("sourceImageRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceImageRegion = ptr.String(xtv) - } - - case strings.EqualFold("sourceInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceInstanceId = ptr.String(xtv) - } - - case strings.EqualFold("sriovNetSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SriovNetSupport = ptr.String(xtv) - } - - case strings.EqualFold("imageState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ImageState(xtv) - } - - case strings.EqualFold("stateReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStateReason(&sv.StateReason, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tpmSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TpmSupport = types.TpmSupportValues(xtv) - } - - case strings.EqualFold("usageOperation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UsageOperation = ptr.String(xtv) - } - - case strings.EqualFold("virtualizationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VirtualizationType = types.VirtualizationType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageCriterion(v **types.ImageCriterion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImageCriterion - if *v == nil { - sv = &types.ImageCriterion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageProviderSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImageProviderList(&sv.ImageProviders, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageCriterionList(v *[]types.ImageCriterion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImageCriterion - if *v == nil { - sv = make([]types.ImageCriterion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImageCriterion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImageCriterion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageCriterionListUnwrapped(v *[]types.ImageCriterion, decoder smithyxml.NodeDecoder) error { - var sv []types.ImageCriterion - if *v == nil { - sv = make([]types.ImageCriterion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImageCriterion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImageCriterion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImageList(v *[]types.Image, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Image - if *v == nil { - sv = make([]types.Image, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Image - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageListUnwrapped(v *[]types.Image, decoder smithyxml.NodeDecoder) error { - var sv []types.Image - if *v == nil { - sv = make([]types.Image, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Image - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImage(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImageMetadata(v **types.ImageMetadata, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImageMetadata - if *v == nil { - sv = &types.ImageMetadata{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationDate = ptr.String(xtv) - } - - case strings.EqualFold("deprecationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeprecationTime = ptr.String(xtv) - } - - case strings.EqualFold("imageAllowed", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ImageAllowed = ptr.Bool(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("imageOwnerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageOwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("isPublic", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsPublic = ptr.Bool(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("imageOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("imageState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ImageState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageProviderList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageProviderListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImageRecycleBinInfo(v **types.ImageRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImageRecycleBinInfo - if *v == nil { - sv = &types.ImageRecycleBinInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("recycleBinEnterTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RecycleBinEnterTime = ptr.Time(t) - } - - case strings.EqualFold("recycleBinExitTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RecycleBinExitTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageRecycleBinInfoList(v *[]types.ImageRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImageRecycleBinInfo - if *v == nil { - sv = make([]types.ImageRecycleBinInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImageRecycleBinInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImageRecycleBinInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImageRecycleBinInfoListUnwrapped(v *[]types.ImageRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.ImageRecycleBinInfo - if *v == nil { - sv = make([]types.ImageRecycleBinInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImageRecycleBinInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImageRecycleBinInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImportImageLicenseConfigurationResponse(v **types.ImportImageLicenseConfigurationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportImageLicenseConfigurationResponse - if *v == nil { - sv = &types.ImportImageLicenseConfigurationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("licenseConfigurationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LicenseConfigurationArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportImageLicenseSpecificationListResponse(v *[]types.ImportImageLicenseConfigurationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImportImageLicenseConfigurationResponse - if *v == nil { - sv = make([]types.ImportImageLicenseConfigurationResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImportImageLicenseConfigurationResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImportImageLicenseConfigurationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportImageLicenseSpecificationListResponseUnwrapped(v *[]types.ImportImageLicenseConfigurationResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.ImportImageLicenseConfigurationResponse - if *v == nil { - sv = make([]types.ImportImageLicenseConfigurationResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImportImageLicenseConfigurationResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImportImageLicenseConfigurationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImportImageTask(v **types.ImportImageTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportImageTask - if *v == nil { - sv = &types.ImportImageTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("architecture", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Architecture = ptr.String(xtv) - } - - case strings.EqualFold("bootMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BootMode = types.BootModeValues(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("hypervisor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Hypervisor = ptr.String(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("importTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("licenseSpecifications", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportImageLicenseSpecificationListResponse(&sv.LicenseSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("licenseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LicenseType = ptr.String(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotDetailSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotDetailList(&sv.SnapshotDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("usageOperation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UsageOperation = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportImageTaskList(v *[]types.ImportImageTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImportImageTask - if *v == nil { - sv = make([]types.ImportImageTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImportImageTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImportImageTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportImageTaskListUnwrapped(v *[]types.ImportImageTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ImportImageTask - if *v == nil { - sv = make([]types.ImportImageTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImportImageTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImportImageTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImportInstanceTaskDetails(v **types.ImportInstanceTaskDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportInstanceTaskDetails - if *v == nil { - sv = &types.ImportInstanceTaskDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = types.PlatformValues(xtv) - } - - case strings.EqualFold("volumes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportInstanceVolumeDetailSet(&sv.Volumes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportInstanceVolumeDetailItem(v **types.ImportInstanceVolumeDetailItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportInstanceVolumeDetailItem - if *v == nil { - sv = &types.ImportInstanceVolumeDetailItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("bytesConverted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BytesConverted = ptr.Int64(i64) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("image", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDiskImageDescription(&sv.Image, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("volume", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDiskImageVolumeDescription(&sv.Volume, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportInstanceVolumeDetailSet(v *[]types.ImportInstanceVolumeDetailItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImportInstanceVolumeDetailItem - if *v == nil { - sv = make([]types.ImportInstanceVolumeDetailItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImportInstanceVolumeDetailItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImportInstanceVolumeDetailItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportInstanceVolumeDetailSetUnwrapped(v *[]types.ImportInstanceVolumeDetailItem, decoder smithyxml.NodeDecoder) error { - var sv []types.ImportInstanceVolumeDetailItem - if *v == nil { - sv = make([]types.ImportInstanceVolumeDetailItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImportInstanceVolumeDetailItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImportInstanceVolumeDetailItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImportSnapshotTask(v **types.ImportSnapshotTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportSnapshotTask - if *v == nil { - sv = &types.ImportSnapshotTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("importTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotTaskDetail", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotTaskDetail(&sv.SnapshotTaskDetail, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportSnapshotTaskList(v *[]types.ImportSnapshotTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ImportSnapshotTask - if *v == nil { - sv = make([]types.ImportSnapshotTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ImportSnapshotTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentImportSnapshotTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentImportSnapshotTaskListUnwrapped(v *[]types.ImportSnapshotTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ImportSnapshotTask - if *v == nil { - sv = make([]types.ImportSnapshotTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ImportSnapshotTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentImportSnapshotTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentImportVolumeTaskDetails(v **types.ImportVolumeTaskDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ImportVolumeTaskDetails - if *v == nil { - sv = &types.ImportVolumeTaskDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("bytesConverted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BytesConverted = ptr.Int64(i64) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("image", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDiskImageDescription(&sv.Image, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("volume", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDiskImageVolumeDescription(&sv.Volume, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInferenceAcceleratorInfo(v **types.InferenceAcceleratorInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InferenceAcceleratorInfo - if *v == nil { - sv = &types.InferenceAcceleratorInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accelerators", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInferenceDeviceInfoList(&sv.Accelerators, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalInferenceMemoryInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalInferenceMemoryInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInferenceDeviceInfo(v **types.InferenceDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InferenceDeviceInfo - if *v == nil { - sv = &types.InferenceDeviceInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("manufacturer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Manufacturer = ptr.String(xtv) - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInferenceDeviceMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInferenceDeviceInfoList(v *[]types.InferenceDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InferenceDeviceInfo - if *v == nil { - sv = make([]types.InferenceDeviceInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.InferenceDeviceInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInferenceDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInferenceDeviceInfoListUnwrapped(v *[]types.InferenceDeviceInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.InferenceDeviceInfo - if *v == nil { - sv = make([]types.InferenceDeviceInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InferenceDeviceInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInferenceDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInferenceDeviceMemoryInfo(v **types.InferenceDeviceMemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InferenceDeviceMemoryInfo - if *v == nil { - sv = &types.InferenceDeviceMemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInitializationStatusDetails(v **types.InitializationStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InitializationStatusDetails - if *v == nil { - sv = &types.InitializationStatusDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("estimatedTimeToCompleteInSeconds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EstimatedTimeToCompleteInSeconds = ptr.Int64(i64) - } - - case strings.EqualFold("initializationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InitializationType = types.InitializationType(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Progress = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInsideCidrBlocksStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInsideCidrBlocksStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstance(v **types.Instance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Instance - if *v == nil { - sv = &types.Instance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amiLaunchIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AmiLaunchIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("architecture", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Architecture = types.ArchitectureValues(xtv) - } - - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bootMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BootMode = types.BootModeValues(xtv) - } - - case strings.EqualFold("capacityBlockId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationSpecificationResponse(&sv.CapacityReservationSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("cpuOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCpuOptions(&sv.CpuOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("currentInstanceBootMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrentInstanceBootMode = types.InstanceBootModeValues(xtv) - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("elasticGpuAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentElasticGpuAssociationList(&sv.ElasticGpuAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("elasticInferenceAcceleratorAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentElasticInferenceAcceleratorAssociationList(&sv.ElasticInferenceAcceleratorAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enaSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSupport = ptr.Bool(xtv) - } - - case strings.EqualFold("enclaveOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnclaveOptions(&sv.EnclaveOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hibernationOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHibernationOptions(&sv.HibernationOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hypervisor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Hypervisor = types.HypervisorType(xtv) - } - - case strings.EqualFold("iamInstanceProfile", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfile(&sv.IamInstanceProfile, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceLifecycle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceLifecycle = types.InstanceLifecycleType(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("ipv6Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Address = ptr.String(xtv) - } - - case strings.EqualFold("kernelId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KernelId = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("launchTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LaunchTime = ptr.Time(t) - } - - case strings.EqualFold("licenseSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLicenseList(&sv.Licenses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maintenanceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMaintenanceOptions(&sv.MaintenanceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("metadataOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMetadataOptionsResponse(&sv.MetadataOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("monitoring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMonitoring(&sv.Monitoring, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkPerformanceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkPerformanceOptions(&sv.NetworkPerformanceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("placement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacement(&sv.Placement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = types.PlatformValues(xtv) - } - - case strings.EqualFold("platformDetails", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PlatformDetails = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsNameOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateDnsNameOptionsResponse(&sv.PrivateDnsNameOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("dnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDnsName = ptr.String(xtv) - } - - case strings.EqualFold("ipAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("ramdiskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RamdiskId = ptr.String(xtv) - } - - case strings.EqualFold("rootDeviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RootDeviceName = ptr.String(xtv) - } - - case strings.EqualFold("rootDeviceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RootDeviceType = types.DeviceType(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceDestCheck", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SourceDestCheck = ptr.Bool(xtv) - } - - case strings.EqualFold("spotInstanceRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotInstanceRequestId = ptr.String(xtv) - } - - case strings.EqualFold("sriovNetSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SriovNetSupport = ptr.String(xtv) - } - - case strings.EqualFold("instanceState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceState(&sv.State, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("stateReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStateReason(&sv.StateReason, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tpmSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TpmSupport = ptr.String(xtv) - } - - case strings.EqualFold("usageOperation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UsageOperation = ptr.String(xtv) - } - - case strings.EqualFold("usageOperationUpdateTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UsageOperationUpdateTime = ptr.Time(t) - } - - case strings.EqualFold("virtualizationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VirtualizationType = types.VirtualizationType(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdSpecification(v **types.InstanceAttachmentEnaSrdSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceAttachmentEnaSrdSpecification - if *v == nil { - sv = &types.InstanceAttachmentEnaSrdSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("enaSrdUdpSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdUdpSpecification(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdUdpSpecification(v **types.InstanceAttachmentEnaSrdUdpSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceAttachmentEnaSrdUdpSpecification - if *v == nil { - sv = &types.InstanceAttachmentEnaSrdUdpSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdUdpEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdUdpEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceBlockDeviceMapping - if *v == nil { - sv = &types.InstanceBlockDeviceMapping{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("ebs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsInstanceBlockDevice(&sv.Ebs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceBlockDeviceMappingList(v *[]types.InstanceBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceBlockDeviceMapping - if *v == nil { - sv = make([]types.InstanceBlockDeviceMapping, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceBlockDeviceMapping - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceBlockDeviceMappingListUnwrapped(v *[]types.InstanceBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceBlockDeviceMapping - if *v == nil { - sv = make([]types.InstanceBlockDeviceMapping, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceBlockDeviceMapping - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceCapacity(v **types.InstanceCapacity, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceCapacity - if *v == nil { - sv = &types.InstanceCapacity{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availableCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("totalCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceConnectEndpointSet(v *[]types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ec2InstanceConnectEndpoint - if *v == nil { - sv = make([]types.Ec2InstanceConnectEndpoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ec2InstanceConnectEndpoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceConnectEndpointSetUnwrapped(v *[]types.Ec2InstanceConnectEndpoint, decoder smithyxml.NodeDecoder) error { - var sv []types.Ec2InstanceConnectEndpoint - if *v == nil { - sv = make([]types.Ec2InstanceConnectEndpoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ec2InstanceConnectEndpoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceCount(v **types.InstanceCount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceCount - if *v == nil { - sv = &types.InstanceCount{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ListingState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceCountList(v *[]types.InstanceCount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceCount - if *v == nil { - sv = make([]types.InstanceCount, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceCount - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceCount(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceCountListUnwrapped(v *[]types.InstanceCount, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceCount - if *v == nil { - sv = make([]types.InstanceCount, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceCount - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceCount(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceCreditSpecification(v **types.InstanceCreditSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceCreditSpecification - if *v == nil { - sv = &types.InstanceCreditSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cpuCredits", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CpuCredits = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceCreditSpecificationList(v *[]types.InstanceCreditSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceCreditSpecification - if *v == nil { - sv = make([]types.InstanceCreditSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceCreditSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceCreditSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceCreditSpecificationListUnwrapped(v *[]types.InstanceCreditSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceCreditSpecification - if *v == nil { - sv = make([]types.InstanceCreditSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceCreditSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceCreditSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceEventWindow(v **types.InstanceEventWindow, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceEventWindow - if *v == nil { - sv = &types.InstanceEventWindow{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationTarget", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindowAssociationTarget(&sv.AssociationTarget, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cronExpression", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CronExpression = ptr.String(xtv) - } - - case strings.EqualFold("instanceEventWindowId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceEventWindowId = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.InstanceEventWindowState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("timeRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindowTimeRangeList(&sv.TimeRanges, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowAssociationTarget(v **types.InstanceEventWindowAssociationTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceEventWindowAssociationTarget - if *v == nil { - sv = &types.InstanceEventWindowAssociationTarget{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dedicatedHostIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDedicatedHostIdList(&sv.DedicatedHostIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIdList(&sv.InstanceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowSet(v *[]types.InstanceEventWindow, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceEventWindow - if *v == nil { - sv = make([]types.InstanceEventWindow, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceEventWindow - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowSetUnwrapped(v *[]types.InstanceEventWindow, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceEventWindow - if *v == nil { - sv = make([]types.InstanceEventWindow, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceEventWindow - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceEventWindowStateChange(v **types.InstanceEventWindowStateChange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceEventWindowStateChange - if *v == nil { - sv = &types.InstanceEventWindowStateChange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindowId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceEventWindowId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.InstanceEventWindowState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowTimeRange(v **types.InstanceEventWindowTimeRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceEventWindowTimeRange - if *v == nil { - sv = &types.InstanceEventWindowTimeRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("endHour", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EndHour = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("endWeekDay", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndWeekDay = types.WeekDay(xtv) - } - - case strings.EqualFold("startHour", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.StartHour = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("startWeekDay", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StartWeekDay = types.WeekDay(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowTimeRangeList(v *[]types.InstanceEventWindowTimeRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceEventWindowTimeRange - if *v == nil { - sv = make([]types.InstanceEventWindowTimeRange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceEventWindowTimeRange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceEventWindowTimeRange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceEventWindowTimeRangeListUnwrapped(v *[]types.InstanceEventWindowTimeRange, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceEventWindowTimeRange - if *v == nil { - sv = make([]types.InstanceEventWindowTimeRange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceEventWindowTimeRange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceEventWindowTimeRange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceExportDetails(v **types.InstanceExportDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceExportDetails - if *v == nil { - sv = &types.InstanceExportDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("targetEnvironment", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetEnvironment = types.ExportEnvironment(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceFamilyCreditSpecification(v **types.InstanceFamilyCreditSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceFamilyCreditSpecification - if *v == nil { - sv = &types.InstanceFamilyCreditSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cpuCredits", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CpuCredits = ptr.String(xtv) - } - - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = types.UnlimitedSupportedInstanceFamily(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceGenerationSet(v *[]types.InstanceGeneration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceGeneration - if *v == nil { - sv = make([]types.InstanceGeneration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceGeneration - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.InstanceGeneration(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceGenerationSetUnwrapped(v *[]types.InstanceGeneration, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceGeneration - if *v == nil { - sv = make([]types.InstanceGeneration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceGeneration - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.InstanceGeneration(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIdList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIdListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIdsSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIdsSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceImageMetadata(v **types.InstanceImageMetadata, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceImageMetadata - if *v == nil { - sv = &types.InstanceImageMetadata{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("imageMetadata", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImageMetadata(&sv.ImageMetadata, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("launchTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LaunchTime = ptr.Time(t) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("instanceState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceState(&sv.State, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("zoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ZoneId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceImageMetadataList(v *[]types.InstanceImageMetadata, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceImageMetadata - if *v == nil { - sv = make([]types.InstanceImageMetadata, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceImageMetadata - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceImageMetadata(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceImageMetadataListUnwrapped(v *[]types.InstanceImageMetadata, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceImageMetadata - if *v == nil { - sv = make([]types.InstanceImageMetadata, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceImageMetadata - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceImageMetadata(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIpv4Prefix(v **types.InstanceIpv4Prefix, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceIpv4Prefix - if *v == nil { - sv = &types.InstanceIpv4Prefix{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv4Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv4Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv4PrefixList(v *[]types.InstanceIpv4Prefix, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceIpv4Prefix - if *v == nil { - sv = make([]types.InstanceIpv4Prefix, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceIpv4Prefix - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceIpv4Prefix(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv4PrefixListUnwrapped(v *[]types.InstanceIpv4Prefix, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceIpv4Prefix - if *v == nil { - sv = make([]types.InstanceIpv4Prefix, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceIpv4Prefix - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceIpv4Prefix(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIpv6Address(v **types.InstanceIpv6Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceIpv6Address - if *v == nil { - sv = &types.InstanceIpv6Address{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Address = ptr.String(xtv) - } - - case strings.EqualFold("isPrimaryIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsPrimaryIpv6 = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv6AddressList(v *[]types.InstanceIpv6Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceIpv6Address - if *v == nil { - sv = make([]types.InstanceIpv6Address, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceIpv6Address - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceIpv6Address(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv6AddressListUnwrapped(v *[]types.InstanceIpv6Address, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceIpv6Address - if *v == nil { - sv = make([]types.InstanceIpv6Address, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceIpv6Address - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceIpv6Address(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceIpv6Prefix(v **types.InstanceIpv6Prefix, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceIpv6Prefix - if *v == nil { - sv = &types.InstanceIpv6Prefix{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv6PrefixList(v *[]types.InstanceIpv6Prefix, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceIpv6Prefix - if *v == nil { - sv = make([]types.InstanceIpv6Prefix, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceIpv6Prefix - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceIpv6Prefix(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceIpv6PrefixListUnwrapped(v *[]types.InstanceIpv6Prefix, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceIpv6Prefix - if *v == nil { - sv = make([]types.InstanceIpv6Prefix, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceIpv6Prefix - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceIpv6Prefix(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceList(v *[]types.Instance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Instance - if *v == nil { - sv = make([]types.Instance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Instance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceListUnwrapped(v *[]types.Instance, decoder smithyxml.NodeDecoder) error { - var sv []types.Instance - if *v == nil { - sv = make([]types.Instance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Instance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceMaintenanceOptions(v **types.InstanceMaintenanceOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceMaintenanceOptions - if *v == nil { - sv = &types.InstanceMaintenanceOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoRecovery", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoRecovery = types.InstanceAutoRecoveryState(xtv) - } - - case strings.EqualFold("rebootMigration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RebootMigration = types.InstanceRebootMigrationState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceMetadataDefaultsResponse(v **types.InstanceMetadataDefaultsResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceMetadataDefaultsResponse - if *v == nil { - sv = &types.InstanceMetadataDefaultsResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("httpEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpEndpoint = types.InstanceMetadataEndpointState(xtv) - } - - case strings.EqualFold("httpPutResponseHopLimit", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("httpTokens", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpTokens = types.HttpTokensState(xtv) - } - - case strings.EqualFold("instanceMetadataTags", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMetadataTags = types.InstanceMetadataTagsState(xtv) - } - - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - case strings.EqualFold("managedExceptionMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedExceptionMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceMetadataOptionsResponse(v **types.InstanceMetadataOptionsResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceMetadataOptionsResponse - if *v == nil { - sv = &types.InstanceMetadataOptionsResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("httpEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpEndpoint = types.InstanceMetadataEndpointState(xtv) - } - - case strings.EqualFold("httpProtocolIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpProtocolIpv6 = types.InstanceMetadataProtocolState(xtv) - } - - case strings.EqualFold("httpPutResponseHopLimit", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("httpTokens", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpTokens = types.HttpTokensState(xtv) - } - - case strings.EqualFold("instanceMetadataTags", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMetadataTags = types.InstanceMetadataTagsState(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.InstanceMetadataOptionsState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceMonitoring(v **types.InstanceMonitoring, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceMonitoring - if *v == nil { - sv = &types.InstanceMonitoring{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("monitoring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMonitoring(&sv.Monitoring, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceMonitoringList(v *[]types.InstanceMonitoring, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceMonitoring - if *v == nil { - sv = make([]types.InstanceMonitoring, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceMonitoring - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceMonitoring(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceMonitoringListUnwrapped(v *[]types.InstanceMonitoring, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceMonitoring - if *v == nil { - sv = make([]types.InstanceMonitoring, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceMonitoring - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceMonitoring(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceNetworkInterface(v **types.InstanceNetworkInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceNetworkInterface - if *v == nil { - sv = &types.InstanceNetworkInterface{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("attachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceAttachment(&sv.Attachment, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("connectionTrackingConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionTrackingSpecificationResponse(&sv.ConnectionTrackingConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("interfaceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterfaceType = ptr.String(xtv) - } - - case strings.EqualFold("ipv4PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIpv4PrefixList(&sv.Ipv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6AddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIpv6AddressList(&sv.Ipv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIpv6PrefixList(&sv.Ipv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("macAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MacAddress = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstancePrivateIpAddressList(&sv.PrivateIpAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceDestCheck", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SourceDestCheck = ptr.Bool(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.NetworkInterfaceStatus(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceAssociation(v **types.InstanceNetworkInterfaceAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceNetworkInterfaceAssociation - if *v == nil { - sv = &types.InstanceNetworkInterfaceAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIp = ptr.String(xtv) - } - - case strings.EqualFold("ipOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("publicDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDnsName = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceAttachment(v **types.InstanceNetworkInterfaceAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceNetworkInterfaceAttachment - if *v == nil { - sv = &types.InstanceNetworkInterfaceAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("deviceIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DeviceIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaQueueCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EnaQueueCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaSrdSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdSpecification(&sv.EnaSrdSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.AttachmentStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceList(v *[]types.InstanceNetworkInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceNetworkInterface - if *v == nil { - sv = make([]types.InstanceNetworkInterface, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceNetworkInterface - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceNetworkInterface(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceListUnwrapped(v *[]types.InstanceNetworkInterface, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceNetworkInterface - if *v == nil { - sv = make([]types.InstanceNetworkInterface, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceNetworkInterface - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceNetworkInterface(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecification(v **types.InstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceNetworkInterfaceSpecification - if *v == nil { - sv = &types.InstanceNetworkInterfaceSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AssociateCarrierIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssociateCarrierIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("associatePublicIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssociatePublicIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("ConnectionTrackingSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionTrackingSpecificationRequest(&sv.ConnectionTrackingSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DeviceIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("EnaQueueCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EnaQueueCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("EnaSrdSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnaSrdSpecificationRequest(&sv.EnaSrdSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("SecurityGroupId", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupIdStringList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("InterfaceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterfaceType = ptr.String(xtv) - } - - case strings.EqualFold("Ipv4PrefixCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv4PrefixCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("Ipv4Prefix", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv4PrefixList(&sv.Ipv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6AddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv6AddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6AddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIpv6AddressList(&sv.Ipv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Ipv6PrefixCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv6PrefixCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("Ipv6Prefix", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6PrefixList(&sv.Ipv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("NetworkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("PrimaryIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PrimaryIpv6 = ptr.Bool(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateIpAddressSpecificationList(&sv.PrivateIpAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("secondaryPrivateIpAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SecondaryPrivateIpAddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecificationList(v *[]types.InstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceNetworkInterfaceSpecification - if *v == nil { - sv = make([]types.InstanceNetworkInterfaceSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceNetworkInterfaceSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecificationListUnwrapped(v *[]types.InstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceNetworkInterfaceSpecification - if *v == nil { - sv = make([]types.InstanceNetworkInterfaceSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceNetworkInterfaceSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceNetworkPerformanceOptions(v **types.InstanceNetworkPerformanceOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceNetworkPerformanceOptions - if *v == nil { - sv = &types.InstanceNetworkPerformanceOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bandwidthWeighting", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BandwidthWeighting = types.InstanceBandwidthWeighting(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstancePrivateIpAddress(v **types.InstancePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstancePrivateIpAddress - if *v == nil { - sv = &types.InstancePrivateIpAddress{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("primary", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Primary = ptr.Bool(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstancePrivateIpAddressList(v *[]types.InstancePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstancePrivateIpAddress - if *v == nil { - sv = make([]types.InstancePrivateIpAddress, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstancePrivateIpAddress - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstancePrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstancePrivateIpAddressListUnwrapped(v *[]types.InstancePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.InstancePrivateIpAddress - if *v == nil { - sv = make([]types.InstancePrivateIpAddress, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstancePrivateIpAddress - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstancePrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceRequirements(v **types.InstanceRequirements, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceRequirements - if *v == nil { - sv = &types.InstanceRequirements{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("acceleratorCount", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAcceleratorCount(&sv.AcceleratorCount, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("acceleratorManufacturerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAcceleratorManufacturerSet(&sv.AcceleratorManufacturers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("acceleratorNameSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAcceleratorNameSet(&sv.AcceleratorNames, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("acceleratorTotalMemoryMiB", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAcceleratorTotalMemoryMiB(&sv.AcceleratorTotalMemoryMiB, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("acceleratorTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAcceleratorTypeSet(&sv.AcceleratorTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("allowedInstanceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAllowedInstanceTypeSet(&sv.AllowedInstanceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bareMetal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BareMetal = types.BareMetal(xtv) - } - - case strings.EqualFold("baselineEbsBandwidthMbps", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBaselineEbsBandwidthMbps(&sv.BaselineEbsBandwidthMbps, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("baselinePerformanceFactors", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBaselinePerformanceFactors(&sv.BaselinePerformanceFactors, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("burstablePerformance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BurstablePerformance = types.BurstablePerformance(xtv) - } - - case strings.EqualFold("cpuManufacturerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCpuManufacturerSet(&sv.CpuManufacturers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("excludedInstanceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExcludedInstanceTypeSet(&sv.ExcludedInstanceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceGenerationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceGenerationSet(&sv.InstanceGenerations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("localStorage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalStorage = types.LocalStorage(xtv) - } - - case strings.EqualFold("localStorageTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalStorageTypeSet(&sv.LocalStorageTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxSpotPriceAsPercentageOfOptimalOnDemandPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("memoryGiBPerVCpu", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMemoryGiBPerVCpu(&sv.MemoryGiBPerVCpu, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("memoryMiB", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMemoryMiB(&sv.MemoryMiB, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkBandwidthGbps", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkBandwidthGbps(&sv.NetworkBandwidthGbps, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceCount", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceCount(&sv.NetworkInterfaceCount, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("onDemandMaxPricePercentageOverLowestPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OnDemandMaxPricePercentageOverLowestPrice = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("requireHibernateSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.RequireHibernateSupport = ptr.Bool(xtv) - } - - case strings.EqualFold("spotMaxPricePercentageOverLowestPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SpotMaxPricePercentageOverLowestPrice = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalLocalStorageGB", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTotalLocalStorageGB(&sv.TotalLocalStorageGB, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vCpuCount", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVCpuCountRange(&sv.VCpuCount, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceSet(v *[]types.InstanceTopology, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceTopology - if *v == nil { - sv = make([]types.InstanceTopology, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceTopology - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceTopology(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceSetUnwrapped(v *[]types.InstanceTopology, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceTopology - if *v == nil { - sv = make([]types.InstanceTopology, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceTopology - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceTopology(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceState(v **types.InstanceState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceState - if *v == nil { - sv = &types.InstanceState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Code = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = types.InstanceStateName(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStateChange(v **types.InstanceStateChange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStateChange - if *v == nil { - sv = &types.InstanceStateChange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currentState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceState(&sv.CurrentState, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("previousState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceState(&sv.PreviousState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStateChangeList(v *[]types.InstanceStateChange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceStateChange - if *v == nil { - sv = make([]types.InstanceStateChange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceStateChange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceStateChange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStateChangeListUnwrapped(v *[]types.InstanceStateChange, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceStateChange - if *v == nil { - sv = make([]types.InstanceStateChange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceStateChange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceStateChange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceStatus(v **types.InstanceStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStatus - if *v == nil { - sv = &types.InstanceStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachedEbsStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsStatusSummary(&sv.AttachedEbsStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("eventsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusEventList(&sv.Events, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceState(&sv.InstanceState, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusSummary(&sv.InstanceStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("systemStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusSummary(&sv.SystemStatus, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusDetails(v **types.InstanceStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStatusDetails - if *v == nil { - sv = &types.InstanceStatusDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("impairedSince", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ImpairedSince = ptr.Time(t) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = types.StatusName(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.StatusType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusDetailsList(v *[]types.InstanceStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceStatusDetails - if *v == nil { - sv = make([]types.InstanceStatusDetails, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceStatusDetails - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusDetailsListUnwrapped(v *[]types.InstanceStatusDetails, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceStatusDetails - if *v == nil { - sv = make([]types.InstanceStatusDetails, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceStatusDetails - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceStatusEvent(v **types.InstanceStatusEvent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStatusEvent - if *v == nil { - sv = &types.InstanceStatusEvent{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.EventCode(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("instanceEventId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceEventId = ptr.String(xtv) - } - - case strings.EqualFold("notAfter", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotAfter = ptr.Time(t) - } - - case strings.EqualFold("notBefore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotBefore = ptr.Time(t) - } - - case strings.EqualFold("notBeforeDeadline", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotBeforeDeadline = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusEventList(v *[]types.InstanceStatusEvent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceStatusEvent - if *v == nil { - sv = make([]types.InstanceStatusEvent, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceStatusEvent - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceStatusEvent(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusEventListUnwrapped(v *[]types.InstanceStatusEvent, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceStatusEvent - if *v == nil { - sv = make([]types.InstanceStatusEvent, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceStatusEvent - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceStatusEvent(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceStatusList(v *[]types.InstanceStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceStatus - if *v == nil { - sv = make([]types.InstanceStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStatusListUnwrapped(v *[]types.InstanceStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceStatus - if *v == nil { - sv = make([]types.InstanceStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceStatusSummary(v **types.InstanceStatusSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStatusSummary - if *v == nil { - sv = &types.InstanceStatusSummary{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("details", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusDetailsList(&sv.Details, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.SummaryStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceStorageInfo(v **types.InstanceStorageInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceStorageInfo - if *v == nil { - sv = &types.InstanceStorageInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("disks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDiskInfoList(&sv.Disks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("encryptionSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EncryptionSupport = types.InstanceStorageEncryptionSupport(xtv) - } - - case strings.EqualFold("nvmeSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NvmeSupport = types.EphemeralNvmeSupport(xtv) - } - - case strings.EqualFold("totalSizeInGB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalSizeInGB = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTagKeySet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTagKeySetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceTagNotificationAttribute(v **types.InstanceTagNotificationAttribute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceTagNotificationAttribute - if *v == nil { - sv = &types.InstanceTagNotificationAttribute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("includeAllTagsOfInstance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IncludeAllTagsOfInstance = ptr.Bool(xtv) - } - - case strings.EqualFold("instanceTagKeySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTagKeySet(&sv.InstanceTagKeys, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTopology(v **types.InstanceTopology, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceTopology - if *v == nil { - sv = &types.InstanceTopology{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("capacityBlockId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityBlockId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("networkNodeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkNodesList(&sv.NetworkNodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("zoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ZoneId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeInfo(v **types.InstanceTypeInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceTypeInfo - if *v == nil { - sv = &types.InstanceTypeInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoRecoverySupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected AutoRecoveryFlag to be of type *bool, got %T instead", val) - } - sv.AutoRecoverySupported = ptr.Bool(xtv) - } - - case strings.EqualFold("bareMetal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected BareMetalFlag to be of type *bool, got %T instead", val) - } - sv.BareMetal = ptr.Bool(xtv) - } - - case strings.EqualFold("burstablePerformanceSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected BurstablePerformanceFlag to be of type *bool, got %T instead", val) - } - sv.BurstablePerformanceSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("currentGeneration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected CurrentGenerationFlag to be of type *bool, got %T instead", val) - } - sv.CurrentGeneration = ptr.Bool(xtv) - } - - case strings.EqualFold("dedicatedHostsSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected DedicatedHostFlag to be of type *bool, got %T instead", val) - } - sv.DedicatedHostsSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("ebsInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEbsInfo(&sv.EbsInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("fpgaInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaInfo(&sv.FpgaInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("freeTierEligible", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected FreeTierEligibleFlag to be of type *bool, got %T instead", val) - } - sv.FreeTierEligible = ptr.Bool(xtv) - } - - case strings.EqualFold("gpuInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGpuInfo(&sv.GpuInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hibernationSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected HibernationFlag to be of type *bool, got %T instead", val) - } - sv.HibernationSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("hypervisor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Hypervisor = types.InstanceTypeHypervisor(xtv) - } - - case strings.EqualFold("inferenceAcceleratorInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInferenceAcceleratorInfo(&sv.InferenceAcceleratorInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceStorageInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStorageInfo(&sv.InstanceStorageInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceStorageSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected InstanceStorageFlag to be of type *bool, got %T instead", val) - } - sv.InstanceStorageSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("mediaAcceleratorInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMediaAcceleratorInfo(&sv.MediaAcceleratorInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInfo(&sv.NetworkInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("neuronInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNeuronInfo(&sv.NeuronInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nitroEnclavesSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NitroEnclavesSupport = types.NitroEnclavesSupport(xtv) - } - - case strings.EqualFold("nitroTpmInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNitroTpmInfo(&sv.NitroTpmInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nitroTpmSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NitroTpmSupport = types.NitroTpmSupport(xtv) - } - - case strings.EqualFold("phcSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PhcSupport = types.PhcSupport(xtv) - } - - case strings.EqualFold("placementGroupInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementGroupInfo(&sv.PlacementGroupInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("processorInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProcessorInfo(&sv.ProcessorInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("rebootMigrationSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RebootMigrationSupport = types.RebootMigrationSupport(xtv) - } - - case strings.EqualFold("supportedBootModes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBootModeTypeList(&sv.SupportedBootModes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedRootDeviceTypes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRootDeviceTypeList(&sv.SupportedRootDeviceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedUsageClasses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUsageClassTypeList(&sv.SupportedUsageClasses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedVirtualizationTypes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVirtualizationTypeList(&sv.SupportedVirtualizationTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vCpuInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVCpuInfo(&sv.VCpuInfo, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirements(v **types.InstanceTypeInfoFromInstanceRequirements, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceTypeInfoFromInstanceRequirements - if *v == nil { - sv = &types.InstanceTypeInfoFromInstanceRequirements{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirementsSet(v *[]types.InstanceTypeInfoFromInstanceRequirements, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceTypeInfoFromInstanceRequirements - if *v == nil { - sv = make([]types.InstanceTypeInfoFromInstanceRequirements, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceTypeInfoFromInstanceRequirements - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirements(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirementsSetUnwrapped(v *[]types.InstanceTypeInfoFromInstanceRequirements, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceTypeInfoFromInstanceRequirements - if *v == nil { - sv = make([]types.InstanceTypeInfoFromInstanceRequirements, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceTypeInfoFromInstanceRequirements - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirements(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceTypeInfoList(v *[]types.InstanceTypeInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceTypeInfo - if *v == nil { - sv = make([]types.InstanceTypeInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceTypeInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceTypeInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeInfoListUnwrapped(v *[]types.InstanceTypeInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceTypeInfo - if *v == nil { - sv = make([]types.InstanceTypeInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceTypeInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceTypeInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceTypeOffering(v **types.InstanceTypeOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceTypeOffering - if *v == nil { - sv = &types.InstanceTypeOffering{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("location", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Location = ptr.String(xtv) - } - - case strings.EqualFold("locationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocationType = types.LocationType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeOfferingsList(v *[]types.InstanceTypeOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceTypeOffering - if *v == nil { - sv = make([]types.InstanceTypeOffering, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceTypeOffering - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceTypeOffering(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypeOfferingsListUnwrapped(v *[]types.InstanceTypeOffering, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceTypeOffering - if *v == nil { - sv = make([]types.InstanceTypeOffering, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceTypeOffering - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceTypeOffering(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceTypesList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceTypesListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInstanceUsage(v **types.InstanceUsage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InstanceUsage - if *v == nil { - sv = &types.InstanceUsage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccountId = ptr.String(xtv) - } - - case strings.EqualFold("usedInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UsedInstanceCount = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceUsageSet(v *[]types.InstanceUsage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InstanceUsage - if *v == nil { - sv = make([]types.InstanceUsage, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InstanceUsage - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInstanceUsage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInstanceUsageSetUnwrapped(v *[]types.InstanceUsage, decoder smithyxml.NodeDecoder) error { - var sv []types.InstanceUsage - if *v == nil { - sv = make([]types.InstanceUsage, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InstanceUsage - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInstanceUsage(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInternetGateway(v **types.InternetGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InternetGateway - if *v == nil { - sv = &types.InternetGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInternetGatewayAttachmentList(&sv.Attachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("internetGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InternetGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInternetGatewayAttachment(v **types.InternetGatewayAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InternetGatewayAttachment - if *v == nil { - sv = &types.InternetGatewayAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AttachmentStatus(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInternetGatewayAttachmentList(v *[]types.InternetGatewayAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InternetGatewayAttachment - if *v == nil { - sv = make([]types.InternetGatewayAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InternetGatewayAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInternetGatewayAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInternetGatewayAttachmentListUnwrapped(v *[]types.InternetGatewayAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.InternetGatewayAttachment - if *v == nil { - sv = make([]types.InternetGatewayAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InternetGatewayAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInternetGatewayAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentInternetGatewayList(v *[]types.InternetGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.InternetGateway - if *v == nil { - sv = make([]types.InternetGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.InternetGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentInternetGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentInternetGatewayListUnwrapped(v *[]types.InternetGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.InternetGateway - if *v == nil { - sv = make([]types.InternetGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.InternetGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentInternetGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpAddressList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpAddressListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpam(v **types.Ipam, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipam - if *v == nil { - sv = &types.Ipam{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("defaultResourceDiscoveryAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DefaultResourceDiscoveryAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("defaultResourceDiscoveryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DefaultResourceDiscoveryId = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("enablePrivateGua", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnablePrivateGua = ptr.Bool(xtv) - } - - case strings.EqualFold("ipamArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamId = ptr.String(xtv) - } - - case strings.EqualFold("ipamRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamRegion = ptr.String(xtv) - } - - case strings.EqualFold("meteredAccount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MeteredAccount = types.IpamMeteredAccount(xtv) - } - - case strings.EqualFold("operatingRegionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamOperatingRegionSet(&sv.OperatingRegions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("privateDefaultScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDefaultScopeId = ptr.String(xtv) - } - - case strings.EqualFold("publicDefaultScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDefaultScopeId = ptr.String(xtv) - } - - case strings.EqualFold("resourceDiscoveryAssociationCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ResourceDiscoveryAssociationCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("scopeCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ScopeCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tier = types.IpamTier(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamAddressHistoryRecord(v **types.IpamAddressHistoryRecord, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamAddressHistoryRecord - if *v == nil { - sv = &types.IpamAddressHistoryRecord{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceCidr = ptr.String(xtv) - } - - case strings.EqualFold("resourceComplianceStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceComplianceStatus = types.IpamComplianceStatus(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceName = ptr.String(xtv) - } - - case strings.EqualFold("resourceOverlapStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOverlapStatus = types.IpamOverlapStatus(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.IpamAddressHistoryResourceType(xtv) - } - - case strings.EqualFold("sampledEndTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.SampledEndTime = ptr.Time(t) - } - - case strings.EqualFold("sampledStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.SampledStartTime = ptr.Time(t) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamAddressHistoryRecordSet(v *[]types.IpamAddressHistoryRecord, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamAddressHistoryRecord - if *v == nil { - sv = make([]types.IpamAddressHistoryRecord, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamAddressHistoryRecord - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamAddressHistoryRecord(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamAddressHistoryRecordSetUnwrapped(v *[]types.IpamAddressHistoryRecord, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamAddressHistoryRecord - if *v == nil { - sv = make([]types.IpamAddressHistoryRecord, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamAddressHistoryRecord - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamAddressHistoryRecord(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamDiscoveredAccount(v **types.IpamDiscoveredAccount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamDiscoveredAccount - if *v == nil { - sv = &types.IpamDiscoveredAccount{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccountId = ptr.String(xtv) - } - - case strings.EqualFold("discoveryRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DiscoveryRegion = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamDiscoveryFailureReason(&sv.FailureReason, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastAttemptedDiscoveryTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastAttemptedDiscoveryTime = ptr.Time(t) - } - - case strings.EqualFold("lastSuccessfulDiscoveryTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastSuccessfulDiscoveryTime = ptr.Time(t) - } - - case strings.EqualFold("organizationalUnitId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OrganizationalUnitId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredAccountSet(v *[]types.IpamDiscoveredAccount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamDiscoveredAccount - if *v == nil { - sv = make([]types.IpamDiscoveredAccount, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamDiscoveredAccount - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamDiscoveredAccount(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredAccountSetUnwrapped(v *[]types.IpamDiscoveredAccount, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamDiscoveredAccount - if *v == nil { - sv = make([]types.IpamDiscoveredAccount, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamDiscoveredAccount - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamDiscoveredAccount(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(v **types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamDiscoveredPublicAddress - if *v == nil { - sv = &types.IpamDiscoveredPublicAddress{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Address = ptr.String(xtv) - } - - case strings.EqualFold("addressAllocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressAllocationId = ptr.String(xtv) - } - - case strings.EqualFold("addressOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("addressRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressRegion = ptr.String(xtv) - } - - case strings.EqualFold("addressType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressType = types.IpamPublicAddressType(xtv) - } - - case strings.EqualFold("associationStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationStatus = types.IpamPublicAddressAssociationStatus(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryId = ptr.String(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceDescription = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv4PoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv4PoolId = ptr.String(xtv) - } - - case strings.EqualFold("sampleTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.SampleTime = ptr.Time(t) - } - - case strings.EqualFold("securityGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("service", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Service = types.IpamPublicAddressAwsService(xtv) - } - - case strings.EqualFold("serviceResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceResource = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tags", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPublicAddressTags(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSet(v *[]types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamDiscoveredPublicAddress - if *v == nil { - sv = make([]types.IpamDiscoveredPublicAddress, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamDiscoveredPublicAddress - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSetUnwrapped(v *[]types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamDiscoveredPublicAddress - if *v == nil { - sv = make([]types.IpamDiscoveredPublicAddress, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamDiscoveredPublicAddress - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(v **types.IpamDiscoveredResourceCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamDiscoveredResourceCidr - if *v == nil { - sv = &types.IpamDiscoveredResourceCidr{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryId = ptr.String(xtv) - } - - case strings.EqualFold("ipSource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpSource = types.IpamResourceCidrIpSource(xtv) - } - - case strings.EqualFold("ipUsage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.IpUsage = ptr.Float64(f64) - } - - case strings.EqualFold("networkInterfaceAttachmentStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceAttachmentStatus = types.IpamNetworkInterfaceAttachmentStatus(xtv) - } - - case strings.EqualFold("resourceCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceCidr = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) - } - - case strings.EqualFold("resourceTagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceTagList(&sv.ResourceTags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.IpamResourceType(xtv) - } - - case strings.EqualFold("sampleTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.SampleTime = ptr.Time(t) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidrSet(v *[]types.IpamDiscoveredResourceCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamDiscoveredResourceCidr - if *v == nil { - sv = make([]types.IpamDiscoveredResourceCidr, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamDiscoveredResourceCidr - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidrSetUnwrapped(v *[]types.IpamDiscoveredResourceCidr, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamDiscoveredResourceCidr - if *v == nil { - sv = make([]types.IpamDiscoveredResourceCidr, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamDiscoveredResourceCidr - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamDiscoveryFailureReason(v **types.IpamDiscoveryFailureReason, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamDiscoveryFailureReason - if *v == nil { - sv = &types.IpamDiscoveryFailureReason{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.IpamDiscoveryFailureCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamExternalResourceVerificationToken(v **types.IpamExternalResourceVerificationToken, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamExternalResourceVerificationToken - if *v == nil { - sv = &types.IpamExternalResourceVerificationToken{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamExternalResourceVerificationTokenArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamExternalResourceVerificationTokenArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamExternalResourceVerificationTokenId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamExternalResourceVerificationTokenId = ptr.String(xtv) - } - - case strings.EqualFold("ipamId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamId = ptr.String(xtv) - } - - case strings.EqualFold("ipamRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamRegion = ptr.String(xtv) - } - - case strings.EqualFold("notAfter", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotAfter = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamExternalResourceVerificationTokenState(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.TokenState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tokenName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TokenName = ptr.String(xtv) - } - - case strings.EqualFold("tokenValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TokenValue = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamExternalResourceVerificationTokenSet(v *[]types.IpamExternalResourceVerificationToken, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamExternalResourceVerificationToken - if *v == nil { - sv = make([]types.IpamExternalResourceVerificationToken, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamExternalResourceVerificationToken - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamExternalResourceVerificationToken(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamExternalResourceVerificationTokenSetUnwrapped(v *[]types.IpamExternalResourceVerificationToken, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamExternalResourceVerificationToken - if *v == nil { - sv = make([]types.IpamExternalResourceVerificationToken, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamExternalResourceVerificationToken - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamExternalResourceVerificationToken(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamOperatingRegion(v **types.IpamOperatingRegion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamOperatingRegion - if *v == nil { - sv = &types.IpamOperatingRegion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("regionName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RegionName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamOperatingRegionSet(v *[]types.IpamOperatingRegion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamOperatingRegion - if *v == nil { - sv = make([]types.IpamOperatingRegion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamOperatingRegion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamOperatingRegion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamOperatingRegionSetUnwrapped(v *[]types.IpamOperatingRegion, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamOperatingRegion - if *v == nil { - sv = make([]types.IpamOperatingRegion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamOperatingRegion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamOperatingRegion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(v **types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamOrganizationalUnitExclusion - if *v == nil { - sv = &types.IpamOrganizationalUnitExclusion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("organizationsEntityPath", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OrganizationsEntityPath = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSet(v *[]types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamOrganizationalUnitExclusion - if *v == nil { - sv = make([]types.IpamOrganizationalUnitExclusion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamOrganizationalUnitExclusion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSetUnwrapped(v *[]types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamOrganizationalUnitExclusion - if *v == nil { - sv = make([]types.IpamOrganizationalUnitExclusion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamOrganizationalUnitExclusion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPool(v **types.IpamPool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPool - if *v == nil { - sv = &types.IpamPool{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressFamily = types.AddressFamily(xtv) - } - - case strings.EqualFold("allocationDefaultNetmaskLength", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AllocationDefaultNetmaskLength = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("allocationMaxNetmaskLength", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AllocationMaxNetmaskLength = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("allocationMinNetmaskLength", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AllocationMinNetmaskLength = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("allocationResourceTagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceTagList(&sv.AllocationResourceTags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("autoImport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AutoImport = ptr.Bool(xtv) - } - - case strings.EqualFold("awsService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsService = types.IpamPoolAwsService(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("ipamArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamPoolArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamPoolArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamPoolId = ptr.String(xtv) - } - - case strings.EqualFold("ipamRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamRegion = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeType = types.IpamScopeType(xtv) - } - - case strings.EqualFold("locale", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Locale = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("poolDepth", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PoolDepth = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("publicIpSource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpSource = types.IpamPoolPublicIpSource(xtv) - } - - case strings.EqualFold("publiclyAdvertisable", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PubliclyAdvertisable = ptr.Bool(xtv) - } - - case strings.EqualFold("sourceIpamPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIpamPoolId = ptr.String(xtv) - } - - case strings.EqualFold("sourceResource", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolSourceResource(&sv.SourceResource, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamPoolState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPoolAllocation - if *v == nil { - sv = &types.IpamPoolAllocation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("ipamPoolAllocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamPoolAllocationId = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwner = ptr.String(xtv) - } - - case strings.EqualFold("resourceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.IpamPoolAllocationResourceType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolAllocationSet(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamPoolAllocation - if *v == nil { - sv = make([]types.IpamPoolAllocation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamPoolAllocation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolAllocationSetUnwrapped(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPoolAllocation - if *v == nil { - sv = make([]types.IpamPoolAllocation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamPoolAllocation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPoolCidr - if *v == nil { - sv = &types.IpamPoolCidr{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(&sv.FailureReason, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipamPoolCidrId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamPoolCidrId = ptr.String(xtv) - } - - case strings.EqualFold("netmaskLength", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetmaskLength = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamPoolCidrState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPoolCidrFailureReason, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPoolCidrFailureReason - if *v == nil { - sv = &types.IpamPoolCidrFailureReason{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.IpamPoolCidrFailureCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolCidrSet(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamPoolCidr - if *v == nil { - sv = make([]types.IpamPoolCidr, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamPoolCidr - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolCidrSetUnwrapped(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPoolCidr - if *v == nil { - sv = make([]types.IpamPoolCidr, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamPoolCidr - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPoolSet(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamPool - if *v == nil { - sv = make([]types.IpamPool, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamPool - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPoolSetUnwrapped(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPool - if *v == nil { - sv = make([]types.IpamPool, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamPool - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPoolSourceResource(v **types.IpamPoolSourceResource, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPoolSourceResource - if *v == nil { - sv = &types.IpamPoolSourceResource{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwner = ptr.String(xtv) - } - - case strings.EqualFold("resourceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.IpamPoolSourceResourceType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(v **types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPublicAddressSecurityGroup - if *v == nil { - sv = &types.IpamPublicAddressSecurityGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupList(v *[]types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamPublicAddressSecurityGroup - if *v == nil { - sv = make([]types.IpamPublicAddressSecurityGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamPublicAddressSecurityGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupListUnwrapped(v *[]types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPublicAddressSecurityGroup - if *v == nil { - sv = make([]types.IpamPublicAddressSecurityGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamPublicAddressSecurityGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPublicAddressTag(v **types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPublicAddressTag - if *v == nil { - sv = &types.IpamPublicAddressTag{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Key = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPublicAddressTagList(v *[]types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamPublicAddressTag - if *v == nil { - sv = make([]types.IpamPublicAddressTag, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamPublicAddressTag - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPublicAddressTag(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamPublicAddressTagListUnwrapped(v *[]types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPublicAddressTag - if *v == nil { - sv = make([]types.IpamPublicAddressTag, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamPublicAddressTag - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPublicAddressTag(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamPublicAddressTags(v **types.IpamPublicAddressTags, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamPublicAddressTags - if *v == nil { - sv = &types.IpamPublicAddressTags{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("eipTagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPublicAddressTagList(&sv.EipTags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceCidr(v **types.IpamResourceCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamResourceCidr - if *v == nil { - sv = &types.IpamResourceCidr{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("complianceStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComplianceStatus = types.IpamComplianceStatus(xtv) - } - - case strings.EqualFold("ipamId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamId = ptr.String(xtv) - } - - case strings.EqualFold("ipamPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamPoolId = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeId = ptr.String(xtv) - } - - case strings.EqualFold("ipUsage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.IpUsage = ptr.Float64(f64) - } - - case strings.EqualFold("managementState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagementState = types.IpamManagementState(xtv) - } - - case strings.EqualFold("overlapStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OverlapStatus = types.IpamOverlapStatus(xtv) - } - - case strings.EqualFold("resourceCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceCidr = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceName = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) - } - - case strings.EqualFold("resourceTagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceTagList(&sv.ResourceTags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.IpamResourceType(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceCidrSet(v *[]types.IpamResourceCidr, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamResourceCidr - if *v == nil { - sv = make([]types.IpamResourceCidr, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamResourceCidr - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamResourceCidr(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceCidrSetUnwrapped(v *[]types.IpamResourceCidr, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamResourceCidr - if *v == nil { - sv = make([]types.IpamResourceCidr, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamResourceCidr - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamResourceCidr(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamResourceDiscovery(v **types.IpamResourceDiscovery, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamResourceDiscovery - if *v == nil { - sv = &types.IpamResourceDiscovery{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryId = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryRegion = ptr.String(xtv) - } - - case strings.EqualFold("isDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("operatingRegionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamOperatingRegionSet(&sv.OperatingRegions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("organizationalUnitExclusionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSet(&sv.OrganizationalUnitExclusions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamResourceDiscoveryState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociation(v **types.IpamResourceDiscoveryAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamResourceDiscoveryAssociation - if *v == nil { - sv = &types.IpamResourceDiscoveryAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamId = ptr.String(xtv) - } - - case strings.EqualFold("ipamRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamRegion = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryAssociationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryAssociationArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamResourceDiscoveryId = ptr.String(xtv) - } - - case strings.EqualFold("isDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceDiscoveryStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceDiscoveryStatus = types.IpamAssociatedResourceDiscoveryStatus(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamResourceDiscoveryAssociationState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociationSet(v *[]types.IpamResourceDiscoveryAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamResourceDiscoveryAssociation - if *v == nil { - sv = make([]types.IpamResourceDiscoveryAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamResourceDiscoveryAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociationSetUnwrapped(v *[]types.IpamResourceDiscoveryAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamResourceDiscoveryAssociation - if *v == nil { - sv = make([]types.IpamResourceDiscoveryAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamResourceDiscoveryAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamResourceDiscoverySet(v *[]types.IpamResourceDiscovery, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamResourceDiscovery - if *v == nil { - sv = make([]types.IpamResourceDiscovery, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamResourceDiscovery - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamResourceDiscovery(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceDiscoverySetUnwrapped(v *[]types.IpamResourceDiscovery, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamResourceDiscovery - if *v == nil { - sv = make([]types.IpamResourceDiscovery, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamResourceDiscovery - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamResourceDiscovery(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamResourceTag(v **types.IpamResourceTag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamResourceTag - if *v == nil { - sv = &types.IpamResourceTag{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Key = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceTagList(v *[]types.IpamResourceTag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamResourceTag - if *v == nil { - sv = make([]types.IpamResourceTag, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamResourceTag - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamResourceTag(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamResourceTagListUnwrapped(v *[]types.IpamResourceTag, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamResourceTag - if *v == nil { - sv = make([]types.IpamResourceTag, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamResourceTag - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamResourceTag(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamScope(v **types.IpamScope, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpamScope - if *v == nil { - sv = &types.IpamScope{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("ipamArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamRegion = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeArn = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeId = ptr.String(xtv) - } - - case strings.EqualFold("ipamScopeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpamScopeType = types.IpamScopeType(xtv) - } - - case strings.EqualFold("isDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("poolCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PoolCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.IpamScopeState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamScopeSet(v *[]types.IpamScope, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpamScope - if *v == nil { - sv = make([]types.IpamScope, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpamScope - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpamScope(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamScopeSetUnwrapped(v *[]types.IpamScope, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamScope - if *v == nil { - sv = make([]types.IpamScope, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpamScope - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamScope(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpamSet(v *[]types.Ipam, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipam - if *v == nil { - sv = make([]types.Ipam, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipam - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpam(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpamSetUnwrapped(v *[]types.Ipam, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipam - if *v == nil { - sv = make([]types.Ipam, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipam - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpam(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpPermission(v **types.IpPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpPermission - if *v == nil { - sv = &types.IpPermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpProtocol = ptr.String(xtv) - } - - case strings.EqualFold("ipRanges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpRangeList(&sv.IpRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6Ranges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6RangeList(&sv.Ipv6Ranges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("prefixListIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListIdList(&sv.PrefixListIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("groups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUserIdGroupPairList(&sv.UserIdGroupPairs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpPermissionList(v *[]types.IpPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpPermission - if *v == nil { - sv = make([]types.IpPermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpPermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpPermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpPermissionListUnwrapped(v *[]types.IpPermission, decoder smithyxml.NodeDecoder) error { - var sv []types.IpPermission - if *v == nil { - sv = make([]types.IpPermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpPermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpPermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpPrefixList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpPrefixListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpRange(v **types.IpRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IpRange - if *v == nil { - sv = &types.IpRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIp = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpRangeList(v *[]types.IpRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.IpRange - if *v == nil { - sv = make([]types.IpRange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.IpRange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpRange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpRangeListUnwrapped(v *[]types.IpRange, decoder smithyxml.NodeDecoder) error { - var sv []types.IpRange - if *v == nil { - sv = make([]types.IpRange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.IpRange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpRange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpRanges(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpRangesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv4PrefixesList(v *[]types.Ipv4PrefixSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv4PrefixSpecification - if *v == nil { - sv = make([]types.Ipv4PrefixSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv4PrefixSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv4PrefixesListUnwrapped(v *[]types.Ipv4PrefixSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv4PrefixSpecification - if *v == nil { - sv = make([]types.Ipv4PrefixSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv4PrefixSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv4PrefixList(v *[]types.Ipv4PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv4PrefixSpecificationRequest - if *v == nil { - sv = make([]types.Ipv4PrefixSpecificationRequest, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv4PrefixSpecificationRequest - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecificationRequest(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv4PrefixListUnwrapped(v *[]types.Ipv4PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv4PrefixSpecificationRequest - if *v == nil { - sv = make([]types.Ipv4PrefixSpecificationRequest, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv4PrefixSpecificationRequest - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecificationRequest(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv4PrefixListResponse(v *[]types.Ipv4PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv4PrefixSpecificationResponse - if *v == nil { - sv = make([]types.Ipv4PrefixSpecificationResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv4PrefixSpecificationResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv4PrefixListResponseUnwrapped(v *[]types.Ipv4PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv4PrefixSpecificationResponse - if *v == nil { - sv = make([]types.Ipv4PrefixSpecificationResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv4PrefixSpecificationResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv4PrefixSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv4PrefixSpecification(v **types.Ipv4PrefixSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv4PrefixSpecification - if *v == nil { - sv = &types.Ipv4PrefixSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv4Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv4Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv4PrefixSpecificationRequest(v **types.Ipv4PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv4PrefixSpecificationRequest - if *v == nil { - sv = &types.Ipv4PrefixSpecificationRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Ipv4Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv4Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv4PrefixSpecificationResponse(v **types.Ipv4PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv4PrefixSpecificationResponse - if *v == nil { - sv = &types.Ipv4PrefixSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv4Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv4Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6AddressList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6AddressListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6CidrAssociation(v **types.Ipv6CidrAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6CidrAssociation - if *v == nil { - sv = &types.Ipv6CidrAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResource = ptr.String(xtv) - } - - case strings.EqualFold("ipv6Cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Cidr = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6CidrAssociationSet(v *[]types.Ipv6CidrAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6CidrAssociation - if *v == nil { - sv = make([]types.Ipv6CidrAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6CidrAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6CidrAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6CidrAssociationSetUnwrapped(v *[]types.Ipv6CidrAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6CidrAssociation - if *v == nil { - sv = make([]types.Ipv6CidrAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6CidrAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6CidrAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6CidrBlock(v **types.Ipv6CidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6CidrBlock - if *v == nil { - sv = &types.Ipv6CidrBlock{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6CidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6CidrBlock = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6CidrBlockSet(v *[]types.Ipv6CidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6CidrBlock - if *v == nil { - sv = make([]types.Ipv6CidrBlock, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6CidrBlock - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6CidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6CidrBlockSetUnwrapped(v *[]types.Ipv6CidrBlock, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6CidrBlock - if *v == nil { - sv = make([]types.Ipv6CidrBlock, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6CidrBlock - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6CidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6Pool(v **types.Ipv6Pool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6Pool - if *v == nil { - sv = &types.Ipv6Pool{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("poolCidrBlockSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPoolCidrBlocksSet(&sv.PoolCidrBlocks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PoolSet(v *[]types.Ipv6Pool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6Pool - if *v == nil { - sv = make([]types.Ipv6Pool, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6Pool - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6Pool(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PoolSetUnwrapped(v *[]types.Ipv6Pool, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6Pool - if *v == nil { - sv = make([]types.Ipv6Pool, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6Pool - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6Pool(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6PrefixesList(v *[]types.Ipv6PrefixSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6PrefixSpecification - if *v == nil { - sv = make([]types.Ipv6PrefixSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6PrefixSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PrefixesListUnwrapped(v *[]types.Ipv6PrefixSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6PrefixSpecification - if *v == nil { - sv = make([]types.Ipv6PrefixSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6PrefixSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6PrefixList(v *[]types.Ipv6PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6PrefixSpecificationRequest - if *v == nil { - sv = make([]types.Ipv6PrefixSpecificationRequest, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6PrefixSpecificationRequest - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecificationRequest(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PrefixListUnwrapped(v *[]types.Ipv6PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6PrefixSpecificationRequest - if *v == nil { - sv = make([]types.Ipv6PrefixSpecificationRequest, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6PrefixSpecificationRequest - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecificationRequest(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6PrefixListResponse(v *[]types.Ipv6PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6PrefixSpecificationResponse - if *v == nil { - sv = make([]types.Ipv6PrefixSpecificationResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6PrefixSpecificationResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PrefixListResponseUnwrapped(v *[]types.Ipv6PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6PrefixSpecificationResponse - if *v == nil { - sv = make([]types.Ipv6PrefixSpecificationResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6PrefixSpecificationResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6PrefixSpecificationResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentIpv6PrefixSpecification(v **types.Ipv6PrefixSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6PrefixSpecification - if *v == nil { - sv = &types.Ipv6PrefixSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PrefixSpecificationRequest(v **types.Ipv6PrefixSpecificationRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6PrefixSpecificationRequest - if *v == nil { - sv = &types.Ipv6PrefixSpecificationRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Ipv6Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6PrefixSpecificationResponse(v **types.Ipv6PrefixSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6PrefixSpecificationResponse - if *v == nil { - sv = &types.Ipv6PrefixSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6Range(v **types.Ipv6Range, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Ipv6Range - if *v == nil { - sv = &types.Ipv6Range{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIpv6 = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6RangeList(v *[]types.Ipv6Range, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Ipv6Range - if *v == nil { - sv = make([]types.Ipv6Range, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Ipv6Range - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentIpv6Range(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentIpv6RangeListUnwrapped(v *[]types.Ipv6Range, decoder smithyxml.NodeDecoder) error { - var sv []types.Ipv6Range - if *v == nil { - sv = make([]types.Ipv6Range, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Ipv6Range - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentIpv6Range(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentKeyPairInfo(v **types.KeyPairInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.KeyPairInfo - if *v == nil { - sv = &types.KeyPairInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("keyFingerprint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyFingerprint = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("keyPairId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyPairId = ptr.String(xtv) - } - - case strings.EqualFold("keyType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyType = types.KeyType(xtv) - } - - case strings.EqualFold("publicKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicKey = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentKeyPairList(v *[]types.KeyPairInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.KeyPairInfo - if *v == nil { - sv = make([]types.KeyPairInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.KeyPairInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentKeyPairInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentKeyPairListUnwrapped(v *[]types.KeyPairInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.KeyPairInfo - if *v == nil { - sv = make([]types.KeyPairInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.KeyPairInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentKeyPairInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLastError(v **types.LastError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LastError - if *v == nil { - sv = &types.LastError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchPermission(v **types.LaunchPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchPermission - if *v == nil { - sv = &types.LaunchPermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("group", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Group = types.PermissionGroup(xtv) - } - - case strings.EqualFold("organizationalUnitArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OrganizationalUnitArn = ptr.String(xtv) - } - - case strings.EqualFold("organizationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OrganizationArn = ptr.String(xtv) - } - - case strings.EqualFold("userId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchPermissionList(v *[]types.LaunchPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchPermission - if *v == nil { - sv = make([]types.LaunchPermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchPermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchPermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchPermissionListUnwrapped(v *[]types.LaunchPermission, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchPermission - if *v == nil { - sv = make([]types.LaunchPermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchPermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchPermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchSpecification(v **types.LaunchSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchSpecification - if *v == nil { - sv = &types.LaunchSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressingType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressingType = ptr.String(xtv) - } - - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("iamInstanceProfile", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileSpecification(&sv.IamInstanceProfile, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("kernelId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KernelId = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("monitoring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRunInstancesMonitoringEnabled(&sv.Monitoring, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecificationList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("placement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotPlacement(&sv.Placement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ramdiskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RamdiskId = ptr.String(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("userData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserData = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchSpecsList(v *[]types.SpotFleetLaunchSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotFleetLaunchSpecification - if *v == nil { - sv = make([]types.SpotFleetLaunchSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotFleetLaunchSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotFleetLaunchSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchSpecsListUnwrapped(v *[]types.SpotFleetLaunchSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotFleetLaunchSpecification - if *v == nil { - sv = make([]types.SpotFleetLaunchSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotFleetLaunchSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotFleetLaunchSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplate(v **types.LaunchTemplate, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplate - if *v == nil { - sv = &types.LaunchTemplate{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createdBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreatedBy = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("defaultVersionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultVersionNumber = ptr.Int64(i64) - } - - case strings.EqualFold("latestVersionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LatestVersionNumber = ptr.Int64(i64) - } - - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateAndOverridesResponse(v **types.LaunchTemplateAndOverridesResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateAndOverridesResponse - if *v == nil { - sv = &types.LaunchTemplateAndOverridesResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateSpecification(&sv.LaunchTemplateSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("overrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateOverrides(&sv.Overrides, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMapping(v **types.LaunchTemplateBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateBlockDeviceMapping - if *v == nil { - sv = &types.LaunchTemplateBlockDeviceMapping{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("ebs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateEbsBlockDevice(&sv.Ebs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("noDevice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NoDevice = ptr.String(xtv) - } - - case strings.EqualFold("virtualName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VirtualName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMappingList(v *[]types.LaunchTemplateBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateBlockDeviceMapping - if *v == nil { - sv = make([]types.LaunchTemplateBlockDeviceMapping, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateBlockDeviceMapping - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMappingListUnwrapped(v *[]types.LaunchTemplateBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateBlockDeviceMapping - if *v == nil { - sv = make([]types.LaunchTemplateBlockDeviceMapping, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateBlockDeviceMapping - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMapping(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateCapacityReservationSpecificationResponse(v **types.LaunchTemplateCapacityReservationSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateCapacityReservationSpecificationResponse - if *v == nil { - sv = &types.LaunchTemplateCapacityReservationSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationPreference", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationPreference = types.CapacityReservationPreference(xtv) - } - - case strings.EqualFold("capacityReservationTarget", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationTargetResponse(&sv.CapacityReservationTarget, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateConfig(v **types.LaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateConfig - if *v == nil { - sv = &types.LaunchTemplateConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetLaunchTemplateSpecification(&sv.LaunchTemplateSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("overrides", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateOverridesList(&sv.Overrides, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateConfigList(v *[]types.LaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateConfig - if *v == nil { - sv = make([]types.LaunchTemplateConfig, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateConfig - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateConfig(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateConfigListUnwrapped(v *[]types.LaunchTemplateConfig, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateConfig - if *v == nil { - sv = make([]types.LaunchTemplateConfig, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateConfig - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateConfig(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateCpuOptions(v **types.LaunchTemplateCpuOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateCpuOptions - if *v == nil { - sv = &types.LaunchTemplateCpuOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amdSevSnp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AmdSevSnp = types.AmdSevSnpSpecification(xtv) - } - - case strings.EqualFold("coreCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CoreCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("threadsPerCore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ThreadsPerCore = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateEbsBlockDevice(v **types.LaunchTemplateEbsBlockDevice, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateEbsBlockDevice - if *v == nil { - sv = &types.LaunchTemplateEbsBlockDevice{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("iops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Iops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("throughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeInitializationRate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeInitializationRate = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeType = types.VolumeType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponse(v **types.LaunchTemplateElasticInferenceAcceleratorResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateElasticInferenceAcceleratorResponse - if *v == nil { - sv = &types.LaunchTemplateElasticInferenceAcceleratorResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponseList(v *[]types.LaunchTemplateElasticInferenceAcceleratorResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateElasticInferenceAcceleratorResponse - if *v == nil { - sv = make([]types.LaunchTemplateElasticInferenceAcceleratorResponse, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateElasticInferenceAcceleratorResponse - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponse(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponseListUnwrapped(v *[]types.LaunchTemplateElasticInferenceAcceleratorResponse, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateElasticInferenceAcceleratorResponse - if *v == nil { - sv = make([]types.LaunchTemplateElasticInferenceAcceleratorResponse, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateElasticInferenceAcceleratorResponse - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponse(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateEnaSrdSpecification(v **types.LaunchTemplateEnaSrdSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateEnaSrdSpecification - if *v == nil { - sv = &types.LaunchTemplateEnaSrdSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("enaSrdUdpSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateEnaSrdUdpSpecification(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateEnaSrdUdpSpecification(v **types.LaunchTemplateEnaSrdUdpSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateEnaSrdUdpSpecification - if *v == nil { - sv = &types.LaunchTemplateEnaSrdUdpSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enaSrdUdpEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnaSrdUdpEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateEnclaveOptions(v **types.LaunchTemplateEnclaveOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateEnclaveOptions - if *v == nil { - sv = &types.LaunchTemplateEnclaveOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateHibernationOptions(v **types.LaunchTemplateHibernationOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateHibernationOptions - if *v == nil { - sv = &types.LaunchTemplateHibernationOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("configured", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Configured = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateIamInstanceProfileSpecification(v **types.LaunchTemplateIamInstanceProfileSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateIamInstanceProfileSpecification - if *v == nil { - sv = &types.LaunchTemplateIamInstanceProfileSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceMaintenanceOptions(v **types.LaunchTemplateInstanceMaintenanceOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateInstanceMaintenanceOptions - if *v == nil { - sv = &types.LaunchTemplateInstanceMaintenanceOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoRecovery", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoRecovery = types.LaunchTemplateAutoRecoveryState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceMarketOptions(v **types.LaunchTemplateInstanceMarketOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateInstanceMarketOptions - if *v == nil { - sv = &types.LaunchTemplateInstanceMarketOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("marketType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MarketType = types.MarketType(xtv) - } - - case strings.EqualFold("spotOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateSpotMarketOptions(&sv.SpotOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceMetadataOptions(v **types.LaunchTemplateInstanceMetadataOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateInstanceMetadataOptions - if *v == nil { - sv = &types.LaunchTemplateInstanceMetadataOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("httpEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpEndpoint = types.LaunchTemplateInstanceMetadataEndpointState(xtv) - } - - case strings.EqualFold("httpProtocolIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpProtocolIpv6 = types.LaunchTemplateInstanceMetadataProtocolIpv6(xtv) - } - - case strings.EqualFold("httpPutResponseHopLimit", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("httpTokens", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HttpTokens = types.LaunchTemplateHttpTokensState(xtv) - } - - case strings.EqualFold("instanceMetadataTags", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMetadataTags = types.LaunchTemplateInstanceMetadataTagsState(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.LaunchTemplateInstanceMetadataOptionsState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecification(v **types.LaunchTemplateInstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateInstanceNetworkInterfaceSpecification - if *v == nil { - sv = &types.LaunchTemplateInstanceNetworkInterfaceSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associateCarrierIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssociateCarrierIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("associatePublicIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssociatePublicIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("connectionTrackingSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionTrackingSpecification(&sv.ConnectionTrackingSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DeviceIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaQueueCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EnaQueueCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaSrdSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateEnaSrdSpecification(&sv.EnaSrdSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdStringList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("interfaceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterfaceType = ptr.String(xtv) - } - - case strings.EqualFold("ipv4PrefixCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv4PrefixCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv4PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv4PrefixListResponse(&sv.Ipv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6AddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv6AddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6AddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIpv6AddressList(&sv.Ipv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6PrefixCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv6PrefixCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6PrefixListResponse(&sv.Ipv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("primaryIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PrimaryIpv6 = ptr.Bool(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateIpAddressSpecificationList(&sv.PrivateIpAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("secondaryPrivateIpAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SecondaryPrivateIpAddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationList(v *[]types.LaunchTemplateInstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateInstanceNetworkInterfaceSpecification - if *v == nil { - sv = make([]types.LaunchTemplateInstanceNetworkInterfaceSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateInstanceNetworkInterfaceSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationListUnwrapped(v *[]types.LaunchTemplateInstanceNetworkInterfaceSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateInstanceNetworkInterfaceSpecification - if *v == nil { - sv = make([]types.LaunchTemplateInstanceNetworkInterfaceSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateInstanceNetworkInterfaceSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateLicenseConfiguration(v **types.LaunchTemplateLicenseConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateLicenseConfiguration - if *v == nil { - sv = &types.LaunchTemplateLicenseConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("licenseConfigurationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LicenseConfigurationArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateLicenseList(v *[]types.LaunchTemplateLicenseConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateLicenseConfiguration - if *v == nil { - sv = make([]types.LaunchTemplateLicenseConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateLicenseConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateLicenseConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateLicenseListUnwrapped(v *[]types.LaunchTemplateLicenseConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateLicenseConfiguration - if *v == nil { - sv = make([]types.LaunchTemplateLicenseConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateLicenseConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateLicenseConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateNetworkPerformanceOptions(v **types.LaunchTemplateNetworkPerformanceOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateNetworkPerformanceOptions - if *v == nil { - sv = &types.LaunchTemplateNetworkPerformanceOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bandwidthWeighting", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BandwidthWeighting = types.InstanceBandwidthWeighting(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateOverrides(v **types.LaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateOverrides - if *v == nil { - sv = &types.LaunchTemplateOverrides{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("instanceRequirements", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceRequirements(&sv.InstanceRequirements, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("priority", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Priority = ptr.Float64(f64) - } - - case strings.EqualFold("spotPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotPrice = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("weightedCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.WeightedCapacity = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateOverridesList(v *[]types.LaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateOverrides - if *v == nil { - sv = make([]types.LaunchTemplateOverrides, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateOverrides - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateOverrides(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateOverridesListUnwrapped(v *[]types.LaunchTemplateOverrides, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateOverrides - if *v == nil { - sv = make([]types.LaunchTemplateOverrides, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateOverrides - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateOverrides(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplatePlacement(v **types.LaunchTemplatePlacement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplatePlacement - if *v == nil { - sv = &types.LaunchTemplatePlacement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("affinity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Affinity = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("hostId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostId = ptr.String(xtv) - } - - case strings.EqualFold("hostResourceGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostResourceGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("partitionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PartitionNumber = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("spreadDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpreadDomain = ptr.String(xtv) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.Tenancy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplatePrivateDnsNameOptions(v **types.LaunchTemplatePrivateDnsNameOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplatePrivateDnsNameOptions - if *v == nil { - sv = &types.LaunchTemplatePrivateDnsNameOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enableResourceNameDnsAAAARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsAAAARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("enableResourceNameDnsARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("hostnameType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostnameType = types.HostnameType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateSet(v *[]types.LaunchTemplate, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplate - if *v == nil { - sv = make([]types.LaunchTemplate, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplate - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplate(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateSetUnwrapped(v *[]types.LaunchTemplate, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplate - if *v == nil { - sv = make([]types.LaunchTemplate, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplate - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplate(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplatesMonitoring(v **types.LaunchTemplatesMonitoring, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplatesMonitoring - if *v == nil { - sv = &types.LaunchTemplatesMonitoring{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateSpotMarketOptions(v **types.LaunchTemplateSpotMarketOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateSpotMarketOptions - if *v == nil { - sv = &types.LaunchTemplateSpotMarketOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blockDurationMinutes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BlockDurationMinutes = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceInterruptionBehavior", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceInterruptionBehavior = types.InstanceInterruptionBehavior(xtv) - } - - case strings.EqualFold("maxPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MaxPrice = ptr.String(xtv) - } - - case strings.EqualFold("spotInstanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotInstanceType = types.SpotInstanceType(xtv) - } - - case strings.EqualFold("validUntil", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidUntil = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateTagSpecification(v **types.LaunchTemplateTagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateTagSpecification - if *v == nil { - sv = &types.LaunchTemplateTagSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.ResourceType(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateTagSpecificationList(v *[]types.LaunchTemplateTagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateTagSpecification - if *v == nil { - sv = make([]types.LaunchTemplateTagSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateTagSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateTagSpecificationListUnwrapped(v *[]types.LaunchTemplateTagSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateTagSpecification - if *v == nil { - sv = make([]types.LaunchTemplateTagSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateTagSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLaunchTemplateVersion(v **types.LaunchTemplateVersion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LaunchTemplateVersion - if *v == nil { - sv = &types.LaunchTemplateVersion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createdBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreatedBy = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("defaultVersion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DefaultVersion = ptr.Bool(xtv) - } - - case strings.EqualFold("launchTemplateData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseLaunchTemplateData(&sv.LaunchTemplateData, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("launchTemplateId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplateName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchTemplateName = ptr.String(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("versionDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VersionDescription = ptr.String(xtv) - } - - case strings.EqualFold("versionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VersionNumber = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateVersionSet(v *[]types.LaunchTemplateVersion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LaunchTemplateVersion - if *v == nil { - sv = make([]types.LaunchTemplateVersion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LaunchTemplateVersion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLaunchTemplateVersion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLaunchTemplateVersionSetUnwrapped(v *[]types.LaunchTemplateVersion, decoder smithyxml.NodeDecoder) error { - var sv []types.LaunchTemplateVersion - if *v == nil { - sv = make([]types.LaunchTemplateVersion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LaunchTemplateVersion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLaunchTemplateVersion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLicenseConfiguration(v **types.LicenseConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LicenseConfiguration - if *v == nil { - sv = &types.LicenseConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("licenseConfigurationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LicenseConfigurationArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLicenseList(v *[]types.LicenseConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LicenseConfiguration - if *v == nil { - sv = make([]types.LicenseConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LicenseConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLicenseConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLicenseListUnwrapped(v *[]types.LicenseConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.LicenseConfiguration - if *v == nil { - sv = make([]types.LicenseConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LicenseConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLicenseConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLoadBalancersConfig(v **types.LoadBalancersConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LoadBalancersConfig - if *v == nil { - sv = &types.LoadBalancersConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("classicLoadBalancersConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClassicLoadBalancersConfig(&sv.ClassicLoadBalancersConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetGroupsConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetGroupsConfig(&sv.TargetGroupsConfig, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLoadPermission(v **types.LoadPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LoadPermission - if *v == nil { - sv = &types.LoadPermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("group", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Group = types.PermissionGroup(xtv) - } - - case strings.EqualFold("userId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLoadPermissionList(v *[]types.LoadPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LoadPermission - if *v == nil { - sv = make([]types.LoadPermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LoadPermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLoadPermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLoadPermissionListUnwrapped(v *[]types.LoadPermission, decoder smithyxml.NodeDecoder) error { - var sv []types.LoadPermission - if *v == nil { - sv = make([]types.LoadPermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LoadPermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLoadPermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGateway(v **types.LocalGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGateway - if *v == nil { - sv = &types.LocalGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRoute(v **types.LocalGatewayRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayRoute - if *v == nil { - sv = &types.LocalGatewayRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoipPoolId = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("destinationPrefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationPrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceGroupId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.LocalGatewayRouteState(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.LocalGatewayRouteType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteList(v *[]types.LocalGatewayRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayRoute - if *v == nil { - sv = make([]types.LocalGatewayRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteListUnwrapped(v *[]types.LocalGatewayRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayRoute - if *v == nil { - sv = make([]types.LocalGatewayRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayRouteTable(v **types.LocalGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayRouteTable - if *v == nil { - sv = &types.LocalGatewayRouteTable{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("mode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Mode = types.LocalGatewayRouteTableMode(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("stateReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStateReason(&sv.StateReason, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableSet(v *[]types.LocalGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayRouteTable - if *v == nil { - sv = make([]types.LocalGatewayRouteTable, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayRouteTable - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableSetUnwrapped(v *[]types.LocalGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayRouteTable - if *v == nil { - sv = make([]types.LocalGatewayRouteTable, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayRouteTable - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociation(v **types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - if *v == nil { - sv = &types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceGroupId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationSet(v *[]types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - if *v == nil { - sv = make([]types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationSetUnwrapped(v *[]types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - if *v == nil { - sv = make([]types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayRouteTableVirtualInterfaceGroupAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociation(v **types.LocalGatewayRouteTableVpcAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayRouteTableVpcAssociation - if *v == nil { - sv = &types.LocalGatewayRouteTableVpcAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableVpcAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableVpcAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociationSet(v *[]types.LocalGatewayRouteTableVpcAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayRouteTableVpcAssociation - if *v == nil { - sv = make([]types.LocalGatewayRouteTableVpcAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayRouteTableVpcAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociationSetUnwrapped(v *[]types.LocalGatewayRouteTableVpcAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayRouteTableVpcAssociation - if *v == nil { - sv = make([]types.LocalGatewayRouteTableVpcAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayRouteTableVpcAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewaySet(v *[]types.LocalGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGateway - if *v == nil { - sv = make([]types.LocalGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewaySetUnwrapped(v *[]types.LocalGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGateway - if *v == nil { - sv = make([]types.LocalGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterface(v **types.LocalGatewayVirtualInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayVirtualInterface - if *v == nil { - sv = &types.LocalGatewayVirtualInterface{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("configurationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConfigurationState = types.LocalGatewayVirtualInterfaceConfigurationState(xtv) - } - - case strings.EqualFold("localAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalAddress = ptr.String(xtv) - } - - case strings.EqualFold("localBgpAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LocalBgpAsn = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceGroupId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("outpostLagId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostLagId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("peerAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerAddress = ptr.String(xtv) - } - - case strings.EqualFold("peerBgpAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PeerBgpAsn = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("peerBgpAsnExtended", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PeerBgpAsnExtended = ptr.Int64(i64) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vlan", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Vlan = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroup(v **types.LocalGatewayVirtualInterfaceGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LocalGatewayVirtualInterfaceGroup - if *v == nil { - sv = &types.LocalGatewayVirtualInterfaceGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("configurationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConfigurationState = types.LocalGatewayVirtualInterfaceGroupConfigurationState(xtv) - } - - case strings.EqualFold("localBgpAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LocalBgpAsn = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("localBgpAsnExtended", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LocalBgpAsnExtended = ptr.Int64(i64) - } - - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayVirtualInterfaceGroupId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayVirtualInterfaceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceIdSet(&sv.LocalGatewayVirtualInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroupSet(v *[]types.LocalGatewayVirtualInterfaceGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayVirtualInterfaceGroup - if *v == nil { - sv = make([]types.LocalGatewayVirtualInterfaceGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayVirtualInterfaceGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroupSetUnwrapped(v *[]types.LocalGatewayVirtualInterfaceGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayVirtualInterfaceGroup - if *v == nil { - sv = make([]types.LocalGatewayVirtualInterfaceGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayVirtualInterfaceGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceSet(v *[]types.LocalGatewayVirtualInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalGatewayVirtualInterface - if *v == nil { - sv = make([]types.LocalGatewayVirtualInterface, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalGatewayVirtualInterface - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterface(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceSetUnwrapped(v *[]types.LocalGatewayVirtualInterface, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalGatewayVirtualInterface - if *v == nil { - sv = make([]types.LocalGatewayVirtualInterface, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalGatewayVirtualInterface - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterface(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLocalStorageTypeSet(v *[]types.LocalStorageType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LocalStorageType - if *v == nil { - sv = make([]types.LocalStorageType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LocalStorageType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.LocalStorageType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLocalStorageTypeSetUnwrapped(v *[]types.LocalStorageType, decoder smithyxml.NodeDecoder) error { - var sv []types.LocalStorageType - if *v == nil { - sv = make([]types.LocalStorageType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LocalStorageType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.LocalStorageType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentLockedSnapshotsInfo(v **types.LockedSnapshotsInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LockedSnapshotsInfo - if *v == nil { - sv = &types.LockedSnapshotsInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coolOffPeriod", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CoolOffPeriod = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("coolOffPeriodExpiresOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CoolOffPeriodExpiresOn = ptr.Time(t) - } - - case strings.EqualFold("lockCreatedOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockCreatedOn = ptr.Time(t) - } - - case strings.EqualFold("lockDuration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LockDuration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("lockDurationStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockDurationStartTime = ptr.Time(t) - } - - case strings.EqualFold("lockExpiresOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockExpiresOn = ptr.Time(t) - } - - case strings.EqualFold("lockState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LockState = types.LockState(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLockedSnapshotsInfoList(v *[]types.LockedSnapshotsInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LockedSnapshotsInfo - if *v == nil { - sv = make([]types.LockedSnapshotsInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.LockedSnapshotsInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentLockedSnapshotsInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentLockedSnapshotsInfoListUnwrapped(v *[]types.LockedSnapshotsInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.LockedSnapshotsInfo - if *v == nil { - sv = make([]types.LockedSnapshotsInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LockedSnapshotsInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentLockedSnapshotsInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMacHost(v **types.MacHost, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MacHost - if *v == nil { - sv = &types.MacHost{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("hostId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostId = ptr.String(xtv) - } - - case strings.EqualFold("macOSLatestSupportedVersionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacOSVersionStringList(&sv.MacOSLatestSupportedVersions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMacHostList(v *[]types.MacHost, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.MacHost - if *v == nil { - sv = make([]types.MacHost, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.MacHost - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentMacHost(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMacHostListUnwrapped(v *[]types.MacHost, decoder smithyxml.NodeDecoder) error { - var sv []types.MacHost - if *v == nil { - sv = make([]types.MacHost, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.MacHost - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentMacHost(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMacModificationTask(v **types.MacModificationTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MacModificationTask - if *v == nil { - sv = &types.MacModificationTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("macModificationTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MacModificationTaskId = ptr.String(xtv) - } - - case strings.EqualFold("macSystemIntegrityProtectionConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacSystemIntegrityProtectionConfiguration(&sv.MacSystemIntegrityProtectionConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("taskState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TaskState = types.MacModificationTaskState(xtv) - } - - case strings.EqualFold("taskType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TaskType = types.MacModificationTaskType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMacModificationTaskList(v *[]types.MacModificationTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.MacModificationTask - if *v == nil { - sv = make([]types.MacModificationTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.MacModificationTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentMacModificationTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMacModificationTaskListUnwrapped(v *[]types.MacModificationTask, decoder smithyxml.NodeDecoder) error { - var sv []types.MacModificationTask - if *v == nil { - sv = make([]types.MacModificationTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.MacModificationTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentMacModificationTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMacOSVersionStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMacOSVersionStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMacSystemIntegrityProtectionConfiguration(v **types.MacSystemIntegrityProtectionConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MacSystemIntegrityProtectionConfiguration - if *v == nil { - sv = &types.MacSystemIntegrityProtectionConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("appleInternal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AppleInternal = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("baseSystem", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BaseSystem = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("debuggingRestrictions", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DebuggingRestrictions = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("dTraceRestrictions", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DTraceRestrictions = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("filesystemProtections", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FilesystemProtections = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("kextSigning", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KextSigning = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("nvramProtections", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NvramProtections = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.MacSystemIntegrityProtectionSettingStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMaintenanceDetails(v **types.MaintenanceDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MaintenanceDetails - if *v == nil { - sv = &types.MaintenanceDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("lastMaintenanceApplied", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastMaintenanceApplied = ptr.Time(t) - } - - case strings.EqualFold("maintenanceAutoAppliedAfter", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.MaintenanceAutoAppliedAfter = ptr.Time(t) - } - - case strings.EqualFold("pendingMaintenance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PendingMaintenance = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentManagedPrefixList(v **types.ManagedPrefixList, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ManagedPrefixList - if *v == nil { - sv = &types.ManagedPrefixList{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressFamily = ptr.String(xtv) - } - - case strings.EqualFold("maxEntries", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxEntries = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("prefixListArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListArn = ptr.String(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("prefixListName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListName = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.PrefixListState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("version", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Version = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentManagedPrefixListSet(v *[]types.ManagedPrefixList, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ManagedPrefixList - if *v == nil { - sv = make([]types.ManagedPrefixList, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ManagedPrefixList - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentManagedPrefixList(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentManagedPrefixListSetUnwrapped(v *[]types.ManagedPrefixList, decoder smithyxml.NodeDecoder) error { - var sv []types.ManagedPrefixList - if *v == nil { - sv = make([]types.ManagedPrefixList, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ManagedPrefixList - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentManagedPrefixList(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMediaAcceleratorInfo(v **types.MediaAcceleratorInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MediaAcceleratorInfo - if *v == nil { - sv = &types.MediaAcceleratorInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accelerators", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMediaDeviceInfoList(&sv.Accelerators, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalMediaMemoryInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalMediaMemoryInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMediaDeviceInfo(v **types.MediaDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MediaDeviceInfo - if *v == nil { - sv = &types.MediaDeviceInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("manufacturer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Manufacturer = ptr.String(xtv) - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMediaDeviceMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMediaDeviceInfoList(v *[]types.MediaDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.MediaDeviceInfo - if *v == nil { - sv = make([]types.MediaDeviceInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.MediaDeviceInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentMediaDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMediaDeviceInfoListUnwrapped(v *[]types.MediaDeviceInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.MediaDeviceInfo - if *v == nil { - sv = make([]types.MediaDeviceInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.MediaDeviceInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentMediaDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMediaDeviceMemoryInfo(v **types.MediaDeviceMemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MediaDeviceMemoryInfo - if *v == nil { - sv = &types.MediaDeviceMemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMemoryGiBPerVCpu(v **types.MemoryGiBPerVCpu, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MemoryGiBPerVCpu - if *v == nil { - sv = &types.MemoryGiBPerVCpu{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Max = ptr.Float64(f64) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Min = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMemoryInfo(v **types.MemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MemoryInfo - if *v == nil { - sv = &types.MemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMemoryMiB(v **types.MemoryMiB, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MemoryMiB - if *v == nil { - sv = &types.MemoryMiB{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMetricPoint(v **types.MetricPoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MetricPoint - if *v == nil { - sv = &types.MetricPoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Value = ptr.Float32(float32(f64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMetricPoints(v *[]types.MetricPoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.MetricPoint - if *v == nil { - sv = make([]types.MetricPoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.MetricPoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentMetricPoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMetricPointsUnwrapped(v *[]types.MetricPoint, decoder smithyxml.NodeDecoder) error { - var sv []types.MetricPoint - if *v == nil { - sv = make([]types.MetricPoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.MetricPoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentMetricPoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentMonitoring(v **types.Monitoring, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Monitoring - if *v == nil { - sv = &types.Monitoring{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.MonitoringState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMovingAddressStatus(v **types.MovingAddressStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MovingAddressStatus - if *v == nil { - sv = &types.MovingAddressStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("moveStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MoveStatus = types.MoveStatus(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMovingAddressStatusSet(v *[]types.MovingAddressStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.MovingAddressStatus - if *v == nil { - sv = make([]types.MovingAddressStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.MovingAddressStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentMovingAddressStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentMovingAddressStatusSetUnwrapped(v *[]types.MovingAddressStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.MovingAddressStatus - if *v == nil { - sv = make([]types.MovingAddressStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.MovingAddressStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentMovingAddressStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNatGateway(v **types.NatGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NatGateway - if *v == nil { - sv = &types.NatGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connectivityType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectivityType = types.ConnectivityType(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("deleteTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DeleteTime = ptr.Time(t) - } - - case strings.EqualFold("failureCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureCode = ptr.String(xtv) - } - - case strings.EqualFold("failureMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureMessage = ptr.String(xtv) - } - - case strings.EqualFold("natGatewayAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayAddressList(&sv.NatGatewayAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("provisionedBandwidth", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProvisionedBandwidth(&sv.ProvisionedBandwidth, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.NatGatewayState(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNatGatewayAddress(v **types.NatGatewayAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NatGatewayAddress - if *v == nil { - sv = &types.NatGatewayAddress{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("failureMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureMessage = ptr.String(xtv) - } - - case strings.EqualFold("isPrimary", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsPrimary = ptr.Bool(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("privateIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIp = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.NatGatewayAddressStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNatGatewayAddressList(v *[]types.NatGatewayAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NatGatewayAddress - if *v == nil { - sv = make([]types.NatGatewayAddress, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NatGatewayAddress - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNatGatewayAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNatGatewayAddressListUnwrapped(v *[]types.NatGatewayAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.NatGatewayAddress - if *v == nil { - sv = make([]types.NatGatewayAddress, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NatGatewayAddress - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNatGatewayAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNatGatewayList(v *[]types.NatGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NatGateway - if *v == nil { - sv = make([]types.NatGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NatGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNatGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNatGatewayListUnwrapped(v *[]types.NatGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.NatGateway - if *v == nil { - sv = make([]types.NatGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NatGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNatGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNativeApplicationOidcOptions(v **types.NativeApplicationOidcOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NativeApplicationOidcOptions - if *v == nil { - sv = &types.NativeApplicationOidcOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("authorizationEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AuthorizationEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("clientId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientId = ptr.String(xtv) - } - - case strings.EqualFold("issuer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Issuer = ptr.String(xtv) - } - - case strings.EqualFold("publicSigningKeyEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicSigningKeyEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = ptr.String(xtv) - } - - case strings.EqualFold("tokenEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TokenEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("userInfoEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserInfoEndpoint = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAcl(v **types.NetworkAcl, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkAcl - if *v == nil { - sv = &types.NetworkAcl{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkAclAssociationList(&sv.Associations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("entrySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkAclEntryList(&sv.Entries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("default", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("networkAclId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkAclId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclAssociation(v **types.NetworkAclAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkAclAssociation - if *v == nil { - sv = &types.NetworkAclAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkAclAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkAclAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("networkAclId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkAclId = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclAssociationList(v *[]types.NetworkAclAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkAclAssociation - if *v == nil { - sv = make([]types.NetworkAclAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkAclAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkAclAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclAssociationListUnwrapped(v *[]types.NetworkAclAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkAclAssociation - if *v == nil { - sv = make([]types.NetworkAclAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkAclAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkAclAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkAclEntry(v **types.NetworkAclEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkAclEntry - if *v == nil { - sv = &types.NetworkAclEntry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("egress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Egress = ptr.Bool(xtv) - } - - case strings.EqualFold("icmpTypeCode", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIcmpTypeCode(&sv.IcmpTypeCode, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6CidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("portRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPortRange(&sv.PortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("ruleAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleAction = types.RuleAction(xtv) - } - - case strings.EqualFold("ruleNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RuleNumber = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclEntryList(v *[]types.NetworkAclEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkAclEntry - if *v == nil { - sv = make([]types.NetworkAclEntry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkAclEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkAclEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclEntryListUnwrapped(v *[]types.NetworkAclEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkAclEntry - if *v == nil { - sv = make([]types.NetworkAclEntry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkAclEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkAclEntry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkAclList(v *[]types.NetworkAcl, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkAcl - if *v == nil { - sv = make([]types.NetworkAcl, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkAcl - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkAcl(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkAclListUnwrapped(v *[]types.NetworkAcl, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkAcl - if *v == nil { - sv = make([]types.NetworkAcl, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkAcl - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkAcl(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkBandwidthGbps(v **types.NetworkBandwidthGbps, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkBandwidthGbps - if *v == nil { - sv = &types.NetworkBandwidthGbps{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Max = ptr.Float64(f64) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Min = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkCardInfo(v **types.NetworkCardInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkCardInfo - if *v == nil { - sv = &types.NetworkCardInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("baselineBandwidthInGbps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.BaselineBandwidthInGbps = ptr.Float64(f64) - } - - case strings.EqualFold("defaultEnaQueueCountPerInterface", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultEnaQueueCountPerInterface = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumEnaQueueCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumEnaQueueCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumEnaQueueCountPerInterface", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumEnaQueueCountPerInterface = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumNetworkInterfaces", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumNetworkInterfaces = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkPerformance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkPerformance = ptr.String(xtv) - } - - case strings.EqualFold("peakBandwidthInGbps", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.PeakBandwidthInGbps = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkCardInfoList(v *[]types.NetworkCardInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkCardInfo - if *v == nil { - sv = make([]types.NetworkCardInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkCardInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkCardInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkCardInfoListUnwrapped(v *[]types.NetworkCardInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkCardInfo - if *v == nil { - sv = make([]types.NetworkCardInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkCardInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkCardInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInfo(v **types.NetworkInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInfo - if *v == nil { - sv = &types.NetworkInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bandwidthWeightings", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBandwidthWeightingTypeList(&sv.BandwidthWeightings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("defaultNetworkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultNetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("efaInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEfaInfo(&sv.EfaInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("efaSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected EfaSupportedFlag to be of type *bool, got %T instead", val) - } - sv.EfaSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("enaSrdSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected EnaSrdSupported to be of type *bool, got %T instead", val) - } - sv.EnaSrdSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("enaSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EnaSupport = types.EnaSupport(xtv) - } - - case strings.EqualFold("encryptionInTransitSupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected EncryptionInTransitSupported to be of type *bool, got %T instead", val) - } - sv.EncryptionInTransitSupported = ptr.Bool(xtv) - } - - case strings.EqualFold("flexibleEnaQueuesSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FlexibleEnaQueuesSupport = types.FlexibleEnaQueuesSupport(xtv) - } - - case strings.EqualFold("ipv4AddressesPerInterface", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv4AddressesPerInterface = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6AddressesPerInterface", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Ipv6AddressesPerInterface = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6Supported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Ipv6Flag to be of type *bool, got %T instead", val) - } - sv.Ipv6Supported = ptr.Bool(xtv) - } - - case strings.EqualFold("maximumNetworkCards", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumNetworkCards = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maximumNetworkInterfaces", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaximumNetworkInterfaces = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkCards", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkCardInfoList(&sv.NetworkCards, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkPerformance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkPerformance = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScope(v **types.NetworkInsightsAccessScope, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInsightsAccessScope - if *v == nil { - sv = &types.NetworkInsightsAccessScope{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createdDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(t) - } - - case strings.EqualFold("networkInsightsAccessScopeArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeArn = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("updatedDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdatedDate = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysis(v **types.NetworkInsightsAccessScopeAnalysis, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInsightsAccessScopeAnalysis - if *v == nil { - sv = &types.NetworkInsightsAccessScopeAnalysis{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("analyzedEniCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AnalyzedEniCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("findingsFound", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FindingsFound = types.FindingsFound(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeAnalysisArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeAnalysisArn = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeAnalysisId = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeId = ptr.String(xtv) - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.AnalysisStatus(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("warningMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.WarningMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysisList(v *[]types.NetworkInsightsAccessScopeAnalysis, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInsightsAccessScopeAnalysis - if *v == nil { - sv = make([]types.NetworkInsightsAccessScopeAnalysis, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInsightsAccessScopeAnalysis - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysis(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysisListUnwrapped(v *[]types.NetworkInsightsAccessScopeAnalysis, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInsightsAccessScopeAnalysis - if *v == nil { - sv = make([]types.NetworkInsightsAccessScopeAnalysis, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInsightsAccessScopeAnalysis - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysis(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeContent(v **types.NetworkInsightsAccessScopeContent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInsightsAccessScopeContent - if *v == nil { - sv = &types.NetworkInsightsAccessScopeContent{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("excludePathSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAccessScopePathList(&sv.ExcludePaths, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("matchPathSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAccessScopePathList(&sv.MatchPaths, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInsightsAccessScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeList(v *[]types.NetworkInsightsAccessScope, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInsightsAccessScope - if *v == nil { - sv = make([]types.NetworkInsightsAccessScope, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInsightsAccessScope - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScope(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAccessScopeListUnwrapped(v *[]types.NetworkInsightsAccessScope, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInsightsAccessScope - if *v == nil { - sv = make([]types.NetworkInsightsAccessScope, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInsightsAccessScope - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScope(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInsightsAnalysis(v **types.NetworkInsightsAnalysis, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInsightsAnalysis - if *v == nil { - sv = &types.NetworkInsightsAnalysis{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("additionalAccountSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.AdditionalAccounts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("alternatePathHintSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAlternatePathHintList(&sv.AlternatePathHints, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("explanationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExplanationList(&sv.Explanations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("filterInArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentArnList(&sv.FilterInArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("filterOutArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentArnList(&sv.FilterOutArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("forwardPathComponentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathComponentList(&sv.ForwardPathComponents, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInsightsAnalysisArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAnalysisArn = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAnalysisId = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsPathId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsPathId = ptr.String(xtv) - } - - case strings.EqualFold("networkPathFound", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.NetworkPathFound = ptr.Bool(xtv) - } - - case strings.EqualFold("returnPathComponentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathComponentList(&sv.ReturnPathComponents, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("startDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartDate = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.AnalysisStatus(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("suggestedAccountSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SuggestedAccounts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("warningMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.WarningMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAnalysisList(v *[]types.NetworkInsightsAnalysis, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInsightsAnalysis - if *v == nil { - sv = make([]types.NetworkInsightsAnalysis, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInsightsAnalysis - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysis(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsAnalysisListUnwrapped(v *[]types.NetworkInsightsAnalysis, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInsightsAnalysis - if *v == nil { - sv = make([]types.NetworkInsightsAnalysis, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInsightsAnalysis - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysis(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInsightsPath(v **types.NetworkInsightsPath, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInsightsPath - if *v == nil { - sv = &types.NetworkInsightsPath{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createdDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(t) - } - - case strings.EqualFold("destination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Destination = ptr.String(xtv) - } - - case strings.EqualFold("destinationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationArn = ptr.String(xtv) - } - - case strings.EqualFold("destinationIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationIp = ptr.String(xtv) - } - - case strings.EqualFold("destinationPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DestinationPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("filterAtDestination", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathFilter(&sv.FilterAtDestination, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("filterAtSource", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPathFilter(&sv.FilterAtSource, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInsightsPathArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsPathArn = ptr.String(xtv) - } - - case strings.EqualFold("networkInsightsPathId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsPathId = ptr.String(xtv) - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.Protocol(xtv) - } - - case strings.EqualFold("source", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Source = ptr.String(xtv) - } - - case strings.EqualFold("sourceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceArn = ptr.String(xtv) - } - - case strings.EqualFold("sourceIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIp = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsPathList(v *[]types.NetworkInsightsPath, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInsightsPath - if *v == nil { - sv = make([]types.NetworkInsightsPath, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInsightsPath - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInsightsPath(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInsightsPathListUnwrapped(v *[]types.NetworkInsightsPath, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInsightsPath - if *v == nil { - sv = make([]types.NetworkInsightsPath, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInsightsPath - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInsightsPath(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInterface(v **types.NetworkInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterface - if *v == nil { - sv = &types.NetworkInterface{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedSubnetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociatedSubnetList(&sv.AssociatedSubnets, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("attachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceAttachment(&sv.Attachment, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("connectionTrackingConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionTrackingConfiguration(&sv.ConnectionTrackingConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("denyAllIgwTraffic", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DenyAllIgwTraffic = ptr.Bool(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("interfaceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterfaceType = types.NetworkInterfaceType(xtv) - } - - case strings.EqualFold("ipv4PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv4PrefixesList(&sv.Ipv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Address = ptr.String(xtv) - } - - case strings.EqualFold("ipv6AddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceIpv6AddressesList(&sv.Ipv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6Native", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Ipv6Native = ptr.Bool(xtv) - } - - case strings.EqualFold("ipv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6PrefixesList(&sv.Ipv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("macAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MacAddress = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddressList(&sv.PrivateIpAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("publicDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDnsName = ptr.String(xtv) - } - - case strings.EqualFold("publicIpDnsNameOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPublicIpDnsNameOptions(&sv.PublicIpDnsNameOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("requesterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RequesterId = ptr.String(xtv) - } - - case strings.EqualFold("requesterManaged", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.RequesterManaged = ptr.Bool(xtv) - } - - case strings.EqualFold("sourceDestCheck", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SourceDestCheck = ptr.Bool(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.NetworkInterfaceStatus(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.TagSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceAssociation(v **types.NetworkInterfaceAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfaceAssociation - if *v == nil { - sv = &types.NetworkInterfaceAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("carrierIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIp = ptr.String(xtv) - } - - case strings.EqualFold("ipOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("publicDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDnsName = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceAttachment(v **types.NetworkInterfaceAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfaceAttachment - if *v == nil { - sv = &types.NetworkInterfaceAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("deviceIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DeviceIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaQueueCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EnaQueueCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enaSrdSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttachmentEnaSrdSpecification(&sv.EnaSrdSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("networkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.AttachmentStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceCount(v **types.NetworkInterfaceCount, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfaceCount - if *v == nil { - sv = &types.NetworkInterfaceCount{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInterfaceIpv6Address(v **types.NetworkInterfaceIpv6Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfaceIpv6Address - if *v == nil { - sv = &types.NetworkInterfaceIpv6Address{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Address = ptr.String(xtv) - } - - case strings.EqualFold("isPrimaryIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsPrimaryIpv6 = ptr.Bool(xtv) - } - - case strings.EqualFold("publicIpv6DnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv6DnsName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceIpv6AddressesList(v *[]types.NetworkInterfaceIpv6Address, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInterfaceIpv6Address - if *v == nil { - sv = make([]types.NetworkInterfaceIpv6Address, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInterfaceIpv6Address - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInterfaceIpv6Address(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceIpv6AddressesListUnwrapped(v *[]types.NetworkInterfaceIpv6Address, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInterfaceIpv6Address - if *v == nil { - sv = make([]types.NetworkInterfaceIpv6Address, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInterfaceIpv6Address - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInterfaceIpv6Address(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInterfaceList(v *[]types.NetworkInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInterface - if *v == nil { - sv = make([]types.NetworkInterface, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInterface - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInterface(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfaceListUnwrapped(v *[]types.NetworkInterface, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInterface - if *v == nil { - sv = make([]types.NetworkInterface, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInterface - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInterface(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInterfacePermission(v **types.NetworkInterfacePermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfacePermission - if *v == nil { - sv = &types.NetworkInterfacePermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("awsAccountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsAccountId = ptr.String(xtv) - } - - case strings.EqualFold("awsService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsService = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfacePermissionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfacePermissionId = ptr.String(xtv) - } - - case strings.EqualFold("permission", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Permission = types.InterfacePermissionType(xtv) - } - - case strings.EqualFold("permissionState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfacePermissionState(&sv.PermissionState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfacePermissionList(v *[]types.NetworkInterfacePermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInterfacePermission - if *v == nil { - sv = make([]types.NetworkInterfacePermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInterfacePermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInterfacePermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfacePermissionListUnwrapped(v *[]types.NetworkInterfacePermission, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInterfacePermission - if *v == nil { - sv = make([]types.NetworkInterfacePermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInterfacePermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInterfacePermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkInterfacePermissionState(v **types.NetworkInterfacePermissionState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfacePermissionState - if *v == nil { - sv = &types.NetworkInterfacePermissionState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.NetworkInterfacePermissionStateCode(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddress(v **types.NetworkInterfacePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NetworkInterfacePrivateIpAddress - if *v == nil { - sv = &types.NetworkInterfacePrivateIpAddress{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("primary", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Primary = ptr.Bool(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddressList(v *[]types.NetworkInterfacePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NetworkInterfacePrivateIpAddress - if *v == nil { - sv = make([]types.NetworkInterfacePrivateIpAddress, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NetworkInterfacePrivateIpAddress - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddressListUnwrapped(v *[]types.NetworkInterfacePrivateIpAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.NetworkInterfacePrivateIpAddress - if *v == nil { - sv = make([]types.NetworkInterfacePrivateIpAddress, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NetworkInterfacePrivateIpAddress - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNetworkInterfacePrivateIpAddress(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNetworkNodesList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNetworkNodesListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNeuronDeviceCoreInfo(v **types.NeuronDeviceCoreInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NeuronDeviceCoreInfo - if *v == nil { - sv = &types.NeuronDeviceCoreInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("version", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Version = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNeuronDeviceInfo(v **types.NeuronDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NeuronDeviceInfo - if *v == nil { - sv = &types.NeuronDeviceInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coreInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNeuronDeviceCoreInfo(&sv.CoreInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("memoryInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNeuronDeviceMemoryInfo(&sv.MemoryInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNeuronDeviceInfoList(v *[]types.NeuronDeviceInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.NeuronDeviceInfo - if *v == nil { - sv = make([]types.NeuronDeviceInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.NeuronDeviceInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentNeuronDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNeuronDeviceInfoListUnwrapped(v *[]types.NeuronDeviceInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.NeuronDeviceInfo - if *v == nil { - sv = make([]types.NeuronDeviceInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.NeuronDeviceInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentNeuronDeviceInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentNeuronDeviceMemoryInfo(v **types.NeuronDeviceMemoryInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NeuronDeviceMemoryInfo - if *v == nil { - sv = &types.NeuronDeviceMemoryInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("sizeInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SizeInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNeuronInfo(v **types.NeuronInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NeuronInfo - if *v == nil { - sv = &types.NeuronInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("neuronDevices", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNeuronDeviceInfoList(&sv.NeuronDevices, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalNeuronDeviceMemoryInMiB", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalNeuronDeviceMemoryInMiB = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNitroTpmInfo(v **types.NitroTpmInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.NitroTpmInfo - if *v == nil { - sv = &types.NitroTpmInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("supportedVersions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNitroTpmSupportedVersionsList(&sv.SupportedVersions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNitroTpmSupportedVersionsList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentNitroTpmSupportedVersionsListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentOccurrenceDaySet(v *[]int32, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col int32 - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - col = int32(i64) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOccurrenceDaySetUnwrapped(v *[]int32, decoder smithyxml.NodeDecoder) error { - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - switch { - default: - var mv int32 - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - mv = int32(i64) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentOidcOptions(v **types.OidcOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.OidcOptions - if *v == nil { - sv = &types.OidcOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("authorizationEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AuthorizationEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("clientId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientId = ptr.String(xtv) - } - - case strings.EqualFold("clientSecret", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientSecret = ptr.String(xtv) - } - - case strings.EqualFold("issuer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Issuer = ptr.String(xtv) - } - - case strings.EqualFold("scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = ptr.String(xtv) - } - - case strings.EqualFold("tokenEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TokenEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("userInfoEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserInfoEndpoint = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOnDemandOptions(v **types.OnDemandOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.OnDemandOptions - if *v == nil { - sv = &types.OnDemandOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationStrategy = types.FleetOnDemandAllocationStrategy(xtv) - } - - case strings.EqualFold("capacityReservationOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationOptions(&sv.CapacityReservationOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxTotalPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MaxTotalPrice = ptr.String(xtv) - } - - case strings.EqualFold("minTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MinTargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("singleAvailabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SingleAvailabilityZone = ptr.Bool(xtv) - } - - case strings.EqualFold("singleInstanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SingleInstanceType = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOperatorResponse(v **types.OperatorResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.OperatorResponse - if *v == nil { - sv = &types.OperatorResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("managed", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Managed = ptr.Bool(xtv) - } - - case strings.EqualFold("principal", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Principal = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOutpostLag(v **types.OutpostLag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.OutpostLag - if *v == nil { - sv = &types.OutpostLag{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterfaceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceIdSet(&sv.LocalGatewayVirtualInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("outpostLagId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostLagId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("serviceLinkVirtualInterfaceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceIdSet(&sv.ServiceLinkVirtualInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOutpostLagSet(v *[]types.OutpostLag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.OutpostLag - if *v == nil { - sv = make([]types.OutpostLag, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.OutpostLag - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentOutpostLag(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentOutpostLagSetUnwrapped(v *[]types.OutpostLag, decoder smithyxml.NodeDecoder) error { - var sv []types.OutpostLag - if *v == nil { - sv = make([]types.OutpostLag, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.OutpostLag - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentOutpostLag(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPacketHeaderStatement(v **types.PacketHeaderStatement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PacketHeaderStatement - if *v == nil { - sv = &types.PacketHeaderStatement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DestinationAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationPortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DestinationPorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationPrefixListSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DestinationPrefixLists, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProtocolList(&sv.Protocols, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SourceAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourcePortSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SourcePorts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourcePrefixListSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SourcePrefixLists, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPathComponent(v **types.PathComponent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PathComponent - if *v == nil { - sv = &types.PathComponent{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("aclRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisAclRule(&sv.AclRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("additionalDetailSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAdditionalDetailList(&sv.AdditionalDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("attachedTo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.AttachedTo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("component", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Component, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("destinationVpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.DestinationVpc, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("elasticLoadBalancerListener", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.ElasticLoadBalancerListener, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("explanationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExplanationList(&sv.Explanations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("firewallStatefulRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFirewallStatefulRule(&sv.FirewallStatefulRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("firewallStatelessRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFirewallStatelessRule(&sv.FirewallStatelessRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("inboundHeader", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisPacketHeader(&sv.InboundHeader, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outboundHeader", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisPacketHeader(&sv.OutboundHeader, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeTableRoute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisRouteTableRoute(&sv.RouteTableRoute, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisSecurityGroupRule(&sv.SecurityGroupRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sequenceNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SequenceNumber = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("serviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceName = ptr.String(xtv) - } - - case strings.EqualFold("sourceVpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.SourceVpc, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Subnet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.TransitGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayRouteTableRoute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableRoute(&sv.TransitGatewayRouteTableRoute, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAnalysisComponent(&sv.Vpc, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPathComponentList(v *[]types.PathComponent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PathComponent - if *v == nil { - sv = make([]types.PathComponent, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PathComponent - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPathComponent(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPathComponentListUnwrapped(v *[]types.PathComponent, decoder smithyxml.NodeDecoder) error { - var sv []types.PathComponent - if *v == nil { - sv = make([]types.PathComponent, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PathComponent - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPathComponent(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPathFilter(v **types.PathFilter, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PathFilter - if *v == nil { - sv = &types.PathFilter{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationAddress = ptr.String(xtv) - } - - case strings.EqualFold("destinationPortRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFilterPortRange(&sv.DestinationPortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceAddress = ptr.String(xtv) - } - - case strings.EqualFold("sourcePortRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFilterPortRange(&sv.SourcePortRange, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPathStatement(v **types.PathStatement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PathStatement - if *v == nil { - sv = &types.PathStatement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("packetHeaderStatement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPacketHeaderStatement(&sv.PacketHeaderStatement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceStatement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResourceStatement(&sv.ResourceStatement, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPciId(v **types.PciId, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PciId - if *v == nil { - sv = &types.PciId{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("DeviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceId = ptr.String(xtv) - } - - case strings.EqualFold("SubsystemId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubsystemId = ptr.String(xtv) - } - - case strings.EqualFold("SubsystemVendorId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubsystemVendorId = ptr.String(xtv) - } - - case strings.EqualFold("VendorId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VendorId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPeeringAttachmentStatus(v **types.PeeringAttachmentStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PeeringAttachmentStatus - if *v == nil { - sv = &types.PeeringAttachmentStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPeeringConnectionOptions(v **types.PeeringConnectionOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PeeringConnectionOptions - if *v == nil { - sv = &types.PeeringConnectionOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allowDnsResolutionFromRemoteVpc", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowDnsResolutionFromRemoteVpc = ptr.Bool(xtv) - } - - case strings.EqualFold("allowEgressFromLocalClassicLinkToRemoteVpc", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowEgressFromLocalClassicLinkToRemoteVpc = ptr.Bool(xtv) - } - - case strings.EqualFold("allowEgressFromLocalVpcToRemoteClassicLink", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowEgressFromLocalVpcToRemoteClassicLink = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPeeringTgwInfo(v **types.PeeringTgwInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PeeringTgwInfo - if *v == nil { - sv = &types.PeeringTgwInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coreNetworkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("region", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Region = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPerformanceFactorReference(v **types.PerformanceFactorReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PerformanceFactorReference - if *v == nil { - sv = &types.PerformanceFactorReference{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPerformanceFactorReferenceSet(v *[]types.PerformanceFactorReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PerformanceFactorReference - if *v == nil { - sv = make([]types.PerformanceFactorReference, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PerformanceFactorReference - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPerformanceFactorReference(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPerformanceFactorReferenceSetUnwrapped(v *[]types.PerformanceFactorReference, decoder smithyxml.NodeDecoder) error { - var sv []types.PerformanceFactorReference - if *v == nil { - sv = make([]types.PerformanceFactorReference, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PerformanceFactorReference - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPerformanceFactorReference(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase1DHGroupNumbersList(v *[]types.Phase1DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase1DHGroupNumbersListValue - if *v == nil { - sv = make([]types.Phase1DHGroupNumbersListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase1DHGroupNumbersListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase1DHGroupNumbersListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase1DHGroupNumbersListUnwrapped(v *[]types.Phase1DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase1DHGroupNumbersListValue - if *v == nil { - sv = make([]types.Phase1DHGroupNumbersListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase1DHGroupNumbersListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase1DHGroupNumbersListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase1DHGroupNumbersListValue(v **types.Phase1DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase1DHGroupNumbersListValue - if *v == nil { - sv = &types.Phase1DHGroupNumbersListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Value = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsList(v *[]types.Phase1EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase1EncryptionAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase1EncryptionAlgorithmsListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase1EncryptionAlgorithmsListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsListUnwrapped(v *[]types.Phase1EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase1EncryptionAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase1EncryptionAlgorithmsListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase1EncryptionAlgorithmsListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsListValue(v **types.Phase1EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase1EncryptionAlgorithmsListValue - if *v == nil { - sv = &types.Phase1EncryptionAlgorithmsListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsList(v *[]types.Phase1IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase1IntegrityAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase1IntegrityAlgorithmsListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase1IntegrityAlgorithmsListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsListUnwrapped(v *[]types.Phase1IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase1IntegrityAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase1IntegrityAlgorithmsListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase1IntegrityAlgorithmsListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsListValue(v **types.Phase1IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase1IntegrityAlgorithmsListValue - if *v == nil { - sv = &types.Phase1IntegrityAlgorithmsListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2DHGroupNumbersList(v *[]types.Phase2DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase2DHGroupNumbersListValue - if *v == nil { - sv = make([]types.Phase2DHGroupNumbersListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase2DHGroupNumbersListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase2DHGroupNumbersListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2DHGroupNumbersListUnwrapped(v *[]types.Phase2DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase2DHGroupNumbersListValue - if *v == nil { - sv = make([]types.Phase2DHGroupNumbersListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase2DHGroupNumbersListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase2DHGroupNumbersListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase2DHGroupNumbersListValue(v **types.Phase2DHGroupNumbersListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase2DHGroupNumbersListValue - if *v == nil { - sv = &types.Phase2DHGroupNumbersListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Value = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsList(v *[]types.Phase2EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase2EncryptionAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase2EncryptionAlgorithmsListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase2EncryptionAlgorithmsListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsListUnwrapped(v *[]types.Phase2EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase2EncryptionAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase2EncryptionAlgorithmsListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase2EncryptionAlgorithmsListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsListValue(v **types.Phase2EncryptionAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase2EncryptionAlgorithmsListValue - if *v == nil { - sv = &types.Phase2EncryptionAlgorithmsListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsList(v *[]types.Phase2IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Phase2IntegrityAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase2IntegrityAlgorithmsListValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Phase2IntegrityAlgorithmsListValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsListUnwrapped(v *[]types.Phase2IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - var sv []types.Phase2IntegrityAlgorithmsListValue - if *v == nil { - sv = make([]types.Phase2IntegrityAlgorithmsListValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Phase2IntegrityAlgorithmsListValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsListValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsListValue(v **types.Phase2IntegrityAlgorithmsListValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Phase2IntegrityAlgorithmsListValue - if *v == nil { - sv = &types.Phase2IntegrityAlgorithmsListValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacement(v **types.Placement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Placement - if *v == nil { - sv = &types.Placement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("affinity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Affinity = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("hostId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostId = ptr.String(xtv) - } - - case strings.EqualFold("hostResourceGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostResourceGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("partitionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PartitionNumber = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("spreadDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpreadDomain = ptr.String(xtv) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.Tenancy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacementGroup(v **types.PlacementGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PlacementGroup - if *v == nil { - sv = &types.PlacementGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupArn = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("partitionCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PartitionCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("spreadLevel", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpreadLevel = types.SpreadLevel(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.PlacementGroupState(xtv) - } - - case strings.EqualFold("strategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Strategy = types.PlacementStrategy(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacementGroupInfo(v **types.PlacementGroupInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PlacementGroupInfo - if *v == nil { - sv = &types.PlacementGroupInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("supportedStrategies", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementGroupStrategyList(&sv.SupportedStrategies, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacementGroupList(v *[]types.PlacementGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PlacementGroup - if *v == nil { - sv = make([]types.PlacementGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PlacementGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPlacementGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacementGroupListUnwrapped(v *[]types.PlacementGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.PlacementGroup - if *v == nil { - sv = make([]types.PlacementGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PlacementGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPlacementGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPlacementGroupStrategyList(v *[]types.PlacementGroupStrategy, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PlacementGroupStrategy - if *v == nil { - sv = make([]types.PlacementGroupStrategy, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PlacementGroupStrategy - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.PlacementGroupStrategy(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPlacementGroupStrategyListUnwrapped(v *[]types.PlacementGroupStrategy, decoder smithyxml.NodeDecoder) error { - var sv []types.PlacementGroupStrategy - if *v == nil { - sv = make([]types.PlacementGroupStrategy, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PlacementGroupStrategy - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.PlacementGroupStrategy(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPlacementResponse(v **types.PlacementResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PlacementResponse - if *v == nil { - sv = &types.PlacementResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPoolCidrBlock(v **types.PoolCidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PoolCidrBlock - if *v == nil { - sv = &types.PoolCidrBlock{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("poolCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPoolCidrBlocksSet(v *[]types.PoolCidrBlock, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PoolCidrBlock - if *v == nil { - sv = make([]types.PoolCidrBlock, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PoolCidrBlock - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPoolCidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPoolCidrBlocksSetUnwrapped(v *[]types.PoolCidrBlock, decoder smithyxml.NodeDecoder) error { - var sv []types.PoolCidrBlock - if *v == nil { - sv = make([]types.PoolCidrBlock, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PoolCidrBlock - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPoolCidrBlock(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPortRange(v **types.PortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PortRange - if *v == nil { - sv = &types.PortRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("from", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.From = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("to", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.To = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPortRangeList(v *[]types.PortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PortRange - if *v == nil { - sv = make([]types.PortRange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PortRange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPortRange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPortRangeListUnwrapped(v *[]types.PortRange, decoder smithyxml.NodeDecoder) error { - var sv []types.PortRange - if *v == nil { - sv = make([]types.PortRange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PortRange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPortRange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrefixList(v **types.PrefixList, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrefixList - if *v == nil { - sv = &types.PrefixList{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Cidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("prefixListName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListAssociation(v **types.PrefixListAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrefixListAssociation - if *v == nil { - sv = &types.PrefixListAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwner = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListAssociationSet(v *[]types.PrefixListAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrefixListAssociation - if *v == nil { - sv = make([]types.PrefixListAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrefixListAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrefixListAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListAssociationSetUnwrapped(v *[]types.PrefixListAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.PrefixListAssociation - if *v == nil { - sv = make([]types.PrefixListAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrefixListAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrefixListAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrefixListEntry(v **types.PrefixListEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrefixListEntry - if *v == nil { - sv = &types.PrefixListEntry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListEntrySet(v *[]types.PrefixListEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrefixListEntry - if *v == nil { - sv = make([]types.PrefixListEntry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrefixListEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrefixListEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListEntrySetUnwrapped(v *[]types.PrefixListEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.PrefixListEntry - if *v == nil { - sv = make([]types.PrefixListEntry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrefixListEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrefixListEntry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrefixListId(v **types.PrefixListId, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrefixListId - if *v == nil { - sv = &types.PrefixListId{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListIdList(v *[]types.PrefixListId, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrefixListId - if *v == nil { - sv = make([]types.PrefixListId, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrefixListId - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrefixListId(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListIdListUnwrapped(v *[]types.PrefixListId, decoder smithyxml.NodeDecoder) error { - var sv []types.PrefixListId - if *v == nil { - sv = make([]types.PrefixListId, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrefixListId - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrefixListId(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrefixListIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrefixListSet(v *[]types.PrefixList, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrefixList - if *v == nil { - sv = make([]types.PrefixList, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrefixList - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrefixList(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrefixListSetUnwrapped(v *[]types.PrefixList, decoder smithyxml.NodeDecoder) error { - var sv []types.PrefixList - if *v == nil { - sv = make([]types.PrefixList, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrefixList - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrefixList(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPriceSchedule(v **types.PriceSchedule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PriceSchedule - if *v == nil { - sv = &types.PriceSchedule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("active", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Active = ptr.Bool(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("price", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Price = ptr.Float64(f64) - } - - case strings.EqualFold("term", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Term = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPriceScheduleList(v *[]types.PriceSchedule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PriceSchedule - if *v == nil { - sv = make([]types.PriceSchedule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PriceSchedule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPriceSchedule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPriceScheduleListUnwrapped(v *[]types.PriceSchedule, decoder smithyxml.NodeDecoder) error { - var sv []types.PriceSchedule - if *v == nil { - sv = make([]types.PriceSchedule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PriceSchedule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPriceSchedule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPricingDetail(v **types.PricingDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PricingDetail - if *v == nil { - sv = &types.PricingDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("price", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Price = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPricingDetailsList(v *[]types.PricingDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PricingDetail - if *v == nil { - sv = make([]types.PricingDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PricingDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPricingDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPricingDetailsListUnwrapped(v *[]types.PricingDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.PricingDetail - if *v == nil { - sv = make([]types.PricingDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PricingDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPricingDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrincipalIdFormat(v **types.PrincipalIdFormat, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrincipalIdFormat - if *v == nil { - sv = &types.PrincipalIdFormat{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("statusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIdFormatList(&sv.Statuses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrincipalIdFormatList(v *[]types.PrincipalIdFormat, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrincipalIdFormat - if *v == nil { - sv = make([]types.PrincipalIdFormat, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrincipalIdFormat - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrincipalIdFormat(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrincipalIdFormatListUnwrapped(v *[]types.PrincipalIdFormat, decoder smithyxml.NodeDecoder) error { - var sv []types.PrincipalIdFormat - if *v == nil { - sv = make([]types.PrincipalIdFormat, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrincipalIdFormat - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrincipalIdFormat(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrivateDnsDetails(v **types.PrivateDnsDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrivateDnsDetails - if *v == nil { - sv = &types.PrivateDnsDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateDnsDetailsSet(v *[]types.PrivateDnsDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrivateDnsDetails - if *v == nil { - sv = make([]types.PrivateDnsDetails, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrivateDnsDetails - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrivateDnsDetails(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateDnsDetailsSetUnwrapped(v *[]types.PrivateDnsDetails, decoder smithyxml.NodeDecoder) error { - var sv []types.PrivateDnsDetails - if *v == nil { - sv = make([]types.PrivateDnsDetails, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrivateDnsDetails - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrivateDnsDetails(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPrivateDnsNameConfiguration(v **types.PrivateDnsNameConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrivateDnsNameConfiguration - if *v == nil { - sv = &types.PrivateDnsNameConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.DnsNameState(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateDnsNameOptionsOnLaunch(v **types.PrivateDnsNameOptionsOnLaunch, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrivateDnsNameOptionsOnLaunch - if *v == nil { - sv = &types.PrivateDnsNameOptionsOnLaunch{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enableResourceNameDnsAAAARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsAAAARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("enableResourceNameDnsARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("hostnameType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostnameType = types.HostnameType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateDnsNameOptionsResponse(v **types.PrivateDnsNameOptionsResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrivateDnsNameOptionsResponse - if *v == nil { - sv = &types.PrivateDnsNameOptionsResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enableResourceNameDnsAAAARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsAAAARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("enableResourceNameDnsARecord", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableResourceNameDnsARecord = ptr.Bool(xtv) - } - - case strings.EqualFold("hostnameType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostnameType = types.HostnameType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateIpAddressSpecification(v **types.PrivateIpAddressSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PrivateIpAddressSpecification - if *v == nil { - sv = &types.PrivateIpAddressSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("primary", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Primary = ptr.Bool(xtv) - } - - case strings.EqualFold("privateIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateIpAddressSpecificationList(v *[]types.PrivateIpAddressSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PrivateIpAddressSpecification - if *v == nil { - sv = make([]types.PrivateIpAddressSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PrivateIpAddressSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPrivateIpAddressSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPrivateIpAddressSpecificationListUnwrapped(v *[]types.PrivateIpAddressSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.PrivateIpAddressSpecification - if *v == nil { - sv = make([]types.PrivateIpAddressSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PrivateIpAddressSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPrivateIpAddressSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentProcessorInfo(v **types.ProcessorInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ProcessorInfo - if *v == nil { - sv = &types.ProcessorInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("manufacturer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Manufacturer = ptr.String(xtv) - } - - case strings.EqualFold("supportedArchitectures", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentArchitectureTypeList(&sv.SupportedArchitectures, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedFeatures", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSupportedAdditionalProcessorFeatureList(&sv.SupportedFeatures, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sustainedClockSpeedInGhz", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.SustainedClockSpeedInGhz = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentProductCode(v **types.ProductCode, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ProductCode - if *v == nil { - sv = &types.ProductCode{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("productCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductCodeId = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductCodeType = types.ProductCodeValues(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentProductCodeList(v *[]types.ProductCode, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ProductCode - if *v == nil { - sv = make([]types.ProductCode, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ProductCode - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentProductCode(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentProductCodeListUnwrapped(v *[]types.ProductCode, decoder smithyxml.NodeDecoder) error { - var sv []types.ProductCode - if *v == nil { - sv = make([]types.ProductCode, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ProductCode - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentProductCode(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPropagatingVgw(v **types.PropagatingVgw, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PropagatingVgw - if *v == nil { - sv = &types.PropagatingVgw{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("gatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPropagatingVgwList(v *[]types.PropagatingVgw, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PropagatingVgw - if *v == nil { - sv = make([]types.PropagatingVgw, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PropagatingVgw - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPropagatingVgw(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPropagatingVgwListUnwrapped(v *[]types.PropagatingVgw, decoder smithyxml.NodeDecoder) error { - var sv []types.PropagatingVgw - if *v == nil { - sv = make([]types.PropagatingVgw, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PropagatingVgw - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPropagatingVgw(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentProtocolIntList(v *[]int32, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col int32 - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - col = int32(i64) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentProtocolIntListUnwrapped(v *[]int32, decoder smithyxml.NodeDecoder) error { - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - switch { - default: - var mv int32 - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - mv = int32(i64) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentProtocolList(v *[]types.Protocol, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Protocol - if *v == nil { - sv = make([]types.Protocol, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Protocol - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.Protocol(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentProtocolListUnwrapped(v *[]types.Protocol, decoder smithyxml.NodeDecoder) error { - var sv []types.Protocol - if *v == nil { - sv = make([]types.Protocol, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Protocol - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.Protocol(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentProvisionedBandwidth(v **types.ProvisionedBandwidth, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ProvisionedBandwidth - if *v == nil { - sv = &types.ProvisionedBandwidth{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("provisioned", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Provisioned = ptr.String(xtv) - } - - case strings.EqualFold("provisionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ProvisionTime = ptr.Time(t) - } - - case strings.EqualFold("requested", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Requested = ptr.String(xtv) - } - - case strings.EqualFold("requestTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RequestTime = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPtrUpdateStatus(v **types.PtrUpdateStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PtrUpdateStatus - if *v == nil { - sv = &types.PtrUpdateStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Reason = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpDnsNameOptions(v **types.PublicIpDnsNameOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PublicIpDnsNameOptions - if *v == nil { - sv = &types.PublicIpDnsNameOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dnsHostnameType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsHostnameType = ptr.String(xtv) - } - - case strings.EqualFold("publicDualStackDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicDualStackDnsName = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv4DnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv4DnsName = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv6DnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv6DnsName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpv4Pool(v **types.PublicIpv4Pool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PublicIpv4Pool - if *v == nil { - sv = &types.PublicIpv4Pool{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("poolAddressRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPublicIpv4PoolRangeSet(&sv.PoolAddressRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalAddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalAvailableAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalAvailableAddressCount = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpv4PoolRange(v **types.PublicIpv4PoolRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PublicIpv4PoolRange - if *v == nil { - sv = &types.PublicIpv4PoolRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("availableAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableAddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("firstAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FirstAddress = ptr.String(xtv) - } - - case strings.EqualFold("lastAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpv4PoolRangeSet(v *[]types.PublicIpv4PoolRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PublicIpv4PoolRange - if *v == nil { - sv = make([]types.PublicIpv4PoolRange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PublicIpv4PoolRange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPublicIpv4PoolRange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpv4PoolRangeSetUnwrapped(v *[]types.PublicIpv4PoolRange, decoder smithyxml.NodeDecoder) error { - var sv []types.PublicIpv4PoolRange - if *v == nil { - sv = make([]types.PublicIpv4PoolRange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PublicIpv4PoolRange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPublicIpv4PoolRange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPublicIpv4PoolSet(v *[]types.PublicIpv4Pool, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.PublicIpv4Pool - if *v == nil { - sv = make([]types.PublicIpv4Pool, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.PublicIpv4Pool - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPublicIpv4Pool(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPublicIpv4PoolSetUnwrapped(v *[]types.PublicIpv4Pool, decoder smithyxml.NodeDecoder) error { - var sv []types.PublicIpv4Pool - if *v == nil { - sv = make([]types.PublicIpv4Pool, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.PublicIpv4Pool - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPublicIpv4Pool(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPurchase(v **types.Purchase, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Purchase - if *v == nil { - sv = &types.Purchase{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("hostIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseHostIdSet(&sv.HostIdSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hostReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostReservationId = ptr.String(xtv) - } - - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("instanceFamily", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceFamily = ptr.String(xtv) - } - - case strings.EqualFold("paymentOption", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PaymentOption = types.PaymentOption(xtv) - } - - case strings.EqualFold("upfrontPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UpfrontPrice = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPurchasedScheduledInstanceSet(v *[]types.ScheduledInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ScheduledInstance - if *v == nil { - sv = make([]types.ScheduledInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ScheduledInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentScheduledInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPurchasedScheduledInstanceSetUnwrapped(v *[]types.ScheduledInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.ScheduledInstance - if *v == nil { - sv = make([]types.ScheduledInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ScheduledInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentScheduledInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentPurchaseSet(v *[]types.Purchase, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Purchase - if *v == nil { - sv = make([]types.Purchase, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Purchase - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentPurchase(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentPurchaseSetUnwrapped(v *[]types.Purchase, decoder smithyxml.NodeDecoder) error { - var sv []types.Purchase - if *v == nil { - sv = make([]types.Purchase, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Purchase - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentPurchase(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRecurringCharge(v **types.RecurringCharge, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RecurringCharge - if *v == nil { - sv = &types.RecurringCharge{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Amount = ptr.Float64(f64) - } - - case strings.EqualFold("frequency", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Frequency = types.RecurringChargeFrequency(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRecurringChargesList(v *[]types.RecurringCharge, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RecurringCharge - if *v == nil { - sv = make([]types.RecurringCharge, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RecurringCharge - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRecurringCharge(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRecurringChargesListUnwrapped(v *[]types.RecurringCharge, decoder smithyxml.NodeDecoder) error { - var sv []types.RecurringCharge - if *v == nil { - sv = make([]types.RecurringCharge, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RecurringCharge - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRecurringCharge(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReferencedSecurityGroup(v **types.ReferencedSecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReferencedSecurityGroup - if *v == nil { - sv = &types.ReferencedSecurityGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("peeringStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeeringStatus = ptr.String(xtv) - } - - case strings.EqualFold("userId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRegion(v **types.Region, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Region - if *v == nil { - sv = &types.Region{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("regionEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Endpoint = ptr.String(xtv) - } - - case strings.EqualFold("optInStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OptInStatus = ptr.String(xtv) - } - - case strings.EqualFold("regionName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RegionName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRegionalSummary(v **types.RegionalSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RegionalSummary - if *v == nil { - sv = &types.RegionalSummary{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("numberOfMatchedAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfMatchedAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("numberOfUnmatchedAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfUnmatchedAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("regionName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RegionName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRegionalSummaryList(v *[]types.RegionalSummary, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RegionalSummary - if *v == nil { - sv = make([]types.RegionalSummary, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RegionalSummary - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRegionalSummary(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRegionalSummaryListUnwrapped(v *[]types.RegionalSummary, decoder smithyxml.NodeDecoder) error { - var sv []types.RegionalSummary - if *v == nil { - sv = make([]types.RegionalSummary, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RegionalSummary - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRegionalSummary(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRegionList(v *[]types.Region, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Region - if *v == nil { - sv = make([]types.Region, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Region - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRegion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRegionListUnwrapped(v *[]types.Region, decoder smithyxml.NodeDecoder) error { - var sv []types.Region - if *v == nil { - sv = make([]types.Region, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Region - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRegion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReplaceRootVolumeTask(v **types.ReplaceRootVolumeTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReplaceRootVolumeTask - if *v == nil { - sv = &types.ReplaceRootVolumeTask{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("completeTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CompleteTime = ptr.String(xtv) - } - - case strings.EqualFold("deleteReplacedRootVolume", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteReplacedRootVolume = ptr.Bool(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("replaceRootVolumeTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReplaceRootVolumeTaskId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StartTime = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("taskState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TaskState = types.ReplaceRootVolumeTaskState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReplaceRootVolumeTasks(v *[]types.ReplaceRootVolumeTask, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReplaceRootVolumeTask - if *v == nil { - sv = make([]types.ReplaceRootVolumeTask, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReplaceRootVolumeTask - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReplaceRootVolumeTask(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReplaceRootVolumeTasksUnwrapped(v *[]types.ReplaceRootVolumeTask, decoder smithyxml.NodeDecoder) error { - var sv []types.ReplaceRootVolumeTask - if *v == nil { - sv = make([]types.ReplaceRootVolumeTask, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReplaceRootVolumeTask - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReplaceRootVolumeTask(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservation(v **types.Reservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Reservation - if *v == nil { - sv = &types.Reservation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceList(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("requesterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RequesterId = ptr.String(xtv) - } - - case strings.EqualFold("reservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservationList(v *[]types.Reservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Reservation - if *v == nil { - sv = make([]types.Reservation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Reservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservationListUnwrapped(v *[]types.Reservation, decoder smithyxml.NodeDecoder) error { - var sv []types.Reservation - if *v == nil { - sv = make([]types.Reservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Reservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservationValue(v **types.ReservationValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservationValue - if *v == nil { - sv = &types.ReservationValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("remainingTotalValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RemainingTotalValue = ptr.String(xtv) - } - - case strings.EqualFold("remainingUpfrontValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RemainingUpfrontValue = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstanceReservationValue(v **types.ReservedInstanceReservationValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstanceReservationValue - if *v == nil { - sv = &types.ReservedInstanceReservationValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservationValue", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservationValue(&sv.ReservationValue, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstanceReservationValueSet(v *[]types.ReservedInstanceReservationValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstanceReservationValue - if *v == nil { - sv = make([]types.ReservedInstanceReservationValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstanceReservationValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstanceReservationValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstanceReservationValueSetUnwrapped(v *[]types.ReservedInstanceReservationValue, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstanceReservationValue - if *v == nil { - sv = make([]types.ReservedInstanceReservationValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstanceReservationValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstanceReservationValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedInstances(v **types.ReservedInstances, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstances - if *v == nil { - sv = &types.ReservedInstances{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int64(i64) - } - - case strings.EqualFold("end", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.End = ptr.Time(t) - } - - case strings.EqualFold("fixedPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FixedPrice = ptr.Float32(float32(f64)) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceTenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceTenancy = types.Tenancy(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("offeringClass", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingClass = types.OfferingClassType(xtv) - } - - case strings.EqualFold("offeringType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingType = types.OfferingTypeValues(xtv) - } - - case strings.EqualFold("productDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductDescription = types.RIProductDescription(xtv) - } - - case strings.EqualFold("recurringCharges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRecurringChargesList(&sv.RecurringCharges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - case strings.EqualFold("scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = types.Scope(xtv) - } - - case strings.EqualFold("start", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Start = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.ReservedInstanceState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("usagePrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.UsagePrice = ptr.Float32(float32(f64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesConfiguration(v **types.ReservedInstancesConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesConfiguration - if *v == nil { - sv = &types.ReservedInstancesConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = types.Scope(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesId(v **types.ReservedInstancesId, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesId - if *v == nil { - sv = &types.ReservedInstancesId{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesList(v *[]types.ReservedInstances, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstances - if *v == nil { - sv = make([]types.ReservedInstances, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstances - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstances(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesListUnwrapped(v *[]types.ReservedInstances, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstances - if *v == nil { - sv = make([]types.ReservedInstances, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstances - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstances(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedInstancesListing(v **types.ReservedInstancesListing, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesListing - if *v == nil { - sv = &types.ReservedInstancesListing{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("instanceCounts", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceCountList(&sv.InstanceCounts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("priceSchedules", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPriceScheduleList(&sv.PriceSchedules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - case strings.EqualFold("reservedInstancesListingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesListingId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.ListingStatus(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("updateDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdateDate = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesListingList(v *[]types.ReservedInstancesListing, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstancesListing - if *v == nil { - sv = make([]types.ReservedInstancesListing, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstancesListing - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstancesListing(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesListingListUnwrapped(v *[]types.ReservedInstancesListing, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstancesListing - if *v == nil { - sv = make([]types.ReservedInstancesListing, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstancesListing - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstancesListing(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedInstancesModification(v **types.ReservedInstancesModification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesModification - if *v == nil { - sv = &types.ReservedInstancesModification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("effectiveDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EffectiveDate = ptr.Time(t) - } - - case strings.EqualFold("modificationResultSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesModificationResultList(&sv.ModificationResults, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedIntancesIds(&sv.ReservedInstancesIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesModificationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesModificationId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("updateDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdateDate = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesModificationList(v *[]types.ReservedInstancesModification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstancesModification - if *v == nil { - sv = make([]types.ReservedInstancesModification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstancesModification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstancesModification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesModificationListUnwrapped(v *[]types.ReservedInstancesModification, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstancesModification - if *v == nil { - sv = make([]types.ReservedInstancesModification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstancesModification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstancesModification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedInstancesModificationResult(v **types.ReservedInstancesModificationResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesModificationResult - if *v == nil { - sv = &types.ReservedInstancesModificationResult{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - case strings.EqualFold("targetConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesConfiguration(&sv.TargetConfiguration, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesModificationResultList(v *[]types.ReservedInstancesModificationResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstancesModificationResult - if *v == nil { - sv = make([]types.ReservedInstancesModificationResult, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstancesModificationResult - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstancesModificationResult(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesModificationResultListUnwrapped(v *[]types.ReservedInstancesModificationResult, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstancesModificationResult - if *v == nil { - sv = make([]types.ReservedInstancesModificationResult, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstancesModificationResult - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstancesModificationResult(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedInstancesOffering(v **types.ReservedInstancesOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ReservedInstancesOffering - if *v == nil { - sv = &types.ReservedInstancesOffering{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int64(i64) - } - - case strings.EqualFold("fixedPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FixedPrice = ptr.Float32(float32(f64)) - } - - case strings.EqualFold("instanceTenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceTenancy = types.Tenancy(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("marketplace", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Marketplace = ptr.Bool(xtv) - } - - case strings.EqualFold("offeringClass", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingClass = types.OfferingClassType(xtv) - } - - case strings.EqualFold("offeringType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingType = types.OfferingTypeValues(xtv) - } - - case strings.EqualFold("pricingDetailsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPricingDetailsList(&sv.PricingDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductDescription = types.RIProductDescription(xtv) - } - - case strings.EqualFold("recurringCharges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRecurringChargesList(&sv.RecurringCharges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstancesOfferingId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesOfferingId = ptr.String(xtv) - } - - case strings.EqualFold("scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = types.Scope(xtv) - } - - case strings.EqualFold("usagePrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.UsagePrice = ptr.Float32(float32(f64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesOfferingList(v *[]types.ReservedInstancesOffering, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstancesOffering - if *v == nil { - sv = make([]types.ReservedInstancesOffering, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstancesOffering - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstancesOffering(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedInstancesOfferingListUnwrapped(v *[]types.ReservedInstancesOffering, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstancesOffering - if *v == nil { - sv = make([]types.ReservedInstancesOffering, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstancesOffering - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstancesOffering(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentReservedIntancesIds(v *[]types.ReservedInstancesId, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ReservedInstancesId - if *v == nil { - sv = make([]types.ReservedInstancesId, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ReservedInstancesId - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentReservedInstancesId(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentReservedIntancesIdsUnwrapped(v *[]types.ReservedInstancesId, decoder smithyxml.NodeDecoder) error { - var sv []types.ReservedInstancesId - if *v == nil { - sv = make([]types.ReservedInstancesId, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ReservedInstancesId - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentReservedInstancesId(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentResourceStatement(v **types.ResourceStatement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ResourceStatement - if *v == nil { - sv = &types.ResourceStatement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Resources, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.ResourceTypes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentResponseError(v **types.ResponseError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ResponseError - if *v == nil { - sv = &types.ResponseError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.LaunchTemplateErrorCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentResponseHostIdList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentResponseHostIdListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentResponseHostIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentResponseHostIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentResponseLaunchTemplateData(v **types.ResponseLaunchTemplateData, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ResponseLaunchTemplateData - if *v == nil { - sv = &types.ResponseLaunchTemplateData{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blockDeviceMappingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("capacityReservationSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateCapacityReservationSpecificationResponse(&sv.CapacityReservationSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cpuOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateCpuOptions(&sv.CpuOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creditSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCreditSpecification(&sv.CreditSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("disableApiStop", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DisableApiStop = ptr.Bool(xtv) - } - - case strings.EqualFold("disableApiTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DisableApiTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("elasticGpuSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentElasticGpuSpecificationResponseList(&sv.ElasticGpuSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("elasticInferenceAcceleratorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorResponseList(&sv.ElasticInferenceAccelerators, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enclaveOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateEnclaveOptions(&sv.EnclaveOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("hibernationOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateHibernationOptions(&sv.HibernationOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("iamInstanceProfile", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateIamInstanceProfileSpecification(&sv.IamInstanceProfile, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceInitiatedShutdownBehavior", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceInitiatedShutdownBehavior = types.ShutdownBehavior(xtv) - } - - case strings.EqualFold("instanceMarketOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceMarketOptions(&sv.InstanceMarketOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceRequirements", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceRequirements(&sv.InstanceRequirements, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("kernelId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KernelId = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("licenseSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateLicenseList(&sv.LicenseSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maintenanceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceMaintenanceOptions(&sv.MaintenanceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("metadataOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceMetadataOptions(&sv.MetadataOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("monitoring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplatesMonitoring(&sv.Monitoring, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkPerformanceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateNetworkPerformanceOptions(&sv.NetworkPerformanceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("placement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplatePlacement(&sv.Placement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("privateDnsNameOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplatePrivateDnsNameOptions(&sv.PrivateDnsNameOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ramDiskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RamDiskId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SecurityGroupIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateTagSpecificationList(&sv.TagSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("userData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserData = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRevokedSecurityGroupRule(v **types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RevokedSecurityGroupRule - if *v == nil { - sv = &types.RevokedSecurityGroupRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrIpv4", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIpv4 = ptr.String(xtv) - } - - case strings.EqualFold("cidrIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIpv6 = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("ipProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpProtocol = ptr.String(xtv) - } - - case strings.EqualFold("isEgress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsEgress = ptr.Bool(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("referencedGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReferencedGroupId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupRuleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupRuleId = ptr.String(xtv) - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRevokedSecurityGroupRuleList(v *[]types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RevokedSecurityGroupRule - if *v == nil { - sv = make([]types.RevokedSecurityGroupRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RevokedSecurityGroupRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRevokedSecurityGroupRuleListUnwrapped(v *[]types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { - var sv []types.RevokedSecurityGroupRule - if *v == nil { - sv = make([]types.RevokedSecurityGroupRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RevokedSecurityGroupRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRootDeviceTypeList(v *[]types.RootDeviceType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RootDeviceType - if *v == nil { - sv = make([]types.RootDeviceType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RootDeviceType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.RootDeviceType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRootDeviceTypeListUnwrapped(v *[]types.RootDeviceType, decoder smithyxml.NodeDecoder) error { - var sv []types.RootDeviceType - if *v == nil { - sv = make([]types.RootDeviceType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RootDeviceType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.RootDeviceType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRoute(v **types.Route, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Route - if *v == nil { - sv = &types.Route{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("coreNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("destinationIpv6CidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationIpv6CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("destinationPrefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationPrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("egressOnlyInternetGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EgressOnlyInternetGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("gatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayId = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("odbNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OdbNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("origin", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Origin = types.RouteOrigin(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteState(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteList(v *[]types.Route, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Route - if *v == nil { - sv = make([]types.Route, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Route - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteListUnwrapped(v *[]types.Route, decoder smithyxml.NodeDecoder) error { - var sv []types.Route - if *v == nil { - sv = make([]types.Route, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Route - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServer(v **types.RouteServer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServer - if *v == nil { - sv = &types.RouteServer{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amazonSideAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AmazonSideAsn = ptr.Int64(i64) - } - - case strings.EqualFold("persistRoutesDuration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PersistRoutesDuration = ptr.Int64(i64) - } - - case strings.EqualFold("persistRoutesState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PersistRoutesState = types.RouteServerPersistRoutesState(xtv) - } - - case strings.EqualFold("routeServerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerId = ptr.String(xtv) - } - - case strings.EqualFold("snsNotificationsEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SnsNotificationsEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("snsTopicArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnsTopicArn = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteServerState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerAssociation(v **types.RouteServerAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerAssociation - if *v == nil { - sv = &types.RouteServerAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteServerAssociationState(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerAssociationsList(v *[]types.RouteServerAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerAssociation - if *v == nil { - sv = make([]types.RouteServerAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerAssociationsListUnwrapped(v *[]types.RouteServerAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerAssociation - if *v == nil { - sv = make([]types.RouteServerAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServerBfdStatus(v **types.RouteServerBfdStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerBfdStatus - if *v == nil { - sv = &types.RouteServerBfdStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.RouteServerBfdState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerBgpOptions(v **types.RouteServerBgpOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerBgpOptions - if *v == nil { - sv = &types.RouteServerBgpOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("peerAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PeerAsn = ptr.Int64(i64) - } - - case strings.EqualFold("peerLivenessDetection", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerLivenessDetection = types.RouteServerPeerLivenessMode(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerBgpStatus(v **types.RouteServerBgpStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerBgpStatus - if *v == nil { - sv = &types.RouteServerBgpStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.RouteServerBgpState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerEndpoint(v **types.RouteServerEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerEndpoint - if *v == nil { - sv = &types.RouteServerEndpoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("eniAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EniAddress = ptr.String(xtv) - } - - case strings.EqualFold("eniId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EniId = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) - } - - case strings.EqualFold("routeServerEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("routeServerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteServerEndpointState(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerEndpointsList(v *[]types.RouteServerEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerEndpoint - if *v == nil { - sv = make([]types.RouteServerEndpoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerEndpoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerEndpointsListUnwrapped(v *[]types.RouteServerEndpoint, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerEndpoint - if *v == nil { - sv = make([]types.RouteServerEndpoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerEndpoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServerPeer(v **types.RouteServerPeer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerPeer - if *v == nil { - sv = &types.RouteServerPeer{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bfdStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerBfdStatus(&sv.BfdStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bgpOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerBgpOptions(&sv.BgpOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bgpStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerBgpStatus(&sv.BgpStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("endpointEniAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndpointEniAddress = ptr.String(xtv) - } - - case strings.EqualFold("endpointEniId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndpointEniId = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) - } - - case strings.EqualFold("peerAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerAddress = ptr.String(xtv) - } - - case strings.EqualFold("routeServerEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("routeServerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerId = ptr.String(xtv) - } - - case strings.EqualFold("routeServerPeerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerPeerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteServerPeerState(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerPeersList(v *[]types.RouteServerPeer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerPeer - if *v == nil { - sv = make([]types.RouteServerPeer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerPeer - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerPeer(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerPeersListUnwrapped(v *[]types.RouteServerPeer, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerPeer - if *v == nil { - sv = make([]types.RouteServerPeer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerPeer - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerPeer(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServerPropagation(v **types.RouteServerPropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerPropagation - if *v == nil { - sv = &types.RouteServerPropagation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerId = ptr.String(xtv) - } - - case strings.EqualFold("routeTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteServerPropagationState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerPropagationsList(v *[]types.RouteServerPropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerPropagation - if *v == nil { - sv = make([]types.RouteServerPropagation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerPropagation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerPropagation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerPropagationsListUnwrapped(v *[]types.RouteServerPropagation, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerPropagation - if *v == nil { - sv = make([]types.RouteServerPropagation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerPropagation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerPropagation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServerRoute(v **types.RouteServerRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerRoute - if *v == nil { - sv = &types.RouteServerRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asPathSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAsPath(&sv.AsPaths, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("med", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Med = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("nextHopIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextHopIp = ptr.String(xtv) - } - - case strings.EqualFold("prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Prefix = ptr.String(xtv) - } - - case strings.EqualFold("routeInstallationDetailSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerRouteInstallationDetails(&sv.RouteInstallationDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeServerEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("routeServerPeerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteServerPeerId = ptr.String(xtv) - } - - case strings.EqualFold("routeStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteStatus = types.RouteServerRouteStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerRouteInstallationDetail(v **types.RouteServerRouteInstallationDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteServerRouteInstallationDetail - if *v == nil { - sv = &types.RouteServerRouteInstallationDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeInstallationStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteInstallationStatus = types.RouteServerRouteInstallationStatus(xtv) - } - - case strings.EqualFold("routeInstallationStatusReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteInstallationStatusReason = ptr.String(xtv) - } - - case strings.EqualFold("routeTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerRouteInstallationDetails(v *[]types.RouteServerRouteInstallationDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerRouteInstallationDetail - if *v == nil { - sv = make([]types.RouteServerRouteInstallationDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerRouteInstallationDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerRouteInstallationDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerRouteInstallationDetailsUnwrapped(v *[]types.RouteServerRouteInstallationDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerRouteInstallationDetail - if *v == nil { - sv = make([]types.RouteServerRouteInstallationDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerRouteInstallationDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerRouteInstallationDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServerRouteList(v *[]types.RouteServerRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServerRoute - if *v == nil { - sv = make([]types.RouteServerRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServerRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServerRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServerRouteListUnwrapped(v *[]types.RouteServerRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServerRoute - if *v == nil { - sv = make([]types.RouteServerRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServerRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServerRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteServersList(v *[]types.RouteServer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteServer - if *v == nil { - sv = make([]types.RouteServer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteServer - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteServer(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteServersListUnwrapped(v *[]types.RouteServer, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteServer - if *v == nil { - sv = make([]types.RouteServer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteServer - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteServer(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteTable(v **types.RouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteTable - if *v == nil { - sv = &types.RouteTable{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableAssociationList(&sv.Associations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("propagatingVgwSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPropagatingVgwList(&sv.PropagatingVgws, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("routeTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteTableAssociation(v **types.RouteTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteTableAssociation - if *v == nil { - sv = &types.RouteTableAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableAssociationState(&sv.AssociationState, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("gatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayId = ptr.String(xtv) - } - - case strings.EqualFold("main", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Main = ptr.Bool(xtv) - } - - case strings.EqualFold("routeTableAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteTableAssociationId = ptr.String(xtv) - } - - case strings.EqualFold("routeTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteTableAssociationList(v *[]types.RouteTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteTableAssociation - if *v == nil { - sv = make([]types.RouteTableAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteTableAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteTableAssociationListUnwrapped(v *[]types.RouteTableAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteTableAssociation - if *v == nil { - sv = make([]types.RouteTableAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteTableAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRouteTableAssociationState(v **types.RouteTableAssociationState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RouteTableAssociationState - if *v == nil { - sv = &types.RouteTableAssociationState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.RouteTableAssociationStateCode(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteTableList(v *[]types.RouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RouteTable - if *v == nil { - sv = make([]types.RouteTable, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RouteTable - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRouteTableListUnwrapped(v *[]types.RouteTable, decoder smithyxml.NodeDecoder) error { - var sv []types.RouteTable - if *v == nil { - sv = make([]types.RouteTable, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RouteTable - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRuleGroupRuleOptionsPair(v **types.RuleGroupRuleOptionsPair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RuleGroupRuleOptionsPair - if *v == nil { - sv = &types.RuleGroupRuleOptionsPair{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ruleGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("ruleOptionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRuleOptionList(&sv.RuleOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleGroupRuleOptionsPairList(v *[]types.RuleGroupRuleOptionsPair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RuleGroupRuleOptionsPair - if *v == nil { - sv = make([]types.RuleGroupRuleOptionsPair, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RuleGroupRuleOptionsPair - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRuleGroupRuleOptionsPair(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleGroupRuleOptionsPairListUnwrapped(v *[]types.RuleGroupRuleOptionsPair, decoder smithyxml.NodeDecoder) error { - var sv []types.RuleGroupRuleOptionsPair - if *v == nil { - sv = make([]types.RuleGroupRuleOptionsPair, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RuleGroupRuleOptionsPair - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRuleGroupRuleOptionsPair(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRuleGroupTypePair(v **types.RuleGroupTypePair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RuleGroupTypePair - if *v == nil { - sv = &types.RuleGroupTypePair{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ruleGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("ruleGroupType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleGroupType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleGroupTypePairList(v *[]types.RuleGroupTypePair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RuleGroupTypePair - if *v == nil { - sv = make([]types.RuleGroupTypePair, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RuleGroupTypePair - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRuleGroupTypePair(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleGroupTypePairListUnwrapped(v *[]types.RuleGroupTypePair, decoder smithyxml.NodeDecoder) error { - var sv []types.RuleGroupTypePair - if *v == nil { - sv = make([]types.RuleGroupTypePair, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RuleGroupTypePair - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRuleGroupTypePair(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRuleOption(v **types.RuleOption, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RuleOption - if *v == nil { - sv = &types.RuleOption{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("keyword", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Keyword = ptr.String(xtv) - } - - case strings.EqualFold("settingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStringList(&sv.Settings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleOptionList(v *[]types.RuleOption, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.RuleOption - if *v == nil { - sv = make([]types.RuleOption, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.RuleOption - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentRuleOption(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentRuleOptionListUnwrapped(v *[]types.RuleOption, decoder smithyxml.NodeDecoder) error { - var sv []types.RuleOption - if *v == nil { - sv = make([]types.RuleOption, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RuleOption - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentRuleOption(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentRunInstancesMonitoringEnabled(v **types.RunInstancesMonitoringEnabled, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RunInstancesMonitoringEnabled - if *v == nil { - sv = &types.RunInstancesMonitoringEnabled{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentS3Storage(v **types.S3Storage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.S3Storage - if *v == nil { - sv = &types.S3Storage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AWSAccessKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AWSAccessKeyId = ptr.String(xtv) - } - - case strings.EqualFold("bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - - case strings.EqualFold("prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Prefix = ptr.String(xtv) - } - - case strings.EqualFold("uploadPolicy", t.Name.Local): - var data string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - data = xtv - } - sv.UploadPolicy, err = base64.StdEncoding.DecodeString(data) - if err != nil { - return err - } - - case strings.EqualFold("uploadPolicySignature", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UploadPolicySignature = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstance(v **types.ScheduledInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ScheduledInstance - if *v == nil { - sv = &types.ScheduledInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("createDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateDate = ptr.Time(t) - } - - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("networkPlatform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkPlatform = ptr.String(xtv) - } - - case strings.EqualFold("nextSlotStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NextSlotStartTime = ptr.Time(t) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("previousSlotEndTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.PreviousSlotEndTime = ptr.Time(t) - } - - case strings.EqualFold("recurrence", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceRecurrence(&sv.Recurrence, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("scheduledInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ScheduledInstanceId = ptr.String(xtv) - } - - case strings.EqualFold("slotDurationInHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SlotDurationInHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("termEndDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TermEndDate = ptr.Time(t) - } - - case strings.EqualFold("termStartDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TermStartDate = ptr.Time(t) - } - - case strings.EqualFold("totalScheduledInstanceHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalScheduledInstanceHours = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstanceAvailability(v **types.ScheduledInstanceAvailability, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ScheduledInstanceAvailability - if *v == nil { - sv = &types.ScheduledInstanceAvailability{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availableInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableInstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("firstSlotStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.FirstSlotStartTime = ptr.Time(t) - } - - case strings.EqualFold("hourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("maxTermDurationInDays", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxTermDurationInDays = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("minTermDurationInDays", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MinTermDurationInDays = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("networkPlatform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkPlatform = ptr.String(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("purchaseToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PurchaseToken = ptr.String(xtv) - } - - case strings.EqualFold("recurrence", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceRecurrence(&sv.Recurrence, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("slotDurationInHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SlotDurationInHours = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("totalScheduledInstanceHours", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalScheduledInstanceHours = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstanceAvailabilitySet(v *[]types.ScheduledInstanceAvailability, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ScheduledInstanceAvailability - if *v == nil { - sv = make([]types.ScheduledInstanceAvailability, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ScheduledInstanceAvailability - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentScheduledInstanceAvailability(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstanceAvailabilitySetUnwrapped(v *[]types.ScheduledInstanceAvailability, decoder smithyxml.NodeDecoder) error { - var sv []types.ScheduledInstanceAvailability - if *v == nil { - sv = make([]types.ScheduledInstanceAvailability, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ScheduledInstanceAvailability - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentScheduledInstanceAvailability(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentScheduledInstanceRecurrence(v **types.ScheduledInstanceRecurrence, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ScheduledInstanceRecurrence - if *v == nil { - sv = &types.ScheduledInstanceRecurrence{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("frequency", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Frequency = ptr.String(xtv) - } - - case strings.EqualFold("interval", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Interval = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("occurrenceDaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOccurrenceDaySet(&sv.OccurrenceDaySet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("occurrenceRelativeToEnd", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.OccurrenceRelativeToEnd = ptr.Bool(xtv) - } - - case strings.EqualFold("occurrenceUnit", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OccurrenceUnit = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstanceSet(v *[]types.ScheduledInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ScheduledInstance - if *v == nil { - sv = make([]types.ScheduledInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ScheduledInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentScheduledInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentScheduledInstanceSetUnwrapped(v *[]types.ScheduledInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.ScheduledInstance - if *v == nil { - sv = make([]types.ScheduledInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ScheduledInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentScheduledInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroup(v **types.SecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroup - if *v == nil { - sv = &types.SecurityGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("ipPermissions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.IpPermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipPermissionsEgress", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.IpPermissionsEgress, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupForVpc(v **types.SecurityGroupForVpc, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroupForVpc - if *v == nil { - sv = &types.SecurityGroupForVpc{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("primaryVpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrimaryVpcId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupForVpcList(v *[]types.SecurityGroupForVpc, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroupForVpc - if *v == nil { - sv = make([]types.SecurityGroupForVpc, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroupForVpc - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroupForVpc(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupForVpcListUnwrapped(v *[]types.SecurityGroupForVpc, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroupForVpc - if *v == nil { - sv = make([]types.SecurityGroupForVpc, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroupForVpc - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroupForVpc(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupIdentifier(v **types.SecurityGroupIdentifier, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroupIdentifier - if *v == nil { - sv = &types.SecurityGroupIdentifier{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupIdList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupIdListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupIdStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("SecurityGroupId", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupIdStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupList(v *[]types.SecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroup - if *v == nil { - sv = make([]types.SecurityGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupListUnwrapped(v *[]types.SecurityGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroup - if *v == nil { - sv = make([]types.SecurityGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupReference(v **types.SecurityGroupReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroupReference - if *v == nil { - sv = &types.SecurityGroupReference{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("referencingVpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReferencingVpcId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupReferences(v *[]types.SecurityGroupReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroupReference - if *v == nil { - sv = make([]types.SecurityGroupReference, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroupReference - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroupReference(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupReferencesUnwrapped(v *[]types.SecurityGroupReference, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroupReference - if *v == nil { - sv = make([]types.SecurityGroupReference, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroupReference - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroupReference(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupRule(v **types.SecurityGroupRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroupRule - if *v == nil { - sv = &types.SecurityGroupRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrIpv4", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIpv4 = ptr.String(xtv) - } - - case strings.EqualFold("cidrIpv6", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrIpv6 = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("ipProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpProtocol = ptr.String(xtv) - } - - case strings.EqualFold("isEgress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsEgress = ptr.Bool(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("referencedGroupInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReferencedSecurityGroup(&sv.ReferencedGroupInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupRuleArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupRuleArn = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupRuleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupRuleId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupRuleList(v *[]types.SecurityGroupRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroupRule - if *v == nil { - sv = make([]types.SecurityGroupRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroupRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroupRule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupRuleListUnwrapped(v *[]types.SecurityGroupRule, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroupRule - if *v == nil { - sv = make([]types.SecurityGroupRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroupRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroupRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(v **types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SecurityGroupVpcAssociation - if *v == nil { - sv = &types.SecurityGroupVpcAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SecurityGroupVpcAssociationState(xtv) - } - - case strings.EqualFold("stateReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateReason = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - case strings.EqualFold("vpcOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupVpcAssociationList(v *[]types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SecurityGroupVpcAssociation - if *v == nil { - sv = make([]types.SecurityGroupVpcAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SecurityGroupVpcAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSecurityGroupVpcAssociationListUnwrapped(v *[]types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.SecurityGroupVpcAssociation - if *v == nil { - sv = make([]types.SecurityGroupVpcAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SecurityGroupVpcAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentServiceConfiguration(v **types.ServiceConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ServiceConfiguration - if *v == nil { - sv = &types.ServiceConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("acceptanceRequired", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AcceptanceRequired = ptr.Bool(xtv) - } - - case strings.EqualFold("availabilityZoneSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.AvailabilityZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("baseEndpointDnsNameSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.BaseEndpointDnsNames, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("gatewayLoadBalancerArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.GatewayLoadBalancerArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("managesVpcEndpoints", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ManagesVpcEndpoints = ptr.Bool(xtv) - } - - case strings.EqualFold("networkLoadBalancerArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.NetworkLoadBalancerArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("payerResponsibility", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PayerResponsibility = types.PayerResponsibility(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsNameConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateDnsNameConfiguration(&sv.PrivateDnsNameConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("remoteAccessEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.RemoteAccessEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("serviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceName = ptr.String(xtv) - } - - case strings.EqualFold("serviceState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceState = types.ServiceState(xtv) - } - - case strings.EqualFold("serviceType", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceTypeDetailSet(&sv.ServiceType, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedIpAddressTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSupportedIpAddressTypes(&sv.SupportedIpAddressTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedRegionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSupportedRegionSet(&sv.SupportedRegions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceConfigurationSet(v *[]types.ServiceConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ServiceConfiguration - if *v == nil { - sv = make([]types.ServiceConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ServiceConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentServiceConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceConfigurationSetUnwrapped(v *[]types.ServiceConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.ServiceConfiguration - if *v == nil { - sv = make([]types.ServiceConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ServiceConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentServiceConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentServiceDetail(v **types.ServiceDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ServiceDetail - if *v == nil { - sv = &types.ServiceDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("acceptanceRequired", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AcceptanceRequired = ptr.Bool(xtv) - } - - case strings.EqualFold("availabilityZoneSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.AvailabilityZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("baseEndpointDnsNameSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.BaseEndpointDnsNames, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("managesVpcEndpoints", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ManagesVpcEndpoints = ptr.Bool(xtv) - } - - case strings.EqualFold("owner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Owner = ptr.String(xtv) - } - - case strings.EqualFold("payerResponsibility", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PayerResponsibility = types.PayerResponsibility(xtv) - } - - case strings.EqualFold("privateDnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsName = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsNameSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateDnsDetailsSet(&sv.PrivateDnsNames, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("privateDnsNameVerificationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrivateDnsNameVerificationState = types.DnsNameState(xtv) - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("serviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceName = ptr.String(xtv) - } - - case strings.EqualFold("serviceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceRegion = ptr.String(xtv) - } - - case strings.EqualFold("serviceType", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceTypeDetailSet(&sv.ServiceType, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("supportedIpAddressTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSupportedIpAddressTypes(&sv.SupportedIpAddressTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEndpointPolicySupported", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.VpcEndpointPolicySupported = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceDetailSet(v *[]types.ServiceDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ServiceDetail - if *v == nil { - sv = make([]types.ServiceDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ServiceDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentServiceDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceDetailSetUnwrapped(v *[]types.ServiceDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.ServiceDetail - if *v == nil { - sv = make([]types.ServiceDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ServiceDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentServiceDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentServiceLinkVirtualInterface(v **types.ServiceLinkVirtualInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ServiceLinkVirtualInterface - if *v == nil { - sv = &types.ServiceLinkVirtualInterface{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("configurationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConfigurationState = types.ServiceLinkVirtualInterfaceConfigurationState(xtv) - } - - case strings.EqualFold("localAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalAddress = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("outpostId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostId = ptr.String(xtv) - } - - case strings.EqualFold("outpostLagId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostLagId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("peerAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerAddress = ptr.String(xtv) - } - - case strings.EqualFold("peerBgpAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PeerBgpAsn = ptr.Int64(i64) - } - - case strings.EqualFold("serviceLinkVirtualInterfaceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceLinkVirtualInterfaceArn = ptr.String(xtv) - } - - case strings.EqualFold("serviceLinkVirtualInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceLinkVirtualInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vlan", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Vlan = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceIdSet(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceIdSetUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceSet(v *[]types.ServiceLinkVirtualInterface, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ServiceLinkVirtualInterface - if *v == nil { - sv = make([]types.ServiceLinkVirtualInterface, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ServiceLinkVirtualInterface - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentServiceLinkVirtualInterface(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceSetUnwrapped(v *[]types.ServiceLinkVirtualInterface, decoder smithyxml.NodeDecoder) error { - var sv []types.ServiceLinkVirtualInterface - if *v == nil { - sv = make([]types.ServiceLinkVirtualInterface, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ServiceLinkVirtualInterface - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentServiceLinkVirtualInterface(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentServiceTypeDetail(v **types.ServiceTypeDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ServiceTypeDetail - if *v == nil { - sv = &types.ServiceTypeDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("serviceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceType = types.ServiceType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceTypeDetailSet(v *[]types.ServiceTypeDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ServiceTypeDetail - if *v == nil { - sv = make([]types.ServiceTypeDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ServiceTypeDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentServiceTypeDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentServiceTypeDetailSetUnwrapped(v *[]types.ServiceTypeDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.ServiceTypeDetail - if *v == nil { - sv = make([]types.ServiceTypeDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ServiceTypeDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentServiceTypeDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSnapshot(v **types.Snapshot, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Snapshot - if *v == nil { - sv = &types.Snapshot{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("completionDurationMinutes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CompletionDurationMinutes = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("completionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CompletionTime = ptr.Time(t) - } - - case strings.EqualFold("dataEncryptionKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DataEncryptionKeyId = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("fullSnapshotSizeInBytes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FullSnapshotSizeInBytes = ptr.Int64(i64) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("restoreExpiryTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RestoreExpiryTime = ptr.Time(t) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("storageTier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StorageTier = types.StorageTier(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transferType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransferType = types.TransferType(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotDetail(v **types.SnapshotDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SnapshotDetail - if *v == nil { - sv = &types.SnapshotDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceName = ptr.String(xtv) - } - - case strings.EqualFold("diskImageSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.DiskImageSize = ptr.Float64(f64) - } - - case strings.EqualFold("format", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Format = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("url", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Url = ptr.String(xtv) - } - - case strings.EqualFold("userBucket", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUserBucketDetails(&sv.UserBucket, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotDetailList(v *[]types.SnapshotDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SnapshotDetail - if *v == nil { - sv = make([]types.SnapshotDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SnapshotDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSnapshotDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotDetailListUnwrapped(v *[]types.SnapshotDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.SnapshotDetail - if *v == nil { - sv = make([]types.SnapshotDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SnapshotDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSnapshotDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSnapshotInfo(v **types.SnapshotInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SnapshotInfo - if *v == nil { - sv = &types.SnapshotInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotList(v *[]types.Snapshot, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Snapshot - if *v == nil { - sv = make([]types.Snapshot, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Snapshot - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSnapshot(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotListUnwrapped(v *[]types.Snapshot, decoder smithyxml.NodeDecoder) error { - var sv []types.Snapshot - if *v == nil { - sv = make([]types.Snapshot, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Snapshot - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSnapshot(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSnapshotRecycleBinInfo(v **types.SnapshotRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SnapshotRecycleBinInfo - if *v == nil { - sv = &types.SnapshotRecycleBinInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("recycleBinEnterTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RecycleBinEnterTime = ptr.Time(t) - } - - case strings.EqualFold("recycleBinExitTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RecycleBinExitTime = ptr.Time(t) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotRecycleBinInfoList(v *[]types.SnapshotRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SnapshotRecycleBinInfo - if *v == nil { - sv = make([]types.SnapshotRecycleBinInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SnapshotRecycleBinInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSnapshotRecycleBinInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotRecycleBinInfoListUnwrapped(v *[]types.SnapshotRecycleBinInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.SnapshotRecycleBinInfo - if *v == nil { - sv = make([]types.SnapshotRecycleBinInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SnapshotRecycleBinInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSnapshotRecycleBinInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSnapshotSet(v *[]types.SnapshotInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SnapshotInfo - if *v == nil { - sv = make([]types.SnapshotInfo, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SnapshotInfo - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSnapshotInfo(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotSetUnwrapped(v *[]types.SnapshotInfo, decoder smithyxml.NodeDecoder) error { - var sv []types.SnapshotInfo - if *v == nil { - sv = make([]types.SnapshotInfo, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SnapshotInfo - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSnapshotInfo(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSnapshotTaskDetail(v **types.SnapshotTaskDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SnapshotTaskDetail - if *v == nil { - sv = &types.SnapshotTaskDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("diskImageSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.DiskImageSize = ptr.Float64(f64) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("format", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Format = ptr.String(xtv) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("url", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Url = ptr.String(xtv) - } - - case strings.EqualFold("userBucket", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUserBucketDetails(&sv.UserBucket, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotTierStatus(v **types.SnapshotTierStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SnapshotTierStatus - if *v == nil { - sv = &types.SnapshotTierStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("archivalCompleteTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ArchivalCompleteTime = ptr.Time(t) - } - - case strings.EqualFold("lastTieringOperationStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastTieringOperationStatus = types.TieringOperationStatus(xtv) - } - - case strings.EqualFold("lastTieringOperationStatusDetail", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastTieringOperationStatusDetail = ptr.String(xtv) - } - - case strings.EqualFold("lastTieringProgress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LastTieringProgress = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("lastTieringStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastTieringStartTime = ptr.Time(t) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("restoreExpiryTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RestoreExpiryTime = ptr.Time(t) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.SnapshotState(xtv) - } - - case strings.EqualFold("storageTier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StorageTier = types.StorageTier(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotTierStatusSet(v *[]types.SnapshotTierStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SnapshotTierStatus - if *v == nil { - sv = make([]types.SnapshotTierStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SnapshotTierStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSnapshotTierStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSnapshotTierStatusSetUnwrapped(v *[]types.SnapshotTierStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.SnapshotTierStatus - if *v == nil { - sv = make([]types.SnapshotTierStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SnapshotTierStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSnapshotTierStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSpotCapacityRebalance(v **types.SpotCapacityRebalance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotCapacityRebalance - if *v == nil { - sv = &types.SpotCapacityRebalance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("replacementStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReplacementStrategy = types.ReplacementStrategy(xtv) - } - - case strings.EqualFold("terminationDelay", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TerminationDelay = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotDatafeedSubscription(v **types.SpotDatafeedSubscription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotDatafeedSubscription - if *v == nil { - sv = &types.SpotDatafeedSubscription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - - case strings.EqualFold("fault", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotInstanceStateFault(&sv.Fault, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Prefix = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.DatafeedSubscriptionState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetLaunchSpecification(v **types.SpotFleetLaunchSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotFleetLaunchSpecification - if *v == nil { - sv = &types.SpotFleetLaunchSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressingType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AddressingType = ptr.String(xtv) - } - - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsOptimized = ptr.Bool(xtv) - } - - case strings.EqualFold("iamInstanceProfile", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileSpecification(&sv.IamInstanceProfile, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("instanceRequirements", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceRequirements(&sv.InstanceRequirements, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("kernelId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KernelId = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("monitoring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotFleetMonitoring(&sv.Monitoring, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecificationList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("placement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotPlacement(&sv.Placement, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ramdiskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RamdiskId = ptr.String(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("spotPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotPrice = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotFleetTagSpecificationList(&sv.TagSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("userData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserData = ptr.String(xtv) - } - - case strings.EqualFold("weightedCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.WeightedCapacity = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetMonitoring(v **types.SpotFleetMonitoring, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotFleetMonitoring - if *v == nil { - sv = &types.SpotFleetMonitoring{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetRequestConfig(v **types.SpotFleetRequestConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotFleetRequestConfig - if *v == nil { - sv = &types.SpotFleetRequestConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activityStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ActivityStatus = types.ActivityStatus(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("spotFleetRequestConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotFleetRequestConfigData(&sv.SpotFleetRequestConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - case strings.EqualFold("spotFleetRequestState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestState = types.BatchState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetRequestConfigData(v **types.SpotFleetRequestConfigData, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotFleetRequestConfigData - if *v == nil { - sv = &types.SpotFleetRequestConfigData{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationStrategy = types.AllocationStrategy(xtv) - } - - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("context", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Context = ptr.String(xtv) - } - - case strings.EqualFold("excessCapacityTerminationPolicy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExcessCapacityTerminationPolicy = types.ExcessCapacityTerminationPolicy(xtv) - } - - case strings.EqualFold("fulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("iamFleetRole", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IamFleetRole = ptr.String(xtv) - } - - case strings.EqualFold("instanceInterruptionBehavior", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceInterruptionBehavior = types.InstanceInterruptionBehavior(xtv) - } - - case strings.EqualFold("instancePoolsToUseCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstancePoolsToUseCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("launchSpecifications", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchSpecsList(&sv.LaunchSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("launchTemplateConfigs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateConfigList(&sv.LaunchTemplateConfigs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("loadBalancersConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLoadBalancersConfig(&sv.LoadBalancersConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("onDemandAllocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OnDemandAllocationStrategy = types.OnDemandAllocationStrategy(xtv) - } - - case strings.EqualFold("onDemandFulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.OnDemandFulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("onDemandMaxTotalPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OnDemandMaxTotalPrice = ptr.String(xtv) - } - - case strings.EqualFold("onDemandTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OnDemandTargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("replaceUnhealthyInstances", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReplaceUnhealthyInstances = ptr.Bool(xtv) - } - - case strings.EqualFold("spotMaintenanceStrategies", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotMaintenanceStrategies(&sv.SpotMaintenanceStrategies, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("spotMaxTotalPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotMaxTotalPrice = ptr.String(xtv) - } - - case strings.EqualFold("spotPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotPrice = ptr.String(xtv) - } - - case strings.EqualFold("TagSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagSpecificationList(&sv.TagSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("targetCapacityUnitType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetCapacityUnitType = types.TargetCapacityUnitType(xtv) - } - - case strings.EqualFold("terminateInstancesWithExpiration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.TerminateInstancesWithExpiration = ptr.Bool(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.FleetType(xtv) - } - - case strings.EqualFold("validFrom", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidFrom = ptr.Time(t) - } - - case strings.EqualFold("validUntil", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidUntil = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetRequestConfigSet(v *[]types.SpotFleetRequestConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotFleetRequestConfig - if *v == nil { - sv = make([]types.SpotFleetRequestConfig, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotFleetRequestConfig - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotFleetRequestConfig(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetRequestConfigSetUnwrapped(v *[]types.SpotFleetRequestConfig, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotFleetRequestConfig - if *v == nil { - sv = make([]types.SpotFleetRequestConfig, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotFleetRequestConfig - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotFleetRequestConfig(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSpotFleetTagSpecification(v **types.SpotFleetTagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotFleetTagSpecification - if *v == nil { - sv = &types.SpotFleetTagSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.ResourceType(xtv) - } - - case strings.EqualFold("tag", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetTagSpecificationList(v *[]types.SpotFleetTagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotFleetTagSpecification - if *v == nil { - sv = make([]types.SpotFleetTagSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotFleetTagSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotFleetTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotFleetTagSpecificationListUnwrapped(v *[]types.SpotFleetTagSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotFleetTagSpecification - if *v == nil { - sv = make([]types.SpotFleetTagSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotFleetTagSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotFleetTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSpotInstanceRequest(v **types.SpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotInstanceRequest - if *v == nil { - sv = &types.SpotInstanceRequest{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("actualBlockHourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ActualBlockHourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneGroup = ptr.String(xtv) - } - - case strings.EqualFold("blockDurationMinutes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.BlockDurationMinutes = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("fault", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotInstanceStateFault(&sv.Fault, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceInterruptionBehavior", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceInterruptionBehavior = types.InstanceInterruptionBehavior(xtv) - } - - case strings.EqualFold("launchedAvailabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchedAvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("launchGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LaunchGroup = ptr.String(xtv) - } - - case strings.EqualFold("launchSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchSpecification(&sv.LaunchSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductDescription = types.RIProductDescription(xtv) - } - - case strings.EqualFold("spotInstanceRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotInstanceRequestId = ptr.String(xtv) - } - - case strings.EqualFold("spotPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotPrice = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SpotInstanceState(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotInstanceStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.SpotInstanceType(xtv) - } - - case strings.EqualFold("validFrom", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidFrom = ptr.Time(t) - } - - case strings.EqualFold("validUntil", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ValidUntil = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotInstanceRequestList(v *[]types.SpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotInstanceRequest - if *v == nil { - sv = make([]types.SpotInstanceRequest, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotInstanceRequest - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotInstanceRequest(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotInstanceRequestListUnwrapped(v *[]types.SpotInstanceRequest, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotInstanceRequest - if *v == nil { - sv = make([]types.SpotInstanceRequest, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotInstanceRequest - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotInstanceRequest(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSpotInstanceStateFault(v **types.SpotInstanceStateFault, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotInstanceStateFault - if *v == nil { - sv = &types.SpotInstanceStateFault{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotInstanceStatus(v **types.SpotInstanceStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotInstanceStatus - if *v == nil { - sv = &types.SpotInstanceStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - case strings.EqualFold("updateTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.UpdateTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotMaintenanceStrategies(v **types.SpotMaintenanceStrategies, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotMaintenanceStrategies - if *v == nil { - sv = &types.SpotMaintenanceStrategies{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityRebalance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotCapacityRebalance(&sv.CapacityRebalance, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotOptions(v **types.SpotOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotOptions - if *v == nil { - sv = &types.SpotOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationStrategy = types.SpotAllocationStrategy(xtv) - } - - case strings.EqualFold("instanceInterruptionBehavior", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceInterruptionBehavior = types.SpotInstanceInterruptionBehavior(xtv) - } - - case strings.EqualFold("instancePoolsToUseCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstancePoolsToUseCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("maintenanceStrategies", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetSpotMaintenanceStrategies(&sv.MaintenanceStrategies, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxTotalPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MaxTotalPrice = ptr.String(xtv) - } - - case strings.EqualFold("minTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MinTargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("singleAvailabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SingleAvailabilityZone = ptr.Bool(xtv) - } - - case strings.EqualFold("singleInstanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SingleInstanceType = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPlacement(v **types.SpotPlacement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotPlacement - if *v == nil { - sv = &types.SpotPlacement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.Tenancy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPlacementScore(v **types.SpotPlacementScore, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotPlacementScore - if *v == nil { - sv = &types.SpotPlacementScore{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("region", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Region = ptr.String(xtv) - } - - case strings.EqualFold("score", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Score = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPlacementScores(v *[]types.SpotPlacementScore, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotPlacementScore - if *v == nil { - sv = make([]types.SpotPlacementScore, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotPlacementScore - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotPlacementScore(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPlacementScoresUnwrapped(v *[]types.SpotPlacementScore, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotPlacementScore - if *v == nil { - sv = make([]types.SpotPlacementScore, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotPlacementScore - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotPlacementScore(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSpotPrice(v **types.SpotPrice, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SpotPrice - if *v == nil { - sv = &types.SpotPrice{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = types.InstanceType(xtv) - } - - case strings.EqualFold("productDescription", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ProductDescription = types.RIProductDescription(xtv) - } - - case strings.EqualFold("spotPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotPrice = ptr.String(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPriceHistoryList(v *[]types.SpotPrice, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SpotPrice - if *v == nil { - sv = make([]types.SpotPrice, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SpotPrice - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSpotPrice(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSpotPriceHistoryListUnwrapped(v *[]types.SpotPrice, decoder smithyxml.NodeDecoder) error { - var sv []types.SpotPrice - if *v == nil { - sv = make([]types.SpotPrice, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SpotPrice - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSpotPrice(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentStaleIpPermission(v **types.StaleIpPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.StaleIpPermission - if *v == nil { - sv = &types.StaleIpPermission{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpProtocol = ptr.String(xtv) - } - - case strings.EqualFold("ipRanges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpRanges(&sv.IpRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("prefixListIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListIdSet(&sv.PrefixListIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("groups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUserIdGroupPairSet(&sv.UserIdGroupPairs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStaleIpPermissionSet(v *[]types.StaleIpPermission, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.StaleIpPermission - if *v == nil { - sv = make([]types.StaleIpPermission, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.StaleIpPermission - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentStaleIpPermission(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStaleIpPermissionSetUnwrapped(v *[]types.StaleIpPermission, decoder smithyxml.NodeDecoder) error { - var sv []types.StaleIpPermission - if *v == nil { - sv = make([]types.StaleIpPermission, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.StaleIpPermission - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentStaleIpPermission(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentStaleSecurityGroup(v **types.StaleSecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.StaleSecurityGroup - if *v == nil { - sv = &types.StaleSecurityGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("staleIpPermissions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStaleIpPermissionSet(&sv.StaleIpPermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("staleIpPermissionsEgress", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStaleIpPermissionSet(&sv.StaleIpPermissionsEgress, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStaleSecurityGroupSet(v *[]types.StaleSecurityGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.StaleSecurityGroup - if *v == nil { - sv = make([]types.StaleSecurityGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.StaleSecurityGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentStaleSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStaleSecurityGroupSetUnwrapped(v *[]types.StaleSecurityGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.StaleSecurityGroup - if *v == nil { - sv = make([]types.StaleSecurityGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.StaleSecurityGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentStaleSecurityGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentStateReason(v **types.StateReason, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.StateReason - if *v == nil { - sv = &types.StateReason{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStorage(v **types.Storage, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Storage - if *v == nil { - sv = &types.Storage{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("S3", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentS3Storage(&sv.S3, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStoreImageTaskResult(v **types.StoreImageTaskResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.StoreImageTaskResult - if *v == nil { - sv = &types.StoreImageTaskResult{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amiId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AmiId = ptr.String(xtv) - } - - case strings.EqualFold("bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - - case strings.EqualFold("progressPercentage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ProgressPercentage = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("s3objectKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3objectKey = ptr.String(xtv) - } - - case strings.EqualFold("storeTaskFailureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StoreTaskFailureReason = ptr.String(xtv) - } - - case strings.EqualFold("storeTaskState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StoreTaskState = ptr.String(xtv) - } - - case strings.EqualFold("taskStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TaskStartTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStoreImageTaskResultSet(v *[]types.StoreImageTaskResult, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.StoreImageTaskResult - if *v == nil { - sv = make([]types.StoreImageTaskResult, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.StoreImageTaskResult - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentStoreImageTaskResult(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStoreImageTaskResultSetUnwrapped(v *[]types.StoreImageTaskResult, decoder smithyxml.NodeDecoder) error { - var sv []types.StoreImageTaskResult - if *v == nil { - sv = make([]types.StoreImageTaskResult, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.StoreImageTaskResult - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentStoreImageTaskResult(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubnet(v **types.Subnet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Subnet - if *v == nil { - sv = &types.Subnet{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("assignIpv6AddressOnCreation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssignIpv6AddressOnCreation = ptr.Bool(xtv) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("availableIpAddressCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableIpAddressCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("blockPublicAccessStates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockPublicAccessStates(&sv.BlockPublicAccessStates, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIpv4Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIpv4Pool = ptr.String(xtv) - } - - case strings.EqualFold("defaultForAz", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DefaultForAz = ptr.Bool(xtv) - } - - case strings.EqualFold("enableDns64", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableDns64 = ptr.Bool(xtv) - } - - case strings.EqualFold("enableLniAtDeviceIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EnableLniAtDeviceIndex = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ipv6CidrBlockAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociationSet(&sv.Ipv6CidrBlockAssociationSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6Native", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Ipv6Native = ptr.Bool(xtv) - } - - case strings.EqualFold("mapCustomerOwnedIpOnLaunch", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.MapCustomerOwnedIpOnLaunch = ptr.Bool(xtv) - } - - case strings.EqualFold("mapPublicIpOnLaunch", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.MapPublicIpOnLaunch = ptr.Bool(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsNameOptionsOnLaunch", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrivateDnsNameOptionsOnLaunch(&sv.PrivateDnsNameOptionsOnLaunch, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SubnetState(xtv) - } - - case strings.EqualFold("subnetArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetArn = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetAssociation(v **types.SubnetAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetAssociation - if *v == nil { - sv = &types.SubnetAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayMulitcastDomainAssociationState(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetAssociationList(v *[]types.SubnetAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SubnetAssociation - if *v == nil { - sv = make([]types.SubnetAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SubnetAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubnetAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetAssociationListUnwrapped(v *[]types.SubnetAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.SubnetAssociation - if *v == nil { - sv = make([]types.SubnetAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SubnetAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubnetAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubnetCidrBlockState(v **types.SubnetCidrBlockState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetCidrBlockState - if *v == nil { - sv = &types.SubnetCidrBlockState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SubnetCidrBlockStateCode(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetCidrReservation(v **types.SubnetCidrReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetCidrReservation - if *v == nil { - sv = &types.SubnetCidrReservation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("reservationType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservationType = types.SubnetCidrReservationType(xtv) - } - - case strings.EqualFold("subnetCidrReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetCidrReservationId = ptr.String(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetCidrReservationList(v *[]types.SubnetCidrReservation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SubnetCidrReservation - if *v == nil { - sv = make([]types.SubnetCidrReservation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SubnetCidrReservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubnetCidrReservation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetCidrReservationListUnwrapped(v *[]types.SubnetCidrReservation, decoder smithyxml.NodeDecoder) error { - var sv []types.SubnetCidrReservation - if *v == nil { - sv = make([]types.SubnetCidrReservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SubnetCidrReservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubnetCidrReservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubnetIpPrefixes(v **types.SubnetIpPrefixes, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetIpPrefixes - if *v == nil { - sv = &types.SubnetIpPrefixes{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipPrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.IpPrefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetIpPrefixesList(v *[]types.SubnetIpPrefixes, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SubnetIpPrefixes - if *v == nil { - sv = make([]types.SubnetIpPrefixes, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SubnetIpPrefixes - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubnetIpPrefixes(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetIpPrefixesListUnwrapped(v *[]types.SubnetIpPrefixes, decoder smithyxml.NodeDecoder) error { - var sv []types.SubnetIpPrefixes - if *v == nil { - sv = make([]types.SubnetIpPrefixes, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SubnetIpPrefixes - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubnetIpPrefixes(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociation(v **types.SubnetIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetIpv6CidrBlockAssociation - if *v == nil { - sv = &types.SubnetIpv6CidrBlockAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("ipSource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpSource = types.IpSource(xtv) - } - - case strings.EqualFold("ipv6AddressAttribute", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6AddressAttribute = types.Ipv6AddressAttribute(xtv) - } - - case strings.EqualFold("ipv6CidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("ipv6CidrBlockState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetCidrBlockState(&sv.Ipv6CidrBlockState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociationSet(v *[]types.SubnetIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SubnetIpv6CidrBlockAssociation - if *v == nil { - sv = make([]types.SubnetIpv6CidrBlockAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SubnetIpv6CidrBlockAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociationSetUnwrapped(v *[]types.SubnetIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.SubnetIpv6CidrBlockAssociation - if *v == nil { - sv = make([]types.SubnetIpv6CidrBlockAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SubnetIpv6CidrBlockAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubnetList(v *[]types.Subnet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Subnet - if *v == nil { - sv = make([]types.Subnet, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Subnet - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubnet(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubnetListUnwrapped(v *[]types.Subnet, decoder smithyxml.NodeDecoder) error { - var sv []types.Subnet - if *v == nil { - sv = make([]types.Subnet, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Subnet - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubnet(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSubscription(v **types.Subscription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Subscription - if *v == nil { - sv = &types.Subscription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Destination = ptr.String(xtv) - } - - case strings.EqualFold("metric", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Metric = types.MetricType(xtv) - } - - case strings.EqualFold("period", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Period = types.PeriodType(xtv) - } - - case strings.EqualFold("source", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Source = ptr.String(xtv) - } - - case strings.EqualFold("statistic", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Statistic = types.StatisticType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubscriptionList(v *[]types.Subscription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Subscription - if *v == nil { - sv = make([]types.Subscription, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Subscription - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSubscription(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSubscriptionListUnwrapped(v *[]types.Subscription, decoder smithyxml.NodeDecoder) error { - var sv []types.Subscription - if *v == nil { - sv = make([]types.Subscription, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Subscription - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSubscription(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationItem(v **types.SuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = &types.SuccessfulInstanceCreditSpecificationItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationSet(v *[]types.SuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = make([]types.SuccessfulInstanceCreditSpecificationItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SuccessfulInstanceCreditSpecificationItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationSetUnwrapped(v *[]types.SuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - var sv []types.SuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = make([]types.SuccessfulInstanceCreditSpecificationItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SuccessfulInstanceCreditSpecificationItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletion(v **types.SuccessfulQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SuccessfulQueuedPurchaseDeletion - if *v == nil { - sv = &types.SuccessfulQueuedPurchaseDeletion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletionSet(v *[]types.SuccessfulQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SuccessfulQueuedPurchaseDeletion - if *v == nil { - sv = make([]types.SuccessfulQueuedPurchaseDeletion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SuccessfulQueuedPurchaseDeletion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletionSetUnwrapped(v *[]types.SuccessfulQueuedPurchaseDeletion, decoder smithyxml.NodeDecoder) error { - var sv []types.SuccessfulQueuedPurchaseDeletion - if *v == nil { - sv = make([]types.SuccessfulQueuedPurchaseDeletion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SuccessfulQueuedPurchaseDeletion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSupportedAdditionalProcessorFeatureList(v *[]types.SupportedAdditionalProcessorFeature, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SupportedAdditionalProcessorFeature - if *v == nil { - sv = make([]types.SupportedAdditionalProcessorFeature, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SupportedAdditionalProcessorFeature - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.SupportedAdditionalProcessorFeature(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSupportedAdditionalProcessorFeatureListUnwrapped(v *[]types.SupportedAdditionalProcessorFeature, decoder smithyxml.NodeDecoder) error { - var sv []types.SupportedAdditionalProcessorFeature - if *v == nil { - sv = make([]types.SupportedAdditionalProcessorFeature, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SupportedAdditionalProcessorFeature - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.SupportedAdditionalProcessorFeature(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSupportedIpAddressTypes(v *[]types.ServiceConnectivityType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ServiceConnectivityType - if *v == nil { - sv = make([]types.ServiceConnectivityType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ServiceConnectivityType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.ServiceConnectivityType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSupportedIpAddressTypesUnwrapped(v *[]types.ServiceConnectivityType, decoder smithyxml.NodeDecoder) error { - var sv []types.ServiceConnectivityType - if *v == nil { - sv = make([]types.ServiceConnectivityType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ServiceConnectivityType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.ServiceConnectivityType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentSupportedRegionDetail(v **types.SupportedRegionDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SupportedRegionDetail - if *v == nil { - sv = &types.SupportedRegionDetail{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("region", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Region = ptr.String(xtv) - } - - case strings.EqualFold("serviceState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceState = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSupportedRegionSet(v *[]types.SupportedRegionDetail, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.SupportedRegionDetail - if *v == nil { - sv = make([]types.SupportedRegionDetail, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.SupportedRegionDetail - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentSupportedRegionDetail(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentSupportedRegionSetUnwrapped(v *[]types.SupportedRegionDetail, decoder smithyxml.NodeDecoder) error { - var sv []types.SupportedRegionDetail - if *v == nil { - sv = make([]types.SupportedRegionDetail, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.SupportedRegionDetail - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentSupportedRegionDetail(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Tag - if *v == nil { - sv = &types.Tag{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Key = ptr.String(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagDescription(v **types.TagDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TagDescription - if *v == nil { - sv = &types.TagDescription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Key = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.ResourceType(xtv) - } - - case strings.EqualFold("value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagDescriptionList(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TagDescription - if *v == nil { - sv = make([]types.TagDescription, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TagDescription - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagDescriptionListUnwrapped(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { - var sv []types.TagDescription - if *v == nil { - sv = make([]types.TagDescription, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TagDescription - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Tag - if *v == nil { - sv = make([]types.Tag, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Tag - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagListUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { - var sv []types.Tag - if *v == nil { - sv = make([]types.Tag, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Tag - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTagSpecification(v **types.TagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TagSpecification - if *v == nil { - sv = &types.TagSpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.ResourceType(xtv) - } - - case strings.EqualFold("Tag", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagSpecificationList(v *[]types.TagSpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TagSpecification - if *v == nil { - sv = make([]types.TagSpecification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TagSpecification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTagSpecificationListUnwrapped(v *[]types.TagSpecification, decoder smithyxml.NodeDecoder) error { - var sv []types.TagSpecification - if *v == nil { - sv = make([]types.TagSpecification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TagSpecification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTagSpecification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTargetCapacitySpecification(v **types.TargetCapacitySpecification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetCapacitySpecification - if *v == nil { - sv = &types.TargetCapacitySpecification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("defaultTargetCapacityType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DefaultTargetCapacityType = types.DefaultTargetCapacityType(xtv) - } - - case strings.EqualFold("onDemandTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OnDemandTargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("spotTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SpotTargetCapacity = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("targetCapacityUnitType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetCapacityUnitType = types.TargetCapacityUnitType(xtv) - } - - case strings.EqualFold("totalTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalTargetCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetConfiguration(v **types.TargetConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetConfiguration - if *v == nil { - sv = &types.TargetConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("offeringId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OfferingId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetGroup - if *v == nil { - sv = &types.TargetGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetGroups(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TargetGroup - if *v == nil { - sv = make([]types.TargetGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TargetGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetGroupsUnwrapped(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetGroup - if *v == nil { - sv = make([]types.TargetGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TargetGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTargetGroupsConfig(v **types.TargetGroupsConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetGroupsConfig - if *v == nil { - sv = &types.TargetGroupsConfig{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("targetGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetGroups(&sv.TargetGroups, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetNetwork(v **types.TargetNetwork, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetNetwork - if *v == nil { - sv = &types.TargetNetwork{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociationStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetNetworkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetNetworkId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetNetworkSet(v *[]types.TargetNetwork, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TargetNetwork - if *v == nil { - sv = make([]types.TargetNetwork, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TargetNetwork - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTargetNetwork(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetNetworkSetUnwrapped(v *[]types.TargetNetwork, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetNetwork - if *v == nil { - sv = make([]types.TargetNetwork, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TargetNetwork - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTargetNetwork(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTargetReservationValue(v **types.TargetReservationValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetReservationValue - if *v == nil { - sv = &types.TargetReservationValue{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservationValue", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservationValue(&sv.ReservationValue, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetConfiguration(&sv.TargetConfiguration, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetReservationValueSet(v *[]types.TargetReservationValue, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TargetReservationValue - if *v == nil { - sv = make([]types.TargetReservationValue, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TargetReservationValue - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTargetReservationValue(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTargetReservationValueSetUnwrapped(v *[]types.TargetReservationValue, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetReservationValue - if *v == nil { - sv = make([]types.TargetReservationValue, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TargetReservationValue - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTargetReservationValue(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTerminateConnectionStatus(v **types.TerminateConnectionStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TerminateConnectionStatus - if *v == nil { - sv = &types.TerminateConnectionStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ConnectionId = ptr.String(xtv) - } - - case strings.EqualFold("currentStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnConnectionStatus(&sv.CurrentStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("previousStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnConnectionStatus(&sv.PreviousStatus, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTerminateConnectionStatusSet(v *[]types.TerminateConnectionStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TerminateConnectionStatus - if *v == nil { - sv = make([]types.TerminateConnectionStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TerminateConnectionStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTerminateConnectionStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTerminateConnectionStatusSetUnwrapped(v *[]types.TerminateConnectionStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.TerminateConnectionStatus - if *v == nil { - sv = make([]types.TerminateConnectionStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TerminateConnectionStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTerminateConnectionStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentThreadsPerCoreList(v *[]int32, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col int32 - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - col = int32(i64) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentThreadsPerCoreListUnwrapped(v *[]int32, decoder smithyxml.NodeDecoder) error { - var sv []int32 - if *v == nil { - sv = make([]int32, 0) - } else { - sv = *v - } - - switch { - default: - var mv int32 - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - mv = int32(i64) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentThroughResourcesStatement(v **types.ThroughResourcesStatement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ThroughResourcesStatement - if *v == nil { - sv = &types.ThroughResourcesStatement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceStatement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResourceStatement(&sv.ResourceStatement, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentThroughResourcesStatementList(v *[]types.ThroughResourcesStatement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.ThroughResourcesStatement - if *v == nil { - sv = make([]types.ThroughResourcesStatement, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.ThroughResourcesStatement - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentThroughResourcesStatement(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentThroughResourcesStatementListUnwrapped(v *[]types.ThroughResourcesStatement, decoder smithyxml.NodeDecoder) error { - var sv []types.ThroughResourcesStatement - if *v == nil { - sv = make([]types.ThroughResourcesStatement, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.ThroughResourcesStatement - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentThroughResourcesStatement(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTotalLocalStorageGB(v **types.TotalLocalStorageGB, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TotalLocalStorageGB - if *v == nil { - sv = &types.TotalLocalStorageGB{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Max = ptr.Float64(f64) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Min = ptr.Float64(f64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilter(v **types.TrafficMirrorFilter, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrafficMirrorFilter - if *v == nil { - sv = &types.TrafficMirrorFilter{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("egressFilterRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRuleList(&sv.EgressFilterRules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ingressFilterRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRuleList(&sv.IngressFilterRules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkServiceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorNetworkServiceList(&sv.NetworkServices, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trafficMirrorFilterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilterRule(v **types.TrafficMirrorFilterRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrafficMirrorFilterRule - if *v == nil { - sv = &types.TrafficMirrorFilterRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("destinationPortRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorPortRange(&sv.DestinationPortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Protocol = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ruleAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RuleAction = types.TrafficMirrorRuleAction(xtv) - } - - case strings.EqualFold("ruleNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RuleNumber = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("sourceCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("sourcePortRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorPortRange(&sv.SourcePortRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trafficDirection", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficDirection = types.TrafficDirection(xtv) - } - - case strings.EqualFold("trafficMirrorFilterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterId = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorFilterRuleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterRuleId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilterRuleList(v *[]types.TrafficMirrorFilterRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorFilterRule - if *v == nil { - sv = make([]types.TrafficMirrorFilterRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorFilterRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilterRuleListUnwrapped(v *[]types.TrafficMirrorFilterRule, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorFilterRule - if *v == nil { - sv = make([]types.TrafficMirrorFilterRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorFilterRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTrafficMirrorFilterRuleSet(v *[]types.TrafficMirrorFilterRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorFilterRule - if *v == nil { - sv = make([]types.TrafficMirrorFilterRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorFilterRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilterRuleSetUnwrapped(v *[]types.TrafficMirrorFilterRule, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorFilterRule - if *v == nil { - sv = make([]types.TrafficMirrorFilterRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorFilterRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTrafficMirrorFilterSet(v *[]types.TrafficMirrorFilter, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorFilter - if *v == nil { - sv = make([]types.TrafficMirrorFilter, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorFilter - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrafficMirrorFilter(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorFilterSetUnwrapped(v *[]types.TrafficMirrorFilter, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorFilter - if *v == nil { - sv = make([]types.TrafficMirrorFilter, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorFilter - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrafficMirrorFilter(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTrafficMirrorNetworkServiceList(v *[]types.TrafficMirrorNetworkService, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorNetworkService - if *v == nil { - sv = make([]types.TrafficMirrorNetworkService, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorNetworkService - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.TrafficMirrorNetworkService(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorNetworkServiceListUnwrapped(v *[]types.TrafficMirrorNetworkService, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorNetworkService - if *v == nil { - sv = make([]types.TrafficMirrorNetworkService, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorNetworkService - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.TrafficMirrorNetworkService(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTrafficMirrorPortRange(v **types.TrafficMirrorPortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrafficMirrorPortRange - if *v == nil { - sv = &types.TrafficMirrorPortRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorSession(v **types.TrafficMirrorSession, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrafficMirrorSession - if *v == nil { - sv = &types.TrafficMirrorSession{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("packetLength", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PacketLength = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("sessionNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SessionNumber = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trafficMirrorFilterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterId = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorSessionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorSessionId = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorTargetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorTargetId = ptr.String(xtv) - } - - case strings.EqualFold("virtualNetworkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VirtualNetworkId = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorSessionSet(v *[]types.TrafficMirrorSession, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorSession - if *v == nil { - sv = make([]types.TrafficMirrorSession, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorSession - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrafficMirrorSession(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorSessionSetUnwrapped(v *[]types.TrafficMirrorSession, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorSession - if *v == nil { - sv = make([]types.TrafficMirrorSession, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorSession - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrafficMirrorSession(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTrafficMirrorTarget(v **types.TrafficMirrorTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrafficMirrorTarget - if *v == nil { - sv = &types.TrafficMirrorTarget{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("gatewayLoadBalancerEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayLoadBalancerEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("networkLoadBalancerArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkLoadBalancerArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trafficMirrorTargetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorTargetId = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.TrafficMirrorTargetType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorTargetSet(v *[]types.TrafficMirrorTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrafficMirrorTarget - if *v == nil { - sv = make([]types.TrafficMirrorTarget, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrafficMirrorTarget - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrafficMirrorTarget(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrafficMirrorTargetSetUnwrapped(v *[]types.TrafficMirrorTarget, decoder smithyxml.NodeDecoder) error { - var sv []types.TrafficMirrorTarget - if *v == nil { - sv = make([]types.TrafficMirrorTarget, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrafficMirrorTarget - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrafficMirrorTarget(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGateway(v **types.TransitGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGateway - if *v == nil { - sv = &types.TransitGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayArn = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAssociation(v **types.TransitGatewayAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayAssociation - if *v == nil { - sv = &types.TransitGatewayAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAssociationState(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachment(v **types.TransitGatewayAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayAttachment - if *v == nil { - sv = &types.TransitGatewayAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAttachmentState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentAssociation(v **types.TransitGatewayAttachmentAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayAttachmentAssociation - if *v == nil { - sv = &types.TransitGatewayAttachmentAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAssociationState(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfiguration(v **types.TransitGatewayAttachmentBgpConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayAttachmentBgpConfiguration - if *v == nil { - sv = &types.TransitGatewayAttachmentBgpConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bgpStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BgpStatus = types.BgpStatus(xtv) - } - - case strings.EqualFold("peerAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerAddress = ptr.String(xtv) - } - - case strings.EqualFold("peerAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PeerAsn = ptr.Int64(i64) - } - - case strings.EqualFold("transitGatewayAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAddress = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TransitGatewayAsn = ptr.Int64(i64) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfigurationList(v *[]types.TransitGatewayAttachmentBgpConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayAttachmentBgpConfiguration - if *v == nil { - sv = make([]types.TransitGatewayAttachmentBgpConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayAttachmentBgpConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfigurationListUnwrapped(v *[]types.TransitGatewayAttachmentBgpConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayAttachmentBgpConfiguration - if *v == nil { - sv = make([]types.TransitGatewayAttachmentBgpConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayAttachmentBgpConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayAttachmentList(v *[]types.TransitGatewayAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayAttachment - if *v == nil { - sv = make([]types.TransitGatewayAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentListUnwrapped(v *[]types.TransitGatewayAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayAttachment - if *v == nil { - sv = make([]types.TransitGatewayAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagation(v **types.TransitGatewayAttachmentPropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayAttachmentPropagation - if *v == nil { - sv = &types.TransitGatewayAttachmentPropagation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayPropagationState(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagationList(v *[]types.TransitGatewayAttachmentPropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayAttachmentPropagation - if *v == nil { - sv = make([]types.TransitGatewayAttachmentPropagation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayAttachmentPropagation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagationListUnwrapped(v *[]types.TransitGatewayAttachmentPropagation, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayAttachmentPropagation - if *v == nil { - sv = make([]types.TransitGatewayAttachmentPropagation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayAttachmentPropagation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayConnect(v **types.TransitGatewayConnect, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayConnect - if *v == nil { - sv = &types.TransitGatewayConnect{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAttachmentState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transportTransitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransportTransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectList(v *[]types.TransitGatewayConnect, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayConnect - if *v == nil { - sv = make([]types.TransitGatewayConnect, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayConnect - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayConnect(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectListUnwrapped(v *[]types.TransitGatewayConnect, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayConnect - if *v == nil { - sv = make([]types.TransitGatewayConnect, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayConnect - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayConnect(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayConnectOptions(v **types.TransitGatewayConnectOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayConnectOptions - if *v == nil { - sv = &types.TransitGatewayConnectOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.ProtocolValue(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectPeer(v **types.TransitGatewayConnectPeer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayConnectPeer - if *v == nil { - sv = &types.TransitGatewayConnectPeer{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connectPeerConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeerConfiguration(&sv.ConnectPeerConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayConnectPeerState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayConnectPeerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayConnectPeerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectPeerConfiguration(v **types.TransitGatewayConnectPeerConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayConnectPeerConfiguration - if *v == nil { - sv = &types.TransitGatewayConnectPeerConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bgpConfigurations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentBgpConfigurationList(&sv.BgpConfigurations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("insideCidrBlocks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInsideCidrBlocksStringList(&sv.InsideCidrBlocks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("peerAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerAddress = ptr.String(xtv) - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.ProtocolValue(xtv) - } - - case strings.EqualFold("transitGatewayAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectPeerList(v *[]types.TransitGatewayConnectPeer, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayConnectPeer - if *v == nil { - sv = make([]types.TransitGatewayConnectPeer, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayConnectPeer - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeer(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayConnectPeerListUnwrapped(v *[]types.TransitGatewayConnectPeer, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayConnectPeer - if *v == nil { - sv = make([]types.TransitGatewayConnectPeer, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayConnectPeer - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeer(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayList(v *[]types.TransitGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGateway - if *v == nil { - sv = make([]types.TransitGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayListUnwrapped(v *[]types.TransitGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGateway - if *v == nil { - sv = make([]types.TransitGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayMulticastDeregisteredGroupMembers(v **types.TransitGatewayMulticastDeregisteredGroupMembers, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDeregisteredGroupMembers - if *v == nil { - sv = &types.TransitGatewayMulticastDeregisteredGroupMembers{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deregisteredNetworkInterfaceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DeregisteredNetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("groupIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDeregisteredGroupSources(v **types.TransitGatewayMulticastDeregisteredGroupSources, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDeregisteredGroupSources - if *v == nil { - sv = &types.TransitGatewayMulticastDeregisteredGroupSources{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deregisteredNetworkInterfaceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.DeregisteredNetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("groupIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomain(v **types.TransitGatewayMulticastDomain, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDomain - if *v == nil { - sv = &types.TransitGatewayMulticastDomain{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayMulticastDomainState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomainArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainArn = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociation(v **types.TransitGatewayMulticastDomainAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDomainAssociation - if *v == nil { - sv = &types.TransitGatewayMulticastDomainAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("subnet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetAssociation(&sv.Subnet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociationList(v *[]types.TransitGatewayMulticastDomainAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayMulticastDomainAssociation - if *v == nil { - sv = make([]types.TransitGatewayMulticastDomainAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayMulticastDomainAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociationListUnwrapped(v *[]types.TransitGatewayMulticastDomainAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayMulticastDomainAssociation - if *v == nil { - sv = make([]types.TransitGatewayMulticastDomainAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayMulticastDomainAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociations(v **types.TransitGatewayMulticastDomainAssociations, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDomainAssociations - if *v == nil { - sv = &types.TransitGatewayMulticastDomainAssociations{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("subnets", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetAssociationList(&sv.Subnets, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainList(v *[]types.TransitGatewayMulticastDomain, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayMulticastDomain - if *v == nil { - sv = make([]types.TransitGatewayMulticastDomain, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayMulticastDomain - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomain(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainListUnwrapped(v *[]types.TransitGatewayMulticastDomain, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayMulticastDomain - if *v == nil { - sv = make([]types.TransitGatewayMulticastDomain, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayMulticastDomain - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomain(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayMulticastDomainOptions(v **types.TransitGatewayMulticastDomainOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastDomainOptions - if *v == nil { - sv = &types.TransitGatewayMulticastDomainOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoAcceptSharedAssociations", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoAcceptSharedAssociations = types.AutoAcceptSharedAssociationsValue(xtv) - } - - case strings.EqualFold("igmpv2Support", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Igmpv2Support = types.Igmpv2SupportValue(xtv) - } - - case strings.EqualFold("staticSourcesSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StaticSourcesSupport = types.StaticSourcesSupportValue(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastGroup(v **types.TransitGatewayMulticastGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastGroup - if *v == nil { - sv = &types.TransitGatewayMulticastGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("groupMember", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.GroupMember = ptr.Bool(xtv) - } - - case strings.EqualFold("groupSource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.GroupSource = ptr.Bool(xtv) - } - - case strings.EqualFold("memberType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MemberType = types.MembershipType(xtv) - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("sourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceType = types.MembershipType(xtv) - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastGroupList(v *[]types.TransitGatewayMulticastGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayMulticastGroup - if *v == nil { - sv = make([]types.TransitGatewayMulticastGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayMulticastGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastGroupListUnwrapped(v *[]types.TransitGatewayMulticastGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayMulticastGroup - if *v == nil { - sv = make([]types.TransitGatewayMulticastGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayMulticastGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayMulticastRegisteredGroupMembers(v **types.TransitGatewayMulticastRegisteredGroupMembers, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastRegisteredGroupMembers - if *v == nil { - sv = &types.TransitGatewayMulticastRegisteredGroupMembers{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("registeredNetworkInterfaceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.RegisteredNetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayMulticastRegisteredGroupSources(v **types.TransitGatewayMulticastRegisteredGroupSources, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayMulticastRegisteredGroupSources - if *v == nil { - sv = &types.TransitGatewayMulticastRegisteredGroupSources{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("registeredNetworkInterfaceIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.RegisteredNetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayMulticastDomainId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayMulticastDomainId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayOptions(v **types.TransitGatewayOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayOptions - if *v == nil { - sv = &types.TransitGatewayOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amazonSideAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AmazonSideAsn = ptr.Int64(i64) - } - - case strings.EqualFold("associationDefaultRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationDefaultRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("autoAcceptSharedAttachments", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoAcceptSharedAttachments = types.AutoAcceptSharedAttachmentsValue(xtv) - } - - case strings.EqualFold("defaultRouteTableAssociation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DefaultRouteTableAssociation = types.DefaultRouteTableAssociationValue(xtv) - } - - case strings.EqualFold("defaultRouteTablePropagation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DefaultRouteTablePropagation = types.DefaultRouteTablePropagationValue(xtv) - } - - case strings.EqualFold("dnsSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsSupport = types.DnsSupportValue(xtv) - } - - case strings.EqualFold("multicastSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MulticastSupport = types.MulticastSupportValue(xtv) - } - - case strings.EqualFold("propagationDefaultRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PropagationDefaultRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupReferencingSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupReferencingSupport = types.SecurityGroupReferencingSupportValue(xtv) - } - - case strings.EqualFold("transitGatewayCidrBlocks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.TransitGatewayCidrBlocks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpnEcmpSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnEcmpSupport = types.VpnEcmpSupportValue(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(v **types.TransitGatewayPeeringAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPeeringAttachment - if *v == nil { - sv = &types.TransitGatewayPeeringAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accepterTgwInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPeeringTgwInfo(&sv.AccepterTgwInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("accepterTransitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccepterTransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachmentOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("requesterTgwInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPeeringTgwInfo(&sv.RequesterTgwInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAttachmentState(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPeeringAttachmentStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPeeringAttachmentList(v *[]types.TransitGatewayPeeringAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayPeeringAttachment - if *v == nil { - sv = make([]types.TransitGatewayPeeringAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayPeeringAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPeeringAttachmentListUnwrapped(v *[]types.TransitGatewayPeeringAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayPeeringAttachment - if *v == nil { - sv = make([]types.TransitGatewayPeeringAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayPeeringAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayPeeringAttachmentOptions(v **types.TransitGatewayPeeringAttachmentOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPeeringAttachmentOptions - if *v == nil { - sv = &types.TransitGatewayPeeringAttachmentOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dynamicRouting", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DynamicRouting = types.DynamicRoutingValue(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyRule(v **types.TransitGatewayPolicyRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPolicyRule - if *v == nil { - sv = &types.TransitGatewayPolicyRule{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("destinationPortRange", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationPortRange = ptr.String(xtv) - } - - case strings.EqualFold("metaData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyRuleMetaData(&sv.MetaData, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("sourceCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("sourcePortRange", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourcePortRange = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyRuleMetaData(v **types.TransitGatewayPolicyRuleMetaData, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPolicyRuleMetaData - if *v == nil { - sv = &types.TransitGatewayPolicyRuleMetaData{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("metaDataKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MetaDataKey = ptr.String(xtv) - } - - case strings.EqualFold("metaDataValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MetaDataValue = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTable(v **types.TransitGatewayPolicyTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPolicyTable - if *v == nil { - sv = &types.TransitGatewayPolicyTable{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayPolicyTableState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayPolicyTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayPolicyTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociation(v **types.TransitGatewayPolicyTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPolicyTableAssociation - if *v == nil { - sv = &types.TransitGatewayPolicyTableAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAssociationState(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayPolicyTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayPolicyTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociationList(v *[]types.TransitGatewayPolicyTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayPolicyTableAssociation - if *v == nil { - sv = make([]types.TransitGatewayPolicyTableAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayPolicyTableAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociationListUnwrapped(v *[]types.TransitGatewayPolicyTableAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayPolicyTableAssociation - if *v == nil { - sv = make([]types.TransitGatewayPolicyTableAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayPolicyTableAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntry(v **types.TransitGatewayPolicyTableEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPolicyTableEntry - if *v == nil { - sv = &types.TransitGatewayPolicyTableEntry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("policyRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyRule(&sv.PolicyRule, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("policyRuleNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyRuleNumber = ptr.String(xtv) - } - - case strings.EqualFold("targetRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntryList(v *[]types.TransitGatewayPolicyTableEntry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayPolicyTableEntry - if *v == nil { - sv = make([]types.TransitGatewayPolicyTableEntry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayPolicyTableEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntryListUnwrapped(v *[]types.TransitGatewayPolicyTableEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayPolicyTableEntry - if *v == nil { - sv = make([]types.TransitGatewayPolicyTableEntry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayPolicyTableEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableList(v *[]types.TransitGatewayPolicyTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayPolicyTable - if *v == nil { - sv = make([]types.TransitGatewayPolicyTable, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayPolicyTable - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTable(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPolicyTableListUnwrapped(v *[]types.TransitGatewayPolicyTable, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayPolicyTable - if *v == nil { - sv = make([]types.TransitGatewayPolicyTable, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayPolicyTable - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTable(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayPrefixListAttachment(v **types.TransitGatewayPrefixListAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPrefixListAttachment - if *v == nil { - sv = &types.TransitGatewayPrefixListAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(v **types.TransitGatewayPrefixListReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPrefixListReference - if *v == nil { - sv = &types.TransitGatewayPrefixListReference{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blackhole", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Blackhole = ptr.Bool(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("prefixListOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListOwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayPrefixListReferenceState(xtv) - } - - case strings.EqualFold("transitGatewayAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListAttachment(&sv.TransitGatewayAttachment, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPrefixListReferenceSet(v *[]types.TransitGatewayPrefixListReference, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayPrefixListReference - if *v == nil { - sv = make([]types.TransitGatewayPrefixListReference, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayPrefixListReference - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayPrefixListReferenceSetUnwrapped(v *[]types.TransitGatewayPrefixListReference, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayPrefixListReference - if *v == nil { - sv = make([]types.TransitGatewayPrefixListReference, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayPrefixListReference - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayPropagation(v **types.TransitGatewayPropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayPropagation - if *v == nil { - sv = &types.TransitGatewayPropagation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayPropagationState(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableAnnouncementId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableAnnouncementId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRoute(v **types.TransitGatewayRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRoute - if *v == nil { - sv = &types.TransitGatewayRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayRouteState(xtv) - } - - case strings.EqualFold("transitGatewayAttachments", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteAttachmentList(&sv.TransitGatewayAttachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayRouteTableAnnouncementId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableAnnouncementId = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.TransitGatewayRouteType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteAttachment(v **types.TransitGatewayRouteAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteAttachment - if *v == nil { - sv = &types.TransitGatewayRouteAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteAttachmentList(v *[]types.TransitGatewayRouteAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRouteAttachment - if *v == nil { - sv = make([]types.TransitGatewayRouteAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRouteAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRouteAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteAttachmentListUnwrapped(v *[]types.TransitGatewayRouteAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRouteAttachment - if *v == nil { - sv = make([]types.TransitGatewayRouteAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRouteAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRouteAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteList(v *[]types.TransitGatewayRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRoute - if *v == nil { - sv = make([]types.TransitGatewayRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteListUnwrapped(v *[]types.TransitGatewayRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRoute - if *v == nil { - sv = make([]types.TransitGatewayRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteTable(v **types.TransitGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteTable - if *v == nil { - sv = &types.TransitGatewayRouteTable{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("defaultAssociationRouteTable", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DefaultAssociationRouteTable = ptr.Bool(xtv) - } - - case strings.EqualFold("defaultPropagationRouteTable", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DefaultPropagationRouteTable = ptr.Bool(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayRouteTableState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncement(v **types.TransitGatewayRouteTableAnnouncement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteTableAnnouncement - if *v == nil { - sv = &types.TransitGatewayRouteTableAnnouncement{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("announcementDirection", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AnnouncementDirection = types.TransitGatewayRouteTableAnnouncementDirection(xtv) - } - - case strings.EqualFold("coreNetworkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkId = ptr.String(xtv) - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("peerCoreNetworkId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerCoreNetworkId = ptr.String(xtv) - } - - case strings.EqualFold("peeringAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeeringAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("peerTransitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeerTransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayRouteTableAnnouncementState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableAnnouncementId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableAnnouncementId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncementList(v *[]types.TransitGatewayRouteTableAnnouncement, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRouteTableAnnouncement - if *v == nil { - sv = make([]types.TransitGatewayRouteTableAnnouncement, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRouteTableAnnouncement - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncement(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncementListUnwrapped(v *[]types.TransitGatewayRouteTableAnnouncement, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRouteTableAnnouncement - if *v == nil { - sv = make([]types.TransitGatewayRouteTableAnnouncement, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRouteTableAnnouncement - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncement(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociation(v **types.TransitGatewayRouteTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteTableAssociation - if *v == nil { - sv = &types.TransitGatewayRouteTableAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAssociationState(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociationList(v *[]types.TransitGatewayRouteTableAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRouteTableAssociation - if *v == nil { - sv = make([]types.TransitGatewayRouteTableAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRouteTableAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociationListUnwrapped(v *[]types.TransitGatewayRouteTableAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRouteTableAssociation - if *v == nil { - sv = make([]types.TransitGatewayRouteTableAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRouteTableAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteTableList(v *[]types.TransitGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRouteTable - if *v == nil { - sv = make([]types.TransitGatewayRouteTable, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRouteTable - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTableListUnwrapped(v *[]types.TransitGatewayRouteTable, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRouteTable - if *v == nil { - sv = make([]types.TransitGatewayRouteTable, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRouteTable - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTable(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagation(v **types.TransitGatewayRouteTablePropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteTablePropagation - if *v == nil { - sv = &types.TransitGatewayRouteTablePropagation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.TransitGatewayAttachmentResourceType(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayPropagationState(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableAnnouncementId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayRouteTableAnnouncementId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagationList(v *[]types.TransitGatewayRouteTablePropagation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayRouteTablePropagation - if *v == nil { - sv = make([]types.TransitGatewayRouteTablePropagation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayRouteTablePropagation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagationListUnwrapped(v *[]types.TransitGatewayRouteTablePropagation, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayRouteTablePropagation - if *v == nil { - sv = make([]types.TransitGatewayRouteTablePropagation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayRouteTablePropagation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayRouteTableRoute(v **types.TransitGatewayRouteTableRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayRouteTableRoute - if *v == nil { - sv = &types.TransitGatewayRouteTableRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("destinationCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidr = ptr.String(xtv) - } - - case strings.EqualFold("prefixListId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PrefixListId = ptr.String(xtv) - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = ptr.String(xtv) - } - - case strings.EqualFold("routeOrigin", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RouteOrigin = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(v **types.TransitGatewayVpcAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayVpcAttachment - if *v == nil { - sv = &types.TransitGatewayVpcAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTime = ptr.Time(t) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachmentOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.TransitGatewayAttachmentState(xtv) - } - - case strings.EqualFold("subnetIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SubnetIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - case strings.EqualFold("vpcOwnerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcOwnerId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayVpcAttachmentList(v *[]types.TransitGatewayVpcAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TransitGatewayVpcAttachment - if *v == nil { - sv = make([]types.TransitGatewayVpcAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TransitGatewayVpcAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTransitGatewayVpcAttachmentListUnwrapped(v *[]types.TransitGatewayVpcAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.TransitGatewayVpcAttachment - if *v == nil { - sv = make([]types.TransitGatewayVpcAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TransitGatewayVpcAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTransitGatewayVpcAttachmentOptions(v **types.TransitGatewayVpcAttachmentOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TransitGatewayVpcAttachmentOptions - if *v == nil { - sv = &types.TransitGatewayVpcAttachmentOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("applianceModeSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ApplianceModeSupport = types.ApplianceModeSupportValue(xtv) - } - - case strings.EqualFold("dnsSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsSupport = types.DnsSupportValue(xtv) - } - - case strings.EqualFold("ipv6Support", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Support = types.Ipv6SupportValue(xtv) - } - - case strings.EqualFold("securityGroupReferencingSupport", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupReferencingSupport = types.SecurityGroupReferencingSupportValue(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrunkInterfaceAssociation(v **types.TrunkInterfaceAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TrunkInterfaceAssociation - if *v == nil { - sv = &types.TrunkInterfaceAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("branchInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BranchInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("greKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.GreKey = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("interfaceProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InterfaceProtocol = types.InterfaceProtocolType(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trunkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrunkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("vlanId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VlanId = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrunkInterfaceAssociationList(v *[]types.TrunkInterfaceAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TrunkInterfaceAssociation - if *v == nil { - sv = make([]types.TrunkInterfaceAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TrunkInterfaceAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTrunkInterfaceAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTrunkInterfaceAssociationListUnwrapped(v *[]types.TrunkInterfaceAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.TrunkInterfaceAssociation - if *v == nil { - sv = make([]types.TrunkInterfaceAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TrunkInterfaceAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTrunkInterfaceAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentTunnelOption(v **types.TunnelOption, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TunnelOption - if *v == nil { - sv = &types.TunnelOption{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dpdTimeoutAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DpdTimeoutAction = ptr.String(xtv) - } - - case strings.EqualFold("dpdTimeoutSeconds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DpdTimeoutSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("enableTunnelLifecycleControl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableTunnelLifecycleControl = ptr.Bool(xtv) - } - - case strings.EqualFold("ikeVersionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIKEVersionsList(&sv.IkeVersions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("logOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnTunnelLogOptions(&sv.LogOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outsideIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutsideIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("phase1DHGroupNumberSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase1DHGroupNumbersList(&sv.Phase1DHGroupNumbers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase1EncryptionAlgorithmSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase1EncryptionAlgorithmsList(&sv.Phase1EncryptionAlgorithms, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase1IntegrityAlgorithmSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase1IntegrityAlgorithmsList(&sv.Phase1IntegrityAlgorithms, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase1LifetimeSeconds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Phase1LifetimeSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("phase2DHGroupNumberSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase2DHGroupNumbersList(&sv.Phase2DHGroupNumbers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase2EncryptionAlgorithmSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase2EncryptionAlgorithmsList(&sv.Phase2EncryptionAlgorithms, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase2IntegrityAlgorithmSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPhase2IntegrityAlgorithmsList(&sv.Phase2IntegrityAlgorithms, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("phase2LifetimeSeconds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Phase2LifetimeSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("preSharedKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreSharedKey = ptr.String(xtv) - } - - case strings.EqualFold("rekeyFuzzPercentage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RekeyFuzzPercentage = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("rekeyMarginTimeSeconds", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RekeyMarginTimeSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("replayWindowSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ReplayWindowSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("startupAction", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StartupAction = ptr.String(xtv) - } - - case strings.EqualFold("tunnelInsideCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TunnelInsideCidr = ptr.String(xtv) - } - - case strings.EqualFold("tunnelInsideIpv6Cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TunnelInsideIpv6Cidr = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTunnelOptionsList(v *[]types.TunnelOption, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.TunnelOption - if *v == nil { - sv = make([]types.TunnelOption, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.TunnelOption - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentTunnelOption(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentTunnelOptionsListUnwrapped(v *[]types.TunnelOption, decoder smithyxml.NodeDecoder) error { - var sv []types.TunnelOption - if *v == nil { - sv = make([]types.TunnelOption, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TunnelOption - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentTunnelOption(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationItem(v **types.UnsuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UnsuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = &types.UnsuccessfulInstanceCreditSpecificationItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationItemError(&sv.Error, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationItemError(v **types.UnsuccessfulInstanceCreditSpecificationItemError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UnsuccessfulInstanceCreditSpecificationItemError - if *v == nil { - sv = &types.UnsuccessfulInstanceCreditSpecificationItemError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.UnsuccessfulInstanceCreditSpecificationErrorCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationSet(v *[]types.UnsuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UnsuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = make([]types.UnsuccessfulInstanceCreditSpecificationItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UnsuccessfulInstanceCreditSpecificationItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationSetUnwrapped(v *[]types.UnsuccessfulInstanceCreditSpecificationItem, decoder smithyxml.NodeDecoder) error { - var sv []types.UnsuccessfulInstanceCreditSpecificationItem - if *v == nil { - sv = make([]types.UnsuccessfulInstanceCreditSpecificationItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UnsuccessfulInstanceCreditSpecificationItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUnsuccessfulItem(v **types.UnsuccessfulItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UnsuccessfulItem - if *v == nil { - sv = &types.UnsuccessfulItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("error", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemError(&sv.Error, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulItemError(v **types.UnsuccessfulItemError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UnsuccessfulItemError - if *v == nil { - sv = &types.UnsuccessfulItemError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulItemList(v *[]types.UnsuccessfulItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UnsuccessfulItem - if *v == nil { - sv = make([]types.UnsuccessfulItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UnsuccessfulItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentUnsuccessfulItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulItemListUnwrapped(v *[]types.UnsuccessfulItem, decoder smithyxml.NodeDecoder) error { - var sv []types.UnsuccessfulItem - if *v == nil { - sv = make([]types.UnsuccessfulItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UnsuccessfulItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentUnsuccessfulItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUnsuccessfulItemSet(v *[]types.UnsuccessfulItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UnsuccessfulItem - if *v == nil { - sv = make([]types.UnsuccessfulItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UnsuccessfulItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentUnsuccessfulItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUnsuccessfulItemSetUnwrapped(v *[]types.UnsuccessfulItem, decoder smithyxml.NodeDecoder) error { - var sv []types.UnsuccessfulItem - if *v == nil { - sv = make([]types.UnsuccessfulItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UnsuccessfulItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentUnsuccessfulItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUsageClassTypeList(v *[]types.UsageClassType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UsageClassType - if *v == nil { - sv = make([]types.UsageClassType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UsageClassType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.UsageClassType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUsageClassTypeListUnwrapped(v *[]types.UsageClassType, decoder smithyxml.NodeDecoder) error { - var sv []types.UsageClassType - if *v == nil { - sv = make([]types.UsageClassType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UsageClassType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.UsageClassType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUserBucketDetails(v **types.UserBucketDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UserBucketDetails - if *v == nil { - sv = &types.UserBucketDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("s3Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Bucket = ptr.String(xtv) - } - - case strings.EqualFold("s3Key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Key = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUserIdGroupPair(v **types.UserIdGroupPair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.UserIdGroupPair - if *v == nil { - sv = &types.UserIdGroupPair{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("groupName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupName = ptr.String(xtv) - } - - case strings.EqualFold("peeringStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PeeringStatus = ptr.String(xtv) - } - - case strings.EqualFold("userId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUserIdGroupPairList(v *[]types.UserIdGroupPair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UserIdGroupPair - if *v == nil { - sv = make([]types.UserIdGroupPair, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UserIdGroupPair - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentUserIdGroupPair(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUserIdGroupPairListUnwrapped(v *[]types.UserIdGroupPair, decoder smithyxml.NodeDecoder) error { - var sv []types.UserIdGroupPair - if *v == nil { - sv = make([]types.UserIdGroupPair, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UserIdGroupPair - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentUserIdGroupPair(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentUserIdGroupPairSet(v *[]types.UserIdGroupPair, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.UserIdGroupPair - if *v == nil { - sv = make([]types.UserIdGroupPair, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.UserIdGroupPair - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentUserIdGroupPair(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentUserIdGroupPairSetUnwrapped(v *[]types.UserIdGroupPair, decoder smithyxml.NodeDecoder) error { - var sv []types.UserIdGroupPair - if *v == nil { - sv = make([]types.UserIdGroupPair, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.UserIdGroupPair - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentUserIdGroupPair(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentValidationError(v **types.ValidationError, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ValidationError - if *v == nil { - sv = &types.ValidationError{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentValidationWarning(v **types.ValidationWarning, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ValidationWarning - if *v == nil { - sv = &types.ValidationWarning{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("errorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentErrorSet(&sv.Errors, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentValueStringList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentValueStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVCpuCountRange(v **types.VCpuCountRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VCpuCountRange - if *v == nil { - sv = &types.VCpuCountRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Max = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("min", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Min = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVCpuInfo(v **types.VCpuInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VCpuInfo - if *v == nil { - sv = &types.VCpuInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("defaultCores", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultCores = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("defaultThreadsPerCore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultThreadsPerCore = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("defaultVCpus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DefaultVCpus = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("validCores", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoreCountList(&sv.ValidCores, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("validThreadsPerCore", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentThreadsPerCoreList(&sv.ValidThreadsPerCore, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpoint(v **types.VerifiedAccessEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpoint - if *v == nil { - sv = &types.VerifiedAccessEndpoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("applicationDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ApplicationDomain = ptr.String(xtv) - } - - case strings.EqualFold("attachmentType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttachmentType = types.VerifiedAccessEndpointAttachmentType(xtv) - } - - case strings.EqualFold("cidrOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointCidrOptions(&sv.CidrOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationTime = ptr.String(xtv) - } - - case strings.EqualFold("deletionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeletionTime = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceValidationDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceValidationDomain = ptr.String(xtv) - } - - case strings.EqualFold("domainCertificateArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DomainCertificateArn = ptr.String(xtv) - } - - case strings.EqualFold("endpointDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndpointDomain = ptr.String(xtv) - } - - case strings.EqualFold("endpointType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EndpointType = types.VerifiedAccessEndpointType(xtv) - } - - case strings.EqualFold("lastUpdatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastUpdatedTime = ptr.String(xtv) - } - - case strings.EqualFold("loadBalancerOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointLoadBalancerOptions(&sv.LoadBalancerOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointEniOptions(&sv.NetworkInterfaceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("rdsOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointRdsOptions(&sv.RdsOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("securityGroupIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sseSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(&sv.SseSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessGroupId = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessInstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointCidrOptions(v **types.VerifiedAccessEndpointCidrOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointCidrOptions - if *v == nil { - sv = &types.VerifiedAccessEndpointCidrOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("portRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRangeList(&sv.PortRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.VerifiedAccessEndpointProtocol(xtv) - } - - case strings.EqualFold("subnetIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointSubnetIdList(&sv.SubnetIds, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointEniOptions(v **types.VerifiedAccessEndpointEniOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointEniOptions - if *v == nil { - sv = &types.VerifiedAccessEndpointEniOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("port", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("portRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRangeList(&sv.PortRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.VerifiedAccessEndpointProtocol(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointList(v *[]types.VerifiedAccessEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessEndpoint - if *v == nil { - sv = make([]types.VerifiedAccessEndpoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessEndpoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointListUnwrapped(v *[]types.VerifiedAccessEndpoint, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessEndpoint - if *v == nil { - sv = make([]types.VerifiedAccessEndpoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessEndpoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessEndpointLoadBalancerOptions(v **types.VerifiedAccessEndpointLoadBalancerOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointLoadBalancerOptions - if *v == nil { - sv = &types.VerifiedAccessEndpointLoadBalancerOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("loadBalancerArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LoadBalancerArn = ptr.String(xtv) - } - - case strings.EqualFold("port", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("portRangeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRangeList(&sv.PortRanges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.VerifiedAccessEndpointProtocol(xtv) - } - - case strings.EqualFold("subnetIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointSubnetIdList(&sv.SubnetIds, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRange(v **types.VerifiedAccessEndpointPortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointPortRange - if *v == nil { - sv = &types.VerifiedAccessEndpointPortRange{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fromPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FromPort = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("toPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ToPort = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRangeList(v *[]types.VerifiedAccessEndpointPortRange, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessEndpointPortRange - if *v == nil { - sv = make([]types.VerifiedAccessEndpointPortRange, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessEndpointPortRange - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRange(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRangeListUnwrapped(v *[]types.VerifiedAccessEndpointPortRange, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessEndpointPortRange - if *v == nil { - sv = make([]types.VerifiedAccessEndpointPortRange, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessEndpointPortRange - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointPortRange(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessEndpointRdsOptions(v **types.VerifiedAccessEndpointRdsOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointRdsOptions - if *v == nil { - sv = &types.VerifiedAccessEndpointRdsOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("port", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.VerifiedAccessEndpointProtocol(xtv) - } - - case strings.EqualFold("rdsDbClusterArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RdsDbClusterArn = ptr.String(xtv) - } - - case strings.EqualFold("rdsDbInstanceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RdsDbInstanceArn = ptr.String(xtv) - } - - case strings.EqualFold("rdsDbProxyArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RdsDbProxyArn = ptr.String(xtv) - } - - case strings.EqualFold("rdsEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RdsEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("subnetIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointSubnetIdList(&sv.SubnetIds, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointStatus(v **types.VerifiedAccessEndpointStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointStatus - if *v == nil { - sv = &types.VerifiedAccessEndpointStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.VerifiedAccessEndpointStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointSubnetIdList(v *[]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointSubnetIdListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessEndpointTarget(v **types.VerifiedAccessEndpointTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessEndpointTarget - if *v == nil { - sv = &types.VerifiedAccessEndpointTarget{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessEndpointTargetDns", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessEndpointTargetDns = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessEndpointTargetIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessEndpointTargetIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointTargetList(v *[]types.VerifiedAccessEndpointTarget, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessEndpointTarget - if *v == nil { - sv = make([]types.VerifiedAccessEndpointTarget, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessEndpointTarget - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointTarget(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessEndpointTargetListUnwrapped(v *[]types.VerifiedAccessEndpointTarget, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessEndpointTarget - if *v == nil { - sv = make([]types.VerifiedAccessEndpointTarget, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessEndpointTarget - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointTarget(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessGroup(v **types.VerifiedAccessGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessGroup - if *v == nil { - sv = &types.VerifiedAccessGroup{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationTime = ptr.String(xtv) - } - - case strings.EqualFold("deletionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeletionTime = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("lastUpdatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastUpdatedTime = ptr.String(xtv) - } - - case strings.EqualFold("owner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Owner = ptr.String(xtv) - } - - case strings.EqualFold("sseSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(&sv.SseSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessGroupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessGroupId = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessInstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessGroupList(v *[]types.VerifiedAccessGroup, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessGroup - if *v == nil { - sv = make([]types.VerifiedAccessGroup, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessGroup - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessGroup(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessGroupListUnwrapped(v *[]types.VerifiedAccessGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessGroup - if *v == nil { - sv = make([]types.VerifiedAccessGroup, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessGroup - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessGroup(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessInstance(v **types.VerifiedAccessInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstance - if *v == nil { - sv = &types.VerifiedAccessInstance{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrEndpointsCustomSubDomain", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceCustomSubDomain(&sv.CidrEndpointsCustomSubDomain, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationTime = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("fipsEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.FipsEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("lastUpdatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastUpdatedTime = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessInstanceId = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessTrustProviderSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensedList(&sv.VerifiedAccessTrustProviders, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceCustomSubDomain(v **types.VerifiedAccessInstanceCustomSubDomain, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstanceCustomSubDomain - if *v == nil { - sv = &types.VerifiedAccessInstanceCustomSubDomain{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nameserverSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.Nameservers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subDomain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubDomain = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceList(v *[]types.VerifiedAccessInstance, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessInstance - if *v == nil { - sv = make([]types.VerifiedAccessInstance, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessInstance - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceListUnwrapped(v *[]types.VerifiedAccessInstance, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessInstance - if *v == nil { - sv = make([]types.VerifiedAccessInstance, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessInstance - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfiguration(v **types.VerifiedAccessInstanceLoggingConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstanceLoggingConfiguration - if *v == nil { - sv = &types.VerifiedAccessInstanceLoggingConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accessLogs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogs(&sv.AccessLogs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessInstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfigurationList(v *[]types.VerifiedAccessInstanceLoggingConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessInstanceLoggingConfiguration - if *v == nil { - sv = make([]types.VerifiedAccessInstanceLoggingConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessInstanceLoggingConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfigurationListUnwrapped(v *[]types.VerifiedAccessInstanceLoggingConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessInstanceLoggingConfiguration - if *v == nil { - sv = make([]types.VerifiedAccessInstanceLoggingConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessInstanceLoggingConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfiguration(v **types.VerifiedAccessInstanceOpenVpnClientConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstanceOpenVpnClientConfiguration - if *v == nil { - sv = &types.VerifiedAccessInstanceOpenVpnClientConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("config", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Config = ptr.String(xtv) - } - - case strings.EqualFold("routeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationList(v *[]types.VerifiedAccessInstanceOpenVpnClientConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessInstanceOpenVpnClientConfiguration - if *v == nil { - sv = make([]types.VerifiedAccessInstanceOpenVpnClientConfiguration, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessInstanceOpenVpnClientConfiguration - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationListUnwrapped(v *[]types.VerifiedAccessInstanceOpenVpnClientConfiguration, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessInstanceOpenVpnClientConfiguration - if *v == nil { - sv = make([]types.VerifiedAccessInstanceOpenVpnClientConfiguration, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessInstanceOpenVpnClientConfiguration - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfiguration(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRoute(v **types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute - if *v == nil { - sv = &types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRouteList(v *[]types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute - if *v == nil { - sv = make([]types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRouteListUnwrapped(v *[]types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute - if *v == nil { - sv = make([]types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessInstanceOpenVpnClientConfigurationRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessInstanceUserTrustProviderClientConfiguration(v **types.VerifiedAccessInstanceUserTrustProviderClientConfiguration, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessInstanceUserTrustProviderClientConfiguration - if *v == nil { - sv = &types.VerifiedAccessInstanceUserTrustProviderClientConfiguration{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("authorizationEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AuthorizationEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("clientId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientId = ptr.String(xtv) - } - - case strings.EqualFold("clientSecret", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientSecret = ptr.String(xtv) - } - - case strings.EqualFold("issuer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Issuer = ptr.String(xtv) - } - - case strings.EqualFold("pkceEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PkceEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("publicSigningKeyEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicSigningKeyEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("scopes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scopes = ptr.String(xtv) - } - - case strings.EqualFold("tokenEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TokenEndpoint = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.UserTrustProviderType(xtv) - } - - case strings.EqualFold("userInfoEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserInfoEndpoint = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessLogCloudWatchLogsDestination(v **types.VerifiedAccessLogCloudWatchLogsDestination, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessLogCloudWatchLogsDestination - if *v == nil { - sv = &types.VerifiedAccessLogCloudWatchLogsDestination{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deliveryStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogDeliveryStatus(&sv.DeliveryStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - case strings.EqualFold("logGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogGroup = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessLogDeliveryStatus(v **types.VerifiedAccessLogDeliveryStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessLogDeliveryStatus - if *v == nil { - sv = &types.VerifiedAccessLogDeliveryStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.VerifiedAccessLogDeliveryStatusCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessLogKinesisDataFirehoseDestination(v **types.VerifiedAccessLogKinesisDataFirehoseDestination, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessLogKinesisDataFirehoseDestination - if *v == nil { - sv = &types.VerifiedAccessLogKinesisDataFirehoseDestination{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deliveryStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogDeliveryStatus(&sv.DeliveryStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("deliveryStream", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeliveryStream = ptr.String(xtv) - } - - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessLogs(v **types.VerifiedAccessLogs, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessLogs - if *v == nil { - sv = &types.VerifiedAccessLogs{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cloudWatchLogs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogCloudWatchLogsDestination(&sv.CloudWatchLogs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("includeTrustContext", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IncludeTrustContext = ptr.Bool(xtv) - } - - case strings.EqualFold("kinesisDataFirehose", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogKinesisDataFirehoseDestination(&sv.KinesisDataFirehose, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("logVersion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LogVersion = ptr.String(xtv) - } - - case strings.EqualFold("s3", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogS3Destination(&sv.S3, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessLogS3Destination(v **types.VerifiedAccessLogS3Destination, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessLogS3Destination - if *v == nil { - sv = &types.VerifiedAccessLogS3Destination{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bucketName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BucketName = ptr.String(xtv) - } - - case strings.EqualFold("bucketOwner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BucketOwner = ptr.String(xtv) - } - - case strings.EqualFold("deliveryStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessLogDeliveryStatus(&sv.DeliveryStatus, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) - } - - case strings.EqualFold("prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Prefix = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(v **types.VerifiedAccessSseSpecificationResponse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessSseSpecificationResponse - if *v == nil { - sv = &types.VerifiedAccessSseSpecificationResponse{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("customerManagedKeyEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.CustomerManagedKeyEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("kmsKeyArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(v **types.VerifiedAccessTrustProvider, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessTrustProvider - if *v == nil { - sv = &types.VerifiedAccessTrustProvider{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CreationTime = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeviceOptions(&sv.DeviceOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("deviceTrustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceTrustProviderType = types.DeviceTrustProviderType(xtv) - } - - case strings.EqualFold("lastUpdatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LastUpdatedTime = ptr.String(xtv) - } - - case strings.EqualFold("nativeApplicationOidcOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNativeApplicationOidcOptions(&sv.NativeApplicationOidcOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("oidcOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOidcOptions(&sv.OidcOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("policyReferenceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyReferenceName = ptr.String(xtv) - } - - case strings.EqualFold("sseSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(&sv.SseSpecification, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("trustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrustProviderType = types.TrustProviderType(xtv) - } - - case strings.EqualFold("userTrustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserTrustProviderType = types.UserTrustProviderType(xtv) - } - - case strings.EqualFold("verifiedAccessTrustProviderId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessTrustProviderId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensed(v **types.VerifiedAccessTrustProviderCondensed, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VerifiedAccessTrustProviderCondensed - if *v == nil { - sv = &types.VerifiedAccessTrustProviderCondensed{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("deviceTrustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DeviceTrustProviderType = types.DeviceTrustProviderType(xtv) - } - - case strings.EqualFold("trustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrustProviderType = types.TrustProviderType(xtv) - } - - case strings.EqualFold("userTrustProviderType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserTrustProviderType = types.UserTrustProviderType(xtv) - } - - case strings.EqualFold("verifiedAccessTrustProviderId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessTrustProviderId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensedList(v *[]types.VerifiedAccessTrustProviderCondensed, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessTrustProviderCondensed - if *v == nil { - sv = make([]types.VerifiedAccessTrustProviderCondensed, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessTrustProviderCondensed - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensed(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensedListUnwrapped(v *[]types.VerifiedAccessTrustProviderCondensed, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessTrustProviderCondensed - if *v == nil { - sv = make([]types.VerifiedAccessTrustProviderCondensed, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessTrustProviderCondensed - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProviderCondensed(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVerifiedAccessTrustProviderList(v *[]types.VerifiedAccessTrustProvider, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VerifiedAccessTrustProvider - if *v == nil { - sv = make([]types.VerifiedAccessTrustProvider, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VerifiedAccessTrustProvider - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVerifiedAccessTrustProviderListUnwrapped(v *[]types.VerifiedAccessTrustProvider, decoder smithyxml.NodeDecoder) error { - var sv []types.VerifiedAccessTrustProvider - if *v == nil { - sv = make([]types.VerifiedAccessTrustProvider, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VerifiedAccessTrustProvider - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVgwTelemetry(v **types.VgwTelemetry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VgwTelemetry - if *v == nil { - sv = &types.VgwTelemetry{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("acceptedRouteCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AcceptedRouteCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("certificateArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateArn = ptr.String(xtv) - } - - case strings.EqualFold("lastStatusChange", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastStatusChange = ptr.Time(t) - } - - case strings.EqualFold("outsideIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutsideIpAddress = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.TelemetryStatus(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVgwTelemetryList(v *[]types.VgwTelemetry, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VgwTelemetry - if *v == nil { - sv = make([]types.VgwTelemetry, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VgwTelemetry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVgwTelemetry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVgwTelemetryListUnwrapped(v *[]types.VgwTelemetry, decoder smithyxml.NodeDecoder) error { - var sv []types.VgwTelemetry - if *v == nil { - sv = make([]types.VgwTelemetry, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VgwTelemetry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVgwTelemetry(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVirtualizationTypeList(v *[]types.VirtualizationType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VirtualizationType - if *v == nil { - sv = make([]types.VirtualizationType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VirtualizationType - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = types.VirtualizationType(xtv) - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVirtualizationTypeListUnwrapped(v *[]types.VirtualizationType, decoder smithyxml.NodeDecoder) error { - var sv []types.VirtualizationType - if *v == nil { - sv = make([]types.VirtualizationType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VirtualizationType - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.VirtualizationType(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolume(v **types.Volume, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Volume - if *v == nil { - sv = &types.Volume{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeAttachmentList(&sv.Attachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("fastRestored", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.FastRestored = ptr.Bool(xtv) - } - - case strings.EqualFold("iops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Iops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("multiAttachEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.MultiAttachEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("size", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Size = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VolumeState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("throughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeInitializationRate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeInitializationRate = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeType = types.VolumeType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeAttachment(v **types.VolumeAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeAttachment - if *v == nil { - sv = &types.VolumeAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResource = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("device", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Device = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceOwningService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceOwningService = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VolumeAttachmentState(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeAttachmentList(v *[]types.VolumeAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeAttachment - if *v == nil { - sv = make([]types.VolumeAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeAttachmentListUnwrapped(v *[]types.VolumeAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeAttachment - if *v == nil { - sv = make([]types.VolumeAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeList(v *[]types.Volume, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Volume - if *v == nil { - sv = make([]types.Volume, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Volume - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolume(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeListUnwrapped(v *[]types.Volume, decoder smithyxml.NodeDecoder) error { - var sv []types.Volume - if *v == nil { - sv = make([]types.Volume, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Volume - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolume(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeModification(v **types.VolumeModification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeModification - if *v == nil { - sv = &types.VolumeModification{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("endTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndTime = ptr.Time(t) - } - - case strings.EqualFold("modificationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ModificationState = types.VolumeModificationState(xtv) - } - - case strings.EqualFold("originalIops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OriginalIops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("originalMultiAttachEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.OriginalMultiAttachEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("originalSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OriginalSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("originalThroughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.OriginalThroughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("originalVolumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OriginalVolumeType = types.VolumeType(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Progress = ptr.Int64(i64) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("targetIops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TargetIops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("targetMultiAttachEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.TargetMultiAttachEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("targetSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TargetSize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("targetThroughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TargetThroughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("targetVolumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetVolumeType = types.VolumeType(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeModificationList(v *[]types.VolumeModification, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeModification - if *v == nil { - sv = make([]types.VolumeModification, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeModification - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeModification(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeModificationListUnwrapped(v *[]types.VolumeModification, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeModification - if *v == nil { - sv = make([]types.VolumeModification, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeModification - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeModification(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeStatusAction(v **types.VolumeStatusAction, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusAction - if *v == nil { - sv = &types.VolumeStatusAction{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("eventId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventId = ptr.String(xtv) - } - - case strings.EqualFold("eventType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusActionsList(v *[]types.VolumeStatusAction, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeStatusAction - if *v == nil { - sv = make([]types.VolumeStatusAction, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeStatusAction - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeStatusAction(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusActionsListUnwrapped(v *[]types.VolumeStatusAction, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeStatusAction - if *v == nil { - sv = make([]types.VolumeStatusAction, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeStatusAction - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeStatusAction(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeStatusAttachmentStatus(v **types.VolumeStatusAttachmentStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusAttachmentStatus - if *v == nil { - sv = &types.VolumeStatusAttachmentStatus{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("ioPerformance", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IoPerformance = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusAttachmentStatusList(v *[]types.VolumeStatusAttachmentStatus, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeStatusAttachmentStatus - if *v == nil { - sv = make([]types.VolumeStatusAttachmentStatus, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeStatusAttachmentStatus - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeStatusAttachmentStatus(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusAttachmentStatusListUnwrapped(v *[]types.VolumeStatusAttachmentStatus, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeStatusAttachmentStatus - if *v == nil { - sv = make([]types.VolumeStatusAttachmentStatus, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeStatusAttachmentStatus - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeStatusAttachmentStatus(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeStatusDetails(v **types.VolumeStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusDetails - if *v == nil { - sv = &types.VolumeStatusDetails{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = types.VolumeStatusName(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusDetailsList(v *[]types.VolumeStatusDetails, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeStatusDetails - if *v == nil { - sv = make([]types.VolumeStatusDetails, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeStatusDetails - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusDetailsListUnwrapped(v *[]types.VolumeStatusDetails, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeStatusDetails - if *v == nil { - sv = make([]types.VolumeStatusDetails, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeStatusDetails - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeStatusDetails(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeStatusEvent(v **types.VolumeStatusEvent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusEvent - if *v == nil { - sv = &types.VolumeStatusEvent{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("eventId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventId = ptr.String(xtv) - } - - case strings.EqualFold("eventType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EventType = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("notAfter", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotAfter = ptr.Time(t) - } - - case strings.EqualFold("notBefore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.NotBefore = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusEventsList(v *[]types.VolumeStatusEvent, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeStatusEvent - if *v == nil { - sv = make([]types.VolumeStatusEvent, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeStatusEvent - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeStatusEvent(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusEventsListUnwrapped(v *[]types.VolumeStatusEvent, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeStatusEvent - if *v == nil { - sv = make([]types.VolumeStatusEvent, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeStatusEvent - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeStatusEvent(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVolumeStatusInfo(v **types.VolumeStatusInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusInfo - if *v == nil { - sv = &types.VolumeStatusInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("details", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusDetailsList(&sv.Details, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.VolumeStatusInfoStatus(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusItem(v **types.VolumeStatusItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VolumeStatusItem - if *v == nil { - sv = &types.VolumeStatusItem{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("actionsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusActionsList(&sv.Actions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("attachmentStatuses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusAttachmentStatusList(&sv.AttachmentStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("availabilityZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZoneId = ptr.String(xtv) - } - - case strings.EqualFold("eventsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusEventsList(&sv.Events, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("initializationStatusDetails", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInitializationStatusDetails(&sv.InitializationStatusDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusInfo(&sv.VolumeStatus, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusList(v *[]types.VolumeStatusItem, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VolumeStatusItem - if *v == nil { - sv = make([]types.VolumeStatusItem, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VolumeStatusItem - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVolumeStatusItem(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVolumeStatusListUnwrapped(v *[]types.VolumeStatusItem, decoder smithyxml.NodeDecoder) error { - var sv []types.VolumeStatusItem - if *v == nil { - sv = make([]types.VolumeStatusItem, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VolumeStatusItem - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVolumeStatusItem(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpc(v **types.Vpc, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Vpc - if *v == nil { - sv = &types.Vpc{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blockPublicAccessStates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockPublicAccessStates(&sv.BlockPublicAccessStates, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("cidrBlockAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcCidrBlockAssociationSet(&sv.CidrBlockAssociationSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("dhcpOptionsId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DhcpOptionsId = ptr.String(xtv) - } - - case strings.EqualFold("encryptionControl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControl(&sv.EncryptionControl, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceTenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceTenancy = types.Tenancy(xtv) - } - - case strings.EqualFold("ipv6CidrBlockAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociationSet(&sv.Ipv6CidrBlockAssociationSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("isDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcAttachment(v **types.VpcAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcAttachment - if *v == nil { - sv = &types.VpcAttachment{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.AttachmentStatus(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcAttachmentList(v *[]types.VpcAttachment, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcAttachment - if *v == nil { - sv = make([]types.VpcAttachment, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcAttachment - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcAttachmentListUnwrapped(v *[]types.VpcAttachment, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcAttachment - if *v == nil { - sv = make([]types.VpcAttachment, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcAttachment - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcAttachment(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(v **types.VpcBlockPublicAccessExclusion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcBlockPublicAccessExclusion - if *v == nil { - sv = &types.VpcBlockPublicAccessExclusion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTimestamp = ptr.Time(t) - } - - case strings.EqualFold("deletionTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.DeletionTimestamp = ptr.Time(t) - } - - case strings.EqualFold("exclusionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExclusionId = ptr.String(xtv) - } - - case strings.EqualFold("internetGatewayExclusionMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InternetGatewayExclusionMode = types.InternetGatewayExclusionMode(xtv) - } - - case strings.EqualFold("lastUpdateTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastUpdateTimestamp = ptr.Time(t) - } - - case strings.EqualFold("reason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Reason = ptr.String(xtv) - } - - case strings.EqualFold("resourceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceArn = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcBlockPublicAccessExclusionState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusionList(v *[]types.VpcBlockPublicAccessExclusion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcBlockPublicAccessExclusion - if *v == nil { - sv = make([]types.VpcBlockPublicAccessExclusion, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcBlockPublicAccessExclusion - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusionListUnwrapped(v *[]types.VpcBlockPublicAccessExclusion, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcBlockPublicAccessExclusion - if *v == nil { - sv = make([]types.VpcBlockPublicAccessExclusion, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcBlockPublicAccessExclusion - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcBlockPublicAccessOptions(v **types.VpcBlockPublicAccessOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcBlockPublicAccessOptions - if *v == nil { - sv = &types.VpcBlockPublicAccessOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("awsAccountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsAccountId = ptr.String(xtv) - } - - case strings.EqualFold("awsRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AwsRegion = ptr.String(xtv) - } - - case strings.EqualFold("exclusionsAllowed", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExclusionsAllowed = types.VpcBlockPublicAccessExclusionsAllowed(xtv) - } - - case strings.EqualFold("internetGatewayBlockMode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InternetGatewayBlockMode = types.InternetGatewayBlockMode(xtv) - } - - case strings.EqualFold("lastUpdateTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastUpdateTimestamp = ptr.Time(t) - } - - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - case strings.EqualFold("reason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Reason = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcBlockPublicAccessState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcCidrBlockAssociation(v **types.VpcCidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcCidrBlockAssociation - if *v == nil { - sv = &types.VpcCidrBlockAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("cidrBlockState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcCidrBlockState(&sv.CidrBlockState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcCidrBlockAssociationSet(v *[]types.VpcCidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcCidrBlockAssociation - if *v == nil { - sv = make([]types.VpcCidrBlockAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcCidrBlockAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcCidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcCidrBlockAssociationSetUnwrapped(v *[]types.VpcCidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcCidrBlockAssociation - if *v == nil { - sv = make([]types.VpcCidrBlockAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcCidrBlockAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcCidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcCidrBlockState(v **types.VpcCidrBlockState, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcCidrBlockState - if *v == nil { - sv = &types.VpcCidrBlockState{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcCidrBlockStateCode(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcClassicLink(v **types.VpcClassicLink, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcClassicLink - if *v == nil { - sv = &types.VpcClassicLink{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("classicLinkEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ClassicLinkEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcClassicLinkList(v *[]types.VpcClassicLink, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcClassicLink - if *v == nil { - sv = make([]types.VpcClassicLink, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcClassicLink - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcClassicLink(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcClassicLinkListUnwrapped(v *[]types.VpcClassicLink, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcClassicLink - if *v == nil { - sv = make([]types.VpcClassicLink, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcClassicLink - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcClassicLink(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcEncryptionControl(v **types.VpcEncryptionControl, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEncryptionControl - if *v == nil { - sv = &types.VpcEncryptionControl{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("mode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Mode = types.VpcEncryptionControlMode(xtv) - } - - case strings.EqualFold("resourceExclusions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusions(&sv.ResourceExclusions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcEncryptionControlState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEncryptionControlId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEncryptionControlId = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(v **types.VpcEncryptionControlExclusion, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEncryptionControlExclusion - if *v == nil { - sv = &types.VpcEncryptionControlExclusion{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpcEncryptionControlExclusionState(xtv) - } - - case strings.EqualFold("stateMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEncryptionControlExclusions(v **types.VpcEncryptionControlExclusions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEncryptionControlExclusions - if *v == nil { - sv = &types.VpcEncryptionControlExclusions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("egressOnlyInternetGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(&sv.EgressOnlyInternetGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("internetGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(&sv.InternetGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(&sv.NatGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("virtualPrivateGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(&sv.VirtualPrivateGateway, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcPeering", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEncryptionControlExclusion(&sv.VpcPeering, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEndpoint - if *v == nil { - sv = &types.VpcEndpoint{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTimestamp = ptr.Time(t) - } - - case strings.EqualFold("dnsEntrySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDnsEntrySet(&sv.DnsEntries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("dnsOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDnsOptions(&sv.DnsOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("failureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierSet(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipAddressType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpAddressType = types.IpAddressType(xtv) - } - - case strings.EqualFold("ipv4PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetIpPrefixesList(&sv.Ipv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetIpPrefixesList(&sv.Ipv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastError", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLastError(&sv.LastError, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.NetworkInterfaceIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("policyDocument", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyDocument = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PrivateDnsEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("requesterManaged", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.RequesterManaged = ptr.Bool(xtv) - } - - case strings.EqualFold("resourceConfigurationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceConfigurationArn = ptr.String(xtv) - } - - case strings.EqualFold("routeTableIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.RouteTableIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("serviceName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceName = ptr.String(xtv) - } - - case strings.EqualFold("serviceNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("serviceRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceRegion = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.State(xtv) - } - - case strings.EqualFold("subnetIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.SubnetIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointType = types.VpcEndpointType(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointAssociation(v **types.VpcEndpointAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEndpointAssociation - if *v == nil { - sv = &types.VpcEndpointAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResourceAccessibility", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResourceAccessibility = ptr.String(xtv) - } - - case strings.EqualFold("associatedResourceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResourceArn = ptr.String(xtv) - } - - case strings.EqualFold("dnsEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDnsEntry(&sv.DnsEntry, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("failureCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureCode = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) - } - - case strings.EqualFold("id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("privateDnsEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDnsEntry(&sv.PrivateDnsEntry, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("resourceConfigurationGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceConfigurationGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("serviceNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("serviceNetworkName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceNetworkName = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointAssociationSet(v *[]types.VpcEndpointAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcEndpointAssociation - if *v == nil { - sv = make([]types.VpcEndpointAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcEndpointAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcEndpointAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointAssociationSetUnwrapped(v *[]types.VpcEndpointAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcEndpointAssociation - if *v == nil { - sv = make([]types.VpcEndpointAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcEndpointAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcEndpointAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcEndpointConnection(v **types.VpcEndpointConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcEndpointConnection - if *v == nil { - sv = &types.VpcEndpointConnection{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("creationTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationTimestamp = ptr.Time(t) - } - - case strings.EqualFold("dnsEntrySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDnsEntrySet(&sv.DnsEntries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("gatewayLoadBalancerArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.GatewayLoadBalancerArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipAddressType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpAddressType = types.IpAddressType(xtv) - } - - case strings.EqualFold("networkLoadBalancerArnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.NetworkLoadBalancerArns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("serviceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ServiceId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcEndpointConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointConnectionId = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointOwner", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointOwner = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointRegion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointRegion = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcEndpointState = types.State(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointConnectionSet(v *[]types.VpcEndpointConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcEndpointConnection - if *v == nil { - sv = make([]types.VpcEndpointConnection, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcEndpointConnection - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcEndpointConnection(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointConnectionSetUnwrapped(v *[]types.VpcEndpointConnection, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcEndpointConnection - if *v == nil { - sv = make([]types.VpcEndpointConnection, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcEndpointConnection - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcEndpointConnection(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcEndpointSet(v *[]types.VpcEndpoint, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcEndpoint - if *v == nil { - sv = make([]types.VpcEndpoint, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcEndpoint - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcEndpointSetUnwrapped(v *[]types.VpcEndpoint, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcEndpoint - if *v == nil { - sv = make([]types.VpcEndpoint, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcEndpoint - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcEndpoint(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociation(v **types.VpcIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcIpv6CidrBlockAssociation - if *v == nil { - sv = &types.VpcIpv6CidrBlockAssociation{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("ipSource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.IpSource = types.IpSource(xtv) - } - - case strings.EqualFold("ipv6AddressAttribute", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6AddressAttribute = types.Ipv6AddressAttribute(xtv) - } - - case strings.EqualFold("ipv6CidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("ipv6CidrBlockState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcCidrBlockState(&sv.Ipv6CidrBlockState, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Ipv6Pool = ptr.String(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociationSet(v *[]types.VpcIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcIpv6CidrBlockAssociation - if *v == nil { - sv = make([]types.VpcIpv6CidrBlockAssociation, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcIpv6CidrBlockAssociation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociationSetUnwrapped(v *[]types.VpcIpv6CidrBlockAssociation, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcIpv6CidrBlockAssociation - if *v == nil { - sv = make([]types.VpcIpv6CidrBlockAssociation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcIpv6CidrBlockAssociation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcList(v *[]types.Vpc, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Vpc - if *v == nil { - sv = make([]types.Vpc, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.Vpc - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpc(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcListUnwrapped(v *[]types.Vpc, decoder smithyxml.NodeDecoder) error { - var sv []types.Vpc - if *v == nil { - sv = make([]types.Vpc, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Vpc - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpc(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcPeeringConnection(v **types.VpcPeeringConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcPeeringConnection - if *v == nil { - sv = &types.VpcPeeringConnection{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accepterVpcInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnectionVpcInfo(&sv.AccepterVpcInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("expirationTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.ExpirationTime = ptr.Time(t) - } - - case strings.EqualFold("requesterVpcInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnectionVpcInfo(&sv.RequesterVpcInfo, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnectionStateReason(&sv.Status, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcPeeringConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcPeeringConnectionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcPeeringConnectionList(v *[]types.VpcPeeringConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpcPeeringConnection - if *v == nil { - sv = make([]types.VpcPeeringConnection, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpcPeeringConnection - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpcPeeringConnection(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcPeeringConnectionListUnwrapped(v *[]types.VpcPeeringConnection, decoder smithyxml.NodeDecoder) error { - var sv []types.VpcPeeringConnection - if *v == nil { - sv = make([]types.VpcPeeringConnection, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpcPeeringConnection - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpcPeeringConnection(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpcPeeringConnectionOptionsDescription(v **types.VpcPeeringConnectionOptionsDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcPeeringConnectionOptionsDescription - if *v == nil { - sv = &types.VpcPeeringConnectionOptionsDescription{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allowDnsResolutionFromRemoteVpc", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowDnsResolutionFromRemoteVpc = ptr.Bool(xtv) - } - - case strings.EqualFold("allowEgressFromLocalClassicLinkToRemoteVpc", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowEgressFromLocalClassicLinkToRemoteVpc = ptr.Bool(xtv) - } - - case strings.EqualFold("allowEgressFromLocalVpcToRemoteClassicLink", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AllowEgressFromLocalVpcToRemoteClassicLink = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcPeeringConnectionStateReason(v **types.VpcPeeringConnectionStateReason, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcPeeringConnectionStateReason - if *v == nil { - sv = &types.VpcPeeringConnectionStateReason{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = types.VpcPeeringConnectionStateReasonCode(xtv) - } - - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpcPeeringConnectionVpcInfo(v **types.VpcPeeringConnectionVpcInfo, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpcPeeringConnectionVpcInfo - if *v == nil { - sv = &types.VpcPeeringConnectionVpcInfo{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("cidrBlockSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCidrBlockSet(&sv.CidrBlockSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6CidrBlockSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6CidrBlockSet(&sv.Ipv6CidrBlockSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("peeringOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnectionOptionsDescription(&sv.PeeringOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("region", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Region = ptr.String(xtv) - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnConnection(v **types.VpnConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnConnection - if *v == nil { - sv = &types.VpnConnection{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("category", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Category = ptr.String(xtv) - } - - case strings.EqualFold("coreNetworkArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkArn = ptr.String(xtv) - } - - case strings.EqualFold("coreNetworkAttachmentArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoreNetworkAttachmentArn = ptr.String(xtv) - } - - case strings.EqualFold("customerGatewayConfiguration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerGatewayConfiguration = ptr.String(xtv) - } - - case strings.EqualFold("customerGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("gatewayAssociationState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GatewayAssociationState = types.GatewayAssociationState(xtv) - } - - case strings.EqualFold("options", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnectionOptions(&sv.Options, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("preSharedKeyArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreSharedKeyArn = ptr.String(xtv) - } - - case strings.EqualFold("routes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnStaticRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpnState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.GatewayType(xtv) - } - - case strings.EqualFold("vgwTelemetry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVgwTelemetryList(&sv.VgwTelemetry, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpnConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnConnectionId = ptr.String(xtv) - } - - case strings.EqualFold("vpnGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnConnectionDeviceType(v **types.VpnConnectionDeviceType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnConnectionDeviceType - if *v == nil { - sv = &types.VpnConnectionDeviceType{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("software", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Software = ptr.String(xtv) - } - - case strings.EqualFold("vendor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Vendor = ptr.String(xtv) - } - - case strings.EqualFold("vpnConnectionDeviceTypeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnConnectionDeviceTypeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnConnectionDeviceTypeList(v *[]types.VpnConnectionDeviceType, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpnConnectionDeviceType - if *v == nil { - sv = make([]types.VpnConnectionDeviceType, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpnConnectionDeviceType - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpnConnectionDeviceType(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnConnectionDeviceTypeListUnwrapped(v *[]types.VpnConnectionDeviceType, decoder smithyxml.NodeDecoder) error { - var sv []types.VpnConnectionDeviceType - if *v == nil { - sv = make([]types.VpnConnectionDeviceType, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpnConnectionDeviceType - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpnConnectionDeviceType(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpnConnectionList(v *[]types.VpnConnection, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpnConnection - if *v == nil { - sv = make([]types.VpnConnection, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpnConnection - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpnConnection(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnConnectionListUnwrapped(v *[]types.VpnConnection, decoder smithyxml.NodeDecoder) error { - var sv []types.VpnConnection - if *v == nil { - sv = make([]types.VpnConnection, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpnConnection - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpnConnection(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpnConnectionOptions(v **types.VpnConnectionOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnConnectionOptions - if *v == nil { - sv = &types.VpnConnectionOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enableAcceleration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EnableAcceleration = ptr.Bool(xtv) - } - - case strings.EqualFold("localIpv4NetworkCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalIpv4NetworkCidr = ptr.String(xtv) - } - - case strings.EqualFold("localIpv6NetworkCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalIpv6NetworkCidr = ptr.String(xtv) - } - - case strings.EqualFold("outsideIpAddressType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutsideIpAddressType = ptr.String(xtv) - } - - case strings.EqualFold("remoteIpv4NetworkCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RemoteIpv4NetworkCidr = ptr.String(xtv) - } - - case strings.EqualFold("remoteIpv6NetworkCidr", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RemoteIpv6NetworkCidr = ptr.String(xtv) - } - - case strings.EqualFold("staticRoutesOnly", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.StaticRoutesOnly = ptr.Bool(xtv) - } - - case strings.EqualFold("transportTransitGatewayAttachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransportTransitGatewayAttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("tunnelInsideIpVersion", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TunnelInsideIpVersion = types.TunnelInsideIpVersion(xtv) - } - - case strings.EqualFold("tunnelOptionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTunnelOptionsList(&sv.TunnelOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnGateway(v **types.VpnGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnGateway - if *v == nil { - sv = &types.VpnGateway{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("amazonSideAsn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AmazonSideAsn = ptr.Int64(i64) - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpnState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.GatewayType(xtv) - } - - case strings.EqualFold("attachments", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcAttachmentList(&sv.VpcAttachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpnGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnGatewayList(v *[]types.VpnGateway, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpnGateway - if *v == nil { - sv = make([]types.VpnGateway, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpnGateway - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpnGateway(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnGatewayListUnwrapped(v *[]types.VpnGateway, decoder smithyxml.NodeDecoder) error { - var sv []types.VpnGateway - if *v == nil { - sv = make([]types.VpnGateway, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpnGateway - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpnGateway(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpnStaticRoute(v **types.VpnStaticRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnStaticRoute - if *v == nil { - sv = &types.VpnStaticRoute{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationCidrBlock", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationCidrBlock = ptr.String(xtv) - } - - case strings.EqualFold("source", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Source = types.VpnStaticRouteSource(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VpnState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnStaticRouteList(v *[]types.VpnStaticRoute, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.VpnStaticRoute - if *v == nil { - sv = make([]types.VpnStaticRoute, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("item", t.Name.Local): - var col types.VpnStaticRoute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsEc2query_deserializeDocumentVpnStaticRoute(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeDocumentVpnStaticRouteListUnwrapped(v *[]types.VpnStaticRoute, decoder smithyxml.NodeDecoder) error { - var sv []types.VpnStaticRoute - if *v == nil { - sv = make([]types.VpnStaticRoute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.VpnStaticRoute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsEc2query_deserializeDocumentVpnStaticRoute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsEc2query_deserializeDocumentVpnTunnelLogOptions(v **types.VpnTunnelLogOptions, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.VpnTunnelLogOptions - if *v == nil { - sv = &types.VpnTunnelLogOptions{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cloudWatchLogOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCloudWatchLogOptions(&sv.CloudWatchLogOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptAddressTransferOutput(v **AcceptAddressTransferOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptAddressTransferOutput - if *v == nil { - sv = &AcceptAddressTransferOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressTransfer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressTransfer(&sv.AddressTransfer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptCapacityReservationBillingOwnershipOutput(v **AcceptCapacityReservationBillingOwnershipOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptCapacityReservationBillingOwnershipOutput - if *v == nil { - sv = &AcceptCapacityReservationBillingOwnershipOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptReservedInstancesExchangeQuoteOutput(v **AcceptReservedInstancesExchangeQuoteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptReservedInstancesExchangeQuoteOutput - if *v == nil { - sv = &AcceptReservedInstancesExchangeQuoteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("exchangeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExchangeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptTransitGatewayMulticastDomainAssociationsOutput(v **AcceptTransitGatewayMulticastDomainAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptTransitGatewayMulticastDomainAssociationsOutput - if *v == nil { - sv = &AcceptTransitGatewayMulticastDomainAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociations(&sv.Associations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptTransitGatewayPeeringAttachmentOutput(v **AcceptTransitGatewayPeeringAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptTransitGatewayPeeringAttachmentOutput - if *v == nil { - sv = &AcceptTransitGatewayPeeringAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPeeringAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&sv.TransitGatewayPeeringAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptTransitGatewayVpcAttachmentOutput(v **AcceptTransitGatewayVpcAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptTransitGatewayVpcAttachmentOutput - if *v == nil { - sv = &AcceptTransitGatewayVpcAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayVpcAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&sv.TransitGatewayVpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptVpcEndpointConnectionsOutput(v **AcceptVpcEndpointConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptVpcEndpointConnectionsOutput - if *v == nil { - sv = &AcceptVpcEndpointConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAcceptVpcPeeringConnectionOutput(v **AcceptVpcPeeringConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AcceptVpcPeeringConnectionOutput - if *v == nil { - sv = &AcceptVpcPeeringConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcPeeringConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnection(&sv.VpcPeeringConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAdvertiseByoipCidrOutput(v **AdvertiseByoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AdvertiseByoipCidrOutput - if *v == nil { - sv = &AdvertiseByoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidr(&sv.ByoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAllocateAddressOutput(v **AllocateAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AllocateAddressOutput - if *v == nil { - sv = &AllocateAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("carrierIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CarrierIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIp = ptr.String(xtv) - } - - case strings.EqualFold("customerOwnedIpv4Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerOwnedIpv4Pool = ptr.String(xtv) - } - - case strings.EqualFold("domain", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Domain = types.DomainType(xtv) - } - - case strings.EqualFold("networkBorderGroup", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkBorderGroup = ptr.String(xtv) - } - - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv4Pool", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIpv4Pool = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAllocateHostsOutput(v **AllocateHostsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AllocateHostsOutput - if *v == nil { - sv = &AllocateHostsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("hostIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseHostIdList(&sv.HostIds, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAllocateIpamPoolCidrOutput(v **AllocateIpamPoolCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AllocateIpamPoolCidrOutput - if *v == nil { - sv = &AllocateIpamPoolCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolAllocation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&sv.IpamPoolAllocation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentApplySecurityGroupsToClientVpnTargetNetworkOutput(v **ApplySecurityGroupsToClientVpnTargetNetworkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ApplySecurityGroupsToClientVpnTargetNetworkOutput - if *v == nil { - sv = &ApplySecurityGroupsToClientVpnTargetNetworkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("securityGroupIds", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnSecurityGroupIdSet(&sv.SecurityGroupIds, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssignIpv6AddressesOutput(v **AssignIpv6AddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssignIpv6AddressesOutput - if *v == nil { - sv = &AssignIpv6AddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("assignedIpv6Addresses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6AddressList(&sv.AssignedIpv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("assignedIpv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPrefixList(&sv.AssignedIpv6Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssignPrivateIpAddressesOutput(v **AssignPrivateIpAddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssignPrivateIpAddressesOutput - if *v == nil { - sv = &AssignPrivateIpAddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("assignedIpv4PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv4PrefixesList(&sv.AssignedIpv4Prefixes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("assignedPrivateIpAddressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssignedPrivateIpAddressList(&sv.AssignedPrivateIpAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssignPrivateNatGatewayAddressOutput(v **AssignPrivateNatGatewayAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssignPrivateNatGatewayAddressOutput - if *v == nil { - sv = &AssignPrivateNatGatewayAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewayAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayAddressList(&sv.NatGatewayAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateAddressOutput(v **AssociateAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateAddressOutput - if *v == nil { - sv = &AssociateAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateCapacityReservationBillingOwnerOutput(v **AssociateCapacityReservationBillingOwnerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateCapacityReservationBillingOwnerOutput - if *v == nil { - sv = &AssociateCapacityReservationBillingOwnerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateClientVpnTargetNetworkOutput(v **AssociateClientVpnTargetNetworkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateClientVpnTargetNetworkOutput - if *v == nil { - sv = &AssociateClientVpnTargetNetworkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociationStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateEnclaveCertificateIamRoleOutput(v **AssociateEnclaveCertificateIamRoleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateEnclaveCertificateIamRoleOutput - if *v == nil { - sv = &AssociateEnclaveCertificateIamRoleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("certificateS3BucketName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateS3BucketName = ptr.String(xtv) - } - - case strings.EqualFold("certificateS3ObjectKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateS3ObjectKey = ptr.String(xtv) - } - - case strings.EqualFold("encryptionKmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.EncryptionKmsKeyId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateIamInstanceProfileOutput(v **AssociateIamInstanceProfileOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateIamInstanceProfileOutput - if *v == nil { - sv = &AssociateIamInstanceProfileOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("iamInstanceProfileAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociation(&sv.IamInstanceProfileAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateInstanceEventWindowOutput(v **AssociateInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateInstanceEventWindowOutput - if *v == nil { - sv = &AssociateInstanceEventWindowOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindow", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&sv.InstanceEventWindow, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateIpamByoasnOutput(v **AssociateIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateIpamByoasnOutput - if *v == nil { - sv = &AssociateIpamByoasnOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asnAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAsnAssociation(&sv.AsnAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateIpamResourceDiscoveryOutput(v **AssociateIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateIpamResourceDiscoveryOutput - if *v == nil { - sv = &AssociateIpamResourceDiscoveryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscoveryAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociation(&sv.IpamResourceDiscoveryAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateNatGatewayAddressOutput(v **AssociateNatGatewayAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateNatGatewayAddressOutput - if *v == nil { - sv = &AssociateNatGatewayAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewayAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayAddressList(&sv.NatGatewayAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateRouteServerOutput(v **AssociateRouteServerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateRouteServerOutput - if *v == nil { - sv = &AssociateRouteServerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerAssociation(&sv.RouteServerAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateRouteTableOutput(v **AssociateRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateRouteTableOutput - if *v == nil { - sv = &AssociateRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("associationState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableAssociationState(&sv.AssociationState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateSecurityGroupVpcOutput(v **AssociateSecurityGroupVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateSecurityGroupVpcOutput - if *v == nil { - sv = &AssociateSecurityGroupVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SecurityGroupVpcAssociationState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateSubnetCidrBlockOutput(v **AssociateSubnetCidrBlockOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateSubnetCidrBlockOutput - if *v == nil { - sv = &AssociateSubnetCidrBlockOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6CidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociation(&sv.Ipv6CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateTransitGatewayMulticastDomainOutput(v **AssociateTransitGatewayMulticastDomainOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateTransitGatewayMulticastDomainOutput - if *v == nil { - sv = &AssociateTransitGatewayMulticastDomainOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociations(&sv.Associations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateTransitGatewayPolicyTableOutput(v **AssociateTransitGatewayPolicyTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateTransitGatewayPolicyTableOutput - if *v == nil { - sv = &AssociateTransitGatewayPolicyTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateTransitGatewayRouteTableOutput(v **AssociateTransitGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateTransitGatewayRouteTableOutput - if *v == nil { - sv = &AssociateTransitGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateTrunkInterfaceOutput(v **AssociateTrunkInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateTrunkInterfaceOutput - if *v == nil { - sv = &AssociateTrunkInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("interfaceAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrunkInterfaceAssociation(&sv.InterfaceAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAssociateVpcCidrBlockOutput(v **AssociateVpcCidrBlockOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssociateVpcCidrBlockOutput - if *v == nil { - sv = &AssociateVpcCidrBlockOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcCidrBlockAssociation(&sv.CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6CidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociation(&sv.Ipv6CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAttachClassicLinkVpcOutput(v **AttachClassicLinkVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AttachClassicLinkVpcOutput - if *v == nil { - sv = &AttachClassicLinkVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAttachNetworkInterfaceOutput(v **AttachNetworkInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AttachNetworkInterfaceOutput - if *v == nil { - sv = &AttachNetworkInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AttachmentId = ptr.String(xtv) - } - - case strings.EqualFold("networkCardIndex", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetworkCardIndex = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAttachVerifiedAccessTrustProviderOutput(v **AttachVerifiedAccessTrustProviderOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AttachVerifiedAccessTrustProviderOutput - if *v == nil { - sv = &AttachVerifiedAccessTrustProviderOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&sv.VerifiedAccessInstance, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&sv.VerifiedAccessTrustProvider, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAttachVolumeOutput(v **AttachVolumeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AttachVolumeOutput - if *v == nil { - sv = &AttachVolumeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResource = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("device", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Device = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceOwningService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceOwningService = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VolumeAttachmentState(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAttachVpnGatewayOutput(v **AttachVpnGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AttachVpnGatewayOutput - if *v == nil { - sv = &AttachVpnGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcAttachment(&sv.VpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAuthorizeClientVpnIngressOutput(v **AuthorizeClientVpnIngressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AuthorizeClientVpnIngressOutput - if *v == nil { - sv = &AuthorizeClientVpnIngressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnAuthorizationRuleStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAuthorizeSecurityGroupEgressOutput(v **AuthorizeSecurityGroupEgressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AuthorizeSecurityGroupEgressOutput - if *v == nil { - sv = &AuthorizeSecurityGroupEgressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - case strings.EqualFold("securityGroupRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupRuleList(&sv.SecurityGroupRules, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentAuthorizeSecurityGroupIngressOutput(v **AuthorizeSecurityGroupIngressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AuthorizeSecurityGroupIngressOutput - if *v == nil { - sv = &AuthorizeSecurityGroupIngressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - case strings.EqualFold("securityGroupRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupRuleList(&sv.SecurityGroupRules, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentBundleInstanceOutput(v **BundleInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *BundleInstanceOutput - if *v == nil { - sv = &BundleInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bundleInstanceTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBundleTask(&sv.BundleTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelBundleTaskOutput(v **CancelBundleTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelBundleTaskOutput - if *v == nil { - sv = &CancelBundleTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bundleInstanceTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBundleTask(&sv.BundleTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelCapacityReservationFleetsOutput(v **CancelCapacityReservationFleetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelCapacityReservationFleetsOutput - if *v == nil { - sv = &CancelCapacityReservationFleetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("failedFleetCancellationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFailedCapacityReservationFleetCancellationResultSet(&sv.FailedFleetCancellations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("successfulFleetCancellationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationFleetCancellationStateSet(&sv.SuccessfulFleetCancellations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelCapacityReservationOutput(v **CancelCapacityReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelCapacityReservationOutput - if *v == nil { - sv = &CancelCapacityReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelDeclarativePoliciesReportOutput(v **CancelDeclarativePoliciesReportOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelDeclarativePoliciesReportOutput - if *v == nil { - sv = &CancelDeclarativePoliciesReportOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelImageLaunchPermissionOutput(v **CancelImageLaunchPermissionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelImageLaunchPermissionOutput - if *v == nil { - sv = &CancelImageLaunchPermissionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelImportTaskOutput(v **CancelImportTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelImportTaskOutput - if *v == nil { - sv = &CancelImportTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("importTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("previousState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PreviousState = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelReservedInstancesListingOutput(v **CancelReservedInstancesListingOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelReservedInstancesListingOutput - if *v == nil { - sv = &CancelReservedInstancesListingOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesListingsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesListingList(&sv.ReservedInstancesListings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelSpotFleetRequestsOutput(v **CancelSpotFleetRequestsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelSpotFleetRequestsOutput - if *v == nil { - sv = &CancelSpotFleetRequestsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successfulFleetRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsSuccessSet(&sv.SuccessfulFleetRequests, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessfulFleetRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCancelSpotFleetRequestsErrorSet(&sv.UnsuccessfulFleetRequests, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCancelSpotInstanceRequestsOutput(v **CancelSpotInstanceRequestsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CancelSpotInstanceRequestsOutput - if *v == nil { - sv = &CancelSpotInstanceRequestsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotInstanceRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCancelledSpotInstanceRequestList(&sv.CancelledSpotInstanceRequests, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentConfirmProductInstanceOutput(v **ConfirmProductInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ConfirmProductInstanceOutput - if *v == nil { - sv = &ConfirmProductInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCopyFpgaImageOutput(v **CopyFpgaImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CopyFpgaImageOutput - if *v == nil { - sv = &CopyFpgaImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgaImageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCopyImageOutput(v **CopyImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CopyImageOutput - if *v == nil { - sv = &CopyImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCopySnapshotOutput(v **CopySnapshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CopySnapshotOutput - if *v == nil { - sv = &CopySnapshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCapacityReservationBySplittingOutput(v **CreateCapacityReservationBySplittingOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCapacityReservationBySplittingOutput - if *v == nil { - sv = &CreateCapacityReservationBySplittingOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationCapacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.DestinationCapacityReservation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("sourceCapacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.SourceCapacityReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCapacityReservationFleetOutput(v **CreateCapacityReservationFleetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCapacityReservationFleetOutput - if *v == nil { - sv = &CreateCapacityReservationFleetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationStrategy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationStrategy = ptr.String(xtv) - } - - case strings.EqualFold("capacityReservationFleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationFleetId = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("endDate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndDate = ptr.Time(t) - } - - case strings.EqualFold("fleetCapacityReservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetCapacityReservationSet(&sv.FleetCapacityReservations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceMatchCriteria", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceMatchCriteria = types.FleetInstanceMatchCriteria(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CapacityReservationFleetState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tenancy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Tenancy = types.FleetCapacityReservationTenancy(xtv) - } - - case strings.EqualFold("totalFulfilledCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.TotalFulfilledCapacity = ptr.Float64(f64) - } - - case strings.EqualFold("totalTargetCapacity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalTargetCapacity = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCapacityReservationOutput(v **CreateCapacityReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCapacityReservationOutput - if *v == nil { - sv = &CreateCapacityReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.CapacityReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCarrierGatewayOutput(v **CreateCarrierGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCarrierGatewayOutput - if *v == nil { - sv = &CreateCarrierGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCarrierGateway(&sv.CarrierGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateClientVpnEndpointOutput(v **CreateClientVpnEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateClientVpnEndpointOutput - if *v == nil { - sv = &CreateClientVpnEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("dnsName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DnsName = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnEndpointStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateClientVpnRouteOutput(v **CreateClientVpnRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateClientVpnRouteOutput - if *v == nil { - sv = &CreateClientVpnRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnRouteStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCoipCidrOutput(v **CreateCoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCoipCidrOutput - if *v == nil { - sv = &CreateCoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipCidr(&sv.CoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCoipPoolOutput(v **CreateCoipPoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCoipPoolOutput - if *v == nil { - sv = &CreateCoipPoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipPool", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipPool(&sv.CoipPool, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateCustomerGatewayOutput(v **CreateCustomerGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateCustomerGatewayOutput - if *v == nil { - sv = &CreateCustomerGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("customerGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCustomerGateway(&sv.CustomerGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateDefaultSubnetOutput(v **CreateDefaultSubnetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateDefaultSubnetOutput - if *v == nil { - sv = &CreateDefaultSubnetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("subnet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnet(&sv.Subnet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateDefaultVpcOutput(v **CreateDefaultVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateDefaultVpcOutput - if *v == nil { - sv = &CreateDefaultVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpc(&sv.Vpc, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateDelegateMacVolumeOwnershipTaskOutput(v **CreateDelegateMacVolumeOwnershipTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateDelegateMacVolumeOwnershipTaskOutput - if *v == nil { - sv = &CreateDelegateMacVolumeOwnershipTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("macModificationTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacModificationTask(&sv.MacModificationTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateDhcpOptionsOutput(v **CreateDhcpOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateDhcpOptionsOutput - if *v == nil { - sv = &CreateDhcpOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dhcpOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDhcpOptions(&sv.DhcpOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateEgressOnlyInternetGatewayOutput(v **CreateEgressOnlyInternetGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateEgressOnlyInternetGatewayOutput - if *v == nil { - sv = &CreateEgressOnlyInternetGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("egressOnlyInternetGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEgressOnlyInternetGateway(&sv.EgressOnlyInternetGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateFleetOutput(v **CreateFleetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateFleetOutput - if *v == nil { - sv = &CreateFleetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("errorSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCreateFleetErrorsSet(&sv.Errors, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - case strings.EqualFold("fleetInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCreateFleetInstancesSet(&sv.Instances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateFlowLogsOutput(v **CreateFlowLogsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateFlowLogsOutput - if *v == nil { - sv = &CreateFlowLogsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("flowLogIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.FlowLogIds, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateFpgaImageOutput(v **CreateFpgaImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateFpgaImageOutput - if *v == nil { - sv = &CreateFpgaImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgaImageGlobalId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageGlobalId = ptr.String(xtv) - } - - case strings.EqualFold("fpgaImageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FpgaImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateImageOutput(v **CreateImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateImageOutput - if *v == nil { - sv = &CreateImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateInstanceConnectEndpointOutput(v **CreateInstanceConnectEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateInstanceConnectEndpointOutput - if *v == nil { - sv = &CreateInstanceConnectEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("instanceConnectEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&sv.InstanceConnectEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateInstanceEventWindowOutput(v **CreateInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateInstanceEventWindowOutput - if *v == nil { - sv = &CreateInstanceEventWindowOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindow", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&sv.InstanceEventWindow, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateInstanceExportTaskOutput(v **CreateInstanceExportTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateInstanceExportTaskOutput - if *v == nil { - sv = &CreateInstanceExportTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("exportTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportTask(&sv.ExportTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateInternetGatewayOutput(v **CreateInternetGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateInternetGatewayOutput - if *v == nil { - sv = &CreateInternetGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("internetGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInternetGateway(&sv.InternetGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateIpamExternalResourceVerificationTokenOutput(v **CreateIpamExternalResourceVerificationTokenOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateIpamExternalResourceVerificationTokenOutput - if *v == nil { - sv = &CreateIpamExternalResourceVerificationTokenOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamExternalResourceVerificationToken", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamExternalResourceVerificationToken(&sv.IpamExternalResourceVerificationToken, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateIpamOutput(v **CreateIpamOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateIpamOutput - if *v == nil { - sv = &CreateIpamOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipam", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpam(&sv.Ipam, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateIpamPoolOutput(v **CreateIpamPoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateIpamPoolOutput - if *v == nil { - sv = &CreateIpamPoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPool", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPool(&sv.IpamPool, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateIpamResourceDiscoveryOutput(v **CreateIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateIpamResourceDiscoveryOutput - if *v == nil { - sv = &CreateIpamResourceDiscoveryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscovery", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscovery(&sv.IpamResourceDiscovery, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateIpamScopeOutput(v **CreateIpamScopeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateIpamScopeOutput - if *v == nil { - sv = &CreateIpamScopeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamScope", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamScope(&sv.IpamScope, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateKeyPairOutput(v **CreateKeyPairOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateKeyPairOutput - if *v == nil { - sv = &CreateKeyPairOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("keyFingerprint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyFingerprint = ptr.String(xtv) - } - - case strings.EqualFold("keyMaterial", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyMaterial = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("keyPairId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyPairId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLaunchTemplateOutput(v **CreateLaunchTemplateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLaunchTemplateOutput - if *v == nil { - sv = &CreateLaunchTemplateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplate(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("warning", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValidationWarning(&sv.Warning, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLaunchTemplateVersionOutput(v **CreateLaunchTemplateVersionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLaunchTemplateVersionOutput - if *v == nil { - sv = &CreateLaunchTemplateVersionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateVersion", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateVersion(&sv.LaunchTemplateVersion, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("warning", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValidationWarning(&sv.Warning, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteOutput(v **CreateLocalGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayRouteOutput - if *v == nil { - sv = &CreateLocalGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableOutput(v **CreateLocalGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayRouteTableOutput - if *v == nil { - sv = &CreateLocalGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTable(&sv.LocalGatewayRouteTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput(v **CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput - if *v == nil { - sv = &CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociation(&sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayRouteTableVpcAssociationOutput(v **CreateLocalGatewayRouteTableVpcAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayRouteTableVpcAssociationOutput - if *v == nil { - sv = &CreateLocalGatewayRouteTableVpcAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVpcAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociation(&sv.LocalGatewayRouteTableVpcAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayVirtualInterfaceGroupOutput(v **CreateLocalGatewayVirtualInterfaceGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayVirtualInterfaceGroupOutput - if *v == nil { - sv = &CreateLocalGatewayVirtualInterfaceGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterfaceGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroup(&sv.LocalGatewayVirtualInterfaceGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateLocalGatewayVirtualInterfaceOutput(v **CreateLocalGatewayVirtualInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateLocalGatewayVirtualInterfaceOutput - if *v == nil { - sv = &CreateLocalGatewayVirtualInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterface", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterface(&sv.LocalGatewayVirtualInterface, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateMacSystemIntegrityProtectionModificationTaskOutput(v **CreateMacSystemIntegrityProtectionModificationTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateMacSystemIntegrityProtectionModificationTaskOutput - if *v == nil { - sv = &CreateMacSystemIntegrityProtectionModificationTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("macModificationTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacModificationTask(&sv.MacModificationTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateManagedPrefixListOutput(v **CreateManagedPrefixListOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateManagedPrefixListOutput - if *v == nil { - sv = &CreateManagedPrefixListOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("prefixList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixList(&sv.PrefixList, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNatGatewayOutput(v **CreateNatGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNatGatewayOutput - if *v == nil { - sv = &CreateNatGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("natGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGateway(&sv.NatGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNetworkAclOutput(v **CreateNetworkAclOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNetworkAclOutput - if *v == nil { - sv = &CreateNetworkAclOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("networkAcl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkAcl(&sv.NetworkAcl, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNetworkInsightsAccessScopeOutput(v **CreateNetworkInsightsAccessScopeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNetworkInsightsAccessScopeOutput - if *v == nil { - sv = &CreateNetworkInsightsAccessScopeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScope", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScope(&sv.NetworkInsightsAccessScope, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInsightsAccessScopeContent", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeContent(&sv.NetworkInsightsAccessScopeContent, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNetworkInsightsPathOutput(v **CreateNetworkInsightsPathOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNetworkInsightsPathOutput - if *v == nil { - sv = &CreateNetworkInsightsPathOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsPath", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsPath(&sv.NetworkInsightsPath, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNetworkInterfaceOutput(v **CreateNetworkInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNetworkInterfaceOutput - if *v == nil { - sv = &CreateNetworkInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("networkInterface", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterface(&sv.NetworkInterface, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateNetworkInterfacePermissionOutput(v **CreateNetworkInterfacePermissionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateNetworkInterfacePermissionOutput - if *v == nil { - sv = &CreateNetworkInterfacePermissionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("interfacePermission", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfacePermission(&sv.InterfacePermission, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreatePlacementGroupOutput(v **CreatePlacementGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreatePlacementGroupOutput - if *v == nil { - sv = &CreatePlacementGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("placementGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementGroup(&sv.PlacementGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreatePublicIpv4PoolOutput(v **CreatePublicIpv4PoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreatePublicIpv4PoolOutput - if *v == nil { - sv = &CreatePublicIpv4PoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateReplaceRootVolumeTaskOutput(v **CreateReplaceRootVolumeTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateReplaceRootVolumeTaskOutput - if *v == nil { - sv = &CreateReplaceRootVolumeTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("replaceRootVolumeTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReplaceRootVolumeTask(&sv.ReplaceRootVolumeTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateReservedInstancesListingOutput(v **CreateReservedInstancesListingOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateReservedInstancesListingOutput - if *v == nil { - sv = &CreateReservedInstancesListingOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesListingsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesListingList(&sv.ReservedInstancesListings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRestoreImageTaskOutput(v **CreateRestoreImageTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRestoreImageTaskOutput - if *v == nil { - sv = &CreateRestoreImageTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRouteOutput(v **CreateRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRouteOutput - if *v == nil { - sv = &CreateRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRouteServerEndpointOutput(v **CreateRouteServerEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRouteServerEndpointOutput - if *v == nil { - sv = &CreateRouteServerEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerEndpoint(&sv.RouteServerEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRouteServerOutput(v **CreateRouteServerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRouteServerOutput - if *v == nil { - sv = &CreateRouteServerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServer(&sv.RouteServer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRouteServerPeerOutput(v **CreateRouteServerPeerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRouteServerPeerOutput - if *v == nil { - sv = &CreateRouteServerPeerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerPeer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPeer(&sv.RouteServerPeer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateRouteTableOutput(v **CreateRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateRouteTableOutput - if *v == nil { - sv = &CreateRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("routeTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTable(&sv.RouteTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSecurityGroupOutput(v **CreateSecurityGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSecurityGroupOutput - if *v == nil { - sv = &CreateSecurityGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecurityGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSnapshotOutput(v **CreateSnapshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSnapshotOutput - if *v == nil { - sv = &CreateSnapshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("completionDurationMinutes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CompletionDurationMinutes = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("completionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CompletionTime = ptr.Time(t) - } - - case strings.EqualFold("dataEncryptionKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DataEncryptionKeyId = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("fullSnapshotSizeInBytes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FullSnapshotSizeInBytes = ptr.Int64(i64) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerAlias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerAlias = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("restoreExpiryTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RestoreExpiryTime = ptr.Time(t) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotState(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateMessage = ptr.String(xtv) - } - - case strings.EqualFold("storageTier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StorageTier = types.StorageTier(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transferType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransferType = types.TransferType(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSnapshotsOutput(v **CreateSnapshotsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSnapshotsOutput - if *v == nil { - sv = &CreateSnapshotsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("snapshotSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotSet(&sv.Snapshots, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSpotDatafeedSubscriptionOutput(v **CreateSpotDatafeedSubscriptionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSpotDatafeedSubscriptionOutput - if *v == nil { - sv = &CreateSpotDatafeedSubscriptionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotDatafeedSubscription", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotDatafeedSubscription(&sv.SpotDatafeedSubscription, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateStoreImageTaskOutput(v **CreateStoreImageTaskOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateStoreImageTaskOutput - if *v == nil { - sv = &CreateStoreImageTaskOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("objectKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ObjectKey = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSubnetCidrReservationOutput(v **CreateSubnetCidrReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSubnetCidrReservationOutput - if *v == nil { - sv = &CreateSubnetCidrReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("subnetCidrReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetCidrReservation(&sv.SubnetCidrReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateSubnetOutput(v **CreateSubnetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateSubnetOutput - if *v == nil { - sv = &CreateSubnetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("subnet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnet(&sv.Subnet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTrafficMirrorFilterOutput(v **CreateTrafficMirrorFilterOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTrafficMirrorFilterOutput - if *v == nil { - sv = &CreateTrafficMirrorFilterOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorFilter", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilter(&sv.TrafficMirrorFilter, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTrafficMirrorFilterRuleOutput(v **CreateTrafficMirrorFilterRuleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTrafficMirrorFilterRuleOutput - if *v == nil { - sv = &CreateTrafficMirrorFilterRuleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorFilterRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&sv.TrafficMirrorFilterRule, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTrafficMirrorSessionOutput(v **CreateTrafficMirrorSessionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTrafficMirrorSessionOutput - if *v == nil { - sv = &CreateTrafficMirrorSessionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorSession", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorSession(&sv.TrafficMirrorSession, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTrafficMirrorTargetOutput(v **CreateTrafficMirrorTargetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTrafficMirrorTargetOutput - if *v == nil { - sv = &CreateTrafficMirrorTargetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorTarget", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorTarget(&sv.TrafficMirrorTarget, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayConnectOutput(v **CreateTransitGatewayConnectOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayConnectOutput - if *v == nil { - sv = &CreateTransitGatewayConnectOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayConnect", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnect(&sv.TransitGatewayConnect, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayConnectPeerOutput(v **CreateTransitGatewayConnectPeerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayConnectPeerOutput - if *v == nil { - sv = &CreateTransitGatewayConnectPeerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayConnectPeer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeer(&sv.TransitGatewayConnectPeer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayMulticastDomainOutput(v **CreateTransitGatewayMulticastDomainOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayMulticastDomainOutput - if *v == nil { - sv = &CreateTransitGatewayMulticastDomainOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayMulticastDomain", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomain(&sv.TransitGatewayMulticastDomain, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayOutput(v **CreateTransitGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayOutput - if *v == nil { - sv = &CreateTransitGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGateway(&sv.TransitGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayPeeringAttachmentOutput(v **CreateTransitGatewayPeeringAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayPeeringAttachmentOutput - if *v == nil { - sv = &CreateTransitGatewayPeeringAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPeeringAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&sv.TransitGatewayPeeringAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayPolicyTableOutput(v **CreateTransitGatewayPolicyTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayPolicyTableOutput - if *v == nil { - sv = &CreateTransitGatewayPolicyTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPolicyTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTable(&sv.TransitGatewayPolicyTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayPrefixListReferenceOutput(v **CreateTransitGatewayPrefixListReferenceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayPrefixListReferenceOutput - if *v == nil { - sv = &CreateTransitGatewayPrefixListReferenceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPrefixListReference", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(&sv.TransitGatewayPrefixListReference, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteOutput(v **CreateTransitGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayRouteOutput - if *v == nil { - sv = &CreateTransitGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteTableAnnouncementOutput(v **CreateTransitGatewayRouteTableAnnouncementOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayRouteTableAnnouncementOutput - if *v == nil { - sv = &CreateTransitGatewayRouteTableAnnouncementOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayRouteTableAnnouncement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncement(&sv.TransitGatewayRouteTableAnnouncement, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayRouteTableOutput(v **CreateTransitGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayRouteTableOutput - if *v == nil { - sv = &CreateTransitGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTable(&sv.TransitGatewayRouteTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateTransitGatewayVpcAttachmentOutput(v **CreateTransitGatewayVpcAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateTransitGatewayVpcAttachmentOutput - if *v == nil { - sv = &CreateTransitGatewayVpcAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayVpcAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&sv.TransitGatewayVpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVerifiedAccessEndpointOutput(v **CreateVerifiedAccessEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVerifiedAccessEndpointOutput - if *v == nil { - sv = &CreateVerifiedAccessEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpoint(&sv.VerifiedAccessEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVerifiedAccessGroupOutput(v **CreateVerifiedAccessGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVerifiedAccessGroupOutput - if *v == nil { - sv = &CreateVerifiedAccessGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessGroup(&sv.VerifiedAccessGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVerifiedAccessInstanceOutput(v **CreateVerifiedAccessInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVerifiedAccessInstanceOutput - if *v == nil { - sv = &CreateVerifiedAccessInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&sv.VerifiedAccessInstance, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVerifiedAccessTrustProviderOutput(v **CreateVerifiedAccessTrustProviderOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVerifiedAccessTrustProviderOutput - if *v == nil { - sv = &CreateVerifiedAccessTrustProviderOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&sv.VerifiedAccessTrustProvider, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVolumeOutput(v **CreateVolumeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVolumeOutput - if *v == nil { - sv = &CreateVolumeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attachmentSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeAttachmentList(&sv.Attachments, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("availabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("createTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreateTime = ptr.Time(t) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("fastRestored", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.FastRestored = ptr.Bool(xtv) - } - - case strings.EqualFold("iops", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Iops = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("multiAttachEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.MultiAttachEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("operator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOperatorResponse(&sv.Operator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("size", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Size = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VolumeState(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("throughput", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeInitializationRate", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeInitializationRate = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("volumeType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeType = types.VolumeType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcBlockPublicAccessExclusionOutput(v **CreateVpcBlockPublicAccessExclusionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcBlockPublicAccessExclusionOutput - if *v == nil { - sv = &CreateVpcBlockPublicAccessExclusionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcBlockPublicAccessExclusion", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(&sv.VpcBlockPublicAccessExclusion, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcEndpointConnectionNotificationOutput(v **CreateVpcEndpointConnectionNotificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcEndpointConnectionNotificationOutput - if *v == nil { - sv = &CreateVpcEndpointConnectionNotificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("connectionNotification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionNotification(&sv.ConnectionNotification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcEndpointOutput - if *v == nil { - sv = &CreateVpcEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcEndpointServiceConfigurationOutput(v **CreateVpcEndpointServiceConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcEndpointServiceConfigurationOutput - if *v == nil { - sv = &CreateVpcEndpointServiceConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("serviceConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceConfiguration(&sv.ServiceConfiguration, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcOutput(v **CreateVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcOutput - if *v == nil { - sv = &CreateVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpc", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpc(&sv.Vpc, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpcPeeringConnectionOutput(v **CreateVpcPeeringConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpcPeeringConnectionOutput - if *v == nil { - sv = &CreateVpcPeeringConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcPeeringConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnection(&sv.VpcPeeringConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpnConnectionOutput(v **CreateVpnConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpnConnectionOutput - if *v == nil { - sv = &CreateVpnConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnection(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentCreateVpnGatewayOutput(v **CreateVpnGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *CreateVpnGatewayOutput - if *v == nil { - sv = &CreateVpnGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnGateway(&sv.VpnGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteCarrierGatewayOutput(v **DeleteCarrierGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteCarrierGatewayOutput - if *v == nil { - sv = &DeleteCarrierGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCarrierGateway(&sv.CarrierGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteClientVpnEndpointOutput(v **DeleteClientVpnEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteClientVpnEndpointOutput - if *v == nil { - sv = &DeleteClientVpnEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnEndpointStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteClientVpnRouteOutput(v **DeleteClientVpnRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteClientVpnRouteOutput - if *v == nil { - sv = &DeleteClientVpnRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnRouteStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteCoipCidrOutput(v **DeleteCoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteCoipCidrOutput - if *v == nil { - sv = &DeleteCoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipCidr(&sv.CoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteCoipPoolOutput(v **DeleteCoipPoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteCoipPoolOutput - if *v == nil { - sv = &DeleteCoipPoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipPool", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipPool(&sv.CoipPool, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteEgressOnlyInternetGatewayOutput(v **DeleteEgressOnlyInternetGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteEgressOnlyInternetGatewayOutput - if *v == nil { - sv = &DeleteEgressOnlyInternetGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("returnCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnCode = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteFleetsOutput(v **DeleteFleetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteFleetsOutput - if *v == nil { - sv = &DeleteFleetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successfulFleetDeletionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteFleetSuccessSet(&sv.SuccessfulFleetDeletions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessfulFleetDeletionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteFleetErrorSet(&sv.UnsuccessfulFleetDeletions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteFlowLogsOutput(v **DeleteFlowLogsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteFlowLogsOutput - if *v == nil { - sv = &DeleteFlowLogsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteFpgaImageOutput(v **DeleteFpgaImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteFpgaImageOutput - if *v == nil { - sv = &DeleteFpgaImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteInstanceConnectEndpointOutput(v **DeleteInstanceConnectEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteInstanceConnectEndpointOutput - if *v == nil { - sv = &DeleteInstanceConnectEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceConnectEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEc2InstanceConnectEndpoint(&sv.InstanceConnectEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteInstanceEventWindowOutput(v **DeleteInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteInstanceEventWindowOutput - if *v == nil { - sv = &DeleteInstanceEventWindowOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindowState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindowStateChange(&sv.InstanceEventWindowState, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteIpamExternalResourceVerificationTokenOutput(v **DeleteIpamExternalResourceVerificationTokenOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteIpamExternalResourceVerificationTokenOutput - if *v == nil { - sv = &DeleteIpamExternalResourceVerificationTokenOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamExternalResourceVerificationToken", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamExternalResourceVerificationToken(&sv.IpamExternalResourceVerificationToken, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteIpamOutput(v **DeleteIpamOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteIpamOutput - if *v == nil { - sv = &DeleteIpamOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipam", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpam(&sv.Ipam, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteIpamPoolOutput(v **DeleteIpamPoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteIpamPoolOutput - if *v == nil { - sv = &DeleteIpamPoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPool", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPool(&sv.IpamPool, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteIpamResourceDiscoveryOutput(v **DeleteIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteIpamResourceDiscoveryOutput - if *v == nil { - sv = &DeleteIpamResourceDiscoveryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscovery", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscovery(&sv.IpamResourceDiscovery, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteIpamScopeOutput(v **DeleteIpamScopeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteIpamScopeOutput - if *v == nil { - sv = &DeleteIpamScopeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamScope", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamScope(&sv.IpamScope, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteKeyPairOutput(v **DeleteKeyPairOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteKeyPairOutput - if *v == nil { - sv = &DeleteKeyPairOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("keyPairId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyPairId = ptr.String(xtv) - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLaunchTemplateOutput(v **DeleteLaunchTemplateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLaunchTemplateOutput - if *v == nil { - sv = &DeleteLaunchTemplateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplate(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLaunchTemplateVersionsOutput(v **DeleteLaunchTemplateVersionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLaunchTemplateVersionsOutput - if *v == nil { - sv = &DeleteLaunchTemplateVersionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successfullyDeletedLaunchTemplateVersionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseSuccessSet(&sv.SuccessfullyDeletedLaunchTemplateVersions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessfullyDeletedLaunchTemplateVersionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteLaunchTemplateVersionsResponseErrorSet(&sv.UnsuccessfullyDeletedLaunchTemplateVersions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteOutput(v **DeleteLocalGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayRouteOutput - if *v == nil { - sv = &DeleteLocalGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableOutput(v **DeleteLocalGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayRouteTableOutput - if *v == nil { - sv = &DeleteLocalGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTable(&sv.LocalGatewayRouteTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput(v **DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput - if *v == nil { - sv = &DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociation(&sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayRouteTableVpcAssociationOutput(v **DeleteLocalGatewayRouteTableVpcAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayRouteTableVpcAssociationOutput - if *v == nil { - sv = &DeleteLocalGatewayRouteTableVpcAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVpcAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociation(&sv.LocalGatewayRouteTableVpcAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayVirtualInterfaceGroupOutput(v **DeleteLocalGatewayVirtualInterfaceGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayVirtualInterfaceGroupOutput - if *v == nil { - sv = &DeleteLocalGatewayVirtualInterfaceGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterfaceGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroup(&sv.LocalGatewayVirtualInterfaceGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteLocalGatewayVirtualInterfaceOutput(v **DeleteLocalGatewayVirtualInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteLocalGatewayVirtualInterfaceOutput - if *v == nil { - sv = &DeleteLocalGatewayVirtualInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterface", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterface(&sv.LocalGatewayVirtualInterface, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteManagedPrefixListOutput(v **DeleteManagedPrefixListOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteManagedPrefixListOutput - if *v == nil { - sv = &DeleteManagedPrefixListOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("prefixList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixList(&sv.PrefixList, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNatGatewayOutput(v **DeleteNatGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNatGatewayOutput - if *v == nil { - sv = &DeleteNatGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAccessScopeAnalysisOutput(v **DeleteNetworkInsightsAccessScopeAnalysisOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNetworkInsightsAccessScopeAnalysisOutput - if *v == nil { - sv = &DeleteNetworkInsightsAccessScopeAnalysisOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeAnalysisId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAccessScopeOutput(v **DeleteNetworkInsightsAccessScopeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNetworkInsightsAccessScopeOutput - if *v == nil { - sv = &DeleteNetworkInsightsAccessScopeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNetworkInsightsAnalysisOutput(v **DeleteNetworkInsightsAnalysisOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNetworkInsightsAnalysisOutput - if *v == nil { - sv = &DeleteNetworkInsightsAnalysisOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAnalysisId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNetworkInsightsPathOutput(v **DeleteNetworkInsightsPathOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNetworkInsightsPathOutput - if *v == nil { - sv = &DeleteNetworkInsightsPathOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsPathId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsPathId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteNetworkInterfacePermissionOutput(v **DeleteNetworkInterfacePermissionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteNetworkInterfacePermissionOutput - if *v == nil { - sv = &DeleteNetworkInterfacePermissionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeletePublicIpv4PoolOutput(v **DeletePublicIpv4PoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeletePublicIpv4PoolOutput - if *v == nil { - sv = &DeletePublicIpv4PoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("returnValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteQueuedReservedInstancesOutput(v **DeleteQueuedReservedInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteQueuedReservedInstancesOutput - if *v == nil { - sv = &DeleteQueuedReservedInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("failedQueuedPurchaseDeletionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFailedQueuedPurchaseDeletionSet(&sv.FailedQueuedPurchaseDeletions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("successfulQueuedPurchaseDeletionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSuccessfulQueuedPurchaseDeletionSet(&sv.SuccessfulQueuedPurchaseDeletions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteRouteServerEndpointOutput(v **DeleteRouteServerEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteRouteServerEndpointOutput - if *v == nil { - sv = &DeleteRouteServerEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerEndpoint(&sv.RouteServerEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteRouteServerOutput(v **DeleteRouteServerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteRouteServerOutput - if *v == nil { - sv = &DeleteRouteServerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServer(&sv.RouteServer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteRouteServerPeerOutput(v **DeleteRouteServerPeerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteRouteServerPeerOutput - if *v == nil { - sv = &DeleteRouteServerPeerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerPeer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPeer(&sv.RouteServerPeer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteSecurityGroupOutput(v **DeleteSecurityGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteSecurityGroupOutput - if *v == nil { - sv = &DeleteSecurityGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GroupId = ptr.String(xtv) - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteSubnetCidrReservationOutput(v **DeleteSubnetCidrReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteSubnetCidrReservationOutput - if *v == nil { - sv = &DeleteSubnetCidrReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deletedSubnetCidrReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetCidrReservation(&sv.DeletedSubnetCidrReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTrafficMirrorFilterOutput(v **DeleteTrafficMirrorFilterOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTrafficMirrorFilterOutput - if *v == nil { - sv = &DeleteTrafficMirrorFilterOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorFilterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTrafficMirrorFilterRuleOutput(v **DeleteTrafficMirrorFilterRuleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTrafficMirrorFilterRuleOutput - if *v == nil { - sv = &DeleteTrafficMirrorFilterRuleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorFilterRuleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorFilterRuleId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTrafficMirrorSessionOutput(v **DeleteTrafficMirrorSessionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTrafficMirrorSessionOutput - if *v == nil { - sv = &DeleteTrafficMirrorSessionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorSessionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorSessionId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTrafficMirrorTargetOutput(v **DeleteTrafficMirrorTargetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTrafficMirrorTargetOutput - if *v == nil { - sv = &DeleteTrafficMirrorTargetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorTargetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficMirrorTargetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayConnectOutput(v **DeleteTransitGatewayConnectOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayConnectOutput - if *v == nil { - sv = &DeleteTransitGatewayConnectOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayConnect", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnect(&sv.TransitGatewayConnect, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayConnectPeerOutput(v **DeleteTransitGatewayConnectPeerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayConnectPeerOutput - if *v == nil { - sv = &DeleteTransitGatewayConnectPeerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayConnectPeer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeer(&sv.TransitGatewayConnectPeer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayMulticastDomainOutput(v **DeleteTransitGatewayMulticastDomainOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayMulticastDomainOutput - if *v == nil { - sv = &DeleteTransitGatewayMulticastDomainOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayMulticastDomain", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomain(&sv.TransitGatewayMulticastDomain, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayOutput(v **DeleteTransitGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayOutput - if *v == nil { - sv = &DeleteTransitGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGateway(&sv.TransitGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayPeeringAttachmentOutput(v **DeleteTransitGatewayPeeringAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayPeeringAttachmentOutput - if *v == nil { - sv = &DeleteTransitGatewayPeeringAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPeeringAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&sv.TransitGatewayPeeringAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayPolicyTableOutput(v **DeleteTransitGatewayPolicyTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayPolicyTableOutput - if *v == nil { - sv = &DeleteTransitGatewayPolicyTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPolicyTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTable(&sv.TransitGatewayPolicyTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayPrefixListReferenceOutput(v **DeleteTransitGatewayPrefixListReferenceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayPrefixListReferenceOutput - if *v == nil { - sv = &DeleteTransitGatewayPrefixListReferenceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPrefixListReference", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(&sv.TransitGatewayPrefixListReference, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteOutput(v **DeleteTransitGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayRouteOutput - if *v == nil { - sv = &DeleteTransitGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteTableAnnouncementOutput(v **DeleteTransitGatewayRouteTableAnnouncementOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayRouteTableAnnouncementOutput - if *v == nil { - sv = &DeleteTransitGatewayRouteTableAnnouncementOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayRouteTableAnnouncement", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncement(&sv.TransitGatewayRouteTableAnnouncement, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayRouteTableOutput(v **DeleteTransitGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayRouteTableOutput - if *v == nil { - sv = &DeleteTransitGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayRouteTable", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTable(&sv.TransitGatewayRouteTable, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteTransitGatewayVpcAttachmentOutput(v **DeleteTransitGatewayVpcAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteTransitGatewayVpcAttachmentOutput - if *v == nil { - sv = &DeleteTransitGatewayVpcAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayVpcAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&sv.TransitGatewayVpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVerifiedAccessEndpointOutput(v **DeleteVerifiedAccessEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVerifiedAccessEndpointOutput - if *v == nil { - sv = &DeleteVerifiedAccessEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpoint(&sv.VerifiedAccessEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVerifiedAccessGroupOutput(v **DeleteVerifiedAccessGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVerifiedAccessGroupOutput - if *v == nil { - sv = &DeleteVerifiedAccessGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessGroup(&sv.VerifiedAccessGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVerifiedAccessInstanceOutput(v **DeleteVerifiedAccessInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVerifiedAccessInstanceOutput - if *v == nil { - sv = &DeleteVerifiedAccessInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&sv.VerifiedAccessInstance, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVerifiedAccessTrustProviderOutput(v **DeleteVerifiedAccessTrustProviderOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVerifiedAccessTrustProviderOutput - if *v == nil { - sv = &DeleteVerifiedAccessTrustProviderOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&sv.VerifiedAccessTrustProvider, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVpcBlockPublicAccessExclusionOutput(v **DeleteVpcBlockPublicAccessExclusionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVpcBlockPublicAccessExclusionOutput - if *v == nil { - sv = &DeleteVpcBlockPublicAccessExclusionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcBlockPublicAccessExclusion", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(&sv.VpcBlockPublicAccessExclusion, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVpcEndpointConnectionNotificationsOutput(v **DeleteVpcEndpointConnectionNotificationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVpcEndpointConnectionNotificationsOutput - if *v == nil { - sv = &DeleteVpcEndpointConnectionNotificationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVpcEndpointServiceConfigurationsOutput(v **DeleteVpcEndpointServiceConfigurationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVpcEndpointServiceConfigurationsOutput - if *v == nil { - sv = &DeleteVpcEndpointServiceConfigurationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVpcEndpointsOutput(v **DeleteVpcEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVpcEndpointsOutput - if *v == nil { - sv = &DeleteVpcEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeleteVpcPeeringConnectionOutput(v **DeleteVpcPeeringConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteVpcPeeringConnectionOutput - if *v == nil { - sv = &DeleteVpcPeeringConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeprovisionByoipCidrOutput(v **DeprovisionByoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeprovisionByoipCidrOutput - if *v == nil { - sv = &DeprovisionByoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidr(&sv.ByoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeprovisionIpamByoasnOutput(v **DeprovisionIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeprovisionIpamByoasnOutput - if *v == nil { - sv = &DeprovisionIpamByoasnOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoasn", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoasn(&sv.Byoasn, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeprovisionIpamPoolCidrOutput(v **DeprovisionIpamPoolCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeprovisionIpamPoolCidrOutput - if *v == nil { - sv = &DeprovisionIpamPoolCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&sv.IpamPoolCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeprovisionPublicIpv4PoolCidrOutput(v **DeprovisionPublicIpv4PoolCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeprovisionPublicIpv4PoolCidrOutput - if *v == nil { - sv = &DeprovisionPublicIpv4PoolCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deprovisionedAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeprovisionedAddressSet(&sv.DeprovisionedAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeregisterImageOutput(v **DeregisterImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeregisterImageOutput - if *v == nil { - sv = &DeregisterImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deleteSnapshotResultSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeleteSnapshotResultSet(&sv.DeleteSnapshotResults, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeregisterInstanceEventNotificationAttributesOutput(v **DeregisterInstanceEventNotificationAttributesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeregisterInstanceEventNotificationAttributesOutput - if *v == nil { - sv = &DeregisterInstanceEventNotificationAttributesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTagAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTagNotificationAttribute(&sv.InstanceTagAttribute, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeregisterTransitGatewayMulticastGroupMembersOutput(v **DeregisterTransitGatewayMulticastGroupMembersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeregisterTransitGatewayMulticastGroupMembersOutput - if *v == nil { - sv = &DeregisterTransitGatewayMulticastGroupMembersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deregisteredMulticastGroupMembers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDeregisteredGroupMembers(&sv.DeregisteredMulticastGroupMembers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDeregisterTransitGatewayMulticastGroupSourcesOutput(v **DeregisterTransitGatewayMulticastGroupSourcesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeregisterTransitGatewayMulticastGroupSourcesOutput - if *v == nil { - sv = &DeregisterTransitGatewayMulticastGroupSourcesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deregisteredMulticastGroupSources", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDeregisteredGroupSources(&sv.DeregisteredMulticastGroupSources, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAccountAttributesOutput(v **DescribeAccountAttributesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAccountAttributesOutput - if *v == nil { - sv = &DescribeAccountAttributesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accountAttributeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAccountAttributeList(&sv.AccountAttributes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAddressesAttributeOutput(v **DescribeAddressesAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAddressesAttributeOutput - if *v == nil { - sv = &DescribeAddressesAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressSet(&sv.Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAddressesOutput(v **DescribeAddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAddressesOutput - if *v == nil { - sv = &DescribeAddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressList(&sv.Addresses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAddressTransfersOutput(v **DescribeAddressTransfersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAddressTransfersOutput - if *v == nil { - sv = &DescribeAddressTransfersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressTransferSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressTransferList(&sv.AddressTransfers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAggregateIdFormatOutput(v **DescribeAggregateIdFormatOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAggregateIdFormatOutput - if *v == nil { - sv = &DescribeAggregateIdFormatOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("statusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIdFormatList(&sv.Statuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("useLongIdsAggregated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.UseLongIdsAggregated = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAvailabilityZonesOutput(v **DescribeAvailabilityZonesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAvailabilityZonesOutput - if *v == nil { - sv = &DescribeAvailabilityZonesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availabilityZoneInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAvailabilityZoneList(&sv.AvailabilityZones, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeAwsNetworkPerformanceMetricSubscriptionsOutput(v **DescribeAwsNetworkPerformanceMetricSubscriptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeAwsNetworkPerformanceMetricSubscriptionsOutput - if *v == nil { - sv = &DescribeAwsNetworkPerformanceMetricSubscriptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("subscriptionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubscriptionList(&sv.Subscriptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeBundleTasksOutput(v **DescribeBundleTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeBundleTasksOutput - if *v == nil { - sv = &DescribeBundleTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bundleInstanceTasksSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBundleTaskList(&sv.BundleTasks, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeByoipCidrsOutput(v **DescribeByoipCidrsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeByoipCidrsOutput - if *v == nil { - sv = &DescribeByoipCidrsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidrSet(&sv.ByoipCidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionHistoryOutput(v **DescribeCapacityBlockExtensionHistoryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityBlockExtensionHistoryOutput - if *v == nil { - sv = &DescribeCapacityBlockExtensionHistoryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockExtensionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockExtensionSet(&sv.CapacityBlockExtensions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionOfferingsOutput(v **DescribeCapacityBlockExtensionOfferingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityBlockExtensionOfferingsOutput - if *v == nil { - sv = &DescribeCapacityBlockExtensionOfferingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockExtensionOfferingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSet(&sv.CapacityBlockExtensionOfferings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityBlockOfferingsOutput(v **DescribeCapacityBlockOfferingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityBlockOfferingsOutput - if *v == nil { - sv = &DescribeCapacityBlockOfferingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockOfferingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockOfferingSet(&sv.CapacityBlockOfferings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityBlocksOutput(v **DescribeCapacityBlocksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityBlocksOutput - if *v == nil { - sv = &DescribeCapacityBlocksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockSet(&sv.CapacityBlocks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityBlockStatusOutput(v **DescribeCapacityBlockStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityBlockStatusOutput - if *v == nil { - sv = &DescribeCapacityBlockStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockStatusSet(&sv.CapacityBlockStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityReservationBillingRequestsOutput(v **DescribeCapacityReservationBillingRequestsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityReservationBillingRequestsOutput - if *v == nil { - sv = &DescribeCapacityReservationBillingRequestsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationBillingRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationBillingRequestSet(&sv.CapacityReservationBillingRequests, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityReservationFleetsOutput(v **DescribeCapacityReservationFleetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityReservationFleetsOutput - if *v == nil { - sv = &DescribeCapacityReservationFleetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationFleetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationFleetSet(&sv.CapacityReservationFleets, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCapacityReservationsOutput(v **DescribeCapacityReservationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCapacityReservationsOutput - if *v == nil { - sv = &DescribeCapacityReservationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationSet(&sv.CapacityReservations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCarrierGatewaysOutput(v **DescribeCarrierGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCarrierGatewaysOutput - if *v == nil { - sv = &DescribeCarrierGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("carrierGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCarrierGatewaySet(&sv.CarrierGateways, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClassicLinkInstancesOutput(v **DescribeClassicLinkInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClassicLinkInstancesOutput - if *v == nil { - sv = &DescribeClassicLinkInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClassicLinkInstanceList(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClientVpnAuthorizationRulesOutput(v **DescribeClientVpnAuthorizationRulesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClientVpnAuthorizationRulesOutput - if *v == nil { - sv = &DescribeClientVpnAuthorizationRulesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("authorizationRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAuthorizationRuleSet(&sv.AuthorizationRules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClientVpnConnectionsOutput(v **DescribeClientVpnConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClientVpnConnectionsOutput - if *v == nil { - sv = &DescribeClientVpnConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connections", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnConnectionSet(&sv.Connections, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClientVpnEndpointsOutput(v **DescribeClientVpnEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClientVpnEndpointsOutput - if *v == nil { - sv = &DescribeClientVpnEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientVpnEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEndpointSet(&sv.ClientVpnEndpoints, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClientVpnRoutesOutput(v **DescribeClientVpnRoutesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClientVpnRoutesOutput - if *v == nil { - sv = &DescribeClientVpnRoutesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnRouteSet(&sv.Routes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeClientVpnTargetNetworksOutput(v **DescribeClientVpnTargetNetworksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeClientVpnTargetNetworksOutput - if *v == nil { - sv = &DescribeClientVpnTargetNetworksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientVpnTargetNetworks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetNetworkSet(&sv.ClientVpnTargetNetworks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCoipPoolsOutput(v **DescribeCoipPoolsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCoipPoolsOutput - if *v == nil { - sv = &DescribeCoipPoolsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipPoolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipPoolSet(&sv.CoipPools, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeConversionTasksOutput(v **DescribeConversionTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeConversionTasksOutput - if *v == nil { - sv = &DescribeConversionTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("conversionTasks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDescribeConversionTaskList(&sv.ConversionTasks, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeCustomerGatewaysOutput(v **DescribeCustomerGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeCustomerGatewaysOutput - if *v == nil { - sv = &DescribeCustomerGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("customerGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCustomerGatewayList(&sv.CustomerGateways, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeDeclarativePoliciesReportsOutput(v **DescribeDeclarativePoliciesReportsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeDeclarativePoliciesReportsOutput - if *v == nil { - sv = &DescribeDeclarativePoliciesReportsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("reportSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeclarativePoliciesReportList(&sv.Reports, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeDhcpOptionsOutput(v **DescribeDhcpOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeDhcpOptionsOutput - if *v == nil { - sv = &DescribeDhcpOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dhcpOptionsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDhcpOptionsList(&sv.DhcpOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeEgressOnlyInternetGatewaysOutput(v **DescribeEgressOnlyInternetGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeEgressOnlyInternetGatewaysOutput - if *v == nil { - sv = &DescribeEgressOnlyInternetGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("egressOnlyInternetGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEgressOnlyInternetGatewayList(&sv.EgressOnlyInternetGateways, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeElasticGpusOutput(v **DescribeElasticGpusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeElasticGpusOutput - if *v == nil { - sv = &DescribeElasticGpusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("elasticGpuSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentElasticGpuSet(&sv.ElasticGpuSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxResults", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxResults = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeExportImageTasksOutput(v **DescribeExportImageTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeExportImageTasksOutput - if *v == nil { - sv = &DescribeExportImageTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("exportImageTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportImageTaskList(&sv.ExportImageTasks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeExportTasksOutput(v **DescribeExportTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeExportTasksOutput - if *v == nil { - sv = &DescribeExportTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("exportTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportTaskList(&sv.ExportTasks, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFastLaunchImagesOutput(v **DescribeFastLaunchImagesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFastLaunchImagesOutput - if *v == nil { - sv = &DescribeFastLaunchImagesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fastLaunchImageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDescribeFastLaunchImagesSuccessSet(&sv.FastLaunchImages, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFastSnapshotRestoresOutput(v **DescribeFastSnapshotRestoresOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFastSnapshotRestoresOutput - if *v == nil { - sv = &DescribeFastSnapshotRestoresOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fastSnapshotRestoreSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDescribeFastSnapshotRestoreSuccessSet(&sv.FastSnapshotRestores, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFleetHistoryOutput(v **DescribeFleetHistoryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFleetHistoryOutput - if *v == nil { - sv = &DescribeFleetHistoryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - case strings.EqualFold("historyRecordSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHistoryRecordSet(&sv.HistoryRecords, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastEvaluatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastEvaluatedTime = ptr.Time(t) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFleetInstancesOutput(v **DescribeFleetInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFleetInstancesOutput - if *v == nil { - sv = &DescribeFleetInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activeInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentActiveInstanceSet(&sv.ActiveInstances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("fleetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FleetId = ptr.String(xtv) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFleetsOutput(v **DescribeFleetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFleetsOutput - if *v == nil { - sv = &DescribeFleetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fleetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFleetSet(&sv.Fleets, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFlowLogsOutput(v **DescribeFlowLogsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFlowLogsOutput - if *v == nil { - sv = &DescribeFlowLogsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("flowLogSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFlowLogSet(&sv.FlowLogs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFpgaImageAttributeOutput(v **DescribeFpgaImageAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFpgaImageAttributeOutput - if *v == nil { - sv = &DescribeFpgaImageAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgaImageAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaImageAttribute(&sv.FpgaImageAttribute, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeFpgaImagesOutput(v **DescribeFpgaImagesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeFpgaImagesOutput - if *v == nil { - sv = &DescribeFpgaImagesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgaImageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaImageList(&sv.FpgaImages, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeHostReservationOfferingsOutput(v **DescribeHostReservationOfferingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeHostReservationOfferingsOutput - if *v == nil { - sv = &DescribeHostReservationOfferingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("offeringSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHostOfferingSet(&sv.OfferingSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeHostReservationsOutput(v **DescribeHostReservationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeHostReservationsOutput - if *v == nil { - sv = &DescribeHostReservationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("hostReservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHostReservationSet(&sv.HostReservationSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeHostsOutput(v **DescribeHostsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeHostsOutput - if *v == nil { - sv = &DescribeHostsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("hostSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHostList(&sv.Hosts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIamInstanceProfileAssociationsOutput(v **DescribeIamInstanceProfileAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIamInstanceProfileAssociationsOutput - if *v == nil { - sv = &DescribeIamInstanceProfileAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("iamInstanceProfileAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociationSet(&sv.IamInstanceProfileAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIdentityIdFormatOutput(v **DescribeIdentityIdFormatOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIdentityIdFormatOutput - if *v == nil { - sv = &DescribeIdentityIdFormatOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("statusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIdFormatList(&sv.Statuses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIdFormatOutput(v **DescribeIdFormatOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIdFormatOutput - if *v == nil { - sv = &DescribeIdFormatOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("statusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIdFormatList(&sv.Statuses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeImageAttributeOutput(v **DescribeImageAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeImageAttributeOutput - if *v == nil { - sv = &DescribeImageAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("bootMode", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.BootMode, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("deregistrationProtection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.DeregistrationProtection, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("description", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.Description, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("imdsSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.ImdsSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("kernel", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.KernelId, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastLaunchedTime", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.LastLaunchedTime, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("launchPermission", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchPermissionList(&sv.LaunchPermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ramdisk", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.RamdiskId, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sriovNetSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.SriovNetSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tpmSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.TpmSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("uefiData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.UefiData, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeImagesOutput(v **DescribeImagesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeImagesOutput - if *v == nil { - sv = &DescribeImagesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imagesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImageList(&sv.Images, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeImportImageTasksOutput(v **DescribeImportImageTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeImportImageTasksOutput - if *v == nil { - sv = &DescribeImportImageTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("importImageTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportImageTaskList(&sv.ImportImageTasks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeImportSnapshotTasksOutput(v **DescribeImportSnapshotTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeImportSnapshotTasksOutput - if *v == nil { - sv = &DescribeImportSnapshotTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("importSnapshotTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportSnapshotTaskList(&sv.ImportSnapshotTasks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceAttributeOutput(v **DescribeInstanceAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceAttributeOutput - if *v == nil { - sv = &DescribeInstanceAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("blockDeviceMapping", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceBlockDeviceMappingList(&sv.BlockDeviceMappings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("disableApiStop", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.DisableApiStop, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("disableApiTermination", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.DisableApiTermination, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ebsOptimized", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EbsOptimized, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enaSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EnaSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enclaveOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnclaveOptions(&sv.EnclaveOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceInitiatedShutdownBehavior", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.InstanceInitiatedShutdownBehavior, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceType", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.InstanceType, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("kernel", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.KernelId, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ramdisk", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.RamdiskId, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("rootDeviceName", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.RootDeviceName, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sourceDestCheck", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.SourceDestCheck, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("sriovNetSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.SriovNetSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("userData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.UserData, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceConnectEndpointsOutput(v **DescribeInstanceConnectEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceConnectEndpointsOutput - if *v == nil { - sv = &DescribeInstanceConnectEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceConnectEndpointSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceConnectEndpointSet(&sv.InstanceConnectEndpoints, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceCreditSpecificationsOutput(v **DescribeInstanceCreditSpecificationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceCreditSpecificationsOutput - if *v == nil { - sv = &DescribeInstanceCreditSpecificationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceCreditSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceCreditSpecificationList(&sv.InstanceCreditSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceEventNotificationAttributesOutput(v **DescribeInstanceEventNotificationAttributesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceEventNotificationAttributesOutput - if *v == nil { - sv = &DescribeInstanceEventNotificationAttributesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTagAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTagNotificationAttribute(&sv.InstanceTagAttribute, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceEventWindowsOutput(v **DescribeInstanceEventWindowsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceEventWindowsOutput - if *v == nil { - sv = &DescribeInstanceEventWindowsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindowSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindowSet(&sv.InstanceEventWindows, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceImageMetadataOutput(v **DescribeInstanceImageMetadataOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceImageMetadataOutput - if *v == nil { - sv = &DescribeInstanceImageMetadataOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceImageMetadataSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceImageMetadataList(&sv.InstanceImageMetadata, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstancesOutput(v **DescribeInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstancesOutput - if *v == nil { - sv = &DescribeInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("reservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservationList(&sv.Reservations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceStatusOutput(v **DescribeInstanceStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceStatusOutput - if *v == nil { - sv = &DescribeInstanceStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusList(&sv.InstanceStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceTopologyOutput(v **DescribeInstanceTopologyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceTopologyOutput - if *v == nil { - sv = &DescribeInstanceTopologyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceSet(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceTypeOfferingsOutput(v **DescribeInstanceTypeOfferingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceTypeOfferingsOutput - if *v == nil { - sv = &DescribeInstanceTypeOfferingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTypeOfferingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTypeOfferingsList(&sv.InstanceTypeOfferings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInstanceTypesOutput(v **DescribeInstanceTypesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInstanceTypesOutput - if *v == nil { - sv = &DescribeInstanceTypesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTypeInfoList(&sv.InstanceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeInternetGatewaysOutput(v **DescribeInternetGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeInternetGatewaysOutput - if *v == nil { - sv = &DescribeInternetGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("internetGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInternetGatewayList(&sv.InternetGateways, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamByoasnOutput(v **DescribeIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamByoasnOutput - if *v == nil { - sv = &DescribeIpamByoasnOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoasnSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoasnSet(&sv.Byoasns, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamExternalResourceVerificationTokensOutput(v **DescribeIpamExternalResourceVerificationTokensOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamExternalResourceVerificationTokensOutput - if *v == nil { - sv = &DescribeIpamExternalResourceVerificationTokensOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamExternalResourceVerificationTokenSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamExternalResourceVerificationTokenSet(&sv.IpamExternalResourceVerificationTokens, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamPoolsOutput(v **DescribeIpamPoolsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamPoolsOutput - if *v == nil { - sv = &DescribeIpamPoolsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolSet(&sv.IpamPools, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveriesOutput(v **DescribeIpamResourceDiscoveriesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamResourceDiscoveriesOutput - if *v == nil { - sv = &DescribeIpamResourceDiscoveriesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscoverySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscoverySet(&sv.IpamResourceDiscoveries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsOutput(v **DescribeIpamResourceDiscoveryAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamResourceDiscoveryAssociationsOutput - if *v == nil { - sv = &DescribeIpamResourceDiscoveryAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscoveryAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociationSet(&sv.IpamResourceDiscoveryAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(v **DescribeIpamScopesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamScopesOutput - if *v == nil { - sv = &DescribeIpamScopesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamScopeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamScopeSet(&sv.IpamScopes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpamsOutput(v **DescribeIpamsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpamsOutput - if *v == nil { - sv = &DescribeIpamsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamSet(&sv.Ipams, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(v **DescribeIpv6PoolsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeIpv6PoolsOutput - if *v == nil { - sv = &DescribeIpv6PoolsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6PoolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6PoolSet(&sv.Ipv6Pools, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(v **DescribeKeyPairsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeKeyPairsOutput - if *v == nil { - sv = &DescribeKeyPairsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("keySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentKeyPairList(&sv.KeyPairs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(v **DescribeLaunchTemplatesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLaunchTemplatesOutput - if *v == nil { - sv = &DescribeLaunchTemplatesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateSet(&sv.LaunchTemplates, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(v **DescribeLaunchTemplateVersionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLaunchTemplateVersionsOutput - if *v == nil { - sv = &DescribeLaunchTemplateVersionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateVersionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateVersionSet(&sv.LaunchTemplateVersions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(v **DescribeLocalGatewayRouteTablesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewayRouteTablesOutput - if *v == nil { - sv = &DescribeLocalGatewayRouteTablesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableSet(&sv.LocalGatewayRouteTables, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput(v **DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput - if *v == nil { - sv = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationSet(&sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsOutput(v **DescribeLocalGatewayRouteTableVpcAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewayRouteTableVpcAssociationsOutput - if *v == nil { - sv = &DescribeLocalGatewayRouteTableVpcAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayRouteTableVpcAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociationSet(&sv.LocalGatewayRouteTableVpcAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLocalGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewaysOutput - if *v == nil { - sv = &DescribeLocalGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewaySet(&sv.LocalGateways, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsOutput(v **DescribeLocalGatewayVirtualInterfaceGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewayVirtualInterfaceGroupsOutput - if *v == nil { - sv = &DescribeLocalGatewayVirtualInterfaceGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterfaceGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroupSet(&sv.LocalGatewayVirtualInterfaceGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutput(v **DescribeLocalGatewayVirtualInterfacesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLocalGatewayVirtualInterfacesOutput - if *v == nil { - sv = &DescribeLocalGatewayVirtualInterfacesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("localGatewayVirtualInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceSet(&sv.LocalGatewayVirtualInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **DescribeLockedSnapshotsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeLockedSnapshotsOutput - if *v == nil { - sv = &DescribeLockedSnapshotsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("snapshotSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLockedSnapshotsInfoList(&sv.Snapshots, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(v **DescribeMacHostsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeMacHostsOutput - if *v == nil { - sv = &DescribeMacHostsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("macHostSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacHostList(&sv.MacHosts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeMacModificationTasksOutput(v **DescribeMacModificationTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeMacModificationTasksOutput - if *v == nil { - sv = &DescribeMacModificationTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("macModificationTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacModificationTaskList(&sv.MacModificationTasks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **DescribeManagedPrefixListsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeManagedPrefixListsOutput - if *v == nil { - sv = &DescribeManagedPrefixListsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("prefixListSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(v **DescribeMovingAddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeMovingAddressesOutput - if *v == nil { - sv = &DescribeMovingAddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("movingAddressStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMovingAddressStatusSet(&sv.MovingAddressStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(v **DescribeNatGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNatGatewaysOutput - if *v == nil { - sv = &DescribeNatGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayList(&sv.NatGateways, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(v **DescribeNetworkAclsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkAclsOutput - if *v == nil { - sv = &DescribeNetworkAclsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkAclSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkAclList(&sv.NetworkAcls, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesOutput(v **DescribeNetworkInsightsAccessScopeAnalysesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInsightsAccessScopeAnalysesOutput - if *v == nil { - sv = &DescribeNetworkInsightsAccessScopeAnalysesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeAnalysisSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysisList(&sv.NetworkInsightsAccessScopeAnalyses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput(v **DescribeNetworkInsightsAccessScopesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInsightsAccessScopesOutput - if *v == nil { - sv = &DescribeNetworkInsightsAccessScopesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeList(&sv.NetworkInsightsAccessScopes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(v **DescribeNetworkInsightsAnalysesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInsightsAnalysesOutput - if *v == nil { - sv = &DescribeNetworkInsightsAnalysesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAnalysisSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysisList(&sv.NetworkInsightsAnalyses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(v **DescribeNetworkInsightsPathsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInsightsPathsOutput - if *v == nil { - sv = &DescribeNetworkInsightsPathsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsPathSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsPathList(&sv.NetworkInsightsPaths, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v **DescribeNetworkInterfaceAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInterfaceAttributeOutput - if *v == nil { - sv = &DescribeNetworkInterfaceAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatePublicIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AssociatePublicIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("attachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceAttachment(&sv.Attachment, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("description", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.Description, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("sourceDestCheck", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.SourceDestCheck, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput(v **DescribeNetworkInterfacePermissionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInterfacePermissionsOutput - if *v == nil { - sv = &DescribeNetworkInterfacePermissionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInterfacePermissions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfacePermissionList(&sv.NetworkInterfacePermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **DescribeNetworkInterfacesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeNetworkInterfacesOutput - if *v == nil { - sv = &DescribeNetworkInterfacesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeOutpostLagsOutput(v **DescribeOutpostLagsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeOutpostLagsOutput - if *v == nil { - sv = &DescribeOutpostLagsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("outpostLagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentOutpostLagSet(&sv.OutpostLags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(v **DescribePlacementGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribePlacementGroupsOutput - if *v == nil { - sv = &DescribePlacementGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("placementGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementGroupList(&sv.PlacementGroups, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(v **DescribePrefixListsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribePrefixListsOutput - if *v == nil { - sv = &DescribePrefixListsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("prefixListSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(v **DescribePrincipalIdFormatOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribePrincipalIdFormatOutput - if *v == nil { - sv = &DescribePrincipalIdFormatOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("principalSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrincipalIdFormatList(&sv.Principals, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribePublicIpv4PoolsOutput(v **DescribePublicIpv4PoolsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribePublicIpv4PoolsOutput - if *v == nil { - sv = &DescribePublicIpv4PoolsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("publicIpv4PoolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPublicIpv4PoolSet(&sv.PublicIpv4Pools, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRegionsOutput(v **DescribeRegionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRegionsOutput - if *v == nil { - sv = &DescribeRegionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("regionInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRegionList(&sv.Regions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(v **DescribeReplaceRootVolumeTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReplaceRootVolumeTasksOutput - if *v == nil { - sv = &DescribeReplaceRootVolumeTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("replaceRootVolumeTaskSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReplaceRootVolumeTasks(&sv.ReplaceRootVolumeTasks, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(v **DescribeReservedInstancesListingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReservedInstancesListingsOutput - if *v == nil { - sv = &DescribeReservedInstancesListingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesListingsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesListingList(&sv.ReservedInstancesListings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutput(v **DescribeReservedInstancesModificationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReservedInstancesModificationsOutput - if *v == nil { - sv = &DescribeReservedInstancesModificationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("reservedInstancesModificationsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesModificationList(&sv.ReservedInstancesModifications, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOfferingsOutput(v **DescribeReservedInstancesOfferingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReservedInstancesOfferingsOutput - if *v == nil { - sv = &DescribeReservedInstancesOfferingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("reservedInstancesOfferingsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesOfferingList(&sv.ReservedInstancesOfferings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReservedInstancesOutput - if *v == nil { - sv = &DescribeReservedInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesList(&sv.ReservedInstances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRouteServerEndpointsOutput(v **DescribeRouteServerEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRouteServerEndpointsOutput - if *v == nil { - sv = &DescribeRouteServerEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeServerEndpointSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerEndpointsList(&sv.RouteServerEndpoints, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRouteServerPeersOutput(v **DescribeRouteServerPeersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRouteServerPeersOutput - if *v == nil { - sv = &DescribeRouteServerPeersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeServerPeerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPeersList(&sv.RouteServerPeers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRouteServersOutput(v **DescribeRouteServersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRouteServersOutput - if *v == nil { - sv = &DescribeRouteServersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeServerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServersList(&sv.RouteServers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(v **DescribeRouteTablesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRouteTablesOutput - if *v == nil { - sv = &DescribeRouteTablesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeTableSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableList(&sv.RouteTables, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutput(v **DescribeScheduledInstanceAvailabilityOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeScheduledInstanceAvailabilityOutput - if *v == nil { - sv = &DescribeScheduledInstanceAvailabilityOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("scheduledInstanceAvailabilitySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceAvailabilitySet(&sv.ScheduledInstanceAvailabilitySet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeScheduledInstancesOutput(v **DescribeScheduledInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeScheduledInstancesOutput - if *v == nil { - sv = &DescribeScheduledInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("scheduledInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceSet(&sv.ScheduledInstanceSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupReferencesOutput(v **DescribeSecurityGroupReferencesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSecurityGroupReferencesOutput - if *v == nil { - sv = &DescribeSecurityGroupReferencesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("securityGroupReferenceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupReferences(&sv.SecurityGroupReferenceSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(v **DescribeSecurityGroupRulesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSecurityGroupRulesOutput - if *v == nil { - sv = &DescribeSecurityGroupRulesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupRuleList(&sv.SecurityGroupRules, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupsOutput(v **DescribeSecurityGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSecurityGroupsOutput - if *v == nil { - sv = &DescribeSecurityGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupInfo", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupList(&sv.SecurityGroups, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupVpcAssociationsOutput(v **DescribeSecurityGroupVpcAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSecurityGroupVpcAssociationsOutput - if *v == nil { - sv = &DescribeSecurityGroupVpcAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupVpcAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociationList(&sv.SecurityGroupVpcAssociations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeServiceLinkVirtualInterfacesOutput(v **DescribeServiceLinkVirtualInterfacesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeServiceLinkVirtualInterfacesOutput - if *v == nil { - sv = &DescribeServiceLinkVirtualInterfacesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("serviceLinkVirtualInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceLinkVirtualInterfaceSet(&sv.ServiceLinkVirtualInterfaces, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSnapshotAttributeOutput(v **DescribeSnapshotAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSnapshotAttributeOutput - if *v == nil { - sv = &DescribeSnapshotAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("createVolumePermission", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCreateVolumePermissionList(&sv.CreateVolumePermissions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSnapshotsOutput(v **DescribeSnapshotsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSnapshotsOutput - if *v == nil { - sv = &DescribeSnapshotsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("snapshotSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotList(&sv.Snapshots, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSnapshotTierStatusOutput(v **DescribeSnapshotTierStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSnapshotTierStatusOutput - if *v == nil { - sv = &DescribeSnapshotTierStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("snapshotTierStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotTierStatusSet(&sv.SnapshotTierStatuses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotDatafeedSubscriptionOutput(v **DescribeSpotDatafeedSubscriptionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotDatafeedSubscriptionOutput - if *v == nil { - sv = &DescribeSpotDatafeedSubscriptionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotDatafeedSubscription", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotDatafeedSubscription(&sv.SpotDatafeedSubscription, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotFleetInstancesOutput(v **DescribeSpotFleetInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotFleetInstancesOutput - if *v == nil { - sv = &DescribeSpotFleetInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activeInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentActiveInstanceSet(&sv.ActiveInstances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotFleetRequestHistoryOutput(v **DescribeSpotFleetRequestHistoryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotFleetRequestHistoryOutput - if *v == nil { - sv = &DescribeSpotFleetRequestHistoryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("historyRecordSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentHistoryRecords(&sv.HistoryRecords, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("lastEvaluatedTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastEvaluatedTime = ptr.Time(t) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotFleetRequestsOutput(v **DescribeSpotFleetRequestsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotFleetRequestsOutput - if *v == nil { - sv = &DescribeSpotFleetRequestsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotFleetRequestConfigSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotFleetRequestConfigSet(&sv.SpotFleetRequestConfigs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotInstanceRequestsOutput(v **DescribeSpotInstanceRequestsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotInstanceRequestsOutput - if *v == nil { - sv = &DescribeSpotInstanceRequestsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotInstanceRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotInstanceRequestList(&sv.SpotInstanceRequests, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSpotPriceHistoryOutput(v **DescribeSpotPriceHistoryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSpotPriceHistoryOutput - if *v == nil { - sv = &DescribeSpotPriceHistoryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotPriceHistorySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotPriceHistoryList(&sv.SpotPriceHistory, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeStaleSecurityGroupsOutput(v **DescribeStaleSecurityGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeStaleSecurityGroupsOutput - if *v == nil { - sv = &DescribeStaleSecurityGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("staleSecurityGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStaleSecurityGroupSet(&sv.StaleSecurityGroupSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeStoreImageTasksOutput(v **DescribeStoreImageTasksOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeStoreImageTasksOutput - if *v == nil { - sv = &DescribeStoreImageTasksOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("storeImageTaskResultSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentStoreImageTaskResultSet(&sv.StoreImageTaskResults, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSubnetsOutput(v **DescribeSubnetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSubnetsOutput - if *v == nil { - sv = &DescribeSubnetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("subnetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetList(&sv.Subnets, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTagsOutput - if *v == nil { - sv = &DescribeTagsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagDescriptionList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTrafficMirrorFilterRulesOutput(v **DescribeTrafficMirrorFilterRulesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTrafficMirrorFilterRulesOutput - if *v == nil { - sv = &DescribeTrafficMirrorFilterRulesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorFilterRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRuleSet(&sv.TrafficMirrorFilterRules, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTrafficMirrorFiltersOutput(v **DescribeTrafficMirrorFiltersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTrafficMirrorFiltersOutput - if *v == nil { - sv = &DescribeTrafficMirrorFiltersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorFilterSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterSet(&sv.TrafficMirrorFilters, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTrafficMirrorSessionsOutput(v **DescribeTrafficMirrorSessionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTrafficMirrorSessionsOutput - if *v == nil { - sv = &DescribeTrafficMirrorSessionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorSessionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorSessionSet(&sv.TrafficMirrorSessions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTrafficMirrorTargetsOutput(v **DescribeTrafficMirrorTargetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTrafficMirrorTargetsOutput - if *v == nil { - sv = &DescribeTrafficMirrorTargetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("trafficMirrorTargetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorTargetSet(&sv.TrafficMirrorTargets, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayAttachmentsOutput(v **DescribeTransitGatewayAttachmentsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayAttachmentsOutput - if *v == nil { - sv = &DescribeTransitGatewayAttachmentsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayAttachments", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentList(&sv.TransitGatewayAttachments, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayConnectPeersOutput(v **DescribeTransitGatewayConnectPeersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayConnectPeersOutput - if *v == nil { - sv = &DescribeTransitGatewayConnectPeersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayConnectPeerSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectPeerList(&sv.TransitGatewayConnectPeers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayConnectsOutput(v **DescribeTransitGatewayConnectsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayConnectsOutput - if *v == nil { - sv = &DescribeTransitGatewayConnectsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayConnectSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayConnectList(&sv.TransitGatewayConnects, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayMulticastDomainsOutput(v **DescribeTransitGatewayMulticastDomainsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayMulticastDomainsOutput - if *v == nil { - sv = &DescribeTransitGatewayMulticastDomainsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayMulticastDomains", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainList(&sv.TransitGatewayMulticastDomains, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayPeeringAttachmentsOutput(v **DescribeTransitGatewayPeeringAttachmentsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayPeeringAttachmentsOutput - if *v == nil { - sv = &DescribeTransitGatewayPeeringAttachmentsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayPeeringAttachments", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachmentList(&sv.TransitGatewayPeeringAttachments, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayPolicyTablesOutput(v **DescribeTransitGatewayPolicyTablesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayPolicyTablesOutput - if *v == nil { - sv = &DescribeTransitGatewayPolicyTablesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayPolicyTables", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableList(&sv.TransitGatewayPolicyTables, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayRouteTableAnnouncementsOutput(v **DescribeTransitGatewayRouteTableAnnouncementsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayRouteTableAnnouncementsOutput - if *v == nil { - sv = &DescribeTransitGatewayRouteTableAnnouncementsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTableAnnouncements", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAnnouncementList(&sv.TransitGatewayRouteTableAnnouncements, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayRouteTablesOutput(v **DescribeTransitGatewayRouteTablesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayRouteTablesOutput - if *v == nil { - sv = &DescribeTransitGatewayRouteTablesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTables", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableList(&sv.TransitGatewayRouteTables, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewaysOutput(v **DescribeTransitGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewaysOutput - if *v == nil { - sv = &DescribeTransitGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayList(&sv.TransitGateways, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTransitGatewayVpcAttachmentsOutput(v **DescribeTransitGatewayVpcAttachmentsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTransitGatewayVpcAttachmentsOutput - if *v == nil { - sv = &DescribeTransitGatewayVpcAttachmentsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayVpcAttachments", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachmentList(&sv.TransitGatewayVpcAttachments, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeTrunkInterfaceAssociationsOutput(v **DescribeTrunkInterfaceAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeTrunkInterfaceAssociationsOutput - if *v == nil { - sv = &DescribeTrunkInterfaceAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("interfaceAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrunkInterfaceAssociationList(&sv.InterfaceAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVerifiedAccessEndpointsOutput(v **DescribeVerifiedAccessEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVerifiedAccessEndpointsOutput - if *v == nil { - sv = &DescribeVerifiedAccessEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessEndpointSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointList(&sv.VerifiedAccessEndpoints, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVerifiedAccessGroupsOutput(v **DescribeVerifiedAccessGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVerifiedAccessGroupsOutput - if *v == nil { - sv = &DescribeVerifiedAccessGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessGroupList(&sv.VerifiedAccessGroups, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVerifiedAccessInstanceLoggingConfigurationsOutput(v **DescribeVerifiedAccessInstanceLoggingConfigurationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVerifiedAccessInstanceLoggingConfigurationsOutput - if *v == nil { - sv = &DescribeVerifiedAccessInstanceLoggingConfigurationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("loggingConfigurationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfigurationList(&sv.LoggingConfigurations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVerifiedAccessInstancesOutput(v **DescribeVerifiedAccessInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVerifiedAccessInstancesOutput - if *v == nil { - sv = &DescribeVerifiedAccessInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceList(&sv.VerifiedAccessInstances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVerifiedAccessTrustProvidersOutput(v **DescribeVerifiedAccessTrustProvidersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVerifiedAccessTrustProvidersOutput - if *v == nil { - sv = &DescribeVerifiedAccessTrustProvidersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessTrustProviderSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProviderList(&sv.VerifiedAccessTrustProviders, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVolumeAttributeOutput(v **DescribeVolumeAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVolumeAttributeOutput - if *v == nil { - sv = &DescribeVolumeAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoEnableIO", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.AutoEnableIO, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("productCodes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentProductCodeList(&sv.ProductCodes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVolumesModificationsOutput(v **DescribeVolumesModificationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVolumesModificationsOutput - if *v == nil { - sv = &DescribeVolumesModificationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("volumeModificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeModificationList(&sv.VolumesModifications, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVolumesOutput(v **DescribeVolumesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVolumesOutput - if *v == nil { - sv = &DescribeVolumesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("volumeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeList(&sv.Volumes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVolumeStatusOutput(v **DescribeVolumeStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVolumeStatusOutput - if *v == nil { - sv = &DescribeVolumeStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("volumeStatusSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeStatusList(&sv.VolumeStatuses, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcAttributeOutput(v **DescribeVpcAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcAttributeOutput - if *v == nil { - sv = &DescribeVpcAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("enableDnsHostnames", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EnableDnsHostnames, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enableDnsSupport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EnableDnsSupport, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("enableNetworkAddressUsageMetrics", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EnableNetworkAddressUsageMetrics, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcBlockPublicAccessExclusionsOutput(v **DescribeVpcBlockPublicAccessExclusionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcBlockPublicAccessExclusionsOutput - if *v == nil { - sv = &DescribeVpcBlockPublicAccessExclusionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcBlockPublicAccessExclusionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusionList(&sv.VpcBlockPublicAccessExclusions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcBlockPublicAccessOptionsOutput(v **DescribeVpcBlockPublicAccessOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcBlockPublicAccessOptionsOutput - if *v == nil { - sv = &DescribeVpcBlockPublicAccessOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcBlockPublicAccessOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessOptions(&sv.VpcBlockPublicAccessOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcClassicLinkDnsSupportOutput(v **DescribeVpcClassicLinkDnsSupportOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcClassicLinkDnsSupportOutput - if *v == nil { - sv = &DescribeVpcClassicLinkDnsSupportOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClassicLinkDnsSupportList(&sv.Vpcs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcClassicLinkOutput(v **DescribeVpcClassicLinkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcClassicLinkOutput - if *v == nil { - sv = &DescribeVpcClassicLinkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcClassicLinkList(&sv.Vpcs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointAssociationsOutput(v **DescribeVpcEndpointAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointAssociationsOutput - if *v == nil { - sv = &DescribeVpcEndpointAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEndpointAssociationSet(&sv.VpcEndpointAssociations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointConnectionNotificationsOutput(v **DescribeVpcEndpointConnectionNotificationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointConnectionNotificationsOutput - if *v == nil { - sv = &DescribeVpcEndpointConnectionNotificationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("connectionNotificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConnectionNotificationSet(&sv.ConnectionNotificationSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointConnectionsOutput(v **DescribeVpcEndpointConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointConnectionsOutput - if *v == nil { - sv = &DescribeVpcEndpointConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointConnectionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEndpointConnectionSet(&sv.VpcEndpointConnections, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointServiceConfigurationsOutput(v **DescribeVpcEndpointServiceConfigurationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointServiceConfigurationsOutput - if *v == nil { - sv = &DescribeVpcEndpointServiceConfigurationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("serviceConfigurationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceConfigurationSet(&sv.ServiceConfigurations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointServicePermissionsOutput(v **DescribeVpcEndpointServicePermissionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointServicePermissionsOutput - if *v == nil { - sv = &DescribeVpcEndpointServicePermissionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allowedPrincipals", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAllowedPrincipalSet(&sv.AllowedPrincipals, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointServicesOutput(v **DescribeVpcEndpointServicesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointServicesOutput - if *v == nil { - sv = &DescribeVpcEndpointServicesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("serviceDetailSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentServiceDetailSet(&sv.ServiceDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("serviceNameSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentValueStringList(&sv.ServiceNames, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcEndpointsOutput(v **DescribeVpcEndpointsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcEndpointsOutput - if *v == nil { - sv = &DescribeVpcEndpointsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcEndpointSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcEndpointSet(&sv.VpcEndpoints, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcPeeringConnectionsOutput(v **DescribeVpcPeeringConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcPeeringConnectionsOutput - if *v == nil { - sv = &DescribeVpcPeeringConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcPeeringConnectionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcPeeringConnectionList(&sv.VpcPeeringConnections, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpcsOutput(v **DescribeVpcsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpcsOutput - if *v == nil { - sv = &DescribeVpcsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpcSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcList(&sv.Vpcs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpnConnectionsOutput(v **DescribeVpnConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpnConnectionsOutput - if *v == nil { - sv = &DescribeVpnConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnectionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnectionList(&sv.VpnConnections, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeVpnGatewaysOutput(v **DescribeVpnGatewaysOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeVpnGatewaysOutput - if *v == nil { - sv = &DescribeVpnGatewaysOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnGatewayList(&sv.VpnGateways, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDetachClassicLinkVpcOutput(v **DetachClassicLinkVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DetachClassicLinkVpcOutput - if *v == nil { - sv = &DetachClassicLinkVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDetachVerifiedAccessTrustProviderOutput(v **DetachVerifiedAccessTrustProviderOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DetachVerifiedAccessTrustProviderOutput - if *v == nil { - sv = &DetachVerifiedAccessTrustProviderOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&sv.VerifiedAccessInstance, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&sv.VerifiedAccessTrustProvider, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDetachVolumeOutput(v **DetachVolumeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DetachVolumeOutput - if *v == nil { - sv = &DetachVolumeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedResource", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociatedResource = ptr.String(xtv) - } - - case strings.EqualFold("attachTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.AttachTime = ptr.Time(t) - } - - case strings.EqualFold("deleteOnTermination", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.DeleteOnTermination = ptr.Bool(xtv) - } - - case strings.EqualFold("device", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Device = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceOwningService", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceOwningService = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.VolumeAttachmentState(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableAddressTransferOutput(v **DisableAddressTransferOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableAddressTransferOutput - if *v == nil { - sv = &DisableAddressTransferOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressTransfer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressTransfer(&sv.AddressTransfer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableAllowedImagesSettingsOutput(v **DisableAllowedImagesSettingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableAllowedImagesSettingsOutput - if *v == nil { - sv = &DisableAllowedImagesSettingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allowedImagesSettingsState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllowedImagesSettingsState = types.AllowedImagesSettingsDisabledState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableAwsNetworkPerformanceMetricSubscriptionOutput(v **DisableAwsNetworkPerformanceMetricSubscriptionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableAwsNetworkPerformanceMetricSubscriptionOutput - if *v == nil { - sv = &DisableAwsNetworkPerformanceMetricSubscriptionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("output", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Output = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableEbsEncryptionByDefaultOutput(v **DisableEbsEncryptionByDefaultOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableEbsEncryptionByDefaultOutput - if *v == nil { - sv = &DisableEbsEncryptionByDefaultOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ebsEncryptionByDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsEncryptionByDefault = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableFastLaunchOutput(v **DisableFastLaunchOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableFastLaunchOutput - if *v == nil { - sv = &DisableFastLaunchOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchLaunchTemplateSpecificationResponse(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxParallelLaunches", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxParallelLaunches = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.FastLaunchResourceType(xtv) - } - - case strings.EqualFold("snapshotConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchSnapshotConfigurationResponse(&sv.SnapshotConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastLaunchStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - case strings.EqualFold("stateTransitionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StateTransitionTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableFastSnapshotRestoresOutput(v **DisableFastSnapshotRestoresOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableFastSnapshotRestoresOutput - if *v == nil { - sv = &DisableFastSnapshotRestoresOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreSuccessSet(&sv.Successful, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDisableFastSnapshotRestoreErrorSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableImageBlockPublicAccessOutput(v **DisableImageBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableImageBlockPublicAccessOutput - if *v == nil { - sv = &DisableImageBlockPublicAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageBlockPublicAccessState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageBlockPublicAccessState = types.ImageBlockPublicAccessDisabledState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableImageDeprecationOutput(v **DisableImageDeprecationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableImageDeprecationOutput - if *v == nil { - sv = &DisableImageDeprecationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableImageDeregistrationProtectionOutput(v **DisableImageDeregistrationProtectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableImageDeregistrationProtectionOutput - if *v == nil { - sv = &DisableImageDeregistrationProtectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Return = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableImageOutput(v **DisableImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableImageOutput - if *v == nil { - sv = &DisableImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableIpamOrganizationAdminAccountOutput(v **DisableIpamOrganizationAdminAccountOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableIpamOrganizationAdminAccountOutput - if *v == nil { - sv = &DisableIpamOrganizationAdminAccountOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("success", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Success = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableRouteServerPropagationOutput(v **DisableRouteServerPropagationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableRouteServerPropagationOutput - if *v == nil { - sv = &DisableRouteServerPropagationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerPropagation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPropagation(&sv.RouteServerPropagation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableSerialConsoleAccessOutput(v **DisableSerialConsoleAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableSerialConsoleAccessOutput - if *v == nil { - sv = &DisableSerialConsoleAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("serialConsoleAccessEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SerialConsoleAccessEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableSnapshotBlockPublicAccessOutput(v **DisableSnapshotBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableSnapshotBlockPublicAccessOutput - if *v == nil { - sv = &DisableSnapshotBlockPublicAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotBlockPublicAccessState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableTransitGatewayRouteTablePropagationOutput(v **DisableTransitGatewayRouteTablePropagationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableTransitGatewayRouteTablePropagationOutput - if *v == nil { - sv = &DisableTransitGatewayRouteTablePropagationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("propagation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPropagation(&sv.Propagation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableVpcClassicLinkDnsSupportOutput(v **DisableVpcClassicLinkDnsSupportOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableVpcClassicLinkDnsSupportOutput - if *v == nil { - sv = &DisableVpcClassicLinkDnsSupportOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisableVpcClassicLinkOutput(v **DisableVpcClassicLinkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisableVpcClassicLinkOutput - if *v == nil { - sv = &DisableVpcClassicLinkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateCapacityReservationBillingOwnerOutput(v **DisassociateCapacityReservationBillingOwnerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateCapacityReservationBillingOwnerOutput - if *v == nil { - sv = &DisassociateCapacityReservationBillingOwnerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateClientVpnTargetNetworkOutput(v **DisassociateClientVpnTargetNetworkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateClientVpnTargetNetworkOutput - if *v == nil { - sv = &DisassociateClientVpnTargetNetworkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssociationId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociationStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateEnclaveCertificateIamRoleOutput(v **DisassociateEnclaveCertificateIamRoleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateEnclaveCertificateIamRoleOutput - if *v == nil { - sv = &DisassociateEnclaveCertificateIamRoleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateIamInstanceProfileOutput(v **DisassociateIamInstanceProfileOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateIamInstanceProfileOutput - if *v == nil { - sv = &DisassociateIamInstanceProfileOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("iamInstanceProfileAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociation(&sv.IamInstanceProfileAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateInstanceEventWindowOutput(v **DisassociateInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateInstanceEventWindowOutput - if *v == nil { - sv = &DisassociateInstanceEventWindowOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindow", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&sv.InstanceEventWindow, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateIpamByoasnOutput(v **DisassociateIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateIpamByoasnOutput - if *v == nil { - sv = &DisassociateIpamByoasnOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("asnAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAsnAssociation(&sv.AsnAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateIpamResourceDiscoveryOutput(v **DisassociateIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateIpamResourceDiscoveryOutput - if *v == nil { - sv = &DisassociateIpamResourceDiscoveryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscoveryAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociation(&sv.IpamResourceDiscoveryAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateNatGatewayAddressOutput(v **DisassociateNatGatewayAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateNatGatewayAddressOutput - if *v == nil { - sv = &DisassociateNatGatewayAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewayAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayAddressList(&sv.NatGatewayAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateRouteServerOutput(v **DisassociateRouteServerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateRouteServerOutput - if *v == nil { - sv = &DisassociateRouteServerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerAssociation(&sv.RouteServerAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateSecurityGroupVpcOutput(v **DisassociateSecurityGroupVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateSecurityGroupVpcOutput - if *v == nil { - sv = &DisassociateSecurityGroupVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SecurityGroupVpcAssociationState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateSubnetCidrBlockOutput(v **DisassociateSubnetCidrBlockOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateSubnetCidrBlockOutput - if *v == nil { - sv = &DisassociateSubnetCidrBlockOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6CidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetIpv6CidrBlockAssociation(&sv.Ipv6CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubnetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateTransitGatewayMulticastDomainOutput(v **DisassociateTransitGatewayMulticastDomainOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateTransitGatewayMulticastDomainOutput - if *v == nil { - sv = &DisassociateTransitGatewayMulticastDomainOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociations(&sv.Associations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateTransitGatewayPolicyTableOutput(v **DisassociateTransitGatewayPolicyTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateTransitGatewayPolicyTableOutput - if *v == nil { - sv = &DisassociateTransitGatewayPolicyTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateTransitGatewayRouteTableOutput(v **DisassociateTransitGatewayRouteTableOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateTransitGatewayRouteTableOutput - if *v == nil { - sv = &DisassociateTransitGatewayRouteTableOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("association", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAssociation(&sv.Association, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateTrunkInterfaceOutput(v **DisassociateTrunkInterfaceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateTrunkInterfaceOutput - if *v == nil { - sv = &DisassociateTrunkInterfaceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDisassociateVpcCidrBlockOutput(v **DisassociateVpcCidrBlockOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DisassociateVpcCidrBlockOutput - if *v == nil { - sv = &DisassociateVpcCidrBlockOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("cidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcCidrBlockAssociation(&sv.CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ipv6CidrBlockAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcIpv6CidrBlockAssociation(&sv.Ipv6CidrBlockAssociation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("vpcId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpcId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableAddressTransferOutput(v **EnableAddressTransferOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableAddressTransferOutput - if *v == nil { - sv = &EnableAddressTransferOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addressTransfer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressTransfer(&sv.AddressTransfer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableAllowedImagesSettingsOutput(v **EnableAllowedImagesSettingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableAllowedImagesSettingsOutput - if *v == nil { - sv = &EnableAllowedImagesSettingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allowedImagesSettingsState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllowedImagesSettingsState = types.AllowedImagesSettingsEnabledState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionOutput(v **EnableAwsNetworkPerformanceMetricSubscriptionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableAwsNetworkPerformanceMetricSubscriptionOutput - if *v == nil { - sv = &EnableAwsNetworkPerformanceMetricSubscriptionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("output", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Output = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableEbsEncryptionByDefaultOutput(v **EnableEbsEncryptionByDefaultOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableEbsEncryptionByDefaultOutput - if *v == nil { - sv = &EnableEbsEncryptionByDefaultOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ebsEncryptionByDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsEncryptionByDefault = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableFastLaunchOutput(v **EnableFastLaunchOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableFastLaunchOutput - if *v == nil { - sv = &EnableFastLaunchOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchLaunchTemplateSpecificationResponse(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("maxParallelLaunches", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxParallelLaunches = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("resourceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceType = types.FastLaunchResourceType(xtv) - } - - case strings.EqualFold("snapshotConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFastLaunchSnapshotConfigurationResponse(&sv.SnapshotConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.FastLaunchStateCode(xtv) - } - - case strings.EqualFold("stateTransitionReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StateTransitionReason = ptr.String(xtv) - } - - case strings.EqualFold("stateTransitionTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StateTransitionTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableFastSnapshotRestoresOutput(v **EnableFastSnapshotRestoresOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableFastSnapshotRestoresOutput - if *v == nil { - sv = &EnableFastSnapshotRestoresOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessSet(&sv.Successful, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentEnableFastSnapshotRestoreErrorSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableImageBlockPublicAccessOutput(v **EnableImageBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableImageBlockPublicAccessOutput - if *v == nil { - sv = &EnableImageBlockPublicAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageBlockPublicAccessState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageBlockPublicAccessState = types.ImageBlockPublicAccessEnabledState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableImageDeprecationOutput(v **EnableImageDeprecationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableImageDeprecationOutput - if *v == nil { - sv = &EnableImageDeprecationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableImageDeregistrationProtectionOutput(v **EnableImageDeregistrationProtectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableImageDeregistrationProtectionOutput - if *v == nil { - sv = &EnableImageDeregistrationProtectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Return = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableImageOutput(v **EnableImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableImageOutput - if *v == nil { - sv = &EnableImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableIpamOrganizationAdminAccountOutput(v **EnableIpamOrganizationAdminAccountOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableIpamOrganizationAdminAccountOutput - if *v == nil { - sv = &EnableIpamOrganizationAdminAccountOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("success", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Success = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingOutput(v **EnableReachabilityAnalyzerOrganizationSharingOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableReachabilityAnalyzerOrganizationSharingOutput - if *v == nil { - sv = &EnableReachabilityAnalyzerOrganizationSharingOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("returnValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableRouteServerPropagationOutput(v **EnableRouteServerPropagationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableRouteServerPropagationOutput - if *v == nil { - sv = &EnableRouteServerPropagationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerPropagation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPropagation(&sv.RouteServerPropagation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableSerialConsoleAccessOutput(v **EnableSerialConsoleAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableSerialConsoleAccessOutput - if *v == nil { - sv = &EnableSerialConsoleAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("serialConsoleAccessEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SerialConsoleAccessEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(v **EnableSnapshotBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableSnapshotBlockPublicAccessOutput - if *v == nil { - sv = &EnableSnapshotBlockPublicAccessOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotBlockPublicAccessState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableTransitGatewayRouteTablePropagationOutput(v **EnableTransitGatewayRouteTablePropagationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableTransitGatewayRouteTablePropagationOutput - if *v == nil { - sv = &EnableTransitGatewayRouteTablePropagationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("propagation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPropagation(&sv.Propagation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableVpcClassicLinkDnsSupportOutput(v **EnableVpcClassicLinkDnsSupportOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableVpcClassicLinkDnsSupportOutput - if *v == nil { - sv = &EnableVpcClassicLinkDnsSupportOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentEnableVpcClassicLinkOutput(v **EnableVpcClassicLinkOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *EnableVpcClassicLinkOutput - if *v == nil { - sv = &EnableVpcClassicLinkOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentExportClientVpnClientCertificateRevocationListOutput(v **ExportClientVpnClientCertificateRevocationListOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ExportClientVpnClientCertificateRevocationListOutput - if *v == nil { - sv = &ExportClientVpnClientCertificateRevocationListOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("certificateRevocationList", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CertificateRevocationList = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientCertificateRevocationListStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentExportClientVpnClientConfigurationOutput(v **ExportClientVpnClientConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ExportClientVpnClientConfigurationOutput - if *v == nil { - sv = &ExportClientVpnClientConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientConfiguration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientConfiguration = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentExportImageOutput(v **ExportImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ExportImageOutput - if *v == nil { - sv = &ExportImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("diskImageFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DiskImageFormat = types.DiskImageFormat(xtv) - } - - case strings.EqualFold("exportImageTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ExportImageTaskId = ptr.String(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("roleName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RoleName = ptr.String(xtv) - } - - case strings.EqualFold("s3ExportLocation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentExportTaskS3Location(&sv.S3ExportLocation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentExportTransitGatewayRoutesOutput(v **ExportTransitGatewayRoutesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ExportTransitGatewayRoutesOutput - if *v == nil { - sv = &ExportTransitGatewayRoutesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("s3Location", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Location = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentExportVerifiedAccessInstanceClientConfigurationOutput(v **ExportVerifiedAccessInstanceClientConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ExportVerifiedAccessInstanceClientConfigurationOutput - if *v == nil { - sv = &ExportVerifiedAccessInstanceClientConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("deviceTrustProviderSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDeviceTrustProviderTypeList(&sv.DeviceTrustProviders, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("openVpnConfigurationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceOpenVpnClientConfigurationList(&sv.OpenVpnConfigurations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("region", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Region = ptr.String(xtv) - } - - case strings.EqualFold("userTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceUserTrustProviderClientConfiguration(&sv.UserTrustProvider, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("verifiedAccessInstanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VerifiedAccessInstanceId = ptr.String(xtv) - } - - case strings.EqualFold("version", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Version = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetActiveVpnTunnelStatusOutput(v **GetActiveVpnTunnelStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetActiveVpnTunnelStatusOutput - if *v == nil { - sv = &GetActiveVpnTunnelStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("activeVpnTunnelStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentActiveVpnTunnelStatus(&sv.ActiveVpnTunnelStatus, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetAllowedImagesSettingsOutput(v **GetAllowedImagesSettingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAllowedImagesSettingsOutput - if *v == nil { - sv = &GetAllowedImagesSettingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageCriterionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImageCriterionList(&sv.ImageCriteria, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetAssociatedEnclaveCertificateIamRolesOutput(v **GetAssociatedEnclaveCertificateIamRolesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAssociatedEnclaveCertificateIamRolesOutput - if *v == nil { - sv = &GetAssociatedEnclaveCertificateIamRolesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associatedRoleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAssociatedRolesList(&sv.AssociatedRoles, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetAssociatedIpv6PoolCidrsOutput(v **GetAssociatedIpv6PoolCidrsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAssociatedIpv6PoolCidrsOutput - if *v == nil { - sv = &GetAssociatedIpv6PoolCidrsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipv6CidrAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6CidrAssociationSet(&sv.Ipv6CidrAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetAwsNetworkPerformanceDataOutput(v **GetAwsNetworkPerformanceDataOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAwsNetworkPerformanceDataOutput - if *v == nil { - sv = &GetAwsNetworkPerformanceDataOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("dataResponseSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentDataResponses(&sv.DataResponses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetCapacityReservationUsageOutput(v **GetCapacityReservationUsageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetCapacityReservationUsageOutput - if *v == nil { - sv = &GetCapacityReservationUsageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("availableInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.AvailableInstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("capacityReservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CapacityReservationId = ptr.String(xtv) - } - - case strings.EqualFold("instanceType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceType = ptr.String(xtv) - } - - case strings.EqualFold("instanceUsageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceUsageSet(&sv.InstanceUsages, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.CapacityReservationState(xtv) - } - - case strings.EqualFold("totalInstanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.TotalInstanceCount = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetCoipPoolUsageOutput(v **GetCoipPoolUsageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetCoipPoolUsageOutput - if *v == nil { - sv = &GetCoipPoolUsageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coipAddressUsageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCoipAddressUsageSet(&sv.CoipAddressUsages, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("coipPoolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CoipPoolId = ptr.String(xtv) - } - - case strings.EqualFold("localGatewayRouteTableId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LocalGatewayRouteTableId = ptr.String(xtv) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetConsoleOutputOutput(v **GetConsoleOutputOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetConsoleOutputOutput - if *v == nil { - sv = &GetConsoleOutputOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("output", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Output = ptr.String(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetConsoleScreenshotOutput(v **GetConsoleScreenshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetConsoleScreenshotOutput - if *v == nil { - sv = &GetConsoleScreenshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageData = ptr.String(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetDeclarativePoliciesReportSummaryOutput(v **GetDeclarativePoliciesReportSummaryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetDeclarativePoliciesReportSummaryOutput - if *v == nil { - sv = &GetDeclarativePoliciesReportSummaryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("attributeSummarySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeSummaryList(&sv.AttributeSummaries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("endTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.EndTime = ptr.Time(t) - } - - case strings.EqualFold("numberOfAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("numberOfFailedAccounts", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NumberOfFailedAccounts = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("reportId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReportId = ptr.String(xtv) - } - - case strings.EqualFold("s3Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Bucket = ptr.String(xtv) - } - - case strings.EqualFold("s3Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.S3Prefix = ptr.String(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("targetId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetDefaultCreditSpecificationOutput(v **GetDefaultCreditSpecificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetDefaultCreditSpecificationOutput - if *v == nil { - sv = &GetDefaultCreditSpecificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceFamilyCreditSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceFamilyCreditSpecification(&sv.InstanceFamilyCreditSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetEbsDefaultKmsKeyIdOutput(v **GetEbsDefaultKmsKeyIdOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetEbsDefaultKmsKeyIdOutput - if *v == nil { - sv = &GetEbsDefaultKmsKeyIdOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetEbsEncryptionByDefaultOutput(v **GetEbsEncryptionByDefaultOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetEbsEncryptionByDefaultOutput - if *v == nil { - sv = &GetEbsEncryptionByDefaultOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ebsEncryptionByDefault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.EbsEncryptionByDefault = ptr.Bool(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetFlowLogsIntegrationTemplateOutput(v **GetFlowLogsIntegrationTemplateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetFlowLogsIntegrationTemplateOutput - if *v == nil { - sv = &GetFlowLogsIntegrationTemplateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("result", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Result = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetGroupsForCapacityReservationOutput(v **GetGroupsForCapacityReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetGroupsForCapacityReservationOutput - if *v == nil { - sv = &GetGroupsForCapacityReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityReservationGroupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservationGroupSet(&sv.CapacityReservationGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetHostReservationPurchasePreviewOutput(v **GetHostReservationPurchasePreviewOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetHostReservationPurchasePreviewOutput - if *v == nil { - sv = &GetHostReservationPurchasePreviewOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("purchase", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPurchaseSet(&sv.Purchase, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalHourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TotalHourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("totalUpfrontPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TotalUpfrontPrice = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetImageBlockPublicAccessStateOutput(v **GetImageBlockPublicAccessStateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetImageBlockPublicAccessStateOutput - if *v == nil { - sv = &GetImageBlockPublicAccessStateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageBlockPublicAccessState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageBlockPublicAccessState = ptr.String(xtv) - } - - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetInstanceMetadataDefaultsOutput(v **GetInstanceMetadataDefaultsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetInstanceMetadataDefaultsOutput - if *v == nil { - sv = &GetInstanceMetadataDefaultsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accountLevel", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMetadataDefaultsResponse(&sv.AccountLevel, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(v **GetInstanceTpmEkPubOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetInstanceTpmEkPubOutput - if *v == nil { - sv = &GetInstanceTpmEkPubOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("keyFormat", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyFormat = types.EkPubKeyFormat(xtv) - } - - case strings.EqualFold("keyType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyType = types.EkPubKeyType(xtv) - } - - case strings.EqualFold("keyValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyValue = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetInstanceTypesFromInstanceRequirementsOutput(v **GetInstanceTypesFromInstanceRequirementsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetInstanceTypesFromInstanceRequirementsOutput - if *v == nil { - sv = &GetInstanceTypesFromInstanceRequirementsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTypeInfoFromInstanceRequirementsSet(&sv.InstanceTypes, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetInstanceUefiDataOutput(v **GetInstanceUefiDataOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetInstanceUefiDataOutput - if *v == nil { - sv = &GetInstanceUefiDataOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("uefiData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UefiData = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamAddressHistoryOutput(v **GetIpamAddressHistoryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamAddressHistoryOutput - if *v == nil { - sv = &GetIpamAddressHistoryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("historyRecordSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamAddressHistoryRecordSet(&sv.HistoryRecords, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamDiscoveredAccountsOutput(v **GetIpamDiscoveredAccountsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamDiscoveredAccountsOutput - if *v == nil { - sv = &GetIpamDiscoveredAccountsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamDiscoveredAccountSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamDiscoveredAccountSet(&sv.IpamDiscoveredAccounts, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(v **GetIpamDiscoveredPublicAddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamDiscoveredPublicAddressesOutput - if *v == nil { - sv = &GetIpamDiscoveredPublicAddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamDiscoveredPublicAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSet(&sv.IpamDiscoveredPublicAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("oldestSampleTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.OldestSampleTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamDiscoveredResourceCidrsOutput(v **GetIpamDiscoveredResourceCidrsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamDiscoveredResourceCidrsOutput - if *v == nil { - sv = &GetIpamDiscoveredResourceCidrsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamDiscoveredResourceCidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamDiscoveredResourceCidrSet(&sv.IpamDiscoveredResourceCidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamPoolAllocationsOutput(v **GetIpamPoolAllocationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamPoolAllocationsOutput - if *v == nil { - sv = &GetIpamPoolAllocationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolAllocationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolAllocationSet(&sv.IpamPoolAllocations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamPoolCidrsOutput(v **GetIpamPoolCidrsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamPoolCidrsOutput - if *v == nil { - sv = &GetIpamPoolCidrsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolCidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolCidrSet(&sv.IpamPoolCidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetIpamResourceCidrsOutput(v **GetIpamResourceCidrsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetIpamResourceCidrsOutput - if *v == nil { - sv = &GetIpamResourceCidrsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceCidrSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceCidrSet(&sv.IpamResourceCidrs, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetLaunchTemplateDataOutput(v **GetLaunchTemplateDataOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetLaunchTemplateDataOutput - if *v == nil { - sv = &GetLaunchTemplateDataOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplateData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseLaunchTemplateData(&sv.LaunchTemplateData, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetManagedPrefixListAssociationsOutput(v **GetManagedPrefixListAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetManagedPrefixListAssociationsOutput - if *v == nil { - sv = &GetManagedPrefixListAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("prefixListAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListAssociationSet(&sv.PrefixListAssociations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetManagedPrefixListEntriesOutput(v **GetManagedPrefixListEntriesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetManagedPrefixListEntriesOutput - if *v == nil { - sv = &GetManagedPrefixListEntriesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("entrySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListEntrySet(&sv.Entries, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsOutput(v **GetNetworkInsightsAccessScopeAnalysisFindingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetNetworkInsightsAccessScopeAnalysisFindingsOutput - if *v == nil { - sv = &GetNetworkInsightsAccessScopeAnalysisFindingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("analysisFindingSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAccessScopeAnalysisFindingList(&sv.AnalysisFindings, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("analysisStatus", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AnalysisStatus = types.AnalysisStatus(xtv) - } - - case strings.EqualFold("networkInsightsAccessScopeAnalysisId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInsightsAccessScopeAnalysisId = ptr.String(xtv) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeContentOutput(v **GetNetworkInsightsAccessScopeContentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetNetworkInsightsAccessScopeContentOutput - if *v == nil { - sv = &GetNetworkInsightsAccessScopeContentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeContent", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeContent(&sv.NetworkInsightsAccessScopeContent, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetPasswordDataOutput(v **GetPasswordDataOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetPasswordDataOutput - if *v == nil { - sv = &GetPasswordDataOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("passwordData", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PasswordData = ptr.String(xtv) - } - - case strings.EqualFold("timestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Timestamp = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetReservedInstancesExchangeQuoteOutput(v **GetReservedInstancesExchangeQuoteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetReservedInstancesExchangeQuoteOutput - if *v == nil { - sv = &GetReservedInstancesExchangeQuoteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = ptr.String(xtv) - } - - case strings.EqualFold("isValidExchange", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsValidExchange = ptr.Bool(xtv) - } - - case strings.EqualFold("outputReservedInstancesWillExpireAt", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.OutputReservedInstancesWillExpireAt = ptr.Time(t) - } - - case strings.EqualFold("paymentDue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PaymentDue = ptr.String(xtv) - } - - case strings.EqualFold("reservedInstanceValueRollup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservationValue(&sv.ReservedInstanceValueRollup, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("reservedInstanceValueSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstanceReservationValueSet(&sv.ReservedInstanceValueSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetConfigurationValueRollup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservationValue(&sv.TargetConfigurationValueRollup, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("targetConfigurationValueSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTargetReservationValueSet(&sv.TargetConfigurationValueSet, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("validationFailureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ValidationFailureReason = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetRouteServerAssociationsOutput(v **GetRouteServerAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetRouteServerAssociationsOutput - if *v == nil { - sv = &GetRouteServerAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerAssociationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerAssociationsList(&sv.RouteServerAssociations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetRouteServerPropagationsOutput(v **GetRouteServerPropagationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetRouteServerPropagationsOutput - if *v == nil { - sv = &GetRouteServerPropagationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServerPropagationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerPropagationsList(&sv.RouteServerPropagations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetRouteServerRoutingDatabaseOutput(v **GetRouteServerRoutingDatabaseOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetRouteServerRoutingDatabaseOutput - if *v == nil { - sv = &GetRouteServerRoutingDatabaseOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("areRoutesPersisted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AreRoutesPersisted = ptr.Bool(xtv) - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServerRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetSecurityGroupsForVpcOutput(v **GetSecurityGroupsForVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSecurityGroupsForVpcOutput - if *v == nil { - sv = &GetSecurityGroupsForVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("securityGroupForVpcSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupForVpcList(&sv.SecurityGroupForVpcs, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetSerialConsoleAccessStatusOutput(v **GetSerialConsoleAccessStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSerialConsoleAccessStatusOutput - if *v == nil { - sv = &GetSerialConsoleAccessStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - case strings.EqualFold("serialConsoleAccessEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.SerialConsoleAccessEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(v **GetSnapshotBlockPublicAccessStateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSnapshotBlockPublicAccessStateOutput - if *v == nil { - sv = &GetSnapshotBlockPublicAccessStateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("managedBy", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ManagedBy = types.ManagedBy(xtv) - } - - case strings.EqualFold("state", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotBlockPublicAccessState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetSpotPlacementScoresOutput(v **GetSpotPlacementScoresOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSpotPlacementScoresOutput - if *v == nil { - sv = &GetSpotPlacementScoresOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("spotPlacementScoreSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotPlacementScores(&sv.SpotPlacementScores, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetSubnetCidrReservationsOutput(v **GetSubnetCidrReservationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSubnetCidrReservationsOutput - if *v == nil { - sv = &GetSubnetCidrReservationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("subnetIpv4CidrReservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetCidrReservationList(&sv.SubnetIpv4CidrReservations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("subnetIpv6CidrReservationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSubnetCidrReservationList(&sv.SubnetIpv6CidrReservations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayAttachmentPropagationsOutput(v **GetTransitGatewayAttachmentPropagationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayAttachmentPropagationsOutput - if *v == nil { - sv = &GetTransitGatewayAttachmentPropagationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayAttachmentPropagations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayAttachmentPropagationList(&sv.TransitGatewayAttachmentPropagations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayMulticastDomainAssociationsOutput(v **GetTransitGatewayMulticastDomainAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayMulticastDomainAssociationsOutput - if *v == nil { - sv = &GetTransitGatewayMulticastDomainAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("multicastDomainAssociations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociationList(&sv.MulticastDomainAssociations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableAssociationsOutput(v **GetTransitGatewayPolicyTableAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayPolicyTableAssociationsOutput - if *v == nil { - sv = &GetTransitGatewayPolicyTableAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableAssociationList(&sv.Associations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableEntriesOutput(v **GetTransitGatewayPolicyTableEntriesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayPolicyTableEntriesOutput - if *v == nil { - sv = &GetTransitGatewayPolicyTableEntriesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPolicyTableEntries", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPolicyTableEntryList(&sv.TransitGatewayPolicyTableEntries, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayPrefixListReferencesOutput(v **GetTransitGatewayPrefixListReferencesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayPrefixListReferencesOutput - if *v == nil { - sv = &GetTransitGatewayPrefixListReferencesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayPrefixListReferenceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReferenceSet(&sv.TransitGatewayPrefixListReferences, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTableAssociationsOutput(v **GetTransitGatewayRouteTableAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayRouteTableAssociationsOutput - if *v == nil { - sv = &GetTransitGatewayRouteTableAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTableAssociationList(&sv.Associations, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTablePropagationsOutput(v **GetTransitGatewayRouteTablePropagationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetTransitGatewayRouteTablePropagationsOutput - if *v == nil { - sv = &GetTransitGatewayRouteTablePropagationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("transitGatewayRouteTablePropagations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteTablePropagationList(&sv.TransitGatewayRouteTablePropagations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointPolicyOutput(v **GetVerifiedAccessEndpointPolicyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVerifiedAccessEndpointPolicyOutput - if *v == nil { - sv = &GetVerifiedAccessEndpointPolicyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("policyDocument", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyDocument = ptr.String(xtv) - } - - case strings.EqualFold("policyEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PolicyEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointTargetsOutput(v **GetVerifiedAccessEndpointTargetsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVerifiedAccessEndpointTargetsOutput - if *v == nil { - sv = &GetVerifiedAccessEndpointTargetsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("verifiedAccessEndpointTargetSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpointTargetList(&sv.VerifiedAccessEndpointTargets, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVerifiedAccessGroupPolicyOutput(v **GetVerifiedAccessGroupPolicyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVerifiedAccessGroupPolicyOutput - if *v == nil { - sv = &GetVerifiedAccessGroupPolicyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("policyDocument", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyDocument = ptr.String(xtv) - } - - case strings.EqualFold("policyEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PolicyEnabled = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceSampleConfigurationOutput(v **GetVpnConnectionDeviceSampleConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVpnConnectionDeviceSampleConfigurationOutput - if *v == nil { - sv = &GetVpnConnectionDeviceSampleConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnectionDeviceSampleConfiguration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnConnectionDeviceSampleConfiguration = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceTypesOutput(v **GetVpnConnectionDeviceTypesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVpnConnectionDeviceTypesOutput - if *v == nil { - sv = &GetVpnConnectionDeviceTypesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("vpnConnectionDeviceTypeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnectionDeviceTypeList(&sv.VpnConnectionDeviceTypes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(v **GetVpnTunnelReplacementStatusOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetVpnTunnelReplacementStatusOutput - if *v == nil { - sv = &GetVpnTunnelReplacementStatusOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("customerGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CustomerGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("maintenanceDetails", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMaintenanceDetails(&sv.MaintenanceDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("transitGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TransitGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpnConnectionId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnConnectionId = ptr.String(xtv) - } - - case strings.EqualFold("vpnGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnGatewayId = ptr.String(xtv) - } - - case strings.EqualFold("vpnTunnelOutsideIpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VpnTunnelOutsideIpAddress = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportClientVpnClientCertificateRevocationListOutput(v **ImportClientVpnClientCertificateRevocationListOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportClientVpnClientCertificateRevocationListOutput - if *v == nil { - sv = &ImportClientVpnClientCertificateRevocationListOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportImageOutput(v **ImportImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportImageOutput - if *v == nil { - sv = &ImportImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("architecture", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Architecture = ptr.String(xtv) - } - - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("hypervisor", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Hypervisor = ptr.String(xtv) - } - - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - case strings.EqualFold("importTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - case strings.EqualFold("licenseSpecifications", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImportImageLicenseSpecificationListResponse(&sv.LicenseSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("licenseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LicenseType = ptr.String(xtv) - } - - case strings.EqualFold("platform", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Platform = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotDetailSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotDetailList(&sv.SnapshotDetails, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) - } - - case strings.EqualFold("statusMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusMessage = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("usageOperation", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UsageOperation = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportInstanceOutput(v **ImportInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportInstanceOutput - if *v == nil { - sv = &ImportInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("conversionTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConversionTask(&sv.ConversionTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportKeyPairOutput(v **ImportKeyPairOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportKeyPairOutput - if *v == nil { - sv = &ImportKeyPairOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("keyFingerprint", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyFingerprint = ptr.String(xtv) - } - - case strings.EqualFold("keyName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyName = ptr.String(xtv) - } - - case strings.EqualFold("keyPairId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KeyPairId = ptr.String(xtv) - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportSnapshotOutput(v **ImportSnapshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportSnapshotOutput - if *v == nil { - sv = &ImportSnapshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("importTaskId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImportTaskId = ptr.String(xtv) - } - - case strings.EqualFold("snapshotTaskDetail", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotTaskDetail(&sv.SnapshotTaskDetail, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("tagSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentImportVolumeOutput(v **ImportVolumeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ImportVolumeOutput - if *v == nil { - sv = &ImportVolumeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("conversionTask", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentConversionTask(&sv.ConversionTask, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentListImagesInRecycleBinOutput(v **ListImagesInRecycleBinOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ListImagesInRecycleBinOutput - if *v == nil { - sv = &ListImagesInRecycleBinOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentImageRecycleBinInfoList(&sv.Images, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentListSnapshotsInRecycleBinOutput(v **ListSnapshotsInRecycleBinOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ListSnapshotsInRecycleBinOutput - if *v == nil { - sv = &ListSnapshotsInRecycleBinOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("snapshotSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSnapshotRecycleBinInfoList(&sv.Snapshots, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentLockSnapshotOutput(v **LockSnapshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *LockSnapshotOutput - if *v == nil { - sv = &LockSnapshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coolOffPeriod", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CoolOffPeriod = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("coolOffPeriodExpiresOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CoolOffPeriodExpiresOn = ptr.Time(t) - } - - case strings.EqualFold("lockCreatedOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockCreatedOn = ptr.Time(t) - } - - case strings.EqualFold("lockDuration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.LockDuration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("lockDurationStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockDurationStartTime = ptr.Time(t) - } - - case strings.EqualFold("lockExpiresOn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LockExpiresOn = ptr.Time(t) - } - - case strings.EqualFold("lockState", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LockState = types.LockState(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyAddressAttributeOutput(v **ModifyAddressAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyAddressAttributeOutput - if *v == nil { - sv = &ModifyAddressAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("address", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressAttribute(&sv.Address, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyAvailabilityZoneGroupOutput(v **ModifyAvailabilityZoneGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyAvailabilityZoneGroupOutput - if *v == nil { - sv = &ModifyAvailabilityZoneGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyCapacityReservationFleetOutput(v **ModifyCapacityReservationFleetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyCapacityReservationFleetOutput - if *v == nil { - sv = &ModifyCapacityReservationFleetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyCapacityReservationOutput(v **ModifyCapacityReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyCapacityReservationOutput - if *v == nil { - sv = &ModifyCapacityReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyClientVpnEndpointOutput(v **ModifyClientVpnEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyClientVpnEndpointOutput - if *v == nil { - sv = &ModifyClientVpnEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyDefaultCreditSpecificationOutput(v **ModifyDefaultCreditSpecificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyDefaultCreditSpecificationOutput - if *v == nil { - sv = &ModifyDefaultCreditSpecificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceFamilyCreditSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceFamilyCreditSpecification(&sv.InstanceFamilyCreditSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyEbsDefaultKmsKeyIdOutput(v **ModifyEbsDefaultKmsKeyIdOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyEbsDefaultKmsKeyIdOutput - if *v == nil { - sv = &ModifyEbsDefaultKmsKeyIdOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyFleetOutput(v **ModifyFleetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyFleetOutput - if *v == nil { - sv = &ModifyFleetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyFpgaImageAttributeOutput(v **ModifyFpgaImageAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyFpgaImageAttributeOutput - if *v == nil { - sv = &ModifyFpgaImageAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("fpgaImageAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentFpgaImageAttribute(&sv.FpgaImageAttribute, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyHostsOutput(v **ModifyHostsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyHostsOutput - if *v == nil { - sv = &ModifyHostsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseHostIdList(&sv.Successful, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemList(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceCapacityReservationAttributesOutput(v **ModifyInstanceCapacityReservationAttributesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceCapacityReservationAttributesOutput - if *v == nil { - sv = &ModifyInstanceCapacityReservationAttributesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceCpuOptionsOutput(v **ModifyInstanceCpuOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceCpuOptionsOutput - if *v == nil { - sv = &ModifyInstanceCpuOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("coreCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.CoreCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("threadsPerCore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ThreadsPerCore = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceCreditSpecificationOutput(v **ModifyInstanceCreditSpecificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceCreditSpecificationOutput - if *v == nil { - sv = &ModifyInstanceCreditSpecificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successfulInstanceCreditSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSuccessfulInstanceCreditSpecificationSet(&sv.SuccessfulInstanceCreditSpecifications, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessfulInstanceCreditSpecificationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulInstanceCreditSpecificationSet(&sv.UnsuccessfulInstanceCreditSpecifications, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceEventStartTimeOutput(v **ModifyInstanceEventStartTimeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceEventStartTimeOutput - if *v == nil { - sv = &ModifyInstanceEventStartTimeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("event", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStatusEvent(&sv.Event, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceEventWindowOutput(v **ModifyInstanceEventWindowOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceEventWindowOutput - if *v == nil { - sv = &ModifyInstanceEventWindowOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceEventWindow", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceEventWindow(&sv.InstanceEventWindow, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceMaintenanceOptionsOutput(v **ModifyInstanceMaintenanceOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceMaintenanceOptionsOutput - if *v == nil { - sv = &ModifyInstanceMaintenanceOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("autoRecovery", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AutoRecovery = types.InstanceAutoRecoveryState(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("rebootMigration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RebootMigration = types.InstanceRebootMigrationState(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceMetadataDefaultsOutput(v **ModifyInstanceMetadataDefaultsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceMetadataDefaultsOutput - if *v == nil { - sv = &ModifyInstanceMetadataDefaultsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceMetadataOptionsOutput(v **ModifyInstanceMetadataOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceMetadataOptionsOutput - if *v == nil { - sv = &ModifyInstanceMetadataOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - case strings.EqualFold("instanceMetadataOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMetadataOptionsResponse(&sv.InstanceMetadataOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstanceNetworkPerformanceOptionsOutput(v **ModifyInstanceNetworkPerformanceOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstanceNetworkPerformanceOptionsOutput - if *v == nil { - sv = &ModifyInstanceNetworkPerformanceOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("bandwidthWeighting", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BandwidthWeighting = types.InstanceBandwidthWeighting(xtv) - } - - case strings.EqualFold("instanceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.InstanceId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyInstancePlacementOutput(v **ModifyInstancePlacementOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyInstancePlacementOutput - if *v == nil { - sv = &ModifyInstancePlacementOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyIpamOutput(v **ModifyIpamOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyIpamOutput - if *v == nil { - sv = &ModifyIpamOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipam", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpam(&sv.Ipam, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyIpamPoolOutput(v **ModifyIpamPoolOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyIpamPoolOutput - if *v == nil { - sv = &ModifyIpamPoolOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPool", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPool(&sv.IpamPool, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyIpamResourceCidrOutput(v **ModifyIpamResourceCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyIpamResourceCidrOutput - if *v == nil { - sv = &ModifyIpamResourceCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceCidr(&sv.IpamResourceCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyIpamResourceDiscoveryOutput(v **ModifyIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyIpamResourceDiscoveryOutput - if *v == nil { - sv = &ModifyIpamResourceDiscoveryOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamResourceDiscovery", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscovery(&sv.IpamResourceDiscovery, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyIpamScopeOutput(v **ModifyIpamScopeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyIpamScopeOutput - if *v == nil { - sv = &ModifyIpamScopeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamScope", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamScope(&sv.IpamScope, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyLaunchTemplateOutput(v **ModifyLaunchTemplateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyLaunchTemplateOutput - if *v == nil { - sv = &ModifyLaunchTemplateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("launchTemplate", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplate(&sv.LaunchTemplate, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyLocalGatewayRouteOutput(v **ModifyLocalGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyLocalGatewayRouteOutput - if *v == nil { - sv = &ModifyLocalGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyManagedPrefixListOutput(v **ModifyManagedPrefixListOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyManagedPrefixListOutput - if *v == nil { - sv = &ModifyManagedPrefixListOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("prefixList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixList(&sv.PrefixList, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyPrivateDnsNameOptionsOutput(v **ModifyPrivateDnsNameOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyPrivateDnsNameOptionsOutput - if *v == nil { - sv = &ModifyPrivateDnsNameOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyPublicIpDnsNameOptionsOutput(v **ModifyPublicIpDnsNameOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyPublicIpDnsNameOptionsOutput - if *v == nil { - sv = &ModifyPublicIpDnsNameOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successful", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Successful = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyReservedInstancesOutput(v **ModifyReservedInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyReservedInstancesOutput - if *v == nil { - sv = &ModifyReservedInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesModificationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesModificationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyRouteServerOutput(v **ModifyRouteServerOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyRouteServerOutput - if *v == nil { - sv = &ModifyRouteServerOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("routeServer", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteServer(&sv.RouteServer, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifySecurityGroupRulesOutput(v **ModifySecurityGroupRulesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifySecurityGroupRulesOutput - if *v == nil { - sv = &ModifySecurityGroupRulesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifySnapshotTierOutput(v **ModifySnapshotTierOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifySnapshotTierOutput - if *v == nil { - sv = &ModifySnapshotTierOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("tieringStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TieringStartTime = ptr.Time(t) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifySpotFleetRequestOutput(v **ModifySpotFleetRequestOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifySpotFleetRequestOutput - if *v == nil { - sv = &ModifySpotFleetRequestOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterNetworkServicesOutput(v **ModifyTrafficMirrorFilterNetworkServicesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTrafficMirrorFilterNetworkServicesOutput - if *v == nil { - sv = &ModifyTrafficMirrorFilterNetworkServicesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorFilter", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilter(&sv.TrafficMirrorFilter, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterRuleOutput(v **ModifyTrafficMirrorFilterRuleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTrafficMirrorFilterRuleOutput - if *v == nil { - sv = &ModifyTrafficMirrorFilterRuleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorFilterRule", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorFilterRule(&sv.TrafficMirrorFilterRule, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTrafficMirrorSessionOutput(v **ModifyTrafficMirrorSessionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTrafficMirrorSessionOutput - if *v == nil { - sv = &ModifyTrafficMirrorSessionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("trafficMirrorSession", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTrafficMirrorSession(&sv.TrafficMirrorSession, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTransitGatewayOutput(v **ModifyTransitGatewayOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTransitGatewayOutput - if *v == nil { - sv = &ModifyTransitGatewayOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGateway", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGateway(&sv.TransitGateway, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTransitGatewayPrefixListReferenceOutput(v **ModifyTransitGatewayPrefixListReferenceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTransitGatewayPrefixListReferenceOutput - if *v == nil { - sv = &ModifyTransitGatewayPrefixListReferenceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPrefixListReference", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPrefixListReference(&sv.TransitGatewayPrefixListReference, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyTransitGatewayVpcAttachmentOutput(v **ModifyTransitGatewayVpcAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyTransitGatewayVpcAttachmentOutput - if *v == nil { - sv = &ModifyTransitGatewayVpcAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayVpcAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&sv.TransitGatewayVpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointOutput(v **ModifyVerifiedAccessEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessEndpointOutput - if *v == nil { - sv = &ModifyVerifiedAccessEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessEndpoint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessEndpoint(&sv.VerifiedAccessEndpoint, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointPolicyOutput(v **ModifyVerifiedAccessEndpointPolicyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessEndpointPolicyOutput - if *v == nil { - sv = &ModifyVerifiedAccessEndpointPolicyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("policyDocument", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyDocument = ptr.String(xtv) - } - - case strings.EqualFold("policyEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PolicyEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("sseSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(&sv.SseSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupOutput(v **ModifyVerifiedAccessGroupOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessGroupOutput - if *v == nil { - sv = &ModifyVerifiedAccessGroupOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessGroup", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessGroup(&sv.VerifiedAccessGroup, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupPolicyOutput(v **ModifyVerifiedAccessGroupPolicyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessGroupPolicyOutput - if *v == nil { - sv = &ModifyVerifiedAccessGroupPolicyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("policyDocument", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PolicyDocument = ptr.String(xtv) - } - - case strings.EqualFold("policyEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.PolicyEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("sseSpecification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessSseSpecificationResponse(&sv.SseSpecification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationOutput(v **ModifyVerifiedAccessInstanceLoggingConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessInstanceLoggingConfigurationOutput - if *v == nil { - sv = &ModifyVerifiedAccessInstanceLoggingConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("loggingConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstanceLoggingConfiguration(&sv.LoggingConfiguration, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceOutput(v **ModifyVerifiedAccessInstanceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessInstanceOutput - if *v == nil { - sv = &ModifyVerifiedAccessInstanceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessInstance", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessInstance(&sv.VerifiedAccessInstance, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVerifiedAccessTrustProviderOutput(v **ModifyVerifiedAccessTrustProviderOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVerifiedAccessTrustProviderOutput - if *v == nil { - sv = &ModifyVerifiedAccessTrustProviderOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("verifiedAccessTrustProvider", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVerifiedAccessTrustProvider(&sv.VerifiedAccessTrustProvider, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVolumeOutput(v **ModifyVolumeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVolumeOutput - if *v == nil { - sv = &ModifyVolumeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("volumeModification", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVolumeModification(&sv.VolumeModification, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcBlockPublicAccessExclusionOutput(v **ModifyVpcBlockPublicAccessExclusionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcBlockPublicAccessExclusionOutput - if *v == nil { - sv = &ModifyVpcBlockPublicAccessExclusionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcBlockPublicAccessExclusion", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessExclusion(&sv.VpcBlockPublicAccessExclusion, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcBlockPublicAccessOptionsOutput(v **ModifyVpcBlockPublicAccessOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcBlockPublicAccessOptionsOutput - if *v == nil { - sv = &ModifyVpcBlockPublicAccessOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpcBlockPublicAccessOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpcBlockPublicAccessOptions(&sv.VpcBlockPublicAccessOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcEndpointConnectionNotificationOutput(v **ModifyVpcEndpointConnectionNotificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcEndpointConnectionNotificationOutput - if *v == nil { - sv = &ModifyVpcEndpointConnectionNotificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcEndpointOutput(v **ModifyVpcEndpointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcEndpointOutput - if *v == nil { - sv = &ModifyVpcEndpointOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcEndpointServiceConfigurationOutput(v **ModifyVpcEndpointServiceConfigurationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcEndpointServiceConfigurationOutput - if *v == nil { - sv = &ModifyVpcEndpointServiceConfigurationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePayerResponsibilityOutput(v **ModifyVpcEndpointServicePayerResponsibilityOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcEndpointServicePayerResponsibilityOutput - if *v == nil { - sv = &ModifyVpcEndpointServicePayerResponsibilityOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePermissionsOutput(v **ModifyVpcEndpointServicePermissionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcEndpointServicePermissionsOutput - if *v == nil { - sv = &ModifyVpcEndpointServicePermissionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("addedPrincipalSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddedPrincipalSet(&sv.AddedPrincipals, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcPeeringConnectionOptionsOutput(v **ModifyVpcPeeringConnectionOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcPeeringConnectionOptionsOutput - if *v == nil { - sv = &ModifyVpcPeeringConnectionOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("accepterPeeringConnectionOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPeeringConnectionOptions(&sv.AccepterPeeringConnectionOptions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("requesterPeeringConnectionOptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPeeringConnectionOptions(&sv.RequesterPeeringConnectionOptions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpcTenancyOutput(v **ModifyVpcTenancyOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpcTenancyOutput - if *v == nil { - sv = &ModifyVpcTenancyOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpnConnectionOptionsOutput(v **ModifyVpnConnectionOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpnConnectionOptionsOutput - if *v == nil { - sv = &ModifyVpnConnectionOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnection(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpnConnectionOutput(v **ModifyVpnConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpnConnectionOutput - if *v == nil { - sv = &ModifyVpnConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnection(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpnTunnelCertificateOutput(v **ModifyVpnTunnelCertificateOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpnTunnelCertificateOutput - if *v == nil { - sv = &ModifyVpnTunnelCertificateOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnection(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentModifyVpnTunnelOptionsOutput(v **ModifyVpnTunnelOptionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ModifyVpnTunnelOptionsOutput - if *v == nil { - sv = &ModifyVpnTunnelOptionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("vpnConnection", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentVpnConnection(&sv.VpnConnection, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentMonitorInstancesOutput(v **MonitorInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *MonitorInstancesOutput - if *v == nil { - sv = &MonitorInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMonitoringList(&sv.InstanceMonitorings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentMoveAddressToVpcOutput(v **MoveAddressToVpcOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *MoveAddressToVpcOutput - if *v == nil { - sv = &MoveAddressToVpcOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("allocationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AllocationId = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.Status(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentMoveByoipCidrToIpamOutput(v **MoveByoipCidrToIpamOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *MoveByoipCidrToIpamOutput - if *v == nil { - sv = &MoveByoipCidrToIpamOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidr(&sv.ByoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentMoveCapacityReservationInstancesOutput(v **MoveCapacityReservationInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *MoveCapacityReservationInstancesOutput - if *v == nil { - sv = &MoveCapacityReservationInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("destinationCapacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.DestinationCapacityReservation, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instanceCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.InstanceCount = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("sourceCapacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.SourceCapacityReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentProvisionByoipCidrOutput(v **ProvisionByoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ProvisionByoipCidrOutput - if *v == nil { - sv = &ProvisionByoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidr(&sv.ByoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(v **ProvisionIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ProvisionIpamByoasnOutput - if *v == nil { - sv = &ProvisionIpamByoasnOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoasn", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoasn(&sv.Byoasn, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentProvisionIpamPoolCidrOutput(v **ProvisionIpamPoolCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ProvisionIpamPoolCidrOutput - if *v == nil { - sv = &ProvisionIpamPoolCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ipamPoolCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&sv.IpamPoolCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentProvisionPublicIpv4PoolCidrOutput(v **ProvisionPublicIpv4PoolCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ProvisionPublicIpv4PoolCidrOutput - if *v == nil { - sv = &ProvisionPublicIpv4PoolCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("poolAddressRange", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPublicIpv4PoolRange(&sv.PoolAddressRange, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("poolId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PoolId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentPurchaseCapacityBlockExtensionOutput(v **PurchaseCapacityBlockExtensionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *PurchaseCapacityBlockExtensionOutput - if *v == nil { - sv = &PurchaseCapacityBlockExtensionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockExtensionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockExtensionSet(&sv.CapacityBlockExtensions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentPurchaseCapacityBlockOutput(v **PurchaseCapacityBlockOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *PurchaseCapacityBlockOutput - if *v == nil { - sv = &PurchaseCapacityBlockOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("capacityBlockSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityBlockSet(&sv.CapacityBlocks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("capacityReservation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentCapacityReservation(&sv.CapacityReservation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentPurchaseHostReservationOutput(v **PurchaseHostReservationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *PurchaseHostReservationOutput - if *v == nil { - sv = &PurchaseHostReservationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientToken = ptr.String(xtv) - } - - case strings.EqualFold("currencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = types.CurrencyCodeValues(xtv) - } - - case strings.EqualFold("purchase", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPurchaseSet(&sv.Purchase, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("totalHourlyPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TotalHourlyPrice = ptr.String(xtv) - } - - case strings.EqualFold("totalUpfrontPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TotalUpfrontPrice = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentPurchaseReservedInstancesOfferingOutput(v **PurchaseReservedInstancesOfferingOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *PurchaseReservedInstancesOfferingOutput - if *v == nil { - sv = &PurchaseReservedInstancesOfferingOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reservedInstancesId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservedInstancesId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentPurchaseScheduledInstancesOutput(v **PurchaseScheduledInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *PurchaseScheduledInstancesOutput - if *v == nil { - sv = &PurchaseScheduledInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("scheduledInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPurchasedScheduledInstanceSet(&sv.ScheduledInstanceSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRegisterImageOutput(v **RegisterImageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RegisterImageOutput - if *v == nil { - sv = &RegisterImageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("imageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ImageId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRegisterInstanceEventNotificationAttributesOutput(v **RegisterInstanceEventNotificationAttributesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RegisterInstanceEventNotificationAttributesOutput - if *v == nil { - sv = &RegisterInstanceEventNotificationAttributesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceTagAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceTagNotificationAttribute(&sv.InstanceTagAttribute, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupMembersOutput(v **RegisterTransitGatewayMulticastGroupMembersOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RegisterTransitGatewayMulticastGroupMembersOutput - if *v == nil { - sv = &RegisterTransitGatewayMulticastGroupMembersOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("registeredMulticastGroupMembers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastRegisteredGroupMembers(&sv.RegisteredMulticastGroupMembers, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesOutput(v **RegisterTransitGatewayMulticastGroupSourcesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RegisterTransitGatewayMulticastGroupSourcesOutput - if *v == nil { - sv = &RegisterTransitGatewayMulticastGroupSourcesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("registeredMulticastGroupSources", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastRegisteredGroupSources(&sv.RegisteredMulticastGroupSources, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectCapacityReservationBillingOwnershipOutput(v **RejectCapacityReservationBillingOwnershipOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectCapacityReservationBillingOwnershipOutput - if *v == nil { - sv = &RejectCapacityReservationBillingOwnershipOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsOutput(v **RejectTransitGatewayMulticastDomainAssociationsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectTransitGatewayMulticastDomainAssociationsOutput - if *v == nil { - sv = &RejectTransitGatewayMulticastDomainAssociationsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associations", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastDomainAssociations(&sv.Associations, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectTransitGatewayPeeringAttachmentOutput(v **RejectTransitGatewayPeeringAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectTransitGatewayPeeringAttachmentOutput - if *v == nil { - sv = &RejectTransitGatewayPeeringAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayPeeringAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayPeeringAttachment(&sv.TransitGatewayPeeringAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectTransitGatewayVpcAttachmentOutput(v **RejectTransitGatewayVpcAttachmentOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectTransitGatewayVpcAttachmentOutput - if *v == nil { - sv = &RejectTransitGatewayVpcAttachmentOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("transitGatewayVpcAttachment", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayVpcAttachment(&sv.TransitGatewayVpcAttachment, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectVpcEndpointConnectionsOutput(v **RejectVpcEndpointConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectVpcEndpointConnectionsOutput - if *v == nil { - sv = &RejectVpcEndpointConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemSet(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRejectVpcPeeringConnectionOutput(v **RejectVpcPeeringConnectionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RejectVpcPeeringConnectionOutput - if *v == nil { - sv = &RejectVpcPeeringConnectionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReleaseHostsOutput(v **ReleaseHostsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReleaseHostsOutput - if *v == nil { - sv = &ReleaseHostsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("successful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentResponseHostIdList(&sv.Successful, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unsuccessful", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentUnsuccessfulItemList(&sv.Unsuccessful, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReleaseIpamPoolAllocationOutput(v **ReleaseIpamPoolAllocationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReleaseIpamPoolAllocationOutput - if *v == nil { - sv = &ReleaseIpamPoolAllocationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("success", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Success = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceIamInstanceProfileAssociationOutput(v **ReplaceIamInstanceProfileAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceIamInstanceProfileAssociationOutput - if *v == nil { - sv = &ReplaceIamInstanceProfileAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("iamInstanceProfileAssociation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIamInstanceProfileAssociation(&sv.IamInstanceProfileAssociation, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceImageCriteriaInAllowedImagesSettingsOutput(v **ReplaceImageCriteriaInAllowedImagesSettingsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceImageCriteriaInAllowedImagesSettingsOutput - if *v == nil { - sv = &ReplaceImageCriteriaInAllowedImagesSettingsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceNetworkAclAssociationOutput(v **ReplaceNetworkAclAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceNetworkAclAssociationOutput - if *v == nil { - sv = &ReplaceNetworkAclAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("newAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NewAssociationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceRouteTableAssociationOutput(v **ReplaceRouteTableAssociationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceRouteTableAssociationOutput - if *v == nil { - sv = &ReplaceRouteTableAssociationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("associationState", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableAssociationState(&sv.AssociationState, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("newAssociationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NewAssociationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceTransitGatewayRouteOutput(v **ReplaceTransitGatewayRouteOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceTransitGatewayRouteOutput - if *v == nil { - sv = &ReplaceTransitGatewayRouteOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("route", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRoute(&sv.Route, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(v **ReplaceVpnTunnelOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ReplaceVpnTunnelOutput - if *v == nil { - sv = &ReplaceVpnTunnelOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRequestSpotFleetOutput(v **RequestSpotFleetOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RequestSpotFleetOutput - if *v == nil { - sv = &RequestSpotFleetOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotFleetRequestId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SpotFleetRequestId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRequestSpotInstancesOutput(v **RequestSpotInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RequestSpotInstancesOutput - if *v == nil { - sv = &RequestSpotInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("spotInstanceRequestSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSpotInstanceRequestList(&sv.SpotInstanceRequests, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentResetAddressAttributeOutput(v **ResetAddressAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ResetAddressAttributeOutput - if *v == nil { - sv = &ResetAddressAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("address", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAddressAttribute(&sv.Address, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentResetEbsDefaultKmsKeyIdOutput(v **ResetEbsDefaultKmsKeyIdOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ResetEbsDefaultKmsKeyIdOutput - if *v == nil { - sv = &ResetEbsDefaultKmsKeyIdOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("kmsKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.KmsKeyId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentResetFpgaImageAttributeOutput(v **ResetFpgaImageAttributeOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ResetFpgaImageAttributeOutput - if *v == nil { - sv = &ResetFpgaImageAttributeOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRestoreAddressToClassicOutput(v **RestoreAddressToClassicOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RestoreAddressToClassicOutput - if *v == nil { - sv = &RestoreAddressToClassicOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("publicIp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.PublicIp = ptr.String(xtv) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.Status(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRestoreImageFromRecycleBinOutput(v **RestoreImageFromRecycleBinOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RestoreImageFromRecycleBinOutput - if *v == nil { - sv = &RestoreImageFromRecycleBinOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRestoreManagedPrefixListVersionOutput(v **RestoreManagedPrefixListVersionOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RestoreManagedPrefixListVersionOutput - if *v == nil { - sv = &RestoreManagedPrefixListVersionOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("prefixList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixList(&sv.PrefixList, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRestoreSnapshotFromRecycleBinOutput(v **RestoreSnapshotFromRecycleBinOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RestoreSnapshotFromRecycleBinOutput - if *v == nil { - sv = &RestoreSnapshotFromRecycleBinOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("description", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Description = ptr.String(xtv) - } - - case strings.EqualFold("encrypted", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Encrypted = ptr.Bool(xtv) - } - - case strings.EqualFold("outpostArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OutpostArn = ptr.String(xtv) - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("progress", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Progress = ptr.String(xtv) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - case strings.EqualFold("sseType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SseType = types.SSEType(xtv) - } - - case strings.EqualFold("startTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) - } - - case strings.EqualFold("status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.State = types.SnapshotState(xtv) - } - - case strings.EqualFold("volumeId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.VolumeId = ptr.String(xtv) - } - - case strings.EqualFold("volumeSize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.VolumeSize = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRestoreSnapshotTierOutput(v **RestoreSnapshotTierOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RestoreSnapshotTierOutput - if *v == nil { - sv = &RestoreSnapshotTierOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("isPermanentRestore", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.IsPermanentRestore = ptr.Bool(xtv) - } - - case strings.EqualFold("restoreDuration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RestoreDuration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("restoreStartTime", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.RestoreStartTime = ptr.Time(t) - } - - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRevokeClientVpnIngressOutput(v **RevokeClientVpnIngressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RevokeClientVpnIngressOutput - if *v == nil { - sv = &RevokeClientVpnIngressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("status", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentClientVpnAuthorizationRuleStatus(&sv.Status, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRevokeSecurityGroupEgressOutput(v **RevokeSecurityGroupEgressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RevokeSecurityGroupEgressOutput - if *v == nil { - sv = &RevokeSecurityGroupEgressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - case strings.EqualFold("revokedSecurityGroupRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRuleList(&sv.RevokedSecurityGroupRules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unknownIpPermissionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.UnknownIpPermissions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRevokeSecurityGroupIngressOutput(v **RevokeSecurityGroupIngressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RevokeSecurityGroupIngressOutput - if *v == nil { - sv = &RevokeSecurityGroupIngressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - case strings.EqualFold("revokedSecurityGroupRuleSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRuleList(&sv.RevokedSecurityGroupRules, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unknownIpPermissionSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.UnknownIpPermissions, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRunInstancesOutput(v **RunInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RunInstancesOutput - if *v == nil { - sv = &RunInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceList(&sv.Instances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ownerId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwnerId = ptr.String(xtv) - } - - case strings.EqualFold("requesterId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RequesterId = ptr.String(xtv) - } - - case strings.EqualFold("reservationId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReservationId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentRunScheduledInstancesOutput(v **RunScheduledInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *RunScheduledInstancesOutput - if *v == nil { - sv = &RunScheduledInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instanceIdSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceIdSet(&sv.InstanceIdSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentSearchLocalGatewayRoutesOutput(v **SearchLocalGatewayRoutesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *SearchLocalGatewayRoutesOutput - if *v == nil { - sv = &SearchLocalGatewayRoutesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("routeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentSearchTransitGatewayMulticastGroupsOutput(v **SearchTransitGatewayMulticastGroupsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *SearchTransitGatewayMulticastGroupsOutput - if *v == nil { - sv = &SearchTransitGatewayMulticastGroupsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("multicastGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayMulticastGroupList(&sv.MulticastGroups, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentSearchTransitGatewayRoutesOutput(v **SearchTransitGatewayRoutesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *SearchTransitGatewayRoutesOutput - if *v == nil { - sv = &SearchTransitGatewayRoutesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("additionalRoutesAvailable", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.AdditionalRoutesAvailable = ptr.Bool(xtv) - } - - case strings.EqualFold("routeSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTransitGatewayRouteList(&sv.Routes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStartDeclarativePoliciesReportOutput(v **StartDeclarativePoliciesReportOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StartDeclarativePoliciesReportOutput - if *v == nil { - sv = &StartDeclarativePoliciesReportOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("reportId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReportId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStartInstancesOutput(v **StartInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StartInstancesOutput - if *v == nil { - sv = &StartInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStateChangeList(&sv.StartingInstances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStartNetworkInsightsAccessScopeAnalysisOutput(v **StartNetworkInsightsAccessScopeAnalysisOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StartNetworkInsightsAccessScopeAnalysisOutput - if *v == nil { - sv = &StartNetworkInsightsAccessScopeAnalysisOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAccessScopeAnalysis", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysis(&sv.NetworkInsightsAccessScopeAnalysis, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStartNetworkInsightsAnalysisOutput(v **StartNetworkInsightsAnalysisOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StartNetworkInsightsAnalysisOutput - if *v == nil { - sv = &StartNetworkInsightsAnalysisOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInsightsAnalysis", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysis(&sv.NetworkInsightsAnalysis, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationOutput(v **StartVpcEndpointServicePrivateDnsVerificationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StartVpcEndpointServicePrivateDnsVerificationOutput - if *v == nil { - sv = &StartVpcEndpointServicePrivateDnsVerificationOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.ReturnValue = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentStopInstancesOutput(v **StopInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *StopInstancesOutput - if *v == nil { - sv = &StopInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStateChangeList(&sv.StoppingInstances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentTerminateClientVpnConnectionsOutput(v **TerminateClientVpnConnectionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *TerminateClientVpnConnectionsOutput - if *v == nil { - sv = &TerminateClientVpnConnectionsOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("clientVpnEndpointId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientVpnEndpointId = ptr.String(xtv) - } - - case strings.EqualFold("connectionStatuses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentTerminateConnectionStatusSet(&sv.ConnectionStatuses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("username", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Username = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentTerminateInstancesOutput(v **TerminateInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *TerminateInstancesOutput - if *v == nil { - sv = &TerminateInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceStateChangeList(&sv.TerminatingInstances, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUnassignIpv6AddressesOutput(v **UnassignIpv6AddressesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UnassignIpv6AddressesOutput - if *v == nil { - sv = &UnassignIpv6AddressesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("networkInterfaceId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) - } - - case strings.EqualFold("unassignedIpv6Addresses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6AddressList(&sv.UnassignedIpv6Addresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("unassignedIpv6PrefixSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpPrefixList(&sv.UnassignedIpv6Prefixes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUnassignPrivateNatGatewayAddressOutput(v **UnassignPrivateNatGatewayAddressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UnassignPrivateNatGatewayAddressOutput - if *v == nil { - sv = &UnassignPrivateNatGatewayAddressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("natGatewayAddressSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayAddressList(&sv.NatGatewayAddresses, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("natGatewayId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NatGatewayId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUnlockSnapshotOutput(v **UnlockSnapshotOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UnlockSnapshotOutput - if *v == nil { - sv = &UnlockSnapshotOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("snapshotId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SnapshotId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUnmonitorInstancesOutput(v **UnmonitorInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UnmonitorInstancesOutput - if *v == nil { - sv = &UnmonitorInstancesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("instancesSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentInstanceMonitoringList(&sv.InstanceMonitorings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressOutput(v **UpdateSecurityGroupRuleDescriptionsEgressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UpdateSecurityGroupRuleDescriptionsEgressOutput - if *v == nil { - sv = &UpdateSecurityGroupRuleDescriptionsEgressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressOutput(v **UpdateSecurityGroupRuleDescriptionsIngressOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *UpdateSecurityGroupRuleDescriptionsIngressOutput - if *v == nil { - sv = &UpdateSecurityGroupRuleDescriptionsIngressOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("return", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) - } - sv.Return = ptr.Bool(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentWithdrawByoipCidrOutput(v **WithdrawByoipCidrOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *WithdrawByoipCidrOutput - if *v == nil { - sv = &WithdrawByoipCidrOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("byoipCidr", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentByoipCidr(&sv.ByoipCidr, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/doc.go deleted file mode 100644 index 68f9534b4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package ec2 provides the API client, operations, and parameter types for Amazon -// Elastic Compute Cloud. -// -// # Amazon Elastic Compute Cloud -// -// You can access the features of Amazon Elastic Compute Cloud (Amazon EC2) -// programmatically. For more information, see the [Amazon EC2 Developer Guide]. -// -// [Amazon EC2 Developer Guide]: https://docs.aws.amazon.com/ec2/latest/devguide -package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/endpoints.go deleted file mode 100644 index 1743a98bc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/endpoints.go +++ /dev/null @@ -1,556 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "ec2" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_EC2") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "EC2", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ec2-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ec2.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://ec2-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ec2.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://ec2.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/generated.json deleted file mode 100644 index b5c4a371b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/generated.json +++ /dev/null @@ -1,723 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5", - "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AcceptAddressTransfer.go", - "api_op_AcceptCapacityReservationBillingOwnership.go", - "api_op_AcceptReservedInstancesExchangeQuote.go", - "api_op_AcceptTransitGatewayMulticastDomainAssociations.go", - "api_op_AcceptTransitGatewayPeeringAttachment.go", - "api_op_AcceptTransitGatewayVpcAttachment.go", - "api_op_AcceptVpcEndpointConnections.go", - "api_op_AcceptVpcPeeringConnection.go", - "api_op_AdvertiseByoipCidr.go", - "api_op_AllocateAddress.go", - "api_op_AllocateHosts.go", - "api_op_AllocateIpamPoolCidr.go", - "api_op_ApplySecurityGroupsToClientVpnTargetNetwork.go", - "api_op_AssignIpv6Addresses.go", - "api_op_AssignPrivateIpAddresses.go", - "api_op_AssignPrivateNatGatewayAddress.go", - "api_op_AssociateAddress.go", - "api_op_AssociateCapacityReservationBillingOwner.go", - "api_op_AssociateClientVpnTargetNetwork.go", - "api_op_AssociateDhcpOptions.go", - "api_op_AssociateEnclaveCertificateIamRole.go", - "api_op_AssociateIamInstanceProfile.go", - "api_op_AssociateInstanceEventWindow.go", - "api_op_AssociateIpamByoasn.go", - "api_op_AssociateIpamResourceDiscovery.go", - "api_op_AssociateNatGatewayAddress.go", - "api_op_AssociateRouteServer.go", - "api_op_AssociateRouteTable.go", - "api_op_AssociateSecurityGroupVpc.go", - "api_op_AssociateSubnetCidrBlock.go", - "api_op_AssociateTransitGatewayMulticastDomain.go", - "api_op_AssociateTransitGatewayPolicyTable.go", - "api_op_AssociateTransitGatewayRouteTable.go", - "api_op_AssociateTrunkInterface.go", - "api_op_AssociateVpcCidrBlock.go", - "api_op_AttachClassicLinkVpc.go", - "api_op_AttachInternetGateway.go", - "api_op_AttachNetworkInterface.go", - "api_op_AttachVerifiedAccessTrustProvider.go", - "api_op_AttachVolume.go", - "api_op_AttachVpnGateway.go", - "api_op_AuthorizeClientVpnIngress.go", - "api_op_AuthorizeSecurityGroupEgress.go", - "api_op_AuthorizeSecurityGroupIngress.go", - "api_op_BundleInstance.go", - "api_op_CancelBundleTask.go", - "api_op_CancelCapacityReservation.go", - "api_op_CancelCapacityReservationFleets.go", - "api_op_CancelConversionTask.go", - "api_op_CancelDeclarativePoliciesReport.go", - "api_op_CancelExportTask.go", - "api_op_CancelImageLaunchPermission.go", - "api_op_CancelImportTask.go", - "api_op_CancelReservedInstancesListing.go", - "api_op_CancelSpotFleetRequests.go", - "api_op_CancelSpotInstanceRequests.go", - "api_op_ConfirmProductInstance.go", - "api_op_CopyFpgaImage.go", - "api_op_CopyImage.go", - "api_op_CopySnapshot.go", - "api_op_CopySnapshot_test.go", - "api_op_CreateCapacityReservation.go", - "api_op_CreateCapacityReservationBySplitting.go", - "api_op_CreateCapacityReservationFleet.go", - "api_op_CreateCarrierGateway.go", - "api_op_CreateClientVpnEndpoint.go", - "api_op_CreateClientVpnRoute.go", - "api_op_CreateCoipCidr.go", - "api_op_CreateCoipPool.go", - "api_op_CreateCustomerGateway.go", - "api_op_CreateDefaultSubnet.go", - "api_op_CreateDefaultVpc.go", - "api_op_CreateDelegateMacVolumeOwnershipTask.go", - "api_op_CreateDhcpOptions.go", - "api_op_CreateEgressOnlyInternetGateway.go", - "api_op_CreateFleet.go", - "api_op_CreateFlowLogs.go", - "api_op_CreateFpgaImage.go", - "api_op_CreateImage.go", - "api_op_CreateInstanceConnectEndpoint.go", - "api_op_CreateInstanceEventWindow.go", - "api_op_CreateInstanceExportTask.go", - "api_op_CreateInternetGateway.go", - "api_op_CreateIpam.go", - "api_op_CreateIpamExternalResourceVerificationToken.go", - "api_op_CreateIpamPool.go", - "api_op_CreateIpamResourceDiscovery.go", - "api_op_CreateIpamScope.go", - "api_op_CreateKeyPair.go", - "api_op_CreateLaunchTemplate.go", - "api_op_CreateLaunchTemplateVersion.go", - "api_op_CreateLocalGatewayRoute.go", - "api_op_CreateLocalGatewayRouteTable.go", - "api_op_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go", - "api_op_CreateLocalGatewayRouteTableVpcAssociation.go", - "api_op_CreateLocalGatewayVirtualInterface.go", - "api_op_CreateLocalGatewayVirtualInterfaceGroup.go", - "api_op_CreateMacSystemIntegrityProtectionModificationTask.go", - "api_op_CreateManagedPrefixList.go", - "api_op_CreateNatGateway.go", - "api_op_CreateNetworkAcl.go", - "api_op_CreateNetworkAclEntry.go", - "api_op_CreateNetworkInsightsAccessScope.go", - "api_op_CreateNetworkInsightsPath.go", - "api_op_CreateNetworkInterface.go", - "api_op_CreateNetworkInterfacePermission.go", - "api_op_CreatePlacementGroup.go", - "api_op_CreatePublicIpv4Pool.go", - "api_op_CreateReplaceRootVolumeTask.go", - "api_op_CreateReservedInstancesListing.go", - "api_op_CreateRestoreImageTask.go", - "api_op_CreateRoute.go", - "api_op_CreateRouteServer.go", - "api_op_CreateRouteServerEndpoint.go", - "api_op_CreateRouteServerPeer.go", - "api_op_CreateRouteTable.go", - "api_op_CreateSecurityGroup.go", - "api_op_CreateSnapshot.go", - "api_op_CreateSnapshots.go", - "api_op_CreateSpotDatafeedSubscription.go", - "api_op_CreateStoreImageTask.go", - "api_op_CreateSubnet.go", - "api_op_CreateSubnetCidrReservation.go", - "api_op_CreateTags.go", - "api_op_CreateTrafficMirrorFilter.go", - "api_op_CreateTrafficMirrorFilterRule.go", - "api_op_CreateTrafficMirrorSession.go", - "api_op_CreateTrafficMirrorTarget.go", - "api_op_CreateTransitGateway.go", - "api_op_CreateTransitGatewayConnect.go", - "api_op_CreateTransitGatewayConnectPeer.go", - "api_op_CreateTransitGatewayMulticastDomain.go", - "api_op_CreateTransitGatewayPeeringAttachment.go", - "api_op_CreateTransitGatewayPolicyTable.go", - "api_op_CreateTransitGatewayPrefixListReference.go", - "api_op_CreateTransitGatewayRoute.go", - "api_op_CreateTransitGatewayRouteTable.go", - "api_op_CreateTransitGatewayRouteTableAnnouncement.go", - "api_op_CreateTransitGatewayVpcAttachment.go", - "api_op_CreateVerifiedAccessEndpoint.go", - "api_op_CreateVerifiedAccessGroup.go", - "api_op_CreateVerifiedAccessInstance.go", - "api_op_CreateVerifiedAccessTrustProvider.go", - "api_op_CreateVolume.go", - "api_op_CreateVpc.go", - "api_op_CreateVpcBlockPublicAccessExclusion.go", - "api_op_CreateVpcEndpoint.go", - "api_op_CreateVpcEndpointConnectionNotification.go", - "api_op_CreateVpcEndpointServiceConfiguration.go", - "api_op_CreateVpcPeeringConnection.go", - "api_op_CreateVpnConnection.go", - "api_op_CreateVpnConnectionRoute.go", - "api_op_CreateVpnGateway.go", - "api_op_DeleteCarrierGateway.go", - "api_op_DeleteClientVpnEndpoint.go", - "api_op_DeleteClientVpnRoute.go", - "api_op_DeleteCoipCidr.go", - "api_op_DeleteCoipPool.go", - "api_op_DeleteCustomerGateway.go", - "api_op_DeleteDhcpOptions.go", - "api_op_DeleteEgressOnlyInternetGateway.go", - "api_op_DeleteFleets.go", - "api_op_DeleteFlowLogs.go", - "api_op_DeleteFpgaImage.go", - "api_op_DeleteInstanceConnectEndpoint.go", - "api_op_DeleteInstanceEventWindow.go", - "api_op_DeleteInternetGateway.go", - "api_op_DeleteIpam.go", - "api_op_DeleteIpamExternalResourceVerificationToken.go", - "api_op_DeleteIpamPool.go", - "api_op_DeleteIpamResourceDiscovery.go", - "api_op_DeleteIpamScope.go", - "api_op_DeleteKeyPair.go", - "api_op_DeleteLaunchTemplate.go", - "api_op_DeleteLaunchTemplateVersions.go", - "api_op_DeleteLocalGatewayRoute.go", - "api_op_DeleteLocalGatewayRouteTable.go", - "api_op_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation.go", - "api_op_DeleteLocalGatewayRouteTableVpcAssociation.go", - "api_op_DeleteLocalGatewayVirtualInterface.go", - "api_op_DeleteLocalGatewayVirtualInterfaceGroup.go", - "api_op_DeleteManagedPrefixList.go", - "api_op_DeleteNatGateway.go", - "api_op_DeleteNetworkAcl.go", - "api_op_DeleteNetworkAclEntry.go", - "api_op_DeleteNetworkInsightsAccessScope.go", - "api_op_DeleteNetworkInsightsAccessScopeAnalysis.go", - "api_op_DeleteNetworkInsightsAnalysis.go", - "api_op_DeleteNetworkInsightsPath.go", - "api_op_DeleteNetworkInterface.go", - "api_op_DeleteNetworkInterfacePermission.go", - "api_op_DeletePlacementGroup.go", - "api_op_DeletePublicIpv4Pool.go", - "api_op_DeleteQueuedReservedInstances.go", - "api_op_DeleteRoute.go", - "api_op_DeleteRouteServer.go", - "api_op_DeleteRouteServerEndpoint.go", - "api_op_DeleteRouteServerPeer.go", - "api_op_DeleteRouteTable.go", - "api_op_DeleteSecurityGroup.go", - "api_op_DeleteSnapshot.go", - "api_op_DeleteSpotDatafeedSubscription.go", - "api_op_DeleteSubnet.go", - "api_op_DeleteSubnetCidrReservation.go", - "api_op_DeleteTags.go", - "api_op_DeleteTrafficMirrorFilter.go", - "api_op_DeleteTrafficMirrorFilterRule.go", - "api_op_DeleteTrafficMirrorSession.go", - "api_op_DeleteTrafficMirrorTarget.go", - "api_op_DeleteTransitGateway.go", - "api_op_DeleteTransitGatewayConnect.go", - "api_op_DeleteTransitGatewayConnectPeer.go", - "api_op_DeleteTransitGatewayMulticastDomain.go", - "api_op_DeleteTransitGatewayPeeringAttachment.go", - "api_op_DeleteTransitGatewayPolicyTable.go", - "api_op_DeleteTransitGatewayPrefixListReference.go", - "api_op_DeleteTransitGatewayRoute.go", - "api_op_DeleteTransitGatewayRouteTable.go", - "api_op_DeleteTransitGatewayRouteTableAnnouncement.go", - "api_op_DeleteTransitGatewayVpcAttachment.go", - "api_op_DeleteVerifiedAccessEndpoint.go", - "api_op_DeleteVerifiedAccessGroup.go", - "api_op_DeleteVerifiedAccessInstance.go", - "api_op_DeleteVerifiedAccessTrustProvider.go", - "api_op_DeleteVolume.go", - "api_op_DeleteVpc.go", - "api_op_DeleteVpcBlockPublicAccessExclusion.go", - "api_op_DeleteVpcEndpointConnectionNotifications.go", - "api_op_DeleteVpcEndpointServiceConfigurations.go", - "api_op_DeleteVpcEndpoints.go", - "api_op_DeleteVpcPeeringConnection.go", - "api_op_DeleteVpnConnection.go", - "api_op_DeleteVpnConnectionRoute.go", - "api_op_DeleteVpnGateway.go", - "api_op_DeprovisionByoipCidr.go", - "api_op_DeprovisionIpamByoasn.go", - "api_op_DeprovisionIpamPoolCidr.go", - "api_op_DeprovisionPublicIpv4PoolCidr.go", - "api_op_DeregisterImage.go", - "api_op_DeregisterInstanceEventNotificationAttributes.go", - "api_op_DeregisterTransitGatewayMulticastGroupMembers.go", - "api_op_DeregisterTransitGatewayMulticastGroupSources.go", - "api_op_DescribeAccountAttributes.go", - "api_op_DescribeAddressTransfers.go", - "api_op_DescribeAddresses.go", - "api_op_DescribeAddressesAttribute.go", - "api_op_DescribeAggregateIdFormat.go", - "api_op_DescribeAvailabilityZones.go", - "api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go", - "api_op_DescribeBundleTasks.go", - "api_op_DescribeByoipCidrs.go", - "api_op_DescribeCapacityBlockExtensionHistory.go", - "api_op_DescribeCapacityBlockExtensionOfferings.go", - "api_op_DescribeCapacityBlockOfferings.go", - "api_op_DescribeCapacityBlockStatus.go", - "api_op_DescribeCapacityBlocks.go", - "api_op_DescribeCapacityReservationBillingRequests.go", - "api_op_DescribeCapacityReservationFleets.go", - "api_op_DescribeCapacityReservations.go", - "api_op_DescribeCarrierGateways.go", - "api_op_DescribeClassicLinkInstances.go", - "api_op_DescribeClientVpnAuthorizationRules.go", - "api_op_DescribeClientVpnConnections.go", - "api_op_DescribeClientVpnEndpoints.go", - "api_op_DescribeClientVpnRoutes.go", - "api_op_DescribeClientVpnTargetNetworks.go", - "api_op_DescribeCoipPools.go", - "api_op_DescribeConversionTasks.go", - "api_op_DescribeCustomerGateways.go", - "api_op_DescribeDeclarativePoliciesReports.go", - "api_op_DescribeDhcpOptions.go", - "api_op_DescribeEgressOnlyInternetGateways.go", - "api_op_DescribeElasticGpus.go", - "api_op_DescribeExportImageTasks.go", - "api_op_DescribeExportTasks.go", - "api_op_DescribeFastLaunchImages.go", - "api_op_DescribeFastSnapshotRestores.go", - "api_op_DescribeFleetHistory.go", - "api_op_DescribeFleetInstances.go", - "api_op_DescribeFleets.go", - "api_op_DescribeFlowLogs.go", - "api_op_DescribeFpgaImageAttribute.go", - "api_op_DescribeFpgaImages.go", - "api_op_DescribeHostReservationOfferings.go", - "api_op_DescribeHostReservations.go", - "api_op_DescribeHosts.go", - "api_op_DescribeIamInstanceProfileAssociations.go", - "api_op_DescribeIdFormat.go", - "api_op_DescribeIdentityIdFormat.go", - "api_op_DescribeImageAttribute.go", - "api_op_DescribeImages.go", - "api_op_DescribeImportImageTasks.go", - "api_op_DescribeImportSnapshotTasks.go", - "api_op_DescribeInstanceAttribute.go", - "api_op_DescribeInstanceConnectEndpoints.go", - "api_op_DescribeInstanceCreditSpecifications.go", - "api_op_DescribeInstanceEventNotificationAttributes.go", - "api_op_DescribeInstanceEventWindows.go", - "api_op_DescribeInstanceImageMetadata.go", - "api_op_DescribeInstanceStatus.go", - "api_op_DescribeInstanceTopology.go", - "api_op_DescribeInstanceTypeOfferings.go", - "api_op_DescribeInstanceTypes.go", - "api_op_DescribeInstances.go", - "api_op_DescribeInternetGateways.go", - "api_op_DescribeIpamByoasn.go", - "api_op_DescribeIpamExternalResourceVerificationTokens.go", - "api_op_DescribeIpamPools.go", - "api_op_DescribeIpamResourceDiscoveries.go", - "api_op_DescribeIpamResourceDiscoveryAssociations.go", - "api_op_DescribeIpamScopes.go", - "api_op_DescribeIpams.go", - "api_op_DescribeIpv6Pools.go", - "api_op_DescribeKeyPairs.go", - "api_op_DescribeLaunchTemplateVersions.go", - "api_op_DescribeLaunchTemplates.go", - "api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go", - "api_op_DescribeLocalGatewayRouteTableVpcAssociations.go", - "api_op_DescribeLocalGatewayRouteTables.go", - "api_op_DescribeLocalGatewayVirtualInterfaceGroups.go", - "api_op_DescribeLocalGatewayVirtualInterfaces.go", - "api_op_DescribeLocalGateways.go", - "api_op_DescribeLockedSnapshots.go", - "api_op_DescribeMacHosts.go", - "api_op_DescribeMacModificationTasks.go", - "api_op_DescribeManagedPrefixLists.go", - "api_op_DescribeMovingAddresses.go", - "api_op_DescribeNatGateways.go", - "api_op_DescribeNetworkAcls.go", - "api_op_DescribeNetworkInsightsAccessScopeAnalyses.go", - "api_op_DescribeNetworkInsightsAccessScopes.go", - "api_op_DescribeNetworkInsightsAnalyses.go", - "api_op_DescribeNetworkInsightsPaths.go", - "api_op_DescribeNetworkInterfaceAttribute.go", - "api_op_DescribeNetworkInterfacePermissions.go", - "api_op_DescribeNetworkInterfaces.go", - "api_op_DescribeOutpostLags.go", - "api_op_DescribePlacementGroups.go", - "api_op_DescribePrefixLists.go", - "api_op_DescribePrincipalIdFormat.go", - "api_op_DescribePublicIpv4Pools.go", - "api_op_DescribeRegions.go", - "api_op_DescribeReplaceRootVolumeTasks.go", - "api_op_DescribeReservedInstances.go", - "api_op_DescribeReservedInstancesListings.go", - "api_op_DescribeReservedInstancesModifications.go", - "api_op_DescribeReservedInstancesOfferings.go", - "api_op_DescribeRouteServerEndpoints.go", - "api_op_DescribeRouteServerPeers.go", - "api_op_DescribeRouteServers.go", - "api_op_DescribeRouteTables.go", - "api_op_DescribeScheduledInstanceAvailability.go", - "api_op_DescribeScheduledInstances.go", - "api_op_DescribeSecurityGroupReferences.go", - "api_op_DescribeSecurityGroupRules.go", - "api_op_DescribeSecurityGroupVpcAssociations.go", - "api_op_DescribeSecurityGroups.go", - "api_op_DescribeServiceLinkVirtualInterfaces.go", - "api_op_DescribeSnapshotAttribute.go", - "api_op_DescribeSnapshotTierStatus.go", - "api_op_DescribeSnapshots.go", - "api_op_DescribeSpotDatafeedSubscription.go", - "api_op_DescribeSpotFleetInstances.go", - "api_op_DescribeSpotFleetRequestHistory.go", - "api_op_DescribeSpotFleetRequests.go", - "api_op_DescribeSpotInstanceRequests.go", - "api_op_DescribeSpotPriceHistory.go", - "api_op_DescribeStaleSecurityGroups.go", - "api_op_DescribeStoreImageTasks.go", - "api_op_DescribeSubnets.go", - "api_op_DescribeTags.go", - "api_op_DescribeTrafficMirrorFilterRules.go", - "api_op_DescribeTrafficMirrorFilters.go", - "api_op_DescribeTrafficMirrorSessions.go", - "api_op_DescribeTrafficMirrorTargets.go", - "api_op_DescribeTransitGatewayAttachments.go", - "api_op_DescribeTransitGatewayConnectPeers.go", - "api_op_DescribeTransitGatewayConnects.go", - "api_op_DescribeTransitGatewayMulticastDomains.go", - "api_op_DescribeTransitGatewayPeeringAttachments.go", - "api_op_DescribeTransitGatewayPolicyTables.go", - "api_op_DescribeTransitGatewayRouteTableAnnouncements.go", - "api_op_DescribeTransitGatewayRouteTables.go", - "api_op_DescribeTransitGatewayVpcAttachments.go", - "api_op_DescribeTransitGateways.go", - "api_op_DescribeTrunkInterfaceAssociations.go", - "api_op_DescribeVerifiedAccessEndpoints.go", - "api_op_DescribeVerifiedAccessGroups.go", - "api_op_DescribeVerifiedAccessInstanceLoggingConfigurations.go", - "api_op_DescribeVerifiedAccessInstances.go", - "api_op_DescribeVerifiedAccessTrustProviders.go", - "api_op_DescribeVolumeAttribute.go", - "api_op_DescribeVolumeStatus.go", - "api_op_DescribeVolumes.go", - "api_op_DescribeVolumesModifications.go", - "api_op_DescribeVpcAttribute.go", - "api_op_DescribeVpcBlockPublicAccessExclusions.go", - "api_op_DescribeVpcBlockPublicAccessOptions.go", - "api_op_DescribeVpcClassicLink.go", - "api_op_DescribeVpcClassicLinkDnsSupport.go", - "api_op_DescribeVpcEndpointAssociations.go", - "api_op_DescribeVpcEndpointConnectionNotifications.go", - "api_op_DescribeVpcEndpointConnections.go", - "api_op_DescribeVpcEndpointServiceConfigurations.go", - "api_op_DescribeVpcEndpointServicePermissions.go", - "api_op_DescribeVpcEndpointServices.go", - "api_op_DescribeVpcEndpoints.go", - "api_op_DescribeVpcPeeringConnections.go", - "api_op_DescribeVpcs.go", - "api_op_DescribeVpnConnections.go", - "api_op_DescribeVpnGateways.go", - "api_op_DetachClassicLinkVpc.go", - "api_op_DetachInternetGateway.go", - "api_op_DetachNetworkInterface.go", - "api_op_DetachVerifiedAccessTrustProvider.go", - "api_op_DetachVolume.go", - "api_op_DetachVpnGateway.go", - "api_op_DisableAddressTransfer.go", - "api_op_DisableAllowedImagesSettings.go", - "api_op_DisableAwsNetworkPerformanceMetricSubscription.go", - "api_op_DisableEbsEncryptionByDefault.go", - "api_op_DisableFastLaunch.go", - "api_op_DisableFastSnapshotRestores.go", - "api_op_DisableImage.go", - "api_op_DisableImageBlockPublicAccess.go", - "api_op_DisableImageDeprecation.go", - "api_op_DisableImageDeregistrationProtection.go", - "api_op_DisableIpamOrganizationAdminAccount.go", - "api_op_DisableRouteServerPropagation.go", - "api_op_DisableSerialConsoleAccess.go", - "api_op_DisableSnapshotBlockPublicAccess.go", - "api_op_DisableTransitGatewayRouteTablePropagation.go", - "api_op_DisableVgwRoutePropagation.go", - "api_op_DisableVpcClassicLink.go", - "api_op_DisableVpcClassicLinkDnsSupport.go", - "api_op_DisassociateAddress.go", - "api_op_DisassociateCapacityReservationBillingOwner.go", - "api_op_DisassociateClientVpnTargetNetwork.go", - "api_op_DisassociateEnclaveCertificateIamRole.go", - "api_op_DisassociateIamInstanceProfile.go", - "api_op_DisassociateInstanceEventWindow.go", - "api_op_DisassociateIpamByoasn.go", - "api_op_DisassociateIpamResourceDiscovery.go", - "api_op_DisassociateNatGatewayAddress.go", - "api_op_DisassociateRouteServer.go", - "api_op_DisassociateRouteTable.go", - "api_op_DisassociateSecurityGroupVpc.go", - "api_op_DisassociateSubnetCidrBlock.go", - "api_op_DisassociateTransitGatewayMulticastDomain.go", - "api_op_DisassociateTransitGatewayPolicyTable.go", - "api_op_DisassociateTransitGatewayRouteTable.go", - "api_op_DisassociateTrunkInterface.go", - "api_op_DisassociateVpcCidrBlock.go", - "api_op_EnableAddressTransfer.go", - "api_op_EnableAllowedImagesSettings.go", - "api_op_EnableAwsNetworkPerformanceMetricSubscription.go", - "api_op_EnableEbsEncryptionByDefault.go", - "api_op_EnableFastLaunch.go", - "api_op_EnableFastSnapshotRestores.go", - "api_op_EnableImage.go", - "api_op_EnableImageBlockPublicAccess.go", - "api_op_EnableImageDeprecation.go", - "api_op_EnableImageDeregistrationProtection.go", - "api_op_EnableIpamOrganizationAdminAccount.go", - "api_op_EnableReachabilityAnalyzerOrganizationSharing.go", - "api_op_EnableRouteServerPropagation.go", - "api_op_EnableSerialConsoleAccess.go", - "api_op_EnableSnapshotBlockPublicAccess.go", - "api_op_EnableTransitGatewayRouteTablePropagation.go", - "api_op_EnableVgwRoutePropagation.go", - "api_op_EnableVolumeIO.go", - "api_op_EnableVpcClassicLink.go", - "api_op_EnableVpcClassicLinkDnsSupport.go", - "api_op_ExportClientVpnClientCertificateRevocationList.go", - "api_op_ExportClientVpnClientConfiguration.go", - "api_op_ExportImage.go", - "api_op_ExportTransitGatewayRoutes.go", - "api_op_ExportVerifiedAccessInstanceClientConfiguration.go", - "api_op_GetActiveVpnTunnelStatus.go", - "api_op_GetAllowedImagesSettings.go", - "api_op_GetAssociatedEnclaveCertificateIamRoles.go", - "api_op_GetAssociatedIpv6PoolCidrs.go", - "api_op_GetAwsNetworkPerformanceData.go", - "api_op_GetCapacityReservationUsage.go", - "api_op_GetCoipPoolUsage.go", - "api_op_GetConsoleOutput.go", - "api_op_GetConsoleScreenshot.go", - "api_op_GetDeclarativePoliciesReportSummary.go", - "api_op_GetDefaultCreditSpecification.go", - "api_op_GetEbsDefaultKmsKeyId.go", - "api_op_GetEbsEncryptionByDefault.go", - "api_op_GetFlowLogsIntegrationTemplate.go", - "api_op_GetGroupsForCapacityReservation.go", - "api_op_GetHostReservationPurchasePreview.go", - "api_op_GetImageBlockPublicAccessState.go", - "api_op_GetInstanceMetadataDefaults.go", - "api_op_GetInstanceTpmEkPub.go", - "api_op_GetInstanceTypesFromInstanceRequirements.go", - "api_op_GetInstanceUefiData.go", - "api_op_GetIpamAddressHistory.go", - "api_op_GetIpamDiscoveredAccounts.go", - "api_op_GetIpamDiscoveredPublicAddresses.go", - "api_op_GetIpamDiscoveredResourceCidrs.go", - "api_op_GetIpamPoolAllocations.go", - "api_op_GetIpamPoolCidrs.go", - "api_op_GetIpamResourceCidrs.go", - "api_op_GetLaunchTemplateData.go", - "api_op_GetManagedPrefixListAssociations.go", - "api_op_GetManagedPrefixListEntries.go", - "api_op_GetNetworkInsightsAccessScopeAnalysisFindings.go", - "api_op_GetNetworkInsightsAccessScopeContent.go", - "api_op_GetPasswordData.go", - "api_op_GetReservedInstancesExchangeQuote.go", - "api_op_GetRouteServerAssociations.go", - "api_op_GetRouteServerPropagations.go", - "api_op_GetRouteServerRoutingDatabase.go", - "api_op_GetSecurityGroupsForVpc.go", - "api_op_GetSerialConsoleAccessStatus.go", - "api_op_GetSnapshotBlockPublicAccessState.go", - "api_op_GetSpotPlacementScores.go", - "api_op_GetSubnetCidrReservations.go", - "api_op_GetTransitGatewayAttachmentPropagations.go", - "api_op_GetTransitGatewayMulticastDomainAssociations.go", - "api_op_GetTransitGatewayPolicyTableAssociations.go", - "api_op_GetTransitGatewayPolicyTableEntries.go", - "api_op_GetTransitGatewayPrefixListReferences.go", - "api_op_GetTransitGatewayRouteTableAssociations.go", - "api_op_GetTransitGatewayRouteTablePropagations.go", - "api_op_GetVerifiedAccessEndpointPolicy.go", - "api_op_GetVerifiedAccessEndpointTargets.go", - "api_op_GetVerifiedAccessGroupPolicy.go", - "api_op_GetVpnConnectionDeviceSampleConfiguration.go", - "api_op_GetVpnConnectionDeviceTypes.go", - "api_op_GetVpnTunnelReplacementStatus.go", - "api_op_ImportClientVpnClientCertificateRevocationList.go", - "api_op_ImportImage.go", - "api_op_ImportInstance.go", - "api_op_ImportKeyPair.go", - "api_op_ImportSnapshot.go", - "api_op_ImportVolume.go", - "api_op_ListImagesInRecycleBin.go", - "api_op_ListSnapshotsInRecycleBin.go", - "api_op_LockSnapshot.go", - "api_op_ModifyAddressAttribute.go", - "api_op_ModifyAvailabilityZoneGroup.go", - "api_op_ModifyCapacityReservation.go", - "api_op_ModifyCapacityReservationFleet.go", - "api_op_ModifyClientVpnEndpoint.go", - "api_op_ModifyDefaultCreditSpecification.go", - "api_op_ModifyEbsDefaultKmsKeyId.go", - "api_op_ModifyFleet.go", - "api_op_ModifyFpgaImageAttribute.go", - "api_op_ModifyHosts.go", - "api_op_ModifyIdFormat.go", - "api_op_ModifyIdentityIdFormat.go", - "api_op_ModifyImageAttribute.go", - "api_op_ModifyInstanceAttribute.go", - "api_op_ModifyInstanceCapacityReservationAttributes.go", - "api_op_ModifyInstanceCpuOptions.go", - "api_op_ModifyInstanceCreditSpecification.go", - "api_op_ModifyInstanceEventStartTime.go", - "api_op_ModifyInstanceEventWindow.go", - "api_op_ModifyInstanceMaintenanceOptions.go", - "api_op_ModifyInstanceMetadataDefaults.go", - "api_op_ModifyInstanceMetadataOptions.go", - "api_op_ModifyInstanceNetworkPerformanceOptions.go", - "api_op_ModifyInstancePlacement.go", - "api_op_ModifyIpam.go", - "api_op_ModifyIpamPool.go", - "api_op_ModifyIpamResourceCidr.go", - "api_op_ModifyIpamResourceDiscovery.go", - "api_op_ModifyIpamScope.go", - "api_op_ModifyLaunchTemplate.go", - "api_op_ModifyLocalGatewayRoute.go", - "api_op_ModifyManagedPrefixList.go", - "api_op_ModifyNetworkInterfaceAttribute.go", - "api_op_ModifyPrivateDnsNameOptions.go", - "api_op_ModifyPublicIpDnsNameOptions.go", - "api_op_ModifyReservedInstances.go", - "api_op_ModifyRouteServer.go", - "api_op_ModifySecurityGroupRules.go", - "api_op_ModifySnapshotAttribute.go", - "api_op_ModifySnapshotTier.go", - "api_op_ModifySpotFleetRequest.go", - "api_op_ModifySubnetAttribute.go", - "api_op_ModifyTrafficMirrorFilterNetworkServices.go", - "api_op_ModifyTrafficMirrorFilterRule.go", - "api_op_ModifyTrafficMirrorSession.go", - "api_op_ModifyTransitGateway.go", - "api_op_ModifyTransitGatewayPrefixListReference.go", - "api_op_ModifyTransitGatewayVpcAttachment.go", - "api_op_ModifyVerifiedAccessEndpoint.go", - "api_op_ModifyVerifiedAccessEndpointPolicy.go", - "api_op_ModifyVerifiedAccessGroup.go", - "api_op_ModifyVerifiedAccessGroupPolicy.go", - "api_op_ModifyVerifiedAccessInstance.go", - "api_op_ModifyVerifiedAccessInstanceLoggingConfiguration.go", - "api_op_ModifyVerifiedAccessTrustProvider.go", - "api_op_ModifyVolume.go", - "api_op_ModifyVolumeAttribute.go", - "api_op_ModifyVpcAttribute.go", - "api_op_ModifyVpcBlockPublicAccessExclusion.go", - "api_op_ModifyVpcBlockPublicAccessOptions.go", - "api_op_ModifyVpcEndpoint.go", - "api_op_ModifyVpcEndpointConnectionNotification.go", - "api_op_ModifyVpcEndpointServiceConfiguration.go", - "api_op_ModifyVpcEndpointServicePayerResponsibility.go", - "api_op_ModifyVpcEndpointServicePermissions.go", - "api_op_ModifyVpcPeeringConnectionOptions.go", - "api_op_ModifyVpcTenancy.go", - "api_op_ModifyVpnConnection.go", - "api_op_ModifyVpnConnectionOptions.go", - "api_op_ModifyVpnTunnelCertificate.go", - "api_op_ModifyVpnTunnelOptions.go", - "api_op_MonitorInstances.go", - "api_op_MoveAddressToVpc.go", - "api_op_MoveByoipCidrToIpam.go", - "api_op_MoveCapacityReservationInstances.go", - "api_op_ProvisionByoipCidr.go", - "api_op_ProvisionIpamByoasn.go", - "api_op_ProvisionIpamPoolCidr.go", - "api_op_ProvisionPublicIpv4PoolCidr.go", - "api_op_PurchaseCapacityBlock.go", - "api_op_PurchaseCapacityBlockExtension.go", - "api_op_PurchaseHostReservation.go", - "api_op_PurchaseReservedInstancesOffering.go", - "api_op_PurchaseScheduledInstances.go", - "api_op_RebootInstances.go", - "api_op_RegisterImage.go", - "api_op_RegisterInstanceEventNotificationAttributes.go", - "api_op_RegisterTransitGatewayMulticastGroupMembers.go", - "api_op_RegisterTransitGatewayMulticastGroupSources.go", - "api_op_RejectCapacityReservationBillingOwnership.go", - "api_op_RejectTransitGatewayMulticastDomainAssociations.go", - "api_op_RejectTransitGatewayPeeringAttachment.go", - "api_op_RejectTransitGatewayVpcAttachment.go", - "api_op_RejectVpcEndpointConnections.go", - "api_op_RejectVpcPeeringConnection.go", - "api_op_ReleaseAddress.go", - "api_op_ReleaseHosts.go", - "api_op_ReleaseIpamPoolAllocation.go", - "api_op_ReplaceIamInstanceProfileAssociation.go", - "api_op_ReplaceImageCriteriaInAllowedImagesSettings.go", - "api_op_ReplaceNetworkAclAssociation.go", - "api_op_ReplaceNetworkAclEntry.go", - "api_op_ReplaceRoute.go", - "api_op_ReplaceRouteTableAssociation.go", - "api_op_ReplaceTransitGatewayRoute.go", - "api_op_ReplaceVpnTunnel.go", - "api_op_ReportInstanceStatus.go", - "api_op_RequestSpotFleet.go", - "api_op_RequestSpotInstances.go", - "api_op_ResetAddressAttribute.go", - "api_op_ResetEbsDefaultKmsKeyId.go", - "api_op_ResetFpgaImageAttribute.go", - "api_op_ResetImageAttribute.go", - "api_op_ResetInstanceAttribute.go", - "api_op_ResetNetworkInterfaceAttribute.go", - "api_op_ResetSnapshotAttribute.go", - "api_op_RestoreAddressToClassic.go", - "api_op_RestoreImageFromRecycleBin.go", - "api_op_RestoreManagedPrefixListVersion.go", - "api_op_RestoreSnapshotFromRecycleBin.go", - "api_op_RestoreSnapshotTier.go", - "api_op_RevokeClientVpnIngress.go", - "api_op_RevokeSecurityGroupEgress.go", - "api_op_RevokeSecurityGroupIngress.go", - "api_op_RunInstances.go", - "api_op_RunScheduledInstances.go", - "api_op_SearchLocalGatewayRoutes.go", - "api_op_SearchTransitGatewayMulticastGroups.go", - "api_op_SearchTransitGatewayRoutes.go", - "api_op_SendDiagnosticInterrupt.go", - "api_op_StartDeclarativePoliciesReport.go", - "api_op_StartInstances.go", - "api_op_StartNetworkInsightsAccessScopeAnalysis.go", - "api_op_StartNetworkInsightsAnalysis.go", - "api_op_StartVpcEndpointServicePrivateDnsVerification.go", - "api_op_StopInstances.go", - "api_op_TerminateClientVpnConnections.go", - "api_op_TerminateInstances.go", - "api_op_UnassignIpv6Addresses.go", - "api_op_UnassignPrivateIpAddresses.go", - "api_op_UnassignPrivateNatGatewayAddress.go", - "api_op_UnlockSnapshot.go", - "api_op_UnmonitorInstances.go", - "api_op_UpdateSecurityGroupRuleDescriptionsEgress.go", - "api_op_UpdateSecurityGroupRuleDescriptionsIngress.go", - "api_op_WithdrawByoipCidr.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/enums.go", - "types/types.go", - "validators.go" - ], - "go": "1.22", - "module": "github.com/aws/aws-sdk-go-v2/service/ec2", - "unstable": false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/go_module_metadata.go deleted file mode 100644 index 749df6cce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package ec2 - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.233.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints/endpoints.go deleted file mode 100644 index 7f18ac0b6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints/endpoints.go +++ /dev/null @@ -1,700 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver EC2 endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ec2-fips.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "af-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "af-south-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.af-south-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-east-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-east-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-northeast-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-northeast-2.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-northeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-south-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-southeast-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ap-southeast-2.api.aws", - }, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-4", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-5", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-7", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-central-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.ca-central-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "ca-central-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.ca-central-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.ca-west-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-central-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-central-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "eu-central-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-north-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-north-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "eu-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-south-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-south-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-west-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "eu-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-2", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-west-2.api.aws", - }, - endpoints.EndpointKey{ - Region: "eu-west-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-3", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.eu-west-3.api.aws", - }, - endpoints.EndpointKey{ - Region: "fips-ca-central-1", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.ca-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-central-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-ca-west-1", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.ca-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-east-1", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-east-2", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-west-1", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-west-2", - }: endpoints.Endpoint{ - Hostname: "ec2-fips.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-south-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.me-south-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "mx-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.sa-east-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.us-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-east-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-east-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "us-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.us-east-2.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-east-2", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-east-2.api.aws", - }, - endpoints.EndpointKey{ - Region: "us-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.us-west-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-west-1.api.aws", - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.us-west-2.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-2", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-west-2.api.aws", - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.amazonaws.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ec2-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.amazonaws.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "cn-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "cn-northwest-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-iso-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-iso-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.sc2s.sgov.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isob-east-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "eu-isoe-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isof-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-isof-south-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ec2.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ec2-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ec2.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-gov-east-1", - }: endpoints.Endpoint{ - Hostname: "ec2.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-gov-east-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-gov-east-1.api.aws", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - }: endpoints.Endpoint{ - Hostname: "ec2.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ec2.us-gov-west-1.api.aws", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/options.go deleted file mode 100644 index 82566bc8b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/options.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // Provides idempotency tokens values that will be automatically populated into - // idempotent API operations. - IdempotencyTokenProvider IdempotencyTokenProvider - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/serializers.go deleted file mode 100644 index 831188f52..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/serializers.go +++ /dev/null @@ -1,81072 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/query" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "math" - "path" -) - -type awsEc2query_serializeOpAcceptAddressTransfer struct { -} - -func (*awsEc2query_serializeOpAcceptAddressTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptAddressTransfer) 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.(*AcceptAddressTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptAddressTransfer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptAddressTransferInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptCapacityReservationBillingOwnership struct { -} - -func (*awsEc2query_serializeOpAcceptCapacityReservationBillingOwnership) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptCapacityReservationBillingOwnership) 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.(*AcceptCapacityReservationBillingOwnershipInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptCapacityReservationBillingOwnership") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptCapacityReservationBillingOwnershipInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptReservedInstancesExchangeQuote struct { -} - -func (*awsEc2query_serializeOpAcceptReservedInstancesExchangeQuote) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptReservedInstancesExchangeQuote) 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.(*AcceptReservedInstancesExchangeQuoteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptReservedInstancesExchangeQuote") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptReservedInstancesExchangeQuoteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_serializeOpAcceptTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptTransitGatewayMulticastDomainAssociations) 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.(*AcceptTransitGatewayMulticastDomainAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptTransitGatewayMulticastDomainAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptTransitGatewayMulticastDomainAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_serializeOpAcceptTransitGatewayPeeringAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptTransitGatewayPeeringAttachment) 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.(*AcceptTransitGatewayPeeringAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptTransitGatewayPeeringAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptTransitGatewayPeeringAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_serializeOpAcceptTransitGatewayVpcAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptTransitGatewayVpcAttachment) 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.(*AcceptTransitGatewayVpcAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptTransitGatewayVpcAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptTransitGatewayVpcAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptVpcEndpointConnections struct { -} - -func (*awsEc2query_serializeOpAcceptVpcEndpointConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptVpcEndpointConnections) 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.(*AcceptVpcEndpointConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptVpcEndpointConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptVpcEndpointConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAcceptVpcPeeringConnection struct { -} - -func (*awsEc2query_serializeOpAcceptVpcPeeringConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAcceptVpcPeeringConnection) 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.(*AcceptVpcPeeringConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AcceptVpcPeeringConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAcceptVpcPeeringConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAdvertiseByoipCidr struct { -} - -func (*awsEc2query_serializeOpAdvertiseByoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAdvertiseByoipCidr) 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.(*AdvertiseByoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AdvertiseByoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAdvertiseByoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAllocateAddress struct { -} - -func (*awsEc2query_serializeOpAllocateAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAllocateAddress) 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.(*AllocateAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AllocateAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAllocateAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAllocateHosts struct { -} - -func (*awsEc2query_serializeOpAllocateHosts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAllocateHosts) 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.(*AllocateHostsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AllocateHosts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAllocateHostsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAllocateIpamPoolCidr struct { -} - -func (*awsEc2query_serializeOpAllocateIpamPoolCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAllocateIpamPoolCidr) 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.(*AllocateIpamPoolCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AllocateIpamPoolCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAllocateIpamPoolCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpApplySecurityGroupsToClientVpnTargetNetwork struct { -} - -func (*awsEc2query_serializeOpApplySecurityGroupsToClientVpnTargetNetwork) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpApplySecurityGroupsToClientVpnTargetNetwork) 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.(*ApplySecurityGroupsToClientVpnTargetNetworkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ApplySecurityGroupsToClientVpnTargetNetwork") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentApplySecurityGroupsToClientVpnTargetNetworkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssignIpv6Addresses struct { -} - -func (*awsEc2query_serializeOpAssignIpv6Addresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssignIpv6Addresses) 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.(*AssignIpv6AddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssignIpv6Addresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssignIpv6AddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssignPrivateIpAddresses struct { -} - -func (*awsEc2query_serializeOpAssignPrivateIpAddresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssignPrivateIpAddresses) 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.(*AssignPrivateIpAddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssignPrivateIpAddresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssignPrivateIpAddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssignPrivateNatGatewayAddress struct { -} - -func (*awsEc2query_serializeOpAssignPrivateNatGatewayAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssignPrivateNatGatewayAddress) 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.(*AssignPrivateNatGatewayAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssignPrivateNatGatewayAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssignPrivateNatGatewayAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateAddress struct { -} - -func (*awsEc2query_serializeOpAssociateAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateAddress) 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.(*AssociateAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateCapacityReservationBillingOwner struct { -} - -func (*awsEc2query_serializeOpAssociateCapacityReservationBillingOwner) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateCapacityReservationBillingOwner) 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.(*AssociateCapacityReservationBillingOwnerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateCapacityReservationBillingOwner") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateCapacityReservationBillingOwnerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateClientVpnTargetNetwork struct { -} - -func (*awsEc2query_serializeOpAssociateClientVpnTargetNetwork) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateClientVpnTargetNetwork) 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.(*AssociateClientVpnTargetNetworkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateClientVpnTargetNetwork") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateClientVpnTargetNetworkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateDhcpOptions struct { -} - -func (*awsEc2query_serializeOpAssociateDhcpOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateDhcpOptions) 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.(*AssociateDhcpOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateDhcpOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateDhcpOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateEnclaveCertificateIamRole struct { -} - -func (*awsEc2query_serializeOpAssociateEnclaveCertificateIamRole) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateEnclaveCertificateIamRole) 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.(*AssociateEnclaveCertificateIamRoleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateEnclaveCertificateIamRole") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateEnclaveCertificateIamRoleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateIamInstanceProfile struct { -} - -func (*awsEc2query_serializeOpAssociateIamInstanceProfile) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateIamInstanceProfile) 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.(*AssociateIamInstanceProfileInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateIamInstanceProfile") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateIamInstanceProfileInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateInstanceEventWindow struct { -} - -func (*awsEc2query_serializeOpAssociateInstanceEventWindow) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateInstanceEventWindow) 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.(*AssociateInstanceEventWindowInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateInstanceEventWindow") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateInstanceEventWindowInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateIpamByoasn struct { -} - -func (*awsEc2query_serializeOpAssociateIpamByoasn) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateIpamByoasn) 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.(*AssociateIpamByoasnInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateIpamByoasn") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateIpamByoasnInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateIpamResourceDiscovery struct { -} - -func (*awsEc2query_serializeOpAssociateIpamResourceDiscovery) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateIpamResourceDiscovery) 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.(*AssociateIpamResourceDiscoveryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateIpamResourceDiscovery") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateIpamResourceDiscoveryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateNatGatewayAddress struct { -} - -func (*awsEc2query_serializeOpAssociateNatGatewayAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateNatGatewayAddress) 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.(*AssociateNatGatewayAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateNatGatewayAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateNatGatewayAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateRouteServer struct { -} - -func (*awsEc2query_serializeOpAssociateRouteServer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateRouteServer) 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.(*AssociateRouteServerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateRouteServer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateRouteServerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateRouteTable struct { -} - -func (*awsEc2query_serializeOpAssociateRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateRouteTable) 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.(*AssociateRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateSecurityGroupVpc struct { -} - -func (*awsEc2query_serializeOpAssociateSecurityGroupVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateSecurityGroupVpc) 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.(*AssociateSecurityGroupVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateSecurityGroupVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateSecurityGroupVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateSubnetCidrBlock struct { -} - -func (*awsEc2query_serializeOpAssociateSubnetCidrBlock) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateSubnetCidrBlock) 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.(*AssociateSubnetCidrBlockInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateSubnetCidrBlock") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateSubnetCidrBlockInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_serializeOpAssociateTransitGatewayMulticastDomain) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateTransitGatewayMulticastDomain) 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.(*AssociateTransitGatewayMulticastDomainInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateTransitGatewayMulticastDomain") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateTransitGatewayMulticastDomainInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_serializeOpAssociateTransitGatewayPolicyTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateTransitGatewayPolicyTable) 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.(*AssociateTransitGatewayPolicyTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateTransitGatewayPolicyTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateTransitGatewayPolicyTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpAssociateTransitGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateTransitGatewayRouteTable) 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.(*AssociateTransitGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateTransitGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateTransitGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateTrunkInterface struct { -} - -func (*awsEc2query_serializeOpAssociateTrunkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateTrunkInterface) 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.(*AssociateTrunkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateTrunkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateTrunkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAssociateVpcCidrBlock struct { -} - -func (*awsEc2query_serializeOpAssociateVpcCidrBlock) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAssociateVpcCidrBlock) 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.(*AssociateVpcCidrBlockInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssociateVpcCidrBlock") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAssociateVpcCidrBlockInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachClassicLinkVpc struct { -} - -func (*awsEc2query_serializeOpAttachClassicLinkVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachClassicLinkVpc) 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.(*AttachClassicLinkVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachClassicLinkVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachClassicLinkVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachInternetGateway struct { -} - -func (*awsEc2query_serializeOpAttachInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachInternetGateway) 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.(*AttachInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachNetworkInterface struct { -} - -func (*awsEc2query_serializeOpAttachNetworkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachNetworkInterface) 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.(*AttachNetworkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachNetworkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachNetworkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_serializeOpAttachVerifiedAccessTrustProvider) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachVerifiedAccessTrustProvider) 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.(*AttachVerifiedAccessTrustProviderInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachVerifiedAccessTrustProvider") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachVerifiedAccessTrustProviderInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachVolume struct { -} - -func (*awsEc2query_serializeOpAttachVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachVolume) 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.(*AttachVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAttachVpnGateway struct { -} - -func (*awsEc2query_serializeOpAttachVpnGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAttachVpnGateway) 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.(*AttachVpnGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AttachVpnGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAttachVpnGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAuthorizeClientVpnIngress struct { -} - -func (*awsEc2query_serializeOpAuthorizeClientVpnIngress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAuthorizeClientVpnIngress) 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.(*AuthorizeClientVpnIngressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AuthorizeClientVpnIngress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAuthorizeClientVpnIngressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAuthorizeSecurityGroupEgress struct { -} - -func (*awsEc2query_serializeOpAuthorizeSecurityGroupEgress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAuthorizeSecurityGroupEgress) 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.(*AuthorizeSecurityGroupEgressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AuthorizeSecurityGroupEgress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAuthorizeSecurityGroupEgressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpAuthorizeSecurityGroupIngress struct { -} - -func (*awsEc2query_serializeOpAuthorizeSecurityGroupIngress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpAuthorizeSecurityGroupIngress) 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.(*AuthorizeSecurityGroupIngressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AuthorizeSecurityGroupIngress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentAuthorizeSecurityGroupIngressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpBundleInstance struct { -} - -func (*awsEc2query_serializeOpBundleInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpBundleInstance) 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.(*BundleInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("BundleInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentBundleInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelBundleTask struct { -} - -func (*awsEc2query_serializeOpCancelBundleTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelBundleTask) 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.(*CancelBundleTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelBundleTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelBundleTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelCapacityReservation struct { -} - -func (*awsEc2query_serializeOpCancelCapacityReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelCapacityReservation) 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.(*CancelCapacityReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelCapacityReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelCapacityReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelCapacityReservationFleets struct { -} - -func (*awsEc2query_serializeOpCancelCapacityReservationFleets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelCapacityReservationFleets) 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.(*CancelCapacityReservationFleetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelCapacityReservationFleets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelCapacityReservationFleetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelConversionTask struct { -} - -func (*awsEc2query_serializeOpCancelConversionTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelConversionTask) 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.(*CancelConversionTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelConversionTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelConversionTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelDeclarativePoliciesReport struct { -} - -func (*awsEc2query_serializeOpCancelDeclarativePoliciesReport) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelDeclarativePoliciesReport) 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.(*CancelDeclarativePoliciesReportInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelDeclarativePoliciesReport") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelDeclarativePoliciesReportInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelExportTask struct { -} - -func (*awsEc2query_serializeOpCancelExportTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelExportTask) 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.(*CancelExportTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelExportTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelExportTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelImageLaunchPermission struct { -} - -func (*awsEc2query_serializeOpCancelImageLaunchPermission) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelImageLaunchPermission) 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.(*CancelImageLaunchPermissionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelImageLaunchPermission") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelImageLaunchPermissionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelImportTask struct { -} - -func (*awsEc2query_serializeOpCancelImportTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelImportTask) 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.(*CancelImportTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelImportTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelImportTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelReservedInstancesListing struct { -} - -func (*awsEc2query_serializeOpCancelReservedInstancesListing) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelReservedInstancesListing) 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.(*CancelReservedInstancesListingInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelReservedInstancesListing") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelReservedInstancesListingInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelSpotFleetRequests struct { -} - -func (*awsEc2query_serializeOpCancelSpotFleetRequests) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelSpotFleetRequests) 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.(*CancelSpotFleetRequestsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelSpotFleetRequests") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelSpotFleetRequestsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCancelSpotInstanceRequests struct { -} - -func (*awsEc2query_serializeOpCancelSpotInstanceRequests) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCancelSpotInstanceRequests) 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.(*CancelSpotInstanceRequestsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelSpotInstanceRequests") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCancelSpotInstanceRequestsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpConfirmProductInstance struct { -} - -func (*awsEc2query_serializeOpConfirmProductInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpConfirmProductInstance) 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.(*ConfirmProductInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ConfirmProductInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentConfirmProductInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCopyFpgaImage struct { -} - -func (*awsEc2query_serializeOpCopyFpgaImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCopyFpgaImage) 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.(*CopyFpgaImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CopyFpgaImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCopyFpgaImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCopyImage struct { -} - -func (*awsEc2query_serializeOpCopyImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCopyImage) 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.(*CopyImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CopyImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCopyImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCopySnapshot struct { -} - -func (*awsEc2query_serializeOpCopySnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCopySnapshot) 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.(*CopySnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CopySnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCopySnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCapacityReservation struct { -} - -func (*awsEc2query_serializeOpCreateCapacityReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCapacityReservation) 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.(*CreateCapacityReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCapacityReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCapacityReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCapacityReservationBySplitting struct { -} - -func (*awsEc2query_serializeOpCreateCapacityReservationBySplitting) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCapacityReservationBySplitting) 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.(*CreateCapacityReservationBySplittingInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCapacityReservationBySplitting") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCapacityReservationBySplittingInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCapacityReservationFleet struct { -} - -func (*awsEc2query_serializeOpCreateCapacityReservationFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCapacityReservationFleet) 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.(*CreateCapacityReservationFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCapacityReservationFleet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCapacityReservationFleetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCarrierGateway struct { -} - -func (*awsEc2query_serializeOpCreateCarrierGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCarrierGateway) 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.(*CreateCarrierGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCarrierGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCarrierGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateClientVpnEndpoint struct { -} - -func (*awsEc2query_serializeOpCreateClientVpnEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateClientVpnEndpoint) 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.(*CreateClientVpnEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateClientVpnEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateClientVpnEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateClientVpnRoute struct { -} - -func (*awsEc2query_serializeOpCreateClientVpnRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateClientVpnRoute) 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.(*CreateClientVpnRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateClientVpnRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateClientVpnRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCoipCidr struct { -} - -func (*awsEc2query_serializeOpCreateCoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCoipCidr) 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.(*CreateCoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCoipPool struct { -} - -func (*awsEc2query_serializeOpCreateCoipPool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCoipPool) 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.(*CreateCoipPoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCoipPool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCoipPoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateCustomerGateway struct { -} - -func (*awsEc2query_serializeOpCreateCustomerGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateCustomerGateway) 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.(*CreateCustomerGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateCustomerGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateCustomerGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateDefaultSubnet struct { -} - -func (*awsEc2query_serializeOpCreateDefaultSubnet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateDefaultSubnet) 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.(*CreateDefaultSubnetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateDefaultSubnet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateDefaultSubnetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateDefaultVpc struct { -} - -func (*awsEc2query_serializeOpCreateDefaultVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateDefaultVpc) 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.(*CreateDefaultVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateDefaultVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateDefaultVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateDelegateMacVolumeOwnershipTask struct { -} - -func (*awsEc2query_serializeOpCreateDelegateMacVolumeOwnershipTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateDelegateMacVolumeOwnershipTask) 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.(*CreateDelegateMacVolumeOwnershipTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateDelegateMacVolumeOwnershipTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateDelegateMacVolumeOwnershipTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateDhcpOptions struct { -} - -func (*awsEc2query_serializeOpCreateDhcpOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateDhcpOptions) 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.(*CreateDhcpOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateDhcpOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateDhcpOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateEgressOnlyInternetGateway struct { -} - -func (*awsEc2query_serializeOpCreateEgressOnlyInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateEgressOnlyInternetGateway) 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.(*CreateEgressOnlyInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateEgressOnlyInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateEgressOnlyInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateFleet struct { -} - -func (*awsEc2query_serializeOpCreateFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateFleet) 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.(*CreateFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateFleet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateFleetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateFlowLogs struct { -} - -func (*awsEc2query_serializeOpCreateFlowLogs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateFlowLogs) 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.(*CreateFlowLogsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateFlowLogs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateFlowLogsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateFpgaImage struct { -} - -func (*awsEc2query_serializeOpCreateFpgaImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateFpgaImage) 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.(*CreateFpgaImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateFpgaImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateFpgaImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateImage struct { -} - -func (*awsEc2query_serializeOpCreateImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateImage) 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.(*CreateImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateInstanceConnectEndpoint struct { -} - -func (*awsEc2query_serializeOpCreateInstanceConnectEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateInstanceConnectEndpoint) 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.(*CreateInstanceConnectEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateInstanceConnectEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateInstanceConnectEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateInstanceEventWindow struct { -} - -func (*awsEc2query_serializeOpCreateInstanceEventWindow) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateInstanceEventWindow) 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.(*CreateInstanceEventWindowInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateInstanceEventWindow") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateInstanceEventWindowInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateInstanceExportTask struct { -} - -func (*awsEc2query_serializeOpCreateInstanceExportTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateInstanceExportTask) 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.(*CreateInstanceExportTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateInstanceExportTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateInstanceExportTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateInternetGateway struct { -} - -func (*awsEc2query_serializeOpCreateInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateInternetGateway) 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.(*CreateInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateIpam struct { -} - -func (*awsEc2query_serializeOpCreateIpam) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateIpam) 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.(*CreateIpamInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateIpam") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateIpamInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateIpamExternalResourceVerificationToken struct { -} - -func (*awsEc2query_serializeOpCreateIpamExternalResourceVerificationToken) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateIpamExternalResourceVerificationToken) 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.(*CreateIpamExternalResourceVerificationTokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateIpamExternalResourceVerificationToken") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateIpamExternalResourceVerificationTokenInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateIpamPool struct { -} - -func (*awsEc2query_serializeOpCreateIpamPool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateIpamPool) 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.(*CreateIpamPoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateIpamPool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateIpamPoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateIpamResourceDiscovery struct { -} - -func (*awsEc2query_serializeOpCreateIpamResourceDiscovery) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateIpamResourceDiscovery) 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.(*CreateIpamResourceDiscoveryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateIpamResourceDiscovery") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateIpamResourceDiscoveryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateIpamScope struct { -} - -func (*awsEc2query_serializeOpCreateIpamScope) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateIpamScope) 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.(*CreateIpamScopeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateIpamScope") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateIpamScopeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateKeyPair struct { -} - -func (*awsEc2query_serializeOpCreateKeyPair) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateKeyPair) 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.(*CreateKeyPairInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateKeyPair") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateKeyPairInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLaunchTemplate struct { -} - -func (*awsEc2query_serializeOpCreateLaunchTemplate) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLaunchTemplate) 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.(*CreateLaunchTemplateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLaunchTemplate") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLaunchTemplateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLaunchTemplateVersion struct { -} - -func (*awsEc2query_serializeOpCreateLaunchTemplateVersion) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLaunchTemplateVersion) 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.(*CreateLaunchTemplateVersionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLaunchTemplateVersion") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLaunchTemplateVersionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayRoute struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayRoute) 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.(*CreateLocalGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayRouteTable) 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.(*CreateLocalGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) 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.(*CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayRouteTableVpcAssociation struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayRouteTableVpcAssociation) 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.(*CreateLocalGatewayRouteTableVpcAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayRouteTableVpcAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableVpcAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayVirtualInterface struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayVirtualInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayVirtualInterface) 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.(*CreateLocalGatewayVirtualInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayVirtualInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayVirtualInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateLocalGatewayVirtualInterfaceGroup struct { -} - -func (*awsEc2query_serializeOpCreateLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateLocalGatewayVirtualInterfaceGroup) 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.(*CreateLocalGatewayVirtualInterfaceGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateLocalGatewayVirtualInterfaceGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateLocalGatewayVirtualInterfaceGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateMacSystemIntegrityProtectionModificationTask struct { -} - -func (*awsEc2query_serializeOpCreateMacSystemIntegrityProtectionModificationTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateMacSystemIntegrityProtectionModificationTask) 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.(*CreateMacSystemIntegrityProtectionModificationTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateMacSystemIntegrityProtectionModificationTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateMacSystemIntegrityProtectionModificationTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateManagedPrefixList struct { -} - -func (*awsEc2query_serializeOpCreateManagedPrefixList) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateManagedPrefixList) 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.(*CreateManagedPrefixListInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateManagedPrefixList") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateManagedPrefixListInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNatGateway struct { -} - -func (*awsEc2query_serializeOpCreateNatGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNatGateway) 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.(*CreateNatGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNatGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNatGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkAcl struct { -} - -func (*awsEc2query_serializeOpCreateNetworkAcl) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkAcl) 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.(*CreateNetworkAclInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkAcl") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkAclInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkAclEntry struct { -} - -func (*awsEc2query_serializeOpCreateNetworkAclEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkAclEntry) 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.(*CreateNetworkAclEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkAclEntry") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkAclEntryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkInsightsAccessScope struct { -} - -func (*awsEc2query_serializeOpCreateNetworkInsightsAccessScope) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkInsightsAccessScope) 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.(*CreateNetworkInsightsAccessScopeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkInsightsAccessScope") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkInsightsAccessScopeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkInsightsPath struct { -} - -func (*awsEc2query_serializeOpCreateNetworkInsightsPath) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkInsightsPath) 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.(*CreateNetworkInsightsPathInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkInsightsPath") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkInsightsPathInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkInterface struct { -} - -func (*awsEc2query_serializeOpCreateNetworkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkInterface) 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.(*CreateNetworkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateNetworkInterfacePermission struct { -} - -func (*awsEc2query_serializeOpCreateNetworkInterfacePermission) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateNetworkInterfacePermission) 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.(*CreateNetworkInterfacePermissionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateNetworkInterfacePermission") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateNetworkInterfacePermissionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreatePlacementGroup struct { -} - -func (*awsEc2query_serializeOpCreatePlacementGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreatePlacementGroup) 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.(*CreatePlacementGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreatePlacementGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreatePlacementGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreatePublicIpv4Pool struct { -} - -func (*awsEc2query_serializeOpCreatePublicIpv4Pool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreatePublicIpv4Pool) 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.(*CreatePublicIpv4PoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreatePublicIpv4Pool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreatePublicIpv4PoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateReplaceRootVolumeTask struct { -} - -func (*awsEc2query_serializeOpCreateReplaceRootVolumeTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateReplaceRootVolumeTask) 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.(*CreateReplaceRootVolumeTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateReplaceRootVolumeTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateReplaceRootVolumeTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateReservedInstancesListing struct { -} - -func (*awsEc2query_serializeOpCreateReservedInstancesListing) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateReservedInstancesListing) 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.(*CreateReservedInstancesListingInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateReservedInstancesListing") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateReservedInstancesListingInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRestoreImageTask struct { -} - -func (*awsEc2query_serializeOpCreateRestoreImageTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRestoreImageTask) 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.(*CreateRestoreImageTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRestoreImageTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRestoreImageTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRoute struct { -} - -func (*awsEc2query_serializeOpCreateRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRoute) 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.(*CreateRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRouteServer struct { -} - -func (*awsEc2query_serializeOpCreateRouteServer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRouteServer) 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.(*CreateRouteServerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRouteServer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRouteServerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRouteServerEndpoint struct { -} - -func (*awsEc2query_serializeOpCreateRouteServerEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRouteServerEndpoint) 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.(*CreateRouteServerEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRouteServerEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRouteServerEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRouteServerPeer struct { -} - -func (*awsEc2query_serializeOpCreateRouteServerPeer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRouteServerPeer) 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.(*CreateRouteServerPeerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRouteServerPeer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRouteServerPeerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateRouteTable struct { -} - -func (*awsEc2query_serializeOpCreateRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateRouteTable) 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.(*CreateRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSecurityGroup struct { -} - -func (*awsEc2query_serializeOpCreateSecurityGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSecurityGroup) 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.(*CreateSecurityGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSecurityGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSecurityGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSnapshot struct { -} - -func (*awsEc2query_serializeOpCreateSnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSnapshot) 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.(*CreateSnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSnapshots struct { -} - -func (*awsEc2query_serializeOpCreateSnapshots) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSnapshots) 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.(*CreateSnapshotsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSnapshots") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSnapshotsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSpotDatafeedSubscription struct { -} - -func (*awsEc2query_serializeOpCreateSpotDatafeedSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSpotDatafeedSubscription) 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.(*CreateSpotDatafeedSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSpotDatafeedSubscription") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSpotDatafeedSubscriptionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateStoreImageTask struct { -} - -func (*awsEc2query_serializeOpCreateStoreImageTask) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateStoreImageTask) 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.(*CreateStoreImageTaskInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateStoreImageTask") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateStoreImageTaskInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSubnet struct { -} - -func (*awsEc2query_serializeOpCreateSubnet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSubnet) 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.(*CreateSubnetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSubnet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSubnetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateSubnetCidrReservation struct { -} - -func (*awsEc2query_serializeOpCreateSubnetCidrReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateSubnetCidrReservation) 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.(*CreateSubnetCidrReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateSubnetCidrReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateSubnetCidrReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTags struct { -} - -func (*awsEc2query_serializeOpCreateTags) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTags) 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.(*CreateTagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTags") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTagsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTrafficMirrorFilter struct { -} - -func (*awsEc2query_serializeOpCreateTrafficMirrorFilter) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTrafficMirrorFilter) 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.(*CreateTrafficMirrorFilterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTrafficMirrorFilter") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTrafficMirrorFilterInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_serializeOpCreateTrafficMirrorFilterRule) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTrafficMirrorFilterRule) 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.(*CreateTrafficMirrorFilterRuleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTrafficMirrorFilterRule") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTrafficMirrorFilterRuleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTrafficMirrorSession struct { -} - -func (*awsEc2query_serializeOpCreateTrafficMirrorSession) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTrafficMirrorSession) 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.(*CreateTrafficMirrorSessionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTrafficMirrorSession") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTrafficMirrorSessionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTrafficMirrorTarget struct { -} - -func (*awsEc2query_serializeOpCreateTrafficMirrorTarget) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTrafficMirrorTarget) 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.(*CreateTrafficMirrorTargetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTrafficMirrorTarget") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTrafficMirrorTargetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGateway struct { -} - -func (*awsEc2query_serializeOpCreateTransitGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGateway) 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.(*CreateTransitGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayConnect struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayConnect) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayConnect) 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.(*CreateTransitGatewayConnectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayConnect") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayConnectInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayConnectPeer struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayConnectPeer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayConnectPeer) 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.(*CreateTransitGatewayConnectPeerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayConnectPeer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayConnectPeerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayMulticastDomain) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayMulticastDomain) 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.(*CreateTransitGatewayMulticastDomainInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayMulticastDomain") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayMulticastDomainInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayPeeringAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayPeeringAttachment) 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.(*CreateTransitGatewayPeeringAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayPeeringAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayPeeringAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayPolicyTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayPolicyTable) 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.(*CreateTransitGatewayPolicyTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayPolicyTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayPolicyTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayPrefixListReference) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayPrefixListReference) 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.(*CreateTransitGatewayPrefixListReferenceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayPrefixListReference") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayPrefixListReferenceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayRoute struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayRoute) 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.(*CreateTransitGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayRouteTable) 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.(*CreateTransitGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayRouteTableAnnouncement struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayRouteTableAnnouncement) 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.(*CreateTransitGatewayRouteTableAnnouncementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayRouteTableAnnouncement") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayRouteTableAnnouncementInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_serializeOpCreateTransitGatewayVpcAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateTransitGatewayVpcAttachment) 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.(*CreateTransitGatewayVpcAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateTransitGatewayVpcAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateTransitGatewayVpcAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_serializeOpCreateVerifiedAccessEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVerifiedAccessEndpoint) 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.(*CreateVerifiedAccessEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVerifiedAccessEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVerifiedAccessEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVerifiedAccessGroup struct { -} - -func (*awsEc2query_serializeOpCreateVerifiedAccessGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVerifiedAccessGroup) 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.(*CreateVerifiedAccessGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVerifiedAccessGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVerifiedAccessGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVerifiedAccessInstance struct { -} - -func (*awsEc2query_serializeOpCreateVerifiedAccessInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVerifiedAccessInstance) 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.(*CreateVerifiedAccessInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVerifiedAccessInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVerifiedAccessInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_serializeOpCreateVerifiedAccessTrustProvider) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVerifiedAccessTrustProvider) 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.(*CreateVerifiedAccessTrustProviderInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVerifiedAccessTrustProvider") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVerifiedAccessTrustProviderInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVolume struct { -} - -func (*awsEc2query_serializeOpCreateVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVolume) 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.(*CreateVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpc struct { -} - -func (*awsEc2query_serializeOpCreateVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpc) 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.(*CreateVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_serializeOpCreateVpcBlockPublicAccessExclusion) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpcBlockPublicAccessExclusion) 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.(*CreateVpcBlockPublicAccessExclusionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpcBlockPublicAccessExclusion") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcBlockPublicAccessExclusionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpcEndpoint struct { -} - -func (*awsEc2query_serializeOpCreateVpcEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpcEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpcEndpointConnectionNotification struct { -} - -func (*awsEc2query_serializeOpCreateVpcEndpointConnectionNotification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpcEndpointConnectionNotification) 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.(*CreateVpcEndpointConnectionNotificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpcEndpointConnectionNotification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcEndpointConnectionNotificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpcEndpointServiceConfiguration struct { -} - -func (*awsEc2query_serializeOpCreateVpcEndpointServiceConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpcEndpointServiceConfiguration) 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.(*CreateVpcEndpointServiceConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpcEndpointServiceConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcEndpointServiceConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpcPeeringConnection struct { -} - -func (*awsEc2query_serializeOpCreateVpcPeeringConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpcPeeringConnection) 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.(*CreateVpcPeeringConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpcPeeringConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpcPeeringConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpnConnection struct { -} - -func (*awsEc2query_serializeOpCreateVpnConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpnConnection) 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.(*CreateVpnConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpnConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpnConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpnConnectionRoute struct { -} - -func (*awsEc2query_serializeOpCreateVpnConnectionRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpnConnectionRoute) 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.(*CreateVpnConnectionRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpnConnectionRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpnConnectionRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpCreateVpnGateway struct { -} - -func (*awsEc2query_serializeOpCreateVpnGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpCreateVpnGateway) 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.(*CreateVpnGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateVpnGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentCreateVpnGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteCarrierGateway struct { -} - -func (*awsEc2query_serializeOpDeleteCarrierGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteCarrierGateway) 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.(*DeleteCarrierGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteCarrierGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteCarrierGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteClientVpnEndpoint struct { -} - -func (*awsEc2query_serializeOpDeleteClientVpnEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteClientVpnEndpoint) 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.(*DeleteClientVpnEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteClientVpnEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteClientVpnEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteClientVpnRoute struct { -} - -func (*awsEc2query_serializeOpDeleteClientVpnRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteClientVpnRoute) 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.(*DeleteClientVpnRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteClientVpnRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteClientVpnRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteCoipCidr struct { -} - -func (*awsEc2query_serializeOpDeleteCoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteCoipCidr) 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.(*DeleteCoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteCoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteCoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteCoipPool struct { -} - -func (*awsEc2query_serializeOpDeleteCoipPool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteCoipPool) 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.(*DeleteCoipPoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteCoipPool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteCoipPoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteCustomerGateway struct { -} - -func (*awsEc2query_serializeOpDeleteCustomerGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteCustomerGateway) 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.(*DeleteCustomerGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteCustomerGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteCustomerGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteDhcpOptions struct { -} - -func (*awsEc2query_serializeOpDeleteDhcpOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteDhcpOptions) 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.(*DeleteDhcpOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteDhcpOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteDhcpOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteEgressOnlyInternetGateway struct { -} - -func (*awsEc2query_serializeOpDeleteEgressOnlyInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteEgressOnlyInternetGateway) 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.(*DeleteEgressOnlyInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteEgressOnlyInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteEgressOnlyInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteFleets struct { -} - -func (*awsEc2query_serializeOpDeleteFleets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteFleets) 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.(*DeleteFleetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteFleets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteFleetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteFlowLogs struct { -} - -func (*awsEc2query_serializeOpDeleteFlowLogs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteFlowLogs) 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.(*DeleteFlowLogsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteFlowLogs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteFlowLogsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteFpgaImage struct { -} - -func (*awsEc2query_serializeOpDeleteFpgaImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteFpgaImage) 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.(*DeleteFpgaImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteFpgaImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteFpgaImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteInstanceConnectEndpoint struct { -} - -func (*awsEc2query_serializeOpDeleteInstanceConnectEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteInstanceConnectEndpoint) 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.(*DeleteInstanceConnectEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteInstanceConnectEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteInstanceConnectEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteInstanceEventWindow struct { -} - -func (*awsEc2query_serializeOpDeleteInstanceEventWindow) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteInstanceEventWindow) 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.(*DeleteInstanceEventWindowInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteInstanceEventWindow") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteInstanceEventWindowInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteInternetGateway struct { -} - -func (*awsEc2query_serializeOpDeleteInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteInternetGateway) 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.(*DeleteInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteIpam struct { -} - -func (*awsEc2query_serializeOpDeleteIpam) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteIpam) 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.(*DeleteIpamInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteIpam") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteIpamInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteIpamExternalResourceVerificationToken struct { -} - -func (*awsEc2query_serializeOpDeleteIpamExternalResourceVerificationToken) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteIpamExternalResourceVerificationToken) 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.(*DeleteIpamExternalResourceVerificationTokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteIpamExternalResourceVerificationToken") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteIpamExternalResourceVerificationTokenInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteIpamPool struct { -} - -func (*awsEc2query_serializeOpDeleteIpamPool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteIpamPool) 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.(*DeleteIpamPoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteIpamPool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteIpamPoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteIpamResourceDiscovery struct { -} - -func (*awsEc2query_serializeOpDeleteIpamResourceDiscovery) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteIpamResourceDiscovery) 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.(*DeleteIpamResourceDiscoveryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteIpamResourceDiscovery") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteIpamResourceDiscoveryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteIpamScope struct { -} - -func (*awsEc2query_serializeOpDeleteIpamScope) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteIpamScope) 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.(*DeleteIpamScopeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteIpamScope") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteIpamScopeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteKeyPair struct { -} - -func (*awsEc2query_serializeOpDeleteKeyPair) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteKeyPair) 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.(*DeleteKeyPairInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteKeyPair") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteKeyPairInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLaunchTemplate struct { -} - -func (*awsEc2query_serializeOpDeleteLaunchTemplate) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLaunchTemplate) 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.(*DeleteLaunchTemplateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLaunchTemplate") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLaunchTemplateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLaunchTemplateVersions struct { -} - -func (*awsEc2query_serializeOpDeleteLaunchTemplateVersions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLaunchTemplateVersions) 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.(*DeleteLaunchTemplateVersionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLaunchTemplateVersions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLaunchTemplateVersionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayRoute struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayRoute) 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.(*DeleteLocalGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayRouteTable) 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.(*DeleteLocalGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) 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.(*DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayRouteTableVpcAssociation struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayRouteTableVpcAssociation) 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.(*DeleteLocalGatewayRouteTableVpcAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayRouteTableVpcAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableVpcAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayVirtualInterface struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayVirtualInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayVirtualInterface) 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.(*DeleteLocalGatewayVirtualInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayVirtualInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayVirtualInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteLocalGatewayVirtualInterfaceGroup struct { -} - -func (*awsEc2query_serializeOpDeleteLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteLocalGatewayVirtualInterfaceGroup) 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.(*DeleteLocalGatewayVirtualInterfaceGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteLocalGatewayVirtualInterfaceGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteLocalGatewayVirtualInterfaceGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteManagedPrefixList struct { -} - -func (*awsEc2query_serializeOpDeleteManagedPrefixList) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteManagedPrefixList) 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.(*DeleteManagedPrefixListInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteManagedPrefixList") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteManagedPrefixListInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNatGateway struct { -} - -func (*awsEc2query_serializeOpDeleteNatGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNatGateway) 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.(*DeleteNatGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNatGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNatGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkAcl struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkAcl) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkAcl) 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.(*DeleteNetworkAclInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkAcl") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkAclInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkAclEntry struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkAclEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkAclEntry) 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.(*DeleteNetworkAclEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkAclEntry") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkAclEntryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInsightsAccessScope struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInsightsAccessScope) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInsightsAccessScope) 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.(*DeleteNetworkInsightsAccessScopeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInsightsAccessScope") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInsightsAccessScopeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInsightsAccessScopeAnalysis struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInsightsAccessScopeAnalysis) 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.(*DeleteNetworkInsightsAccessScopeAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInsightsAccessScopeAnalysis") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInsightsAccessScopeAnalysisInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInsightsAnalysis struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInsightsAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInsightsAnalysis) 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.(*DeleteNetworkInsightsAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInsightsAnalysis") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInsightsAnalysisInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInsightsPath struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInsightsPath) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInsightsPath) 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.(*DeleteNetworkInsightsPathInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInsightsPath") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInsightsPathInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInterface struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInterface) 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.(*DeleteNetworkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteNetworkInterfacePermission struct { -} - -func (*awsEc2query_serializeOpDeleteNetworkInterfacePermission) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteNetworkInterfacePermission) 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.(*DeleteNetworkInterfacePermissionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteNetworkInterfacePermission") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteNetworkInterfacePermissionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeletePlacementGroup struct { -} - -func (*awsEc2query_serializeOpDeletePlacementGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeletePlacementGroup) 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.(*DeletePlacementGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeletePlacementGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeletePlacementGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeletePublicIpv4Pool struct { -} - -func (*awsEc2query_serializeOpDeletePublicIpv4Pool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeletePublicIpv4Pool) 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.(*DeletePublicIpv4PoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeletePublicIpv4Pool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeletePublicIpv4PoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteQueuedReservedInstances struct { -} - -func (*awsEc2query_serializeOpDeleteQueuedReservedInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteQueuedReservedInstances) 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.(*DeleteQueuedReservedInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteQueuedReservedInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteQueuedReservedInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteRoute struct { -} - -func (*awsEc2query_serializeOpDeleteRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteRoute) 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.(*DeleteRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteRouteServer struct { -} - -func (*awsEc2query_serializeOpDeleteRouteServer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteRouteServer) 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.(*DeleteRouteServerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteRouteServer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteRouteServerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteRouteServerEndpoint struct { -} - -func (*awsEc2query_serializeOpDeleteRouteServerEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteRouteServerEndpoint) 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.(*DeleteRouteServerEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteRouteServerEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteRouteServerEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteRouteServerPeer struct { -} - -func (*awsEc2query_serializeOpDeleteRouteServerPeer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteRouteServerPeer) 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.(*DeleteRouteServerPeerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteRouteServerPeer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteRouteServerPeerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteRouteTable struct { -} - -func (*awsEc2query_serializeOpDeleteRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteRouteTable) 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.(*DeleteRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteSecurityGroup struct { -} - -func (*awsEc2query_serializeOpDeleteSecurityGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteSecurityGroup) 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.(*DeleteSecurityGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteSecurityGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteSecurityGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteSnapshot struct { -} - -func (*awsEc2query_serializeOpDeleteSnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteSnapshot) 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.(*DeleteSnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteSnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteSnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteSpotDatafeedSubscription struct { -} - -func (*awsEc2query_serializeOpDeleteSpotDatafeedSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteSpotDatafeedSubscription) 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.(*DeleteSpotDatafeedSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteSpotDatafeedSubscription") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteSpotDatafeedSubscriptionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteSubnet struct { -} - -func (*awsEc2query_serializeOpDeleteSubnet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteSubnet) 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.(*DeleteSubnetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteSubnet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteSubnetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteSubnetCidrReservation struct { -} - -func (*awsEc2query_serializeOpDeleteSubnetCidrReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteSubnetCidrReservation) 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.(*DeleteSubnetCidrReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteSubnetCidrReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteSubnetCidrReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTags struct { -} - -func (*awsEc2query_serializeOpDeleteTags) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTags) 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.(*DeleteTagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTags") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTagsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTrafficMirrorFilter struct { -} - -func (*awsEc2query_serializeOpDeleteTrafficMirrorFilter) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTrafficMirrorFilter) 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.(*DeleteTrafficMirrorFilterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTrafficMirrorFilter") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTrafficMirrorFilterInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_serializeOpDeleteTrafficMirrorFilterRule) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTrafficMirrorFilterRule) 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.(*DeleteTrafficMirrorFilterRuleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTrafficMirrorFilterRule") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTrafficMirrorFilterRuleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTrafficMirrorSession struct { -} - -func (*awsEc2query_serializeOpDeleteTrafficMirrorSession) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTrafficMirrorSession) 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.(*DeleteTrafficMirrorSessionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTrafficMirrorSession") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTrafficMirrorSessionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTrafficMirrorTarget struct { -} - -func (*awsEc2query_serializeOpDeleteTrafficMirrorTarget) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTrafficMirrorTarget) 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.(*DeleteTrafficMirrorTargetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTrafficMirrorTarget") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTrafficMirrorTargetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGateway struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGateway) 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.(*DeleteTransitGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayConnect struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayConnect) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayConnect) 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.(*DeleteTransitGatewayConnectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayConnect") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayConnectInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayConnectPeer struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayConnectPeer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayConnectPeer) 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.(*DeleteTransitGatewayConnectPeerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayConnectPeer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayConnectPeerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayMulticastDomain) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayMulticastDomain) 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.(*DeleteTransitGatewayMulticastDomainInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayMulticastDomain") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayMulticastDomainInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayPeeringAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayPeeringAttachment) 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.(*DeleteTransitGatewayPeeringAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayPeeringAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayPeeringAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayPolicyTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayPolicyTable) 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.(*DeleteTransitGatewayPolicyTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayPolicyTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayPolicyTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayPrefixListReference) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayPrefixListReference) 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.(*DeleteTransitGatewayPrefixListReferenceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayPrefixListReference") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayPrefixListReferenceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayRoute struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayRoute) 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.(*DeleteTransitGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayRouteTable) 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.(*DeleteTransitGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayRouteTableAnnouncement struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayRouteTableAnnouncement) 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.(*DeleteTransitGatewayRouteTableAnnouncementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayRouteTableAnnouncement") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteTableAnnouncementInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_serializeOpDeleteTransitGatewayVpcAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteTransitGatewayVpcAttachment) 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.(*DeleteTransitGatewayVpcAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteTransitGatewayVpcAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteTransitGatewayVpcAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_serializeOpDeleteVerifiedAccessEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVerifiedAccessEndpoint) 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.(*DeleteVerifiedAccessEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVerifiedAccessEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVerifiedAccessEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVerifiedAccessGroup struct { -} - -func (*awsEc2query_serializeOpDeleteVerifiedAccessGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVerifiedAccessGroup) 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.(*DeleteVerifiedAccessGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVerifiedAccessGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVerifiedAccessGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVerifiedAccessInstance struct { -} - -func (*awsEc2query_serializeOpDeleteVerifiedAccessInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVerifiedAccessInstance) 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.(*DeleteVerifiedAccessInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVerifiedAccessInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVerifiedAccessInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_serializeOpDeleteVerifiedAccessTrustProvider) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVerifiedAccessTrustProvider) 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.(*DeleteVerifiedAccessTrustProviderInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVerifiedAccessTrustProvider") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVerifiedAccessTrustProviderInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVolume struct { -} - -func (*awsEc2query_serializeOpDeleteVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVolume) 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.(*DeleteVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpc struct { -} - -func (*awsEc2query_serializeOpDeleteVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpc) 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.(*DeleteVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_serializeOpDeleteVpcBlockPublicAccessExclusion) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpcBlockPublicAccessExclusion) 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.(*DeleteVpcBlockPublicAccessExclusionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpcBlockPublicAccessExclusion") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcBlockPublicAccessExclusionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpcEndpointConnectionNotifications struct { -} - -func (*awsEc2query_serializeOpDeleteVpcEndpointConnectionNotifications) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpcEndpointConnectionNotifications) 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.(*DeleteVpcEndpointConnectionNotificationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpcEndpointConnectionNotifications") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcEndpointConnectionNotificationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpcEndpoints struct { -} - -func (*awsEc2query_serializeOpDeleteVpcEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpcEndpoints) 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.(*DeleteVpcEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpcEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpcEndpointServiceConfigurations struct { -} - -func (*awsEc2query_serializeOpDeleteVpcEndpointServiceConfigurations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpcEndpointServiceConfigurations) 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.(*DeleteVpcEndpointServiceConfigurationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpcEndpointServiceConfigurations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcEndpointServiceConfigurationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpcPeeringConnection struct { -} - -func (*awsEc2query_serializeOpDeleteVpcPeeringConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpcPeeringConnection) 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.(*DeleteVpcPeeringConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpcPeeringConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpcPeeringConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpnConnection struct { -} - -func (*awsEc2query_serializeOpDeleteVpnConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpnConnection) 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.(*DeleteVpnConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpnConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpnConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpnConnectionRoute struct { -} - -func (*awsEc2query_serializeOpDeleteVpnConnectionRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpnConnectionRoute) 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.(*DeleteVpnConnectionRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpnConnectionRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpnConnectionRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeleteVpnGateway struct { -} - -func (*awsEc2query_serializeOpDeleteVpnGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeleteVpnGateway) 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.(*DeleteVpnGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteVpnGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeleteVpnGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeprovisionByoipCidr struct { -} - -func (*awsEc2query_serializeOpDeprovisionByoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeprovisionByoipCidr) 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.(*DeprovisionByoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeprovisionByoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeprovisionByoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeprovisionIpamByoasn struct { -} - -func (*awsEc2query_serializeOpDeprovisionIpamByoasn) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeprovisionIpamByoasn) 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.(*DeprovisionIpamByoasnInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeprovisionIpamByoasn") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeprovisionIpamByoasnInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeprovisionIpamPoolCidr struct { -} - -func (*awsEc2query_serializeOpDeprovisionIpamPoolCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeprovisionIpamPoolCidr) 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.(*DeprovisionIpamPoolCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeprovisionIpamPoolCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeprovisionIpamPoolCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeprovisionPublicIpv4PoolCidr struct { -} - -func (*awsEc2query_serializeOpDeprovisionPublicIpv4PoolCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeprovisionPublicIpv4PoolCidr) 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.(*DeprovisionPublicIpv4PoolCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeprovisionPublicIpv4PoolCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeprovisionPublicIpv4PoolCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeregisterImage struct { -} - -func (*awsEc2query_serializeOpDeregisterImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeregisterImage) 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.(*DeregisterImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeregisterImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeregisterImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeregisterInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_serializeOpDeregisterInstanceEventNotificationAttributes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeregisterInstanceEventNotificationAttributes) 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.(*DeregisterInstanceEventNotificationAttributesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeregisterInstanceEventNotificationAttributes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeregisterInstanceEventNotificationAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupMembers struct { -} - -func (*awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupMembers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupMembers) 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.(*DeregisterTransitGatewayMulticastGroupMembersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeregisterTransitGatewayMulticastGroupMembers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeregisterTransitGatewayMulticastGroupMembersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupSources struct { -} - -func (*awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupSources) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDeregisterTransitGatewayMulticastGroupSources) 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.(*DeregisterTransitGatewayMulticastGroupSourcesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeregisterTransitGatewayMulticastGroupSources") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDeregisterTransitGatewayMulticastGroupSourcesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAccountAttributes struct { -} - -func (*awsEc2query_serializeOpDescribeAccountAttributes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAccountAttributes) 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.(*DescribeAccountAttributesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAccountAttributes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAccountAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAddresses struct { -} - -func (*awsEc2query_serializeOpDescribeAddresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAddresses) 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.(*DescribeAddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAddresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAddressesAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeAddressesAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAddressesAttribute) 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.(*DescribeAddressesAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAddressesAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAddressesAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAddressTransfers struct { -} - -func (*awsEc2query_serializeOpDescribeAddressTransfers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAddressTransfers) 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.(*DescribeAddressTransfersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAddressTransfers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAddressTransfersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAggregateIdFormat struct { -} - -func (*awsEc2query_serializeOpDescribeAggregateIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAggregateIdFormat) 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.(*DescribeAggregateIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAggregateIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAggregateIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAvailabilityZones struct { -} - -func (*awsEc2query_serializeOpDescribeAvailabilityZones) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAvailabilityZones) 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.(*DescribeAvailabilityZonesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAvailabilityZones") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAvailabilityZonesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeAwsNetworkPerformanceMetricSubscriptions struct { -} - -func (*awsEc2query_serializeOpDescribeAwsNetworkPerformanceMetricSubscriptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeAwsNetworkPerformanceMetricSubscriptions) 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.(*DescribeAwsNetworkPerformanceMetricSubscriptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeAwsNetworkPerformanceMetricSubscriptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeAwsNetworkPerformanceMetricSubscriptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeBundleTasks struct { -} - -func (*awsEc2query_serializeOpDescribeBundleTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeBundleTasks) 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.(*DescribeBundleTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeBundleTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeBundleTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeByoipCidrs struct { -} - -func (*awsEc2query_serializeOpDescribeByoipCidrs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeByoipCidrs) 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.(*DescribeByoipCidrsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeByoipCidrs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeByoipCidrsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory) 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.(*DescribeCapacityBlockExtensionHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityBlockExtensionHistory") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionHistoryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings) 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.(*DescribeCapacityBlockExtensionOfferingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityBlockExtensionOfferings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionOfferingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityBlockOfferings struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityBlockOfferings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityBlockOfferings) 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.(*DescribeCapacityBlockOfferingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityBlockOfferings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockOfferingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityBlocks struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityBlocks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityBlocks) 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.(*DescribeCapacityBlocksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityBlocks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityBlocksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityBlockStatus struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityBlockStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityBlockStatus) 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.(*DescribeCapacityBlockStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityBlockStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityReservationBillingRequests struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityReservationBillingRequests) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityReservationBillingRequests) 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.(*DescribeCapacityReservationBillingRequestsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityReservationBillingRequests") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityReservationBillingRequestsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityReservationFleets struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityReservationFleets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityReservationFleets) 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.(*DescribeCapacityReservationFleetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityReservationFleets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityReservationFleetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCapacityReservations struct { -} - -func (*awsEc2query_serializeOpDescribeCapacityReservations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCapacityReservations) 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.(*DescribeCapacityReservationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCapacityReservations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCapacityReservationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCarrierGateways struct { -} - -func (*awsEc2query_serializeOpDescribeCarrierGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCarrierGateways) 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.(*DescribeCarrierGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCarrierGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCarrierGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClassicLinkInstances struct { -} - -func (*awsEc2query_serializeOpDescribeClassicLinkInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClassicLinkInstances) 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.(*DescribeClassicLinkInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClassicLinkInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClassicLinkInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClientVpnAuthorizationRules struct { -} - -func (*awsEc2query_serializeOpDescribeClientVpnAuthorizationRules) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClientVpnAuthorizationRules) 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.(*DescribeClientVpnAuthorizationRulesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClientVpnAuthorizationRules") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClientVpnAuthorizationRulesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClientVpnConnections struct { -} - -func (*awsEc2query_serializeOpDescribeClientVpnConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClientVpnConnections) 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.(*DescribeClientVpnConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClientVpnConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClientVpnConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClientVpnEndpoints struct { -} - -func (*awsEc2query_serializeOpDescribeClientVpnEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClientVpnEndpoints) 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.(*DescribeClientVpnEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClientVpnEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClientVpnEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClientVpnRoutes struct { -} - -func (*awsEc2query_serializeOpDescribeClientVpnRoutes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClientVpnRoutes) 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.(*DescribeClientVpnRoutesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClientVpnRoutes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClientVpnRoutesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeClientVpnTargetNetworks struct { -} - -func (*awsEc2query_serializeOpDescribeClientVpnTargetNetworks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeClientVpnTargetNetworks) 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.(*DescribeClientVpnTargetNetworksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeClientVpnTargetNetworks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeClientVpnTargetNetworksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCoipPools struct { -} - -func (*awsEc2query_serializeOpDescribeCoipPools) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCoipPools) 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.(*DescribeCoipPoolsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCoipPools") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCoipPoolsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeConversionTasks struct { -} - -func (*awsEc2query_serializeOpDescribeConversionTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeConversionTasks) 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.(*DescribeConversionTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeConversionTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeConversionTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeCustomerGateways struct { -} - -func (*awsEc2query_serializeOpDescribeCustomerGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeCustomerGateways) 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.(*DescribeCustomerGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeCustomerGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeCustomerGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeDeclarativePoliciesReports struct { -} - -func (*awsEc2query_serializeOpDescribeDeclarativePoliciesReports) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeDeclarativePoliciesReports) 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.(*DescribeDeclarativePoliciesReportsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeDeclarativePoliciesReports") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeDeclarativePoliciesReportsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeDhcpOptions struct { -} - -func (*awsEc2query_serializeOpDescribeDhcpOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeDhcpOptions) 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.(*DescribeDhcpOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeDhcpOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeDhcpOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeEgressOnlyInternetGateways struct { -} - -func (*awsEc2query_serializeOpDescribeEgressOnlyInternetGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeEgressOnlyInternetGateways) 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.(*DescribeEgressOnlyInternetGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeEgressOnlyInternetGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeEgressOnlyInternetGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeElasticGpus struct { -} - -func (*awsEc2query_serializeOpDescribeElasticGpus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeElasticGpus) 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.(*DescribeElasticGpusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeElasticGpus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeElasticGpusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeExportImageTasks struct { -} - -func (*awsEc2query_serializeOpDescribeExportImageTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeExportImageTasks) 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.(*DescribeExportImageTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeExportImageTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeExportImageTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeExportTasks struct { -} - -func (*awsEc2query_serializeOpDescribeExportTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeExportTasks) 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.(*DescribeExportTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeExportTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeExportTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFastLaunchImages struct { -} - -func (*awsEc2query_serializeOpDescribeFastLaunchImages) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFastLaunchImages) 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.(*DescribeFastLaunchImagesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFastLaunchImages") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFastLaunchImagesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFastSnapshotRestores struct { -} - -func (*awsEc2query_serializeOpDescribeFastSnapshotRestores) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFastSnapshotRestores) 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.(*DescribeFastSnapshotRestoresInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFastSnapshotRestores") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFastSnapshotRestoresInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFleetHistory struct { -} - -func (*awsEc2query_serializeOpDescribeFleetHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFleetHistory) 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.(*DescribeFleetHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFleetHistory") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFleetHistoryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFleetInstances struct { -} - -func (*awsEc2query_serializeOpDescribeFleetInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFleetInstances) 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.(*DescribeFleetInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFleetInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFleetInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFleets struct { -} - -func (*awsEc2query_serializeOpDescribeFleets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFleets) 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.(*DescribeFleetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFleets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFleetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFlowLogs struct { -} - -func (*awsEc2query_serializeOpDescribeFlowLogs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFlowLogs) 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.(*DescribeFlowLogsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFlowLogs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFlowLogsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFpgaImageAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeFpgaImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFpgaImageAttribute) 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.(*DescribeFpgaImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFpgaImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFpgaImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeFpgaImages struct { -} - -func (*awsEc2query_serializeOpDescribeFpgaImages) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeFpgaImages) 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.(*DescribeFpgaImagesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeFpgaImages") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeFpgaImagesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeHostReservationOfferings struct { -} - -func (*awsEc2query_serializeOpDescribeHostReservationOfferings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeHostReservationOfferings) 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.(*DescribeHostReservationOfferingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeHostReservationOfferings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeHostReservationOfferingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeHostReservations struct { -} - -func (*awsEc2query_serializeOpDescribeHostReservations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeHostReservations) 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.(*DescribeHostReservationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeHostReservations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeHostReservationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeHosts struct { -} - -func (*awsEc2query_serializeOpDescribeHosts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeHosts) 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.(*DescribeHostsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeHosts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeHostsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIamInstanceProfileAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeIamInstanceProfileAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIamInstanceProfileAssociations) 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.(*DescribeIamInstanceProfileAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIamInstanceProfileAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIamInstanceProfileAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIdentityIdFormat struct { -} - -func (*awsEc2query_serializeOpDescribeIdentityIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIdentityIdFormat) 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.(*DescribeIdentityIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIdentityIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIdentityIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIdFormat struct { -} - -func (*awsEc2query_serializeOpDescribeIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIdFormat) 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.(*DescribeIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeImageAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeImageAttribute) 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.(*DescribeImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeImages struct { -} - -func (*awsEc2query_serializeOpDescribeImages) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeImages) 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.(*DescribeImagesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeImages") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeImagesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeImportImageTasks struct { -} - -func (*awsEc2query_serializeOpDescribeImportImageTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeImportImageTasks) 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.(*DescribeImportImageTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeImportImageTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeImportImageTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeImportSnapshotTasks struct { -} - -func (*awsEc2query_serializeOpDescribeImportSnapshotTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeImportSnapshotTasks) 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.(*DescribeImportSnapshotTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeImportSnapshotTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeImportSnapshotTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceAttribute) 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.(*DescribeInstanceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceConnectEndpoints struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceConnectEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceConnectEndpoints) 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.(*DescribeInstanceConnectEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceConnectEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceConnectEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceCreditSpecifications struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceCreditSpecifications) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceCreditSpecifications) 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.(*DescribeInstanceCreditSpecificationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceCreditSpecifications") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceCreditSpecificationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceEventNotificationAttributes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceEventNotificationAttributes) 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.(*DescribeInstanceEventNotificationAttributesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceEventNotificationAttributes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceEventNotificationAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceEventWindows struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceEventWindows) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceEventWindows) 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.(*DescribeInstanceEventWindowsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceEventWindows") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceEventWindowsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceImageMetadata struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceImageMetadata) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceImageMetadata) 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.(*DescribeInstanceImageMetadataInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceImageMetadata") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceImageMetadataInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstances struct { -} - -func (*awsEc2query_serializeOpDescribeInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstances) 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.(*DescribeInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceStatus struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceStatus) 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.(*DescribeInstanceStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceTopology struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceTopology) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceTopology) 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.(*DescribeInstanceTopologyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceTopology") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceTopologyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceTypeOfferings struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceTypeOfferings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceTypeOfferings) 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.(*DescribeInstanceTypeOfferingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceTypeOfferings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceTypeOfferingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInstanceTypes struct { -} - -func (*awsEc2query_serializeOpDescribeInstanceTypes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInstanceTypes) 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.(*DescribeInstanceTypesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInstanceTypes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInstanceTypesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeInternetGateways struct { -} - -func (*awsEc2query_serializeOpDescribeInternetGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeInternetGateways) 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.(*DescribeInternetGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeInternetGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeInternetGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamByoasn struct { -} - -func (*awsEc2query_serializeOpDescribeIpamByoasn) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamByoasn) 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.(*DescribeIpamByoasnInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamByoasn") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamByoasnInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamExternalResourceVerificationTokens struct { -} - -func (*awsEc2query_serializeOpDescribeIpamExternalResourceVerificationTokens) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamExternalResourceVerificationTokens) 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.(*DescribeIpamExternalResourceVerificationTokensInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamExternalResourceVerificationTokens") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamExternalResourceVerificationTokensInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamPools struct { -} - -func (*awsEc2query_serializeOpDescribeIpamPools) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamPools) 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.(*DescribeIpamPoolsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamPools") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamPoolsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamResourceDiscoveries struct { -} - -func (*awsEc2query_serializeOpDescribeIpamResourceDiscoveries) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamResourceDiscoveries) 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.(*DescribeIpamResourceDiscoveriesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamResourceDiscoveries") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamResourceDiscoveriesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamResourceDiscoveryAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeIpamResourceDiscoveryAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamResourceDiscoveryAssociations) 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.(*DescribeIpamResourceDiscoveryAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamResourceDiscoveryAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamResourceDiscoveryAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpams struct { -} - -func (*awsEc2query_serializeOpDescribeIpams) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpams) 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.(*DescribeIpamsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpams") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpamScopes struct { -} - -func (*awsEc2query_serializeOpDescribeIpamScopes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpamScopes) 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.(*DescribeIpamScopesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpamScopes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpamScopesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeIpv6Pools struct { -} - -func (*awsEc2query_serializeOpDescribeIpv6Pools) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeIpv6Pools) 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.(*DescribeIpv6PoolsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeIpv6Pools") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeIpv6PoolsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeKeyPairs struct { -} - -func (*awsEc2query_serializeOpDescribeKeyPairs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeKeyPairs) 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.(*DescribeKeyPairsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeKeyPairs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeKeyPairsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLaunchTemplates struct { -} - -func (*awsEc2query_serializeOpDescribeLaunchTemplates) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLaunchTemplates) 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.(*DescribeLaunchTemplatesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLaunchTemplates") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLaunchTemplatesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLaunchTemplateVersions struct { -} - -func (*awsEc2query_serializeOpDescribeLaunchTemplateVersions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLaunchTemplateVersions) 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.(*DescribeLaunchTemplateVersionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLaunchTemplateVersions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLaunchTemplateVersionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGatewayRouteTables struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGatewayRouteTables) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGatewayRouteTables) 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.(*DescribeLocalGatewayRouteTablesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGatewayRouteTables") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTablesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations) 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.(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGatewayRouteTableVpcAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGatewayRouteTableVpcAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGatewayRouteTableVpcAssociations) 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.(*DescribeLocalGatewayRouteTableVpcAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGatewayRouteTableVpcAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGateways struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGateways) 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.(*DescribeLocalGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaceGroups struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaceGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaceGroups) 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.(*DescribeLocalGatewayVirtualInterfaceGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGatewayVirtualInterfaceGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaces struct { -} - -func (*awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaces) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLocalGatewayVirtualInterfaces) 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.(*DescribeLocalGatewayVirtualInterfacesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLocalGatewayVirtualInterfaces") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLocalGatewayVirtualInterfacesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeLockedSnapshots struct { -} - -func (*awsEc2query_serializeOpDescribeLockedSnapshots) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeLockedSnapshots) 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.(*DescribeLockedSnapshotsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeLockedSnapshots") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeLockedSnapshotsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeMacHosts struct { -} - -func (*awsEc2query_serializeOpDescribeMacHosts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeMacHosts) 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.(*DescribeMacHostsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeMacHosts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeMacHostsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeMacModificationTasks struct { -} - -func (*awsEc2query_serializeOpDescribeMacModificationTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeMacModificationTasks) 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.(*DescribeMacModificationTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeMacModificationTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeMacModificationTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeManagedPrefixLists struct { -} - -func (*awsEc2query_serializeOpDescribeManagedPrefixLists) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeManagedPrefixLists) 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.(*DescribeManagedPrefixListsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeManagedPrefixLists") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeManagedPrefixListsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeMovingAddresses struct { -} - -func (*awsEc2query_serializeOpDescribeMovingAddresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeMovingAddresses) 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.(*DescribeMovingAddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeMovingAddresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeMovingAddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNatGateways struct { -} - -func (*awsEc2query_serializeOpDescribeNatGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNatGateways) 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.(*DescribeNatGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNatGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNatGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkAcls struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkAcls) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkAcls) 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.(*DescribeNetworkAclsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkAcls") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkAclsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInsightsAccessScopeAnalyses struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInsightsAccessScopeAnalyses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInsightsAccessScopeAnalyses) 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.(*DescribeNetworkInsightsAccessScopeAnalysesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInsightsAccessScopeAnalyses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInsightsAccessScopes struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInsightsAccessScopes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInsightsAccessScopes) 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.(*DescribeNetworkInsightsAccessScopesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInsightsAccessScopes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInsightsAccessScopesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInsightsAnalyses struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInsightsAnalyses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInsightsAnalyses) 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.(*DescribeNetworkInsightsAnalysesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInsightsAnalyses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInsightsAnalysesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInsightsPaths struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInsightsPaths) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInsightsPaths) 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.(*DescribeNetworkInsightsPathsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInsightsPaths") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInsightsPathsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInterfaceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInterfaceAttribute) 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.(*DescribeNetworkInterfaceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInterfaceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInterfaceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInterfacePermissions struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInterfacePermissions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInterfacePermissions) 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.(*DescribeNetworkInterfacePermissionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInterfacePermissions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInterfacePermissionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeNetworkInterfaces struct { -} - -func (*awsEc2query_serializeOpDescribeNetworkInterfaces) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeNetworkInterfaces) 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.(*DescribeNetworkInterfacesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeNetworkInterfaces") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeNetworkInterfacesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeOutpostLags struct { -} - -func (*awsEc2query_serializeOpDescribeOutpostLags) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeOutpostLags) 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.(*DescribeOutpostLagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeOutpostLags") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeOutpostLagsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribePlacementGroups struct { -} - -func (*awsEc2query_serializeOpDescribePlacementGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribePlacementGroups) 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.(*DescribePlacementGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribePlacementGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribePlacementGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribePrefixLists struct { -} - -func (*awsEc2query_serializeOpDescribePrefixLists) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribePrefixLists) 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.(*DescribePrefixListsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribePrefixLists") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribePrefixListsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribePrincipalIdFormat struct { -} - -func (*awsEc2query_serializeOpDescribePrincipalIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribePrincipalIdFormat) 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.(*DescribePrincipalIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribePrincipalIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribePrincipalIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribePublicIpv4Pools struct { -} - -func (*awsEc2query_serializeOpDescribePublicIpv4Pools) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribePublicIpv4Pools) 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.(*DescribePublicIpv4PoolsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribePublicIpv4Pools") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribePublicIpv4PoolsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeRegions struct { -} - -func (*awsEc2query_serializeOpDescribeRegions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeRegions) 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.(*DescribeRegionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeRegions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeRegionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeReplaceRootVolumeTasks struct { -} - -func (*awsEc2query_serializeOpDescribeReplaceRootVolumeTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeReplaceRootVolumeTasks) 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.(*DescribeReplaceRootVolumeTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeReplaceRootVolumeTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeReplaceRootVolumeTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeReservedInstances struct { -} - -func (*awsEc2query_serializeOpDescribeReservedInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeReservedInstances) 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.(*DescribeReservedInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeReservedInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeReservedInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeReservedInstancesListings struct { -} - -func (*awsEc2query_serializeOpDescribeReservedInstancesListings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeReservedInstancesListings) 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.(*DescribeReservedInstancesListingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeReservedInstancesListings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeReservedInstancesListingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeReservedInstancesModifications struct { -} - -func (*awsEc2query_serializeOpDescribeReservedInstancesModifications) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeReservedInstancesModifications) 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.(*DescribeReservedInstancesModificationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeReservedInstancesModifications") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeReservedInstancesModificationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeReservedInstancesOfferings struct { -} - -func (*awsEc2query_serializeOpDescribeReservedInstancesOfferings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeReservedInstancesOfferings) 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.(*DescribeReservedInstancesOfferingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeReservedInstancesOfferings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeReservedInstancesOfferingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeRouteServerEndpoints struct { -} - -func (*awsEc2query_serializeOpDescribeRouteServerEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeRouteServerEndpoints) 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.(*DescribeRouteServerEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeRouteServerEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeRouteServerEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeRouteServerPeers struct { -} - -func (*awsEc2query_serializeOpDescribeRouteServerPeers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeRouteServerPeers) 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.(*DescribeRouteServerPeersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeRouteServerPeers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeRouteServerPeersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeRouteServers struct { -} - -func (*awsEc2query_serializeOpDescribeRouteServers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeRouteServers) 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.(*DescribeRouteServersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeRouteServers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeRouteServersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeRouteTables struct { -} - -func (*awsEc2query_serializeOpDescribeRouteTables) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeRouteTables) 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.(*DescribeRouteTablesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeRouteTables") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeRouteTablesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeScheduledInstanceAvailability struct { -} - -func (*awsEc2query_serializeOpDescribeScheduledInstanceAvailability) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeScheduledInstanceAvailability) 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.(*DescribeScheduledInstanceAvailabilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeScheduledInstanceAvailability") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeScheduledInstanceAvailabilityInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeScheduledInstances struct { -} - -func (*awsEc2query_serializeOpDescribeScheduledInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeScheduledInstances) 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.(*DescribeScheduledInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeScheduledInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeScheduledInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSecurityGroupReferences struct { -} - -func (*awsEc2query_serializeOpDescribeSecurityGroupReferences) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSecurityGroupReferences) 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.(*DescribeSecurityGroupReferencesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSecurityGroupReferences") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSecurityGroupReferencesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSecurityGroupRules struct { -} - -func (*awsEc2query_serializeOpDescribeSecurityGroupRules) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSecurityGroupRules) 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.(*DescribeSecurityGroupRulesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSecurityGroupRules") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSecurityGroupRulesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSecurityGroups struct { -} - -func (*awsEc2query_serializeOpDescribeSecurityGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSecurityGroups) 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.(*DescribeSecurityGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSecurityGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSecurityGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations) 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.(*DescribeSecurityGroupVpcAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSecurityGroupVpcAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSecurityGroupVpcAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeServiceLinkVirtualInterfaces struct { -} - -func (*awsEc2query_serializeOpDescribeServiceLinkVirtualInterfaces) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeServiceLinkVirtualInterfaces) 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.(*DescribeServiceLinkVirtualInterfacesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeServiceLinkVirtualInterfaces") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeServiceLinkVirtualInterfacesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSnapshotAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeSnapshotAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSnapshotAttribute) 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.(*DescribeSnapshotAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSnapshotAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSnapshotAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSnapshots struct { -} - -func (*awsEc2query_serializeOpDescribeSnapshots) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSnapshots) 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.(*DescribeSnapshotsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSnapshots") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSnapshotsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSnapshotTierStatus struct { -} - -func (*awsEc2query_serializeOpDescribeSnapshotTierStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSnapshotTierStatus) 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.(*DescribeSnapshotTierStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSnapshotTierStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSnapshotTierStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotDatafeedSubscription struct { -} - -func (*awsEc2query_serializeOpDescribeSpotDatafeedSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotDatafeedSubscription) 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.(*DescribeSpotDatafeedSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotDatafeedSubscription") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotDatafeedSubscriptionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotFleetInstances struct { -} - -func (*awsEc2query_serializeOpDescribeSpotFleetInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotFleetInstances) 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.(*DescribeSpotFleetInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotFleetInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotFleetInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotFleetRequestHistory struct { -} - -func (*awsEc2query_serializeOpDescribeSpotFleetRequestHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotFleetRequestHistory) 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.(*DescribeSpotFleetRequestHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotFleetRequestHistory") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotFleetRequestHistoryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotFleetRequests struct { -} - -func (*awsEc2query_serializeOpDescribeSpotFleetRequests) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotFleetRequests) 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.(*DescribeSpotFleetRequestsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotFleetRequests") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotFleetRequestsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotInstanceRequests struct { -} - -func (*awsEc2query_serializeOpDescribeSpotInstanceRequests) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotInstanceRequests) 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.(*DescribeSpotInstanceRequestsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotInstanceRequests") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotInstanceRequestsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSpotPriceHistory struct { -} - -func (*awsEc2query_serializeOpDescribeSpotPriceHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSpotPriceHistory) 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.(*DescribeSpotPriceHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSpotPriceHistory") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSpotPriceHistoryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeStaleSecurityGroups struct { -} - -func (*awsEc2query_serializeOpDescribeStaleSecurityGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeStaleSecurityGroups) 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.(*DescribeStaleSecurityGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeStaleSecurityGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeStaleSecurityGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeStoreImageTasks struct { -} - -func (*awsEc2query_serializeOpDescribeStoreImageTasks) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeStoreImageTasks) 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.(*DescribeStoreImageTasksInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeStoreImageTasks") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeStoreImageTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeSubnets struct { -} - -func (*awsEc2query_serializeOpDescribeSubnets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeSubnets) 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.(*DescribeSubnetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeSubnets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeSubnetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTags struct { -} - -func (*awsEc2query_serializeOpDescribeTags) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTags) 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.(*DescribeTagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTags") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTagsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTrafficMirrorFilterRules struct { -} - -func (*awsEc2query_serializeOpDescribeTrafficMirrorFilterRules) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTrafficMirrorFilterRules) 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.(*DescribeTrafficMirrorFilterRulesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTrafficMirrorFilterRules") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTrafficMirrorFilterRulesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTrafficMirrorFilters struct { -} - -func (*awsEc2query_serializeOpDescribeTrafficMirrorFilters) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTrafficMirrorFilters) 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.(*DescribeTrafficMirrorFiltersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTrafficMirrorFilters") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTrafficMirrorFiltersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTrafficMirrorSessions struct { -} - -func (*awsEc2query_serializeOpDescribeTrafficMirrorSessions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTrafficMirrorSessions) 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.(*DescribeTrafficMirrorSessionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTrafficMirrorSessions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTrafficMirrorSessionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTrafficMirrorTargets struct { -} - -func (*awsEc2query_serializeOpDescribeTrafficMirrorTargets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTrafficMirrorTargets) 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.(*DescribeTrafficMirrorTargetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTrafficMirrorTargets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTrafficMirrorTargetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayAttachments struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayAttachments) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayAttachments) 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.(*DescribeTransitGatewayAttachmentsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayAttachments") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayAttachmentsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayConnectPeers struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayConnectPeers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayConnectPeers) 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.(*DescribeTransitGatewayConnectPeersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayConnectPeers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayConnectPeersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayConnects struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayConnects) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayConnects) 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.(*DescribeTransitGatewayConnectsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayConnects") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayConnectsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayMulticastDomains struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayMulticastDomains) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayMulticastDomains) 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.(*DescribeTransitGatewayMulticastDomainsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayMulticastDomains") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayMulticastDomainsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayPeeringAttachments struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayPeeringAttachments) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayPeeringAttachments) 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.(*DescribeTransitGatewayPeeringAttachmentsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayPeeringAttachments") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayPeeringAttachmentsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayPolicyTables struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayPolicyTables) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayPolicyTables) 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.(*DescribeTransitGatewayPolicyTablesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayPolicyTables") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayPolicyTablesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayRouteTableAnnouncements struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayRouteTableAnnouncements) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayRouteTableAnnouncements) 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.(*DescribeTransitGatewayRouteTableAnnouncementsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayRouteTableAnnouncements") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayRouteTableAnnouncementsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayRouteTables struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayRouteTables) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayRouteTables) 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.(*DescribeTransitGatewayRouteTablesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayRouteTables") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayRouteTablesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGateways struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGateways) 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.(*DescribeTransitGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTransitGatewayVpcAttachments struct { -} - -func (*awsEc2query_serializeOpDescribeTransitGatewayVpcAttachments) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTransitGatewayVpcAttachments) 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.(*DescribeTransitGatewayVpcAttachmentsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTransitGatewayVpcAttachments") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTransitGatewayVpcAttachmentsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeTrunkInterfaceAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeTrunkInterfaceAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeTrunkInterfaceAssociations) 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.(*DescribeTrunkInterfaceAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeTrunkInterfaceAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeTrunkInterfaceAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVerifiedAccessEndpoints struct { -} - -func (*awsEc2query_serializeOpDescribeVerifiedAccessEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVerifiedAccessEndpoints) 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.(*DescribeVerifiedAccessEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVerifiedAccessEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVerifiedAccessEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVerifiedAccessGroups struct { -} - -func (*awsEc2query_serializeOpDescribeVerifiedAccessGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVerifiedAccessGroups) 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.(*DescribeVerifiedAccessGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVerifiedAccessGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVerifiedAccessGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVerifiedAccessInstanceLoggingConfigurations struct { -} - -func (*awsEc2query_serializeOpDescribeVerifiedAccessInstanceLoggingConfigurations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVerifiedAccessInstanceLoggingConfigurations) 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.(*DescribeVerifiedAccessInstanceLoggingConfigurationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVerifiedAccessInstanceLoggingConfigurations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVerifiedAccessInstanceLoggingConfigurationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVerifiedAccessInstances struct { -} - -func (*awsEc2query_serializeOpDescribeVerifiedAccessInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVerifiedAccessInstances) 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.(*DescribeVerifiedAccessInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVerifiedAccessInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVerifiedAccessInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVerifiedAccessTrustProviders struct { -} - -func (*awsEc2query_serializeOpDescribeVerifiedAccessTrustProviders) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVerifiedAccessTrustProviders) 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.(*DescribeVerifiedAccessTrustProvidersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVerifiedAccessTrustProviders") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVerifiedAccessTrustProvidersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVolumeAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeVolumeAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVolumeAttribute) 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.(*DescribeVolumeAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVolumeAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVolumeAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVolumes struct { -} - -func (*awsEc2query_serializeOpDescribeVolumes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVolumes) 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.(*DescribeVolumesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVolumes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVolumesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVolumesModifications struct { -} - -func (*awsEc2query_serializeOpDescribeVolumesModifications) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVolumesModifications) 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.(*DescribeVolumesModificationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVolumesModifications") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVolumesModificationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVolumeStatus struct { -} - -func (*awsEc2query_serializeOpDescribeVolumeStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVolumeStatus) 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.(*DescribeVolumeStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVolumeStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVolumeStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcAttribute struct { -} - -func (*awsEc2query_serializeOpDescribeVpcAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcAttribute) 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.(*DescribeVpcAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcBlockPublicAccessExclusions struct { -} - -func (*awsEc2query_serializeOpDescribeVpcBlockPublicAccessExclusions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcBlockPublicAccessExclusions) 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.(*DescribeVpcBlockPublicAccessExclusionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcBlockPublicAccessExclusions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcBlockPublicAccessExclusionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcBlockPublicAccessOptions struct { -} - -func (*awsEc2query_serializeOpDescribeVpcBlockPublicAccessOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcBlockPublicAccessOptions) 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.(*DescribeVpcBlockPublicAccessOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcBlockPublicAccessOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcBlockPublicAccessOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcClassicLink struct { -} - -func (*awsEc2query_serializeOpDescribeVpcClassicLink) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcClassicLink) 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.(*DescribeVpcClassicLinkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcClassicLink") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcClassicLinkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_serializeOpDescribeVpcClassicLinkDnsSupport) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcClassicLinkDnsSupport) 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.(*DescribeVpcClassicLinkDnsSupportInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcClassicLinkDnsSupport") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcClassicLinkDnsSupportInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointAssociations struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointAssociations) 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.(*DescribeVpcEndpointAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointConnectionNotifications struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointConnectionNotifications) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointConnectionNotifications) 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.(*DescribeVpcEndpointConnectionNotificationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointConnectionNotifications") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointConnectionNotificationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointConnections struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointConnections) 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.(*DescribeVpcEndpointConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpoints struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpoints) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpoints) 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.(*DescribeVpcEndpointsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpoints") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointServiceConfigurations struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointServiceConfigurations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointServiceConfigurations) 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.(*DescribeVpcEndpointServiceConfigurationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointServiceConfigurations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointServiceConfigurationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointServicePermissions struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointServicePermissions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointServicePermissions) 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.(*DescribeVpcEndpointServicePermissionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointServicePermissions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointServicePermissionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcEndpointServices struct { -} - -func (*awsEc2query_serializeOpDescribeVpcEndpointServices) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcEndpointServices) 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.(*DescribeVpcEndpointServicesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcEndpointServices") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcEndpointServicesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcPeeringConnections struct { -} - -func (*awsEc2query_serializeOpDescribeVpcPeeringConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcPeeringConnections) 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.(*DescribeVpcPeeringConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcPeeringConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcPeeringConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpcs struct { -} - -func (*awsEc2query_serializeOpDescribeVpcs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpcs) 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.(*DescribeVpcsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpcs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpcsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpnConnections struct { -} - -func (*awsEc2query_serializeOpDescribeVpnConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpnConnections) 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.(*DescribeVpnConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpnConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpnConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDescribeVpnGateways struct { -} - -func (*awsEc2query_serializeOpDescribeVpnGateways) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDescribeVpnGateways) 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.(*DescribeVpnGatewaysInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DescribeVpnGateways") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDescribeVpnGatewaysInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachClassicLinkVpc struct { -} - -func (*awsEc2query_serializeOpDetachClassicLinkVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachClassicLinkVpc) 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.(*DetachClassicLinkVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachClassicLinkVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachClassicLinkVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachInternetGateway struct { -} - -func (*awsEc2query_serializeOpDetachInternetGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachInternetGateway) 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.(*DetachInternetGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachInternetGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachInternetGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachNetworkInterface struct { -} - -func (*awsEc2query_serializeOpDetachNetworkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachNetworkInterface) 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.(*DetachNetworkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachNetworkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachNetworkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_serializeOpDetachVerifiedAccessTrustProvider) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachVerifiedAccessTrustProvider) 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.(*DetachVerifiedAccessTrustProviderInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachVerifiedAccessTrustProvider") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachVerifiedAccessTrustProviderInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachVolume struct { -} - -func (*awsEc2query_serializeOpDetachVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachVolume) 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.(*DetachVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDetachVpnGateway struct { -} - -func (*awsEc2query_serializeOpDetachVpnGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDetachVpnGateway) 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.(*DetachVpnGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DetachVpnGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDetachVpnGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableAddressTransfer struct { -} - -func (*awsEc2query_serializeOpDisableAddressTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableAddressTransfer) 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.(*DisableAddressTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableAddressTransfer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableAddressTransferInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableAllowedImagesSettings struct { -} - -func (*awsEc2query_serializeOpDisableAllowedImagesSettings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableAllowedImagesSettings) 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.(*DisableAllowedImagesSettingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableAllowedImagesSettings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableAllowedImagesSettingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableAwsNetworkPerformanceMetricSubscription struct { -} - -func (*awsEc2query_serializeOpDisableAwsNetworkPerformanceMetricSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableAwsNetworkPerformanceMetricSubscription) 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.(*DisableAwsNetworkPerformanceMetricSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableAwsNetworkPerformanceMetricSubscription") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableAwsNetworkPerformanceMetricSubscriptionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableEbsEncryptionByDefault struct { -} - -func (*awsEc2query_serializeOpDisableEbsEncryptionByDefault) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableEbsEncryptionByDefault) 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.(*DisableEbsEncryptionByDefaultInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableEbsEncryptionByDefault") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableEbsEncryptionByDefaultInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableFastLaunch struct { -} - -func (*awsEc2query_serializeOpDisableFastLaunch) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableFastLaunch) 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.(*DisableFastLaunchInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableFastLaunch") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableFastLaunchInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableFastSnapshotRestores struct { -} - -func (*awsEc2query_serializeOpDisableFastSnapshotRestores) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableFastSnapshotRestores) 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.(*DisableFastSnapshotRestoresInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableFastSnapshotRestores") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableFastSnapshotRestoresInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableImage struct { -} - -func (*awsEc2query_serializeOpDisableImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableImage) 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.(*DisableImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableImageBlockPublicAccess struct { -} - -func (*awsEc2query_serializeOpDisableImageBlockPublicAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableImageBlockPublicAccess) 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.(*DisableImageBlockPublicAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableImageBlockPublicAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableImageBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableImageDeprecation struct { -} - -func (*awsEc2query_serializeOpDisableImageDeprecation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableImageDeprecation) 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.(*DisableImageDeprecationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableImageDeprecation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableImageDeprecationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableImageDeregistrationProtection struct { -} - -func (*awsEc2query_serializeOpDisableImageDeregistrationProtection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableImageDeregistrationProtection) 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.(*DisableImageDeregistrationProtectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableImageDeregistrationProtection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableImageDeregistrationProtectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableIpamOrganizationAdminAccount struct { -} - -func (*awsEc2query_serializeOpDisableIpamOrganizationAdminAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableIpamOrganizationAdminAccount) 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.(*DisableIpamOrganizationAdminAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableIpamOrganizationAdminAccount") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableIpamOrganizationAdminAccountInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableRouteServerPropagation struct { -} - -func (*awsEc2query_serializeOpDisableRouteServerPropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableRouteServerPropagation) 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.(*DisableRouteServerPropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableRouteServerPropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableRouteServerPropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableSerialConsoleAccess struct { -} - -func (*awsEc2query_serializeOpDisableSerialConsoleAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableSerialConsoleAccess) 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.(*DisableSerialConsoleAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableSerialConsoleAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableSerialConsoleAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableSnapshotBlockPublicAccess struct { -} - -func (*awsEc2query_serializeOpDisableSnapshotBlockPublicAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableSnapshotBlockPublicAccess) 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.(*DisableSnapshotBlockPublicAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableSnapshotBlockPublicAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableSnapshotBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableTransitGatewayRouteTablePropagation struct { -} - -func (*awsEc2query_serializeOpDisableTransitGatewayRouteTablePropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableTransitGatewayRouteTablePropagation) 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.(*DisableTransitGatewayRouteTablePropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableTransitGatewayRouteTablePropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableTransitGatewayRouteTablePropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableVgwRoutePropagation struct { -} - -func (*awsEc2query_serializeOpDisableVgwRoutePropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableVgwRoutePropagation) 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.(*DisableVgwRoutePropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableVgwRoutePropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableVgwRoutePropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableVpcClassicLink struct { -} - -func (*awsEc2query_serializeOpDisableVpcClassicLink) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableVpcClassicLink) 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.(*DisableVpcClassicLinkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableVpcClassicLink") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableVpcClassicLinkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisableVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_serializeOpDisableVpcClassicLinkDnsSupport) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisableVpcClassicLinkDnsSupport) 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.(*DisableVpcClassicLinkDnsSupportInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisableVpcClassicLinkDnsSupport") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisableVpcClassicLinkDnsSupportInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateAddress struct { -} - -func (*awsEc2query_serializeOpDisassociateAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateAddress) 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.(*DisassociateAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateCapacityReservationBillingOwner struct { -} - -func (*awsEc2query_serializeOpDisassociateCapacityReservationBillingOwner) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateCapacityReservationBillingOwner) 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.(*DisassociateCapacityReservationBillingOwnerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateCapacityReservationBillingOwner") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateCapacityReservationBillingOwnerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateClientVpnTargetNetwork struct { -} - -func (*awsEc2query_serializeOpDisassociateClientVpnTargetNetwork) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateClientVpnTargetNetwork) 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.(*DisassociateClientVpnTargetNetworkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateClientVpnTargetNetwork") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateClientVpnTargetNetworkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateEnclaveCertificateIamRole struct { -} - -func (*awsEc2query_serializeOpDisassociateEnclaveCertificateIamRole) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateEnclaveCertificateIamRole) 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.(*DisassociateEnclaveCertificateIamRoleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateEnclaveCertificateIamRole") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateEnclaveCertificateIamRoleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateIamInstanceProfile struct { -} - -func (*awsEc2query_serializeOpDisassociateIamInstanceProfile) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateIamInstanceProfile) 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.(*DisassociateIamInstanceProfileInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateIamInstanceProfile") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateIamInstanceProfileInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateInstanceEventWindow struct { -} - -func (*awsEc2query_serializeOpDisassociateInstanceEventWindow) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateInstanceEventWindow) 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.(*DisassociateInstanceEventWindowInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateInstanceEventWindow") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateInstanceEventWindowInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateIpamByoasn struct { -} - -func (*awsEc2query_serializeOpDisassociateIpamByoasn) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateIpamByoasn) 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.(*DisassociateIpamByoasnInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateIpamByoasn") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateIpamByoasnInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateIpamResourceDiscovery struct { -} - -func (*awsEc2query_serializeOpDisassociateIpamResourceDiscovery) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateIpamResourceDiscovery) 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.(*DisassociateIpamResourceDiscoveryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateIpamResourceDiscovery") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateIpamResourceDiscoveryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateNatGatewayAddress struct { -} - -func (*awsEc2query_serializeOpDisassociateNatGatewayAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateNatGatewayAddress) 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.(*DisassociateNatGatewayAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateNatGatewayAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateNatGatewayAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateRouteServer struct { -} - -func (*awsEc2query_serializeOpDisassociateRouteServer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateRouteServer) 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.(*DisassociateRouteServerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateRouteServer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateRouteServerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateRouteTable struct { -} - -func (*awsEc2query_serializeOpDisassociateRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateRouteTable) 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.(*DisassociateRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateSecurityGroupVpc struct { -} - -func (*awsEc2query_serializeOpDisassociateSecurityGroupVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateSecurityGroupVpc) 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.(*DisassociateSecurityGroupVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateSecurityGroupVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateSecurityGroupVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateSubnetCidrBlock struct { -} - -func (*awsEc2query_serializeOpDisassociateSubnetCidrBlock) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateSubnetCidrBlock) 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.(*DisassociateSubnetCidrBlockInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateSubnetCidrBlock") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateSubnetCidrBlockInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateTransitGatewayMulticastDomain struct { -} - -func (*awsEc2query_serializeOpDisassociateTransitGatewayMulticastDomain) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateTransitGatewayMulticastDomain) 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.(*DisassociateTransitGatewayMulticastDomainInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateTransitGatewayMulticastDomain") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateTransitGatewayMulticastDomainInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateTransitGatewayPolicyTable struct { -} - -func (*awsEc2query_serializeOpDisassociateTransitGatewayPolicyTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateTransitGatewayPolicyTable) 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.(*DisassociateTransitGatewayPolicyTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateTransitGatewayPolicyTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateTransitGatewayPolicyTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateTransitGatewayRouteTable struct { -} - -func (*awsEc2query_serializeOpDisassociateTransitGatewayRouteTable) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateTransitGatewayRouteTable) 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.(*DisassociateTransitGatewayRouteTableInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateTransitGatewayRouteTable") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateTransitGatewayRouteTableInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateTrunkInterface struct { -} - -func (*awsEc2query_serializeOpDisassociateTrunkInterface) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateTrunkInterface) 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.(*DisassociateTrunkInterfaceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateTrunkInterface") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateTrunkInterfaceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpDisassociateVpcCidrBlock struct { -} - -func (*awsEc2query_serializeOpDisassociateVpcCidrBlock) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpDisassociateVpcCidrBlock) 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.(*DisassociateVpcCidrBlockInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DisassociateVpcCidrBlock") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentDisassociateVpcCidrBlockInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableAddressTransfer struct { -} - -func (*awsEc2query_serializeOpEnableAddressTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableAddressTransfer) 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.(*EnableAddressTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableAddressTransfer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableAddressTransferInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableAllowedImagesSettings struct { -} - -func (*awsEc2query_serializeOpEnableAllowedImagesSettings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableAllowedImagesSettings) 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.(*EnableAllowedImagesSettingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableAllowedImagesSettings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableAllowedImagesSettingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableAwsNetworkPerformanceMetricSubscription struct { -} - -func (*awsEc2query_serializeOpEnableAwsNetworkPerformanceMetricSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableAwsNetworkPerformanceMetricSubscription) 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.(*EnableAwsNetworkPerformanceMetricSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableAwsNetworkPerformanceMetricSubscription") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableEbsEncryptionByDefault struct { -} - -func (*awsEc2query_serializeOpEnableEbsEncryptionByDefault) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableEbsEncryptionByDefault) 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.(*EnableEbsEncryptionByDefaultInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableEbsEncryptionByDefault") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableEbsEncryptionByDefaultInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableFastLaunch struct { -} - -func (*awsEc2query_serializeOpEnableFastLaunch) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableFastLaunch) 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.(*EnableFastLaunchInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableFastLaunch") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableFastLaunchInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableFastSnapshotRestores struct { -} - -func (*awsEc2query_serializeOpEnableFastSnapshotRestores) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableFastSnapshotRestores) 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.(*EnableFastSnapshotRestoresInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableFastSnapshotRestores") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableFastSnapshotRestoresInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableImage struct { -} - -func (*awsEc2query_serializeOpEnableImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableImage) 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.(*EnableImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableImageBlockPublicAccess struct { -} - -func (*awsEc2query_serializeOpEnableImageBlockPublicAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableImageBlockPublicAccess) 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.(*EnableImageBlockPublicAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableImageBlockPublicAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableImageBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableImageDeprecation struct { -} - -func (*awsEc2query_serializeOpEnableImageDeprecation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableImageDeprecation) 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.(*EnableImageDeprecationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableImageDeprecation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableImageDeprecationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableImageDeregistrationProtection struct { -} - -func (*awsEc2query_serializeOpEnableImageDeregistrationProtection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableImageDeregistrationProtection) 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.(*EnableImageDeregistrationProtectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableImageDeregistrationProtection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableImageDeregistrationProtectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableIpamOrganizationAdminAccount struct { -} - -func (*awsEc2query_serializeOpEnableIpamOrganizationAdminAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableIpamOrganizationAdminAccount) 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.(*EnableIpamOrganizationAdminAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableIpamOrganizationAdminAccount") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableIpamOrganizationAdminAccountInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableReachabilityAnalyzerOrganizationSharing struct { -} - -func (*awsEc2query_serializeOpEnableReachabilityAnalyzerOrganizationSharing) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableReachabilityAnalyzerOrganizationSharing) 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.(*EnableReachabilityAnalyzerOrganizationSharingInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableReachabilityAnalyzerOrganizationSharing") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableRouteServerPropagation struct { -} - -func (*awsEc2query_serializeOpEnableRouteServerPropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableRouteServerPropagation) 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.(*EnableRouteServerPropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableRouteServerPropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableRouteServerPropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableSerialConsoleAccess struct { -} - -func (*awsEc2query_serializeOpEnableSerialConsoleAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableSerialConsoleAccess) 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.(*EnableSerialConsoleAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableSerialConsoleAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableSerialConsoleAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableSnapshotBlockPublicAccess struct { -} - -func (*awsEc2query_serializeOpEnableSnapshotBlockPublicAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableSnapshotBlockPublicAccess) 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.(*EnableSnapshotBlockPublicAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableSnapshotBlockPublicAccess") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableSnapshotBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation struct { -} - -func (*awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation) 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.(*EnableTransitGatewayRouteTablePropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableTransitGatewayRouteTablePropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableTransitGatewayRouteTablePropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableVgwRoutePropagation struct { -} - -func (*awsEc2query_serializeOpEnableVgwRoutePropagation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableVgwRoutePropagation) 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.(*EnableVgwRoutePropagationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableVgwRoutePropagation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableVgwRoutePropagationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableVolumeIO struct { -} - -func (*awsEc2query_serializeOpEnableVolumeIO) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableVolumeIO) 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.(*EnableVolumeIOInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableVolumeIO") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableVolumeIOInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableVpcClassicLink struct { -} - -func (*awsEc2query_serializeOpEnableVpcClassicLink) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableVpcClassicLink) 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.(*EnableVpcClassicLinkInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableVpcClassicLink") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableVpcClassicLinkInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpEnableVpcClassicLinkDnsSupport struct { -} - -func (*awsEc2query_serializeOpEnableVpcClassicLinkDnsSupport) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpEnableVpcClassicLinkDnsSupport) 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.(*EnableVpcClassicLinkDnsSupportInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("EnableVpcClassicLinkDnsSupport") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentEnableVpcClassicLinkDnsSupportInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpExportClientVpnClientCertificateRevocationList struct { -} - -func (*awsEc2query_serializeOpExportClientVpnClientCertificateRevocationList) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpExportClientVpnClientCertificateRevocationList) 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.(*ExportClientVpnClientCertificateRevocationListInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ExportClientVpnClientCertificateRevocationList") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentExportClientVpnClientCertificateRevocationListInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpExportClientVpnClientConfiguration struct { -} - -func (*awsEc2query_serializeOpExportClientVpnClientConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpExportClientVpnClientConfiguration) 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.(*ExportClientVpnClientConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ExportClientVpnClientConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentExportClientVpnClientConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpExportImage struct { -} - -func (*awsEc2query_serializeOpExportImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpExportImage) 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.(*ExportImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ExportImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentExportImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpExportTransitGatewayRoutes struct { -} - -func (*awsEc2query_serializeOpExportTransitGatewayRoutes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpExportTransitGatewayRoutes) 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.(*ExportTransitGatewayRoutesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ExportTransitGatewayRoutes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentExportTransitGatewayRoutesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpExportVerifiedAccessInstanceClientConfiguration struct { -} - -func (*awsEc2query_serializeOpExportVerifiedAccessInstanceClientConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpExportVerifiedAccessInstanceClientConfiguration) 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.(*ExportVerifiedAccessInstanceClientConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ExportVerifiedAccessInstanceClientConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentExportVerifiedAccessInstanceClientConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetActiveVpnTunnelStatus struct { -} - -func (*awsEc2query_serializeOpGetActiveVpnTunnelStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetActiveVpnTunnelStatus) 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.(*GetActiveVpnTunnelStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetActiveVpnTunnelStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetActiveVpnTunnelStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetAllowedImagesSettings struct { -} - -func (*awsEc2query_serializeOpGetAllowedImagesSettings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetAllowedImagesSettings) 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.(*GetAllowedImagesSettingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetAllowedImagesSettings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetAllowedImagesSettingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetAssociatedEnclaveCertificateIamRoles struct { -} - -func (*awsEc2query_serializeOpGetAssociatedEnclaveCertificateIamRoles) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetAssociatedEnclaveCertificateIamRoles) 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.(*GetAssociatedEnclaveCertificateIamRolesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetAssociatedEnclaveCertificateIamRoles") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetAssociatedEnclaveCertificateIamRolesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetAssociatedIpv6PoolCidrs struct { -} - -func (*awsEc2query_serializeOpGetAssociatedIpv6PoolCidrs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetAssociatedIpv6PoolCidrs) 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.(*GetAssociatedIpv6PoolCidrsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetAssociatedIpv6PoolCidrs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetAssociatedIpv6PoolCidrsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetAwsNetworkPerformanceData struct { -} - -func (*awsEc2query_serializeOpGetAwsNetworkPerformanceData) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetAwsNetworkPerformanceData) 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.(*GetAwsNetworkPerformanceDataInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetAwsNetworkPerformanceData") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetAwsNetworkPerformanceDataInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetCapacityReservationUsage struct { -} - -func (*awsEc2query_serializeOpGetCapacityReservationUsage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetCapacityReservationUsage) 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.(*GetCapacityReservationUsageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetCapacityReservationUsage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetCapacityReservationUsageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetCoipPoolUsage struct { -} - -func (*awsEc2query_serializeOpGetCoipPoolUsage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetCoipPoolUsage) 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.(*GetCoipPoolUsageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetCoipPoolUsage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetCoipPoolUsageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetConsoleOutput struct { -} - -func (*awsEc2query_serializeOpGetConsoleOutput) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetConsoleOutput) 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.(*GetConsoleOutputInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetConsoleOutput") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetConsoleOutputInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetConsoleScreenshot struct { -} - -func (*awsEc2query_serializeOpGetConsoleScreenshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetConsoleScreenshot) 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.(*GetConsoleScreenshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetConsoleScreenshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetConsoleScreenshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetDeclarativePoliciesReportSummary struct { -} - -func (*awsEc2query_serializeOpGetDeclarativePoliciesReportSummary) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetDeclarativePoliciesReportSummary) 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.(*GetDeclarativePoliciesReportSummaryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetDeclarativePoliciesReportSummary") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetDeclarativePoliciesReportSummaryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetDefaultCreditSpecification struct { -} - -func (*awsEc2query_serializeOpGetDefaultCreditSpecification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetDefaultCreditSpecification) 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.(*GetDefaultCreditSpecificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetDefaultCreditSpecification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetDefaultCreditSpecificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_serializeOpGetEbsDefaultKmsKeyId) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetEbsDefaultKmsKeyId) 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.(*GetEbsDefaultKmsKeyIdInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetEbsDefaultKmsKeyId") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetEbsDefaultKmsKeyIdInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetEbsEncryptionByDefault struct { -} - -func (*awsEc2query_serializeOpGetEbsEncryptionByDefault) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetEbsEncryptionByDefault) 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.(*GetEbsEncryptionByDefaultInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetEbsEncryptionByDefault") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetEbsEncryptionByDefaultInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetFlowLogsIntegrationTemplate struct { -} - -func (*awsEc2query_serializeOpGetFlowLogsIntegrationTemplate) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetFlowLogsIntegrationTemplate) 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.(*GetFlowLogsIntegrationTemplateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetFlowLogsIntegrationTemplate") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetFlowLogsIntegrationTemplateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetGroupsForCapacityReservation struct { -} - -func (*awsEc2query_serializeOpGetGroupsForCapacityReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetGroupsForCapacityReservation) 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.(*GetGroupsForCapacityReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetGroupsForCapacityReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetGroupsForCapacityReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetHostReservationPurchasePreview struct { -} - -func (*awsEc2query_serializeOpGetHostReservationPurchasePreview) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetHostReservationPurchasePreview) 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.(*GetHostReservationPurchasePreviewInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetHostReservationPurchasePreview") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetHostReservationPurchasePreviewInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetImageBlockPublicAccessState struct { -} - -func (*awsEc2query_serializeOpGetImageBlockPublicAccessState) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetImageBlockPublicAccessState) 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.(*GetImageBlockPublicAccessStateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetImageBlockPublicAccessState") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetImageBlockPublicAccessStateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetInstanceMetadataDefaults struct { -} - -func (*awsEc2query_serializeOpGetInstanceMetadataDefaults) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetInstanceMetadataDefaults) 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.(*GetInstanceMetadataDefaultsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetInstanceMetadataDefaults") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetInstanceMetadataDefaultsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetInstanceTpmEkPub struct { -} - -func (*awsEc2query_serializeOpGetInstanceTpmEkPub) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetInstanceTpmEkPub) 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.(*GetInstanceTpmEkPubInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetInstanceTpmEkPub") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetInstanceTpmEkPubInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetInstanceTypesFromInstanceRequirements struct { -} - -func (*awsEc2query_serializeOpGetInstanceTypesFromInstanceRequirements) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetInstanceTypesFromInstanceRequirements) 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.(*GetInstanceTypesFromInstanceRequirementsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetInstanceTypesFromInstanceRequirements") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetInstanceTypesFromInstanceRequirementsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetInstanceUefiData struct { -} - -func (*awsEc2query_serializeOpGetInstanceUefiData) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetInstanceUefiData) 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.(*GetInstanceUefiDataInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetInstanceUefiData") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetInstanceUefiDataInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamAddressHistory struct { -} - -func (*awsEc2query_serializeOpGetIpamAddressHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamAddressHistory) 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.(*GetIpamAddressHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamAddressHistory") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamAddressHistoryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamDiscoveredAccounts struct { -} - -func (*awsEc2query_serializeOpGetIpamDiscoveredAccounts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamDiscoveredAccounts) 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.(*GetIpamDiscoveredAccountsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamDiscoveredAccounts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredAccountsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses struct { -} - -func (*awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses) 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.(*GetIpamDiscoveredPublicAddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamDiscoveredPublicAddresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredPublicAddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs struct { -} - -func (*awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) 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.(*GetIpamDiscoveredResourceCidrsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamDiscoveredResourceCidrs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredResourceCidrsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamPoolAllocations struct { -} - -func (*awsEc2query_serializeOpGetIpamPoolAllocations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamPoolAllocations) 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.(*GetIpamPoolAllocationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamPoolAllocations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamPoolAllocationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamPoolCidrs struct { -} - -func (*awsEc2query_serializeOpGetIpamPoolCidrs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamPoolCidrs) 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.(*GetIpamPoolCidrsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamPoolCidrs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamPoolCidrsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetIpamResourceCidrs struct { -} - -func (*awsEc2query_serializeOpGetIpamResourceCidrs) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetIpamResourceCidrs) 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.(*GetIpamResourceCidrsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetIpamResourceCidrs") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetIpamResourceCidrsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetLaunchTemplateData struct { -} - -func (*awsEc2query_serializeOpGetLaunchTemplateData) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetLaunchTemplateData) 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.(*GetLaunchTemplateDataInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetLaunchTemplateData") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetLaunchTemplateDataInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetManagedPrefixListAssociations struct { -} - -func (*awsEc2query_serializeOpGetManagedPrefixListAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetManagedPrefixListAssociations) 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.(*GetManagedPrefixListAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetManagedPrefixListAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetManagedPrefixListAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetManagedPrefixListEntries struct { -} - -func (*awsEc2query_serializeOpGetManagedPrefixListEntries) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetManagedPrefixListEntries) 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.(*GetManagedPrefixListEntriesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetManagedPrefixListEntries") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetManagedPrefixListEntriesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetNetworkInsightsAccessScopeAnalysisFindings struct { -} - -func (*awsEc2query_serializeOpGetNetworkInsightsAccessScopeAnalysisFindings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetNetworkInsightsAccessScopeAnalysisFindings) 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.(*GetNetworkInsightsAccessScopeAnalysisFindingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetNetworkInsightsAccessScopeAnalysisFindings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetNetworkInsightsAccessScopeContent struct { -} - -func (*awsEc2query_serializeOpGetNetworkInsightsAccessScopeContent) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetNetworkInsightsAccessScopeContent) 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.(*GetNetworkInsightsAccessScopeContentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetNetworkInsightsAccessScopeContent") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetNetworkInsightsAccessScopeContentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetPasswordData struct { -} - -func (*awsEc2query_serializeOpGetPasswordData) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetPasswordData) 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.(*GetPasswordDataInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetPasswordData") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetPasswordDataInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetReservedInstancesExchangeQuote struct { -} - -func (*awsEc2query_serializeOpGetReservedInstancesExchangeQuote) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetReservedInstancesExchangeQuote) 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.(*GetReservedInstancesExchangeQuoteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetReservedInstancesExchangeQuote") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetReservedInstancesExchangeQuoteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetRouteServerAssociations struct { -} - -func (*awsEc2query_serializeOpGetRouteServerAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetRouteServerAssociations) 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.(*GetRouteServerAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetRouteServerAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetRouteServerAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetRouteServerPropagations struct { -} - -func (*awsEc2query_serializeOpGetRouteServerPropagations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetRouteServerPropagations) 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.(*GetRouteServerPropagationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetRouteServerPropagations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetRouteServerPropagationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetRouteServerRoutingDatabase struct { -} - -func (*awsEc2query_serializeOpGetRouteServerRoutingDatabase) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetRouteServerRoutingDatabase) 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.(*GetRouteServerRoutingDatabaseInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetRouteServerRoutingDatabase") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetRouteServerRoutingDatabaseInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetSecurityGroupsForVpc struct { -} - -func (*awsEc2query_serializeOpGetSecurityGroupsForVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetSecurityGroupsForVpc) 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.(*GetSecurityGroupsForVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSecurityGroupsForVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetSecurityGroupsForVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetSerialConsoleAccessStatus struct { -} - -func (*awsEc2query_serializeOpGetSerialConsoleAccessStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetSerialConsoleAccessStatus) 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.(*GetSerialConsoleAccessStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSerialConsoleAccessStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetSerialConsoleAccessStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetSnapshotBlockPublicAccessState struct { -} - -func (*awsEc2query_serializeOpGetSnapshotBlockPublicAccessState) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetSnapshotBlockPublicAccessState) 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.(*GetSnapshotBlockPublicAccessStateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSnapshotBlockPublicAccessState") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetSnapshotBlockPublicAccessStateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetSpotPlacementScores struct { -} - -func (*awsEc2query_serializeOpGetSpotPlacementScores) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetSpotPlacementScores) 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.(*GetSpotPlacementScoresInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSpotPlacementScores") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetSpotPlacementScoresInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetSubnetCidrReservations struct { -} - -func (*awsEc2query_serializeOpGetSubnetCidrReservations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetSubnetCidrReservations) 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.(*GetSubnetCidrReservationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSubnetCidrReservations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetSubnetCidrReservationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayAttachmentPropagations struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayAttachmentPropagations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayAttachmentPropagations) 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.(*GetTransitGatewayAttachmentPropagationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayAttachmentPropagations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayAttachmentPropagationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayMulticastDomainAssociations) 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.(*GetTransitGatewayMulticastDomainAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayMulticastDomainAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayMulticastDomainAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayPolicyTableAssociations struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayPolicyTableAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayPolicyTableAssociations) 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.(*GetTransitGatewayPolicyTableAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayPolicyTableAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayPolicyTableAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayPolicyTableEntries struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayPolicyTableEntries) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayPolicyTableEntries) 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.(*GetTransitGatewayPolicyTableEntriesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayPolicyTableEntries") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayPolicyTableEntriesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayPrefixListReferences struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayPrefixListReferences) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayPrefixListReferences) 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.(*GetTransitGatewayPrefixListReferencesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayPrefixListReferences") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayPrefixListReferencesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayRouteTableAssociations struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayRouteTableAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayRouteTableAssociations) 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.(*GetTransitGatewayRouteTableAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayRouteTableAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayRouteTableAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetTransitGatewayRouteTablePropagations struct { -} - -func (*awsEc2query_serializeOpGetTransitGatewayRouteTablePropagations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetTransitGatewayRouteTablePropagations) 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.(*GetTransitGatewayRouteTablePropagationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetTransitGatewayRouteTablePropagations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetTransitGatewayRouteTablePropagationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVerifiedAccessEndpointPolicy struct { -} - -func (*awsEc2query_serializeOpGetVerifiedAccessEndpointPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVerifiedAccessEndpointPolicy) 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.(*GetVerifiedAccessEndpointPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVerifiedAccessEndpointPolicy") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVerifiedAccessEndpointPolicyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVerifiedAccessEndpointTargets struct { -} - -func (*awsEc2query_serializeOpGetVerifiedAccessEndpointTargets) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVerifiedAccessEndpointTargets) 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.(*GetVerifiedAccessEndpointTargetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVerifiedAccessEndpointTargets") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVerifiedAccessEndpointTargetsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVerifiedAccessGroupPolicy struct { -} - -func (*awsEc2query_serializeOpGetVerifiedAccessGroupPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVerifiedAccessGroupPolicy) 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.(*GetVerifiedAccessGroupPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVerifiedAccessGroupPolicy") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVerifiedAccessGroupPolicyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVpnConnectionDeviceSampleConfiguration struct { -} - -func (*awsEc2query_serializeOpGetVpnConnectionDeviceSampleConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVpnConnectionDeviceSampleConfiguration) 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.(*GetVpnConnectionDeviceSampleConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVpnConnectionDeviceSampleConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVpnConnectionDeviceSampleConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVpnConnectionDeviceTypes struct { -} - -func (*awsEc2query_serializeOpGetVpnConnectionDeviceTypes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVpnConnectionDeviceTypes) 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.(*GetVpnConnectionDeviceTypesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVpnConnectionDeviceTypes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVpnConnectionDeviceTypesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpGetVpnTunnelReplacementStatus struct { -} - -func (*awsEc2query_serializeOpGetVpnTunnelReplacementStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpGetVpnTunnelReplacementStatus) 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.(*GetVpnTunnelReplacementStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetVpnTunnelReplacementStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentGetVpnTunnelReplacementStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportClientVpnClientCertificateRevocationList struct { -} - -func (*awsEc2query_serializeOpImportClientVpnClientCertificateRevocationList) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportClientVpnClientCertificateRevocationList) 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.(*ImportClientVpnClientCertificateRevocationListInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportClientVpnClientCertificateRevocationList") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportClientVpnClientCertificateRevocationListInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportImage struct { -} - -func (*awsEc2query_serializeOpImportImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportImage) 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.(*ImportImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportInstance struct { -} - -func (*awsEc2query_serializeOpImportInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportInstance) 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.(*ImportInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportKeyPair struct { -} - -func (*awsEc2query_serializeOpImportKeyPair) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportKeyPair) 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.(*ImportKeyPairInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportKeyPair") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportKeyPairInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportSnapshot struct { -} - -func (*awsEc2query_serializeOpImportSnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportSnapshot) 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.(*ImportSnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportSnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportSnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpImportVolume struct { -} - -func (*awsEc2query_serializeOpImportVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpImportVolume) 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.(*ImportVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ImportVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentImportVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpListImagesInRecycleBin struct { -} - -func (*awsEc2query_serializeOpListImagesInRecycleBin) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpListImagesInRecycleBin) 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.(*ListImagesInRecycleBinInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListImagesInRecycleBin") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentListImagesInRecycleBinInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpListSnapshotsInRecycleBin struct { -} - -func (*awsEc2query_serializeOpListSnapshotsInRecycleBin) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpListSnapshotsInRecycleBin) 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.(*ListSnapshotsInRecycleBinInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListSnapshotsInRecycleBin") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentListSnapshotsInRecycleBinInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpLockSnapshot struct { -} - -func (*awsEc2query_serializeOpLockSnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpLockSnapshot) 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.(*LockSnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("LockSnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentLockSnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyAddressAttribute struct { -} - -func (*awsEc2query_serializeOpModifyAddressAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyAddressAttribute) 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.(*ModifyAddressAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyAddressAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyAddressAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyAvailabilityZoneGroup struct { -} - -func (*awsEc2query_serializeOpModifyAvailabilityZoneGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyAvailabilityZoneGroup) 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.(*ModifyAvailabilityZoneGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyAvailabilityZoneGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyAvailabilityZoneGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyCapacityReservation struct { -} - -func (*awsEc2query_serializeOpModifyCapacityReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyCapacityReservation) 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.(*ModifyCapacityReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyCapacityReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyCapacityReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyCapacityReservationFleet struct { -} - -func (*awsEc2query_serializeOpModifyCapacityReservationFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyCapacityReservationFleet) 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.(*ModifyCapacityReservationFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyCapacityReservationFleet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyCapacityReservationFleetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyClientVpnEndpoint struct { -} - -func (*awsEc2query_serializeOpModifyClientVpnEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyClientVpnEndpoint) 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.(*ModifyClientVpnEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyClientVpnEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyClientVpnEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyDefaultCreditSpecification struct { -} - -func (*awsEc2query_serializeOpModifyDefaultCreditSpecification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyDefaultCreditSpecification) 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.(*ModifyDefaultCreditSpecificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyDefaultCreditSpecification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyDefaultCreditSpecificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_serializeOpModifyEbsDefaultKmsKeyId) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyEbsDefaultKmsKeyId) 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.(*ModifyEbsDefaultKmsKeyIdInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyEbsDefaultKmsKeyId") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyEbsDefaultKmsKeyIdInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyFleet struct { -} - -func (*awsEc2query_serializeOpModifyFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyFleet) 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.(*ModifyFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyFleet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyFleetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyFpgaImageAttribute struct { -} - -func (*awsEc2query_serializeOpModifyFpgaImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyFpgaImageAttribute) 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.(*ModifyFpgaImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyFpgaImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyFpgaImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyHosts struct { -} - -func (*awsEc2query_serializeOpModifyHosts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyHosts) 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.(*ModifyHostsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyHosts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyHostsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIdentityIdFormat struct { -} - -func (*awsEc2query_serializeOpModifyIdentityIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIdentityIdFormat) 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.(*ModifyIdentityIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIdentityIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIdentityIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIdFormat struct { -} - -func (*awsEc2query_serializeOpModifyIdFormat) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIdFormat) 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.(*ModifyIdFormatInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIdFormat") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIdFormatInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyImageAttribute struct { -} - -func (*awsEc2query_serializeOpModifyImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyImageAttribute) 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.(*ModifyImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceAttribute struct { -} - -func (*awsEc2query_serializeOpModifyInstanceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceAttribute) 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.(*ModifyInstanceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceCapacityReservationAttributes struct { -} - -func (*awsEc2query_serializeOpModifyInstanceCapacityReservationAttributes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceCapacityReservationAttributes) 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.(*ModifyInstanceCapacityReservationAttributesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceCapacityReservationAttributes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceCapacityReservationAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceCpuOptions struct { -} - -func (*awsEc2query_serializeOpModifyInstanceCpuOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceCpuOptions) 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.(*ModifyInstanceCpuOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceCpuOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceCpuOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceCreditSpecification struct { -} - -func (*awsEc2query_serializeOpModifyInstanceCreditSpecification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceCreditSpecification) 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.(*ModifyInstanceCreditSpecificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceCreditSpecification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceCreditSpecificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceEventStartTime struct { -} - -func (*awsEc2query_serializeOpModifyInstanceEventStartTime) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceEventStartTime) 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.(*ModifyInstanceEventStartTimeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceEventStartTime") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceEventStartTimeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceEventWindow struct { -} - -func (*awsEc2query_serializeOpModifyInstanceEventWindow) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceEventWindow) 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.(*ModifyInstanceEventWindowInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceEventWindow") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceEventWindowInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceMaintenanceOptions struct { -} - -func (*awsEc2query_serializeOpModifyInstanceMaintenanceOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceMaintenanceOptions) 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.(*ModifyInstanceMaintenanceOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceMaintenanceOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceMaintenanceOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceMetadataDefaults struct { -} - -func (*awsEc2query_serializeOpModifyInstanceMetadataDefaults) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceMetadataDefaults) 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.(*ModifyInstanceMetadataDefaultsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceMetadataDefaults") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceMetadataDefaultsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceMetadataOptions struct { -} - -func (*awsEc2query_serializeOpModifyInstanceMetadataOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceMetadataOptions) 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.(*ModifyInstanceMetadataOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceMetadataOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceMetadataOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstanceNetworkPerformanceOptions struct { -} - -func (*awsEc2query_serializeOpModifyInstanceNetworkPerformanceOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstanceNetworkPerformanceOptions) 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.(*ModifyInstanceNetworkPerformanceOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstanceNetworkPerformanceOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstanceNetworkPerformanceOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyInstancePlacement struct { -} - -func (*awsEc2query_serializeOpModifyInstancePlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyInstancePlacement) 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.(*ModifyInstancePlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyInstancePlacement") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyInstancePlacementInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIpam struct { -} - -func (*awsEc2query_serializeOpModifyIpam) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIpam) 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.(*ModifyIpamInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIpam") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIpamInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIpamPool struct { -} - -func (*awsEc2query_serializeOpModifyIpamPool) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIpamPool) 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.(*ModifyIpamPoolInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIpamPool") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIpamPoolInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIpamResourceCidr struct { -} - -func (*awsEc2query_serializeOpModifyIpamResourceCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIpamResourceCidr) 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.(*ModifyIpamResourceCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIpamResourceCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIpamResourceCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIpamResourceDiscovery struct { -} - -func (*awsEc2query_serializeOpModifyIpamResourceDiscovery) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIpamResourceDiscovery) 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.(*ModifyIpamResourceDiscoveryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIpamResourceDiscovery") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIpamResourceDiscoveryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyIpamScope struct { -} - -func (*awsEc2query_serializeOpModifyIpamScope) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyIpamScope) 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.(*ModifyIpamScopeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyIpamScope") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyIpamScopeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyLaunchTemplate struct { -} - -func (*awsEc2query_serializeOpModifyLaunchTemplate) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyLaunchTemplate) 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.(*ModifyLaunchTemplateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyLaunchTemplate") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyLaunchTemplateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyLocalGatewayRoute struct { -} - -func (*awsEc2query_serializeOpModifyLocalGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyLocalGatewayRoute) 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.(*ModifyLocalGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyLocalGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyLocalGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyManagedPrefixList struct { -} - -func (*awsEc2query_serializeOpModifyManagedPrefixList) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyManagedPrefixList) 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.(*ModifyManagedPrefixListInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyManagedPrefixList") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyManagedPrefixListInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_serializeOpModifyNetworkInterfaceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyNetworkInterfaceAttribute) 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.(*ModifyNetworkInterfaceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyNetworkInterfaceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyNetworkInterfaceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyPrivateDnsNameOptions struct { -} - -func (*awsEc2query_serializeOpModifyPrivateDnsNameOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyPrivateDnsNameOptions) 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.(*ModifyPrivateDnsNameOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyPrivateDnsNameOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyPrivateDnsNameOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyPublicIpDnsNameOptions struct { -} - -func (*awsEc2query_serializeOpModifyPublicIpDnsNameOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyPublicIpDnsNameOptions) 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.(*ModifyPublicIpDnsNameOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyPublicIpDnsNameOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyPublicIpDnsNameOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyReservedInstances struct { -} - -func (*awsEc2query_serializeOpModifyReservedInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyReservedInstances) 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.(*ModifyReservedInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyReservedInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyReservedInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyRouteServer struct { -} - -func (*awsEc2query_serializeOpModifyRouteServer) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyRouteServer) 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.(*ModifyRouteServerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyRouteServer") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyRouteServerInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifySecurityGroupRules struct { -} - -func (*awsEc2query_serializeOpModifySecurityGroupRules) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifySecurityGroupRules) 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.(*ModifySecurityGroupRulesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifySecurityGroupRules") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifySecurityGroupRulesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifySnapshotAttribute struct { -} - -func (*awsEc2query_serializeOpModifySnapshotAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifySnapshotAttribute) 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.(*ModifySnapshotAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifySnapshotAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifySnapshotAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifySnapshotTier struct { -} - -func (*awsEc2query_serializeOpModifySnapshotTier) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifySnapshotTier) 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.(*ModifySnapshotTierInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifySnapshotTier") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifySnapshotTierInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifySpotFleetRequest struct { -} - -func (*awsEc2query_serializeOpModifySpotFleetRequest) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifySpotFleetRequest) 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.(*ModifySpotFleetRequestInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifySpotFleetRequest") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifySpotFleetRequestInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifySubnetAttribute struct { -} - -func (*awsEc2query_serializeOpModifySubnetAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifySubnetAttribute) 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.(*ModifySubnetAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifySubnetAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifySubnetAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTrafficMirrorFilterNetworkServices struct { -} - -func (*awsEc2query_serializeOpModifyTrafficMirrorFilterNetworkServices) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTrafficMirrorFilterNetworkServices) 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.(*ModifyTrafficMirrorFilterNetworkServicesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTrafficMirrorFilterNetworkServices") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTrafficMirrorFilterNetworkServicesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTrafficMirrorFilterRule struct { -} - -func (*awsEc2query_serializeOpModifyTrafficMirrorFilterRule) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTrafficMirrorFilterRule) 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.(*ModifyTrafficMirrorFilterRuleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTrafficMirrorFilterRule") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTrafficMirrorFilterRuleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTrafficMirrorSession struct { -} - -func (*awsEc2query_serializeOpModifyTrafficMirrorSession) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTrafficMirrorSession) 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.(*ModifyTrafficMirrorSessionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTrafficMirrorSession") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTrafficMirrorSessionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTransitGateway struct { -} - -func (*awsEc2query_serializeOpModifyTransitGateway) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTransitGateway) 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.(*ModifyTransitGatewayInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTransitGateway") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTransitGatewayInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTransitGatewayPrefixListReference struct { -} - -func (*awsEc2query_serializeOpModifyTransitGatewayPrefixListReference) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTransitGatewayPrefixListReference) 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.(*ModifyTransitGatewayPrefixListReferenceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTransitGatewayPrefixListReference") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTransitGatewayPrefixListReferenceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_serializeOpModifyTransitGatewayVpcAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyTransitGatewayVpcAttachment) 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.(*ModifyTransitGatewayVpcAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyTransitGatewayVpcAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyTransitGatewayVpcAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessEndpoint struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessEndpoint) 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.(*ModifyVerifiedAccessEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessEndpointPolicy struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessEndpointPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessEndpointPolicy) 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.(*ModifyVerifiedAccessEndpointPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessEndpointPolicy") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessEndpointPolicyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessGroup struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessGroup) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessGroup) 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.(*ModifyVerifiedAccessGroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessGroup") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessGroupInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessGroupPolicy struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessGroupPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessGroupPolicy) 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.(*ModifyVerifiedAccessGroupPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessGroupPolicy") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessGroupPolicyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessInstance struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessInstance) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessInstance) 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.(*ModifyVerifiedAccessInstanceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessInstance") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessInstanceInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessInstanceLoggingConfiguration struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessInstanceLoggingConfiguration) 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.(*ModifyVerifiedAccessInstanceLoggingConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessInstanceLoggingConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVerifiedAccessTrustProvider struct { -} - -func (*awsEc2query_serializeOpModifyVerifiedAccessTrustProvider) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVerifiedAccessTrustProvider) 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.(*ModifyVerifiedAccessTrustProviderInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVerifiedAccessTrustProvider") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVerifiedAccessTrustProviderInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVolume struct { -} - -func (*awsEc2query_serializeOpModifyVolume) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVolume) 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.(*ModifyVolumeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVolume") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVolumeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVolumeAttribute struct { -} - -func (*awsEc2query_serializeOpModifyVolumeAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVolumeAttribute) 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.(*ModifyVolumeAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVolumeAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVolumeAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcAttribute struct { -} - -func (*awsEc2query_serializeOpModifyVpcAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcAttribute) 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.(*ModifyVpcAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcBlockPublicAccessExclusion struct { -} - -func (*awsEc2query_serializeOpModifyVpcBlockPublicAccessExclusion) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcBlockPublicAccessExclusion) 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.(*ModifyVpcBlockPublicAccessExclusionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcBlockPublicAccessExclusion") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcBlockPublicAccessExclusionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcBlockPublicAccessOptions struct { -} - -func (*awsEc2query_serializeOpModifyVpcBlockPublicAccessOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcBlockPublicAccessOptions) 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.(*ModifyVpcBlockPublicAccessOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcBlockPublicAccessOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcBlockPublicAccessOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcEndpoint struct { -} - -func (*awsEc2query_serializeOpModifyVpcEndpoint) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcEndpoint) 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.(*ModifyVpcEndpointInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcEndpoint") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcEndpointInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcEndpointConnectionNotification struct { -} - -func (*awsEc2query_serializeOpModifyVpcEndpointConnectionNotification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcEndpointConnectionNotification) 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.(*ModifyVpcEndpointConnectionNotificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcEndpointConnectionNotification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcEndpointConnectionNotificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcEndpointServiceConfiguration struct { -} - -func (*awsEc2query_serializeOpModifyVpcEndpointServiceConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcEndpointServiceConfiguration) 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.(*ModifyVpcEndpointServiceConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcEndpointServiceConfiguration") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcEndpointServiceConfigurationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcEndpointServicePayerResponsibility struct { -} - -func (*awsEc2query_serializeOpModifyVpcEndpointServicePayerResponsibility) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcEndpointServicePayerResponsibility) 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.(*ModifyVpcEndpointServicePayerResponsibilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcEndpointServicePayerResponsibility") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcEndpointServicePayerResponsibilityInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcEndpointServicePermissions struct { -} - -func (*awsEc2query_serializeOpModifyVpcEndpointServicePermissions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcEndpointServicePermissions) 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.(*ModifyVpcEndpointServicePermissionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcEndpointServicePermissions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcEndpointServicePermissionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcPeeringConnectionOptions struct { -} - -func (*awsEc2query_serializeOpModifyVpcPeeringConnectionOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcPeeringConnectionOptions) 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.(*ModifyVpcPeeringConnectionOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcPeeringConnectionOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcPeeringConnectionOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpcTenancy struct { -} - -func (*awsEc2query_serializeOpModifyVpcTenancy) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpcTenancy) 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.(*ModifyVpcTenancyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpcTenancy") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpcTenancyInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpnConnection struct { -} - -func (*awsEc2query_serializeOpModifyVpnConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpnConnection) 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.(*ModifyVpnConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpnConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpnConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpnConnectionOptions struct { -} - -func (*awsEc2query_serializeOpModifyVpnConnectionOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpnConnectionOptions) 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.(*ModifyVpnConnectionOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpnConnectionOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpnConnectionOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpnTunnelCertificate struct { -} - -func (*awsEc2query_serializeOpModifyVpnTunnelCertificate) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpnTunnelCertificate) 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.(*ModifyVpnTunnelCertificateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpnTunnelCertificate") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpnTunnelCertificateInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpModifyVpnTunnelOptions struct { -} - -func (*awsEc2query_serializeOpModifyVpnTunnelOptions) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpModifyVpnTunnelOptions) 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.(*ModifyVpnTunnelOptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ModifyVpnTunnelOptions") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentModifyVpnTunnelOptionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpMonitorInstances struct { -} - -func (*awsEc2query_serializeOpMonitorInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpMonitorInstances) 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.(*MonitorInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("MonitorInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentMonitorInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpMoveAddressToVpc struct { -} - -func (*awsEc2query_serializeOpMoveAddressToVpc) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpMoveAddressToVpc) 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.(*MoveAddressToVpcInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("MoveAddressToVpc") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentMoveAddressToVpcInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpMoveByoipCidrToIpam struct { -} - -func (*awsEc2query_serializeOpMoveByoipCidrToIpam) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpMoveByoipCidrToIpam) 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.(*MoveByoipCidrToIpamInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("MoveByoipCidrToIpam") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentMoveByoipCidrToIpamInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpMoveCapacityReservationInstances struct { -} - -func (*awsEc2query_serializeOpMoveCapacityReservationInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpMoveCapacityReservationInstances) 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.(*MoveCapacityReservationInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("MoveCapacityReservationInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentMoveCapacityReservationInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpProvisionByoipCidr struct { -} - -func (*awsEc2query_serializeOpProvisionByoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpProvisionByoipCidr) 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.(*ProvisionByoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ProvisionByoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentProvisionByoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpProvisionIpamByoasn struct { -} - -func (*awsEc2query_serializeOpProvisionIpamByoasn) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpProvisionIpamByoasn) 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.(*ProvisionIpamByoasnInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ProvisionIpamByoasn") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentProvisionIpamByoasnInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpProvisionIpamPoolCidr struct { -} - -func (*awsEc2query_serializeOpProvisionIpamPoolCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpProvisionIpamPoolCidr) 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.(*ProvisionIpamPoolCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ProvisionIpamPoolCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentProvisionIpamPoolCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpProvisionPublicIpv4PoolCidr struct { -} - -func (*awsEc2query_serializeOpProvisionPublicIpv4PoolCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpProvisionPublicIpv4PoolCidr) 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.(*ProvisionPublicIpv4PoolCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ProvisionPublicIpv4PoolCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentProvisionPublicIpv4PoolCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpPurchaseCapacityBlock struct { -} - -func (*awsEc2query_serializeOpPurchaseCapacityBlock) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpPurchaseCapacityBlock) 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.(*PurchaseCapacityBlockInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurchaseCapacityBlock") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentPurchaseCapacityBlockInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpPurchaseCapacityBlockExtension struct { -} - -func (*awsEc2query_serializeOpPurchaseCapacityBlockExtension) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpPurchaseCapacityBlockExtension) 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.(*PurchaseCapacityBlockExtensionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurchaseCapacityBlockExtension") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentPurchaseCapacityBlockExtensionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpPurchaseHostReservation struct { -} - -func (*awsEc2query_serializeOpPurchaseHostReservation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpPurchaseHostReservation) 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.(*PurchaseHostReservationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurchaseHostReservation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentPurchaseHostReservationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpPurchaseReservedInstancesOffering struct { -} - -func (*awsEc2query_serializeOpPurchaseReservedInstancesOffering) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpPurchaseReservedInstancesOffering) 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.(*PurchaseReservedInstancesOfferingInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurchaseReservedInstancesOffering") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentPurchaseReservedInstancesOfferingInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpPurchaseScheduledInstances struct { -} - -func (*awsEc2query_serializeOpPurchaseScheduledInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpPurchaseScheduledInstances) 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.(*PurchaseScheduledInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurchaseScheduledInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentPurchaseScheduledInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRebootInstances struct { -} - -func (*awsEc2query_serializeOpRebootInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRebootInstances) 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.(*RebootInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RebootInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRebootInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRegisterImage struct { -} - -func (*awsEc2query_serializeOpRegisterImage) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRegisterImage) 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.(*RegisterImageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RegisterImage") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRegisterImageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRegisterInstanceEventNotificationAttributes struct { -} - -func (*awsEc2query_serializeOpRegisterInstanceEventNotificationAttributes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRegisterInstanceEventNotificationAttributes) 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.(*RegisterInstanceEventNotificationAttributesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RegisterInstanceEventNotificationAttributes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRegisterInstanceEventNotificationAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupMembers struct { -} - -func (*awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupMembers) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupMembers) 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.(*RegisterTransitGatewayMulticastGroupMembersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RegisterTransitGatewayMulticastGroupMembers") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRegisterTransitGatewayMulticastGroupMembersInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupSources struct { -} - -func (*awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupSources) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRegisterTransitGatewayMulticastGroupSources) 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.(*RegisterTransitGatewayMulticastGroupSourcesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RegisterTransitGatewayMulticastGroupSources") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectCapacityReservationBillingOwnership struct { -} - -func (*awsEc2query_serializeOpRejectCapacityReservationBillingOwnership) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectCapacityReservationBillingOwnership) 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.(*RejectCapacityReservationBillingOwnershipInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectCapacityReservationBillingOwnership") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectCapacityReservationBillingOwnershipInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectTransitGatewayMulticastDomainAssociations struct { -} - -func (*awsEc2query_serializeOpRejectTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectTransitGatewayMulticastDomainAssociations) 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.(*RejectTransitGatewayMulticastDomainAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectTransitGatewayMulticastDomainAssociations") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectTransitGatewayPeeringAttachment struct { -} - -func (*awsEc2query_serializeOpRejectTransitGatewayPeeringAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectTransitGatewayPeeringAttachment) 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.(*RejectTransitGatewayPeeringAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectTransitGatewayPeeringAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectTransitGatewayPeeringAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectTransitGatewayVpcAttachment struct { -} - -func (*awsEc2query_serializeOpRejectTransitGatewayVpcAttachment) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectTransitGatewayVpcAttachment) 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.(*RejectTransitGatewayVpcAttachmentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectTransitGatewayVpcAttachment") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectTransitGatewayVpcAttachmentInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectVpcEndpointConnections struct { -} - -func (*awsEc2query_serializeOpRejectVpcEndpointConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectVpcEndpointConnections) 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.(*RejectVpcEndpointConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectVpcEndpointConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectVpcEndpointConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRejectVpcPeeringConnection struct { -} - -func (*awsEc2query_serializeOpRejectVpcPeeringConnection) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRejectVpcPeeringConnection) 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.(*RejectVpcPeeringConnectionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RejectVpcPeeringConnection") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRejectVpcPeeringConnectionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReleaseAddress struct { -} - -func (*awsEc2query_serializeOpReleaseAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReleaseAddress) 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.(*ReleaseAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReleaseAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReleaseAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReleaseHosts struct { -} - -func (*awsEc2query_serializeOpReleaseHosts) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReleaseHosts) 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.(*ReleaseHostsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReleaseHosts") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReleaseHostsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReleaseIpamPoolAllocation struct { -} - -func (*awsEc2query_serializeOpReleaseIpamPoolAllocation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReleaseIpamPoolAllocation) 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.(*ReleaseIpamPoolAllocationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReleaseIpamPoolAllocation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReleaseIpamPoolAllocationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceIamInstanceProfileAssociation struct { -} - -func (*awsEc2query_serializeOpReplaceIamInstanceProfileAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceIamInstanceProfileAssociation) 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.(*ReplaceIamInstanceProfileAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceIamInstanceProfileAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceIamInstanceProfileAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceImageCriteriaInAllowedImagesSettings struct { -} - -func (*awsEc2query_serializeOpReplaceImageCriteriaInAllowedImagesSettings) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceImageCriteriaInAllowedImagesSettings) 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.(*ReplaceImageCriteriaInAllowedImagesSettingsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceImageCriteriaInAllowedImagesSettings") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceImageCriteriaInAllowedImagesSettingsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceNetworkAclAssociation struct { -} - -func (*awsEc2query_serializeOpReplaceNetworkAclAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceNetworkAclAssociation) 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.(*ReplaceNetworkAclAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceNetworkAclAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceNetworkAclAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceNetworkAclEntry struct { -} - -func (*awsEc2query_serializeOpReplaceNetworkAclEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceNetworkAclEntry) 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.(*ReplaceNetworkAclEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceNetworkAclEntry") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceNetworkAclEntryInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceRoute struct { -} - -func (*awsEc2query_serializeOpReplaceRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceRoute) 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.(*ReplaceRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceRouteTableAssociation struct { -} - -func (*awsEc2query_serializeOpReplaceRouteTableAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceRouteTableAssociation) 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.(*ReplaceRouteTableAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceRouteTableAssociation") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceRouteTableAssociationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceTransitGatewayRoute struct { -} - -func (*awsEc2query_serializeOpReplaceTransitGatewayRoute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceTransitGatewayRoute) 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.(*ReplaceTransitGatewayRouteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceTransitGatewayRoute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceTransitGatewayRouteInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReplaceVpnTunnel struct { -} - -func (*awsEc2query_serializeOpReplaceVpnTunnel) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReplaceVpnTunnel) 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.(*ReplaceVpnTunnelInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReplaceVpnTunnel") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReplaceVpnTunnelInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpReportInstanceStatus struct { -} - -func (*awsEc2query_serializeOpReportInstanceStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpReportInstanceStatus) 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.(*ReportInstanceStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReportInstanceStatus") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentReportInstanceStatusInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRequestSpotFleet struct { -} - -func (*awsEc2query_serializeOpRequestSpotFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRequestSpotFleet) 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.(*RequestSpotFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RequestSpotFleet") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRequestSpotFleetInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRequestSpotInstances struct { -} - -func (*awsEc2query_serializeOpRequestSpotInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRequestSpotInstances) 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.(*RequestSpotInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RequestSpotInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRequestSpotInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetAddressAttribute struct { -} - -func (*awsEc2query_serializeOpResetAddressAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetAddressAttribute) 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.(*ResetAddressAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetAddressAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetAddressAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetEbsDefaultKmsKeyId struct { -} - -func (*awsEc2query_serializeOpResetEbsDefaultKmsKeyId) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetEbsDefaultKmsKeyId) 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.(*ResetEbsDefaultKmsKeyIdInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetEbsDefaultKmsKeyId") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetEbsDefaultKmsKeyIdInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetFpgaImageAttribute struct { -} - -func (*awsEc2query_serializeOpResetFpgaImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetFpgaImageAttribute) 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.(*ResetFpgaImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetFpgaImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetFpgaImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetImageAttribute struct { -} - -func (*awsEc2query_serializeOpResetImageAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetImageAttribute) 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.(*ResetImageAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetImageAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetImageAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetInstanceAttribute struct { -} - -func (*awsEc2query_serializeOpResetInstanceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetInstanceAttribute) 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.(*ResetInstanceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetInstanceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetInstanceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_serializeOpResetNetworkInterfaceAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetNetworkInterfaceAttribute) 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.(*ResetNetworkInterfaceAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetNetworkInterfaceAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetNetworkInterfaceAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpResetSnapshotAttribute struct { -} - -func (*awsEc2query_serializeOpResetSnapshotAttribute) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpResetSnapshotAttribute) 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.(*ResetSnapshotAttributeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ResetSnapshotAttribute") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentResetSnapshotAttributeInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRestoreAddressToClassic struct { -} - -func (*awsEc2query_serializeOpRestoreAddressToClassic) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRestoreAddressToClassic) 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.(*RestoreAddressToClassicInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RestoreAddressToClassic") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRestoreAddressToClassicInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRestoreImageFromRecycleBin struct { -} - -func (*awsEc2query_serializeOpRestoreImageFromRecycleBin) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRestoreImageFromRecycleBin) 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.(*RestoreImageFromRecycleBinInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RestoreImageFromRecycleBin") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRestoreImageFromRecycleBinInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRestoreManagedPrefixListVersion struct { -} - -func (*awsEc2query_serializeOpRestoreManagedPrefixListVersion) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRestoreManagedPrefixListVersion) 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.(*RestoreManagedPrefixListVersionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RestoreManagedPrefixListVersion") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRestoreManagedPrefixListVersionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRestoreSnapshotFromRecycleBin struct { -} - -func (*awsEc2query_serializeOpRestoreSnapshotFromRecycleBin) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRestoreSnapshotFromRecycleBin) 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.(*RestoreSnapshotFromRecycleBinInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RestoreSnapshotFromRecycleBin") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRestoreSnapshotFromRecycleBinInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRestoreSnapshotTier struct { -} - -func (*awsEc2query_serializeOpRestoreSnapshotTier) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRestoreSnapshotTier) 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.(*RestoreSnapshotTierInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RestoreSnapshotTier") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRestoreSnapshotTierInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRevokeClientVpnIngress struct { -} - -func (*awsEc2query_serializeOpRevokeClientVpnIngress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRevokeClientVpnIngress) 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.(*RevokeClientVpnIngressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RevokeClientVpnIngress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRevokeClientVpnIngressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRevokeSecurityGroupEgress struct { -} - -func (*awsEc2query_serializeOpRevokeSecurityGroupEgress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRevokeSecurityGroupEgress) 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.(*RevokeSecurityGroupEgressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RevokeSecurityGroupEgress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRevokeSecurityGroupEgressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRevokeSecurityGroupIngress struct { -} - -func (*awsEc2query_serializeOpRevokeSecurityGroupIngress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRevokeSecurityGroupIngress) 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.(*RevokeSecurityGroupIngressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RevokeSecurityGroupIngress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRevokeSecurityGroupIngressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRunInstances struct { -} - -func (*awsEc2query_serializeOpRunInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRunInstances) 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.(*RunInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RunInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRunInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpRunScheduledInstances struct { -} - -func (*awsEc2query_serializeOpRunScheduledInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpRunScheduledInstances) 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.(*RunScheduledInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RunScheduledInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentRunScheduledInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpSearchLocalGatewayRoutes struct { -} - -func (*awsEc2query_serializeOpSearchLocalGatewayRoutes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpSearchLocalGatewayRoutes) 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.(*SearchLocalGatewayRoutesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SearchLocalGatewayRoutes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentSearchLocalGatewayRoutesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpSearchTransitGatewayMulticastGroups struct { -} - -func (*awsEc2query_serializeOpSearchTransitGatewayMulticastGroups) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpSearchTransitGatewayMulticastGroups) 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.(*SearchTransitGatewayMulticastGroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SearchTransitGatewayMulticastGroups") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentSearchTransitGatewayMulticastGroupsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpSearchTransitGatewayRoutes struct { -} - -func (*awsEc2query_serializeOpSearchTransitGatewayRoutes) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpSearchTransitGatewayRoutes) 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.(*SearchTransitGatewayRoutesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SearchTransitGatewayRoutes") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentSearchTransitGatewayRoutesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpSendDiagnosticInterrupt struct { -} - -func (*awsEc2query_serializeOpSendDiagnosticInterrupt) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpSendDiagnosticInterrupt) 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.(*SendDiagnosticInterruptInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SendDiagnosticInterrupt") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentSendDiagnosticInterruptInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStartDeclarativePoliciesReport struct { -} - -func (*awsEc2query_serializeOpStartDeclarativePoliciesReport) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStartDeclarativePoliciesReport) 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.(*StartDeclarativePoliciesReportInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartDeclarativePoliciesReport") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStartDeclarativePoliciesReportInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStartInstances struct { -} - -func (*awsEc2query_serializeOpStartInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStartInstances) 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.(*StartInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStartInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStartNetworkInsightsAccessScopeAnalysis struct { -} - -func (*awsEc2query_serializeOpStartNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStartNetworkInsightsAccessScopeAnalysis) 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.(*StartNetworkInsightsAccessScopeAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartNetworkInsightsAccessScopeAnalysis") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStartNetworkInsightsAccessScopeAnalysisInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStartNetworkInsightsAnalysis struct { -} - -func (*awsEc2query_serializeOpStartNetworkInsightsAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStartNetworkInsightsAnalysis) 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.(*StartNetworkInsightsAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartNetworkInsightsAnalysis") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStartNetworkInsightsAnalysisInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStartVpcEndpointServicePrivateDnsVerification struct { -} - -func (*awsEc2query_serializeOpStartVpcEndpointServicePrivateDnsVerification) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStartVpcEndpointServicePrivateDnsVerification) 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.(*StartVpcEndpointServicePrivateDnsVerificationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartVpcEndpointServicePrivateDnsVerification") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpStopInstances struct { -} - -func (*awsEc2query_serializeOpStopInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpStopInstances) 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.(*StopInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StopInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentStopInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpTerminateClientVpnConnections struct { -} - -func (*awsEc2query_serializeOpTerminateClientVpnConnections) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpTerminateClientVpnConnections) 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.(*TerminateClientVpnConnectionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("TerminateClientVpnConnections") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentTerminateClientVpnConnectionsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpTerminateInstances struct { -} - -func (*awsEc2query_serializeOpTerminateInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpTerminateInstances) 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.(*TerminateInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("TerminateInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentTerminateInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUnassignIpv6Addresses struct { -} - -func (*awsEc2query_serializeOpUnassignIpv6Addresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUnassignIpv6Addresses) 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.(*UnassignIpv6AddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UnassignIpv6Addresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUnassignIpv6AddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUnassignPrivateIpAddresses struct { -} - -func (*awsEc2query_serializeOpUnassignPrivateIpAddresses) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUnassignPrivateIpAddresses) 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.(*UnassignPrivateIpAddressesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UnassignPrivateIpAddresses") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUnassignPrivateIpAddressesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUnassignPrivateNatGatewayAddress struct { -} - -func (*awsEc2query_serializeOpUnassignPrivateNatGatewayAddress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUnassignPrivateNatGatewayAddress) 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.(*UnassignPrivateNatGatewayAddressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UnassignPrivateNatGatewayAddress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUnassignPrivateNatGatewayAddressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUnlockSnapshot struct { -} - -func (*awsEc2query_serializeOpUnlockSnapshot) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUnlockSnapshot) 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.(*UnlockSnapshotInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UnlockSnapshot") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUnlockSnapshotInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUnmonitorInstances struct { -} - -func (*awsEc2query_serializeOpUnmonitorInstances) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUnmonitorInstances) 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.(*UnmonitorInstancesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UnmonitorInstances") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUnmonitorInstancesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsEgress struct { -} - -func (*awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsEgress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsEgress) 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.(*UpdateSecurityGroupRuleDescriptionsEgressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UpdateSecurityGroupRuleDescriptionsEgress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsIngress struct { -} - -func (*awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsIngress) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpUpdateSecurityGroupRuleDescriptionsIngress) 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.(*UpdateSecurityGroupRuleDescriptionsIngressInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UpdateSecurityGroupRuleDescriptionsIngress") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsEc2query_serializeOpWithdrawByoipCidr struct { -} - -func (*awsEc2query_serializeOpWithdrawByoipCidr) ID() string { - return "OperationSerializer" -} - -func (m *awsEc2query_serializeOpWithdrawByoipCidr) 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.(*WithdrawByoipCidrInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("WithdrawByoipCidr") - body.Key("Version").String("2016-11-15") - - if err := awsEc2query_serializeOpDocumentWithdrawByoipCidrInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsEc2query_serializeDocumentAcceleratorCount(v *types.AcceleratorCount, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentAcceleratorCountRequest(v *types.AcceleratorCountRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentAcceleratorManufacturerSet(v []types.AcceleratorManufacturer, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentAcceleratorNameSet(v []types.AcceleratorName, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentAcceleratorTotalMemoryMiB(v *types.AcceleratorTotalMemoryMiB, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentAcceleratorTotalMemoryMiBRequest(v *types.AcceleratorTotalMemoryMiBRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentAcceleratorTypeSet(v []types.AcceleratorType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentAccessScopePathListRequest(v []types.AccessScopePathRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentAccessScopePathRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentAccessScopePathRequest(v *types.AccessScopePathRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Destination != nil { - objectKey := object.Key("Destination") - if err := awsEc2query_serializeDocumentPathStatementRequest(v.Destination, objectKey); err != nil { - return err - } - } - - if v.Source != nil { - objectKey := object.Key("Source") - if err := awsEc2query_serializeDocumentPathStatementRequest(v.Source, objectKey); err != nil { - return err - } - } - - if v.ThroughResources != nil { - objectKey := object.FlatKey("ThroughResource") - if err := awsEc2query_serializeDocumentThroughResourcesStatementRequestList(v.ThroughResources, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentAccountAttributeNameStringList(v []types.AccountAttributeName, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("AttributeName") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentAddIpamOperatingRegion(v *types.AddIpamOperatingRegion, value query.Value) error { - object := value.Object() - _ = object - - if v.RegionName != nil { - objectKey := object.Key("RegionName") - objectKey.String(*v.RegionName) - } - - return nil -} - -func awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v []types.AddIpamOperatingRegion, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentAddIpamOperatingRegion(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusion(v *types.AddIpamOrganizationalUnitExclusion, value query.Value) error { - object := value.Object() - _ = object - - if v.OrganizationsEntityPath != nil { - objectKey := object.Key("OrganizationsEntityPath") - objectKey.String(*v.OrganizationsEntityPath) - } - - return nil -} - -func awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusionSet(v []types.AddIpamOrganizationalUnitExclusion, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusion(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentAddPrefixListEntries(v []types.AddPrefixListEntry, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentAddPrefixListEntry(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentAddPrefixListEntry(v *types.AddPrefixListEntry, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - return nil -} - -func awsEc2query_serializeDocumentAllocationIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("AllocationId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentAllocationIds(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentAllowedInstanceTypeSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentArchitectureTypeSet(v []types.ArchitectureType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentArnList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentAsnAuthorizationContext(v *types.AsnAuthorizationContext, value query.Value) error { - object := value.Object() - _ = object - - if v.Message != nil { - objectKey := object.Key("Message") - objectKey.String(*v.Message) - } - - if v.Signature != nil { - objectKey := object.Key("Signature") - objectKey.String(*v.Signature) - } - - return nil -} - -func awsEc2query_serializeDocumentAssetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentAssociationIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("AssociationId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentAthenaIntegration(v *types.AthenaIntegration, value query.Value) error { - object := value.Object() - _ = object - - if v.IntegrationResultS3DestinationArn != nil { - objectKey := object.Key("IntegrationResultS3DestinationArn") - objectKey.String(*v.IntegrationResultS3DestinationArn) - } - - if v.PartitionEndDate != nil { - objectKey := object.Key("PartitionEndDate") - objectKey.String(smithytime.FormatDateTime(*v.PartitionEndDate)) - } - - if len(v.PartitionLoadFrequency) > 0 { - objectKey := object.Key("PartitionLoadFrequency") - objectKey.String(string(v.PartitionLoadFrequency)) - } - - if v.PartitionStartDate != nil { - objectKey := object.Key("PartitionStartDate") - objectKey.String(smithytime.FormatDateTime(*v.PartitionStartDate)) - } - - return nil -} - -func awsEc2query_serializeDocumentAthenaIntegrationsSet(v []types.AthenaIntegration, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentAthenaIntegration(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentAttributeBooleanValue(v *types.AttributeBooleanValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.Boolean(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentAttributeValue(v *types.AttributeValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentAvailabilityZoneStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("AvailabilityZone") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentBaselineEbsBandwidthMbps(v *types.BaselineEbsBandwidthMbps, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentBaselineEbsBandwidthMbpsRequest(v *types.BaselineEbsBandwidthMbpsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentBaselinePerformanceFactors(v *types.BaselinePerformanceFactors, value query.Value) error { - object := value.Object() - _ = object - - if v.Cpu != nil { - objectKey := object.Key("Cpu") - if err := awsEc2query_serializeDocumentCpuPerformanceFactor(v.Cpu, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentBaselinePerformanceFactorsRequest(v *types.BaselinePerformanceFactorsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Cpu != nil { - objectKey := object.Key("Cpu") - if err := awsEc2query_serializeDocumentCpuPerformanceFactorRequest(v.Cpu, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentBillingProductList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentBlobAttributeValue(v *types.BlobAttributeValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.Base64EncodeBytes(v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentBlockDeviceMapping(v *types.BlockDeviceMapping, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Ebs != nil { - objectKey := object.Key("Ebs") - if err := awsEc2query_serializeDocumentEbsBlockDevice(v.Ebs, objectKey); err != nil { - return err - } - } - - if v.NoDevice != nil { - objectKey := object.Key("NoDevice") - objectKey.String(*v.NoDevice) - } - - if v.VirtualName != nil { - objectKey := object.Key("VirtualName") - objectKey.String(*v.VirtualName) - } - - return nil -} - -func awsEc2query_serializeDocumentBlockDeviceMappingList(v []types.BlockDeviceMapping, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentBlockDeviceMapping(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentBlockDeviceMappingRequestList(v []types.BlockDeviceMapping, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("BlockDeviceMapping") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentBlockDeviceMapping(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentBundleIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("BundleId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCapacityBlockIds(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCapacityReservationFleetIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCapacityReservationIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCapacityReservationOptionsRequest(v *types.CapacityReservationOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.UsageStrategy) > 0 { - objectKey := object.Key("UsageStrategy") - objectKey.String(string(v.UsageStrategy)) - } - - return nil -} - -func awsEc2query_serializeDocumentCapacityReservationSpecification(v *types.CapacityReservationSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.CapacityReservationPreference) > 0 { - objectKey := object.Key("CapacityReservationPreference") - objectKey.String(string(v.CapacityReservationPreference)) - } - - if v.CapacityReservationTarget != nil { - objectKey := object.Key("CapacityReservationTarget") - if err := awsEc2query_serializeDocumentCapacityReservationTarget(v.CapacityReservationTarget, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCapacityReservationTarget(v *types.CapacityReservationTarget, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.CapacityReservationResourceGroupArn != nil { - objectKey := object.Key("CapacityReservationResourceGroupArn") - objectKey.String(*v.CapacityReservationResourceGroupArn) - } - - return nil -} - -func awsEc2query_serializeDocumentCarrierGatewayIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCertificateAuthenticationRequest(v *types.CertificateAuthenticationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientRootCertificateChainArn != nil { - objectKey := object.Key("ClientRootCertificateChainArn") - objectKey.String(*v.ClientRootCertificateChainArn) - } - - return nil -} - -func awsEc2query_serializeDocumentCidrAuthorizationContext(v *types.CidrAuthorizationContext, value query.Value) error { - object := value.Object() - _ = object - - if v.Message != nil { - objectKey := object.Key("Message") - objectKey.String(*v.Message) - } - - if v.Signature != nil { - objectKey := object.Key("Signature") - objectKey.String(*v.Signature) - } - - return nil -} - -func awsEc2query_serializeDocumentClassicLoadBalancer(v *types.ClassicLoadBalancer, value query.Value) error { - object := value.Object() - _ = object - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - return nil -} - -func awsEc2query_serializeDocumentClassicLoadBalancers(v []types.ClassicLoadBalancer, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentClassicLoadBalancer(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentClassicLoadBalancersConfig(v *types.ClassicLoadBalancersConfig, value query.Value) error { - object := value.Object() - _ = object - - if v.ClassicLoadBalancers != nil { - objectKey := object.FlatKey("ClassicLoadBalancers") - if err := awsEc2query_serializeDocumentClassicLoadBalancers(v.ClassicLoadBalancers, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentClientConnectOptions(v *types.ClientConnectOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - if v.LambdaFunctionArn != nil { - objectKey := object.Key("LambdaFunctionArn") - objectKey.String(*v.LambdaFunctionArn) - } - - return nil -} - -func awsEc2query_serializeDocumentClientData(v *types.ClientData, value query.Value) error { - object := value.Object() - _ = object - - if v.Comment != nil { - objectKey := object.Key("Comment") - objectKey.String(*v.Comment) - } - - if v.UploadEnd != nil { - objectKey := object.Key("UploadEnd") - objectKey.String(smithytime.FormatDateTime(*v.UploadEnd)) - } - - if v.UploadSize != nil { - objectKey := object.Key("UploadSize") - switch { - case math.IsNaN(*v.UploadSize): - objectKey.String("NaN") - - case math.IsInf(*v.UploadSize, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.UploadSize, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.UploadSize) - - } - } - - if v.UploadStart != nil { - objectKey := object.Key("UploadStart") - objectKey.String(smithytime.FormatDateTime(*v.UploadStart)) - } - - return nil -} - -func awsEc2query_serializeDocumentClientLoginBannerOptions(v *types.ClientLoginBannerOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.BannerText != nil { - objectKey := object.Key("BannerText") - objectKey.String(*v.BannerText) - } - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentClientRouteEnforcementOptions(v *types.ClientRouteEnforcementOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Enforced != nil { - objectKey := object.Key("Enforced") - objectKey.Boolean(*v.Enforced) - } - - return nil -} - -func awsEc2query_serializeDocumentClientVpnAuthenticationRequest(v *types.ClientVpnAuthenticationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ActiveDirectory != nil { - objectKey := object.Key("ActiveDirectory") - if err := awsEc2query_serializeDocumentDirectoryServiceAuthenticationRequest(v.ActiveDirectory, objectKey); err != nil { - return err - } - } - - if v.FederatedAuthentication != nil { - objectKey := object.Key("FederatedAuthentication") - if err := awsEc2query_serializeDocumentFederatedAuthenticationRequest(v.FederatedAuthentication, objectKey); err != nil { - return err - } - } - - if v.MutualAuthentication != nil { - objectKey := object.Key("MutualAuthentication") - if err := awsEc2query_serializeDocumentCertificateAuthenticationRequest(v.MutualAuthentication, objectKey); err != nil { - return err - } - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - return nil -} - -func awsEc2query_serializeDocumentClientVpnAuthenticationRequestList(v []types.ClientVpnAuthenticationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentClientVpnAuthenticationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentClientVpnEndpointIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentClientVpnSecurityGroupIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCloudWatchLogOptionsSpecification(v *types.CloudWatchLogOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.LogEnabled != nil { - objectKey := object.Key("LogEnabled") - objectKey.Boolean(*v.LogEnabled) - } - - if v.LogGroupArn != nil { - objectKey := object.Key("LogGroupArn") - objectKey.String(*v.LogGroupArn) - } - - if v.LogOutputFormat != nil { - objectKey := object.Key("LogOutputFormat") - objectKey.String(*v.LogOutputFormat) - } - - return nil -} - -func awsEc2query_serializeDocumentCoipPoolIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentConnectionLogOptions(v *types.ConnectionLogOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.CloudwatchLogGroup != nil { - objectKey := object.Key("CloudwatchLogGroup") - objectKey.String(*v.CloudwatchLogGroup) - } - - if v.CloudwatchLogStream != nil { - objectKey := object.Key("CloudwatchLogStream") - objectKey.String(*v.CloudwatchLogStream) - } - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentConnectionNotificationIdsList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v *types.ConnectionTrackingSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.TcpEstablishedTimeout != nil { - objectKey := object.Key("TcpEstablishedTimeout") - objectKey.Integer(*v.TcpEstablishedTimeout) - } - - if v.UdpStreamTimeout != nil { - objectKey := object.Key("UdpStreamTimeout") - objectKey.Integer(*v.UdpStreamTimeout) - } - - if v.UdpTimeout != nil { - objectKey := object.Key("UdpTimeout") - objectKey.Integer(*v.UdpTimeout) - } - - return nil -} - -func awsEc2query_serializeDocumentConversionIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCpuManufacturerSet(v []types.CpuManufacturer, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentCpuOptionsRequest(v *types.CpuOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AmdSevSnp) > 0 { - objectKey := object.Key("AmdSevSnp") - objectKey.String(string(v.AmdSevSnp)) - } - - if v.CoreCount != nil { - objectKey := object.Key("CoreCount") - objectKey.Integer(*v.CoreCount) - } - - if v.ThreadsPerCore != nil { - objectKey := object.Key("ThreadsPerCore") - objectKey.Integer(*v.ThreadsPerCore) - } - - return nil -} - -func awsEc2query_serializeDocumentCpuPerformanceFactor(v *types.CpuPerformanceFactor, value query.Value) error { - object := value.Object() - _ = object - - if v.References != nil { - objectKey := object.FlatKey("ReferenceSet") - if err := awsEc2query_serializeDocumentPerformanceFactorReferenceSet(v.References, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCpuPerformanceFactorRequest(v *types.CpuPerformanceFactorRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.References != nil { - objectKey := object.FlatKey("Reference") - if err := awsEc2query_serializeDocumentPerformanceFactorReferenceSetRequest(v.References, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCreateTransitGatewayConnectRequestOptions(v *types.CreateTransitGatewayConnectRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateTransitGatewayMulticastDomainRequestOptions(v *types.CreateTransitGatewayMulticastDomainRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AutoAcceptSharedAssociations) > 0 { - objectKey := object.Key("AutoAcceptSharedAssociations") - objectKey.String(string(v.AutoAcceptSharedAssociations)) - } - - if len(v.Igmpv2Support) > 0 { - objectKey := object.Key("Igmpv2Support") - objectKey.String(string(v.Igmpv2Support)) - } - - if len(v.StaticSourcesSupport) > 0 { - objectKey := object.Key("StaticSourcesSupport") - objectKey.String(string(v.StaticSourcesSupport)) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateTransitGatewayPeeringAttachmentRequestOptions(v *types.CreateTransitGatewayPeeringAttachmentRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if len(v.DynamicRouting) > 0 { - objectKey := object.Key("DynamicRouting") - objectKey.String(string(v.DynamicRouting)) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateTransitGatewayVpcAttachmentRequestOptions(v *types.CreateTransitGatewayVpcAttachmentRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ApplianceModeSupport) > 0 { - objectKey := object.Key("ApplianceModeSupport") - objectKey.String(string(v.ApplianceModeSupport)) - } - - if len(v.DnsSupport) > 0 { - objectKey := object.Key("DnsSupport") - objectKey.String(string(v.DnsSupport)) - } - - if len(v.Ipv6Support) > 0 { - objectKey := object.Key("Ipv6Support") - objectKey.String(string(v.Ipv6Support)) - } - - if len(v.SecurityGroupReferencingSupport) > 0 { - objectKey := object.Key("SecurityGroupReferencingSupport") - objectKey.String(string(v.SecurityGroupReferencingSupport)) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointCidrOptions(v *types.CreateVerifiedAccessEndpointCidrOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointEniOptions(v *types.CreateVerifiedAccessEndpointEniOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointLoadBalancerOptions(v *types.CreateVerifiedAccessEndpointLoadBalancerOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.LoadBalancerArn != nil { - objectKey := object.Key("LoadBalancerArn") - objectKey.String(*v.LoadBalancerArn) - } - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRange(v *types.CreateVerifiedAccessEndpointPortRange, value query.Value) error { - object := value.Object() - _ = object - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRangeList(v []types.CreateVerifiedAccessEndpointPortRange, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointPortRange(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointRdsOptions(v *types.CreateVerifiedAccessEndpointRdsOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - if v.RdsDbClusterArn != nil { - objectKey := object.Key("RdsDbClusterArn") - objectKey.String(*v.RdsDbClusterArn) - } - - if v.RdsDbInstanceArn != nil { - objectKey := object.Key("RdsDbInstanceArn") - objectKey.String(*v.RdsDbInstanceArn) - } - - if v.RdsDbProxyArn != nil { - objectKey := object.Key("RdsDbProxyArn") - objectKey.String(*v.RdsDbProxyArn) - } - - if v.RdsEndpoint != nil { - objectKey := object.Key("RdsEndpoint") - objectKey.String(*v.RdsEndpoint) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessEndpointSubnetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessNativeApplicationOidcOptions(v *types.CreateVerifiedAccessNativeApplicationOidcOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AuthorizationEndpoint != nil { - objectKey := object.Key("AuthorizationEndpoint") - objectKey.String(*v.AuthorizationEndpoint) - } - - if v.ClientId != nil { - objectKey := object.Key("ClientId") - objectKey.String(*v.ClientId) - } - - if v.ClientSecret != nil { - objectKey := object.Key("ClientSecret") - objectKey.String(*v.ClientSecret) - } - - if v.Issuer != nil { - objectKey := object.Key("Issuer") - objectKey.String(*v.Issuer) - } - - if v.PublicSigningKeyEndpoint != nil { - objectKey := object.Key("PublicSigningKeyEndpoint") - objectKey.String(*v.PublicSigningKeyEndpoint) - } - - if v.Scope != nil { - objectKey := object.Key("Scope") - objectKey.String(*v.Scope) - } - - if v.TokenEndpoint != nil { - objectKey := object.Key("TokenEndpoint") - objectKey.String(*v.TokenEndpoint) - } - - if v.UserInfoEndpoint != nil { - objectKey := object.Key("UserInfoEndpoint") - objectKey.String(*v.UserInfoEndpoint) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessTrustProviderDeviceOptions(v *types.CreateVerifiedAccessTrustProviderDeviceOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.PublicSigningKeyUrl != nil { - objectKey := object.Key("PublicSigningKeyUrl") - objectKey.String(*v.PublicSigningKeyUrl) - } - - if v.TenantId != nil { - objectKey := object.Key("TenantId") - objectKey.String(*v.TenantId) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVerifiedAccessTrustProviderOidcOptions(v *types.CreateVerifiedAccessTrustProviderOidcOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AuthorizationEndpoint != nil { - objectKey := object.Key("AuthorizationEndpoint") - objectKey.String(*v.AuthorizationEndpoint) - } - - if v.ClientId != nil { - objectKey := object.Key("ClientId") - objectKey.String(*v.ClientId) - } - - if v.ClientSecret != nil { - objectKey := object.Key("ClientSecret") - objectKey.String(*v.ClientSecret) - } - - if v.Issuer != nil { - objectKey := object.Key("Issuer") - objectKey.String(*v.Issuer) - } - - if v.Scope != nil { - objectKey := object.Key("Scope") - objectKey.String(*v.Scope) - } - - if v.TokenEndpoint != nil { - objectKey := object.Key("TokenEndpoint") - objectKey.String(*v.TokenEndpoint) - } - - if v.UserInfoEndpoint != nil { - objectKey := object.Key("UserInfoEndpoint") - objectKey.String(*v.UserInfoEndpoint) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVolumePermission(v *types.CreateVolumePermission, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Group) > 0 { - objectKey := object.Key("Group") - objectKey.String(string(v.Group)) - } - - if v.UserId != nil { - objectKey := object.Key("UserId") - objectKey.String(*v.UserId) - } - - return nil -} - -func awsEc2query_serializeDocumentCreateVolumePermissionList(v []types.CreateVolumePermission, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentCreateVolumePermission(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentCreateVolumePermissionModifications(v *types.CreateVolumePermissionModifications, value query.Value) error { - object := value.Object() - _ = object - - if v.Add != nil { - objectKey := object.FlatKey("Add") - if err := awsEc2query_serializeDocumentCreateVolumePermissionList(v.Add, objectKey); err != nil { - return err - } - } - - if v.Remove != nil { - objectKey := object.FlatKey("Remove") - if err := awsEc2query_serializeDocumentCreateVolumePermissionList(v.Remove, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentCreditSpecificationRequest(v *types.CreditSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.CpuCredits != nil { - objectKey := object.Key("CpuCredits") - objectKey.String(*v.CpuCredits) - } - - return nil -} - -func awsEc2query_serializeDocumentCustomerGatewayIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("CustomerGatewayId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDataQueries(v []types.DataQuery, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentDataQuery(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentDataQuery(v *types.DataQuery, value query.Value) error { - object := value.Object() - _ = object - - if v.Destination != nil { - objectKey := object.Key("Destination") - objectKey.String(*v.Destination) - } - - if v.Id != nil { - objectKey := object.Key("Id") - objectKey.String(*v.Id) - } - - if len(v.Metric) > 0 { - objectKey := object.Key("Metric") - objectKey.String(string(v.Metric)) - } - - if len(v.Period) > 0 { - objectKey := object.Key("Period") - objectKey.String(string(v.Period)) - } - - if v.Source != nil { - objectKey := object.Key("Source") - objectKey.String(*v.Source) - } - - if len(v.Statistic) > 0 { - objectKey := object.Key("Statistic") - objectKey.String(string(v.Statistic)) - } - - return nil -} - -func awsEc2query_serializeDocumentDedicatedHostIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDeleteQueuedReservedInstancesIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDeregisterInstanceTagAttributeRequest(v *types.DeregisterInstanceTagAttributeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.IncludeAllTagsOfInstance != nil { - objectKey := object.Key("IncludeAllTagsOfInstance") - objectKey.Boolean(*v.IncludeAllTagsOfInstance) - } - - if v.InstanceTagKeys != nil { - objectKey := object.FlatKey("InstanceTagKey") - if err := awsEc2query_serializeDocumentInstanceTagKeySet(v.InstanceTagKeys, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentDescribeInstanceTopologyGroupNameSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDescribeInstanceTopologyInstanceIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDestinationOptionsRequest(v *types.DestinationOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.FileFormat) > 0 { - objectKey := object.Key("FileFormat") - objectKey.String(string(v.FileFormat)) - } - - if v.HiveCompatiblePartitions != nil { - objectKey := object.Key("HiveCompatiblePartitions") - objectKey.Boolean(*v.HiveCompatiblePartitions) - } - - if v.PerHourPartition != nil { - objectKey := object.Key("PerHourPartition") - objectKey.Boolean(*v.PerHourPartition) - } - - return nil -} - -func awsEc2query_serializeDocumentDhcpOptionsIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("DhcpOptionsId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentDirectoryServiceAuthenticationRequest(v *types.DirectoryServiceAuthenticationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DirectoryId != nil { - objectKey := object.Key("DirectoryId") - objectKey.String(*v.DirectoryId) - } - - return nil -} - -func awsEc2query_serializeDocumentDiskImage(v *types.DiskImage, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.Image != nil { - objectKey := object.Key("Image") - if err := awsEc2query_serializeDocumentDiskImageDetail(v.Image, objectKey); err != nil { - return err - } - } - - if v.Volume != nil { - objectKey := object.Key("Volume") - if err := awsEc2query_serializeDocumentVolumeDetail(v.Volume, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentDiskImageDetail(v *types.DiskImageDetail, value query.Value) error { - object := value.Object() - _ = object - - if v.Bytes != nil { - objectKey := object.Key("Bytes") - objectKey.Long(*v.Bytes) - } - - if len(v.Format) > 0 { - objectKey := object.Key("Format") - objectKey.String(string(v.Format)) - } - - if v.ImportManifestUrl != nil { - objectKey := object.Key("ImportManifestUrl") - objectKey.String(*v.ImportManifestUrl) - } - - return nil -} - -func awsEc2query_serializeDocumentDiskImageList(v []types.DiskImage, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentDiskImage(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentDnsOptionsSpecification(v *types.DnsOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.DnsRecordIpType) > 0 { - objectKey := object.Key("DnsRecordIpType") - objectKey.String(string(v.DnsRecordIpType)) - } - - if v.PrivateDnsOnlyForInboundResolverEndpoint != nil { - objectKey := object.Key("PrivateDnsOnlyForInboundResolverEndpoint") - objectKey.Boolean(*v.PrivateDnsOnlyForInboundResolverEndpoint) - } - - return nil -} - -func awsEc2query_serializeDocumentDnsServersOptionsModifyStructure(v *types.DnsServersOptionsModifyStructure, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomDnsServers != nil { - objectKey := object.FlatKey("CustomDnsServers") - if err := awsEc2query_serializeDocumentValueStringList(v.CustomDnsServers, objectKey); err != nil { - return err - } - } - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentEbsBlockDevice(v *types.EbsBlockDevice, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.Throughput != nil { - objectKey := object.Key("Throughput") - objectKey.Integer(*v.Throughput) - } - - if v.VolumeInitializationRate != nil { - objectKey := object.Key("VolumeInitializationRate") - objectKey.Integer(*v.VolumeInitializationRate) - } - - if v.VolumeSize != nil { - objectKey := object.Key("VolumeSize") - objectKey.Integer(*v.VolumeSize) - } - - if len(v.VolumeType) > 0 { - objectKey := object.Key("VolumeType") - objectKey.String(string(v.VolumeType)) - } - - return nil -} - -func awsEc2query_serializeDocumentEbsInstanceBlockDeviceSpecification(v *types.EbsInstanceBlockDeviceSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeDocumentEgressOnlyInternetGatewayIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentEipAssociationIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentElasticGpuIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentElasticGpuSpecification(v *types.ElasticGpuSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.Type != nil { - objectKey := object.Key("Type") - objectKey.String(*v.Type) - } - - return nil -} - -func awsEc2query_serializeDocumentElasticGpuSpecificationList(v []types.ElasticGpuSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ElasticGpuSpecification") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentElasticGpuSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentElasticGpuSpecifications(v []types.ElasticGpuSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentElasticGpuSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentElasticInferenceAccelerator(v *types.ElasticInferenceAccelerator, value query.Value) error { - object := value.Object() - _ = object - - if v.Count != nil { - objectKey := object.Key("Count") - objectKey.Integer(*v.Count) - } - - if v.Type != nil { - objectKey := object.Key("Type") - objectKey.String(*v.Type) - } - - return nil -} - -func awsEc2query_serializeDocumentElasticInferenceAccelerators(v []types.ElasticInferenceAccelerator, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentElasticInferenceAccelerator(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentEnaSrdSpecification(v *types.EnaSrdSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.EnaSrdEnabled != nil { - objectKey := object.Key("EnaSrdEnabled") - objectKey.Boolean(*v.EnaSrdEnabled) - } - - if v.EnaSrdUdpSpecification != nil { - objectKey := object.Key("EnaSrdUdpSpecification") - if err := awsEc2query_serializeDocumentEnaSrdUdpSpecification(v.EnaSrdUdpSpecification, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v *types.EnaSrdSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EnaSrdEnabled != nil { - objectKey := object.Key("EnaSrdEnabled") - objectKey.Boolean(*v.EnaSrdEnabled) - } - - if v.EnaSrdUdpSpecification != nil { - objectKey := object.Key("EnaSrdUdpSpecification") - if err := awsEc2query_serializeDocumentEnaSrdUdpSpecificationRequest(v.EnaSrdUdpSpecification, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentEnaSrdUdpSpecification(v *types.EnaSrdUdpSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.EnaSrdUdpEnabled != nil { - objectKey := object.Key("EnaSrdUdpEnabled") - objectKey.Boolean(*v.EnaSrdUdpEnabled) - } - - return nil -} - -func awsEc2query_serializeDocumentEnaSrdUdpSpecificationRequest(v *types.EnaSrdUdpSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EnaSrdUdpEnabled != nil { - objectKey := object.Key("EnaSrdUdpEnabled") - objectKey.Boolean(*v.EnaSrdUdpEnabled) - } - - return nil -} - -func awsEc2query_serializeDocumentEnclaveOptionsRequest(v *types.EnclaveOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentExcludedInstanceTypeSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentExecutableByStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ExecutableBy") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentExportImageTaskIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ExportImageTaskId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentExportTaskIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ExportTaskId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentExportTaskS3LocationRequest(v *types.ExportTaskS3LocationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.S3Bucket != nil { - objectKey := object.Key("S3Bucket") - objectKey.String(*v.S3Bucket) - } - - if v.S3Prefix != nil { - objectKey := object.Key("S3Prefix") - objectKey.String(*v.S3Prefix) - } - - return nil -} - -func awsEc2query_serializeDocumentExportToS3TaskSpecification(v *types.ExportToS3TaskSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ContainerFormat) > 0 { - objectKey := object.Key("ContainerFormat") - objectKey.String(string(v.ContainerFormat)) - } - - if len(v.DiskImageFormat) > 0 { - objectKey := object.Key("DiskImageFormat") - objectKey.String(string(v.DiskImageFormat)) - } - - if v.S3Bucket != nil { - objectKey := object.Key("S3Bucket") - objectKey.String(*v.S3Bucket) - } - - if v.S3Prefix != nil { - objectKey := object.Key("S3Prefix") - objectKey.String(*v.S3Prefix) - } - - return nil -} - -func awsEc2query_serializeDocumentFastLaunchImageIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ImageId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentFastLaunchLaunchTemplateSpecificationRequest(v *types.FastLaunchLaunchTemplateSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Version != nil { - objectKey := object.Key("Version") - objectKey.String(*v.Version) - } - - return nil -} - -func awsEc2query_serializeDocumentFastLaunchSnapshotConfigurationRequest(v *types.FastLaunchSnapshotConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.TargetResourceCount != nil { - objectKey := object.Key("TargetResourceCount") - objectKey.Integer(*v.TargetResourceCount) - } - - return nil -} - -func awsEc2query_serializeDocumentFederatedAuthenticationRequest(v *types.FederatedAuthenticationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.SAMLProviderArn != nil { - objectKey := object.Key("SAMLProviderArn") - objectKey.String(*v.SAMLProviderArn) - } - - if v.SelfServiceSAMLProviderArn != nil { - objectKey := object.Key("SelfServiceSAMLProviderArn") - objectKey.String(*v.SelfServiceSAMLProviderArn) - } - - return nil -} - -func awsEc2query_serializeDocumentFilter(v *types.Filter, value query.Value) error { - object := value.Object() - _ = object - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.Values != nil { - objectKey := object.FlatKey("Value") - if err := awsEc2query_serializeDocumentValueStringList(v.Values, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentFilterList(v []types.Filter, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Filter") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentFilter(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentFleetBlockDeviceMappingRequest(v *types.FleetBlockDeviceMappingRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Ebs != nil { - objectKey := object.Key("Ebs") - if err := awsEc2query_serializeDocumentFleetEbsBlockDeviceRequest(v.Ebs, objectKey); err != nil { - return err - } - } - - if v.NoDevice != nil { - objectKey := object.Key("NoDevice") - objectKey.String(*v.NoDevice) - } - - if v.VirtualName != nil { - objectKey := object.Key("VirtualName") - objectKey.String(*v.VirtualName) - } - - return nil -} - -func awsEc2query_serializeDocumentFleetBlockDeviceMappingRequestList(v []types.FleetBlockDeviceMappingRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("BlockDeviceMapping") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentFleetBlockDeviceMappingRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentFleetEbsBlockDeviceRequest(v *types.FleetEbsBlockDeviceRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.Throughput != nil { - objectKey := object.Key("Throughput") - objectKey.Integer(*v.Throughput) - } - - if v.VolumeSize != nil { - objectKey := object.Key("VolumeSize") - objectKey.Integer(*v.VolumeSize) - } - - if len(v.VolumeType) > 0 { - objectKey := object.Key("VolumeType") - objectKey.String(string(v.VolumeType)) - } - - return nil -} - -func awsEc2query_serializeDocumentFleetIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateConfigListRequest(v []types.FleetLaunchTemplateConfigRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentFleetLaunchTemplateConfigRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateConfigRequest(v *types.FleetLaunchTemplateConfigRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateSpecification != nil { - objectKey := object.Key("LaunchTemplateSpecification") - if err := awsEc2query_serializeDocumentFleetLaunchTemplateSpecificationRequest(v.LaunchTemplateSpecification, objectKey); err != nil { - return err - } - } - - if v.Overrides != nil { - objectKey := object.FlatKey("Overrides") - if err := awsEc2query_serializeDocumentFleetLaunchTemplateOverridesListRequest(v.Overrides, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateOverridesListRequest(v []types.FleetLaunchTemplateOverridesRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentFleetLaunchTemplateOverridesRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateOverridesRequest(v *types.FleetLaunchTemplateOverridesRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentFleetBlockDeviceMappingRequestList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirementsRequest(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.MaxPrice != nil { - objectKey := object.Key("MaxPrice") - objectKey.String(*v.MaxPrice) - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.Priority != nil { - objectKey := object.Key("Priority") - switch { - case math.IsNaN(*v.Priority): - objectKey.String("NaN") - - case math.IsInf(*v.Priority, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Priority, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Priority) - - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.WeightedCapacity != nil { - objectKey := object.Key("WeightedCapacity") - switch { - case math.IsNaN(*v.WeightedCapacity): - objectKey.String("NaN") - - case math.IsInf(*v.WeightedCapacity, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.WeightedCapacity, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.WeightedCapacity) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateSpecification(v *types.FleetLaunchTemplateSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Version != nil { - objectKey := object.Key("Version") - objectKey.String(*v.Version) - } - - return nil -} - -func awsEc2query_serializeDocumentFleetLaunchTemplateSpecificationRequest(v *types.FleetLaunchTemplateSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Version != nil { - objectKey := object.Key("Version") - objectKey.String(*v.Version) - } - - return nil -} - -func awsEc2query_serializeDocumentFleetSpotCapacityRebalanceRequest(v *types.FleetSpotCapacityRebalanceRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ReplacementStrategy) > 0 { - objectKey := object.Key("ReplacementStrategy") - objectKey.String(string(v.ReplacementStrategy)) - } - - if v.TerminationDelay != nil { - objectKey := object.Key("TerminationDelay") - objectKey.Integer(*v.TerminationDelay) - } - - return nil -} - -func awsEc2query_serializeDocumentFleetSpotMaintenanceStrategiesRequest(v *types.FleetSpotMaintenanceStrategiesRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityRebalance != nil { - objectKey := object.Key("CapacityRebalance") - if err := awsEc2query_serializeDocumentFleetSpotCapacityRebalanceRequest(v.CapacityRebalance, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentFlowLogIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentFlowLogResourceIds(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentFpgaImageIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentGroupIdentifier(v *types.GroupIdentifier, value query.Value) error { - object := value.Object() - _ = object - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - return nil -} - -func awsEc2query_serializeDocumentGroupIdentifierList(v []types.GroupIdentifier, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentGroupIdentifier(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentGroupIds(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentGroupIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("GroupId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentGroupNameStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("GroupName") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentHibernationOptionsRequest(v *types.HibernationOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Configured != nil { - objectKey := object.Key("Configured") - objectKey.Boolean(*v.Configured) - } - - return nil -} - -func awsEc2query_serializeDocumentHostReservationIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIamInstanceProfileSpecification(v *types.IamInstanceProfileSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.Arn != nil { - objectKey := object.Key("Arn") - objectKey.String(*v.Arn) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - return nil -} - -func awsEc2query_serializeDocumentIcmpTypeCode(v *types.IcmpTypeCode, value query.Value) error { - object := value.Object() - _ = object - - if v.Code != nil { - objectKey := object.Key("Code") - objectKey.Integer(*v.Code) - } - - if v.Type != nil { - objectKey := object.Key("Type") - objectKey.Integer(*v.Type) - } - - return nil -} - -func awsEc2query_serializeDocumentIKEVersionsRequestList(v []types.IKEVersionsRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIKEVersionsRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentIKEVersionsRequestListValue(v *types.IKEVersionsRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentImageCriterionRequest(v *types.ImageCriterionRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ImageProviders != nil { - objectKey := object.FlatKey("ImageProvider") - if err := awsEc2query_serializeDocumentImageProviderRequestList(v.ImageProviders, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentImageCriterionRequestList(v []types.ImageCriterionRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ImageCriterion") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentImageCriterionRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentImageDiskContainer(v *types.ImageDiskContainer, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Format != nil { - objectKey := object.Key("Format") - objectKey.String(*v.Format) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.Url != nil { - objectKey := object.Key("Url") - objectKey.String(*v.Url) - } - - if v.UserBucket != nil { - objectKey := object.Key("UserBucket") - if err := awsEc2query_serializeDocumentUserBucket(v.UserBucket, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentImageDiskContainerList(v []types.ImageDiskContainer, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentImageDiskContainer(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentImageIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentImageIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ImageId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentImageProviderRequestList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentImportImageLicenseConfigurationRequest(v *types.ImportImageLicenseConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LicenseConfigurationArn != nil { - objectKey := object.Key("LicenseConfigurationArn") - objectKey.String(*v.LicenseConfigurationArn) - } - - return nil -} - -func awsEc2query_serializeDocumentImportImageLicenseSpecificationListRequest(v []types.ImportImageLicenseConfigurationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentImportImageLicenseConfigurationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentImportInstanceLaunchSpecification(v *types.ImportInstanceLaunchSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.AdditionalInfo != nil { - objectKey := object.Key("AdditionalInfo") - objectKey.String(*v.AdditionalInfo) - } - - if len(v.Architecture) > 0 { - objectKey := object.Key("Architecture") - objectKey.String(string(v.Architecture)) - } - - if v.GroupIds != nil { - objectKey := object.FlatKey("GroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.GroupIds, objectKey); err != nil { - return err - } - } - - if v.GroupNames != nil { - objectKey := object.FlatKey("GroupName") - if err := awsEc2query_serializeDocumentSecurityGroupStringList(v.GroupNames, objectKey); err != nil { - return err - } - } - - if len(v.InstanceInitiatedShutdownBehavior) > 0 { - objectKey := object.Key("InstanceInitiatedShutdownBehavior") - objectKey.String(string(v.InstanceInitiatedShutdownBehavior)) - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - objectKey.Boolean(*v.Monitoring) - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - if err := awsEc2query_serializeDocumentUserData(v.UserData, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentImportSnapshotTaskIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ImportTaskId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentImportTaskIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ImportTaskId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInsideCidrBlocksStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceBlockDeviceMappingSpecification(v *types.InstanceBlockDeviceMappingSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Ebs != nil { - objectKey := object.Key("Ebs") - if err := awsEc2query_serializeDocumentEbsInstanceBlockDeviceSpecification(v.Ebs, objectKey); err != nil { - return err - } - } - - if v.NoDevice != nil { - objectKey := object.Key("NoDevice") - objectKey.String(*v.NoDevice) - } - - if v.VirtualName != nil { - objectKey := object.Key("VirtualName") - objectKey.String(*v.VirtualName) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceBlockDeviceMappingSpecificationList(v []types.InstanceBlockDeviceMappingSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceBlockDeviceMappingSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceCreditSpecificationListRequest(v []types.InstanceCreditSpecificationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceCreditSpecificationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceCreditSpecificationRequest(v *types.InstanceCreditSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.CpuCredits != nil { - objectKey := object.Key("CpuCredits") - objectKey.String(*v.CpuCredits) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceEventWindowAssociationRequest(v *types.InstanceEventWindowAssociationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DedicatedHostIds != nil { - objectKey := object.FlatKey("DedicatedHostId") - if err := awsEc2query_serializeDocumentDedicatedHostIdList(v.DedicatedHostIds, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.InstanceTags != nil { - objectKey := object.FlatKey("InstanceTag") - if err := awsEc2query_serializeDocumentTagList(v.InstanceTags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceEventWindowDisassociationRequest(v *types.InstanceEventWindowDisassociationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DedicatedHostIds != nil { - objectKey := object.FlatKey("DedicatedHostId") - if err := awsEc2query_serializeDocumentDedicatedHostIdList(v.DedicatedHostIds, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.InstanceTags != nil { - objectKey := object.FlatKey("InstanceTag") - if err := awsEc2query_serializeDocumentTagList(v.InstanceTags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceEventWindowIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("InstanceEventWindowId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceEventWindowTimeRangeRequest(v *types.InstanceEventWindowTimeRangeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EndHour != nil { - objectKey := object.Key("EndHour") - objectKey.Integer(*v.EndHour) - } - - if len(v.EndWeekDay) > 0 { - objectKey := object.Key("EndWeekDay") - objectKey.String(string(v.EndWeekDay)) - } - - if v.StartHour != nil { - objectKey := object.Key("StartHour") - objectKey.Integer(*v.StartHour) - } - - if len(v.StartWeekDay) > 0 { - objectKey := object.Key("StartWeekDay") - objectKey.String(string(v.StartWeekDay)) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceEventWindowTimeRangeRequestSet(v []types.InstanceEventWindowTimeRangeRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceEventWindowTimeRangeRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceGenerationSet(v []types.InstanceGeneration, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("InstanceId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceIpv6Address(v *types.InstanceIpv6Address, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6Address != nil { - objectKey := object.Key("Ipv6Address") - objectKey.String(*v.Ipv6Address) - } - - if v.IsPrimaryIpv6 != nil { - objectKey := object.Key("IsPrimaryIpv6") - objectKey.Boolean(*v.IsPrimaryIpv6) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceIpv6AddressList(v []types.InstanceIpv6Address, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceIpv6Address(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceIpv6AddressListRequest(v []types.InstanceIpv6AddressRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("InstanceIpv6Address") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceIpv6AddressRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceIpv6AddressRequest(v *types.InstanceIpv6AddressRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6Address != nil { - objectKey := object.Key("Ipv6Address") - objectKey.String(*v.Ipv6Address) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceMaintenanceOptionsRequest(v *types.InstanceMaintenanceOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AutoRecovery) > 0 { - objectKey := object.Key("AutoRecovery") - objectKey.String(string(v.AutoRecovery)) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceMarketOptionsRequest(v *types.InstanceMarketOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.MarketType) > 0 { - objectKey := object.Key("MarketType") - objectKey.String(string(v.MarketType)) - } - - if v.SpotOptions != nil { - objectKey := object.Key("SpotOptions") - if err := awsEc2query_serializeDocumentSpotMarketOptions(v.SpotOptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceMetadataOptionsRequest(v *types.InstanceMetadataOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.HttpEndpoint) > 0 { - objectKey := object.Key("HttpEndpoint") - objectKey.String(string(v.HttpEndpoint)) - } - - if len(v.HttpProtocolIpv6) > 0 { - objectKey := object.Key("HttpProtocolIpv6") - objectKey.String(string(v.HttpProtocolIpv6)) - } - - if v.HttpPutResponseHopLimit != nil { - objectKey := object.Key("HttpPutResponseHopLimit") - objectKey.Integer(*v.HttpPutResponseHopLimit) - } - - if len(v.HttpTokens) > 0 { - objectKey := object.Key("HttpTokens") - objectKey.String(string(v.HttpTokens)) - } - - if len(v.InstanceMetadataTags) > 0 { - objectKey := object.Key("InstanceMetadataTags") - objectKey.String(string(v.InstanceMetadataTags)) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecification(v *types.InstanceNetworkInterfaceSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociateCarrierIpAddress != nil { - objectKey := object.Key("AssociateCarrierIpAddress") - objectKey.Boolean(*v.AssociateCarrierIpAddress) - } - - if v.AssociatePublicIpAddress != nil { - objectKey := object.Key("AssociatePublicIpAddress") - objectKey.Boolean(*v.AssociatePublicIpAddress) - } - - if v.ConnectionTrackingSpecification != nil { - objectKey := object.Key("ConnectionTrackingSpecification") - if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { - return err - } - } - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceIndex != nil { - objectKey := object.Key("DeviceIndex") - objectKey.Integer(*v.DeviceIndex) - } - - if v.EnaQueueCount != nil { - objectKey := object.Key("EnaQueueCount") - objectKey.Integer(*v.EnaQueueCount) - } - - if v.EnaSrdSpecification != nil { - objectKey := object.Key("EnaSrdSpecification") - if err := awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v.EnaSrdSpecification, objectKey); err != nil { - return err - } - } - - if v.Groups != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if v.InterfaceType != nil { - objectKey := object.Key("InterfaceType") - objectKey.String(*v.InterfaceType) - } - - if v.Ipv4PrefixCount != nil { - objectKey := object.Key("Ipv4PrefixCount") - objectKey.Integer(*v.Ipv4PrefixCount) - } - - if v.Ipv4Prefixes != nil { - objectKey := object.FlatKey("Ipv4Prefix") - if err := awsEc2query_serializeDocumentIpv4PrefixList(v.Ipv4Prefixes, objectKey); err != nil { - return err - } - } - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Addresses") - if err := awsEc2query_serializeDocumentInstanceIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.Ipv6PrefixCount != nil { - objectKey := object.Key("Ipv6PrefixCount") - objectKey.Integer(*v.Ipv6PrefixCount) - } - - if v.Ipv6Prefixes != nil { - objectKey := object.FlatKey("Ipv6Prefix") - if err := awsEc2query_serializeDocumentIpv6PrefixList(v.Ipv6Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkCardIndex != nil { - objectKey := object.Key("NetworkCardIndex") - objectKey.Integer(*v.NetworkCardIndex) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrimaryIpv6 != nil { - objectKey := object.Key("PrimaryIpv6") - objectKey.Boolean(*v.PrimaryIpv6) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddresses") - if err := awsEc2query_serializeDocumentPrivateIpAddressSpecificationList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecificationList(v []types.InstanceNetworkInterfaceSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentInstanceNetworkPerformanceOptionsRequest(v *types.InstanceNetworkPerformanceOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.BandwidthWeighting) > 0 { - objectKey := object.Key("BandwidthWeighting") - objectKey.String(string(v.BandwidthWeighting)) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceRequirements(v *types.InstanceRequirements, value query.Value) error { - object := value.Object() - _ = object - - if v.AcceleratorCount != nil { - objectKey := object.Key("AcceleratorCount") - if err := awsEc2query_serializeDocumentAcceleratorCount(v.AcceleratorCount, objectKey); err != nil { - return err - } - } - - if v.AcceleratorManufacturers != nil { - objectKey := object.FlatKey("AcceleratorManufacturerSet") - if err := awsEc2query_serializeDocumentAcceleratorManufacturerSet(v.AcceleratorManufacturers, objectKey); err != nil { - return err - } - } - - if v.AcceleratorNames != nil { - objectKey := object.FlatKey("AcceleratorNameSet") - if err := awsEc2query_serializeDocumentAcceleratorNameSet(v.AcceleratorNames, objectKey); err != nil { - return err - } - } - - if v.AcceleratorTotalMemoryMiB != nil { - objectKey := object.Key("AcceleratorTotalMemoryMiB") - if err := awsEc2query_serializeDocumentAcceleratorTotalMemoryMiB(v.AcceleratorTotalMemoryMiB, objectKey); err != nil { - return err - } - } - - if v.AcceleratorTypes != nil { - objectKey := object.FlatKey("AcceleratorTypeSet") - if err := awsEc2query_serializeDocumentAcceleratorTypeSet(v.AcceleratorTypes, objectKey); err != nil { - return err - } - } - - if v.AllowedInstanceTypes != nil { - objectKey := object.FlatKey("AllowedInstanceTypeSet") - if err := awsEc2query_serializeDocumentAllowedInstanceTypeSet(v.AllowedInstanceTypes, objectKey); err != nil { - return err - } - } - - if len(v.BareMetal) > 0 { - objectKey := object.Key("BareMetal") - objectKey.String(string(v.BareMetal)) - } - - if v.BaselineEbsBandwidthMbps != nil { - objectKey := object.Key("BaselineEbsBandwidthMbps") - if err := awsEc2query_serializeDocumentBaselineEbsBandwidthMbps(v.BaselineEbsBandwidthMbps, objectKey); err != nil { - return err - } - } - - if v.BaselinePerformanceFactors != nil { - objectKey := object.Key("BaselinePerformanceFactors") - if err := awsEc2query_serializeDocumentBaselinePerformanceFactors(v.BaselinePerformanceFactors, objectKey); err != nil { - return err - } - } - - if len(v.BurstablePerformance) > 0 { - objectKey := object.Key("BurstablePerformance") - objectKey.String(string(v.BurstablePerformance)) - } - - if v.CpuManufacturers != nil { - objectKey := object.FlatKey("CpuManufacturerSet") - if err := awsEc2query_serializeDocumentCpuManufacturerSet(v.CpuManufacturers, objectKey); err != nil { - return err - } - } - - if v.ExcludedInstanceTypes != nil { - objectKey := object.FlatKey("ExcludedInstanceTypeSet") - if err := awsEc2query_serializeDocumentExcludedInstanceTypeSet(v.ExcludedInstanceTypes, objectKey); err != nil { - return err - } - } - - if v.InstanceGenerations != nil { - objectKey := object.FlatKey("InstanceGenerationSet") - if err := awsEc2query_serializeDocumentInstanceGenerationSet(v.InstanceGenerations, objectKey); err != nil { - return err - } - } - - if len(v.LocalStorage) > 0 { - objectKey := object.Key("LocalStorage") - objectKey.String(string(v.LocalStorage)) - } - - if v.LocalStorageTypes != nil { - objectKey := object.FlatKey("LocalStorageTypeSet") - if err := awsEc2query_serializeDocumentLocalStorageTypeSet(v.LocalStorageTypes, objectKey); err != nil { - return err - } - } - - if v.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice != nil { - objectKey := object.Key("MaxSpotPriceAsPercentageOfOptimalOnDemandPrice") - objectKey.Integer(*v.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice) - } - - if v.MemoryGiBPerVCpu != nil { - objectKey := object.Key("MemoryGiBPerVCpu") - if err := awsEc2query_serializeDocumentMemoryGiBPerVCpu(v.MemoryGiBPerVCpu, objectKey); err != nil { - return err - } - } - - if v.MemoryMiB != nil { - objectKey := object.Key("MemoryMiB") - if err := awsEc2query_serializeDocumentMemoryMiB(v.MemoryMiB, objectKey); err != nil { - return err - } - } - - if v.NetworkBandwidthGbps != nil { - objectKey := object.Key("NetworkBandwidthGbps") - if err := awsEc2query_serializeDocumentNetworkBandwidthGbps(v.NetworkBandwidthGbps, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceCount != nil { - objectKey := object.Key("NetworkInterfaceCount") - if err := awsEc2query_serializeDocumentNetworkInterfaceCount(v.NetworkInterfaceCount, objectKey); err != nil { - return err - } - } - - if v.OnDemandMaxPricePercentageOverLowestPrice != nil { - objectKey := object.Key("OnDemandMaxPricePercentageOverLowestPrice") - objectKey.Integer(*v.OnDemandMaxPricePercentageOverLowestPrice) - } - - if v.RequireHibernateSupport != nil { - objectKey := object.Key("RequireHibernateSupport") - objectKey.Boolean(*v.RequireHibernateSupport) - } - - if v.SpotMaxPricePercentageOverLowestPrice != nil { - objectKey := object.Key("SpotMaxPricePercentageOverLowestPrice") - objectKey.Integer(*v.SpotMaxPricePercentageOverLowestPrice) - } - - if v.TotalLocalStorageGB != nil { - objectKey := object.Key("TotalLocalStorageGB") - if err := awsEc2query_serializeDocumentTotalLocalStorageGB(v.TotalLocalStorageGB, objectKey); err != nil { - return err - } - } - - if v.VCpuCount != nil { - objectKey := object.Key("VCpuCount") - if err := awsEc2query_serializeDocumentVCpuCountRange(v.VCpuCount, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceRequirementsRequest(v *types.InstanceRequirementsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.AcceleratorCount != nil { - objectKey := object.Key("AcceleratorCount") - if err := awsEc2query_serializeDocumentAcceleratorCountRequest(v.AcceleratorCount, objectKey); err != nil { - return err - } - } - - if v.AcceleratorManufacturers != nil { - objectKey := object.FlatKey("AcceleratorManufacturer") - if err := awsEc2query_serializeDocumentAcceleratorManufacturerSet(v.AcceleratorManufacturers, objectKey); err != nil { - return err - } - } - - if v.AcceleratorNames != nil { - objectKey := object.FlatKey("AcceleratorName") - if err := awsEc2query_serializeDocumentAcceleratorNameSet(v.AcceleratorNames, objectKey); err != nil { - return err - } - } - - if v.AcceleratorTotalMemoryMiB != nil { - objectKey := object.Key("AcceleratorTotalMemoryMiB") - if err := awsEc2query_serializeDocumentAcceleratorTotalMemoryMiBRequest(v.AcceleratorTotalMemoryMiB, objectKey); err != nil { - return err - } - } - - if v.AcceleratorTypes != nil { - objectKey := object.FlatKey("AcceleratorType") - if err := awsEc2query_serializeDocumentAcceleratorTypeSet(v.AcceleratorTypes, objectKey); err != nil { - return err - } - } - - if v.AllowedInstanceTypes != nil { - objectKey := object.FlatKey("AllowedInstanceType") - if err := awsEc2query_serializeDocumentAllowedInstanceTypeSet(v.AllowedInstanceTypes, objectKey); err != nil { - return err - } - } - - if len(v.BareMetal) > 0 { - objectKey := object.Key("BareMetal") - objectKey.String(string(v.BareMetal)) - } - - if v.BaselineEbsBandwidthMbps != nil { - objectKey := object.Key("BaselineEbsBandwidthMbps") - if err := awsEc2query_serializeDocumentBaselineEbsBandwidthMbpsRequest(v.BaselineEbsBandwidthMbps, objectKey); err != nil { - return err - } - } - - if v.BaselinePerformanceFactors != nil { - objectKey := object.Key("BaselinePerformanceFactors") - if err := awsEc2query_serializeDocumentBaselinePerformanceFactorsRequest(v.BaselinePerformanceFactors, objectKey); err != nil { - return err - } - } - - if len(v.BurstablePerformance) > 0 { - objectKey := object.Key("BurstablePerformance") - objectKey.String(string(v.BurstablePerformance)) - } - - if v.CpuManufacturers != nil { - objectKey := object.FlatKey("CpuManufacturer") - if err := awsEc2query_serializeDocumentCpuManufacturerSet(v.CpuManufacturers, objectKey); err != nil { - return err - } - } - - if v.ExcludedInstanceTypes != nil { - objectKey := object.FlatKey("ExcludedInstanceType") - if err := awsEc2query_serializeDocumentExcludedInstanceTypeSet(v.ExcludedInstanceTypes, objectKey); err != nil { - return err - } - } - - if v.InstanceGenerations != nil { - objectKey := object.FlatKey("InstanceGeneration") - if err := awsEc2query_serializeDocumentInstanceGenerationSet(v.InstanceGenerations, objectKey); err != nil { - return err - } - } - - if len(v.LocalStorage) > 0 { - objectKey := object.Key("LocalStorage") - objectKey.String(string(v.LocalStorage)) - } - - if v.LocalStorageTypes != nil { - objectKey := object.FlatKey("LocalStorageType") - if err := awsEc2query_serializeDocumentLocalStorageTypeSet(v.LocalStorageTypes, objectKey); err != nil { - return err - } - } - - if v.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice != nil { - objectKey := object.Key("MaxSpotPriceAsPercentageOfOptimalOnDemandPrice") - objectKey.Integer(*v.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice) - } - - if v.MemoryGiBPerVCpu != nil { - objectKey := object.Key("MemoryGiBPerVCpu") - if err := awsEc2query_serializeDocumentMemoryGiBPerVCpuRequest(v.MemoryGiBPerVCpu, objectKey); err != nil { - return err - } - } - - if v.MemoryMiB != nil { - objectKey := object.Key("MemoryMiB") - if err := awsEc2query_serializeDocumentMemoryMiBRequest(v.MemoryMiB, objectKey); err != nil { - return err - } - } - - if v.NetworkBandwidthGbps != nil { - objectKey := object.Key("NetworkBandwidthGbps") - if err := awsEc2query_serializeDocumentNetworkBandwidthGbpsRequest(v.NetworkBandwidthGbps, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceCount != nil { - objectKey := object.Key("NetworkInterfaceCount") - if err := awsEc2query_serializeDocumentNetworkInterfaceCountRequest(v.NetworkInterfaceCount, objectKey); err != nil { - return err - } - } - - if v.OnDemandMaxPricePercentageOverLowestPrice != nil { - objectKey := object.Key("OnDemandMaxPricePercentageOverLowestPrice") - objectKey.Integer(*v.OnDemandMaxPricePercentageOverLowestPrice) - } - - if v.RequireHibernateSupport != nil { - objectKey := object.Key("RequireHibernateSupport") - objectKey.Boolean(*v.RequireHibernateSupport) - } - - if v.SpotMaxPricePercentageOverLowestPrice != nil { - objectKey := object.Key("SpotMaxPricePercentageOverLowestPrice") - objectKey.Integer(*v.SpotMaxPricePercentageOverLowestPrice) - } - - if v.TotalLocalStorageGB != nil { - objectKey := object.Key("TotalLocalStorageGB") - if err := awsEc2query_serializeDocumentTotalLocalStorageGBRequest(v.TotalLocalStorageGB, objectKey); err != nil { - return err - } - } - - if v.VCpuCount != nil { - objectKey := object.Key("VCpuCount") - if err := awsEc2query_serializeDocumentVCpuCountRangeRequest(v.VCpuCount, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceRequirementsWithMetadataRequest(v *types.InstanceRequirementsWithMetadataRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ArchitectureTypes != nil { - objectKey := object.FlatKey("ArchitectureType") - if err := awsEc2query_serializeDocumentArchitectureTypeSet(v.ArchitectureTypes, objectKey); err != nil { - return err - } - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirementsRequest(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if v.VirtualizationTypes != nil { - objectKey := object.FlatKey("VirtualizationType") - if err := awsEc2query_serializeDocumentVirtualizationTypeSet(v.VirtualizationTypes, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceSpecification(v *types.InstanceSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.ExcludeBootVolume != nil { - objectKey := object.Key("ExcludeBootVolume") - objectKey.Boolean(*v.ExcludeBootVolume) - } - - if v.ExcludeDataVolumeIds != nil { - objectKey := object.FlatKey("ExcludeDataVolumeId") - if err := awsEc2query_serializeDocumentVolumeIdStringList(v.ExcludeDataVolumeIds, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeDocumentInstanceTagKeySet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceTypeList(v []types.InstanceType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentInstanceTypes(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIntegrateServices(v *types.IntegrateServices, value query.Value) error { - object := value.Object() - _ = object - - if v.AthenaIntegrations != nil { - objectKey := object.FlatKey("AthenaIntegration") - if err := awsEc2query_serializeDocumentAthenaIntegrationsSet(v.AthenaIntegrations, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentInternetGatewayIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpamCidrAuthorizationContext(v *types.IpamCidrAuthorizationContext, value query.Value) error { - object := value.Object() - _ = object - - if v.Message != nil { - objectKey := object.Key("Message") - objectKey.String(*v.Message) - } - - if v.Signature != nil { - objectKey := object.Key("Signature") - objectKey.String(*v.Signature) - } - - return nil -} - -func awsEc2query_serializeDocumentIpamPoolAllocationAllowedCidrs(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpamPoolAllocationDisallowedCidrs(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpamPoolSourceResourceRequest(v *types.IpamPoolSourceResourceRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ResourceId != nil { - objectKey := object.Key("ResourceId") - objectKey.String(*v.ResourceId) - } - - if v.ResourceOwner != nil { - objectKey := object.Key("ResourceOwner") - objectKey.String(*v.ResourceOwner) - } - - if v.ResourceRegion != nil { - objectKey := object.Key("ResourceRegion") - objectKey.String(*v.ResourceRegion) - } - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - return nil -} - -func awsEc2query_serializeDocumentIpList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpPermission(v *types.IpPermission, value query.Value) error { - object := value.Object() - _ = object - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.IpRanges != nil { - objectKey := object.FlatKey("IpRanges") - if err := awsEc2query_serializeDocumentIpRangeList(v.IpRanges, objectKey); err != nil { - return err - } - } - - if v.Ipv6Ranges != nil { - objectKey := object.FlatKey("Ipv6Ranges") - if err := awsEc2query_serializeDocumentIpv6RangeList(v.Ipv6Ranges, objectKey); err != nil { - return err - } - } - - if v.PrefixListIds != nil { - objectKey := object.FlatKey("PrefixListIds") - if err := awsEc2query_serializeDocumentPrefixListIdList(v.PrefixListIds, objectKey); err != nil { - return err - } - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - if v.UserIdGroupPairs != nil { - objectKey := object.FlatKey("Groups") - if err := awsEc2query_serializeDocumentUserIdGroupPairList(v.UserIdGroupPairs, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentIpPermissionList(v []types.IpPermission, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIpPermission(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentIpPrefixList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpRange(v *types.IpRange, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIp != nil { - objectKey := object.Key("CidrIp") - objectKey.String(*v.CidrIp) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - return nil -} - -func awsEc2query_serializeDocumentIpRangeList(v []types.IpRange, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIpRange(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentIpv4PrefixList(v []types.Ipv4PrefixSpecificationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIpv4PrefixSpecificationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentIpv4PrefixSpecificationRequest(v *types.Ipv4PrefixSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv4Prefix != nil { - objectKey := object.Key("Ipv4Prefix") - objectKey.String(*v.Ipv4Prefix) - } - - return nil -} - -func awsEc2query_serializeDocumentIpv6AddressList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpv6PoolIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentIpv6PrefixList(v []types.Ipv6PrefixSpecificationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIpv6PrefixSpecificationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentIpv6PrefixSpecificationRequest(v *types.Ipv6PrefixSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6Prefix != nil { - objectKey := object.Key("Ipv6Prefix") - objectKey.String(*v.Ipv6Prefix) - } - - return nil -} - -func awsEc2query_serializeDocumentIpv6Range(v *types.Ipv6Range, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIpv6 != nil { - objectKey := object.Key("CidrIpv6") - objectKey.String(*v.CidrIpv6) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - return nil -} - -func awsEc2query_serializeDocumentIpv6RangeList(v []types.Ipv6Range, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentIpv6Range(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentKeyNameStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("KeyName") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentKeyPairIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("KeyPairId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLaunchPermission(v *types.LaunchPermission, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Group) > 0 { - objectKey := object.Key("Group") - objectKey.String(string(v.Group)) - } - - if v.OrganizationalUnitArn != nil { - objectKey := object.Key("OrganizationalUnitArn") - objectKey.String(*v.OrganizationalUnitArn) - } - - if v.OrganizationArn != nil { - objectKey := object.Key("OrganizationArn") - objectKey.String(*v.OrganizationArn) - } - - if v.UserId != nil { - objectKey := object.Key("UserId") - objectKey.String(*v.UserId) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchPermissionList(v []types.LaunchPermission, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchPermission(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchPermissionModifications(v *types.LaunchPermissionModifications, value query.Value) error { - object := value.Object() - _ = object - - if v.Add != nil { - objectKey := object.FlatKey("Add") - if err := awsEc2query_serializeDocumentLaunchPermissionList(v.Add, objectKey); err != nil { - return err - } - } - - if v.Remove != nil { - objectKey := object.FlatKey("Remove") - if err := awsEc2query_serializeDocumentLaunchPermissionList(v.Remove, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchSpecsList(v []types.SpotFleetLaunchSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentSpotFleetLaunchSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateBlockDeviceMappingRequest(v *types.LaunchTemplateBlockDeviceMappingRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Ebs != nil { - objectKey := object.Key("Ebs") - if err := awsEc2query_serializeDocumentLaunchTemplateEbsBlockDeviceRequest(v.Ebs, objectKey); err != nil { - return err - } - } - - if v.NoDevice != nil { - objectKey := object.Key("NoDevice") - objectKey.String(*v.NoDevice) - } - - if v.VirtualName != nil { - objectKey := object.Key("VirtualName") - objectKey.String(*v.VirtualName) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateBlockDeviceMappingRequestList(v []types.LaunchTemplateBlockDeviceMappingRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("BlockDeviceMapping") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateBlockDeviceMappingRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateCapacityReservationSpecificationRequest(v *types.LaunchTemplateCapacityReservationSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.CapacityReservationPreference) > 0 { - objectKey := object.Key("CapacityReservationPreference") - objectKey.String(string(v.CapacityReservationPreference)) - } - - if v.CapacityReservationTarget != nil { - objectKey := object.Key("CapacityReservationTarget") - if err := awsEc2query_serializeDocumentCapacityReservationTarget(v.CapacityReservationTarget, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateConfig(v *types.LaunchTemplateConfig, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateSpecification != nil { - objectKey := object.Key("LaunchTemplateSpecification") - if err := awsEc2query_serializeDocumentFleetLaunchTemplateSpecification(v.LaunchTemplateSpecification, objectKey); err != nil { - return err - } - } - - if v.Overrides != nil { - objectKey := object.FlatKey("Overrides") - if err := awsEc2query_serializeDocumentLaunchTemplateOverridesList(v.Overrides, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateConfigList(v []types.LaunchTemplateConfig, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateConfig(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateCpuOptionsRequest(v *types.LaunchTemplateCpuOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AmdSevSnp) > 0 { - objectKey := object.Key("AmdSevSnp") - objectKey.String(string(v.AmdSevSnp)) - } - - if v.CoreCount != nil { - objectKey := object.Key("CoreCount") - objectKey.Integer(*v.CoreCount) - } - - if v.ThreadsPerCore != nil { - objectKey := object.Key("ThreadsPerCore") - objectKey.Integer(*v.ThreadsPerCore) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateEbsBlockDeviceRequest(v *types.LaunchTemplateEbsBlockDeviceRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.Throughput != nil { - objectKey := object.Key("Throughput") - objectKey.Integer(*v.Throughput) - } - - if v.VolumeInitializationRate != nil { - objectKey := object.Key("VolumeInitializationRate") - objectKey.Integer(*v.VolumeInitializationRate) - } - - if v.VolumeSize != nil { - objectKey := object.Key("VolumeSize") - objectKey.Integer(*v.VolumeSize) - } - - if len(v.VolumeType) > 0 { - objectKey := object.Key("VolumeType") - objectKey.String(string(v.VolumeType)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateElasticInferenceAccelerator(v *types.LaunchTemplateElasticInferenceAccelerator, value query.Value) error { - object := value.Object() - _ = object - - if v.Count != nil { - objectKey := object.Key("Count") - objectKey.Integer(*v.Count) - } - - if v.Type != nil { - objectKey := object.Key("Type") - objectKey.String(*v.Type) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateElasticInferenceAcceleratorList(v []types.LaunchTemplateElasticInferenceAccelerator, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateElasticInferenceAccelerator(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateEnclaveOptionsRequest(v *types.LaunchTemplateEnclaveOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateHibernationOptionsRequest(v *types.LaunchTemplateHibernationOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Configured != nil { - objectKey := object.Key("Configured") - objectKey.Boolean(*v.Configured) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateIamInstanceProfileSpecificationRequest(v *types.LaunchTemplateIamInstanceProfileSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Arn != nil { - objectKey := object.Key("Arn") - objectKey.String(*v.Arn) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateInstanceMaintenanceOptionsRequest(v *types.LaunchTemplateInstanceMaintenanceOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AutoRecovery) > 0 { - objectKey := object.Key("AutoRecovery") - objectKey.String(string(v.AutoRecovery)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateInstanceMarketOptionsRequest(v *types.LaunchTemplateInstanceMarketOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.MarketType) > 0 { - objectKey := object.Key("MarketType") - objectKey.String(string(v.MarketType)) - } - - if v.SpotOptions != nil { - objectKey := object.Key("SpotOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateSpotMarketOptionsRequest(v.SpotOptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateInstanceMetadataOptionsRequest(v *types.LaunchTemplateInstanceMetadataOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.HttpEndpoint) > 0 { - objectKey := object.Key("HttpEndpoint") - objectKey.String(string(v.HttpEndpoint)) - } - - if len(v.HttpProtocolIpv6) > 0 { - objectKey := object.Key("HttpProtocolIpv6") - objectKey.String(string(v.HttpProtocolIpv6)) - } - - if v.HttpPutResponseHopLimit != nil { - objectKey := object.Key("HttpPutResponseHopLimit") - objectKey.Integer(*v.HttpPutResponseHopLimit) - } - - if len(v.HttpTokens) > 0 { - objectKey := object.Key("HttpTokens") - objectKey.String(string(v.HttpTokens)) - } - - if len(v.InstanceMetadataTags) > 0 { - objectKey := object.Key("InstanceMetadataTags") - objectKey.String(string(v.InstanceMetadataTags)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationRequest(v *types.LaunchTemplateInstanceNetworkInterfaceSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociateCarrierIpAddress != nil { - objectKey := object.Key("AssociateCarrierIpAddress") - objectKey.Boolean(*v.AssociateCarrierIpAddress) - } - - if v.AssociatePublicIpAddress != nil { - objectKey := object.Key("AssociatePublicIpAddress") - objectKey.Boolean(*v.AssociatePublicIpAddress) - } - - if v.ConnectionTrackingSpecification != nil { - objectKey := object.Key("ConnectionTrackingSpecification") - if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { - return err - } - } - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceIndex != nil { - objectKey := object.Key("DeviceIndex") - objectKey.Integer(*v.DeviceIndex) - } - - if v.EnaQueueCount != nil { - objectKey := object.Key("EnaQueueCount") - objectKey.Integer(*v.EnaQueueCount) - } - - if v.EnaSrdSpecification != nil { - objectKey := object.Key("EnaSrdSpecification") - if err := awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v.EnaSrdSpecification, objectKey); err != nil { - return err - } - } - - if v.Groups != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if v.InterfaceType != nil { - objectKey := object.Key("InterfaceType") - objectKey.String(*v.InterfaceType) - } - - if v.Ipv4PrefixCount != nil { - objectKey := object.Key("Ipv4PrefixCount") - objectKey.Integer(*v.Ipv4PrefixCount) - } - - if v.Ipv4Prefixes != nil { - objectKey := object.FlatKey("Ipv4Prefix") - if err := awsEc2query_serializeDocumentIpv4PrefixList(v.Ipv4Prefixes, objectKey); err != nil { - return err - } - } - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Addresses") - if err := awsEc2query_serializeDocumentInstanceIpv6AddressListRequest(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.Ipv6PrefixCount != nil { - objectKey := object.Key("Ipv6PrefixCount") - objectKey.Integer(*v.Ipv6PrefixCount) - } - - if v.Ipv6Prefixes != nil { - objectKey := object.FlatKey("Ipv6Prefix") - if err := awsEc2query_serializeDocumentIpv6PrefixList(v.Ipv6Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkCardIndex != nil { - objectKey := object.Key("NetworkCardIndex") - objectKey.Integer(*v.NetworkCardIndex) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrimaryIpv6 != nil { - objectKey := object.Key("PrimaryIpv6") - objectKey.Boolean(*v.PrimaryIpv6) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddresses") - if err := awsEc2query_serializeDocumentPrivateIpAddressSpecificationList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationRequestList(v []types.LaunchTemplateInstanceNetworkInterfaceSpecificationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("InstanceNetworkInterfaceSpecification") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateLicenseConfigurationRequest(v *types.LaunchTemplateLicenseConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LicenseConfigurationArn != nil { - objectKey := object.Key("LicenseConfigurationArn") - objectKey.String(*v.LicenseConfigurationArn) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateLicenseSpecificationListRequest(v []types.LaunchTemplateLicenseConfigurationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateLicenseConfigurationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateNameStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateNetworkPerformanceOptionsRequest(v *types.LaunchTemplateNetworkPerformanceOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.BandwidthWeighting) > 0 { - objectKey := object.Key("BandwidthWeighting") - objectKey.String(string(v.BandwidthWeighting)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateOverrides(v *types.LaunchTemplateOverrides, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirements(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.Priority != nil { - objectKey := object.Key("Priority") - switch { - case math.IsNaN(*v.Priority): - objectKey.String("NaN") - - case math.IsInf(*v.Priority, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Priority, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Priority) - - } - } - - if v.SpotPrice != nil { - objectKey := object.Key("SpotPrice") - objectKey.String(*v.SpotPrice) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.WeightedCapacity != nil { - objectKey := object.Key("WeightedCapacity") - switch { - case math.IsNaN(*v.WeightedCapacity): - objectKey.String("NaN") - - case math.IsInf(*v.WeightedCapacity, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.WeightedCapacity, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.WeightedCapacity) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateOverridesList(v []types.LaunchTemplateOverrides, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateOverrides(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplatePlacementRequest(v *types.LaunchTemplatePlacementRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Affinity != nil { - objectKey := object.Key("Affinity") - objectKey.String(*v.Affinity) - } - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.HostId != nil { - objectKey := object.Key("HostId") - objectKey.String(*v.HostId) - } - - if v.HostResourceGroupArn != nil { - objectKey := object.Key("HostResourceGroupArn") - objectKey.String(*v.HostResourceGroupArn) - } - - if v.PartitionNumber != nil { - objectKey := object.Key("PartitionNumber") - objectKey.Integer(*v.PartitionNumber) - } - - if v.SpreadDomain != nil { - objectKey := object.Key("SpreadDomain") - objectKey.String(*v.SpreadDomain) - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplatePrivateDnsNameOptionsRequest(v *types.LaunchTemplatePrivateDnsNameOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EnableResourceNameDnsAAAARecord != nil { - objectKey := object.Key("EnableResourceNameDnsAAAARecord") - objectKey.Boolean(*v.EnableResourceNameDnsAAAARecord) - } - - if v.EnableResourceNameDnsARecord != nil { - objectKey := object.Key("EnableResourceNameDnsARecord") - objectKey.Boolean(*v.EnableResourceNameDnsARecord) - } - - if len(v.HostnameType) > 0 { - objectKey := object.Key("HostnameType") - objectKey.String(string(v.HostnameType)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplatesMonitoringRequest(v *types.LaunchTemplatesMonitoringRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateSpecification(v *types.LaunchTemplateSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Version != nil { - objectKey := object.Key("Version") - objectKey.String(*v.Version) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateSpotMarketOptionsRequest(v *types.LaunchTemplateSpotMarketOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.BlockDurationMinutes != nil { - objectKey := object.Key("BlockDurationMinutes") - objectKey.Integer(*v.BlockDurationMinutes) - } - - if len(v.InstanceInterruptionBehavior) > 0 { - objectKey := object.Key("InstanceInterruptionBehavior") - objectKey.String(string(v.InstanceInterruptionBehavior)) - } - - if v.MaxPrice != nil { - objectKey := object.Key("MaxPrice") - objectKey.String(*v.MaxPrice) - } - - if len(v.SpotInstanceType) > 0 { - objectKey := object.Key("SpotInstanceType") - objectKey.String(string(v.SpotInstanceType)) - } - - if v.ValidUntil != nil { - objectKey := object.Key("ValidUntil") - objectKey.String(smithytime.FormatDateTime(*v.ValidUntil)) - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateTagSpecificationRequest(v *types.LaunchTemplateTagSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsEc2query_serializeDocumentTagList(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLaunchTemplateTagSpecificationRequestList(v []types.LaunchTemplateTagSpecificationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("LaunchTemplateTagSpecificationRequest") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLaunchTemplateTagSpecificationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLicenseConfigurationRequest(v *types.LicenseConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.LicenseConfigurationArn != nil { - objectKey := object.Key("LicenseConfigurationArn") - objectKey.String(*v.LicenseConfigurationArn) - } - - return nil -} - -func awsEc2query_serializeDocumentLicenseSpecificationListRequest(v []types.LicenseConfigurationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLicenseConfigurationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLoadBalancersConfig(v *types.LoadBalancersConfig, value query.Value) error { - object := value.Object() - _ = object - - if v.ClassicLoadBalancersConfig != nil { - objectKey := object.Key("ClassicLoadBalancersConfig") - if err := awsEc2query_serializeDocumentClassicLoadBalancersConfig(v.ClassicLoadBalancersConfig, objectKey); err != nil { - return err - } - } - - if v.TargetGroupsConfig != nil { - objectKey := object.Key("TargetGroupsConfig") - if err := awsEc2query_serializeDocumentTargetGroupsConfig(v.TargetGroupsConfig, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLoadPermissionListRequest(v []types.LoadPermissionRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentLoadPermissionRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentLoadPermissionModifications(v *types.LoadPermissionModifications, value query.Value) error { - object := value.Object() - _ = object - - if v.Add != nil { - objectKey := object.FlatKey("Add") - if err := awsEc2query_serializeDocumentLoadPermissionListRequest(v.Add, objectKey); err != nil { - return err - } - } - - if v.Remove != nil { - objectKey := object.FlatKey("Remove") - if err := awsEc2query_serializeDocumentLoadPermissionListRequest(v.Remove, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentLoadPermissionRequest(v *types.LoadPermissionRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Group) > 0 { - objectKey := object.Key("Group") - objectKey.String(string(v.Group)) - } - - if v.UserId != nil { - objectKey := object.Key("UserId") - objectKey.String(*v.UserId) - } - - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayRouteTableIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayRouteTableVpcAssociationIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayVirtualInterfaceGroupIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalGatewayVirtualInterfaceIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentLocalStorageTypeSet(v []types.LocalStorageType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentMacModificationTaskIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentMacSystemIntegrityProtectionConfigurationRequest(v *types.MacSystemIntegrityProtectionConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AppleInternal) > 0 { - objectKey := object.Key("AppleInternal") - objectKey.String(string(v.AppleInternal)) - } - - if len(v.BaseSystem) > 0 { - objectKey := object.Key("BaseSystem") - objectKey.String(string(v.BaseSystem)) - } - - if len(v.DebuggingRestrictions) > 0 { - objectKey := object.Key("DebuggingRestrictions") - objectKey.String(string(v.DebuggingRestrictions)) - } - - if len(v.DTraceRestrictions) > 0 { - objectKey := object.Key("DTraceRestrictions") - objectKey.String(string(v.DTraceRestrictions)) - } - - if len(v.FilesystemProtections) > 0 { - objectKey := object.Key("FilesystemProtections") - objectKey.String(string(v.FilesystemProtections)) - } - - if len(v.KextSigning) > 0 { - objectKey := object.Key("KextSigning") - objectKey.String(string(v.KextSigning)) - } - - if len(v.NvramProtections) > 0 { - objectKey := object.Key("NvramProtections") - objectKey.String(string(v.NvramProtections)) - } - - return nil -} - -func awsEc2query_serializeDocumentMemoryGiBPerVCpu(v *types.MemoryGiBPerVCpu, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentMemoryGiBPerVCpuRequest(v *types.MemoryGiBPerVCpuRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentMemoryMiB(v *types.MemoryMiB, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentMemoryMiBRequest(v *types.MemoryMiBRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyTransitGatewayOptions(v *types.ModifyTransitGatewayOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AddTransitGatewayCidrBlocks != nil { - objectKey := object.FlatKey("AddTransitGatewayCidrBlocks") - if err := awsEc2query_serializeDocumentTransitGatewayCidrBlockStringList(v.AddTransitGatewayCidrBlocks, objectKey); err != nil { - return err - } - } - - if v.AmazonSideAsn != nil { - objectKey := object.Key("AmazonSideAsn") - objectKey.Long(*v.AmazonSideAsn) - } - - if v.AssociationDefaultRouteTableId != nil { - objectKey := object.Key("AssociationDefaultRouteTableId") - objectKey.String(*v.AssociationDefaultRouteTableId) - } - - if len(v.AutoAcceptSharedAttachments) > 0 { - objectKey := object.Key("AutoAcceptSharedAttachments") - objectKey.String(string(v.AutoAcceptSharedAttachments)) - } - - if len(v.DefaultRouteTableAssociation) > 0 { - objectKey := object.Key("DefaultRouteTableAssociation") - objectKey.String(string(v.DefaultRouteTableAssociation)) - } - - if len(v.DefaultRouteTablePropagation) > 0 { - objectKey := object.Key("DefaultRouteTablePropagation") - objectKey.String(string(v.DefaultRouteTablePropagation)) - } - - if len(v.DnsSupport) > 0 { - objectKey := object.Key("DnsSupport") - objectKey.String(string(v.DnsSupport)) - } - - if v.PropagationDefaultRouteTableId != nil { - objectKey := object.Key("PropagationDefaultRouteTableId") - objectKey.String(*v.PropagationDefaultRouteTableId) - } - - if v.RemoveTransitGatewayCidrBlocks != nil { - objectKey := object.FlatKey("RemoveTransitGatewayCidrBlocks") - if err := awsEc2query_serializeDocumentTransitGatewayCidrBlockStringList(v.RemoveTransitGatewayCidrBlocks, objectKey); err != nil { - return err - } - } - - if len(v.SecurityGroupReferencingSupport) > 0 { - objectKey := object.Key("SecurityGroupReferencingSupport") - objectKey.String(string(v.SecurityGroupReferencingSupport)) - } - - if len(v.VpnEcmpSupport) > 0 { - objectKey := object.Key("VpnEcmpSupport") - objectKey.String(string(v.VpnEcmpSupport)) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyTransitGatewayVpcAttachmentRequestOptions(v *types.ModifyTransitGatewayVpcAttachmentRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ApplianceModeSupport) > 0 { - objectKey := object.Key("ApplianceModeSupport") - objectKey.String(string(v.ApplianceModeSupport)) - } - - if len(v.DnsSupport) > 0 { - objectKey := object.Key("DnsSupport") - objectKey.String(string(v.DnsSupport)) - } - - if len(v.Ipv6Support) > 0 { - objectKey := object.Key("Ipv6Support") - objectKey.String(string(v.Ipv6Support)) - } - - if len(v.SecurityGroupReferencingSupport) > 0 { - objectKey := object.Key("SecurityGroupReferencingSupport") - objectKey.String(string(v.SecurityGroupReferencingSupport)) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointCidrOptions(v *types.ModifyVerifiedAccessEndpointCidrOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointEniOptions(v *types.ModifyVerifiedAccessEndpointEniOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointLoadBalancerOptions(v *types.ModifyVerifiedAccessEndpointLoadBalancerOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if v.PortRanges != nil { - objectKey := object.FlatKey("PortRange") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRangeList(v.PortRanges, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRange(v *types.ModifyVerifiedAccessEndpointPortRange, value query.Value) error { - object := value.Object() - _ = object - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRangeList(v []types.ModifyVerifiedAccessEndpointPortRange, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointPortRange(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointRdsOptions(v *types.ModifyVerifiedAccessEndpointRdsOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Port != nil { - objectKey := object.Key("Port") - objectKey.Integer(*v.Port) - } - - if v.RdsEndpoint != nil { - objectKey := object.Key("RdsEndpoint") - objectKey.String(*v.RdsEndpoint) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessEndpointSubnetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessNativeApplicationOidcOptions(v *types.ModifyVerifiedAccessNativeApplicationOidcOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AuthorizationEndpoint != nil { - objectKey := object.Key("AuthorizationEndpoint") - objectKey.String(*v.AuthorizationEndpoint) - } - - if v.ClientId != nil { - objectKey := object.Key("ClientId") - objectKey.String(*v.ClientId) - } - - if v.ClientSecret != nil { - objectKey := object.Key("ClientSecret") - objectKey.String(*v.ClientSecret) - } - - if v.Issuer != nil { - objectKey := object.Key("Issuer") - objectKey.String(*v.Issuer) - } - - if v.PublicSigningKeyEndpoint != nil { - objectKey := object.Key("PublicSigningKeyEndpoint") - objectKey.String(*v.PublicSigningKeyEndpoint) - } - - if v.Scope != nil { - objectKey := object.Key("Scope") - objectKey.String(*v.Scope) - } - - if v.TokenEndpoint != nil { - objectKey := object.Key("TokenEndpoint") - objectKey.String(*v.TokenEndpoint) - } - - if v.UserInfoEndpoint != nil { - objectKey := object.Key("UserInfoEndpoint") - objectKey.String(*v.UserInfoEndpoint) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessTrustProviderDeviceOptions(v *types.ModifyVerifiedAccessTrustProviderDeviceOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.PublicSigningKeyUrl != nil { - objectKey := object.Key("PublicSigningKeyUrl") - objectKey.String(*v.PublicSigningKeyUrl) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVerifiedAccessTrustProviderOidcOptions(v *types.ModifyVerifiedAccessTrustProviderOidcOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AuthorizationEndpoint != nil { - objectKey := object.Key("AuthorizationEndpoint") - objectKey.String(*v.AuthorizationEndpoint) - } - - if v.ClientId != nil { - objectKey := object.Key("ClientId") - objectKey.String(*v.ClientId) - } - - if v.ClientSecret != nil { - objectKey := object.Key("ClientSecret") - objectKey.String(*v.ClientSecret) - } - - if v.Issuer != nil { - objectKey := object.Key("Issuer") - objectKey.String(*v.Issuer) - } - - if v.Scope != nil { - objectKey := object.Key("Scope") - objectKey.String(*v.Scope) - } - - if v.TokenEndpoint != nil { - objectKey := object.Key("TokenEndpoint") - objectKey.String(*v.TokenEndpoint) - } - - if v.UserInfoEndpoint != nil { - objectKey := object.Key("UserInfoEndpoint") - objectKey.String(*v.UserInfoEndpoint) - } - - return nil -} - -func awsEc2query_serializeDocumentModifyVpnTunnelOptionsSpecification(v *types.ModifyVpnTunnelOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.DPDTimeoutAction != nil { - objectKey := object.Key("DPDTimeoutAction") - objectKey.String(*v.DPDTimeoutAction) - } - - if v.DPDTimeoutSeconds != nil { - objectKey := object.Key("DPDTimeoutSeconds") - objectKey.Integer(*v.DPDTimeoutSeconds) - } - - if v.EnableTunnelLifecycleControl != nil { - objectKey := object.Key("EnableTunnelLifecycleControl") - objectKey.Boolean(*v.EnableTunnelLifecycleControl) - } - - if v.IKEVersions != nil { - objectKey := object.FlatKey("IKEVersion") - if err := awsEc2query_serializeDocumentIKEVersionsRequestList(v.IKEVersions, objectKey); err != nil { - return err - } - } - - if v.LogOptions != nil { - objectKey := object.Key("LogOptions") - if err := awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v.LogOptions, objectKey); err != nil { - return err - } - } - - if v.Phase1DHGroupNumbers != nil { - objectKey := object.FlatKey("Phase1DHGroupNumber") - if err := awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestList(v.Phase1DHGroupNumbers, objectKey); err != nil { - return err - } - } - - if v.Phase1EncryptionAlgorithms != nil { - objectKey := object.FlatKey("Phase1EncryptionAlgorithm") - if err := awsEc2query_serializeDocumentPhase1EncryptionAlgorithmsRequestList(v.Phase1EncryptionAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase1IntegrityAlgorithms != nil { - objectKey := object.FlatKey("Phase1IntegrityAlgorithm") - if err := awsEc2query_serializeDocumentPhase1IntegrityAlgorithmsRequestList(v.Phase1IntegrityAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase1LifetimeSeconds != nil { - objectKey := object.Key("Phase1LifetimeSeconds") - objectKey.Integer(*v.Phase1LifetimeSeconds) - } - - if v.Phase2DHGroupNumbers != nil { - objectKey := object.FlatKey("Phase2DHGroupNumber") - if err := awsEc2query_serializeDocumentPhase2DHGroupNumbersRequestList(v.Phase2DHGroupNumbers, objectKey); err != nil { - return err - } - } - - if v.Phase2EncryptionAlgorithms != nil { - objectKey := object.FlatKey("Phase2EncryptionAlgorithm") - if err := awsEc2query_serializeDocumentPhase2EncryptionAlgorithmsRequestList(v.Phase2EncryptionAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase2IntegrityAlgorithms != nil { - objectKey := object.FlatKey("Phase2IntegrityAlgorithm") - if err := awsEc2query_serializeDocumentPhase2IntegrityAlgorithmsRequestList(v.Phase2IntegrityAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase2LifetimeSeconds != nil { - objectKey := object.Key("Phase2LifetimeSeconds") - objectKey.Integer(*v.Phase2LifetimeSeconds) - } - - if v.PreSharedKey != nil { - objectKey := object.Key("PreSharedKey") - objectKey.String(*v.PreSharedKey) - } - - if v.RekeyFuzzPercentage != nil { - objectKey := object.Key("RekeyFuzzPercentage") - objectKey.Integer(*v.RekeyFuzzPercentage) - } - - if v.RekeyMarginTimeSeconds != nil { - objectKey := object.Key("RekeyMarginTimeSeconds") - objectKey.Integer(*v.RekeyMarginTimeSeconds) - } - - if v.ReplayWindowSize != nil { - objectKey := object.Key("ReplayWindowSize") - objectKey.Integer(*v.ReplayWindowSize) - } - - if v.StartupAction != nil { - objectKey := object.Key("StartupAction") - objectKey.String(*v.StartupAction) - } - - if v.TunnelInsideCidr != nil { - objectKey := object.Key("TunnelInsideCidr") - objectKey.String(*v.TunnelInsideCidr) - } - - if v.TunnelInsideIpv6Cidr != nil { - objectKey := object.Key("TunnelInsideIpv6Cidr") - objectKey.String(*v.TunnelInsideIpv6Cidr) - } - - return nil -} - -func awsEc2query_serializeDocumentNatGatewayIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkAclIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkBandwidthGbps(v *types.NetworkBandwidthGbps, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentNetworkBandwidthGbpsRequest(v *types.NetworkBandwidthGbpsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentNetworkInsightsAccessScopeAnalysisIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkInsightsAccessScopeIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkInsightsAnalysisIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkInsightsPathIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkInterfaceAttachmentChanges(v *types.NetworkInterfaceAttachmentChanges, value query.Value) error { - object := value.Object() - _ = object - - if v.AttachmentId != nil { - objectKey := object.Key("AttachmentId") - objectKey.String(*v.AttachmentId) - } - - if v.DefaultEnaQueueCount != nil { - objectKey := object.Key("DefaultEnaQueueCount") - objectKey.Boolean(*v.DefaultEnaQueueCount) - } - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.EnaQueueCount != nil { - objectKey := object.Key("EnaQueueCount") - objectKey.Integer(*v.EnaQueueCount) - } - - return nil -} - -func awsEc2query_serializeDocumentNetworkInterfaceCount(v *types.NetworkInterfaceCount, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentNetworkInterfaceCountRequest(v *types.NetworkInterfaceCountRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentNetworkInterfaceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNetworkInterfacePermissionIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentNewDhcpConfiguration(v *types.NewDhcpConfiguration, value query.Value) error { - object := value.Object() - _ = object - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - if v.Values != nil { - objectKey := object.FlatKey("Value") - if err := awsEc2query_serializeDocumentValueStringList(v.Values, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentNewDhcpConfigurationList(v []types.NewDhcpConfiguration, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentNewDhcpConfiguration(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentOccurrenceDayRequestSet(v []int32, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("OccurenceDay") - - for i := range v { - av := array.Value() - av.Integer(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentOnDemandOptionsRequest(v *types.OnDemandOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AllocationStrategy) > 0 { - objectKey := object.Key("AllocationStrategy") - objectKey.String(string(v.AllocationStrategy)) - } - - if v.CapacityReservationOptions != nil { - objectKey := object.Key("CapacityReservationOptions") - if err := awsEc2query_serializeDocumentCapacityReservationOptionsRequest(v.CapacityReservationOptions, objectKey); err != nil { - return err - } - } - - if v.MaxTotalPrice != nil { - objectKey := object.Key("MaxTotalPrice") - objectKey.String(*v.MaxTotalPrice) - } - - if v.MinTargetCapacity != nil { - objectKey := object.Key("MinTargetCapacity") - objectKey.Integer(*v.MinTargetCapacity) - } - - if v.SingleAvailabilityZone != nil { - objectKey := object.Key("SingleAvailabilityZone") - objectKey.Boolean(*v.SingleAvailabilityZone) - } - - if v.SingleInstanceType != nil { - objectKey := object.Key("SingleInstanceType") - objectKey.Boolean(*v.SingleInstanceType) - } - - return nil -} - -func awsEc2query_serializeDocumentOperatorRequest(v *types.OperatorRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Principal != nil { - objectKey := object.Key("Principal") - objectKey.String(*v.Principal) - } - - return nil -} - -func awsEc2query_serializeDocumentOrganizationalUnitArnStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("OrganizationalUnitArn") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentOrganizationArnStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("OrganizationArn") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentOutpostLagIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentOwnerStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Owner") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPacketHeaderStatementRequest(v *types.PacketHeaderStatementRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationAddresses != nil { - objectKey := object.FlatKey("DestinationAddress") - if err := awsEc2query_serializeDocumentValueStringList(v.DestinationAddresses, objectKey); err != nil { - return err - } - } - - if v.DestinationPorts != nil { - objectKey := object.FlatKey("DestinationPort") - if err := awsEc2query_serializeDocumentValueStringList(v.DestinationPorts, objectKey); err != nil { - return err - } - } - - if v.DestinationPrefixLists != nil { - objectKey := object.FlatKey("DestinationPrefixList") - if err := awsEc2query_serializeDocumentValueStringList(v.DestinationPrefixLists, objectKey); err != nil { - return err - } - } - - if v.Protocols != nil { - objectKey := object.FlatKey("Protocol") - if err := awsEc2query_serializeDocumentProtocolList(v.Protocols, objectKey); err != nil { - return err - } - } - - if v.SourceAddresses != nil { - objectKey := object.FlatKey("SourceAddress") - if err := awsEc2query_serializeDocumentValueStringList(v.SourceAddresses, objectKey); err != nil { - return err - } - } - - if v.SourcePorts != nil { - objectKey := object.FlatKey("SourcePort") - if err := awsEc2query_serializeDocumentValueStringList(v.SourcePorts, objectKey); err != nil { - return err - } - } - - if v.SourcePrefixLists != nil { - objectKey := object.FlatKey("SourcePrefixList") - if err := awsEc2query_serializeDocumentValueStringList(v.SourcePrefixLists, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentPathRequestFilter(v *types.PathRequestFilter, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationAddress != nil { - objectKey := object.Key("DestinationAddress") - objectKey.String(*v.DestinationAddress) - } - - if v.DestinationPortRange != nil { - objectKey := object.Key("DestinationPortRange") - if err := awsEc2query_serializeDocumentRequestFilterPortRange(v.DestinationPortRange, objectKey); err != nil { - return err - } - } - - if v.SourceAddress != nil { - objectKey := object.Key("SourceAddress") - objectKey.String(*v.SourceAddress) - } - - if v.SourcePortRange != nil { - objectKey := object.Key("SourcePortRange") - if err := awsEc2query_serializeDocumentRequestFilterPortRange(v.SourcePortRange, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentPathStatementRequest(v *types.PathStatementRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.PacketHeaderStatement != nil { - objectKey := object.Key("PacketHeaderStatement") - if err := awsEc2query_serializeDocumentPacketHeaderStatementRequest(v.PacketHeaderStatement, objectKey); err != nil { - return err - } - } - - if v.ResourceStatement != nil { - objectKey := object.Key("ResourceStatement") - if err := awsEc2query_serializeDocumentResourceStatementRequest(v.ResourceStatement, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentPeeringConnectionOptionsRequest(v *types.PeeringConnectionOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.AllowDnsResolutionFromRemoteVpc != nil { - objectKey := object.Key("AllowDnsResolutionFromRemoteVpc") - objectKey.Boolean(*v.AllowDnsResolutionFromRemoteVpc) - } - - if v.AllowEgressFromLocalClassicLinkToRemoteVpc != nil { - objectKey := object.Key("AllowEgressFromLocalClassicLinkToRemoteVpc") - objectKey.Boolean(*v.AllowEgressFromLocalClassicLinkToRemoteVpc) - } - - if v.AllowEgressFromLocalVpcToRemoteClassicLink != nil { - objectKey := object.Key("AllowEgressFromLocalVpcToRemoteClassicLink") - objectKey.Boolean(*v.AllowEgressFromLocalVpcToRemoteClassicLink) - } - - return nil -} - -func awsEc2query_serializeDocumentPerformanceFactorReference(v *types.PerformanceFactorReference, value query.Value) error { - object := value.Object() - _ = object - - if v.InstanceFamily != nil { - objectKey := object.Key("InstanceFamily") - objectKey.String(*v.InstanceFamily) - } - - return nil -} - -func awsEc2query_serializeDocumentPerformanceFactorReferenceRequest(v *types.PerformanceFactorReferenceRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.InstanceFamily != nil { - objectKey := object.Key("InstanceFamily") - objectKey.String(*v.InstanceFamily) - } - - return nil -} - -func awsEc2query_serializeDocumentPerformanceFactorReferenceSet(v []types.PerformanceFactorReference, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPerformanceFactorReference(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPerformanceFactorReferenceSetRequest(v []types.PerformanceFactorReferenceRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPerformanceFactorReferenceRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestList(v []types.Phase1DHGroupNumbersRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestListValue(v *types.Phase1DHGroupNumbersRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.Integer(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPhase1EncryptionAlgorithmsRequestList(v []types.Phase1EncryptionAlgorithmsRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase1EncryptionAlgorithmsRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase1EncryptionAlgorithmsRequestListValue(v *types.Phase1EncryptionAlgorithmsRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPhase1IntegrityAlgorithmsRequestList(v []types.Phase1IntegrityAlgorithmsRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase1IntegrityAlgorithmsRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase1IntegrityAlgorithmsRequestListValue(v *types.Phase1IntegrityAlgorithmsRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPhase2DHGroupNumbersRequestList(v []types.Phase2DHGroupNumbersRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase2DHGroupNumbersRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase2DHGroupNumbersRequestListValue(v *types.Phase2DHGroupNumbersRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.Integer(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPhase2EncryptionAlgorithmsRequestList(v []types.Phase2EncryptionAlgorithmsRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase2EncryptionAlgorithmsRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase2EncryptionAlgorithmsRequestListValue(v *types.Phase2EncryptionAlgorithmsRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPhase2IntegrityAlgorithmsRequestList(v []types.Phase2IntegrityAlgorithmsRequestListValue, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPhase2IntegrityAlgorithmsRequestListValue(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPhase2IntegrityAlgorithmsRequestListValue(v *types.Phase2IntegrityAlgorithmsRequestListValue, value query.Value) error { - object := value.Object() - _ = object - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentPlacement(v *types.Placement, value query.Value) error { - object := value.Object() - _ = object - - if v.Affinity != nil { - objectKey := object.Key("Affinity") - objectKey.String(*v.Affinity) - } - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.HostId != nil { - objectKey := object.Key("HostId") - objectKey.String(*v.HostId) - } - - if v.HostResourceGroupArn != nil { - objectKey := object.Key("HostResourceGroupArn") - objectKey.String(*v.HostResourceGroupArn) - } - - if v.PartitionNumber != nil { - objectKey := object.Key("PartitionNumber") - objectKey.Integer(*v.PartitionNumber) - } - - if v.SpreadDomain != nil { - objectKey := object.Key("SpreadDomain") - objectKey.String(*v.SpreadDomain) - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - return nil -} - -func awsEc2query_serializeDocumentPlacementGroupIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("GroupId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPlacementGroupStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPortRange(v *types.PortRange, value query.Value) error { - object := value.Object() - _ = object - - if v.From != nil { - objectKey := object.Key("From") - objectKey.Integer(*v.From) - } - - if v.To != nil { - objectKey := object.Key("To") - objectKey.Integer(*v.To) - } - - return nil -} - -func awsEc2query_serializeDocumentPrefixListId(v *types.PrefixListId, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - return nil -} - -func awsEc2query_serializeDocumentPrefixListIdList(v []types.PrefixListId, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPrefixListId(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPrefixListResourceIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPriceScheduleSpecification(v *types.PriceScheduleSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.CurrencyCode) > 0 { - objectKey := object.Key("CurrencyCode") - objectKey.String(string(v.CurrencyCode)) - } - - if v.Price != nil { - objectKey := object.Key("Price") - switch { - case math.IsNaN(*v.Price): - objectKey.String("NaN") - - case math.IsInf(*v.Price, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Price, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Price) - - } - } - - if v.Term != nil { - objectKey := object.Key("Term") - objectKey.Long(*v.Term) - } - - return nil -} - -func awsEc2query_serializeDocumentPriceScheduleSpecificationList(v []types.PriceScheduleSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPriceScheduleSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPrivateDnsNameOptionsRequest(v *types.PrivateDnsNameOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EnableResourceNameDnsAAAARecord != nil { - objectKey := object.Key("EnableResourceNameDnsAAAARecord") - objectKey.Boolean(*v.EnableResourceNameDnsAAAARecord) - } - - if v.EnableResourceNameDnsARecord != nil { - objectKey := object.Key("EnableResourceNameDnsARecord") - objectKey.Boolean(*v.EnableResourceNameDnsARecord) - } - - if len(v.HostnameType) > 0 { - objectKey := object.Key("HostnameType") - objectKey.String(string(v.HostnameType)) - } - - return nil -} - -func awsEc2query_serializeDocumentPrivateIpAddressConfigSet(v []types.ScheduledInstancesPrivateIpAddressConfig, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("PrivateIpAddressConfigSet") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentScheduledInstancesPrivateIpAddressConfig(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPrivateIpAddressSpecification(v *types.PrivateIpAddressSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.Primary != nil { - objectKey := object.Key("Primary") - objectKey.Boolean(*v.Primary) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - return nil -} - -func awsEc2query_serializeDocumentPrivateIpAddressSpecificationList(v []types.PrivateIpAddressSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPrivateIpAddressSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentPrivateIpAddressStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("PrivateIpAddress") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentProductCodeStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ProductCode") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentProductDescriptionList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentProtocolList(v []types.Protocol, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentPublicIpStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("PublicIp") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPublicIpv4PoolIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentPurchaseRequest(v *types.PurchaseRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.PurchaseToken != nil { - objectKey := object.Key("PurchaseToken") - objectKey.String(*v.PurchaseToken) - } - - return nil -} - -func awsEc2query_serializeDocumentPurchaseRequestSet(v []types.PurchaseRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("PurchaseRequest") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentPurchaseRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentReasonCodesList(v []types.ReportInstanceReasonCodes, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentRegionNames(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRegionNameStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("RegionName") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRegisterInstanceTagAttributeRequest(v *types.RegisterInstanceTagAttributeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.IncludeAllTagsOfInstance != nil { - objectKey := object.Key("IncludeAllTagsOfInstance") - objectKey.Boolean(*v.IncludeAllTagsOfInstance) - } - - if v.InstanceTagKeys != nil { - objectKey := object.FlatKey("InstanceTagKey") - if err := awsEc2query_serializeDocumentInstanceTagKeySet(v.InstanceTagKeys, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentRemoveIpamOperatingRegion(v *types.RemoveIpamOperatingRegion, value query.Value) error { - object := value.Object() - _ = object - - if v.RegionName != nil { - objectKey := object.Key("RegionName") - objectKey.String(*v.RegionName) - } - - return nil -} - -func awsEc2query_serializeDocumentRemoveIpamOperatingRegionSet(v []types.RemoveIpamOperatingRegion, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentRemoveIpamOperatingRegion(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusion(v *types.RemoveIpamOrganizationalUnitExclusion, value query.Value) error { - object := value.Object() - _ = object - - if v.OrganizationsEntityPath != nil { - objectKey := object.Key("OrganizationsEntityPath") - objectKey.String(*v.OrganizationsEntityPath) - } - - return nil -} - -func awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusionSet(v []types.RemoveIpamOrganizationalUnitExclusion, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusion(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentRemovePrefixListEntries(v []types.RemovePrefixListEntry, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentRemovePrefixListEntry(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentRemovePrefixListEntry(v *types.RemovePrefixListEntry, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - return nil -} - -func awsEc2query_serializeDocumentReplaceRootVolumeTaskIds(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ReplaceRootVolumeTaskId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRequestFilterPortRange(v *types.RequestFilterPortRange, value query.Value) error { - object := value.Object() - _ = object - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeDocumentRequestHostIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRequestHostIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRequestInstanceTypeList(v []types.InstanceType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentRequestIpamResourceTag(v *types.RequestIpamResourceTag, value query.Value) error { - object := value.Object() - _ = object - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentRequestIpamResourceTagList(v []types.RequestIpamResourceTag, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentRequestIpamResourceTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentRequestLaunchTemplateData(v *types.RequestLaunchTemplateData, value query.Value) error { - object := value.Object() - _ = object - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentLaunchTemplateBlockDeviceMappingRequestList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.CapacityReservationSpecification != nil { - objectKey := object.Key("CapacityReservationSpecification") - if err := awsEc2query_serializeDocumentLaunchTemplateCapacityReservationSpecificationRequest(v.CapacityReservationSpecification, objectKey); err != nil { - return err - } - } - - if v.CpuOptions != nil { - objectKey := object.Key("CpuOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateCpuOptionsRequest(v.CpuOptions, objectKey); err != nil { - return err - } - } - - if v.CreditSpecification != nil { - objectKey := object.Key("CreditSpecification") - if err := awsEc2query_serializeDocumentCreditSpecificationRequest(v.CreditSpecification, objectKey); err != nil { - return err - } - } - - if v.DisableApiStop != nil { - objectKey := object.Key("DisableApiStop") - objectKey.Boolean(*v.DisableApiStop) - } - - if v.DisableApiTermination != nil { - objectKey := object.Key("DisableApiTermination") - objectKey.Boolean(*v.DisableApiTermination) - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.ElasticGpuSpecifications != nil { - objectKey := object.FlatKey("ElasticGpuSpecification") - if err := awsEc2query_serializeDocumentElasticGpuSpecificationList(v.ElasticGpuSpecifications, objectKey); err != nil { - return err - } - } - - if v.ElasticInferenceAccelerators != nil { - objectKey := object.FlatKey("ElasticInferenceAccelerator") - if err := awsEc2query_serializeDocumentLaunchTemplateElasticInferenceAcceleratorList(v.ElasticInferenceAccelerators, objectKey); err != nil { - return err - } - } - - if v.EnclaveOptions != nil { - objectKey := object.Key("EnclaveOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateEnclaveOptionsRequest(v.EnclaveOptions, objectKey); err != nil { - return err - } - } - - if v.HibernationOptions != nil { - objectKey := object.Key("HibernationOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateHibernationOptionsRequest(v.HibernationOptions, objectKey); err != nil { - return err - } - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentLaunchTemplateIamInstanceProfileSpecificationRequest(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if len(v.InstanceInitiatedShutdownBehavior) > 0 { - objectKey := object.Key("InstanceInitiatedShutdownBehavior") - objectKey.String(string(v.InstanceInitiatedShutdownBehavior)) - } - - if v.InstanceMarketOptions != nil { - objectKey := object.Key("InstanceMarketOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateInstanceMarketOptionsRequest(v.InstanceMarketOptions, objectKey); err != nil { - return err - } - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirementsRequest(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.LicenseSpecifications != nil { - objectKey := object.FlatKey("LicenseSpecification") - if err := awsEc2query_serializeDocumentLaunchTemplateLicenseSpecificationListRequest(v.LicenseSpecifications, objectKey); err != nil { - return err - } - } - - if v.MaintenanceOptions != nil { - objectKey := object.Key("MaintenanceOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateInstanceMaintenanceOptionsRequest(v.MaintenanceOptions, objectKey); err != nil { - return err - } - } - - if v.MetadataOptions != nil { - objectKey := object.Key("MetadataOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateInstanceMetadataOptionsRequest(v.MetadataOptions, objectKey); err != nil { - return err - } - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - if err := awsEc2query_serializeDocumentLaunchTemplatesMonitoringRequest(v.Monitoring, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaces != nil { - objectKey := object.FlatKey("NetworkInterface") - if err := awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecificationRequestList(v.NetworkInterfaces, objectKey); err != nil { - return err - } - } - - if v.NetworkPerformanceOptions != nil { - objectKey := object.Key("NetworkPerformanceOptions") - if err := awsEc2query_serializeDocumentLaunchTemplateNetworkPerformanceOptionsRequest(v.NetworkPerformanceOptions, objectKey); err != nil { - return err - } - } - - if v.Operator != nil { - objectKey := object.Key("Operator") - if err := awsEc2query_serializeDocumentOperatorRequest(v.Operator, objectKey); err != nil { - return err - } - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentLaunchTemplatePlacementRequest(v.Placement, objectKey); err != nil { - return err - } - } - - if v.PrivateDnsNameOptions != nil { - objectKey := object.Key("PrivateDnsNameOptions") - if err := awsEc2query_serializeDocumentLaunchTemplatePrivateDnsNameOptionsRequest(v.PrivateDnsNameOptions, objectKey); err != nil { - return err - } - } - - if v.RamDiskId != nil { - objectKey := object.Key("RamDiskId") - objectKey.String(*v.RamDiskId) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SecurityGroups != nil { - objectKey := object.FlatKey("SecurityGroup") - if err := awsEc2query_serializeDocumentSecurityGroupStringList(v.SecurityGroups, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentLaunchTemplateTagSpecificationRequestList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - objectKey.String(*v.UserData) - } - - return nil -} - -func awsEc2query_serializeDocumentRequestSpotLaunchSpecification(v *types.RequestSpotLaunchSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.AddressingType != nil { - objectKey := object.Key("AddressingType") - objectKey.String(*v.AddressingType) - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentBlockDeviceMappingList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentIamInstanceProfileSpecification(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - if err := awsEc2query_serializeDocumentRunInstancesMonitoringEnabled(v.Monitoring, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaces != nil { - objectKey := object.FlatKey("NetworkInterface") - if err := awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecificationList(v.NetworkInterfaces, objectKey); err != nil { - return err - } - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentSpotPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.RamdiskId != nil { - objectKey := object.Key("RamdiskId") - objectKey.String(*v.RamdiskId) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentRequestSpotLaunchSpecificationSecurityGroupIdList(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SecurityGroups != nil { - objectKey := object.FlatKey("SecurityGroup") - if err := awsEc2query_serializeDocumentRequestSpotLaunchSpecificationSecurityGroupList(v.SecurityGroups, objectKey); err != nil { - return err - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - objectKey.String(*v.UserData) - } - - return nil -} - -func awsEc2query_serializeDocumentRequestSpotLaunchSpecificationSecurityGroupIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRequestSpotLaunchSpecificationSecurityGroupList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentReservationFleetInstanceSpecification(v *types.ReservationFleetInstanceSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if len(v.InstancePlatform) > 0 { - objectKey := object.Key("InstancePlatform") - objectKey.String(string(v.InstancePlatform)) - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.Priority != nil { - objectKey := object.Key("Priority") - objectKey.Integer(*v.Priority) - } - - if v.Weight != nil { - objectKey := object.Key("Weight") - switch { - case math.IsNaN(*v.Weight): - objectKey.String("NaN") - - case math.IsInf(*v.Weight, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Weight, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Weight) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentReservationFleetInstanceSpecificationList(v []types.ReservationFleetInstanceSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentReservationFleetInstanceSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentReservedInstanceIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ReservedInstanceId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentReservedInstanceLimitPrice(v *types.ReservedInstanceLimitPrice, value query.Value) error { - object := value.Object() - _ = object - - if v.Amount != nil { - objectKey := object.Key("Amount") - switch { - case math.IsNaN(*v.Amount): - objectKey.String("NaN") - - case math.IsInf(*v.Amount, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Amount, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Amount) - - } - } - - if len(v.CurrencyCode) > 0 { - objectKey := object.Key("CurrencyCode") - objectKey.String(string(v.CurrencyCode)) - } - - return nil -} - -func awsEc2query_serializeDocumentReservedInstancesConfiguration(v *types.ReservedInstancesConfiguration, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.Platform != nil { - objectKey := object.Key("Platform") - objectKey.String(*v.Platform) - } - - if len(v.Scope) > 0 { - objectKey := object.Key("Scope") - objectKey.String(string(v.Scope)) - } - - return nil -} - -func awsEc2query_serializeDocumentReservedInstancesConfigurationList(v []types.ReservedInstancesConfiguration, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentReservedInstancesConfiguration(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentReservedInstancesIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ReservedInstancesId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentReservedInstancesModificationIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ReservedInstancesModificationId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentReservedInstancesOfferingIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentResourceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentResourceList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentResourceStatementRequest(v *types.ResourceStatementRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Resources != nil { - objectKey := object.FlatKey("Resource") - if err := awsEc2query_serializeDocumentValueStringList(v.Resources, objectKey); err != nil { - return err - } - } - - if v.ResourceTypes != nil { - objectKey := object.FlatKey("ResourceType") - if err := awsEc2query_serializeDocumentValueStringList(v.ResourceTypes, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentRestorableByStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRouteServerBgpOptionsRequest(v *types.RouteServerBgpOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.PeerAsn != nil { - objectKey := object.Key("PeerAsn") - objectKey.Long(*v.PeerAsn) - } - - if len(v.PeerLivenessDetection) > 0 { - objectKey := object.Key("PeerLivenessDetection") - objectKey.String(string(v.PeerLivenessDetection)) - } - - return nil -} - -func awsEc2query_serializeDocumentRouteServerEndpointIdsList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRouteServerIdsList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRouteServerPeerIdsList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRouteTableIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentRunInstancesMonitoringEnabled(v *types.RunInstancesMonitoringEnabled, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentS3ObjectTag(v *types.S3ObjectTag, value query.Value) error { - object := value.Object() - _ = object - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentS3ObjectTagList(v []types.S3ObjectTag, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentS3ObjectTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentS3Storage(v *types.S3Storage, value query.Value) error { - object := value.Object() - _ = object - - if v.AWSAccessKeyId != nil { - objectKey := object.Key("AWSAccessKeyId") - objectKey.String(*v.AWSAccessKeyId) - } - - if v.Bucket != nil { - objectKey := object.Key("Bucket") - objectKey.String(*v.Bucket) - } - - if v.Prefix != nil { - objectKey := object.Key("Prefix") - objectKey.String(*v.Prefix) - } - - if v.UploadPolicy != nil { - objectKey := object.Key("UploadPolicy") - objectKey.Base64EncodeBytes(v.UploadPolicy) - } - - if v.UploadPolicySignature != nil { - objectKey := object.Key("UploadPolicySignature") - objectKey.String(*v.UploadPolicySignature) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstanceIdRequestSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ScheduledInstanceId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentScheduledInstanceRecurrenceRequest(v *types.ScheduledInstanceRecurrenceRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Frequency != nil { - objectKey := object.Key("Frequency") - objectKey.String(*v.Frequency) - } - - if v.Interval != nil { - objectKey := object.Key("Interval") - objectKey.Integer(*v.Interval) - } - - if v.OccurrenceDays != nil { - objectKey := object.FlatKey("OccurrenceDay") - if err := awsEc2query_serializeDocumentOccurrenceDayRequestSet(v.OccurrenceDays, objectKey); err != nil { - return err - } - } - - if v.OccurrenceRelativeToEnd != nil { - objectKey := object.Key("OccurrenceRelativeToEnd") - objectKey.Boolean(*v.OccurrenceRelativeToEnd) - } - - if v.OccurrenceUnit != nil { - objectKey := object.Key("OccurrenceUnit") - objectKey.String(*v.OccurrenceUnit) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesBlockDeviceMapping(v *types.ScheduledInstancesBlockDeviceMapping, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.Ebs != nil { - objectKey := object.Key("Ebs") - if err := awsEc2query_serializeDocumentScheduledInstancesEbs(v.Ebs, objectKey); err != nil { - return err - } - } - - if v.NoDevice != nil { - objectKey := object.Key("NoDevice") - objectKey.String(*v.NoDevice) - } - - if v.VirtualName != nil { - objectKey := object.Key("VirtualName") - objectKey.String(*v.VirtualName) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesBlockDeviceMappingSet(v []types.ScheduledInstancesBlockDeviceMapping, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("BlockDeviceMapping") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentScheduledInstancesBlockDeviceMapping(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesEbs(v *types.ScheduledInstancesEbs, value query.Value) error { - object := value.Object() - _ = object - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.VolumeSize != nil { - objectKey := object.Key("VolumeSize") - objectKey.Integer(*v.VolumeSize) - } - - if v.VolumeType != nil { - objectKey := object.Key("VolumeType") - objectKey.String(*v.VolumeType) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesIamInstanceProfile(v *types.ScheduledInstancesIamInstanceProfile, value query.Value) error { - object := value.Object() - _ = object - - if v.Arn != nil { - objectKey := object.Key("Arn") - objectKey.String(*v.Arn) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesIpv6Address(v *types.ScheduledInstancesIpv6Address, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6Address != nil { - objectKey := object.Key("Ipv6Address") - objectKey.String(*v.Ipv6Address) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesIpv6AddressList(v []types.ScheduledInstancesIpv6Address, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Ipv6Address") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentScheduledInstancesIpv6Address(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesLaunchSpecification(v *types.ScheduledInstancesLaunchSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentScheduledInstancesBlockDeviceMappingSet(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentScheduledInstancesIamInstanceProfile(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - objectKey.String(*v.InstanceType) - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - if err := awsEc2query_serializeDocumentScheduledInstancesMonitoring(v.Monitoring, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaces != nil { - objectKey := object.FlatKey("NetworkInterface") - if err := awsEc2query_serializeDocumentScheduledInstancesNetworkInterfaceSet(v.NetworkInterfaces, objectKey); err != nil { - return err - } - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentScheduledInstancesPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.RamdiskId != nil { - objectKey := object.Key("RamdiskId") - objectKey.String(*v.RamdiskId) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentScheduledInstancesSecurityGroupIdSet(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - objectKey.String(*v.UserData) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesMonitoring(v *types.ScheduledInstancesMonitoring, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesNetworkInterface(v *types.ScheduledInstancesNetworkInterface, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociatePublicIpAddress != nil { - objectKey := object.Key("AssociatePublicIpAddress") - objectKey.Boolean(*v.AssociatePublicIpAddress) - } - - if v.DeleteOnTermination != nil { - objectKey := object.Key("DeleteOnTermination") - objectKey.Boolean(*v.DeleteOnTermination) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceIndex != nil { - objectKey := object.Key("DeviceIndex") - objectKey.Integer(*v.DeviceIndex) - } - - if v.Groups != nil { - objectKey := object.FlatKey("Group") - if err := awsEc2query_serializeDocumentScheduledInstancesSecurityGroupIdSet(v.Groups, objectKey); err != nil { - return err - } - } - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Address") - if err := awsEc2query_serializeDocumentScheduledInstancesIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.PrivateIpAddressConfigs != nil { - objectKey := object.FlatKey("PrivateIpAddressConfig") - if err := awsEc2query_serializeDocumentPrivateIpAddressConfigSet(v.PrivateIpAddressConfigs, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesNetworkInterfaceSet(v []types.ScheduledInstancesNetworkInterface, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("NetworkInterface") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentScheduledInstancesNetworkInterface(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesPlacement(v *types.ScheduledInstancesPlacement, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesPrivateIpAddressConfig(v *types.ScheduledInstancesPrivateIpAddressConfig, value query.Value) error { - object := value.Object() - _ = object - - if v.Primary != nil { - objectKey := object.Key("Primary") - objectKey.Boolean(*v.Primary) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - return nil -} - -func awsEc2query_serializeDocumentScheduledInstancesSecurityGroupIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SecurityGroupId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SecurityGroupId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupIdStringListRequest(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SecurityGroupId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleDescription(v *types.SecurityGroupRuleDescription, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.SecurityGroupRuleId != nil { - objectKey := object.Key("SecurityGroupRuleId") - objectKey.String(*v.SecurityGroupRuleId) - } - - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleDescriptionList(v []types.SecurityGroupRuleDescription, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentSecurityGroupRuleDescription(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleRequest(v *types.SecurityGroupRuleRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIpv4 != nil { - objectKey := object.Key("CidrIpv4") - objectKey.String(*v.CidrIpv4) - } - - if v.CidrIpv6 != nil { - objectKey := object.Key("CidrIpv6") - objectKey.String(*v.CidrIpv6) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.ReferencedGroupId != nil { - objectKey := object.Key("ReferencedGroupId") - objectKey.String(*v.ReferencedGroupId) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleUpdate(v *types.SecurityGroupRuleUpdate, value query.Value) error { - object := value.Object() - _ = object - - if v.SecurityGroupRule != nil { - objectKey := object.Key("SecurityGroupRule") - if err := awsEc2query_serializeDocumentSecurityGroupRuleRequest(v.SecurityGroupRule, objectKey); err != nil { - return err - } - } - - if v.SecurityGroupRuleId != nil { - objectKey := object.Key("SecurityGroupRuleId") - objectKey.String(*v.SecurityGroupRuleId) - } - - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupRuleUpdateList(v []types.SecurityGroupRuleUpdate, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentSecurityGroupRuleUpdate(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentSecurityGroupStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SecurityGroup") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentServiceLinkVirtualInterfaceIdSet(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSlotDateTimeRangeRequest(v *types.SlotDateTimeRangeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EarliestTime != nil { - objectKey := object.Key("EarliestTime") - objectKey.String(smithytime.FormatDateTime(*v.EarliestTime)) - } - - if v.LatestTime != nil { - objectKey := object.Key("LatestTime") - objectKey.String(smithytime.FormatDateTime(*v.LatestTime)) - } - - return nil -} - -func awsEc2query_serializeDocumentSlotStartTimeRangeRequest(v *types.SlotStartTimeRangeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.EarliestTime != nil { - objectKey := object.Key("EarliestTime") - objectKey.String(smithytime.FormatDateTime(*v.EarliestTime)) - } - - if v.LatestTime != nil { - objectKey := object.Key("LatestTime") - objectKey.String(smithytime.FormatDateTime(*v.LatestTime)) - } - - return nil -} - -func awsEc2query_serializeDocumentSnapshotDiskContainer(v *types.SnapshotDiskContainer, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.Format != nil { - objectKey := object.Key("Format") - objectKey.String(*v.Format) - } - - if v.Url != nil { - objectKey := object.Key("Url") - objectKey.String(*v.Url) - } - - if v.UserBucket != nil { - objectKey := object.Key("UserBucket") - if err := awsEc2query_serializeDocumentUserBucket(v.UserBucket, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentSnapshotIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SnapshotId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSpotCapacityRebalance(v *types.SpotCapacityRebalance, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ReplacementStrategy) > 0 { - objectKey := object.Key("ReplacementStrategy") - objectKey.String(string(v.ReplacementStrategy)) - } - - if v.TerminationDelay != nil { - objectKey := object.Key("TerminationDelay") - objectKey.Integer(*v.TerminationDelay) - } - - return nil -} - -func awsEc2query_serializeDocumentSpotFleetLaunchSpecification(v *types.SpotFleetLaunchSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.AddressingType != nil { - objectKey := object.Key("AddressingType") - objectKey.String(*v.AddressingType) - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentBlockDeviceMappingList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentIamInstanceProfileSpecification(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirements(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - if err := awsEc2query_serializeDocumentSpotFleetMonitoring(v.Monitoring, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaces != nil { - objectKey := object.FlatKey("NetworkInterfaceSet") - if err := awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecificationList(v.NetworkInterfaces, objectKey); err != nil { - return err - } - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentSpotPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.RamdiskId != nil { - objectKey := object.Key("RamdiskId") - objectKey.String(*v.RamdiskId) - } - - if v.SecurityGroups != nil { - objectKey := object.FlatKey("GroupSet") - if err := awsEc2query_serializeDocumentGroupIdentifierList(v.SecurityGroups, objectKey); err != nil { - return err - } - } - - if v.SpotPrice != nil { - objectKey := object.Key("SpotPrice") - objectKey.String(*v.SpotPrice) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecificationSet") - if err := awsEc2query_serializeDocumentSpotFleetTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - objectKey.String(*v.UserData) - } - - if v.WeightedCapacity != nil { - objectKey := object.Key("WeightedCapacity") - switch { - case math.IsNaN(*v.WeightedCapacity): - objectKey.String("NaN") - - case math.IsInf(*v.WeightedCapacity, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.WeightedCapacity, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.WeightedCapacity) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentSpotFleetMonitoring(v *types.SpotFleetMonitoring, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentSpotFleetRequestConfigData(v *types.SpotFleetRequestConfigData, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AllocationStrategy) > 0 { - objectKey := object.Key("AllocationStrategy") - objectKey.String(string(v.AllocationStrategy)) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Context != nil { - objectKey := object.Key("Context") - objectKey.String(*v.Context) - } - - if len(v.ExcessCapacityTerminationPolicy) > 0 { - objectKey := object.Key("ExcessCapacityTerminationPolicy") - objectKey.String(string(v.ExcessCapacityTerminationPolicy)) - } - - if v.FulfilledCapacity != nil { - objectKey := object.Key("FulfilledCapacity") - switch { - case math.IsNaN(*v.FulfilledCapacity): - objectKey.String("NaN") - - case math.IsInf(*v.FulfilledCapacity, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.FulfilledCapacity, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.FulfilledCapacity) - - } - } - - if v.IamFleetRole != nil { - objectKey := object.Key("IamFleetRole") - objectKey.String(*v.IamFleetRole) - } - - if len(v.InstanceInterruptionBehavior) > 0 { - objectKey := object.Key("InstanceInterruptionBehavior") - objectKey.String(string(v.InstanceInterruptionBehavior)) - } - - if v.InstancePoolsToUseCount != nil { - objectKey := object.Key("InstancePoolsToUseCount") - objectKey.Integer(*v.InstancePoolsToUseCount) - } - - if v.LaunchSpecifications != nil { - objectKey := object.FlatKey("LaunchSpecifications") - if err := awsEc2query_serializeDocumentLaunchSpecsList(v.LaunchSpecifications, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateConfigs != nil { - objectKey := object.FlatKey("LaunchTemplateConfigs") - if err := awsEc2query_serializeDocumentLaunchTemplateConfigList(v.LaunchTemplateConfigs, objectKey); err != nil { - return err - } - } - - if v.LoadBalancersConfig != nil { - objectKey := object.Key("LoadBalancersConfig") - if err := awsEc2query_serializeDocumentLoadBalancersConfig(v.LoadBalancersConfig, objectKey); err != nil { - return err - } - } - - if len(v.OnDemandAllocationStrategy) > 0 { - objectKey := object.Key("OnDemandAllocationStrategy") - objectKey.String(string(v.OnDemandAllocationStrategy)) - } - - if v.OnDemandFulfilledCapacity != nil { - objectKey := object.Key("OnDemandFulfilledCapacity") - switch { - case math.IsNaN(*v.OnDemandFulfilledCapacity): - objectKey.String("NaN") - - case math.IsInf(*v.OnDemandFulfilledCapacity, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.OnDemandFulfilledCapacity, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.OnDemandFulfilledCapacity) - - } - } - - if v.OnDemandMaxTotalPrice != nil { - objectKey := object.Key("OnDemandMaxTotalPrice") - objectKey.String(*v.OnDemandMaxTotalPrice) - } - - if v.OnDemandTargetCapacity != nil { - objectKey := object.Key("OnDemandTargetCapacity") - objectKey.Integer(*v.OnDemandTargetCapacity) - } - - if v.ReplaceUnhealthyInstances != nil { - objectKey := object.Key("ReplaceUnhealthyInstances") - objectKey.Boolean(*v.ReplaceUnhealthyInstances) - } - - if v.SpotMaintenanceStrategies != nil { - objectKey := object.Key("SpotMaintenanceStrategies") - if err := awsEc2query_serializeDocumentSpotMaintenanceStrategies(v.SpotMaintenanceStrategies, objectKey); err != nil { - return err - } - } - - if v.SpotMaxTotalPrice != nil { - objectKey := object.Key("SpotMaxTotalPrice") - objectKey.String(*v.SpotMaxTotalPrice) - } - - if v.SpotPrice != nil { - objectKey := object.Key("SpotPrice") - objectKey.String(*v.SpotPrice) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TargetCapacity != nil { - objectKey := object.Key("TargetCapacity") - objectKey.Integer(*v.TargetCapacity) - } - - if len(v.TargetCapacityUnitType) > 0 { - objectKey := object.Key("TargetCapacityUnitType") - objectKey.String(string(v.TargetCapacityUnitType)) - } - - if v.TerminateInstancesWithExpiration != nil { - objectKey := object.Key("TerminateInstancesWithExpiration") - objectKey.Boolean(*v.TerminateInstancesWithExpiration) - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - if v.ValidFrom != nil { - objectKey := object.Key("ValidFrom") - objectKey.String(smithytime.FormatDateTime(*v.ValidFrom)) - } - - if v.ValidUntil != nil { - objectKey := object.Key("ValidUntil") - objectKey.String(smithytime.FormatDateTime(*v.ValidUntil)) - } - - return nil -} - -func awsEc2query_serializeDocumentSpotFleetRequestIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSpotFleetTagSpecification(v *types.SpotFleetTagSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsEc2query_serializeDocumentTagList(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentSpotFleetTagSpecificationList(v []types.SpotFleetTagSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentSpotFleetTagSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentSpotInstanceRequestIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SpotInstanceRequestId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSpotMaintenanceStrategies(v *types.SpotMaintenanceStrategies, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityRebalance != nil { - objectKey := object.Key("CapacityRebalance") - if err := awsEc2query_serializeDocumentSpotCapacityRebalance(v.CapacityRebalance, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentSpotMarketOptions(v *types.SpotMarketOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.BlockDurationMinutes != nil { - objectKey := object.Key("BlockDurationMinutes") - objectKey.Integer(*v.BlockDurationMinutes) - } - - if len(v.InstanceInterruptionBehavior) > 0 { - objectKey := object.Key("InstanceInterruptionBehavior") - objectKey.String(string(v.InstanceInterruptionBehavior)) - } - - if v.MaxPrice != nil { - objectKey := object.Key("MaxPrice") - objectKey.String(*v.MaxPrice) - } - - if len(v.SpotInstanceType) > 0 { - objectKey := object.Key("SpotInstanceType") - objectKey.String(string(v.SpotInstanceType)) - } - - if v.ValidUntil != nil { - objectKey := object.Key("ValidUntil") - objectKey.String(smithytime.FormatDateTime(*v.ValidUntil)) - } - - return nil -} - -func awsEc2query_serializeDocumentSpotOptionsRequest(v *types.SpotOptionsRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AllocationStrategy) > 0 { - objectKey := object.Key("AllocationStrategy") - objectKey.String(string(v.AllocationStrategy)) - } - - if len(v.InstanceInterruptionBehavior) > 0 { - objectKey := object.Key("InstanceInterruptionBehavior") - objectKey.String(string(v.InstanceInterruptionBehavior)) - } - - if v.InstancePoolsToUseCount != nil { - objectKey := object.Key("InstancePoolsToUseCount") - objectKey.Integer(*v.InstancePoolsToUseCount) - } - - if v.MaintenanceStrategies != nil { - objectKey := object.Key("MaintenanceStrategies") - if err := awsEc2query_serializeDocumentFleetSpotMaintenanceStrategiesRequest(v.MaintenanceStrategies, objectKey); err != nil { - return err - } - } - - if v.MaxTotalPrice != nil { - objectKey := object.Key("MaxTotalPrice") - objectKey.String(*v.MaxTotalPrice) - } - - if v.MinTargetCapacity != nil { - objectKey := object.Key("MinTargetCapacity") - objectKey.Integer(*v.MinTargetCapacity) - } - - if v.SingleAvailabilityZone != nil { - objectKey := object.Key("SingleAvailabilityZone") - objectKey.Boolean(*v.SingleAvailabilityZone) - } - - if v.SingleInstanceType != nil { - objectKey := object.Key("SingleInstanceType") - objectKey.Boolean(*v.SingleInstanceType) - } - - return nil -} - -func awsEc2query_serializeDocumentSpotPlacement(v *types.SpotPlacement, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - return nil -} - -func awsEc2query_serializeDocumentStorage(v *types.Storage, value query.Value) error { - object := value.Object() - _ = object - - if v.S3 != nil { - objectKey := object.Key("S3") - if err := awsEc2query_serializeDocumentS3Storage(v.S3, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentStorageLocation(v *types.StorageLocation, value query.Value) error { - object := value.Object() - _ = object - - if v.Bucket != nil { - objectKey := object.Key("Bucket") - objectKey.String(*v.Bucket) - } - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - return nil -} - -func awsEc2query_serializeDocumentSubnetConfiguration(v *types.SubnetConfiguration, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv4 != nil { - objectKey := object.Key("Ipv4") - objectKey.String(*v.Ipv4) - } - - if v.Ipv6 != nil { - objectKey := object.Key("Ipv6") - objectKey.String(*v.Ipv6) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeDocumentSubnetConfigurationsList(v []types.SubnetConfiguration, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentSubnetConfiguration(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentSubnetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("AssociatedSubnetId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentSubnetIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("SubnetId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTag(v *types.Tag, value query.Value) error { - object := value.Object() - _ = object - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeDocumentTagList(v []types.Tag, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentTagSpecification(v *types.TagSpecification, value query.Value) error { - object := value.Object() - _ = object - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsEc2query_serializeDocumentTagList(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentTagSpecificationList(v []types.TagSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentTagSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentTargetCapacitySpecificationRequest(v *types.TargetCapacitySpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if len(v.DefaultTargetCapacityType) > 0 { - objectKey := object.Key("DefaultTargetCapacityType") - objectKey.String(string(v.DefaultTargetCapacityType)) - } - - if v.OnDemandTargetCapacity != nil { - objectKey := object.Key("OnDemandTargetCapacity") - objectKey.Integer(*v.OnDemandTargetCapacity) - } - - if v.SpotTargetCapacity != nil { - objectKey := object.Key("SpotTargetCapacity") - objectKey.Integer(*v.SpotTargetCapacity) - } - - if len(v.TargetCapacityUnitType) > 0 { - objectKey := object.Key("TargetCapacityUnitType") - objectKey.String(string(v.TargetCapacityUnitType)) - } - - if v.TotalTargetCapacity != nil { - objectKey := object.Key("TotalTargetCapacity") - objectKey.Integer(*v.TotalTargetCapacity) - } - - return nil -} - -func awsEc2query_serializeDocumentTargetConfigurationRequest(v *types.TargetConfigurationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.OfferingId != nil { - objectKey := object.Key("OfferingId") - objectKey.String(*v.OfferingId) - } - - return nil -} - -func awsEc2query_serializeDocumentTargetConfigurationRequestSet(v []types.TargetConfigurationRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("TargetConfigurationRequest") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentTargetConfigurationRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentTargetGroup(v *types.TargetGroup, value query.Value) error { - object := value.Object() - _ = object - - if v.Arn != nil { - objectKey := object.Key("Arn") - objectKey.String(*v.Arn) - } - - return nil -} - -func awsEc2query_serializeDocumentTargetGroups(v []types.TargetGroup, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentTargetGroup(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentTargetGroupsConfig(v *types.TargetGroupsConfig, value query.Value) error { - object := value.Object() - _ = object - - if v.TargetGroups != nil { - objectKey := object.FlatKey("TargetGroups") - if err := awsEc2query_serializeDocumentTargetGroups(v.TargetGroups, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentThroughResourcesStatementRequest(v *types.ThroughResourcesStatementRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.ResourceStatement != nil { - objectKey := object.Key("ResourceStatement") - if err := awsEc2query_serializeDocumentResourceStatementRequest(v.ResourceStatement, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentThroughResourcesStatementRequestList(v []types.ThroughResourcesStatementRequest, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentThroughResourcesStatementRequest(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentTotalLocalStorageGB(v *types.TotalLocalStorageGB, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentTotalLocalStorageGBRequest(v *types.TotalLocalStorageGBRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - switch { - case math.IsNaN(*v.Max): - objectKey.String("NaN") - - case math.IsInf(*v.Max, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Max, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Max) - - } - } - - if v.Min != nil { - objectKey := object.Key("Min") - switch { - case math.IsNaN(*v.Min): - objectKey.String("NaN") - - case math.IsInf(*v.Min, 1): - objectKey.String("Infinity") - - case math.IsInf(*v.Min, -1): - objectKey.String("-Infinity") - - default: - objectKey.Double(*v.Min) - - } - } - - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorFilterIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorFilterRuleFieldList(v []types.TrafficMirrorFilterRuleField, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorFilterRuleIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorNetworkServiceList(v []types.TrafficMirrorNetworkService, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorPortRangeRequest(v *types.TrafficMirrorPortRangeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorSessionFieldList(v []types.TrafficMirrorSessionField, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorSessionIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTrafficMirrorTargetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayAttachmentIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayCidrBlockStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayConnectPeerIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayConnectRequestBgpOptions(v *types.TransitGatewayConnectRequestBgpOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.PeerAsn != nil { - objectKey := object.Key("PeerAsn") - objectKey.Long(*v.PeerAsn) - } - - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayMulticastDomainIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayNetworkInterfaceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayPolicyTableIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayRequestOptions(v *types.TransitGatewayRequestOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.AmazonSideAsn != nil { - objectKey := object.Key("AmazonSideAsn") - objectKey.Long(*v.AmazonSideAsn) - } - - if len(v.AutoAcceptSharedAttachments) > 0 { - objectKey := object.Key("AutoAcceptSharedAttachments") - objectKey.String(string(v.AutoAcceptSharedAttachments)) - } - - if len(v.DefaultRouteTableAssociation) > 0 { - objectKey := object.Key("DefaultRouteTableAssociation") - objectKey.String(string(v.DefaultRouteTableAssociation)) - } - - if len(v.DefaultRouteTablePropagation) > 0 { - objectKey := object.Key("DefaultRouteTablePropagation") - objectKey.String(string(v.DefaultRouteTablePropagation)) - } - - if len(v.DnsSupport) > 0 { - objectKey := object.Key("DnsSupport") - objectKey.String(string(v.DnsSupport)) - } - - if len(v.MulticastSupport) > 0 { - objectKey := object.Key("MulticastSupport") - objectKey.String(string(v.MulticastSupport)) - } - - if len(v.SecurityGroupReferencingSupport) > 0 { - objectKey := object.Key("SecurityGroupReferencingSupport") - objectKey.String(string(v.SecurityGroupReferencingSupport)) - } - - if v.TransitGatewayCidrBlocks != nil { - objectKey := object.FlatKey("TransitGatewayCidrBlocks") - if err := awsEc2query_serializeDocumentTransitGatewayCidrBlockStringList(v.TransitGatewayCidrBlocks, objectKey); err != nil { - return err - } - } - - if len(v.VpnEcmpSupport) > 0 { - objectKey := object.Key("VpnEcmpSupport") - objectKey.String(string(v.VpnEcmpSupport)) - } - - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayRouteTableAnnouncementIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewayRouteTableIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentTrunkInterfaceAssociationIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentUserBucket(v *types.UserBucket, value query.Value) error { - object := value.Object() - _ = object - - if v.S3Bucket != nil { - objectKey := object.Key("S3Bucket") - objectKey.String(*v.S3Bucket) - } - - if v.S3Key != nil { - objectKey := object.Key("S3Key") - objectKey.String(*v.S3Key) - } - - return nil -} - -func awsEc2query_serializeDocumentUserData(v *types.UserData, value query.Value) error { - object := value.Object() - _ = object - - if v.Data != nil { - objectKey := object.Key("Data") - objectKey.String(*v.Data) - } - - return nil -} - -func awsEc2query_serializeDocumentUserGroupStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("UserGroup") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentUserIdGroupPair(v *types.UserIdGroupPair, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.PeeringStatus != nil { - objectKey := object.Key("PeeringStatus") - objectKey.String(*v.PeeringStatus) - } - - if v.UserId != nil { - objectKey := object.Key("UserId") - objectKey.String(*v.UserId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeDocumentUserIdGroupPairList(v []types.UserIdGroupPair, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentUserIdGroupPair(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentUserIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("UserId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentValueStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVCpuCountRange(v *types.VCpuCountRange, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentVCpuCountRangeRequest(v *types.VCpuCountRangeRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.Max != nil { - objectKey := object.Key("Max") - objectKey.Integer(*v.Max) - } - - if v.Min != nil { - objectKey := object.Key("Min") - objectKey.Integer(*v.Min) - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessEndpointIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessGroupIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessInstanceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessLogCloudWatchLogsDestinationOptions(v *types.VerifiedAccessLogCloudWatchLogsDestinationOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - if v.LogGroup != nil { - objectKey := object.Key("LogGroup") - objectKey.String(*v.LogGroup) - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessLogKinesisDataFirehoseDestinationOptions(v *types.VerifiedAccessLogKinesisDataFirehoseDestinationOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.DeliveryStream != nil { - objectKey := object.Key("DeliveryStream") - objectKey.String(*v.DeliveryStream) - } - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessLogOptions(v *types.VerifiedAccessLogOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.CloudWatchLogs != nil { - objectKey := object.Key("CloudWatchLogs") - if err := awsEc2query_serializeDocumentVerifiedAccessLogCloudWatchLogsDestinationOptions(v.CloudWatchLogs, objectKey); err != nil { - return err - } - } - - if v.IncludeTrustContext != nil { - objectKey := object.Key("IncludeTrustContext") - objectKey.Boolean(*v.IncludeTrustContext) - } - - if v.KinesisDataFirehose != nil { - objectKey := object.Key("KinesisDataFirehose") - if err := awsEc2query_serializeDocumentVerifiedAccessLogKinesisDataFirehoseDestinationOptions(v.KinesisDataFirehose, objectKey); err != nil { - return err - } - } - - if v.LogVersion != nil { - objectKey := object.Key("LogVersion") - objectKey.String(*v.LogVersion) - } - - if v.S3 != nil { - objectKey := object.Key("S3") - if err := awsEc2query_serializeDocumentVerifiedAccessLogS3DestinationOptions(v.S3, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessLogS3DestinationOptions(v *types.VerifiedAccessLogS3DestinationOptions, value query.Value) error { - object := value.Object() - _ = object - - if v.BucketName != nil { - objectKey := object.Key("BucketName") - objectKey.String(*v.BucketName) - } - - if v.BucketOwner != nil { - objectKey := object.Key("BucketOwner") - objectKey.String(*v.BucketOwner) - } - - if v.Enabled != nil { - objectKey := object.Key("Enabled") - objectKey.Boolean(*v.Enabled) - } - - if v.Prefix != nil { - objectKey := object.Key("Prefix") - objectKey.String(*v.Prefix) - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v *types.VerifiedAccessSseSpecificationRequest, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomerManagedKeyEnabled != nil { - objectKey := object.Key("CustomerManagedKeyEnabled") - objectKey.Boolean(*v.CustomerManagedKeyEnabled) - } - - if v.KmsKeyArn != nil { - objectKey := object.Key("KmsKeyArn") - objectKey.String(*v.KmsKeyArn) - } - - return nil -} - -func awsEc2query_serializeDocumentVerifiedAccessTrustProviderIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVersionStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVirtualizationTypeSet(v []types.VirtualizationType, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsEc2query_serializeDocumentVolumeDetail(v *types.VolumeDetail, value query.Value) error { - object := value.Object() - _ = object - - if v.Size != nil { - objectKey := object.Key("Size") - objectKey.Long(*v.Size) - } - - return nil -} - -func awsEc2query_serializeDocumentVolumeIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("VolumeId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcBlockPublicAccessExclusionIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcClassicLinkIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("VpcId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcEndpointIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcEndpointRouteTableIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcEndpointSecurityGroupIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcEndpointServiceIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcEndpointSubnetIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("VpcId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpcPeeringConnectionIdList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Item") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpnConnectionIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("VpnConnectionId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpnConnectionOptionsSpecification(v *types.VpnConnectionOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.EnableAcceleration != nil { - objectKey := object.Key("EnableAcceleration") - objectKey.Boolean(*v.EnableAcceleration) - } - - if v.LocalIpv4NetworkCidr != nil { - objectKey := object.Key("LocalIpv4NetworkCidr") - objectKey.String(*v.LocalIpv4NetworkCidr) - } - - if v.LocalIpv6NetworkCidr != nil { - objectKey := object.Key("LocalIpv6NetworkCidr") - objectKey.String(*v.LocalIpv6NetworkCidr) - } - - if v.OutsideIpAddressType != nil { - objectKey := object.Key("OutsideIpAddressType") - objectKey.String(*v.OutsideIpAddressType) - } - - if v.RemoteIpv4NetworkCidr != nil { - objectKey := object.Key("RemoteIpv4NetworkCidr") - objectKey.String(*v.RemoteIpv4NetworkCidr) - } - - if v.RemoteIpv6NetworkCidr != nil { - objectKey := object.Key("RemoteIpv6NetworkCidr") - objectKey.String(*v.RemoteIpv6NetworkCidr) - } - - if v.StaticRoutesOnly != nil { - objectKey := object.Key("StaticRoutesOnly") - objectKey.Boolean(*v.StaticRoutesOnly) - } - - if v.TransportTransitGatewayAttachmentId != nil { - objectKey := object.Key("TransportTransitGatewayAttachmentId") - objectKey.String(*v.TransportTransitGatewayAttachmentId) - } - - if len(v.TunnelInsideIpVersion) > 0 { - objectKey := object.Key("TunnelInsideIpVersion") - objectKey.String(string(v.TunnelInsideIpVersion)) - } - - if v.TunnelOptions != nil { - objectKey := object.FlatKey("TunnelOptions") - if err := awsEc2query_serializeDocumentVpnTunnelOptionsSpecificationsList(v.TunnelOptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentVpnGatewayIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("VpnGatewayId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v *types.VpnTunnelLogOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.CloudWatchLogOptions != nil { - objectKey := object.Key("CloudWatchLogOptions") - if err := awsEc2query_serializeDocumentCloudWatchLogOptionsSpecification(v.CloudWatchLogOptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeDocumentVpnTunnelOptionsSpecification(v *types.VpnTunnelOptionsSpecification, value query.Value) error { - object := value.Object() - _ = object - - if v.DPDTimeoutAction != nil { - objectKey := object.Key("DPDTimeoutAction") - objectKey.String(*v.DPDTimeoutAction) - } - - if v.DPDTimeoutSeconds != nil { - objectKey := object.Key("DPDTimeoutSeconds") - objectKey.Integer(*v.DPDTimeoutSeconds) - } - - if v.EnableTunnelLifecycleControl != nil { - objectKey := object.Key("EnableTunnelLifecycleControl") - objectKey.Boolean(*v.EnableTunnelLifecycleControl) - } - - if v.IKEVersions != nil { - objectKey := object.FlatKey("IKEVersion") - if err := awsEc2query_serializeDocumentIKEVersionsRequestList(v.IKEVersions, objectKey); err != nil { - return err - } - } - - if v.LogOptions != nil { - objectKey := object.Key("LogOptions") - if err := awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v.LogOptions, objectKey); err != nil { - return err - } - } - - if v.Phase1DHGroupNumbers != nil { - objectKey := object.FlatKey("Phase1DHGroupNumber") - if err := awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestList(v.Phase1DHGroupNumbers, objectKey); err != nil { - return err - } - } - - if v.Phase1EncryptionAlgorithms != nil { - objectKey := object.FlatKey("Phase1EncryptionAlgorithm") - if err := awsEc2query_serializeDocumentPhase1EncryptionAlgorithmsRequestList(v.Phase1EncryptionAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase1IntegrityAlgorithms != nil { - objectKey := object.FlatKey("Phase1IntegrityAlgorithm") - if err := awsEc2query_serializeDocumentPhase1IntegrityAlgorithmsRequestList(v.Phase1IntegrityAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase1LifetimeSeconds != nil { - objectKey := object.Key("Phase1LifetimeSeconds") - objectKey.Integer(*v.Phase1LifetimeSeconds) - } - - if v.Phase2DHGroupNumbers != nil { - objectKey := object.FlatKey("Phase2DHGroupNumber") - if err := awsEc2query_serializeDocumentPhase2DHGroupNumbersRequestList(v.Phase2DHGroupNumbers, objectKey); err != nil { - return err - } - } - - if v.Phase2EncryptionAlgorithms != nil { - objectKey := object.FlatKey("Phase2EncryptionAlgorithm") - if err := awsEc2query_serializeDocumentPhase2EncryptionAlgorithmsRequestList(v.Phase2EncryptionAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase2IntegrityAlgorithms != nil { - objectKey := object.FlatKey("Phase2IntegrityAlgorithm") - if err := awsEc2query_serializeDocumentPhase2IntegrityAlgorithmsRequestList(v.Phase2IntegrityAlgorithms, objectKey); err != nil { - return err - } - } - - if v.Phase2LifetimeSeconds != nil { - objectKey := object.Key("Phase2LifetimeSeconds") - objectKey.Integer(*v.Phase2LifetimeSeconds) - } - - if v.PreSharedKey != nil { - objectKey := object.Key("PreSharedKey") - objectKey.String(*v.PreSharedKey) - } - - if v.RekeyFuzzPercentage != nil { - objectKey := object.Key("RekeyFuzzPercentage") - objectKey.Integer(*v.RekeyFuzzPercentage) - } - - if v.RekeyMarginTimeSeconds != nil { - objectKey := object.Key("RekeyMarginTimeSeconds") - objectKey.Integer(*v.RekeyMarginTimeSeconds) - } - - if v.ReplayWindowSize != nil { - objectKey := object.Key("ReplayWindowSize") - objectKey.Integer(*v.ReplayWindowSize) - } - - if v.StartupAction != nil { - objectKey := object.Key("StartupAction") - objectKey.String(*v.StartupAction) - } - - if v.TunnelInsideCidr != nil { - objectKey := object.Key("TunnelInsideCidr") - objectKey.String(*v.TunnelInsideCidr) - } - - if v.TunnelInsideIpv6Cidr != nil { - objectKey := object.Key("TunnelInsideIpv6Cidr") - objectKey.String(*v.TunnelInsideIpv6Cidr) - } - - return nil -} - -func awsEc2query_serializeDocumentVpnTunnelOptionsSpecificationsList(v []types.VpnTunnelOptionsSpecification, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("Member") - - for i := range v { - av := array.Value() - if err := awsEc2query_serializeDocumentVpnTunnelOptionsSpecification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsEc2query_serializeDocumentZoneIdStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ZoneId") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeDocumentZoneNameStringList(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } - array := value.Array("ZoneName") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsEc2query_serializeOpDocumentAcceptAddressTransferInput(v *AcceptAddressTransferInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Address != nil { - objectKey := object.Key("Address") - objectKey.String(*v.Address) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptCapacityReservationBillingOwnershipInput(v *AcceptCapacityReservationBillingOwnershipInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptReservedInstancesExchangeQuoteInput(v *AcceptReservedInstancesExchangeQuoteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReservedInstanceIds != nil { - objectKey := object.FlatKey("ReservedInstanceId") - if err := awsEc2query_serializeDocumentReservedInstanceIdSet(v.ReservedInstanceIds, objectKey); err != nil { - return err - } - } - - if v.TargetConfigurations != nil { - objectKey := object.FlatKey("TargetConfiguration") - if err := awsEc2query_serializeDocumentTargetConfigurationRequestSet(v.TargetConfigurations, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptTransitGatewayMulticastDomainAssociationsInput(v *AcceptTransitGatewayMulticastDomainAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetIds") - if err := awsEc2query_serializeDocumentValueStringList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptTransitGatewayPeeringAttachmentInput(v *AcceptTransitGatewayPeeringAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptTransitGatewayVpcAttachmentInput(v *AcceptTransitGatewayVpcAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptVpcEndpointConnectionsInput(v *AcceptVpcEndpointConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - if v.VpcEndpointIds != nil { - objectKey := object.FlatKey("VpcEndpointId") - if err := awsEc2query_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAcceptVpcPeeringConnectionInput(v *AcceptVpcPeeringConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAdvertiseByoipCidrInput(v *AdvertiseByoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Asn != nil { - objectKey := object.Key("Asn") - objectKey.String(*v.Asn) - } - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAllocateAddressInput(v *AllocateAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Address != nil { - objectKey := object.Key("Address") - objectKey.String(*v.Address) - } - - if v.CustomerOwnedIpv4Pool != nil { - objectKey := object.Key("CustomerOwnedIpv4Pool") - objectKey.String(*v.CustomerOwnedIpv4Pool) - } - - if len(v.Domain) > 0 { - objectKey := object.Key("Domain") - objectKey.String(string(v.Domain)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.PublicIpv4Pool != nil { - objectKey := object.Key("PublicIpv4Pool") - objectKey.String(*v.PublicIpv4Pool) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAllocateHostsInput(v *AllocateHostsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssetIds != nil { - objectKey := object.FlatKey("AssetId") - if err := awsEc2query_serializeDocumentAssetIdList(v.AssetIds, objectKey); err != nil { - return err - } - } - - if len(v.AutoPlacement) > 0 { - objectKey := object.Key("AutoPlacement") - objectKey.String(string(v.AutoPlacement)) - } - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if len(v.HostMaintenance) > 0 { - objectKey := object.Key("HostMaintenance") - objectKey.String(string(v.HostMaintenance)) - } - - if len(v.HostRecovery) > 0 { - objectKey := object.Key("HostRecovery") - objectKey.String(string(v.HostRecovery)) - } - - if v.InstanceFamily != nil { - objectKey := object.Key("InstanceFamily") - objectKey.String(*v.InstanceFamily) - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - objectKey.String(*v.InstanceType) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.Quantity != nil { - objectKey := object.Key("Quantity") - objectKey.Integer(*v.Quantity) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAllocateIpamPoolCidrInput(v *AllocateIpamPoolCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllowedCidrs != nil { - objectKey := object.FlatKey("AllowedCidr") - if err := awsEc2query_serializeDocumentIpamPoolAllocationAllowedCidrs(v.AllowedCidrs, objectKey); err != nil { - return err - } - } - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DisallowedCidrs != nil { - objectKey := object.FlatKey("DisallowedCidr") - if err := awsEc2query_serializeDocumentIpamPoolAllocationDisallowedCidrs(v.DisallowedCidrs, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.NetmaskLength != nil { - objectKey := object.Key("NetmaskLength") - objectKey.Integer(*v.NetmaskLength) - } - - if v.PreviewNextCidr != nil { - objectKey := object.Key("PreviewNextCidr") - objectKey.Boolean(*v.PreviewNextCidr) - } - - return nil -} - -func awsEc2query_serializeOpDocumentApplySecurityGroupsToClientVpnTargetNetworkInput(v *ApplySecurityGroupsToClientVpnTargetNetworkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentClientVpnSecurityGroupIdSet(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssignIpv6AddressesInput(v *AssignIpv6AddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Addresses") - if err := awsEc2query_serializeDocumentIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.Ipv6PrefixCount != nil { - objectKey := object.Key("Ipv6PrefixCount") - objectKey.Integer(*v.Ipv6PrefixCount) - } - - if v.Ipv6Prefixes != nil { - objectKey := object.FlatKey("Ipv6Prefix") - if err := awsEc2query_serializeDocumentIpPrefixList(v.Ipv6Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssignPrivateIpAddressesInput(v *AssignPrivateIpAddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllowReassignment != nil { - objectKey := object.Key("AllowReassignment") - objectKey.Boolean(*v.AllowReassignment) - } - - if v.Ipv4PrefixCount != nil { - objectKey := object.Key("Ipv4PrefixCount") - objectKey.Integer(*v.Ipv4PrefixCount) - } - - if v.Ipv4Prefixes != nil { - objectKey := object.FlatKey("Ipv4Prefix") - if err := awsEc2query_serializeDocumentIpPrefixList(v.Ipv4Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddress") - if err := awsEc2query_serializeDocumentPrivateIpAddressStringList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssignPrivateNatGatewayAddressInput(v *AssignPrivateNatGatewayAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - if v.PrivateIpAddressCount != nil { - objectKey := object.Key("PrivateIpAddressCount") - objectKey.Integer(*v.PrivateIpAddressCount) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddress") - if err := awsEc2query_serializeDocumentIpList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateAddressInput(v *AssociateAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.AllowReassociation != nil { - objectKey := object.Key("AllowReassociation") - objectKey.Boolean(*v.AllowReassociation) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateCapacityReservationBillingOwnerInput(v *AssociateCapacityReservationBillingOwnerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.UnusedReservationBillingOwnerId != nil { - objectKey := object.Key("UnusedReservationBillingOwnerId") - objectKey.String(*v.UnusedReservationBillingOwnerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateClientVpnTargetNetworkInput(v *AssociateClientVpnTargetNetworkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateDhcpOptionsInput(v *AssociateDhcpOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DhcpOptionsId != nil { - objectKey := object.Key("DhcpOptionsId") - objectKey.String(*v.DhcpOptionsId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateEnclaveCertificateIamRoleInput(v *AssociateEnclaveCertificateIamRoleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CertificateArn != nil { - objectKey := object.Key("CertificateArn") - objectKey.String(*v.CertificateArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RoleArn != nil { - objectKey := object.Key("RoleArn") - objectKey.String(*v.RoleArn) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateIamInstanceProfileInput(v *AssociateIamInstanceProfileInput, value query.Value) error { - object := value.Object() - _ = object - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentIamInstanceProfileSpecification(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateInstanceEventWindowInput(v *AssociateInstanceEventWindowInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationTarget != nil { - objectKey := object.Key("AssociationTarget") - if err := awsEc2query_serializeDocumentInstanceEventWindowAssociationRequest(v.AssociationTarget, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceEventWindowId != nil { - objectKey := object.Key("InstanceEventWindowId") - objectKey.String(*v.InstanceEventWindowId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateIpamByoasnInput(v *AssociateIpamByoasnInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Asn != nil { - objectKey := object.Key("Asn") - objectKey.String(*v.Asn) - } - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateIpamResourceDiscoveryInput(v *AssociateIpamResourceDiscoveryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateNatGatewayAddressInput(v *AssociateNatGatewayAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationIds != nil { - objectKey := object.FlatKey("AllocationId") - if err := awsEc2query_serializeDocumentAllocationIdList(v.AllocationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddress") - if err := awsEc2query_serializeDocumentIpList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateRouteServerInput(v *AssociateRouteServerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateRouteTableInput(v *AssociateRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GatewayId != nil { - objectKey := object.Key("GatewayId") - objectKey.String(*v.GatewayId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateSecurityGroupVpcInput(v *AssociateSecurityGroupVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateSubnetCidrBlockInput(v *AssociateSubnetCidrBlockInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.Ipv6IpamPoolId != nil { - objectKey := object.Key("Ipv6IpamPoolId") - objectKey.String(*v.Ipv6IpamPoolId) - } - - if v.Ipv6NetmaskLength != nil { - objectKey := object.Key("Ipv6NetmaskLength") - objectKey.Integer(*v.Ipv6NetmaskLength) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateTransitGatewayMulticastDomainInput(v *AssociateTransitGatewayMulticastDomainInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetIds") - if err := awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateTransitGatewayPolicyTableInput(v *AssociateTransitGatewayPolicyTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayPolicyTableId != nil { - objectKey := object.Key("TransitGatewayPolicyTableId") - objectKey.String(*v.TransitGatewayPolicyTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateTransitGatewayRouteTableInput(v *AssociateTransitGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateTrunkInterfaceInput(v *AssociateTrunkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BranchInterfaceId != nil { - objectKey := object.Key("BranchInterfaceId") - objectKey.String(*v.BranchInterfaceId) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GreKey != nil { - objectKey := object.Key("GreKey") - objectKey.Integer(*v.GreKey) - } - - if v.TrunkInterfaceId != nil { - objectKey := object.Key("TrunkInterfaceId") - objectKey.String(*v.TrunkInterfaceId) - } - - if v.VlanId != nil { - objectKey := object.Key("VlanId") - objectKey.Integer(*v.VlanId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAssociateVpcCidrBlockInput(v *AssociateVpcCidrBlockInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AmazonProvidedIpv6CidrBlock != nil { - objectKey := object.Key("AmazonProvidedIpv6CidrBlock") - objectKey.Boolean(*v.AmazonProvidedIpv6CidrBlock) - } - - if v.CidrBlock != nil { - objectKey := object.Key("CidrBlock") - objectKey.String(*v.CidrBlock) - } - - if v.Ipv4IpamPoolId != nil { - objectKey := object.Key("Ipv4IpamPoolId") - objectKey.String(*v.Ipv4IpamPoolId) - } - - if v.Ipv4NetmaskLength != nil { - objectKey := object.Key("Ipv4NetmaskLength") - objectKey.Integer(*v.Ipv4NetmaskLength) - } - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.Ipv6CidrBlockNetworkBorderGroup != nil { - objectKey := object.Key("Ipv6CidrBlockNetworkBorderGroup") - objectKey.String(*v.Ipv6CidrBlockNetworkBorderGroup) - } - - if v.Ipv6IpamPoolId != nil { - objectKey := object.Key("Ipv6IpamPoolId") - objectKey.String(*v.Ipv6IpamPoolId) - } - - if v.Ipv6NetmaskLength != nil { - objectKey := object.Key("Ipv6NetmaskLength") - objectKey.Integer(*v.Ipv6NetmaskLength) - } - - if v.Ipv6Pool != nil { - objectKey := object.Key("Ipv6Pool") - objectKey.String(*v.Ipv6Pool) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachClassicLinkVpcInput(v *AttachClassicLinkVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Groups != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachInternetGatewayInput(v *AttachInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InternetGatewayId != nil { - objectKey := object.Key("InternetGatewayId") - objectKey.String(*v.InternetGatewayId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachNetworkInterfaceInput(v *AttachNetworkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DeviceIndex != nil { - objectKey := object.Key("DeviceIndex") - objectKey.Integer(*v.DeviceIndex) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnaQueueCount != nil { - objectKey := object.Key("EnaQueueCount") - objectKey.Integer(*v.EnaQueueCount) - } - - if v.EnaSrdSpecification != nil { - objectKey := object.Key("EnaSrdSpecification") - if err := awsEc2query_serializeDocumentEnaSrdSpecification(v.EnaSrdSpecification, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.NetworkCardIndex != nil { - objectKey := object.Key("NetworkCardIndex") - objectKey.Integer(*v.NetworkCardIndex) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachVerifiedAccessTrustProviderInput(v *AttachVerifiedAccessTrustProviderInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - if v.VerifiedAccessTrustProviderId != nil { - objectKey := object.Key("VerifiedAccessTrustProviderId") - objectKey.String(*v.VerifiedAccessTrustProviderId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachVolumeInput(v *AttachVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Device != nil { - objectKey := object.Key("Device") - objectKey.String(*v.Device) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAttachVpnGatewayInput(v *AttachVpnGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - if v.VpnGatewayId != nil { - objectKey := object.Key("VpnGatewayId") - objectKey.String(*v.VpnGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAuthorizeClientVpnIngressInput(v *AuthorizeClientVpnIngressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AccessGroupId != nil { - objectKey := object.Key("AccessGroupId") - objectKey.String(*v.AccessGroupId) - } - - if v.AuthorizeAllGroups != nil { - objectKey := object.Key("AuthorizeAllGroups") - objectKey.Boolean(*v.AuthorizeAllGroups) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TargetNetworkCidr != nil { - objectKey := object.Key("TargetNetworkCidr") - objectKey.String(*v.TargetNetworkCidr) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAuthorizeSecurityGroupEgressInput(v *AuthorizeSecurityGroupEgressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIp != nil { - objectKey := object.Key("CidrIp") - objectKey.String(*v.CidrIp) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.SourceSecurityGroupName != nil { - objectKey := object.Key("SourceSecurityGroupName") - objectKey.String(*v.SourceSecurityGroupName) - } - - if v.SourceSecurityGroupOwnerId != nil { - objectKey := object.Key("SourceSecurityGroupOwnerId") - objectKey.String(*v.SourceSecurityGroupOwnerId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentAuthorizeSecurityGroupIngressInput(v *AuthorizeSecurityGroupIngressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIp != nil { - objectKey := object.Key("CidrIp") - objectKey.String(*v.CidrIp) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.SourceSecurityGroupName != nil { - objectKey := object.Key("SourceSecurityGroupName") - objectKey.String(*v.SourceSecurityGroupName) - } - - if v.SourceSecurityGroupOwnerId != nil { - objectKey := object.Key("SourceSecurityGroupOwnerId") - objectKey.String(*v.SourceSecurityGroupOwnerId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentBundleInstanceInput(v *BundleInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.Storage != nil { - objectKey := object.Key("Storage") - if err := awsEc2query_serializeDocumentStorage(v.Storage, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelBundleTaskInput(v *CancelBundleTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BundleId != nil { - objectKey := object.Key("BundleId") - objectKey.String(*v.BundleId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelCapacityReservationFleetsInput(v *CancelCapacityReservationFleetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationFleetIds != nil { - objectKey := object.FlatKey("CapacityReservationFleetId") - if err := awsEc2query_serializeDocumentCapacityReservationFleetIdSet(v.CapacityReservationFleetIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelCapacityReservationInput(v *CancelCapacityReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelConversionTaskInput(v *CancelConversionTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConversionTaskId != nil { - objectKey := object.Key("ConversionTaskId") - objectKey.String(*v.ConversionTaskId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReasonMessage != nil { - objectKey := object.Key("ReasonMessage") - objectKey.String(*v.ReasonMessage) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelDeclarativePoliciesReportInput(v *CancelDeclarativePoliciesReportInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReportId != nil { - objectKey := object.Key("ReportId") - objectKey.String(*v.ReportId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelExportTaskInput(v *CancelExportTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ExportTaskId != nil { - objectKey := object.Key("ExportTaskId") - objectKey.String(*v.ExportTaskId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelImageLaunchPermissionInput(v *CancelImageLaunchPermissionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelImportTaskInput(v *CancelImportTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CancelReason != nil { - objectKey := object.Key("CancelReason") - objectKey.String(*v.CancelReason) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImportTaskId != nil { - objectKey := object.Key("ImportTaskId") - objectKey.String(*v.ImportTaskId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelReservedInstancesListingInput(v *CancelReservedInstancesListingInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ReservedInstancesListingId != nil { - objectKey := object.Key("ReservedInstancesListingId") - objectKey.String(*v.ReservedInstancesListingId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelSpotFleetRequestsInput(v *CancelSpotFleetRequestsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SpotFleetRequestIds != nil { - objectKey := object.FlatKey("SpotFleetRequestId") - if err := awsEc2query_serializeDocumentSpotFleetRequestIdList(v.SpotFleetRequestIds, objectKey); err != nil { - return err - } - } - - if v.TerminateInstances != nil { - objectKey := object.Key("TerminateInstances") - objectKey.Boolean(*v.TerminateInstances) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCancelSpotInstanceRequestsInput(v *CancelSpotInstanceRequestsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SpotInstanceRequestIds != nil { - objectKey := object.FlatKey("SpotInstanceRequestId") - if err := awsEc2query_serializeDocumentSpotInstanceRequestIdList(v.SpotInstanceRequestIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentConfirmProductInstanceInput(v *ConfirmProductInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.ProductCode != nil { - objectKey := object.Key("ProductCode") - objectKey.String(*v.ProductCode) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCopyFpgaImageInput(v *CopyFpgaImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.SourceFpgaImageId != nil { - objectKey := object.Key("SourceFpgaImageId") - objectKey.String(*v.SourceFpgaImageId) - } - - if v.SourceRegion != nil { - objectKey := object.Key("SourceRegion") - objectKey.String(*v.SourceRegion) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCopyImageInput(v *CopyImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.CopyImageTags != nil { - objectKey := object.Key("CopyImageTags") - objectKey.Boolean(*v.CopyImageTags) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DestinationOutpostArn != nil { - objectKey := object.Key("DestinationOutpostArn") - objectKey.String(*v.DestinationOutpostArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.SnapshotCopyCompletionDurationMinutes != nil { - objectKey := object.Key("SnapshotCopyCompletionDurationMinutes") - objectKey.Long(*v.SnapshotCopyCompletionDurationMinutes) - } - - if v.SourceImageId != nil { - objectKey := object.Key("SourceImageId") - objectKey.String(*v.SourceImageId) - } - - if v.SourceRegion != nil { - objectKey := object.Key("SourceRegion") - objectKey.String(*v.SourceRegion) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCopySnapshotInput(v *CopySnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CompletionDurationMinutes != nil { - objectKey := object.Key("CompletionDurationMinutes") - objectKey.Integer(*v.CompletionDurationMinutes) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DestinationOutpostArn != nil { - objectKey := object.Key("DestinationOutpostArn") - objectKey.String(*v.DestinationOutpostArn) - } - - if v.destinationRegion != nil { - objectKey := object.Key("DestinationRegion") - objectKey.String(*v.destinationRegion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.PresignedUrl != nil { - objectKey := object.Key("PresignedUrl") - objectKey.String(*v.PresignedUrl) - } - - if v.SourceRegion != nil { - objectKey := object.Key("SourceRegion") - objectKey.String(*v.SourceRegion) - } - - if v.SourceSnapshotId != nil { - objectKey := object.Key("SourceSnapshotId") - objectKey.String(*v.SourceSnapshotId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCapacityReservationBySplittingInput(v *CreateCapacityReservationBySplittingInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.SourceCapacityReservationId != nil { - objectKey := object.Key("SourceCapacityReservationId") - objectKey.String(*v.SourceCapacityReservationId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCapacityReservationFleetInput(v *CreateCapacityReservationFleetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationStrategy != nil { - objectKey := object.Key("AllocationStrategy") - objectKey.String(*v.AllocationStrategy) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndDate != nil { - objectKey := object.Key("EndDate") - objectKey.String(smithytime.FormatDateTime(*v.EndDate)) - } - - if len(v.InstanceMatchCriteria) > 0 { - objectKey := object.Key("InstanceMatchCriteria") - objectKey.String(string(v.InstanceMatchCriteria)) - } - - if v.InstanceTypeSpecifications != nil { - objectKey := object.FlatKey("InstanceTypeSpecification") - if err := awsEc2query_serializeDocumentReservationFleetInstanceSpecificationList(v.InstanceTypeSpecifications, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - if v.TotalTargetCapacity != nil { - objectKey := object.Key("TotalTargetCapacity") - objectKey.Integer(*v.TotalTargetCapacity) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCapacityReservationInput(v *CreateCapacityReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.CommitmentDuration != nil { - objectKey := object.Key("CommitmentDuration") - objectKey.Long(*v.CommitmentDuration) - } - - if len(v.DeliveryPreference) > 0 { - objectKey := object.Key("DeliveryPreference") - objectKey.String(string(v.DeliveryPreference)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.EndDate != nil { - objectKey := object.Key("EndDate") - objectKey.String(smithytime.FormatDateTime(*v.EndDate)) - } - - if len(v.EndDateType) > 0 { - objectKey := object.Key("EndDateType") - objectKey.String(string(v.EndDateType)) - } - - if v.EphemeralStorage != nil { - objectKey := object.Key("EphemeralStorage") - objectKey.Boolean(*v.EphemeralStorage) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if len(v.InstanceMatchCriteria) > 0 { - objectKey := object.Key("InstanceMatchCriteria") - objectKey.String(string(v.InstanceMatchCriteria)) - } - - if len(v.InstancePlatform) > 0 { - objectKey := object.Key("InstancePlatform") - objectKey.String(string(v.InstancePlatform)) - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - objectKey.String(*v.InstanceType) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.PlacementGroupArn != nil { - objectKey := object.Key("PlacementGroupArn") - objectKey.String(*v.PlacementGroupArn) - } - - if v.StartDate != nil { - objectKey := object.Key("StartDate") - objectKey.String(smithytime.FormatDateTime(*v.StartDate)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecifications") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCarrierGatewayInput(v *CreateCarrierGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateClientVpnEndpointInput(v *CreateClientVpnEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AuthenticationOptions != nil { - objectKey := object.FlatKey("Authentication") - if err := awsEc2query_serializeDocumentClientVpnAuthenticationRequestList(v.AuthenticationOptions, objectKey); err != nil { - return err - } - } - - if v.ClientCidrBlock != nil { - objectKey := object.Key("ClientCidrBlock") - objectKey.String(*v.ClientCidrBlock) - } - - if v.ClientConnectOptions != nil { - objectKey := object.Key("ClientConnectOptions") - if err := awsEc2query_serializeDocumentClientConnectOptions(v.ClientConnectOptions, objectKey); err != nil { - return err - } - } - - if v.ClientLoginBannerOptions != nil { - objectKey := object.Key("ClientLoginBannerOptions") - if err := awsEc2query_serializeDocumentClientLoginBannerOptions(v.ClientLoginBannerOptions, objectKey); err != nil { - return err - } - } - - if v.ClientRouteEnforcementOptions != nil { - objectKey := object.Key("ClientRouteEnforcementOptions") - if err := awsEc2query_serializeDocumentClientRouteEnforcementOptions(v.ClientRouteEnforcementOptions, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ConnectionLogOptions != nil { - objectKey := object.Key("ConnectionLogOptions") - if err := awsEc2query_serializeDocumentConnectionLogOptions(v.ConnectionLogOptions, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DisconnectOnSessionTimeout != nil { - objectKey := object.Key("DisconnectOnSessionTimeout") - objectKey.Boolean(*v.DisconnectOnSessionTimeout) - } - - if v.DnsServers != nil { - objectKey := object.FlatKey("DnsServers") - if err := awsEc2query_serializeDocumentValueStringList(v.DnsServers, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentClientVpnSecurityGroupIdSet(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if len(v.SelfServicePortal) > 0 { - objectKey := object.Key("SelfServicePortal") - objectKey.String(string(v.SelfServicePortal)) - } - - if v.ServerCertificateArn != nil { - objectKey := object.Key("ServerCertificateArn") - objectKey.String(*v.ServerCertificateArn) - } - - if v.SessionTimeoutHours != nil { - objectKey := object.Key("SessionTimeoutHours") - objectKey.Integer(*v.SessionTimeoutHours) - } - - if v.SplitTunnel != nil { - objectKey := object.Key("SplitTunnel") - objectKey.Boolean(*v.SplitTunnel) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TransportProtocol) > 0 { - objectKey := object.Key("TransportProtocol") - objectKey.String(string(v.TransportProtocol)) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - if v.VpnPort != nil { - objectKey := object.Key("VpnPort") - objectKey.Integer(*v.VpnPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateClientVpnRouteInput(v *CreateClientVpnRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TargetVpcSubnetId != nil { - objectKey := object.Key("TargetVpcSubnetId") - objectKey.String(*v.TargetVpcSubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCoipCidrInput(v *CreateCoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.CoipPoolId != nil { - objectKey := object.Key("CoipPoolId") - objectKey.String(*v.CoipPoolId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCoipPoolInput(v *CreateCoipPoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateCustomerGatewayInput(v *CreateCustomerGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BgpAsn != nil { - objectKey := object.Key("BgpAsn") - objectKey.Integer(*v.BgpAsn) - } - - if v.BgpAsnExtended != nil { - objectKey := object.Key("BgpAsnExtended") - objectKey.Long(*v.BgpAsnExtended) - } - - if v.CertificateArn != nil { - objectKey := object.Key("CertificateArn") - objectKey.String(*v.CertificateArn) - } - - if v.DeviceName != nil { - objectKey := object.Key("DeviceName") - objectKey.String(*v.DeviceName) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpAddress != nil { - objectKey := object.Key("IpAddress") - objectKey.String(*v.IpAddress) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateDefaultSubnetInput(v *CreateDefaultSubnetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Ipv6Native != nil { - objectKey := object.Key("Ipv6Native") - objectKey.Boolean(*v.Ipv6Native) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateDefaultVpcInput(v *CreateDefaultVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateDelegateMacVolumeOwnershipTaskInput(v *CreateDelegateMacVolumeOwnershipTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.MacCredentials != nil { - objectKey := object.Key("MacCredentials") - objectKey.String(*v.MacCredentials) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateDhcpOptionsInput(v *CreateDhcpOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DhcpConfigurations != nil { - objectKey := object.FlatKey("DhcpConfiguration") - if err := awsEc2query_serializeDocumentNewDhcpConfigurationList(v.DhcpConfigurations, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateEgressOnlyInternetGatewayInput(v *CreateEgressOnlyInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Context != nil { - objectKey := object.Key("Context") - objectKey.String(*v.Context) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.ExcessCapacityTerminationPolicy) > 0 { - objectKey := object.Key("ExcessCapacityTerminationPolicy") - objectKey.String(string(v.ExcessCapacityTerminationPolicy)) - } - - if v.LaunchTemplateConfigs != nil { - objectKey := object.FlatKey("LaunchTemplateConfigs") - if err := awsEc2query_serializeDocumentFleetLaunchTemplateConfigListRequest(v.LaunchTemplateConfigs, objectKey); err != nil { - return err - } - } - - if v.OnDemandOptions != nil { - objectKey := object.Key("OnDemandOptions") - if err := awsEc2query_serializeDocumentOnDemandOptionsRequest(v.OnDemandOptions, objectKey); err != nil { - return err - } - } - - if v.ReplaceUnhealthyInstances != nil { - objectKey := object.Key("ReplaceUnhealthyInstances") - objectKey.Boolean(*v.ReplaceUnhealthyInstances) - } - - if v.SpotOptions != nil { - objectKey := object.Key("SpotOptions") - if err := awsEc2query_serializeDocumentSpotOptionsRequest(v.SpotOptions, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TargetCapacitySpecification != nil { - objectKey := object.Key("TargetCapacitySpecification") - if err := awsEc2query_serializeDocumentTargetCapacitySpecificationRequest(v.TargetCapacitySpecification, objectKey); err != nil { - return err - } - } - - if v.TerminateInstancesWithExpiration != nil { - objectKey := object.Key("TerminateInstancesWithExpiration") - objectKey.Boolean(*v.TerminateInstancesWithExpiration) - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - if v.ValidFrom != nil { - objectKey := object.Key("ValidFrom") - objectKey.String(smithytime.FormatDateTime(*v.ValidFrom)) - } - - if v.ValidUntil != nil { - objectKey := object.Key("ValidUntil") - objectKey.String(smithytime.FormatDateTime(*v.ValidUntil)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateFlowLogsInput(v *CreateFlowLogsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DeliverCrossAccountRole != nil { - objectKey := object.Key("DeliverCrossAccountRole") - objectKey.String(*v.DeliverCrossAccountRole) - } - - if v.DeliverLogsPermissionArn != nil { - objectKey := object.Key("DeliverLogsPermissionArn") - objectKey.String(*v.DeliverLogsPermissionArn) - } - - if v.DestinationOptions != nil { - objectKey := object.Key("DestinationOptions") - if err := awsEc2query_serializeDocumentDestinationOptionsRequest(v.DestinationOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LogDestination != nil { - objectKey := object.Key("LogDestination") - objectKey.String(*v.LogDestination) - } - - if len(v.LogDestinationType) > 0 { - objectKey := object.Key("LogDestinationType") - objectKey.String(string(v.LogDestinationType)) - } - - if v.LogFormat != nil { - objectKey := object.Key("LogFormat") - objectKey.String(*v.LogFormat) - } - - if v.LogGroupName != nil { - objectKey := object.Key("LogGroupName") - objectKey.String(*v.LogGroupName) - } - - if v.MaxAggregationInterval != nil { - objectKey := object.Key("MaxAggregationInterval") - objectKey.Integer(*v.MaxAggregationInterval) - } - - if v.ResourceIds != nil { - objectKey := object.FlatKey("ResourceId") - if err := awsEc2query_serializeDocumentFlowLogResourceIds(v.ResourceIds, objectKey); err != nil { - return err - } - } - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TrafficType) > 0 { - objectKey := object.Key("TrafficType") - objectKey.String(string(v.TrafficType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateFpgaImageInput(v *CreateFpgaImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InputStorageLocation != nil { - objectKey := object.Key("InputStorageLocation") - if err := awsEc2query_serializeDocumentStorageLocation(v.InputStorageLocation, objectKey); err != nil { - return err - } - } - - if v.LogsStorageLocation != nil { - objectKey := object.Key("LogsStorageLocation") - if err := awsEc2query_serializeDocumentStorageLocation(v.LogsStorageLocation, objectKey); err != nil { - return err - } - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateImageInput(v *CreateImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentBlockDeviceMappingRequestList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.NoReboot != nil { - objectKey := object.Key("NoReboot") - objectKey.Boolean(*v.NoReboot) - } - - if len(v.SnapshotLocation) > 0 { - objectKey := object.Key("SnapshotLocation") - objectKey.String(string(v.SnapshotLocation)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateInstanceConnectEndpointInput(v *CreateInstanceConnectEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.IpAddressType) > 0 { - objectKey := object.Key("IpAddressType") - objectKey.String(string(v.IpAddressType)) - } - - if v.PreserveClientIp != nil { - objectKey := object.Key("PreserveClientIp") - objectKey.Boolean(*v.PreserveClientIp) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringListRequest(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateInstanceEventWindowInput(v *CreateInstanceEventWindowInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CronExpression != nil { - objectKey := object.Key("CronExpression") - objectKey.String(*v.CronExpression) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TimeRanges != nil { - objectKey := object.FlatKey("TimeRange") - if err := awsEc2query_serializeDocumentInstanceEventWindowTimeRangeRequestSet(v.TimeRanges, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateInstanceExportTaskInput(v *CreateInstanceExportTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.ExportToS3Task != nil { - objectKey := object.Key("ExportToS3") - if err := awsEc2query_serializeDocumentExportToS3TaskSpecification(v.ExportToS3Task, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TargetEnvironment) > 0 { - objectKey := object.Key("TargetEnvironment") - objectKey.String(string(v.TargetEnvironment)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateInternetGatewayInput(v *CreateInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateIpamExternalResourceVerificationTokenInput(v *CreateIpamExternalResourceVerificationTokenInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateIpamInput(v *CreateIpamInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnablePrivateGua != nil { - objectKey := object.Key("EnablePrivateGua") - objectKey.Boolean(*v.EnablePrivateGua) - } - - if len(v.MeteredAccount) > 0 { - objectKey := object.Key("MeteredAccount") - objectKey.String(string(v.MeteredAccount)) - } - - if v.OperatingRegions != nil { - objectKey := object.FlatKey("OperatingRegion") - if err := awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v.OperatingRegions, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Tier) > 0 { - objectKey := object.Key("Tier") - objectKey.String(string(v.Tier)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateIpamPoolInput(v *CreateIpamPoolInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AddressFamily) > 0 { - objectKey := object.Key("AddressFamily") - objectKey.String(string(v.AddressFamily)) - } - - if v.AllocationDefaultNetmaskLength != nil { - objectKey := object.Key("AllocationDefaultNetmaskLength") - objectKey.Integer(*v.AllocationDefaultNetmaskLength) - } - - if v.AllocationMaxNetmaskLength != nil { - objectKey := object.Key("AllocationMaxNetmaskLength") - objectKey.Integer(*v.AllocationMaxNetmaskLength) - } - - if v.AllocationMinNetmaskLength != nil { - objectKey := object.Key("AllocationMinNetmaskLength") - objectKey.Integer(*v.AllocationMinNetmaskLength) - } - - if v.AllocationResourceTags != nil { - objectKey := object.FlatKey("AllocationResourceTag") - if err := awsEc2query_serializeDocumentRequestIpamResourceTagList(v.AllocationResourceTags, objectKey); err != nil { - return err - } - } - - if v.AutoImport != nil { - objectKey := object.Key("AutoImport") - objectKey.Boolean(*v.AutoImport) - } - - if len(v.AwsService) > 0 { - objectKey := object.Key("AwsService") - objectKey.String(string(v.AwsService)) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamScopeId != nil { - objectKey := object.Key("IpamScopeId") - objectKey.String(*v.IpamScopeId) - } - - if v.Locale != nil { - objectKey := object.Key("Locale") - objectKey.String(*v.Locale) - } - - if len(v.PublicIpSource) > 0 { - objectKey := object.Key("PublicIpSource") - objectKey.String(string(v.PublicIpSource)) - } - - if v.PubliclyAdvertisable != nil { - objectKey := object.Key("PubliclyAdvertisable") - objectKey.Boolean(*v.PubliclyAdvertisable) - } - - if v.SourceIpamPoolId != nil { - objectKey := object.Key("SourceIpamPoolId") - objectKey.String(*v.SourceIpamPoolId) - } - - if v.SourceResource != nil { - objectKey := object.Key("SourceResource") - if err := awsEc2query_serializeDocumentIpamPoolSourceResourceRequest(v.SourceResource, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateIpamResourceDiscoveryInput(v *CreateIpamResourceDiscoveryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.OperatingRegions != nil { - objectKey := object.FlatKey("OperatingRegion") - if err := awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v.OperatingRegions, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateIpamScopeInput(v *CreateIpamScopeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateKeyPairInput(v *CreateKeyPairInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.KeyFormat) > 0 { - objectKey := object.Key("KeyFormat") - objectKey.String(string(v.KeyFormat)) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if len(v.KeyType) > 0 { - objectKey := object.Key("KeyType") - objectKey.String(string(v.KeyType)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLaunchTemplateInput(v *CreateLaunchTemplateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchTemplateData != nil { - objectKey := object.Key("LaunchTemplateData") - if err := awsEc2query_serializeDocumentRequestLaunchTemplateData(v.LaunchTemplateData, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Operator != nil { - objectKey := object.Key("Operator") - if err := awsEc2query_serializeDocumentOperatorRequest(v.Operator, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VersionDescription != nil { - objectKey := object.Key("VersionDescription") - objectKey.String(*v.VersionDescription) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLaunchTemplateVersionInput(v *CreateLaunchTemplateVersionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchTemplateData != nil { - objectKey := object.Key("LaunchTemplateData") - if err := awsEc2query_serializeDocumentRequestLaunchTemplateData(v.LaunchTemplateData, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.ResolveAlias != nil { - objectKey := object.Key("ResolveAlias") - objectKey.Boolean(*v.ResolveAlias) - } - - if v.SourceVersion != nil { - objectKey := object.Key("SourceVersion") - objectKey.String(*v.SourceVersion) - } - - if v.VersionDescription != nil { - objectKey := object.Key("VersionDescription") - objectKey.String(*v.VersionDescription) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayRouteInput(v *CreateLocalGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.LocalGatewayVirtualInterfaceGroupId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceGroupId") - objectKey.String(*v.LocalGatewayVirtualInterfaceGroupId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableInput(v *CreateLocalGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayId != nil { - objectKey := object.Key("LocalGatewayId") - objectKey.String(*v.LocalGatewayId) - } - - if len(v.Mode) > 0 { - objectKey := object.Key("Mode") - objectKey.String(string(v.Mode)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(v *CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.LocalGatewayVirtualInterfaceGroupId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceGroupId") - objectKey.String(*v.LocalGatewayVirtualInterfaceGroupId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayRouteTableVpcAssociationInput(v *CreateLocalGatewayRouteTableVpcAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayVirtualInterfaceGroupInput(v *CreateLocalGatewayVirtualInterfaceGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalBgpAsn != nil { - objectKey := object.Key("LocalBgpAsn") - objectKey.Integer(*v.LocalBgpAsn) - } - - if v.LocalBgpAsnExtended != nil { - objectKey := object.Key("LocalBgpAsnExtended") - objectKey.Long(*v.LocalBgpAsnExtended) - } - - if v.LocalGatewayId != nil { - objectKey := object.Key("LocalGatewayId") - objectKey.String(*v.LocalGatewayId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateLocalGatewayVirtualInterfaceInput(v *CreateLocalGatewayVirtualInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalAddress != nil { - objectKey := object.Key("LocalAddress") - objectKey.String(*v.LocalAddress) - } - - if v.LocalGatewayVirtualInterfaceGroupId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceGroupId") - objectKey.String(*v.LocalGatewayVirtualInterfaceGroupId) - } - - if v.OutpostLagId != nil { - objectKey := object.Key("OutpostLagId") - objectKey.String(*v.OutpostLagId) - } - - if v.PeerAddress != nil { - objectKey := object.Key("PeerAddress") - objectKey.String(*v.PeerAddress) - } - - if v.PeerBgpAsn != nil { - objectKey := object.Key("PeerBgpAsn") - objectKey.Integer(*v.PeerBgpAsn) - } - - if v.PeerBgpAsnExtended != nil { - objectKey := object.Key("PeerBgpAsnExtended") - objectKey.Long(*v.PeerBgpAsnExtended) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.Vlan != nil { - objectKey := object.Key("Vlan") - objectKey.Integer(*v.Vlan) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateMacSystemIntegrityProtectionModificationTaskInput(v *CreateMacSystemIntegrityProtectionModificationTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.MacCredentials != nil { - objectKey := object.Key("MacCredentials") - objectKey.String(*v.MacCredentials) - } - - if v.MacSystemIntegrityProtectionConfiguration != nil { - objectKey := object.Key("MacSystemIntegrityProtectionConfiguration") - if err := awsEc2query_serializeDocumentMacSystemIntegrityProtectionConfigurationRequest(v.MacSystemIntegrityProtectionConfiguration, objectKey); err != nil { - return err - } - } - - if len(v.MacSystemIntegrityProtectionStatus) > 0 { - objectKey := object.Key("MacSystemIntegrityProtectionStatus") - objectKey.String(string(v.MacSystemIntegrityProtectionStatus)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateManagedPrefixListInput(v *CreateManagedPrefixListInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddressFamily != nil { - objectKey := object.Key("AddressFamily") - objectKey.String(*v.AddressFamily) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Entries != nil { - objectKey := object.FlatKey("Entry") - if err := awsEc2query_serializeDocumentAddPrefixListEntries(v.Entries, objectKey); err != nil { - return err - } - } - - if v.MaxEntries != nil { - objectKey := object.Key("MaxEntries") - objectKey.Integer(*v.MaxEntries) - } - - if v.PrefixListName != nil { - objectKey := object.Key("PrefixListName") - objectKey.String(*v.PrefixListName) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNatGatewayInput(v *CreateNatGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if len(v.ConnectivityType) > 0 { - objectKey := object.Key("ConnectivityType") - objectKey.String(string(v.ConnectivityType)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.SecondaryAllocationIds != nil { - objectKey := object.FlatKey("SecondaryAllocationId") - if err := awsEc2query_serializeDocumentAllocationIdList(v.SecondaryAllocationIds, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - if v.SecondaryPrivateIpAddresses != nil { - objectKey := object.FlatKey("SecondaryPrivateIpAddress") - if err := awsEc2query_serializeDocumentIpList(v.SecondaryPrivateIpAddresses, objectKey); err != nil { - return err - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkAclEntryInput(v *CreateNetworkAclEntryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrBlock != nil { - objectKey := object.Key("CidrBlock") - objectKey.String(*v.CidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Egress != nil { - objectKey := object.Key("Egress") - objectKey.Boolean(*v.Egress) - } - - if v.IcmpTypeCode != nil { - objectKey := object.Key("Icmp") - if err := awsEc2query_serializeDocumentIcmpTypeCode(v.IcmpTypeCode, objectKey); err != nil { - return err - } - } - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.NetworkAclId != nil { - objectKey := object.Key("NetworkAclId") - objectKey.String(*v.NetworkAclId) - } - - if v.PortRange != nil { - objectKey := object.Key("PortRange") - if err := awsEc2query_serializeDocumentPortRange(v.PortRange, objectKey); err != nil { - return err - } - } - - if v.Protocol != nil { - objectKey := object.Key("Protocol") - objectKey.String(*v.Protocol) - } - - if len(v.RuleAction) > 0 { - objectKey := object.Key("RuleAction") - objectKey.String(string(v.RuleAction)) - } - - if v.RuleNumber != nil { - objectKey := object.Key("RuleNumber") - objectKey.Integer(*v.RuleNumber) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkAclInput(v *CreateNetworkAclInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkInsightsAccessScopeInput(v *CreateNetworkInsightsAccessScopeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExcludePaths != nil { - objectKey := object.FlatKey("ExcludePath") - if err := awsEc2query_serializeDocumentAccessScopePathListRequest(v.ExcludePaths, objectKey); err != nil { - return err - } - } - - if v.MatchPaths != nil { - objectKey := object.FlatKey("MatchPath") - if err := awsEc2query_serializeDocumentAccessScopePathListRequest(v.MatchPaths, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkInsightsPathInput(v *CreateNetworkInsightsPathInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Destination != nil { - objectKey := object.Key("Destination") - objectKey.String(*v.Destination) - } - - if v.DestinationIp != nil { - objectKey := object.Key("DestinationIp") - objectKey.String(*v.DestinationIp) - } - - if v.DestinationPort != nil { - objectKey := object.Key("DestinationPort") - objectKey.Integer(*v.DestinationPort) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FilterAtDestination != nil { - objectKey := object.Key("FilterAtDestination") - if err := awsEc2query_serializeDocumentPathRequestFilter(v.FilterAtDestination, objectKey); err != nil { - return err - } - } - - if v.FilterAtSource != nil { - objectKey := object.Key("FilterAtSource") - if err := awsEc2query_serializeDocumentPathRequestFilter(v.FilterAtSource, objectKey); err != nil { - return err - } - } - - if len(v.Protocol) > 0 { - objectKey := object.Key("Protocol") - objectKey.String(string(v.Protocol)) - } - - if v.Source != nil { - objectKey := object.Key("Source") - objectKey.String(*v.Source) - } - - if v.SourceIp != nil { - objectKey := object.Key("SourceIp") - objectKey.String(*v.SourceIp) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkInterfaceInput(v *CreateNetworkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ConnectionTrackingSpecification != nil { - objectKey := object.Key("ConnectionTrackingSpecification") - if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnablePrimaryIpv6 != nil { - objectKey := object.Key("EnablePrimaryIpv6") - objectKey.Boolean(*v.EnablePrimaryIpv6) - } - - if v.Groups != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if len(v.InterfaceType) > 0 { - objectKey := object.Key("InterfaceType") - objectKey.String(string(v.InterfaceType)) - } - - if v.Ipv4PrefixCount != nil { - objectKey := object.Key("Ipv4PrefixCount") - objectKey.Integer(*v.Ipv4PrefixCount) - } - - if v.Ipv4Prefixes != nil { - objectKey := object.FlatKey("Ipv4Prefix") - if err := awsEc2query_serializeDocumentIpv4PrefixList(v.Ipv4Prefixes, objectKey); err != nil { - return err - } - } - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Addresses") - if err := awsEc2query_serializeDocumentInstanceIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.Ipv6PrefixCount != nil { - objectKey := object.Key("Ipv6PrefixCount") - objectKey.Integer(*v.Ipv6PrefixCount) - } - - if v.Ipv6Prefixes != nil { - objectKey := object.FlatKey("Ipv6Prefix") - if err := awsEc2query_serializeDocumentIpv6PrefixList(v.Ipv6Prefixes, objectKey); err != nil { - return err - } - } - - if v.Operator != nil { - objectKey := object.Key("Operator") - if err := awsEc2query_serializeDocumentOperatorRequest(v.Operator, objectKey); err != nil { - return err - } - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddresses") - if err := awsEc2query_serializeDocumentPrivateIpAddressSpecificationList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - if v.SecondaryPrivateIpAddressCount != nil { - objectKey := object.Key("SecondaryPrivateIpAddressCount") - objectKey.Integer(*v.SecondaryPrivateIpAddressCount) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateNetworkInterfacePermissionInput(v *CreateNetworkInterfacePermissionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AwsAccountId != nil { - objectKey := object.Key("AwsAccountId") - objectKey.String(*v.AwsAccountId) - } - - if v.AwsService != nil { - objectKey := object.Key("AwsService") - objectKey.String(*v.AwsService) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if len(v.Permission) > 0 { - objectKey := object.Key("Permission") - objectKey.String(string(v.Permission)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreatePlacementGroupInput(v *CreatePlacementGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.PartitionCount != nil { - objectKey := object.Key("PartitionCount") - objectKey.Integer(*v.PartitionCount) - } - - if len(v.SpreadLevel) > 0 { - objectKey := object.Key("SpreadLevel") - objectKey.String(string(v.SpreadLevel)) - } - - if len(v.Strategy) > 0 { - objectKey := object.Key("Strategy") - objectKey.String(string(v.Strategy)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreatePublicIpv4PoolInput(v *CreatePublicIpv4PoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateReplaceRootVolumeTaskInput(v *CreateReplaceRootVolumeTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DeleteReplacedRootVolume != nil { - objectKey := object.Key("DeleteReplacedRootVolume") - objectKey.Boolean(*v.DeleteReplacedRootVolume) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VolumeInitializationRate != nil { - objectKey := object.Key("VolumeInitializationRate") - objectKey.Long(*v.VolumeInitializationRate) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateReservedInstancesListingInput(v *CreateReservedInstancesListingInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.PriceSchedules != nil { - objectKey := object.FlatKey("PriceSchedules") - if err := awsEc2query_serializeDocumentPriceScheduleSpecificationList(v.PriceSchedules, objectKey); err != nil { - return err - } - } - - if v.ReservedInstancesId != nil { - objectKey := object.Key("ReservedInstancesId") - objectKey.String(*v.ReservedInstancesId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRestoreImageTaskInput(v *CreateRestoreImageTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Bucket != nil { - objectKey := object.Key("Bucket") - objectKey.String(*v.Bucket) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.ObjectKey != nil { - objectKey := object.Key("ObjectKey") - objectKey.String(*v.ObjectKey) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRouteInput(v *CreateRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CarrierGatewayId != nil { - objectKey := object.Key("CarrierGatewayId") - objectKey.String(*v.CarrierGatewayId) - } - - if v.CoreNetworkArn != nil { - objectKey := object.Key("CoreNetworkArn") - objectKey.String(*v.CoreNetworkArn) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationIpv6CidrBlock != nil { - objectKey := object.Key("DestinationIpv6CidrBlock") - objectKey.String(*v.DestinationIpv6CidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EgressOnlyInternetGatewayId != nil { - objectKey := object.Key("EgressOnlyInternetGatewayId") - objectKey.String(*v.EgressOnlyInternetGatewayId) - } - - if v.GatewayId != nil { - objectKey := object.Key("GatewayId") - objectKey.String(*v.GatewayId) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.LocalGatewayId != nil { - objectKey := object.Key("LocalGatewayId") - objectKey.String(*v.LocalGatewayId) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.OdbNetworkArn != nil { - objectKey := object.Key("OdbNetworkArn") - objectKey.String(*v.OdbNetworkArn) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - if v.VpcEndpointId != nil { - objectKey := object.Key("VpcEndpointId") - objectKey.String(*v.VpcEndpointId) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRouteServerEndpointInput(v *CreateRouteServerEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRouteServerInput(v *CreateRouteServerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AmazonSideAsn != nil { - objectKey := object.Key("AmazonSideAsn") - objectKey.Long(*v.AmazonSideAsn) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.PersistRoutes) > 0 { - objectKey := object.Key("PersistRoutes") - objectKey.String(string(v.PersistRoutes)) - } - - if v.PersistRoutesDuration != nil { - objectKey := object.Key("PersistRoutesDuration") - objectKey.Long(*v.PersistRoutesDuration) - } - - if v.SnsNotificationsEnabled != nil { - objectKey := object.Key("SnsNotificationsEnabled") - objectKey.Boolean(*v.SnsNotificationsEnabled) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRouteServerPeerInput(v *CreateRouteServerPeerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BgpOptions != nil { - objectKey := object.Key("BgpOptions") - if err := awsEc2query_serializeDocumentRouteServerBgpOptionsRequest(v.BgpOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PeerAddress != nil { - objectKey := object.Key("PeerAddress") - objectKey.String(*v.PeerAddress) - } - - if v.RouteServerEndpointId != nil { - objectKey := object.Key("RouteServerEndpointId") - objectKey.String(*v.RouteServerEndpointId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateRouteTableInput(v *CreateRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSecurityGroupInput(v *CreateSecurityGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("GroupDescription") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSnapshotInput(v *CreateSnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.Location) > 0 { - objectKey := object.Key("Location") - objectKey.String(string(v.Location)) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSnapshotsInput(v *CreateSnapshotsInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.CopyTagsFromSource) > 0 { - objectKey := object.Key("CopyTagsFromSource") - objectKey.String(string(v.CopyTagsFromSource)) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceSpecification != nil { - objectKey := object.Key("InstanceSpecification") - if err := awsEc2query_serializeDocumentInstanceSpecification(v.InstanceSpecification, objectKey); err != nil { - return err - } - } - - if len(v.Location) > 0 { - objectKey := object.Key("Location") - objectKey.String(string(v.Location)) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSpotDatafeedSubscriptionInput(v *CreateSpotDatafeedSubscriptionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Bucket != nil { - objectKey := object.Key("Bucket") - objectKey.String(*v.Bucket) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Prefix != nil { - objectKey := object.Key("Prefix") - objectKey.String(*v.Prefix) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateStoreImageTaskInput(v *CreateStoreImageTaskInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Bucket != nil { - objectKey := object.Key("Bucket") - objectKey.String(*v.Bucket) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.S3ObjectTags != nil { - objectKey := object.FlatKey("S3ObjectTag") - if err := awsEc2query_serializeDocumentS3ObjectTagList(v.S3ObjectTags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSubnetCidrReservationInput(v *CreateSubnetCidrReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.ReservationType) > 0 { - objectKey := object.Key("ReservationType") - objectKey.String(string(v.ReservationType)) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateSubnetInput(v *CreateSubnetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.CidrBlock != nil { - objectKey := object.Key("CidrBlock") - objectKey.String(*v.CidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Ipv4IpamPoolId != nil { - objectKey := object.Key("Ipv4IpamPoolId") - objectKey.String(*v.Ipv4IpamPoolId) - } - - if v.Ipv4NetmaskLength != nil { - objectKey := object.Key("Ipv4NetmaskLength") - objectKey.Integer(*v.Ipv4NetmaskLength) - } - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.Ipv6IpamPoolId != nil { - objectKey := object.Key("Ipv6IpamPoolId") - objectKey.String(*v.Ipv6IpamPoolId) - } - - if v.Ipv6Native != nil { - objectKey := object.Key("Ipv6Native") - objectKey.Boolean(*v.Ipv6Native) - } - - if v.Ipv6NetmaskLength != nil { - objectKey := object.Key("Ipv6NetmaskLength") - objectKey.Integer(*v.Ipv6NetmaskLength) - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTagsInput(v *CreateTagsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Resources != nil { - objectKey := object.FlatKey("ResourceId") - if err := awsEc2query_serializeDocumentResourceIdList(v.Resources, objectKey); err != nil { - return err - } - } - - if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsEc2query_serializeDocumentTagList(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTrafficMirrorFilterInput(v *CreateTrafficMirrorFilterInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTrafficMirrorFilterRuleInput(v *CreateTrafficMirrorFilterRuleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationPortRange != nil { - objectKey := object.Key("DestinationPortRange") - if err := awsEc2query_serializeDocumentTrafficMirrorPortRangeRequest(v.DestinationPortRange, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Protocol != nil { - objectKey := object.Key("Protocol") - objectKey.Integer(*v.Protocol) - } - - if len(v.RuleAction) > 0 { - objectKey := object.Key("RuleAction") - objectKey.String(string(v.RuleAction)) - } - - if v.RuleNumber != nil { - objectKey := object.Key("RuleNumber") - objectKey.Integer(*v.RuleNumber) - } - - if v.SourceCidrBlock != nil { - objectKey := object.Key("SourceCidrBlock") - objectKey.String(*v.SourceCidrBlock) - } - - if v.SourcePortRange != nil { - objectKey := object.Key("SourcePortRange") - if err := awsEc2query_serializeDocumentTrafficMirrorPortRangeRequest(v.SourcePortRange, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TrafficDirection) > 0 { - objectKey := object.Key("TrafficDirection") - objectKey.String(string(v.TrafficDirection)) - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTrafficMirrorSessionInput(v *CreateTrafficMirrorSessionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PacketLength != nil { - objectKey := object.Key("PacketLength") - objectKey.Integer(*v.PacketLength) - } - - if v.SessionNumber != nil { - objectKey := object.Key("SessionNumber") - objectKey.Integer(*v.SessionNumber) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - if v.TrafficMirrorTargetId != nil { - objectKey := object.Key("TrafficMirrorTargetId") - objectKey.String(*v.TrafficMirrorTargetId) - } - - if v.VirtualNetworkId != nil { - objectKey := object.Key("VirtualNetworkId") - objectKey.Integer(*v.VirtualNetworkId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTrafficMirrorTargetInput(v *CreateTrafficMirrorTargetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GatewayLoadBalancerEndpointId != nil { - objectKey := object.Key("GatewayLoadBalancerEndpointId") - objectKey.String(*v.GatewayLoadBalancerEndpointId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.NetworkLoadBalancerArn != nil { - objectKey := object.Key("NetworkLoadBalancerArn") - objectKey.String(*v.NetworkLoadBalancerArn) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayConnectInput(v *CreateTransitGatewayConnectInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentCreateTransitGatewayConnectRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransportTransitGatewayAttachmentId != nil { - objectKey := object.Key("TransportTransitGatewayAttachmentId") - objectKey.String(*v.TransportTransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayConnectPeerInput(v *CreateTransitGatewayConnectPeerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BgpOptions != nil { - objectKey := object.Key("BgpOptions") - if err := awsEc2query_serializeDocumentTransitGatewayConnectRequestBgpOptions(v.BgpOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InsideCidrBlocks != nil { - objectKey := object.FlatKey("InsideCidrBlocks") - if err := awsEc2query_serializeDocumentInsideCidrBlocksStringList(v.InsideCidrBlocks, objectKey); err != nil { - return err - } - } - - if v.PeerAddress != nil { - objectKey := object.Key("PeerAddress") - objectKey.String(*v.PeerAddress) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAddress != nil { - objectKey := object.Key("TransitGatewayAddress") - objectKey.String(*v.TransitGatewayAddress) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayInput(v *CreateTransitGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentTransitGatewayRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayMulticastDomainInput(v *CreateTransitGatewayMulticastDomainInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentCreateTransitGatewayMulticastDomainRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayPeeringAttachmentInput(v *CreateTransitGatewayPeeringAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentCreateTransitGatewayPeeringAttachmentRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.PeerAccountId != nil { - objectKey := object.Key("PeerAccountId") - objectKey.String(*v.PeerAccountId) - } - - if v.PeerRegion != nil { - objectKey := object.Key("PeerRegion") - objectKey.String(*v.PeerRegion) - } - - if v.PeerTransitGatewayId != nil { - objectKey := object.Key("PeerTransitGatewayId") - objectKey.String(*v.PeerTransitGatewayId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayPolicyTableInput(v *CreateTransitGatewayPolicyTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecifications") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayPrefixListReferenceInput(v *CreateTransitGatewayPrefixListReferenceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Blackhole != nil { - objectKey := object.Key("Blackhole") - objectKey.Boolean(*v.Blackhole) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayRouteInput(v *CreateTransitGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Blackhole != nil { - objectKey := object.Key("Blackhole") - objectKey.Boolean(*v.Blackhole) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayRouteTableAnnouncementInput(v *CreateTransitGatewayRouteTableAnnouncementInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PeeringAttachmentId != nil { - objectKey := object.Key("PeeringAttachmentId") - objectKey.String(*v.PeeringAttachmentId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayRouteTableInput(v *CreateTransitGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecifications") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateTransitGatewayVpcAttachmentInput(v *CreateTransitGatewayVpcAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentCreateTransitGatewayVpcAttachmentRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetIds") - if err := awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecifications") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVerifiedAccessEndpointInput(v *CreateVerifiedAccessEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ApplicationDomain != nil { - objectKey := object.Key("ApplicationDomain") - objectKey.String(*v.ApplicationDomain) - } - - if len(v.AttachmentType) > 0 { - objectKey := object.Key("AttachmentType") - objectKey.String(string(v.AttachmentType)) - } - - if v.CidrOptions != nil { - objectKey := object.Key("CidrOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointCidrOptions(v.CidrOptions, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DomainCertificateArn != nil { - objectKey := object.Key("DomainCertificateArn") - objectKey.String(*v.DomainCertificateArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndpointDomainPrefix != nil { - objectKey := object.Key("EndpointDomainPrefix") - objectKey.String(*v.EndpointDomainPrefix) - } - - if len(v.EndpointType) > 0 { - objectKey := object.Key("EndpointType") - objectKey.String(string(v.EndpointType)) - } - - if v.LoadBalancerOptions != nil { - objectKey := object.Key("LoadBalancerOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointLoadBalancerOptions(v.LoadBalancerOptions, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceOptions != nil { - objectKey := object.Key("NetworkInterfaceOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointEniOptions(v.NetworkInterfaceOptions, objectKey); err != nil { - return err - } - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.RdsOptions != nil { - objectKey := object.Key("RdsOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessEndpointRdsOptions(v.RdsOptions, objectKey); err != nil { - return err - } - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdList(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVerifiedAccessGroupInput(v *CreateVerifiedAccessGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVerifiedAccessInstanceInput(v *CreateVerifiedAccessInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrEndpointsCustomSubDomain != nil { - objectKey := object.Key("CidrEndpointsCustomSubDomain") - objectKey.String(*v.CidrEndpointsCustomSubDomain) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FIPSEnabled != nil { - objectKey := object.Key("FIPSEnabled") - objectKey.Boolean(*v.FIPSEnabled) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVerifiedAccessTrustProviderInput(v *CreateVerifiedAccessTrustProviderInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceOptions != nil { - objectKey := object.Key("DeviceOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessTrustProviderDeviceOptions(v.DeviceOptions, objectKey); err != nil { - return err - } - } - - if len(v.DeviceTrustProviderType) > 0 { - objectKey := object.Key("DeviceTrustProviderType") - objectKey.String(string(v.DeviceTrustProviderType)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NativeApplicationOidcOptions != nil { - objectKey := object.Key("NativeApplicationOidcOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessNativeApplicationOidcOptions(v.NativeApplicationOidcOptions, objectKey); err != nil { - return err - } - } - - if v.OidcOptions != nil { - objectKey := object.Key("OidcOptions") - if err := awsEc2query_serializeDocumentCreateVerifiedAccessTrustProviderOidcOptions(v.OidcOptions, objectKey); err != nil { - return err - } - } - - if v.PolicyReferenceName != nil { - objectKey := object.Key("PolicyReferenceName") - objectKey.String(*v.PolicyReferenceName) - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TrustProviderType) > 0 { - objectKey := object.Key("TrustProviderType") - objectKey.String(string(v.TrustProviderType)) - } - - if len(v.UserTrustProviderType) > 0 { - objectKey := object.Key("UserTrustProviderType") - objectKey.String(string(v.UserTrustProviderType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVolumeInput(v *CreateVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.MultiAttachEnabled != nil { - objectKey := object.Key("MultiAttachEnabled") - objectKey.Boolean(*v.MultiAttachEnabled) - } - - if v.Operator != nil { - objectKey := object.Key("Operator") - if err := awsEc2query_serializeDocumentOperatorRequest(v.Operator, objectKey); err != nil { - return err - } - } - - if v.OutpostArn != nil { - objectKey := object.Key("OutpostArn") - objectKey.String(*v.OutpostArn) - } - - if v.Size != nil { - objectKey := object.Key("Size") - objectKey.Integer(*v.Size) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.Throughput != nil { - objectKey := object.Key("Throughput") - objectKey.Integer(*v.Throughput) - } - - if v.VolumeInitializationRate != nil { - objectKey := object.Key("VolumeInitializationRate") - objectKey.Integer(*v.VolumeInitializationRate) - } - - if len(v.VolumeType) > 0 { - objectKey := object.Key("VolumeType") - objectKey.String(string(v.VolumeType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcBlockPublicAccessExclusionInput(v *CreateVpcBlockPublicAccessExclusionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InternetGatewayExclusionMode) > 0 { - objectKey := object.Key("InternetGatewayExclusionMode") - objectKey.String(string(v.InternetGatewayExclusionMode)) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcEndpointConnectionNotificationInput(v *CreateVpcEndpointConnectionNotificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ConnectionEvents != nil { - objectKey := object.FlatKey("ConnectionEvents") - if err := awsEc2query_serializeDocumentValueStringList(v.ConnectionEvents, objectKey); err != nil { - return err - } - } - - if v.ConnectionNotificationArn != nil { - objectKey := object.Key("ConnectionNotificationArn") - objectKey.String(*v.ConnectionNotificationArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - if v.VpcEndpointId != nil { - objectKey := object.Key("VpcEndpointId") - objectKey.String(*v.VpcEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DnsOptions != nil { - objectKey := object.Key("DnsOptions") - if err := awsEc2query_serializeDocumentDnsOptionsSpecification(v.DnsOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.IpAddressType) > 0 { - objectKey := object.Key("IpAddressType") - objectKey.String(string(v.IpAddressType)) - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.PrivateDnsEnabled != nil { - objectKey := object.Key("PrivateDnsEnabled") - objectKey.Boolean(*v.PrivateDnsEnabled) - } - - if v.ResourceConfigurationArn != nil { - objectKey := object.Key("ResourceConfigurationArn") - objectKey.String(*v.ResourceConfigurationArn) - } - - if v.RouteTableIds != nil { - objectKey := object.FlatKey("RouteTableId") - if err := awsEc2query_serializeDocumentVpcEndpointRouteTableIdList(v.RouteTableIds, objectKey); err != nil { - return err - } - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentVpcEndpointSecurityGroupIdList(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.ServiceName != nil { - objectKey := object.Key("ServiceName") - objectKey.String(*v.ServiceName) - } - - if v.ServiceNetworkArn != nil { - objectKey := object.Key("ServiceNetworkArn") - objectKey.String(*v.ServiceNetworkArn) - } - - if v.ServiceRegion != nil { - objectKey := object.Key("ServiceRegion") - objectKey.String(*v.ServiceRegion) - } - - if v.SubnetConfigurations != nil { - objectKey := object.FlatKey("SubnetConfiguration") - if err := awsEc2query_serializeDocumentSubnetConfigurationsList(v.SubnetConfigurations, objectKey); err != nil { - return err - } - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentVpcEndpointSubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.VpcEndpointType) > 0 { - objectKey := object.Key("VpcEndpointType") - objectKey.String(string(v.VpcEndpointType)) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcEndpointServiceConfigurationInput(v *CreateVpcEndpointServiceConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AcceptanceRequired != nil { - objectKey := object.Key("AcceptanceRequired") - objectKey.Boolean(*v.AcceptanceRequired) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GatewayLoadBalancerArns != nil { - objectKey := object.FlatKey("GatewayLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.GatewayLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.NetworkLoadBalancerArns != nil { - objectKey := object.FlatKey("NetworkLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.NetworkLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.PrivateDnsName != nil { - objectKey := object.Key("PrivateDnsName") - objectKey.String(*v.PrivateDnsName) - } - - if v.SupportedIpAddressTypes != nil { - objectKey := object.FlatKey("SupportedIpAddressType") - if err := awsEc2query_serializeDocumentValueStringList(v.SupportedIpAddressTypes, objectKey); err != nil { - return err - } - } - - if v.SupportedRegions != nil { - objectKey := object.FlatKey("SupportedRegion") - if err := awsEc2query_serializeDocumentValueStringList(v.SupportedRegions, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcInput(v *CreateVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AmazonProvidedIpv6CidrBlock != nil { - objectKey := object.Key("AmazonProvidedIpv6CidrBlock") - objectKey.Boolean(*v.AmazonProvidedIpv6CidrBlock) - } - - if v.CidrBlock != nil { - objectKey := object.Key("CidrBlock") - objectKey.String(*v.CidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InstanceTenancy) > 0 { - objectKey := object.Key("InstanceTenancy") - objectKey.String(string(v.InstanceTenancy)) - } - - if v.Ipv4IpamPoolId != nil { - objectKey := object.Key("Ipv4IpamPoolId") - objectKey.String(*v.Ipv4IpamPoolId) - } - - if v.Ipv4NetmaskLength != nil { - objectKey := object.Key("Ipv4NetmaskLength") - objectKey.Integer(*v.Ipv4NetmaskLength) - } - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.Ipv6CidrBlockNetworkBorderGroup != nil { - objectKey := object.Key("Ipv6CidrBlockNetworkBorderGroup") - objectKey.String(*v.Ipv6CidrBlockNetworkBorderGroup) - } - - if v.Ipv6IpamPoolId != nil { - objectKey := object.Key("Ipv6IpamPoolId") - objectKey.String(*v.Ipv6IpamPoolId) - } - - if v.Ipv6NetmaskLength != nil { - objectKey := object.Key("Ipv6NetmaskLength") - objectKey.Integer(*v.Ipv6NetmaskLength) - } - - if v.Ipv6Pool != nil { - objectKey := object.Key("Ipv6Pool") - objectKey.String(*v.Ipv6Pool) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpcPeeringConnectionInput(v *CreateVpcPeeringConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PeerOwnerId != nil { - objectKey := object.Key("PeerOwnerId") - objectKey.String(*v.PeerOwnerId) - } - - if v.PeerRegion != nil { - objectKey := object.Key("PeerRegion") - objectKey.String(*v.PeerRegion) - } - - if v.PeerVpcId != nil { - objectKey := object.Key("PeerVpcId") - objectKey.String(*v.PeerVpcId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpnConnectionInput(v *CreateVpnConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomerGatewayId != nil { - objectKey := object.Key("CustomerGatewayId") - objectKey.String(*v.CustomerGatewayId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentVpnConnectionOptionsSpecification(v.Options, objectKey); err != nil { - return err - } - } - - if v.PreSharedKeyStorage != nil { - objectKey := object.Key("PreSharedKeyStorage") - objectKey.String(*v.PreSharedKeyStorage) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - if v.Type != nil { - objectKey := object.Key("Type") - objectKey.String(*v.Type) - } - - if v.VpnGatewayId != nil { - objectKey := object.Key("VpnGatewayId") - objectKey.String(*v.VpnGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpnConnectionRouteInput(v *CreateVpnConnectionRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentCreateVpnGatewayInput(v *CreateVpnGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AmazonSideAsn != nil { - objectKey := object.Key("AmazonSideAsn") - objectKey.Long(*v.AmazonSideAsn) - } - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteCarrierGatewayInput(v *DeleteCarrierGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CarrierGatewayId != nil { - objectKey := object.Key("CarrierGatewayId") - objectKey.String(*v.CarrierGatewayId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteClientVpnEndpointInput(v *DeleteClientVpnEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteClientVpnRouteInput(v *DeleteClientVpnRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TargetVpcSubnetId != nil { - objectKey := object.Key("TargetVpcSubnetId") - objectKey.String(*v.TargetVpcSubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteCoipCidrInput(v *DeleteCoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.CoipPoolId != nil { - objectKey := object.Key("CoipPoolId") - objectKey.String(*v.CoipPoolId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteCoipPoolInput(v *DeleteCoipPoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CoipPoolId != nil { - objectKey := object.Key("CoipPoolId") - objectKey.String(*v.CoipPoolId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteCustomerGatewayInput(v *DeleteCustomerGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomerGatewayId != nil { - objectKey := object.Key("CustomerGatewayId") - objectKey.String(*v.CustomerGatewayId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteDhcpOptionsInput(v *DeleteDhcpOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DhcpOptionsId != nil { - objectKey := object.Key("DhcpOptionsId") - objectKey.String(*v.DhcpOptionsId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteEgressOnlyInternetGatewayInput(v *DeleteEgressOnlyInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EgressOnlyInternetGatewayId != nil { - objectKey := object.Key("EgressOnlyInternetGatewayId") - objectKey.String(*v.EgressOnlyInternetGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteFleetsInput(v *DeleteFleetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FleetIds != nil { - objectKey := object.FlatKey("FleetId") - if err := awsEc2query_serializeDocumentFleetIdSet(v.FleetIds, objectKey); err != nil { - return err - } - } - - if v.TerminateInstances != nil { - objectKey := object.Key("TerminateInstances") - objectKey.Boolean(*v.TerminateInstances) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteFlowLogsInput(v *DeleteFlowLogsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FlowLogIds != nil { - objectKey := object.FlatKey("FlowLogId") - if err := awsEc2query_serializeDocumentFlowLogIdList(v.FlowLogIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteFpgaImageInput(v *DeleteFpgaImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FpgaImageId != nil { - objectKey := object.Key("FpgaImageId") - objectKey.String(*v.FpgaImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteInstanceConnectEndpointInput(v *DeleteInstanceConnectEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceConnectEndpointId != nil { - objectKey := object.Key("InstanceConnectEndpointId") - objectKey.String(*v.InstanceConnectEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteInstanceEventWindowInput(v *DeleteInstanceEventWindowInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ForceDelete != nil { - objectKey := object.Key("ForceDelete") - objectKey.Boolean(*v.ForceDelete) - } - - if v.InstanceEventWindowId != nil { - objectKey := object.Key("InstanceEventWindowId") - objectKey.String(*v.InstanceEventWindowId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteInternetGatewayInput(v *DeleteInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InternetGatewayId != nil { - objectKey := object.Key("InternetGatewayId") - objectKey.String(*v.InternetGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteIpamExternalResourceVerificationTokenInput(v *DeleteIpamExternalResourceVerificationTokenInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamExternalResourceVerificationTokenId != nil { - objectKey := object.Key("IpamExternalResourceVerificationTokenId") - objectKey.String(*v.IpamExternalResourceVerificationTokenId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteIpamInput(v *DeleteIpamInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cascade != nil { - objectKey := object.Key("Cascade") - objectKey.Boolean(*v.Cascade) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteIpamPoolInput(v *DeleteIpamPoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cascade != nil { - objectKey := object.Key("Cascade") - objectKey.Boolean(*v.Cascade) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteIpamResourceDiscoveryInput(v *DeleteIpamResourceDiscoveryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteIpamScopeInput(v *DeleteIpamScopeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamScopeId != nil { - objectKey := object.Key("IpamScopeId") - objectKey.String(*v.IpamScopeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteKeyPairInput(v *DeleteKeyPairInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.KeyPairId != nil { - objectKey := object.Key("KeyPairId") - objectKey.String(*v.KeyPairId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLaunchTemplateInput(v *DeleteLaunchTemplateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLaunchTemplateVersionsInput(v *DeleteLaunchTemplateVersionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.Versions != nil { - objectKey := object.FlatKey("LaunchTemplateVersion") - if err := awsEc2query_serializeDocumentVersionStringList(v.Versions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteInput(v *DeleteLocalGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableInput(v *DeleteLocalGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(v *DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableVirtualInterfaceGroupAssociationId != nil { - objectKey := object.Key("LocalGatewayRouteTableVirtualInterfaceGroupAssociationId") - objectKey.String(*v.LocalGatewayRouteTableVirtualInterfaceGroupAssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayRouteTableVpcAssociationInput(v *DeleteLocalGatewayRouteTableVpcAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableVpcAssociationId != nil { - objectKey := object.Key("LocalGatewayRouteTableVpcAssociationId") - objectKey.String(*v.LocalGatewayRouteTableVpcAssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayVirtualInterfaceGroupInput(v *DeleteLocalGatewayVirtualInterfaceGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayVirtualInterfaceGroupId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceGroupId") - objectKey.String(*v.LocalGatewayVirtualInterfaceGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteLocalGatewayVirtualInterfaceInput(v *DeleteLocalGatewayVirtualInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayVirtualInterfaceId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceId") - objectKey.String(*v.LocalGatewayVirtualInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteManagedPrefixListInput(v *DeleteManagedPrefixListInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNatGatewayInput(v *DeleteNatGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkAclEntryInput(v *DeleteNetworkAclEntryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Egress != nil { - objectKey := object.Key("Egress") - objectKey.Boolean(*v.Egress) - } - - if v.NetworkAclId != nil { - objectKey := object.Key("NetworkAclId") - objectKey.String(*v.NetworkAclId) - } - - if v.RuleNumber != nil { - objectKey := object.Key("RuleNumber") - objectKey.Integer(*v.RuleNumber) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkAclInput(v *DeleteNetworkAclInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkAclId != nil { - objectKey := object.Key("NetworkAclId") - objectKey.String(*v.NetworkAclId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInsightsAccessScopeAnalysisInput(v *DeleteNetworkInsightsAccessScopeAnalysisInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsAccessScopeAnalysisId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeAnalysisId") - objectKey.String(*v.NetworkInsightsAccessScopeAnalysisId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInsightsAccessScopeInput(v *DeleteNetworkInsightsAccessScopeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsAccessScopeId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeId") - objectKey.String(*v.NetworkInsightsAccessScopeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInsightsAnalysisInput(v *DeleteNetworkInsightsAnalysisInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsAnalysisId != nil { - objectKey := object.Key("NetworkInsightsAnalysisId") - objectKey.String(*v.NetworkInsightsAnalysisId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInsightsPathInput(v *DeleteNetworkInsightsPathInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsPathId != nil { - objectKey := object.Key("NetworkInsightsPathId") - objectKey.String(*v.NetworkInsightsPathId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInterfaceInput(v *DeleteNetworkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteNetworkInterfacePermissionInput(v *DeleteNetworkInterfacePermissionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Force != nil { - objectKey := object.Key("Force") - objectKey.Boolean(*v.Force) - } - - if v.NetworkInterfacePermissionId != nil { - objectKey := object.Key("NetworkInterfacePermissionId") - objectKey.String(*v.NetworkInterfacePermissionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeletePlacementGroupInput(v *DeletePlacementGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeletePublicIpv4PoolInput(v *DeletePublicIpv4PoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.PoolId != nil { - objectKey := object.Key("PoolId") - objectKey.String(*v.PoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteQueuedReservedInstancesInput(v *DeleteQueuedReservedInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReservedInstancesIds != nil { - objectKey := object.FlatKey("ReservedInstancesId") - if err := awsEc2query_serializeDocumentDeleteQueuedReservedInstancesIdList(v.ReservedInstancesIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteRouteInput(v *DeleteRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationIpv6CidrBlock != nil { - objectKey := object.Key("DestinationIpv6CidrBlock") - objectKey.String(*v.DestinationIpv6CidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteRouteServerEndpointInput(v *DeleteRouteServerEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerEndpointId != nil { - objectKey := object.Key("RouteServerEndpointId") - objectKey.String(*v.RouteServerEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteRouteServerInput(v *DeleteRouteServerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteRouteServerPeerInput(v *DeleteRouteServerPeerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerPeerId != nil { - objectKey := object.Key("RouteServerPeerId") - objectKey.String(*v.RouteServerPeerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteRouteTableInput(v *DeleteRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteSecurityGroupInput(v *DeleteSecurityGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteSnapshotInput(v *DeleteSnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteSpotDatafeedSubscriptionInput(v *DeleteSpotDatafeedSubscriptionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteSubnetCidrReservationInput(v *DeleteSubnetCidrReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetCidrReservationId != nil { - objectKey := object.Key("SubnetCidrReservationId") - objectKey.String(*v.SubnetCidrReservationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteSubnetInput(v *DeleteSubnetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTagsInput(v *DeleteTagsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Resources != nil { - objectKey := object.FlatKey("ResourceId") - if err := awsEc2query_serializeDocumentResourceIdList(v.Resources, objectKey); err != nil { - return err - } - } - - if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsEc2query_serializeDocumentTagList(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTrafficMirrorFilterInput(v *DeleteTrafficMirrorFilterInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTrafficMirrorFilterRuleInput(v *DeleteTrafficMirrorFilterRuleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TrafficMirrorFilterRuleId != nil { - objectKey := object.Key("TrafficMirrorFilterRuleId") - objectKey.String(*v.TrafficMirrorFilterRuleId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTrafficMirrorSessionInput(v *DeleteTrafficMirrorSessionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TrafficMirrorSessionId != nil { - objectKey := object.Key("TrafficMirrorSessionId") - objectKey.String(*v.TrafficMirrorSessionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTrafficMirrorTargetInput(v *DeleteTrafficMirrorTargetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TrafficMirrorTargetId != nil { - objectKey := object.Key("TrafficMirrorTargetId") - objectKey.String(*v.TrafficMirrorTargetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayConnectInput(v *DeleteTransitGatewayConnectInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayConnectPeerInput(v *DeleteTransitGatewayConnectPeerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayConnectPeerId != nil { - objectKey := object.Key("TransitGatewayConnectPeerId") - objectKey.String(*v.TransitGatewayConnectPeerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayInput(v *DeleteTransitGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayMulticastDomainInput(v *DeleteTransitGatewayMulticastDomainInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayPeeringAttachmentInput(v *DeleteTransitGatewayPeeringAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayPolicyTableInput(v *DeleteTransitGatewayPolicyTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayPolicyTableId != nil { - objectKey := object.Key("TransitGatewayPolicyTableId") - objectKey.String(*v.TransitGatewayPolicyTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayPrefixListReferenceInput(v *DeleteTransitGatewayPrefixListReferenceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteInput(v *DeleteTransitGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteTableAnnouncementInput(v *DeleteTransitGatewayRouteTableAnnouncementInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayRouteTableAnnouncementId != nil { - objectKey := object.Key("TransitGatewayRouteTableAnnouncementId") - objectKey.String(*v.TransitGatewayRouteTableAnnouncementId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayRouteTableInput(v *DeleteTransitGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteTransitGatewayVpcAttachmentInput(v *DeleteTransitGatewayVpcAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVerifiedAccessEndpointInput(v *DeleteVerifiedAccessEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessEndpointId != nil { - objectKey := object.Key("VerifiedAccessEndpointId") - objectKey.String(*v.VerifiedAccessEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVerifiedAccessGroupInput(v *DeleteVerifiedAccessGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVerifiedAccessInstanceInput(v *DeleteVerifiedAccessInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVerifiedAccessTrustProviderInput(v *DeleteVerifiedAccessTrustProviderInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessTrustProviderId != nil { - objectKey := object.Key("VerifiedAccessTrustProviderId") - objectKey.String(*v.VerifiedAccessTrustProviderId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVolumeInput(v *DeleteVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcBlockPublicAccessExclusionInput(v *DeleteVpcBlockPublicAccessExclusionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExclusionId != nil { - objectKey := object.Key("ExclusionId") - objectKey.String(*v.ExclusionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcEndpointConnectionNotificationsInput(v *DeleteVpcEndpointConnectionNotificationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConnectionNotificationIds != nil { - objectKey := object.FlatKey("ConnectionNotificationId") - if err := awsEc2query_serializeDocumentConnectionNotificationIdsList(v.ConnectionNotificationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcEndpointServiceConfigurationsInput(v *DeleteVpcEndpointServiceConfigurationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ServiceIds != nil { - objectKey := object.FlatKey("ServiceId") - if err := awsEc2query_serializeDocumentVpcEndpointServiceIdList(v.ServiceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcEndpointsInput(v *DeleteVpcEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcEndpointIds != nil { - objectKey := object.FlatKey("VpcEndpointId") - if err := awsEc2query_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcInput(v *DeleteVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpcPeeringConnectionInput(v *DeleteVpcPeeringConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpnConnectionInput(v *DeleteVpnConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpnConnectionRouteInput(v *DeleteVpnConnectionRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeleteVpnGatewayInput(v *DeleteVpnGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnGatewayId != nil { - objectKey := object.Key("VpnGatewayId") - objectKey.String(*v.VpnGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeprovisionByoipCidrInput(v *DeprovisionByoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeprovisionIpamByoasnInput(v *DeprovisionIpamByoasnInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Asn != nil { - objectKey := object.Key("Asn") - objectKey.String(*v.Asn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeprovisionIpamPoolCidrInput(v *DeprovisionIpamPoolCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeprovisionPublicIpv4PoolCidrInput(v *DeprovisionPublicIpv4PoolCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PoolId != nil { - objectKey := object.Key("PoolId") - objectKey.String(*v.PoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeregisterImageInput(v *DeregisterImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DeleteAssociatedSnapshots != nil { - objectKey := object.Key("DeleteAssociatedSnapshots") - objectKey.Boolean(*v.DeleteAssociatedSnapshots) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeregisterInstanceEventNotificationAttributesInput(v *DeregisterInstanceEventNotificationAttributesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceTagAttribute != nil { - objectKey := object.Key("InstanceTagAttribute") - if err := awsEc2query_serializeDocumentDeregisterInstanceTagAttributeRequest(v.InstanceTagAttribute, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeregisterTransitGatewayMulticastGroupMembersInput(v *DeregisterTransitGatewayMulticastGroupMembersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupIpAddress != nil { - objectKey := object.Key("GroupIpAddress") - objectKey.String(*v.GroupIpAddress) - } - - if v.NetworkInterfaceIds != nil { - objectKey := object.FlatKey("NetworkInterfaceIds") - if err := awsEc2query_serializeDocumentTransitGatewayNetworkInterfaceIdList(v.NetworkInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDeregisterTransitGatewayMulticastGroupSourcesInput(v *DeregisterTransitGatewayMulticastGroupSourcesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupIpAddress != nil { - objectKey := object.Key("GroupIpAddress") - objectKey.String(*v.GroupIpAddress) - } - - if v.NetworkInterfaceIds != nil { - objectKey := object.FlatKey("NetworkInterfaceIds") - if err := awsEc2query_serializeDocumentTransitGatewayNetworkInterfaceIdList(v.NetworkInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAccountAttributesInput(v *DescribeAccountAttributesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AttributeNames != nil { - objectKey := object.FlatKey("AttributeName") - if err := awsEc2query_serializeDocumentAccountAttributeNameStringList(v.AttributeNames, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAddressesAttributeInput(v *DescribeAddressesAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationIds != nil { - objectKey := object.FlatKey("AllocationId") - if err := awsEc2query_serializeDocumentAllocationIds(v.AllocationIds, objectKey); err != nil { - return err - } - } - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAddressesInput(v *DescribeAddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationIds != nil { - objectKey := object.FlatKey("AllocationId") - if err := awsEc2query_serializeDocumentAllocationIdList(v.AllocationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.PublicIps != nil { - objectKey := object.FlatKey("PublicIp") - if err := awsEc2query_serializeDocumentPublicIpStringList(v.PublicIps, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAddressTransfersInput(v *DescribeAddressTransfersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationIds != nil { - objectKey := object.FlatKey("AllocationId") - if err := awsEc2query_serializeDocumentAllocationIdList(v.AllocationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAggregateIdFormatInput(v *DescribeAggregateIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAvailabilityZonesInput(v *DescribeAvailabilityZonesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllAvailabilityZones != nil { - objectKey := object.Key("AllAvailabilityZones") - objectKey.Boolean(*v.AllAvailabilityZones) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ZoneIds != nil { - objectKey := object.FlatKey("ZoneId") - if err := awsEc2query_serializeDocumentZoneIdStringList(v.ZoneIds, objectKey); err != nil { - return err - } - } - - if v.ZoneNames != nil { - objectKey := object.FlatKey("ZoneName") - if err := awsEc2query_serializeDocumentZoneNameStringList(v.ZoneNames, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeAwsNetworkPerformanceMetricSubscriptionsInput(v *DescribeAwsNetworkPerformanceMetricSubscriptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeBundleTasksInput(v *DescribeBundleTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.BundleIds != nil { - objectKey := object.FlatKey("BundleId") - if err := awsEc2query_serializeDocumentBundleIdStringList(v.BundleIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeByoipCidrsInput(v *DescribeByoipCidrsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionHistoryInput(v *DescribeCapacityBlockExtensionHistoryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationIds != nil { - objectKey := object.FlatKey("CapacityReservationId") - if err := awsEc2query_serializeDocumentCapacityReservationIdSet(v.CapacityReservationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionOfferingsInput(v *DescribeCapacityBlockExtensionOfferingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityBlockExtensionDurationHours != nil { - objectKey := object.Key("CapacityBlockExtensionDurationHours") - objectKey.Integer(*v.CapacityBlockExtensionDurationHours) - } - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityBlockOfferingsInput(v *DescribeCapacityBlockOfferingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityDurationHours != nil { - objectKey := object.Key("CapacityDurationHours") - objectKey.Integer(*v.CapacityDurationHours) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndDateRange != nil { - objectKey := object.Key("EndDateRange") - objectKey.String(smithytime.FormatDateTime(*v.EndDateRange)) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - objectKey.String(*v.InstanceType) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.StartDateRange != nil { - objectKey := object.Key("StartDateRange") - objectKey.String(smithytime.FormatDateTime(*v.StartDateRange)) - } - - if v.UltraserverCount != nil { - objectKey := object.Key("UltraserverCount") - objectKey.Integer(*v.UltraserverCount) - } - - if v.UltraserverType != nil { - objectKey := object.Key("UltraserverType") - objectKey.String(*v.UltraserverType) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityBlocksInput(v *DescribeCapacityBlocksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityBlockIds != nil { - objectKey := object.FlatKey("CapacityBlockId") - if err := awsEc2query_serializeDocumentCapacityBlockIds(v.CapacityBlockIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityBlockStatusInput(v *DescribeCapacityBlockStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityBlockIds != nil { - objectKey := object.FlatKey("CapacityBlockId") - if err := awsEc2query_serializeDocumentCapacityBlockIds(v.CapacityBlockIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityReservationBillingRequestsInput(v *DescribeCapacityReservationBillingRequestsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationIds != nil { - objectKey := object.FlatKey("CapacityReservationId") - if err := awsEc2query_serializeDocumentCapacityReservationIdSet(v.CapacityReservationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if len(v.Role) > 0 { - objectKey := object.Key("Role") - objectKey.String(string(v.Role)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityReservationFleetsInput(v *DescribeCapacityReservationFleetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationFleetIds != nil { - objectKey := object.FlatKey("CapacityReservationFleetId") - if err := awsEc2query_serializeDocumentCapacityReservationFleetIdSet(v.CapacityReservationFleetIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCapacityReservationsInput(v *DescribeCapacityReservationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationIds != nil { - objectKey := object.FlatKey("CapacityReservationId") - if err := awsEc2query_serializeDocumentCapacityReservationIdSet(v.CapacityReservationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCarrierGatewaysInput(v *DescribeCarrierGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CarrierGatewayIds != nil { - objectKey := object.FlatKey("CarrierGatewayId") - if err := awsEc2query_serializeDocumentCarrierGatewayIdSet(v.CarrierGatewayIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClassicLinkInstancesInput(v *DescribeClassicLinkInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClientVpnAuthorizationRulesInput(v *DescribeClientVpnAuthorizationRulesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClientVpnConnectionsInput(v *DescribeClientVpnConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClientVpnEndpointsInput(v *DescribeClientVpnEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointIds != nil { - objectKey := object.FlatKey("ClientVpnEndpointId") - if err := awsEc2query_serializeDocumentClientVpnEndpointIdList(v.ClientVpnEndpointIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClientVpnRoutesInput(v *DescribeClientVpnRoutesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeClientVpnTargetNetworksInput(v *DescribeClientVpnTargetNetworksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationIds != nil { - objectKey := object.FlatKey("AssociationIds") - if err := awsEc2query_serializeDocumentValueStringList(v.AssociationIds, objectKey); err != nil { - return err - } - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCoipPoolsInput(v *DescribeCoipPoolsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PoolIds != nil { - objectKey := object.FlatKey("PoolId") - if err := awsEc2query_serializeDocumentCoipPoolIdSet(v.PoolIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeConversionTasksInput(v *DescribeConversionTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConversionTaskIds != nil { - objectKey := object.FlatKey("ConversionTaskId") - if err := awsEc2query_serializeDocumentConversionIdStringList(v.ConversionTaskIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeCustomerGatewaysInput(v *DescribeCustomerGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomerGatewayIds != nil { - objectKey := object.FlatKey("CustomerGatewayId") - if err := awsEc2query_serializeDocumentCustomerGatewayIdStringList(v.CustomerGatewayIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeDeclarativePoliciesReportsInput(v *DescribeDeclarativePoliciesReportsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ReportIds != nil { - objectKey := object.FlatKey("ReportId") - if err := awsEc2query_serializeDocumentValueStringList(v.ReportIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeDhcpOptionsInput(v *DescribeDhcpOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DhcpOptionsIds != nil { - objectKey := object.FlatKey("DhcpOptionsId") - if err := awsEc2query_serializeDocumentDhcpOptionsIdStringList(v.DhcpOptionsIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeEgressOnlyInternetGatewaysInput(v *DescribeEgressOnlyInternetGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EgressOnlyInternetGatewayIds != nil { - objectKey := object.FlatKey("EgressOnlyInternetGatewayId") - if err := awsEc2query_serializeDocumentEgressOnlyInternetGatewayIdList(v.EgressOnlyInternetGatewayIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeElasticGpusInput(v *DescribeElasticGpusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ElasticGpuIds != nil { - objectKey := object.FlatKey("ElasticGpuId") - if err := awsEc2query_serializeDocumentElasticGpuIdSet(v.ElasticGpuIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeExportImageTasksInput(v *DescribeExportImageTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExportImageTaskIds != nil { - objectKey := object.FlatKey("ExportImageTaskId") - if err := awsEc2query_serializeDocumentExportImageTaskIdList(v.ExportImageTaskIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeExportTasksInput(v *DescribeExportTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ExportTaskIds != nil { - objectKey := object.FlatKey("ExportTaskId") - if err := awsEc2query_serializeDocumentExportTaskIdStringList(v.ExportTaskIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFastLaunchImagesInput(v *DescribeFastLaunchImagesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ImageIds != nil { - objectKey := object.FlatKey("ImageId") - if err := awsEc2query_serializeDocumentFastLaunchImageIdList(v.ImageIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFastSnapshotRestoresInput(v *DescribeFastSnapshotRestoresInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFleetHistoryInput(v *DescribeFleetHistoryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.EventType) > 0 { - objectKey := object.Key("EventType") - objectKey.String(string(v.EventType)) - } - - if v.FleetId != nil { - objectKey := object.Key("FleetId") - objectKey.String(*v.FleetId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFleetInstancesInput(v *DescribeFleetInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.FleetId != nil { - objectKey := object.Key("FleetId") - objectKey.String(*v.FleetId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFleetsInput(v *DescribeFleetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.FleetIds != nil { - objectKey := object.FlatKey("FleetId") - if err := awsEc2query_serializeDocumentFleetIdSet(v.FleetIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFlowLogsInput(v *DescribeFlowLogsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filter != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filter, objectKey); err != nil { - return err - } - } - - if v.FlowLogIds != nil { - objectKey := object.FlatKey("FlowLogId") - if err := awsEc2query_serializeDocumentFlowLogIdList(v.FlowLogIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFpgaImageAttributeInput(v *DescribeFpgaImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FpgaImageId != nil { - objectKey := object.Key("FpgaImageId") - objectKey.String(*v.FpgaImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeFpgaImagesInput(v *DescribeFpgaImagesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.FpgaImageIds != nil { - objectKey := object.FlatKey("FpgaImageId") - if err := awsEc2query_serializeDocumentFpgaImageIdList(v.FpgaImageIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.Owners != nil { - objectKey := object.FlatKey("Owner") - if err := awsEc2query_serializeDocumentOwnerStringList(v.Owners, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeHostReservationOfferingsInput(v *DescribeHostReservationOfferingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filter != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filter, objectKey); err != nil { - return err - } - } - - if v.MaxDuration != nil { - objectKey := object.Key("MaxDuration") - objectKey.Integer(*v.MaxDuration) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.MinDuration != nil { - objectKey := object.Key("MinDuration") - objectKey.Integer(*v.MinDuration) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.OfferingId != nil { - objectKey := object.Key("OfferingId") - objectKey.String(*v.OfferingId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeHostReservationsInput(v *DescribeHostReservationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filter != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filter, objectKey); err != nil { - return err - } - } - - if v.HostReservationIdSet != nil { - objectKey := object.FlatKey("HostReservationIdSet") - if err := awsEc2query_serializeDocumentHostReservationIdSet(v.HostReservationIdSet, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeHostsInput(v *DescribeHostsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filter != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filter, objectKey); err != nil { - return err - } - } - - if v.HostIds != nil { - objectKey := object.FlatKey("HostId") - if err := awsEc2query_serializeDocumentRequestHostIdList(v.HostIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIamInstanceProfileAssociationsInput(v *DescribeIamInstanceProfileAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationIds != nil { - objectKey := object.FlatKey("AssociationId") - if err := awsEc2query_serializeDocumentAssociationIdList(v.AssociationIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIdentityIdFormatInput(v *DescribeIdentityIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.PrincipalArn != nil { - objectKey := object.Key("PrincipalArn") - objectKey.String(*v.PrincipalArn) - } - - if v.Resource != nil { - objectKey := object.Key("Resource") - objectKey.String(*v.Resource) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIdFormatInput(v *DescribeIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Resource != nil { - objectKey := object.Key("Resource") - objectKey.String(*v.Resource) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeImageAttributeInput(v *DescribeImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeImagesInput(v *DescribeImagesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExecutableUsers != nil { - objectKey := object.FlatKey("ExecutableBy") - if err := awsEc2query_serializeDocumentExecutableByStringList(v.ExecutableUsers, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ImageIds != nil { - objectKey := object.FlatKey("ImageId") - if err := awsEc2query_serializeDocumentImageIdStringList(v.ImageIds, objectKey); err != nil { - return err - } - } - - if v.IncludeDeprecated != nil { - objectKey := object.Key("IncludeDeprecated") - objectKey.Boolean(*v.IncludeDeprecated) - } - - if v.IncludeDisabled != nil { - objectKey := object.Key("IncludeDisabled") - objectKey.Boolean(*v.IncludeDisabled) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.Owners != nil { - objectKey := object.FlatKey("Owner") - if err := awsEc2query_serializeDocumentOwnerStringList(v.Owners, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeImportImageTasksInput(v *DescribeImportImageTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filters") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ImportTaskIds != nil { - objectKey := object.FlatKey("ImportTaskId") - if err := awsEc2query_serializeDocumentImportTaskIdList(v.ImportTaskIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeImportSnapshotTasksInput(v *DescribeImportSnapshotTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filters") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ImportTaskIds != nil { - objectKey := object.FlatKey("ImportTaskId") - if err := awsEc2query_serializeDocumentImportSnapshotTaskIdList(v.ImportTaskIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceAttributeInput(v *DescribeInstanceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceConnectEndpointsInput(v *DescribeInstanceConnectEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceConnectEndpointIds != nil { - objectKey := object.FlatKey("InstanceConnectEndpointId") - if err := awsEc2query_serializeDocumentValueStringList(v.InstanceConnectEndpointIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceCreditSpecificationsInput(v *DescribeInstanceCreditSpecificationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceEventNotificationAttributesInput(v *DescribeInstanceEventNotificationAttributesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceEventWindowsInput(v *DescribeInstanceEventWindowsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceEventWindowIds != nil { - objectKey := object.FlatKey("InstanceEventWindowId") - if err := awsEc2query_serializeDocumentInstanceEventWindowIdSet(v.InstanceEventWindowIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceImageMetadataInput(v *DescribeInstanceImageMetadataInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstancesInput(v *DescribeInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceStatusInput(v *DescribeInstanceStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IncludeAllInstances != nil { - objectKey := object.Key("IncludeAllInstances") - objectKey.Boolean(*v.IncludeAllInstances) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceTopologyInput(v *DescribeInstanceTopologyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.GroupNames != nil { - objectKey := object.FlatKey("GroupName") - if err := awsEc2query_serializeDocumentDescribeInstanceTopologyGroupNameSet(v.GroupNames, objectKey); err != nil { - return err - } - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentDescribeInstanceTopologyInstanceIdSet(v.InstanceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceTypeOfferingsInput(v *DescribeInstanceTypeOfferingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if len(v.LocationType) > 0 { - objectKey := object.Key("LocationType") - objectKey.String(string(v.LocationType)) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInstanceTypesInput(v *DescribeInstanceTypesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceTypes != nil { - objectKey := object.FlatKey("InstanceType") - if err := awsEc2query_serializeDocumentRequestInstanceTypeList(v.InstanceTypes, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeInternetGatewaysInput(v *DescribeInternetGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InternetGatewayIds != nil { - objectKey := object.FlatKey("InternetGatewayId") - if err := awsEc2query_serializeDocumentInternetGatewayIdList(v.InternetGatewayIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamByoasnInput(v *DescribeIpamByoasnInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamExternalResourceVerificationTokensInput(v *DescribeIpamExternalResourceVerificationTokensInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamExternalResourceVerificationTokenIds != nil { - objectKey := object.FlatKey("IpamExternalResourceVerificationTokenId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamExternalResourceVerificationTokenIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamPoolsInput(v *DescribeIpamPoolsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamPoolIds != nil { - objectKey := object.FlatKey("IpamPoolId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamPoolIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamResourceDiscoveriesInput(v *DescribeIpamResourceDiscoveriesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamResourceDiscoveryIds != nil { - objectKey := object.FlatKey("IpamResourceDiscoveryId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamResourceDiscoveryIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamResourceDiscoveryAssociationsInput(v *DescribeIpamResourceDiscoveryAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamResourceDiscoveryAssociationIds != nil { - objectKey := object.FlatKey("IpamResourceDiscoveryAssociationId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamResourceDiscoveryAssociationIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamScopesInput(v *DescribeIpamScopesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamScopeIds != nil { - objectKey := object.FlatKey("IpamScopeId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamScopeIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpamsInput(v *DescribeIpamsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamIds != nil { - objectKey := object.FlatKey("IpamId") - if err := awsEc2query_serializeDocumentValueStringList(v.IpamIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeIpv6PoolsInput(v *DescribeIpv6PoolsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PoolIds != nil { - objectKey := object.FlatKey("PoolId") - if err := awsEc2query_serializeDocumentIpv6PoolIdList(v.PoolIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeKeyPairsInput(v *DescribeKeyPairsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IncludePublicKey != nil { - objectKey := object.Key("IncludePublicKey") - objectKey.Boolean(*v.IncludePublicKey) - } - - if v.KeyNames != nil { - objectKey := object.FlatKey("KeyName") - if err := awsEc2query_serializeDocumentKeyNameStringList(v.KeyNames, objectKey); err != nil { - return err - } - } - - if v.KeyPairIds != nil { - objectKey := object.FlatKey("KeyPairId") - if err := awsEc2query_serializeDocumentKeyPairIdStringList(v.KeyPairIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLaunchTemplatesInput(v *DescribeLaunchTemplatesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateIds != nil { - objectKey := object.FlatKey("LaunchTemplateId") - if err := awsEc2query_serializeDocumentLaunchTemplateIdStringList(v.LaunchTemplateIds, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateNames != nil { - objectKey := object.FlatKey("LaunchTemplateName") - if err := awsEc2query_serializeDocumentLaunchTemplateNameStringList(v.LaunchTemplateNames, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLaunchTemplateVersionsInput(v *DescribeLaunchTemplateVersionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.MaxVersion != nil { - objectKey := object.Key("MaxVersion") - objectKey.String(*v.MaxVersion) - } - - if v.MinVersion != nil { - objectKey := object.Key("MinVersion") - objectKey.String(*v.MinVersion) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ResolveAlias != nil { - objectKey := object.Key("ResolveAlias") - objectKey.Boolean(*v.ResolveAlias) - } - - if v.Versions != nil { - objectKey := object.FlatKey("LaunchTemplateVersion") - if err := awsEc2query_serializeDocumentVersionStringList(v.Versions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTablesInput(v *DescribeLocalGatewayRouteTablesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayRouteTableIds != nil { - objectKey := object.FlatKey("LocalGatewayRouteTableId") - if err := awsEc2query_serializeDocumentLocalGatewayRouteTableIdSet(v.LocalGatewayRouteTableIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput(v *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds != nil { - objectKey := object.FlatKey("LocalGatewayRouteTableVirtualInterfaceGroupAssociationId") - if err := awsEc2query_serializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationIdSet(v.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsInput(v *DescribeLocalGatewayRouteTableVpcAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayRouteTableVpcAssociationIds != nil { - objectKey := object.FlatKey("LocalGatewayRouteTableVpcAssociationId") - if err := awsEc2query_serializeDocumentLocalGatewayRouteTableVpcAssociationIdSet(v.LocalGatewayRouteTableVpcAssociationIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewaysInput(v *DescribeLocalGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayIds != nil { - objectKey := object.FlatKey("LocalGatewayId") - if err := awsEc2query_serializeDocumentLocalGatewayIdSet(v.LocalGatewayIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsInput(v *DescribeLocalGatewayVirtualInterfaceGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayVirtualInterfaceGroupIds != nil { - objectKey := object.FlatKey("LocalGatewayVirtualInterfaceGroupId") - if err := awsEc2query_serializeDocumentLocalGatewayVirtualInterfaceGroupIdSet(v.LocalGatewayVirtualInterfaceGroupIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLocalGatewayVirtualInterfacesInput(v *DescribeLocalGatewayVirtualInterfacesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayVirtualInterfaceIds != nil { - objectKey := object.FlatKey("LocalGatewayVirtualInterfaceId") - if err := awsEc2query_serializeDocumentLocalGatewayVirtualInterfaceIdSet(v.LocalGatewayVirtualInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeLockedSnapshotsInput(v *DescribeLockedSnapshotsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SnapshotIds != nil { - objectKey := object.FlatKey("SnapshotId") - if err := awsEc2query_serializeDocumentSnapshotIdStringList(v.SnapshotIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeMacHostsInput(v *DescribeMacHostsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.HostIds != nil { - objectKey := object.FlatKey("HostId") - if err := awsEc2query_serializeDocumentRequestHostIdList(v.HostIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeMacModificationTasksInput(v *DescribeMacModificationTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MacModificationTaskIds != nil { - objectKey := object.FlatKey("MacModificationTaskId") - if err := awsEc2query_serializeDocumentMacModificationTaskIdList(v.MacModificationTaskIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeManagedPrefixListsInput(v *DescribeManagedPrefixListsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PrefixListIds != nil { - objectKey := object.FlatKey("PrefixListId") - if err := awsEc2query_serializeDocumentValueStringList(v.PrefixListIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeMovingAddressesInput(v *DescribeMovingAddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PublicIps != nil { - objectKey := object.FlatKey("PublicIp") - if err := awsEc2query_serializeDocumentValueStringList(v.PublicIps, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNatGatewaysInput(v *DescribeNatGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filter != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filter, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NatGatewayIds != nil { - objectKey := object.FlatKey("NatGatewayId") - if err := awsEc2query_serializeDocumentNatGatewayIdStringList(v.NatGatewayIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkAclsInput(v *DescribeNetworkAclsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkAclIds != nil { - objectKey := object.FlatKey("NetworkAclId") - if err := awsEc2query_serializeDocumentNetworkAclIdStringList(v.NetworkAclIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesInput(v *DescribeNetworkInsightsAccessScopeAnalysesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AnalysisStartTimeBegin != nil { - objectKey := object.Key("AnalysisStartTimeBegin") - objectKey.String(smithytime.FormatDateTime(*v.AnalysisStartTimeBegin)) - } - - if v.AnalysisStartTimeEnd != nil { - objectKey := object.Key("AnalysisStartTimeEnd") - objectKey.String(smithytime.FormatDateTime(*v.AnalysisStartTimeEnd)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInsightsAccessScopeAnalysisIds != nil { - objectKey := object.FlatKey("NetworkInsightsAccessScopeAnalysisId") - if err := awsEc2query_serializeDocumentNetworkInsightsAccessScopeAnalysisIdList(v.NetworkInsightsAccessScopeAnalysisIds, objectKey); err != nil { - return err - } - } - - if v.NetworkInsightsAccessScopeId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeId") - objectKey.String(*v.NetworkInsightsAccessScopeId) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInsightsAccessScopesInput(v *DescribeNetworkInsightsAccessScopesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInsightsAccessScopeIds != nil { - objectKey := object.FlatKey("NetworkInsightsAccessScopeId") - if err := awsEc2query_serializeDocumentNetworkInsightsAccessScopeIdList(v.NetworkInsightsAccessScopeIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInsightsAnalysesInput(v *DescribeNetworkInsightsAnalysesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AnalysisEndTime != nil { - objectKey := object.Key("AnalysisEndTime") - objectKey.String(smithytime.FormatDateTime(*v.AnalysisEndTime)) - } - - if v.AnalysisStartTime != nil { - objectKey := object.Key("AnalysisStartTime") - objectKey.String(smithytime.FormatDateTime(*v.AnalysisStartTime)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInsightsAnalysisIds != nil { - objectKey := object.FlatKey("NetworkInsightsAnalysisId") - if err := awsEc2query_serializeDocumentNetworkInsightsAnalysisIdList(v.NetworkInsightsAnalysisIds, objectKey); err != nil { - return err - } - } - - if v.NetworkInsightsPathId != nil { - objectKey := object.Key("NetworkInsightsPathId") - objectKey.String(*v.NetworkInsightsPathId) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInsightsPathsInput(v *DescribeNetworkInsightsPathsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInsightsPathIds != nil { - objectKey := object.FlatKey("NetworkInsightsPathId") - if err := awsEc2query_serializeDocumentNetworkInsightsPathIdList(v.NetworkInsightsPathIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInterfaceAttributeInput(v *DescribeNetworkInterfaceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInterfacePermissionsInput(v *DescribeNetworkInterfacePermissionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInterfacePermissionIds != nil { - objectKey := object.FlatKey("NetworkInterfacePermissionId") - if err := awsEc2query_serializeDocumentNetworkInterfacePermissionIdList(v.NetworkInterfacePermissionIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeNetworkInterfacesInput(v *DescribeNetworkInterfacesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInterfaceIds != nil { - objectKey := object.FlatKey("NetworkInterfaceId") - if err := awsEc2query_serializeDocumentNetworkInterfaceIdList(v.NetworkInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeOutpostLagsInput(v *DescribeOutpostLagsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.OutpostLagIds != nil { - objectKey := object.FlatKey("OutpostLagId") - if err := awsEc2query_serializeDocumentOutpostLagIdSet(v.OutpostLagIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribePlacementGroupsInput(v *DescribePlacementGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.GroupIds != nil { - objectKey := object.FlatKey("GroupId") - if err := awsEc2query_serializeDocumentPlacementGroupIdStringList(v.GroupIds, objectKey); err != nil { - return err - } - } - - if v.GroupNames != nil { - objectKey := object.FlatKey("GroupName") - if err := awsEc2query_serializeDocumentPlacementGroupStringList(v.GroupNames, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribePrefixListsInput(v *DescribePrefixListsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PrefixListIds != nil { - objectKey := object.FlatKey("PrefixListId") - if err := awsEc2query_serializeDocumentPrefixListResourceIdStringList(v.PrefixListIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribePrincipalIdFormatInput(v *DescribePrincipalIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.Resources != nil { - objectKey := object.FlatKey("Resource") - if err := awsEc2query_serializeDocumentResourceList(v.Resources, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribePublicIpv4PoolsInput(v *DescribePublicIpv4PoolsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PoolIds != nil { - objectKey := object.FlatKey("PoolId") - if err := awsEc2query_serializeDocumentPublicIpv4PoolIdStringList(v.PoolIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeRegionsInput(v *DescribeRegionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllRegions != nil { - objectKey := object.Key("AllRegions") - objectKey.Boolean(*v.AllRegions) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.RegionNames != nil { - objectKey := object.FlatKey("RegionName") - if err := awsEc2query_serializeDocumentRegionNameStringList(v.RegionNames, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeReplaceRootVolumeTasksInput(v *DescribeReplaceRootVolumeTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ReplaceRootVolumeTaskIds != nil { - objectKey := object.FlatKey("ReplaceRootVolumeTaskId") - if err := awsEc2query_serializeDocumentReplaceRootVolumeTaskIds(v.ReplaceRootVolumeTaskIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeReservedInstancesInput(v *DescribeReservedInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if len(v.OfferingClass) > 0 { - objectKey := object.Key("OfferingClass") - objectKey.String(string(v.OfferingClass)) - } - - if len(v.OfferingType) > 0 { - objectKey := object.Key("OfferingType") - objectKey.String(string(v.OfferingType)) - } - - if v.ReservedInstancesIds != nil { - objectKey := object.FlatKey("ReservedInstancesId") - if err := awsEc2query_serializeDocumentReservedInstancesIdStringList(v.ReservedInstancesIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeReservedInstancesListingsInput(v *DescribeReservedInstancesListingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ReservedInstancesId != nil { - objectKey := object.Key("ReservedInstancesId") - objectKey.String(*v.ReservedInstancesId) - } - - if v.ReservedInstancesListingId != nil { - objectKey := object.Key("ReservedInstancesListingId") - objectKey.String(*v.ReservedInstancesListingId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeReservedInstancesModificationsInput(v *DescribeReservedInstancesModificationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ReservedInstancesModificationIds != nil { - objectKey := object.FlatKey("ReservedInstancesModificationId") - if err := awsEc2query_serializeDocumentReservedInstancesModificationIdStringList(v.ReservedInstancesModificationIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeReservedInstancesOfferingsInput(v *DescribeReservedInstancesOfferingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.AvailabilityZoneId != nil { - objectKey := object.Key("AvailabilityZoneId") - objectKey.String(*v.AvailabilityZoneId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IncludeMarketplace != nil { - objectKey := object.Key("IncludeMarketplace") - objectKey.Boolean(*v.IncludeMarketplace) - } - - if len(v.InstanceTenancy) > 0 { - objectKey := object.Key("InstanceTenancy") - objectKey.String(string(v.InstanceTenancy)) - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.MaxDuration != nil { - objectKey := object.Key("MaxDuration") - objectKey.Long(*v.MaxDuration) - } - - if v.MaxInstanceCount != nil { - objectKey := object.Key("MaxInstanceCount") - objectKey.Integer(*v.MaxInstanceCount) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.MinDuration != nil { - objectKey := object.Key("MinDuration") - objectKey.Long(*v.MinDuration) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if len(v.OfferingClass) > 0 { - objectKey := object.Key("OfferingClass") - objectKey.String(string(v.OfferingClass)) - } - - if len(v.OfferingType) > 0 { - objectKey := object.Key("OfferingType") - objectKey.String(string(v.OfferingType)) - } - - if len(v.ProductDescription) > 0 { - objectKey := object.Key("ProductDescription") - objectKey.String(string(v.ProductDescription)) - } - - if v.ReservedInstancesOfferingIds != nil { - objectKey := object.FlatKey("ReservedInstancesOfferingId") - if err := awsEc2query_serializeDocumentReservedInstancesOfferingIdStringList(v.ReservedInstancesOfferingIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeRouteServerEndpointsInput(v *DescribeRouteServerEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RouteServerEndpointIds != nil { - objectKey := object.FlatKey("RouteServerEndpointId") - if err := awsEc2query_serializeDocumentRouteServerEndpointIdsList(v.RouteServerEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeRouteServerPeersInput(v *DescribeRouteServerPeersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RouteServerPeerIds != nil { - objectKey := object.FlatKey("RouteServerPeerId") - if err := awsEc2query_serializeDocumentRouteServerPeerIdsList(v.RouteServerPeerIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeRouteServersInput(v *DescribeRouteServersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RouteServerIds != nil { - objectKey := object.FlatKey("RouteServerId") - if err := awsEc2query_serializeDocumentRouteServerIdsList(v.RouteServerIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeRouteTablesInput(v *DescribeRouteTablesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RouteTableIds != nil { - objectKey := object.FlatKey("RouteTableId") - if err := awsEc2query_serializeDocumentRouteTableIdStringList(v.RouteTableIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeScheduledInstanceAvailabilityInput(v *DescribeScheduledInstanceAvailabilityInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.FirstSlotStartTimeRange != nil { - objectKey := object.Key("FirstSlotStartTimeRange") - if err := awsEc2query_serializeDocumentSlotDateTimeRangeRequest(v.FirstSlotStartTimeRange, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.MaxSlotDurationInHours != nil { - objectKey := object.Key("MaxSlotDurationInHours") - objectKey.Integer(*v.MaxSlotDurationInHours) - } - - if v.MinSlotDurationInHours != nil { - objectKey := object.Key("MinSlotDurationInHours") - objectKey.Integer(*v.MinSlotDurationInHours) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.Recurrence != nil { - objectKey := object.Key("Recurrence") - if err := awsEc2query_serializeDocumentScheduledInstanceRecurrenceRequest(v.Recurrence, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeScheduledInstancesInput(v *DescribeScheduledInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ScheduledInstanceIds != nil { - objectKey := object.FlatKey("ScheduledInstanceId") - if err := awsEc2query_serializeDocumentScheduledInstanceIdRequestSet(v.ScheduledInstanceIds, objectKey); err != nil { - return err - } - } - - if v.SlotStartTimeRange != nil { - objectKey := object.Key("SlotStartTimeRange") - if err := awsEc2query_serializeDocumentSlotStartTimeRangeRequest(v.SlotStartTimeRange, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSecurityGroupReferencesInput(v *DescribeSecurityGroupReferencesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.FlatKey("GroupId") - if err := awsEc2query_serializeDocumentGroupIds(v.GroupId, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSecurityGroupRulesInput(v *DescribeSecurityGroupRulesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SecurityGroupRuleIds != nil { - objectKey := object.FlatKey("SecurityGroupRuleId") - if err := awsEc2query_serializeDocumentSecurityGroupRuleIdList(v.SecurityGroupRuleIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSecurityGroupsInput(v *DescribeSecurityGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.GroupIds != nil { - objectKey := object.FlatKey("GroupId") - if err := awsEc2query_serializeDocumentGroupIdStringList(v.GroupIds, objectKey); err != nil { - return err - } - } - - if v.GroupNames != nil { - objectKey := object.FlatKey("GroupName") - if err := awsEc2query_serializeDocumentGroupNameStringList(v.GroupNames, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSecurityGroupVpcAssociationsInput(v *DescribeSecurityGroupVpcAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeServiceLinkVirtualInterfacesInput(v *DescribeServiceLinkVirtualInterfacesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ServiceLinkVirtualInterfaceIds != nil { - objectKey := object.FlatKey("ServiceLinkVirtualInterfaceId") - if err := awsEc2query_serializeDocumentServiceLinkVirtualInterfaceIdSet(v.ServiceLinkVirtualInterfaceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSnapshotAttributeInput(v *DescribeSnapshotAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSnapshotsInput(v *DescribeSnapshotsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.OwnerIds != nil { - objectKey := object.FlatKey("Owner") - if err := awsEc2query_serializeDocumentOwnerStringList(v.OwnerIds, objectKey); err != nil { - return err - } - } - - if v.RestorableByUserIds != nil { - objectKey := object.FlatKey("RestorableBy") - if err := awsEc2query_serializeDocumentRestorableByStringList(v.RestorableByUserIds, objectKey); err != nil { - return err - } - } - - if v.SnapshotIds != nil { - objectKey := object.FlatKey("SnapshotId") - if err := awsEc2query_serializeDocumentSnapshotIdStringList(v.SnapshotIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSnapshotTierStatusInput(v *DescribeSnapshotTierStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotDatafeedSubscriptionInput(v *DescribeSpotDatafeedSubscriptionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotFleetInstancesInput(v *DescribeSpotFleetInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SpotFleetRequestId != nil { - objectKey := object.Key("SpotFleetRequestId") - objectKey.String(*v.SpotFleetRequestId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotFleetRequestHistoryInput(v *DescribeSpotFleetRequestHistoryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.EventType) > 0 { - objectKey := object.Key("EventType") - objectKey.String(string(v.EventType)) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SpotFleetRequestId != nil { - objectKey := object.Key("SpotFleetRequestId") - objectKey.String(*v.SpotFleetRequestId) - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotFleetRequestsInput(v *DescribeSpotFleetRequestsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SpotFleetRequestIds != nil { - objectKey := object.FlatKey("SpotFleetRequestId") - if err := awsEc2query_serializeDocumentSpotFleetRequestIdList(v.SpotFleetRequestIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotInstanceRequestsInput(v *DescribeSpotInstanceRequestsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SpotInstanceRequestIds != nil { - objectKey := object.FlatKey("SpotInstanceRequestId") - if err := awsEc2query_serializeDocumentSpotInstanceRequestIdList(v.SpotInstanceRequestIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSpotPriceHistoryInput(v *DescribeSpotPriceHistoryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndTime != nil { - objectKey := object.Key("EndTime") - objectKey.String(smithytime.FormatDateTime(*v.EndTime)) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.InstanceTypes != nil { - objectKey := object.FlatKey("InstanceType") - if err := awsEc2query_serializeDocumentInstanceTypeList(v.InstanceTypes, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ProductDescriptions != nil { - objectKey := object.FlatKey("ProductDescription") - if err := awsEc2query_serializeDocumentProductDescriptionList(v.ProductDescriptions, objectKey); err != nil { - return err - } - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeStaleSecurityGroupsInput(v *DescribeStaleSecurityGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeStoreImageTasksInput(v *DescribeStoreImageTasksInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.ImageIds != nil { - objectKey := object.FlatKey("ImageId") - if err := awsEc2query_serializeDocumentImageIdList(v.ImageIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeSubnetsInput(v *DescribeSubnetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetId") - if err := awsEc2query_serializeDocumentSubnetIdStringList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTagsInput(v *DescribeTagsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTrafficMirrorFilterRulesInput(v *DescribeTrafficMirrorFilterRulesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - if v.TrafficMirrorFilterRuleIds != nil { - objectKey := object.FlatKey("TrafficMirrorFilterRuleId") - if err := awsEc2query_serializeDocumentTrafficMirrorFilterRuleIdList(v.TrafficMirrorFilterRuleIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTrafficMirrorFiltersInput(v *DescribeTrafficMirrorFiltersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TrafficMirrorFilterIds != nil { - objectKey := object.FlatKey("TrafficMirrorFilterId") - if err := awsEc2query_serializeDocumentTrafficMirrorFilterIdList(v.TrafficMirrorFilterIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTrafficMirrorSessionsInput(v *DescribeTrafficMirrorSessionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TrafficMirrorSessionIds != nil { - objectKey := object.FlatKey("TrafficMirrorSessionId") - if err := awsEc2query_serializeDocumentTrafficMirrorSessionIdList(v.TrafficMirrorSessionIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTrafficMirrorTargetsInput(v *DescribeTrafficMirrorTargetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TrafficMirrorTargetIds != nil { - objectKey := object.FlatKey("TrafficMirrorTargetId") - if err := awsEc2query_serializeDocumentTrafficMirrorTargetIdList(v.TrafficMirrorTargetIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayAttachmentsInput(v *DescribeTransitGatewayAttachmentsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayAttachmentIds != nil { - objectKey := object.FlatKey("TransitGatewayAttachmentIds") - if err := awsEc2query_serializeDocumentTransitGatewayAttachmentIdStringList(v.TransitGatewayAttachmentIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayConnectPeersInput(v *DescribeTransitGatewayConnectPeersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayConnectPeerIds != nil { - objectKey := object.FlatKey("TransitGatewayConnectPeerIds") - if err := awsEc2query_serializeDocumentTransitGatewayConnectPeerIdStringList(v.TransitGatewayConnectPeerIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayConnectsInput(v *DescribeTransitGatewayConnectsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayAttachmentIds != nil { - objectKey := object.FlatKey("TransitGatewayAttachmentIds") - if err := awsEc2query_serializeDocumentTransitGatewayAttachmentIdStringList(v.TransitGatewayAttachmentIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayMulticastDomainsInput(v *DescribeTransitGatewayMulticastDomainsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayMulticastDomainIds != nil { - objectKey := object.FlatKey("TransitGatewayMulticastDomainIds") - if err := awsEc2query_serializeDocumentTransitGatewayMulticastDomainIdStringList(v.TransitGatewayMulticastDomainIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayPeeringAttachmentsInput(v *DescribeTransitGatewayPeeringAttachmentsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayAttachmentIds != nil { - objectKey := object.FlatKey("TransitGatewayAttachmentIds") - if err := awsEc2query_serializeDocumentTransitGatewayAttachmentIdStringList(v.TransitGatewayAttachmentIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayPolicyTablesInput(v *DescribeTransitGatewayPolicyTablesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayPolicyTableIds != nil { - objectKey := object.FlatKey("TransitGatewayPolicyTableIds") - if err := awsEc2query_serializeDocumentTransitGatewayPolicyTableIdStringList(v.TransitGatewayPolicyTableIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayRouteTableAnnouncementsInput(v *DescribeTransitGatewayRouteTableAnnouncementsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayRouteTableAnnouncementIds != nil { - objectKey := object.FlatKey("TransitGatewayRouteTableAnnouncementIds") - if err := awsEc2query_serializeDocumentTransitGatewayRouteTableAnnouncementIdStringList(v.TransitGatewayRouteTableAnnouncementIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayRouteTablesInput(v *DescribeTransitGatewayRouteTablesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayRouteTableIds != nil { - objectKey := object.FlatKey("TransitGatewayRouteTableIds") - if err := awsEc2query_serializeDocumentTransitGatewayRouteTableIdStringList(v.TransitGatewayRouteTableIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewaysInput(v *DescribeTransitGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayIds != nil { - objectKey := object.FlatKey("TransitGatewayIds") - if err := awsEc2query_serializeDocumentTransitGatewayIdStringList(v.TransitGatewayIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTransitGatewayVpcAttachmentsInput(v *DescribeTransitGatewayVpcAttachmentsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayAttachmentIds != nil { - objectKey := object.FlatKey("TransitGatewayAttachmentIds") - if err := awsEc2query_serializeDocumentTransitGatewayAttachmentIdStringList(v.TransitGatewayAttachmentIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeTrunkInterfaceAssociationsInput(v *DescribeTrunkInterfaceAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationIds != nil { - objectKey := object.FlatKey("AssociationId") - if err := awsEc2query_serializeDocumentTrunkInterfaceAssociationIdList(v.AssociationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVerifiedAccessEndpointsInput(v *DescribeVerifiedAccessEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessEndpointIds != nil { - objectKey := object.FlatKey("VerifiedAccessEndpointId") - if err := awsEc2query_serializeDocumentVerifiedAccessEndpointIdList(v.VerifiedAccessEndpointIds, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVerifiedAccessGroupsInput(v *DescribeVerifiedAccessGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessGroupIds != nil { - objectKey := object.FlatKey("VerifiedAccessGroupId") - if err := awsEc2query_serializeDocumentVerifiedAccessGroupIdList(v.VerifiedAccessGroupIds, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVerifiedAccessInstanceLoggingConfigurationsInput(v *DescribeVerifiedAccessInstanceLoggingConfigurationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessInstanceIds != nil { - objectKey := object.FlatKey("VerifiedAccessInstanceId") - if err := awsEc2query_serializeDocumentVerifiedAccessInstanceIdList(v.VerifiedAccessInstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVerifiedAccessInstancesInput(v *DescribeVerifiedAccessInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessInstanceIds != nil { - objectKey := object.FlatKey("VerifiedAccessInstanceId") - if err := awsEc2query_serializeDocumentVerifiedAccessInstanceIdList(v.VerifiedAccessInstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVerifiedAccessTrustProvidersInput(v *DescribeVerifiedAccessTrustProvidersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessTrustProviderIds != nil { - objectKey := object.FlatKey("VerifiedAccessTrustProviderId") - if err := awsEc2query_serializeDocumentVerifiedAccessTrustProviderIdList(v.VerifiedAccessTrustProviderIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVolumeAttributeInput(v *DescribeVolumeAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVolumesInput(v *DescribeVolumesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VolumeIds != nil { - objectKey := object.FlatKey("VolumeId") - if err := awsEc2query_serializeDocumentVolumeIdStringList(v.VolumeIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVolumesModificationsInput(v *DescribeVolumesModificationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VolumeIds != nil { - objectKey := object.FlatKey("VolumeId") - if err := awsEc2query_serializeDocumentVolumeIdStringList(v.VolumeIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVolumeStatusInput(v *DescribeVolumeStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VolumeIds != nil { - objectKey := object.FlatKey("VolumeId") - if err := awsEc2query_serializeDocumentVolumeIdStringList(v.VolumeIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcAttributeInput(v *DescribeVpcAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcBlockPublicAccessExclusionsInput(v *DescribeVpcBlockPublicAccessExclusionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExclusionIds != nil { - objectKey := object.FlatKey("ExclusionId") - if err := awsEc2query_serializeDocumentVpcBlockPublicAccessExclusionIdList(v.ExclusionIds, objectKey); err != nil { - return err - } - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcBlockPublicAccessOptionsInput(v *DescribeVpcBlockPublicAccessOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcClassicLinkDnsSupportInput(v *DescribeVpcClassicLinkDnsSupportInput, value query.Value) error { - object := value.Object() - _ = object - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcIds != nil { - objectKey := object.FlatKey("VpcIds") - if err := awsEc2query_serializeDocumentVpcClassicLinkIdList(v.VpcIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcClassicLinkInput(v *DescribeVpcClassicLinkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.VpcIds != nil { - objectKey := object.FlatKey("VpcId") - if err := awsEc2query_serializeDocumentVpcClassicLinkIdList(v.VpcIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointAssociationsInput(v *DescribeVpcEndpointAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcEndpointIds != nil { - objectKey := object.FlatKey("VpcEndpointId") - if err := awsEc2query_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointConnectionNotificationsInput(v *DescribeVpcEndpointConnectionNotificationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConnectionNotificationId != nil { - objectKey := object.Key("ConnectionNotificationId") - objectKey.String(*v.ConnectionNotificationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointConnectionsInput(v *DescribeVpcEndpointConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointServiceConfigurationsInput(v *DescribeVpcEndpointServiceConfigurationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ServiceIds != nil { - objectKey := object.FlatKey("ServiceId") - if err := awsEc2query_serializeDocumentVpcEndpointServiceIdList(v.ServiceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointServicePermissionsInput(v *DescribeVpcEndpointServicePermissionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointServicesInput(v *DescribeVpcEndpointServicesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ServiceNames != nil { - objectKey := object.FlatKey("ServiceName") - if err := awsEc2query_serializeDocumentValueStringList(v.ServiceNames, objectKey); err != nil { - return err - } - } - - if v.ServiceRegions != nil { - objectKey := object.FlatKey("ServiceRegion") - if err := awsEc2query_serializeDocumentValueStringList(v.ServiceRegions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcEndpointIds != nil { - objectKey := object.FlatKey("VpcEndpointId") - if err := awsEc2query_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcPeeringConnectionsInput(v *DescribeVpcPeeringConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcPeeringConnectionIds != nil { - objectKey := object.FlatKey("VpcPeeringConnectionId") - if err := awsEc2query_serializeDocumentVpcPeeringConnectionIdList(v.VpcPeeringConnectionIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpcsInput(v *DescribeVpcsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcIds != nil { - objectKey := object.FlatKey("VpcId") - if err := awsEc2query_serializeDocumentVpcIdStringList(v.VpcIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpnConnectionsInput(v *DescribeVpnConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.VpnConnectionIds != nil { - objectKey := object.FlatKey("VpnConnectionId") - if err := awsEc2query_serializeDocumentVpnConnectionIdStringList(v.VpnConnectionIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDescribeVpnGatewaysInput(v *DescribeVpnGatewaysInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.VpnGatewayIds != nil { - objectKey := object.FlatKey("VpnGatewayId") - if err := awsEc2query_serializeDocumentVpnGatewayIdStringList(v.VpnGatewayIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachClassicLinkVpcInput(v *DetachClassicLinkVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachInternetGatewayInput(v *DetachInternetGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InternetGatewayId != nil { - objectKey := object.Key("InternetGatewayId") - objectKey.String(*v.InternetGatewayId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachNetworkInterfaceInput(v *DetachNetworkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AttachmentId != nil { - objectKey := object.Key("AttachmentId") - objectKey.String(*v.AttachmentId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Force != nil { - objectKey := object.Key("Force") - objectKey.Boolean(*v.Force) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachVerifiedAccessTrustProviderInput(v *DetachVerifiedAccessTrustProviderInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - if v.VerifiedAccessTrustProviderId != nil { - objectKey := object.Key("VerifiedAccessTrustProviderId") - objectKey.String(*v.VerifiedAccessTrustProviderId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachVolumeInput(v *DetachVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Device != nil { - objectKey := object.Key("Device") - objectKey.String(*v.Device) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Force != nil { - objectKey := object.Key("Force") - objectKey.Boolean(*v.Force) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDetachVpnGatewayInput(v *DetachVpnGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - if v.VpnGatewayId != nil { - objectKey := object.Key("VpnGatewayId") - objectKey.String(*v.VpnGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableAddressTransferInput(v *DisableAddressTransferInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableAllowedImagesSettingsInput(v *DisableAllowedImagesSettingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableAwsNetworkPerformanceMetricSubscriptionInput(v *DisableAwsNetworkPerformanceMetricSubscriptionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Destination != nil { - objectKey := object.Key("Destination") - objectKey.String(*v.Destination) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.Metric) > 0 { - objectKey := object.Key("Metric") - objectKey.String(string(v.Metric)) - } - - if v.Source != nil { - objectKey := object.Key("Source") - objectKey.String(*v.Source) - } - - if len(v.Statistic) > 0 { - objectKey := object.Key("Statistic") - objectKey.String(string(v.Statistic)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableEbsEncryptionByDefaultInput(v *DisableEbsEncryptionByDefaultInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableFastLaunchInput(v *DisableFastLaunchInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Force != nil { - objectKey := object.Key("Force") - objectKey.Boolean(*v.Force) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableFastSnapshotRestoresInput(v *DisableFastSnapshotRestoresInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZones != nil { - objectKey := object.FlatKey("AvailabilityZone") - if err := awsEc2query_serializeDocumentAvailabilityZoneStringList(v.AvailabilityZones, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SourceSnapshotIds != nil { - objectKey := object.FlatKey("SourceSnapshotId") - if err := awsEc2query_serializeDocumentSnapshotIdStringList(v.SourceSnapshotIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableImageBlockPublicAccessInput(v *DisableImageBlockPublicAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableImageDeprecationInput(v *DisableImageDeprecationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableImageDeregistrationProtectionInput(v *DisableImageDeregistrationProtectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableImageInput(v *DisableImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableIpamOrganizationAdminAccountInput(v *DisableIpamOrganizationAdminAccountInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DelegatedAdminAccountId != nil { - objectKey := object.Key("DelegatedAdminAccountId") - objectKey.String(*v.DelegatedAdminAccountId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableRouteServerPropagationInput(v *DisableRouteServerPropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableSerialConsoleAccessInput(v *DisableSerialConsoleAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableSnapshotBlockPublicAccessInput(v *DisableSnapshotBlockPublicAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableTransitGatewayRouteTablePropagationInput(v *DisableTransitGatewayRouteTablePropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableAnnouncementId != nil { - objectKey := object.Key("TransitGatewayRouteTableAnnouncementId") - objectKey.String(*v.TransitGatewayRouteTableAnnouncementId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableVgwRoutePropagationInput(v *DisableVgwRoutePropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GatewayId != nil { - objectKey := object.Key("GatewayId") - objectKey.String(*v.GatewayId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableVpcClassicLinkDnsSupportInput(v *DisableVpcClassicLinkDnsSupportInput, value query.Value) error { - object := value.Object() - _ = object - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisableVpcClassicLinkInput(v *DisableVpcClassicLinkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateAddressInput(v *DisassociateAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateCapacityReservationBillingOwnerInput(v *DisassociateCapacityReservationBillingOwnerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.UnusedReservationBillingOwnerId != nil { - objectKey := object.Key("UnusedReservationBillingOwnerId") - objectKey.String(*v.UnusedReservationBillingOwnerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateClientVpnTargetNetworkInput(v *DisassociateClientVpnTargetNetworkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateEnclaveCertificateIamRoleInput(v *DisassociateEnclaveCertificateIamRoleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CertificateArn != nil { - objectKey := object.Key("CertificateArn") - objectKey.String(*v.CertificateArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RoleArn != nil { - objectKey := object.Key("RoleArn") - objectKey.String(*v.RoleArn) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateIamInstanceProfileInput(v *DisassociateIamInstanceProfileInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateInstanceEventWindowInput(v *DisassociateInstanceEventWindowInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationTarget != nil { - objectKey := object.Key("AssociationTarget") - if err := awsEc2query_serializeDocumentInstanceEventWindowDisassociationRequest(v.AssociationTarget, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceEventWindowId != nil { - objectKey := object.Key("InstanceEventWindowId") - objectKey.String(*v.InstanceEventWindowId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateIpamByoasnInput(v *DisassociateIpamByoasnInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Asn != nil { - objectKey := object.Key("Asn") - objectKey.String(*v.Asn) - } - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateIpamResourceDiscoveryInput(v *DisassociateIpamResourceDiscoveryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamResourceDiscoveryAssociationId != nil { - objectKey := object.Key("IpamResourceDiscoveryAssociationId") - objectKey.String(*v.IpamResourceDiscoveryAssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateNatGatewayAddressInput(v *DisassociateNatGatewayAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationIds != nil { - objectKey := object.FlatKey("AssociationId") - if err := awsEc2query_serializeDocumentEipAssociationIdList(v.AssociationIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxDrainDurationSeconds != nil { - objectKey := object.Key("MaxDrainDurationSeconds") - objectKey.Integer(*v.MaxDrainDurationSeconds) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateRouteServerInput(v *DisassociateRouteServerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateRouteTableInput(v *DisassociateRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateSecurityGroupVpcInput(v *DisassociateSecurityGroupVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateSubnetCidrBlockInput(v *DisassociateSubnetCidrBlockInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateTransitGatewayMulticastDomainInput(v *DisassociateTransitGatewayMulticastDomainInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetIds") - if err := awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateTransitGatewayPolicyTableInput(v *DisassociateTransitGatewayPolicyTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayPolicyTableId != nil { - objectKey := object.Key("TransitGatewayPolicyTableId") - objectKey.String(*v.TransitGatewayPolicyTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateTransitGatewayRouteTableInput(v *DisassociateTransitGatewayRouteTableInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateTrunkInterfaceInput(v *DisassociateTrunkInterfaceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentDisassociateVpcCidrBlockInput(v *DisassociateVpcCidrBlockInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableAddressTransferInput(v *EnableAddressTransferInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransferAccountId != nil { - objectKey := object.Key("TransferAccountId") - objectKey.String(*v.TransferAccountId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableAllowedImagesSettingsInput(v *EnableAllowedImagesSettingsInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AllowedImagesSettingsState) > 0 { - objectKey := object.Key("AllowedImagesSettingsState") - objectKey.String(string(v.AllowedImagesSettingsState)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionInput(v *EnableAwsNetworkPerformanceMetricSubscriptionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Destination != nil { - objectKey := object.Key("Destination") - objectKey.String(*v.Destination) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.Metric) > 0 { - objectKey := object.Key("Metric") - objectKey.String(string(v.Metric)) - } - - if v.Source != nil { - objectKey := object.Key("Source") - objectKey.String(*v.Source) - } - - if len(v.Statistic) > 0 { - objectKey := object.Key("Statistic") - objectKey.String(string(v.Statistic)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableEbsEncryptionByDefaultInput(v *EnableEbsEncryptionByDefaultInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableFastLaunchInput(v *EnableFastLaunchInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.LaunchTemplate != nil { - objectKey := object.Key("LaunchTemplate") - if err := awsEc2query_serializeDocumentFastLaunchLaunchTemplateSpecificationRequest(v.LaunchTemplate, objectKey); err != nil { - return err - } - } - - if v.MaxParallelLaunches != nil { - objectKey := object.Key("MaxParallelLaunches") - objectKey.Integer(*v.MaxParallelLaunches) - } - - if v.ResourceType != nil { - objectKey := object.Key("ResourceType") - objectKey.String(*v.ResourceType) - } - - if v.SnapshotConfiguration != nil { - objectKey := object.Key("SnapshotConfiguration") - if err := awsEc2query_serializeDocumentFastLaunchSnapshotConfigurationRequest(v.SnapshotConfiguration, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableFastSnapshotRestoresInput(v *EnableFastSnapshotRestoresInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZones != nil { - objectKey := object.FlatKey("AvailabilityZone") - if err := awsEc2query_serializeDocumentAvailabilityZoneStringList(v.AvailabilityZones, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SourceSnapshotIds != nil { - objectKey := object.FlatKey("SourceSnapshotId") - if err := awsEc2query_serializeDocumentSnapshotIdStringList(v.SourceSnapshotIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableImageBlockPublicAccessInput(v *EnableImageBlockPublicAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.ImageBlockPublicAccessState) > 0 { - objectKey := object.Key("ImageBlockPublicAccessState") - objectKey.String(string(v.ImageBlockPublicAccessState)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableImageDeprecationInput(v *EnableImageDeprecationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DeprecateAt != nil { - objectKey := object.Key("DeprecateAt") - objectKey.String(smithytime.FormatDateTime(*v.DeprecateAt)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableImageDeregistrationProtectionInput(v *EnableImageDeregistrationProtectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.WithCooldown != nil { - objectKey := object.Key("WithCooldown") - objectKey.Boolean(*v.WithCooldown) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableImageInput(v *EnableImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableIpamOrganizationAdminAccountInput(v *EnableIpamOrganizationAdminAccountInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DelegatedAdminAccountId != nil { - objectKey := object.Key("DelegatedAdminAccountId") - objectKey.String(*v.DelegatedAdminAccountId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingInput(v *EnableReachabilityAnalyzerOrganizationSharingInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableRouteServerPropagationInput(v *EnableRouteServerPropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableSerialConsoleAccessInput(v *EnableSerialConsoleAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableSnapshotBlockPublicAccessInput(v *EnableSnapshotBlockPublicAccessInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.State) > 0 { - objectKey := object.Key("State") - objectKey.String(string(v.State)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableTransitGatewayRouteTablePropagationInput(v *EnableTransitGatewayRouteTablePropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableAnnouncementId != nil { - objectKey := object.Key("TransitGatewayRouteTableAnnouncementId") - objectKey.String(*v.TransitGatewayRouteTableAnnouncementId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableVgwRoutePropagationInput(v *EnableVgwRoutePropagationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GatewayId != nil { - objectKey := object.Key("GatewayId") - objectKey.String(*v.GatewayId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableVolumeIOInput(v *EnableVolumeIOInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableVpcClassicLinkDnsSupportInput(v *EnableVpcClassicLinkDnsSupportInput, value query.Value) error { - object := value.Object() - _ = object - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentEnableVpcClassicLinkInput(v *EnableVpcClassicLinkInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentExportClientVpnClientCertificateRevocationListInput(v *ExportClientVpnClientCertificateRevocationListInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentExportClientVpnClientConfigurationInput(v *ExportClientVpnClientConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentExportImageInput(v *ExportImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if len(v.DiskImageFormat) > 0 { - objectKey := object.Key("DiskImageFormat") - objectKey.String(string(v.DiskImageFormat)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.RoleName != nil { - objectKey := object.Key("RoleName") - objectKey.String(*v.RoleName) - } - - if v.S3ExportLocation != nil { - objectKey := object.Key("S3ExportLocation") - if err := awsEc2query_serializeDocumentExportTaskS3LocationRequest(v.S3ExportLocation, objectKey); err != nil { - return err - } - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentExportTransitGatewayRoutesInput(v *ExportTransitGatewayRoutesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.S3Bucket != nil { - objectKey := object.Key("S3Bucket") - objectKey.String(*v.S3Bucket) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentExportVerifiedAccessInstanceClientConfigurationInput(v *ExportVerifiedAccessInstanceClientConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetActiveVpnTunnelStatusInput(v *GetActiveVpnTunnelStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnTunnelOutsideIpAddress != nil { - objectKey := object.Key("VpnTunnelOutsideIpAddress") - objectKey.String(*v.VpnTunnelOutsideIpAddress) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetAllowedImagesSettingsInput(v *GetAllowedImagesSettingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetAssociatedEnclaveCertificateIamRolesInput(v *GetAssociatedEnclaveCertificateIamRolesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CertificateArn != nil { - objectKey := object.Key("CertificateArn") - objectKey.String(*v.CertificateArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetAssociatedIpv6PoolCidrsInput(v *GetAssociatedIpv6PoolCidrsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PoolId != nil { - objectKey := object.Key("PoolId") - objectKey.String(*v.PoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetAwsNetworkPerformanceDataInput(v *GetAwsNetworkPerformanceDataInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DataQueries != nil { - objectKey := object.FlatKey("DataQuery") - if err := awsEc2query_serializeDocumentDataQueries(v.DataQueries, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndTime != nil { - objectKey := object.Key("EndTime") - objectKey.String(smithytime.FormatDateTime(*v.EndTime)) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetCapacityReservationUsageInput(v *GetCapacityReservationUsageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetCoipPoolUsageInput(v *GetCoipPoolUsageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PoolId != nil { - objectKey := object.Key("PoolId") - objectKey.String(*v.PoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetConsoleOutputInput(v *GetConsoleOutputInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.Latest != nil { - objectKey := object.Key("Latest") - objectKey.Boolean(*v.Latest) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetConsoleScreenshotInput(v *GetConsoleScreenshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.WakeUp != nil { - objectKey := object.Key("WakeUp") - objectKey.Boolean(*v.WakeUp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetDeclarativePoliciesReportSummaryInput(v *GetDeclarativePoliciesReportSummaryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReportId != nil { - objectKey := object.Key("ReportId") - objectKey.String(*v.ReportId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetDefaultCreditSpecificationInput(v *GetDefaultCreditSpecificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InstanceFamily) > 0 { - objectKey := object.Key("InstanceFamily") - objectKey.String(string(v.InstanceFamily)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetEbsDefaultKmsKeyIdInput(v *GetEbsDefaultKmsKeyIdInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetEbsEncryptionByDefaultInput(v *GetEbsEncryptionByDefaultInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetFlowLogsIntegrationTemplateInput(v *GetFlowLogsIntegrationTemplateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConfigDeliveryS3DestinationArn != nil { - objectKey := object.Key("ConfigDeliveryS3DestinationArn") - objectKey.String(*v.ConfigDeliveryS3DestinationArn) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FlowLogId != nil { - objectKey := object.Key("FlowLogId") - objectKey.String(*v.FlowLogId) - } - - if v.IntegrateServices != nil { - objectKey := object.Key("IntegrateService") - if err := awsEc2query_serializeDocumentIntegrateServices(v.IntegrateServices, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetGroupsForCapacityReservationInput(v *GetGroupsForCapacityReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetHostReservationPurchasePreviewInput(v *GetHostReservationPurchasePreviewInput, value query.Value) error { - object := value.Object() - _ = object - - if v.HostIdSet != nil { - objectKey := object.FlatKey("HostIdSet") - if err := awsEc2query_serializeDocumentRequestHostIdSet(v.HostIdSet, objectKey); err != nil { - return err - } - } - - if v.OfferingId != nil { - objectKey := object.Key("OfferingId") - objectKey.String(*v.OfferingId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetImageBlockPublicAccessStateInput(v *GetImageBlockPublicAccessStateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetInstanceMetadataDefaultsInput(v *GetInstanceMetadataDefaultsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetInstanceTpmEkPubInput(v *GetInstanceTpmEkPubInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if len(v.KeyFormat) > 0 { - objectKey := object.Key("KeyFormat") - objectKey.String(string(v.KeyFormat)) - } - - if len(v.KeyType) > 0 { - objectKey := object.Key("KeyType") - objectKey.String(string(v.KeyType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetInstanceTypesFromInstanceRequirementsInput(v *GetInstanceTypesFromInstanceRequirementsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ArchitectureTypes != nil { - objectKey := object.FlatKey("ArchitectureType") - if err := awsEc2query_serializeDocumentArchitectureTypeSet(v.ArchitectureTypes, objectKey); err != nil { - return err - } - } - - if v.Context != nil { - objectKey := object.Key("Context") - objectKey.String(*v.Context) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceRequirements != nil { - objectKey := object.Key("InstanceRequirements") - if err := awsEc2query_serializeDocumentInstanceRequirementsRequest(v.InstanceRequirements, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VirtualizationTypes != nil { - objectKey := object.FlatKey("VirtualizationType") - if err := awsEc2query_serializeDocumentVirtualizationTypeSet(v.VirtualizationTypes, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetInstanceUefiDataInput(v *GetInstanceUefiDataInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamAddressHistoryInput(v *GetIpamAddressHistoryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndTime != nil { - objectKey := object.Key("EndTime") - objectKey.String(smithytime.FormatDateTime(*v.EndTime)) - } - - if v.IpamScopeId != nil { - objectKey := object.Key("IpamScopeId") - objectKey.String(*v.IpamScopeId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamDiscoveredAccountsInput(v *GetIpamDiscoveredAccountsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DiscoveryRegion != nil { - objectKey := object.Key("DiscoveryRegion") - objectKey.String(*v.DiscoveryRegion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamDiscoveredPublicAddressesInput(v *GetIpamDiscoveredPublicAddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddressRegion != nil { - objectKey := object.Key("AddressRegion") - objectKey.String(*v.AddressRegion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamDiscoveredResourceCidrsInput(v *GetIpamDiscoveredResourceCidrsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ResourceRegion != nil { - objectKey := object.Key("ResourceRegion") - objectKey.String(*v.ResourceRegion) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamPoolAllocationsInput(v *GetIpamPoolAllocationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamPoolAllocationId != nil { - objectKey := object.Key("IpamPoolAllocationId") - objectKey.String(*v.IpamPoolAllocationId) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamPoolCidrsInput(v *GetIpamPoolCidrsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetIpamResourceCidrsInput(v *GetIpamResourceCidrsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.IpamScopeId != nil { - objectKey := object.Key("IpamScopeId") - objectKey.String(*v.IpamScopeId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.ResourceId != nil { - objectKey := object.Key("ResourceId") - objectKey.String(*v.ResourceId) - } - - if v.ResourceOwner != nil { - objectKey := object.Key("ResourceOwner") - objectKey.String(*v.ResourceOwner) - } - - if v.ResourceTag != nil { - objectKey := object.Key("ResourceTag") - if err := awsEc2query_serializeDocumentRequestIpamResourceTag(v.ResourceTag, objectKey); err != nil { - return err - } - } - - if len(v.ResourceType) > 0 { - objectKey := object.Key("ResourceType") - objectKey.String(string(v.ResourceType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetLaunchTemplateDataInput(v *GetLaunchTemplateDataInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetManagedPrefixListAssociationsInput(v *GetManagedPrefixListAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetManagedPrefixListEntriesInput(v *GetManagedPrefixListEntriesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.TargetVersion != nil { - objectKey := object.Key("TargetVersion") - objectKey.Long(*v.TargetVersion) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsInput(v *GetNetworkInsightsAccessScopeAnalysisFindingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NetworkInsightsAccessScopeAnalysisId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeAnalysisId") - objectKey.String(*v.NetworkInsightsAccessScopeAnalysisId) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetNetworkInsightsAccessScopeContentInput(v *GetNetworkInsightsAccessScopeContentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsAccessScopeId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeId") - objectKey.String(*v.NetworkInsightsAccessScopeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetPasswordDataInput(v *GetPasswordDataInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetReservedInstancesExchangeQuoteInput(v *GetReservedInstancesExchangeQuoteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ReservedInstanceIds != nil { - objectKey := object.FlatKey("ReservedInstanceId") - if err := awsEc2query_serializeDocumentReservedInstanceIdSet(v.ReservedInstanceIds, objectKey); err != nil { - return err - } - } - - if v.TargetConfigurations != nil { - objectKey := object.FlatKey("TargetConfiguration") - if err := awsEc2query_serializeDocumentTargetConfigurationRequestSet(v.TargetConfigurations, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetRouteServerAssociationsInput(v *GetRouteServerAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetRouteServerPropagationsInput(v *GetRouteServerPropagationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetRouteServerRoutingDatabaseInput(v *GetRouteServerRoutingDatabaseInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetSecurityGroupsForVpcInput(v *GetSecurityGroupsForVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetSerialConsoleAccessStatusInput(v *GetSerialConsoleAccessStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetSnapshotBlockPublicAccessStateInput(v *GetSnapshotBlockPublicAccessStateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetSpotPlacementScoresInput(v *GetSpotPlacementScoresInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceRequirementsWithMetadata != nil { - objectKey := object.Key("InstanceRequirementsWithMetadata") - if err := awsEc2query_serializeDocumentInstanceRequirementsWithMetadataRequest(v.InstanceRequirementsWithMetadata, objectKey); err != nil { - return err - } - } - - if v.InstanceTypes != nil { - objectKey := object.FlatKey("InstanceType") - if err := awsEc2query_serializeDocumentInstanceTypes(v.InstanceTypes, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.RegionNames != nil { - objectKey := object.FlatKey("RegionName") - if err := awsEc2query_serializeDocumentRegionNames(v.RegionNames, objectKey); err != nil { - return err - } - } - - if v.SingleAvailabilityZone != nil { - objectKey := object.Key("SingleAvailabilityZone") - objectKey.Boolean(*v.SingleAvailabilityZone) - } - - if v.TargetCapacity != nil { - objectKey := object.Key("TargetCapacity") - objectKey.Integer(*v.TargetCapacity) - } - - if len(v.TargetCapacityUnitType) > 0 { - objectKey := object.Key("TargetCapacityUnitType") - objectKey.String(string(v.TargetCapacityUnitType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetSubnetCidrReservationsInput(v *GetSubnetCidrReservationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayAttachmentPropagationsInput(v *GetTransitGatewayAttachmentPropagationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayMulticastDomainAssociationsInput(v *GetTransitGatewayMulticastDomainAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayPolicyTableAssociationsInput(v *GetTransitGatewayPolicyTableAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayPolicyTableId != nil { - objectKey := object.Key("TransitGatewayPolicyTableId") - objectKey.String(*v.TransitGatewayPolicyTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayPolicyTableEntriesInput(v *GetTransitGatewayPolicyTableEntriesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayPolicyTableId != nil { - objectKey := object.Key("TransitGatewayPolicyTableId") - objectKey.String(*v.TransitGatewayPolicyTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayPrefixListReferencesInput(v *GetTransitGatewayPrefixListReferencesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayRouteTableAssociationsInput(v *GetTransitGatewayRouteTableAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetTransitGatewayRouteTablePropagationsInput(v *GetTransitGatewayRouteTablePropagationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVerifiedAccessEndpointPolicyInput(v *GetVerifiedAccessEndpointPolicyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessEndpointId != nil { - objectKey := object.Key("VerifiedAccessEndpointId") - objectKey.String(*v.VerifiedAccessEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVerifiedAccessEndpointTargetsInput(v *GetVerifiedAccessEndpointTargetsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.VerifiedAccessEndpointId != nil { - objectKey := object.Key("VerifiedAccessEndpointId") - objectKey.String(*v.VerifiedAccessEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVerifiedAccessGroupPolicyInput(v *GetVerifiedAccessGroupPolicyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVpnConnectionDeviceSampleConfigurationInput(v *GetVpnConnectionDeviceSampleConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InternetKeyExchangeVersion != nil { - objectKey := object.Key("InternetKeyExchangeVersion") - objectKey.String(*v.InternetKeyExchangeVersion) - } - - if v.SampleType != nil { - objectKey := object.Key("SampleType") - objectKey.String(*v.SampleType) - } - - if v.VpnConnectionDeviceTypeId != nil { - objectKey := object.Key("VpnConnectionDeviceTypeId") - objectKey.String(*v.VpnConnectionDeviceTypeId) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVpnConnectionDeviceTypesInput(v *GetVpnConnectionDeviceTypesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentGetVpnTunnelReplacementStatusInput(v *GetVpnTunnelReplacementStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnTunnelOutsideIpAddress != nil { - objectKey := object.Key("VpnTunnelOutsideIpAddress") - objectKey.String(*v.VpnTunnelOutsideIpAddress) - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportClientVpnClientCertificateRevocationListInput(v *ImportClientVpnClientCertificateRevocationListInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CertificateRevocationList != nil { - objectKey := object.Key("CertificateRevocationList") - objectKey.String(*v.CertificateRevocationList) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportImageInput(v *ImportImageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Architecture != nil { - objectKey := object.Key("Architecture") - objectKey.String(*v.Architecture) - } - - if len(v.BootMode) > 0 { - objectKey := object.Key("BootMode") - objectKey.String(string(v.BootMode)) - } - - if v.ClientData != nil { - objectKey := object.Key("ClientData") - if err := awsEc2query_serializeDocumentClientData(v.ClientData, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DiskContainers != nil { - objectKey := object.FlatKey("DiskContainer") - if err := awsEc2query_serializeDocumentImageDiskContainerList(v.DiskContainers, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.Hypervisor != nil { - objectKey := object.Key("Hypervisor") - objectKey.String(*v.Hypervisor) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.LicenseSpecifications != nil { - objectKey := object.FlatKey("LicenseSpecifications") - if err := awsEc2query_serializeDocumentImportImageLicenseSpecificationListRequest(v.LicenseSpecifications, objectKey); err != nil { - return err - } - } - - if v.LicenseType != nil { - objectKey := object.Key("LicenseType") - objectKey.String(*v.LicenseType) - } - - if v.Platform != nil { - objectKey := object.Key("Platform") - objectKey.String(*v.Platform) - } - - if v.RoleName != nil { - objectKey := object.Key("RoleName") - objectKey.String(*v.RoleName) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.UsageOperation != nil { - objectKey := object.Key("UsageOperation") - objectKey.String(*v.UsageOperation) - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportInstanceInput(v *ImportInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DiskImages != nil { - objectKey := object.FlatKey("DiskImage") - if err := awsEc2query_serializeDocumentDiskImageList(v.DiskImages, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchSpecification != nil { - objectKey := object.Key("LaunchSpecification") - if err := awsEc2query_serializeDocumentImportInstanceLaunchSpecification(v.LaunchSpecification, objectKey); err != nil { - return err - } - } - - if len(v.Platform) > 0 { - objectKey := object.Key("Platform") - objectKey.String(string(v.Platform)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportKeyPairInput(v *ImportKeyPairInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.PublicKeyMaterial != nil { - objectKey := object.Key("PublicKeyMaterial") - objectKey.Base64EncodeBytes(v.PublicKeyMaterial) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportSnapshotInput(v *ImportSnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientData != nil { - objectKey := object.Key("ClientData") - if err := awsEc2query_serializeDocumentClientData(v.ClientData, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DiskContainer != nil { - objectKey := object.Key("DiskContainer") - if err := awsEc2query_serializeDocumentSnapshotDiskContainer(v.DiskContainer, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Encrypted != nil { - objectKey := object.Key("Encrypted") - objectKey.Boolean(*v.Encrypted) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - if v.RoleName != nil { - objectKey := object.Key("RoleName") - objectKey.String(*v.RoleName) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentImportVolumeInput(v *ImportVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZone != nil { - objectKey := object.Key("AvailabilityZone") - objectKey.String(*v.AvailabilityZone) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Image != nil { - objectKey := object.Key("Image") - if err := awsEc2query_serializeDocumentDiskImageDetail(v.Image, objectKey); err != nil { - return err - } - } - - if v.Volume != nil { - objectKey := object.Key("Volume") - if err := awsEc2query_serializeDocumentVolumeDetail(v.Volume, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentListImagesInRecycleBinInput(v *ListImagesInRecycleBinInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageIds != nil { - objectKey := object.FlatKey("ImageId") - if err := awsEc2query_serializeDocumentImageIdStringList(v.ImageIds, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentListSnapshotsInRecycleBinInput(v *ListSnapshotsInRecycleBinInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.SnapshotIds != nil { - objectKey := object.FlatKey("SnapshotId") - if err := awsEc2query_serializeDocumentSnapshotIdStringList(v.SnapshotIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentLockSnapshotInput(v *LockSnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CoolOffPeriod != nil { - objectKey := object.Key("CoolOffPeriod") - objectKey.Integer(*v.CoolOffPeriod) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExpirationDate != nil { - objectKey := object.Key("ExpirationDate") - objectKey.String(smithytime.FormatDateTime(*v.ExpirationDate)) - } - - if v.LockDuration != nil { - objectKey := object.Key("LockDuration") - objectKey.Integer(*v.LockDuration) - } - - if len(v.LockMode) > 0 { - objectKey := object.Key("LockMode") - objectKey.String(string(v.LockMode)) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyAddressAttributeInput(v *ModifyAddressAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.DomainName != nil { - objectKey := object.Key("DomainName") - objectKey.String(*v.DomainName) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyAvailabilityZoneGroupInput(v *ModifyAvailabilityZoneGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if len(v.OptInStatus) > 0 { - objectKey := object.Key("OptInStatus") - objectKey.String(string(v.OptInStatus)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyCapacityReservationFleetInput(v *ModifyCapacityReservationFleetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationFleetId != nil { - objectKey := object.Key("CapacityReservationFleetId") - objectKey.String(*v.CapacityReservationFleetId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndDate != nil { - objectKey := object.Key("EndDate") - objectKey.String(smithytime.FormatDateTime(*v.EndDate)) - } - - if v.RemoveEndDate != nil { - objectKey := object.Key("RemoveEndDate") - objectKey.Boolean(*v.RemoveEndDate) - } - - if v.TotalTargetCapacity != nil { - objectKey := object.Key("TotalTargetCapacity") - objectKey.Integer(*v.TotalTargetCapacity) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyCapacityReservationInput(v *ModifyCapacityReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Accept != nil { - objectKey := object.Key("Accept") - objectKey.Boolean(*v.Accept) - } - - if v.AdditionalInfo != nil { - objectKey := object.Key("AdditionalInfo") - objectKey.String(*v.AdditionalInfo) - } - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndDate != nil { - objectKey := object.Key("EndDate") - objectKey.String(smithytime.FormatDateTime(*v.EndDate)) - } - - if len(v.EndDateType) > 0 { - objectKey := object.Key("EndDateType") - objectKey.String(string(v.EndDateType)) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if len(v.InstanceMatchCriteria) > 0 { - objectKey := object.Key("InstanceMatchCriteria") - objectKey.String(string(v.InstanceMatchCriteria)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyClientVpnEndpointInput(v *ModifyClientVpnEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientConnectOptions != nil { - objectKey := object.Key("ClientConnectOptions") - if err := awsEc2query_serializeDocumentClientConnectOptions(v.ClientConnectOptions, objectKey); err != nil { - return err - } - } - - if v.ClientLoginBannerOptions != nil { - objectKey := object.Key("ClientLoginBannerOptions") - if err := awsEc2query_serializeDocumentClientLoginBannerOptions(v.ClientLoginBannerOptions, objectKey); err != nil { - return err - } - } - - if v.ClientRouteEnforcementOptions != nil { - objectKey := object.Key("ClientRouteEnforcementOptions") - if err := awsEc2query_serializeDocumentClientRouteEnforcementOptions(v.ClientRouteEnforcementOptions, objectKey); err != nil { - return err - } - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.ConnectionLogOptions != nil { - objectKey := object.Key("ConnectionLogOptions") - if err := awsEc2query_serializeDocumentConnectionLogOptions(v.ConnectionLogOptions, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DisconnectOnSessionTimeout != nil { - objectKey := object.Key("DisconnectOnSessionTimeout") - objectKey.Boolean(*v.DisconnectOnSessionTimeout) - } - - if v.DnsServers != nil { - objectKey := object.Key("DnsServers") - if err := awsEc2query_serializeDocumentDnsServersOptionsModifyStructure(v.DnsServers, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentClientVpnSecurityGroupIdSet(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if len(v.SelfServicePortal) > 0 { - objectKey := object.Key("SelfServicePortal") - objectKey.String(string(v.SelfServicePortal)) - } - - if v.ServerCertificateArn != nil { - objectKey := object.Key("ServerCertificateArn") - objectKey.String(*v.ServerCertificateArn) - } - - if v.SessionTimeoutHours != nil { - objectKey := object.Key("SessionTimeoutHours") - objectKey.Integer(*v.SessionTimeoutHours) - } - - if v.SplitTunnel != nil { - objectKey := object.Key("SplitTunnel") - objectKey.Boolean(*v.SplitTunnel) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - if v.VpnPort != nil { - objectKey := object.Key("VpnPort") - objectKey.Integer(*v.VpnPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyDefaultCreditSpecificationInput(v *ModifyDefaultCreditSpecificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CpuCredits != nil { - objectKey := object.Key("CpuCredits") - objectKey.String(*v.CpuCredits) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InstanceFamily) > 0 { - objectKey := object.Key("InstanceFamily") - objectKey.String(string(v.InstanceFamily)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyEbsDefaultKmsKeyIdInput(v *ModifyEbsDefaultKmsKeyIdInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.KmsKeyId != nil { - objectKey := object.Key("KmsKeyId") - objectKey.String(*v.KmsKeyId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyFleetInput(v *ModifyFleetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Context != nil { - objectKey := object.Key("Context") - objectKey.String(*v.Context) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.ExcessCapacityTerminationPolicy) > 0 { - objectKey := object.Key("ExcessCapacityTerminationPolicy") - objectKey.String(string(v.ExcessCapacityTerminationPolicy)) - } - - if v.FleetId != nil { - objectKey := object.Key("FleetId") - objectKey.String(*v.FleetId) - } - - if v.LaunchTemplateConfigs != nil { - objectKey := object.FlatKey("LaunchTemplateConfig") - if err := awsEc2query_serializeDocumentFleetLaunchTemplateConfigListRequest(v.LaunchTemplateConfigs, objectKey); err != nil { - return err - } - } - - if v.TargetCapacitySpecification != nil { - objectKey := object.Key("TargetCapacitySpecification") - if err := awsEc2query_serializeDocumentTargetCapacitySpecificationRequest(v.TargetCapacitySpecification, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyFpgaImageAttributeInput(v *ModifyFpgaImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FpgaImageId != nil { - objectKey := object.Key("FpgaImageId") - objectKey.String(*v.FpgaImageId) - } - - if v.LoadPermission != nil { - objectKey := object.Key("LoadPermission") - if err := awsEc2query_serializeDocumentLoadPermissionModifications(v.LoadPermission, objectKey); err != nil { - return err - } - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if len(v.OperationType) > 0 { - objectKey := object.Key("OperationType") - objectKey.String(string(v.OperationType)) - } - - if v.ProductCodes != nil { - objectKey := object.FlatKey("ProductCode") - if err := awsEc2query_serializeDocumentProductCodeStringList(v.ProductCodes, objectKey); err != nil { - return err - } - } - - if v.UserGroups != nil { - objectKey := object.FlatKey("UserGroup") - if err := awsEc2query_serializeDocumentUserGroupStringList(v.UserGroups, objectKey); err != nil { - return err - } - } - - if v.UserIds != nil { - objectKey := object.FlatKey("UserId") - if err := awsEc2query_serializeDocumentUserIdStringList(v.UserIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyHostsInput(v *ModifyHostsInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AutoPlacement) > 0 { - objectKey := object.Key("AutoPlacement") - objectKey.String(string(v.AutoPlacement)) - } - - if v.HostIds != nil { - objectKey := object.FlatKey("HostId") - if err := awsEc2query_serializeDocumentRequestHostIdList(v.HostIds, objectKey); err != nil { - return err - } - } - - if len(v.HostMaintenance) > 0 { - objectKey := object.Key("HostMaintenance") - objectKey.String(string(v.HostMaintenance)) - } - - if len(v.HostRecovery) > 0 { - objectKey := object.Key("HostRecovery") - objectKey.String(string(v.HostRecovery)) - } - - if v.InstanceFamily != nil { - objectKey := object.Key("InstanceFamily") - objectKey.String(*v.InstanceFamily) - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - objectKey.String(*v.InstanceType) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIdentityIdFormatInput(v *ModifyIdentityIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.PrincipalArn != nil { - objectKey := object.Key("PrincipalArn") - objectKey.String(*v.PrincipalArn) - } - - if v.Resource != nil { - objectKey := object.Key("Resource") - objectKey.String(*v.Resource) - } - - if v.UseLongIds != nil { - objectKey := object.Key("UseLongIds") - objectKey.Boolean(*v.UseLongIds) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIdFormatInput(v *ModifyIdFormatInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Resource != nil { - objectKey := object.Key("Resource") - objectKey.String(*v.Resource) - } - - if v.UseLongIds != nil { - objectKey := object.Key("UseLongIds") - objectKey.Boolean(*v.UseLongIds) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyImageAttributeInput(v *ModifyImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Attribute != nil { - objectKey := object.Key("Attribute") - objectKey.String(*v.Attribute) - } - - if v.Description != nil { - objectKey := object.Key("Description") - if err := awsEc2query_serializeDocumentAttributeValue(v.Description, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if v.ImdsSupport != nil { - objectKey := object.Key("ImdsSupport") - if err := awsEc2query_serializeDocumentAttributeValue(v.ImdsSupport, objectKey); err != nil { - return err - } - } - - if v.LaunchPermission != nil { - objectKey := object.Key("LaunchPermission") - if err := awsEc2query_serializeDocumentLaunchPermissionModifications(v.LaunchPermission, objectKey); err != nil { - return err - } - } - - if len(v.OperationType) > 0 { - objectKey := object.Key("OperationType") - objectKey.String(string(v.OperationType)) - } - - if v.OrganizationalUnitArns != nil { - objectKey := object.FlatKey("OrganizationalUnitArn") - if err := awsEc2query_serializeDocumentOrganizationalUnitArnStringList(v.OrganizationalUnitArns, objectKey); err != nil { - return err - } - } - - if v.OrganizationArns != nil { - objectKey := object.FlatKey("OrganizationArn") - if err := awsEc2query_serializeDocumentOrganizationArnStringList(v.OrganizationArns, objectKey); err != nil { - return err - } - } - - if v.ProductCodes != nil { - objectKey := object.FlatKey("ProductCode") - if err := awsEc2query_serializeDocumentProductCodeStringList(v.ProductCodes, objectKey); err != nil { - return err - } - } - - if v.UserGroups != nil { - objectKey := object.FlatKey("UserGroup") - if err := awsEc2query_serializeDocumentUserGroupStringList(v.UserGroups, objectKey); err != nil { - return err - } - } - - if v.UserIds != nil { - objectKey := object.FlatKey("UserId") - if err := awsEc2query_serializeDocumentUserIdStringList(v.UserIds, objectKey); err != nil { - return err - } - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceAttributeInput(v *ModifyInstanceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentInstanceBlockDeviceMappingSpecificationList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.DisableApiStop != nil { - objectKey := object.Key("DisableApiStop") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.DisableApiStop, objectKey); err != nil { - return err - } - } - - if v.DisableApiTermination != nil { - objectKey := object.Key("DisableApiTermination") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.DisableApiTermination, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EbsOptimized, objectKey); err != nil { - return err - } - } - - if v.EnaSupport != nil { - objectKey := object.Key("EnaSupport") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnaSupport, objectKey); err != nil { - return err - } - } - - if v.Groups != nil { - objectKey := object.FlatKey("GroupId") - if err := awsEc2query_serializeDocumentGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.InstanceInitiatedShutdownBehavior != nil { - objectKey := object.Key("InstanceInitiatedShutdownBehavior") - if err := awsEc2query_serializeDocumentAttributeValue(v.InstanceInitiatedShutdownBehavior, objectKey); err != nil { - return err - } - } - - if v.InstanceType != nil { - objectKey := object.Key("InstanceType") - if err := awsEc2query_serializeDocumentAttributeValue(v.InstanceType, objectKey); err != nil { - return err - } - } - - if v.Kernel != nil { - objectKey := object.Key("Kernel") - if err := awsEc2query_serializeDocumentAttributeValue(v.Kernel, objectKey); err != nil { - return err - } - } - - if v.Ramdisk != nil { - objectKey := object.Key("Ramdisk") - if err := awsEc2query_serializeDocumentAttributeValue(v.Ramdisk, objectKey); err != nil { - return err - } - } - - if v.SourceDestCheck != nil { - objectKey := object.Key("SourceDestCheck") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.SourceDestCheck, objectKey); err != nil { - return err - } - } - - if v.SriovNetSupport != nil { - objectKey := object.Key("SriovNetSupport") - if err := awsEc2query_serializeDocumentAttributeValue(v.SriovNetSupport, objectKey); err != nil { - return err - } - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - if err := awsEc2query_serializeDocumentBlobAttributeValue(v.UserData, objectKey); err != nil { - return err - } - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceCapacityReservationAttributesInput(v *ModifyInstanceCapacityReservationAttributesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationSpecification != nil { - objectKey := object.Key("CapacityReservationSpecification") - if err := awsEc2query_serializeDocumentCapacityReservationSpecification(v.CapacityReservationSpecification, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceCpuOptionsInput(v *ModifyInstanceCpuOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CoreCount != nil { - objectKey := object.Key("CoreCount") - objectKey.Integer(*v.CoreCount) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.ThreadsPerCore != nil { - objectKey := object.Key("ThreadsPerCore") - objectKey.Integer(*v.ThreadsPerCore) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceCreditSpecificationInput(v *ModifyInstanceCreditSpecificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCreditSpecifications != nil { - objectKey := object.FlatKey("InstanceCreditSpecification") - if err := awsEc2query_serializeDocumentInstanceCreditSpecificationListRequest(v.InstanceCreditSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceEventStartTimeInput(v *ModifyInstanceEventStartTimeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceEventId != nil { - objectKey := object.Key("InstanceEventId") - objectKey.String(*v.InstanceEventId) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.NotBefore != nil { - objectKey := object.Key("NotBefore") - objectKey.String(smithytime.FormatDateTime(*v.NotBefore)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceEventWindowInput(v *ModifyInstanceEventWindowInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CronExpression != nil { - objectKey := object.Key("CronExpression") - objectKey.String(*v.CronExpression) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceEventWindowId != nil { - objectKey := object.Key("InstanceEventWindowId") - objectKey.String(*v.InstanceEventWindowId) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.TimeRanges != nil { - objectKey := object.FlatKey("TimeRange") - if err := awsEc2query_serializeDocumentInstanceEventWindowTimeRangeRequestSet(v.TimeRanges, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceMaintenanceOptionsInput(v *ModifyInstanceMaintenanceOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.AutoRecovery) > 0 { - objectKey := object.Key("AutoRecovery") - objectKey.String(string(v.AutoRecovery)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if len(v.RebootMigration) > 0 { - objectKey := object.Key("RebootMigration") - objectKey.String(string(v.RebootMigration)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceMetadataDefaultsInput(v *ModifyInstanceMetadataDefaultsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.HttpEndpoint) > 0 { - objectKey := object.Key("HttpEndpoint") - objectKey.String(string(v.HttpEndpoint)) - } - - if v.HttpPutResponseHopLimit != nil { - objectKey := object.Key("HttpPutResponseHopLimit") - objectKey.Integer(*v.HttpPutResponseHopLimit) - } - - if len(v.HttpTokens) > 0 { - objectKey := object.Key("HttpTokens") - objectKey.String(string(v.HttpTokens)) - } - - if len(v.InstanceMetadataTags) > 0 { - objectKey := object.Key("InstanceMetadataTags") - objectKey.String(string(v.InstanceMetadataTags)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceMetadataOptionsInput(v *ModifyInstanceMetadataOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.HttpEndpoint) > 0 { - objectKey := object.Key("HttpEndpoint") - objectKey.String(string(v.HttpEndpoint)) - } - - if len(v.HttpProtocolIpv6) > 0 { - objectKey := object.Key("HttpProtocolIpv6") - objectKey.String(string(v.HttpProtocolIpv6)) - } - - if v.HttpPutResponseHopLimit != nil { - objectKey := object.Key("HttpPutResponseHopLimit") - objectKey.Integer(*v.HttpPutResponseHopLimit) - } - - if len(v.HttpTokens) > 0 { - objectKey := object.Key("HttpTokens") - objectKey.String(string(v.HttpTokens)) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if len(v.InstanceMetadataTags) > 0 { - objectKey := object.Key("InstanceMetadataTags") - objectKey.String(string(v.InstanceMetadataTags)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstanceNetworkPerformanceOptionsInput(v *ModifyInstanceNetworkPerformanceOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.BandwidthWeighting) > 0 { - objectKey := object.Key("BandwidthWeighting") - objectKey.String(string(v.BandwidthWeighting)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyInstancePlacementInput(v *ModifyInstancePlacementInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Affinity) > 0 { - objectKey := object.Key("Affinity") - objectKey.String(string(v.Affinity)) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.HostId != nil { - objectKey := object.Key("HostId") - objectKey.String(*v.HostId) - } - - if v.HostResourceGroupArn != nil { - objectKey := object.Key("HostResourceGroupArn") - objectKey.String(*v.HostResourceGroupArn) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.PartitionNumber != nil { - objectKey := object.Key("PartitionNumber") - objectKey.Integer(*v.PartitionNumber) - } - - if len(v.Tenancy) > 0 { - objectKey := object.Key("Tenancy") - objectKey.String(string(v.Tenancy)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIpamInput(v *ModifyIpamInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddOperatingRegions != nil { - objectKey := object.FlatKey("AddOperatingRegion") - if err := awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v.AddOperatingRegions, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnablePrivateGua != nil { - objectKey := object.Key("EnablePrivateGua") - objectKey.Boolean(*v.EnablePrivateGua) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - if len(v.MeteredAccount) > 0 { - objectKey := object.Key("MeteredAccount") - objectKey.String(string(v.MeteredAccount)) - } - - if v.RemoveOperatingRegions != nil { - objectKey := object.FlatKey("RemoveOperatingRegion") - if err := awsEc2query_serializeDocumentRemoveIpamOperatingRegionSet(v.RemoveOperatingRegions, objectKey); err != nil { - return err - } - } - - if len(v.Tier) > 0 { - objectKey := object.Key("Tier") - objectKey.String(string(v.Tier)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIpamPoolInput(v *ModifyIpamPoolInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddAllocationResourceTags != nil { - objectKey := object.FlatKey("AddAllocationResourceTag") - if err := awsEc2query_serializeDocumentRequestIpamResourceTagList(v.AddAllocationResourceTags, objectKey); err != nil { - return err - } - } - - if v.AllocationDefaultNetmaskLength != nil { - objectKey := object.Key("AllocationDefaultNetmaskLength") - objectKey.Integer(*v.AllocationDefaultNetmaskLength) - } - - if v.AllocationMaxNetmaskLength != nil { - objectKey := object.Key("AllocationMaxNetmaskLength") - objectKey.Integer(*v.AllocationMaxNetmaskLength) - } - - if v.AllocationMinNetmaskLength != nil { - objectKey := object.Key("AllocationMinNetmaskLength") - objectKey.Integer(*v.AllocationMinNetmaskLength) - } - - if v.AutoImport != nil { - objectKey := object.Key("AutoImport") - objectKey.Boolean(*v.AutoImport) - } - - if v.ClearAllocationDefaultNetmaskLength != nil { - objectKey := object.Key("ClearAllocationDefaultNetmaskLength") - objectKey.Boolean(*v.ClearAllocationDefaultNetmaskLength) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.RemoveAllocationResourceTags != nil { - objectKey := object.FlatKey("RemoveAllocationResourceTag") - if err := awsEc2query_serializeDocumentRequestIpamResourceTagList(v.RemoveAllocationResourceTags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIpamResourceCidrInput(v *ModifyIpamResourceCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CurrentIpamScopeId != nil { - objectKey := object.Key("CurrentIpamScopeId") - objectKey.String(*v.CurrentIpamScopeId) - } - - if v.DestinationIpamScopeId != nil { - objectKey := object.Key("DestinationIpamScopeId") - objectKey.String(*v.DestinationIpamScopeId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Monitored != nil { - objectKey := object.Key("Monitored") - objectKey.Boolean(*v.Monitored) - } - - if v.ResourceCidr != nil { - objectKey := object.Key("ResourceCidr") - objectKey.String(*v.ResourceCidr) - } - - if v.ResourceId != nil { - objectKey := object.Key("ResourceId") - objectKey.String(*v.ResourceId) - } - - if v.ResourceRegion != nil { - objectKey := object.Key("ResourceRegion") - objectKey.String(*v.ResourceRegion) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIpamResourceDiscoveryInput(v *ModifyIpamResourceDiscoveryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddOperatingRegions != nil { - objectKey := object.FlatKey("AddOperatingRegion") - if err := awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v.AddOperatingRegions, objectKey); err != nil { - return err - } - } - - if v.AddOrganizationalUnitExclusions != nil { - objectKey := object.FlatKey("AddOrganizationalUnitExclusion") - if err := awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusionSet(v.AddOrganizationalUnitExclusions, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamResourceDiscoveryId != nil { - objectKey := object.Key("IpamResourceDiscoveryId") - objectKey.String(*v.IpamResourceDiscoveryId) - } - - if v.RemoveOperatingRegions != nil { - objectKey := object.FlatKey("RemoveOperatingRegion") - if err := awsEc2query_serializeDocumentRemoveIpamOperatingRegionSet(v.RemoveOperatingRegions, objectKey); err != nil { - return err - } - } - - if v.RemoveOrganizationalUnitExclusions != nil { - objectKey := object.FlatKey("RemoveOrganizationalUnitExclusion") - if err := awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusionSet(v.RemoveOrganizationalUnitExclusions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyIpamScopeInput(v *ModifyIpamScopeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamScopeId != nil { - objectKey := object.Key("IpamScopeId") - objectKey.String(*v.IpamScopeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyLaunchTemplateInput(v *ModifyLaunchTemplateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DefaultVersion != nil { - objectKey := object.Key("SetDefaultVersion") - objectKey.String(*v.DefaultVersion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LaunchTemplateId != nil { - objectKey := object.Key("LaunchTemplateId") - objectKey.String(*v.LaunchTemplateId) - } - - if v.LaunchTemplateName != nil { - objectKey := object.Key("LaunchTemplateName") - objectKey.String(*v.LaunchTemplateName) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyLocalGatewayRouteInput(v *ModifyLocalGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.LocalGatewayVirtualInterfaceGroupId != nil { - objectKey := object.Key("LocalGatewayVirtualInterfaceGroupId") - objectKey.String(*v.LocalGatewayVirtualInterfaceGroupId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyManagedPrefixListInput(v *ModifyManagedPrefixListInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddEntries != nil { - objectKey := object.FlatKey("AddEntry") - if err := awsEc2query_serializeDocumentAddPrefixListEntries(v.AddEntries, objectKey); err != nil { - return err - } - } - - if v.CurrentVersion != nil { - objectKey := object.Key("CurrentVersion") - objectKey.Long(*v.CurrentVersion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxEntries != nil { - objectKey := object.Key("MaxEntries") - objectKey.Integer(*v.MaxEntries) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.PrefixListName != nil { - objectKey := object.Key("PrefixListName") - objectKey.String(*v.PrefixListName) - } - - if v.RemoveEntries != nil { - objectKey := object.FlatKey("RemoveEntry") - if err := awsEc2query_serializeDocumentRemovePrefixListEntries(v.RemoveEntries, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyNetworkInterfaceAttributeInput(v *ModifyNetworkInterfaceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociatedSubnetIds != nil { - objectKey := object.FlatKey("AssociatedSubnetId") - if err := awsEc2query_serializeDocumentSubnetIdList(v.AssociatedSubnetIds, objectKey); err != nil { - return err - } - } - - if v.AssociatePublicIpAddress != nil { - objectKey := object.Key("AssociatePublicIpAddress") - objectKey.Boolean(*v.AssociatePublicIpAddress) - } - - if v.Attachment != nil { - objectKey := object.Key("Attachment") - if err := awsEc2query_serializeDocumentNetworkInterfaceAttachmentChanges(v.Attachment, objectKey); err != nil { - return err - } - } - - if v.ConnectionTrackingSpecification != nil { - objectKey := object.Key("ConnectionTrackingSpecification") - if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - if err := awsEc2query_serializeDocumentAttributeValue(v.Description, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnablePrimaryIpv6 != nil { - objectKey := object.Key("EnablePrimaryIpv6") - objectKey.Boolean(*v.EnablePrimaryIpv6) - } - - if v.EnaSrdSpecification != nil { - objectKey := object.Key("EnaSrdSpecification") - if err := awsEc2query_serializeDocumentEnaSrdSpecification(v.EnaSrdSpecification, objectKey); err != nil { - return err - } - } - - if v.Groups != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.SourceDestCheck != nil { - objectKey := object.Key("SourceDestCheck") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.SourceDestCheck, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyPrivateDnsNameOptionsInput(v *ModifyPrivateDnsNameOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnableResourceNameDnsAAAARecord != nil { - objectKey := object.Key("EnableResourceNameDnsAAAARecord") - objectKey.Boolean(*v.EnableResourceNameDnsAAAARecord) - } - - if v.EnableResourceNameDnsARecord != nil { - objectKey := object.Key("EnableResourceNameDnsARecord") - objectKey.Boolean(*v.EnableResourceNameDnsARecord) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if len(v.PrivateDnsHostnameType) > 0 { - objectKey := object.Key("PrivateDnsHostnameType") - objectKey.String(string(v.PrivateDnsHostnameType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyPublicIpDnsNameOptionsInput(v *ModifyPublicIpDnsNameOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.HostnameType) > 0 { - objectKey := object.Key("HostnameType") - objectKey.String(string(v.HostnameType)) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyReservedInstancesInput(v *ModifyReservedInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.ReservedInstancesIds != nil { - objectKey := object.FlatKey("ReservedInstancesId") - if err := awsEc2query_serializeDocumentReservedInstancesIdStringList(v.ReservedInstancesIds, objectKey); err != nil { - return err - } - } - - if v.TargetConfigurations != nil { - objectKey := object.FlatKey("ReservedInstancesConfigurationSetItemType") - if err := awsEc2query_serializeDocumentReservedInstancesConfigurationList(v.TargetConfigurations, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyRouteServerInput(v *ModifyRouteServerInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.PersistRoutes) > 0 { - objectKey := object.Key("PersistRoutes") - objectKey.String(string(v.PersistRoutes)) - } - - if v.PersistRoutesDuration != nil { - objectKey := object.Key("PersistRoutesDuration") - objectKey.Long(*v.PersistRoutesDuration) - } - - if v.RouteServerId != nil { - objectKey := object.Key("RouteServerId") - objectKey.String(*v.RouteServerId) - } - - if v.SnsNotificationsEnabled != nil { - objectKey := object.Key("SnsNotificationsEnabled") - objectKey.Boolean(*v.SnsNotificationsEnabled) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifySecurityGroupRulesInput(v *ModifySecurityGroupRulesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.SecurityGroupRules != nil { - objectKey := object.FlatKey("SecurityGroupRule") - if err := awsEc2query_serializeDocumentSecurityGroupRuleUpdateList(v.SecurityGroupRules, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifySnapshotAttributeInput(v *ModifySnapshotAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.CreateVolumePermission != nil { - objectKey := object.Key("CreateVolumePermission") - if err := awsEc2query_serializeDocumentCreateVolumePermissionModifications(v.CreateVolumePermission, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupNames != nil { - objectKey := object.FlatKey("UserGroup") - if err := awsEc2query_serializeDocumentGroupNameStringList(v.GroupNames, objectKey); err != nil { - return err - } - } - - if len(v.OperationType) > 0 { - objectKey := object.Key("OperationType") - objectKey.String(string(v.OperationType)) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.UserIds != nil { - objectKey := object.FlatKey("UserId") - if err := awsEc2query_serializeDocumentUserIdStringList(v.UserIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifySnapshotTierInput(v *ModifySnapshotTierInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if len(v.StorageTier) > 0 { - objectKey := object.Key("StorageTier") - objectKey.String(string(v.StorageTier)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifySpotFleetRequestInput(v *ModifySpotFleetRequestInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Context != nil { - objectKey := object.Key("Context") - objectKey.String(*v.Context) - } - - if len(v.ExcessCapacityTerminationPolicy) > 0 { - objectKey := object.Key("ExcessCapacityTerminationPolicy") - objectKey.String(string(v.ExcessCapacityTerminationPolicy)) - } - - if v.LaunchTemplateConfigs != nil { - objectKey := object.FlatKey("LaunchTemplateConfig") - if err := awsEc2query_serializeDocumentLaunchTemplateConfigList(v.LaunchTemplateConfigs, objectKey); err != nil { - return err - } - } - - if v.OnDemandTargetCapacity != nil { - objectKey := object.Key("OnDemandTargetCapacity") - objectKey.Integer(*v.OnDemandTargetCapacity) - } - - if v.SpotFleetRequestId != nil { - objectKey := object.Key("SpotFleetRequestId") - objectKey.String(*v.SpotFleetRequestId) - } - - if v.TargetCapacity != nil { - objectKey := object.Key("TargetCapacity") - objectKey.Integer(*v.TargetCapacity) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifySubnetAttributeInput(v *ModifySubnetAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssignIpv6AddressOnCreation != nil { - objectKey := object.Key("AssignIpv6AddressOnCreation") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.AssignIpv6AddressOnCreation, objectKey); err != nil { - return err - } - } - - if v.CustomerOwnedIpv4Pool != nil { - objectKey := object.Key("CustomerOwnedIpv4Pool") - objectKey.String(*v.CustomerOwnedIpv4Pool) - } - - if v.DisableLniAtDeviceIndex != nil { - objectKey := object.Key("DisableLniAtDeviceIndex") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.DisableLniAtDeviceIndex, objectKey); err != nil { - return err - } - } - - if v.EnableDns64 != nil { - objectKey := object.Key("EnableDns64") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableDns64, objectKey); err != nil { - return err - } - } - - if v.EnableLniAtDeviceIndex != nil { - objectKey := object.Key("EnableLniAtDeviceIndex") - objectKey.Integer(*v.EnableLniAtDeviceIndex) - } - - if v.EnableResourceNameDnsAAAARecordOnLaunch != nil { - objectKey := object.Key("EnableResourceNameDnsAAAARecordOnLaunch") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableResourceNameDnsAAAARecordOnLaunch, objectKey); err != nil { - return err - } - } - - if v.EnableResourceNameDnsARecordOnLaunch != nil { - objectKey := object.Key("EnableResourceNameDnsARecordOnLaunch") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableResourceNameDnsARecordOnLaunch, objectKey); err != nil { - return err - } - } - - if v.MapCustomerOwnedIpOnLaunch != nil { - objectKey := object.Key("MapCustomerOwnedIpOnLaunch") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.MapCustomerOwnedIpOnLaunch, objectKey); err != nil { - return err - } - } - - if v.MapPublicIpOnLaunch != nil { - objectKey := object.Key("MapPublicIpOnLaunch") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.MapPublicIpOnLaunch, objectKey); err != nil { - return err - } - } - - if len(v.PrivateDnsHostnameTypeOnLaunch) > 0 { - objectKey := object.Key("PrivateDnsHostnameTypeOnLaunch") - objectKey.String(string(v.PrivateDnsHostnameTypeOnLaunch)) - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTrafficMirrorFilterNetworkServicesInput(v *ModifyTrafficMirrorFilterNetworkServicesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddNetworkServices != nil { - objectKey := object.FlatKey("AddNetworkService") - if err := awsEc2query_serializeDocumentTrafficMirrorNetworkServiceList(v.AddNetworkServices, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RemoveNetworkServices != nil { - objectKey := object.FlatKey("RemoveNetworkService") - if err := awsEc2query_serializeDocumentTrafficMirrorNetworkServiceList(v.RemoveNetworkServices, objectKey); err != nil { - return err - } - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTrafficMirrorFilterRuleInput(v *ModifyTrafficMirrorFilterRuleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationPortRange != nil { - objectKey := object.Key("DestinationPortRange") - if err := awsEc2query_serializeDocumentTrafficMirrorPortRangeRequest(v.DestinationPortRange, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Protocol != nil { - objectKey := object.Key("Protocol") - objectKey.Integer(*v.Protocol) - } - - if v.RemoveFields != nil { - objectKey := object.FlatKey("RemoveField") - if err := awsEc2query_serializeDocumentTrafficMirrorFilterRuleFieldList(v.RemoveFields, objectKey); err != nil { - return err - } - } - - if len(v.RuleAction) > 0 { - objectKey := object.Key("RuleAction") - objectKey.String(string(v.RuleAction)) - } - - if v.RuleNumber != nil { - objectKey := object.Key("RuleNumber") - objectKey.Integer(*v.RuleNumber) - } - - if v.SourceCidrBlock != nil { - objectKey := object.Key("SourceCidrBlock") - objectKey.String(*v.SourceCidrBlock) - } - - if v.SourcePortRange != nil { - objectKey := object.Key("SourcePortRange") - if err := awsEc2query_serializeDocumentTrafficMirrorPortRangeRequest(v.SourcePortRange, objectKey); err != nil { - return err - } - } - - if len(v.TrafficDirection) > 0 { - objectKey := object.Key("TrafficDirection") - objectKey.String(string(v.TrafficDirection)) - } - - if v.TrafficMirrorFilterRuleId != nil { - objectKey := object.Key("TrafficMirrorFilterRuleId") - objectKey.String(*v.TrafficMirrorFilterRuleId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTrafficMirrorSessionInput(v *ModifyTrafficMirrorSessionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PacketLength != nil { - objectKey := object.Key("PacketLength") - objectKey.Integer(*v.PacketLength) - } - - if v.RemoveFields != nil { - objectKey := object.FlatKey("RemoveField") - if err := awsEc2query_serializeDocumentTrafficMirrorSessionFieldList(v.RemoveFields, objectKey); err != nil { - return err - } - } - - if v.SessionNumber != nil { - objectKey := object.Key("SessionNumber") - objectKey.Integer(*v.SessionNumber) - } - - if v.TrafficMirrorFilterId != nil { - objectKey := object.Key("TrafficMirrorFilterId") - objectKey.String(*v.TrafficMirrorFilterId) - } - - if v.TrafficMirrorSessionId != nil { - objectKey := object.Key("TrafficMirrorSessionId") - objectKey.String(*v.TrafficMirrorSessionId) - } - - if v.TrafficMirrorTargetId != nil { - objectKey := object.Key("TrafficMirrorTargetId") - objectKey.String(*v.TrafficMirrorTargetId) - } - - if v.VirtualNetworkId != nil { - objectKey := object.Key("VirtualNetworkId") - objectKey.Integer(*v.VirtualNetworkId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTransitGatewayInput(v *ModifyTransitGatewayInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentModifyTransitGatewayOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTransitGatewayPrefixListReferenceInput(v *ModifyTransitGatewayPrefixListReferenceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Blackhole != nil { - objectKey := object.Key("Blackhole") - objectKey.Boolean(*v.Blackhole) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyTransitGatewayVpcAttachmentInput(v *ModifyTransitGatewayVpcAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddSubnetIds != nil { - objectKey := object.FlatKey("AddSubnetIds") - if err := awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v.AddSubnetIds, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Options != nil { - objectKey := object.Key("Options") - if err := awsEc2query_serializeDocumentModifyTransitGatewayVpcAttachmentRequestOptions(v.Options, objectKey); err != nil { - return err - } - } - - if v.RemoveSubnetIds != nil { - objectKey := object.FlatKey("RemoveSubnetIds") - if err := awsEc2query_serializeDocumentTransitGatewaySubnetIdList(v.RemoveSubnetIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessEndpointInput(v *ModifyVerifiedAccessEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrOptions != nil { - objectKey := object.Key("CidrOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointCidrOptions(v.CidrOptions, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LoadBalancerOptions != nil { - objectKey := object.Key("LoadBalancerOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointLoadBalancerOptions(v.LoadBalancerOptions, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceOptions != nil { - objectKey := object.Key("NetworkInterfaceOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointEniOptions(v.NetworkInterfaceOptions, objectKey); err != nil { - return err - } - } - - if v.RdsOptions != nil { - objectKey := object.Key("RdsOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessEndpointRdsOptions(v.RdsOptions, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessEndpointId != nil { - objectKey := object.Key("VerifiedAccessEndpointId") - objectKey.String(*v.VerifiedAccessEndpointId) - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessEndpointPolicyInput(v *ModifyVerifiedAccessEndpointPolicyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.PolicyEnabled != nil { - objectKey := object.Key("PolicyEnabled") - objectKey.Boolean(*v.PolicyEnabled) - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessEndpointId != nil { - objectKey := object.Key("VerifiedAccessEndpointId") - objectKey.String(*v.VerifiedAccessEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessGroupInput(v *ModifyVerifiedAccessGroupInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessGroupPolicyInput(v *ModifyVerifiedAccessGroupPolicyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.PolicyEnabled != nil { - objectKey := object.Key("PolicyEnabled") - objectKey.Boolean(*v.PolicyEnabled) - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessGroupId != nil { - objectKey := object.Key("VerifiedAccessGroupId") - objectKey.String(*v.VerifiedAccessGroupId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessInstanceInput(v *ModifyVerifiedAccessInstanceInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrEndpointsCustomSubDomain != nil { - objectKey := object.Key("CidrEndpointsCustomSubDomain") - objectKey.String(*v.CidrEndpointsCustomSubDomain) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationInput(v *ModifyVerifiedAccessInstanceLoggingConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AccessLogs != nil { - objectKey := object.Key("AccessLogs") - if err := awsEc2query_serializeDocumentVerifiedAccessLogOptions(v.AccessLogs, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VerifiedAccessInstanceId != nil { - objectKey := object.Key("VerifiedAccessInstanceId") - objectKey.String(*v.VerifiedAccessInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVerifiedAccessTrustProviderInput(v *ModifyVerifiedAccessTrustProviderInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DeviceOptions != nil { - objectKey := object.Key("DeviceOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessTrustProviderDeviceOptions(v.DeviceOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NativeApplicationOidcOptions != nil { - objectKey := object.Key("NativeApplicationOidcOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessNativeApplicationOidcOptions(v.NativeApplicationOidcOptions, objectKey); err != nil { - return err - } - } - - if v.OidcOptions != nil { - objectKey := object.Key("OidcOptions") - if err := awsEc2query_serializeDocumentModifyVerifiedAccessTrustProviderOidcOptions(v.OidcOptions, objectKey); err != nil { - return err - } - } - - if v.SseSpecification != nil { - objectKey := object.Key("SseSpecification") - if err := awsEc2query_serializeDocumentVerifiedAccessSseSpecificationRequest(v.SseSpecification, objectKey); err != nil { - return err - } - } - - if v.VerifiedAccessTrustProviderId != nil { - objectKey := object.Key("VerifiedAccessTrustProviderId") - objectKey.String(*v.VerifiedAccessTrustProviderId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVolumeAttributeInput(v *ModifyVolumeAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AutoEnableIO != nil { - objectKey := object.Key("AutoEnableIO") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.AutoEnableIO, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVolumeInput(v *ModifyVolumeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Iops != nil { - objectKey := object.Key("Iops") - objectKey.Integer(*v.Iops) - } - - if v.MultiAttachEnabled != nil { - objectKey := object.Key("MultiAttachEnabled") - objectKey.Boolean(*v.MultiAttachEnabled) - } - - if v.Size != nil { - objectKey := object.Key("Size") - objectKey.Integer(*v.Size) - } - - if v.Throughput != nil { - objectKey := object.Key("Throughput") - objectKey.Integer(*v.Throughput) - } - - if v.VolumeId != nil { - objectKey := object.Key("VolumeId") - objectKey.String(*v.VolumeId) - } - - if len(v.VolumeType) > 0 { - objectKey := object.Key("VolumeType") - objectKey.String(string(v.VolumeType)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcAttributeInput(v *ModifyVpcAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.EnableDnsHostnames != nil { - objectKey := object.Key("EnableDnsHostnames") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableDnsHostnames, objectKey); err != nil { - return err - } - } - - if v.EnableDnsSupport != nil { - objectKey := object.Key("EnableDnsSupport") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableDnsSupport, objectKey); err != nil { - return err - } - } - - if v.EnableNetworkAddressUsageMetrics != nil { - objectKey := object.Key("EnableNetworkAddressUsageMetrics") - if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableNetworkAddressUsageMetrics, objectKey); err != nil { - return err - } - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcBlockPublicAccessExclusionInput(v *ModifyVpcBlockPublicAccessExclusionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ExclusionId != nil { - objectKey := object.Key("ExclusionId") - objectKey.String(*v.ExclusionId) - } - - if len(v.InternetGatewayExclusionMode) > 0 { - objectKey := object.Key("InternetGatewayExclusionMode") - objectKey.String(string(v.InternetGatewayExclusionMode)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcBlockPublicAccessOptionsInput(v *ModifyVpcBlockPublicAccessOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InternetGatewayBlockMode) > 0 { - objectKey := object.Key("InternetGatewayBlockMode") - objectKey.String(string(v.InternetGatewayBlockMode)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcEndpointConnectionNotificationInput(v *ModifyVpcEndpointConnectionNotificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ConnectionEvents != nil { - objectKey := object.FlatKey("ConnectionEvents") - if err := awsEc2query_serializeDocumentValueStringList(v.ConnectionEvents, objectKey); err != nil { - return err - } - } - - if v.ConnectionNotificationArn != nil { - objectKey := object.Key("ConnectionNotificationArn") - objectKey.String(*v.ConnectionNotificationArn) - } - - if v.ConnectionNotificationId != nil { - objectKey := object.Key("ConnectionNotificationId") - objectKey.String(*v.ConnectionNotificationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcEndpointInput(v *ModifyVpcEndpointInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddRouteTableIds != nil { - objectKey := object.FlatKey("AddRouteTableId") - if err := awsEc2query_serializeDocumentVpcEndpointRouteTableIdList(v.AddRouteTableIds, objectKey); err != nil { - return err - } - } - - if v.AddSecurityGroupIds != nil { - objectKey := object.FlatKey("AddSecurityGroupId") - if err := awsEc2query_serializeDocumentVpcEndpointSecurityGroupIdList(v.AddSecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.AddSubnetIds != nil { - objectKey := object.FlatKey("AddSubnetId") - if err := awsEc2query_serializeDocumentVpcEndpointSubnetIdList(v.AddSubnetIds, objectKey); err != nil { - return err - } - } - - if v.DnsOptions != nil { - objectKey := object.Key("DnsOptions") - if err := awsEc2query_serializeDocumentDnsOptionsSpecification(v.DnsOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.IpAddressType) > 0 { - objectKey := object.Key("IpAddressType") - objectKey.String(string(v.IpAddressType)) - } - - if v.PolicyDocument != nil { - objectKey := object.Key("PolicyDocument") - objectKey.String(*v.PolicyDocument) - } - - if v.PrivateDnsEnabled != nil { - objectKey := object.Key("PrivateDnsEnabled") - objectKey.Boolean(*v.PrivateDnsEnabled) - } - - if v.RemoveRouteTableIds != nil { - objectKey := object.FlatKey("RemoveRouteTableId") - if err := awsEc2query_serializeDocumentVpcEndpointRouteTableIdList(v.RemoveRouteTableIds, objectKey); err != nil { - return err - } - } - - if v.RemoveSecurityGroupIds != nil { - objectKey := object.FlatKey("RemoveSecurityGroupId") - if err := awsEc2query_serializeDocumentVpcEndpointSecurityGroupIdList(v.RemoveSecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.RemoveSubnetIds != nil { - objectKey := object.FlatKey("RemoveSubnetId") - if err := awsEc2query_serializeDocumentVpcEndpointSubnetIdList(v.RemoveSubnetIds, objectKey); err != nil { - return err - } - } - - if v.ResetPolicy != nil { - objectKey := object.Key("ResetPolicy") - objectKey.Boolean(*v.ResetPolicy) - } - - if v.SubnetConfigurations != nil { - objectKey := object.FlatKey("SubnetConfiguration") - if err := awsEc2query_serializeDocumentSubnetConfigurationsList(v.SubnetConfigurations, objectKey); err != nil { - return err - } - } - - if v.VpcEndpointId != nil { - objectKey := object.Key("VpcEndpointId") - objectKey.String(*v.VpcEndpointId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcEndpointServiceConfigurationInput(v *ModifyVpcEndpointServiceConfigurationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AcceptanceRequired != nil { - objectKey := object.Key("AcceptanceRequired") - objectKey.Boolean(*v.AcceptanceRequired) - } - - if v.AddGatewayLoadBalancerArns != nil { - objectKey := object.FlatKey("AddGatewayLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.AddGatewayLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.AddNetworkLoadBalancerArns != nil { - objectKey := object.FlatKey("AddNetworkLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.AddNetworkLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.AddSupportedIpAddressTypes != nil { - objectKey := object.FlatKey("AddSupportedIpAddressType") - if err := awsEc2query_serializeDocumentValueStringList(v.AddSupportedIpAddressTypes, objectKey); err != nil { - return err - } - } - - if v.AddSupportedRegions != nil { - objectKey := object.FlatKey("AddSupportedRegion") - if err := awsEc2query_serializeDocumentValueStringList(v.AddSupportedRegions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrivateDnsName != nil { - objectKey := object.Key("PrivateDnsName") - objectKey.String(*v.PrivateDnsName) - } - - if v.RemoveGatewayLoadBalancerArns != nil { - objectKey := object.FlatKey("RemoveGatewayLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.RemoveGatewayLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.RemoveNetworkLoadBalancerArns != nil { - objectKey := object.FlatKey("RemoveNetworkLoadBalancerArn") - if err := awsEc2query_serializeDocumentValueStringList(v.RemoveNetworkLoadBalancerArns, objectKey); err != nil { - return err - } - } - - if v.RemovePrivateDnsName != nil { - objectKey := object.Key("RemovePrivateDnsName") - objectKey.Boolean(*v.RemovePrivateDnsName) - } - - if v.RemoveSupportedIpAddressTypes != nil { - objectKey := object.FlatKey("RemoveSupportedIpAddressType") - if err := awsEc2query_serializeDocumentValueStringList(v.RemoveSupportedIpAddressTypes, objectKey); err != nil { - return err - } - } - - if v.RemoveSupportedRegions != nil { - objectKey := object.FlatKey("RemoveSupportedRegion") - if err := awsEc2query_serializeDocumentValueStringList(v.RemoveSupportedRegions, objectKey); err != nil { - return err - } - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcEndpointServicePayerResponsibilityInput(v *ModifyVpcEndpointServicePayerResponsibilityInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.PayerResponsibility) > 0 { - objectKey := object.Key("PayerResponsibility") - objectKey.String(string(v.PayerResponsibility)) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcEndpointServicePermissionsInput(v *ModifyVpcEndpointServicePermissionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AddAllowedPrincipals != nil { - objectKey := object.FlatKey("AddAllowedPrincipals") - if err := awsEc2query_serializeDocumentValueStringList(v.AddAllowedPrincipals, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RemoveAllowedPrincipals != nil { - objectKey := object.FlatKey("RemoveAllowedPrincipals") - if err := awsEc2query_serializeDocumentValueStringList(v.RemoveAllowedPrincipals, objectKey); err != nil { - return err - } - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcPeeringConnectionOptionsInput(v *ModifyVpcPeeringConnectionOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AccepterPeeringConnectionOptions != nil { - objectKey := object.Key("AccepterPeeringConnectionOptions") - if err := awsEc2query_serializeDocumentPeeringConnectionOptionsRequest(v.AccepterPeeringConnectionOptions, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RequesterPeeringConnectionOptions != nil { - objectKey := object.Key("RequesterPeeringConnectionOptions") - if err := awsEc2query_serializeDocumentPeeringConnectionOptionsRequest(v.RequesterPeeringConnectionOptions, objectKey); err != nil { - return err - } - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpcTenancyInput(v *ModifyVpcTenancyInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InstanceTenancy) > 0 { - objectKey := object.Key("InstanceTenancy") - objectKey.String(string(v.InstanceTenancy)) - } - - if v.VpcId != nil { - objectKey := object.Key("VpcId") - objectKey.String(*v.VpcId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpnConnectionInput(v *ModifyVpnConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CustomerGatewayId != nil { - objectKey := object.Key("CustomerGatewayId") - objectKey.String(*v.CustomerGatewayId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnGatewayId != nil { - objectKey := object.Key("VpnGatewayId") - objectKey.String(*v.VpnGatewayId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpnConnectionOptionsInput(v *ModifyVpnConnectionOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.LocalIpv4NetworkCidr != nil { - objectKey := object.Key("LocalIpv4NetworkCidr") - objectKey.String(*v.LocalIpv4NetworkCidr) - } - - if v.LocalIpv6NetworkCidr != nil { - objectKey := object.Key("LocalIpv6NetworkCidr") - objectKey.String(*v.LocalIpv6NetworkCidr) - } - - if v.RemoteIpv4NetworkCidr != nil { - objectKey := object.Key("RemoteIpv4NetworkCidr") - objectKey.String(*v.RemoteIpv4NetworkCidr) - } - - if v.RemoteIpv6NetworkCidr != nil { - objectKey := object.Key("RemoteIpv6NetworkCidr") - objectKey.String(*v.RemoteIpv6NetworkCidr) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpnTunnelCertificateInput(v *ModifyVpnTunnelCertificateInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnTunnelOutsideIpAddress != nil { - objectKey := object.Key("VpnTunnelOutsideIpAddress") - objectKey.String(*v.VpnTunnelOutsideIpAddress) - } - - return nil -} - -func awsEc2query_serializeOpDocumentModifyVpnTunnelOptionsInput(v *ModifyVpnTunnelOptionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PreSharedKeyStorage != nil { - objectKey := object.Key("PreSharedKeyStorage") - objectKey.String(*v.PreSharedKeyStorage) - } - - if v.SkipTunnelReplacement != nil { - objectKey := object.Key("SkipTunnelReplacement") - objectKey.Boolean(*v.SkipTunnelReplacement) - } - - if v.TunnelOptions != nil { - objectKey := object.Key("TunnelOptions") - if err := awsEc2query_serializeDocumentModifyVpnTunnelOptionsSpecification(v.TunnelOptions, objectKey); err != nil { - return err - } - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnTunnelOutsideIpAddress != nil { - objectKey := object.Key("VpnTunnelOutsideIpAddress") - objectKey.String(*v.VpnTunnelOutsideIpAddress) - } - - return nil -} - -func awsEc2query_serializeOpDocumentMonitorInstancesInput(v *MonitorInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentMoveAddressToVpcInput(v *MoveAddressToVpcInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentMoveByoipCidrToIpamInput(v *MoveByoipCidrToIpamInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.IpamPoolOwner != nil { - objectKey := object.Key("IpamPoolOwner") - objectKey.String(*v.IpamPoolOwner) - } - - return nil -} - -func awsEc2query_serializeOpDocumentMoveCapacityReservationInstancesInput(v *MoveCapacityReservationInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DestinationCapacityReservationId != nil { - objectKey := object.Key("DestinationCapacityReservationId") - objectKey.String(*v.DestinationCapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.SourceCapacityReservationId != nil { - objectKey := object.Key("SourceCapacityReservationId") - objectKey.String(*v.SourceCapacityReservationId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentProvisionByoipCidrInput(v *ProvisionByoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.CidrAuthorizationContext != nil { - objectKey := object.Key("CidrAuthorizationContext") - if err := awsEc2query_serializeDocumentCidrAuthorizationContext(v.CidrAuthorizationContext, objectKey); err != nil { - return err - } - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MultiRegion != nil { - objectKey := object.Key("MultiRegion") - objectKey.Boolean(*v.MultiRegion) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.PoolTagSpecifications != nil { - objectKey := object.FlatKey("PoolTagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.PoolTagSpecifications, objectKey); err != nil { - return err - } - } - - if v.PubliclyAdvertisable != nil { - objectKey := object.Key("PubliclyAdvertisable") - objectKey.Boolean(*v.PubliclyAdvertisable) - } - - return nil -} - -func awsEc2query_serializeOpDocumentProvisionIpamByoasnInput(v *ProvisionIpamByoasnInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Asn != nil { - objectKey := object.Key("Asn") - objectKey.String(*v.Asn) - } - - if v.AsnAuthorizationContext != nil { - objectKey := object.Key("AsnAuthorizationContext") - if err := awsEc2query_serializeDocumentAsnAuthorizationContext(v.AsnAuthorizationContext, objectKey); err != nil { - return err - } - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamId != nil { - objectKey := object.Key("IpamId") - objectKey.String(*v.IpamId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentProvisionIpamPoolCidrInput(v *ProvisionIpamPoolCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.CidrAuthorizationContext != nil { - objectKey := object.Key("CidrAuthorizationContext") - if err := awsEc2query_serializeDocumentIpamCidrAuthorizationContext(v.CidrAuthorizationContext, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamExternalResourceVerificationTokenId != nil { - objectKey := object.Key("IpamExternalResourceVerificationTokenId") - objectKey.String(*v.IpamExternalResourceVerificationTokenId) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.NetmaskLength != nil { - objectKey := object.Key("NetmaskLength") - objectKey.Integer(*v.NetmaskLength) - } - - if len(v.VerificationMethod) > 0 { - objectKey := object.Key("VerificationMethod") - objectKey.String(string(v.VerificationMethod)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentProvisionPublicIpv4PoolCidrInput(v *ProvisionPublicIpv4PoolCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - if v.NetmaskLength != nil { - objectKey := object.Key("NetmaskLength") - objectKey.Integer(*v.NetmaskLength) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.PoolId != nil { - objectKey := object.Key("PoolId") - objectKey.String(*v.PoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentPurchaseCapacityBlockExtensionInput(v *PurchaseCapacityBlockExtensionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityBlockExtensionOfferingId != nil { - objectKey := object.Key("CapacityBlockExtensionOfferingId") - objectKey.String(*v.CapacityBlockExtensionOfferingId) - } - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentPurchaseCapacityBlockInput(v *PurchaseCapacityBlockInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityBlockOfferingId != nil { - objectKey := object.Key("CapacityBlockOfferingId") - objectKey.String(*v.CapacityBlockOfferingId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if len(v.InstancePlatform) > 0 { - objectKey := object.Key("InstancePlatform") - objectKey.String(string(v.InstancePlatform)) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentPurchaseHostReservationInput(v *PurchaseHostReservationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if len(v.CurrencyCode) > 0 { - objectKey := object.Key("CurrencyCode") - objectKey.String(string(v.CurrencyCode)) - } - - if v.HostIdSet != nil { - objectKey := object.FlatKey("HostIdSet") - if err := awsEc2query_serializeDocumentRequestHostIdSet(v.HostIdSet, objectKey); err != nil { - return err - } - } - - if v.LimitPrice != nil { - objectKey := object.Key("LimitPrice") - objectKey.String(*v.LimitPrice) - } - - if v.OfferingId != nil { - objectKey := object.Key("OfferingId") - objectKey.String(*v.OfferingId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentPurchaseReservedInstancesOfferingInput(v *PurchaseReservedInstancesOfferingInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.LimitPrice != nil { - objectKey := object.Key("LimitPrice") - if err := awsEc2query_serializeDocumentReservedInstanceLimitPrice(v.LimitPrice, objectKey); err != nil { - return err - } - } - - if v.PurchaseTime != nil { - objectKey := object.Key("PurchaseTime") - objectKey.String(smithytime.FormatDateTime(*v.PurchaseTime)) - } - - if v.ReservedInstancesOfferingId != nil { - objectKey := object.Key("ReservedInstancesOfferingId") - objectKey.String(*v.ReservedInstancesOfferingId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentPurchaseScheduledInstancesInput(v *PurchaseScheduledInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PurchaseRequests != nil { - objectKey := object.FlatKey("PurchaseRequest") - if err := awsEc2query_serializeDocumentPurchaseRequestSet(v.PurchaseRequests, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentRebootInstancesInput(v *RebootInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentRegisterImageInput(v *RegisterImageInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Architecture) > 0 { - objectKey := object.Key("Architecture") - objectKey.String(string(v.Architecture)) - } - - if v.BillingProducts != nil { - objectKey := object.FlatKey("BillingProduct") - if err := awsEc2query_serializeDocumentBillingProductList(v.BillingProducts, objectKey); err != nil { - return err - } - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentBlockDeviceMappingRequestList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if len(v.BootMode) > 0 { - objectKey := object.Key("BootMode") - objectKey.String(string(v.BootMode)) - } - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EnaSupport != nil { - objectKey := object.Key("EnaSupport") - objectKey.Boolean(*v.EnaSupport) - } - - if v.ImageLocation != nil { - objectKey := object.Key("ImageLocation") - objectKey.String(*v.ImageLocation) - } - - if len(v.ImdsSupport) > 0 { - objectKey := object.Key("ImdsSupport") - objectKey.String(string(v.ImdsSupport)) - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.RamdiskId != nil { - objectKey := object.Key("RamdiskId") - objectKey.String(*v.RamdiskId) - } - - if v.RootDeviceName != nil { - objectKey := object.Key("RootDeviceName") - objectKey.String(*v.RootDeviceName) - } - - if v.SriovNetSupport != nil { - objectKey := object.Key("SriovNetSupport") - objectKey.String(*v.SriovNetSupport) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.TpmSupport) > 0 { - objectKey := object.Key("TpmSupport") - objectKey.String(string(v.TpmSupport)) - } - - if v.UefiData != nil { - objectKey := object.Key("UefiData") - objectKey.String(*v.UefiData) - } - - if v.VirtualizationType != nil { - objectKey := object.Key("VirtualizationType") - objectKey.String(*v.VirtualizationType) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRegisterInstanceEventNotificationAttributesInput(v *RegisterInstanceEventNotificationAttributesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceTagAttribute != nil { - objectKey := object.Key("InstanceTagAttribute") - if err := awsEc2query_serializeDocumentRegisterInstanceTagAttributeRequest(v.InstanceTagAttribute, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentRegisterTransitGatewayMulticastGroupMembersInput(v *RegisterTransitGatewayMulticastGroupMembersInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupIpAddress != nil { - objectKey := object.Key("GroupIpAddress") - objectKey.String(*v.GroupIpAddress) - } - - if v.NetworkInterfaceIds != nil { - objectKey := object.FlatKey("NetworkInterfaceIds") - if err := awsEc2query_serializeDocumentTransitGatewayNetworkInterfaceIdList(v.NetworkInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesInput(v *RegisterTransitGatewayMulticastGroupSourcesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupIpAddress != nil { - objectKey := object.Key("GroupIpAddress") - objectKey.String(*v.GroupIpAddress) - } - - if v.NetworkInterfaceIds != nil { - objectKey := object.FlatKey("NetworkInterfaceIds") - if err := awsEc2query_serializeDocumentTransitGatewayNetworkInterfaceIdList(v.NetworkInterfaceIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectCapacityReservationBillingOwnershipInput(v *RejectCapacityReservationBillingOwnershipInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CapacityReservationId != nil { - objectKey := object.Key("CapacityReservationId") - objectKey.String(*v.CapacityReservationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsInput(v *RejectTransitGatewayMulticastDomainAssociationsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SubnetIds != nil { - objectKey := object.FlatKey("SubnetIds") - if err := awsEc2query_serializeDocumentValueStringList(v.SubnetIds, objectKey); err != nil { - return err - } - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectTransitGatewayPeeringAttachmentInput(v *RejectTransitGatewayPeeringAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectTransitGatewayVpcAttachmentInput(v *RejectTransitGatewayVpcAttachmentInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectVpcEndpointConnectionsInput(v *RejectVpcEndpointConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - if v.VpcEndpointIds != nil { - objectKey := object.FlatKey("VpcEndpointId") - if err := awsEc2query_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentRejectVpcPeeringConnectionInput(v *RejectVpcPeeringConnectionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReleaseAddressInput(v *ReleaseAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkBorderGroup != nil { - objectKey := object.Key("NetworkBorderGroup") - objectKey.String(*v.NetworkBorderGroup) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReleaseHostsInput(v *ReleaseHostsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.HostIds != nil { - objectKey := object.FlatKey("HostId") - if err := awsEc2query_serializeDocumentRequestHostIdList(v.HostIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentReleaseIpamPoolAllocationInput(v *ReleaseIpamPoolAllocationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.IpamPoolAllocationId != nil { - objectKey := object.Key("IpamPoolAllocationId") - objectKey.String(*v.IpamPoolAllocationId) - } - - if v.IpamPoolId != nil { - objectKey := object.Key("IpamPoolId") - objectKey.String(*v.IpamPoolId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceIamInstanceProfileAssociationInput(v *ReplaceIamInstanceProfileAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentIamInstanceProfileSpecification(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceImageCriteriaInAllowedImagesSettingsInput(v *ReplaceImageCriteriaInAllowedImagesSettingsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageCriteria != nil { - objectKey := object.FlatKey("ImageCriterion") - if err := awsEc2query_serializeDocumentImageCriterionRequestList(v.ImageCriteria, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceNetworkAclAssociationInput(v *ReplaceNetworkAclAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkAclId != nil { - objectKey := object.Key("NetworkAclId") - objectKey.String(*v.NetworkAclId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceNetworkAclEntryInput(v *ReplaceNetworkAclEntryInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrBlock != nil { - objectKey := object.Key("CidrBlock") - objectKey.String(*v.CidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Egress != nil { - objectKey := object.Key("Egress") - objectKey.Boolean(*v.Egress) - } - - if v.IcmpTypeCode != nil { - objectKey := object.Key("Icmp") - if err := awsEc2query_serializeDocumentIcmpTypeCode(v.IcmpTypeCode, objectKey); err != nil { - return err - } - } - - if v.Ipv6CidrBlock != nil { - objectKey := object.Key("Ipv6CidrBlock") - objectKey.String(*v.Ipv6CidrBlock) - } - - if v.NetworkAclId != nil { - objectKey := object.Key("NetworkAclId") - objectKey.String(*v.NetworkAclId) - } - - if v.PortRange != nil { - objectKey := object.Key("PortRange") - if err := awsEc2query_serializeDocumentPortRange(v.PortRange, objectKey); err != nil { - return err - } - } - - if v.Protocol != nil { - objectKey := object.Key("Protocol") - objectKey.String(*v.Protocol) - } - - if len(v.RuleAction) > 0 { - objectKey := object.Key("RuleAction") - objectKey.String(string(v.RuleAction)) - } - - if v.RuleNumber != nil { - objectKey := object.Key("RuleNumber") - objectKey.Integer(*v.RuleNumber) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceRouteInput(v *ReplaceRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CarrierGatewayId != nil { - objectKey := object.Key("CarrierGatewayId") - objectKey.String(*v.CarrierGatewayId) - } - - if v.CoreNetworkArn != nil { - objectKey := object.Key("CoreNetworkArn") - objectKey.String(*v.CoreNetworkArn) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DestinationIpv6CidrBlock != nil { - objectKey := object.Key("DestinationIpv6CidrBlock") - objectKey.String(*v.DestinationIpv6CidrBlock) - } - - if v.DestinationPrefixListId != nil { - objectKey := object.Key("DestinationPrefixListId") - objectKey.String(*v.DestinationPrefixListId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EgressOnlyInternetGatewayId != nil { - objectKey := object.Key("EgressOnlyInternetGatewayId") - objectKey.String(*v.EgressOnlyInternetGatewayId) - } - - if v.GatewayId != nil { - objectKey := object.Key("GatewayId") - objectKey.String(*v.GatewayId) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - if v.LocalGatewayId != nil { - objectKey := object.Key("LocalGatewayId") - objectKey.String(*v.LocalGatewayId) - } - - if v.LocalTarget != nil { - objectKey := object.Key("LocalTarget") - objectKey.Boolean(*v.LocalTarget) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.OdbNetworkArn != nil { - objectKey := object.Key("OdbNetworkArn") - objectKey.String(*v.OdbNetworkArn) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - if v.TransitGatewayId != nil { - objectKey := object.Key("TransitGatewayId") - objectKey.String(*v.TransitGatewayId) - } - - if v.VpcEndpointId != nil { - objectKey := object.Key("VpcEndpointId") - objectKey.String(*v.VpcEndpointId) - } - - if v.VpcPeeringConnectionId != nil { - objectKey := object.Key("VpcPeeringConnectionId") - objectKey.String(*v.VpcPeeringConnectionId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceRouteTableAssociationInput(v *ReplaceRouteTableAssociationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AssociationId != nil { - objectKey := object.Key("AssociationId") - objectKey.String(*v.AssociationId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RouteTableId != nil { - objectKey := object.Key("RouteTableId") - objectKey.String(*v.RouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceTransitGatewayRouteInput(v *ReplaceTransitGatewayRouteInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Blackhole != nil { - objectKey := object.Key("Blackhole") - objectKey.Boolean(*v.Blackhole) - } - - if v.DestinationCidrBlock != nil { - objectKey := object.Key("DestinationCidrBlock") - objectKey.String(*v.DestinationCidrBlock) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.TransitGatewayAttachmentId != nil { - objectKey := object.Key("TransitGatewayAttachmentId") - objectKey.String(*v.TransitGatewayAttachmentId) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReplaceVpnTunnelInput(v *ReplaceVpnTunnelInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ApplyPendingMaintenance != nil { - objectKey := object.Key("ApplyPendingMaintenance") - objectKey.Boolean(*v.ApplyPendingMaintenance) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.VpnConnectionId != nil { - objectKey := object.Key("VpnConnectionId") - objectKey.String(*v.VpnConnectionId) - } - - if v.VpnTunnelOutsideIpAddress != nil { - objectKey := object.Key("VpnTunnelOutsideIpAddress") - objectKey.String(*v.VpnTunnelOutsideIpAddress) - } - - return nil -} - -func awsEc2query_serializeOpDocumentReportInstanceStatusInput(v *ReportInstanceStatusInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Description != nil { - objectKey := object.Key("Description") - objectKey.String(*v.Description) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EndTime != nil { - objectKey := object.Key("EndTime") - objectKey.String(smithytime.FormatDateTime(*v.EndTime)) - } - - if v.Instances != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.Instances, objectKey); err != nil { - return err - } - } - - if v.ReasonCodes != nil { - objectKey := object.FlatKey("ReasonCode") - if err := awsEc2query_serializeDocumentReasonCodesList(v.ReasonCodes, objectKey); err != nil { - return err - } - } - - if v.StartTime != nil { - objectKey := object.Key("StartTime") - objectKey.String(smithytime.FormatDateTime(*v.StartTime)) - } - - if len(v.Status) > 0 { - objectKey := object.Key("Status") - objectKey.String(string(v.Status)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRequestSpotFleetInput(v *RequestSpotFleetInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SpotFleetRequestConfig != nil { - objectKey := object.Key("SpotFleetRequestConfig") - if err := awsEc2query_serializeDocumentSpotFleetRequestConfigData(v.SpotFleetRequestConfig, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentRequestSpotInstancesInput(v *RequestSpotInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AvailabilityZoneGroup != nil { - objectKey := object.Key("AvailabilityZoneGroup") - objectKey.String(*v.AvailabilityZoneGroup) - } - - if v.BlockDurationMinutes != nil { - objectKey := object.Key("BlockDurationMinutes") - objectKey.Integer(*v.BlockDurationMinutes) - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if len(v.InstanceInterruptionBehavior) > 0 { - objectKey := object.Key("InstanceInterruptionBehavior") - objectKey.String(string(v.InstanceInterruptionBehavior)) - } - - if v.LaunchGroup != nil { - objectKey := object.Key("LaunchGroup") - objectKey.String(*v.LaunchGroup) - } - - if v.LaunchSpecification != nil { - objectKey := object.Key("LaunchSpecification") - if err := awsEc2query_serializeDocumentRequestSpotLaunchSpecification(v.LaunchSpecification, objectKey); err != nil { - return err - } - } - - if v.SpotPrice != nil { - objectKey := object.Key("SpotPrice") - objectKey.String(*v.SpotPrice) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if len(v.Type) > 0 { - objectKey := object.Key("Type") - objectKey.String(string(v.Type)) - } - - if v.ValidFrom != nil { - objectKey := object.Key("ValidFrom") - objectKey.String(smithytime.FormatDateTime(*v.ValidFrom)) - } - - if v.ValidUntil != nil { - objectKey := object.Key("ValidUntil") - objectKey.String(smithytime.FormatDateTime(*v.ValidUntil)) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetAddressAttributeInput(v *ResetAddressAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AllocationId != nil { - objectKey := object.Key("AllocationId") - objectKey.String(*v.AllocationId) - } - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetEbsDefaultKmsKeyIdInput(v *ResetEbsDefaultKmsKeyIdInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetFpgaImageAttributeInput(v *ResetFpgaImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FpgaImageId != nil { - objectKey := object.Key("FpgaImageId") - objectKey.String(*v.FpgaImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetImageAttributeInput(v *ResetImageAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetInstanceAttributeInput(v *ResetInstanceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetNetworkInterfaceAttributeInput(v *ResetNetworkInterfaceAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.SourceDestCheck != nil { - objectKey := object.Key("SourceDestCheck") - objectKey.String(*v.SourceDestCheck) - } - - return nil -} - -func awsEc2query_serializeOpDocumentResetSnapshotAttributeInput(v *ResetSnapshotAttributeInput, value query.Value) error { - object := value.Object() - _ = object - - if len(v.Attribute) > 0 { - objectKey := object.Key("Attribute") - objectKey.String(string(v.Attribute)) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRestoreAddressToClassicInput(v *RestoreAddressToClassicInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PublicIp != nil { - objectKey := object.Key("PublicIp") - objectKey.String(*v.PublicIp) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRestoreImageFromRecycleBinInput(v *RestoreImageFromRecycleBinInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRestoreManagedPrefixListVersionInput(v *RestoreManagedPrefixListVersionInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CurrentVersion != nil { - objectKey := object.Key("CurrentVersion") - objectKey.Long(*v.CurrentVersion) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PrefixListId != nil { - objectKey := object.Key("PrefixListId") - objectKey.String(*v.PrefixListId) - } - - if v.PreviousVersion != nil { - objectKey := object.Key("PreviousVersion") - objectKey.Long(*v.PreviousVersion) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRestoreSnapshotFromRecycleBinInput(v *RestoreSnapshotFromRecycleBinInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRestoreSnapshotTierInput(v *RestoreSnapshotTierInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.PermanentRestore != nil { - objectKey := object.Key("PermanentRestore") - objectKey.Boolean(*v.PermanentRestore) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - if v.TemporaryRestoreDays != nil { - objectKey := object.Key("TemporaryRestoreDays") - objectKey.Integer(*v.TemporaryRestoreDays) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRevokeClientVpnIngressInput(v *RevokeClientVpnIngressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AccessGroupId != nil { - objectKey := object.Key("AccessGroupId") - objectKey.String(*v.AccessGroupId) - } - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.RevokeAllGroups != nil { - objectKey := object.Key("RevokeAllGroups") - objectKey.Boolean(*v.RevokeAllGroups) - } - - if v.TargetNetworkCidr != nil { - objectKey := object.Key("TargetNetworkCidr") - objectKey.String(*v.TargetNetworkCidr) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRevokeSecurityGroupEgressInput(v *RevokeSecurityGroupEgressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIp != nil { - objectKey := object.Key("CidrIp") - objectKey.String(*v.CidrIp) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.SecurityGroupRuleIds != nil { - objectKey := object.FlatKey("SecurityGroupRuleId") - if err := awsEc2query_serializeDocumentSecurityGroupRuleIdList(v.SecurityGroupRuleIds, objectKey); err != nil { - return err - } - } - - if v.SourceSecurityGroupName != nil { - objectKey := object.Key("SourceSecurityGroupName") - objectKey.String(*v.SourceSecurityGroupName) - } - - if v.SourceSecurityGroupOwnerId != nil { - objectKey := object.Key("SourceSecurityGroupOwnerId") - objectKey.String(*v.SourceSecurityGroupOwnerId) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRevokeSecurityGroupIngressInput(v *RevokeSecurityGroupIngressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.CidrIp != nil { - objectKey := object.Key("CidrIp") - objectKey.String(*v.CidrIp) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FromPort != nil { - objectKey := object.Key("FromPort") - objectKey.Integer(*v.FromPort) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.IpProtocol != nil { - objectKey := object.Key("IpProtocol") - objectKey.String(*v.IpProtocol) - } - - if v.SecurityGroupRuleIds != nil { - objectKey := object.FlatKey("SecurityGroupRuleId") - if err := awsEc2query_serializeDocumentSecurityGroupRuleIdList(v.SecurityGroupRuleIds, objectKey); err != nil { - return err - } - } - - if v.SourceSecurityGroupName != nil { - objectKey := object.Key("SourceSecurityGroupName") - objectKey.String(*v.SourceSecurityGroupName) - } - - if v.SourceSecurityGroupOwnerId != nil { - objectKey := object.Key("SourceSecurityGroupOwnerId") - objectKey.String(*v.SourceSecurityGroupOwnerId) - } - - if v.ToPort != nil { - objectKey := object.Key("ToPort") - objectKey.Integer(*v.ToPort) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRunInstancesInput(v *RunInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AdditionalInfo != nil { - objectKey := object.Key("AdditionalInfo") - objectKey.String(*v.AdditionalInfo) - } - - if v.BlockDeviceMappings != nil { - objectKey := object.FlatKey("BlockDeviceMapping") - if err := awsEc2query_serializeDocumentBlockDeviceMappingRequestList(v.BlockDeviceMappings, objectKey); err != nil { - return err - } - } - - if v.CapacityReservationSpecification != nil { - objectKey := object.Key("CapacityReservationSpecification") - if err := awsEc2query_serializeDocumentCapacityReservationSpecification(v.CapacityReservationSpecification, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.CpuOptions != nil { - objectKey := object.Key("CpuOptions") - if err := awsEc2query_serializeDocumentCpuOptionsRequest(v.CpuOptions, objectKey); err != nil { - return err - } - } - - if v.CreditSpecification != nil { - objectKey := object.Key("CreditSpecification") - if err := awsEc2query_serializeDocumentCreditSpecificationRequest(v.CreditSpecification, objectKey); err != nil { - return err - } - } - - if v.DisableApiStop != nil { - objectKey := object.Key("DisableApiStop") - objectKey.Boolean(*v.DisableApiStop) - } - - if v.DisableApiTermination != nil { - objectKey := object.Key("DisableApiTermination") - objectKey.Boolean(*v.DisableApiTermination) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.EbsOptimized != nil { - objectKey := object.Key("EbsOptimized") - objectKey.Boolean(*v.EbsOptimized) - } - - if v.ElasticGpuSpecification != nil { - objectKey := object.FlatKey("ElasticGpuSpecification") - if err := awsEc2query_serializeDocumentElasticGpuSpecifications(v.ElasticGpuSpecification, objectKey); err != nil { - return err - } - } - - if v.ElasticInferenceAccelerators != nil { - objectKey := object.FlatKey("ElasticInferenceAccelerator") - if err := awsEc2query_serializeDocumentElasticInferenceAccelerators(v.ElasticInferenceAccelerators, objectKey); err != nil { - return err - } - } - - if v.EnablePrimaryIpv6 != nil { - objectKey := object.Key("EnablePrimaryIpv6") - objectKey.Boolean(*v.EnablePrimaryIpv6) - } - - if v.EnclaveOptions != nil { - objectKey := object.Key("EnclaveOptions") - if err := awsEc2query_serializeDocumentEnclaveOptionsRequest(v.EnclaveOptions, objectKey); err != nil { - return err - } - } - - if v.HibernationOptions != nil { - objectKey := object.Key("HibernationOptions") - if err := awsEc2query_serializeDocumentHibernationOptionsRequest(v.HibernationOptions, objectKey); err != nil { - return err - } - } - - if v.IamInstanceProfile != nil { - objectKey := object.Key("IamInstanceProfile") - if err := awsEc2query_serializeDocumentIamInstanceProfileSpecification(v.IamInstanceProfile, objectKey); err != nil { - return err - } - } - - if v.ImageId != nil { - objectKey := object.Key("ImageId") - objectKey.String(*v.ImageId) - } - - if len(v.InstanceInitiatedShutdownBehavior) > 0 { - objectKey := object.Key("InstanceInitiatedShutdownBehavior") - objectKey.String(string(v.InstanceInitiatedShutdownBehavior)) - } - - if v.InstanceMarketOptions != nil { - objectKey := object.Key("InstanceMarketOptions") - if err := awsEc2query_serializeDocumentInstanceMarketOptionsRequest(v.InstanceMarketOptions, objectKey); err != nil { - return err - } - } - - if len(v.InstanceType) > 0 { - objectKey := object.Key("InstanceType") - objectKey.String(string(v.InstanceType)) - } - - if v.Ipv6AddressCount != nil { - objectKey := object.Key("Ipv6AddressCount") - objectKey.Integer(*v.Ipv6AddressCount) - } - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Address") - if err := awsEc2query_serializeDocumentInstanceIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.KernelId != nil { - objectKey := object.Key("KernelId") - objectKey.String(*v.KernelId) - } - - if v.KeyName != nil { - objectKey := object.Key("KeyName") - objectKey.String(*v.KeyName) - } - - if v.LaunchTemplate != nil { - objectKey := object.Key("LaunchTemplate") - if err := awsEc2query_serializeDocumentLaunchTemplateSpecification(v.LaunchTemplate, objectKey); err != nil { - return err - } - } - - if v.LicenseSpecifications != nil { - objectKey := object.FlatKey("LicenseSpecification") - if err := awsEc2query_serializeDocumentLicenseSpecificationListRequest(v.LicenseSpecifications, objectKey); err != nil { - return err - } - } - - if v.MaintenanceOptions != nil { - objectKey := object.Key("MaintenanceOptions") - if err := awsEc2query_serializeDocumentInstanceMaintenanceOptionsRequest(v.MaintenanceOptions, objectKey); err != nil { - return err - } - } - - if v.MaxCount != nil { - objectKey := object.Key("MaxCount") - objectKey.Integer(*v.MaxCount) - } - - if v.MetadataOptions != nil { - objectKey := object.Key("MetadataOptions") - if err := awsEc2query_serializeDocumentInstanceMetadataOptionsRequest(v.MetadataOptions, objectKey); err != nil { - return err - } - } - - if v.MinCount != nil { - objectKey := object.Key("MinCount") - objectKey.Integer(*v.MinCount) - } - - if v.Monitoring != nil { - objectKey := object.Key("Monitoring") - if err := awsEc2query_serializeDocumentRunInstancesMonitoringEnabled(v.Monitoring, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaces != nil { - objectKey := object.FlatKey("NetworkInterface") - if err := awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecificationList(v.NetworkInterfaces, objectKey); err != nil { - return err - } - } - - if v.NetworkPerformanceOptions != nil { - objectKey := object.Key("NetworkPerformanceOptions") - if err := awsEc2query_serializeDocumentInstanceNetworkPerformanceOptionsRequest(v.NetworkPerformanceOptions, objectKey); err != nil { - return err - } - } - - if v.Operator != nil { - objectKey := object.Key("Operator") - if err := awsEc2query_serializeDocumentOperatorRequest(v.Operator, objectKey); err != nil { - return err - } - } - - if v.Placement != nil { - objectKey := object.Key("Placement") - if err := awsEc2query_serializeDocumentPlacement(v.Placement, objectKey); err != nil { - return err - } - } - - if v.PrivateDnsNameOptions != nil { - objectKey := object.Key("PrivateDnsNameOptions") - if err := awsEc2query_serializeDocumentPrivateDnsNameOptionsRequest(v.PrivateDnsNameOptions, objectKey); err != nil { - return err - } - } - - if v.PrivateIpAddress != nil { - objectKey := object.Key("PrivateIpAddress") - objectKey.String(*v.PrivateIpAddress) - } - - if v.RamdiskId != nil { - objectKey := object.Key("RamdiskId") - objectKey.String(*v.RamdiskId) - } - - if v.SecurityGroupIds != nil { - objectKey := object.FlatKey("SecurityGroupId") - if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.SecurityGroupIds, objectKey); err != nil { - return err - } - } - - if v.SecurityGroups != nil { - objectKey := object.FlatKey("SecurityGroup") - if err := awsEc2query_serializeDocumentSecurityGroupStringList(v.SecurityGroups, objectKey); err != nil { - return err - } - } - - if v.SubnetId != nil { - objectKey := object.Key("SubnetId") - objectKey.String(*v.SubnetId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.UserData != nil { - objectKey := object.Key("UserData") - objectKey.String(*v.UserData) - } - - return nil -} - -func awsEc2query_serializeOpDocumentRunScheduledInstancesInput(v *RunScheduledInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceCount != nil { - objectKey := object.Key("InstanceCount") - objectKey.Integer(*v.InstanceCount) - } - - if v.LaunchSpecification != nil { - objectKey := object.Key("LaunchSpecification") - if err := awsEc2query_serializeDocumentScheduledInstancesLaunchSpecification(v.LaunchSpecification, objectKey); err != nil { - return err - } - } - - if v.ScheduledInstanceId != nil { - objectKey := object.Key("ScheduledInstanceId") - objectKey.String(*v.ScheduledInstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentSearchLocalGatewayRoutesInput(v *SearchLocalGatewayRoutesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.LocalGatewayRouteTableId != nil { - objectKey := object.Key("LocalGatewayRouteTableId") - objectKey.String(*v.LocalGatewayRouteTableId) - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - return nil -} - -func awsEc2query_serializeOpDocumentSearchTransitGatewayMulticastGroupsInput(v *SearchTransitGatewayMulticastGroupsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) - } - - if v.TransitGatewayMulticastDomainId != nil { - objectKey := object.Key("TransitGatewayMulticastDomainId") - objectKey.String(*v.TransitGatewayMulticastDomainId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentSearchTransitGatewayRoutesInput(v *SearchTransitGatewayRoutesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Filters != nil { - objectKey := object.FlatKey("Filter") - if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { - return err - } - } - - if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) - } - - if v.TransitGatewayRouteTableId != nil { - objectKey := object.Key("TransitGatewayRouteTableId") - objectKey.String(*v.TransitGatewayRouteTableId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentSendDiagnosticInterruptInput(v *SendDiagnosticInterruptInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceId != nil { - objectKey := object.Key("InstanceId") - objectKey.String(*v.InstanceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentStartDeclarativePoliciesReportInput(v *StartDeclarativePoliciesReportInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.S3Bucket != nil { - objectKey := object.Key("S3Bucket") - objectKey.String(*v.S3Bucket) - } - - if v.S3Prefix != nil { - objectKey := object.Key("S3Prefix") - objectKey.String(*v.S3Prefix) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - if v.TargetId != nil { - objectKey := object.Key("TargetId") - objectKey.String(*v.TargetId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentStartInstancesInput(v *StartInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AdditionalInfo != nil { - objectKey := object.Key("AdditionalInfo") - objectKey.String(*v.AdditionalInfo) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentStartNetworkInsightsAccessScopeAnalysisInput(v *StartNetworkInsightsAccessScopeAnalysisInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.NetworkInsightsAccessScopeId != nil { - objectKey := object.Key("NetworkInsightsAccessScopeId") - objectKey.String(*v.NetworkInsightsAccessScopeId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentStartNetworkInsightsAnalysisInput(v *StartNetworkInsightsAnalysisInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AdditionalAccounts != nil { - objectKey := object.FlatKey("AdditionalAccount") - if err := awsEc2query_serializeDocumentValueStringList(v.AdditionalAccounts, objectKey); err != nil { - return err - } - } - - if v.ClientToken != nil { - objectKey := object.Key("ClientToken") - objectKey.String(*v.ClientToken) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.FilterInArns != nil { - objectKey := object.FlatKey("FilterInArn") - if err := awsEc2query_serializeDocumentArnList(v.FilterInArns, objectKey); err != nil { - return err - } - } - - if v.FilterOutArns != nil { - objectKey := object.FlatKey("FilterOutArn") - if err := awsEc2query_serializeDocumentArnList(v.FilterOutArns, objectKey); err != nil { - return err - } - } - - if v.NetworkInsightsPathId != nil { - objectKey := object.Key("NetworkInsightsPathId") - objectKey.String(*v.NetworkInsightsPathId) - } - - if v.TagSpecifications != nil { - objectKey := object.FlatKey("TagSpecification") - if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationInput(v *StartVpcEndpointServicePrivateDnsVerificationInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.ServiceId != nil { - objectKey := object.Key("ServiceId") - objectKey.String(*v.ServiceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentStopInstancesInput(v *StopInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Force != nil { - objectKey := object.Key("Force") - objectKey.Boolean(*v.Force) - } - - if v.Hibernate != nil { - objectKey := object.Key("Hibernate") - objectKey.Boolean(*v.Hibernate) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentTerminateClientVpnConnectionsInput(v *TerminateClientVpnConnectionsInput, value query.Value) error { - object := value.Object() - _ = object - - if v.ClientVpnEndpointId != nil { - objectKey := object.Key("ClientVpnEndpointId") - objectKey.String(*v.ClientVpnEndpointId) - } - - if v.ConnectionId != nil { - objectKey := object.Key("ConnectionId") - objectKey.String(*v.ConnectionId) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.Username != nil { - objectKey := object.Key("Username") - objectKey.String(*v.Username) - } - - return nil -} - -func awsEc2query_serializeOpDocumentTerminateInstancesInput(v *TerminateInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentUnassignIpv6AddressesInput(v *UnassignIpv6AddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv6Addresses != nil { - objectKey := object.FlatKey("Ipv6Addresses") - if err := awsEc2query_serializeDocumentIpv6AddressList(v.Ipv6Addresses, objectKey); err != nil { - return err - } - } - - if v.Ipv6Prefixes != nil { - objectKey := object.FlatKey("Ipv6Prefix") - if err := awsEc2query_serializeDocumentIpPrefixList(v.Ipv6Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentUnassignPrivateIpAddressesInput(v *UnassignPrivateIpAddressesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Ipv4Prefixes != nil { - objectKey := object.FlatKey("Ipv4Prefix") - if err := awsEc2query_serializeDocumentIpPrefixList(v.Ipv4Prefixes, objectKey); err != nil { - return err - } - } - - if v.NetworkInterfaceId != nil { - objectKey := object.Key("NetworkInterfaceId") - objectKey.String(*v.NetworkInterfaceId) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddress") - if err := awsEc2query_serializeDocumentPrivateIpAddressStringList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentUnassignPrivateNatGatewayAddressInput(v *UnassignPrivateNatGatewayAddressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.MaxDrainDurationSeconds != nil { - objectKey := object.Key("MaxDrainDurationSeconds") - objectKey.Integer(*v.MaxDrainDurationSeconds) - } - - if v.NatGatewayId != nil { - objectKey := object.Key("NatGatewayId") - objectKey.String(*v.NatGatewayId) - } - - if v.PrivateIpAddresses != nil { - objectKey := object.FlatKey("PrivateIpAddress") - if err := awsEc2query_serializeDocumentIpList(v.PrivateIpAddresses, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentUnlockSnapshotInput(v *UnlockSnapshotInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.SnapshotId != nil { - objectKey := object.Key("SnapshotId") - objectKey.String(*v.SnapshotId) - } - - return nil -} - -func awsEc2query_serializeOpDocumentUnmonitorInstancesInput(v *UnmonitorInstancesInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.InstanceIds != nil { - objectKey := object.FlatKey("InstanceId") - if err := awsEc2query_serializeDocumentInstanceIdStringList(v.InstanceIds, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressInput(v *UpdateSecurityGroupRuleDescriptionsEgressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.SecurityGroupRuleDescriptions != nil { - objectKey := object.FlatKey("SecurityGroupRuleDescription") - if err := awsEc2query_serializeDocumentSecurityGroupRuleDescriptionList(v.SecurityGroupRuleDescriptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressInput(v *UpdateSecurityGroupRuleDescriptionsIngressInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - if v.GroupId != nil { - objectKey := object.Key("GroupId") - objectKey.String(*v.GroupId) - } - - if v.GroupName != nil { - objectKey := object.Key("GroupName") - objectKey.String(*v.GroupName) - } - - if v.IpPermissions != nil { - objectKey := object.FlatKey("IpPermissions") - if err := awsEc2query_serializeDocumentIpPermissionList(v.IpPermissions, objectKey); err != nil { - return err - } - } - - if v.SecurityGroupRuleDescriptions != nil { - objectKey := object.FlatKey("SecurityGroupRuleDescription") - if err := awsEc2query_serializeDocumentSecurityGroupRuleDescriptionList(v.SecurityGroupRuleDescriptions, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsEc2query_serializeOpDocumentWithdrawByoipCidrInput(v *WithdrawByoipCidrInput, value query.Value) error { - object := value.Object() - _ = object - - if v.Cidr != nil { - objectKey := object.Key("Cidr") - objectKey.String(*v.Cidr) - } - - if v.DryRun != nil { - objectKey := object.Key("DryRun") - objectKey.Boolean(*v.DryRun) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/enums.go deleted file mode 100644 index 9a4ddf9ad..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/enums.go +++ /dev/null @@ -1,10741 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type AcceleratorManufacturer string - -// Enum values for AcceleratorManufacturer -const ( - AcceleratorManufacturerAmazonWebServices AcceleratorManufacturer = "amazon-web-services" - AcceleratorManufacturerAmd AcceleratorManufacturer = "amd" - AcceleratorManufacturerNvidia AcceleratorManufacturer = "nvidia" - AcceleratorManufacturerXilinx AcceleratorManufacturer = "xilinx" - AcceleratorManufacturerHabana AcceleratorManufacturer = "habana" -) - -// Values returns all known values for AcceleratorManufacturer. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AcceleratorManufacturer) Values() []AcceleratorManufacturer { - return []AcceleratorManufacturer{ - "amazon-web-services", - "amd", - "nvidia", - "xilinx", - "habana", - } -} - -type AcceleratorName string - -// Enum values for AcceleratorName -const ( - AcceleratorNameA100 AcceleratorName = "a100" - AcceleratorNameInferentia AcceleratorName = "inferentia" - AcceleratorNameK520 AcceleratorName = "k520" - AcceleratorNameK80 AcceleratorName = "k80" - AcceleratorNameM60 AcceleratorName = "m60" - AcceleratorNameRadeonProV520 AcceleratorName = "radeon-pro-v520" - AcceleratorNameT4 AcceleratorName = "t4" - AcceleratorNameVu9p AcceleratorName = "vu9p" - AcceleratorNameV100 AcceleratorName = "v100" - AcceleratorNameA10g AcceleratorName = "a10g" - AcceleratorNameH100 AcceleratorName = "h100" - AcceleratorNameT4g AcceleratorName = "t4g" -) - -// Values returns all known values for AcceleratorName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AcceleratorName) Values() []AcceleratorName { - return []AcceleratorName{ - "a100", - "inferentia", - "k520", - "k80", - "m60", - "radeon-pro-v520", - "t4", - "vu9p", - "v100", - "a10g", - "h100", - "t4g", - } -} - -type AcceleratorType string - -// Enum values for AcceleratorType -const ( - AcceleratorTypeGpu AcceleratorType = "gpu" - AcceleratorTypeFpga AcceleratorType = "fpga" - AcceleratorTypeInference AcceleratorType = "inference" -) - -// Values returns all known values for AcceleratorType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AcceleratorType) Values() []AcceleratorType { - return []AcceleratorType{ - "gpu", - "fpga", - "inference", - } -} - -type AccountAttributeName string - -// Enum values for AccountAttributeName -const ( - AccountAttributeNameSupportedPlatforms AccountAttributeName = "supported-platforms" - AccountAttributeNameDefaultVpc AccountAttributeName = "default-vpc" -) - -// Values returns all known values for AccountAttributeName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccountAttributeName) Values() []AccountAttributeName { - return []AccountAttributeName{ - "supported-platforms", - "default-vpc", - } -} - -type ActivityStatus string - -// Enum values for ActivityStatus -const ( - ActivityStatusError ActivityStatus = "error" - ActivityStatusPendingFulfillment ActivityStatus = "pending_fulfillment" - ActivityStatusPendingTermination ActivityStatus = "pending_termination" - ActivityStatusFulfilled ActivityStatus = "fulfilled" -) - -// Values returns all known values for ActivityStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ActivityStatus) Values() []ActivityStatus { - return []ActivityStatus{ - "error", - "pending_fulfillment", - "pending_termination", - "fulfilled", - } -} - -type AddressAttributeName string - -// Enum values for AddressAttributeName -const ( - AddressAttributeNameDomainName AddressAttributeName = "domain-name" -) - -// Values returns all known values for AddressAttributeName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AddressAttributeName) Values() []AddressAttributeName { - return []AddressAttributeName{ - "domain-name", - } -} - -type AddressFamily string - -// Enum values for AddressFamily -const ( - AddressFamilyIpv4 AddressFamily = "ipv4" - AddressFamilyIpv6 AddressFamily = "ipv6" -) - -// Values returns all known values for AddressFamily. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AddressFamily) Values() []AddressFamily { - return []AddressFamily{ - "ipv4", - "ipv6", - } -} - -type AddressTransferStatus string - -// Enum values for AddressTransferStatus -const ( - AddressTransferStatusPending AddressTransferStatus = "pending" - AddressTransferStatusDisabled AddressTransferStatus = "disabled" - AddressTransferStatusAccepted AddressTransferStatus = "accepted" -) - -// Values returns all known values for AddressTransferStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AddressTransferStatus) Values() []AddressTransferStatus { - return []AddressTransferStatus{ - "pending", - "disabled", - "accepted", - } -} - -type Affinity string - -// Enum values for Affinity -const ( - AffinityDefault Affinity = "default" - AffinityHost Affinity = "host" -) - -// Values returns all known values for Affinity. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Affinity) Values() []Affinity { - return []Affinity{ - "default", - "host", - } -} - -type AllocationState string - -// Enum values for AllocationState -const ( - AllocationStateAvailable AllocationState = "available" - AllocationStateUnderAssessment AllocationState = "under-assessment" - AllocationStatePermanentFailure AllocationState = "permanent-failure" - AllocationStateReleased AllocationState = "released" - AllocationStateReleasedPermanentFailure AllocationState = "released-permanent-failure" - AllocationStatePending AllocationState = "pending" -) - -// Values returns all known values for AllocationState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllocationState) Values() []AllocationState { - return []AllocationState{ - "available", - "under-assessment", - "permanent-failure", - "released", - "released-permanent-failure", - "pending", - } -} - -type AllocationStrategy string - -// Enum values for AllocationStrategy -const ( - AllocationStrategyLowestPrice AllocationStrategy = "lowestPrice" - AllocationStrategyDiversified AllocationStrategy = "diversified" - AllocationStrategyCapacityOptimized AllocationStrategy = "capacityOptimized" - AllocationStrategyCapacityOptimizedPrioritized AllocationStrategy = "capacityOptimizedPrioritized" - AllocationStrategyPriceCapacityOptimized AllocationStrategy = "priceCapacityOptimized" -) - -// Values returns all known values for AllocationStrategy. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllocationStrategy) Values() []AllocationStrategy { - return []AllocationStrategy{ - "lowestPrice", - "diversified", - "capacityOptimized", - "capacityOptimizedPrioritized", - "priceCapacityOptimized", - } -} - -type AllocationType string - -// Enum values for AllocationType -const ( - AllocationTypeUsed AllocationType = "used" - AllocationTypeFuture AllocationType = "future" -) - -// Values returns all known values for AllocationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllocationType) Values() []AllocationType { - return []AllocationType{ - "used", - "future", - } -} - -type AllowedImagesSettingsDisabledState string - -// Enum values for AllowedImagesSettingsDisabledState -const ( - AllowedImagesSettingsDisabledStateDisabled AllowedImagesSettingsDisabledState = "disabled" -) - -// Values returns all known values for AllowedImagesSettingsDisabledState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllowedImagesSettingsDisabledState) Values() []AllowedImagesSettingsDisabledState { - return []AllowedImagesSettingsDisabledState{ - "disabled", - } -} - -type AllowedImagesSettingsEnabledState string - -// Enum values for AllowedImagesSettingsEnabledState -const ( - AllowedImagesSettingsEnabledStateEnabled AllowedImagesSettingsEnabledState = "enabled" - AllowedImagesSettingsEnabledStateAuditMode AllowedImagesSettingsEnabledState = "audit-mode" -) - -// Values returns all known values for AllowedImagesSettingsEnabledState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllowedImagesSettingsEnabledState) Values() []AllowedImagesSettingsEnabledState { - return []AllowedImagesSettingsEnabledState{ - "enabled", - "audit-mode", - } -} - -type AllowsMultipleInstanceTypes string - -// Enum values for AllowsMultipleInstanceTypes -const ( - AllowsMultipleInstanceTypesOn AllowsMultipleInstanceTypes = "on" - AllowsMultipleInstanceTypesOff AllowsMultipleInstanceTypes = "off" -) - -// Values returns all known values for AllowsMultipleInstanceTypes. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AllowsMultipleInstanceTypes) Values() []AllowsMultipleInstanceTypes { - return []AllowsMultipleInstanceTypes{ - "on", - "off", - } -} - -type AmdSevSnpSpecification string - -// Enum values for AmdSevSnpSpecification -const ( - AmdSevSnpSpecificationEnabled AmdSevSnpSpecification = "enabled" - AmdSevSnpSpecificationDisabled AmdSevSnpSpecification = "disabled" -) - -// Values returns all known values for AmdSevSnpSpecification. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AmdSevSnpSpecification) Values() []AmdSevSnpSpecification { - return []AmdSevSnpSpecification{ - "enabled", - "disabled", - } -} - -type AnalysisStatus string - -// Enum values for AnalysisStatus -const ( - AnalysisStatusRunning AnalysisStatus = "running" - AnalysisStatusSucceeded AnalysisStatus = "succeeded" - AnalysisStatusFailed AnalysisStatus = "failed" -) - -// Values returns all known values for AnalysisStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AnalysisStatus) Values() []AnalysisStatus { - return []AnalysisStatus{ - "running", - "succeeded", - "failed", - } -} - -type ApplianceModeSupportValue string - -// Enum values for ApplianceModeSupportValue -const ( - ApplianceModeSupportValueEnable ApplianceModeSupportValue = "enable" - ApplianceModeSupportValueDisable ApplianceModeSupportValue = "disable" -) - -// Values returns all known values for ApplianceModeSupportValue. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ApplianceModeSupportValue) Values() []ApplianceModeSupportValue { - return []ApplianceModeSupportValue{ - "enable", - "disable", - } -} - -type ArchitectureType string - -// Enum values for ArchitectureType -const ( - ArchitectureTypeI386 ArchitectureType = "i386" - ArchitectureTypeX8664 ArchitectureType = "x86_64" - ArchitectureTypeArm64 ArchitectureType = "arm64" - ArchitectureTypeX8664Mac ArchitectureType = "x86_64_mac" - ArchitectureTypeArm64Mac ArchitectureType = "arm64_mac" -) - -// Values returns all known values for ArchitectureType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ArchitectureType) Values() []ArchitectureType { - return []ArchitectureType{ - "i386", - "x86_64", - "arm64", - "x86_64_mac", - "arm64_mac", - } -} - -type ArchitectureValues string - -// Enum values for ArchitectureValues -const ( - ArchitectureValuesI386 ArchitectureValues = "i386" - ArchitectureValuesX8664 ArchitectureValues = "x86_64" - ArchitectureValuesArm64 ArchitectureValues = "arm64" - ArchitectureValuesX8664Mac ArchitectureValues = "x86_64_mac" - ArchitectureValuesArm64Mac ArchitectureValues = "arm64_mac" -) - -// Values returns all known values for ArchitectureValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ArchitectureValues) Values() []ArchitectureValues { - return []ArchitectureValues{ - "i386", - "x86_64", - "arm64", - "x86_64_mac", - "arm64_mac", - } -} - -type AsnAssociationState string - -// Enum values for AsnAssociationState -const ( - AsnAssociationStateDisassociated AsnAssociationState = "disassociated" - AsnAssociationStateFailedDisassociation AsnAssociationState = "failed-disassociation" - AsnAssociationStateFailedAssociation AsnAssociationState = "failed-association" - AsnAssociationStatePendingDisassociation AsnAssociationState = "pending-disassociation" - AsnAssociationStatePendingAssociation AsnAssociationState = "pending-association" - AsnAssociationStateAssociated AsnAssociationState = "associated" -) - -// Values returns all known values for AsnAssociationState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AsnAssociationState) Values() []AsnAssociationState { - return []AsnAssociationState{ - "disassociated", - "failed-disassociation", - "failed-association", - "pending-disassociation", - "pending-association", - "associated", - } -} - -type AsnState string - -// Enum values for AsnState -const ( - AsnStateDeprovisioned AsnState = "deprovisioned" - AsnStateFailedDeprovision AsnState = "failed-deprovision" - AsnStateFailedProvision AsnState = "failed-provision" - AsnStatePendingDeprovision AsnState = "pending-deprovision" - AsnStatePendingProvision AsnState = "pending-provision" - AsnStateProvisioned AsnState = "provisioned" -) - -// Values returns all known values for AsnState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AsnState) Values() []AsnState { - return []AsnState{ - "deprovisioned", - "failed-deprovision", - "failed-provision", - "pending-deprovision", - "pending-provision", - "provisioned", - } -} - -type AssociatedNetworkType string - -// Enum values for AssociatedNetworkType -const ( - AssociatedNetworkTypeVpc AssociatedNetworkType = "vpc" -) - -// Values returns all known values for AssociatedNetworkType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AssociatedNetworkType) Values() []AssociatedNetworkType { - return []AssociatedNetworkType{ - "vpc", - } -} - -type AssociationStatusCode string - -// Enum values for AssociationStatusCode -const ( - AssociationStatusCodeAssociating AssociationStatusCode = "associating" - AssociationStatusCodeAssociated AssociationStatusCode = "associated" - AssociationStatusCodeAssociationFailed AssociationStatusCode = "association-failed" - AssociationStatusCodeDisassociating AssociationStatusCode = "disassociating" - AssociationStatusCodeDisassociated AssociationStatusCode = "disassociated" -) - -// Values returns all known values for AssociationStatusCode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AssociationStatusCode) Values() []AssociationStatusCode { - return []AssociationStatusCode{ - "associating", - "associated", - "association-failed", - "disassociating", - "disassociated", - } -} - -type AttachmentStatus string - -// Enum values for AttachmentStatus -const ( - AttachmentStatusAttaching AttachmentStatus = "attaching" - AttachmentStatusAttached AttachmentStatus = "attached" - AttachmentStatusDetaching AttachmentStatus = "detaching" - AttachmentStatusDetached AttachmentStatus = "detached" -) - -// Values returns all known values for AttachmentStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AttachmentStatus) Values() []AttachmentStatus { - return []AttachmentStatus{ - "attaching", - "attached", - "detaching", - "detached", - } -} - -type AutoAcceptSharedAssociationsValue string - -// Enum values for AutoAcceptSharedAssociationsValue -const ( - AutoAcceptSharedAssociationsValueEnable AutoAcceptSharedAssociationsValue = "enable" - AutoAcceptSharedAssociationsValueDisable AutoAcceptSharedAssociationsValue = "disable" -) - -// Values returns all known values for AutoAcceptSharedAssociationsValue. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AutoAcceptSharedAssociationsValue) Values() []AutoAcceptSharedAssociationsValue { - return []AutoAcceptSharedAssociationsValue{ - "enable", - "disable", - } -} - -type AutoAcceptSharedAttachmentsValue string - -// Enum values for AutoAcceptSharedAttachmentsValue -const ( - AutoAcceptSharedAttachmentsValueEnable AutoAcceptSharedAttachmentsValue = "enable" - AutoAcceptSharedAttachmentsValueDisable AutoAcceptSharedAttachmentsValue = "disable" -) - -// Values returns all known values for AutoAcceptSharedAttachmentsValue. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AutoAcceptSharedAttachmentsValue) Values() []AutoAcceptSharedAttachmentsValue { - return []AutoAcceptSharedAttachmentsValue{ - "enable", - "disable", - } -} - -type AutoPlacement string - -// Enum values for AutoPlacement -const ( - AutoPlacementOn AutoPlacement = "on" - AutoPlacementOff AutoPlacement = "off" -) - -// Values returns all known values for AutoPlacement. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AutoPlacement) Values() []AutoPlacement { - return []AutoPlacement{ - "on", - "off", - } -} - -type AvailabilityZoneOptInStatus string - -// Enum values for AvailabilityZoneOptInStatus -const ( - AvailabilityZoneOptInStatusOptInNotRequired AvailabilityZoneOptInStatus = "opt-in-not-required" - AvailabilityZoneOptInStatusOptedIn AvailabilityZoneOptInStatus = "opted-in" - AvailabilityZoneOptInStatusNotOptedIn AvailabilityZoneOptInStatus = "not-opted-in" -) - -// Values returns all known values for AvailabilityZoneOptInStatus. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AvailabilityZoneOptInStatus) Values() []AvailabilityZoneOptInStatus { - return []AvailabilityZoneOptInStatus{ - "opt-in-not-required", - "opted-in", - "not-opted-in", - } -} - -type AvailabilityZoneState string - -// Enum values for AvailabilityZoneState -const ( - AvailabilityZoneStateAvailable AvailabilityZoneState = "available" - AvailabilityZoneStateInformation AvailabilityZoneState = "information" - AvailabilityZoneStateImpaired AvailabilityZoneState = "impaired" - AvailabilityZoneStateUnavailable AvailabilityZoneState = "unavailable" - AvailabilityZoneStateConstrained AvailabilityZoneState = "constrained" -) - -// Values returns all known values for AvailabilityZoneState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AvailabilityZoneState) Values() []AvailabilityZoneState { - return []AvailabilityZoneState{ - "available", - "information", - "impaired", - "unavailable", - "constrained", - } -} - -type BandwidthWeightingType string - -// Enum values for BandwidthWeightingType -const ( - BandwidthWeightingTypeDefault BandwidthWeightingType = "default" - BandwidthWeightingTypeVpc1 BandwidthWeightingType = "vpc-1" - BandwidthWeightingTypeEbs1 BandwidthWeightingType = "ebs-1" -) - -// Values returns all known values for BandwidthWeightingType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BandwidthWeightingType) Values() []BandwidthWeightingType { - return []BandwidthWeightingType{ - "default", - "vpc-1", - "ebs-1", - } -} - -type BareMetal string - -// Enum values for BareMetal -const ( - BareMetalIncluded BareMetal = "included" - BareMetalRequired BareMetal = "required" - BareMetalExcluded BareMetal = "excluded" -) - -// Values returns all known values for BareMetal. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BareMetal) Values() []BareMetal { - return []BareMetal{ - "included", - "required", - "excluded", - } -} - -type BatchState string - -// Enum values for BatchState -const ( - BatchStateSubmitted BatchState = "submitted" - BatchStateActive BatchState = "active" - BatchStateCancelled BatchState = "cancelled" - BatchStateFailed BatchState = "failed" - BatchStateCancelledRunning BatchState = "cancelled_running" - BatchStateCancelledTerminatingInstances BatchState = "cancelled_terminating" - BatchStateModifying BatchState = "modifying" -) - -// Values returns all known values for BatchState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BatchState) Values() []BatchState { - return []BatchState{ - "submitted", - "active", - "cancelled", - "failed", - "cancelled_running", - "cancelled_terminating", - "modifying", - } -} - -type BgpStatus string - -// Enum values for BgpStatus -const ( - BgpStatusUp BgpStatus = "up" - BgpStatusDown BgpStatus = "down" -) - -// Values returns all known values for BgpStatus. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BgpStatus) Values() []BgpStatus { - return []BgpStatus{ - "up", - "down", - } -} - -type BlockPublicAccessMode string - -// Enum values for BlockPublicAccessMode -const ( - BlockPublicAccessModeOff BlockPublicAccessMode = "off" - BlockPublicAccessModeBlockBidirectional BlockPublicAccessMode = "block-bidirectional" - BlockPublicAccessModeBlockIngress BlockPublicAccessMode = "block-ingress" -) - -// Values returns all known values for BlockPublicAccessMode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BlockPublicAccessMode) Values() []BlockPublicAccessMode { - return []BlockPublicAccessMode{ - "off", - "block-bidirectional", - "block-ingress", - } -} - -type BootModeType string - -// Enum values for BootModeType -const ( - BootModeTypeLegacyBios BootModeType = "legacy-bios" - BootModeTypeUefi BootModeType = "uefi" -) - -// Values returns all known values for BootModeType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BootModeType) Values() []BootModeType { - return []BootModeType{ - "legacy-bios", - "uefi", - } -} - -type BootModeValues string - -// Enum values for BootModeValues -const ( - BootModeValuesLegacyBios BootModeValues = "legacy-bios" - BootModeValuesUefi BootModeValues = "uefi" - BootModeValuesUefiPreferred BootModeValues = "uefi-preferred" -) - -// Values returns all known values for BootModeValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BootModeValues) Values() []BootModeValues { - return []BootModeValues{ - "legacy-bios", - "uefi", - "uefi-preferred", - } -} - -type BundleTaskState string - -// Enum values for BundleTaskState -const ( - BundleTaskStatePending BundleTaskState = "pending" - BundleTaskStateWaitingForShutdown BundleTaskState = "waiting-for-shutdown" - BundleTaskStateBundling BundleTaskState = "bundling" - BundleTaskStateStoring BundleTaskState = "storing" - BundleTaskStateCancelling BundleTaskState = "cancelling" - BundleTaskStateComplete BundleTaskState = "complete" - BundleTaskStateFailed BundleTaskState = "failed" -) - -// Values returns all known values for BundleTaskState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BundleTaskState) Values() []BundleTaskState { - return []BundleTaskState{ - "pending", - "waiting-for-shutdown", - "bundling", - "storing", - "cancelling", - "complete", - "failed", - } -} - -type BurstablePerformance string - -// Enum values for BurstablePerformance -const ( - BurstablePerformanceIncluded BurstablePerformance = "included" - BurstablePerformanceRequired BurstablePerformance = "required" - BurstablePerformanceExcluded BurstablePerformance = "excluded" -) - -// Values returns all known values for BurstablePerformance. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (BurstablePerformance) Values() []BurstablePerformance { - return []BurstablePerformance{ - "included", - "required", - "excluded", - } -} - -type ByoipCidrState string - -// Enum values for ByoipCidrState -const ( - ByoipCidrStateAdvertised ByoipCidrState = "advertised" - ByoipCidrStateDeprovisioned ByoipCidrState = "deprovisioned" - ByoipCidrStateFailedDeprovision ByoipCidrState = "failed-deprovision" - ByoipCidrStateFailedProvision ByoipCidrState = "failed-provision" - ByoipCidrStatePendingDeprovision ByoipCidrState = "pending-deprovision" - ByoipCidrStatePendingProvision ByoipCidrState = "pending-provision" - ByoipCidrStateProvisioned ByoipCidrState = "provisioned" - ByoipCidrStateProvisionedNotPubliclyAdvertisable ByoipCidrState = "provisioned-not-publicly-advertisable" -) - -// Values returns all known values for ByoipCidrState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ByoipCidrState) Values() []ByoipCidrState { - return []ByoipCidrState{ - "advertised", - "deprovisioned", - "failed-deprovision", - "failed-provision", - "pending-deprovision", - "pending-provision", - "provisioned", - "provisioned-not-publicly-advertisable", - } -} - -type CallerRole string - -// Enum values for CallerRole -const ( - CallerRoleOdcrOwner CallerRole = "odcr-owner" - CallerRoleUnusedReservationBillingOwner CallerRole = "unused-reservation-billing-owner" -) - -// Values returns all known values for CallerRole. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CallerRole) Values() []CallerRole { - return []CallerRole{ - "odcr-owner", - "unused-reservation-billing-owner", - } -} - -type CancelBatchErrorCode string - -// Enum values for CancelBatchErrorCode -const ( - CancelBatchErrorCodeFleetRequestIdDoesNotExist CancelBatchErrorCode = "fleetRequestIdDoesNotExist" - CancelBatchErrorCodeFleetRequestIdMalformed CancelBatchErrorCode = "fleetRequestIdMalformed" - CancelBatchErrorCodeFleetRequestNotInCancellableState CancelBatchErrorCode = "fleetRequestNotInCancellableState" - CancelBatchErrorCodeUnexpectedError CancelBatchErrorCode = "unexpectedError" -) - -// Values returns all known values for CancelBatchErrorCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CancelBatchErrorCode) Values() []CancelBatchErrorCode { - return []CancelBatchErrorCode{ - "fleetRequestIdDoesNotExist", - "fleetRequestIdMalformed", - "fleetRequestNotInCancellableState", - "unexpectedError", - } -} - -type CancelSpotInstanceRequestState string - -// Enum values for CancelSpotInstanceRequestState -const ( - CancelSpotInstanceRequestStateActive CancelSpotInstanceRequestState = "active" - CancelSpotInstanceRequestStateOpen CancelSpotInstanceRequestState = "open" - CancelSpotInstanceRequestStateClosed CancelSpotInstanceRequestState = "closed" - CancelSpotInstanceRequestStateCancelled CancelSpotInstanceRequestState = "cancelled" - CancelSpotInstanceRequestStateCompleted CancelSpotInstanceRequestState = "completed" -) - -// Values returns all known values for CancelSpotInstanceRequestState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CancelSpotInstanceRequestState) Values() []CancelSpotInstanceRequestState { - return []CancelSpotInstanceRequestState{ - "active", - "open", - "closed", - "cancelled", - "completed", - } -} - -type CapacityBlockExtensionStatus string - -// Enum values for CapacityBlockExtensionStatus -const ( - CapacityBlockExtensionStatusPaymentPending CapacityBlockExtensionStatus = "payment-pending" - CapacityBlockExtensionStatusPaymentFailed CapacityBlockExtensionStatus = "payment-failed" - CapacityBlockExtensionStatusPaymentSucceeded CapacityBlockExtensionStatus = "payment-succeeded" -) - -// Values returns all known values for CapacityBlockExtensionStatus. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityBlockExtensionStatus) Values() []CapacityBlockExtensionStatus { - return []CapacityBlockExtensionStatus{ - "payment-pending", - "payment-failed", - "payment-succeeded", - } -} - -type CapacityBlockInterconnectStatus string - -// Enum values for CapacityBlockInterconnectStatus -const ( - CapacityBlockInterconnectStatusOk CapacityBlockInterconnectStatus = "ok" - CapacityBlockInterconnectStatusImpaired CapacityBlockInterconnectStatus = "impaired" - CapacityBlockInterconnectStatusInsufficientData CapacityBlockInterconnectStatus = "insufficient-data" -) - -// Values returns all known values for CapacityBlockInterconnectStatus. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityBlockInterconnectStatus) Values() []CapacityBlockInterconnectStatus { - return []CapacityBlockInterconnectStatus{ - "ok", - "impaired", - "insufficient-data", - } -} - -type CapacityBlockResourceState string - -// Enum values for CapacityBlockResourceState -const ( - CapacityBlockResourceStateActive CapacityBlockResourceState = "active" - CapacityBlockResourceStateExpired CapacityBlockResourceState = "expired" - CapacityBlockResourceStateUnavailable CapacityBlockResourceState = "unavailable" - CapacityBlockResourceStateCancelled CapacityBlockResourceState = "cancelled" - CapacityBlockResourceStateFailed CapacityBlockResourceState = "failed" - CapacityBlockResourceStateScheduled CapacityBlockResourceState = "scheduled" - CapacityBlockResourceStatePaymentPending CapacityBlockResourceState = "payment-pending" - CapacityBlockResourceStatePaymentFailed CapacityBlockResourceState = "payment-failed" -) - -// Values returns all known values for CapacityBlockResourceState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityBlockResourceState) Values() []CapacityBlockResourceState { - return []CapacityBlockResourceState{ - "active", - "expired", - "unavailable", - "cancelled", - "failed", - "scheduled", - "payment-pending", - "payment-failed", - } -} - -type CapacityReservationBillingRequestStatus string - -// Enum values for CapacityReservationBillingRequestStatus -const ( - CapacityReservationBillingRequestStatusPending CapacityReservationBillingRequestStatus = "pending" - CapacityReservationBillingRequestStatusAccepted CapacityReservationBillingRequestStatus = "accepted" - CapacityReservationBillingRequestStatusRejected CapacityReservationBillingRequestStatus = "rejected" - CapacityReservationBillingRequestStatusCancelled CapacityReservationBillingRequestStatus = "cancelled" - CapacityReservationBillingRequestStatusRevoked CapacityReservationBillingRequestStatus = "revoked" - CapacityReservationBillingRequestStatusExpired CapacityReservationBillingRequestStatus = "expired" -) - -// Values returns all known values for CapacityReservationBillingRequestStatus. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationBillingRequestStatus) Values() []CapacityReservationBillingRequestStatus { - return []CapacityReservationBillingRequestStatus{ - "pending", - "accepted", - "rejected", - "cancelled", - "revoked", - "expired", - } -} - -type CapacityReservationDeliveryPreference string - -// Enum values for CapacityReservationDeliveryPreference -const ( - CapacityReservationDeliveryPreferenceFixed CapacityReservationDeliveryPreference = "fixed" - CapacityReservationDeliveryPreferenceIncremental CapacityReservationDeliveryPreference = "incremental" -) - -// Values returns all known values for CapacityReservationDeliveryPreference. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationDeliveryPreference) Values() []CapacityReservationDeliveryPreference { - return []CapacityReservationDeliveryPreference{ - "fixed", - "incremental", - } -} - -type CapacityReservationFleetState string - -// Enum values for CapacityReservationFleetState -const ( - CapacityReservationFleetStateSubmitted CapacityReservationFleetState = "submitted" - CapacityReservationFleetStateModifying CapacityReservationFleetState = "modifying" - CapacityReservationFleetStateActive CapacityReservationFleetState = "active" - CapacityReservationFleetStatePartiallyFulfilled CapacityReservationFleetState = "partially_fulfilled" - CapacityReservationFleetStateExpiring CapacityReservationFleetState = "expiring" - CapacityReservationFleetStateExpired CapacityReservationFleetState = "expired" - CapacityReservationFleetStateCancelling CapacityReservationFleetState = "cancelling" - CapacityReservationFleetStateCancelled CapacityReservationFleetState = "cancelled" - CapacityReservationFleetStateFailed CapacityReservationFleetState = "failed" -) - -// Values returns all known values for CapacityReservationFleetState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationFleetState) Values() []CapacityReservationFleetState { - return []CapacityReservationFleetState{ - "submitted", - "modifying", - "active", - "partially_fulfilled", - "expiring", - "expired", - "cancelling", - "cancelled", - "failed", - } -} - -type CapacityReservationInstancePlatform string - -// Enum values for CapacityReservationInstancePlatform -const ( - CapacityReservationInstancePlatformLinuxUnix CapacityReservationInstancePlatform = "Linux/UNIX" - CapacityReservationInstancePlatformRedHatEnterpriseLinux CapacityReservationInstancePlatform = "Red Hat Enterprise Linux" - CapacityReservationInstancePlatformSuseLinux CapacityReservationInstancePlatform = "SUSE Linux" - CapacityReservationInstancePlatformWindows CapacityReservationInstancePlatform = "Windows" - CapacityReservationInstancePlatformWindowsWithSqlServer CapacityReservationInstancePlatform = "Windows with SQL Server" - CapacityReservationInstancePlatformWindowsWithSqlServerEnterprise CapacityReservationInstancePlatform = "Windows with SQL Server Enterprise" - CapacityReservationInstancePlatformWindowsWithSqlServerStandard CapacityReservationInstancePlatform = "Windows with SQL Server Standard" - CapacityReservationInstancePlatformWindowsWithSqlServerWeb CapacityReservationInstancePlatform = "Windows with SQL Server Web" - CapacityReservationInstancePlatformLinuxWithSqlServerStandard CapacityReservationInstancePlatform = "Linux with SQL Server Standard" - CapacityReservationInstancePlatformLinuxWithSqlServerWeb CapacityReservationInstancePlatform = "Linux with SQL Server Web" - CapacityReservationInstancePlatformLinuxWithSqlServerEnterprise CapacityReservationInstancePlatform = "Linux with SQL Server Enterprise" - CapacityReservationInstancePlatformRhelWithSqlServerStandard CapacityReservationInstancePlatform = "RHEL with SQL Server Standard" - CapacityReservationInstancePlatformRhelWithSqlServerEnterprise CapacityReservationInstancePlatform = "RHEL with SQL Server Enterprise" - CapacityReservationInstancePlatformRhelWithSqlServerWeb CapacityReservationInstancePlatform = "RHEL with SQL Server Web" - CapacityReservationInstancePlatformRhelWithHa CapacityReservationInstancePlatform = "RHEL with HA" - CapacityReservationInstancePlatformRhelWithHaAndSqlServerStandard CapacityReservationInstancePlatform = "RHEL with HA and SQL Server Standard" - CapacityReservationInstancePlatformRhelWithHaAndSqlServerEnterprise CapacityReservationInstancePlatform = "RHEL with HA and SQL Server Enterprise" - CapacityReservationInstancePlatformUbuntuProLinux CapacityReservationInstancePlatform = "Ubuntu Pro" -) - -// Values returns all known values for CapacityReservationInstancePlatform. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationInstancePlatform) Values() []CapacityReservationInstancePlatform { - return []CapacityReservationInstancePlatform{ - "Linux/UNIX", - "Red Hat Enterprise Linux", - "SUSE Linux", - "Windows", - "Windows with SQL Server", - "Windows with SQL Server Enterprise", - "Windows with SQL Server Standard", - "Windows with SQL Server Web", - "Linux with SQL Server Standard", - "Linux with SQL Server Web", - "Linux with SQL Server Enterprise", - "RHEL with SQL Server Standard", - "RHEL with SQL Server Enterprise", - "RHEL with SQL Server Web", - "RHEL with HA", - "RHEL with HA and SQL Server Standard", - "RHEL with HA and SQL Server Enterprise", - "Ubuntu Pro", - } -} - -type CapacityReservationPreference string - -// Enum values for CapacityReservationPreference -const ( - CapacityReservationPreferenceCapacityReservationsOnly CapacityReservationPreference = "capacity-reservations-only" - CapacityReservationPreferenceOpen CapacityReservationPreference = "open" - CapacityReservationPreferenceNone CapacityReservationPreference = "none" -) - -// Values returns all known values for CapacityReservationPreference. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationPreference) Values() []CapacityReservationPreference { - return []CapacityReservationPreference{ - "capacity-reservations-only", - "open", - "none", - } -} - -type CapacityReservationState string - -// Enum values for CapacityReservationState -const ( - CapacityReservationStateActive CapacityReservationState = "active" - CapacityReservationStateExpired CapacityReservationState = "expired" - CapacityReservationStateCancelled CapacityReservationState = "cancelled" - CapacityReservationStatePending CapacityReservationState = "pending" - CapacityReservationStateFailed CapacityReservationState = "failed" - CapacityReservationStateScheduled CapacityReservationState = "scheduled" - CapacityReservationStatePaymentPending CapacityReservationState = "payment-pending" - CapacityReservationStatePaymentFailed CapacityReservationState = "payment-failed" - CapacityReservationStateAssessing CapacityReservationState = "assessing" - CapacityReservationStateDelayed CapacityReservationState = "delayed" - CapacityReservationStateUnsupported CapacityReservationState = "unsupported" - CapacityReservationStateUnavailable CapacityReservationState = "unavailable" -) - -// Values returns all known values for CapacityReservationState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationState) Values() []CapacityReservationState { - return []CapacityReservationState{ - "active", - "expired", - "cancelled", - "pending", - "failed", - "scheduled", - "payment-pending", - "payment-failed", - "assessing", - "delayed", - "unsupported", - "unavailable", - } -} - -type CapacityReservationTenancy string - -// Enum values for CapacityReservationTenancy -const ( - CapacityReservationTenancyDefault CapacityReservationTenancy = "default" - CapacityReservationTenancyDedicated CapacityReservationTenancy = "dedicated" -) - -// Values returns all known values for CapacityReservationTenancy. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationTenancy) Values() []CapacityReservationTenancy { - return []CapacityReservationTenancy{ - "default", - "dedicated", - } -} - -type CapacityReservationType string - -// Enum values for CapacityReservationType -const ( - CapacityReservationTypeDefault CapacityReservationType = "default" - CapacityReservationTypeCapacityBlock CapacityReservationType = "capacity-block" -) - -// Values returns all known values for CapacityReservationType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityReservationType) Values() []CapacityReservationType { - return []CapacityReservationType{ - "default", - "capacity-block", - } -} - -type CarrierGatewayState string - -// Enum values for CarrierGatewayState -const ( - CarrierGatewayStatePending CarrierGatewayState = "pending" - CarrierGatewayStateAvailable CarrierGatewayState = "available" - CarrierGatewayStateDeleting CarrierGatewayState = "deleting" - CarrierGatewayStateDeleted CarrierGatewayState = "deleted" -) - -// Values returns all known values for CarrierGatewayState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CarrierGatewayState) Values() []CarrierGatewayState { - return []CarrierGatewayState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type ClientCertificateRevocationListStatusCode string - -// Enum values for ClientCertificateRevocationListStatusCode -const ( - ClientCertificateRevocationListStatusCodePending ClientCertificateRevocationListStatusCode = "pending" - ClientCertificateRevocationListStatusCodeActive ClientCertificateRevocationListStatusCode = "active" -) - -// Values returns all known values for ClientCertificateRevocationListStatusCode. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientCertificateRevocationListStatusCode) Values() []ClientCertificateRevocationListStatusCode { - return []ClientCertificateRevocationListStatusCode{ - "pending", - "active", - } -} - -type ClientVpnAuthenticationType string - -// Enum values for ClientVpnAuthenticationType -const ( - ClientVpnAuthenticationTypeCertificateAuthentication ClientVpnAuthenticationType = "certificate-authentication" - ClientVpnAuthenticationTypeDirectoryServiceAuthentication ClientVpnAuthenticationType = "directory-service-authentication" - ClientVpnAuthenticationTypeFederatedAuthentication ClientVpnAuthenticationType = "federated-authentication" -) - -// Values returns all known values for ClientVpnAuthenticationType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnAuthenticationType) Values() []ClientVpnAuthenticationType { - return []ClientVpnAuthenticationType{ - "certificate-authentication", - "directory-service-authentication", - "federated-authentication", - } -} - -type ClientVpnAuthorizationRuleStatusCode string - -// Enum values for ClientVpnAuthorizationRuleStatusCode -const ( - ClientVpnAuthorizationRuleStatusCodeAuthorizing ClientVpnAuthorizationRuleStatusCode = "authorizing" - ClientVpnAuthorizationRuleStatusCodeActive ClientVpnAuthorizationRuleStatusCode = "active" - ClientVpnAuthorizationRuleStatusCodeFailed ClientVpnAuthorizationRuleStatusCode = "failed" - ClientVpnAuthorizationRuleStatusCodeRevoking ClientVpnAuthorizationRuleStatusCode = "revoking" -) - -// Values returns all known values for ClientVpnAuthorizationRuleStatusCode. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnAuthorizationRuleStatusCode) Values() []ClientVpnAuthorizationRuleStatusCode { - return []ClientVpnAuthorizationRuleStatusCode{ - "authorizing", - "active", - "failed", - "revoking", - } -} - -type ClientVpnConnectionStatusCode string - -// Enum values for ClientVpnConnectionStatusCode -const ( - ClientVpnConnectionStatusCodeActive ClientVpnConnectionStatusCode = "active" - ClientVpnConnectionStatusCodeFailedToTerminate ClientVpnConnectionStatusCode = "failed-to-terminate" - ClientVpnConnectionStatusCodeTerminating ClientVpnConnectionStatusCode = "terminating" - ClientVpnConnectionStatusCodeTerminated ClientVpnConnectionStatusCode = "terminated" -) - -// Values returns all known values for ClientVpnConnectionStatusCode. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnConnectionStatusCode) Values() []ClientVpnConnectionStatusCode { - return []ClientVpnConnectionStatusCode{ - "active", - "failed-to-terminate", - "terminating", - "terminated", - } -} - -type ClientVpnEndpointAttributeStatusCode string - -// Enum values for ClientVpnEndpointAttributeStatusCode -const ( - ClientVpnEndpointAttributeStatusCodeApplying ClientVpnEndpointAttributeStatusCode = "applying" - ClientVpnEndpointAttributeStatusCodeApplied ClientVpnEndpointAttributeStatusCode = "applied" -) - -// Values returns all known values for ClientVpnEndpointAttributeStatusCode. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnEndpointAttributeStatusCode) Values() []ClientVpnEndpointAttributeStatusCode { - return []ClientVpnEndpointAttributeStatusCode{ - "applying", - "applied", - } -} - -type ClientVpnEndpointStatusCode string - -// Enum values for ClientVpnEndpointStatusCode -const ( - ClientVpnEndpointStatusCodePendingAssociate ClientVpnEndpointStatusCode = "pending-associate" - ClientVpnEndpointStatusCodeAvailable ClientVpnEndpointStatusCode = "available" - ClientVpnEndpointStatusCodeDeleting ClientVpnEndpointStatusCode = "deleting" - ClientVpnEndpointStatusCodeDeleted ClientVpnEndpointStatusCode = "deleted" -) - -// Values returns all known values for ClientVpnEndpointStatusCode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnEndpointStatusCode) Values() []ClientVpnEndpointStatusCode { - return []ClientVpnEndpointStatusCode{ - "pending-associate", - "available", - "deleting", - "deleted", - } -} - -type ClientVpnRouteStatusCode string - -// Enum values for ClientVpnRouteStatusCode -const ( - ClientVpnRouteStatusCodeCreating ClientVpnRouteStatusCode = "creating" - ClientVpnRouteStatusCodeActive ClientVpnRouteStatusCode = "active" - ClientVpnRouteStatusCodeFailed ClientVpnRouteStatusCode = "failed" - ClientVpnRouteStatusCodeDeleting ClientVpnRouteStatusCode = "deleting" -) - -// Values returns all known values for ClientVpnRouteStatusCode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClientVpnRouteStatusCode) Values() []ClientVpnRouteStatusCode { - return []ClientVpnRouteStatusCode{ - "creating", - "active", - "failed", - "deleting", - } -} - -type ConnectionNotificationState string - -// Enum values for ConnectionNotificationState -const ( - ConnectionNotificationStateEnabled ConnectionNotificationState = "Enabled" - ConnectionNotificationStateDisabled ConnectionNotificationState = "Disabled" -) - -// Values returns all known values for ConnectionNotificationState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConnectionNotificationState) Values() []ConnectionNotificationState { - return []ConnectionNotificationState{ - "Enabled", - "Disabled", - } -} - -type ConnectionNotificationType string - -// Enum values for ConnectionNotificationType -const ( - ConnectionNotificationTypeTopic ConnectionNotificationType = "Topic" -) - -// Values returns all known values for ConnectionNotificationType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConnectionNotificationType) Values() []ConnectionNotificationType { - return []ConnectionNotificationType{ - "Topic", - } -} - -type ConnectivityType string - -// Enum values for ConnectivityType -const ( - ConnectivityTypePrivate ConnectivityType = "private" - ConnectivityTypePublic ConnectivityType = "public" -) - -// Values returns all known values for ConnectivityType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConnectivityType) Values() []ConnectivityType { - return []ConnectivityType{ - "private", - "public", - } -} - -type ContainerFormat string - -// Enum values for ContainerFormat -const ( - ContainerFormatOva ContainerFormat = "ova" -) - -// Values returns all known values for ContainerFormat. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ContainerFormat) Values() []ContainerFormat { - return []ContainerFormat{ - "ova", - } -} - -type ConversionTaskState string - -// Enum values for ConversionTaskState -const ( - ConversionTaskStateActive ConversionTaskState = "active" - ConversionTaskStateCancelling ConversionTaskState = "cancelling" - ConversionTaskStateCancelled ConversionTaskState = "cancelled" - ConversionTaskStateCompleted ConversionTaskState = "completed" -) - -// Values returns all known values for ConversionTaskState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConversionTaskState) Values() []ConversionTaskState { - return []ConversionTaskState{ - "active", - "cancelling", - "cancelled", - "completed", - } -} - -type CopyTagsFromSource string - -// Enum values for CopyTagsFromSource -const ( - CopyTagsFromSourceVolume CopyTagsFromSource = "volume" -) - -// Values returns all known values for CopyTagsFromSource. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CopyTagsFromSource) Values() []CopyTagsFromSource { - return []CopyTagsFromSource{ - "volume", - } -} - -type CpuManufacturer string - -// Enum values for CpuManufacturer -const ( - CpuManufacturerIntel CpuManufacturer = "intel" - CpuManufacturerAmd CpuManufacturer = "amd" - CpuManufacturerAmazonWebServices CpuManufacturer = "amazon-web-services" - CpuManufacturerApple CpuManufacturer = "apple" -) - -// Values returns all known values for CpuManufacturer. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CpuManufacturer) Values() []CpuManufacturer { - return []CpuManufacturer{ - "intel", - "amd", - "amazon-web-services", - "apple", - } -} - -type CurrencyCodeValues string - -// Enum values for CurrencyCodeValues -const ( - CurrencyCodeValuesUsd CurrencyCodeValues = "USD" -) - -// Values returns all known values for CurrencyCodeValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CurrencyCodeValues) Values() []CurrencyCodeValues { - return []CurrencyCodeValues{ - "USD", - } -} - -type DatafeedSubscriptionState string - -// Enum values for DatafeedSubscriptionState -const ( - DatafeedSubscriptionStateActive DatafeedSubscriptionState = "Active" - DatafeedSubscriptionStateInactive DatafeedSubscriptionState = "Inactive" -) - -// Values returns all known values for DatafeedSubscriptionState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DatafeedSubscriptionState) Values() []DatafeedSubscriptionState { - return []DatafeedSubscriptionState{ - "Active", - "Inactive", - } -} - -type DefaultInstanceMetadataEndpointState string - -// Enum values for DefaultInstanceMetadataEndpointState -const ( - DefaultInstanceMetadataEndpointStateDisabled DefaultInstanceMetadataEndpointState = "disabled" - DefaultInstanceMetadataEndpointStateEnabled DefaultInstanceMetadataEndpointState = "enabled" - DefaultInstanceMetadataEndpointStateNoPreference DefaultInstanceMetadataEndpointState = "no-preference" -) - -// Values returns all known values for DefaultInstanceMetadataEndpointState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DefaultInstanceMetadataEndpointState) Values() []DefaultInstanceMetadataEndpointState { - return []DefaultInstanceMetadataEndpointState{ - "disabled", - "enabled", - "no-preference", - } -} - -type DefaultInstanceMetadataTagsState string - -// Enum values for DefaultInstanceMetadataTagsState -const ( - DefaultInstanceMetadataTagsStateDisabled DefaultInstanceMetadataTagsState = "disabled" - DefaultInstanceMetadataTagsStateEnabled DefaultInstanceMetadataTagsState = "enabled" - DefaultInstanceMetadataTagsStateNoPreference DefaultInstanceMetadataTagsState = "no-preference" -) - -// Values returns all known values for DefaultInstanceMetadataTagsState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DefaultInstanceMetadataTagsState) Values() []DefaultInstanceMetadataTagsState { - return []DefaultInstanceMetadataTagsState{ - "disabled", - "enabled", - "no-preference", - } -} - -type DefaultRouteTableAssociationValue string - -// Enum values for DefaultRouteTableAssociationValue -const ( - DefaultRouteTableAssociationValueEnable DefaultRouteTableAssociationValue = "enable" - DefaultRouteTableAssociationValueDisable DefaultRouteTableAssociationValue = "disable" -) - -// Values returns all known values for DefaultRouteTableAssociationValue. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DefaultRouteTableAssociationValue) Values() []DefaultRouteTableAssociationValue { - return []DefaultRouteTableAssociationValue{ - "enable", - "disable", - } -} - -type DefaultRouteTablePropagationValue string - -// Enum values for DefaultRouteTablePropagationValue -const ( - DefaultRouteTablePropagationValueEnable DefaultRouteTablePropagationValue = "enable" - DefaultRouteTablePropagationValueDisable DefaultRouteTablePropagationValue = "disable" -) - -// Values returns all known values for DefaultRouteTablePropagationValue. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DefaultRouteTablePropagationValue) Values() []DefaultRouteTablePropagationValue { - return []DefaultRouteTablePropagationValue{ - "enable", - "disable", - } -} - -type DefaultTargetCapacityType string - -// Enum values for DefaultTargetCapacityType -const ( - DefaultTargetCapacityTypeSpot DefaultTargetCapacityType = "spot" - DefaultTargetCapacityTypeOnDemand DefaultTargetCapacityType = "on-demand" - DefaultTargetCapacityTypeCapacityBlock DefaultTargetCapacityType = "capacity-block" -) - -// Values returns all known values for DefaultTargetCapacityType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DefaultTargetCapacityType) Values() []DefaultTargetCapacityType { - return []DefaultTargetCapacityType{ - "spot", - "on-demand", - "capacity-block", - } -} - -type DeleteFleetErrorCode string - -// Enum values for DeleteFleetErrorCode -const ( - DeleteFleetErrorCodeFleetIdDoesNotExist DeleteFleetErrorCode = "fleetIdDoesNotExist" - DeleteFleetErrorCodeFleetIdMalformed DeleteFleetErrorCode = "fleetIdMalformed" - DeleteFleetErrorCodeFleetNotInDeletableState DeleteFleetErrorCode = "fleetNotInDeletableState" - DeleteFleetErrorCodeUnexpectedError DeleteFleetErrorCode = "unexpectedError" -) - -// Values returns all known values for DeleteFleetErrorCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DeleteFleetErrorCode) Values() []DeleteFleetErrorCode { - return []DeleteFleetErrorCode{ - "fleetIdDoesNotExist", - "fleetIdMalformed", - "fleetNotInDeletableState", - "unexpectedError", - } -} - -type DeleteQueuedReservedInstancesErrorCode string - -// Enum values for DeleteQueuedReservedInstancesErrorCode -const ( - DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid DeleteQueuedReservedInstancesErrorCode = "reserved-instances-id-invalid" - DeleteQueuedReservedInstancesErrorCodeReservedInstancesNotInQueuedState DeleteQueuedReservedInstancesErrorCode = "reserved-instances-not-in-queued-state" - DeleteQueuedReservedInstancesErrorCodeUnexpectedError DeleteQueuedReservedInstancesErrorCode = "unexpected-error" -) - -// Values returns all known values for DeleteQueuedReservedInstancesErrorCode. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DeleteQueuedReservedInstancesErrorCode) Values() []DeleteQueuedReservedInstancesErrorCode { - return []DeleteQueuedReservedInstancesErrorCode{ - "reserved-instances-id-invalid", - "reserved-instances-not-in-queued-state", - "unexpected-error", - } -} - -type DestinationFileFormat string - -// Enum values for DestinationFileFormat -const ( - DestinationFileFormatPlainText DestinationFileFormat = "plain-text" - DestinationFileFormatParquet DestinationFileFormat = "parquet" -) - -// Values returns all known values for DestinationFileFormat. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DestinationFileFormat) Values() []DestinationFileFormat { - return []DestinationFileFormat{ - "plain-text", - "parquet", - } -} - -type DeviceTrustProviderType string - -// Enum values for DeviceTrustProviderType -const ( - DeviceTrustProviderTypeJamf DeviceTrustProviderType = "jamf" - DeviceTrustProviderTypeCrowdstrike DeviceTrustProviderType = "crowdstrike" - DeviceTrustProviderTypeJumpcloud DeviceTrustProviderType = "jumpcloud" -) - -// Values returns all known values for DeviceTrustProviderType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DeviceTrustProviderType) Values() []DeviceTrustProviderType { - return []DeviceTrustProviderType{ - "jamf", - "crowdstrike", - "jumpcloud", - } -} - -type DeviceType string - -// Enum values for DeviceType -const ( - DeviceTypeEbs DeviceType = "ebs" - DeviceTypeInstanceStore DeviceType = "instance-store" -) - -// Values returns all known values for DeviceType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DeviceType) Values() []DeviceType { - return []DeviceType{ - "ebs", - "instance-store", - } -} - -type DiskImageFormat string - -// Enum values for DiskImageFormat -const ( - DiskImageFormatVmdk DiskImageFormat = "VMDK" - DiskImageFormatRaw DiskImageFormat = "RAW" - DiskImageFormatVhd DiskImageFormat = "VHD" -) - -// Values returns all known values for DiskImageFormat. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DiskImageFormat) Values() []DiskImageFormat { - return []DiskImageFormat{ - "VMDK", - "RAW", - "VHD", - } -} - -type DiskType string - -// Enum values for DiskType -const ( - DiskTypeHdd DiskType = "hdd" - DiskTypeSsd DiskType = "ssd" -) - -// Values returns all known values for DiskType. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DiskType) Values() []DiskType { - return []DiskType{ - "hdd", - "ssd", - } -} - -type DnsNameState string - -// Enum values for DnsNameState -const ( - DnsNameStatePendingVerification DnsNameState = "pendingVerification" - DnsNameStateVerified DnsNameState = "verified" - DnsNameStateFailed DnsNameState = "failed" -) - -// Values returns all known values for DnsNameState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DnsNameState) Values() []DnsNameState { - return []DnsNameState{ - "pendingVerification", - "verified", - "failed", - } -} - -type DnsRecordIpType string - -// Enum values for DnsRecordIpType -const ( - DnsRecordIpTypeIpv4 DnsRecordIpType = "ipv4" - DnsRecordIpTypeDualstack DnsRecordIpType = "dualstack" - DnsRecordIpTypeIpv6 DnsRecordIpType = "ipv6" - DnsRecordIpTypeServiceDefined DnsRecordIpType = "service-defined" -) - -// Values returns all known values for DnsRecordIpType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DnsRecordIpType) Values() []DnsRecordIpType { - return []DnsRecordIpType{ - "ipv4", - "dualstack", - "ipv6", - "service-defined", - } -} - -type DnsSupportValue string - -// Enum values for DnsSupportValue -const ( - DnsSupportValueEnable DnsSupportValue = "enable" - DnsSupportValueDisable DnsSupportValue = "disable" -) - -// Values returns all known values for DnsSupportValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DnsSupportValue) Values() []DnsSupportValue { - return []DnsSupportValue{ - "enable", - "disable", - } -} - -type DomainType string - -// Enum values for DomainType -const ( - DomainTypeVpc DomainType = "vpc" - DomainTypeStandard DomainType = "standard" -) - -// Values returns all known values for DomainType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DomainType) Values() []DomainType { - return []DomainType{ - "vpc", - "standard", - } -} - -type DynamicRoutingValue string - -// Enum values for DynamicRoutingValue -const ( - DynamicRoutingValueEnable DynamicRoutingValue = "enable" - DynamicRoutingValueDisable DynamicRoutingValue = "disable" -) - -// Values returns all known values for DynamicRoutingValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (DynamicRoutingValue) Values() []DynamicRoutingValue { - return []DynamicRoutingValue{ - "enable", - "disable", - } -} - -type EbsEncryptionSupport string - -// Enum values for EbsEncryptionSupport -const ( - EbsEncryptionSupportUnsupported EbsEncryptionSupport = "unsupported" - EbsEncryptionSupportSupported EbsEncryptionSupport = "supported" -) - -// Values returns all known values for EbsEncryptionSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EbsEncryptionSupport) Values() []EbsEncryptionSupport { - return []EbsEncryptionSupport{ - "unsupported", - "supported", - } -} - -type EbsNvmeSupport string - -// Enum values for EbsNvmeSupport -const ( - EbsNvmeSupportUnsupported EbsNvmeSupport = "unsupported" - EbsNvmeSupportSupported EbsNvmeSupport = "supported" - EbsNvmeSupportRequired EbsNvmeSupport = "required" -) - -// Values returns all known values for EbsNvmeSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EbsNvmeSupport) Values() []EbsNvmeSupport { - return []EbsNvmeSupport{ - "unsupported", - "supported", - "required", - } -} - -type EbsOptimizedSupport string - -// Enum values for EbsOptimizedSupport -const ( - EbsOptimizedSupportUnsupported EbsOptimizedSupport = "unsupported" - EbsOptimizedSupportSupported EbsOptimizedSupport = "supported" - EbsOptimizedSupportDefault EbsOptimizedSupport = "default" -) - -// Values returns all known values for EbsOptimizedSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EbsOptimizedSupport) Values() []EbsOptimizedSupport { - return []EbsOptimizedSupport{ - "unsupported", - "supported", - "default", - } -} - -type Ec2InstanceConnectEndpointState string - -// Enum values for Ec2InstanceConnectEndpointState -const ( - Ec2InstanceConnectEndpointStateCreateInProgress Ec2InstanceConnectEndpointState = "create-in-progress" - Ec2InstanceConnectEndpointStateCreateComplete Ec2InstanceConnectEndpointState = "create-complete" - Ec2InstanceConnectEndpointStateCreateFailed Ec2InstanceConnectEndpointState = "create-failed" - Ec2InstanceConnectEndpointStateDeleteInProgress Ec2InstanceConnectEndpointState = "delete-in-progress" - Ec2InstanceConnectEndpointStateDeleteComplete Ec2InstanceConnectEndpointState = "delete-complete" - Ec2InstanceConnectEndpointStateDeleteFailed Ec2InstanceConnectEndpointState = "delete-failed" -) - -// Values returns all known values for Ec2InstanceConnectEndpointState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Ec2InstanceConnectEndpointState) Values() []Ec2InstanceConnectEndpointState { - return []Ec2InstanceConnectEndpointState{ - "create-in-progress", - "create-complete", - "create-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - } -} - -type EkPubKeyFormat string - -// Enum values for EkPubKeyFormat -const ( - EkPubKeyFormatDer EkPubKeyFormat = "der" - EkPubKeyFormatTpmt EkPubKeyFormat = "tpmt" -) - -// Values returns all known values for EkPubKeyFormat. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EkPubKeyFormat) Values() []EkPubKeyFormat { - return []EkPubKeyFormat{ - "der", - "tpmt", - } -} - -type EkPubKeyType string - -// Enum values for EkPubKeyType -const ( - EkPubKeyTypeRsa2048 EkPubKeyType = "rsa-2048" - EkPubKeyTypeEccSecP384 EkPubKeyType = "ecc-sec-p384" -) - -// Values returns all known values for EkPubKeyType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EkPubKeyType) Values() []EkPubKeyType { - return []EkPubKeyType{ - "rsa-2048", - "ecc-sec-p384", - } -} - -type ElasticGpuState string - -// Enum values for ElasticGpuState -const ( - ElasticGpuStateAttached ElasticGpuState = "ATTACHED" -) - -// Values returns all known values for ElasticGpuState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ElasticGpuState) Values() []ElasticGpuState { - return []ElasticGpuState{ - "ATTACHED", - } -} - -type ElasticGpuStatus string - -// Enum values for ElasticGpuStatus -const ( - ElasticGpuStatusOk ElasticGpuStatus = "OK" - ElasticGpuStatusImpaired ElasticGpuStatus = "IMPAIRED" -) - -// Values returns all known values for ElasticGpuStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ElasticGpuStatus) Values() []ElasticGpuStatus { - return []ElasticGpuStatus{ - "OK", - "IMPAIRED", - } -} - -type EnaSupport string - -// Enum values for EnaSupport -const ( - EnaSupportUnsupported EnaSupport = "unsupported" - EnaSupportSupported EnaSupport = "supported" - EnaSupportRequired EnaSupport = "required" -) - -// Values returns all known values for EnaSupport. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EnaSupport) Values() []EnaSupport { - return []EnaSupport{ - "unsupported", - "supported", - "required", - } -} - -type EndDateType string - -// Enum values for EndDateType -const ( - EndDateTypeUnlimited EndDateType = "unlimited" - EndDateTypeLimited EndDateType = "limited" -) - -// Values returns all known values for EndDateType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EndDateType) Values() []EndDateType { - return []EndDateType{ - "unlimited", - "limited", - } -} - -type EphemeralNvmeSupport string - -// Enum values for EphemeralNvmeSupport -const ( - EphemeralNvmeSupportUnsupported EphemeralNvmeSupport = "unsupported" - EphemeralNvmeSupportSupported EphemeralNvmeSupport = "supported" - EphemeralNvmeSupportRequired EphemeralNvmeSupport = "required" -) - -// Values returns all known values for EphemeralNvmeSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EphemeralNvmeSupport) Values() []EphemeralNvmeSupport { - return []EphemeralNvmeSupport{ - "unsupported", - "supported", - "required", - } -} - -type EventCode string - -// Enum values for EventCode -const ( - EventCodeInstanceReboot EventCode = "instance-reboot" - EventCodeSystemReboot EventCode = "system-reboot" - EventCodeSystemMaintenance EventCode = "system-maintenance" - EventCodeInstanceRetirement EventCode = "instance-retirement" - EventCodeInstanceStop EventCode = "instance-stop" -) - -// Values returns all known values for EventCode. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EventCode) Values() []EventCode { - return []EventCode{ - "instance-reboot", - "system-reboot", - "system-maintenance", - "instance-retirement", - "instance-stop", - } -} - -type EventType string - -// Enum values for EventType -const ( - EventTypeInstanceChange EventType = "instanceChange" - EventTypeBatchChange EventType = "fleetRequestChange" - EventTypeError EventType = "error" - EventTypeInformation EventType = "information" -) - -// Values returns all known values for EventType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EventType) Values() []EventType { - return []EventType{ - "instanceChange", - "fleetRequestChange", - "error", - "information", - } -} - -type ExcessCapacityTerminationPolicy string - -// Enum values for ExcessCapacityTerminationPolicy -const ( - ExcessCapacityTerminationPolicyNoTermination ExcessCapacityTerminationPolicy = "noTermination" - ExcessCapacityTerminationPolicyDefault ExcessCapacityTerminationPolicy = "default" -) - -// Values returns all known values for ExcessCapacityTerminationPolicy. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ExcessCapacityTerminationPolicy) Values() []ExcessCapacityTerminationPolicy { - return []ExcessCapacityTerminationPolicy{ - "noTermination", - "default", - } -} - -type ExportEnvironment string - -// Enum values for ExportEnvironment -const ( - ExportEnvironmentCitrix ExportEnvironment = "citrix" - ExportEnvironmentVmware ExportEnvironment = "vmware" - ExportEnvironmentMicrosoft ExportEnvironment = "microsoft" -) - -// Values returns all known values for ExportEnvironment. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ExportEnvironment) Values() []ExportEnvironment { - return []ExportEnvironment{ - "citrix", - "vmware", - "microsoft", - } -} - -type ExportTaskState string - -// Enum values for ExportTaskState -const ( - ExportTaskStateActive ExportTaskState = "active" - ExportTaskStateCancelling ExportTaskState = "cancelling" - ExportTaskStateCancelled ExportTaskState = "cancelled" - ExportTaskStateCompleted ExportTaskState = "completed" -) - -// Values returns all known values for ExportTaskState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ExportTaskState) Values() []ExportTaskState { - return []ExportTaskState{ - "active", - "cancelling", - "cancelled", - "completed", - } -} - -type FastLaunchResourceType string - -// Enum values for FastLaunchResourceType -const ( - FastLaunchResourceTypeSnapshot FastLaunchResourceType = "snapshot" -) - -// Values returns all known values for FastLaunchResourceType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FastLaunchResourceType) Values() []FastLaunchResourceType { - return []FastLaunchResourceType{ - "snapshot", - } -} - -type FastLaunchStateCode string - -// Enum values for FastLaunchStateCode -const ( - FastLaunchStateCodeEnabling FastLaunchStateCode = "enabling" - FastLaunchStateCodeEnablingFailed FastLaunchStateCode = "enabling-failed" - FastLaunchStateCodeEnabled FastLaunchStateCode = "enabled" - FastLaunchStateCodeEnabledFailed FastLaunchStateCode = "enabled-failed" - FastLaunchStateCodeDisabling FastLaunchStateCode = "disabling" - FastLaunchStateCodeDisablingFailed FastLaunchStateCode = "disabling-failed" -) - -// Values returns all known values for FastLaunchStateCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FastLaunchStateCode) Values() []FastLaunchStateCode { - return []FastLaunchStateCode{ - "enabling", - "enabling-failed", - "enabled", - "enabled-failed", - "disabling", - "disabling-failed", - } -} - -type FastSnapshotRestoreStateCode string - -// Enum values for FastSnapshotRestoreStateCode -const ( - FastSnapshotRestoreStateCodeEnabling FastSnapshotRestoreStateCode = "enabling" - FastSnapshotRestoreStateCodeOptimizing FastSnapshotRestoreStateCode = "optimizing" - FastSnapshotRestoreStateCodeEnabled FastSnapshotRestoreStateCode = "enabled" - FastSnapshotRestoreStateCodeDisabling FastSnapshotRestoreStateCode = "disabling" - FastSnapshotRestoreStateCodeDisabled FastSnapshotRestoreStateCode = "disabled" -) - -// Values returns all known values for FastSnapshotRestoreStateCode. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FastSnapshotRestoreStateCode) Values() []FastSnapshotRestoreStateCode { - return []FastSnapshotRestoreStateCode{ - "enabling", - "optimizing", - "enabled", - "disabling", - "disabled", - } -} - -type FindingsFound string - -// Enum values for FindingsFound -const ( - FindingsFoundTrue FindingsFound = "true" - FindingsFoundFalse FindingsFound = "false" - FindingsFoundUnknown FindingsFound = "unknown" -) - -// Values returns all known values for FindingsFound. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FindingsFound) Values() []FindingsFound { - return []FindingsFound{ - "true", - "false", - "unknown", - } -} - -type FleetActivityStatus string - -// Enum values for FleetActivityStatus -const ( - FleetActivityStatusError FleetActivityStatus = "error" - FleetActivityStatusPendingFulfillment FleetActivityStatus = "pending_fulfillment" - FleetActivityStatusPendingTermination FleetActivityStatus = "pending_termination" - FleetActivityStatusFulfilled FleetActivityStatus = "fulfilled" -) - -// Values returns all known values for FleetActivityStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetActivityStatus) Values() []FleetActivityStatus { - return []FleetActivityStatus{ - "error", - "pending_fulfillment", - "pending_termination", - "fulfilled", - } -} - -type FleetCapacityReservationTenancy string - -// Enum values for FleetCapacityReservationTenancy -const ( - FleetCapacityReservationTenancyDefault FleetCapacityReservationTenancy = "default" -) - -// Values returns all known values for FleetCapacityReservationTenancy. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetCapacityReservationTenancy) Values() []FleetCapacityReservationTenancy { - return []FleetCapacityReservationTenancy{ - "default", - } -} - -type FleetCapacityReservationUsageStrategy string - -// Enum values for FleetCapacityReservationUsageStrategy -const ( - FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst FleetCapacityReservationUsageStrategy = "use-capacity-reservations-first" -) - -// Values returns all known values for FleetCapacityReservationUsageStrategy. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetCapacityReservationUsageStrategy) Values() []FleetCapacityReservationUsageStrategy { - return []FleetCapacityReservationUsageStrategy{ - "use-capacity-reservations-first", - } -} - -type FleetEventType string - -// Enum values for FleetEventType -const ( - FleetEventTypeInstanceChange FleetEventType = "instance-change" - FleetEventTypeFleetChange FleetEventType = "fleet-change" - FleetEventTypeServiceError FleetEventType = "service-error" -) - -// Values returns all known values for FleetEventType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetEventType) Values() []FleetEventType { - return []FleetEventType{ - "instance-change", - "fleet-change", - "service-error", - } -} - -type FleetExcessCapacityTerminationPolicy string - -// Enum values for FleetExcessCapacityTerminationPolicy -const ( - FleetExcessCapacityTerminationPolicyNoTermination FleetExcessCapacityTerminationPolicy = "no-termination" - FleetExcessCapacityTerminationPolicyTermination FleetExcessCapacityTerminationPolicy = "termination" -) - -// Values returns all known values for FleetExcessCapacityTerminationPolicy. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetExcessCapacityTerminationPolicy) Values() []FleetExcessCapacityTerminationPolicy { - return []FleetExcessCapacityTerminationPolicy{ - "no-termination", - "termination", - } -} - -type FleetInstanceMatchCriteria string - -// Enum values for FleetInstanceMatchCriteria -const ( - FleetInstanceMatchCriteriaOpen FleetInstanceMatchCriteria = "open" -) - -// Values returns all known values for FleetInstanceMatchCriteria. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetInstanceMatchCriteria) Values() []FleetInstanceMatchCriteria { - return []FleetInstanceMatchCriteria{ - "open", - } -} - -type FleetOnDemandAllocationStrategy string - -// Enum values for FleetOnDemandAllocationStrategy -const ( - FleetOnDemandAllocationStrategyLowestPrice FleetOnDemandAllocationStrategy = "lowest-price" - FleetOnDemandAllocationStrategyPrioritized FleetOnDemandAllocationStrategy = "prioritized" -) - -// Values returns all known values for FleetOnDemandAllocationStrategy. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetOnDemandAllocationStrategy) Values() []FleetOnDemandAllocationStrategy { - return []FleetOnDemandAllocationStrategy{ - "lowest-price", - "prioritized", - } -} - -type FleetReplacementStrategy string - -// Enum values for FleetReplacementStrategy -const ( - FleetReplacementStrategyLaunch FleetReplacementStrategy = "launch" - FleetReplacementStrategyLaunchBeforeTerminate FleetReplacementStrategy = "launch-before-terminate" -) - -// Values returns all known values for FleetReplacementStrategy. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetReplacementStrategy) Values() []FleetReplacementStrategy { - return []FleetReplacementStrategy{ - "launch", - "launch-before-terminate", - } -} - -type FleetStateCode string - -// Enum values for FleetStateCode -const ( - FleetStateCodeSubmitted FleetStateCode = "submitted" - FleetStateCodeActive FleetStateCode = "active" - FleetStateCodeDeleted FleetStateCode = "deleted" - FleetStateCodeFailed FleetStateCode = "failed" - FleetStateCodeDeletedRunning FleetStateCode = "deleted_running" - FleetStateCodeDeletedTerminatingInstances FleetStateCode = "deleted_terminating" - FleetStateCodeModifying FleetStateCode = "modifying" -) - -// Values returns all known values for FleetStateCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetStateCode) Values() []FleetStateCode { - return []FleetStateCode{ - "submitted", - "active", - "deleted", - "failed", - "deleted_running", - "deleted_terminating", - "modifying", - } -} - -type FleetType string - -// Enum values for FleetType -const ( - FleetTypeRequest FleetType = "request" - FleetTypeMaintain FleetType = "maintain" - FleetTypeInstant FleetType = "instant" -) - -// Values returns all known values for FleetType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FleetType) Values() []FleetType { - return []FleetType{ - "request", - "maintain", - "instant", - } -} - -type FlexibleEnaQueuesSupport string - -// Enum values for FlexibleEnaQueuesSupport -const ( - FlexibleEnaQueuesSupportUnsupported FlexibleEnaQueuesSupport = "unsupported" - FlexibleEnaQueuesSupportSupported FlexibleEnaQueuesSupport = "supported" -) - -// Values returns all known values for FlexibleEnaQueuesSupport. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FlexibleEnaQueuesSupport) Values() []FlexibleEnaQueuesSupport { - return []FlexibleEnaQueuesSupport{ - "unsupported", - "supported", - } -} - -type FlowLogsResourceType string - -// Enum values for FlowLogsResourceType -const ( - FlowLogsResourceTypeVpc FlowLogsResourceType = "VPC" - FlowLogsResourceTypeSubnet FlowLogsResourceType = "Subnet" - FlowLogsResourceTypeNetworkInterface FlowLogsResourceType = "NetworkInterface" - FlowLogsResourceTypeTransitGateway FlowLogsResourceType = "TransitGateway" - FlowLogsResourceTypeTransitGatewayAttachment FlowLogsResourceType = "TransitGatewayAttachment" -) - -// Values returns all known values for FlowLogsResourceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FlowLogsResourceType) Values() []FlowLogsResourceType { - return []FlowLogsResourceType{ - "VPC", - "Subnet", - "NetworkInterface", - "TransitGateway", - "TransitGatewayAttachment", - } -} - -type FpgaImageAttributeName string - -// Enum values for FpgaImageAttributeName -const ( - FpgaImageAttributeNameDescription FpgaImageAttributeName = "description" - FpgaImageAttributeNameName FpgaImageAttributeName = "name" - FpgaImageAttributeNameLoadPermission FpgaImageAttributeName = "loadPermission" - FpgaImageAttributeNameProductCodes FpgaImageAttributeName = "productCodes" -) - -// Values returns all known values for FpgaImageAttributeName. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FpgaImageAttributeName) Values() []FpgaImageAttributeName { - return []FpgaImageAttributeName{ - "description", - "name", - "loadPermission", - "productCodes", - } -} - -type FpgaImageStateCode string - -// Enum values for FpgaImageStateCode -const ( - FpgaImageStateCodePending FpgaImageStateCode = "pending" - FpgaImageStateCodeFailed FpgaImageStateCode = "failed" - FpgaImageStateCodeAvailable FpgaImageStateCode = "available" - FpgaImageStateCodeUnavailable FpgaImageStateCode = "unavailable" -) - -// Values returns all known values for FpgaImageStateCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FpgaImageStateCode) Values() []FpgaImageStateCode { - return []FpgaImageStateCode{ - "pending", - "failed", - "available", - "unavailable", - } -} - -type GatewayAssociationState string - -// Enum values for GatewayAssociationState -const ( - GatewayAssociationStateAssociated GatewayAssociationState = "associated" - GatewayAssociationStateNotAssociated GatewayAssociationState = "not-associated" - GatewayAssociationStateAssociating GatewayAssociationState = "associating" - GatewayAssociationStateDisassociating GatewayAssociationState = "disassociating" -) - -// Values returns all known values for GatewayAssociationState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (GatewayAssociationState) Values() []GatewayAssociationState { - return []GatewayAssociationState{ - "associated", - "not-associated", - "associating", - "disassociating", - } -} - -type GatewayType string - -// Enum values for GatewayType -const ( - GatewayTypeIpsec1 GatewayType = "ipsec.1" -) - -// Values returns all known values for GatewayType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (GatewayType) Values() []GatewayType { - return []GatewayType{ - "ipsec.1", - } -} - -type HostMaintenance string - -// Enum values for HostMaintenance -const ( - HostMaintenanceOn HostMaintenance = "on" - HostMaintenanceOff HostMaintenance = "off" -) - -// Values returns all known values for HostMaintenance. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HostMaintenance) Values() []HostMaintenance { - return []HostMaintenance{ - "on", - "off", - } -} - -type HostnameType string - -// Enum values for HostnameType -const ( - HostnameTypeIpName HostnameType = "ip-name" - HostnameTypeResourceName HostnameType = "resource-name" -) - -// Values returns all known values for HostnameType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HostnameType) Values() []HostnameType { - return []HostnameType{ - "ip-name", - "resource-name", - } -} - -type HostRecovery string - -// Enum values for HostRecovery -const ( - HostRecoveryOn HostRecovery = "on" - HostRecoveryOff HostRecovery = "off" -) - -// Values returns all known values for HostRecovery. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HostRecovery) Values() []HostRecovery { - return []HostRecovery{ - "on", - "off", - } -} - -type HostTenancy string - -// Enum values for HostTenancy -const ( - HostTenancyDefault HostTenancy = "default" - HostTenancyDedicated HostTenancy = "dedicated" - HostTenancyHost HostTenancy = "host" -) - -// Values returns all known values for HostTenancy. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HostTenancy) Values() []HostTenancy { - return []HostTenancy{ - "default", - "dedicated", - "host", - } -} - -type HttpTokensState string - -// Enum values for HttpTokensState -const ( - HttpTokensStateOptional HttpTokensState = "optional" - HttpTokensStateRequired HttpTokensState = "required" -) - -// Values returns all known values for HttpTokensState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HttpTokensState) Values() []HttpTokensState { - return []HttpTokensState{ - "optional", - "required", - } -} - -type HypervisorType string - -// Enum values for HypervisorType -const ( - HypervisorTypeOvm HypervisorType = "ovm" - HypervisorTypeXen HypervisorType = "xen" -) - -// Values returns all known values for HypervisorType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HypervisorType) Values() []HypervisorType { - return []HypervisorType{ - "ovm", - "xen", - } -} - -type IamInstanceProfileAssociationState string - -// Enum values for IamInstanceProfileAssociationState -const ( - IamInstanceProfileAssociationStateAssociating IamInstanceProfileAssociationState = "associating" - IamInstanceProfileAssociationStateAssociated IamInstanceProfileAssociationState = "associated" - IamInstanceProfileAssociationStateDisassociating IamInstanceProfileAssociationState = "disassociating" - IamInstanceProfileAssociationStateDisassociated IamInstanceProfileAssociationState = "disassociated" -) - -// Values returns all known values for IamInstanceProfileAssociationState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IamInstanceProfileAssociationState) Values() []IamInstanceProfileAssociationState { - return []IamInstanceProfileAssociationState{ - "associating", - "associated", - "disassociating", - "disassociated", - } -} - -type Igmpv2SupportValue string - -// Enum values for Igmpv2SupportValue -const ( - Igmpv2SupportValueEnable Igmpv2SupportValue = "enable" - Igmpv2SupportValueDisable Igmpv2SupportValue = "disable" -) - -// Values returns all known values for Igmpv2SupportValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Igmpv2SupportValue) Values() []Igmpv2SupportValue { - return []Igmpv2SupportValue{ - "enable", - "disable", - } -} - -type ImageAttributeName string - -// Enum values for ImageAttributeName -const ( - ImageAttributeNameDescription ImageAttributeName = "description" - ImageAttributeNameKernel ImageAttributeName = "kernel" - ImageAttributeNameRamdisk ImageAttributeName = "ramdisk" - ImageAttributeNameLaunchPermission ImageAttributeName = "launchPermission" - ImageAttributeNameProductCodes ImageAttributeName = "productCodes" - ImageAttributeNameBlockDeviceMapping ImageAttributeName = "blockDeviceMapping" - ImageAttributeNameSriovNetSupport ImageAttributeName = "sriovNetSupport" - ImageAttributeNameBootMode ImageAttributeName = "bootMode" - ImageAttributeNameTpmSupport ImageAttributeName = "tpmSupport" - ImageAttributeNameUefiData ImageAttributeName = "uefiData" - ImageAttributeNameLastLaunchedTime ImageAttributeName = "lastLaunchedTime" - ImageAttributeNameImdsSupport ImageAttributeName = "imdsSupport" - ImageAttributeNameDeregistrationProtection ImageAttributeName = "deregistrationProtection" -) - -// Values returns all known values for ImageAttributeName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImageAttributeName) Values() []ImageAttributeName { - return []ImageAttributeName{ - "description", - "kernel", - "ramdisk", - "launchPermission", - "productCodes", - "blockDeviceMapping", - "sriovNetSupport", - "bootMode", - "tpmSupport", - "uefiData", - "lastLaunchedTime", - "imdsSupport", - "deregistrationProtection", - } -} - -type ImageBlockPublicAccessDisabledState string - -// Enum values for ImageBlockPublicAccessDisabledState -const ( - ImageBlockPublicAccessDisabledStateUnblocked ImageBlockPublicAccessDisabledState = "unblocked" -) - -// Values returns all known values for ImageBlockPublicAccessDisabledState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImageBlockPublicAccessDisabledState) Values() []ImageBlockPublicAccessDisabledState { - return []ImageBlockPublicAccessDisabledState{ - "unblocked", - } -} - -type ImageBlockPublicAccessEnabledState string - -// Enum values for ImageBlockPublicAccessEnabledState -const ( - ImageBlockPublicAccessEnabledStateBlockNewSharing ImageBlockPublicAccessEnabledState = "block-new-sharing" -) - -// Values returns all known values for ImageBlockPublicAccessEnabledState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImageBlockPublicAccessEnabledState) Values() []ImageBlockPublicAccessEnabledState { - return []ImageBlockPublicAccessEnabledState{ - "block-new-sharing", - } -} - -type ImageState string - -// Enum values for ImageState -const ( - ImageStatePending ImageState = "pending" - ImageStateAvailable ImageState = "available" - ImageStateInvalid ImageState = "invalid" - ImageStateDeregistered ImageState = "deregistered" - ImageStateTransient ImageState = "transient" - ImageStateFailed ImageState = "failed" - ImageStateError ImageState = "error" - ImageStateDisabled ImageState = "disabled" -) - -// Values returns all known values for ImageState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImageState) Values() []ImageState { - return []ImageState{ - "pending", - "available", - "invalid", - "deregistered", - "transient", - "failed", - "error", - "disabled", - } -} - -type ImageTypeValues string - -// Enum values for ImageTypeValues -const ( - ImageTypeValuesMachine ImageTypeValues = "machine" - ImageTypeValuesKernel ImageTypeValues = "kernel" - ImageTypeValuesRamdisk ImageTypeValues = "ramdisk" -) - -// Values returns all known values for ImageTypeValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImageTypeValues) Values() []ImageTypeValues { - return []ImageTypeValues{ - "machine", - "kernel", - "ramdisk", - } -} - -type ImdsSupportValues string - -// Enum values for ImdsSupportValues -const ( - ImdsSupportValuesV20 ImdsSupportValues = "v2.0" -) - -// Values returns all known values for ImdsSupportValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ImdsSupportValues) Values() []ImdsSupportValues { - return []ImdsSupportValues{ - "v2.0", - } -} - -type InitializationType string - -// Enum values for InitializationType -const ( - InitializationTypeDefault InitializationType = "default" - InitializationTypeProvisionedRate InitializationType = "provisioned-rate" -) - -// Values returns all known values for InitializationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InitializationType) Values() []InitializationType { - return []InitializationType{ - "default", - "provisioned-rate", - } -} - -type InstanceAttributeName string - -// Enum values for InstanceAttributeName -const ( - InstanceAttributeNameInstanceType InstanceAttributeName = "instanceType" - InstanceAttributeNameKernel InstanceAttributeName = "kernel" - InstanceAttributeNameRamdisk InstanceAttributeName = "ramdisk" - InstanceAttributeNameUserData InstanceAttributeName = "userData" - InstanceAttributeNameDisableApiTermination InstanceAttributeName = "disableApiTermination" - InstanceAttributeNameInstanceInitiatedShutdownBehavior InstanceAttributeName = "instanceInitiatedShutdownBehavior" - InstanceAttributeNameRootDeviceName InstanceAttributeName = "rootDeviceName" - InstanceAttributeNameBlockDeviceMapping InstanceAttributeName = "blockDeviceMapping" - InstanceAttributeNameProductCodes InstanceAttributeName = "productCodes" - InstanceAttributeNameSourceDestCheck InstanceAttributeName = "sourceDestCheck" - InstanceAttributeNameGroupSet InstanceAttributeName = "groupSet" - InstanceAttributeNameEbsOptimized InstanceAttributeName = "ebsOptimized" - InstanceAttributeNameSriovNetSupport InstanceAttributeName = "sriovNetSupport" - InstanceAttributeNameEnaSupport InstanceAttributeName = "enaSupport" - InstanceAttributeNameEnclaveOptions InstanceAttributeName = "enclaveOptions" - InstanceAttributeNameDisableApiStop InstanceAttributeName = "disableApiStop" -) - -// Values returns all known values for InstanceAttributeName. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceAttributeName) Values() []InstanceAttributeName { - return []InstanceAttributeName{ - "instanceType", - "kernel", - "ramdisk", - "userData", - "disableApiTermination", - "instanceInitiatedShutdownBehavior", - "rootDeviceName", - "blockDeviceMapping", - "productCodes", - "sourceDestCheck", - "groupSet", - "ebsOptimized", - "sriovNetSupport", - "enaSupport", - "enclaveOptions", - "disableApiStop", - } -} - -type InstanceAutoRecoveryState string - -// Enum values for InstanceAutoRecoveryState -const ( - InstanceAutoRecoveryStateDisabled InstanceAutoRecoveryState = "disabled" - InstanceAutoRecoveryStateDefault InstanceAutoRecoveryState = "default" -) - -// Values returns all known values for InstanceAutoRecoveryState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceAutoRecoveryState) Values() []InstanceAutoRecoveryState { - return []InstanceAutoRecoveryState{ - "disabled", - "default", - } -} - -type InstanceBandwidthWeighting string - -// Enum values for InstanceBandwidthWeighting -const ( - InstanceBandwidthWeightingDefault InstanceBandwidthWeighting = "default" - InstanceBandwidthWeightingVpc1 InstanceBandwidthWeighting = "vpc-1" - InstanceBandwidthWeightingEbs1 InstanceBandwidthWeighting = "ebs-1" -) - -// Values returns all known values for InstanceBandwidthWeighting. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceBandwidthWeighting) Values() []InstanceBandwidthWeighting { - return []InstanceBandwidthWeighting{ - "default", - "vpc-1", - "ebs-1", - } -} - -type InstanceBootModeValues string - -// Enum values for InstanceBootModeValues -const ( - InstanceBootModeValuesLegacyBios InstanceBootModeValues = "legacy-bios" - InstanceBootModeValuesUefi InstanceBootModeValues = "uefi" -) - -// Values returns all known values for InstanceBootModeValues. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceBootModeValues) Values() []InstanceBootModeValues { - return []InstanceBootModeValues{ - "legacy-bios", - "uefi", - } -} - -type InstanceEventWindowState string - -// Enum values for InstanceEventWindowState -const ( - InstanceEventWindowStateCreating InstanceEventWindowState = "creating" - InstanceEventWindowStateDeleting InstanceEventWindowState = "deleting" - InstanceEventWindowStateActive InstanceEventWindowState = "active" - InstanceEventWindowStateDeleted InstanceEventWindowState = "deleted" -) - -// Values returns all known values for InstanceEventWindowState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceEventWindowState) Values() []InstanceEventWindowState { - return []InstanceEventWindowState{ - "creating", - "deleting", - "active", - "deleted", - } -} - -type InstanceGeneration string - -// Enum values for InstanceGeneration -const ( - InstanceGenerationCurrent InstanceGeneration = "current" - InstanceGenerationPrevious InstanceGeneration = "previous" -) - -// Values returns all known values for InstanceGeneration. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceGeneration) Values() []InstanceGeneration { - return []InstanceGeneration{ - "current", - "previous", - } -} - -type InstanceHealthStatus string - -// Enum values for InstanceHealthStatus -const ( - InstanceHealthStatusHealthyStatus InstanceHealthStatus = "healthy" - InstanceHealthStatusUnhealthyStatus InstanceHealthStatus = "unhealthy" -) - -// Values returns all known values for InstanceHealthStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceHealthStatus) Values() []InstanceHealthStatus { - return []InstanceHealthStatus{ - "healthy", - "unhealthy", - } -} - -type InstanceInterruptionBehavior string - -// Enum values for InstanceInterruptionBehavior -const ( - InstanceInterruptionBehaviorHibernate InstanceInterruptionBehavior = "hibernate" - InstanceInterruptionBehaviorStop InstanceInterruptionBehavior = "stop" - InstanceInterruptionBehaviorTerminate InstanceInterruptionBehavior = "terminate" -) - -// Values returns all known values for InstanceInterruptionBehavior. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceInterruptionBehavior) Values() []InstanceInterruptionBehavior { - return []InstanceInterruptionBehavior{ - "hibernate", - "stop", - "terminate", - } -} - -type InstanceLifecycle string - -// Enum values for InstanceLifecycle -const ( - InstanceLifecycleSpot InstanceLifecycle = "spot" - InstanceLifecycleOnDemand InstanceLifecycle = "on-demand" -) - -// Values returns all known values for InstanceLifecycle. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceLifecycle) Values() []InstanceLifecycle { - return []InstanceLifecycle{ - "spot", - "on-demand", - } -} - -type InstanceLifecycleType string - -// Enum values for InstanceLifecycleType -const ( - InstanceLifecycleTypeSpot InstanceLifecycleType = "spot" - InstanceLifecycleTypeScheduled InstanceLifecycleType = "scheduled" - InstanceLifecycleTypeCapacityBlock InstanceLifecycleType = "capacity-block" -) - -// Values returns all known values for InstanceLifecycleType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceLifecycleType) Values() []InstanceLifecycleType { - return []InstanceLifecycleType{ - "spot", - "scheduled", - "capacity-block", - } -} - -type InstanceMatchCriteria string - -// Enum values for InstanceMatchCriteria -const ( - InstanceMatchCriteriaOpen InstanceMatchCriteria = "open" - InstanceMatchCriteriaTargeted InstanceMatchCriteria = "targeted" -) - -// Values returns all known values for InstanceMatchCriteria. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceMatchCriteria) Values() []InstanceMatchCriteria { - return []InstanceMatchCriteria{ - "open", - "targeted", - } -} - -type InstanceMetadataEndpointState string - -// Enum values for InstanceMetadataEndpointState -const ( - InstanceMetadataEndpointStateDisabled InstanceMetadataEndpointState = "disabled" - InstanceMetadataEndpointStateEnabled InstanceMetadataEndpointState = "enabled" -) - -// Values returns all known values for InstanceMetadataEndpointState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceMetadataEndpointState) Values() []InstanceMetadataEndpointState { - return []InstanceMetadataEndpointState{ - "disabled", - "enabled", - } -} - -type InstanceMetadataOptionsState string - -// Enum values for InstanceMetadataOptionsState -const ( - InstanceMetadataOptionsStatePending InstanceMetadataOptionsState = "pending" - InstanceMetadataOptionsStateApplied InstanceMetadataOptionsState = "applied" -) - -// Values returns all known values for InstanceMetadataOptionsState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceMetadataOptionsState) Values() []InstanceMetadataOptionsState { - return []InstanceMetadataOptionsState{ - "pending", - "applied", - } -} - -type InstanceMetadataProtocolState string - -// Enum values for InstanceMetadataProtocolState -const ( - InstanceMetadataProtocolStateDisabled InstanceMetadataProtocolState = "disabled" - InstanceMetadataProtocolStateEnabled InstanceMetadataProtocolState = "enabled" -) - -// Values returns all known values for InstanceMetadataProtocolState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceMetadataProtocolState) Values() []InstanceMetadataProtocolState { - return []InstanceMetadataProtocolState{ - "disabled", - "enabled", - } -} - -type InstanceMetadataTagsState string - -// Enum values for InstanceMetadataTagsState -const ( - InstanceMetadataTagsStateDisabled InstanceMetadataTagsState = "disabled" - InstanceMetadataTagsStateEnabled InstanceMetadataTagsState = "enabled" -) - -// Values returns all known values for InstanceMetadataTagsState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceMetadataTagsState) Values() []InstanceMetadataTagsState { - return []InstanceMetadataTagsState{ - "disabled", - "enabled", - } -} - -type InstanceRebootMigrationState string - -// Enum values for InstanceRebootMigrationState -const ( - InstanceRebootMigrationStateDisabled InstanceRebootMigrationState = "disabled" - InstanceRebootMigrationStateDefault InstanceRebootMigrationState = "default" -) - -// Values returns all known values for InstanceRebootMigrationState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceRebootMigrationState) Values() []InstanceRebootMigrationState { - return []InstanceRebootMigrationState{ - "disabled", - "default", - } -} - -type InstanceStateName string - -// Enum values for InstanceStateName -const ( - InstanceStateNamePending InstanceStateName = "pending" - InstanceStateNameRunning InstanceStateName = "running" - InstanceStateNameShuttingDown InstanceStateName = "shutting-down" - InstanceStateNameTerminated InstanceStateName = "terminated" - InstanceStateNameStopping InstanceStateName = "stopping" - InstanceStateNameStopped InstanceStateName = "stopped" -) - -// Values returns all known values for InstanceStateName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceStateName) Values() []InstanceStateName { - return []InstanceStateName{ - "pending", - "running", - "shutting-down", - "terminated", - "stopping", - "stopped", - } -} - -type InstanceStorageEncryptionSupport string - -// Enum values for InstanceStorageEncryptionSupport -const ( - InstanceStorageEncryptionSupportUnsupported InstanceStorageEncryptionSupport = "unsupported" - InstanceStorageEncryptionSupportRequired InstanceStorageEncryptionSupport = "required" -) - -// Values returns all known values for InstanceStorageEncryptionSupport. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceStorageEncryptionSupport) Values() []InstanceStorageEncryptionSupport { - return []InstanceStorageEncryptionSupport{ - "unsupported", - "required", - } -} - -type InstanceType string - -// Enum values for InstanceType -const ( - InstanceTypeA1Medium InstanceType = "a1.medium" - InstanceTypeA1Large InstanceType = "a1.large" - InstanceTypeA1Xlarge InstanceType = "a1.xlarge" - InstanceTypeA12xlarge InstanceType = "a1.2xlarge" - InstanceTypeA14xlarge InstanceType = "a1.4xlarge" - InstanceTypeA1Metal InstanceType = "a1.metal" - InstanceTypeC1Medium InstanceType = "c1.medium" - InstanceTypeC1Xlarge InstanceType = "c1.xlarge" - InstanceTypeC3Large InstanceType = "c3.large" - InstanceTypeC3Xlarge InstanceType = "c3.xlarge" - InstanceTypeC32xlarge InstanceType = "c3.2xlarge" - InstanceTypeC34xlarge InstanceType = "c3.4xlarge" - InstanceTypeC38xlarge InstanceType = "c3.8xlarge" - InstanceTypeC4Large InstanceType = "c4.large" - InstanceTypeC4Xlarge InstanceType = "c4.xlarge" - InstanceTypeC42xlarge InstanceType = "c4.2xlarge" - InstanceTypeC44xlarge InstanceType = "c4.4xlarge" - InstanceTypeC48xlarge InstanceType = "c4.8xlarge" - InstanceTypeC5Large InstanceType = "c5.large" - InstanceTypeC5Xlarge InstanceType = "c5.xlarge" - InstanceTypeC52xlarge InstanceType = "c5.2xlarge" - InstanceTypeC54xlarge InstanceType = "c5.4xlarge" - InstanceTypeC59xlarge InstanceType = "c5.9xlarge" - InstanceTypeC512xlarge InstanceType = "c5.12xlarge" - InstanceTypeC518xlarge InstanceType = "c5.18xlarge" - InstanceTypeC524xlarge InstanceType = "c5.24xlarge" - InstanceTypeC5Metal InstanceType = "c5.metal" - InstanceTypeC5aLarge InstanceType = "c5a.large" - InstanceTypeC5aXlarge InstanceType = "c5a.xlarge" - InstanceTypeC5a2xlarge InstanceType = "c5a.2xlarge" - InstanceTypeC5a4xlarge InstanceType = "c5a.4xlarge" - InstanceTypeC5a8xlarge InstanceType = "c5a.8xlarge" - InstanceTypeC5a12xlarge InstanceType = "c5a.12xlarge" - InstanceTypeC5a16xlarge InstanceType = "c5a.16xlarge" - InstanceTypeC5a24xlarge InstanceType = "c5a.24xlarge" - InstanceTypeC5adLarge InstanceType = "c5ad.large" - InstanceTypeC5adXlarge InstanceType = "c5ad.xlarge" - InstanceTypeC5ad2xlarge InstanceType = "c5ad.2xlarge" - InstanceTypeC5ad4xlarge InstanceType = "c5ad.4xlarge" - InstanceTypeC5ad8xlarge InstanceType = "c5ad.8xlarge" - InstanceTypeC5ad12xlarge InstanceType = "c5ad.12xlarge" - InstanceTypeC5ad16xlarge InstanceType = "c5ad.16xlarge" - InstanceTypeC5ad24xlarge InstanceType = "c5ad.24xlarge" - InstanceTypeC5dLarge InstanceType = "c5d.large" - InstanceTypeC5dXlarge InstanceType = "c5d.xlarge" - InstanceTypeC5d2xlarge InstanceType = "c5d.2xlarge" - InstanceTypeC5d4xlarge InstanceType = "c5d.4xlarge" - InstanceTypeC5d9xlarge InstanceType = "c5d.9xlarge" - InstanceTypeC5d12xlarge InstanceType = "c5d.12xlarge" - InstanceTypeC5d18xlarge InstanceType = "c5d.18xlarge" - InstanceTypeC5d24xlarge InstanceType = "c5d.24xlarge" - InstanceTypeC5dMetal InstanceType = "c5d.metal" - InstanceTypeC5nLarge InstanceType = "c5n.large" - InstanceTypeC5nXlarge InstanceType = "c5n.xlarge" - InstanceTypeC5n2xlarge InstanceType = "c5n.2xlarge" - InstanceTypeC5n4xlarge InstanceType = "c5n.4xlarge" - InstanceTypeC5n9xlarge InstanceType = "c5n.9xlarge" - InstanceTypeC5n18xlarge InstanceType = "c5n.18xlarge" - InstanceTypeC5nMetal InstanceType = "c5n.metal" - InstanceTypeC6gMedium InstanceType = "c6g.medium" - InstanceTypeC6gLarge InstanceType = "c6g.large" - InstanceTypeC6gXlarge InstanceType = "c6g.xlarge" - InstanceTypeC6g2xlarge InstanceType = "c6g.2xlarge" - InstanceTypeC6g4xlarge InstanceType = "c6g.4xlarge" - InstanceTypeC6g8xlarge InstanceType = "c6g.8xlarge" - InstanceTypeC6g12xlarge InstanceType = "c6g.12xlarge" - InstanceTypeC6g16xlarge InstanceType = "c6g.16xlarge" - InstanceTypeC6gMetal InstanceType = "c6g.metal" - InstanceTypeC6gdMedium InstanceType = "c6gd.medium" - InstanceTypeC6gdLarge InstanceType = "c6gd.large" - InstanceTypeC6gdXlarge InstanceType = "c6gd.xlarge" - InstanceTypeC6gd2xlarge InstanceType = "c6gd.2xlarge" - InstanceTypeC6gd4xlarge InstanceType = "c6gd.4xlarge" - InstanceTypeC6gd8xlarge InstanceType = "c6gd.8xlarge" - InstanceTypeC6gd12xlarge InstanceType = "c6gd.12xlarge" - InstanceTypeC6gd16xlarge InstanceType = "c6gd.16xlarge" - InstanceTypeC6gdMetal InstanceType = "c6gd.metal" - InstanceTypeC6gnMedium InstanceType = "c6gn.medium" - InstanceTypeC6gnLarge InstanceType = "c6gn.large" - InstanceTypeC6gnXlarge InstanceType = "c6gn.xlarge" - InstanceTypeC6gn2xlarge InstanceType = "c6gn.2xlarge" - InstanceTypeC6gn4xlarge InstanceType = "c6gn.4xlarge" - InstanceTypeC6gn8xlarge InstanceType = "c6gn.8xlarge" - InstanceTypeC6gn12xlarge InstanceType = "c6gn.12xlarge" - InstanceTypeC6gn16xlarge InstanceType = "c6gn.16xlarge" - InstanceTypeC6iLarge InstanceType = "c6i.large" - InstanceTypeC6iXlarge InstanceType = "c6i.xlarge" - InstanceTypeC6i2xlarge InstanceType = "c6i.2xlarge" - InstanceTypeC6i4xlarge InstanceType = "c6i.4xlarge" - InstanceTypeC6i8xlarge InstanceType = "c6i.8xlarge" - InstanceTypeC6i12xlarge InstanceType = "c6i.12xlarge" - InstanceTypeC6i16xlarge InstanceType = "c6i.16xlarge" - InstanceTypeC6i24xlarge InstanceType = "c6i.24xlarge" - InstanceTypeC6i32xlarge InstanceType = "c6i.32xlarge" - InstanceTypeC6iMetal InstanceType = "c6i.metal" - InstanceTypeCc14xlarge InstanceType = "cc1.4xlarge" - InstanceTypeCc28xlarge InstanceType = "cc2.8xlarge" - InstanceTypeCg14xlarge InstanceType = "cg1.4xlarge" - InstanceTypeCr18xlarge InstanceType = "cr1.8xlarge" - InstanceTypeD2Xlarge InstanceType = "d2.xlarge" - InstanceTypeD22xlarge InstanceType = "d2.2xlarge" - InstanceTypeD24xlarge InstanceType = "d2.4xlarge" - InstanceTypeD28xlarge InstanceType = "d2.8xlarge" - InstanceTypeD3Xlarge InstanceType = "d3.xlarge" - InstanceTypeD32xlarge InstanceType = "d3.2xlarge" - InstanceTypeD34xlarge InstanceType = "d3.4xlarge" - InstanceTypeD38xlarge InstanceType = "d3.8xlarge" - InstanceTypeD3enXlarge InstanceType = "d3en.xlarge" - InstanceTypeD3en2xlarge InstanceType = "d3en.2xlarge" - InstanceTypeD3en4xlarge InstanceType = "d3en.4xlarge" - InstanceTypeD3en6xlarge InstanceType = "d3en.6xlarge" - InstanceTypeD3en8xlarge InstanceType = "d3en.8xlarge" - InstanceTypeD3en12xlarge InstanceType = "d3en.12xlarge" - InstanceTypeDl124xlarge InstanceType = "dl1.24xlarge" - InstanceTypeF12xlarge InstanceType = "f1.2xlarge" - InstanceTypeF14xlarge InstanceType = "f1.4xlarge" - InstanceTypeF116xlarge InstanceType = "f1.16xlarge" - InstanceTypeG22xlarge InstanceType = "g2.2xlarge" - InstanceTypeG28xlarge InstanceType = "g2.8xlarge" - InstanceTypeG34xlarge InstanceType = "g3.4xlarge" - InstanceTypeG38xlarge InstanceType = "g3.8xlarge" - InstanceTypeG316xlarge InstanceType = "g3.16xlarge" - InstanceTypeG3sXlarge InstanceType = "g3s.xlarge" - InstanceTypeG4adXlarge InstanceType = "g4ad.xlarge" - InstanceTypeG4ad2xlarge InstanceType = "g4ad.2xlarge" - InstanceTypeG4ad4xlarge InstanceType = "g4ad.4xlarge" - InstanceTypeG4ad8xlarge InstanceType = "g4ad.8xlarge" - InstanceTypeG4ad16xlarge InstanceType = "g4ad.16xlarge" - InstanceTypeG4dnXlarge InstanceType = "g4dn.xlarge" - InstanceTypeG4dn2xlarge InstanceType = "g4dn.2xlarge" - InstanceTypeG4dn4xlarge InstanceType = "g4dn.4xlarge" - InstanceTypeG4dn8xlarge InstanceType = "g4dn.8xlarge" - InstanceTypeG4dn12xlarge InstanceType = "g4dn.12xlarge" - InstanceTypeG4dn16xlarge InstanceType = "g4dn.16xlarge" - InstanceTypeG4dnMetal InstanceType = "g4dn.metal" - InstanceTypeG5Xlarge InstanceType = "g5.xlarge" - InstanceTypeG52xlarge InstanceType = "g5.2xlarge" - InstanceTypeG54xlarge InstanceType = "g5.4xlarge" - InstanceTypeG58xlarge InstanceType = "g5.8xlarge" - InstanceTypeG512xlarge InstanceType = "g5.12xlarge" - InstanceTypeG516xlarge InstanceType = "g5.16xlarge" - InstanceTypeG524xlarge InstanceType = "g5.24xlarge" - InstanceTypeG548xlarge InstanceType = "g5.48xlarge" - InstanceTypeG5gXlarge InstanceType = "g5g.xlarge" - InstanceTypeG5g2xlarge InstanceType = "g5g.2xlarge" - InstanceTypeG5g4xlarge InstanceType = "g5g.4xlarge" - InstanceTypeG5g8xlarge InstanceType = "g5g.8xlarge" - InstanceTypeG5g16xlarge InstanceType = "g5g.16xlarge" - InstanceTypeG5gMetal InstanceType = "g5g.metal" - InstanceTypeHi14xlarge InstanceType = "hi1.4xlarge" - InstanceTypeHpc6a48xlarge InstanceType = "hpc6a.48xlarge" - InstanceTypeHs18xlarge InstanceType = "hs1.8xlarge" - InstanceTypeH12xlarge InstanceType = "h1.2xlarge" - InstanceTypeH14xlarge InstanceType = "h1.4xlarge" - InstanceTypeH18xlarge InstanceType = "h1.8xlarge" - InstanceTypeH116xlarge InstanceType = "h1.16xlarge" - InstanceTypeI2Xlarge InstanceType = "i2.xlarge" - InstanceTypeI22xlarge InstanceType = "i2.2xlarge" - InstanceTypeI24xlarge InstanceType = "i2.4xlarge" - InstanceTypeI28xlarge InstanceType = "i2.8xlarge" - InstanceTypeI3Large InstanceType = "i3.large" - InstanceTypeI3Xlarge InstanceType = "i3.xlarge" - InstanceTypeI32xlarge InstanceType = "i3.2xlarge" - InstanceTypeI34xlarge InstanceType = "i3.4xlarge" - InstanceTypeI38xlarge InstanceType = "i3.8xlarge" - InstanceTypeI316xlarge InstanceType = "i3.16xlarge" - InstanceTypeI3Metal InstanceType = "i3.metal" - InstanceTypeI3enLarge InstanceType = "i3en.large" - InstanceTypeI3enXlarge InstanceType = "i3en.xlarge" - InstanceTypeI3en2xlarge InstanceType = "i3en.2xlarge" - InstanceTypeI3en3xlarge InstanceType = "i3en.3xlarge" - InstanceTypeI3en6xlarge InstanceType = "i3en.6xlarge" - InstanceTypeI3en12xlarge InstanceType = "i3en.12xlarge" - InstanceTypeI3en24xlarge InstanceType = "i3en.24xlarge" - InstanceTypeI3enMetal InstanceType = "i3en.metal" - InstanceTypeIm4gnLarge InstanceType = "im4gn.large" - InstanceTypeIm4gnXlarge InstanceType = "im4gn.xlarge" - InstanceTypeIm4gn2xlarge InstanceType = "im4gn.2xlarge" - InstanceTypeIm4gn4xlarge InstanceType = "im4gn.4xlarge" - InstanceTypeIm4gn8xlarge InstanceType = "im4gn.8xlarge" - InstanceTypeIm4gn16xlarge InstanceType = "im4gn.16xlarge" - InstanceTypeInf1Xlarge InstanceType = "inf1.xlarge" - InstanceTypeInf12xlarge InstanceType = "inf1.2xlarge" - InstanceTypeInf16xlarge InstanceType = "inf1.6xlarge" - InstanceTypeInf124xlarge InstanceType = "inf1.24xlarge" - InstanceTypeIs4genMedium InstanceType = "is4gen.medium" - InstanceTypeIs4genLarge InstanceType = "is4gen.large" - InstanceTypeIs4genXlarge InstanceType = "is4gen.xlarge" - InstanceTypeIs4gen2xlarge InstanceType = "is4gen.2xlarge" - InstanceTypeIs4gen4xlarge InstanceType = "is4gen.4xlarge" - InstanceTypeIs4gen8xlarge InstanceType = "is4gen.8xlarge" - InstanceTypeM1Small InstanceType = "m1.small" - InstanceTypeM1Medium InstanceType = "m1.medium" - InstanceTypeM1Large InstanceType = "m1.large" - InstanceTypeM1Xlarge InstanceType = "m1.xlarge" - InstanceTypeM2Xlarge InstanceType = "m2.xlarge" - InstanceTypeM22xlarge InstanceType = "m2.2xlarge" - InstanceTypeM24xlarge InstanceType = "m2.4xlarge" - InstanceTypeM3Medium InstanceType = "m3.medium" - InstanceTypeM3Large InstanceType = "m3.large" - InstanceTypeM3Xlarge InstanceType = "m3.xlarge" - InstanceTypeM32xlarge InstanceType = "m3.2xlarge" - InstanceTypeM4Large InstanceType = "m4.large" - InstanceTypeM4Xlarge InstanceType = "m4.xlarge" - InstanceTypeM42xlarge InstanceType = "m4.2xlarge" - InstanceTypeM44xlarge InstanceType = "m4.4xlarge" - InstanceTypeM410xlarge InstanceType = "m4.10xlarge" - InstanceTypeM416xlarge InstanceType = "m4.16xlarge" - InstanceTypeM5Large InstanceType = "m5.large" - InstanceTypeM5Xlarge InstanceType = "m5.xlarge" - InstanceTypeM52xlarge InstanceType = "m5.2xlarge" - InstanceTypeM54xlarge InstanceType = "m5.4xlarge" - InstanceTypeM58xlarge InstanceType = "m5.8xlarge" - InstanceTypeM512xlarge InstanceType = "m5.12xlarge" - InstanceTypeM516xlarge InstanceType = "m5.16xlarge" - InstanceTypeM524xlarge InstanceType = "m5.24xlarge" - InstanceTypeM5Metal InstanceType = "m5.metal" - InstanceTypeM5aLarge InstanceType = "m5a.large" - InstanceTypeM5aXlarge InstanceType = "m5a.xlarge" - InstanceTypeM5a2xlarge InstanceType = "m5a.2xlarge" - InstanceTypeM5a4xlarge InstanceType = "m5a.4xlarge" - InstanceTypeM5a8xlarge InstanceType = "m5a.8xlarge" - InstanceTypeM5a12xlarge InstanceType = "m5a.12xlarge" - InstanceTypeM5a16xlarge InstanceType = "m5a.16xlarge" - InstanceTypeM5a24xlarge InstanceType = "m5a.24xlarge" - InstanceTypeM5adLarge InstanceType = "m5ad.large" - InstanceTypeM5adXlarge InstanceType = "m5ad.xlarge" - InstanceTypeM5ad2xlarge InstanceType = "m5ad.2xlarge" - InstanceTypeM5ad4xlarge InstanceType = "m5ad.4xlarge" - InstanceTypeM5ad8xlarge InstanceType = "m5ad.8xlarge" - InstanceTypeM5ad12xlarge InstanceType = "m5ad.12xlarge" - InstanceTypeM5ad16xlarge InstanceType = "m5ad.16xlarge" - InstanceTypeM5ad24xlarge InstanceType = "m5ad.24xlarge" - InstanceTypeM5dLarge InstanceType = "m5d.large" - InstanceTypeM5dXlarge InstanceType = "m5d.xlarge" - InstanceTypeM5d2xlarge InstanceType = "m5d.2xlarge" - InstanceTypeM5d4xlarge InstanceType = "m5d.4xlarge" - InstanceTypeM5d8xlarge InstanceType = "m5d.8xlarge" - InstanceTypeM5d12xlarge InstanceType = "m5d.12xlarge" - InstanceTypeM5d16xlarge InstanceType = "m5d.16xlarge" - InstanceTypeM5d24xlarge InstanceType = "m5d.24xlarge" - InstanceTypeM5dMetal InstanceType = "m5d.metal" - InstanceTypeM5dnLarge InstanceType = "m5dn.large" - InstanceTypeM5dnXlarge InstanceType = "m5dn.xlarge" - InstanceTypeM5dn2xlarge InstanceType = "m5dn.2xlarge" - InstanceTypeM5dn4xlarge InstanceType = "m5dn.4xlarge" - InstanceTypeM5dn8xlarge InstanceType = "m5dn.8xlarge" - InstanceTypeM5dn12xlarge InstanceType = "m5dn.12xlarge" - InstanceTypeM5dn16xlarge InstanceType = "m5dn.16xlarge" - InstanceTypeM5dn24xlarge InstanceType = "m5dn.24xlarge" - InstanceTypeM5dnMetal InstanceType = "m5dn.metal" - InstanceTypeM5nLarge InstanceType = "m5n.large" - InstanceTypeM5nXlarge InstanceType = "m5n.xlarge" - InstanceTypeM5n2xlarge InstanceType = "m5n.2xlarge" - InstanceTypeM5n4xlarge InstanceType = "m5n.4xlarge" - InstanceTypeM5n8xlarge InstanceType = "m5n.8xlarge" - InstanceTypeM5n12xlarge InstanceType = "m5n.12xlarge" - InstanceTypeM5n16xlarge InstanceType = "m5n.16xlarge" - InstanceTypeM5n24xlarge InstanceType = "m5n.24xlarge" - InstanceTypeM5nMetal InstanceType = "m5n.metal" - InstanceTypeM5znLarge InstanceType = "m5zn.large" - InstanceTypeM5znXlarge InstanceType = "m5zn.xlarge" - InstanceTypeM5zn2xlarge InstanceType = "m5zn.2xlarge" - InstanceTypeM5zn3xlarge InstanceType = "m5zn.3xlarge" - InstanceTypeM5zn6xlarge InstanceType = "m5zn.6xlarge" - InstanceTypeM5zn12xlarge InstanceType = "m5zn.12xlarge" - InstanceTypeM5znMetal InstanceType = "m5zn.metal" - InstanceTypeM6aLarge InstanceType = "m6a.large" - InstanceTypeM6aXlarge InstanceType = "m6a.xlarge" - InstanceTypeM6a2xlarge InstanceType = "m6a.2xlarge" - InstanceTypeM6a4xlarge InstanceType = "m6a.4xlarge" - InstanceTypeM6a8xlarge InstanceType = "m6a.8xlarge" - InstanceTypeM6a12xlarge InstanceType = "m6a.12xlarge" - InstanceTypeM6a16xlarge InstanceType = "m6a.16xlarge" - InstanceTypeM6a24xlarge InstanceType = "m6a.24xlarge" - InstanceTypeM6a32xlarge InstanceType = "m6a.32xlarge" - InstanceTypeM6a48xlarge InstanceType = "m6a.48xlarge" - InstanceTypeM6gMetal InstanceType = "m6g.metal" - InstanceTypeM6gMedium InstanceType = "m6g.medium" - InstanceTypeM6gLarge InstanceType = "m6g.large" - InstanceTypeM6gXlarge InstanceType = "m6g.xlarge" - InstanceTypeM6g2xlarge InstanceType = "m6g.2xlarge" - InstanceTypeM6g4xlarge InstanceType = "m6g.4xlarge" - InstanceTypeM6g8xlarge InstanceType = "m6g.8xlarge" - InstanceTypeM6g12xlarge InstanceType = "m6g.12xlarge" - InstanceTypeM6g16xlarge InstanceType = "m6g.16xlarge" - InstanceTypeM6gdMetal InstanceType = "m6gd.metal" - InstanceTypeM6gdMedium InstanceType = "m6gd.medium" - InstanceTypeM6gdLarge InstanceType = "m6gd.large" - InstanceTypeM6gdXlarge InstanceType = "m6gd.xlarge" - InstanceTypeM6gd2xlarge InstanceType = "m6gd.2xlarge" - InstanceTypeM6gd4xlarge InstanceType = "m6gd.4xlarge" - InstanceTypeM6gd8xlarge InstanceType = "m6gd.8xlarge" - InstanceTypeM6gd12xlarge InstanceType = "m6gd.12xlarge" - InstanceTypeM6gd16xlarge InstanceType = "m6gd.16xlarge" - InstanceTypeM6iLarge InstanceType = "m6i.large" - InstanceTypeM6iXlarge InstanceType = "m6i.xlarge" - InstanceTypeM6i2xlarge InstanceType = "m6i.2xlarge" - InstanceTypeM6i4xlarge InstanceType = "m6i.4xlarge" - InstanceTypeM6i8xlarge InstanceType = "m6i.8xlarge" - InstanceTypeM6i12xlarge InstanceType = "m6i.12xlarge" - InstanceTypeM6i16xlarge InstanceType = "m6i.16xlarge" - InstanceTypeM6i24xlarge InstanceType = "m6i.24xlarge" - InstanceTypeM6i32xlarge InstanceType = "m6i.32xlarge" - InstanceTypeM6iMetal InstanceType = "m6i.metal" - InstanceTypeMac1Metal InstanceType = "mac1.metal" - InstanceTypeP2Xlarge InstanceType = "p2.xlarge" - InstanceTypeP28xlarge InstanceType = "p2.8xlarge" - InstanceTypeP216xlarge InstanceType = "p2.16xlarge" - InstanceTypeP32xlarge InstanceType = "p3.2xlarge" - InstanceTypeP38xlarge InstanceType = "p3.8xlarge" - InstanceTypeP316xlarge InstanceType = "p3.16xlarge" - InstanceTypeP3dn24xlarge InstanceType = "p3dn.24xlarge" - InstanceTypeP4d24xlarge InstanceType = "p4d.24xlarge" - InstanceTypeR3Large InstanceType = "r3.large" - InstanceTypeR3Xlarge InstanceType = "r3.xlarge" - InstanceTypeR32xlarge InstanceType = "r3.2xlarge" - InstanceTypeR34xlarge InstanceType = "r3.4xlarge" - InstanceTypeR38xlarge InstanceType = "r3.8xlarge" - InstanceTypeR4Large InstanceType = "r4.large" - InstanceTypeR4Xlarge InstanceType = "r4.xlarge" - InstanceTypeR42xlarge InstanceType = "r4.2xlarge" - InstanceTypeR44xlarge InstanceType = "r4.4xlarge" - InstanceTypeR48xlarge InstanceType = "r4.8xlarge" - InstanceTypeR416xlarge InstanceType = "r4.16xlarge" - InstanceTypeR5Large InstanceType = "r5.large" - InstanceTypeR5Xlarge InstanceType = "r5.xlarge" - InstanceTypeR52xlarge InstanceType = "r5.2xlarge" - InstanceTypeR54xlarge InstanceType = "r5.4xlarge" - InstanceTypeR58xlarge InstanceType = "r5.8xlarge" - InstanceTypeR512xlarge InstanceType = "r5.12xlarge" - InstanceTypeR516xlarge InstanceType = "r5.16xlarge" - InstanceTypeR524xlarge InstanceType = "r5.24xlarge" - InstanceTypeR5Metal InstanceType = "r5.metal" - InstanceTypeR5aLarge InstanceType = "r5a.large" - InstanceTypeR5aXlarge InstanceType = "r5a.xlarge" - InstanceTypeR5a2xlarge InstanceType = "r5a.2xlarge" - InstanceTypeR5a4xlarge InstanceType = "r5a.4xlarge" - InstanceTypeR5a8xlarge InstanceType = "r5a.8xlarge" - InstanceTypeR5a12xlarge InstanceType = "r5a.12xlarge" - InstanceTypeR5a16xlarge InstanceType = "r5a.16xlarge" - InstanceTypeR5a24xlarge InstanceType = "r5a.24xlarge" - InstanceTypeR5adLarge InstanceType = "r5ad.large" - InstanceTypeR5adXlarge InstanceType = "r5ad.xlarge" - InstanceTypeR5ad2xlarge InstanceType = "r5ad.2xlarge" - InstanceTypeR5ad4xlarge InstanceType = "r5ad.4xlarge" - InstanceTypeR5ad8xlarge InstanceType = "r5ad.8xlarge" - InstanceTypeR5ad12xlarge InstanceType = "r5ad.12xlarge" - InstanceTypeR5ad16xlarge InstanceType = "r5ad.16xlarge" - InstanceTypeR5ad24xlarge InstanceType = "r5ad.24xlarge" - InstanceTypeR5bLarge InstanceType = "r5b.large" - InstanceTypeR5bXlarge InstanceType = "r5b.xlarge" - InstanceTypeR5b2xlarge InstanceType = "r5b.2xlarge" - InstanceTypeR5b4xlarge InstanceType = "r5b.4xlarge" - InstanceTypeR5b8xlarge InstanceType = "r5b.8xlarge" - InstanceTypeR5b12xlarge InstanceType = "r5b.12xlarge" - InstanceTypeR5b16xlarge InstanceType = "r5b.16xlarge" - InstanceTypeR5b24xlarge InstanceType = "r5b.24xlarge" - InstanceTypeR5bMetal InstanceType = "r5b.metal" - InstanceTypeR5dLarge InstanceType = "r5d.large" - InstanceTypeR5dXlarge InstanceType = "r5d.xlarge" - InstanceTypeR5d2xlarge InstanceType = "r5d.2xlarge" - InstanceTypeR5d4xlarge InstanceType = "r5d.4xlarge" - InstanceTypeR5d8xlarge InstanceType = "r5d.8xlarge" - InstanceTypeR5d12xlarge InstanceType = "r5d.12xlarge" - InstanceTypeR5d16xlarge InstanceType = "r5d.16xlarge" - InstanceTypeR5d24xlarge InstanceType = "r5d.24xlarge" - InstanceTypeR5dMetal InstanceType = "r5d.metal" - InstanceTypeR5dnLarge InstanceType = "r5dn.large" - InstanceTypeR5dnXlarge InstanceType = "r5dn.xlarge" - InstanceTypeR5dn2xlarge InstanceType = "r5dn.2xlarge" - InstanceTypeR5dn4xlarge InstanceType = "r5dn.4xlarge" - InstanceTypeR5dn8xlarge InstanceType = "r5dn.8xlarge" - InstanceTypeR5dn12xlarge InstanceType = "r5dn.12xlarge" - InstanceTypeR5dn16xlarge InstanceType = "r5dn.16xlarge" - InstanceTypeR5dn24xlarge InstanceType = "r5dn.24xlarge" - InstanceTypeR5dnMetal InstanceType = "r5dn.metal" - InstanceTypeR5nLarge InstanceType = "r5n.large" - InstanceTypeR5nXlarge InstanceType = "r5n.xlarge" - InstanceTypeR5n2xlarge InstanceType = "r5n.2xlarge" - InstanceTypeR5n4xlarge InstanceType = "r5n.4xlarge" - InstanceTypeR5n8xlarge InstanceType = "r5n.8xlarge" - InstanceTypeR5n12xlarge InstanceType = "r5n.12xlarge" - InstanceTypeR5n16xlarge InstanceType = "r5n.16xlarge" - InstanceTypeR5n24xlarge InstanceType = "r5n.24xlarge" - InstanceTypeR5nMetal InstanceType = "r5n.metal" - InstanceTypeR6gMedium InstanceType = "r6g.medium" - InstanceTypeR6gLarge InstanceType = "r6g.large" - InstanceTypeR6gXlarge InstanceType = "r6g.xlarge" - InstanceTypeR6g2xlarge InstanceType = "r6g.2xlarge" - InstanceTypeR6g4xlarge InstanceType = "r6g.4xlarge" - InstanceTypeR6g8xlarge InstanceType = "r6g.8xlarge" - InstanceTypeR6g12xlarge InstanceType = "r6g.12xlarge" - InstanceTypeR6g16xlarge InstanceType = "r6g.16xlarge" - InstanceTypeR6gMetal InstanceType = "r6g.metal" - InstanceTypeR6gdMedium InstanceType = "r6gd.medium" - InstanceTypeR6gdLarge InstanceType = "r6gd.large" - InstanceTypeR6gdXlarge InstanceType = "r6gd.xlarge" - InstanceTypeR6gd2xlarge InstanceType = "r6gd.2xlarge" - InstanceTypeR6gd4xlarge InstanceType = "r6gd.4xlarge" - InstanceTypeR6gd8xlarge InstanceType = "r6gd.8xlarge" - InstanceTypeR6gd12xlarge InstanceType = "r6gd.12xlarge" - InstanceTypeR6gd16xlarge InstanceType = "r6gd.16xlarge" - InstanceTypeR6gdMetal InstanceType = "r6gd.metal" - InstanceTypeR6iLarge InstanceType = "r6i.large" - InstanceTypeR6iXlarge InstanceType = "r6i.xlarge" - InstanceTypeR6i2xlarge InstanceType = "r6i.2xlarge" - InstanceTypeR6i4xlarge InstanceType = "r6i.4xlarge" - InstanceTypeR6i8xlarge InstanceType = "r6i.8xlarge" - InstanceTypeR6i12xlarge InstanceType = "r6i.12xlarge" - InstanceTypeR6i16xlarge InstanceType = "r6i.16xlarge" - InstanceTypeR6i24xlarge InstanceType = "r6i.24xlarge" - InstanceTypeR6i32xlarge InstanceType = "r6i.32xlarge" - InstanceTypeR6iMetal InstanceType = "r6i.metal" - InstanceTypeT1Micro InstanceType = "t1.micro" - InstanceTypeT2Nano InstanceType = "t2.nano" - InstanceTypeT2Micro InstanceType = "t2.micro" - InstanceTypeT2Small InstanceType = "t2.small" - InstanceTypeT2Medium InstanceType = "t2.medium" - InstanceTypeT2Large InstanceType = "t2.large" - InstanceTypeT2Xlarge InstanceType = "t2.xlarge" - InstanceTypeT22xlarge InstanceType = "t2.2xlarge" - InstanceTypeT3Nano InstanceType = "t3.nano" - InstanceTypeT3Micro InstanceType = "t3.micro" - InstanceTypeT3Small InstanceType = "t3.small" - InstanceTypeT3Medium InstanceType = "t3.medium" - InstanceTypeT3Large InstanceType = "t3.large" - InstanceTypeT3Xlarge InstanceType = "t3.xlarge" - InstanceTypeT32xlarge InstanceType = "t3.2xlarge" - InstanceTypeT3aNano InstanceType = "t3a.nano" - InstanceTypeT3aMicro InstanceType = "t3a.micro" - InstanceTypeT3aSmall InstanceType = "t3a.small" - InstanceTypeT3aMedium InstanceType = "t3a.medium" - InstanceTypeT3aLarge InstanceType = "t3a.large" - InstanceTypeT3aXlarge InstanceType = "t3a.xlarge" - InstanceTypeT3a2xlarge InstanceType = "t3a.2xlarge" - InstanceTypeT4gNano InstanceType = "t4g.nano" - InstanceTypeT4gMicro InstanceType = "t4g.micro" - InstanceTypeT4gSmall InstanceType = "t4g.small" - InstanceTypeT4gMedium InstanceType = "t4g.medium" - InstanceTypeT4gLarge InstanceType = "t4g.large" - InstanceTypeT4gXlarge InstanceType = "t4g.xlarge" - InstanceTypeT4g2xlarge InstanceType = "t4g.2xlarge" - InstanceTypeU6tb156xlarge InstanceType = "u-6tb1.56xlarge" - InstanceTypeU6tb1112xlarge InstanceType = "u-6tb1.112xlarge" - InstanceTypeU9tb1112xlarge InstanceType = "u-9tb1.112xlarge" - InstanceTypeU12tb1112xlarge InstanceType = "u-12tb1.112xlarge" - InstanceTypeU6tb1Metal InstanceType = "u-6tb1.metal" - InstanceTypeU9tb1Metal InstanceType = "u-9tb1.metal" - InstanceTypeU12tb1Metal InstanceType = "u-12tb1.metal" - InstanceTypeU18tb1Metal InstanceType = "u-18tb1.metal" - InstanceTypeU24tb1Metal InstanceType = "u-24tb1.metal" - InstanceTypeVt13xlarge InstanceType = "vt1.3xlarge" - InstanceTypeVt16xlarge InstanceType = "vt1.6xlarge" - InstanceTypeVt124xlarge InstanceType = "vt1.24xlarge" - InstanceTypeX116xlarge InstanceType = "x1.16xlarge" - InstanceTypeX132xlarge InstanceType = "x1.32xlarge" - InstanceTypeX1eXlarge InstanceType = "x1e.xlarge" - InstanceTypeX1e2xlarge InstanceType = "x1e.2xlarge" - InstanceTypeX1e4xlarge InstanceType = "x1e.4xlarge" - InstanceTypeX1e8xlarge InstanceType = "x1e.8xlarge" - InstanceTypeX1e16xlarge InstanceType = "x1e.16xlarge" - InstanceTypeX1e32xlarge InstanceType = "x1e.32xlarge" - InstanceTypeX2iezn2xlarge InstanceType = "x2iezn.2xlarge" - InstanceTypeX2iezn4xlarge InstanceType = "x2iezn.4xlarge" - InstanceTypeX2iezn6xlarge InstanceType = "x2iezn.6xlarge" - InstanceTypeX2iezn8xlarge InstanceType = "x2iezn.8xlarge" - InstanceTypeX2iezn12xlarge InstanceType = "x2iezn.12xlarge" - InstanceTypeX2ieznMetal InstanceType = "x2iezn.metal" - InstanceTypeX2gdMedium InstanceType = "x2gd.medium" - InstanceTypeX2gdLarge InstanceType = "x2gd.large" - InstanceTypeX2gdXlarge InstanceType = "x2gd.xlarge" - InstanceTypeX2gd2xlarge InstanceType = "x2gd.2xlarge" - InstanceTypeX2gd4xlarge InstanceType = "x2gd.4xlarge" - InstanceTypeX2gd8xlarge InstanceType = "x2gd.8xlarge" - InstanceTypeX2gd12xlarge InstanceType = "x2gd.12xlarge" - InstanceTypeX2gd16xlarge InstanceType = "x2gd.16xlarge" - InstanceTypeX2gdMetal InstanceType = "x2gd.metal" - InstanceTypeZ1dLarge InstanceType = "z1d.large" - InstanceTypeZ1dXlarge InstanceType = "z1d.xlarge" - InstanceTypeZ1d2xlarge InstanceType = "z1d.2xlarge" - InstanceTypeZ1d3xlarge InstanceType = "z1d.3xlarge" - InstanceTypeZ1d6xlarge InstanceType = "z1d.6xlarge" - InstanceTypeZ1d12xlarge InstanceType = "z1d.12xlarge" - InstanceTypeZ1dMetal InstanceType = "z1d.metal" - InstanceTypeX2idn16xlarge InstanceType = "x2idn.16xlarge" - InstanceTypeX2idn24xlarge InstanceType = "x2idn.24xlarge" - InstanceTypeX2idn32xlarge InstanceType = "x2idn.32xlarge" - InstanceTypeX2iednXlarge InstanceType = "x2iedn.xlarge" - InstanceTypeX2iedn2xlarge InstanceType = "x2iedn.2xlarge" - InstanceTypeX2iedn4xlarge InstanceType = "x2iedn.4xlarge" - InstanceTypeX2iedn8xlarge InstanceType = "x2iedn.8xlarge" - InstanceTypeX2iedn16xlarge InstanceType = "x2iedn.16xlarge" - InstanceTypeX2iedn24xlarge InstanceType = "x2iedn.24xlarge" - InstanceTypeX2iedn32xlarge InstanceType = "x2iedn.32xlarge" - InstanceTypeC6aLarge InstanceType = "c6a.large" - InstanceTypeC6aXlarge InstanceType = "c6a.xlarge" - InstanceTypeC6a2xlarge InstanceType = "c6a.2xlarge" - InstanceTypeC6a4xlarge InstanceType = "c6a.4xlarge" - InstanceTypeC6a8xlarge InstanceType = "c6a.8xlarge" - InstanceTypeC6a12xlarge InstanceType = "c6a.12xlarge" - InstanceTypeC6a16xlarge InstanceType = "c6a.16xlarge" - InstanceTypeC6a24xlarge InstanceType = "c6a.24xlarge" - InstanceTypeC6a32xlarge InstanceType = "c6a.32xlarge" - InstanceTypeC6a48xlarge InstanceType = "c6a.48xlarge" - InstanceTypeC6aMetal InstanceType = "c6a.metal" - InstanceTypeM6aMetal InstanceType = "m6a.metal" - InstanceTypeI4iLarge InstanceType = "i4i.large" - InstanceTypeI4iXlarge InstanceType = "i4i.xlarge" - InstanceTypeI4i2xlarge InstanceType = "i4i.2xlarge" - InstanceTypeI4i4xlarge InstanceType = "i4i.4xlarge" - InstanceTypeI4i8xlarge InstanceType = "i4i.8xlarge" - InstanceTypeI4i16xlarge InstanceType = "i4i.16xlarge" - InstanceTypeI4i32xlarge InstanceType = "i4i.32xlarge" - InstanceTypeI4iMetal InstanceType = "i4i.metal" - InstanceTypeX2idnMetal InstanceType = "x2idn.metal" - InstanceTypeX2iednMetal InstanceType = "x2iedn.metal" - InstanceTypeC7gMedium InstanceType = "c7g.medium" - InstanceTypeC7gLarge InstanceType = "c7g.large" - InstanceTypeC7gXlarge InstanceType = "c7g.xlarge" - InstanceTypeC7g2xlarge InstanceType = "c7g.2xlarge" - InstanceTypeC7g4xlarge InstanceType = "c7g.4xlarge" - InstanceTypeC7g8xlarge InstanceType = "c7g.8xlarge" - InstanceTypeC7g12xlarge InstanceType = "c7g.12xlarge" - InstanceTypeC7g16xlarge InstanceType = "c7g.16xlarge" - InstanceTypeMac2Metal InstanceType = "mac2.metal" - InstanceTypeC6idLarge InstanceType = "c6id.large" - InstanceTypeC6idXlarge InstanceType = "c6id.xlarge" - InstanceTypeC6id2xlarge InstanceType = "c6id.2xlarge" - InstanceTypeC6id4xlarge InstanceType = "c6id.4xlarge" - InstanceTypeC6id8xlarge InstanceType = "c6id.8xlarge" - InstanceTypeC6id12xlarge InstanceType = "c6id.12xlarge" - InstanceTypeC6id16xlarge InstanceType = "c6id.16xlarge" - InstanceTypeC6id24xlarge InstanceType = "c6id.24xlarge" - InstanceTypeC6id32xlarge InstanceType = "c6id.32xlarge" - InstanceTypeC6idMetal InstanceType = "c6id.metal" - InstanceTypeM6idLarge InstanceType = "m6id.large" - InstanceTypeM6idXlarge InstanceType = "m6id.xlarge" - InstanceTypeM6id2xlarge InstanceType = "m6id.2xlarge" - InstanceTypeM6id4xlarge InstanceType = "m6id.4xlarge" - InstanceTypeM6id8xlarge InstanceType = "m6id.8xlarge" - InstanceTypeM6id12xlarge InstanceType = "m6id.12xlarge" - InstanceTypeM6id16xlarge InstanceType = "m6id.16xlarge" - InstanceTypeM6id24xlarge InstanceType = "m6id.24xlarge" - InstanceTypeM6id32xlarge InstanceType = "m6id.32xlarge" - InstanceTypeM6idMetal InstanceType = "m6id.metal" - InstanceTypeR6idLarge InstanceType = "r6id.large" - InstanceTypeR6idXlarge InstanceType = "r6id.xlarge" - InstanceTypeR6id2xlarge InstanceType = "r6id.2xlarge" - InstanceTypeR6id4xlarge InstanceType = "r6id.4xlarge" - InstanceTypeR6id8xlarge InstanceType = "r6id.8xlarge" - InstanceTypeR6id12xlarge InstanceType = "r6id.12xlarge" - InstanceTypeR6id16xlarge InstanceType = "r6id.16xlarge" - InstanceTypeR6id24xlarge InstanceType = "r6id.24xlarge" - InstanceTypeR6id32xlarge InstanceType = "r6id.32xlarge" - InstanceTypeR6idMetal InstanceType = "r6id.metal" - InstanceTypeR6aLarge InstanceType = "r6a.large" - InstanceTypeR6aXlarge InstanceType = "r6a.xlarge" - InstanceTypeR6a2xlarge InstanceType = "r6a.2xlarge" - InstanceTypeR6a4xlarge InstanceType = "r6a.4xlarge" - InstanceTypeR6a8xlarge InstanceType = "r6a.8xlarge" - InstanceTypeR6a12xlarge InstanceType = "r6a.12xlarge" - InstanceTypeR6a16xlarge InstanceType = "r6a.16xlarge" - InstanceTypeR6a24xlarge InstanceType = "r6a.24xlarge" - InstanceTypeR6a32xlarge InstanceType = "r6a.32xlarge" - InstanceTypeR6a48xlarge InstanceType = "r6a.48xlarge" - InstanceTypeR6aMetal InstanceType = "r6a.metal" - InstanceTypeP4de24xlarge InstanceType = "p4de.24xlarge" - InstanceTypeU3tb156xlarge InstanceType = "u-3tb1.56xlarge" - InstanceTypeU18tb1112xlarge InstanceType = "u-18tb1.112xlarge" - InstanceTypeU24tb1112xlarge InstanceType = "u-24tb1.112xlarge" - InstanceTypeTrn12xlarge InstanceType = "trn1.2xlarge" - InstanceTypeTrn132xlarge InstanceType = "trn1.32xlarge" - InstanceTypeHpc6id32xlarge InstanceType = "hpc6id.32xlarge" - InstanceTypeC6inLarge InstanceType = "c6in.large" - InstanceTypeC6inXlarge InstanceType = "c6in.xlarge" - InstanceTypeC6in2xlarge InstanceType = "c6in.2xlarge" - InstanceTypeC6in4xlarge InstanceType = "c6in.4xlarge" - InstanceTypeC6in8xlarge InstanceType = "c6in.8xlarge" - InstanceTypeC6in12xlarge InstanceType = "c6in.12xlarge" - InstanceTypeC6in16xlarge InstanceType = "c6in.16xlarge" - InstanceTypeC6in24xlarge InstanceType = "c6in.24xlarge" - InstanceTypeC6in32xlarge InstanceType = "c6in.32xlarge" - InstanceTypeM6inLarge InstanceType = "m6in.large" - InstanceTypeM6inXlarge InstanceType = "m6in.xlarge" - InstanceTypeM6in2xlarge InstanceType = "m6in.2xlarge" - InstanceTypeM6in4xlarge InstanceType = "m6in.4xlarge" - InstanceTypeM6in8xlarge InstanceType = "m6in.8xlarge" - InstanceTypeM6in12xlarge InstanceType = "m6in.12xlarge" - InstanceTypeM6in16xlarge InstanceType = "m6in.16xlarge" - InstanceTypeM6in24xlarge InstanceType = "m6in.24xlarge" - InstanceTypeM6in32xlarge InstanceType = "m6in.32xlarge" - InstanceTypeM6idnLarge InstanceType = "m6idn.large" - InstanceTypeM6idnXlarge InstanceType = "m6idn.xlarge" - InstanceTypeM6idn2xlarge InstanceType = "m6idn.2xlarge" - InstanceTypeM6idn4xlarge InstanceType = "m6idn.4xlarge" - InstanceTypeM6idn8xlarge InstanceType = "m6idn.8xlarge" - InstanceTypeM6idn12xlarge InstanceType = "m6idn.12xlarge" - InstanceTypeM6idn16xlarge InstanceType = "m6idn.16xlarge" - InstanceTypeM6idn24xlarge InstanceType = "m6idn.24xlarge" - InstanceTypeM6idn32xlarge InstanceType = "m6idn.32xlarge" - InstanceTypeR6inLarge InstanceType = "r6in.large" - InstanceTypeR6inXlarge InstanceType = "r6in.xlarge" - InstanceTypeR6in2xlarge InstanceType = "r6in.2xlarge" - InstanceTypeR6in4xlarge InstanceType = "r6in.4xlarge" - InstanceTypeR6in8xlarge InstanceType = "r6in.8xlarge" - InstanceTypeR6in12xlarge InstanceType = "r6in.12xlarge" - InstanceTypeR6in16xlarge InstanceType = "r6in.16xlarge" - InstanceTypeR6in24xlarge InstanceType = "r6in.24xlarge" - InstanceTypeR6in32xlarge InstanceType = "r6in.32xlarge" - InstanceTypeR6idnLarge InstanceType = "r6idn.large" - InstanceTypeR6idnXlarge InstanceType = "r6idn.xlarge" - InstanceTypeR6idn2xlarge InstanceType = "r6idn.2xlarge" - InstanceTypeR6idn4xlarge InstanceType = "r6idn.4xlarge" - InstanceTypeR6idn8xlarge InstanceType = "r6idn.8xlarge" - InstanceTypeR6idn12xlarge InstanceType = "r6idn.12xlarge" - InstanceTypeR6idn16xlarge InstanceType = "r6idn.16xlarge" - InstanceTypeR6idn24xlarge InstanceType = "r6idn.24xlarge" - InstanceTypeR6idn32xlarge InstanceType = "r6idn.32xlarge" - InstanceTypeC7gMetal InstanceType = "c7g.metal" - InstanceTypeM7gMedium InstanceType = "m7g.medium" - InstanceTypeM7gLarge InstanceType = "m7g.large" - InstanceTypeM7gXlarge InstanceType = "m7g.xlarge" - InstanceTypeM7g2xlarge InstanceType = "m7g.2xlarge" - InstanceTypeM7g4xlarge InstanceType = "m7g.4xlarge" - InstanceTypeM7g8xlarge InstanceType = "m7g.8xlarge" - InstanceTypeM7g12xlarge InstanceType = "m7g.12xlarge" - InstanceTypeM7g16xlarge InstanceType = "m7g.16xlarge" - InstanceTypeM7gMetal InstanceType = "m7g.metal" - InstanceTypeR7gMedium InstanceType = "r7g.medium" - InstanceTypeR7gLarge InstanceType = "r7g.large" - InstanceTypeR7gXlarge InstanceType = "r7g.xlarge" - InstanceTypeR7g2xlarge InstanceType = "r7g.2xlarge" - InstanceTypeR7g4xlarge InstanceType = "r7g.4xlarge" - InstanceTypeR7g8xlarge InstanceType = "r7g.8xlarge" - InstanceTypeR7g12xlarge InstanceType = "r7g.12xlarge" - InstanceTypeR7g16xlarge InstanceType = "r7g.16xlarge" - InstanceTypeR7gMetal InstanceType = "r7g.metal" - InstanceTypeC6inMetal InstanceType = "c6in.metal" - InstanceTypeM6inMetal InstanceType = "m6in.metal" - InstanceTypeM6idnMetal InstanceType = "m6idn.metal" - InstanceTypeR6inMetal InstanceType = "r6in.metal" - InstanceTypeR6idnMetal InstanceType = "r6idn.metal" - InstanceTypeInf2Xlarge InstanceType = "inf2.xlarge" - InstanceTypeInf28xlarge InstanceType = "inf2.8xlarge" - InstanceTypeInf224xlarge InstanceType = "inf2.24xlarge" - InstanceTypeInf248xlarge InstanceType = "inf2.48xlarge" - InstanceTypeTrn1n32xlarge InstanceType = "trn1n.32xlarge" - InstanceTypeI4gLarge InstanceType = "i4g.large" - InstanceTypeI4gXlarge InstanceType = "i4g.xlarge" - InstanceTypeI4g2xlarge InstanceType = "i4g.2xlarge" - InstanceTypeI4g4xlarge InstanceType = "i4g.4xlarge" - InstanceTypeI4g8xlarge InstanceType = "i4g.8xlarge" - InstanceTypeI4g16xlarge InstanceType = "i4g.16xlarge" - InstanceTypeHpc7g4xlarge InstanceType = "hpc7g.4xlarge" - InstanceTypeHpc7g8xlarge InstanceType = "hpc7g.8xlarge" - InstanceTypeHpc7g16xlarge InstanceType = "hpc7g.16xlarge" - InstanceTypeC7gnMedium InstanceType = "c7gn.medium" - InstanceTypeC7gnLarge InstanceType = "c7gn.large" - InstanceTypeC7gnXlarge InstanceType = "c7gn.xlarge" - InstanceTypeC7gn2xlarge InstanceType = "c7gn.2xlarge" - InstanceTypeC7gn4xlarge InstanceType = "c7gn.4xlarge" - InstanceTypeC7gn8xlarge InstanceType = "c7gn.8xlarge" - InstanceTypeC7gn12xlarge InstanceType = "c7gn.12xlarge" - InstanceTypeC7gn16xlarge InstanceType = "c7gn.16xlarge" - InstanceTypeP548xlarge InstanceType = "p5.48xlarge" - InstanceTypeM7iLarge InstanceType = "m7i.large" - InstanceTypeM7iXlarge InstanceType = "m7i.xlarge" - InstanceTypeM7i2xlarge InstanceType = "m7i.2xlarge" - InstanceTypeM7i4xlarge InstanceType = "m7i.4xlarge" - InstanceTypeM7i8xlarge InstanceType = "m7i.8xlarge" - InstanceTypeM7i12xlarge InstanceType = "m7i.12xlarge" - InstanceTypeM7i16xlarge InstanceType = "m7i.16xlarge" - InstanceTypeM7i24xlarge InstanceType = "m7i.24xlarge" - InstanceTypeM7i48xlarge InstanceType = "m7i.48xlarge" - InstanceTypeM7iFlexLarge InstanceType = "m7i-flex.large" - InstanceTypeM7iFlexXlarge InstanceType = "m7i-flex.xlarge" - InstanceTypeM7iFlex2xlarge InstanceType = "m7i-flex.2xlarge" - InstanceTypeM7iFlex4xlarge InstanceType = "m7i-flex.4xlarge" - InstanceTypeM7iFlex8xlarge InstanceType = "m7i-flex.8xlarge" - InstanceTypeM7aMedium InstanceType = "m7a.medium" - InstanceTypeM7aLarge InstanceType = "m7a.large" - InstanceTypeM7aXlarge InstanceType = "m7a.xlarge" - InstanceTypeM7a2xlarge InstanceType = "m7a.2xlarge" - InstanceTypeM7a4xlarge InstanceType = "m7a.4xlarge" - InstanceTypeM7a8xlarge InstanceType = "m7a.8xlarge" - InstanceTypeM7a12xlarge InstanceType = "m7a.12xlarge" - InstanceTypeM7a16xlarge InstanceType = "m7a.16xlarge" - InstanceTypeM7a24xlarge InstanceType = "m7a.24xlarge" - InstanceTypeM7a32xlarge InstanceType = "m7a.32xlarge" - InstanceTypeM7a48xlarge InstanceType = "m7a.48xlarge" - InstanceTypeM7aMetal48xl InstanceType = "m7a.metal-48xl" - InstanceTypeHpc7a12xlarge InstanceType = "hpc7a.12xlarge" - InstanceTypeHpc7a24xlarge InstanceType = "hpc7a.24xlarge" - InstanceTypeHpc7a48xlarge InstanceType = "hpc7a.48xlarge" - InstanceTypeHpc7a96xlarge InstanceType = "hpc7a.96xlarge" - InstanceTypeC7gdMedium InstanceType = "c7gd.medium" - InstanceTypeC7gdLarge InstanceType = "c7gd.large" - InstanceTypeC7gdXlarge InstanceType = "c7gd.xlarge" - InstanceTypeC7gd2xlarge InstanceType = "c7gd.2xlarge" - InstanceTypeC7gd4xlarge InstanceType = "c7gd.4xlarge" - InstanceTypeC7gd8xlarge InstanceType = "c7gd.8xlarge" - InstanceTypeC7gd12xlarge InstanceType = "c7gd.12xlarge" - InstanceTypeC7gd16xlarge InstanceType = "c7gd.16xlarge" - InstanceTypeM7gdMedium InstanceType = "m7gd.medium" - InstanceTypeM7gdLarge InstanceType = "m7gd.large" - InstanceTypeM7gdXlarge InstanceType = "m7gd.xlarge" - InstanceTypeM7gd2xlarge InstanceType = "m7gd.2xlarge" - InstanceTypeM7gd4xlarge InstanceType = "m7gd.4xlarge" - InstanceTypeM7gd8xlarge InstanceType = "m7gd.8xlarge" - InstanceTypeM7gd12xlarge InstanceType = "m7gd.12xlarge" - InstanceTypeM7gd16xlarge InstanceType = "m7gd.16xlarge" - InstanceTypeR7gdMedium InstanceType = "r7gd.medium" - InstanceTypeR7gdLarge InstanceType = "r7gd.large" - InstanceTypeR7gdXlarge InstanceType = "r7gd.xlarge" - InstanceTypeR7gd2xlarge InstanceType = "r7gd.2xlarge" - InstanceTypeR7gd4xlarge InstanceType = "r7gd.4xlarge" - InstanceTypeR7gd8xlarge InstanceType = "r7gd.8xlarge" - InstanceTypeR7gd12xlarge InstanceType = "r7gd.12xlarge" - InstanceTypeR7gd16xlarge InstanceType = "r7gd.16xlarge" - InstanceTypeR7aMedium InstanceType = "r7a.medium" - InstanceTypeR7aLarge InstanceType = "r7a.large" - InstanceTypeR7aXlarge InstanceType = "r7a.xlarge" - InstanceTypeR7a2xlarge InstanceType = "r7a.2xlarge" - InstanceTypeR7a4xlarge InstanceType = "r7a.4xlarge" - InstanceTypeR7a8xlarge InstanceType = "r7a.8xlarge" - InstanceTypeR7a12xlarge InstanceType = "r7a.12xlarge" - InstanceTypeR7a16xlarge InstanceType = "r7a.16xlarge" - InstanceTypeR7a24xlarge InstanceType = "r7a.24xlarge" - InstanceTypeR7a32xlarge InstanceType = "r7a.32xlarge" - InstanceTypeR7a48xlarge InstanceType = "r7a.48xlarge" - InstanceTypeC7iLarge InstanceType = "c7i.large" - InstanceTypeC7iXlarge InstanceType = "c7i.xlarge" - InstanceTypeC7i2xlarge InstanceType = "c7i.2xlarge" - InstanceTypeC7i4xlarge InstanceType = "c7i.4xlarge" - InstanceTypeC7i8xlarge InstanceType = "c7i.8xlarge" - InstanceTypeC7i12xlarge InstanceType = "c7i.12xlarge" - InstanceTypeC7i16xlarge InstanceType = "c7i.16xlarge" - InstanceTypeC7i24xlarge InstanceType = "c7i.24xlarge" - InstanceTypeC7i48xlarge InstanceType = "c7i.48xlarge" - InstanceTypeMac2M2proMetal InstanceType = "mac2-m2pro.metal" - InstanceTypeR7izLarge InstanceType = "r7iz.large" - InstanceTypeR7izXlarge InstanceType = "r7iz.xlarge" - InstanceTypeR7iz2xlarge InstanceType = "r7iz.2xlarge" - InstanceTypeR7iz4xlarge InstanceType = "r7iz.4xlarge" - InstanceTypeR7iz8xlarge InstanceType = "r7iz.8xlarge" - InstanceTypeR7iz12xlarge InstanceType = "r7iz.12xlarge" - InstanceTypeR7iz16xlarge InstanceType = "r7iz.16xlarge" - InstanceTypeR7iz32xlarge InstanceType = "r7iz.32xlarge" - InstanceTypeC7aMedium InstanceType = "c7a.medium" - InstanceTypeC7aLarge InstanceType = "c7a.large" - InstanceTypeC7aXlarge InstanceType = "c7a.xlarge" - InstanceTypeC7a2xlarge InstanceType = "c7a.2xlarge" - InstanceTypeC7a4xlarge InstanceType = "c7a.4xlarge" - InstanceTypeC7a8xlarge InstanceType = "c7a.8xlarge" - InstanceTypeC7a12xlarge InstanceType = "c7a.12xlarge" - InstanceTypeC7a16xlarge InstanceType = "c7a.16xlarge" - InstanceTypeC7a24xlarge InstanceType = "c7a.24xlarge" - InstanceTypeC7a32xlarge InstanceType = "c7a.32xlarge" - InstanceTypeC7a48xlarge InstanceType = "c7a.48xlarge" - InstanceTypeC7aMetal48xl InstanceType = "c7a.metal-48xl" - InstanceTypeR7aMetal48xl InstanceType = "r7a.metal-48xl" - InstanceTypeR7iLarge InstanceType = "r7i.large" - InstanceTypeR7iXlarge InstanceType = "r7i.xlarge" - InstanceTypeR7i2xlarge InstanceType = "r7i.2xlarge" - InstanceTypeR7i4xlarge InstanceType = "r7i.4xlarge" - InstanceTypeR7i8xlarge InstanceType = "r7i.8xlarge" - InstanceTypeR7i12xlarge InstanceType = "r7i.12xlarge" - InstanceTypeR7i16xlarge InstanceType = "r7i.16xlarge" - InstanceTypeR7i24xlarge InstanceType = "r7i.24xlarge" - InstanceTypeR7i48xlarge InstanceType = "r7i.48xlarge" - InstanceTypeDl2q24xlarge InstanceType = "dl2q.24xlarge" - InstanceTypeMac2M2Metal InstanceType = "mac2-m2.metal" - InstanceTypeI4i12xlarge InstanceType = "i4i.12xlarge" - InstanceTypeI4i24xlarge InstanceType = "i4i.24xlarge" - InstanceTypeC7iMetal24xl InstanceType = "c7i.metal-24xl" - InstanceTypeC7iMetal48xl InstanceType = "c7i.metal-48xl" - InstanceTypeM7iMetal24xl InstanceType = "m7i.metal-24xl" - InstanceTypeM7iMetal48xl InstanceType = "m7i.metal-48xl" - InstanceTypeR7iMetal24xl InstanceType = "r7i.metal-24xl" - InstanceTypeR7iMetal48xl InstanceType = "r7i.metal-48xl" - InstanceTypeR7izMetal16xl InstanceType = "r7iz.metal-16xl" - InstanceTypeR7izMetal32xl InstanceType = "r7iz.metal-32xl" - InstanceTypeC7gdMetal InstanceType = "c7gd.metal" - InstanceTypeM7gdMetal InstanceType = "m7gd.metal" - InstanceTypeR7gdMetal InstanceType = "r7gd.metal" - InstanceTypeG6Xlarge InstanceType = "g6.xlarge" - InstanceTypeG62xlarge InstanceType = "g6.2xlarge" - InstanceTypeG64xlarge InstanceType = "g6.4xlarge" - InstanceTypeG68xlarge InstanceType = "g6.8xlarge" - InstanceTypeG612xlarge InstanceType = "g6.12xlarge" - InstanceTypeG616xlarge InstanceType = "g6.16xlarge" - InstanceTypeG624xlarge InstanceType = "g6.24xlarge" - InstanceTypeG648xlarge InstanceType = "g6.48xlarge" - InstanceTypeGr64xlarge InstanceType = "gr6.4xlarge" - InstanceTypeGr68xlarge InstanceType = "gr6.8xlarge" - InstanceTypeC7iFlexLarge InstanceType = "c7i-flex.large" - InstanceTypeC7iFlexXlarge InstanceType = "c7i-flex.xlarge" - InstanceTypeC7iFlex2xlarge InstanceType = "c7i-flex.2xlarge" - InstanceTypeC7iFlex4xlarge InstanceType = "c7i-flex.4xlarge" - InstanceTypeC7iFlex8xlarge InstanceType = "c7i-flex.8xlarge" - InstanceTypeU7i12tb224xlarge InstanceType = "u7i-12tb.224xlarge" - InstanceTypeU7in16tb224xlarge InstanceType = "u7in-16tb.224xlarge" - InstanceTypeU7in24tb224xlarge InstanceType = "u7in-24tb.224xlarge" - InstanceTypeU7in32tb224xlarge InstanceType = "u7in-32tb.224xlarge" - InstanceTypeU7ib12tb224xlarge InstanceType = "u7ib-12tb.224xlarge" - InstanceTypeC7gnMetal InstanceType = "c7gn.metal" - InstanceTypeR8gMedium InstanceType = "r8g.medium" - InstanceTypeR8gLarge InstanceType = "r8g.large" - InstanceTypeR8gXlarge InstanceType = "r8g.xlarge" - InstanceTypeR8g2xlarge InstanceType = "r8g.2xlarge" - InstanceTypeR8g4xlarge InstanceType = "r8g.4xlarge" - InstanceTypeR8g8xlarge InstanceType = "r8g.8xlarge" - InstanceTypeR8g12xlarge InstanceType = "r8g.12xlarge" - InstanceTypeR8g16xlarge InstanceType = "r8g.16xlarge" - InstanceTypeR8g24xlarge InstanceType = "r8g.24xlarge" - InstanceTypeR8g48xlarge InstanceType = "r8g.48xlarge" - InstanceTypeR8gMetal24xl InstanceType = "r8g.metal-24xl" - InstanceTypeR8gMetal48xl InstanceType = "r8g.metal-48xl" - InstanceTypeMac2M1ultraMetal InstanceType = "mac2-m1ultra.metal" - InstanceTypeG6eXlarge InstanceType = "g6e.xlarge" - InstanceTypeG6e2xlarge InstanceType = "g6e.2xlarge" - InstanceTypeG6e4xlarge InstanceType = "g6e.4xlarge" - InstanceTypeG6e8xlarge InstanceType = "g6e.8xlarge" - InstanceTypeG6e12xlarge InstanceType = "g6e.12xlarge" - InstanceTypeG6e16xlarge InstanceType = "g6e.16xlarge" - InstanceTypeG6e24xlarge InstanceType = "g6e.24xlarge" - InstanceTypeG6e48xlarge InstanceType = "g6e.48xlarge" - InstanceTypeC8gMedium InstanceType = "c8g.medium" - InstanceTypeC8gLarge InstanceType = "c8g.large" - InstanceTypeC8gXlarge InstanceType = "c8g.xlarge" - InstanceTypeC8g2xlarge InstanceType = "c8g.2xlarge" - InstanceTypeC8g4xlarge InstanceType = "c8g.4xlarge" - InstanceTypeC8g8xlarge InstanceType = "c8g.8xlarge" - InstanceTypeC8g12xlarge InstanceType = "c8g.12xlarge" - InstanceTypeC8g16xlarge InstanceType = "c8g.16xlarge" - InstanceTypeC8g24xlarge InstanceType = "c8g.24xlarge" - InstanceTypeC8g48xlarge InstanceType = "c8g.48xlarge" - InstanceTypeC8gMetal24xl InstanceType = "c8g.metal-24xl" - InstanceTypeC8gMetal48xl InstanceType = "c8g.metal-48xl" - InstanceTypeM8gMedium InstanceType = "m8g.medium" - InstanceTypeM8gLarge InstanceType = "m8g.large" - InstanceTypeM8gXlarge InstanceType = "m8g.xlarge" - InstanceTypeM8g2xlarge InstanceType = "m8g.2xlarge" - InstanceTypeM8g4xlarge InstanceType = "m8g.4xlarge" - InstanceTypeM8g8xlarge InstanceType = "m8g.8xlarge" - InstanceTypeM8g12xlarge InstanceType = "m8g.12xlarge" - InstanceTypeM8g16xlarge InstanceType = "m8g.16xlarge" - InstanceTypeM8g24xlarge InstanceType = "m8g.24xlarge" - InstanceTypeM8g48xlarge InstanceType = "m8g.48xlarge" - InstanceTypeM8gMetal24xl InstanceType = "m8g.metal-24xl" - InstanceTypeM8gMetal48xl InstanceType = "m8g.metal-48xl" - InstanceTypeX8gMedium InstanceType = "x8g.medium" - InstanceTypeX8gLarge InstanceType = "x8g.large" - InstanceTypeX8gXlarge InstanceType = "x8g.xlarge" - InstanceTypeX8g2xlarge InstanceType = "x8g.2xlarge" - InstanceTypeX8g4xlarge InstanceType = "x8g.4xlarge" - InstanceTypeX8g8xlarge InstanceType = "x8g.8xlarge" - InstanceTypeX8g12xlarge InstanceType = "x8g.12xlarge" - InstanceTypeX8g16xlarge InstanceType = "x8g.16xlarge" - InstanceTypeX8g24xlarge InstanceType = "x8g.24xlarge" - InstanceTypeX8g48xlarge InstanceType = "x8g.48xlarge" - InstanceTypeX8gMetal24xl InstanceType = "x8g.metal-24xl" - InstanceTypeX8gMetal48xl InstanceType = "x8g.metal-48xl" - InstanceTypeI7ieLarge InstanceType = "i7ie.large" - InstanceTypeI7ieXlarge InstanceType = "i7ie.xlarge" - InstanceTypeI7ie2xlarge InstanceType = "i7ie.2xlarge" - InstanceTypeI7ie3xlarge InstanceType = "i7ie.3xlarge" - InstanceTypeI7ie6xlarge InstanceType = "i7ie.6xlarge" - InstanceTypeI7ie12xlarge InstanceType = "i7ie.12xlarge" - InstanceTypeI7ie18xlarge InstanceType = "i7ie.18xlarge" - InstanceTypeI7ie24xlarge InstanceType = "i7ie.24xlarge" - InstanceTypeI7ie48xlarge InstanceType = "i7ie.48xlarge" - InstanceTypeI8gLarge InstanceType = "i8g.large" - InstanceTypeI8gXlarge InstanceType = "i8g.xlarge" - InstanceTypeI8g2xlarge InstanceType = "i8g.2xlarge" - InstanceTypeI8g4xlarge InstanceType = "i8g.4xlarge" - InstanceTypeI8g8xlarge InstanceType = "i8g.8xlarge" - InstanceTypeI8g12xlarge InstanceType = "i8g.12xlarge" - InstanceTypeI8g16xlarge InstanceType = "i8g.16xlarge" - InstanceTypeI8g24xlarge InstanceType = "i8g.24xlarge" - InstanceTypeI8gMetal24xl InstanceType = "i8g.metal-24xl" - InstanceTypeU7i6tb112xlarge InstanceType = "u7i-6tb.112xlarge" - InstanceTypeU7i8tb112xlarge InstanceType = "u7i-8tb.112xlarge" - InstanceTypeU7inh32tb480xlarge InstanceType = "u7inh-32tb.480xlarge" - InstanceTypeP5e48xlarge InstanceType = "p5e.48xlarge" - InstanceTypeP5en48xlarge InstanceType = "p5en.48xlarge" - InstanceTypeF212xlarge InstanceType = "f2.12xlarge" - InstanceTypeF248xlarge InstanceType = "f2.48xlarge" - InstanceTypeTrn248xlarge InstanceType = "trn2.48xlarge" - InstanceTypeC7iFlex12xlarge InstanceType = "c7i-flex.12xlarge" - InstanceTypeC7iFlex16xlarge InstanceType = "c7i-flex.16xlarge" - InstanceTypeM7iFlex12xlarge InstanceType = "m7i-flex.12xlarge" - InstanceTypeM7iFlex16xlarge InstanceType = "m7i-flex.16xlarge" - InstanceTypeI7ieMetal24xl InstanceType = "i7ie.metal-24xl" - InstanceTypeI7ieMetal48xl InstanceType = "i7ie.metal-48xl" - InstanceTypeI8g48xlarge InstanceType = "i8g.48xlarge" - InstanceTypeC8gdMedium InstanceType = "c8gd.medium" - InstanceTypeC8gdLarge InstanceType = "c8gd.large" - InstanceTypeC8gdXlarge InstanceType = "c8gd.xlarge" - InstanceTypeC8gd2xlarge InstanceType = "c8gd.2xlarge" - InstanceTypeC8gd4xlarge InstanceType = "c8gd.4xlarge" - InstanceTypeC8gd8xlarge InstanceType = "c8gd.8xlarge" - InstanceTypeC8gd12xlarge InstanceType = "c8gd.12xlarge" - InstanceTypeC8gd16xlarge InstanceType = "c8gd.16xlarge" - InstanceTypeC8gd24xlarge InstanceType = "c8gd.24xlarge" - InstanceTypeC8gd48xlarge InstanceType = "c8gd.48xlarge" - InstanceTypeC8gdMetal24xl InstanceType = "c8gd.metal-24xl" - InstanceTypeC8gdMetal48xl InstanceType = "c8gd.metal-48xl" - InstanceTypeI7iLarge InstanceType = "i7i.large" - InstanceTypeI7iXlarge InstanceType = "i7i.xlarge" - InstanceTypeI7i2xlarge InstanceType = "i7i.2xlarge" - InstanceTypeI7i4xlarge InstanceType = "i7i.4xlarge" - InstanceTypeI7i8xlarge InstanceType = "i7i.8xlarge" - InstanceTypeI7i12xlarge InstanceType = "i7i.12xlarge" - InstanceTypeI7i16xlarge InstanceType = "i7i.16xlarge" - InstanceTypeI7i24xlarge InstanceType = "i7i.24xlarge" - InstanceTypeI7i48xlarge InstanceType = "i7i.48xlarge" - InstanceTypeI7iMetal24xl InstanceType = "i7i.metal-24xl" - InstanceTypeI7iMetal48xl InstanceType = "i7i.metal-48xl" - InstanceTypeP6B20048xlarge InstanceType = "p6-b200.48xlarge" - InstanceTypeM8gdMedium InstanceType = "m8gd.medium" - InstanceTypeM8gdLarge InstanceType = "m8gd.large" - InstanceTypeM8gdXlarge InstanceType = "m8gd.xlarge" - InstanceTypeM8gd2xlarge InstanceType = "m8gd.2xlarge" - InstanceTypeM8gd4xlarge InstanceType = "m8gd.4xlarge" - InstanceTypeM8gd8xlarge InstanceType = "m8gd.8xlarge" - InstanceTypeM8gd12xlarge InstanceType = "m8gd.12xlarge" - InstanceTypeM8gd16xlarge InstanceType = "m8gd.16xlarge" - InstanceTypeM8gd24xlarge InstanceType = "m8gd.24xlarge" - InstanceTypeM8gd48xlarge InstanceType = "m8gd.48xlarge" - InstanceTypeM8gdMetal24xl InstanceType = "m8gd.metal-24xl" - InstanceTypeM8gdMetal48xl InstanceType = "m8gd.metal-48xl" - InstanceTypeR8gdMedium InstanceType = "r8gd.medium" - InstanceTypeR8gdLarge InstanceType = "r8gd.large" - InstanceTypeR8gdXlarge InstanceType = "r8gd.xlarge" - InstanceTypeR8gd2xlarge InstanceType = "r8gd.2xlarge" - InstanceTypeR8gd4xlarge InstanceType = "r8gd.4xlarge" - InstanceTypeR8gd8xlarge InstanceType = "r8gd.8xlarge" - InstanceTypeR8gd12xlarge InstanceType = "r8gd.12xlarge" - InstanceTypeR8gd16xlarge InstanceType = "r8gd.16xlarge" - InstanceTypeR8gd24xlarge InstanceType = "r8gd.24xlarge" - InstanceTypeR8gd48xlarge InstanceType = "r8gd.48xlarge" - InstanceTypeR8gdMetal24xl InstanceType = "r8gd.metal-24xl" - InstanceTypeR8gdMetal48xl InstanceType = "r8gd.metal-48xl" -) - -// Values returns all known values for InstanceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceType) Values() []InstanceType { - return []InstanceType{ - "a1.medium", - "a1.large", - "a1.xlarge", - "a1.2xlarge", - "a1.4xlarge", - "a1.metal", - "c1.medium", - "c1.xlarge", - "c3.large", - "c3.xlarge", - "c3.2xlarge", - "c3.4xlarge", - "c3.8xlarge", - "c4.large", - "c4.xlarge", - "c4.2xlarge", - "c4.4xlarge", - "c4.8xlarge", - "c5.large", - "c5.xlarge", - "c5.2xlarge", - "c5.4xlarge", - "c5.9xlarge", - "c5.12xlarge", - "c5.18xlarge", - "c5.24xlarge", - "c5.metal", - "c5a.large", - "c5a.xlarge", - "c5a.2xlarge", - "c5a.4xlarge", - "c5a.8xlarge", - "c5a.12xlarge", - "c5a.16xlarge", - "c5a.24xlarge", - "c5ad.large", - "c5ad.xlarge", - "c5ad.2xlarge", - "c5ad.4xlarge", - "c5ad.8xlarge", - "c5ad.12xlarge", - "c5ad.16xlarge", - "c5ad.24xlarge", - "c5d.large", - "c5d.xlarge", - "c5d.2xlarge", - "c5d.4xlarge", - "c5d.9xlarge", - "c5d.12xlarge", - "c5d.18xlarge", - "c5d.24xlarge", - "c5d.metal", - "c5n.large", - "c5n.xlarge", - "c5n.2xlarge", - "c5n.4xlarge", - "c5n.9xlarge", - "c5n.18xlarge", - "c5n.metal", - "c6g.medium", - "c6g.large", - "c6g.xlarge", - "c6g.2xlarge", - "c6g.4xlarge", - "c6g.8xlarge", - "c6g.12xlarge", - "c6g.16xlarge", - "c6g.metal", - "c6gd.medium", - "c6gd.large", - "c6gd.xlarge", - "c6gd.2xlarge", - "c6gd.4xlarge", - "c6gd.8xlarge", - "c6gd.12xlarge", - "c6gd.16xlarge", - "c6gd.metal", - "c6gn.medium", - "c6gn.large", - "c6gn.xlarge", - "c6gn.2xlarge", - "c6gn.4xlarge", - "c6gn.8xlarge", - "c6gn.12xlarge", - "c6gn.16xlarge", - "c6i.large", - "c6i.xlarge", - "c6i.2xlarge", - "c6i.4xlarge", - "c6i.8xlarge", - "c6i.12xlarge", - "c6i.16xlarge", - "c6i.24xlarge", - "c6i.32xlarge", - "c6i.metal", - "cc1.4xlarge", - "cc2.8xlarge", - "cg1.4xlarge", - "cr1.8xlarge", - "d2.xlarge", - "d2.2xlarge", - "d2.4xlarge", - "d2.8xlarge", - "d3.xlarge", - "d3.2xlarge", - "d3.4xlarge", - "d3.8xlarge", - "d3en.xlarge", - "d3en.2xlarge", - "d3en.4xlarge", - "d3en.6xlarge", - "d3en.8xlarge", - "d3en.12xlarge", - "dl1.24xlarge", - "f1.2xlarge", - "f1.4xlarge", - "f1.16xlarge", - "g2.2xlarge", - "g2.8xlarge", - "g3.4xlarge", - "g3.8xlarge", - "g3.16xlarge", - "g3s.xlarge", - "g4ad.xlarge", - "g4ad.2xlarge", - "g4ad.4xlarge", - "g4ad.8xlarge", - "g4ad.16xlarge", - "g4dn.xlarge", - "g4dn.2xlarge", - "g4dn.4xlarge", - "g4dn.8xlarge", - "g4dn.12xlarge", - "g4dn.16xlarge", - "g4dn.metal", - "g5.xlarge", - "g5.2xlarge", - "g5.4xlarge", - "g5.8xlarge", - "g5.12xlarge", - "g5.16xlarge", - "g5.24xlarge", - "g5.48xlarge", - "g5g.xlarge", - "g5g.2xlarge", - "g5g.4xlarge", - "g5g.8xlarge", - "g5g.16xlarge", - "g5g.metal", - "hi1.4xlarge", - "hpc6a.48xlarge", - "hs1.8xlarge", - "h1.2xlarge", - "h1.4xlarge", - "h1.8xlarge", - "h1.16xlarge", - "i2.xlarge", - "i2.2xlarge", - "i2.4xlarge", - "i2.8xlarge", - "i3.large", - "i3.xlarge", - "i3.2xlarge", - "i3.4xlarge", - "i3.8xlarge", - "i3.16xlarge", - "i3.metal", - "i3en.large", - "i3en.xlarge", - "i3en.2xlarge", - "i3en.3xlarge", - "i3en.6xlarge", - "i3en.12xlarge", - "i3en.24xlarge", - "i3en.metal", - "im4gn.large", - "im4gn.xlarge", - "im4gn.2xlarge", - "im4gn.4xlarge", - "im4gn.8xlarge", - "im4gn.16xlarge", - "inf1.xlarge", - "inf1.2xlarge", - "inf1.6xlarge", - "inf1.24xlarge", - "is4gen.medium", - "is4gen.large", - "is4gen.xlarge", - "is4gen.2xlarge", - "is4gen.4xlarge", - "is4gen.8xlarge", - "m1.small", - "m1.medium", - "m1.large", - "m1.xlarge", - "m2.xlarge", - "m2.2xlarge", - "m2.4xlarge", - "m3.medium", - "m3.large", - "m3.xlarge", - "m3.2xlarge", - "m4.large", - "m4.xlarge", - "m4.2xlarge", - "m4.4xlarge", - "m4.10xlarge", - "m4.16xlarge", - "m5.large", - "m5.xlarge", - "m5.2xlarge", - "m5.4xlarge", - "m5.8xlarge", - "m5.12xlarge", - "m5.16xlarge", - "m5.24xlarge", - "m5.metal", - "m5a.large", - "m5a.xlarge", - "m5a.2xlarge", - "m5a.4xlarge", - "m5a.8xlarge", - "m5a.12xlarge", - "m5a.16xlarge", - "m5a.24xlarge", - "m5ad.large", - "m5ad.xlarge", - "m5ad.2xlarge", - "m5ad.4xlarge", - "m5ad.8xlarge", - "m5ad.12xlarge", - "m5ad.16xlarge", - "m5ad.24xlarge", - "m5d.large", - "m5d.xlarge", - "m5d.2xlarge", - "m5d.4xlarge", - "m5d.8xlarge", - "m5d.12xlarge", - "m5d.16xlarge", - "m5d.24xlarge", - "m5d.metal", - "m5dn.large", - "m5dn.xlarge", - "m5dn.2xlarge", - "m5dn.4xlarge", - "m5dn.8xlarge", - "m5dn.12xlarge", - "m5dn.16xlarge", - "m5dn.24xlarge", - "m5dn.metal", - "m5n.large", - "m5n.xlarge", - "m5n.2xlarge", - "m5n.4xlarge", - "m5n.8xlarge", - "m5n.12xlarge", - "m5n.16xlarge", - "m5n.24xlarge", - "m5n.metal", - "m5zn.large", - "m5zn.xlarge", - "m5zn.2xlarge", - "m5zn.3xlarge", - "m5zn.6xlarge", - "m5zn.12xlarge", - "m5zn.metal", - "m6a.large", - "m6a.xlarge", - "m6a.2xlarge", - "m6a.4xlarge", - "m6a.8xlarge", - "m6a.12xlarge", - "m6a.16xlarge", - "m6a.24xlarge", - "m6a.32xlarge", - "m6a.48xlarge", - "m6g.metal", - "m6g.medium", - "m6g.large", - "m6g.xlarge", - "m6g.2xlarge", - "m6g.4xlarge", - "m6g.8xlarge", - "m6g.12xlarge", - "m6g.16xlarge", - "m6gd.metal", - "m6gd.medium", - "m6gd.large", - "m6gd.xlarge", - "m6gd.2xlarge", - "m6gd.4xlarge", - "m6gd.8xlarge", - "m6gd.12xlarge", - "m6gd.16xlarge", - "m6i.large", - "m6i.xlarge", - "m6i.2xlarge", - "m6i.4xlarge", - "m6i.8xlarge", - "m6i.12xlarge", - "m6i.16xlarge", - "m6i.24xlarge", - "m6i.32xlarge", - "m6i.metal", - "mac1.metal", - "p2.xlarge", - "p2.8xlarge", - "p2.16xlarge", - "p3.2xlarge", - "p3.8xlarge", - "p3.16xlarge", - "p3dn.24xlarge", - "p4d.24xlarge", - "r3.large", - "r3.xlarge", - "r3.2xlarge", - "r3.4xlarge", - "r3.8xlarge", - "r4.large", - "r4.xlarge", - "r4.2xlarge", - "r4.4xlarge", - "r4.8xlarge", - "r4.16xlarge", - "r5.large", - "r5.xlarge", - "r5.2xlarge", - "r5.4xlarge", - "r5.8xlarge", - "r5.12xlarge", - "r5.16xlarge", - "r5.24xlarge", - "r5.metal", - "r5a.large", - "r5a.xlarge", - "r5a.2xlarge", - "r5a.4xlarge", - "r5a.8xlarge", - "r5a.12xlarge", - "r5a.16xlarge", - "r5a.24xlarge", - "r5ad.large", - "r5ad.xlarge", - "r5ad.2xlarge", - "r5ad.4xlarge", - "r5ad.8xlarge", - "r5ad.12xlarge", - "r5ad.16xlarge", - "r5ad.24xlarge", - "r5b.large", - "r5b.xlarge", - "r5b.2xlarge", - "r5b.4xlarge", - "r5b.8xlarge", - "r5b.12xlarge", - "r5b.16xlarge", - "r5b.24xlarge", - "r5b.metal", - "r5d.large", - "r5d.xlarge", - "r5d.2xlarge", - "r5d.4xlarge", - "r5d.8xlarge", - "r5d.12xlarge", - "r5d.16xlarge", - "r5d.24xlarge", - "r5d.metal", - "r5dn.large", - "r5dn.xlarge", - "r5dn.2xlarge", - "r5dn.4xlarge", - "r5dn.8xlarge", - "r5dn.12xlarge", - "r5dn.16xlarge", - "r5dn.24xlarge", - "r5dn.metal", - "r5n.large", - "r5n.xlarge", - "r5n.2xlarge", - "r5n.4xlarge", - "r5n.8xlarge", - "r5n.12xlarge", - "r5n.16xlarge", - "r5n.24xlarge", - "r5n.metal", - "r6g.medium", - "r6g.large", - "r6g.xlarge", - "r6g.2xlarge", - "r6g.4xlarge", - "r6g.8xlarge", - "r6g.12xlarge", - "r6g.16xlarge", - "r6g.metal", - "r6gd.medium", - "r6gd.large", - "r6gd.xlarge", - "r6gd.2xlarge", - "r6gd.4xlarge", - "r6gd.8xlarge", - "r6gd.12xlarge", - "r6gd.16xlarge", - "r6gd.metal", - "r6i.large", - "r6i.xlarge", - "r6i.2xlarge", - "r6i.4xlarge", - "r6i.8xlarge", - "r6i.12xlarge", - "r6i.16xlarge", - "r6i.24xlarge", - "r6i.32xlarge", - "r6i.metal", - "t1.micro", - "t2.nano", - "t2.micro", - "t2.small", - "t2.medium", - "t2.large", - "t2.xlarge", - "t2.2xlarge", - "t3.nano", - "t3.micro", - "t3.small", - "t3.medium", - "t3.large", - "t3.xlarge", - "t3.2xlarge", - "t3a.nano", - "t3a.micro", - "t3a.small", - "t3a.medium", - "t3a.large", - "t3a.xlarge", - "t3a.2xlarge", - "t4g.nano", - "t4g.micro", - "t4g.small", - "t4g.medium", - "t4g.large", - "t4g.xlarge", - "t4g.2xlarge", - "u-6tb1.56xlarge", - "u-6tb1.112xlarge", - "u-9tb1.112xlarge", - "u-12tb1.112xlarge", - "u-6tb1.metal", - "u-9tb1.metal", - "u-12tb1.metal", - "u-18tb1.metal", - "u-24tb1.metal", - "vt1.3xlarge", - "vt1.6xlarge", - "vt1.24xlarge", - "x1.16xlarge", - "x1.32xlarge", - "x1e.xlarge", - "x1e.2xlarge", - "x1e.4xlarge", - "x1e.8xlarge", - "x1e.16xlarge", - "x1e.32xlarge", - "x2iezn.2xlarge", - "x2iezn.4xlarge", - "x2iezn.6xlarge", - "x2iezn.8xlarge", - "x2iezn.12xlarge", - "x2iezn.metal", - "x2gd.medium", - "x2gd.large", - "x2gd.xlarge", - "x2gd.2xlarge", - "x2gd.4xlarge", - "x2gd.8xlarge", - "x2gd.12xlarge", - "x2gd.16xlarge", - "x2gd.metal", - "z1d.large", - "z1d.xlarge", - "z1d.2xlarge", - "z1d.3xlarge", - "z1d.6xlarge", - "z1d.12xlarge", - "z1d.metal", - "x2idn.16xlarge", - "x2idn.24xlarge", - "x2idn.32xlarge", - "x2iedn.xlarge", - "x2iedn.2xlarge", - "x2iedn.4xlarge", - "x2iedn.8xlarge", - "x2iedn.16xlarge", - "x2iedn.24xlarge", - "x2iedn.32xlarge", - "c6a.large", - "c6a.xlarge", - "c6a.2xlarge", - "c6a.4xlarge", - "c6a.8xlarge", - "c6a.12xlarge", - "c6a.16xlarge", - "c6a.24xlarge", - "c6a.32xlarge", - "c6a.48xlarge", - "c6a.metal", - "m6a.metal", - "i4i.large", - "i4i.xlarge", - "i4i.2xlarge", - "i4i.4xlarge", - "i4i.8xlarge", - "i4i.16xlarge", - "i4i.32xlarge", - "i4i.metal", - "x2idn.metal", - "x2iedn.metal", - "c7g.medium", - "c7g.large", - "c7g.xlarge", - "c7g.2xlarge", - "c7g.4xlarge", - "c7g.8xlarge", - "c7g.12xlarge", - "c7g.16xlarge", - "mac2.metal", - "c6id.large", - "c6id.xlarge", - "c6id.2xlarge", - "c6id.4xlarge", - "c6id.8xlarge", - "c6id.12xlarge", - "c6id.16xlarge", - "c6id.24xlarge", - "c6id.32xlarge", - "c6id.metal", - "m6id.large", - "m6id.xlarge", - "m6id.2xlarge", - "m6id.4xlarge", - "m6id.8xlarge", - "m6id.12xlarge", - "m6id.16xlarge", - "m6id.24xlarge", - "m6id.32xlarge", - "m6id.metal", - "r6id.large", - "r6id.xlarge", - "r6id.2xlarge", - "r6id.4xlarge", - "r6id.8xlarge", - "r6id.12xlarge", - "r6id.16xlarge", - "r6id.24xlarge", - "r6id.32xlarge", - "r6id.metal", - "r6a.large", - "r6a.xlarge", - "r6a.2xlarge", - "r6a.4xlarge", - "r6a.8xlarge", - "r6a.12xlarge", - "r6a.16xlarge", - "r6a.24xlarge", - "r6a.32xlarge", - "r6a.48xlarge", - "r6a.metal", - "p4de.24xlarge", - "u-3tb1.56xlarge", - "u-18tb1.112xlarge", - "u-24tb1.112xlarge", - "trn1.2xlarge", - "trn1.32xlarge", - "hpc6id.32xlarge", - "c6in.large", - "c6in.xlarge", - "c6in.2xlarge", - "c6in.4xlarge", - "c6in.8xlarge", - "c6in.12xlarge", - "c6in.16xlarge", - "c6in.24xlarge", - "c6in.32xlarge", - "m6in.large", - "m6in.xlarge", - "m6in.2xlarge", - "m6in.4xlarge", - "m6in.8xlarge", - "m6in.12xlarge", - "m6in.16xlarge", - "m6in.24xlarge", - "m6in.32xlarge", - "m6idn.large", - "m6idn.xlarge", - "m6idn.2xlarge", - "m6idn.4xlarge", - "m6idn.8xlarge", - "m6idn.12xlarge", - "m6idn.16xlarge", - "m6idn.24xlarge", - "m6idn.32xlarge", - "r6in.large", - "r6in.xlarge", - "r6in.2xlarge", - "r6in.4xlarge", - "r6in.8xlarge", - "r6in.12xlarge", - "r6in.16xlarge", - "r6in.24xlarge", - "r6in.32xlarge", - "r6idn.large", - "r6idn.xlarge", - "r6idn.2xlarge", - "r6idn.4xlarge", - "r6idn.8xlarge", - "r6idn.12xlarge", - "r6idn.16xlarge", - "r6idn.24xlarge", - "r6idn.32xlarge", - "c7g.metal", - "m7g.medium", - "m7g.large", - "m7g.xlarge", - "m7g.2xlarge", - "m7g.4xlarge", - "m7g.8xlarge", - "m7g.12xlarge", - "m7g.16xlarge", - "m7g.metal", - "r7g.medium", - "r7g.large", - "r7g.xlarge", - "r7g.2xlarge", - "r7g.4xlarge", - "r7g.8xlarge", - "r7g.12xlarge", - "r7g.16xlarge", - "r7g.metal", - "c6in.metal", - "m6in.metal", - "m6idn.metal", - "r6in.metal", - "r6idn.metal", - "inf2.xlarge", - "inf2.8xlarge", - "inf2.24xlarge", - "inf2.48xlarge", - "trn1n.32xlarge", - "i4g.large", - "i4g.xlarge", - "i4g.2xlarge", - "i4g.4xlarge", - "i4g.8xlarge", - "i4g.16xlarge", - "hpc7g.4xlarge", - "hpc7g.8xlarge", - "hpc7g.16xlarge", - "c7gn.medium", - "c7gn.large", - "c7gn.xlarge", - "c7gn.2xlarge", - "c7gn.4xlarge", - "c7gn.8xlarge", - "c7gn.12xlarge", - "c7gn.16xlarge", - "p5.48xlarge", - "m7i.large", - "m7i.xlarge", - "m7i.2xlarge", - "m7i.4xlarge", - "m7i.8xlarge", - "m7i.12xlarge", - "m7i.16xlarge", - "m7i.24xlarge", - "m7i.48xlarge", - "m7i-flex.large", - "m7i-flex.xlarge", - "m7i-flex.2xlarge", - "m7i-flex.4xlarge", - "m7i-flex.8xlarge", - "m7a.medium", - "m7a.large", - "m7a.xlarge", - "m7a.2xlarge", - "m7a.4xlarge", - "m7a.8xlarge", - "m7a.12xlarge", - "m7a.16xlarge", - "m7a.24xlarge", - "m7a.32xlarge", - "m7a.48xlarge", - "m7a.metal-48xl", - "hpc7a.12xlarge", - "hpc7a.24xlarge", - "hpc7a.48xlarge", - "hpc7a.96xlarge", - "c7gd.medium", - "c7gd.large", - "c7gd.xlarge", - "c7gd.2xlarge", - "c7gd.4xlarge", - "c7gd.8xlarge", - "c7gd.12xlarge", - "c7gd.16xlarge", - "m7gd.medium", - "m7gd.large", - "m7gd.xlarge", - "m7gd.2xlarge", - "m7gd.4xlarge", - "m7gd.8xlarge", - "m7gd.12xlarge", - "m7gd.16xlarge", - "r7gd.medium", - "r7gd.large", - "r7gd.xlarge", - "r7gd.2xlarge", - "r7gd.4xlarge", - "r7gd.8xlarge", - "r7gd.12xlarge", - "r7gd.16xlarge", - "r7a.medium", - "r7a.large", - "r7a.xlarge", - "r7a.2xlarge", - "r7a.4xlarge", - "r7a.8xlarge", - "r7a.12xlarge", - "r7a.16xlarge", - "r7a.24xlarge", - "r7a.32xlarge", - "r7a.48xlarge", - "c7i.large", - "c7i.xlarge", - "c7i.2xlarge", - "c7i.4xlarge", - "c7i.8xlarge", - "c7i.12xlarge", - "c7i.16xlarge", - "c7i.24xlarge", - "c7i.48xlarge", - "mac2-m2pro.metal", - "r7iz.large", - "r7iz.xlarge", - "r7iz.2xlarge", - "r7iz.4xlarge", - "r7iz.8xlarge", - "r7iz.12xlarge", - "r7iz.16xlarge", - "r7iz.32xlarge", - "c7a.medium", - "c7a.large", - "c7a.xlarge", - "c7a.2xlarge", - "c7a.4xlarge", - "c7a.8xlarge", - "c7a.12xlarge", - "c7a.16xlarge", - "c7a.24xlarge", - "c7a.32xlarge", - "c7a.48xlarge", - "c7a.metal-48xl", - "r7a.metal-48xl", - "r7i.large", - "r7i.xlarge", - "r7i.2xlarge", - "r7i.4xlarge", - "r7i.8xlarge", - "r7i.12xlarge", - "r7i.16xlarge", - "r7i.24xlarge", - "r7i.48xlarge", - "dl2q.24xlarge", - "mac2-m2.metal", - "i4i.12xlarge", - "i4i.24xlarge", - "c7i.metal-24xl", - "c7i.metal-48xl", - "m7i.metal-24xl", - "m7i.metal-48xl", - "r7i.metal-24xl", - "r7i.metal-48xl", - "r7iz.metal-16xl", - "r7iz.metal-32xl", - "c7gd.metal", - "m7gd.metal", - "r7gd.metal", - "g6.xlarge", - "g6.2xlarge", - "g6.4xlarge", - "g6.8xlarge", - "g6.12xlarge", - "g6.16xlarge", - "g6.24xlarge", - "g6.48xlarge", - "gr6.4xlarge", - "gr6.8xlarge", - "c7i-flex.large", - "c7i-flex.xlarge", - "c7i-flex.2xlarge", - "c7i-flex.4xlarge", - "c7i-flex.8xlarge", - "u7i-12tb.224xlarge", - "u7in-16tb.224xlarge", - "u7in-24tb.224xlarge", - "u7in-32tb.224xlarge", - "u7ib-12tb.224xlarge", - "c7gn.metal", - "r8g.medium", - "r8g.large", - "r8g.xlarge", - "r8g.2xlarge", - "r8g.4xlarge", - "r8g.8xlarge", - "r8g.12xlarge", - "r8g.16xlarge", - "r8g.24xlarge", - "r8g.48xlarge", - "r8g.metal-24xl", - "r8g.metal-48xl", - "mac2-m1ultra.metal", - "g6e.xlarge", - "g6e.2xlarge", - "g6e.4xlarge", - "g6e.8xlarge", - "g6e.12xlarge", - "g6e.16xlarge", - "g6e.24xlarge", - "g6e.48xlarge", - "c8g.medium", - "c8g.large", - "c8g.xlarge", - "c8g.2xlarge", - "c8g.4xlarge", - "c8g.8xlarge", - "c8g.12xlarge", - "c8g.16xlarge", - "c8g.24xlarge", - "c8g.48xlarge", - "c8g.metal-24xl", - "c8g.metal-48xl", - "m8g.medium", - "m8g.large", - "m8g.xlarge", - "m8g.2xlarge", - "m8g.4xlarge", - "m8g.8xlarge", - "m8g.12xlarge", - "m8g.16xlarge", - "m8g.24xlarge", - "m8g.48xlarge", - "m8g.metal-24xl", - "m8g.metal-48xl", - "x8g.medium", - "x8g.large", - "x8g.xlarge", - "x8g.2xlarge", - "x8g.4xlarge", - "x8g.8xlarge", - "x8g.12xlarge", - "x8g.16xlarge", - "x8g.24xlarge", - "x8g.48xlarge", - "x8g.metal-24xl", - "x8g.metal-48xl", - "i7ie.large", - "i7ie.xlarge", - "i7ie.2xlarge", - "i7ie.3xlarge", - "i7ie.6xlarge", - "i7ie.12xlarge", - "i7ie.18xlarge", - "i7ie.24xlarge", - "i7ie.48xlarge", - "i8g.large", - "i8g.xlarge", - "i8g.2xlarge", - "i8g.4xlarge", - "i8g.8xlarge", - "i8g.12xlarge", - "i8g.16xlarge", - "i8g.24xlarge", - "i8g.metal-24xl", - "u7i-6tb.112xlarge", - "u7i-8tb.112xlarge", - "u7inh-32tb.480xlarge", - "p5e.48xlarge", - "p5en.48xlarge", - "f2.12xlarge", - "f2.48xlarge", - "trn2.48xlarge", - "c7i-flex.12xlarge", - "c7i-flex.16xlarge", - "m7i-flex.12xlarge", - "m7i-flex.16xlarge", - "i7ie.metal-24xl", - "i7ie.metal-48xl", - "i8g.48xlarge", - "c8gd.medium", - "c8gd.large", - "c8gd.xlarge", - "c8gd.2xlarge", - "c8gd.4xlarge", - "c8gd.8xlarge", - "c8gd.12xlarge", - "c8gd.16xlarge", - "c8gd.24xlarge", - "c8gd.48xlarge", - "c8gd.metal-24xl", - "c8gd.metal-48xl", - "i7i.large", - "i7i.xlarge", - "i7i.2xlarge", - "i7i.4xlarge", - "i7i.8xlarge", - "i7i.12xlarge", - "i7i.16xlarge", - "i7i.24xlarge", - "i7i.48xlarge", - "i7i.metal-24xl", - "i7i.metal-48xl", - "p6-b200.48xlarge", - "m8gd.medium", - "m8gd.large", - "m8gd.xlarge", - "m8gd.2xlarge", - "m8gd.4xlarge", - "m8gd.8xlarge", - "m8gd.12xlarge", - "m8gd.16xlarge", - "m8gd.24xlarge", - "m8gd.48xlarge", - "m8gd.metal-24xl", - "m8gd.metal-48xl", - "r8gd.medium", - "r8gd.large", - "r8gd.xlarge", - "r8gd.2xlarge", - "r8gd.4xlarge", - "r8gd.8xlarge", - "r8gd.12xlarge", - "r8gd.16xlarge", - "r8gd.24xlarge", - "r8gd.48xlarge", - "r8gd.metal-24xl", - "r8gd.metal-48xl", - } -} - -type InstanceTypeHypervisor string - -// Enum values for InstanceTypeHypervisor -const ( - InstanceTypeHypervisorNitro InstanceTypeHypervisor = "nitro" - InstanceTypeHypervisorXen InstanceTypeHypervisor = "xen" -) - -// Values returns all known values for InstanceTypeHypervisor. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InstanceTypeHypervisor) Values() []InstanceTypeHypervisor { - return []InstanceTypeHypervisor{ - "nitro", - "xen", - } -} - -type InterfacePermissionType string - -// Enum values for InterfacePermissionType -const ( - InterfacePermissionTypeInstanceAttach InterfacePermissionType = "INSTANCE-ATTACH" - InterfacePermissionTypeEipAssociate InterfacePermissionType = "EIP-ASSOCIATE" -) - -// Values returns all known values for InterfacePermissionType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InterfacePermissionType) Values() []InterfacePermissionType { - return []InterfacePermissionType{ - "INSTANCE-ATTACH", - "EIP-ASSOCIATE", - } -} - -type InterfaceProtocolType string - -// Enum values for InterfaceProtocolType -const ( - InterfaceProtocolTypeVlan InterfaceProtocolType = "VLAN" - InterfaceProtocolTypeGre InterfaceProtocolType = "GRE" -) - -// Values returns all known values for InterfaceProtocolType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InterfaceProtocolType) Values() []InterfaceProtocolType { - return []InterfaceProtocolType{ - "VLAN", - "GRE", - } -} - -type InternetGatewayBlockMode string - -// Enum values for InternetGatewayBlockMode -const ( - InternetGatewayBlockModeOff InternetGatewayBlockMode = "off" - InternetGatewayBlockModeBlockBidirectional InternetGatewayBlockMode = "block-bidirectional" - InternetGatewayBlockModeBlockIngress InternetGatewayBlockMode = "block-ingress" -) - -// Values returns all known values for InternetGatewayBlockMode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InternetGatewayBlockMode) Values() []InternetGatewayBlockMode { - return []InternetGatewayBlockMode{ - "off", - "block-bidirectional", - "block-ingress", - } -} - -type InternetGatewayExclusionMode string - -// Enum values for InternetGatewayExclusionMode -const ( - InternetGatewayExclusionModeAllowBidirectional InternetGatewayExclusionMode = "allow-bidirectional" - InternetGatewayExclusionModeAllowEgress InternetGatewayExclusionMode = "allow-egress" -) - -// Values returns all known values for InternetGatewayExclusionMode. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InternetGatewayExclusionMode) Values() []InternetGatewayExclusionMode { - return []InternetGatewayExclusionMode{ - "allow-bidirectional", - "allow-egress", - } -} - -type IpAddressType string - -// Enum values for IpAddressType -const ( - IpAddressTypeIpv4 IpAddressType = "ipv4" - IpAddressTypeDualstack IpAddressType = "dualstack" - IpAddressTypeIpv6 IpAddressType = "ipv6" -) - -// Values returns all known values for IpAddressType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpAddressType) Values() []IpAddressType { - return []IpAddressType{ - "ipv4", - "dualstack", - "ipv6", - } -} - -type IpamAddressHistoryResourceType string - -// Enum values for IpamAddressHistoryResourceType -const ( - IpamAddressHistoryResourceTypeEip IpamAddressHistoryResourceType = "eip" - IpamAddressHistoryResourceTypeVpc IpamAddressHistoryResourceType = "vpc" - IpamAddressHistoryResourceTypeSubnet IpamAddressHistoryResourceType = "subnet" - IpamAddressHistoryResourceTypeNetworkInterface IpamAddressHistoryResourceType = "network-interface" - IpamAddressHistoryResourceTypeInstance IpamAddressHistoryResourceType = "instance" -) - -// Values returns all known values for IpamAddressHistoryResourceType. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamAddressHistoryResourceType) Values() []IpamAddressHistoryResourceType { - return []IpamAddressHistoryResourceType{ - "eip", - "vpc", - "subnet", - "network-interface", - "instance", - } -} - -type IpamAssociatedResourceDiscoveryStatus string - -// Enum values for IpamAssociatedResourceDiscoveryStatus -const ( - IpamAssociatedResourceDiscoveryStatusActive IpamAssociatedResourceDiscoveryStatus = "active" - IpamAssociatedResourceDiscoveryStatusNotFound IpamAssociatedResourceDiscoveryStatus = "not-found" -) - -// Values returns all known values for IpamAssociatedResourceDiscoveryStatus. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamAssociatedResourceDiscoveryStatus) Values() []IpamAssociatedResourceDiscoveryStatus { - return []IpamAssociatedResourceDiscoveryStatus{ - "active", - "not-found", - } -} - -type IpamComplianceStatus string - -// Enum values for IpamComplianceStatus -const ( - IpamComplianceStatusCompliant IpamComplianceStatus = "compliant" - IpamComplianceStatusNoncompliant IpamComplianceStatus = "noncompliant" - IpamComplianceStatusUnmanaged IpamComplianceStatus = "unmanaged" - IpamComplianceStatusIgnored IpamComplianceStatus = "ignored" -) - -// Values returns all known values for IpamComplianceStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamComplianceStatus) Values() []IpamComplianceStatus { - return []IpamComplianceStatus{ - "compliant", - "noncompliant", - "unmanaged", - "ignored", - } -} - -type IpamDiscoveryFailureCode string - -// Enum values for IpamDiscoveryFailureCode -const ( - IpamDiscoveryFailureCodeAssumeRoleFailure IpamDiscoveryFailureCode = "assume-role-failure" - IpamDiscoveryFailureCodeThrottlingFailure IpamDiscoveryFailureCode = "throttling-failure" - IpamDiscoveryFailureCodeUnauthorizedFailure IpamDiscoveryFailureCode = "unauthorized-failure" -) - -// Values returns all known values for IpamDiscoveryFailureCode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamDiscoveryFailureCode) Values() []IpamDiscoveryFailureCode { - return []IpamDiscoveryFailureCode{ - "assume-role-failure", - "throttling-failure", - "unauthorized-failure", - } -} - -type IpamExternalResourceVerificationTokenState string - -// Enum values for IpamExternalResourceVerificationTokenState -const ( - IpamExternalResourceVerificationTokenStateCreateInProgress IpamExternalResourceVerificationTokenState = "create-in-progress" - IpamExternalResourceVerificationTokenStateCreateComplete IpamExternalResourceVerificationTokenState = "create-complete" - IpamExternalResourceVerificationTokenStateCreateFailed IpamExternalResourceVerificationTokenState = "create-failed" - IpamExternalResourceVerificationTokenStateDeleteInProgress IpamExternalResourceVerificationTokenState = "delete-in-progress" - IpamExternalResourceVerificationTokenStateDeleteComplete IpamExternalResourceVerificationTokenState = "delete-complete" - IpamExternalResourceVerificationTokenStateDeleteFailed IpamExternalResourceVerificationTokenState = "delete-failed" -) - -// Values returns all known values for IpamExternalResourceVerificationTokenState. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamExternalResourceVerificationTokenState) Values() []IpamExternalResourceVerificationTokenState { - return []IpamExternalResourceVerificationTokenState{ - "create-in-progress", - "create-complete", - "create-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - } -} - -type IpamManagementState string - -// Enum values for IpamManagementState -const ( - IpamManagementStateManaged IpamManagementState = "managed" - IpamManagementStateUnmanaged IpamManagementState = "unmanaged" - IpamManagementStateIgnored IpamManagementState = "ignored" -) - -// Values returns all known values for IpamManagementState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamManagementState) Values() []IpamManagementState { - return []IpamManagementState{ - "managed", - "unmanaged", - "ignored", - } -} - -type IpamMeteredAccount string - -// Enum values for IpamMeteredAccount -const ( - IpamMeteredAccountIpamOwner IpamMeteredAccount = "ipam-owner" - IpamMeteredAccountResourceOwner IpamMeteredAccount = "resource-owner" -) - -// Values returns all known values for IpamMeteredAccount. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamMeteredAccount) Values() []IpamMeteredAccount { - return []IpamMeteredAccount{ - "ipam-owner", - "resource-owner", - } -} - -type IpamNetworkInterfaceAttachmentStatus string - -// Enum values for IpamNetworkInterfaceAttachmentStatus -const ( - IpamNetworkInterfaceAttachmentStatusAvailable IpamNetworkInterfaceAttachmentStatus = "available" - IpamNetworkInterfaceAttachmentStatusInUse IpamNetworkInterfaceAttachmentStatus = "in-use" -) - -// Values returns all known values for IpamNetworkInterfaceAttachmentStatus. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamNetworkInterfaceAttachmentStatus) Values() []IpamNetworkInterfaceAttachmentStatus { - return []IpamNetworkInterfaceAttachmentStatus{ - "available", - "in-use", - } -} - -type IpamOverlapStatus string - -// Enum values for IpamOverlapStatus -const ( - IpamOverlapStatusOverlapping IpamOverlapStatus = "overlapping" - IpamOverlapStatusNonoverlapping IpamOverlapStatus = "nonoverlapping" - IpamOverlapStatusIgnored IpamOverlapStatus = "ignored" -) - -// Values returns all known values for IpamOverlapStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamOverlapStatus) Values() []IpamOverlapStatus { - return []IpamOverlapStatus{ - "overlapping", - "nonoverlapping", - "ignored", - } -} - -type IpamPoolAllocationResourceType string - -// Enum values for IpamPoolAllocationResourceType -const ( - IpamPoolAllocationResourceTypeIpamPool IpamPoolAllocationResourceType = "ipam-pool" - IpamPoolAllocationResourceTypeVpc IpamPoolAllocationResourceType = "vpc" - IpamPoolAllocationResourceTypeEc2PublicIpv4Pool IpamPoolAllocationResourceType = "ec2-public-ipv4-pool" - IpamPoolAllocationResourceTypeCustom IpamPoolAllocationResourceType = "custom" - IpamPoolAllocationResourceTypeSubnet IpamPoolAllocationResourceType = "subnet" - IpamPoolAllocationResourceTypeEip IpamPoolAllocationResourceType = "eip" -) - -// Values returns all known values for IpamPoolAllocationResourceType. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolAllocationResourceType) Values() []IpamPoolAllocationResourceType { - return []IpamPoolAllocationResourceType{ - "ipam-pool", - "vpc", - "ec2-public-ipv4-pool", - "custom", - "subnet", - "eip", - } -} - -type IpamPoolAwsService string - -// Enum values for IpamPoolAwsService -const ( - IpamPoolAwsServiceEc2 IpamPoolAwsService = "ec2" -) - -// Values returns all known values for IpamPoolAwsService. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolAwsService) Values() []IpamPoolAwsService { - return []IpamPoolAwsService{ - "ec2", - } -} - -type IpamPoolCidrFailureCode string - -// Enum values for IpamPoolCidrFailureCode -const ( - IpamPoolCidrFailureCodeCidrNotAvailable IpamPoolCidrFailureCode = "cidr-not-available" - IpamPoolCidrFailureCodeLimitExceeded IpamPoolCidrFailureCode = "limit-exceeded" -) - -// Values returns all known values for IpamPoolCidrFailureCode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolCidrFailureCode) Values() []IpamPoolCidrFailureCode { - return []IpamPoolCidrFailureCode{ - "cidr-not-available", - "limit-exceeded", - } -} - -type IpamPoolCidrState string - -// Enum values for IpamPoolCidrState -const ( - IpamPoolCidrStatePendingProvision IpamPoolCidrState = "pending-provision" - IpamPoolCidrStateProvisioned IpamPoolCidrState = "provisioned" - IpamPoolCidrStateFailedProvision IpamPoolCidrState = "failed-provision" - IpamPoolCidrStatePendingDeprovision IpamPoolCidrState = "pending-deprovision" - IpamPoolCidrStateDeprovisioned IpamPoolCidrState = "deprovisioned" - IpamPoolCidrStateFailedDeprovision IpamPoolCidrState = "failed-deprovision" - IpamPoolCidrStatePendingImport IpamPoolCidrState = "pending-import" - IpamPoolCidrStateFailedImport IpamPoolCidrState = "failed-import" -) - -// Values returns all known values for IpamPoolCidrState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolCidrState) Values() []IpamPoolCidrState { - return []IpamPoolCidrState{ - "pending-provision", - "provisioned", - "failed-provision", - "pending-deprovision", - "deprovisioned", - "failed-deprovision", - "pending-import", - "failed-import", - } -} - -type IpamPoolPublicIpSource string - -// Enum values for IpamPoolPublicIpSource -const ( - IpamPoolPublicIpSourceAmazon IpamPoolPublicIpSource = "amazon" - IpamPoolPublicIpSourceByoip IpamPoolPublicIpSource = "byoip" -) - -// Values returns all known values for IpamPoolPublicIpSource. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolPublicIpSource) Values() []IpamPoolPublicIpSource { - return []IpamPoolPublicIpSource{ - "amazon", - "byoip", - } -} - -type IpamPoolSourceResourceType string - -// Enum values for IpamPoolSourceResourceType -const ( - IpamPoolSourceResourceTypeVpc IpamPoolSourceResourceType = "vpc" -) - -// Values returns all known values for IpamPoolSourceResourceType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolSourceResourceType) Values() []IpamPoolSourceResourceType { - return []IpamPoolSourceResourceType{ - "vpc", - } -} - -type IpamPoolState string - -// Enum values for IpamPoolState -const ( - IpamPoolStateCreateInProgress IpamPoolState = "create-in-progress" - IpamPoolStateCreateComplete IpamPoolState = "create-complete" - IpamPoolStateCreateFailed IpamPoolState = "create-failed" - IpamPoolStateModifyInProgress IpamPoolState = "modify-in-progress" - IpamPoolStateModifyComplete IpamPoolState = "modify-complete" - IpamPoolStateModifyFailed IpamPoolState = "modify-failed" - IpamPoolStateDeleteInProgress IpamPoolState = "delete-in-progress" - IpamPoolStateDeleteComplete IpamPoolState = "delete-complete" - IpamPoolStateDeleteFailed IpamPoolState = "delete-failed" - IpamPoolStateIsolateInProgress IpamPoolState = "isolate-in-progress" - IpamPoolStateIsolateComplete IpamPoolState = "isolate-complete" - IpamPoolStateRestoreInProgress IpamPoolState = "restore-in-progress" -) - -// Values returns all known values for IpamPoolState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPoolState) Values() []IpamPoolState { - return []IpamPoolState{ - "create-in-progress", - "create-complete", - "create-failed", - "modify-in-progress", - "modify-complete", - "modify-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - "isolate-in-progress", - "isolate-complete", - "restore-in-progress", - } -} - -type IpamPublicAddressAssociationStatus string - -// Enum values for IpamPublicAddressAssociationStatus -const ( - IpamPublicAddressAssociationStatusAssociated IpamPublicAddressAssociationStatus = "associated" - IpamPublicAddressAssociationStatusDisassociated IpamPublicAddressAssociationStatus = "disassociated" -) - -// Values returns all known values for IpamPublicAddressAssociationStatus. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPublicAddressAssociationStatus) Values() []IpamPublicAddressAssociationStatus { - return []IpamPublicAddressAssociationStatus{ - "associated", - "disassociated", - } -} - -type IpamPublicAddressAwsService string - -// Enum values for IpamPublicAddressAwsService -const ( - IpamPublicAddressAwsServiceNatGateway IpamPublicAddressAwsService = "nat-gateway" - IpamPublicAddressAwsServiceDms IpamPublicAddressAwsService = "database-migration-service" - IpamPublicAddressAwsServiceRedshift IpamPublicAddressAwsService = "redshift" - IpamPublicAddressAwsServiceEcs IpamPublicAddressAwsService = "elastic-container-service" - IpamPublicAddressAwsServiceRds IpamPublicAddressAwsService = "relational-database-service" - IpamPublicAddressAwsServiceS2sVpn IpamPublicAddressAwsService = "site-to-site-vpn" - IpamPublicAddressAwsServiceEc2Lb IpamPublicAddressAwsService = "load-balancer" - IpamPublicAddressAwsServiceAga IpamPublicAddressAwsService = "global-accelerator" - IpamPublicAddressAwsServiceOther IpamPublicAddressAwsService = "other" -) - -// Values returns all known values for IpamPublicAddressAwsService. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPublicAddressAwsService) Values() []IpamPublicAddressAwsService { - return []IpamPublicAddressAwsService{ - "nat-gateway", - "database-migration-service", - "redshift", - "elastic-container-service", - "relational-database-service", - "site-to-site-vpn", - "load-balancer", - "global-accelerator", - "other", - } -} - -type IpamPublicAddressType string - -// Enum values for IpamPublicAddressType -const ( - IpamPublicAddressTypeServiceManagedIp IpamPublicAddressType = "service-managed-ip" - IpamPublicAddressTypeServiceManagedByoip IpamPublicAddressType = "service-managed-byoip" - IpamPublicAddressTypeAmazonOwnedEip IpamPublicAddressType = "amazon-owned-eip" - IpamPublicAddressTypeAmazonOwnedContig IpamPublicAddressType = "amazon-owned-contig" - IpamPublicAddressTypeByoip IpamPublicAddressType = "byoip" - IpamPublicAddressTypeEc2PublicIp IpamPublicAddressType = "ec2-public-ip" -) - -// Values returns all known values for IpamPublicAddressType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamPublicAddressType) Values() []IpamPublicAddressType { - return []IpamPublicAddressType{ - "service-managed-ip", - "service-managed-byoip", - "amazon-owned-eip", - "amazon-owned-contig", - "byoip", - "ec2-public-ip", - } -} - -type IpamResourceCidrIpSource string - -// Enum values for IpamResourceCidrIpSource -const ( - IpamResourceCidrIpSourceAmazon IpamResourceCidrIpSource = "amazon" - IpamResourceCidrIpSourceByoip IpamResourceCidrIpSource = "byoip" - IpamResourceCidrIpSourceNone IpamResourceCidrIpSource = "none" -) - -// Values returns all known values for IpamResourceCidrIpSource. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamResourceCidrIpSource) Values() []IpamResourceCidrIpSource { - return []IpamResourceCidrIpSource{ - "amazon", - "byoip", - "none", - } -} - -type IpamResourceDiscoveryAssociationState string - -// Enum values for IpamResourceDiscoveryAssociationState -const ( - IpamResourceDiscoveryAssociationStateAssociateInProgress IpamResourceDiscoveryAssociationState = "associate-in-progress" - IpamResourceDiscoveryAssociationStateAssociateComplete IpamResourceDiscoveryAssociationState = "associate-complete" - IpamResourceDiscoveryAssociationStateAssociateFailed IpamResourceDiscoveryAssociationState = "associate-failed" - IpamResourceDiscoveryAssociationStateDisassociateInProgress IpamResourceDiscoveryAssociationState = "disassociate-in-progress" - IpamResourceDiscoveryAssociationStateDisassociateComplete IpamResourceDiscoveryAssociationState = "disassociate-complete" - IpamResourceDiscoveryAssociationStateDisassociateFailed IpamResourceDiscoveryAssociationState = "disassociate-failed" - IpamResourceDiscoveryAssociationStateIsolateInProgress IpamResourceDiscoveryAssociationState = "isolate-in-progress" - IpamResourceDiscoveryAssociationStateIsolateComplete IpamResourceDiscoveryAssociationState = "isolate-complete" - IpamResourceDiscoveryAssociationStateRestoreInProgress IpamResourceDiscoveryAssociationState = "restore-in-progress" -) - -// Values returns all known values for IpamResourceDiscoveryAssociationState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamResourceDiscoveryAssociationState) Values() []IpamResourceDiscoveryAssociationState { - return []IpamResourceDiscoveryAssociationState{ - "associate-in-progress", - "associate-complete", - "associate-failed", - "disassociate-in-progress", - "disassociate-complete", - "disassociate-failed", - "isolate-in-progress", - "isolate-complete", - "restore-in-progress", - } -} - -type IpamResourceDiscoveryState string - -// Enum values for IpamResourceDiscoveryState -const ( - IpamResourceDiscoveryStateCreateInProgress IpamResourceDiscoveryState = "create-in-progress" - IpamResourceDiscoveryStateCreateComplete IpamResourceDiscoveryState = "create-complete" - IpamResourceDiscoveryStateCreateFailed IpamResourceDiscoveryState = "create-failed" - IpamResourceDiscoveryStateModifyInProgress IpamResourceDiscoveryState = "modify-in-progress" - IpamResourceDiscoveryStateModifyComplete IpamResourceDiscoveryState = "modify-complete" - IpamResourceDiscoveryStateModifyFailed IpamResourceDiscoveryState = "modify-failed" - IpamResourceDiscoveryStateDeleteInProgress IpamResourceDiscoveryState = "delete-in-progress" - IpamResourceDiscoveryStateDeleteComplete IpamResourceDiscoveryState = "delete-complete" - IpamResourceDiscoveryStateDeleteFailed IpamResourceDiscoveryState = "delete-failed" - IpamResourceDiscoveryStateIsolateInProgress IpamResourceDiscoveryState = "isolate-in-progress" - IpamResourceDiscoveryStateIsolateComplete IpamResourceDiscoveryState = "isolate-complete" - IpamResourceDiscoveryStateRestoreInProgress IpamResourceDiscoveryState = "restore-in-progress" -) - -// Values returns all known values for IpamResourceDiscoveryState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamResourceDiscoveryState) Values() []IpamResourceDiscoveryState { - return []IpamResourceDiscoveryState{ - "create-in-progress", - "create-complete", - "create-failed", - "modify-in-progress", - "modify-complete", - "modify-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - "isolate-in-progress", - "isolate-complete", - "restore-in-progress", - } -} - -type IpamResourceType string - -// Enum values for IpamResourceType -const ( - IpamResourceTypeVpc IpamResourceType = "vpc" - IpamResourceTypeSubnet IpamResourceType = "subnet" - IpamResourceTypeEip IpamResourceType = "eip" - IpamResourceTypePublicIpv4Pool IpamResourceType = "public-ipv4-pool" - IpamResourceTypeIpv6Pool IpamResourceType = "ipv6-pool" - IpamResourceTypeEni IpamResourceType = "eni" -) - -// Values returns all known values for IpamResourceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamResourceType) Values() []IpamResourceType { - return []IpamResourceType{ - "vpc", - "subnet", - "eip", - "public-ipv4-pool", - "ipv6-pool", - "eni", - } -} - -type IpamScopeState string - -// Enum values for IpamScopeState -const ( - IpamScopeStateCreateInProgress IpamScopeState = "create-in-progress" - IpamScopeStateCreateComplete IpamScopeState = "create-complete" - IpamScopeStateCreateFailed IpamScopeState = "create-failed" - IpamScopeStateModifyInProgress IpamScopeState = "modify-in-progress" - IpamScopeStateModifyComplete IpamScopeState = "modify-complete" - IpamScopeStateModifyFailed IpamScopeState = "modify-failed" - IpamScopeStateDeleteInProgress IpamScopeState = "delete-in-progress" - IpamScopeStateDeleteComplete IpamScopeState = "delete-complete" - IpamScopeStateDeleteFailed IpamScopeState = "delete-failed" - IpamScopeStateIsolateInProgress IpamScopeState = "isolate-in-progress" - IpamScopeStateIsolateComplete IpamScopeState = "isolate-complete" - IpamScopeStateRestoreInProgress IpamScopeState = "restore-in-progress" -) - -// Values returns all known values for IpamScopeState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamScopeState) Values() []IpamScopeState { - return []IpamScopeState{ - "create-in-progress", - "create-complete", - "create-failed", - "modify-in-progress", - "modify-complete", - "modify-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - "isolate-in-progress", - "isolate-complete", - "restore-in-progress", - } -} - -type IpamScopeType string - -// Enum values for IpamScopeType -const ( - IpamScopeTypePublic IpamScopeType = "public" - IpamScopeTypePrivate IpamScopeType = "private" -) - -// Values returns all known values for IpamScopeType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamScopeType) Values() []IpamScopeType { - return []IpamScopeType{ - "public", - "private", - } -} - -type IpamState string - -// Enum values for IpamState -const ( - IpamStateCreateInProgress IpamState = "create-in-progress" - IpamStateCreateComplete IpamState = "create-complete" - IpamStateCreateFailed IpamState = "create-failed" - IpamStateModifyInProgress IpamState = "modify-in-progress" - IpamStateModifyComplete IpamState = "modify-complete" - IpamStateModifyFailed IpamState = "modify-failed" - IpamStateDeleteInProgress IpamState = "delete-in-progress" - IpamStateDeleteComplete IpamState = "delete-complete" - IpamStateDeleteFailed IpamState = "delete-failed" - IpamStateIsolateInProgress IpamState = "isolate-in-progress" - IpamStateIsolateComplete IpamState = "isolate-complete" - IpamStateRestoreInProgress IpamState = "restore-in-progress" -) - -// Values returns all known values for IpamState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamState) Values() []IpamState { - return []IpamState{ - "create-in-progress", - "create-complete", - "create-failed", - "modify-in-progress", - "modify-complete", - "modify-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - "isolate-in-progress", - "isolate-complete", - "restore-in-progress", - } -} - -type IpamTier string - -// Enum values for IpamTier -const ( - IpamTierFree IpamTier = "free" - IpamTierAdvanced IpamTier = "advanced" -) - -// Values returns all known values for IpamTier. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpamTier) Values() []IpamTier { - return []IpamTier{ - "free", - "advanced", - } -} - -type IpSource string - -// Enum values for IpSource -const ( - IpSourceAmazon IpSource = "amazon" - IpSourceByoip IpSource = "byoip" - IpSourceNone IpSource = "none" -) - -// Values returns all known values for IpSource. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpSource) Values() []IpSource { - return []IpSource{ - "amazon", - "byoip", - "none", - } -} - -type Ipv6AddressAttribute string - -// Enum values for Ipv6AddressAttribute -const ( - Ipv6AddressAttributePublic Ipv6AddressAttribute = "public" - Ipv6AddressAttributePrivate Ipv6AddressAttribute = "private" -) - -// Values returns all known values for Ipv6AddressAttribute. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Ipv6AddressAttribute) Values() []Ipv6AddressAttribute { - return []Ipv6AddressAttribute{ - "public", - "private", - } -} - -type Ipv6SupportValue string - -// Enum values for Ipv6SupportValue -const ( - Ipv6SupportValueEnable Ipv6SupportValue = "enable" - Ipv6SupportValueDisable Ipv6SupportValue = "disable" -) - -// Values returns all known values for Ipv6SupportValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Ipv6SupportValue) Values() []Ipv6SupportValue { - return []Ipv6SupportValue{ - "enable", - "disable", - } -} - -type KeyFormat string - -// Enum values for KeyFormat -const ( - KeyFormatPem KeyFormat = "pem" - KeyFormatPpk KeyFormat = "ppk" -) - -// Values returns all known values for KeyFormat. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (KeyFormat) Values() []KeyFormat { - return []KeyFormat{ - "pem", - "ppk", - } -} - -type KeyType string - -// Enum values for KeyType -const ( - KeyTypeRsa KeyType = "rsa" - KeyTypeEd25519 KeyType = "ed25519" -) - -// Values returns all known values for KeyType. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (KeyType) Values() []KeyType { - return []KeyType{ - "rsa", - "ed25519", - } -} - -type LaunchTemplateAutoRecoveryState string - -// Enum values for LaunchTemplateAutoRecoveryState -const ( - LaunchTemplateAutoRecoveryStateDefault LaunchTemplateAutoRecoveryState = "default" - LaunchTemplateAutoRecoveryStateDisabled LaunchTemplateAutoRecoveryState = "disabled" -) - -// Values returns all known values for LaunchTemplateAutoRecoveryState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateAutoRecoveryState) Values() []LaunchTemplateAutoRecoveryState { - return []LaunchTemplateAutoRecoveryState{ - "default", - "disabled", - } -} - -type LaunchTemplateErrorCode string - -// Enum values for LaunchTemplateErrorCode -const ( - LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist LaunchTemplateErrorCode = "launchTemplateIdDoesNotExist" - LaunchTemplateErrorCodeLaunchTemplateIdMalformed LaunchTemplateErrorCode = "launchTemplateIdMalformed" - LaunchTemplateErrorCodeLaunchTemplateNameDoesNotExist LaunchTemplateErrorCode = "launchTemplateNameDoesNotExist" - LaunchTemplateErrorCodeLaunchTemplateNameMalformed LaunchTemplateErrorCode = "launchTemplateNameMalformed" - LaunchTemplateErrorCodeLaunchTemplateVersionDoesNotExist LaunchTemplateErrorCode = "launchTemplateVersionDoesNotExist" - LaunchTemplateErrorCodeUnexpectedError LaunchTemplateErrorCode = "unexpectedError" -) - -// Values returns all known values for LaunchTemplateErrorCode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateErrorCode) Values() []LaunchTemplateErrorCode { - return []LaunchTemplateErrorCode{ - "launchTemplateIdDoesNotExist", - "launchTemplateIdMalformed", - "launchTemplateNameDoesNotExist", - "launchTemplateNameMalformed", - "launchTemplateVersionDoesNotExist", - "unexpectedError", - } -} - -type LaunchTemplateHttpTokensState string - -// Enum values for LaunchTemplateHttpTokensState -const ( - LaunchTemplateHttpTokensStateOptional LaunchTemplateHttpTokensState = "optional" - LaunchTemplateHttpTokensStateRequired LaunchTemplateHttpTokensState = "required" -) - -// Values returns all known values for LaunchTemplateHttpTokensState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateHttpTokensState) Values() []LaunchTemplateHttpTokensState { - return []LaunchTemplateHttpTokensState{ - "optional", - "required", - } -} - -type LaunchTemplateInstanceMetadataEndpointState string - -// Enum values for LaunchTemplateInstanceMetadataEndpointState -const ( - LaunchTemplateInstanceMetadataEndpointStateDisabled LaunchTemplateInstanceMetadataEndpointState = "disabled" - LaunchTemplateInstanceMetadataEndpointStateEnabled LaunchTemplateInstanceMetadataEndpointState = "enabled" -) - -// Values returns all known values for -// LaunchTemplateInstanceMetadataEndpointState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateInstanceMetadataEndpointState) Values() []LaunchTemplateInstanceMetadataEndpointState { - return []LaunchTemplateInstanceMetadataEndpointState{ - "disabled", - "enabled", - } -} - -type LaunchTemplateInstanceMetadataOptionsState string - -// Enum values for LaunchTemplateInstanceMetadataOptionsState -const ( - LaunchTemplateInstanceMetadataOptionsStatePending LaunchTemplateInstanceMetadataOptionsState = "pending" - LaunchTemplateInstanceMetadataOptionsStateApplied LaunchTemplateInstanceMetadataOptionsState = "applied" -) - -// Values returns all known values for LaunchTemplateInstanceMetadataOptionsState. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateInstanceMetadataOptionsState) Values() []LaunchTemplateInstanceMetadataOptionsState { - return []LaunchTemplateInstanceMetadataOptionsState{ - "pending", - "applied", - } -} - -type LaunchTemplateInstanceMetadataProtocolIpv6 string - -// Enum values for LaunchTemplateInstanceMetadataProtocolIpv6 -const ( - LaunchTemplateInstanceMetadataProtocolIpv6Disabled LaunchTemplateInstanceMetadataProtocolIpv6 = "disabled" - LaunchTemplateInstanceMetadataProtocolIpv6Enabled LaunchTemplateInstanceMetadataProtocolIpv6 = "enabled" -) - -// Values returns all known values for LaunchTemplateInstanceMetadataProtocolIpv6. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateInstanceMetadataProtocolIpv6) Values() []LaunchTemplateInstanceMetadataProtocolIpv6 { - return []LaunchTemplateInstanceMetadataProtocolIpv6{ - "disabled", - "enabled", - } -} - -type LaunchTemplateInstanceMetadataTagsState string - -// Enum values for LaunchTemplateInstanceMetadataTagsState -const ( - LaunchTemplateInstanceMetadataTagsStateDisabled LaunchTemplateInstanceMetadataTagsState = "disabled" - LaunchTemplateInstanceMetadataTagsStateEnabled LaunchTemplateInstanceMetadataTagsState = "enabled" -) - -// Values returns all known values for LaunchTemplateInstanceMetadataTagsState. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LaunchTemplateInstanceMetadataTagsState) Values() []LaunchTemplateInstanceMetadataTagsState { - return []LaunchTemplateInstanceMetadataTagsState{ - "disabled", - "enabled", - } -} - -type ListingState string - -// Enum values for ListingState -const ( - ListingStateAvailable ListingState = "available" - ListingStateSold ListingState = "sold" - ListingStateCancelled ListingState = "cancelled" - ListingStatePending ListingState = "pending" -) - -// Values returns all known values for ListingState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ListingState) Values() []ListingState { - return []ListingState{ - "available", - "sold", - "cancelled", - "pending", - } -} - -type ListingStatus string - -// Enum values for ListingStatus -const ( - ListingStatusActive ListingStatus = "active" - ListingStatusPending ListingStatus = "pending" - ListingStatusCancelled ListingStatus = "cancelled" - ListingStatusClosed ListingStatus = "closed" -) - -// Values returns all known values for ListingStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ListingStatus) Values() []ListingStatus { - return []ListingStatus{ - "active", - "pending", - "cancelled", - "closed", - } -} - -type LocalGatewayRouteState string - -// Enum values for LocalGatewayRouteState -const ( - LocalGatewayRouteStatePending LocalGatewayRouteState = "pending" - LocalGatewayRouteStateActive LocalGatewayRouteState = "active" - LocalGatewayRouteStateBlackhole LocalGatewayRouteState = "blackhole" - LocalGatewayRouteStateDeleting LocalGatewayRouteState = "deleting" - LocalGatewayRouteStateDeleted LocalGatewayRouteState = "deleted" -) - -// Values returns all known values for LocalGatewayRouteState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalGatewayRouteState) Values() []LocalGatewayRouteState { - return []LocalGatewayRouteState{ - "pending", - "active", - "blackhole", - "deleting", - "deleted", - } -} - -type LocalGatewayRouteTableMode string - -// Enum values for LocalGatewayRouteTableMode -const ( - LocalGatewayRouteTableModeDirectVpcRouting LocalGatewayRouteTableMode = "direct-vpc-routing" - LocalGatewayRouteTableModeCoip LocalGatewayRouteTableMode = "coip" -) - -// Values returns all known values for LocalGatewayRouteTableMode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalGatewayRouteTableMode) Values() []LocalGatewayRouteTableMode { - return []LocalGatewayRouteTableMode{ - "direct-vpc-routing", - "coip", - } -} - -type LocalGatewayRouteType string - -// Enum values for LocalGatewayRouteType -const ( - LocalGatewayRouteTypeStatic LocalGatewayRouteType = "static" - LocalGatewayRouteTypePropagated LocalGatewayRouteType = "propagated" -) - -// Values returns all known values for LocalGatewayRouteType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalGatewayRouteType) Values() []LocalGatewayRouteType { - return []LocalGatewayRouteType{ - "static", - "propagated", - } -} - -type LocalGatewayVirtualInterfaceConfigurationState string - -// Enum values for LocalGatewayVirtualInterfaceConfigurationState -const ( - LocalGatewayVirtualInterfaceConfigurationStatePending LocalGatewayVirtualInterfaceConfigurationState = "pending" - LocalGatewayVirtualInterfaceConfigurationStateAvailable LocalGatewayVirtualInterfaceConfigurationState = "available" - LocalGatewayVirtualInterfaceConfigurationStateDeleting LocalGatewayVirtualInterfaceConfigurationState = "deleting" - LocalGatewayVirtualInterfaceConfigurationStateDeleted LocalGatewayVirtualInterfaceConfigurationState = "deleted" -) - -// Values returns all known values for -// LocalGatewayVirtualInterfaceConfigurationState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalGatewayVirtualInterfaceConfigurationState) Values() []LocalGatewayVirtualInterfaceConfigurationState { - return []LocalGatewayVirtualInterfaceConfigurationState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type LocalGatewayVirtualInterfaceGroupConfigurationState string - -// Enum values for LocalGatewayVirtualInterfaceGroupConfigurationState -const ( - LocalGatewayVirtualInterfaceGroupConfigurationStatePending LocalGatewayVirtualInterfaceGroupConfigurationState = "pending" - LocalGatewayVirtualInterfaceGroupConfigurationStateIncomplete LocalGatewayVirtualInterfaceGroupConfigurationState = "incomplete" - LocalGatewayVirtualInterfaceGroupConfigurationStateAvailable LocalGatewayVirtualInterfaceGroupConfigurationState = "available" - LocalGatewayVirtualInterfaceGroupConfigurationStateDeleting LocalGatewayVirtualInterfaceGroupConfigurationState = "deleting" - LocalGatewayVirtualInterfaceGroupConfigurationStateDeleted LocalGatewayVirtualInterfaceGroupConfigurationState = "deleted" -) - -// Values returns all known values for -// LocalGatewayVirtualInterfaceGroupConfigurationState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalGatewayVirtualInterfaceGroupConfigurationState) Values() []LocalGatewayVirtualInterfaceGroupConfigurationState { - return []LocalGatewayVirtualInterfaceGroupConfigurationState{ - "pending", - "incomplete", - "available", - "deleting", - "deleted", - } -} - -type LocalStorage string - -// Enum values for LocalStorage -const ( - LocalStorageIncluded LocalStorage = "included" - LocalStorageRequired LocalStorage = "required" - LocalStorageExcluded LocalStorage = "excluded" -) - -// Values returns all known values for LocalStorage. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalStorage) Values() []LocalStorage { - return []LocalStorage{ - "included", - "required", - "excluded", - } -} - -type LocalStorageType string - -// Enum values for LocalStorageType -const ( - LocalStorageTypeHdd LocalStorageType = "hdd" - LocalStorageTypeSsd LocalStorageType = "ssd" -) - -// Values returns all known values for LocalStorageType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocalStorageType) Values() []LocalStorageType { - return []LocalStorageType{ - "hdd", - "ssd", - } -} - -type LocationType string - -// Enum values for LocationType -const ( - LocationTypeRegion LocationType = "region" - LocationTypeAvailabilityZone LocationType = "availability-zone" - LocationTypeAvailabilityZoneId LocationType = "availability-zone-id" - LocationTypeOutpost LocationType = "outpost" -) - -// Values returns all known values for LocationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LocationType) Values() []LocationType { - return []LocationType{ - "region", - "availability-zone", - "availability-zone-id", - "outpost", - } -} - -type LockMode string - -// Enum values for LockMode -const ( - LockModeCompliance LockMode = "compliance" - LockModeGovernance LockMode = "governance" -) - -// Values returns all known values for LockMode. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LockMode) Values() []LockMode { - return []LockMode{ - "compliance", - "governance", - } -} - -type LockState string - -// Enum values for LockState -const ( - LockStateCompliance LockState = "compliance" - LockStateGovernance LockState = "governance" - LockStateComplianceCooloff LockState = "compliance-cooloff" - LockStateExpired LockState = "expired" -) - -// Values returns all known values for LockState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LockState) Values() []LockState { - return []LockState{ - "compliance", - "governance", - "compliance-cooloff", - "expired", - } -} - -type LogDestinationType string - -// Enum values for LogDestinationType -const ( - LogDestinationTypeCloudWatchLogs LogDestinationType = "cloud-watch-logs" - LogDestinationTypeS3 LogDestinationType = "s3" - LogDestinationTypeKinesisDataFirehose LogDestinationType = "kinesis-data-firehose" -) - -// Values returns all known values for LogDestinationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LogDestinationType) Values() []LogDestinationType { - return []LogDestinationType{ - "cloud-watch-logs", - "s3", - "kinesis-data-firehose", - } -} - -type MacModificationTaskState string - -// Enum values for MacModificationTaskState -const ( - MacModificationTaskStateSuccessful MacModificationTaskState = "successful" - MacModificationTaskStateFailed MacModificationTaskState = "failed" - MacModificationTaskStateInprogress MacModificationTaskState = "in-progress" - MacModificationTaskStatePending MacModificationTaskState = "pending" -) - -// Values returns all known values for MacModificationTaskState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MacModificationTaskState) Values() []MacModificationTaskState { - return []MacModificationTaskState{ - "successful", - "failed", - "in-progress", - "pending", - } -} - -type MacModificationTaskType string - -// Enum values for MacModificationTaskType -const ( - MacModificationTaskTypeSIPModification MacModificationTaskType = "sip-modification" - MacModificationTaskTypeVolumeOwnershipDelegation MacModificationTaskType = "volume-ownership-delegation" -) - -// Values returns all known values for MacModificationTaskType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MacModificationTaskType) Values() []MacModificationTaskType { - return []MacModificationTaskType{ - "sip-modification", - "volume-ownership-delegation", - } -} - -type MacSystemIntegrityProtectionSettingStatus string - -// Enum values for MacSystemIntegrityProtectionSettingStatus -const ( - MacSystemIntegrityProtectionSettingStatusEnabled MacSystemIntegrityProtectionSettingStatus = "enabled" - MacSystemIntegrityProtectionSettingStatusDisabled MacSystemIntegrityProtectionSettingStatus = "disabled" -) - -// Values returns all known values for MacSystemIntegrityProtectionSettingStatus. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MacSystemIntegrityProtectionSettingStatus) Values() []MacSystemIntegrityProtectionSettingStatus { - return []MacSystemIntegrityProtectionSettingStatus{ - "enabled", - "disabled", - } -} - -type ManagedBy string - -// Enum values for ManagedBy -const ( - ManagedByAccount ManagedBy = "account" - ManagedByDeclarativePolicy ManagedBy = "declarative-policy" -) - -// Values returns all known values for ManagedBy. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ManagedBy) Values() []ManagedBy { - return []ManagedBy{ - "account", - "declarative-policy", - } -} - -type MarketType string - -// Enum values for MarketType -const ( - MarketTypeSpot MarketType = "spot" - MarketTypeCapacityBlock MarketType = "capacity-block" -) - -// Values returns all known values for MarketType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MarketType) Values() []MarketType { - return []MarketType{ - "spot", - "capacity-block", - } -} - -type MembershipType string - -// Enum values for MembershipType -const ( - MembershipTypeStatic MembershipType = "static" - MembershipTypeIgmp MembershipType = "igmp" -) - -// Values returns all known values for MembershipType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MembershipType) Values() []MembershipType { - return []MembershipType{ - "static", - "igmp", - } -} - -type MetadataDefaultHttpTokensState string - -// Enum values for MetadataDefaultHttpTokensState -const ( - MetadataDefaultHttpTokensStateOptional MetadataDefaultHttpTokensState = "optional" - MetadataDefaultHttpTokensStateRequired MetadataDefaultHttpTokensState = "required" - MetadataDefaultHttpTokensStateNoPreference MetadataDefaultHttpTokensState = "no-preference" -) - -// Values returns all known values for MetadataDefaultHttpTokensState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MetadataDefaultHttpTokensState) Values() []MetadataDefaultHttpTokensState { - return []MetadataDefaultHttpTokensState{ - "optional", - "required", - "no-preference", - } -} - -type MetricType string - -// Enum values for MetricType -const ( - MetricTypeAggregateLatency MetricType = "aggregate-latency" -) - -// Values returns all known values for MetricType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MetricType) Values() []MetricType { - return []MetricType{ - "aggregate-latency", - } -} - -type ModifyAvailabilityZoneOptInStatus string - -// Enum values for ModifyAvailabilityZoneOptInStatus -const ( - ModifyAvailabilityZoneOptInStatusOptedIn ModifyAvailabilityZoneOptInStatus = "opted-in" - ModifyAvailabilityZoneOptInStatusNotOptedIn ModifyAvailabilityZoneOptInStatus = "not-opted-in" -) - -// Values returns all known values for ModifyAvailabilityZoneOptInStatus. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ModifyAvailabilityZoneOptInStatus) Values() []ModifyAvailabilityZoneOptInStatus { - return []ModifyAvailabilityZoneOptInStatus{ - "opted-in", - "not-opted-in", - } -} - -type MonitoringState string - -// Enum values for MonitoringState -const ( - MonitoringStateDisabled MonitoringState = "disabled" - MonitoringStateDisabling MonitoringState = "disabling" - MonitoringStateEnabled MonitoringState = "enabled" - MonitoringStatePending MonitoringState = "pending" -) - -// Values returns all known values for MonitoringState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MonitoringState) Values() []MonitoringState { - return []MonitoringState{ - "disabled", - "disabling", - "enabled", - "pending", - } -} - -type MoveStatus string - -// Enum values for MoveStatus -const ( - MoveStatusMovingToVpc MoveStatus = "movingToVpc" - MoveStatusRestoringToClassic MoveStatus = "restoringToClassic" -) - -// Values returns all known values for MoveStatus. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MoveStatus) Values() []MoveStatus { - return []MoveStatus{ - "movingToVpc", - "restoringToClassic", - } -} - -type MulticastSupportValue string - -// Enum values for MulticastSupportValue -const ( - MulticastSupportValueEnable MulticastSupportValue = "enable" - MulticastSupportValueDisable MulticastSupportValue = "disable" -) - -// Values returns all known values for MulticastSupportValue. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MulticastSupportValue) Values() []MulticastSupportValue { - return []MulticastSupportValue{ - "enable", - "disable", - } -} - -type NatGatewayAddressStatus string - -// Enum values for NatGatewayAddressStatus -const ( - NatGatewayAddressStatusAssigning NatGatewayAddressStatus = "assigning" - NatGatewayAddressStatusUnassigning NatGatewayAddressStatus = "unassigning" - NatGatewayAddressStatusAssociating NatGatewayAddressStatus = "associating" - NatGatewayAddressStatusDisassociating NatGatewayAddressStatus = "disassociating" - NatGatewayAddressStatusSucceeded NatGatewayAddressStatus = "succeeded" - NatGatewayAddressStatusFailed NatGatewayAddressStatus = "failed" -) - -// Values returns all known values for NatGatewayAddressStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NatGatewayAddressStatus) Values() []NatGatewayAddressStatus { - return []NatGatewayAddressStatus{ - "assigning", - "unassigning", - "associating", - "disassociating", - "succeeded", - "failed", - } -} - -type NatGatewayState string - -// Enum values for NatGatewayState -const ( - NatGatewayStatePending NatGatewayState = "pending" - NatGatewayStateFailed NatGatewayState = "failed" - NatGatewayStateAvailable NatGatewayState = "available" - NatGatewayStateDeleting NatGatewayState = "deleting" - NatGatewayStateDeleted NatGatewayState = "deleted" -) - -// Values returns all known values for NatGatewayState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NatGatewayState) Values() []NatGatewayState { - return []NatGatewayState{ - "pending", - "failed", - "available", - "deleting", - "deleted", - } -} - -type NetworkInterfaceAttribute string - -// Enum values for NetworkInterfaceAttribute -const ( - NetworkInterfaceAttributeDescription NetworkInterfaceAttribute = "description" - NetworkInterfaceAttributeGroupSet NetworkInterfaceAttribute = "groupSet" - NetworkInterfaceAttributeSourceDestCheck NetworkInterfaceAttribute = "sourceDestCheck" - NetworkInterfaceAttributeAttachment NetworkInterfaceAttribute = "attachment" - NetworkInterfaceAttributeAssociatePublicIpAddress NetworkInterfaceAttribute = "associatePublicIpAddress" -) - -// Values returns all known values for NetworkInterfaceAttribute. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NetworkInterfaceAttribute) Values() []NetworkInterfaceAttribute { - return []NetworkInterfaceAttribute{ - "description", - "groupSet", - "sourceDestCheck", - "attachment", - "associatePublicIpAddress", - } -} - -type NetworkInterfaceCreationType string - -// Enum values for NetworkInterfaceCreationType -const ( - NetworkInterfaceCreationTypeEfa NetworkInterfaceCreationType = "efa" - NetworkInterfaceCreationTypeEfaOnly NetworkInterfaceCreationType = "efa-only" - NetworkInterfaceCreationTypeBranch NetworkInterfaceCreationType = "branch" - NetworkInterfaceCreationTypeTrunk NetworkInterfaceCreationType = "trunk" -) - -// Values returns all known values for NetworkInterfaceCreationType. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NetworkInterfaceCreationType) Values() []NetworkInterfaceCreationType { - return []NetworkInterfaceCreationType{ - "efa", - "efa-only", - "branch", - "trunk", - } -} - -type NetworkInterfacePermissionStateCode string - -// Enum values for NetworkInterfacePermissionStateCode -const ( - NetworkInterfacePermissionStateCodePending NetworkInterfacePermissionStateCode = "pending" - NetworkInterfacePermissionStateCodeGranted NetworkInterfacePermissionStateCode = "granted" - NetworkInterfacePermissionStateCodeRevoking NetworkInterfacePermissionStateCode = "revoking" - NetworkInterfacePermissionStateCodeRevoked NetworkInterfacePermissionStateCode = "revoked" -) - -// Values returns all known values for NetworkInterfacePermissionStateCode. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NetworkInterfacePermissionStateCode) Values() []NetworkInterfacePermissionStateCode { - return []NetworkInterfacePermissionStateCode{ - "pending", - "granted", - "revoking", - "revoked", - } -} - -type NetworkInterfaceStatus string - -// Enum values for NetworkInterfaceStatus -const ( - NetworkInterfaceStatusAvailable NetworkInterfaceStatus = "available" - NetworkInterfaceStatusAssociated NetworkInterfaceStatus = "associated" - NetworkInterfaceStatusAttaching NetworkInterfaceStatus = "attaching" - NetworkInterfaceStatusInUse NetworkInterfaceStatus = "in-use" - NetworkInterfaceStatusDetaching NetworkInterfaceStatus = "detaching" -) - -// Values returns all known values for NetworkInterfaceStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NetworkInterfaceStatus) Values() []NetworkInterfaceStatus { - return []NetworkInterfaceStatus{ - "available", - "associated", - "attaching", - "in-use", - "detaching", - } -} - -type NetworkInterfaceType string - -// Enum values for NetworkInterfaceType -const ( - NetworkInterfaceTypeInterface NetworkInterfaceType = "interface" - NetworkInterfaceTypeNatGateway NetworkInterfaceType = "natGateway" - NetworkInterfaceTypeEfa NetworkInterfaceType = "efa" - NetworkInterfaceTypeEfaOnly NetworkInterfaceType = "efa-only" - NetworkInterfaceTypeTrunk NetworkInterfaceType = "trunk" - NetworkInterfaceTypeLoadBalancer NetworkInterfaceType = "load_balancer" - NetworkInterfaceTypeNetworkLoadBalancer NetworkInterfaceType = "network_load_balancer" - NetworkInterfaceTypeVpcEndpoint NetworkInterfaceType = "vpc_endpoint" - NetworkInterfaceTypeBranch NetworkInterfaceType = "branch" - NetworkInterfaceTypeTransitGateway NetworkInterfaceType = "transit_gateway" - NetworkInterfaceTypeLambda NetworkInterfaceType = "lambda" - NetworkInterfaceTypeQuicksight NetworkInterfaceType = "quicksight" - NetworkInterfaceTypeGlobalAcceleratorManaged NetworkInterfaceType = "global_accelerator_managed" - NetworkInterfaceTypeApiGatewayManaged NetworkInterfaceType = "api_gateway_managed" - NetworkInterfaceTypeGatewayLoadBalancer NetworkInterfaceType = "gateway_load_balancer" - NetworkInterfaceTypeGatewayLoadBalancerEndpoint NetworkInterfaceType = "gateway_load_balancer_endpoint" - NetworkInterfaceTypeIotRulesManaged NetworkInterfaceType = "iot_rules_managed" - NetworkInterfaceTypeAwsCodestarConnectionsManaged NetworkInterfaceType = "aws_codestar_connections_managed" -) - -// Values returns all known values for NetworkInterfaceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NetworkInterfaceType) Values() []NetworkInterfaceType { - return []NetworkInterfaceType{ - "interface", - "natGateway", - "efa", - "efa-only", - "trunk", - "load_balancer", - "network_load_balancer", - "vpc_endpoint", - "branch", - "transit_gateway", - "lambda", - "quicksight", - "global_accelerator_managed", - "api_gateway_managed", - "gateway_load_balancer", - "gateway_load_balancer_endpoint", - "iot_rules_managed", - "aws_codestar_connections_managed", - } -} - -type NitroEnclavesSupport string - -// Enum values for NitroEnclavesSupport -const ( - NitroEnclavesSupportUnsupported NitroEnclavesSupport = "unsupported" - NitroEnclavesSupportSupported NitroEnclavesSupport = "supported" -) - -// Values returns all known values for NitroEnclavesSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NitroEnclavesSupport) Values() []NitroEnclavesSupport { - return []NitroEnclavesSupport{ - "unsupported", - "supported", - } -} - -type NitroTpmSupport string - -// Enum values for NitroTpmSupport -const ( - NitroTpmSupportUnsupported NitroTpmSupport = "unsupported" - NitroTpmSupportSupported NitroTpmSupport = "supported" -) - -// Values returns all known values for NitroTpmSupport. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NitroTpmSupport) Values() []NitroTpmSupport { - return []NitroTpmSupport{ - "unsupported", - "supported", - } -} - -type OfferingClassType string - -// Enum values for OfferingClassType -const ( - OfferingClassTypeStandard OfferingClassType = "standard" - OfferingClassTypeConvertible OfferingClassType = "convertible" -) - -// Values returns all known values for OfferingClassType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OfferingClassType) Values() []OfferingClassType { - return []OfferingClassType{ - "standard", - "convertible", - } -} - -type OfferingTypeValues string - -// Enum values for OfferingTypeValues -const ( - OfferingTypeValuesHeavyUtilization OfferingTypeValues = "Heavy Utilization" - OfferingTypeValuesMediumUtilization OfferingTypeValues = "Medium Utilization" - OfferingTypeValuesLightUtilization OfferingTypeValues = "Light Utilization" - OfferingTypeValuesNoUpfront OfferingTypeValues = "No Upfront" - OfferingTypeValuesPartialUpfront OfferingTypeValues = "Partial Upfront" - OfferingTypeValuesAllUpfront OfferingTypeValues = "All Upfront" -) - -// Values returns all known values for OfferingTypeValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OfferingTypeValues) Values() []OfferingTypeValues { - return []OfferingTypeValues{ - "Heavy Utilization", - "Medium Utilization", - "Light Utilization", - "No Upfront", - "Partial Upfront", - "All Upfront", - } -} - -type OnDemandAllocationStrategy string - -// Enum values for OnDemandAllocationStrategy -const ( - OnDemandAllocationStrategyLowestPrice OnDemandAllocationStrategy = "lowestPrice" - OnDemandAllocationStrategyPrioritized OnDemandAllocationStrategy = "prioritized" -) - -// Values returns all known values for OnDemandAllocationStrategy. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OnDemandAllocationStrategy) Values() []OnDemandAllocationStrategy { - return []OnDemandAllocationStrategy{ - "lowestPrice", - "prioritized", - } -} - -type OperationType string - -// Enum values for OperationType -const ( - OperationTypeAdd OperationType = "add" - OperationTypeRemove OperationType = "remove" -) - -// Values returns all known values for OperationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OperationType) Values() []OperationType { - return []OperationType{ - "add", - "remove", - } -} - -type PartitionLoadFrequency string - -// Enum values for PartitionLoadFrequency -const ( - PartitionLoadFrequencyNone PartitionLoadFrequency = "none" - PartitionLoadFrequencyDaily PartitionLoadFrequency = "daily" - PartitionLoadFrequencyWeekly PartitionLoadFrequency = "weekly" - PartitionLoadFrequencyMonthly PartitionLoadFrequency = "monthly" -) - -// Values returns all known values for PartitionLoadFrequency. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PartitionLoadFrequency) Values() []PartitionLoadFrequency { - return []PartitionLoadFrequency{ - "none", - "daily", - "weekly", - "monthly", - } -} - -type PayerResponsibility string - -// Enum values for PayerResponsibility -const ( - PayerResponsibilityServiceOwner PayerResponsibility = "ServiceOwner" -) - -// Values returns all known values for PayerResponsibility. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PayerResponsibility) Values() []PayerResponsibility { - return []PayerResponsibility{ - "ServiceOwner", - } -} - -type PaymentOption string - -// Enum values for PaymentOption -const ( - PaymentOptionAllUpfront PaymentOption = "AllUpfront" - PaymentOptionPartialUpfront PaymentOption = "PartialUpfront" - PaymentOptionNoUpfront PaymentOption = "NoUpfront" -) - -// Values returns all known values for PaymentOption. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PaymentOption) Values() []PaymentOption { - return []PaymentOption{ - "AllUpfront", - "PartialUpfront", - "NoUpfront", - } -} - -type PeriodType string - -// Enum values for PeriodType -const ( - PeriodTypeFiveMinutes PeriodType = "five-minutes" - PeriodTypeFifteenMinutes PeriodType = "fifteen-minutes" - PeriodTypeOneHour PeriodType = "one-hour" - PeriodTypeThreeHours PeriodType = "three-hours" - PeriodTypeOneDay PeriodType = "one-day" - PeriodTypeOneWeek PeriodType = "one-week" -) - -// Values returns all known values for PeriodType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PeriodType) Values() []PeriodType { - return []PeriodType{ - "five-minutes", - "fifteen-minutes", - "one-hour", - "three-hours", - "one-day", - "one-week", - } -} - -type PermissionGroup string - -// Enum values for PermissionGroup -const ( - PermissionGroupAll PermissionGroup = "all" -) - -// Values returns all known values for PermissionGroup. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PermissionGroup) Values() []PermissionGroup { - return []PermissionGroup{ - "all", - } -} - -type PhcSupport string - -// Enum values for PhcSupport -const ( - PhcSupportUnsupported PhcSupport = "unsupported" - PhcSupportSupported PhcSupport = "supported" -) - -// Values returns all known values for PhcSupport. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PhcSupport) Values() []PhcSupport { - return []PhcSupport{ - "unsupported", - "supported", - } -} - -type PlacementGroupState string - -// Enum values for PlacementGroupState -const ( - PlacementGroupStatePending PlacementGroupState = "pending" - PlacementGroupStateAvailable PlacementGroupState = "available" - PlacementGroupStateDeleting PlacementGroupState = "deleting" - PlacementGroupStateDeleted PlacementGroupState = "deleted" -) - -// Values returns all known values for PlacementGroupState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PlacementGroupState) Values() []PlacementGroupState { - return []PlacementGroupState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type PlacementGroupStrategy string - -// Enum values for PlacementGroupStrategy -const ( - PlacementGroupStrategyCluster PlacementGroupStrategy = "cluster" - PlacementGroupStrategyPartition PlacementGroupStrategy = "partition" - PlacementGroupStrategySpread PlacementGroupStrategy = "spread" -) - -// Values returns all known values for PlacementGroupStrategy. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PlacementGroupStrategy) Values() []PlacementGroupStrategy { - return []PlacementGroupStrategy{ - "cluster", - "partition", - "spread", - } -} - -type PlacementStrategy string - -// Enum values for PlacementStrategy -const ( - PlacementStrategyCluster PlacementStrategy = "cluster" - PlacementStrategySpread PlacementStrategy = "spread" - PlacementStrategyPartition PlacementStrategy = "partition" -) - -// Values returns all known values for PlacementStrategy. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PlacementStrategy) Values() []PlacementStrategy { - return []PlacementStrategy{ - "cluster", - "spread", - "partition", - } -} - -type PlatformValues string - -// Enum values for PlatformValues -const ( - PlatformValuesWindows PlatformValues = "Windows" -) - -// Values returns all known values for PlatformValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PlatformValues) Values() []PlatformValues { - return []PlatformValues{ - "Windows", - } -} - -type PrefixListState string - -// Enum values for PrefixListState -const ( - PrefixListStateCreateInProgress PrefixListState = "create-in-progress" - PrefixListStateCreateComplete PrefixListState = "create-complete" - PrefixListStateCreateFailed PrefixListState = "create-failed" - PrefixListStateModifyInProgress PrefixListState = "modify-in-progress" - PrefixListStateModifyComplete PrefixListState = "modify-complete" - PrefixListStateModifyFailed PrefixListState = "modify-failed" - PrefixListStateRestoreInProgress PrefixListState = "restore-in-progress" - PrefixListStateRestoreComplete PrefixListState = "restore-complete" - PrefixListStateRestoreFailed PrefixListState = "restore-failed" - PrefixListStateDeleteInProgress PrefixListState = "delete-in-progress" - PrefixListStateDeleteComplete PrefixListState = "delete-complete" - PrefixListStateDeleteFailed PrefixListState = "delete-failed" -) - -// Values returns all known values for PrefixListState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PrefixListState) Values() []PrefixListState { - return []PrefixListState{ - "create-in-progress", - "create-complete", - "create-failed", - "modify-in-progress", - "modify-complete", - "modify-failed", - "restore-in-progress", - "restore-complete", - "restore-failed", - "delete-in-progress", - "delete-complete", - "delete-failed", - } -} - -type PrincipalType string - -// Enum values for PrincipalType -const ( - PrincipalTypeAll PrincipalType = "All" - PrincipalTypeService PrincipalType = "Service" - PrincipalTypeOrganizationUnit PrincipalType = "OrganizationUnit" - PrincipalTypeAccount PrincipalType = "Account" - PrincipalTypeUser PrincipalType = "User" - PrincipalTypeRole PrincipalType = "Role" -) - -// Values returns all known values for PrincipalType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PrincipalType) Values() []PrincipalType { - return []PrincipalType{ - "All", - "Service", - "OrganizationUnit", - "Account", - "User", - "Role", - } -} - -type ProductCodeValues string - -// Enum values for ProductCodeValues -const ( - ProductCodeValuesDevpay ProductCodeValues = "devpay" - ProductCodeValuesMarketplace ProductCodeValues = "marketplace" -) - -// Values returns all known values for ProductCodeValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ProductCodeValues) Values() []ProductCodeValues { - return []ProductCodeValues{ - "devpay", - "marketplace", - } -} - -type Protocol string - -// Enum values for Protocol -const ( - ProtocolTcp Protocol = "tcp" - ProtocolUdp Protocol = "udp" -) - -// Values returns all known values for Protocol. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Protocol) Values() []Protocol { - return []Protocol{ - "tcp", - "udp", - } -} - -type ProtocolValue string - -// Enum values for ProtocolValue -const ( - ProtocolValueGre ProtocolValue = "gre" -) - -// Values returns all known values for ProtocolValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ProtocolValue) Values() []ProtocolValue { - return []ProtocolValue{ - "gre", - } -} - -type PublicIpDnsOption string - -// Enum values for PublicIpDnsOption -const ( - PublicIpDnsOptionPublicDualStackDnsName PublicIpDnsOption = "public-dual-stack-dns-name" - PublicIpDnsOptionPublicIpv4DnsName PublicIpDnsOption = "public-ipv4-dns-name" - PublicIpDnsOptionPublicIpv6DnsName PublicIpDnsOption = "public-ipv6-dns-name" -) - -// Values returns all known values for PublicIpDnsOption. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PublicIpDnsOption) Values() []PublicIpDnsOption { - return []PublicIpDnsOption{ - "public-dual-stack-dns-name", - "public-ipv4-dns-name", - "public-ipv6-dns-name", - } -} - -type RebootMigrationSupport string - -// Enum values for RebootMigrationSupport -const ( - RebootMigrationSupportUnsupported RebootMigrationSupport = "unsupported" - RebootMigrationSupportSupported RebootMigrationSupport = "supported" -) - -// Values returns all known values for RebootMigrationSupport. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RebootMigrationSupport) Values() []RebootMigrationSupport { - return []RebootMigrationSupport{ - "unsupported", - "supported", - } -} - -type RecurringChargeFrequency string - -// Enum values for RecurringChargeFrequency -const ( - RecurringChargeFrequencyHourly RecurringChargeFrequency = "Hourly" -) - -// Values returns all known values for RecurringChargeFrequency. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RecurringChargeFrequency) Values() []RecurringChargeFrequency { - return []RecurringChargeFrequency{ - "Hourly", - } -} - -type ReplacementStrategy string - -// Enum values for ReplacementStrategy -const ( - ReplacementStrategyLaunch ReplacementStrategy = "launch" - ReplacementStrategyLaunchBeforeTerminate ReplacementStrategy = "launch-before-terminate" -) - -// Values returns all known values for ReplacementStrategy. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReplacementStrategy) Values() []ReplacementStrategy { - return []ReplacementStrategy{ - "launch", - "launch-before-terminate", - } -} - -type ReplaceRootVolumeTaskState string - -// Enum values for ReplaceRootVolumeTaskState -const ( - ReplaceRootVolumeTaskStatePending ReplaceRootVolumeTaskState = "pending" - ReplaceRootVolumeTaskStateInProgress ReplaceRootVolumeTaskState = "in-progress" - ReplaceRootVolumeTaskStateFailing ReplaceRootVolumeTaskState = "failing" - ReplaceRootVolumeTaskStateSucceeded ReplaceRootVolumeTaskState = "succeeded" - ReplaceRootVolumeTaskStateFailed ReplaceRootVolumeTaskState = "failed" - ReplaceRootVolumeTaskStateFailedDetached ReplaceRootVolumeTaskState = "failed-detached" -) - -// Values returns all known values for ReplaceRootVolumeTaskState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReplaceRootVolumeTaskState) Values() []ReplaceRootVolumeTaskState { - return []ReplaceRootVolumeTaskState{ - "pending", - "in-progress", - "failing", - "succeeded", - "failed", - "failed-detached", - } -} - -type ReportInstanceReasonCodes string - -// Enum values for ReportInstanceReasonCodes -const ( - ReportInstanceReasonCodesInstanceStuckInState ReportInstanceReasonCodes = "instance-stuck-in-state" - ReportInstanceReasonCodesUnresponsive ReportInstanceReasonCodes = "unresponsive" - ReportInstanceReasonCodesNotAcceptingCredentials ReportInstanceReasonCodes = "not-accepting-credentials" - ReportInstanceReasonCodesPasswordNotAvailable ReportInstanceReasonCodes = "password-not-available" - ReportInstanceReasonCodesPerformanceNetwork ReportInstanceReasonCodes = "performance-network" - ReportInstanceReasonCodesPerformanceInstanceStore ReportInstanceReasonCodes = "performance-instance-store" - ReportInstanceReasonCodesPerformanceEbsVolume ReportInstanceReasonCodes = "performance-ebs-volume" - ReportInstanceReasonCodesPerformanceOther ReportInstanceReasonCodes = "performance-other" - ReportInstanceReasonCodesOther ReportInstanceReasonCodes = "other" -) - -// Values returns all known values for ReportInstanceReasonCodes. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReportInstanceReasonCodes) Values() []ReportInstanceReasonCodes { - return []ReportInstanceReasonCodes{ - "instance-stuck-in-state", - "unresponsive", - "not-accepting-credentials", - "password-not-available", - "performance-network", - "performance-instance-store", - "performance-ebs-volume", - "performance-other", - "other", - } -} - -type ReportState string - -// Enum values for ReportState -const ( - ReportStateRunning ReportState = "running" - ReportStateCancelled ReportState = "cancelled" - ReportStateComplete ReportState = "complete" - ReportStateError ReportState = "error" -) - -// Values returns all known values for ReportState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReportState) Values() []ReportState { - return []ReportState{ - "running", - "cancelled", - "complete", - "error", - } -} - -type ReportStatusType string - -// Enum values for ReportStatusType -const ( - ReportStatusTypeOk ReportStatusType = "ok" - ReportStatusTypeImpaired ReportStatusType = "impaired" -) - -// Values returns all known values for ReportStatusType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReportStatusType) Values() []ReportStatusType { - return []ReportStatusType{ - "ok", - "impaired", - } -} - -type ReservationState string - -// Enum values for ReservationState -const ( - ReservationStatePaymentPending ReservationState = "payment-pending" - ReservationStatePaymentFailed ReservationState = "payment-failed" - ReservationStateActive ReservationState = "active" - ReservationStateRetired ReservationState = "retired" -) - -// Values returns all known values for ReservationState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReservationState) Values() []ReservationState { - return []ReservationState{ - "payment-pending", - "payment-failed", - "active", - "retired", - } -} - -type ReservedInstanceState string - -// Enum values for ReservedInstanceState -const ( - ReservedInstanceStatePaymentPending ReservedInstanceState = "payment-pending" - ReservedInstanceStateActive ReservedInstanceState = "active" - ReservedInstanceStatePaymentFailed ReservedInstanceState = "payment-failed" - ReservedInstanceStateRetired ReservedInstanceState = "retired" - ReservedInstanceStateQueued ReservedInstanceState = "queued" - ReservedInstanceStateQueuedDeleted ReservedInstanceState = "queued-deleted" -) - -// Values returns all known values for ReservedInstanceState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ReservedInstanceState) Values() []ReservedInstanceState { - return []ReservedInstanceState{ - "payment-pending", - "active", - "payment-failed", - "retired", - "queued", - "queued-deleted", - } -} - -type ResetFpgaImageAttributeName string - -// Enum values for ResetFpgaImageAttributeName -const ( - ResetFpgaImageAttributeNameLoadPermission ResetFpgaImageAttributeName = "loadPermission" -) - -// Values returns all known values for ResetFpgaImageAttributeName. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResetFpgaImageAttributeName) Values() []ResetFpgaImageAttributeName { - return []ResetFpgaImageAttributeName{ - "loadPermission", - } -} - -type ResetImageAttributeName string - -// Enum values for ResetImageAttributeName -const ( - ResetImageAttributeNameLaunchPermission ResetImageAttributeName = "launchPermission" -) - -// Values returns all known values for ResetImageAttributeName. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResetImageAttributeName) Values() []ResetImageAttributeName { - return []ResetImageAttributeName{ - "launchPermission", - } -} - -type ResourceType string - -// Enum values for ResourceType -const ( - ResourceTypeCapacityReservation ResourceType = "capacity-reservation" - ResourceTypeClientVpnEndpoint ResourceType = "client-vpn-endpoint" - ResourceTypeCustomerGateway ResourceType = "customer-gateway" - ResourceTypeCarrierGateway ResourceType = "carrier-gateway" - ResourceTypeCoipPool ResourceType = "coip-pool" - ResourceTypeDeclarativePoliciesReport ResourceType = "declarative-policies-report" - ResourceTypeDedicatedHost ResourceType = "dedicated-host" - ResourceTypeDhcpOptions ResourceType = "dhcp-options" - ResourceTypeEgressOnlyInternetGateway ResourceType = "egress-only-internet-gateway" - ResourceTypeElasticIp ResourceType = "elastic-ip" - ResourceTypeElasticGpu ResourceType = "elastic-gpu" - ResourceTypeExportImageTask ResourceType = "export-image-task" - ResourceTypeExportInstanceTask ResourceType = "export-instance-task" - ResourceTypeFleet ResourceType = "fleet" - ResourceTypeFpgaImage ResourceType = "fpga-image" - ResourceTypeHostReservation ResourceType = "host-reservation" - ResourceTypeImage ResourceType = "image" - ResourceTypeImportImageTask ResourceType = "import-image-task" - ResourceTypeImportSnapshotTask ResourceType = "import-snapshot-task" - ResourceTypeInstance ResourceType = "instance" - ResourceTypeInstanceEventWindow ResourceType = "instance-event-window" - ResourceTypeInternetGateway ResourceType = "internet-gateway" - ResourceTypeIpam ResourceType = "ipam" - ResourceTypeIpamPool ResourceType = "ipam-pool" - ResourceTypeIpamScope ResourceType = "ipam-scope" - ResourceTypeIpv4poolEc2 ResourceType = "ipv4pool-ec2" - ResourceTypeIpv6poolEc2 ResourceType = "ipv6pool-ec2" - ResourceTypeKeyPair ResourceType = "key-pair" - ResourceTypeLaunchTemplate ResourceType = "launch-template" - ResourceTypeLocalGateway ResourceType = "local-gateway" - ResourceTypeLocalGatewayRouteTable ResourceType = "local-gateway-route-table" - ResourceTypeLocalGatewayVirtualInterface ResourceType = "local-gateway-virtual-interface" - ResourceTypeLocalGatewayVirtualInterfaceGroup ResourceType = "local-gateway-virtual-interface-group" - ResourceTypeLocalGatewayRouteTableVpcAssociation ResourceType = "local-gateway-route-table-vpc-association" - ResourceTypeLocalGatewayRouteTableVirtualInterfaceGroupAssociation ResourceType = "local-gateway-route-table-virtual-interface-group-association" - ResourceTypeNatgateway ResourceType = "natgateway" - ResourceTypeNetworkAcl ResourceType = "network-acl" - ResourceTypeNetworkInterface ResourceType = "network-interface" - ResourceTypeNetworkInsightsAnalysis ResourceType = "network-insights-analysis" - ResourceTypeNetworkInsightsPath ResourceType = "network-insights-path" - ResourceTypeNetworkInsightsAccessScope ResourceType = "network-insights-access-scope" - ResourceTypeNetworkInsightsAccessScopeAnalysis ResourceType = "network-insights-access-scope-analysis" - ResourceTypeOutpostLag ResourceType = "outpost-lag" - ResourceTypePlacementGroup ResourceType = "placement-group" - ResourceTypePrefixList ResourceType = "prefix-list" - ResourceTypeReplaceRootVolumeTask ResourceType = "replace-root-volume-task" - ResourceTypeReservedInstances ResourceType = "reserved-instances" - ResourceTypeRouteTable ResourceType = "route-table" - ResourceTypeSecurityGroup ResourceType = "security-group" - ResourceTypeSecurityGroupRule ResourceType = "security-group-rule" - ResourceTypeServiceLinkVirtualInterface ResourceType = "service-link-virtual-interface" - ResourceTypeSnapshot ResourceType = "snapshot" - ResourceTypeSpotFleetRequest ResourceType = "spot-fleet-request" - ResourceTypeSpotInstancesRequest ResourceType = "spot-instances-request" - ResourceTypeSubnet ResourceType = "subnet" - ResourceTypeSubnetCidrReservation ResourceType = "subnet-cidr-reservation" - ResourceTypeTrafficMirrorFilter ResourceType = "traffic-mirror-filter" - ResourceTypeTrafficMirrorSession ResourceType = "traffic-mirror-session" - ResourceTypeTrafficMirrorTarget ResourceType = "traffic-mirror-target" - ResourceTypeTransitGateway ResourceType = "transit-gateway" - ResourceTypeTransitGatewayAttachment ResourceType = "transit-gateway-attachment" - ResourceTypeTransitGatewayConnectPeer ResourceType = "transit-gateway-connect-peer" - ResourceTypeTransitGatewayMulticastDomain ResourceType = "transit-gateway-multicast-domain" - ResourceTypeTransitGatewayPolicyTable ResourceType = "transit-gateway-policy-table" - ResourceTypeTransitGatewayRouteTable ResourceType = "transit-gateway-route-table" - ResourceTypeTransitGatewayRouteTableAnnouncement ResourceType = "transit-gateway-route-table-announcement" - ResourceTypeVolume ResourceType = "volume" - ResourceTypeVpc ResourceType = "vpc" - ResourceTypeVpcEndpoint ResourceType = "vpc-endpoint" - ResourceTypeVpcEndpointConnection ResourceType = "vpc-endpoint-connection" - ResourceTypeVpcEndpointService ResourceType = "vpc-endpoint-service" - ResourceTypeVpcEndpointServicePermission ResourceType = "vpc-endpoint-service-permission" - ResourceTypeVpcPeeringConnection ResourceType = "vpc-peering-connection" - ResourceTypeVpnConnection ResourceType = "vpn-connection" - ResourceTypeVpnGateway ResourceType = "vpn-gateway" - ResourceTypeVpcFlowLog ResourceType = "vpc-flow-log" - ResourceTypeCapacityReservationFleet ResourceType = "capacity-reservation-fleet" - ResourceTypeTrafficMirrorFilterRule ResourceType = "traffic-mirror-filter-rule" - ResourceTypeVpcEndpointConnectionDeviceType ResourceType = "vpc-endpoint-connection-device-type" - ResourceTypeVerifiedAccessInstance ResourceType = "verified-access-instance" - ResourceTypeVerifiedAccessGroup ResourceType = "verified-access-group" - ResourceTypeVerifiedAccessEndpoint ResourceType = "verified-access-endpoint" - ResourceTypeVerifiedAccessPolicy ResourceType = "verified-access-policy" - ResourceTypeVerifiedAccessTrustProvider ResourceType = "verified-access-trust-provider" - ResourceTypeVpnConnectionDeviceType ResourceType = "vpn-connection-device-type" - ResourceTypeVpcBlockPublicAccessExclusion ResourceType = "vpc-block-public-access-exclusion" - ResourceTypeRouteServer ResourceType = "route-server" - ResourceTypeRouteServerEndpoint ResourceType = "route-server-endpoint" - ResourceTypeRouteServerPeer ResourceType = "route-server-peer" - ResourceTypeIpamResourceDiscovery ResourceType = "ipam-resource-discovery" - ResourceTypeIpamResourceDiscoveryAssociation ResourceType = "ipam-resource-discovery-association" - ResourceTypeInstanceConnectEndpoint ResourceType = "instance-connect-endpoint" - ResourceTypeVerifiedAccessEndpointTarget ResourceType = "verified-access-endpoint-target" - ResourceTypeIpamExternalResourceVerificationToken ResourceType = "ipam-external-resource-verification-token" - ResourceTypeCapacityBlock ResourceType = "capacity-block" - ResourceTypeMacModificationTask ResourceType = "mac-modification-task" -) - -// Values returns all known values for ResourceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResourceType) Values() []ResourceType { - return []ResourceType{ - "capacity-reservation", - "client-vpn-endpoint", - "customer-gateway", - "carrier-gateway", - "coip-pool", - "declarative-policies-report", - "dedicated-host", - "dhcp-options", - "egress-only-internet-gateway", - "elastic-ip", - "elastic-gpu", - "export-image-task", - "export-instance-task", - "fleet", - "fpga-image", - "host-reservation", - "image", - "import-image-task", - "import-snapshot-task", - "instance", - "instance-event-window", - "internet-gateway", - "ipam", - "ipam-pool", - "ipam-scope", - "ipv4pool-ec2", - "ipv6pool-ec2", - "key-pair", - "launch-template", - "local-gateway", - "local-gateway-route-table", - "local-gateway-virtual-interface", - "local-gateway-virtual-interface-group", - "local-gateway-route-table-vpc-association", - "local-gateway-route-table-virtual-interface-group-association", - "natgateway", - "network-acl", - "network-interface", - "network-insights-analysis", - "network-insights-path", - "network-insights-access-scope", - "network-insights-access-scope-analysis", - "outpost-lag", - "placement-group", - "prefix-list", - "replace-root-volume-task", - "reserved-instances", - "route-table", - "security-group", - "security-group-rule", - "service-link-virtual-interface", - "snapshot", - "spot-fleet-request", - "spot-instances-request", - "subnet", - "subnet-cidr-reservation", - "traffic-mirror-filter", - "traffic-mirror-session", - "traffic-mirror-target", - "transit-gateway", - "transit-gateway-attachment", - "transit-gateway-connect-peer", - "transit-gateway-multicast-domain", - "transit-gateway-policy-table", - "transit-gateway-route-table", - "transit-gateway-route-table-announcement", - "volume", - "vpc", - "vpc-endpoint", - "vpc-endpoint-connection", - "vpc-endpoint-service", - "vpc-endpoint-service-permission", - "vpc-peering-connection", - "vpn-connection", - "vpn-gateway", - "vpc-flow-log", - "capacity-reservation-fleet", - "traffic-mirror-filter-rule", - "vpc-endpoint-connection-device-type", - "verified-access-instance", - "verified-access-group", - "verified-access-endpoint", - "verified-access-policy", - "verified-access-trust-provider", - "vpn-connection-device-type", - "vpc-block-public-access-exclusion", - "route-server", - "route-server-endpoint", - "route-server-peer", - "ipam-resource-discovery", - "ipam-resource-discovery-association", - "instance-connect-endpoint", - "verified-access-endpoint-target", - "ipam-external-resource-verification-token", - "capacity-block", - "mac-modification-task", - } -} - -type RIProductDescription string - -// Enum values for RIProductDescription -const ( - RIProductDescriptionLinuxUnix RIProductDescription = "Linux/UNIX" - RIProductDescriptionLinuxUnixAmazonVpc RIProductDescription = "Linux/UNIX (Amazon VPC)" - RIProductDescriptionWindows RIProductDescription = "Windows" - RIProductDescriptionWindowsAmazonVpc RIProductDescription = "Windows (Amazon VPC)" -) - -// Values returns all known values for RIProductDescription. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RIProductDescription) Values() []RIProductDescription { - return []RIProductDescription{ - "Linux/UNIX", - "Linux/UNIX (Amazon VPC)", - "Windows", - "Windows (Amazon VPC)", - } -} - -type RootDeviceType string - -// Enum values for RootDeviceType -const ( - RootDeviceTypeEbs RootDeviceType = "ebs" - RootDeviceTypeInstanceStore RootDeviceType = "instance-store" -) - -// Values returns all known values for RootDeviceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RootDeviceType) Values() []RootDeviceType { - return []RootDeviceType{ - "ebs", - "instance-store", - } -} - -type RouteOrigin string - -// Enum values for RouteOrigin -const ( - RouteOriginCreateRouteTable RouteOrigin = "CreateRouteTable" - RouteOriginCreateRoute RouteOrigin = "CreateRoute" - RouteOriginEnableVgwRoutePropagation RouteOrigin = "EnableVgwRoutePropagation" -) - -// Values returns all known values for RouteOrigin. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteOrigin) Values() []RouteOrigin { - return []RouteOrigin{ - "CreateRouteTable", - "CreateRoute", - "EnableVgwRoutePropagation", - } -} - -type RouteServerAssociationState string - -// Enum values for RouteServerAssociationState -const ( - RouteServerAssociationStateAssociating RouteServerAssociationState = "associating" - RouteServerAssociationStateAssociated RouteServerAssociationState = "associated" - RouteServerAssociationStateDisassociating RouteServerAssociationState = "disassociating" -) - -// Values returns all known values for RouteServerAssociationState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerAssociationState) Values() []RouteServerAssociationState { - return []RouteServerAssociationState{ - "associating", - "associated", - "disassociating", - } -} - -type RouteServerBfdState string - -// Enum values for RouteServerBfdState -const ( - RouteServerBfdStateUp RouteServerBfdState = "up" - RouteServerBfdStateDown RouteServerBfdState = "down" -) - -// Values returns all known values for RouteServerBfdState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerBfdState) Values() []RouteServerBfdState { - return []RouteServerBfdState{ - "up", - "down", - } -} - -type RouteServerBgpState string - -// Enum values for RouteServerBgpState -const ( - RouteServerBgpStateUp RouteServerBgpState = "up" - RouteServerBgpStateDown RouteServerBgpState = "down" -) - -// Values returns all known values for RouteServerBgpState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerBgpState) Values() []RouteServerBgpState { - return []RouteServerBgpState{ - "up", - "down", - } -} - -type RouteServerEndpointState string - -// Enum values for RouteServerEndpointState -const ( - RouteServerEndpointStatePending RouteServerEndpointState = "pending" - RouteServerEndpointStateAvailable RouteServerEndpointState = "available" - RouteServerEndpointStateDeleting RouteServerEndpointState = "deleting" - RouteServerEndpointStateDeleted RouteServerEndpointState = "deleted" - RouteServerEndpointStateFailing RouteServerEndpointState = "failing" - RouteServerEndpointStateFailed RouteServerEndpointState = "failed" - RouteServerEndpointStateDeleteFailed RouteServerEndpointState = "delete-failed" -) - -// Values returns all known values for RouteServerEndpointState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerEndpointState) Values() []RouteServerEndpointState { - return []RouteServerEndpointState{ - "pending", - "available", - "deleting", - "deleted", - "failing", - "failed", - "delete-failed", - } -} - -type RouteServerPeerLivenessMode string - -// Enum values for RouteServerPeerLivenessMode -const ( - RouteServerPeerLivenessModeBfd RouteServerPeerLivenessMode = "bfd" - RouteServerPeerLivenessModeBgpKeepalive RouteServerPeerLivenessMode = "bgp-keepalive" -) - -// Values returns all known values for RouteServerPeerLivenessMode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerPeerLivenessMode) Values() []RouteServerPeerLivenessMode { - return []RouteServerPeerLivenessMode{ - "bfd", - "bgp-keepalive", - } -} - -type RouteServerPeerState string - -// Enum values for RouteServerPeerState -const ( - RouteServerPeerStatePending RouteServerPeerState = "pending" - RouteServerPeerStateAvailable RouteServerPeerState = "available" - RouteServerPeerStateDeleting RouteServerPeerState = "deleting" - RouteServerPeerStateDeleted RouteServerPeerState = "deleted" - RouteServerPeerStateFailing RouteServerPeerState = "failing" - RouteServerPeerStateFailed RouteServerPeerState = "failed" -) - -// Values returns all known values for RouteServerPeerState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerPeerState) Values() []RouteServerPeerState { - return []RouteServerPeerState{ - "pending", - "available", - "deleting", - "deleted", - "failing", - "failed", - } -} - -type RouteServerPersistRoutesAction string - -// Enum values for RouteServerPersistRoutesAction -const ( - RouteServerPersistRoutesActionEnable RouteServerPersistRoutesAction = "enable" - RouteServerPersistRoutesActionDisable RouteServerPersistRoutesAction = "disable" - RouteServerPersistRoutesActionReset RouteServerPersistRoutesAction = "reset" -) - -// Values returns all known values for RouteServerPersistRoutesAction. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerPersistRoutesAction) Values() []RouteServerPersistRoutesAction { - return []RouteServerPersistRoutesAction{ - "enable", - "disable", - "reset", - } -} - -type RouteServerPersistRoutesState string - -// Enum values for RouteServerPersistRoutesState -const ( - RouteServerPersistRoutesStateEnabling RouteServerPersistRoutesState = "enabling" - RouteServerPersistRoutesStateEnabled RouteServerPersistRoutesState = "enabled" - RouteServerPersistRoutesStateResetting RouteServerPersistRoutesState = "resetting" - RouteServerPersistRoutesStateDisabling RouteServerPersistRoutesState = "disabling" - RouteServerPersistRoutesStateDisabled RouteServerPersistRoutesState = "disabled" - RouteServerPersistRoutesStateModifying RouteServerPersistRoutesState = "modifying" -) - -// Values returns all known values for RouteServerPersistRoutesState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerPersistRoutesState) Values() []RouteServerPersistRoutesState { - return []RouteServerPersistRoutesState{ - "enabling", - "enabled", - "resetting", - "disabling", - "disabled", - "modifying", - } -} - -type RouteServerPropagationState string - -// Enum values for RouteServerPropagationState -const ( - RouteServerPropagationStatePending RouteServerPropagationState = "pending" - RouteServerPropagationStateAvailable RouteServerPropagationState = "available" - RouteServerPropagationStateDeleting RouteServerPropagationState = "deleting" -) - -// Values returns all known values for RouteServerPropagationState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerPropagationState) Values() []RouteServerPropagationState { - return []RouteServerPropagationState{ - "pending", - "available", - "deleting", - } -} - -type RouteServerRouteInstallationStatus string - -// Enum values for RouteServerRouteInstallationStatus -const ( - RouteServerRouteInstallationStatusInstalled RouteServerRouteInstallationStatus = "installed" - RouteServerRouteInstallationStatusRejected RouteServerRouteInstallationStatus = "rejected" -) - -// Values returns all known values for RouteServerRouteInstallationStatus. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerRouteInstallationStatus) Values() []RouteServerRouteInstallationStatus { - return []RouteServerRouteInstallationStatus{ - "installed", - "rejected", - } -} - -type RouteServerRouteStatus string - -// Enum values for RouteServerRouteStatus -const ( - RouteServerRouteStatusInRib RouteServerRouteStatus = "in-rib" - RouteServerRouteStatusInFib RouteServerRouteStatus = "in-fib" -) - -// Values returns all known values for RouteServerRouteStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerRouteStatus) Values() []RouteServerRouteStatus { - return []RouteServerRouteStatus{ - "in-rib", - "in-fib", - } -} - -type RouteServerState string - -// Enum values for RouteServerState -const ( - RouteServerStatePending RouteServerState = "pending" - RouteServerStateAvailable RouteServerState = "available" - RouteServerStateModifying RouteServerState = "modifying" - RouteServerStateDeleting RouteServerState = "deleting" - RouteServerStateDeleted RouteServerState = "deleted" -) - -// Values returns all known values for RouteServerState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteServerState) Values() []RouteServerState { - return []RouteServerState{ - "pending", - "available", - "modifying", - "deleting", - "deleted", - } -} - -type RouteState string - -// Enum values for RouteState -const ( - RouteStateActive RouteState = "active" - RouteStateBlackhole RouteState = "blackhole" -) - -// Values returns all known values for RouteState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteState) Values() []RouteState { - return []RouteState{ - "active", - "blackhole", - } -} - -type RouteTableAssociationStateCode string - -// Enum values for RouteTableAssociationStateCode -const ( - RouteTableAssociationStateCodeAssociating RouteTableAssociationStateCode = "associating" - RouteTableAssociationStateCodeAssociated RouteTableAssociationStateCode = "associated" - RouteTableAssociationStateCodeDisassociating RouteTableAssociationStateCode = "disassociating" - RouteTableAssociationStateCodeDisassociated RouteTableAssociationStateCode = "disassociated" - RouteTableAssociationStateCodeFailed RouteTableAssociationStateCode = "failed" -) - -// Values returns all known values for RouteTableAssociationStateCode. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RouteTableAssociationStateCode) Values() []RouteTableAssociationStateCode { - return []RouteTableAssociationStateCode{ - "associating", - "associated", - "disassociating", - "disassociated", - "failed", - } -} - -type RuleAction string - -// Enum values for RuleAction -const ( - RuleActionAllow RuleAction = "allow" - RuleActionDeny RuleAction = "deny" -) - -// Values returns all known values for RuleAction. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RuleAction) Values() []RuleAction { - return []RuleAction{ - "allow", - "deny", - } -} - -type Scope string - -// Enum values for Scope -const ( - ScopeAvailabilityZone Scope = "Availability Zone" - ScopeRegional Scope = "Region" -) - -// Values returns all known values for Scope. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Scope) Values() []Scope { - return []Scope{ - "Availability Zone", - "Region", - } -} - -type SecurityGroupReferencingSupportValue string - -// Enum values for SecurityGroupReferencingSupportValue -const ( - SecurityGroupReferencingSupportValueEnable SecurityGroupReferencingSupportValue = "enable" - SecurityGroupReferencingSupportValueDisable SecurityGroupReferencingSupportValue = "disable" -) - -// Values returns all known values for SecurityGroupReferencingSupportValue. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SecurityGroupReferencingSupportValue) Values() []SecurityGroupReferencingSupportValue { - return []SecurityGroupReferencingSupportValue{ - "enable", - "disable", - } -} - -type SecurityGroupVpcAssociationState string - -// Enum values for SecurityGroupVpcAssociationState -const ( - SecurityGroupVpcAssociationStateAssociating SecurityGroupVpcAssociationState = "associating" - SecurityGroupVpcAssociationStateAssociated SecurityGroupVpcAssociationState = "associated" - SecurityGroupVpcAssociationStateAssociationFailed SecurityGroupVpcAssociationState = "association-failed" - SecurityGroupVpcAssociationStateDisassociating SecurityGroupVpcAssociationState = "disassociating" - SecurityGroupVpcAssociationStateDisassociated SecurityGroupVpcAssociationState = "disassociated" - SecurityGroupVpcAssociationStateDisassociationFailed SecurityGroupVpcAssociationState = "disassociation-failed" -) - -// Values returns all known values for SecurityGroupVpcAssociationState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SecurityGroupVpcAssociationState) Values() []SecurityGroupVpcAssociationState { - return []SecurityGroupVpcAssociationState{ - "associating", - "associated", - "association-failed", - "disassociating", - "disassociated", - "disassociation-failed", - } -} - -type SelfServicePortal string - -// Enum values for SelfServicePortal -const ( - SelfServicePortalEnabled SelfServicePortal = "enabled" - SelfServicePortalDisabled SelfServicePortal = "disabled" -) - -// Values returns all known values for SelfServicePortal. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SelfServicePortal) Values() []SelfServicePortal { - return []SelfServicePortal{ - "enabled", - "disabled", - } -} - -type ServiceConnectivityType string - -// Enum values for ServiceConnectivityType -const ( - ServiceConnectivityTypeIpv4 ServiceConnectivityType = "ipv4" - ServiceConnectivityTypeIpv6 ServiceConnectivityType = "ipv6" -) - -// Values returns all known values for ServiceConnectivityType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ServiceConnectivityType) Values() []ServiceConnectivityType { - return []ServiceConnectivityType{ - "ipv4", - "ipv6", - } -} - -type ServiceLinkVirtualInterfaceConfigurationState string - -// Enum values for ServiceLinkVirtualInterfaceConfigurationState -const ( - ServiceLinkVirtualInterfaceConfigurationStatePending ServiceLinkVirtualInterfaceConfigurationState = "pending" - ServiceLinkVirtualInterfaceConfigurationStateAvailable ServiceLinkVirtualInterfaceConfigurationState = "available" - ServiceLinkVirtualInterfaceConfigurationStateDeleting ServiceLinkVirtualInterfaceConfigurationState = "deleting" - ServiceLinkVirtualInterfaceConfigurationStateDeleted ServiceLinkVirtualInterfaceConfigurationState = "deleted" -) - -// Values returns all known values for -// ServiceLinkVirtualInterfaceConfigurationState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ServiceLinkVirtualInterfaceConfigurationState) Values() []ServiceLinkVirtualInterfaceConfigurationState { - return []ServiceLinkVirtualInterfaceConfigurationState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type ServiceManaged string - -// Enum values for ServiceManaged -const ( - ServiceManagedAlb ServiceManaged = "alb" - ServiceManagedNlb ServiceManaged = "nlb" - ServiceManagedRnat ServiceManaged = "rnat" -) - -// Values returns all known values for ServiceManaged. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ServiceManaged) Values() []ServiceManaged { - return []ServiceManaged{ - "alb", - "nlb", - "rnat", - } -} - -type ServiceState string - -// Enum values for ServiceState -const ( - ServiceStatePending ServiceState = "Pending" - ServiceStateAvailable ServiceState = "Available" - ServiceStateDeleting ServiceState = "Deleting" - ServiceStateDeleted ServiceState = "Deleted" - ServiceStateFailed ServiceState = "Failed" -) - -// Values returns all known values for ServiceState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ServiceState) Values() []ServiceState { - return []ServiceState{ - "Pending", - "Available", - "Deleting", - "Deleted", - "Failed", - } -} - -type ServiceType string - -// Enum values for ServiceType -const ( - ServiceTypeInterface ServiceType = "Interface" - ServiceTypeGateway ServiceType = "Gateway" - ServiceTypeGatewayLoadBalancer ServiceType = "GatewayLoadBalancer" -) - -// Values returns all known values for ServiceType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ServiceType) Values() []ServiceType { - return []ServiceType{ - "Interface", - "Gateway", - "GatewayLoadBalancer", - } -} - -type ShutdownBehavior string - -// Enum values for ShutdownBehavior -const ( - ShutdownBehaviorStop ShutdownBehavior = "stop" - ShutdownBehaviorTerminate ShutdownBehavior = "terminate" -) - -// Values returns all known values for ShutdownBehavior. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ShutdownBehavior) Values() []ShutdownBehavior { - return []ShutdownBehavior{ - "stop", - "terminate", - } -} - -type SnapshotAttributeName string - -// Enum values for SnapshotAttributeName -const ( - SnapshotAttributeNameProductCodes SnapshotAttributeName = "productCodes" - SnapshotAttributeNameCreateVolumePermission SnapshotAttributeName = "createVolumePermission" -) - -// Values returns all known values for SnapshotAttributeName. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SnapshotAttributeName) Values() []SnapshotAttributeName { - return []SnapshotAttributeName{ - "productCodes", - "createVolumePermission", - } -} - -type SnapshotBlockPublicAccessState string - -// Enum values for SnapshotBlockPublicAccessState -const ( - SnapshotBlockPublicAccessStateBlockAllSharing SnapshotBlockPublicAccessState = "block-all-sharing" - SnapshotBlockPublicAccessStateBlockNewSharing SnapshotBlockPublicAccessState = "block-new-sharing" - SnapshotBlockPublicAccessStateUnblocked SnapshotBlockPublicAccessState = "unblocked" -) - -// Values returns all known values for SnapshotBlockPublicAccessState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SnapshotBlockPublicAccessState) Values() []SnapshotBlockPublicAccessState { - return []SnapshotBlockPublicAccessState{ - "block-all-sharing", - "block-new-sharing", - "unblocked", - } -} - -type SnapshotLocationEnum string - -// Enum values for SnapshotLocationEnum -const ( - SnapshotLocationEnumRegional SnapshotLocationEnum = "regional" - SnapshotLocationEnumLocal SnapshotLocationEnum = "local" -) - -// Values returns all known values for SnapshotLocationEnum. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SnapshotLocationEnum) Values() []SnapshotLocationEnum { - return []SnapshotLocationEnum{ - "regional", - "local", - } -} - -type SnapshotReturnCodes string - -// Enum values for SnapshotReturnCodes -const ( - SnapshotReturnCodesSuccess SnapshotReturnCodes = "success" - SnapshotReturnCodesWarnSkipped SnapshotReturnCodes = "skipped" - SnapshotReturnCodesErrorMissingPermissions SnapshotReturnCodes = "missing-permissions" - SnapshotReturnCodesErrorCodeInternalError SnapshotReturnCodes = "internal-error" - SnapshotReturnCodesErrorCodeClientError SnapshotReturnCodes = "client-error" -) - -// Values returns all known values for SnapshotReturnCodes. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SnapshotReturnCodes) Values() []SnapshotReturnCodes { - return []SnapshotReturnCodes{ - "success", - "skipped", - "missing-permissions", - "internal-error", - "client-error", - } -} - -type SnapshotState string - -// Enum values for SnapshotState -const ( - SnapshotStatePending SnapshotState = "pending" - SnapshotStateCompleted SnapshotState = "completed" - SnapshotStateError SnapshotState = "error" - SnapshotStateRecoverable SnapshotState = "recoverable" - SnapshotStateRecovering SnapshotState = "recovering" -) - -// Values returns all known values for SnapshotState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SnapshotState) Values() []SnapshotState { - return []SnapshotState{ - "pending", - "completed", - "error", - "recoverable", - "recovering", - } -} - -type SpotAllocationStrategy string - -// Enum values for SpotAllocationStrategy -const ( - SpotAllocationStrategyLowestPrice SpotAllocationStrategy = "lowest-price" - SpotAllocationStrategyDiversified SpotAllocationStrategy = "diversified" - SpotAllocationStrategyCapacityOptimized SpotAllocationStrategy = "capacity-optimized" - SpotAllocationStrategyCapacityOptimizedPrioritized SpotAllocationStrategy = "capacity-optimized-prioritized" - SpotAllocationStrategyPriceCapacityOptimized SpotAllocationStrategy = "price-capacity-optimized" -) - -// Values returns all known values for SpotAllocationStrategy. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SpotAllocationStrategy) Values() []SpotAllocationStrategy { - return []SpotAllocationStrategy{ - "lowest-price", - "diversified", - "capacity-optimized", - "capacity-optimized-prioritized", - "price-capacity-optimized", - } -} - -type SpotInstanceInterruptionBehavior string - -// Enum values for SpotInstanceInterruptionBehavior -const ( - SpotInstanceInterruptionBehaviorHibernate SpotInstanceInterruptionBehavior = "hibernate" - SpotInstanceInterruptionBehaviorStop SpotInstanceInterruptionBehavior = "stop" - SpotInstanceInterruptionBehaviorTerminate SpotInstanceInterruptionBehavior = "terminate" -) - -// Values returns all known values for SpotInstanceInterruptionBehavior. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SpotInstanceInterruptionBehavior) Values() []SpotInstanceInterruptionBehavior { - return []SpotInstanceInterruptionBehavior{ - "hibernate", - "stop", - "terminate", - } -} - -type SpotInstanceState string - -// Enum values for SpotInstanceState -const ( - SpotInstanceStateOpen SpotInstanceState = "open" - SpotInstanceStateActive SpotInstanceState = "active" - SpotInstanceStateClosed SpotInstanceState = "closed" - SpotInstanceStateCancelled SpotInstanceState = "cancelled" - SpotInstanceStateFailed SpotInstanceState = "failed" - SpotInstanceStateDisabled SpotInstanceState = "disabled" -) - -// Values returns all known values for SpotInstanceState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SpotInstanceState) Values() []SpotInstanceState { - return []SpotInstanceState{ - "open", - "active", - "closed", - "cancelled", - "failed", - "disabled", - } -} - -type SpotInstanceType string - -// Enum values for SpotInstanceType -const ( - SpotInstanceTypeOneTime SpotInstanceType = "one-time" - SpotInstanceTypePersistent SpotInstanceType = "persistent" -) - -// Values returns all known values for SpotInstanceType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SpotInstanceType) Values() []SpotInstanceType { - return []SpotInstanceType{ - "one-time", - "persistent", - } -} - -type SpreadLevel string - -// Enum values for SpreadLevel -const ( - SpreadLevelHost SpreadLevel = "host" - SpreadLevelRack SpreadLevel = "rack" -) - -// Values returns all known values for SpreadLevel. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SpreadLevel) Values() []SpreadLevel { - return []SpreadLevel{ - "host", - "rack", - } -} - -type SSEType string - -// Enum values for SSEType -const ( - SSETypeSseEbs SSEType = "sse-ebs" - SSETypeSseKms SSEType = "sse-kms" - SSETypeNone SSEType = "none" -) - -// Values returns all known values for SSEType. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SSEType) Values() []SSEType { - return []SSEType{ - "sse-ebs", - "sse-kms", - "none", - } -} - -type State string - -// Enum values for State -const ( - StatePendingAcceptance State = "PendingAcceptance" - StatePending State = "Pending" - StateAvailable State = "Available" - StateDeleting State = "Deleting" - StateDeleted State = "Deleted" - StateRejected State = "Rejected" - StateFailed State = "Failed" - StateExpired State = "Expired" - StatePartial State = "Partial" -) - -// Values returns all known values for State. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (State) Values() []State { - return []State{ - "PendingAcceptance", - "Pending", - "Available", - "Deleting", - "Deleted", - "Rejected", - "Failed", - "Expired", - "Partial", - } -} - -type StaticSourcesSupportValue string - -// Enum values for StaticSourcesSupportValue -const ( - StaticSourcesSupportValueEnable StaticSourcesSupportValue = "enable" - StaticSourcesSupportValueDisable StaticSourcesSupportValue = "disable" -) - -// Values returns all known values for StaticSourcesSupportValue. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (StaticSourcesSupportValue) Values() []StaticSourcesSupportValue { - return []StaticSourcesSupportValue{ - "enable", - "disable", - } -} - -type StatisticType string - -// Enum values for StatisticType -const ( - StatisticTypeP50 StatisticType = "p50" -) - -// Values returns all known values for StatisticType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (StatisticType) Values() []StatisticType { - return []StatisticType{ - "p50", - } -} - -type Status string - -// Enum values for Status -const ( - StatusMoveInProgress Status = "MoveInProgress" - StatusInVpc Status = "InVpc" - StatusInClassic Status = "InClassic" -) - -// Values returns all known values for Status. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Status) Values() []Status { - return []Status{ - "MoveInProgress", - "InVpc", - "InClassic", - } -} - -type StatusName string - -// Enum values for StatusName -const ( - StatusNameReachability StatusName = "reachability" -) - -// Values returns all known values for StatusName. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (StatusName) Values() []StatusName { - return []StatusName{ - "reachability", - } -} - -type StatusType string - -// Enum values for StatusType -const ( - StatusTypePassed StatusType = "passed" - StatusTypeFailed StatusType = "failed" - StatusTypeInsufficientData StatusType = "insufficient-data" - StatusTypeInitializing StatusType = "initializing" -) - -// Values returns all known values for StatusType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (StatusType) Values() []StatusType { - return []StatusType{ - "passed", - "failed", - "insufficient-data", - "initializing", - } -} - -type StorageTier string - -// Enum values for StorageTier -const ( - StorageTierArchive StorageTier = "archive" - StorageTierStandard StorageTier = "standard" -) - -// Values returns all known values for StorageTier. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (StorageTier) Values() []StorageTier { - return []StorageTier{ - "archive", - "standard", - } -} - -type SubnetCidrBlockStateCode string - -// Enum values for SubnetCidrBlockStateCode -const ( - SubnetCidrBlockStateCodeAssociating SubnetCidrBlockStateCode = "associating" - SubnetCidrBlockStateCodeAssociated SubnetCidrBlockStateCode = "associated" - SubnetCidrBlockStateCodeDisassociating SubnetCidrBlockStateCode = "disassociating" - SubnetCidrBlockStateCodeDisassociated SubnetCidrBlockStateCode = "disassociated" - SubnetCidrBlockStateCodeFailing SubnetCidrBlockStateCode = "failing" - SubnetCidrBlockStateCodeFailed SubnetCidrBlockStateCode = "failed" -) - -// Values returns all known values for SubnetCidrBlockStateCode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SubnetCidrBlockStateCode) Values() []SubnetCidrBlockStateCode { - return []SubnetCidrBlockStateCode{ - "associating", - "associated", - "disassociating", - "disassociated", - "failing", - "failed", - } -} - -type SubnetCidrReservationType string - -// Enum values for SubnetCidrReservationType -const ( - SubnetCidrReservationTypePrefix SubnetCidrReservationType = "prefix" - SubnetCidrReservationTypeExplicit SubnetCidrReservationType = "explicit" -) - -// Values returns all known values for SubnetCidrReservationType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SubnetCidrReservationType) Values() []SubnetCidrReservationType { - return []SubnetCidrReservationType{ - "prefix", - "explicit", - } -} - -type SubnetState string - -// Enum values for SubnetState -const ( - SubnetStatePending SubnetState = "pending" - SubnetStateAvailable SubnetState = "available" - SubnetStateUnavailable SubnetState = "unavailable" - SubnetStateFailed SubnetState = "failed" - SubnetStateFailedInsufficientCapacity SubnetState = "failed-insufficient-capacity" -) - -// Values returns all known values for SubnetState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SubnetState) Values() []SubnetState { - return []SubnetState{ - "pending", - "available", - "unavailable", - "failed", - "failed-insufficient-capacity", - } -} - -type SummaryStatus string - -// Enum values for SummaryStatus -const ( - SummaryStatusOk SummaryStatus = "ok" - SummaryStatusImpaired SummaryStatus = "impaired" - SummaryStatusInsufficientData SummaryStatus = "insufficient-data" - SummaryStatusNotApplicable SummaryStatus = "not-applicable" - SummaryStatusInitializing SummaryStatus = "initializing" -) - -// Values returns all known values for SummaryStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SummaryStatus) Values() []SummaryStatus { - return []SummaryStatus{ - "ok", - "impaired", - "insufficient-data", - "not-applicable", - "initializing", - } -} - -type SupportedAdditionalProcessorFeature string - -// Enum values for SupportedAdditionalProcessorFeature -const ( - SupportedAdditionalProcessorFeatureAmdSevSnp SupportedAdditionalProcessorFeature = "amd-sev-snp" -) - -// Values returns all known values for SupportedAdditionalProcessorFeature. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SupportedAdditionalProcessorFeature) Values() []SupportedAdditionalProcessorFeature { - return []SupportedAdditionalProcessorFeature{ - "amd-sev-snp", - } -} - -type TargetCapacityUnitType string - -// Enum values for TargetCapacityUnitType -const ( - TargetCapacityUnitTypeVcpu TargetCapacityUnitType = "vcpu" - TargetCapacityUnitTypeMemoryMib TargetCapacityUnitType = "memory-mib" - TargetCapacityUnitTypeUnits TargetCapacityUnitType = "units" -) - -// Values returns all known values for TargetCapacityUnitType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TargetCapacityUnitType) Values() []TargetCapacityUnitType { - return []TargetCapacityUnitType{ - "vcpu", - "memory-mib", - "units", - } -} - -type TargetStorageTier string - -// Enum values for TargetStorageTier -const ( - TargetStorageTierArchive TargetStorageTier = "archive" -) - -// Values returns all known values for TargetStorageTier. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TargetStorageTier) Values() []TargetStorageTier { - return []TargetStorageTier{ - "archive", - } -} - -type TelemetryStatus string - -// Enum values for TelemetryStatus -const ( - TelemetryStatusUp TelemetryStatus = "UP" - TelemetryStatusDown TelemetryStatus = "DOWN" -) - -// Values returns all known values for TelemetryStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TelemetryStatus) Values() []TelemetryStatus { - return []TelemetryStatus{ - "UP", - "DOWN", - } -} - -type Tenancy string - -// Enum values for Tenancy -const ( - TenancyDefault Tenancy = "default" - TenancyDedicated Tenancy = "dedicated" - TenancyHost Tenancy = "host" -) - -// Values returns all known values for Tenancy. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Tenancy) Values() []Tenancy { - return []Tenancy{ - "default", - "dedicated", - "host", - } -} - -type TieringOperationStatus string - -// Enum values for TieringOperationStatus -const ( - TieringOperationStatusArchivalInProgress TieringOperationStatus = "archival-in-progress" - TieringOperationStatusArchivalCompleted TieringOperationStatus = "archival-completed" - TieringOperationStatusArchivalFailed TieringOperationStatus = "archival-failed" - TieringOperationStatusTemporaryRestoreInProgress TieringOperationStatus = "temporary-restore-in-progress" - TieringOperationStatusTemporaryRestoreCompleted TieringOperationStatus = "temporary-restore-completed" - TieringOperationStatusTemporaryRestoreFailed TieringOperationStatus = "temporary-restore-failed" - TieringOperationStatusPermanentRestoreInProgress TieringOperationStatus = "permanent-restore-in-progress" - TieringOperationStatusPermanentRestoreCompleted TieringOperationStatus = "permanent-restore-completed" - TieringOperationStatusPermanentRestoreFailed TieringOperationStatus = "permanent-restore-failed" -) - -// Values returns all known values for TieringOperationStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TieringOperationStatus) Values() []TieringOperationStatus { - return []TieringOperationStatus{ - "archival-in-progress", - "archival-completed", - "archival-failed", - "temporary-restore-in-progress", - "temporary-restore-completed", - "temporary-restore-failed", - "permanent-restore-in-progress", - "permanent-restore-completed", - "permanent-restore-failed", - } -} - -type TokenState string - -// Enum values for TokenState -const ( - TokenStateValid TokenState = "valid" - TokenStateExpired TokenState = "expired" -) - -// Values returns all known values for TokenState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TokenState) Values() []TokenState { - return []TokenState{ - "valid", - "expired", - } -} - -type TpmSupportValues string - -// Enum values for TpmSupportValues -const ( - TpmSupportValuesV20 TpmSupportValues = "v2.0" -) - -// Values returns all known values for TpmSupportValues. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TpmSupportValues) Values() []TpmSupportValues { - return []TpmSupportValues{ - "v2.0", - } -} - -type TrafficDirection string - -// Enum values for TrafficDirection -const ( - TrafficDirectionIngress TrafficDirection = "ingress" - TrafficDirectionEgress TrafficDirection = "egress" -) - -// Values returns all known values for TrafficDirection. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficDirection) Values() []TrafficDirection { - return []TrafficDirection{ - "ingress", - "egress", - } -} - -type TrafficMirrorFilterRuleField string - -// Enum values for TrafficMirrorFilterRuleField -const ( - TrafficMirrorFilterRuleFieldDestinationPortRange TrafficMirrorFilterRuleField = "destination-port-range" - TrafficMirrorFilterRuleFieldSourcePortRange TrafficMirrorFilterRuleField = "source-port-range" - TrafficMirrorFilterRuleFieldProtocol TrafficMirrorFilterRuleField = "protocol" - TrafficMirrorFilterRuleFieldDescription TrafficMirrorFilterRuleField = "description" -) - -// Values returns all known values for TrafficMirrorFilterRuleField. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficMirrorFilterRuleField) Values() []TrafficMirrorFilterRuleField { - return []TrafficMirrorFilterRuleField{ - "destination-port-range", - "source-port-range", - "protocol", - "description", - } -} - -type TrafficMirrorNetworkService string - -// Enum values for TrafficMirrorNetworkService -const ( - TrafficMirrorNetworkServiceAmazonDns TrafficMirrorNetworkService = "amazon-dns" -) - -// Values returns all known values for TrafficMirrorNetworkService. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficMirrorNetworkService) Values() []TrafficMirrorNetworkService { - return []TrafficMirrorNetworkService{ - "amazon-dns", - } -} - -type TrafficMirrorRuleAction string - -// Enum values for TrafficMirrorRuleAction -const ( - TrafficMirrorRuleActionAccept TrafficMirrorRuleAction = "accept" - TrafficMirrorRuleActionReject TrafficMirrorRuleAction = "reject" -) - -// Values returns all known values for TrafficMirrorRuleAction. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficMirrorRuleAction) Values() []TrafficMirrorRuleAction { - return []TrafficMirrorRuleAction{ - "accept", - "reject", - } -} - -type TrafficMirrorSessionField string - -// Enum values for TrafficMirrorSessionField -const ( - TrafficMirrorSessionFieldPacketLength TrafficMirrorSessionField = "packet-length" - TrafficMirrorSessionFieldDescription TrafficMirrorSessionField = "description" - TrafficMirrorSessionFieldVirtualNetworkId TrafficMirrorSessionField = "virtual-network-id" -) - -// Values returns all known values for TrafficMirrorSessionField. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficMirrorSessionField) Values() []TrafficMirrorSessionField { - return []TrafficMirrorSessionField{ - "packet-length", - "description", - "virtual-network-id", - } -} - -type TrafficMirrorTargetType string - -// Enum values for TrafficMirrorTargetType -const ( - TrafficMirrorTargetTypeNetworkInterface TrafficMirrorTargetType = "network-interface" - TrafficMirrorTargetTypeNetworkLoadBalancer TrafficMirrorTargetType = "network-load-balancer" - TrafficMirrorTargetTypeGatewayLoadBalancerEndpoint TrafficMirrorTargetType = "gateway-load-balancer-endpoint" -) - -// Values returns all known values for TrafficMirrorTargetType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficMirrorTargetType) Values() []TrafficMirrorTargetType { - return []TrafficMirrorTargetType{ - "network-interface", - "network-load-balancer", - "gateway-load-balancer-endpoint", - } -} - -type TrafficType string - -// Enum values for TrafficType -const ( - TrafficTypeAccept TrafficType = "ACCEPT" - TrafficTypeReject TrafficType = "REJECT" - TrafficTypeAll TrafficType = "ALL" -) - -// Values returns all known values for TrafficType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrafficType) Values() []TrafficType { - return []TrafficType{ - "ACCEPT", - "REJECT", - "ALL", - } -} - -type TransferType string - -// Enum values for TransferType -const ( - TransferTypeTimeBased TransferType = "time-based" - TransferTypeStandard TransferType = "standard" -) - -// Values returns all known values for TransferType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransferType) Values() []TransferType { - return []TransferType{ - "time-based", - "standard", - } -} - -type TransitGatewayAssociationState string - -// Enum values for TransitGatewayAssociationState -const ( - TransitGatewayAssociationStateAssociating TransitGatewayAssociationState = "associating" - TransitGatewayAssociationStateAssociated TransitGatewayAssociationState = "associated" - TransitGatewayAssociationStateDisassociating TransitGatewayAssociationState = "disassociating" - TransitGatewayAssociationStateDisassociated TransitGatewayAssociationState = "disassociated" -) - -// Values returns all known values for TransitGatewayAssociationState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayAssociationState) Values() []TransitGatewayAssociationState { - return []TransitGatewayAssociationState{ - "associating", - "associated", - "disassociating", - "disassociated", - } -} - -type TransitGatewayAttachmentResourceType string - -// Enum values for TransitGatewayAttachmentResourceType -const ( - TransitGatewayAttachmentResourceTypeVpc TransitGatewayAttachmentResourceType = "vpc" - TransitGatewayAttachmentResourceTypeVpn TransitGatewayAttachmentResourceType = "vpn" - TransitGatewayAttachmentResourceTypeDirectConnectGateway TransitGatewayAttachmentResourceType = "direct-connect-gateway" - TransitGatewayAttachmentResourceTypeConnect TransitGatewayAttachmentResourceType = "connect" - TransitGatewayAttachmentResourceTypePeering TransitGatewayAttachmentResourceType = "peering" - TransitGatewayAttachmentResourceTypeTgwPeering TransitGatewayAttachmentResourceType = "tgw-peering" -) - -// Values returns all known values for TransitGatewayAttachmentResourceType. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayAttachmentResourceType) Values() []TransitGatewayAttachmentResourceType { - return []TransitGatewayAttachmentResourceType{ - "vpc", - "vpn", - "direct-connect-gateway", - "connect", - "peering", - "tgw-peering", - } -} - -type TransitGatewayAttachmentState string - -// Enum values for TransitGatewayAttachmentState -const ( - TransitGatewayAttachmentStateInitiating TransitGatewayAttachmentState = "initiating" - TransitGatewayAttachmentStateInitiatingRequest TransitGatewayAttachmentState = "initiatingRequest" - TransitGatewayAttachmentStatePendingAcceptance TransitGatewayAttachmentState = "pendingAcceptance" - TransitGatewayAttachmentStateRollingBack TransitGatewayAttachmentState = "rollingBack" - TransitGatewayAttachmentStatePending TransitGatewayAttachmentState = "pending" - TransitGatewayAttachmentStateAvailable TransitGatewayAttachmentState = "available" - TransitGatewayAttachmentStateModifying TransitGatewayAttachmentState = "modifying" - TransitGatewayAttachmentStateDeleting TransitGatewayAttachmentState = "deleting" - TransitGatewayAttachmentStateDeleted TransitGatewayAttachmentState = "deleted" - TransitGatewayAttachmentStateFailed TransitGatewayAttachmentState = "failed" - TransitGatewayAttachmentStateRejected TransitGatewayAttachmentState = "rejected" - TransitGatewayAttachmentStateRejecting TransitGatewayAttachmentState = "rejecting" - TransitGatewayAttachmentStateFailing TransitGatewayAttachmentState = "failing" -) - -// Values returns all known values for TransitGatewayAttachmentState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayAttachmentState) Values() []TransitGatewayAttachmentState { - return []TransitGatewayAttachmentState{ - "initiating", - "initiatingRequest", - "pendingAcceptance", - "rollingBack", - "pending", - "available", - "modifying", - "deleting", - "deleted", - "failed", - "rejected", - "rejecting", - "failing", - } -} - -type TransitGatewayConnectPeerState string - -// Enum values for TransitGatewayConnectPeerState -const ( - TransitGatewayConnectPeerStatePending TransitGatewayConnectPeerState = "pending" - TransitGatewayConnectPeerStateAvailable TransitGatewayConnectPeerState = "available" - TransitGatewayConnectPeerStateDeleting TransitGatewayConnectPeerState = "deleting" - TransitGatewayConnectPeerStateDeleted TransitGatewayConnectPeerState = "deleted" -) - -// Values returns all known values for TransitGatewayConnectPeerState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayConnectPeerState) Values() []TransitGatewayConnectPeerState { - return []TransitGatewayConnectPeerState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type TransitGatewayMulitcastDomainAssociationState string - -// Enum values for TransitGatewayMulitcastDomainAssociationState -const ( - TransitGatewayMulitcastDomainAssociationStatePendingAcceptance TransitGatewayMulitcastDomainAssociationState = "pendingAcceptance" - TransitGatewayMulitcastDomainAssociationStateAssociating TransitGatewayMulitcastDomainAssociationState = "associating" - TransitGatewayMulitcastDomainAssociationStateAssociated TransitGatewayMulitcastDomainAssociationState = "associated" - TransitGatewayMulitcastDomainAssociationStateDisassociating TransitGatewayMulitcastDomainAssociationState = "disassociating" - TransitGatewayMulitcastDomainAssociationStateDisassociated TransitGatewayMulitcastDomainAssociationState = "disassociated" - TransitGatewayMulitcastDomainAssociationStateRejected TransitGatewayMulitcastDomainAssociationState = "rejected" - TransitGatewayMulitcastDomainAssociationStateFailed TransitGatewayMulitcastDomainAssociationState = "failed" -) - -// Values returns all known values for -// TransitGatewayMulitcastDomainAssociationState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayMulitcastDomainAssociationState) Values() []TransitGatewayMulitcastDomainAssociationState { - return []TransitGatewayMulitcastDomainAssociationState{ - "pendingAcceptance", - "associating", - "associated", - "disassociating", - "disassociated", - "rejected", - "failed", - } -} - -type TransitGatewayMulticastDomainState string - -// Enum values for TransitGatewayMulticastDomainState -const ( - TransitGatewayMulticastDomainStatePending TransitGatewayMulticastDomainState = "pending" - TransitGatewayMulticastDomainStateAvailable TransitGatewayMulticastDomainState = "available" - TransitGatewayMulticastDomainStateDeleting TransitGatewayMulticastDomainState = "deleting" - TransitGatewayMulticastDomainStateDeleted TransitGatewayMulticastDomainState = "deleted" -) - -// Values returns all known values for TransitGatewayMulticastDomainState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayMulticastDomainState) Values() []TransitGatewayMulticastDomainState { - return []TransitGatewayMulticastDomainState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type TransitGatewayPolicyTableState string - -// Enum values for TransitGatewayPolicyTableState -const ( - TransitGatewayPolicyTableStatePending TransitGatewayPolicyTableState = "pending" - TransitGatewayPolicyTableStateAvailable TransitGatewayPolicyTableState = "available" - TransitGatewayPolicyTableStateDeleting TransitGatewayPolicyTableState = "deleting" - TransitGatewayPolicyTableStateDeleted TransitGatewayPolicyTableState = "deleted" -) - -// Values returns all known values for TransitGatewayPolicyTableState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayPolicyTableState) Values() []TransitGatewayPolicyTableState { - return []TransitGatewayPolicyTableState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type TransitGatewayPrefixListReferenceState string - -// Enum values for TransitGatewayPrefixListReferenceState -const ( - TransitGatewayPrefixListReferenceStatePending TransitGatewayPrefixListReferenceState = "pending" - TransitGatewayPrefixListReferenceStateAvailable TransitGatewayPrefixListReferenceState = "available" - TransitGatewayPrefixListReferenceStateModifying TransitGatewayPrefixListReferenceState = "modifying" - TransitGatewayPrefixListReferenceStateDeleting TransitGatewayPrefixListReferenceState = "deleting" -) - -// Values returns all known values for TransitGatewayPrefixListReferenceState. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayPrefixListReferenceState) Values() []TransitGatewayPrefixListReferenceState { - return []TransitGatewayPrefixListReferenceState{ - "pending", - "available", - "modifying", - "deleting", - } -} - -type TransitGatewayPropagationState string - -// Enum values for TransitGatewayPropagationState -const ( - TransitGatewayPropagationStateEnabling TransitGatewayPropagationState = "enabling" - TransitGatewayPropagationStateEnabled TransitGatewayPropagationState = "enabled" - TransitGatewayPropagationStateDisabling TransitGatewayPropagationState = "disabling" - TransitGatewayPropagationStateDisabled TransitGatewayPropagationState = "disabled" -) - -// Values returns all known values for TransitGatewayPropagationState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayPropagationState) Values() []TransitGatewayPropagationState { - return []TransitGatewayPropagationState{ - "enabling", - "enabled", - "disabling", - "disabled", - } -} - -type TransitGatewayRouteState string - -// Enum values for TransitGatewayRouteState -const ( - TransitGatewayRouteStatePending TransitGatewayRouteState = "pending" - TransitGatewayRouteStateActive TransitGatewayRouteState = "active" - TransitGatewayRouteStateBlackhole TransitGatewayRouteState = "blackhole" - TransitGatewayRouteStateDeleting TransitGatewayRouteState = "deleting" - TransitGatewayRouteStateDeleted TransitGatewayRouteState = "deleted" -) - -// Values returns all known values for TransitGatewayRouteState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayRouteState) Values() []TransitGatewayRouteState { - return []TransitGatewayRouteState{ - "pending", - "active", - "blackhole", - "deleting", - "deleted", - } -} - -type TransitGatewayRouteTableAnnouncementDirection string - -// Enum values for TransitGatewayRouteTableAnnouncementDirection -const ( - TransitGatewayRouteTableAnnouncementDirectionOutgoing TransitGatewayRouteTableAnnouncementDirection = "outgoing" - TransitGatewayRouteTableAnnouncementDirectionIncoming TransitGatewayRouteTableAnnouncementDirection = "incoming" -) - -// Values returns all known values for -// TransitGatewayRouteTableAnnouncementDirection. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayRouteTableAnnouncementDirection) Values() []TransitGatewayRouteTableAnnouncementDirection { - return []TransitGatewayRouteTableAnnouncementDirection{ - "outgoing", - "incoming", - } -} - -type TransitGatewayRouteTableAnnouncementState string - -// Enum values for TransitGatewayRouteTableAnnouncementState -const ( - TransitGatewayRouteTableAnnouncementStateAvailable TransitGatewayRouteTableAnnouncementState = "available" - TransitGatewayRouteTableAnnouncementStatePending TransitGatewayRouteTableAnnouncementState = "pending" - TransitGatewayRouteTableAnnouncementStateFailing TransitGatewayRouteTableAnnouncementState = "failing" - TransitGatewayRouteTableAnnouncementStateFailed TransitGatewayRouteTableAnnouncementState = "failed" - TransitGatewayRouteTableAnnouncementStateDeleting TransitGatewayRouteTableAnnouncementState = "deleting" - TransitGatewayRouteTableAnnouncementStateDeleted TransitGatewayRouteTableAnnouncementState = "deleted" -) - -// Values returns all known values for TransitGatewayRouteTableAnnouncementState. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayRouteTableAnnouncementState) Values() []TransitGatewayRouteTableAnnouncementState { - return []TransitGatewayRouteTableAnnouncementState{ - "available", - "pending", - "failing", - "failed", - "deleting", - "deleted", - } -} - -type TransitGatewayRouteTableState string - -// Enum values for TransitGatewayRouteTableState -const ( - TransitGatewayRouteTableStatePending TransitGatewayRouteTableState = "pending" - TransitGatewayRouteTableStateAvailable TransitGatewayRouteTableState = "available" - TransitGatewayRouteTableStateDeleting TransitGatewayRouteTableState = "deleting" - TransitGatewayRouteTableStateDeleted TransitGatewayRouteTableState = "deleted" -) - -// Values returns all known values for TransitGatewayRouteTableState. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayRouteTableState) Values() []TransitGatewayRouteTableState { - return []TransitGatewayRouteTableState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type TransitGatewayRouteType string - -// Enum values for TransitGatewayRouteType -const ( - TransitGatewayRouteTypeStatic TransitGatewayRouteType = "static" - TransitGatewayRouteTypePropagated TransitGatewayRouteType = "propagated" -) - -// Values returns all known values for TransitGatewayRouteType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayRouteType) Values() []TransitGatewayRouteType { - return []TransitGatewayRouteType{ - "static", - "propagated", - } -} - -type TransitGatewayState string - -// Enum values for TransitGatewayState -const ( - TransitGatewayStatePending TransitGatewayState = "pending" - TransitGatewayStateAvailable TransitGatewayState = "available" - TransitGatewayStateModifying TransitGatewayState = "modifying" - TransitGatewayStateDeleting TransitGatewayState = "deleting" - TransitGatewayStateDeleted TransitGatewayState = "deleted" -) - -// Values returns all known values for TransitGatewayState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransitGatewayState) Values() []TransitGatewayState { - return []TransitGatewayState{ - "pending", - "available", - "modifying", - "deleting", - "deleted", - } -} - -type TransportProtocol string - -// Enum values for TransportProtocol -const ( - TransportProtocolTcp TransportProtocol = "tcp" - TransportProtocolUdp TransportProtocol = "udp" -) - -// Values returns all known values for TransportProtocol. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TransportProtocol) Values() []TransportProtocol { - return []TransportProtocol{ - "tcp", - "udp", - } -} - -type TrustProviderType string - -// Enum values for TrustProviderType -const ( - TrustProviderTypeUser TrustProviderType = "user" - TrustProviderTypeDevice TrustProviderType = "device" -) - -// Values returns all known values for TrustProviderType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TrustProviderType) Values() []TrustProviderType { - return []TrustProviderType{ - "user", - "device", - } -} - -type TunnelInsideIpVersion string - -// Enum values for TunnelInsideIpVersion -const ( - TunnelInsideIpVersionIpv4 TunnelInsideIpVersion = "ipv4" - TunnelInsideIpVersionIpv6 TunnelInsideIpVersion = "ipv6" -) - -// Values returns all known values for TunnelInsideIpVersion. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TunnelInsideIpVersion) Values() []TunnelInsideIpVersion { - return []TunnelInsideIpVersion{ - "ipv4", - "ipv6", - } -} - -type UnlimitedSupportedInstanceFamily string - -// Enum values for UnlimitedSupportedInstanceFamily -const ( - UnlimitedSupportedInstanceFamilyT2 UnlimitedSupportedInstanceFamily = "t2" - UnlimitedSupportedInstanceFamilyT3 UnlimitedSupportedInstanceFamily = "t3" - UnlimitedSupportedInstanceFamilyT3a UnlimitedSupportedInstanceFamily = "t3a" - UnlimitedSupportedInstanceFamilyT4g UnlimitedSupportedInstanceFamily = "t4g" -) - -// Values returns all known values for UnlimitedSupportedInstanceFamily. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UnlimitedSupportedInstanceFamily) Values() []UnlimitedSupportedInstanceFamily { - return []UnlimitedSupportedInstanceFamily{ - "t2", - "t3", - "t3a", - "t4g", - } -} - -type UnsuccessfulInstanceCreditSpecificationErrorCode string - -// Enum values for UnsuccessfulInstanceCreditSpecificationErrorCode -const ( - UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceId UnsuccessfulInstanceCreditSpecificationErrorCode = "InvalidInstanceID.Malformed" - UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceNotFound UnsuccessfulInstanceCreditSpecificationErrorCode = "InvalidInstanceID.NotFound" - UnsuccessfulInstanceCreditSpecificationErrorCodeIncorrectInstanceState UnsuccessfulInstanceCreditSpecificationErrorCode = "IncorrectInstanceState" - UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported UnsuccessfulInstanceCreditSpecificationErrorCode = "InstanceCreditSpecification.NotSupported" -) - -// Values returns all known values for -// UnsuccessfulInstanceCreditSpecificationErrorCode. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UnsuccessfulInstanceCreditSpecificationErrorCode) Values() []UnsuccessfulInstanceCreditSpecificationErrorCode { - return []UnsuccessfulInstanceCreditSpecificationErrorCode{ - "InvalidInstanceID.Malformed", - "InvalidInstanceID.NotFound", - "IncorrectInstanceState", - "InstanceCreditSpecification.NotSupported", - } -} - -type UsageClassType string - -// Enum values for UsageClassType -const ( - UsageClassTypeSpot UsageClassType = "spot" - UsageClassTypeOnDemand UsageClassType = "on-demand" - UsageClassTypeCapacityBlock UsageClassType = "capacity-block" -) - -// Values returns all known values for UsageClassType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UsageClassType) Values() []UsageClassType { - return []UsageClassType{ - "spot", - "on-demand", - "capacity-block", - } -} - -type UserTrustProviderType string - -// Enum values for UserTrustProviderType -const ( - UserTrustProviderTypeIamIdentityCenter UserTrustProviderType = "iam-identity-center" - UserTrustProviderTypeOidc UserTrustProviderType = "oidc" -) - -// Values returns all known values for UserTrustProviderType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UserTrustProviderType) Values() []UserTrustProviderType { - return []UserTrustProviderType{ - "iam-identity-center", - "oidc", - } -} - -type VerificationMethod string - -// Enum values for VerificationMethod -const ( - VerificationMethodRemarksX509 VerificationMethod = "remarks-x509" - VerificationMethodDnsToken VerificationMethod = "dns-token" -) - -// Values returns all known values for VerificationMethod. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerificationMethod) Values() []VerificationMethod { - return []VerificationMethod{ - "remarks-x509", - "dns-token", - } -} - -type VerifiedAccessEndpointAttachmentType string - -// Enum values for VerifiedAccessEndpointAttachmentType -const ( - VerifiedAccessEndpointAttachmentTypeVpc VerifiedAccessEndpointAttachmentType = "vpc" -) - -// Values returns all known values for VerifiedAccessEndpointAttachmentType. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerifiedAccessEndpointAttachmentType) Values() []VerifiedAccessEndpointAttachmentType { - return []VerifiedAccessEndpointAttachmentType{ - "vpc", - } -} - -type VerifiedAccessEndpointProtocol string - -// Enum values for VerifiedAccessEndpointProtocol -const ( - VerifiedAccessEndpointProtocolHttp VerifiedAccessEndpointProtocol = "http" - VerifiedAccessEndpointProtocolHttps VerifiedAccessEndpointProtocol = "https" - VerifiedAccessEndpointProtocolTcp VerifiedAccessEndpointProtocol = "tcp" -) - -// Values returns all known values for VerifiedAccessEndpointProtocol. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerifiedAccessEndpointProtocol) Values() []VerifiedAccessEndpointProtocol { - return []VerifiedAccessEndpointProtocol{ - "http", - "https", - "tcp", - } -} - -type VerifiedAccessEndpointStatusCode string - -// Enum values for VerifiedAccessEndpointStatusCode -const ( - VerifiedAccessEndpointStatusCodePending VerifiedAccessEndpointStatusCode = "pending" - VerifiedAccessEndpointStatusCodeActive VerifiedAccessEndpointStatusCode = "active" - VerifiedAccessEndpointStatusCodeUpdating VerifiedAccessEndpointStatusCode = "updating" - VerifiedAccessEndpointStatusCodeDeleting VerifiedAccessEndpointStatusCode = "deleting" - VerifiedAccessEndpointStatusCodeDeleted VerifiedAccessEndpointStatusCode = "deleted" -) - -// Values returns all known values for VerifiedAccessEndpointStatusCode. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerifiedAccessEndpointStatusCode) Values() []VerifiedAccessEndpointStatusCode { - return []VerifiedAccessEndpointStatusCode{ - "pending", - "active", - "updating", - "deleting", - "deleted", - } -} - -type VerifiedAccessEndpointType string - -// Enum values for VerifiedAccessEndpointType -const ( - VerifiedAccessEndpointTypeLoadBalancer VerifiedAccessEndpointType = "load-balancer" - VerifiedAccessEndpointTypeNetworkInterface VerifiedAccessEndpointType = "network-interface" - VerifiedAccessEndpointTypeRds VerifiedAccessEndpointType = "rds" - VerifiedAccessEndpointTypeCidr VerifiedAccessEndpointType = "cidr" -) - -// Values returns all known values for VerifiedAccessEndpointType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerifiedAccessEndpointType) Values() []VerifiedAccessEndpointType { - return []VerifiedAccessEndpointType{ - "load-balancer", - "network-interface", - "rds", - "cidr", - } -} - -type VerifiedAccessLogDeliveryStatusCode string - -// Enum values for VerifiedAccessLogDeliveryStatusCode -const ( - VerifiedAccessLogDeliveryStatusCodeSuccess VerifiedAccessLogDeliveryStatusCode = "success" - VerifiedAccessLogDeliveryStatusCodeFailed VerifiedAccessLogDeliveryStatusCode = "failed" -) - -// Values returns all known values for VerifiedAccessLogDeliveryStatusCode. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VerifiedAccessLogDeliveryStatusCode) Values() []VerifiedAccessLogDeliveryStatusCode { - return []VerifiedAccessLogDeliveryStatusCode{ - "success", - "failed", - } -} - -type VirtualizationType string - -// Enum values for VirtualizationType -const ( - VirtualizationTypeHvm VirtualizationType = "hvm" - VirtualizationTypeParavirtual VirtualizationType = "paravirtual" -) - -// Values returns all known values for VirtualizationType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VirtualizationType) Values() []VirtualizationType { - return []VirtualizationType{ - "hvm", - "paravirtual", - } -} - -type VolumeAttachmentState string - -// Enum values for VolumeAttachmentState -const ( - VolumeAttachmentStateAttaching VolumeAttachmentState = "attaching" - VolumeAttachmentStateAttached VolumeAttachmentState = "attached" - VolumeAttachmentStateDetaching VolumeAttachmentState = "detaching" - VolumeAttachmentStateDetached VolumeAttachmentState = "detached" - VolumeAttachmentStateBusy VolumeAttachmentState = "busy" -) - -// Values returns all known values for VolumeAttachmentState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeAttachmentState) Values() []VolumeAttachmentState { - return []VolumeAttachmentState{ - "attaching", - "attached", - "detaching", - "detached", - "busy", - } -} - -type VolumeAttributeName string - -// Enum values for VolumeAttributeName -const ( - VolumeAttributeNameAutoEnableIO VolumeAttributeName = "autoEnableIO" - VolumeAttributeNameProductCodes VolumeAttributeName = "productCodes" -) - -// Values returns all known values for VolumeAttributeName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeAttributeName) Values() []VolumeAttributeName { - return []VolumeAttributeName{ - "autoEnableIO", - "productCodes", - } -} - -type VolumeModificationState string - -// Enum values for VolumeModificationState -const ( - VolumeModificationStateModifying VolumeModificationState = "modifying" - VolumeModificationStateOptimizing VolumeModificationState = "optimizing" - VolumeModificationStateCompleted VolumeModificationState = "completed" - VolumeModificationStateFailed VolumeModificationState = "failed" -) - -// Values returns all known values for VolumeModificationState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeModificationState) Values() []VolumeModificationState { - return []VolumeModificationState{ - "modifying", - "optimizing", - "completed", - "failed", - } -} - -type VolumeState string - -// Enum values for VolumeState -const ( - VolumeStateCreating VolumeState = "creating" - VolumeStateAvailable VolumeState = "available" - VolumeStateInUse VolumeState = "in-use" - VolumeStateDeleting VolumeState = "deleting" - VolumeStateDeleted VolumeState = "deleted" - VolumeStateError VolumeState = "error" -) - -// Values returns all known values for VolumeState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeState) Values() []VolumeState { - return []VolumeState{ - "creating", - "available", - "in-use", - "deleting", - "deleted", - "error", - } -} - -type VolumeStatusInfoStatus string - -// Enum values for VolumeStatusInfoStatus -const ( - VolumeStatusInfoStatusOk VolumeStatusInfoStatus = "ok" - VolumeStatusInfoStatusImpaired VolumeStatusInfoStatus = "impaired" - VolumeStatusInfoStatusInsufficientData VolumeStatusInfoStatus = "insufficient-data" -) - -// Values returns all known values for VolumeStatusInfoStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeStatusInfoStatus) Values() []VolumeStatusInfoStatus { - return []VolumeStatusInfoStatus{ - "ok", - "impaired", - "insufficient-data", - } -} - -type VolumeStatusName string - -// Enum values for VolumeStatusName -const ( - VolumeStatusNameIoEnabled VolumeStatusName = "io-enabled" - VolumeStatusNameIoPerformance VolumeStatusName = "io-performance" - VolumeStatusNameInitializationState VolumeStatusName = "initialization-state" -) - -// Values returns all known values for VolumeStatusName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeStatusName) Values() []VolumeStatusName { - return []VolumeStatusName{ - "io-enabled", - "io-performance", - "initialization-state", - } -} - -type VolumeType string - -// Enum values for VolumeType -const ( - VolumeTypeStandard VolumeType = "standard" - VolumeTypeIo1 VolumeType = "io1" - VolumeTypeIo2 VolumeType = "io2" - VolumeTypeGp2 VolumeType = "gp2" - VolumeTypeSc1 VolumeType = "sc1" - VolumeTypeSt1 VolumeType = "st1" - VolumeTypeGp3 VolumeType = "gp3" -) - -// Values returns all known values for VolumeType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VolumeType) Values() []VolumeType { - return []VolumeType{ - "standard", - "io1", - "io2", - "gp2", - "sc1", - "st1", - "gp3", - } -} - -type VpcAttributeName string - -// Enum values for VpcAttributeName -const ( - VpcAttributeNameEnableDnsSupport VpcAttributeName = "enableDnsSupport" - VpcAttributeNameEnableDnsHostnames VpcAttributeName = "enableDnsHostnames" - VpcAttributeNameEnableNetworkAddressUsageMetrics VpcAttributeName = "enableNetworkAddressUsageMetrics" -) - -// Values returns all known values for VpcAttributeName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcAttributeName) Values() []VpcAttributeName { - return []VpcAttributeName{ - "enableDnsSupport", - "enableDnsHostnames", - "enableNetworkAddressUsageMetrics", - } -} - -type VpcBlockPublicAccessExclusionsAllowed string - -// Enum values for VpcBlockPublicAccessExclusionsAllowed -const ( - VpcBlockPublicAccessExclusionsAllowedAllowed VpcBlockPublicAccessExclusionsAllowed = "allowed" - VpcBlockPublicAccessExclusionsAllowedNotAllowed VpcBlockPublicAccessExclusionsAllowed = "not-allowed" -) - -// Values returns all known values for VpcBlockPublicAccessExclusionsAllowed. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcBlockPublicAccessExclusionsAllowed) Values() []VpcBlockPublicAccessExclusionsAllowed { - return []VpcBlockPublicAccessExclusionsAllowed{ - "allowed", - "not-allowed", - } -} - -type VpcBlockPublicAccessExclusionState string - -// Enum values for VpcBlockPublicAccessExclusionState -const ( - VpcBlockPublicAccessExclusionStateCreateInProgress VpcBlockPublicAccessExclusionState = "create-in-progress" - VpcBlockPublicAccessExclusionStateCreateComplete VpcBlockPublicAccessExclusionState = "create-complete" - VpcBlockPublicAccessExclusionStateCreateFailed VpcBlockPublicAccessExclusionState = "create-failed" - VpcBlockPublicAccessExclusionStateUpdateInProgress VpcBlockPublicAccessExclusionState = "update-in-progress" - VpcBlockPublicAccessExclusionStateUpdateComplete VpcBlockPublicAccessExclusionState = "update-complete" - VpcBlockPublicAccessExclusionStateUpdateFailed VpcBlockPublicAccessExclusionState = "update-failed" - VpcBlockPublicAccessExclusionStateDeleteInProgress VpcBlockPublicAccessExclusionState = "delete-in-progress" - VpcBlockPublicAccessExclusionStateDeleteComplete VpcBlockPublicAccessExclusionState = "delete-complete" - VpcBlockPublicAccessExclusionStateDisableInProgress VpcBlockPublicAccessExclusionState = "disable-in-progress" - VpcBlockPublicAccessExclusionStateDisableComplete VpcBlockPublicAccessExclusionState = "disable-complete" -) - -// Values returns all known values for VpcBlockPublicAccessExclusionState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcBlockPublicAccessExclusionState) Values() []VpcBlockPublicAccessExclusionState { - return []VpcBlockPublicAccessExclusionState{ - "create-in-progress", - "create-complete", - "create-failed", - "update-in-progress", - "update-complete", - "update-failed", - "delete-in-progress", - "delete-complete", - "disable-in-progress", - "disable-complete", - } -} - -type VpcBlockPublicAccessState string - -// Enum values for VpcBlockPublicAccessState -const ( - VpcBlockPublicAccessStateDefaultState VpcBlockPublicAccessState = "default-state" - VpcBlockPublicAccessStateUpdateInProgress VpcBlockPublicAccessState = "update-in-progress" - VpcBlockPublicAccessStateUpdateComplete VpcBlockPublicAccessState = "update-complete" -) - -// Values returns all known values for VpcBlockPublicAccessState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcBlockPublicAccessState) Values() []VpcBlockPublicAccessState { - return []VpcBlockPublicAccessState{ - "default-state", - "update-in-progress", - "update-complete", - } -} - -type VpcCidrBlockStateCode string - -// Enum values for VpcCidrBlockStateCode -const ( - VpcCidrBlockStateCodeAssociating VpcCidrBlockStateCode = "associating" - VpcCidrBlockStateCodeAssociated VpcCidrBlockStateCode = "associated" - VpcCidrBlockStateCodeDisassociating VpcCidrBlockStateCode = "disassociating" - VpcCidrBlockStateCodeDisassociated VpcCidrBlockStateCode = "disassociated" - VpcCidrBlockStateCodeFailing VpcCidrBlockStateCode = "failing" - VpcCidrBlockStateCodeFailed VpcCidrBlockStateCode = "failed" -) - -// Values returns all known values for VpcCidrBlockStateCode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcCidrBlockStateCode) Values() []VpcCidrBlockStateCode { - return []VpcCidrBlockStateCode{ - "associating", - "associated", - "disassociating", - "disassociated", - "failing", - "failed", - } -} - -type VpcEncryptionControlExclusionState string - -// Enum values for VpcEncryptionControlExclusionState -const ( - VpcEncryptionControlExclusionStateEnabling VpcEncryptionControlExclusionState = "enabling" - VpcEncryptionControlExclusionStateEnabled VpcEncryptionControlExclusionState = "enabled" - VpcEncryptionControlExclusionStateDisabling VpcEncryptionControlExclusionState = "disabling" - VpcEncryptionControlExclusionStateDisabled VpcEncryptionControlExclusionState = "disabled" -) - -// Values returns all known values for VpcEncryptionControlExclusionState. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcEncryptionControlExclusionState) Values() []VpcEncryptionControlExclusionState { - return []VpcEncryptionControlExclusionState{ - "enabling", - "enabled", - "disabling", - "disabled", - } -} - -type VpcEncryptionControlMode string - -// Enum values for VpcEncryptionControlMode -const ( - VpcEncryptionControlModeMonitor VpcEncryptionControlMode = "monitor" - VpcEncryptionControlModeEnforce VpcEncryptionControlMode = "enforce" -) - -// Values returns all known values for VpcEncryptionControlMode. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcEncryptionControlMode) Values() []VpcEncryptionControlMode { - return []VpcEncryptionControlMode{ - "monitor", - "enforce", - } -} - -type VpcEncryptionControlState string - -// Enum values for VpcEncryptionControlState -const ( - VpcEncryptionControlStateEnforceInProgress VpcEncryptionControlState = "enforce-in-progress" - VpcEncryptionControlStateMonitorInProgress VpcEncryptionControlState = "monitor-in-progress" - VpcEncryptionControlStateEnforceFailed VpcEncryptionControlState = "enforce-failed" - VpcEncryptionControlStateMonitorFailed VpcEncryptionControlState = "monitor-failed" - VpcEncryptionControlStateDeleting VpcEncryptionControlState = "deleting" - VpcEncryptionControlStateDeleted VpcEncryptionControlState = "deleted" - VpcEncryptionControlStateAvailable VpcEncryptionControlState = "available" - VpcEncryptionControlStateCreating VpcEncryptionControlState = "creating" - VpcEncryptionControlStateDeleteFailed VpcEncryptionControlState = "delete-failed" -) - -// Values returns all known values for VpcEncryptionControlState. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcEncryptionControlState) Values() []VpcEncryptionControlState { - return []VpcEncryptionControlState{ - "enforce-in-progress", - "monitor-in-progress", - "enforce-failed", - "monitor-failed", - "deleting", - "deleted", - "available", - "creating", - "delete-failed", - } -} - -type VpcEndpointType string - -// Enum values for VpcEndpointType -const ( - VpcEndpointTypeInterface VpcEndpointType = "Interface" - VpcEndpointTypeGateway VpcEndpointType = "Gateway" - VpcEndpointTypeGatewayLoadBalancer VpcEndpointType = "GatewayLoadBalancer" - VpcEndpointTypeResource VpcEndpointType = "Resource" - VpcEndpointTypeServiceNetwork VpcEndpointType = "ServiceNetwork" -) - -// Values returns all known values for VpcEndpointType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcEndpointType) Values() []VpcEndpointType { - return []VpcEndpointType{ - "Interface", - "Gateway", - "GatewayLoadBalancer", - "Resource", - "ServiceNetwork", - } -} - -type VpcPeeringConnectionStateReasonCode string - -// Enum values for VpcPeeringConnectionStateReasonCode -const ( - VpcPeeringConnectionStateReasonCodeInitiatingRequest VpcPeeringConnectionStateReasonCode = "initiating-request" - VpcPeeringConnectionStateReasonCodePendingAcceptance VpcPeeringConnectionStateReasonCode = "pending-acceptance" - VpcPeeringConnectionStateReasonCodeActive VpcPeeringConnectionStateReasonCode = "active" - VpcPeeringConnectionStateReasonCodeDeleted VpcPeeringConnectionStateReasonCode = "deleted" - VpcPeeringConnectionStateReasonCodeRejected VpcPeeringConnectionStateReasonCode = "rejected" - VpcPeeringConnectionStateReasonCodeFailed VpcPeeringConnectionStateReasonCode = "failed" - VpcPeeringConnectionStateReasonCodeExpired VpcPeeringConnectionStateReasonCode = "expired" - VpcPeeringConnectionStateReasonCodeProvisioning VpcPeeringConnectionStateReasonCode = "provisioning" - VpcPeeringConnectionStateReasonCodeDeleting VpcPeeringConnectionStateReasonCode = "deleting" -) - -// Values returns all known values for VpcPeeringConnectionStateReasonCode. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcPeeringConnectionStateReasonCode) Values() []VpcPeeringConnectionStateReasonCode { - return []VpcPeeringConnectionStateReasonCode{ - "initiating-request", - "pending-acceptance", - "active", - "deleted", - "rejected", - "failed", - "expired", - "provisioning", - "deleting", - } -} - -type VpcState string - -// Enum values for VpcState -const ( - VpcStatePending VpcState = "pending" - VpcStateAvailable VpcState = "available" -) - -// Values returns all known values for VpcState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcState) Values() []VpcState { - return []VpcState{ - "pending", - "available", - } -} - -type VpcTenancy string - -// Enum values for VpcTenancy -const ( - VpcTenancyDefault VpcTenancy = "default" -) - -// Values returns all known values for VpcTenancy. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpcTenancy) Values() []VpcTenancy { - return []VpcTenancy{ - "default", - } -} - -type VpnEcmpSupportValue string - -// Enum values for VpnEcmpSupportValue -const ( - VpnEcmpSupportValueEnable VpnEcmpSupportValue = "enable" - VpnEcmpSupportValueDisable VpnEcmpSupportValue = "disable" -) - -// Values returns all known values for VpnEcmpSupportValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpnEcmpSupportValue) Values() []VpnEcmpSupportValue { - return []VpnEcmpSupportValue{ - "enable", - "disable", - } -} - -type VpnProtocol string - -// Enum values for VpnProtocol -const ( - VpnProtocolOpenvpn VpnProtocol = "openvpn" -) - -// Values returns all known values for VpnProtocol. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpnProtocol) Values() []VpnProtocol { - return []VpnProtocol{ - "openvpn", - } -} - -type VpnState string - -// Enum values for VpnState -const ( - VpnStatePending VpnState = "pending" - VpnStateAvailable VpnState = "available" - VpnStateDeleting VpnState = "deleting" - VpnStateDeleted VpnState = "deleted" -) - -// Values returns all known values for VpnState. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpnState) Values() []VpnState { - return []VpnState{ - "pending", - "available", - "deleting", - "deleted", - } -} - -type VpnStaticRouteSource string - -// Enum values for VpnStaticRouteSource -const ( - VpnStaticRouteSourceStatic VpnStaticRouteSource = "Static" -) - -// Values returns all known values for VpnStaticRouteSource. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpnStaticRouteSource) Values() []VpnStaticRouteSource { - return []VpnStaticRouteSource{ - "Static", - } -} - -type VpnTunnelProvisioningStatus string - -// Enum values for VpnTunnelProvisioningStatus -const ( - VpnTunnelProvisioningStatusAvailable VpnTunnelProvisioningStatus = "available" - VpnTunnelProvisioningStatusPending VpnTunnelProvisioningStatus = "pending" - VpnTunnelProvisioningStatusFailed VpnTunnelProvisioningStatus = "failed" -) - -// Values returns all known values for VpnTunnelProvisioningStatus. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VpnTunnelProvisioningStatus) Values() []VpnTunnelProvisioningStatus { - return []VpnTunnelProvisioningStatus{ - "available", - "pending", - "failed", - } -} - -type WeekDay string - -// Enum values for WeekDay -const ( - WeekDaySunday WeekDay = "sunday" - WeekDayMonday WeekDay = "monday" - WeekDayTuesday WeekDay = "tuesday" - WeekDayWednesday WeekDay = "wednesday" - WeekDayThursday WeekDay = "thursday" - WeekDayFriday WeekDay = "friday" - WeekDaySaturday WeekDay = "saturday" -) - -// Values returns all known values for WeekDay. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (WeekDay) Values() []WeekDay { - return []WeekDay{ - "sunday", - "monday", - "tuesday", - "wednesday", - "thursday", - "friday", - "saturday", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/types.go deleted file mode 100644 index 7da6e4965..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/types/types.go +++ /dev/null @@ -1,23428 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web -// Services Inferentia chips) on an instance. -type AcceleratorCount struct { - - // The maximum number of accelerators. If this parameter is not specified, there - // is no maximum limit. - Max *int32 - - // The minimum number of accelerators. If this parameter is not specified, there - // is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web -// Services Inferentia chips) on an instance. To exclude accelerator-enabled -// instance types, set Max to 0 . -type AcceleratorCountRequest struct { - - // The maximum number of accelerators. To specify no maximum limit, omit this - // parameter. To exclude accelerator-enabled instance types, set Max to 0 . - Max *int32 - - // The minimum number of accelerators. To specify no minimum limit, omit this - // parameter. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of total accelerator memory, in MiB. -type AcceleratorTotalMemoryMiB struct { - - // The maximum amount of accelerator memory, in MiB. If this parameter is not - // specified, there is no maximum limit. - Max *int32 - - // The minimum amount of accelerator memory, in MiB. If this parameter is not - // specified, there is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of total accelerator memory, in MiB. -type AcceleratorTotalMemoryMiBRequest struct { - - // The maximum amount of accelerator memory, in MiB. To specify no maximum limit, - // omit this parameter. - Max *int32 - - // The minimum amount of accelerator memory, in MiB. To specify no minimum limit, - // omit this parameter. - Min *int32 - - noSmithyDocumentSerde -} - -// Describes a finding for a Network Access Scope. -type AccessScopeAnalysisFinding struct { - - // The finding components. - FindingComponents []PathComponent - - // The ID of the finding. - FindingId *string - - // The ID of the Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysisId *string - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - noSmithyDocumentSerde -} - -// Describes a path. -type AccessScopePath struct { - - // The destination. - Destination *PathStatement - - // The source. - Source *PathStatement - - // The through resources. - ThroughResources []ThroughResourcesStatement - - noSmithyDocumentSerde -} - -// Describes a path. -type AccessScopePathRequest struct { - - // The destination. - Destination *PathStatementRequest - - // The source. - Source *PathStatementRequest - - // The through resources. - ThroughResources []ThroughResourcesStatementRequest - - noSmithyDocumentSerde -} - -// Describes an account attribute. -type AccountAttribute struct { - - // The name of the account attribute. - AttributeName *string - - // The values for the account attribute. - AttributeValues []AccountAttributeValue - - noSmithyDocumentSerde -} - -// Describes a value of an account attribute. -type AccountAttributeValue struct { - - // The value of the attribute. - AttributeValue *string - - noSmithyDocumentSerde -} - -// Describes a running instance in a Spot Fleet. -type ActiveInstance struct { - - // The health status of the instance. If the status of either the instance status - // check or the system status check is impaired , the health status of the instance - // is unhealthy . Otherwise, the health status is healthy . - InstanceHealth InstanceHealthStatus - - // The ID of the instance. - InstanceId *string - - // The instance type. - InstanceType *string - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string - - noSmithyDocumentSerde -} - -// Contains information about the current security configuration of an active VPN -// tunnel. -type ActiveVpnTunnelStatus struct { - - // The version of the Internet Key Exchange (IKE) protocol being used. - IkeVersion *string - - // The Diffie-Hellman group number being used in Phase 1 IKE negotiations. - Phase1DHGroup *int32 - - // The encryption algorithm negotiated in Phase 1 IKE negotiations. - Phase1EncryptionAlgorithm *string - - // The integrity algorithm negotiated in Phase 1 IKE negotiations. - Phase1IntegrityAlgorithm *string - - // The Diffie-Hellman group number being used in Phase 2 IKE negotiations. - Phase2DHGroup *int32 - - // The encryption algorithm negotiated in Phase 2 IKE negotiations. - Phase2EncryptionAlgorithm *string - - // The integrity algorithm negotiated in Phase 2 IKE negotiations. - Phase2IntegrityAlgorithm *string - - // The current provisioning status of the VPN tunnel. - ProvisioningStatus VpnTunnelProvisioningStatus - - // The reason for the current provisioning status. - ProvisioningStatusReason *string - - noSmithyDocumentSerde -} - -// Describes a principal. -type AddedPrincipal struct { - - // The Amazon Resource Name (ARN) of the principal. - Principal *string - - // The type of principal. - PrincipalType PrincipalType - - // The ID of the service. - ServiceId *string - - // The ID of the service permission. - ServicePermissionId *string - - noSmithyDocumentSerde -} - -// Add an operating Region to an IPAM. Operating Regions are Amazon Web Services -// Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only -// discovers and monitors resources in the Amazon Web Services Regions you select -// as operating Regions. -// -// For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User -// Guide. -// -// [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html -type AddIpamOperatingRegion struct { - - // The name of the operating Region. - RegionName *string - - noSmithyDocumentSerde -} - -// Add an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is -// integrated with Amazon Web Services Organizations and you add an organizational -// unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that -// OU exclusion. There is a limit on the number of exclusions you can create. For -// more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. -// -// [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html -type AddIpamOrganizationalUnitExclusion struct { - - // An Amazon Web Services Organizations entity path. Build the path for the OU(s) - // using Amazon Web Services Organizations IDs separated by a / . Include all child - // OUs by ending the path with /* . - // - // - Example 1 - // - // - Path to a child OU: - // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/ - // - // - In this example, o-a1b2c3d4e5 is the organization ID, r-f6g7h8i9j0example is - // the root ID , ou-ghi0-awsccccc is an OU ID, and ou-jkl0-awsddddd is a child OU - // ID. - // - // - IPAM will not manage the IP addresses in accounts in the child OU. - // - // - Example 2 - // - // - Path where all child OUs will be part of the exclusion: - // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/* - // - // - In this example, IPAM will not manage the IP addresses in accounts in the - // OU ( ou-ghi0-awsccccc ) or in accounts in any OUs that are children of the OU. - // - // For more information on how to construct an entity path, see [Understand the Amazon Web Services Organizations entity path] in the Amazon Web - // Services Identity and Access Management User Guide. - // - // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path - OrganizationsEntityPath *string - - noSmithyDocumentSerde -} - -// Describes an additional detail for a path analysis. For more information, see [Reachability Analyzer additional detail codes]. -// -// [Reachability Analyzer additional detail codes]: https://docs.aws.amazon.com/vpc/latest/reachability/additional-detail-codes.html -type AdditionalDetail struct { - - // The additional detail code. - AdditionalDetailType *string - - // The path component. - Component *AnalysisComponent - - // The load balancers. - LoadBalancers []AnalysisComponent - - // The rule options. - RuleGroupRuleOptionsPairs []RuleGroupRuleOptionsPair - - // The rule group type. - RuleGroupTypePairs []RuleGroupTypePair - - // The rule options. - RuleOptions []RuleOption - - // The name of the VPC endpoint service. - ServiceName *string - - // The VPC endpoint service. - VpcEndpointService *AnalysisComponent - - noSmithyDocumentSerde -} - -// An entry for a prefix list. -type AddPrefixListEntry struct { - - // The CIDR block. - // - // This member is required. - Cidr *string - - // A description for the entry. - // - // Constraints: Up to 255 characters in length. - Description *string - - noSmithyDocumentSerde -} - -// Describes an Elastic IP address, or a carrier IP address. -type Address struct { - - // The ID representing the allocation of the address. - AllocationId *string - - // The ID representing the association of the address with an instance. - AssociationId *string - - // The carrier IP address associated. This option is only available for network - // interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 - // instance). - CarrierIp *string - - // The customer-owned IP address. - CustomerOwnedIp *string - - // The ID of the customer-owned address pool. - CustomerOwnedIpv4Pool *string - - // The network ( vpc ). - Domain DomainType - - // The ID of the instance that the address is associated with (if any). - InstanceId *string - - // The name of the unique set of Availability Zones, Local Zones, or Wavelength - // Zones from which Amazon Web Services advertises IP addresses. - NetworkBorderGroup *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The ID of the Amazon Web Services account that owns the network interface. - NetworkInterfaceOwnerId *string - - // The private IP address associated with the Elastic IP address. - PrivateIpAddress *string - - // The Elastic IP address. - PublicIp *string - - // The ID of an address pool. - PublicIpv4Pool *string - - // The service that manages the elastic IP address. - // - // The only option supported today is alb . - ServiceManaged ServiceManaged - - // The ID of the subnet where the IP address is allocated. - SubnetId *string - - // Any tags assigned to the Elastic IP address. - Tags []Tag - - noSmithyDocumentSerde -} - -// The attributes associated with an Elastic IP address. -type AddressAttribute struct { - - // [EC2-VPC] The allocation ID. - AllocationId *string - - // The pointer (PTR) record for the IP address. - PtrRecord *string - - // The updated PTR record for the IP address. - PtrRecordUpdate *PtrUpdateStatus - - // The public IP address. - PublicIp *string - - noSmithyDocumentSerde -} - -// Details on the Elastic IP address transfer. For more information, see [Transfer Elastic IP addresses] in the -// Amazon VPC User Guide. -// -// [Transfer Elastic IP addresses]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro -type AddressTransfer struct { - - // The Elastic IP address transfer status. - AddressTransferStatus AddressTransferStatus - - // The allocation ID of an Elastic IP address. - AllocationId *string - - // The Elastic IP address being transferred. - PublicIp *string - - // The ID of the account that you want to transfer the Elastic IP address to. - TransferAccountId *string - - // The timestamp when the Elastic IP address transfer was accepted. - TransferOfferAcceptedTimestamp *time.Time - - // The timestamp when the Elastic IP address transfer expired. When the source - // account starts the transfer, the transfer account has seven hours to allocate - // the Elastic IP address to complete the transfer, or the Elastic IP address will - // return to its original owner. - TransferOfferExpirationTimestamp *time.Time - - noSmithyDocumentSerde -} - -// Describes a principal. -type AllowedPrincipal struct { - - // The Amazon Resource Name (ARN) of the principal. - Principal *string - - // The type of principal. - PrincipalType PrincipalType - - // The ID of the service. - ServiceId *string - - // The ID of the service permission. - ServicePermissionId *string - - // The tags. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an potential intermediate component of a feasible path. -type AlternatePathHint struct { - - // The Amazon Resource Name (ARN) of the component. - ComponentArn *string - - // The ID of the component. - ComponentId *string - - noSmithyDocumentSerde -} - -// Describes a network access control (ACL) rule. -type AnalysisAclRule struct { - - // The IPv4 address range, in CIDR notation. - Cidr *string - - // Indicates whether the rule is an outbound rule. - Egress *bool - - // The range of ports. - PortRange *PortRange - - // The protocol. - Protocol *string - - // Indicates whether to allow or deny traffic that matches the rule. - RuleAction *string - - // The rule number. - RuleNumber *int32 - - noSmithyDocumentSerde -} - -// Describes a path component. -type AnalysisComponent struct { - - // The Amazon Resource Name (ARN) of the component. - Arn *string - - // The ID of the component. - Id *string - - // The name of the analysis component. - Name *string - - noSmithyDocumentSerde -} - -// Describes a load balancer listener. -type AnalysisLoadBalancerListener struct { - - // [Classic Load Balancers] The back-end port for the listener. - InstancePort *int32 - - // The port on which the load balancer is listening. - LoadBalancerPort *int32 - - noSmithyDocumentSerde -} - -// Describes a load balancer target. -type AnalysisLoadBalancerTarget struct { - - // The IP address. - Address *string - - // The Availability Zone. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // Information about the instance. - Instance *AnalysisComponent - - // The port on which the target is listening. - Port *int32 - - noSmithyDocumentSerde -} - -// Describes a header. Reflects any changes made by a component as traffic passes -// through. The fields of an inbound header are null except for the first component -// of a path. -type AnalysisPacketHeader struct { - - // The destination addresses. - DestinationAddresses []string - - // The destination port ranges. - DestinationPortRanges []PortRange - - // The protocol. - Protocol *string - - // The source addresses. - SourceAddresses []string - - // The source port ranges. - SourcePortRanges []PortRange - - noSmithyDocumentSerde -} - -// Describes a route table route. -type AnalysisRouteTableRoute struct { - - // The ID of a carrier gateway. - CarrierGatewayId *string - - // The Amazon Resource Name (ARN) of a core network. - CoreNetworkArn *string - - // The destination IPv4 address, in CIDR notation. - DestinationCidr *string - - // The prefix of the Amazon Web Services service. - DestinationPrefixListId *string - - // The ID of an egress-only internet gateway. - EgressOnlyInternetGatewayId *string - - // The ID of the gateway, such as an internet gateway or virtual private gateway. - GatewayId *string - - // The ID of the instance, such as a NAT instance. - InstanceId *string - - // The ID of a local gateway. - LocalGatewayId *string - - // The ID of a NAT gateway. - NatGatewayId *string - - // The ID of a network interface. - NetworkInterfaceId *string - - // Describes how the route was created. The following are the possible values: - // - // - CreateRouteTable - The route was automatically created when the route table - // was created. - // - // - CreateRoute - The route was manually added to the route table. - // - // - EnableVgwRoutePropagation - The route was propagated by route propagation. - Origin *string - - // The state. The following are the possible values: - // - // - active - // - // - blackhole - State *string - - // The ID of a transit gateway. - TransitGatewayId *string - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// Describes a security group rule. -type AnalysisSecurityGroupRule struct { - - // The IPv4 address range, in CIDR notation. - Cidr *string - - // The direction. The following are the possible values: - // - // - egress - // - // - ingress - Direction *string - - // The port range. - PortRange *PortRange - - // The prefix list ID. - PrefixListId *string - - // The protocol name. - Protocol *string - - // The security group ID. - SecurityGroupId *string - - noSmithyDocumentSerde -} - -// An Autonomous System Number (ASN) and BYOIP CIDR association. -type AsnAssociation struct { - - // The association's ASN. - Asn *string - - // The association's CIDR. - Cidr *string - - // The association's state. - State AsnAssociationState - - // The association's status message. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Provides authorization for Amazon to bring an Autonomous System Number (ASN) to -// a specific Amazon Web Services account using bring your own ASN (BYOASN). For -// details on the format of the message and signature, see [Tutorial: Bring your ASN to IPAM]in the Amazon VPC IPAM -// guide. -// -// [Tutorial: Bring your ASN to IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html -type AsnAuthorizationContext struct { - - // The authorization context's message. - // - // This member is required. - Message *string - - // The authorization context's signature. - // - // This member is required. - Signature *string - - noSmithyDocumentSerde -} - -// Describes the private IP addresses assigned to a network interface. -type AssignedPrivateIpAddress struct { - - // The private IP address assigned to the network interface. - PrivateIpAddress *string - - noSmithyDocumentSerde -} - -// Information about the associated IAM roles. -type AssociatedRole struct { - - // The ARN of the associated IAM role. - AssociatedRoleArn *string - - // The name of the Amazon S3 bucket in which the Amazon S3 object is stored. - CertificateS3BucketName *string - - // The key of the Amazon S3 object where the certificate, certificate chain, and - // encrypted private key bundle are stored. The object key is formatted as follows: - // role_arn / certificate_arn . - CertificateS3ObjectKey *string - - // The ID of the KMS key used to encrypt the private key. - EncryptionKmsKeyId *string - - noSmithyDocumentSerde -} - -// Describes a target network that is associated with a Client VPN endpoint. A -// target network is a subnet in a VPC. -type AssociatedTargetNetwork struct { - - // The ID of the subnet. - NetworkId *string - - // The target network type. - NetworkType AssociatedNetworkType - - noSmithyDocumentSerde -} - -// Describes the state of a target network association. -type AssociationStatus struct { - - // The state of the target network association. - Code AssociationStatusCode - - // A message about the status of the target network association, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Describes integration options for Amazon Athena. -type AthenaIntegration struct { - - // The location in Amazon S3 to store the generated CloudFormation template. - // - // This member is required. - IntegrationResultS3DestinationArn *string - - // The schedule for adding new partitions to the table. - // - // This member is required. - PartitionLoadFrequency PartitionLoadFrequency - - // The end date for the partition. - PartitionEndDate *time.Time - - // The start date for the partition. - PartitionStartDate *time.Time - - noSmithyDocumentSerde -} - -// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) -// technology to increase the maximum bandwidth used per stream and minimize tail -// latency of network traffic between EC2 instances. With ENA Express, you can -// communicate between two EC2 instances in the same subnet within the same -// account, or in different accounts. Both sending and receiving instances must -// have ENA Express enabled. -// -// To improve the reliability of network packet delivery, ENA Express reorders -// network packets on the receiving end by default. However, some UDP-based -// applications are designed to handle network packets that are out of order to -// reduce the overhead for packet delivery at the network layer. When ENA Express -// is enabled, you can specify whether UDP network traffic uses it. -type AttachmentEnaSrdSpecification struct { - - // Indicates whether ENA Express is enabled for the network interface. - EnaSrdEnabled *bool - - // Configures ENA Express for UDP network traffic. - EnaSrdUdpSpecification *AttachmentEnaSrdUdpSpecification - - noSmithyDocumentSerde -} - -// ENA Express is compatible with both TCP and UDP transport protocols. When it's -// enabled, TCP traffic automatically uses it. However, some UDP-based applications -// are designed to handle network packets that are out of order, without a need for -// retransmission, such as live video broadcasting or other near-real-time -// applications. For UDP traffic, you can specify whether to use ENA Express, based -// on your application environment needs. -type AttachmentEnaSrdUdpSpecification struct { - - // Indicates whether UDP traffic to and from the instance uses ENA Express. To - // specify this setting, you must first enable ENA Express. - EnaSrdUdpEnabled *bool - - noSmithyDocumentSerde -} - -// Describes a value for a resource attribute that is a Boolean value. -type AttributeBooleanValue struct { - - // The attribute value. The valid values are true or false . - Value *bool - - noSmithyDocumentSerde -} - -// A summary report for the attribute across all Regions. -type AttributeSummary struct { - - // The name of the attribute. - AttributeName *string - - // The configuration value that is most frequently observed for the attribute. - MostFrequentValue *string - - // The number of accounts with the same configuration value for the attribute that - // is most frequently observed. - NumberOfMatchedAccounts *int32 - - // The number of accounts with a configuration value different from the most - // frequently observed value for the attribute. - NumberOfUnmatchedAccounts *int32 - - // The summary report for each Region for the attribute. - RegionalSummaries []RegionalSummary - - noSmithyDocumentSerde -} - -// Describes a value for a resource attribute that is a String. -type AttributeValue struct { - - // The attribute value. The value is case-sensitive. - Value *string - - noSmithyDocumentSerde -} - -// Information about an authorization rule. -type AuthorizationRule struct { - - // Indicates whether the authorization rule grants access to all clients. - AccessAll *bool - - // The ID of the Client VPN endpoint with which the authorization rule is - // associated. - ClientVpnEndpointId *string - - // A brief description of the authorization rule. - Description *string - - // The IPv4 address range, in CIDR notation, of the network to which the - // authorization rule applies. - DestinationCidr *string - - // The ID of the Active Directory group to which the authorization rule grants - // access. - GroupId *string - - // The current state of the authorization rule. - Status *ClientVpnAuthorizationRuleStatus - - noSmithyDocumentSerde -} - -// Describes Availability Zones, Local Zones, and Wavelength Zones. -type AvailabilityZone struct { - - // The long name of the Availability Zone group, Local Zone group, or Wavelength - // Zone group. - GroupLongName *string - - // The name of the zone group. For example: - // - // - Availability Zones - us-east-1-zg-1 - // - // - Local Zones - us-west-2-lax-1 - // - // - Wavelength Zones - us-east-1-wl1-bos-wlz-1 - GroupName *string - - // Any messages about the Availability Zone, Local Zone, or Wavelength Zone. - Messages []AvailabilityZoneMessage - - // The name of the network border group. - NetworkBorderGroup *string - - // For Availability Zones, this parameter always has the value of - // opt-in-not-required . - // - // For Local Zones and Wavelength Zones, this parameter is the opt-in status. The - // possible values are opted-in and not-opted-in . - OptInStatus AvailabilityZoneOptInStatus - - // The ID of the zone that handles some of the Local Zone or Wavelength Zone - // control plane operations, such as API calls. - ParentZoneId *string - - // The name of the zone that handles some of the Local Zone or Wavelength Zone - // control plane operations, such as API calls. - ParentZoneName *string - - // The name of the Region. - RegionName *string - - // The state of the Availability Zone, Local Zone, or Wavelength Zone. The - // possible values are available , unavailable , and constrained . - State AvailabilityZoneState - - // The ID of the Availability Zone, Local Zone, or Wavelength Zone. - ZoneId *string - - // The name of the Availability Zone, Local Zone, or Wavelength Zone. - ZoneName *string - - // The type of zone. - // - // Valid values: availability-zone | local-zone | wavelength-zone - ZoneType *string - - noSmithyDocumentSerde -} - -// Describes a message about an Availability Zone, Local Zone, or Wavelength Zone. -type AvailabilityZoneMessage struct { - - // The message about the Availability Zone, Local Zone, or Wavelength Zone. - Message *string - - noSmithyDocumentSerde -} - -// The capacity information for instances that can be launched onto the Dedicated -// Host. -type AvailableCapacity struct { - - // The number of instances that can be launched onto the Dedicated Host depending - // on the host's available capacity. For Dedicated Hosts that support multiple - // instance types, this parameter represents the number of instances for each - // instance size that is supported on the host. - AvailableInstanceCapacity []InstanceCapacity - - // The number of vCPUs available for launching instances onto the Dedicated Host. - AvailableVCpus *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more -// information, see [Amazon EBS–optimized instances]in the Amazon EC2 User Guide. -// -// [Amazon EBS–optimized instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html -type BaselineEbsBandwidthMbps struct { - - // The maximum baseline bandwidth, in Mbps. If this parameter is not specified, - // there is no maximum limit. - Max *int32 - - // The minimum baseline bandwidth, in Mbps. If this parameter is not specified, - // there is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more -// information, see [Amazon EBS–optimized instances]in the Amazon EC2 User Guide. -// -// [Amazon EBS–optimized instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html -type BaselineEbsBandwidthMbpsRequest struct { - - // The maximum baseline bandwidth, in Mbps. To specify no maximum limit, omit this - // parameter. - Max *int32 - - // The minimum baseline bandwidth, in Mbps. To specify no minimum limit, omit this - // parameter. - Min *int32 - - noSmithyDocumentSerde -} - -// The baseline performance to consider, using an instance family as a baseline -// reference. The instance family establishes the lowest acceptable level of -// performance. Amazon EC2 uses this baseline to guide instance type selection, but -// there is no guarantee that the selected instance types will always exceed the -// baseline for every application. -// -// Currently, this parameter only supports CPU performance as a baseline -// performance factor. For example, specifying c6i would use the CPU performance -// of the c6i family as the baseline reference. -type BaselinePerformanceFactors struct { - - // The CPU performance to consider, using an instance family as the baseline - // reference. - Cpu *CpuPerformanceFactor - - noSmithyDocumentSerde -} - -// The baseline performance to consider, using an instance family as a baseline -// reference. The instance family establishes the lowest acceptable level of -// performance. Amazon EC2 uses this baseline to guide instance type selection, but -// there is no guarantee that the selected instance types will always exceed the -// baseline for every application. -// -// Currently, this parameter only supports CPU performance as a baseline -// performance factor. For example, specifying c6i would use the CPU performance -// of the c6i family as the baseline reference. -type BaselinePerformanceFactorsRequest struct { - - // The CPU performance to consider, using an instance family as the baseline - // reference. - Cpu *CpuPerformanceFactorRequest - - noSmithyDocumentSerde -} - -type BlobAttributeValue struct { - Value []byte - - noSmithyDocumentSerde -} - -// Describes a block device mapping, which defines the EBS volumes and instance -// store volumes to attach to an instance at launch. -type BlockDeviceMapping struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsBlockDevice - - // To omit the device from the block device mapping, specify an empty string. When - // this property is specified, the device is removed from the block device mapping - // regardless of the assigned value. - NoDevice *string - - // The virtual device name ( ephemeral N). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes can - // specify mappings for ephemeral0 and ephemeral1 . The number of available - // instance store volumes depends on the instance type. After you connect to the - // instance, you must mount the volume. - // - // NVMe instance store volumes are automatically enumerated and assigned a device - // name. Including them in your block device mapping has no effect. - // - // Constraints: For M3 instances, you must specify instance store volumes in the - // block device mapping for the instance. When you launch an M3 instance, we ignore - // any instance store volumes specified in the block device mapping for the AMI. - VirtualName *string - - noSmithyDocumentSerde -} - -// Describes a block device mapping, which defines the EBS volumes and instance -// store volumes to attach to an instance at launch. -type BlockDeviceMappingResponse struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsBlockDeviceResponse - - // Suppresses the specified device included in the block device mapping. - NoDevice *string - - // The virtual device name. - VirtualName *string - - noSmithyDocumentSerde -} - -// The state of VPC Block Public Access (BPA). -type BlockPublicAccessStates struct { - - // The mode of VPC BPA. - // - // - off : VPC BPA is not enabled and traffic is allowed to and from internet - // gateways and egress-only internet gateways in this Region. - // - // - block-bidirectional : Block all traffic to and from internet gateways and - // egress-only internet gateways in this Region (except for excluded VPCs and - // subnets). - // - // - block-ingress : Block all internet traffic to the VPCs in this Region - // (except for VPCs or subnets which are excluded). Only traffic to and from NAT - // gateways and egress-only internet gateways is allowed because these gateways - // only allow outbound connections to be established. - InternetGatewayBlockMode BlockPublicAccessMode - - noSmithyDocumentSerde -} - -// Describes a bundle task. -type BundleTask struct { - - // The ID of the bundle task. - BundleId *string - - // If the task fails, a description of the error. - BundleTaskError *BundleTaskError - - // The ID of the instance associated with this bundle task. - InstanceId *string - - // The level of task completion, as a percent (for example, 20%). - Progress *string - - // The time this task started. - StartTime *time.Time - - // The state of the task. - State BundleTaskState - - // The Amazon S3 storage locations. - Storage *Storage - - // The time of the most recent update for the task. - UpdateTime *time.Time - - noSmithyDocumentSerde -} - -// Describes an error for BundleInstance. -type BundleTaskError struct { - - // The error code. - Code *string - - // The error message. - Message *string - - noSmithyDocumentSerde -} - -// The Autonomous System Number (ASN) and BYOIP CIDR association. -type Byoasn struct { - - // A public 2-byte or 4-byte ASN. - Asn *string - - // An IPAM ID. - IpamId *string - - // The provisioning state of the BYOASN. - State AsnState - - // The status message. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Information about an address range that is provisioned for use with your Amazon -// Web Services resources through bring your own IP addresses (BYOIP). -type ByoipCidr struct { - - // The BYOIP CIDR associations with ASNs. - AsnAssociations []AsnAssociation - - // The address range, in CIDR notation. - Cidr *string - - // The description of the address range. - Description *string - - // If you have [Local Zones] enabled, you can choose a network border group for Local Zones - // when you provision and advertise a BYOIPv4 CIDR. Choose the network border group - // carefully as the EIP and the Amazon Web Services resource it is associated with - // must reside in the same network border group. - // - // You can provision BYOIP address ranges to and advertise them in the following - // Local Zone network border groups: - // - // - us-east-1-dfw-2 - // - // - us-west-2-lax-1 - // - // - us-west-2-phx-2 - // - // You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this - // time. - // - // [Local Zones]: https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html - NetworkBorderGroup *string - - // The state of the address range. - // - // - advertised : The address range is being advertised to the internet by Amazon - // Web Services. - // - // - deprovisioned : The address range is deprovisioned. - // - // - failed-deprovision : The request to deprovision the address range was - // unsuccessful. Ensure that all EIPs from the range have been deallocated and try - // again. - // - // - failed-provision : The request to provision the address range was - // unsuccessful. - // - // - pending-deprovision : You’ve submitted a request to deprovision an address - // range and it's pending. - // - // - pending-provision : You’ve submitted a request to provision an address range - // and it's pending. - // - // - provisioned : The address range is provisioned and can be advertised. The - // range is not currently advertised. - // - // - provisioned-not-publicly-advertisable : The address range is provisioned and - // cannot be advertised. - State ByoipCidrState - - // Upon success, contains the ID of the address pool. Otherwise, contains an error - // message. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Describes a Capacity Reservation Fleet cancellation error. -type CancelCapacityReservationFleetError struct { - - // The error code. - Code *string - - // The error message. - Message *string - - noSmithyDocumentSerde -} - -// Describes a request to cancel a Spot Instance. -type CancelledSpotInstanceRequest struct { - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string - - // The state of the Spot Instance request. - State CancelSpotInstanceRequestState - - noSmithyDocumentSerde -} - -// Describes a Spot Fleet error. -type CancelSpotFleetRequestsError struct { - - // The error code. - Code CancelBatchErrorCode - - // The description for the error code. - Message *string - - noSmithyDocumentSerde -} - -// Describes a Spot Fleet request that was not successfully canceled. -type CancelSpotFleetRequestsErrorItem struct { - - // The error. - Error *CancelSpotFleetRequestsError - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - noSmithyDocumentSerde -} - -// Describes a Spot Fleet request that was successfully canceled. -type CancelSpotFleetRequestsSuccessItem struct { - - // The current state of the Spot Fleet request. - CurrentSpotFleetRequestState BatchState - - // The previous state of the Spot Fleet request. - PreviousSpotFleetRequestState BatchState - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - noSmithyDocumentSerde -} - -// Information about instance capacity usage for a Capacity Reservation. -type CapacityAllocation struct { - - // The usage type. used indicates that the instance capacity is in use by - // instances that are running in the Capacity Reservation. - AllocationType AllocationType - - // The amount of instance capacity associated with the usage. For example a value - // of 4 indicates that instance capacity for 4 instances is currently in use. - Count *int32 - - noSmithyDocumentSerde -} - -// Reserve powerful GPU instances on a future date to support your short duration -// machine learning (ML) workloads. Instances that run inside a Capacity Block are -// automatically placed close together inside [Amazon EC2 UltraClusters], for low-latency, petabit-scale, -// non-blocking networking. -// -// You can also reserve Amazon EC2 UltraServers. UltraServers connect multiple EC2 -// instances using a low-latency, high-bandwidth accelerator interconnect -// (NeuronLink). They are built to tackle very large-scale AI/ML workloads that -// require significant processing power. For more information, see Amazon EC2 -// UltraServers. -// -// [Amazon EC2 UltraClusters]: http://aws.amazon.com/ec2/ultraclusters/ -type CapacityBlock struct { - - // The Availability Zone of the Capacity Block. - AvailabilityZone *string - - // The Availability Zone ID of the Capacity Block. - AvailabilityZoneId *string - - // The ID of the Capacity Block. - CapacityBlockId *string - - // The ID of the Capacity Reservation. - CapacityReservationIds []string - - // The date and time at which the Capacity Block was created. - CreateDate *time.Time - - // The date and time at which the Capacity Block expires. When a Capacity Block - // expires, all instances in the Capacity Block are terminated. - EndDate *time.Time - - // The date and time at which the Capacity Block was started. - StartDate *time.Time - - // The state of the Capacity Block. - State CapacityBlockResourceState - - // The tags assigned to the Capacity Block. - Tags []Tag - - // The EC2 UltraServer type of the Capacity Block. - UltraserverType *string - - noSmithyDocumentSerde -} - -// Describes a Capacity Block extension. With an extension, you can extend the -// duration of time for an existing Capacity Block. -type CapacityBlockExtension struct { - - // The Availability Zone of the Capacity Block extension. - AvailabilityZone *string - - // The Availability Zone ID of the Capacity Block extension. - AvailabilityZoneId *string - - // The duration of the Capacity Block extension in hours. - CapacityBlockExtensionDurationHours *int32 - - // The end date of the Capacity Block extension. - CapacityBlockExtensionEndDate *time.Time - - // The ID of the Capacity Block extension offering. - CapacityBlockExtensionOfferingId *string - - // The date when the Capacity Block extension was purchased. - CapacityBlockExtensionPurchaseDate *time.Time - - // The start date of the Capacity Block extension. - CapacityBlockExtensionStartDate *time.Time - - // The status of the Capacity Block extension. A Capacity Block extension can have - // one of the following statuses: - // - // - payment-pending - The Capacity Block extension payment is processing. If - // your payment can't be processed within 12 hours, the Capacity Block extension is - // failed. - // - // - payment-failed - Payment for the Capacity Block extension request was not - // successful. - // - // - payment-succeeded - Payment for the Capacity Block extension request was - // successful. You receive an invoice that reflects the one-time upfront payment. - // In the invoice, you can associate the paid amount with the Capacity Block - // reservation ID. - CapacityBlockExtensionStatus CapacityBlockExtensionStatus - - // The reservation ID of the Capacity Block extension. - CapacityReservationId *string - - // The currency of the payment for the Capacity Block extension. - CurrencyCode *string - - // The number of instances in the Capacity Block extension. - InstanceCount *int32 - - // The instance type of the Capacity Block extension. - InstanceType *string - - // The total price to be paid up front. - UpfrontFee *string - - noSmithyDocumentSerde -} - -// The recommended Capacity Block extension that fits your search requirements. -type CapacityBlockExtensionOffering struct { - - // The Availability Zone of the Capacity Block that will be extended. - AvailabilityZone *string - - // The Availability Zone ID of the Capacity Block that will be extended. - AvailabilityZoneId *string - - // The amount of time of the Capacity Block extension offering in hours. - CapacityBlockExtensionDurationHours *int32 - - // The date and time at which the Capacity Block extension expires. When a - // Capacity Block expires, the reserved capacity is released and you can no longer - // launch instances into it. The Capacity Block's state changes to expired when it - // reaches its end date - CapacityBlockExtensionEndDate *time.Time - - // The ID of the Capacity Block extension offering. - CapacityBlockExtensionOfferingId *string - - // The date and time at which the Capacity Block extension will start. This date - // is also the same as the end date of the Capacity Block that will be extended. - CapacityBlockExtensionStartDate *time.Time - - // The currency of the payment for the Capacity Block extension offering. - CurrencyCode *string - - // The number of instances in the Capacity Block extension offering. - InstanceCount *int32 - - // The instance type of the Capacity Block that will be extended. - InstanceType *string - - // The start date of the Capacity Block that will be extended. - StartDate *time.Time - - // Indicates the tenancy of the Capacity Block extension offering. A Capacity - // Block can have one of the following tenancy settings: - // - // - default - The Capacity Block is created on hardware that is shared with - // other Amazon Web Services accounts. - // - // - dedicated - The Capacity Block is created on single-tenant hardware that is - // dedicated to a single Amazon Web Services account. - Tenancy CapacityReservationTenancy - - // The total price of the Capacity Block extension offering, to be paid up front. - UpfrontFee *string - - noSmithyDocumentSerde -} - -// The recommended Capacity Block that fits your search requirements. -type CapacityBlockOffering struct { - - // The Availability Zone of the Capacity Block offering. - AvailabilityZone *string - - // The number of hours (in addition to capacityBlockDurationMinutes ) for the - // duration of the Capacity Block reservation. For example, if a Capacity Block - // starts at 04:55 and ends at 11:30, the hours field would be 6. - CapacityBlockDurationHours *int32 - - // The number of minutes (in addition to capacityBlockDurationHours ) for the - // duration of the Capacity Block reservation. For example, if a Capacity Block - // starts at 08:55 and ends at 11:30, the minutes field would be 35. - CapacityBlockDurationMinutes *int32 - - // The ID of the Capacity Block offering. - CapacityBlockOfferingId *string - - // The currency of the payment for the Capacity Block. - CurrencyCode *string - - // The end date of the Capacity Block offering. - EndDate *time.Time - - // The number of instances in the Capacity Block offering. - InstanceCount *int32 - - // The instance type of the Capacity Block offering. - InstanceType *string - - // The start date of the Capacity Block offering. - StartDate *time.Time - - // The tenancy of the Capacity Block. - Tenancy CapacityReservationTenancy - - // The number of EC2 UltraServers in the offering. - UltraserverCount *int32 - - // The EC2 UltraServer type of the Capacity Block offering. - UltraserverType *string - - // The total price to be paid up front. - UpfrontFee *string - - noSmithyDocumentSerde -} - -// Describes the availability of capacity for a Capacity Block. -type CapacityBlockStatus struct { - - // The ID of the Capacity Block. - CapacityBlockId *string - - // The availability of capacity for the Capacity Block reservations. - CapacityReservationStatuses []CapacityReservationStatus - - // The status of the high-bandwidth accelerator interconnect. Possible states - // include: - // - // - ok the accelerator interconnect is healthy. - // - // - impaired - accelerator interconnect communication is impaired. - // - // - insufficient-data - insufficient data to determine accelerator interconnect - // status. - InterconnectStatus CapacityBlockInterconnectStatus - - // The remaining capacity. Indicates the number of resources that can be launched - // into the Capacity Block. - TotalAvailableCapacity *int32 - - // The combined amount of Available and Unavailable capacity in the Capacity Block. - TotalCapacity *int32 - - // The unavailable capacity. Indicates the instance capacity that is unavailable - // for use due to a system status check failure. - TotalUnavailableCapacity *int32 - - noSmithyDocumentSerde -} - -// Describes a Capacity Reservation. -type CapacityReservation struct { - - // The Availability Zone in which the capacity is reserved. - AvailabilityZone *string - - // The Availability Zone ID of the Capacity Reservation. - AvailabilityZoneId *string - - // The remaining capacity. Indicates the number of instances that can be launched - // in the Capacity Reservation. - AvailableInstanceCount *int32 - - // Information about instance capacity usage. - CapacityAllocations []CapacityAllocation - - // The ID of the Capacity Block. - CapacityBlockId *string - - // The Amazon Resource Name (ARN) of the Capacity Reservation. - CapacityReservationArn *string - - // The ID of the Capacity Reservation Fleet to which the Capacity Reservation - // belongs. Only valid for Capacity Reservations that were created by a Capacity - // Reservation Fleet. - CapacityReservationFleetId *string - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // Information about your commitment for a future-dated Capacity Reservation. - CommitmentInfo *CapacityReservationCommitmentInfo - - // The date and time at which the Capacity Reservation was created. - CreateDate *time.Time - - // The delivery method for a future-dated Capacity Reservation. incremental - // indicates that the requested capacity is delivered in addition to any running - // instances and reserved capacity that you have in your account at the requested - // date and time. - DeliveryPreference CapacityReservationDeliveryPreference - - // Indicates whether the Capacity Reservation supports EBS-optimized instances. - // This optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using an - // EBS- optimized instance. - EbsOptimized *bool - - // The date and time at which the Capacity Reservation expires. When a Capacity - // Reservation expires, the reserved capacity is released and you can no longer - // launch instances into it. The Capacity Reservation's state changes to expired - // when it reaches its end date and time. - EndDate *time.Time - - // Indicates the way in which the Capacity Reservation ends. A Capacity - // Reservation can have one of the following end types: - // - // - unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. - // - // - limited - The Capacity Reservation expires automatically at a specified date - // and time. - EndDateType EndDateType - - // Deprecated. - EphemeralStorage *bool - - // Indicates the type of instance launches that the Capacity Reservation accepts. - // The options include: - // - // - open - The Capacity Reservation accepts all instances that have matching - // attributes (instance type, platform, and Availability Zone). Instances that have - // matching attributes launch into the Capacity Reservation automatically without - // specifying any additional parameters. - // - // - targeted - The Capacity Reservation only accepts instances that have - // matching attributes (instance type, platform, and Availability Zone), and - // explicitly target the Capacity Reservation. This ensures that only permitted - // instances can use the reserved capacity. - InstanceMatchCriteria InstanceMatchCriteria - - // The type of operating system for which the Capacity Reservation reserves - // capacity. - InstancePlatform CapacityReservationInstancePlatform - - // The type of instance for which the Capacity Reservation reserves capacity. - InstanceType *string - - // The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation - // was created. - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the Capacity Reservation. - OwnerId *string - - // The Amazon Resource Name (ARN) of the cluster placement group in which the - // Capacity Reservation was created. For more information, see [Capacity Reservations for cluster placement groups]in the Amazon EC2 - // User Guide. - // - // [Capacity Reservations for cluster placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html - PlacementGroupArn *string - - // The type of Capacity Reservation. - ReservationType CapacityReservationType - - // The date and time at which the Capacity Reservation was started. - StartDate *time.Time - - // The current state of the Capacity Reservation. A Capacity Reservation can be in - // one of the following states: - // - // - active - The capacity is available for use. - // - // - expired - The Capacity Reservation expired automatically at the date and - // time specified in your reservation request. The reserved capacity is no longer - // available for your use. - // - // - cancelled - The Capacity Reservation was canceled. The reserved capacity is - // no longer available for your use. - // - // - pending - The Capacity Reservation request was successful but the capacity - // provisioning is still pending. - // - // - failed - The Capacity Reservation request has failed. A request can fail due - // to request parameters that are not valid, capacity constraints, or instance - // limit constraints. You can view a failed request for 60 minutes. - // - // - scheduled - (Future-dated Capacity Reservations) The future-dated Capacity - // Reservation request was approved and the Capacity Reservation is scheduled for - // delivery on the requested start date. - // - // - payment-pending - (Capacity Blocks) The upfront payment has not been - // processed yet. - // - // - payment-failed - (Capacity Blocks) The upfront payment was not processed in - // the 12-hour time frame. Your Capacity Block was released. - // - // - assessing - (Future-dated Capacity Reservations) Amazon EC2 is assessing - // your request for a future-dated Capacity Reservation. - // - // - delayed - (Future-dated Capacity Reservations) Amazon EC2 encountered a - // delay in provisioning the requested future-dated Capacity Reservation. Amazon - // EC2 is unable to deliver the requested capacity by the requested start date and - // time. - // - // - unsupported - (Future-dated Capacity Reservations) Amazon EC2 can't support - // the future-dated Capacity Reservation request due to capacity constraints. You - // can view unsupported requests for 30 days. The Capacity Reservation will not be - // delivered. - State CapacityReservationState - - // Any tags assigned to the Capacity Reservation. - Tags []Tag - - // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can - // have one of the following tenancy settings: - // - // - default - The Capacity Reservation is created on hardware that is shared - // with other Amazon Web Services accounts. - // - // - dedicated - The Capacity Reservation is created on single-tenant hardware - // that is dedicated to a single Amazon Web Services account. - Tenancy CapacityReservationTenancy - - // The total number of instances for which the Capacity Reservation reserves - // capacity. - TotalInstanceCount *int32 - - // The ID of the Amazon Web Services account to which billing of the unused - // capacity of the Capacity Reservation is assigned. - UnusedReservationBillingOwnerId *string - - noSmithyDocumentSerde -} - -// Information about a request to assign billing of the unused capacity of a -// Capacity Reservation. -type CapacityReservationBillingRequest struct { - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // Information about the Capacity Reservation. - CapacityReservationInfo *CapacityReservationInfo - - // The date and time, in UTC time format, at which the request was initiated. - LastUpdateTime *time.Time - - // The ID of the Amazon Web Services account that initiated the request. - RequestedBy *string - - // The status of the request. For more information, see [View billing assignment requests for a shared Amazon EC2 Capacity Reservation]. - // - // [View billing assignment requests for a shared Amazon EC2 Capacity Reservation]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/view-billing-transfers.html - Status CapacityReservationBillingRequestStatus - - // Information about the status. - StatusMessage *string - - // The ID of the Amazon Web Services account to which the request was sent. - UnusedReservationBillingOwnerId *string - - noSmithyDocumentSerde -} - -// Information about your commitment for a future-dated Capacity Reservation. -type CapacityReservationCommitmentInfo struct { - - // The date and time at which the commitment duration expires, in the ISO8601 - // format in the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ ). You can't decrease the - // instance count or cancel the Capacity Reservation before this date and time. - CommitmentEndDate *time.Time - - // The instance capacity that you committed to when you requested the future-dated - // Capacity Reservation. - CommittedInstanceCount *int32 - - noSmithyDocumentSerde -} - -// Information about a Capacity Reservation Fleet. -type CapacityReservationFleet struct { - - // The strategy used by the Capacity Reservation Fleet to determine which of the - // specified instance types to use. For more information, see For more information, - // see [Allocation strategy]in the Amazon EC2 User Guide. - // - // [Allocation strategy]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#allocation-strategy - AllocationStrategy *string - - // The ARN of the Capacity Reservation Fleet. - CapacityReservationFleetArn *string - - // The ID of the Capacity Reservation Fleet. - CapacityReservationFleetId *string - - // The date and time at which the Capacity Reservation Fleet was created. - CreateTime *time.Time - - // The date and time at which the Capacity Reservation Fleet expires. - EndDate *time.Time - - // Indicates the type of instance launches that the Capacity Reservation Fleet - // accepts. All Capacity Reservations in the Fleet inherit this instance matching - // criteria. - // - // Currently, Capacity Reservation Fleets support open instance matching criteria - // only. This means that instances that have matching attributes (instance type, - // platform, and Availability Zone) run in the Capacity Reservations automatically. - // Instances do not need to explicitly target a Capacity Reservation Fleet to use - // its reserved capacity. - InstanceMatchCriteria FleetInstanceMatchCriteria - - // Information about the instance types for which to reserve the capacity. - InstanceTypeSpecifications []FleetCapacityReservation - - // The state of the Capacity Reservation Fleet. Possible states include: - // - // - submitted - The Capacity Reservation Fleet request has been submitted and - // Amazon Elastic Compute Cloud is preparing to create the Capacity Reservations. - // - // - modifying - The Capacity Reservation Fleet is being modified. The Fleet - // remains in this state until the modification is complete. - // - // - active - The Capacity Reservation Fleet has fulfilled its total target - // capacity and it is attempting to maintain this capacity. The Fleet remains in - // this state until it is modified or deleted. - // - // - partially_fulfilled - The Capacity Reservation Fleet has partially fulfilled - // its total target capacity. There is insufficient Amazon EC2 to fulfill the total - // target capacity. The Fleet is attempting to asynchronously fulfill its total - // target capacity. - // - // - expiring - The Capacity Reservation Fleet has reach its end date and it is - // in the process of expiring. One or more of its Capacity reservations might still - // be active. - // - // - expired - The Capacity Reservation Fleet has reach its end date. The Fleet - // and its Capacity Reservations are expired. The Fleet can't create new Capacity - // Reservations. - // - // - cancelling - The Capacity Reservation Fleet is in the process of being - // cancelled. One or more of its Capacity reservations might still be active. - // - // - cancelled - The Capacity Reservation Fleet has been manually cancelled. The - // Fleet and its Capacity Reservations are cancelled and the Fleet can't create new - // Capacity Reservations. - // - // - failed - The Capacity Reservation Fleet failed to reserve capacity for the - // specified instance types. - State CapacityReservationFleetState - - // The tags assigned to the Capacity Reservation Fleet. - Tags []Tag - - // The tenancy of the Capacity Reservation Fleet. Tenancies include: - // - // - default - The Capacity Reservation Fleet is created on hardware that is - // shared with other Amazon Web Services accounts. - // - // - dedicated - The Capacity Reservation Fleet is created on single-tenant - // hardware that is dedicated to a single Amazon Web Services account. - Tenancy FleetCapacityReservationTenancy - - // The capacity units that have been fulfilled. - TotalFulfilledCapacity *float64 - - // The total number of capacity units for which the Capacity Reservation Fleet - // reserves capacity. For more information, see [Total target capacity]in the Amazon EC2 User Guide. - // - // [Total target capacity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity - TotalTargetCapacity *int32 - - noSmithyDocumentSerde -} - -// Describes a Capacity Reservation Fleet that was successfully cancelled. -type CapacityReservationFleetCancellationState struct { - - // The ID of the Capacity Reservation Fleet that was successfully cancelled. - CapacityReservationFleetId *string - - // The current state of the Capacity Reservation Fleet. - CurrentFleetState CapacityReservationFleetState - - // The previous state of the Capacity Reservation Fleet. - PreviousFleetState CapacityReservationFleetState - - noSmithyDocumentSerde -} - -// Describes a resource group to which a Capacity Reservation has been added. -type CapacityReservationGroup struct { - - // The ARN of the resource group. - GroupArn *string - - // The ID of the Amazon Web Services account that owns the resource group. - OwnerId *string - - noSmithyDocumentSerde -} - -// Information about a Capacity Reservation. -type CapacityReservationInfo struct { - - // The Availability Zone for the Capacity Reservation. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // The instance type for the Capacity Reservation. - InstanceType *string - - // The tenancy of the Capacity Reservation. - Tenancy CapacityReservationTenancy - - noSmithyDocumentSerde -} - -// Describes the strategy for using unused Capacity Reservations for fulfilling -// On-Demand capacity. -// -// This strategy can only be used if the EC2 Fleet is of type instant . -// -// For more information about Capacity Reservations, see [On-Demand Capacity Reservations] in the Amazon EC2 User -// Guide. For examples of using Capacity Reservations in an EC2 Fleet, see [EC2 Fleet example configurations]in the -// Amazon EC2 User Guide. -// -// [EC2 Fleet example configurations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html -// [On-Demand Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html -type CapacityReservationOptions struct { - - // Indicates whether to use unused Capacity Reservations for fulfilling On-Demand - // capacity. - // - // If you specify use-capacity-reservations-first , the fleet uses unused Capacity - // Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. - // If multiple instance pools have unused Capacity Reservations, the On-Demand - // allocation strategy ( lowest-price or prioritized ) is applied. If the number of - // unused Capacity Reservations is less than the On-Demand target capacity, the - // remaining On-Demand target capacity is launched according to the On-Demand - // allocation strategy ( lowest-price or prioritized ). - // - // If you do not specify a value, the fleet fulfils the On-Demand capacity - // according to the chosen On-Demand allocation strategy. - UsageStrategy FleetCapacityReservationUsageStrategy - - noSmithyDocumentSerde -} - -// Describes the strategy for using unused Capacity Reservations for fulfilling -// On-Demand capacity. -// -// This strategy can only be used if the EC2 Fleet is of type instant . -// -// For more information about Capacity Reservations, see [On-Demand Capacity Reservations] in the Amazon EC2 User -// Guide. For examples of using Capacity Reservations in an EC2 Fleet, see [EC2 Fleet example configurations]in the -// Amazon EC2 User Guide. -// -// [EC2 Fleet example configurations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html -// [On-Demand Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html -type CapacityReservationOptionsRequest struct { - - // Indicates whether to use unused Capacity Reservations for fulfilling On-Demand - // capacity. - // - // If you specify use-capacity-reservations-first , the fleet uses unused Capacity - // Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. - // If multiple instance pools have unused Capacity Reservations, the On-Demand - // allocation strategy ( lowest-price or prioritized ) is applied. If the number of - // unused Capacity Reservations is less than the On-Demand target capacity, the - // remaining On-Demand target capacity is launched according to the On-Demand - // allocation strategy ( lowest-price or prioritized ). - // - // If you do not specify a value, the fleet fulfils the On-Demand capacity - // according to the chosen On-Demand allocation strategy. - UsageStrategy FleetCapacityReservationUsageStrategy - - noSmithyDocumentSerde -} - -// Describes an instance's Capacity Reservation targeting option. -// -// Use the CapacityReservationPreference parameter to configure the instance to -// run as an On-Demand Instance, to run in any open Capacity Reservation that has -// matching attributes, or to run only in a Capacity Reservation or Capacity -// Reservation group. Use the CapacityReservationTarget parameter to explicitly -// target a specific Capacity Reservation or a Capacity Reservation group. -// -// You can only specify CapacityReservationPreference and CapacityReservationTarget -// if the CapacityReservationPreference is capacity-reservations-only . -type CapacityReservationSpecification struct { - - // Indicates the instance's Capacity Reservation preferences. Possible preferences - // include: - // - // - capacity-reservations-only - The instance will only run in a Capacity - // Reservation or Capacity Reservation group. If capacity isn't available, the - // instance will fail to launch. - // - // - open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone, and tenancy). - // If capacity isn't available, the instance runs as an On-Demand Instance. - // - // - none - The instance doesn't run in a Capacity Reservation even if one is - // available. The instance runs as an On-Demand Instance. - CapacityReservationPreference CapacityReservationPreference - - // Information about the target Capacity Reservation or Capacity Reservation group. - CapacityReservationTarget *CapacityReservationTarget - - noSmithyDocumentSerde -} - -// Describes the instance's Capacity Reservation targeting preferences. The action -// returns the capacityReservationPreference response element if the instance is -// configured to run in On-Demand capacity, or if it is configured in run in any -// open Capacity Reservation that has matching attributes (instance type, platform, -// Availability Zone). The action returns the capacityReservationTarget response -// element if the instance explicily targets a specific Capacity Reservation or -// Capacity Reservation group. -type CapacityReservationSpecificationResponse struct { - - // Describes the instance's Capacity Reservation preferences. Possible preferences - // include: - // - // - open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone). - // - // - none - The instance avoids running in a Capacity Reservation even if one is - // available. The instance runs in On-Demand capacity. - CapacityReservationPreference CapacityReservationPreference - - // Information about the targeted Capacity Reservation or Capacity Reservation - // group. - CapacityReservationTarget *CapacityReservationTargetResponse - - noSmithyDocumentSerde -} - -// Describes the availability of capacity for a Capacity Reservation. -type CapacityReservationStatus struct { - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // The remaining capacity. Indicates the amount of resources that can be launched - // into the Capacity Reservation. - TotalAvailableCapacity *int32 - - // The combined amount of Available and Unavailable capacity in the Capacity - // Reservation. - TotalCapacity *int32 - - // The used capacity. Indicates that the capacity is in use by resources that are - // running in the Capacity Reservation. - TotalUnavailableCapacity *int32 - - noSmithyDocumentSerde -} - -// Describes a target Capacity Reservation or Capacity Reservation group. -type CapacityReservationTarget struct { - - // The ID of the Capacity Reservation in which to run the instance. - CapacityReservationId *string - - // The ARN of the Capacity Reservation resource group in which to run the instance. - CapacityReservationResourceGroupArn *string - - noSmithyDocumentSerde -} - -// Describes a target Capacity Reservation or Capacity Reservation group. -type CapacityReservationTargetResponse struct { - - // The ID of the targeted Capacity Reservation. - CapacityReservationId *string - - // The ARN of the targeted Capacity Reservation group. - CapacityReservationResourceGroupArn *string - - noSmithyDocumentSerde -} - -// Describes a carrier gateway. -type CarrierGateway struct { - - // The ID of the carrier gateway. - CarrierGatewayId *string - - // The Amazon Web Services account ID of the owner of the carrier gateway. - OwnerId *string - - // The state of the carrier gateway. - State CarrierGatewayState - - // The tags assigned to the carrier gateway. - Tags []Tag - - // The ID of the VPC associated with the carrier gateway. - VpcId *string - - noSmithyDocumentSerde -} - -// Information about the client certificate used for authentication. -type CertificateAuthentication struct { - - // The ARN of the client certificate. - ClientRootCertificateChain *string - - noSmithyDocumentSerde -} - -// Information about the client certificate to be used for authentication. -type CertificateAuthenticationRequest struct { - - // The ARN of the client certificate. The certificate must be signed by a - // certificate authority (CA) and it must be provisioned in Certificate Manager - // (ACM). - ClientRootCertificateChainArn *string - - noSmithyDocumentSerde -} - -// Provides authorization for Amazon to bring a specific IP address range to a -// specific Amazon Web Services account using bring your own IP addresses (BYOIP). -// For more information, see [Configuring your BYOIP address range]in the Amazon EC2 User Guide. -// -// [Configuring your BYOIP address range]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip -type CidrAuthorizationContext struct { - - // The plain-text authorization message for the prefix and account. - // - // This member is required. - Message *string - - // The signed authorization message for the prefix and account. - // - // This member is required. - Signature *string - - noSmithyDocumentSerde -} - -// Describes an IPv4 CIDR block. -type CidrBlock struct { - - // The IPv4 CIDR block. - CidrBlock *string - - noSmithyDocumentSerde -} - -// Deprecated. -// -// Describes the ClassicLink DNS support status of a VPC. -type ClassicLinkDnsSupport struct { - - // Indicates whether ClassicLink DNS support is enabled for the VPC. - ClassicLinkDnsSupported *bool - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Deprecated. -// -// Describes a linked EC2-Classic instance. -type ClassicLinkInstance struct { - - // The security groups. - Groups []GroupIdentifier - - // The ID of the instance. - InstanceId *string - - // Any tags assigned to the instance. - Tags []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes a Classic Load Balancer. -type ClassicLoadBalancer struct { - - // The name of the load balancer. - Name *string - - noSmithyDocumentSerde -} - -// Describes the Classic Load Balancers to attach to a Spot Fleet. Spot Fleet -// registers the running Spot Instances with these Classic Load Balancers. -type ClassicLoadBalancersConfig struct { - - // One or more Classic Load Balancers. - ClassicLoadBalancers []ClassicLoadBalancer - - noSmithyDocumentSerde -} - -// Describes the state of a client certificate revocation list. -type ClientCertificateRevocationListStatus struct { - - // The state of the client certificate revocation list. - Code ClientCertificateRevocationListStatusCode - - // A message about the status of the client certificate revocation list, if - // applicable. - Message *string - - noSmithyDocumentSerde -} - -// The options for managing connection authorization for new client connections. -type ClientConnectOptions struct { - - // Indicates whether client connect options are enabled. The default is false (not - // enabled). - Enabled *bool - - // The Amazon Resource Name (ARN) of the Lambda function used for connection - // authorization. - LambdaFunctionArn *string - - noSmithyDocumentSerde -} - -// The options for managing connection authorization for new client connections. -type ClientConnectResponseOptions struct { - - // Indicates whether client connect options are enabled. - Enabled *bool - - // The Amazon Resource Name (ARN) of the Lambda function used for connection - // authorization. - LambdaFunctionArn *string - - // The status of any updates to the client connect options. - Status *ClientVpnEndpointAttributeStatus - - noSmithyDocumentSerde -} - -// Describes the client-specific data. -type ClientData struct { - - // A user-defined comment about the disk upload. - Comment *string - - // The time that the disk upload ends. - UploadEnd *time.Time - - // The size of the uploaded disk image, in GiB. - UploadSize *float64 - - // The time that the disk upload starts. - UploadStart *time.Time - - noSmithyDocumentSerde -} - -// Options for enabling a customizable text banner that will be displayed on -// Amazon Web Services provided clients when a VPN session is established. -type ClientLoginBannerOptions struct { - - // Customizable text that will be displayed in a banner on Amazon Web Services - // provided clients when a VPN session is established. UTF-8 encoded characters - // only. Maximum of 1400 characters. - BannerText *string - - // Enable or disable a customizable text banner that will be displayed on Amazon - // Web Services provided clients when a VPN session is established. - // - // Valid values: true | false - // - // Default value: false - Enabled *bool - - noSmithyDocumentSerde -} - -// Current state of options for customizable text banner that will be displayed on -// Amazon Web Services provided clients when a VPN session is established. -type ClientLoginBannerResponseOptions struct { - - // Customizable text that will be displayed in a banner on Amazon Web Services - // provided clients when a VPN session is established. UTF-8 encoded characters - // only. Maximum of 1400 characters. - BannerText *string - - // Current state of text banner feature. - // - // Valid values: true | false - Enabled *bool - - noSmithyDocumentSerde -} - -// Client Route Enforcement is a feature of Client VPN that helps enforce -// administrator defined routes on devices connected through the VPN. This feature -// helps improve your security posture by ensuring that network traffic originating -// from a connected client is not inadvertently sent outside the VPN tunnel. -// -// Client Route Enforcement works by monitoring the route table of a connected -// device for routing policy changes to the VPN connection. If the feature detects -// any VPN routing policy modifications, it will automatically force an update to -// the route table, reverting it back to the expected route configurations. -type ClientRouteEnforcementOptions struct { - - // Enable or disable Client Route Enforcement. The state can either be true - // (enabled) or false (disabled). The default is false . - // - // Valid values: true | false - // - // Default value: false - Enforced *bool - - noSmithyDocumentSerde -} - -// The current status of Client Route Enforcement. -type ClientRouteEnforcementResponseOptions struct { - - // Status of the client route enforcement feature, indicating whether Client Route - // Enforcement is true (enabled) or false (disabled). - // - // Valid values: true | false - // - // Default value: false - Enforced *bool - - noSmithyDocumentSerde -} - -// Describes the authentication methods used by a Client VPN endpoint. For more -// information, see [Authentication]in the Client VPN Administrator Guide. -// -// [Authentication]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/client-authentication.html -type ClientVpnAuthentication struct { - - // Information about the Active Directory, if applicable. - ActiveDirectory *DirectoryServiceAuthentication - - // Information about the IAM SAML identity provider, if applicable. - FederatedAuthentication *FederatedAuthentication - - // Information about the authentication certificates, if applicable. - MutualAuthentication *CertificateAuthentication - - // The authentication type used. - Type ClientVpnAuthenticationType - - noSmithyDocumentSerde -} - -// Describes the authentication method to be used by a Client VPN endpoint. For -// more information, see [Authentication]in the Client VPN Administrator Guide. -// -// [Authentication]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication -type ClientVpnAuthenticationRequest struct { - - // Information about the Active Directory to be used, if applicable. You must - // provide this information if Type is directory-service-authentication . - ActiveDirectory *DirectoryServiceAuthenticationRequest - - // Information about the IAM SAML identity provider to be used, if applicable. You - // must provide this information if Type is federated-authentication . - FederatedAuthentication *FederatedAuthenticationRequest - - // Information about the authentication certificates to be used, if applicable. - // You must provide this information if Type is certificate-authentication . - MutualAuthentication *CertificateAuthenticationRequest - - // The type of client authentication to be used. - Type ClientVpnAuthenticationType - - noSmithyDocumentSerde -} - -// Describes the state of an authorization rule. -type ClientVpnAuthorizationRuleStatus struct { - - // The state of the authorization rule. - Code ClientVpnAuthorizationRuleStatusCode - - // A message about the status of the authorization rule, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Describes a client connection. -type ClientVpnConnection struct { - - // The IP address of the client. - ClientIp *string - - // The ID of the Client VPN endpoint to which the client is connected. - ClientVpnEndpointId *string - - // The common name associated with the client. This is either the name of the - // client certificate, or the Active Directory user name. - CommonName *string - - // The date and time the client connection was terminated. - ConnectionEndTime *string - - // The date and time the client connection was established. - ConnectionEstablishedTime *string - - // The ID of the client connection. - ConnectionId *string - - // The number of bytes received by the client. - EgressBytes *string - - // The number of packets received by the client. - EgressPackets *string - - // The number of bytes sent by the client. - IngressBytes *string - - // The number of packets sent by the client. - IngressPackets *string - - // The statuses returned by the client connect handler for posture compliance, if - // applicable. - PostureComplianceStatuses []string - - // The current state of the client connection. - Status *ClientVpnConnectionStatus - - // The current date and time. - Timestamp *string - - // The username of the client who established the client connection. This - // information is only provided if Active Directory client authentication is used. - Username *string - - noSmithyDocumentSerde -} - -// Describes the status of a client connection. -type ClientVpnConnectionStatus struct { - - // The state of the client connection. - Code ClientVpnConnectionStatusCode - - // A message about the status of the client connection, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Describes a Client VPN endpoint. -type ClientVpnEndpoint struct { - - // Information about the associated target networks. A target network is a subnet - // in a VPC. - // - // Deprecated: This property is deprecated. To view the target networks associated - // with a Client VPN endpoint, call DescribeClientVpnTargetNetworks and inspect the - // clientVpnTargetNetworks response element. - AssociatedTargetNetworks []AssociatedTargetNetwork - - // Information about the authentication method used by the Client VPN endpoint. - AuthenticationOptions []ClientVpnAuthentication - - // The IPv4 address range, in CIDR notation, from which client IP addresses are - // assigned. - ClientCidrBlock *string - - // The options for managing connection authorization for new client connections. - ClientConnectOptions *ClientConnectResponseOptions - - // Options for enabling a customizable text banner that will be displayed on - // Amazon Web Services provided clients when a VPN session is established. - ClientLoginBannerOptions *ClientLoginBannerResponseOptions - - // Client route enforcement is a feature of the Client VPN service that helps - // enforce administrator defined routes on devices connected through the VPN. T his - // feature helps improve your security posture by ensuring that network traffic - // originating from a connected client is not inadvertently sent outside the VPN - // tunnel. - // - // Client route enforcement works by monitoring the route table of a connected - // device for routing policy changes to the VPN connection. If the feature detects - // any VPN routing policy modifications, it will automatically force an update to - // the route table, reverting it back to the expected route configurations. - ClientRouteEnforcementOptions *ClientRouteEnforcementResponseOptions - - // The ID of the Client VPN endpoint. - ClientVpnEndpointId *string - - // Information about the client connection logging options for the Client VPN - // endpoint. - ConnectionLogOptions *ConnectionLogResponseOptions - - // The date and time the Client VPN endpoint was created. - CreationTime *string - - // The date and time the Client VPN endpoint was deleted, if applicable. - DeletionTime *string - - // A brief description of the endpoint. - Description *string - - // Indicates whether the client VPN session is disconnected after the maximum - // sessionTimeoutHours is reached. If true , users are prompted to reconnect client - // VPN. If false , client VPN attempts to reconnect automatically. The default - // value is true . - DisconnectOnSessionTimeout *bool - - // The DNS name to be used by clients when connecting to the Client VPN endpoint. - DnsName *string - - // Information about the DNS servers to be used for DNS resolution. - DnsServers []string - - // The IDs of the security groups for the target network. - SecurityGroupIds []string - - // The URL of the self-service portal. - SelfServicePortalUrl *string - - // The ARN of the server certificate. - ServerCertificateArn *string - - // The maximum VPN session duration time in hours. - // - // Valid values: 8 | 10 | 12 | 24 - // - // Default value: 24 - SessionTimeoutHours *int32 - - // Indicates whether split-tunnel is enabled in the Client VPN endpoint. - // - // For information about split-tunnel VPN endpoints, see [Split-Tunnel Client VPN endpoint] in the Client VPN - // Administrator Guide. - // - // [Split-Tunnel Client VPN endpoint]: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html - SplitTunnel *bool - - // The current state of the Client VPN endpoint. - Status *ClientVpnEndpointStatus - - // Any tags assigned to the Client VPN endpoint. - Tags []Tag - - // The transport protocol used by the Client VPN endpoint. - TransportProtocol TransportProtocol - - // The ID of the VPC. - VpcId *string - - // The port number for the Client VPN endpoint. - VpnPort *int32 - - // The protocol used by the VPN session. - VpnProtocol VpnProtocol - - noSmithyDocumentSerde -} - -// Describes the status of the Client VPN endpoint attribute. -type ClientVpnEndpointAttributeStatus struct { - - // The status code. - Code ClientVpnEndpointAttributeStatusCode - - // The status message. - Message *string - - noSmithyDocumentSerde -} - -// Describes the state of a Client VPN endpoint. -type ClientVpnEndpointStatus struct { - - // The state of the Client VPN endpoint. Possible states include: - // - // - pending-associate - The Client VPN endpoint has been created but no target - // networks have been associated. The Client VPN endpoint cannot accept - // connections. - // - // - available - The Client VPN endpoint has been created and a target network - // has been associated. The Client VPN endpoint can accept connections. - // - // - deleting - The Client VPN endpoint is being deleted. The Client VPN endpoint - // cannot accept connections. - // - // - deleted - The Client VPN endpoint has been deleted. The Client VPN endpoint - // cannot accept connections. - Code ClientVpnEndpointStatusCode - - // A message about the status of the Client VPN endpoint. - Message *string - - noSmithyDocumentSerde -} - -// Information about a Client VPN endpoint route. -type ClientVpnRoute struct { - - // The ID of the Client VPN endpoint with which the route is associated. - ClientVpnEndpointId *string - - // A brief description of the route. - Description *string - - // The IPv4 address range, in CIDR notation, of the route destination. - DestinationCidr *string - - // Indicates how the route was associated with the Client VPN endpoint. associate - // indicates that the route was automatically added when the target network was - // associated with the Client VPN endpoint. add-route indicates that the route was - // manually added using the CreateClientVpnRoute action. - Origin *string - - // The current state of the route. - Status *ClientVpnRouteStatus - - // The ID of the subnet through which traffic is routed. - TargetSubnet *string - - // The route type. - Type *string - - noSmithyDocumentSerde -} - -// Describes the state of a Client VPN endpoint route. -type ClientVpnRouteStatus struct { - - // The state of the Client VPN endpoint route. - Code ClientVpnRouteStatusCode - - // A message about the status of the Client VPN endpoint route, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Options for sending VPN tunnel logs to CloudWatch. -type CloudWatchLogOptions struct { - - // Status of VPN tunnel logging feature. Default value is False . - // - // Valid values: True | False - LogEnabled *bool - - // The Amazon Resource Name (ARN) of the CloudWatch log group to send logs to. - LogGroupArn *string - - // Configured log format. Default format is json . - // - // Valid values: json | text - LogOutputFormat *string - - noSmithyDocumentSerde -} - -// Options for sending VPN tunnel logs to CloudWatch. -type CloudWatchLogOptionsSpecification struct { - - // Enable or disable VPN tunnel logging feature. Default value is False . - // - // Valid values: True | False - LogEnabled *bool - - // The Amazon Resource Name (ARN) of the CloudWatch log group to send logs to. - LogGroupArn *string - - // Set log format. Default format is json . - // - // Valid values: json | text - LogOutputFormat *string - - noSmithyDocumentSerde -} - -// Describes address usage for a customer-owned address pool. -type CoipAddressUsage struct { - - // The allocation ID of the address. - AllocationId *string - - // The Amazon Web Services account ID. - AwsAccountId *string - - // The Amazon Web Services service. - AwsService *string - - // The customer-owned IP address. - CoIp *string - - noSmithyDocumentSerde -} - -// Information about a customer-owned IP address range. -type CoipCidr struct { - - // An address range in a customer-owned IP address space. - Cidr *string - - // The ID of the address pool. - CoipPoolId *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes a customer-owned address pool. -type CoipPool struct { - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The ARN of the address pool. - PoolArn *string - - // The address ranges of the address pool. - PoolCidrs []string - - // The ID of the address pool. - PoolId *string - - // The tags. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the client connection logging options for the Client VPN endpoint. -type ConnectionLogOptions struct { - - // The name of the CloudWatch Logs log group. Required if connection logging is - // enabled. - CloudwatchLogGroup *string - - // The name of the CloudWatch Logs log stream to which the connection data is - // published. - CloudwatchLogStream *string - - // Indicates whether connection logging is enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -// Information about the client connection logging options for a Client VPN -// endpoint. -type ConnectionLogResponseOptions struct { - - // The name of the Amazon CloudWatch Logs log group to which connection logging - // data is published. - CloudwatchLogGroup *string - - // The name of the Amazon CloudWatch Logs log stream to which connection logging - // data is published. - CloudwatchLogStream *string - - // Indicates whether client connection logging is enabled for the Client VPN - // endpoint. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes a connection notification for a VPC endpoint or VPC endpoint service. -type ConnectionNotification struct { - - // The events for the notification. Valid values are Accept , Connect , Delete , - // and Reject . - ConnectionEvents []string - - // The ARN of the SNS topic for the notification. - ConnectionNotificationArn *string - - // The ID of the notification. - ConnectionNotificationId *string - - // The state of the notification. - ConnectionNotificationState ConnectionNotificationState - - // The type of notification. - ConnectionNotificationType ConnectionNotificationType - - // The ID of the endpoint service. - ServiceId *string - - // The Region for the endpoint service. - ServiceRegion *string - - // The ID of the VPC endpoint. - VpcEndpointId *string - - noSmithyDocumentSerde -} - -// A security group connection tracking configuration that enables you to set the -// idle timeout for connection tracking on an Elastic network interface. For more -// information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. -// -// [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts -type ConnectionTrackingConfiguration struct { - - // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 - // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: - // Less than 432000 seconds. - TcpEstablishedTimeout *int32 - - // Timeout (in seconds) for idle UDP flows classified as streams which have seen - // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 - // minutes). Default: 180 seconds. - UdpStreamTimeout *int32 - - // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single - // direction or a single request-response transaction. Min: 30 seconds. Max: 60 - // seconds. Default: 30 seconds. - UdpTimeout *int32 - - noSmithyDocumentSerde -} - -// A security group connection tracking specification that enables you to set the -// idle timeout for connection tracking on an Elastic network interface. For more -// information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. -// -// [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts -type ConnectionTrackingSpecification struct { - - // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 - // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: - // Less than 432000 seconds. - TcpEstablishedTimeout *int32 - - // Timeout (in seconds) for idle UDP flows classified as streams which have seen - // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 - // minutes). Default: 180 seconds. - UdpStreamTimeout *int32 - - // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single - // direction or a single request-response transaction. Min: 30 seconds. Max: 60 - // seconds. Default: 30 seconds. - UdpTimeout *int32 - - noSmithyDocumentSerde -} - -// A security group connection tracking specification request that enables you to -// set the idle timeout for connection tracking on an Elastic network interface. -// For more information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. -// -// [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts -type ConnectionTrackingSpecificationRequest struct { - - // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 - // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: - // Less than 432000 seconds. - TcpEstablishedTimeout *int32 - - // Timeout (in seconds) for idle UDP flows classified as streams which have seen - // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 - // minutes). Default: 180 seconds. - UdpStreamTimeout *int32 - - // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single - // direction or a single request-response transaction. Min: 30 seconds. Max: 60 - // seconds. Default: 30 seconds. - UdpTimeout *int32 - - noSmithyDocumentSerde -} - -// A security group connection tracking specification response that enables you to -// set the idle timeout for connection tracking on an Elastic network interface. -// For more information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. -// -// [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts -type ConnectionTrackingSpecificationResponse struct { - - // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 - // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: - // Less than 432000 seconds. - TcpEstablishedTimeout *int32 - - // Timeout (in seconds) for idle UDP flows classified as streams which have seen - // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 - // minutes). Default: 180 seconds. - UdpStreamTimeout *int32 - - // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single - // direction or a single request-response transaction. Min: 30 seconds. Max: 60 - // seconds. Default: 30 seconds. - UdpTimeout *int32 - - noSmithyDocumentSerde -} - -// Describes a conversion task. -type ConversionTask struct { - - // The ID of the conversion task. - ConversionTaskId *string - - // The time when the task expires. If the upload isn't complete before the - // expiration time, we automatically cancel the task. - ExpirationTime *string - - // If the task is for importing an instance, this contains information about the - // import instance task. - ImportInstance *ImportInstanceTaskDetails - - // If the task is for importing a volume, this contains information about the - // import volume task. - ImportVolume *ImportVolumeTaskDetails - - // The state of the conversion task. - State ConversionTaskState - - // The status message related to the conversion task. - StatusMessage *string - - // Any tags assigned to the task. - Tags []Tag - - noSmithyDocumentSerde -} - -// The CPU options for the instance. -type CpuOptions struct { - - // Indicates whether the instance is enabled for AMD SEV-SNP. For more - // information, see [AMD SEV-SNP]. - // - // [AMD SEV-SNP]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html - AmdSevSnp AmdSevSnpSpecification - - // The number of CPU cores for the instance. - CoreCount *int32 - - // The number of threads per CPU core. - ThreadsPerCore *int32 - - noSmithyDocumentSerde -} - -// The CPU options for the instance. Both the core count and threads per core must -// be specified in the request. -type CpuOptionsRequest struct { - - // Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is - // supported with M6a, R6a, and C6a instance types only. For more information, see [AMD SEV-SNP] - // . - // - // [AMD SEV-SNP]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html - AmdSevSnp AmdSevSnpSpecification - - // The number of CPU cores for the instance. - CoreCount *int32 - - // The number of threads per CPU core. To disable multithreading for the instance, - // specify a value of 1 . Otherwise, specify the default value of 2 . - ThreadsPerCore *int32 - - noSmithyDocumentSerde -} - -// The CPU performance to consider, using an instance family as the baseline -// reference. -type CpuPerformanceFactor struct { - - // Specify an instance family to use as the baseline reference for CPU - // performance. All instance types that match your specified attributes will be - // compared against the CPU performance of the referenced instance family, - // regardless of CPU manufacturer or architecture differences. - // - // Currently, only one instance family can be specified in the list. - References []PerformanceFactorReference - - noSmithyDocumentSerde -} - -// The CPU performance to consider, using an instance family as the baseline -// reference. -type CpuPerformanceFactorRequest struct { - - // Specify an instance family to use as the baseline reference for CPU - // performance. All instance types that match your specified attributes will be - // compared against the CPU performance of the referenced instance family, - // regardless of CPU manufacturer or architecture differences. - // - // Currently, only one instance family can be specified in the list. - References []PerformanceFactorReferenceRequest - - noSmithyDocumentSerde -} - -// Describes the instances that could not be launched by the fleet. -type CreateFleetError struct { - - // The error code that indicates why the instance could not be launched. For more - // information about error codes, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html - ErrorCode *string - - // The error message that describes why the instance could not be launched. For - // more information about error messages, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html - ErrorMessage *string - - // The launch templates and overrides that were used for launching the instances. - // The values that you specify in the Overrides replace the values in the launch - // template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse - - // Indicates if the instance that could not be launched was a Spot Instance or - // On-Demand Instance. - Lifecycle InstanceLifecycle - - noSmithyDocumentSerde -} - -// Describes the instances that were launched by the fleet. -type CreateFleetInstance struct { - - // The IDs of the instances. - InstanceIds []string - - // The instance type. - InstanceType InstanceType - - // The launch templates and overrides that were used for launching the instances. - // The values that you specify in the Overrides replace the values in the launch - // template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse - - // Indicates if the instance that was launched is a Spot Instance or On-Demand - // Instance. - Lifecycle InstanceLifecycle - - // The value is windows for Windows instances in an EC2 Fleet. Otherwise, the - // value is blank. - Platform PlatformValues - - noSmithyDocumentSerde -} - -// The options for a Connect attachment. -type CreateTransitGatewayConnectRequestOptions struct { - - // The tunnel protocol. - // - // This member is required. - Protocol ProtocolValue - - noSmithyDocumentSerde -} - -// The options for the transit gateway multicast domain. -type CreateTransitGatewayMulticastDomainRequestOptions struct { - - // Indicates whether to automatically accept cross-account subnet associations - // that are associated with the transit gateway multicast domain. - AutoAcceptSharedAssociations AutoAcceptSharedAssociationsValue - - // Specify whether to enable Internet Group Management Protocol (IGMP) version 2 - // for the transit gateway multicast domain. - Igmpv2Support Igmpv2SupportValue - - // Specify whether to enable support for statically configuring multicast group - // sources for a domain. - StaticSourcesSupport StaticSourcesSupportValue - - noSmithyDocumentSerde -} - -// Describes whether dynamic routing is enabled or disabled for the transit -// gateway peering request. -type CreateTransitGatewayPeeringAttachmentRequestOptions struct { - - // Indicates whether dynamic routing is enabled or disabled. - DynamicRouting DynamicRoutingValue - - noSmithyDocumentSerde -} - -// Describes the options for a VPC attachment. -type CreateTransitGatewayVpcAttachmentRequestOptions struct { - - // Enable or disable support for appliance mode. If enabled, a traffic flow - // between a source and destination uses the same Availability Zone for the VPC - // attachment for the lifetime of that flow. The default is disable . - ApplianceModeSupport ApplianceModeSupportValue - - // Enable or disable DNS support. The default is enable . - DnsSupport DnsSupportValue - - // Enable or disable IPv6 support. The default is disable . - Ipv6Support Ipv6SupportValue - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is set to enable by default. However, at the transit gateway level - // the default is set to disable . - // - // For more information about security group referencing, see [Security group referencing] in the Amazon Web - // Services Transit Gateways Guide. - // - // [Security group referencing]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - noSmithyDocumentSerde -} - -// Describes the CIDR options for a Verified Access endpoint. -type CreateVerifiedAccessEndpointCidrOptions struct { - - // The CIDR. - Cidr *string - - // The port ranges. - PortRanges []CreateVerifiedAccessEndpointPortRange - - // The protocol. - Protocol VerifiedAccessEndpointProtocol - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the network interface options when creating an Amazon Web Services -// Verified Access endpoint using the network-interface type. -type CreateVerifiedAccessEndpointEniOptions struct { - - // The ID of the network interface. - NetworkInterfaceId *string - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []CreateVerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - noSmithyDocumentSerde -} - -// Describes the load balancer options when creating an Amazon Web Services -// Verified Access endpoint using the load-balancer type. -type CreateVerifiedAccessEndpointLoadBalancerOptions struct { - - // The ARN of the load balancer. - LoadBalancerArn *string - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []CreateVerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - // The IDs of the subnets. You can specify only one subnet per Availability Zone. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the port range for a Verified Access endpoint. -type CreateVerifiedAccessEndpointPortRange struct { - - // The start of the port range. - FromPort *int32 - - // The end of the port range. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes the RDS options for a Verified Access endpoint. -type CreateVerifiedAccessEndpointRdsOptions struct { - - // The port. - Port *int32 - - // The protocol. - Protocol VerifiedAccessEndpointProtocol - - // The ARN of the DB cluster. - RdsDbClusterArn *string - - // The ARN of the RDS instance. - RdsDbInstanceArn *string - - // The ARN of the RDS proxy. - RdsDbProxyArn *string - - // The RDS endpoint. - RdsEndpoint *string - - // The IDs of the subnets. You can specify only one subnet per Availability Zone. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the OpenID Connect (OIDC) options. -type CreateVerifiedAccessNativeApplicationOidcOptions struct { - - // The authorization endpoint of the IdP. - AuthorizationEndpoint *string - - // The OAuth 2.0 client identifier. - ClientId *string - - // The OAuth 2.0 client secret. - ClientSecret *string - - // The OIDC issuer identifier of the IdP. - Issuer *string - - // The public signing key endpoint. - PublicSigningKeyEndpoint *string - - // The set of user claims to be requested from the IdP. - Scope *string - - // The token endpoint of the IdP. - TokenEndpoint *string - - // The user info endpoint of the IdP. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Describes the options when creating an Amazon Web Services Verified Access -// trust provider using the device type. -type CreateVerifiedAccessTrustProviderDeviceOptions struct { - - // The URL Amazon Web Services Verified Access will use to verify the - // authenticity of the device tokens. - PublicSigningKeyUrl *string - - // The ID of the tenant application with the device-identity provider. - TenantId *string - - noSmithyDocumentSerde -} - -// Describes the options when creating an Amazon Web Services Verified Access -// trust provider using the user type. -type CreateVerifiedAccessTrustProviderOidcOptions struct { - - // The OIDC authorization endpoint. - AuthorizationEndpoint *string - - // The client identifier. - ClientId *string - - // The client secret. - ClientSecret *string - - // The OIDC issuer. - Issuer *string - - // OpenID Connect (OIDC) scopes are used by an application during authentication - // to authorize access to a user's details. Each scope returns a specific set of - // user attributes. - Scope *string - - // The OIDC token endpoint. - TokenEndpoint *string - - // The OIDC user info endpoint. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Describes the user or group to be added or removed from the list of create -// volume permissions for a volume. -type CreateVolumePermission struct { - - // The group to be added or removed. The possible value is all . - Group PermissionGroup - - // The ID of the Amazon Web Services account to be added or removed. - UserId *string - - noSmithyDocumentSerde -} - -// Describes modifications to the list of create volume permissions for a volume. -type CreateVolumePermissionModifications struct { - - // Adds the specified Amazon Web Services account ID or group to the list. - Add []CreateVolumePermission - - // Removes the specified Amazon Web Services account ID or group from the list. - Remove []CreateVolumePermission - - noSmithyDocumentSerde -} - -// Describes the credit option for CPU usage of a T instance. -type CreditSpecification struct { - - // The credit option for CPU usage of a T instance. - // - // Valid values: standard | unlimited - CpuCredits *string - - noSmithyDocumentSerde -} - -// The credit option for CPU usage of a T instance. -type CreditSpecificationRequest struct { - - // The credit option for CPU usage of a T instance. - // - // Valid values: standard | unlimited - // - // This member is required. - CpuCredits *string - - noSmithyDocumentSerde -} - -// Describes a customer gateway. -type CustomerGateway struct { - - // The customer gateway device's Border Gateway Protocol (BGP) Autonomous System - // Number (ASN). - // - // Valid values: 1 to 2,147,483,647 - BgpAsn *string - - // The customer gateway device's Border Gateway Protocol (BGP) Autonomous System - // Number (ASN). - // - // Valid values: 2,147,483,648 to 4,294,967,295 - BgpAsnExtended *string - - // The Amazon Resource Name (ARN) for the customer gateway certificate. - CertificateArn *string - - // The ID of the customer gateway. - CustomerGatewayId *string - - // The name of customer gateway device. - DeviceName *string - - // The IP address for the customer gateway device's outside interface. The - // address must be static. If OutsideIpAddressType in your VPN connection options - // is set to PrivateIpv4 , you can use an RFC6598 or RFC1918 private IPv4 address. - // If OutsideIpAddressType is set to PublicIpv4 , you can use a public IPv4 - // address. If OutsideIpAddressType is set to Ipv6 , you can use a public IPv6 - // address. - IpAddress *string - - // The current state of the customer gateway ( pending | available | deleting | - // deleted ). - State *string - - // Any tags assigned to the customer gateway. - Tags []Tag - - // The type of VPN connection the customer gateway supports ( ipsec.1 ). - Type *string - - noSmithyDocumentSerde -} - -// A query used for retrieving network health data. -type DataQuery struct { - - // The Region or Availability Zone that's the target for the data query. For - // example, eu-north-1 . - Destination *string - - // A user-defined ID associated with a data query that's returned in the - // dataResponse identifying the query. For example, if you set the Id to MyQuery01 - // in the query, the dataResponse identifies the query as MyQuery01 . - Id *string - - // The metric used for the network performance request. - Metric MetricType - - // The aggregation period used for the data query. - Period PeriodType - - // The Region or Availability Zone that's the source for the data query. For - // example, us-east-1 . - Source *string - - // The metric data aggregation period, p50 , between the specified startDate and - // endDate . For example, a metric of five_minutes is the median of all the data - // points gathered within those five minutes. p50 is the only supported metric. - Statistic StatisticType - - noSmithyDocumentSerde -} - -// The response to a DataQuery . -type DataResponse struct { - - // The Region or Availability Zone that's the destination for the data query. For - // example, eu-west-1 . - Destination *string - - // The ID passed in the DataQuery . - Id *string - - // The metric used for the network performance request. - Metric MetricType - - // A list of MetricPoint objects. - MetricPoints []MetricPoint - - // The period used for the network performance request. - Period PeriodType - - // The Region or Availability Zone that's the source for the data query. For - // example, us-east-1 . - Source *string - - // The statistic used for the network performance request. - Statistic StatisticType - - noSmithyDocumentSerde -} - -// Describes the metadata of the account status report. -type DeclarativePoliciesReport struct { - - // The time when the report generation ended. - EndTime *time.Time - - // The ID of the report. - ReportId *string - - // The name of the Amazon S3 bucket where the report is located. - S3Bucket *string - - // The prefix for your S3 object. - S3Prefix *string - - // The time when the report generation started. - StartTime *time.Time - - // The current status of the report. - Status ReportState - - // Any tags assigned to the report. - Tags []Tag - - // The root ID, organizational unit ID, or account ID. - // - // Format: - // - // - For root: r-ab12 - // - // - For OU: ou-ab12-cdef1234 - // - // - For account: 123456789012 - TargetId *string - - noSmithyDocumentSerde -} - -// Describes an EC2 Fleet error. -type DeleteFleetError struct { - - // The error code. - Code DeleteFleetErrorCode - - // The description for the error code. - Message *string - - noSmithyDocumentSerde -} - -// Describes an EC2 Fleet that was not successfully deleted. -type DeleteFleetErrorItem struct { - - // The error. - Error *DeleteFleetError - - // The ID of the EC2 Fleet. - FleetId *string - - noSmithyDocumentSerde -} - -// Describes an EC2 Fleet that was successfully deleted. -type DeleteFleetSuccessItem struct { - - // The current state of the EC2 Fleet. - CurrentFleetState FleetStateCode - - // The ID of the EC2 Fleet. - FleetId *string - - // The previous state of the EC2 Fleet. - PreviousFleetState FleetStateCode - - noSmithyDocumentSerde -} - -// Describes a launch template version that could not be deleted. -type DeleteLaunchTemplateVersionsResponseErrorItem struct { - - // The ID of the launch template. - LaunchTemplateId *string - - // The name of the launch template. - LaunchTemplateName *string - - // Information about the error. - ResponseError *ResponseError - - // The version number of the launch template. - VersionNumber *int64 - - noSmithyDocumentSerde -} - -// Describes a launch template version that was successfully deleted. -type DeleteLaunchTemplateVersionsResponseSuccessItem struct { - - // The ID of the launch template. - LaunchTemplateId *string - - // The name of the launch template. - LaunchTemplateName *string - - // The version number of the launch template. - VersionNumber *int64 - - noSmithyDocumentSerde -} - -// Describes the error for a Reserved Instance whose queued purchase could not be -// deleted. -type DeleteQueuedReservedInstancesError struct { - - // The error code. - Code DeleteQueuedReservedInstancesErrorCode - - // The error message. - Message *string - - noSmithyDocumentSerde -} - -// The snapshot ID and its deletion result code. -type DeleteSnapshotReturnCode struct { - - // The result code from the snapshot deletion attempt. Possible values: - // - // - success - The snapshot was successfully deleted. - // - // - skipped - The snapshot was not deleted because it's associated with other - // AMIs. - // - // - missing-permissions - The snapshot was not deleted because the role lacks - // DeleteSnapshot permissions. For more information, see [How Amazon EBS works with IAM]. - // - // - internal-error - The snapshot was not deleted due to a server error. - // - // - client-error - The snapshot was not deleted due to a client configuration - // error. - // - // For details about an error, check the DeleteSnapshot event in the CloudTrail - // event history. For more information, see [View event history]in the Amazon Web Services CloudTrail - // User Guide. - // - // [View event history]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/tutorial-event-history.html - // [How Amazon EBS works with IAM]: https://docs.aws.amazon.com/ebs/latest/userguide/security_iam_service-with-iam.html - ReturnCode SnapshotReturnCodes - - // The ID of the snapshot. - SnapshotId *string - - noSmithyDocumentSerde -} - -// Information about the tag keys to deregister for the current Region. You can -// either specify individual tag keys or deregister all tag keys in the current -// Region. You must specify either IncludeAllTagsOfInstance or InstanceTagKeys in -// the request -type DeregisterInstanceTagAttributeRequest struct { - - // Indicates whether to deregister all tag keys in the current Region. Specify - // false to deregister all tag keys. - IncludeAllTagsOfInstance *bool - - // Information about the tag keys to deregister. - InstanceTagKeys []string - - noSmithyDocumentSerde -} - -// Describe details about a Windows image with Windows fast launch enabled that -// meets the requested criteria. Criteria are defined by the -// DescribeFastLaunchImages action filters. -type DescribeFastLaunchImagesSuccessItem struct { - - // The image ID that identifies the Windows fast launch enabled image. - ImageId *string - - // The launch template that the Windows fast launch enabled AMI uses when it - // launches Windows instances from pre-provisioned snapshots. - LaunchTemplate *FastLaunchLaunchTemplateSpecificationResponse - - // The maximum number of instances that Amazon EC2 can launch at the same time to - // create pre-provisioned snapshots for Windows fast launch. - MaxParallelLaunches *int32 - - // The owner ID for the Windows fast launch enabled AMI. - OwnerId *string - - // The resource type that Amazon EC2 uses for pre-provisioning the Windows AMI. - // Supported values include: snapshot . - ResourceType FastLaunchResourceType - - // A group of parameters that are used for pre-provisioning the associated Windows - // AMI using snapshots. - SnapshotConfiguration *FastLaunchSnapshotConfigurationResponse - - // The current state of Windows fast launch for the specified Windows AMI. - State FastLaunchStateCode - - // The reason that Windows fast launch for the AMI changed to the current state. - StateTransitionReason *string - - // The time that Windows fast launch for the AMI changed to the current state. - StateTransitionTime *time.Time - - noSmithyDocumentSerde -} - -// Describes fast snapshot restores for a snapshot. -type DescribeFastSnapshotRestoreSuccessItem struct { - - // The Availability Zone. - AvailabilityZone *string - - // The time at which fast snapshot restores entered the disabled state. - DisabledTime *time.Time - - // The time at which fast snapshot restores entered the disabling state. - DisablingTime *time.Time - - // The time at which fast snapshot restores entered the enabled state. - EnabledTime *time.Time - - // The time at which fast snapshot restores entered the enabling state. - EnablingTime *time.Time - - // The time at which fast snapshot restores entered the optimizing state. - OptimizingTime *time.Time - - // The Amazon Web Services owner alias that enabled fast snapshot restores on the - // snapshot. This is intended for future use. - OwnerAlias *string - - // The ID of the Amazon Web Services account that enabled fast snapshot restores - // on the snapshot. - OwnerId *string - - // The ID of the snapshot. - SnapshotId *string - - // The state of fast snapshot restores. - State FastSnapshotRestoreStateCode - - // The reason for the state transition. The possible values are as follows: - // - // - Client.UserInitiated - The state successfully transitioned to enabling or - // disabling . - // - // - Client.UserInitiated - Lifecycle state transition - The state successfully - // transitioned to optimizing , enabled , or disabled . - StateTransitionReason *string - - noSmithyDocumentSerde -} - -// Describes the instances that could not be launched by the fleet. -type DescribeFleetError struct { - - // The error code that indicates why the instance could not be launched. For more - // information about error codes, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html - ErrorCode *string - - // The error message that describes why the instance could not be launched. For - // more information about error messages, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html - ErrorMessage *string - - // The launch templates and overrides that were used for launching the instances. - // The values that you specify in the Overrides replace the values in the launch - // template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse - - // Indicates if the instance that could not be launched was a Spot Instance or - // On-Demand Instance. - Lifecycle InstanceLifecycle - - noSmithyDocumentSerde -} - -// Describes the instances that were launched by the fleet. -type DescribeFleetsInstances struct { - - // The IDs of the instances. - InstanceIds []string - - // The instance type. - InstanceType InstanceType - - // The launch templates and overrides that were used for launching the instances. - // The values that you specify in the Overrides replace the values in the launch - // template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse - - // Indicates if the instance that was launched is a Spot Instance or On-Demand - // Instance. - Lifecycle InstanceLifecycle - - // The value is windows for Windows instances in an EC2 Fleet. Otherwise, the - // value is blank. - Platform PlatformValues - - noSmithyDocumentSerde -} - -// Describes the destination options for a flow log. -type DestinationOptionsRequest struct { - - // The format for the flow log. The default is plain-text . - FileFormat DestinationFileFormat - - // Indicates whether to use Hive-compatible prefixes for flow logs stored in - // Amazon S3. The default is false . - HiveCompatiblePartitions *bool - - // Indicates whether to partition the flow log per hour. This reduces the cost and - // response time for queries. The default is false . - PerHourPartition *bool - - noSmithyDocumentSerde -} - -// Describes the destination options for a flow log. -type DestinationOptionsResponse struct { - - // The format for the flow log. - FileFormat DestinationFileFormat - - // Indicates whether to use Hive-compatible prefixes for flow logs stored in - // Amazon S3. - HiveCompatiblePartitions *bool - - // Indicates whether to partition the flow log per hour. - PerHourPartition *bool - - noSmithyDocumentSerde -} - -// Describes the options for an Amazon Web Services Verified Access -// device-identity based trust provider. -type DeviceOptions struct { - - // The URL Amazon Web Services Verified Access will use to verify the - // authenticity of the device tokens. - PublicSigningKeyUrl *string - - // The ID of the tenant application with the device-identity provider. - TenantId *string - - noSmithyDocumentSerde -} - -// Describes a DHCP configuration option. -type DhcpConfiguration struct { - - // The name of a DHCP option. - Key *string - - // The values for the DHCP option. - Values []AttributeValue - - noSmithyDocumentSerde -} - -// The set of DHCP options. -type DhcpOptions struct { - - // The DHCP options in the set. - DhcpConfigurations []DhcpConfiguration - - // The ID of the set of DHCP options. - DhcpOptionsId *string - - // The ID of the Amazon Web Services account that owns the DHCP options set. - OwnerId *string - - // Any tags assigned to the DHCP options set. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an Active Directory. -type DirectoryServiceAuthentication struct { - - // The ID of the Active Directory used for authentication. - DirectoryId *string - - noSmithyDocumentSerde -} - -// Describes the Active Directory to be used for client authentication. -type DirectoryServiceAuthenticationRequest struct { - - // The ID of the Active Directory to be used for authentication. - DirectoryId *string - - noSmithyDocumentSerde -} - -// Contains information about the errors that occurred when disabling fast -// snapshot restores. -type DisableFastSnapshotRestoreErrorItem struct { - - // The errors. - FastSnapshotRestoreStateErrors []DisableFastSnapshotRestoreStateErrorItem - - // The ID of the snapshot. - SnapshotId *string - - noSmithyDocumentSerde -} - -// Describes an error that occurred when disabling fast snapshot restores. -type DisableFastSnapshotRestoreStateError struct { - - // The error code. - Code *string - - // The error message. - Message *string - - noSmithyDocumentSerde -} - -// Contains information about an error that occurred when disabling fast snapshot -// restores. -type DisableFastSnapshotRestoreStateErrorItem struct { - - // The Availability Zone. - AvailabilityZone *string - - // The error. - Error *DisableFastSnapshotRestoreStateError - - noSmithyDocumentSerde -} - -// Describes fast snapshot restores that were successfully disabled. -type DisableFastSnapshotRestoreSuccessItem struct { - - // The Availability Zone. - AvailabilityZone *string - - // The time at which fast snapshot restores entered the disabled state. - DisabledTime *time.Time - - // The time at which fast snapshot restores entered the disabling state. - DisablingTime *time.Time - - // The time at which fast snapshot restores entered the enabled state. - EnabledTime *time.Time - - // The time at which fast snapshot restores entered the enabling state. - EnablingTime *time.Time - - // The time at which fast snapshot restores entered the optimizing state. - OptimizingTime *time.Time - - // The Amazon Web Services owner alias that enabled fast snapshot restores on the - // snapshot. This is intended for future use. - OwnerAlias *string - - // The ID of the Amazon Web Services account that enabled fast snapshot restores - // on the snapshot. - OwnerId *string - - // The ID of the snapshot. - SnapshotId *string - - // The state of fast snapshot restores for the snapshot. - State FastSnapshotRestoreStateCode - - // The reason for the state transition. The possible values are as follows: - // - // - Client.UserInitiated - The state successfully transitioned to enabling or - // disabling . - // - // - Client.UserInitiated - Lifecycle state transition - The state successfully - // transitioned to optimizing , enabled , or disabled . - StateTransitionReason *string - - noSmithyDocumentSerde -} - -// Describes a disk image. -type DiskImage struct { - - // A description of the disk image. - Description *string - - // Information about the disk image. - Image *DiskImageDetail - - // Information about the volume. - Volume *VolumeDetail - - noSmithyDocumentSerde -} - -// Describes a disk image. -type DiskImageDescription struct { - - // The checksum computed for the disk image. - Checksum *string - - // The disk image format. - Format DiskImageFormat - - // A presigned URL for the import manifest stored in Amazon S3. For information - // about creating a presigned URL for an Amazon S3 object, read the "Query String - // Request Authentication Alternative" section of the [Authenticating REST Requests]topic in the Amazon Simple - // Storage Service Developer Guide. - // - // For information about the import manifest referenced by this API action, see [VM Import Manifest]. - // - // [Authenticating REST Requests]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - // [VM Import Manifest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html - ImportManifestUrl *string - - // The size of the disk image, in GiB. - Size *int64 - - noSmithyDocumentSerde -} - -// Describes a disk image. -type DiskImageDetail struct { - - // The size of the disk image, in GiB. - // - // This member is required. - Bytes *int64 - - // The disk image format. - // - // This member is required. - Format DiskImageFormat - - // A presigned URL for the import manifest stored in Amazon S3 and presented here - // as an Amazon S3 presigned URL. For information about creating a presigned URL - // for an Amazon S3 object, read the "Query String Request Authentication - // Alternative" section of the [Authenticating REST Requests]topic in the Amazon Simple Storage Service - // Developer Guide. - // - // For information about the import manifest referenced by this API action, see [VM Import Manifest]. - // - // [Authenticating REST Requests]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - // [VM Import Manifest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html - // - // This member is required. - ImportManifestUrl *string - - noSmithyDocumentSerde -} - -// Describes a disk image volume. -type DiskImageVolumeDescription struct { - - // The volume identifier. - Id *string - - // The size of the volume, in GiB. - Size *int64 - - noSmithyDocumentSerde -} - -// Describes a disk. -type DiskInfo struct { - - // The number of disks with this configuration. - Count *int32 - - // The size of the disk in GB. - SizeInGB *int64 - - // The type of disk. - Type DiskType - - noSmithyDocumentSerde -} - -// Describes a DNS entry. -type DnsEntry struct { - - // The DNS name. - DnsName *string - - // The ID of the private hosted zone. - HostedZoneId *string - - noSmithyDocumentSerde -} - -// Describes the DNS options for an endpoint. -type DnsOptions struct { - - // The DNS records created for the endpoint. - DnsRecordIpType DnsRecordIpType - - // Indicates whether to enable private DNS only for inbound endpoints. - PrivateDnsOnlyForInboundResolverEndpoint *bool - - noSmithyDocumentSerde -} - -// Describes the DNS options for an endpoint. -type DnsOptionsSpecification struct { - - // The DNS records created for the endpoint. - DnsRecordIpType DnsRecordIpType - - // Indicates whether to enable private DNS only for inbound endpoints. This option - // is available only for services that support both gateway and interface - // endpoints. It routes traffic that originates from the VPC to the gateway - // endpoint and traffic that originates from on-premises to the interface endpoint. - PrivateDnsOnlyForInboundResolverEndpoint *bool - - noSmithyDocumentSerde -} - -// Information about the DNS server to be used. -type DnsServersOptionsModifyStructure struct { - - // The IPv4 address range, in CIDR notation, of the DNS servers to be used. You - // can specify up to two DNS servers. Ensure that the DNS servers can be reached by - // the clients. The specified values overwrite the existing values. - CustomDnsServers []string - - // Indicates whether DNS servers should be used. Specify False to delete the - // existing DNS servers. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes a block device for an EBS volume. -type EbsBlockDevice struct { - - // The Availability Zone where the EBS volume will be created (for example, - // us-east-1a ). - // - // Either AvailabilityZone or AvailabilityZoneId can be specified, but not both. - // If neither is specified, Amazon EC2 automatically selects an Availability Zone - // within the Region. - // - // This parameter is not supported when using [CreateImage], [DescribeImages], and [RunInstances]. - // - // [DescribeImages]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - AvailabilityZone *string - - // The ID of the Availability Zone where the EBS volume will be created (for - // example, use1-az1 ). - // - // Either AvailabilityZone or AvailabilityZoneId can be specified, but not both. - // If neither is specified, Amazon EC2 automatically selects an Availability Zone - // within the Region. - // - // This parameter is not supported when using [CreateImage], [DescribeImages], and [RunInstances]. - // - // [DescribeImages]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - AvailabilityZoneId *string - - // Indicates whether the EBS volume is deleted on instance termination. For more - // information, see [Preserving Amazon EBS volumes on instance termination]in the Amazon EC2 User Guide. - // - // [Preserving Amazon EBS volumes on instance termination]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination - DeleteOnTermination *bool - - // Indicates whether the encryption state of an EBS volume is changed while being - // restored from a backing snapshot. The effect of setting the encryption state to - // true depends on the volume origin (new or from a snapshot), starting encryption - // state, ownership, and whether encryption by default is enabled. For more - // information, see [Amazon EBS encryption]in the Amazon EBS User Guide. - // - // In no case can you remove encryption from an encrypted volume. - // - // Encrypted volumes can only be attached to instances that support Amazon EBS - // encryption. For more information, see [Supported instance types]. - // - // This parameter is not returned by DescribeImageAttribute. - // - // For CreateImage and RegisterImage, whether you can include this parameter, and the allowed values - // differ depending on the type of block device mapping you are creating. - // - // - If you are creating a block device mapping for a new (empty) volume, you - // can include this parameter, and specify either true for an encrypted volume, - // or false for an unencrypted volume. If you omit this parameter, it defaults to - // false (unencrypted). - // - // - If you are creating a block device mapping from an existing encrypted or - // unencrypted snapshot, you must omit this parameter. If you include this - // parameter, the request will fail, regardless of the value that you specify. - // - // - If you are creating a block device mapping from an existing unencrypted - // volume, you can include this parameter, but you must specify false . If you - // specify true , the request will fail. In this case, we recommend that you omit - // the parameter. - // - // - If you are creating a block device mapping from an existing encrypted - // volume, you can include this parameter, and specify either true or false . - // However, if you specify false , the parameter is ignored and the block device - // mapping is always encrypted. In this case, we recommend that you omit the - // parameter. - // - // [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html#encryption-parameters - // [Supported instance types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances - Encrypted *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - // - // The following are the supported values for each volume type: - // - // - gp3 : 3,000 - 16,000 IOPS - // - // - io1 : 100 - 64,000 IOPS - // - // - io2 : 100 - 256,000 IOPS - // - // For io2 volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System]. On other instances, - // you can achieve performance up to 32,000 IOPS. - // - // This parameter is required for io1 and io2 volumes. The default for gp3 volumes - // is 3,000 IOPS. - // - // [instances built on the Nitro System]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances - Iops *int32 - - // Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed - // KMS key to use for EBS encryption. - // - // This parameter is only supported on BlockDeviceMapping objects called by [RunInstances], [RequestSpotFleet], - // and [RequestSpotInstances]. - // - // [RequestSpotInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - // [RequestSpotFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html - KmsKeyId *string - - // The ARN of the Outpost on which the snapshot is stored. - // - // This parameter is not supported when using [CreateImage]. - // - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - OutpostArn *string - - // The ID of the snapshot. - SnapshotId *string - - // The throughput that the volume supports, in MiB/s. - // - // This parameter is valid only for gp3 volumes. - // - // Valid Range: Minimum value of 125. Maximum value of 1000. - Throughput *int32 - - // Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate), in MiB/s, at which to download the snapshot blocks from - // Amazon S3 to the volume. This is also known as volume initialization. Specifying - // a volume initialization rate ensures that the volume is initialized at a - // predictable and consistent rate after creation. - // - // This parameter is supported only for volumes created from snapshots. Omit this - // parameter if: - // - // - You want to create the volume using fast snapshot restore. You must specify - // a snapshot that is enabled for fast snapshot restore. In this case, the volume - // is fully initialized at creation. - // - // If you specify a snapshot that is enabled for fast snapshot restore and a - // volume initialization rate, the volume will be initialized at the specified rate - // instead of fast snapshot restore. - // - // - You want to create a volume that is initialized at the default rate. - // - // For more information, see [Initialize Amazon EBS volumes] in the Amazon EC2 User Guide. - // - // This parameter is not supported when using [CreateImage]. - // - // Valid range: 100 - 300 MiB/s - // - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - VolumeInitializationRate *int32 - - // The size of the volume, in GiBs. You must specify either a snapshot ID or a - // volume size. If you specify a snapshot, the default is the snapshot size. You - // can specify a volume size that is equal to or larger than the snapshot size. - // - // The following are the supported sizes for each volume type: - // - // - gp2 and gp3 : 1 - 16,384 GiB - // - // - io1 : 4 - 16,384 GiB - // - // - io2 : 4 - 65,536 GiB - // - // - st1 and sc1 : 125 - 16,384 GiB - // - // - standard : 1 - 1024 GiB - VolumeSize *int32 - - // The volume type. For more information, see [Amazon EBS volume types] in the Amazon EBS User Guide. - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// Describes a block device for an EBS volume. -type EbsBlockDeviceResponse struct { - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool - - // Indicates whether the volume is encrypted. - Encrypted *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - Iops *int32 - - // Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed - // KMS key to use for EBS encryption. - KmsKeyId *string - - // The ID of the snapshot. - SnapshotId *string - - // The throughput that the volume supports, in MiB/s. - Throughput *int32 - - // The size of the volume, in GiBs. - VolumeSize *int32 - - // The volume type. For more information, see [Amazon EBS volume types] in the Amazon EBS User Guide. - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// Describes the Amazon EBS features supported by the instance type. -type EbsInfo struct { - - // Describes the optimized EBS performance for the instance type. - EbsOptimizedInfo *EbsOptimizedInfo - - // Indicates whether the instance type is Amazon EBS-optimized. For more - // information, see [Amazon EBS-optimized instances]in Amazon EC2 User Guide. - // - // [Amazon EBS-optimized instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html - EbsOptimizedSupport EbsOptimizedSupport - - // Indicates whether Amazon EBS encryption is supported. - EncryptionSupport EbsEncryptionSupport - - // Indicates whether non-volatile memory express (NVMe) is supported. - NvmeSupport EbsNvmeSupport - - noSmithyDocumentSerde -} - -// Describes a parameter used to set up an EBS volume in a block device mapping. -type EbsInstanceBlockDevice struct { - - // The ARN of the Amazon Web Services-managed resource to which the volume is - // attached. - AssociatedResource *string - - // The time stamp when the attachment initiated. - AttachTime *time.Time - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool - - // The service provider that manages the EBS volume. - Operator *OperatorResponse - - // The attachment state. - Status AttachmentStatus - - // The ID of the EBS volume. - VolumeId *string - - // The ID of the Amazon Web Services account that owns the volume. - // - // This parameter is returned only for volumes that are attached to Amazon Web - // Services-managed resources. - VolumeOwnerId *string - - noSmithyDocumentSerde -} - -// Describes information used to set up an EBS volume specified in a block device -// mapping. -type EbsInstanceBlockDeviceSpecification struct { - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool - - // The ID of the EBS volume. - VolumeId *string - - noSmithyDocumentSerde -} - -// Describes the optimized EBS performance for supported instance types. -type EbsOptimizedInfo struct { - - // The baseline bandwidth performance for an EBS-optimized instance type, in Mbps. - BaselineBandwidthInMbps *int32 - - // The baseline input/output storage operations per seconds for an EBS-optimized - // instance type. - BaselineIops *int32 - - // The baseline throughput performance for an EBS-optimized instance type, in MB/s. - BaselineThroughputInMBps *float64 - - // The maximum bandwidth performance for an EBS-optimized instance type, in Mbps. - MaximumBandwidthInMbps *int32 - - // The maximum input/output storage operations per second for an EBS-optimized - // instance type. - MaximumIops *int32 - - // The maximum throughput performance for an EBS-optimized instance type, in MB/s. - MaximumThroughputInMBps *float64 - - noSmithyDocumentSerde -} - -// Describes the attached EBS status check for an instance. -type EbsStatusDetails struct { - - // The date and time when the attached EBS status check failed. - ImpairedSince *time.Time - - // The name of the attached EBS status check. - Name StatusName - - // The result of the attached EBS status check. - Status StatusType - - noSmithyDocumentSerde -} - -// Provides a summary of the attached EBS volume status for an instance. -type EbsStatusSummary struct { - - // Details about the attached EBS status check for an instance. - Details []EbsStatusDetails - - // The current status. - Status SummaryStatus - - noSmithyDocumentSerde -} - -// The EC2 Instance Connect Endpoint. -type Ec2InstanceConnectEndpoint struct { - - // The Availability Zone of the EC2 Instance Connect Endpoint. - AvailabilityZone *string - - // The date and time that the EC2 Instance Connect Endpoint was created. - CreatedAt *time.Time - - // The DNS name of the EC2 Instance Connect Endpoint. - DnsName *string - - // The Federal Information Processing Standards (FIPS) compliant DNS name of the - // EC2 Instance Connect Endpoint. - FipsDnsName *string - - // The Amazon Resource Name (ARN) of the EC2 Instance Connect Endpoint. - InstanceConnectEndpointArn *string - - // The ID of the EC2 Instance Connect Endpoint. - InstanceConnectEndpointId *string - - // The IP address type of the endpoint. - IpAddressType IpAddressType - - // The ID of the elastic network interface that Amazon EC2 automatically created - // when creating the EC2 Instance Connect Endpoint. - NetworkInterfaceIds []string - - // The ID of the Amazon Web Services account that created the EC2 Instance Connect - // Endpoint. - OwnerId *string - - // Indicates whether your client's IP address is preserved as the source. The - // value is true or false . - // - // - If true , your client's IP address is used when you connect to a resource. - // - // - If false , the elastic network interface IP address is used when you connect - // to a resource. - // - // Default: true - PreserveClientIp *bool - - // The security groups associated with the endpoint. If you didn't specify a - // security group, the default security group for your VPC is associated with the - // endpoint. - SecurityGroupIds []string - - // The current state of the EC2 Instance Connect Endpoint. - State Ec2InstanceConnectEndpointState - - // The message for the current state of the EC2 Instance Connect Endpoint. Can - // include a failure message. - StateMessage *string - - // The ID of the subnet in which the EC2 Instance Connect Endpoint was created. - SubnetId *string - - // The tags assigned to the EC2 Instance Connect Endpoint. - Tags []Tag - - // The ID of the VPC in which the EC2 Instance Connect Endpoint was created. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes the Elastic Fabric Adapters for the instance type. -type EfaInfo struct { - - // The maximum number of Elastic Fabric Adapters for the instance type. - MaximumEfaInterfaces *int32 - - noSmithyDocumentSerde -} - -// Describes an egress-only internet gateway. -type EgressOnlyInternetGateway struct { - - // Information about the attachment of the egress-only internet gateway. - Attachments []InternetGatewayAttachment - - // The ID of the egress-only internet gateway. - EgressOnlyInternetGatewayId *string - - // The tags assigned to the egress-only internet gateway. - Tags []Tag - - noSmithyDocumentSerde -} - -// Amazon Elastic Graphics reached end of life on January 8, 2024. -// -// Describes the association between an instance and an Elastic Graphics -// accelerator. -type ElasticGpuAssociation struct { - - // The ID of the association. - ElasticGpuAssociationId *string - - // The state of the association between the instance and the Elastic Graphics - // accelerator. - ElasticGpuAssociationState *string - - // The time the Elastic Graphics accelerator was associated with the instance. - ElasticGpuAssociationTime *string - - // The ID of the Elastic Graphics accelerator. - ElasticGpuId *string - - noSmithyDocumentSerde -} - -// Amazon Elastic Graphics reached end of life on January 8, 2024. -// -// Describes the status of an Elastic Graphics accelerator. -type ElasticGpuHealth struct { - - // The health status. - Status ElasticGpuStatus - - noSmithyDocumentSerde -} - -// Amazon Elastic Graphics reached end of life on January 8, 2024. -// -// Describes an Elastic Graphics accelerator. -type ElasticGpus struct { - - // The Availability Zone in the which the Elastic Graphics accelerator resides. - AvailabilityZone *string - - // The status of the Elastic Graphics accelerator. - ElasticGpuHealth *ElasticGpuHealth - - // The ID of the Elastic Graphics accelerator. - ElasticGpuId *string - - // The state of the Elastic Graphics accelerator. - ElasticGpuState ElasticGpuState - - // The type of Elastic Graphics accelerator. - ElasticGpuType *string - - // The ID of the instance to which the Elastic Graphics accelerator is attached. - InstanceId *string - - // The tags assigned to the Elastic Graphics accelerator. - Tags []Tag - - noSmithyDocumentSerde -} - -// Amazon Elastic Graphics reached end of life on January 8, 2024. -// -// A specification for an Elastic Graphics accelerator. -type ElasticGpuSpecification struct { - - // The type of Elastic Graphics accelerator. - // - // This member is required. - Type *string - - noSmithyDocumentSerde -} - -// Deprecated. -// -// Amazon Elastic Graphics reached end of life on January 8, 2024. -type ElasticGpuSpecificationResponse struct { - - // Deprecated. - // - // Amazon Elastic Graphics reached end of life on January 8, 2024. - Type *string - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes an elastic inference accelerator. -type ElasticInferenceAccelerator struct { - - // The type of elastic inference accelerator. The possible values are eia1.medium - // , eia1.large , eia1.xlarge , eia2.medium , eia2.large , and eia2.xlarge . - // - // This member is required. - Type *string - - // The number of elastic inference accelerators to attach to the instance. - // - // Default: 1 - Count *int32 - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes the association between an instance and an elastic inference -// accelerator. -type ElasticInferenceAcceleratorAssociation struct { - - // The Amazon Resource Name (ARN) of the elastic inference accelerator. - ElasticInferenceAcceleratorArn *string - - // The ID of the association. - ElasticInferenceAcceleratorAssociationId *string - - // The state of the elastic inference accelerator. - ElasticInferenceAcceleratorAssociationState *string - - // The time at which the elastic inference accelerator is associated with an - // instance. - ElasticInferenceAcceleratorAssociationTime *time.Time - - noSmithyDocumentSerde -} - -// Contains information about the errors that occurred when enabling fast snapshot -// restores. -type EnableFastSnapshotRestoreErrorItem struct { - - // The errors. - FastSnapshotRestoreStateErrors []EnableFastSnapshotRestoreStateErrorItem - - // The ID of the snapshot. - SnapshotId *string - - noSmithyDocumentSerde -} - -// Describes an error that occurred when enabling fast snapshot restores. -type EnableFastSnapshotRestoreStateError struct { - - // The error code. - Code *string - - // The error message. - Message *string - - noSmithyDocumentSerde -} - -// Contains information about an error that occurred when enabling fast snapshot -// restores. -type EnableFastSnapshotRestoreStateErrorItem struct { - - // The Availability Zone. - AvailabilityZone *string - - // The error. - Error *EnableFastSnapshotRestoreStateError - - noSmithyDocumentSerde -} - -// Describes fast snapshot restores that were successfully enabled. -type EnableFastSnapshotRestoreSuccessItem struct { - - // The Availability Zone. - AvailabilityZone *string - - // The time at which fast snapshot restores entered the disabled state. - DisabledTime *time.Time - - // The time at which fast snapshot restores entered the disabling state. - DisablingTime *time.Time - - // The time at which fast snapshot restores entered the enabled state. - EnabledTime *time.Time - - // The time at which fast snapshot restores entered the enabling state. - EnablingTime *time.Time - - // The time at which fast snapshot restores entered the optimizing state. - OptimizingTime *time.Time - - // The Amazon Web Services owner alias that enabled fast snapshot restores on the - // snapshot. This is intended for future use. - OwnerAlias *string - - // The ID of the Amazon Web Services account that enabled fast snapshot restores - // on the snapshot. - OwnerId *string - - // The ID of the snapshot. - SnapshotId *string - - // The state of fast snapshot restores. - State FastSnapshotRestoreStateCode - - // The reason for the state transition. The possible values are as follows: - // - // - Client.UserInitiated - The state successfully transitioned to enabling or - // disabling . - // - // - Client.UserInitiated - Lifecycle state transition - The state successfully - // transitioned to optimizing , enabled , or disabled . - StateTransitionReason *string - - noSmithyDocumentSerde -} - -// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) -// technology to increase the maximum bandwidth used per stream and minimize tail -// latency of network traffic between EC2 instances. With ENA Express, you can -// communicate between two EC2 instances in the same subnet within the same -// account, or in different accounts. Both sending and receiving instances must -// have ENA Express enabled. -// -// To improve the reliability of network packet delivery, ENA Express reorders -// network packets on the receiving end by default. However, some UDP-based -// applications are designed to handle network packets that are out of order to -// reduce the overhead for packet delivery at the network layer. When ENA Express -// is enabled, you can specify whether UDP network traffic uses it. -type EnaSrdSpecification struct { - - // Indicates whether ENA Express is enabled for the network interface. - EnaSrdEnabled *bool - - // Configures ENA Express for UDP network traffic. - EnaSrdUdpSpecification *EnaSrdUdpSpecification - - noSmithyDocumentSerde -} - -// Launch instances with ENA Express settings configured from your launch template. -type EnaSrdSpecificationRequest struct { - - // Specifies whether ENA Express is enabled for the network interface when you - // launch an instance. - EnaSrdEnabled *bool - - // Contains ENA Express settings for UDP network traffic for the network interface - // attached to the instance. - EnaSrdUdpSpecification *EnaSrdUdpSpecificationRequest - - noSmithyDocumentSerde -} - -// ENA Express is compatible with both TCP and UDP transport protocols. When it's -// enabled, TCP traffic automatically uses it. However, some UDP-based applications -// are designed to handle network packets that are out of order, without a need for -// retransmission, such as live video broadcasting or other near-real-time -// applications. For UDP traffic, you can specify whether to use ENA Express, based -// on your application environment needs. -type EnaSrdUdpSpecification struct { - - // Indicates whether UDP traffic to and from the instance uses ENA Express. To - // specify this setting, you must first enable ENA Express. - EnaSrdUdpEnabled *bool - - noSmithyDocumentSerde -} - -// Configures ENA Express for UDP network traffic from your launch template. -type EnaSrdUdpSpecificationRequest struct { - - // Indicates whether UDP traffic uses ENA Express for your instance. To ensure - // that UDP traffic can use ENA Express when you launch an instance, you must also - // set EnaSrdEnabled in the EnaSrdSpecificationRequest to true . - EnaSrdUdpEnabled *bool - - noSmithyDocumentSerde -} - -// Indicates whether the instance is enabled for Amazon Web Services Nitro -// Enclaves. -type EnclaveOptions struct { - - // If this parameter is set to true , the instance is enabled for Amazon Web - // Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services - // Nitro Enclaves. - Enabled *bool - - noSmithyDocumentSerde -} - -// Indicates whether the instance is enabled for Amazon Web Services Nitro -// Enclaves. For more information, see [What is Amazon Web Services Nitro Enclaves?]in the Amazon Web Services Nitro Enclaves -// User Guide. -// -// [What is Amazon Web Services Nitro Enclaves?]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html -type EnclaveOptionsRequest struct { - - // To enable the instance for Amazon Web Services Nitro Enclaves, set this - // parameter to true . - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes an EC2 Fleet or Spot Fleet event. -type EventInformation struct { - - // The description of the event. - EventDescription *string - - // The event. - // - // error events: - // - // - iamFleetRoleInvalid - The EC2 Fleet or Spot Fleet does not have the required - // permissions either to launch or terminate an instance. - // - // - allLaunchSpecsTemporarilyBlacklisted - None of the configurations are valid, - // and several attempts to launch instances have failed. For more information, see - // the description of the event. - // - // - spotInstanceCountLimitExceeded - You've reached the limit on the number of - // Spot Instances that you can launch. - // - // - spotFleetRequestConfigurationInvalid - The configuration is not valid. For - // more information, see the description of the event. - // - // fleetRequestChange events: - // - // - active - The EC2 Fleet or Spot Fleet request has been validated and Amazon - // EC2 is attempting to maintain the target number of running instances. - // - // - deleted (EC2 Fleet) / cancelled (Spot Fleet) - The EC2 Fleet is deleted or - // the Spot Fleet request is canceled and has no running instances. The EC2 Fleet - // or Spot Fleet will be deleted two days after its instances are terminated. - // - // - deleted_running (EC2 Fleet) / cancelled_running (Spot Fleet) - The EC2 Fleet - // is deleted or the Spot Fleet request is canceled and does not launch additional - // instances. Its existing instances continue to run until they are interrupted or - // terminated. The request remains in this state until all instances are - // interrupted or terminated. - // - // - deleted_terminating (EC2 Fleet) / cancelled_terminating (Spot Fleet) - The - // EC2 Fleet is deleted or the Spot Fleet request is canceled and its instances are - // terminating. The request remains in this state until all instances are - // terminated. - // - // - expired - The EC2 Fleet or Spot Fleet request has expired. If the request - // was created with TerminateInstancesWithExpiration set, a subsequent terminated - // event indicates that the instances are terminated. - // - // - modify_in_progress - The EC2 Fleet or Spot Fleet request is being modified. - // The request remains in this state until the modification is fully processed. - // - // - modify_succeeded - The EC2 Fleet or Spot Fleet request was modified. - // - // - submitted - The EC2 Fleet or Spot Fleet request is being evaluated and - // Amazon EC2 is preparing to launch the target number of instances. - // - // - progress - The EC2 Fleet or Spot Fleet request is in the process of being - // fulfilled. - // - // instanceChange events: - // - // - launched - A new instance was launched. - // - // - terminated - An instance was terminated by the user. - // - // - termination_notified - An instance termination notification was sent when a - // Spot Instance was terminated by Amazon EC2 during scale-down, when the target - // capacity of the fleet was modified down, for example, from a target capacity of - // 4 to a target capacity of 3. - // - // Information events: - // - // - fleetProgressHalted - The price in every launch specification is not valid - // because it is below the Spot price (all the launch specifications have produced - // launchSpecUnusable events). A launch specification might become valid if the - // Spot price changes. - // - // - launchSpecTemporarilyBlacklisted - The configuration is not valid and - // several attempts to launch instances have failed. For more information, see the - // description of the event. - // - // - launchSpecUnusable - The price specified in a launch specification is not - // valid because it is below the Spot price for the requested Spot pools. - // - // Note: Even if a fleet with the maintain request type is in the process of being - // canceled, it may still publish a launchSpecUnusable event. This does not mean - // that the canceled fleet is attempting to launch a new instance. - // - // - registerWithLoadBalancersFailed - An attempt to register instances with load - // balancers failed. For more information, see the description of the event. - EventSubType *string - - // The ID of the instance. This information is available only for instanceChange - // events. - InstanceId *string - - noSmithyDocumentSerde -} - -// Describes an explanation code for an unreachable path. For more information, -// see [Reachability Analyzer explanation codes]. -// -// [Reachability Analyzer explanation codes]: https://docs.aws.amazon.com/vpc/latest/reachability/explanation-codes.html -type Explanation struct { - - // The network ACL. - Acl *AnalysisComponent - - // The network ACL rule. - AclRule *AnalysisAclRule - - // The IPv4 address, in CIDR notation. - Address *string - - // The IPv4 addresses, in CIDR notation. - Addresses []string - - // The resource to which the component is attached. - AttachedTo *AnalysisComponent - - // The IDs of the Availability Zones. - AvailabilityZoneIds []string - - // The Availability Zones. - AvailabilityZones []string - - // The CIDR ranges. - Cidrs []string - - // The listener for a Classic Load Balancer. - ClassicLoadBalancerListener *AnalysisLoadBalancerListener - - // The component. - Component *AnalysisComponent - - // The Amazon Web Services account for the component. - ComponentAccount *string - - // The Region for the component. - ComponentRegion *string - - // The customer gateway. - CustomerGateway *AnalysisComponent - - // The destination. - Destination *AnalysisComponent - - // The destination VPC. - DestinationVpc *AnalysisComponent - - // The direction. The following are the possible values: - // - // - egress - // - // - ingress - Direction *string - - // The load balancer listener. - ElasticLoadBalancerListener *AnalysisComponent - - // The explanation code. - ExplanationCode *string - - // The Network Firewall stateful rule. - FirewallStatefulRule *FirewallStatefulRule - - // The Network Firewall stateless rule. - FirewallStatelessRule *FirewallStatelessRule - - // The route table. - IngressRouteTable *AnalysisComponent - - // The internet gateway. - InternetGateway *AnalysisComponent - - // The Amazon Resource Name (ARN) of the load balancer. - LoadBalancerArn *string - - // The listener port of the load balancer. - LoadBalancerListenerPort *int32 - - // The target. - LoadBalancerTarget *AnalysisLoadBalancerTarget - - // The target group. - LoadBalancerTargetGroup *AnalysisComponent - - // The target groups. - LoadBalancerTargetGroups []AnalysisComponent - - // The target port. - LoadBalancerTargetPort *int32 - - // The missing component. - MissingComponent *string - - // The NAT gateway. - NatGateway *AnalysisComponent - - // The network interface. - NetworkInterface *AnalysisComponent - - // The packet field. - PacketField *string - - // The port. - Port *int32 - - // The port ranges. - PortRanges []PortRange - - // The prefix list. - PrefixList *AnalysisComponent - - // The protocols. - Protocols []string - - // The route table. - RouteTable *AnalysisComponent - - // The route table route. - RouteTableRoute *AnalysisRouteTableRoute - - // The security group. - SecurityGroup *AnalysisComponent - - // The security group rule. - SecurityGroupRule *AnalysisSecurityGroupRule - - // The security groups. - SecurityGroups []AnalysisComponent - - // The source VPC. - SourceVpc *AnalysisComponent - - // The state. - State *string - - // The subnet. - Subnet *AnalysisComponent - - // The route table for the subnet. - SubnetRouteTable *AnalysisComponent - - // The transit gateway. - TransitGateway *AnalysisComponent - - // The transit gateway attachment. - TransitGatewayAttachment *AnalysisComponent - - // The transit gateway route table. - TransitGatewayRouteTable *AnalysisComponent - - // The transit gateway route table route. - TransitGatewayRouteTableRoute *TransitGatewayRouteTableRoute - - // The component VPC. - Vpc *AnalysisComponent - - // The VPC endpoint. - VpcEndpoint *AnalysisComponent - - // The VPC peering connection. - VpcPeeringConnection *AnalysisComponent - - // The VPN connection. - VpnConnection *AnalysisComponent - - // The VPN gateway. - VpnGateway *AnalysisComponent - - noSmithyDocumentSerde -} - -// Describes an export image task. -type ExportImageTask struct { - - // A description of the image being exported. - Description *string - - // The ID of the export image task. - ExportImageTaskId *string - - // The ID of the image. - ImageId *string - - // The percent complete of the export image task. - Progress *string - - // Information about the destination Amazon S3 bucket. - S3ExportLocation *ExportTaskS3Location - - // The status of the export image task. The possible values are active , completed - // , deleting , and deleted . - Status *string - - // The status message for the export image task. - StatusMessage *string - - // Any tags assigned to the export image task. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an export instance task. -type ExportTask struct { - - // A description of the resource being exported. - Description *string - - // The ID of the export task. - ExportTaskId *string - - // Information about the export task. - ExportToS3Task *ExportToS3Task - - // Information about the instance to export. - InstanceExportDetails *InstanceExportDetails - - // The state of the export task. - State ExportTaskState - - // The status message related to the export task. - StatusMessage *string - - // The tags for the export task. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the destination for an export image task. -type ExportTaskS3Location struct { - - // The destination Amazon S3 bucket. - S3Bucket *string - - // The prefix (logical hierarchy) in the bucket. - S3Prefix *string - - noSmithyDocumentSerde -} - -// Describes the destination for an export image task. -type ExportTaskS3LocationRequest struct { - - // The destination Amazon S3 bucket. - // - // This member is required. - S3Bucket *string - - // The prefix (logical hierarchy) in the bucket. - S3Prefix *string - - noSmithyDocumentSerde -} - -// Describes the format and location for the export task. -type ExportToS3Task struct { - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat ContainerFormat - - // The format for the exported image. - DiskImageFormat DiskImageFormat - - // The Amazon S3 bucket for the destination image. The destination bucket must - // exist and have an access control list (ACL) attached that specifies the - // Region-specific canonical account ID for the Grantee . For more information - // about the ACL to your S3 bucket, see [Prerequisites]in the VM Import/Export User Guide. - // - // [Prerequisites]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html#vmexport-prerequisites - S3Bucket *string - - // The encryption key for your S3 bucket. - S3Key *string - - noSmithyDocumentSerde -} - -// Describes an export instance task. -type ExportToS3TaskSpecification struct { - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat ContainerFormat - - // The format for the exported image. - DiskImageFormat DiskImageFormat - - // The Amazon S3 bucket for the destination image. The destination bucket must - // exist and have an access control list (ACL) attached that specifies the - // Region-specific canonical account ID for the Grantee . For more information - // about the ACL to your S3 bucket, see [Prerequisites]in the VM Import/Export User Guide. - // - // [Prerequisites]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html#vmexport-prerequisites - S3Bucket *string - - // The image is written to a single object in the Amazon S3 bucket at the S3 key - // s3prefix + exportTaskId + '.' + diskImageFormat. - S3Prefix *string - - noSmithyDocumentSerde -} - -// Describes a Capacity Reservation Fleet that could not be cancelled. -type FailedCapacityReservationFleetCancellationResult struct { - - // Information about the Capacity Reservation Fleet cancellation error. - CancelCapacityReservationFleetError *CancelCapacityReservationFleetError - - // The ID of the Capacity Reservation Fleet that could not be cancelled. - CapacityReservationFleetId *string - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance whose queued purchase was not deleted. -type FailedQueuedPurchaseDeletion struct { - - // The error. - Error *DeleteQueuedReservedInstancesError - - // The ID of the Reserved Instance. - ReservedInstancesId *string - - noSmithyDocumentSerde -} - -// Request to create a launch template for a Windows fast launch enabled AMI. -// -// Note - You can specify either the LaunchTemplateName or the LaunchTemplateId , -// but not both. -type FastLaunchLaunchTemplateSpecificationRequest struct { - - // Specify the version of the launch template that the AMI should use for Windows - // fast launch. - // - // This member is required. - Version *string - - // Specify the ID of the launch template that the AMI should use for Windows fast - // launch. - LaunchTemplateId *string - - // Specify the name of the launch template that the AMI should use for Windows - // fast launch. - LaunchTemplateName *string - - noSmithyDocumentSerde -} - -// Identifies the launch template that the AMI uses for Windows fast launch. -type FastLaunchLaunchTemplateSpecificationResponse struct { - - // The ID of the launch template that the AMI uses for Windows fast launch. - LaunchTemplateId *string - - // The name of the launch template that the AMI uses for Windows fast launch. - LaunchTemplateName *string - - // The version of the launch template that the AMI uses for Windows fast launch. - Version *string - - noSmithyDocumentSerde -} - -// Configuration settings for creating and managing pre-provisioned snapshots for -// a Windows fast launch enabled AMI. -type FastLaunchSnapshotConfigurationRequest struct { - - // The number of pre-provisioned snapshots to keep on hand for a Windows fast - // launch enabled AMI. - TargetResourceCount *int32 - - noSmithyDocumentSerde -} - -// Configuration settings for creating and managing pre-provisioned snapshots for -// a Windows fast launch enabled Windows AMI. -type FastLaunchSnapshotConfigurationResponse struct { - - // The number of pre-provisioned snapshots requested to keep on hand for a Windows - // fast launch enabled AMI. - TargetResourceCount *int32 - - noSmithyDocumentSerde -} - -// Describes the IAM SAML identity providers used for federated authentication. -type FederatedAuthentication struct { - - // The Amazon Resource Name (ARN) of the IAM SAML identity provider. - SamlProviderArn *string - - // The Amazon Resource Name (ARN) of the IAM SAML identity provider for the - // self-service portal. - SelfServiceSamlProviderArn *string - - noSmithyDocumentSerde -} - -// The IAM SAML identity provider used for federated authentication. -type FederatedAuthenticationRequest struct { - - // The Amazon Resource Name (ARN) of the IAM SAML identity provider. - SAMLProviderArn *string - - // The Amazon Resource Name (ARN) of the IAM SAML identity provider for the - // self-service portal. - SelfServiceSAMLProviderArn *string - - noSmithyDocumentSerde -} - -// A filter name and value pair that is used to return a more specific list of -// results from a describe operation. Filters can be used to match a set of -// resources by specific criteria, such as tags, attributes, or IDs. -// -// If you specify multiple filters, the filters are joined with an AND , and the -// request returns only results that match all of the specified filters. -// -// For more information, see [List and filter using the CLI and API] in the Amazon EC2 User Guide. -// -// [List and filter using the CLI and API]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI -type Filter struct { - - // The name of the filter. Filter names are case-sensitive. - Name *string - - // The filter values. Filter values are case-sensitive. If you specify multiple - // values for a filter, the values are joined with an OR , and the request returns - // all results that match any of the specified values. - Values []string - - noSmithyDocumentSerde -} - -// Describes a port range. -type FilterPortRange struct { - - // The first port in the range. - FromPort *int32 - - // The last port in the range. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes a stateful rule. -type FirewallStatefulRule struct { - - // The destination ports. - DestinationPorts []PortRange - - // The destination IP addresses, in CIDR notation. - Destinations []string - - // The direction. The possible values are FORWARD and ANY . - Direction *string - - // The protocol. - Protocol *string - - // The rule action. The possible values are pass , drop , and alert . - RuleAction *string - - // The ARN of the stateful rule group. - RuleGroupArn *string - - // The source ports. - SourcePorts []PortRange - - // The source IP addresses, in CIDR notation. - Sources []string - - noSmithyDocumentSerde -} - -// Describes a stateless rule. -type FirewallStatelessRule struct { - - // The destination ports. - DestinationPorts []PortRange - - // The destination IP addresses, in CIDR notation. - Destinations []string - - // The rule priority. - Priority *int32 - - // The protocols. - Protocols []int32 - - // The rule action. The possible values are pass , drop , and forward_to_site . - RuleAction *string - - // The ARN of the stateless rule group. - RuleGroupArn *string - - // The source ports. - SourcePorts []PortRange - - // The source IP addresses, in CIDR notation. - Sources []string - - noSmithyDocumentSerde -} - -// Describes a block device mapping, which defines the EBS volumes and instance -// store volumes to attach to an instance at launch. -// -// To override a block device mapping specified in the launch template: -// -// - Specify the exact same DeviceName here as specified in the launch template. -// -// - Only specify the parameters you want to change. -// -// - Any parameters you don't specify here will keep their original launch -// template values. -// -// To add a new block device mapping: -// -// - Specify a DeviceName that doesn't exist in the launch template. -// -// - Specify all desired parameters here. -type FleetBlockDeviceMappingRequest struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *FleetEbsBlockDeviceRequest - - // To omit the device from the block device mapping, specify an empty string. When - // this property is specified, the device is removed from the block device mapping - // regardless of the assigned value. - NoDevice *string - - // The virtual device name ( ephemeralN ). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes can - // specify mappings for ephemeral0 and ephemeral1 . The number of available - // instance store volumes depends on the instance type. After you connect to the - // instance, you must mount the volume. - // - // NVMe instance store volumes are automatically enumerated and assigned a device - // name. Including them in your block device mapping has no effect. - // - // Constraints: For M3 instances, you must specify instance store volumes in the - // block device mapping for the instance. When you launch an M3 instance, we ignore - // any instance store volumes specified in the block device mapping for the AMI. - VirtualName *string - - noSmithyDocumentSerde -} - -// Information about a Capacity Reservation in a Capacity Reservation Fleet. -type FleetCapacityReservation struct { - - // The Availability Zone in which the Capacity Reservation reserves capacity. - AvailabilityZone *string - - // The ID of the Availability Zone in which the Capacity Reservation reserves - // capacity. - AvailabilityZoneId *string - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // The date and time at which the Capacity Reservation was created. - CreateDate *time.Time - - // Indicates whether the Capacity Reservation reserves capacity for EBS-optimized - // instance types. - EbsOptimized *bool - - // The number of capacity units fulfilled by the Capacity Reservation. For more - // information, see [Total target capacity]in the Amazon EC2 User Guide. - // - // [Total target capacity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity - FulfilledCapacity *float64 - - // The type of operating system for which the Capacity Reservation reserves - // capacity. - InstancePlatform CapacityReservationInstancePlatform - - // The instance type for which the Capacity Reservation reserves capacity. - InstanceType InstanceType - - // The priority of the instance type in the Capacity Reservation Fleet. For more - // information, see [Instance type priority]in the Amazon EC2 User Guide. - // - // [Instance type priority]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#instance-priority - Priority *int32 - - // The total number of instances for which the Capacity Reservation reserves - // capacity. - TotalInstanceCount *int32 - - // The weight of the instance type in the Capacity Reservation Fleet. For more - // information, see [Instance type weight]in the Amazon EC2 User Guide. - // - // [Instance type weight]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#instance-weight - Weight *float64 - - noSmithyDocumentSerde -} - -// Describes an EC2 Fleet. -type FleetData struct { - - // The progress of the EC2 Fleet. If there is an error, the status is error . After - // all requests are placed, the status is pending_fulfillment . If the size of the - // EC2 Fleet is equal to or greater than its target capacity, the status is - // fulfilled . If the size of the EC2 Fleet is decreased, the status is - // pending_termination while instances are terminating. - ActivityStatus FleetActivityStatus - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring idempotency]. - // - // Constraints: Maximum 64 ASCII characters - // - // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Reserved. - Context *string - - // The creation date and time of the EC2 Fleet. - CreateTime *time.Time - - // Information about the instances that could not be launched by the fleet. Valid - // only when Type is set to instant . - Errors []DescribeFleetError - - // Indicates whether running instances should be terminated if the target capacity - // of the EC2 Fleet is decreased below the current size of the EC2 Fleet. - // - // Supported only for fleets of type maintain . - ExcessCapacityTerminationPolicy FleetExcessCapacityTerminationPolicy - - // The ID of the EC2 Fleet. - FleetId *string - - // The state of the EC2 Fleet. - FleetState FleetStateCode - - // The number of units fulfilled by this request compared to the set target - // capacity. - FulfilledCapacity *float64 - - // The number of units fulfilled by this request compared to the set target - // On-Demand capacity. - FulfilledOnDemandCapacity *float64 - - // Information about the instances that were launched by the fleet. Valid only - // when Type is set to instant . - Instances []DescribeFleetsInstances - - // The launch template and overrides. - LaunchTemplateConfigs []FleetLaunchTemplateConfig - - // The allocation strategy of On-Demand Instances in an EC2 Fleet. - OnDemandOptions *OnDemandOptions - - // Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported - // only for fleets of type maintain . For more information, see [EC2 Fleet health checks] in the Amazon EC2 - // User Guide. - // - // [EC2 Fleet health checks]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks - ReplaceUnhealthyInstances *bool - - // The configuration of Spot Instances in an EC2 Fleet. - SpotOptions *SpotOptions - - // The tags for an EC2 Fleet resource. - Tags []Tag - - // The number of units to request. You can choose to set the target capacity in - // terms of instances or a performance characteristic that is important to your - // application workload, such as vCPUs, memory, or I/O. If the request type is - // maintain , you can specify a target capacity of 0 and add capacity later. - TargetCapacitySpecification *TargetCapacitySpecification - - // Indicates whether running instances should be terminated when the EC2 Fleet - // expires. - TerminateInstancesWithExpiration *bool - - // The type of request. Indicates whether the EC2 Fleet only requests the target - // capacity, or also attempts to maintain it. If you request a certain target - // capacity, EC2 Fleet only places the required requests; it does not attempt to - // replenish instances if capacity is diminished, and it does not submit requests - // in alternative capacity pools if capacity is unavailable. To maintain a certain - // target capacity, EC2 Fleet places the required requests to meet this target - // capacity. It also automatically replenishes any interrupted Spot Instances. - // Default: maintain . - Type FleetType - - // The start date and time of the request, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request - // immediately. - ValidFrom *time.Time - - // The end date and time of the request, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). At this point, no new instance requests are placed or - // able to fulfill the request. The default end date is 7 days from the current - // date. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// Describes a block device for an EBS volume. -type FleetEbsBlockDeviceRequest struct { - - // Indicates whether the EBS volume is deleted on instance termination. For more - // information, see [Preserve data when an instance is terminated]in the Amazon EC2 User Guide. - // - // [Preserve data when an instance is terminated]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/preserving-volumes-on-termination.html - DeleteOnTermination *bool - - // Indicates whether the encryption state of an EBS volume is changed while being - // restored from a backing snapshot. The effect of setting the encryption state to - // true depends on the volume origin (new or from a snapshot), starting encryption - // state, ownership, and whether encryption by default is enabled. For more - // information, see [Amazon EBS encryption]in the Amazon EBS User Guide. - // - // In no case can you remove encryption from an encrypted volume. - // - // Encrypted volumes can only be attached to instances that support Amazon EBS - // encryption. For more information, see [Supported instance types]. - // - // This parameter is not returned by [DescribeImageAttribute]. - // - // For [CreateImage] and [RegisterImage], whether you can include this parameter, and the allowed values - // differ depending on the type of block device mapping you are creating. - // - // - If you are creating a block device mapping for a new (empty) volume, you - // can include this parameter, and specify either true for an encrypted volume, - // or false for an unencrypted volume. If you omit this parameter, it defaults to - // false (unencrypted). - // - // - If you are creating a block device mapping from an existing encrypted or - // unencrypted snapshot, you must omit this parameter. If you include this - // parameter, the request will fail, regardless of the value that you specify. - // - // - If you are creating a block device mapping from an existing unencrypted - // volume, you can include this parameter, but you must specify false . If you - // specify true , the request will fail. In this case, we recommend that you omit - // the parameter. - // - // - If you are creating a block device mapping from an existing encrypted - // volume, you can include this parameter, and specify either true or false . - // However, if you specify false , the parameter is ignored and the block device - // mapping is always encrypted. In this case, we recommend that you omit the - // parameter. - // - // [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html - // [DescribeImageAttribute]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImageAttribute - // [RegisterImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RegisterImage - // [Supported instance types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage - Encrypted *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - // - // The following are the supported values for each volume type: - // - // - gp3 : 3,000 - 16,000 IOPS - // - // - io1 : 100 - 64,000 IOPS - // - // - io2 : 100 - 256,000 IOPS - // - // For io2 volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System]. On other instances, - // you can achieve performance up to 32,000 IOPS. - // - // This parameter is required for io1 and io2 volumes. The default for gp3 volumes - // is 3,000 IOPS. - // - // [instances built on the Nitro System]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances - Iops *int32 - - // Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed - // KMS key to use for EBS encryption. - // - // This parameter is only supported on BlockDeviceMapping objects called by [CreateFleet], [RequestSpotInstances], - // and [RunInstances]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet.html - // [RequestSpotInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - KmsKeyId *string - - // The ID of the snapshot. - SnapshotId *string - - // The throughput that the volume supports, in MiB/s. - // - // This parameter is valid only for gp3 volumes. - // - // Valid Range: Minimum value of 125. Maximum value of 1000. - Throughput *int32 - - // The size of the volume, in GiBs. You must specify either a snapshot ID or a - // volume size. If you specify a snapshot, the default is the snapshot size. You - // can specify a volume size that is equal to or larger than the snapshot size. - // - // The following are the supported sizes for each volume type: - // - // - gp2 and gp3 : 1 - 16,384 GiB - // - // - io1 : 4 - 16,384 GiB - // - // - io2 : 4 - 65,536 GiB - // - // - st1 and sc1 : 125 - 16,384 GiB - // - // - standard : 1 - 1024 GiB - VolumeSize *int32 - - // The volume type. For more information, see [Amazon EBS volume types] in the Amazon EBS User Guide. - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// Describes a launch template and overrides. -type FleetLaunchTemplateConfig struct { - - // The launch template. - LaunchTemplateSpecification *FleetLaunchTemplateSpecification - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides []FleetLaunchTemplateOverrides - - noSmithyDocumentSerde -} - -// Describes a launch template and overrides. -type FleetLaunchTemplateConfigRequest struct { - - // The launch template to use. You must specify either the launch template ID or - // launch template name in the request. - LaunchTemplateSpecification *FleetLaunchTemplateSpecificationRequest - - // Any parameters that you specify override the same parameters in the launch - // template. - // - // For fleets of type request and maintain , a maximum of 300 items is allowed - // across all launch templates. - Overrides []FleetLaunchTemplateOverridesRequest - - noSmithyDocumentSerde -} - -// Describes overrides for a launch template. -type FleetLaunchTemplateOverrides struct { - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string - - // The block device mappings, which define the EBS volumes and instance store - // volumes to attach to the instance at launch. - // - // Supported only for fleets of type instant . - // - // For more information, see [Block device mappings for volumes on Amazon EC2 instances] in the Amazon EC2 User Guide. - // - // [Block device mappings for volumes on Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html - BlockDeviceMappings []BlockDeviceMappingResponse - - // The ID of the AMI in the format ami-17characters00000 . - // - // Alternatively, you can specify a Systems Manager parameter, using one of the - // following formats. The Systems Manager parameter will resolve to an AMI ID on - // launch. - // - // To reference a public parameter: - // - // - resolve:ssm:public-parameter - // - // To reference a parameter stored in the same account: - // - // - resolve:ssm:parameter-name - // - // - resolve:ssm:parameter-name:version-number - // - // - resolve:ssm:parameter-name:label - // - // To reference a parameter shared from another Amazon Web Services account: - // - // - resolve:ssm:parameter-ARN - // - // - resolve:ssm:parameter-ARN:version-number - // - // - resolve:ssm:parameter-ARN:label - // - // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. - // - // This parameter is only available for fleets of type instant . For fleets of type - // maintain and request , you must specify the AMI ID in the launch template. - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ImageId *string - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with those attributes. - // - // If you specify InstanceRequirements , you can't specify InstanceType . - InstanceRequirements *InstanceRequirements - - // The instance type. - // - // mac1.metal is not supported as a launch template override. - // - // If you specify InstanceType , you can't specify InstanceRequirements . - InstanceType InstanceType - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - // - // If you specify a maximum price, it must be more than USD $0.001. Specifying a - // value below USD $0.001 will result in an InvalidParameterValue error message. - MaxPrice *string - - // The location where the instance launched, if applicable. - Placement *PlacementResponse - - // The priority for the launch template override. The highest priority is launched - // first. - // - // If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses - // priority to determine which launch template override to use first in fulfilling - // On-Demand capacity. - // - // If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 - // Fleet uses priority on a best-effort basis to determine which launch template - // override to use in fulfilling Spot capacity, but optimizes for capacity first. - // - // Valid values are whole numbers starting at 0 . The lower the number, the higher - // the priority. If no number is set, the override has the lowest priority. You can - // set the same priority for different launch template overrides. - Priority *float64 - - // The ID of the subnet in which to launch the instances. - SubnetId *string - - // The number of units provided by the specified instance type. These are the same - // units that you chose to set the target capacity in terms of instances, or a - // performance characteristic such as vCPUs, memory, or I/O. - // - // If the target capacity divided by this value is not a whole number, Amazon EC2 - // rounds the number of instances to the next whole number. If this value is not - // specified, the default is 1. - // - // When specifying weights, the price used in the lowest-price and - // price-capacity-optimized allocation strategies is per unit hour (where the - // instance price is divided by the specified weight). However, if all the - // specified weights are above the requested TargetCapacity , resulting in only 1 - // instance being launched, the price used is per instance hour. - WeightedCapacity *float64 - - noSmithyDocumentSerde -} - -// Describes overrides for a launch template. -type FleetLaunchTemplateOverridesRequest struct { - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string - - // The block device mappings, which define the EBS volumes and instance store - // volumes to attach to the instance at launch. - // - // Supported only for fleets of type instant . - // - // For more information, see [Block device mappings for volumes on Amazon EC2 instances] in the Amazon EC2 User Guide. - // - // [Block device mappings for volumes on Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html - BlockDeviceMappings []FleetBlockDeviceMappingRequest - - // The ID of the AMI in the format ami-17characters00000 . - // - // Alternatively, you can specify a Systems Manager parameter, using one of the - // following formats. The Systems Manager parameter will resolve to an AMI ID on - // launch. - // - // To reference a public parameter: - // - // - resolve:ssm:public-parameter - // - // To reference a parameter stored in the same account: - // - // - resolve:ssm:parameter-name - // - // - resolve:ssm:parameter-name:version-number - // - // - resolve:ssm:parameter-name:label - // - // To reference a parameter shared from another Amazon Web Services account: - // - // - resolve:ssm:parameter-ARN - // - // - resolve:ssm:parameter-ARN:version-number - // - // - resolve:ssm:parameter-ARN:label - // - // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. - // - // This parameter is only available for fleets of type instant . For fleets of type - // maintain and request , you must specify the AMI ID in the launch template. - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ImageId *string - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with those attributes. - // - // If you specify InstanceRequirements , you can't specify InstanceType . - InstanceRequirements *InstanceRequirementsRequest - - // The instance type. - // - // mac1.metal is not supported as a launch template override. - // - // If you specify InstanceType , you can't specify InstanceRequirements . - InstanceType InstanceType - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - // - // If you specify a maximum price, it must be more than USD $0.001. Specifying a - // value below USD $0.001 will result in an InvalidParameterValue error message. - MaxPrice *string - - // The location where the instance launched, if applicable. - Placement *Placement - - // The priority for the launch template override. The highest priority is launched - // first. - // - // If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses - // priority to determine which launch template override to use first in fulfilling - // On-Demand capacity. - // - // If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 - // Fleet uses priority on a best-effort basis to determine which launch template - // override to use in fulfilling Spot capacity, but optimizes for capacity first. - // - // Valid values are whole numbers starting at 0 . The lower the number, the higher - // the priority. If no number is set, the launch template override has the lowest - // priority. You can set the same priority for different launch template overrides. - Priority *float64 - - // The IDs of the subnets in which to launch the instances. Separate multiple - // subnet IDs using commas (for example, subnet-1234abcdeexample1, - // subnet-0987cdef6example2 ). A request of type instant can have only one subnet - // ID. - SubnetId *string - - // The number of units provided by the specified instance type. These are the same - // units that you chose to set the target capacity in terms of instances, or a - // performance characteristic such as vCPUs, memory, or I/O. - // - // If the target capacity divided by this value is not a whole number, Amazon EC2 - // rounds the number of instances to the next whole number. If this value is not - // specified, the default is 1. - // - // When specifying weights, the price used in the lowest-price and - // price-capacity-optimized allocation strategies is per unit hour (where the - // instance price is divided by the specified weight). However, if all the - // specified weights are above the requested TargetCapacity , resulting in only 1 - // instance being launched, the price used is per instance hour. - WeightedCapacity *float64 - - noSmithyDocumentSerde -} - -// The Amazon EC2 launch template that can be used by a Spot Fleet to configure -// Amazon EC2 instances. You must specify either the ID or name of the launch -// template in the request, but not both. -// -// For information about launch templates, see [Launch an instance from a launch template] in the Amazon EC2 User Guide. -// -// [Launch an instance from a launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html -type FleetLaunchTemplateSpecification struct { - - // The ID of the launch template. - // - // You must specify the LaunchTemplateId or the LaunchTemplateName , but not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify the LaunchTemplateName or the LaunchTemplateId , but not both. - LaunchTemplateName *string - - // The launch template version number, $Latest , or $Default . You must specify a - // value, otherwise the request fails. - // - // If the value is $Latest , Amazon EC2 uses the latest version of the launch - // template. - // - // If the value is $Default , Amazon EC2 uses the default version of the launch - // template. - Version *string - - noSmithyDocumentSerde -} - -// The Amazon EC2 launch template that can be used by an EC2 Fleet to configure -// Amazon EC2 instances. You must specify either the ID or name of the launch -// template in the request, but not both. -// -// For information about launch templates, see [Launch an instance from a launch template] in the Amazon EC2 User Guide. -// -// [Launch an instance from a launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html -type FleetLaunchTemplateSpecificationRequest struct { - - // The ID of the launch template. - // - // You must specify the LaunchTemplateId or the LaunchTemplateName , but not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify the LaunchTemplateName or the LaunchTemplateId , but not both. - LaunchTemplateName *string - - // The launch template version number, $Latest , or $Default . You must specify a - // value, otherwise the request fails. - // - // If the value is $Latest , Amazon EC2 uses the latest version of the launch - // template. - // - // If the value is $Default , Amazon EC2 uses the default version of the launch - // template. - Version *string - - noSmithyDocumentSerde -} - -// The strategy to use when Amazon EC2 emits a signal that your Spot Instance is -// at an elevated risk of being interrupted. -type FleetSpotCapacityRebalance struct { - - // The replacement strategy to use. Only available for fleets of type maintain . - // - // launch - EC2 Fleet launches a new replacement Spot Instance when a rebalance - // notification is emitted for an existing Spot Instance in the fleet. EC2 Fleet - // does not terminate the instances that receive a rebalance notification. You can - // terminate the old instances, or you can leave them running. You are charged for - // all instances while they are running. - // - // launch-before-terminate - EC2 Fleet launches a new replacement Spot Instance - // when a rebalance notification is emitted for an existing Spot Instance in the - // fleet, and then, after a delay that you specify (in TerminationDelay ), - // terminates the instances that received a rebalance notification. - ReplacementStrategy FleetReplacementStrategy - - // The amount of time (in seconds) that Amazon EC2 waits before terminating the - // old Spot Instance after launching a new replacement Spot Instance. - // - // Required when ReplacementStrategy is set to launch-before-terminate . - // - // Not valid when ReplacementStrategy is set to launch . - // - // Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds. - TerminationDelay *int32 - - noSmithyDocumentSerde -} - -// The Spot Instance replacement strategy to use when Amazon EC2 emits a rebalance -// notification signal that your Spot Instance is at an elevated risk of being -// interrupted. For more information, see [Capacity rebalancing]in the Amazon EC2 User Guide. -// -// [Capacity rebalancing]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-capacity-rebalance.html -type FleetSpotCapacityRebalanceRequest struct { - - // The replacement strategy to use. Only available for fleets of type maintain . - // - // launch - EC2 Fleet launches a replacement Spot Instance when a rebalance - // notification is emitted for an existing Spot Instance in the fleet. EC2 Fleet - // does not terminate the instances that receive a rebalance notification. You can - // terminate the old instances, or you can leave them running. You are charged for - // all instances while they are running. - // - // launch-before-terminate - EC2 Fleet launches a replacement Spot Instance when a - // rebalance notification is emitted for an existing Spot Instance in the fleet, - // and then, after a delay that you specify (in TerminationDelay ), terminates the - // instances that received a rebalance notification. - ReplacementStrategy FleetReplacementStrategy - - // The amount of time (in seconds) that Amazon EC2 waits before terminating the - // old Spot Instance after launching a new replacement Spot Instance. - // - // Required when ReplacementStrategy is set to launch-before-terminate . - // - // Not valid when ReplacementStrategy is set to launch . - // - // Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds. - TerminationDelay *int32 - - noSmithyDocumentSerde -} - -// The strategies for managing your Spot Instances that are at an elevated risk of -// being interrupted. -type FleetSpotMaintenanceStrategies struct { - - // The strategy to use when Amazon EC2 emits a signal that your Spot Instance is - // at an elevated risk of being interrupted. - CapacityRebalance *FleetSpotCapacityRebalance - - noSmithyDocumentSerde -} - -// The strategies for managing your Spot Instances that are at an elevated risk of -// being interrupted. -type FleetSpotMaintenanceStrategiesRequest struct { - - // The strategy to use when Amazon EC2 emits a signal that your Spot Instance is - // at an elevated risk of being interrupted. - CapacityRebalance *FleetSpotCapacityRebalanceRequest - - noSmithyDocumentSerde -} - -// Describes a flow log. -type FlowLog struct { - - // The date and time the flow log was created. - CreationTime *time.Time - - // The ARN of the IAM role that allows the service to publish flow logs across - // accounts. - DeliverCrossAccountRole *string - - // Information about the error that occurred. Rate limited indicates that - // CloudWatch Logs throttling has been applied for one or more network interfaces, - // or that you've reached the limit on the number of log groups that you can - // create. Access error indicates that the IAM role associated with the flow log - // does not have sufficient permissions to publish to CloudWatch Logs. Unknown - // error indicates an internal error. - DeliverLogsErrorMessage *string - - // The ARN of the IAM role allows the service to publish logs to CloudWatch Logs. - DeliverLogsPermissionArn *string - - // The status of the logs delivery ( SUCCESS | FAILED ). - DeliverLogsStatus *string - - // The destination options. - DestinationOptions *DestinationOptionsResponse - - // The ID of the flow log. - FlowLogId *string - - // The status of the flow log ( ACTIVE ). - FlowLogStatus *string - - // The Amazon Resource Name (ARN) of the destination for the flow log data. - LogDestination *string - - // The type of destination for the flow log data. - LogDestinationType LogDestinationType - - // The format of the flow log record. - LogFormat *string - - // The name of the flow log group. - LogGroupName *string - - // The maximum interval of time, in seconds, during which a flow of packets is - // captured and aggregated into a flow log record. - // - // When a network interface is attached to a [Nitro-based instance], the aggregation interval is always - // 60 seconds (1 minute) or less, regardless of the specified value. - // - // Valid Values: 60 | 600 - // - // [Nitro-based instance]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - MaxAggregationInterval *int32 - - // The ID of the resource being monitored. - ResourceId *string - - // The tags for the flow log. - Tags []Tag - - // The type of traffic captured for the flow log. - TrafficType TrafficType - - noSmithyDocumentSerde -} - -// Describes the FPGA accelerator for the instance type. -type FpgaDeviceInfo struct { - - // The count of FPGA accelerators for the instance type. - Count *int32 - - // The manufacturer of the FPGA accelerator. - Manufacturer *string - - // Describes the memory for the FPGA accelerator for the instance type. - MemoryInfo *FpgaDeviceMemoryInfo - - // The name of the FPGA accelerator. - Name *string - - noSmithyDocumentSerde -} - -// Describes the memory for the FPGA accelerator for the instance type. -type FpgaDeviceMemoryInfo struct { - - // The size of the memory available to the FPGA accelerator, in MiB. - SizeInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes an Amazon FPGA image (AFI). -type FpgaImage struct { - - // The date and time the AFI was created. - CreateTime *time.Time - - // Indicates whether data retention support is enabled for the AFI. - DataRetentionSupport *bool - - // The description of the AFI. - Description *string - - // The global FPGA image identifier (AGFI ID). - FpgaImageGlobalId *string - - // The FPGA image identifier (AFI ID). - FpgaImageId *string - - // The instance types supported by the AFI. - InstanceTypes []string - - // The name of the AFI. - Name *string - - // The alias of the AFI owner. Possible values include self , amazon , and - // aws-marketplace . - OwnerAlias *string - - // The ID of the Amazon Web Services account that owns the AFI. - OwnerId *string - - // Information about the PCI bus. - PciId *PciId - - // The product codes for the AFI. - ProductCodes []ProductCode - - // Indicates whether the AFI is public. - Public *bool - - // The version of the Amazon Web Services Shell that was used to create the - // bitstream. - ShellVersion *string - - // Information about the state of the AFI. - State *FpgaImageState - - // Any tags assigned to the AFI. - Tags []Tag - - // The time of the most recent update to the AFI. - UpdateTime *time.Time - - noSmithyDocumentSerde -} - -// Describes an Amazon FPGA image (AFI) attribute. -type FpgaImageAttribute struct { - - // The description of the AFI. - Description *string - - // The ID of the AFI. - FpgaImageId *string - - // The load permissions. - LoadPermissions []LoadPermission - - // The name of the AFI. - Name *string - - // The product codes. - ProductCodes []ProductCode - - noSmithyDocumentSerde -} - -// Describes the state of the bitstream generation process for an Amazon FPGA -// image (AFI). -type FpgaImageState struct { - - // The state. The following are the possible values: - // - // - pending - AFI bitstream generation is in progress. - // - // - available - The AFI is available for use. - // - // - failed - AFI bitstream generation failed. - // - // - unavailable - The AFI is no longer available for use. - Code FpgaImageStateCode - - // If the state is failed , this is the error message. - Message *string - - noSmithyDocumentSerde -} - -// Describes the FPGAs for the instance type. -type FpgaInfo struct { - - // Describes the FPGAs for the instance type. - Fpgas []FpgaDeviceInfo - - // The total memory of all FPGA accelerators for the instance type. - TotalFpgaMemoryInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes the GPU accelerators for the instance type. -type GpuDeviceInfo struct { - - // The number of GPUs for the instance type. - Count *int32 - - // The manufacturer of the GPU accelerator. - Manufacturer *string - - // Describes the memory available to the GPU accelerator. - MemoryInfo *GpuDeviceMemoryInfo - - // The name of the GPU accelerator. - Name *string - - noSmithyDocumentSerde -} - -// Describes the memory available to the GPU accelerator. -type GpuDeviceMemoryInfo struct { - - // The size of the memory available to the GPU accelerator, in MiB. - SizeInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes the GPU accelerators for the instance type. -type GpuInfo struct { - - // Describes the GPU accelerators for the instance type. - Gpus []GpuDeviceInfo - - // The total size of the memory for the GPU accelerators for the instance type, in - // MiB. - TotalGpuMemoryInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes a security group. -type GroupIdentifier struct { - - // The ID of the security group. - GroupId *string - - // The name of the security group. - GroupName *string - - noSmithyDocumentSerde -} - -// Indicates whether your instance is configured for hibernation. This parameter -// is valid only if the instance meets the [hibernation prerequisites]. For more information, see [Hibernate your Amazon EC2 instance] in the -// Amazon EC2 User Guide. -// -// [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html -// [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html -type HibernationOptions struct { - - // If true , your instance is enabled for hibernation; otherwise, it is not enabled - // for hibernation. - Configured *bool - - noSmithyDocumentSerde -} - -// Indicates whether your instance is configured for hibernation. This parameter -// is valid only if the instance meets the [hibernation prerequisites]. For more information, see [Hibernate your Amazon EC2 instance] in the -// Amazon EC2 User Guide. -// -// [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html -// [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html -type HibernationOptionsRequest struct { - - // Set to true to enable your instance for hibernation. - // - // For Spot Instances, if you set Configured to true , either omit the - // InstanceInterruptionBehavior parameter (for [SpotMarketOptions]SpotMarketOptions ), or set it to - // hibernate . When Configured is true: - // - // - If you omit InstanceInterruptionBehavior , it defaults to hibernate . - // - // - If you set InstanceInterruptionBehavior to a value other than hibernate , - // you'll get an error. - // - // Default: false - // - // [SpotMarketOptions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotMarketOptions.html - Configured *bool - - noSmithyDocumentSerde -} - -// Describes an event in the history of the Spot Fleet request. -type HistoryRecord struct { - - // Information about the event. - EventInformation *EventInformation - - // The event type. - // - // - error - An error with the Spot Fleet request. - // - // - fleetRequestChange - A change in the status or configuration of the Spot - // Fleet request. - // - // - instanceChange - An instance was launched or terminated. - // - // - Information - An informational event. - EventType EventType - - // The date and time of the event, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time - - noSmithyDocumentSerde -} - -// Describes an event in the history of an EC2 Fleet. -type HistoryRecordEntry struct { - - // Information about the event. - EventInformation *EventInformation - - // The event type. - EventType FleetEventType - - // The date and time of the event, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time - - noSmithyDocumentSerde -} - -// Describes the properties of the Dedicated Host. -type Host struct { - - // The time that the Dedicated Host was allocated. - AllocationTime *time.Time - - // Indicates whether the Dedicated Host supports multiple instance types of the - // same instance family. If the value is on , the Dedicated Host supports multiple - // instance types in the instance family. If the value is off , the Dedicated Host - // supports a single instance type only. - AllowsMultipleInstanceTypes AllowsMultipleInstanceTypes - - // The ID of the Outpost hardware asset on which the Dedicated Host is allocated. - AssetId *string - - // Whether auto-placement is on or off. - AutoPlacement AutoPlacement - - // The Availability Zone of the Dedicated Host. - AvailabilityZone *string - - // The ID of the Availability Zone in which the Dedicated Host is allocated. - AvailabilityZoneId *string - - // Information about the instances running on the Dedicated Host. - AvailableCapacity *AvailableCapacity - - // Unique, case-sensitive identifier that you provide to ensure the idempotency of - // the request. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The ID of the Dedicated Host. - HostId *string - - // Indicates whether host maintenance is enabled or disabled for the Dedicated - // Host. - HostMaintenance HostMaintenance - - // The hardware specifications of the Dedicated Host. - HostProperties *HostProperties - - // Indicates whether host recovery is enabled or disabled for the Dedicated Host. - HostRecovery HostRecovery - - // The reservation ID of the Dedicated Host. This returns a null response if the - // Dedicated Host doesn't have an associated reservation. - HostReservationId *string - - // The IDs and instance type that are currently running on the Dedicated Host. - Instances []HostInstance - - // Indicates whether the Dedicated Host is in a host resource group. If - // memberOfServiceLinkedResourceGroup is true , the host is in a host resource - // group; otherwise, it is not. - MemberOfServiceLinkedResourceGroup *bool - - // The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which the - // Dedicated Host is allocated. - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the Dedicated Host. - OwnerId *string - - // The time that the Dedicated Host was released. - ReleaseTime *time.Time - - // The Dedicated Host's state. - State AllocationState - - // Any tags assigned to the Dedicated Host. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an instance running on a Dedicated Host. -type HostInstance struct { - - // The ID of instance that is running on the Dedicated Host. - InstanceId *string - - // The instance type (for example, m3.medium ) of the running instance. - InstanceType *string - - // The ID of the Amazon Web Services account that owns the instance. - OwnerId *string - - noSmithyDocumentSerde -} - -// Details about the Dedicated Host Reservation offering. -type HostOffering struct { - - // The currency of the offering. - CurrencyCode CurrencyCodeValues - - // The duration of the offering (in seconds). - Duration *int32 - - // The hourly price of the offering. - HourlyPrice *string - - // The instance family of the offering. - InstanceFamily *string - - // The ID of the offering. - OfferingId *string - - // The available payment option. - PaymentOption PaymentOption - - // The upfront price of the offering. Does not apply to No Upfront offerings. - UpfrontPrice *string - - noSmithyDocumentSerde -} - -// Describes the properties of a Dedicated Host. -type HostProperties struct { - - // The number of cores on the Dedicated Host. - Cores *int32 - - // The instance family supported by the Dedicated Host. For example, m5 . - InstanceFamily *string - - // The instance type supported by the Dedicated Host. For example, m5.large . If - // the host supports multiple instance types, no instanceType is returned. - InstanceType *string - - // The number of sockets on the Dedicated Host. - Sockets *int32 - - // The total number of vCPUs on the Dedicated Host. - TotalVCpus *int32 - - noSmithyDocumentSerde -} - -// Details about the Dedicated Host Reservation and associated Dedicated Hosts. -type HostReservation struct { - - // The number of Dedicated Hosts the reservation is associated with. - Count *int32 - - // The currency in which the upfrontPrice and hourlyPrice amounts are specified. - // At this time, the only supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The length of the reservation's term, specified in seconds. Can be 31536000 (1 - // year) | 94608000 (3 years) . - Duration *int32 - - // The date and time that the reservation ends. - End *time.Time - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []string - - // The ID of the reservation that specifies the associated Dedicated Hosts. - HostReservationId *string - - // The hourly price of the reservation. - HourlyPrice *string - - // The instance family of the Dedicated Host Reservation. The instance family on - // the Dedicated Host must be the same in order for it to benefit from the - // reservation. - InstanceFamily *string - - // The ID of the reservation. This remains the same regardless of which Dedicated - // Hosts are associated with it. - OfferingId *string - - // The payment option selected for this reservation. - PaymentOption PaymentOption - - // The date and time that the reservation started. - Start *time.Time - - // The state of the reservation. - State ReservationState - - // Any tags assigned to the Dedicated Host Reservation. - Tags []Tag - - // The upfront price of the reservation. - UpfrontPrice *string - - noSmithyDocumentSerde -} - -// Describes an IAM instance profile. -type IamInstanceProfile struct { - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string - - // The ID of the instance profile. - Id *string - - noSmithyDocumentSerde -} - -// Describes an association between an IAM instance profile and an instance. -type IamInstanceProfileAssociation struct { - - // The ID of the association. - AssociationId *string - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfile - - // The ID of the instance. - InstanceId *string - - // The state of the association. - State IamInstanceProfileAssociationState - - // The time the IAM instance profile was associated with the instance. - Timestamp *time.Time - - noSmithyDocumentSerde -} - -// Describes an IAM instance profile. -type IamInstanceProfileSpecification struct { - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string - - // The name of the instance profile. - Name *string - - noSmithyDocumentSerde -} - -// Describes the ICMP type and code. -type IcmpTypeCode struct { - - // The ICMP code. A value of -1 means all codes for the specified ICMP type. - Code *int32 - - // The ICMP type. A value of -1 means all types. - Type *int32 - - noSmithyDocumentSerde -} - -// Describes the ID format for a resource. -type IdFormat struct { - - // The date in UTC at which you are permanently switched over to using longer IDs. - // If a deadline is not yet available for this resource type, this field is not - // returned. - Deadline *time.Time - - // The type of resource. - Resource *string - - // Indicates whether longer IDs (17-character IDs) are enabled for the resource. - UseLongIds *bool - - noSmithyDocumentSerde -} - -// The internet key exchange (IKE) version permitted for the VPN tunnel. -type IKEVersionsListValue struct { - - // The IKE version. - Value *string - - noSmithyDocumentSerde -} - -// The IKE version that is permitted for the VPN tunnel. -type IKEVersionsRequestListValue struct { - - // The IKE version. - Value *string - - noSmithyDocumentSerde -} - -// Describes an image. -type Image struct { - - // The architecture of the image. - Architecture ArchitectureValues - - // Any block device mapping entries. - BlockDeviceMappings []BlockDeviceMapping - - // The boot mode of the image. For more information, see [Instance launch behavior with Amazon EC2 boot modes] in the Amazon EC2 User - // Guide. - // - // [Instance launch behavior with Amazon EC2 boot modes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html - BootMode BootModeValues - - // The date and time the image was created. - CreationDate *string - - // The date and time to deprecate the AMI, in UTC, in the following format: - // YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 rounds - // the seconds to the nearest minute. - DeprecationTime *string - - // Indicates whether deregistration protection is enabled for the AMI. - DeregistrationProtection *string - - // The description of the AMI that was provided during image creation. - Description *string - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool - - // Indicates whether the image is eligible for Amazon Web Services Free Tier. - // - // - If true , the AMI is eligible for Free Tier and can be used to launch - // instances under the Free Tier limits. - // - // - If false , the AMI is not eligible for Free Tier. - FreeTierEligible *bool - - // The hypervisor type of the image. Only xen is supported. ovm is not supported. - Hypervisor HypervisorType - - // If true , the AMI satisfies the criteria for Allowed AMIs and can be discovered - // and used in the account. If false and Allowed AMIs is set to enabled , the AMI - // can't be discovered or used in the account. If false and Allowed AMIs is set to - // audit-mode , the AMI can be discovered and used in the account. - // - // For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. - // - // [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html - ImageAllowed *bool - - // The ID of the AMI. - ImageId *string - - // The location of the AMI. - ImageLocation *string - - // The owner alias ( amazon | aws-backup-vault | aws-marketplace ). - ImageOwnerAlias *string - - // The type of image. - ImageType ImageTypeValues - - // If v2.0 , it indicates that IMDSv2 is specified in the AMI. Instances launched - // from this AMI will have HttpTokens automatically set to required so that, by - // default, the instance requires that IMDSv2 is used when requesting instance - // metadata. In addition, HttpPutResponseHopLimit is set to 2 . For more - // information, see [Configure the AMI]in the Amazon EC2 User Guide. - // - // [Configure the AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration - ImdsSupport ImdsSupportValues - - // The kernel associated with the image, if any. Only applicable for machine - // images. - KernelId *string - - // The date and time, in [ISO 8601 date-time format], when the AMI was last used to launch an EC2 instance. - // When the AMI is used to launch an instance, there is a 24-hour delay before that - // usage is reported. - // - // lastLaunchedTime data is available starting April 2017. - // - // [ISO 8601 date-time format]: http://www.iso.org/iso/iso8601 - LastLaunchedTime *string - - // The name of the AMI that was provided during image creation. - Name *string - - // The ID of the Amazon Web Services account that owns the image. - OwnerId *string - - // This value is set to windows for Windows AMIs; otherwise, it is blank. - Platform PlatformValues - - // The platform details associated with the billing code of the AMI. For more - // information, see [Understand AMI billing information]in the Amazon EC2 User Guide. - // - // [Understand AMI billing information]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html - PlatformDetails *string - - // Any product codes associated with the AMI. - ProductCodes []ProductCode - - // Indicates whether the image has public launch permissions. The value is true if - // this image has public launch permissions or false if it has only implicit and - // explicit launch permissions. - Public *bool - - // The RAM disk associated with the image, if any. Only applicable for machine - // images. - RamdiskId *string - - // The device name of the root device volume (for example, /dev/sda1 ). - RootDeviceName *string - - // The type of root device used by the AMI. The AMI can use an Amazon EBS volume - // or an instance store volume. - RootDeviceType DeviceType - - // The ID of the source AMI from which the AMI was created. - // - // The ID only appears if the AMI was created using CreateImage, CopyImage, or CreateRestoreImageTask. The ID does not - // appear if the AMI was created using any other API. For some older AMIs, the ID - // might not be available. For more information, see [Identify the source AMI used to create a new Amazon EC2 AMI]in the Amazon EC2 User Guide. - // - // [Identify the source AMI used to create a new Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.html - SourceImageId *string - - // The Region of the source AMI. - // - // The Region only appears if the AMI was created using CreateImage, CopyImage, or CreateRestoreImageTask. The Region does - // not appear if the AMI was created using any other API. For some older AMIs, the - // Region might not be available. For more information, see [Identify the source AMI used to create a new Amazon EC2 AMI]in the Amazon EC2 User - // Guide. - // - // [Identify the source AMI used to create a new Amazon EC2 AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.html - SourceImageRegion *string - - // The ID of the instance that the AMI was created from if the AMI was created - // using [CreateImage]. This field only appears if the AMI was created using CreateImage. - // - // [CreateImage]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html - SourceInstanceId *string - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string - - // The current state of the AMI. If the state is available , the image is - // successfully registered and can be used to launch an instance. - State ImageState - - // The reason for the state change. - StateReason *StateReason - - // Any tags assigned to the image. - Tags []Tag - - // If the image is configured for NitroTPM support, the value is v2.0 . For more - // information, see [NitroTPM]in the Amazon EC2 User Guide. - // - // [NitroTPM]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html - TpmSupport TpmSupportValues - - // The operation of the Amazon EC2 instance and the billing code that is - // associated with the AMI. usageOperation corresponds to the [lineitem/Operation] column on your - // Amazon Web Services Cost and Usage Report and in the [Amazon Web Services Price List API]. You can view these - // fields on the Instances or AMIs pages in the Amazon EC2 console, or in the - // responses that are returned by the [DescribeImages]command in the Amazon EC2 API, or the [describe-images] - // command in the CLI. - // - // [describe-images]: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html - // [lineitem/Operation]: https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation - // [DescribeImages]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html - // [Amazon Web Services Price List API]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html - UsageOperation *string - - // The type of virtualization of the AMI. - VirtualizationType VirtualizationType - - noSmithyDocumentSerde -} - -// The list of criteria that are evaluated to determine whch AMIs are discoverable -// and usable in the account in the specified Amazon Web Services Region. -// Currently, the only criteria that can be specified are AMI providers. -// -// Up to 10 imageCriteria objects can be specified, and up to a total of 200 -// values for all imageProviders . For more information, see [JSON configuration for the Allowed AMIs criteria] in the Amazon EC2 -// User Guide. -// -// [JSON configuration for the Allowed AMIs criteria]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html#allowed-amis-json-configuration -type ImageCriterion struct { - - // A list of AMI providers whose AMIs are discoverable and useable in the account. - // Up to a total of 200 values can be specified. - // - // Possible values: - // - // amazon : Allow AMIs created by Amazon Web Services. - // - // aws-marketplace : Allow AMIs created by verified providers in the Amazon Web - // Services Marketplace. - // - // aws-backup-vault : Allow AMIs created by Amazon Web Services Backup. - // - // 12-digit account ID: Allow AMIs created by this account. One or more account - // IDs can be specified. - // - // none : Allow AMIs created by your own account only. - ImageProviders []string - - noSmithyDocumentSerde -} - -// The list of criteria that are evaluated to determine whch AMIs are discoverable -// and usable in the account in the specified Amazon Web Services Region. -// Currently, the only criteria that can be specified are AMI providers. -// -// Up to 10 imageCriteria objects can be specified, and up to a total of 200 -// values for all imageProviders . For more information, see [JSON configuration for the Allowed AMIs criteria] in the Amazon EC2 -// User Guide. -// -// [JSON configuration for the Allowed AMIs criteria]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html#allowed-amis-json-configuration -type ImageCriterionRequest struct { - - // A list of image providers whose AMIs are discoverable and useable in the - // account. Up to a total of 200 values can be specified. - // - // Possible values: - // - // amazon : Allow AMIs created by Amazon Web Services. - // - // aws-marketplace : Allow AMIs created by verified providers in the Amazon Web - // Services Marketplace. - // - // aws-backup-vault : Allow AMIs created by Amazon Web Services Backup. - // - // 12-digit account ID: Allow AMIs created by this account. One or more account - // IDs can be specified. - // - // none : Allow AMIs created by your own account only. When none is specified, no - // other values can be specified. - ImageProviders []string - - noSmithyDocumentSerde -} - -// Describes the disk container object for an import image task. -type ImageDiskContainer struct { - - // The description of the disk image. - Description *string - - // The block device mapping for the disk. - DeviceName *string - - // The format of the disk image being imported. - // - // Valid values: OVA | VHD | VHDX | VMDK | RAW - Format *string - - // The ID of the EBS snapshot to be used for importing the snapshot. - SnapshotId *string - - // The URL to the Amazon S3-based disk image being imported. The URL can either be - // a https URL (https://..) or an Amazon S3 URL (s3://..) - Url *string - - // The S3 bucket for the disk image. - UserBucket *UserBucket - - noSmithyDocumentSerde -} - -// Information about the AMI. -type ImageMetadata struct { - - // The date and time the AMI was created. - CreationDate *string - - // The deprecation date and time of the AMI, in UTC, in the following format: - // YYYY-MM-DDTHH:MM:SSZ. - DeprecationTime *string - - // If true , the AMI satisfies the criteria for Allowed AMIs and can be discovered - // and used in the account. If false , the AMI can't be discovered or used in the - // account. - // - // For more information, see [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs] in Amazon EC2 User Guide. - // - // [Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html - ImageAllowed *bool - - // The ID of the AMI. - ImageId *string - - // The alias of the AMI owner. - // - // Valid values: amazon | aws-backup-vault | aws-marketplace - ImageOwnerAlias *string - - // Indicates whether the AMI has public launch permissions. A value of true means - // this AMI has public launch permissions, while false means it has only implicit - // (AMI owner) or explicit (shared with your account) launch permissions. - IsPublic *bool - - // The name of the AMI. - Name *string - - // The ID of the Amazon Web Services account that owns the AMI. - OwnerId *string - - // The current state of the AMI. If the state is available , the AMI is - // successfully registered and can be used to launch an instance. - State ImageState - - noSmithyDocumentSerde -} - -// Information about an AMI that is currently in the Recycle Bin. -type ImageRecycleBinInfo struct { - - // The description of the AMI. - Description *string - - // The ID of the AMI. - ImageId *string - - // The name of the AMI. - Name *string - - // The date and time when the AMI entered the Recycle Bin. - RecycleBinEnterTime *time.Time - - // The date and time when the AMI is to be permanently deleted from the Recycle - // Bin. - RecycleBinExitTime *time.Time - - noSmithyDocumentSerde -} - -// The request information of license configurations. -type ImportImageLicenseConfigurationRequest struct { - - // The ARN of a license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// The response information for license configurations. -type ImportImageLicenseConfigurationResponse struct { - - // The ARN of a license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// Describes an import image task. -type ImportImageTask struct { - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 | arm64 - Architecture *string - - // The boot mode of the virtual machine. - BootMode BootModeValues - - // A description of the import task. - Description *string - - // Indicates whether the image is encrypted. - Encrypted *bool - - // The target hypervisor for the import task. - // - // Valid values: xen - Hypervisor *string - - // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. - ImageId *string - - // The ID of the import image task. - ImportTaskId *string - - // The identifier for the KMS key that was used to create the encrypted image. - KmsKeyId *string - - // The ARNs of the license configurations that are associated with the import - // image task. - LicenseSpecifications []ImportImageLicenseConfigurationResponse - - // The license type of the virtual machine. - LicenseType *string - - // The description string for the import image task. - Platform *string - - // The percentage of progress of the import image task. - Progress *string - - // Information about the snapshots. - SnapshotDetails []SnapshotDetail - - // A brief status for the import image task. - Status *string - - // A descriptive status message for the import image task. - StatusMessage *string - - // The tags for the import image task. - Tags []Tag - - // The usage operation value. - UsageOperation *string - - noSmithyDocumentSerde -} - -// Describes the launch specification for VM import. -type ImportInstanceLaunchSpecification struct { - - // Reserved. - AdditionalInfo *string - - // The architecture of the instance. - Architecture ArchitectureValues - - // The security group IDs. - GroupIds []string - - // The security group names. - GroupNames []string - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior ShutdownBehavior - - // The instance type. For more information about the instance types that you can - // import, see [Instance Types]in the VM Import/Export User Guide. - // - // [Instance Types]: https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-instance-types - InstanceType InstanceType - - // Indicates whether monitoring is enabled. - Monitoring *bool - - // The placement information for the instance. - Placement *Placement - - // [EC2-VPC] An available IP address from the IP address range of the subnet. - PrivateIpAddress *string - - // [EC2-VPC] The ID of the subnet in which to launch the instance. - SubnetId *string - - // The Base64-encoded user data to make available to the instance. - UserData *UserData - - noSmithyDocumentSerde -} - -// Describes an import instance task. -type ImportInstanceTaskDetails struct { - - // A description of the task. - Description *string - - // The ID of the instance. - InstanceId *string - - // The instance operating system. - Platform PlatformValues - - // The volumes. - Volumes []ImportInstanceVolumeDetailItem - - noSmithyDocumentSerde -} - -// Describes an import volume task. -type ImportInstanceVolumeDetailItem struct { - - // The Availability Zone where the resulting instance will reside. - AvailabilityZone *string - - // The number of bytes converted so far. - BytesConverted *int64 - - // A description of the task. - Description *string - - // The image. - Image *DiskImageDescription - - // The status of the import of this particular disk image. - Status *string - - // The status information or errors related to the disk image. - StatusMessage *string - - // The volume. - Volume *DiskImageVolumeDescription - - noSmithyDocumentSerde -} - -// Describes an import snapshot task. -type ImportSnapshotTask struct { - - // A description of the import snapshot task. - Description *string - - // The ID of the import snapshot task. - ImportTaskId *string - - // Describes an import snapshot task. - SnapshotTaskDetail *SnapshotTaskDetail - - // The tags for the import snapshot task. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an import volume task. -type ImportVolumeTaskDetails struct { - - // The Availability Zone where the resulting volume will reside. - AvailabilityZone *string - - // The number of bytes converted so far. - BytesConverted *int64 - - // The description you provided when starting the import volume task. - Description *string - - // The image. - Image *DiskImageDescription - - // The volume. - Volume *DiskImageVolumeDescription - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes the Inference accelerators for the instance type. -type InferenceAcceleratorInfo struct { - - // Describes the Inference accelerators for the instance type. - Accelerators []InferenceDeviceInfo - - // The total size of the memory for the inference accelerators for the instance - // type, in MiB. - TotalInferenceMemoryInMiB *int32 - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes the Inference accelerators for the instance type. -type InferenceDeviceInfo struct { - - // The number of Inference accelerators for the instance type. - Count *int32 - - // The manufacturer of the Inference accelerator. - Manufacturer *string - - // Describes the memory available to the inference accelerator. - MemoryInfo *InferenceDeviceMemoryInfo - - // The name of the Inference accelerator. - Name *string - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes the memory available to the inference accelerator. -type InferenceDeviceMemoryInfo struct { - - // The size of the memory available to the inference accelerator, in MiB. - SizeInMiB *int32 - - noSmithyDocumentSerde -} - -// Information about the volume initialization. For more information, see [Initialize Amazon EBS volumes]. -// -// [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html -type InitializationStatusDetails struct { - - // The estimated remaining time, in seconds, for volume initialization to - // complete. Returns 0 when volume initialization has completed. - // - // Only available for volumes created with Amazon EBS Provisioned Rate for Volume - // Initialization. - EstimatedTimeToCompleteInSeconds *int64 - - // The method used for volume initialization. Possible values include: - // - // - default - Volume initialized using the default volume initialization rate or - // fast snapshot restore. - // - // - provisioned-rate - Volume initialized using an Amazon EBS Provisioned Rate - // for Volume Initialization. - InitializationType InitializationType - - // The current volume initialization progress as a percentage (0-100). Returns 100 - // when volume initialization has completed. - Progress *int64 - - noSmithyDocumentSerde -} - -// Describes an instance. -type Instance struct { - - // The AMI launch index, which can be used to find this instance in the launch - // group. - AmiLaunchIndex *int32 - - // The architecture of the image. - Architecture ArchitectureValues - - // Any block device mapping entries for the instance. - BlockDeviceMappings []InstanceBlockDeviceMapping - - // The boot mode that was specified by the AMI. If the value is uefi-preferred , - // the AMI supports both UEFI and Legacy BIOS. The currentInstanceBootMode - // parameter is the boot mode that is used to boot the instance at launch or start. - // - // The operating system contained in the AMI must be configured to support the - // specified boot mode. - // - // For more information, see [Boot modes] in the Amazon EC2 User Guide. - // - // [Boot modes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html - BootMode BootModeValues - - // The ID of the Capacity Block. - // - // For P5 instances, a Capacity Block ID refers to a group of instances. For Trn2u - // instances, a capacity block ID refers to an EC2 UltraServer. - CapacityBlockId *string - - // The ID of the Capacity Reservation. - CapacityReservationId *string - - // Information about the Capacity Reservation targeting option. - CapacityReservationSpecification *CapacityReservationSpecificationResponse - - // The idempotency token you provided when you launched the instance, if - // applicable. - ClientToken *string - - // The CPU options for the instance. - CpuOptions *CpuOptions - - // The boot mode that is used to boot the instance at launch or start. For more - // information, see [Boot modes]in the Amazon EC2 User Guide. - // - // [Boot modes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html - CurrentInstanceBootMode InstanceBootModeValues - - // Indicates whether the instance is optimized for Amazon EBS I/O. This - // optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using an - // EBS Optimized instance. - EbsOptimized *bool - - // Deprecated. - // - // Amazon Elastic Graphics reached end of life on January 8, 2024. - ElasticGpuAssociations []ElasticGpuAssociation - - // Deprecated - // - // Amazon Elastic Inference is no longer available. - ElasticInferenceAcceleratorAssociations []ElasticInferenceAcceleratorAssociation - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool - - // Indicates whether the instance is enabled for Amazon Web Services Nitro - // Enclaves. - EnclaveOptions *EnclaveOptions - - // Indicates whether the instance is enabled for hibernation. - HibernationOptions *HibernationOptions - - // The hypervisor type of the instance. The value xen is used for both Xen and - // Nitro hypervisors. - Hypervisor HypervisorType - - // The IAM instance profile associated with the instance, if applicable. - IamInstanceProfile *IamInstanceProfile - - // The ID of the AMI used to launch the instance. - ImageId *string - - // The ID of the instance. - InstanceId *string - - // Indicates whether this is a Spot Instance or a Scheduled Instance. - InstanceLifecycle InstanceLifecycleType - - // The instance type. - InstanceType InstanceType - - // The IPv6 address assigned to the instance. - Ipv6Address *string - - // The kernel associated with this instance, if applicable. - KernelId *string - - // The name of the key pair, if this instance was launched with an associated key - // pair. - KeyName *string - - // The time that the instance was last launched. To determine the time that - // instance was first launched, see the attachment time for the primary network - // interface. - LaunchTime *time.Time - - // The license configurations for the instance. - Licenses []LicenseConfiguration - - // Provides information on the recovery and maintenance options of your instance. - MaintenanceOptions *InstanceMaintenanceOptions - - // The metadata options for the instance. - MetadataOptions *InstanceMetadataOptionsResponse - - // The monitoring for the instance. - Monitoring *Monitoring - - // The network interfaces for the instance. - NetworkInterfaces []InstanceNetworkInterface - - // Contains settings for the network performance options for your instance. - NetworkPerformanceOptions *InstanceNetworkPerformanceOptions - - // The service provider that manages the instance. - Operator *OperatorResponse - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The location where the instance launched, if applicable. - Placement *Placement - - // The platform. This value is windows for Windows instances; otherwise, it is - // empty. - Platform PlatformValues - - // The platform details value for the instance. For more information, see [AMI billing information fields] in the - // Amazon EC2 User Guide. - // - // [AMI billing information fields]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html - PlatformDetails *string - - // [IPv4 only] The private DNS hostname name assigned to the instance. This DNS - // hostname can only be used inside the Amazon EC2 network. This name is not - // available until the instance enters the running state. - // - // The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames - // if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not - // using the Amazon-provided DNS server in your VPC, your custom domain name - // servers must resolve the hostname as appropriate. - PrivateDnsName *string - - // The options for the instance hostname. - PrivateDnsNameOptions *PrivateDnsNameOptionsResponse - - // The private IPv4 address assigned to the instance. - PrivateIpAddress *string - - // The product codes attached to this instance, if applicable. - ProductCodes []ProductCode - - // The public DNS name assigned to the instance. This name is not available until - // the instance enters the running state. This name is only available if you've - // enabled DNS hostnames for your VPC. The format of this name depends on the [public hostname type]. - // - // [public hostname type]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hostname-types.html#public-hostnames - PublicDnsName *string - - // The public IPv4 address, or the Carrier IP address assigned to the instance, if - // applicable. - // - // A Carrier IP address only applies to an instance launched in a subnet - // associated with a Wavelength Zone. - PublicIpAddress *string - - // The RAM disk associated with this instance, if applicable. - RamdiskId *string - - // The device name of the root device volume (for example, /dev/sda1 ). - RootDeviceName *string - - // The root device type used by the AMI. The AMI can use an EBS volume or an - // instance store volume. - RootDeviceType DeviceType - - // The security groups for the instance. - SecurityGroups []GroupIdentifier - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *bool - - // If the request is a Spot Instance request, the ID of the request. - SpotInstanceRequestId *string - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string - - // The current state of the instance. - State *InstanceState - - // The reason for the most recent state transition. - StateReason *StateReason - - // The reason for the most recent state transition. This might be an empty string. - StateTransitionReason *string - - // The ID of the subnet in which the instance is running. - SubnetId *string - - // Any tags assigned to the instance. - Tags []Tag - - // If the instance is configured for NitroTPM support, the value is v2.0 . For more - // information, see [NitroTPM]in the Amazon EC2 User Guide. - // - // [NitroTPM]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html - TpmSupport *string - - // The usage operation value for the instance. For more information, see [AMI billing information fields] in the - // Amazon EC2 User Guide. - // - // [AMI billing information fields]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html - UsageOperation *string - - // The time that the usage operation was last updated. - UsageOperationUpdateTime *time.Time - - // The virtualization type of the instance. - VirtualizationType VirtualizationType - - // The ID of the VPC in which the instance is running. - VpcId *string - - noSmithyDocumentSerde -} - -// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) -// technology to increase the maximum bandwidth used per stream and minimize tail -// latency of network traffic between EC2 instances. With ENA Express, you can -// communicate between two EC2 instances in the same subnet within the same -// account, or in different accounts. Both sending and receiving instances must -// have ENA Express enabled. -// -// To improve the reliability of network packet delivery, ENA Express reorders -// network packets on the receiving end by default. However, some UDP-based -// applications are designed to handle network packets that are out of order to -// reduce the overhead for packet delivery at the network layer. When ENA Express -// is enabled, you can specify whether UDP network traffic uses it. -type InstanceAttachmentEnaSrdSpecification struct { - - // Indicates whether ENA Express is enabled for the network interface. - EnaSrdEnabled *bool - - // Configures ENA Express for UDP network traffic. - EnaSrdUdpSpecification *InstanceAttachmentEnaSrdUdpSpecification - - noSmithyDocumentSerde -} - -// ENA Express is compatible with both TCP and UDP transport protocols. When it's -// enabled, TCP traffic automatically uses it. However, some UDP-based applications -// are designed to handle network packets that are out of order, without a need for -// retransmission, such as live video broadcasting or other near-real-time -// applications. For UDP traffic, you can specify whether to use ENA Express, based -// on your application environment needs. -type InstanceAttachmentEnaSrdUdpSpecification struct { - - // Indicates whether UDP traffic to and from the instance uses ENA Express. To - // specify this setting, you must first enable ENA Express. - EnaSrdUdpEnabled *bool - - noSmithyDocumentSerde -} - -// Describes a block device mapping. -type InstanceBlockDeviceMapping struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDevice - - noSmithyDocumentSerde -} - -// Describes a block device mapping entry. -type InstanceBlockDeviceMappingSpecification struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDeviceSpecification - - // Suppresses the specified device included in the block device mapping. - NoDevice *string - - // The virtual device name. - VirtualName *string - - noSmithyDocumentSerde -} - -// Information about the number of instances that can be launched onto the -// Dedicated Host. -type InstanceCapacity struct { - - // The number of instances that can be launched onto the Dedicated Host based on - // the host's available capacity. - AvailableCapacity *int32 - - // The instance type supported by the Dedicated Host. - InstanceType *string - - // The total number of instances that can be launched onto the Dedicated Host if - // there are no instances running on it. - TotalCapacity *int32 - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance listing state. -type InstanceCount struct { - - // The number of listed Reserved Instances in the state specified by the state . - InstanceCount *int32 - - // The states of the listed Reserved Instances. - State ListingState - - noSmithyDocumentSerde -} - -// Describes the credit option for CPU usage of a burstable performance instance. -type InstanceCreditSpecification struct { - - // The credit option for CPU usage of the instance. - // - // Valid values: standard | unlimited - CpuCredits *string - - // The ID of the instance. - InstanceId *string - - noSmithyDocumentSerde -} - -// Describes the credit option for CPU usage of a burstable performance instance. -type InstanceCreditSpecificationRequest struct { - - // The ID of the instance. - // - // This member is required. - InstanceId *string - - // The credit option for CPU usage of the instance. - // - // Valid values: standard | unlimited - // - // T3 instances with host tenancy do not support the unlimited CPU credit option. - CpuCredits *string - - noSmithyDocumentSerde -} - -// The event window. -type InstanceEventWindow struct { - - // One or more targets associated with the event window. - AssociationTarget *InstanceEventWindowAssociationTarget - - // The cron expression defined for the event window. - CronExpression *string - - // The ID of the event window. - InstanceEventWindowId *string - - // The name of the event window. - Name *string - - // The current state of the event window. - State InstanceEventWindowState - - // The instance tags associated with the event window. - Tags []Tag - - // One or more time ranges defined for the event window. - TimeRanges []InstanceEventWindowTimeRange - - noSmithyDocumentSerde -} - -// One or more targets associated with the specified event window. Only one type -// of target (instance ID, instance tag, or Dedicated Host ID) can be associated -// with an event window. -type InstanceEventWindowAssociationRequest struct { - - // The IDs of the Dedicated Hosts to associate with the event window. - DedicatedHostIds []string - - // The IDs of the instances to associate with the event window. If the instance is - // on a Dedicated Host, you can't specify the Instance ID parameter; you must use - // the Dedicated Host ID parameter. - InstanceIds []string - - // The instance tags to associate with the event window. Any instances associated - // with the tags will be associated with the event window. - // - // Note that while you can't create tag keys beginning with aws: , you can specify - // existing Amazon Web Services managed tag keys (with the aws: prefix) when - // specifying them as targets to associate with the event window. - InstanceTags []Tag - - noSmithyDocumentSerde -} - -// One or more targets associated with the event window. -type InstanceEventWindowAssociationTarget struct { - - // The IDs of the Dedicated Hosts associated with the event window. - DedicatedHostIds []string - - // The IDs of the instances associated with the event window. - InstanceIds []string - - // The instance tags associated with the event window. Any instances associated - // with the tags will be associated with the event window. - // - // Note that while you can't create tag keys beginning with aws: , you can specify - // existing Amazon Web Services managed tag keys (with the aws: prefix) when - // specifying them as targets to associate with the event window. - Tags []Tag - - noSmithyDocumentSerde -} - -// The targets to disassociate from the specified event window. -type InstanceEventWindowDisassociationRequest struct { - - // The IDs of the Dedicated Hosts to disassociate from the event window. - DedicatedHostIds []string - - // The IDs of the instances to disassociate from the event window. - InstanceIds []string - - // The instance tags to disassociate from the event window. Any instances - // associated with the tags will be disassociated from the event window. - InstanceTags []Tag - - noSmithyDocumentSerde -} - -// The state of the event window. -type InstanceEventWindowStateChange struct { - - // The ID of the event window. - InstanceEventWindowId *string - - // The current state of the event window. - State InstanceEventWindowState - - noSmithyDocumentSerde -} - -// The start day and time and the end day and time of the time range, in UTC. -type InstanceEventWindowTimeRange struct { - - // The hour when the time range ends. - EndHour *int32 - - // The day on which the time range ends. - EndWeekDay WeekDay - - // The hour when the time range begins. - StartHour *int32 - - // The day on which the time range begins. - StartWeekDay WeekDay - - noSmithyDocumentSerde -} - -// The start day and time and the end day and time of the time range, in UTC. -type InstanceEventWindowTimeRangeRequest struct { - - // The hour when the time range ends. - EndHour *int32 - - // The day on which the time range ends. - EndWeekDay WeekDay - - // The hour when the time range begins. - StartHour *int32 - - // The day on which the time range begins. - StartWeekDay WeekDay - - noSmithyDocumentSerde -} - -// Describes an instance to export. -type InstanceExportDetails struct { - - // The ID of the resource being exported. - InstanceId *string - - // The target virtualization environment. - TargetEnvironment ExportEnvironment - - noSmithyDocumentSerde -} - -// Describes the default credit option for CPU usage of a burstable performance -// instance family. -type InstanceFamilyCreditSpecification struct { - - // The default credit option for CPU usage of the instance family. Valid values - // are standard and unlimited . - CpuCredits *string - - // The instance family. - InstanceFamily UnlimitedSupportedInstanceFamily - - noSmithyDocumentSerde -} - -// Information about the instance and the AMI used to launch the instance. -type InstanceImageMetadata struct { - - // The Availability Zone or Local Zone of the instance. - AvailabilityZone *string - - // Information about the AMI used to launch the instance. - ImageMetadata *ImageMetadata - - // The ID of the instance. - InstanceId *string - - // The instance type. - InstanceType InstanceType - - // The time the instance was launched. - LaunchTime *time.Time - - // The entity that manages the instance. - Operator *OperatorResponse - - // The ID of the Amazon Web Services account that owns the instance. - OwnerId *string - - // The current state of the instance. - State *InstanceState - - // Any tags assigned to the instance. - Tags []Tag - - // The ID of the Availability Zone or Local Zone of the instance. - ZoneId *string - - noSmithyDocumentSerde -} - -// Information about an IPv4 prefix. -type InstanceIpv4Prefix struct { - - // One or more IPv4 prefixes assigned to the network interface. - Ipv4Prefix *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 address. -type InstanceIpv6Address struct { - - // The IPv6 address. - Ipv6Address *string - - // Determines if an IPv6 address associated with a network interface is the - // primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, - // the first IPv6 GUA will be made the primary IPv6 address until the instance is - // terminated or the network interface is detached. For more information, see [RunInstances]. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - IsPrimaryIpv6 *bool - - noSmithyDocumentSerde -} - -// Describes an IPv6 address. -type InstanceIpv6AddressRequest struct { - - // The IPv6 address. - Ipv6Address *string - - noSmithyDocumentSerde -} - -// Information about an IPv6 prefix. -type InstanceIpv6Prefix struct { - - // One or more IPv6 prefixes assigned to the network interface. - Ipv6Prefix *string - - noSmithyDocumentSerde -} - -// The maintenance options for the instance. -type InstanceMaintenanceOptions struct { - - // Provides information on the current automatic recovery behavior of your - // instance. - AutoRecovery InstanceAutoRecoveryState - - // Specifies whether to attempt reboot migration during a user-initiated reboot of - // an instance that has a scheduled system-reboot event: - // - // - default - Amazon EC2 attempts to migrate the instance to new hardware - // (reboot migration). If successful, the system-reboot event is cleared. If - // unsuccessful, an in-place reboot occurs and the event remains scheduled. - // - // - disabled - Amazon EC2 keeps the instance on the same hardware (in-place - // reboot). The system-reboot event remains scheduled. - // - // This setting only applies to supported instances that have a scheduled reboot - // event. For more information, see [Enable or disable reboot migration]in the Amazon EC2 User Guide. - // - // [Enable or disable reboot migration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/schedevents_actions_reboot.html#reboot-migration - RebootMigration InstanceRebootMigrationState - - noSmithyDocumentSerde -} - -// The maintenance options for the instance. -type InstanceMaintenanceOptionsRequest struct { - - // Disables the automatic recovery behavior of your instance or sets it to - // default. For more information, see [Simplified automatic recovery]. - // - // [Simplified automatic recovery]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery - AutoRecovery InstanceAutoRecoveryState - - noSmithyDocumentSerde -} - -// Describes the market (purchasing) option for the instances. -type InstanceMarketOptionsRequest struct { - - // The market type. - MarketType MarketType - - // The options for Spot Instances. - SpotOptions *SpotMarketOptions - - noSmithyDocumentSerde -} - -// The default instance metadata service (IMDS) settings that were set at the -// account level in the specified Amazon Web Services
 Region. -type InstanceMetadataDefaultsResponse struct { - - // Indicates whether the IMDS endpoint for an instance is enabled or disabled. - // When disabled, the instance metadata can't be accessed. - HttpEndpoint InstanceMetadataEndpointState - - // The maximum number of hops that the metadata token can travel. - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional – IMDSv2 is optional, which means that you can use either IMDSv2 or - // IMDSv1. - // - // - required – IMDSv2 is required, which means that IMDSv1 is disabled, and you - // must use IMDSv2. - HttpTokens HttpTokensState - - // Indicates whether access to instance tags from the instance metadata is enabled - // or disabled. For more information, see [Work with instance tags using the instance metadata]in the Amazon EC2 User Guide. - // - // [Work with instance tags using the instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS - InstanceMetadataTags InstanceMetadataTagsState - - // The entity that manages the IMDS default settings. Possible values include: - // - // - account - The IMDS default settings are managed by the account. - // - // - declarative-policy - The IMDS default settings are managed by a declarative - // policy and can't be modified by the account. - ManagedBy ManagedBy - - // The customized exception message that is specified in the declarative policy. - ManagedExceptionMessage *string - - noSmithyDocumentSerde -} - -// The metadata options for the instance. -type InstanceMetadataOptionsRequest struct { - - // Enables or disables the HTTP metadata endpoint on your instances. - // - // If you specify a value of disabled , you cannot access your instance metadata. - // - // Default: enabled - HttpEndpoint InstanceMetadataEndpointState - - // Enables or disables the IPv6 endpoint for the instance metadata service. - // - // Default: disabled - HttpProtocolIpv6 InstanceMetadataProtocolState - - // The maximum number of hops that the metadata token can travel. - // - // Possible values: Integers from 1 to 64 - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional - IMDSv2 is optional, which means that you can use either IMDSv2 or - // IMDSv1. - // - // - required - IMDSv2 is required, which means that IMDSv1 is disabled, and you - // must use IMDSv2. - // - // Default: - // - // - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your - // instance is v2.0 and the account level default is set to no-preference , the - // default is required . - // - // - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your - // instance is v2.0 , but the account level default is set to V1 or V2 , the - // default is optional . - // - // The default value can also be affected by other combinations of parameters. For - // more information, see [Order of precedence for instance metadata options]in the Amazon EC2 User Guide. - // - // [Order of precedence for instance metadata options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence - HttpTokens HttpTokensState - - // Set to enabled to allow access to instance tags from the instance metadata. Set - // to disabled to turn off access to instance tags from the instance metadata. For - // more information, see [Work with instance tags using the instance metadata]. - // - // Default: disabled - // - // [Work with instance tags using the instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS - InstanceMetadataTags InstanceMetadataTagsState - - noSmithyDocumentSerde -} - -// The metadata options for the instance. -type InstanceMetadataOptionsResponse struct { - - // Indicates whether the HTTP metadata endpoint on your instances is enabled or - // disabled. - // - // If the value is disabled , you cannot access your instance metadata. - HttpEndpoint InstanceMetadataEndpointState - - // Indicates whether the IPv6 endpoint for the instance metadata service is - // enabled or disabled. - // - // Default: disabled - HttpProtocolIpv6 InstanceMetadataProtocolState - - // The maximum number of hops that the metadata token can travel. - // - // Possible values: Integers from 1 to 64 - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional - IMDSv2 is optional, which means that you can use either IMDSv2 or - // IMDSv1. - // - // - required - IMDSv2 is required, which means that IMDSv1 is disabled, and you - // must use IMDSv2. - HttpTokens HttpTokensState - - // Indicates whether access to instance tags from the instance metadata is enabled - // or disabled. For more information, see [Work with instance tags using the instance metadata]. - // - // [Work with instance tags using the instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS - InstanceMetadataTags InstanceMetadataTagsState - - // The state of the metadata option changes. - // - // pending - The metadata options are being updated and the instance is not ready - // to process metadata traffic with the new selection. - // - // applied - The metadata options have been successfully applied on the instance. - State InstanceMetadataOptionsState - - noSmithyDocumentSerde -} - -// Describes the monitoring of an instance. -type InstanceMonitoring struct { - - // The ID of the instance. - InstanceId *string - - // The monitoring for the instance. - Monitoring *Monitoring - - noSmithyDocumentSerde -} - -// Describes a network interface. -type InstanceNetworkInterface struct { - - // The association information for an Elastic IPv4 associated with the network - // interface. - Association *InstanceNetworkInterfaceAssociation - - // The network interface attachment. - Attachment *InstanceNetworkInterfaceAttachment - - // A security group connection tracking configuration that enables you to set the - // timeout for connection tracking on an Elastic network interface. For more - // information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. - // - // [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts - ConnectionTrackingConfiguration *ConnectionTrackingSpecificationResponse - - // The description. - Description *string - - // The security groups. - Groups []GroupIdentifier - - // The type of network interface. - // - // Valid values: interface | efa | efa-only | evs | trunk - InterfaceType *string - - // The IPv4 delegated prefixes that are assigned to the network interface. - Ipv4Prefixes []InstanceIpv4Prefix - - // The IPv6 addresses associated with the network interface. - Ipv6Addresses []InstanceIpv6Address - - // The IPv6 delegated prefixes that are assigned to the network interface. - Ipv6Prefixes []InstanceIpv6Prefix - - // The MAC address. - MacAddress *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The service provider that manages the network interface. - Operator *OperatorResponse - - // The ID of the Amazon Web Services account that created the network interface. - OwnerId *string - - // The private DNS name. - PrivateDnsName *string - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string - - // The private IPv4 addresses associated with the network interface. - PrivateIpAddresses []InstancePrivateIpAddress - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *bool - - // The status of the network interface. - Status NetworkInterfaceStatus - - // The ID of the subnet. - SubnetId *string - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes association information for an Elastic IP address (IPv4). -type InstanceNetworkInterfaceAssociation struct { - - // The carrier IP address associated with the network interface. - CarrierIp *string - - // The customer-owned IP address associated with the network interface. - CustomerOwnedIp *string - - // The ID of the owner of the Elastic IP address. - IpOwnerId *string - - // The public DNS name. - PublicDnsName *string - - // The public IP address or Elastic IP address bound to the network interface. - PublicIp *string - - noSmithyDocumentSerde -} - -// Describes a network interface attachment. -type InstanceNetworkInterfaceAttachment struct { - - // The time stamp when the attachment initiated. - AttachTime *time.Time - - // The ID of the network interface attachment. - AttachmentId *string - - // Indicates whether the network interface is deleted when the instance is - // terminated. - DeleteOnTermination *bool - - // The index of the device on the instance for the network interface attachment. - DeviceIndex *int32 - - // The number of ENA queues created with the instance. - EnaQueueCount *int32 - - // Contains the ENA Express settings for the network interface that's attached to - // the instance. - EnaSrdSpecification *InstanceAttachmentEnaSrdSpecification - - // The index of the network card. - NetworkCardIndex *int32 - - // The attachment state. - Status AttachmentStatus - - noSmithyDocumentSerde -} - -// Describes a network interface. -type InstanceNetworkInterfaceSpecification struct { - - // Indicates whether to assign a carrier IP address to the network interface. - // - // You can only assign a carrier IP address to a network interface that is in a - // subnet in a Wavelength Zone. For more information about carrier IP addresses, - // see [Carrier IP address]in the Amazon Web Services Wavelength Developer Guide. - // - // [Carrier IP address]: https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#provider-owned-ip - AssociateCarrierIpAddress *bool - - // Indicates whether to assign a public IPv4 address to an instance you launch in - // a VPC. The public IP address can only be assigned to a network interface for - // eth0, and can only be assigned to a new network interface, not an existing one. - // You cannot specify more than one network interface in the request. If launching - // into a default subnet, the default value is true . - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - AssociatePublicIpAddress *bool - - // A security group connection tracking specification that enables you to set the - // timeout for connection tracking on an Elastic network interface. For more - // information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. - // - // [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts - ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest - - // If set to true , the interface is deleted when the instance is terminated. You - // can specify true only if creating a new network interface when launching an - // instance. - DeleteOnTermination *bool - - // The description of the network interface. Applies only if creating a network - // interface when launching an instance. - Description *string - - // The position of the network interface in the attachment order. A primary - // network interface has a device index of 0. - // - // If you specify a network interface when launching an instance, you must specify - // the device index. - DeviceIndex *int32 - - // The number of ENA queues to be created with the instance. - EnaQueueCount *int32 - - // Specifies the ENA Express settings for the network interface that's attached to - // the instance. - EnaSrdSpecification *EnaSrdSpecificationRequest - - // The IDs of the security groups for the network interface. Applies only if - // creating a network interface when launching an instance. - Groups []string - - // The type of network interface. - // - // If you specify efa-only , do not assign any IP addresses to the network - // interface. EFA-only network interfaces do not support IP addresses. - // - // Valid values: interface | efa | efa-only - InterfaceType *string - - // The number of IPv4 delegated prefixes to be automatically assigned to the - // network interface. You cannot use this option if you use the Ipv4Prefix option. - Ipv4PrefixCount *int32 - - // The IPv4 delegated prefixes to be assigned to the network interface. You cannot - // use this option if you use the Ipv4PrefixCount option. - Ipv4Prefixes []Ipv4PrefixSpecificationRequest - - // A number of IPv6 addresses to assign to the network interface. Amazon EC2 - // chooses the IPv6 addresses from the range of the subnet. You cannot specify this - // option and the option to assign specific IPv6 addresses in the same request. You - // can specify this option if you've specified a minimum number of instances to - // launch. - Ipv6AddressCount *int32 - - // The IPv6 addresses to assign to the network interface. You cannot specify this - // option and the option to assign a number of IPv6 addresses in the same request. - // You cannot specify this option if you've specified a minimum number of instances - // to launch. - Ipv6Addresses []InstanceIpv6Address - - // The number of IPv6 delegated prefixes to be automatically assigned to the - // network interface. You cannot use this option if you use the Ipv6Prefix option. - Ipv6PrefixCount *int32 - - // The IPv6 delegated prefixes to be assigned to the network interface. You cannot - // use this option if you use the Ipv6PrefixCount option. - Ipv6Prefixes []Ipv6PrefixSpecificationRequest - - // The index of the network card. Some instance types support multiple network - // cards. The primary network interface must be assigned to network card index 0. - // The default is network card index 0. - // - // If you are using [RequestSpotInstances] to create Spot Instances, omit this parameter because you - // can’t specify the network card index when using this API. To specify the network - // card index, use [RunInstances]. - // - // [RequestSpotInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - NetworkCardIndex *int32 - - // The ID of the network interface. - // - // If you are creating a Spot Fleet, omit this parameter because you can’t specify - // a network interface ID in a launch specification. - NetworkInterfaceId *string - - // The primary IPv6 address of the network interface. When you enable an IPv6 GUA - // address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 - // address until the instance is terminated or the network interface is detached. - // For more information about primary IPv6 addresses, see [RunInstances]. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - PrimaryIpv6 *bool - - // The private IPv4 address of the network interface. Applies only if creating a - // network interface when launching an instance. You cannot specify this option if - // you're launching more than one instance in a [RunInstances]request. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - PrivateIpAddress *string - - // The private IPv4 addresses to assign to the network interface. Only one private - // IPv4 address can be designated as primary. You cannot specify this option if - // you're launching more than one instance in a [RunInstances]request. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - PrivateIpAddresses []PrivateIpAddressSpecification - - // The number of secondary private IPv4 addresses. You can’t specify this - // parameter and also specify a secondary private IP address using the - // PrivateIpAddress parameter. - SecondaryPrivateIpAddressCount *int32 - - // The ID of the subnet associated with the network interface. Applies only if - // creating a network interface when launching an instance. - SubnetId *string - - noSmithyDocumentSerde -} - -// With network performance options, you can adjust your bandwidth preferences to -// meet the needs of the workload that runs on your instance. -type InstanceNetworkPerformanceOptions struct { - - // When you configure network bandwidth weighting, you can boost your baseline - // bandwidth for either networking or EBS by up to 25%. The total available - // baseline bandwidth for your instance remains the same. The default option uses - // the standard bandwidth configuration for your instance type. - BandwidthWeighting InstanceBandwidthWeighting - - noSmithyDocumentSerde -} - -// Configure network performance options for your instance that are geared towards -// performance improvements based on the workload that it runs. -type InstanceNetworkPerformanceOptionsRequest struct { - - // Specify the bandwidth weighting option to boost the associated type of baseline - // bandwidth, as follows: - // - // default This option uses the standard bandwidth configuration for your instance - // type. - // - // vpc-1 This option boosts your networking baseline bandwidth and reduces your - // EBS baseline bandwidth. - // - // ebs-1 This option boosts your EBS baseline bandwidth and reduces your - // networking baseline bandwidth. - BandwidthWeighting InstanceBandwidthWeighting - - noSmithyDocumentSerde -} - -// Describes a private IPv4 address. -type InstancePrivateIpAddress struct { - - // The association information for an Elastic IP address for the network interface. - Association *InstanceNetworkInterfaceAssociation - - // Indicates whether this IPv4 address is the primary private IP address of the - // network interface. - Primary *bool - - // The private IPv4 DNS name. - PrivateDnsName *string - - // The private IPv4 address of the network interface. - PrivateIpAddress *string - - noSmithyDocumentSerde -} - -// The attributes for the instance types. When you specify instance attributes, -// Amazon EC2 will identify instance types with these attributes. -// -// You must specify VCpuCount and MemoryMiB . All other attributes are optional. -// Any unspecified optional attribute is set to its default. -// -// When you specify multiple attributes, you get instance types that satisfy all -// of the specified attributes. If you specify multiple values for an attribute, -// you get instance types that satisfy any of the specified values. -// -// To limit the list of instance types from which Amazon EC2 can identify matching -// instance types, you can use one of the following parameters, but not both in the -// same request: -// -// - AllowedInstanceTypes - The instance types to include in the list. All other -// instance types are ignored, even if they match your specified attributes. -// -// - ExcludedInstanceTypes - The instance types to exclude from the list, even if -// they match your specified attributes. -// -// If you specify InstanceRequirements , you can't specify InstanceType . -// -// Attribute-based instance type selection is only supported when using Auto -// Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to -// use the launch template in the [launch instance wizard]or with the [RunInstances API], you can't specify -// InstanceRequirements . -// -// For more information, see [Create mixed instances group using attribute-based instance type selection] in the Amazon EC2 Auto Scaling User Guide, and also [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet] -// and [Spot placement score]in the Amazon EC2 User Guide. -// -// [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html -// [RunInstances API]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html -// [Create mixed instances group using attribute-based instance type selection]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-mixed-instances-group-attribute-based-instance-type-selection.html -// [Spot placement score]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html -// [launch instance wizard]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance-wizard.html -type InstanceRequirements struct { - - // The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web - // Services Inferentia chips) on an instance. - // - // To exclude accelerator-enabled instance types, set Max to 0 . - // - // Default: No minimum or maximum limits - AcceleratorCount *AcceleratorCount - - // Indicates whether instance types must have accelerators by specific - // manufacturers. - // - // - For instance types with Amazon Web Services devices, specify - // amazon-web-services . - // - // - For instance types with AMD devices, specify amd . - // - // - For instance types with Habana devices, specify habana . - // - // - For instance types with NVIDIA devices, specify nvidia . - // - // - For instance types with Xilinx devices, specify xilinx . - // - // Default: Any manufacturer - AcceleratorManufacturers []AcceleratorManufacturer - - // The accelerators that must be on the instance type. - // - // - For instance types with NVIDIA A10G GPUs, specify a10g . - // - // - For instance types with NVIDIA A100 GPUs, specify a100 . - // - // - For instance types with NVIDIA H100 GPUs, specify h100 . - // - // - For instance types with Amazon Web Services Inferentia chips, specify - // inferentia . - // - // - For instance types with NVIDIA GRID K520 GPUs, specify k520 . - // - // - For instance types with NVIDIA K80 GPUs, specify k80 . - // - // - For instance types with NVIDIA M60 GPUs, specify m60 . - // - // - For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 . - // - // - For instance types with NVIDIA T4 GPUs, specify t4 . - // - // - For instance types with NVIDIA T4G GPUs, specify t4g . - // - // - For instance types with Xilinx VU9P FPGAs, specify vu9p . - // - // - For instance types with NVIDIA V100 GPUs, specify v100 . - // - // Default: Any accelerator - AcceleratorNames []AcceleratorName - - // The minimum and maximum amount of total accelerator memory, in MiB. - // - // Default: No minimum or maximum limits - AcceleratorTotalMemoryMiB *AcceleratorTotalMemoryMiB - - // The accelerator types that must be on the instance type. - // - // - For instance types with FPGA accelerators, specify fpga . - // - // - For instance types with GPU accelerators, specify gpu . - // - // - For instance types with Inference accelerators, specify inference . - // - // Default: Any accelerator type - AcceleratorTypes []AcceleratorType - - // The instance types to apply your specified attributes against. All other - // instance types are ignored, even if they match your specified attributes. - // - // You can use strings with one or more wild cards, represented by an asterisk ( * - // ), to allow an instance type, size, or generation. The following are examples: - // m5.8xlarge , c5*.* , m5a.* , r* , *3* . - // - // For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance - // family, which includes all C5a and C5n instance types. If you specify m5a.* , - // Amazon EC2 will allow all the M5a instance types, but not the M5n instance - // types. - // - // If you specify AllowedInstanceTypes , you can't specify ExcludedInstanceTypes . - // - // Default: All instance types - AllowedInstanceTypes []string - - // Indicates whether bare metal instance types must be included, excluded, or - // required. - // - // - To include bare metal instance types, specify included . - // - // - To require only bare metal instance types, specify required . - // - // - To exclude bare metal instance types, specify excluded . - // - // Default: excluded - BareMetal BareMetal - - // The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more - // information, see [Amazon EBS–optimized instances]in the Amazon EC2 User Guide. - // - // Default: No minimum or maximum limits - // - // [Amazon EBS–optimized instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html - BaselineEbsBandwidthMbps *BaselineEbsBandwidthMbps - - // The baseline performance to consider, using an instance family as a baseline - // reference. The instance family establishes the lowest acceptable level of - // performance. Amazon EC2 uses this baseline to guide instance type selection, but - // there is no guarantee that the selected instance types will always exceed the - // baseline for every application. Currently, this parameter only supports CPU - // performance as a baseline performance factor. For more information, see [Performance protection]in the - // Amazon EC2 User Guide. - // - // [Performance protection]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abis-performance-protection - BaselinePerformanceFactors *BaselinePerformanceFactors - - // Indicates whether burstable performance T instance types are included, - // excluded, or required. For more information, see [Burstable performance instances]. - // - // - To include burstable performance instance types, specify included . - // - // - To require only burstable performance instance types, specify required . - // - // - To exclude burstable performance instance types, specify excluded . - // - // Default: excluded - // - // [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html - BurstablePerformance BurstablePerformance - - // The CPU manufacturers to include. - // - // - For instance types with Intel CPUs, specify intel . - // - // - For instance types with AMD CPUs, specify amd . - // - // - For instance types with Amazon Web Services CPUs, specify - // amazon-web-services . - // - // - For instance types with Apple CPUs, specify apple . - // - // Don't confuse the CPU manufacturer with the CPU architecture. Instances will be - // launched with a compatible CPU architecture based on the Amazon Machine Image - // (AMI) that you specify in your launch template. - // - // Default: Any manufacturer - CpuManufacturers []CpuManufacturer - - // The instance types to exclude. - // - // You can use strings with one or more wild cards, represented by an asterisk ( * - // ), to exclude an instance type, size, or generation. The following are examples: - // m5.8xlarge , c5*.* , m5a.* , r* , *3* . - // - // For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance - // family, which includes all C5a and C5n instance types. If you specify m5a.* , - // Amazon EC2 will exclude all the M5a instance types, but not the M5n instance - // types. - // - // If you specify ExcludedInstanceTypes , you can't specify AllowedInstanceTypes . - // - // Default: No excluded instance types - ExcludedInstanceTypes []string - - // Indicates whether current or previous generation instance types are included. - // The current generation instance types are recommended for use. Current - // generation instance types are typically the latest two to three generations in - // each instance family. For more information, see [Instance types]in the Amazon EC2 User Guide. - // - // For current generation instance types, specify current . - // - // For previous generation instance types, specify previous . - // - // Default: Current and previous generation instance types - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceGenerations []InstanceGeneration - - // Indicates whether instance types with instance store volumes are included, - // excluded, or required. For more information, [Amazon EC2 instance store]in the Amazon EC2 User Guide. - // - // - To include instance types with instance store volumes, specify included . - // - // - To require only instance types with instance store volumes, specify required - // . - // - // - To exclude instance types with instance store volumes, specify excluded . - // - // Default: included - // - // [Amazon EC2 instance store]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html - LocalStorage LocalStorage - - // The type of local storage that is required. - // - // - For instance types with hard disk drive (HDD) storage, specify hdd . - // - // - For instance types with solid state drive (SSD) storage, specify ssd . - // - // Default: hdd and ssd - LocalStorageTypes []LocalStorageType - - // [Price protection] The price protection threshold for Spot Instances, as a - // percentage of an identified On-Demand price. The identified On-Demand price is - // the price of the lowest priced current generation C, M, or R instance type with - // your specified attributes. If no current generation C, M, or R instance type - // matches your attributes, then the identified price is from the lowest priced - // current generation instance types, and failing that, from the lowest priced - // previous generation instance types that match your attributes. When Amazon EC2 - // selects instance types with your attributes, it will exclude instance types - // whose price exceeds your specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is based on the per vCPU or per memory price instead of the per - // instance price. - // - // Only one of SpotMaxPricePercentageOverLowestPrice or - // MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't - // specify either, Amazon EC2 will automatically apply optimal price protection to - // consistently select from a wide range of instance types. To indicate no price - // protection threshold for Spot Instances, meaning you want to consider all - // instance types that match your attributes, include one of these parameters and - // specify a high value, such as 999999 . - MaxSpotPriceAsPercentageOfOptimalOnDemandPrice *int32 - - // The minimum and maximum amount of memory per vCPU, in GiB. - // - // Default: No minimum or maximum limits - MemoryGiBPerVCpu *MemoryGiBPerVCpu - - // The minimum and maximum amount of memory, in MiB. - MemoryMiB *MemoryMiB - - // The minimum and maximum amount of network bandwidth, in gigabits per second - // (Gbps). - // - // Default: No minimum or maximum limits - NetworkBandwidthGbps *NetworkBandwidthGbps - - // The minimum and maximum number of network interfaces. - // - // Default: No minimum or maximum limits - NetworkInterfaceCount *NetworkInterfaceCount - - // [Price protection] The price protection threshold for On-Demand Instances, as a - // percentage higher than an identified On-Demand price. The identified On-Demand - // price is the price of the lowest priced current generation C, M, or R instance - // type with your specified attributes. When Amazon EC2 selects instance types with - // your attributes, it will exclude instance types whose price exceeds your - // specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // To turn off price protection, specify a high value, such as 999999 . - // - // This parameter is not supported for [GetSpotPlacementScores] and [GetInstanceTypesFromInstanceRequirements]. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is applied based on the per-vCPU or per-memory price instead of the - // per-instance price. - // - // Default: 20 - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html - OnDemandMaxPricePercentageOverLowestPrice *int32 - - // Indicates whether instance types must support hibernation for On-Demand - // Instances. - // - // This parameter is not supported for [GetSpotPlacementScores]. - // - // Default: false - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - RequireHibernateSupport *bool - - // [Price protection] The price protection threshold for Spot Instances, as a - // percentage higher than an identified Spot price. The identified Spot price is - // the Spot price of the lowest priced current generation C, M, or R instance type - // with your specified attributes. If no current generation C, M, or R instance - // type matches your attributes, then the identified Spot price is from the lowest - // priced current generation instance types, and failing that, from the lowest - // priced previous generation instance types that match your attributes. When - // Amazon EC2 selects instance types with your attributes, it will exclude instance - // types whose Spot price exceeds your specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is applied based on the per-vCPU or per-memory price instead of the - // per-instance price. - // - // This parameter is not supported for [GetSpotPlacementScores] and [GetInstanceTypesFromInstanceRequirements]. - // - // Only one of SpotMaxPricePercentageOverLowestPrice or - // MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't - // specify either, Amazon EC2 will automatically apply optimal price protection to - // consistently select from a wide range of instance types. To indicate no price - // protection threshold for Spot Instances, meaning you want to consider all - // instance types that match your attributes, include one of these parameters and - // specify a high value, such as 999999 . - // - // Default: 100 - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html - SpotMaxPricePercentageOverLowestPrice *int32 - - // The minimum and maximum amount of total local storage, in GB. - // - // Default: No minimum or maximum limits - TotalLocalStorageGB *TotalLocalStorageGB - - // The minimum and maximum number of vCPUs. - VCpuCount *VCpuCountRange - - noSmithyDocumentSerde -} - -// The attributes for the instance types. When you specify instance attributes, -// Amazon EC2 will identify instance types with these attributes. -// -// You must specify VCpuCount and MemoryMiB . All other attributes are optional. -// Any unspecified optional attribute is set to its default. -// -// When you specify multiple attributes, you get instance types that satisfy all -// of the specified attributes. If you specify multiple values for an attribute, -// you get instance types that satisfy any of the specified values. -// -// To limit the list of instance types from which Amazon EC2 can identify matching -// instance types, you can use one of the following parameters, but not both in the -// same request: -// -// - AllowedInstanceTypes - The instance types to include in the list. All other -// instance types are ignored, even if they match your specified attributes. -// -// - ExcludedInstanceTypes - The instance types to exclude from the list, even if -// they match your specified attributes. -// -// If you specify InstanceRequirements , you can't specify InstanceType . -// -// Attribute-based instance type selection is only supported when using Auto -// Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to -// use the launch template in the [launch instance wizard], or with the [RunInstances] API or [AWS::EC2::Instance] Amazon Web Services -// CloudFormation resource, you can't specify InstanceRequirements . -// -// For more information, see [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet] and [Spot placement score] in the Amazon EC2 User Guide. -// -// [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html -// [AWS::EC2::Instance]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html -// [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html -// [Spot placement score]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html -// [launch instance wizard]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance-wizard.html -type InstanceRequirementsRequest struct { - - // The minimum and maximum amount of memory, in MiB. - // - // This member is required. - MemoryMiB *MemoryMiBRequest - - // The minimum and maximum number of vCPUs. - // - // This member is required. - VCpuCount *VCpuCountRangeRequest - - // The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web - // Services Inferentia chips) on an instance. - // - // To exclude accelerator-enabled instance types, set Max to 0 . - // - // Default: No minimum or maximum limits - AcceleratorCount *AcceleratorCountRequest - - // Indicates whether instance types must have accelerators by specific - // manufacturers. - // - // - For instance types with Amazon Web Services devices, specify - // amazon-web-services . - // - // - For instance types with AMD devices, specify amd . - // - // - For instance types with Habana devices, specify habana . - // - // - For instance types with NVIDIA devices, specify nvidia . - // - // - For instance types with Xilinx devices, specify xilinx . - // - // Default: Any manufacturer - AcceleratorManufacturers []AcceleratorManufacturer - - // The accelerators that must be on the instance type. - // - // - For instance types with NVIDIA A10G GPUs, specify a10g . - // - // - For instance types with NVIDIA A100 GPUs, specify a100 . - // - // - For instance types with NVIDIA H100 GPUs, specify h100 . - // - // - For instance types with Amazon Web Services Inferentia chips, specify - // inferentia . - // - // - For instance types with NVIDIA GRID K520 GPUs, specify k520 . - // - // - For instance types with NVIDIA K80 GPUs, specify k80 . - // - // - For instance types with NVIDIA M60 GPUs, specify m60 . - // - // - For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 . - // - // - For instance types with NVIDIA T4 GPUs, specify t4 . - // - // - For instance types with NVIDIA T4G GPUs, specify t4g . - // - // - For instance types with Xilinx VU9P FPGAs, specify vu9p . - // - // - For instance types with NVIDIA V100 GPUs, specify v100 . - // - // Default: Any accelerator - AcceleratorNames []AcceleratorName - - // The minimum and maximum amount of total accelerator memory, in MiB. - // - // Default: No minimum or maximum limits - AcceleratorTotalMemoryMiB *AcceleratorTotalMemoryMiBRequest - - // The accelerator types that must be on the instance type. - // - // - For instance types with FPGA accelerators, specify fpga . - // - // - For instance types with GPU accelerators, specify gpu . - // - // - For instance types with Inference accelerators, specify inference . - // - // Default: Any accelerator type - AcceleratorTypes []AcceleratorType - - // The instance types to apply your specified attributes against. All other - // instance types are ignored, even if they match your specified attributes. - // - // You can use strings with one or more wild cards, represented by an asterisk ( * - // ), to allow an instance type, size, or generation. The following are examples: - // m5.8xlarge , c5*.* , m5a.* , r* , *3* . - // - // For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance - // family, which includes all C5a and C5n instance types. If you specify m5a.* , - // Amazon EC2 will allow all the M5a instance types, but not the M5n instance - // types. - // - // If you specify AllowedInstanceTypes , you can't specify ExcludedInstanceTypes . - // - // Default: All instance types - AllowedInstanceTypes []string - - // Indicates whether bare metal instance types must be included, excluded, or - // required. - // - // - To include bare metal instance types, specify included . - // - // - To require only bare metal instance types, specify required . - // - // - To exclude bare metal instance types, specify excluded . - // - // Default: excluded - BareMetal BareMetal - - // The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more - // information, see [Amazon EBS–optimized instances]in the Amazon EC2 User Guide. - // - // Default: No minimum or maximum limits - // - // [Amazon EBS–optimized instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html - BaselineEbsBandwidthMbps *BaselineEbsBandwidthMbpsRequest - - // The baseline performance to consider, using an instance family as a baseline - // reference. The instance family establishes the lowest acceptable level of - // performance. Amazon EC2 uses this baseline to guide instance type selection, but - // there is no guarantee that the selected instance types will always exceed the - // baseline for every application. Currently, this parameter only supports CPU - // performance as a baseline performance factor. For more information, see [Performance protection]in the - // Amazon EC2 User Guide. - // - // [Performance protection]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abis-performance-protection - BaselinePerformanceFactors *BaselinePerformanceFactorsRequest - - // Indicates whether burstable performance T instance types are included, - // excluded, or required. For more information, see [Burstable performance instances]. - // - // - To include burstable performance instance types, specify included . - // - // - To require only burstable performance instance types, specify required . - // - // - To exclude burstable performance instance types, specify excluded . - // - // Default: excluded - // - // [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html - BurstablePerformance BurstablePerformance - - // The CPU manufacturers to include. - // - // - For instance types with Intel CPUs, specify intel . - // - // - For instance types with AMD CPUs, specify amd . - // - // - For instance types with Amazon Web Services CPUs, specify - // amazon-web-services . - // - // - For instance types with Apple CPUs, specify apple . - // - // Don't confuse the CPU manufacturer with the CPU architecture. Instances will be - // launched with a compatible CPU architecture based on the Amazon Machine Image - // (AMI) that you specify in your launch template. - // - // Default: Any manufacturer - CpuManufacturers []CpuManufacturer - - // The instance types to exclude. - // - // You can use strings with one or more wild cards, represented by an asterisk ( * - // ), to exclude an instance family, type, size, or generation. The following are - // examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* . - // - // For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance - // family, which includes all C5a and C5n instance types. If you specify m5a.* , - // Amazon EC2 will exclude all the M5a instance types, but not the M5n instance - // types. - // - // If you specify ExcludedInstanceTypes , you can't specify AllowedInstanceTypes . - // - // Default: No excluded instance types - ExcludedInstanceTypes []string - - // Indicates whether current or previous generation instance types are included. - // The current generation instance types are recommended for use. Current - // generation instance types are typically the latest two to three generations in - // each instance family. For more information, see [Instance types]in the Amazon EC2 User Guide. - // - // For current generation instance types, specify current . - // - // For previous generation instance types, specify previous . - // - // Default: Current and previous generation instance types - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceGenerations []InstanceGeneration - - // Indicates whether instance types with instance store volumes are included, - // excluded, or required. For more information, [Amazon EC2 instance store]in the Amazon EC2 User Guide. - // - // - To include instance types with instance store volumes, specify included . - // - // - To require only instance types with instance store volumes, specify required - // . - // - // - To exclude instance types with instance store volumes, specify excluded . - // - // Default: included - // - // [Amazon EC2 instance store]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html - LocalStorage LocalStorage - - // The type of local storage that is required. - // - // - For instance types with hard disk drive (HDD) storage, specify hdd . - // - // - For instance types with solid state drive (SSD) storage, specify ssd . - // - // Default: hdd and ssd - LocalStorageTypes []LocalStorageType - - // [Price protection] The price protection threshold for Spot Instances, as a - // percentage of an identified On-Demand price. The identified On-Demand price is - // the price of the lowest priced current generation C, M, or R instance type with - // your specified attributes. If no current generation C, M, or R instance type - // matches your attributes, then the identified price is from the lowest priced - // current generation instance types, and failing that, from the lowest priced - // previous generation instance types that match your attributes. When Amazon EC2 - // selects instance types with your attributes, it will exclude instance types - // whose price exceeds your specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is based on the per vCPU or per memory price instead of the per - // instance price. - // - // Only one of SpotMaxPricePercentageOverLowestPrice or - // MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't - // specify either, Amazon EC2 will automatically apply optimal price protection to - // consistently select from a wide range of instance types. To indicate no price - // protection threshold for Spot Instances, meaning you want to consider all - // instance types that match your attributes, include one of these parameters and - // specify a high value, such as 999999 . - MaxSpotPriceAsPercentageOfOptimalOnDemandPrice *int32 - - // The minimum and maximum amount of memory per vCPU, in GiB. - // - // Default: No minimum or maximum limits - MemoryGiBPerVCpu *MemoryGiBPerVCpuRequest - - // The minimum and maximum amount of baseline network bandwidth, in gigabits per - // second (Gbps). For more information, see [Amazon EC2 instance network bandwidth]in the Amazon EC2 User Guide. - // - // Default: No minimum or maximum limits - // - // [Amazon EC2 instance network bandwidth]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html - NetworkBandwidthGbps *NetworkBandwidthGbpsRequest - - // The minimum and maximum number of network interfaces. - // - // Default: No minimum or maximum limits - NetworkInterfaceCount *NetworkInterfaceCountRequest - - // [Price protection] The price protection threshold for On-Demand Instances, as a - // percentage higher than an identified On-Demand price. The identified On-Demand - // price is the price of the lowest priced current generation C, M, or R instance - // type with your specified attributes. When Amazon EC2 selects instance types with - // your attributes, it will exclude instance types whose price exceeds your - // specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // To indicate no price protection threshold, specify a high value, such as 999999 . - // - // This parameter is not supported for [GetSpotPlacementScores] and [GetInstanceTypesFromInstanceRequirements]. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is applied based on the per-vCPU or per-memory price instead of the - // per-instance price. - // - // Default: 20 - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html - OnDemandMaxPricePercentageOverLowestPrice *int32 - - // Indicates whether instance types must support hibernation for On-Demand - // Instances. - // - // This parameter is not supported for [GetSpotPlacementScores]. - // - // Default: false - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - RequireHibernateSupport *bool - - // [Price protection] The price protection threshold for Spot Instances, as a - // percentage higher than an identified Spot price. The identified Spot price is - // the Spot price of the lowest priced current generation C, M, or R instance type - // with your specified attributes. If no current generation C, M, or R instance - // type matches your attributes, then the identified Spot price is from the lowest - // priced current generation instance types, and failing that, from the lowest - // priced previous generation instance types that match your attributes. When - // Amazon EC2 selects instance types with your attributes, it will exclude instance - // types whose Spot price exceeds your specified threshold. - // - // The parameter accepts an integer, which Amazon EC2 interprets as a percentage. - // - // If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection - // threshold is applied based on the per-vCPU or per-memory price instead of the - // per-instance price. - // - // This parameter is not supported for [GetSpotPlacementScores] and [GetInstanceTypesFromInstanceRequirements]. - // - // Only one of SpotMaxPricePercentageOverLowestPrice or - // MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't - // specify either, Amazon EC2 will automatically apply optimal price protection to - // consistently select from a wide range of instance types. To indicate no price - // protection threshold for Spot Instances, meaning you want to consider all - // instance types that match your attributes, include one of these parameters and - // specify a high value, such as 999999 . - // - // Default: 100 - // - // [GetSpotPlacementScores]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html - SpotMaxPricePercentageOverLowestPrice *int32 - - // The minimum and maximum amount of total local storage, in GB. - // - // Default: No minimum or maximum limits - TotalLocalStorageGB *TotalLocalStorageGBRequest - - noSmithyDocumentSerde -} - -// The architecture type, virtualization type, and other attributes for the -// instance types. When you specify instance attributes, Amazon EC2 will identify -// instance types with those attributes. -// -// If you specify InstanceRequirementsWithMetadataRequest , you can't specify -// InstanceTypes . -type InstanceRequirementsWithMetadataRequest struct { - - // The architecture type. - ArchitectureTypes []ArchitectureType - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with those attributes. - InstanceRequirements *InstanceRequirementsRequest - - // The virtualization type. - VirtualizationTypes []VirtualizationType - - noSmithyDocumentSerde -} - -// The instance details to specify which volumes should be snapshotted. -type InstanceSpecification struct { - - // The instance to specify which volumes should be snapshotted. - // - // This member is required. - InstanceId *string - - // Excludes the root volume from being snapshotted. - ExcludeBootVolume *bool - - // The IDs of the data (non-root) volumes to exclude from the multi-volume - // snapshot set. If you specify the ID of the root volume, the request fails. To - // exclude the root volume, use ExcludeBootVolume. - // - // You can specify up to 40 volume IDs per request. - ExcludeDataVolumeIds []string - - noSmithyDocumentSerde -} - -// Describes the current state of an instance. -type InstanceState struct { - - // The state of the instance as a 16-bit unsigned integer. - // - // The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal - // values between 256 and 65,535. These numerical values are used for internal - // purposes and should be ignored. - // - // The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal - // values between 0 and 255. - // - // The valid values for instance-state-code will all be in the range of the low - // byte and they are: - // - // - 0 : pending - // - // - 16 : running - // - // - 32 : shutting-down - // - // - 48 : terminated - // - // - 64 : stopping - // - // - 80 : stopped - // - // You can ignore the high byte value by zeroing out all of the bits above 2^8 or - // 256 in decimal. - Code *int32 - - // The current state of the instance. - Name InstanceStateName - - noSmithyDocumentSerde -} - -// Describes an instance state change. -type InstanceStateChange struct { - - // The current state of the instance. - CurrentState *InstanceState - - // The ID of the instance. - InstanceId *string - - // The previous state of the instance. - PreviousState *InstanceState - - noSmithyDocumentSerde -} - -// Describes the status of an instance. -type InstanceStatus struct { - - // Reports impaired functionality that stems from an attached Amazon EBS volume - // that is unreachable and unable to complete I/O operations. - AttachedEbsStatus *EbsStatusSummary - - // The Availability Zone of the instance. - AvailabilityZone *string - - // Any scheduled events associated with the instance. - Events []InstanceStatusEvent - - // The ID of the instance. - InstanceId *string - - // The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running - // state. - InstanceState *InstanceState - - // Reports impaired functionality that stems from issues internal to the instance, - // such as impaired reachability. - InstanceStatus *InstanceStatusSummary - - // The service provider that manages the instance. - Operator *OperatorResponse - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // Reports impaired functionality that stems from issues related to the systems - // that support an instance, such as hardware failures and network connectivity - // problems. - SystemStatus *InstanceStatusSummary - - noSmithyDocumentSerde -} - -// Describes the instance status. -type InstanceStatusDetails struct { - - // The time when a status check failed. For an instance that was launched and - // impaired, this is the time when the instance was launched. - ImpairedSince *time.Time - - // The type of instance status. - Name StatusName - - // The status. - Status StatusType - - noSmithyDocumentSerde -} - -// Describes a scheduled event for an instance. -type InstanceStatusEvent struct { - - // The event code. - Code EventCode - - // A description of the event. - // - // After a scheduled event is completed, it can still be described for up to a - // week. If the event has been completed, this description starts with the - // following text: [Completed]. - Description *string - - // The ID of the event. - InstanceEventId *string - - // The latest scheduled end time for the event. - NotAfter *time.Time - - // The earliest scheduled start time for the event. - NotBefore *time.Time - - // The deadline for starting the event. - NotBeforeDeadline *time.Time - - noSmithyDocumentSerde -} - -// Describes the status of an instance. -type InstanceStatusSummary struct { - - // The system instance health or application instance health. - Details []InstanceStatusDetails - - // The status. - Status SummaryStatus - - noSmithyDocumentSerde -} - -// Describes the instance store features that are supported by the instance type. -type InstanceStorageInfo struct { - - // Describes the disks that are available for the instance type. - Disks []DiskInfo - - // Indicates whether data is encrypted at rest. - EncryptionSupport InstanceStorageEncryptionSupport - - // Indicates whether non-volatile memory express (NVMe) is supported. - NvmeSupport EphemeralNvmeSupport - - // The total size of the disks, in GB. - TotalSizeInGB *int64 - - noSmithyDocumentSerde -} - -// Describes the registered tag keys for the current Region. -type InstanceTagNotificationAttribute struct { - - // Indicates wheter all tag keys in the current Region are registered to appear in - // scheduled event notifications. true indicates that all tag keys in the current - // Region are registered. - IncludeAllTagsOfInstance *bool - - // The registered tag keys. - InstanceTagKeys []string - - noSmithyDocumentSerde -} - -// Information about the instance topology. -type InstanceTopology struct { - - // The name of the Availability Zone or Local Zone that the instance is in. - AvailabilityZone *string - - // The ID of the Capacity Block. This parameter is only supported for Ultraserver - // instances and identifies instances within the Ultraserver domain. - CapacityBlockId *string - - // The name of the placement group that the instance is in. - GroupName *string - - // The instance ID. - InstanceId *string - - // The instance type. - InstanceType *string - - // The network nodes. The nodes are hashed based on your account. Instances from - // different accounts running under the same server will return a different hashed - // list of strings. - NetworkNodes []string - - // The ID of the Availability Zone or Local Zone that the instance is in. - ZoneId *string - - noSmithyDocumentSerde -} - -// Describes the instance type. -type InstanceTypeInfo struct { - - // Indicates whether Amazon CloudWatch action based recovery is supported. - AutoRecoverySupported *bool - - // Indicates whether the instance is a bare metal instance type. - BareMetal *bool - - // Indicates whether the instance type is a burstable performance T instance type. - // For more information, see [Burstable performance instances]. - // - // [Burstable performance instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html - BurstablePerformanceSupported *bool - - // Indicates whether the instance type is current generation. - CurrentGeneration *bool - - // Indicates whether Dedicated Hosts are supported on the instance type. - DedicatedHostsSupported *bool - - // Describes the Amazon EBS settings for the instance type. - EbsInfo *EbsInfo - - // Describes the FPGA accelerator settings for the instance type. - FpgaInfo *FpgaInfo - - // Indicates whether the instance type is eligible for the free tier. - FreeTierEligible *bool - - // Describes the GPU accelerator settings for the instance type. - GpuInfo *GpuInfo - - // Indicates whether On-Demand hibernation is supported. - HibernationSupported *bool - - // The hypervisor for the instance type. - Hypervisor InstanceTypeHypervisor - - // Describes the Inference accelerator settings for the instance type. - InferenceAcceleratorInfo *InferenceAcceleratorInfo - - // Describes the instance storage for the instance type. - InstanceStorageInfo *InstanceStorageInfo - - // Indicates whether instance storage is supported. - InstanceStorageSupported *bool - - // The instance type. For more information, see [Instance types] in the Amazon EC2 User Guide. - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType InstanceType - - // Describes the media accelerator settings for the instance type. - MediaAcceleratorInfo *MediaAcceleratorInfo - - // Describes the memory for the instance type. - MemoryInfo *MemoryInfo - - // Describes the network settings for the instance type. - NetworkInfo *NetworkInfo - - // Describes the Neuron accelerator settings for the instance type. - NeuronInfo *NeuronInfo - - // Indicates whether Nitro Enclaves is supported. - NitroEnclavesSupport NitroEnclavesSupport - - // Describes the supported NitroTPM versions for the instance type. - NitroTpmInfo *NitroTpmInfo - - // Indicates whether NitroTPM is supported. - NitroTpmSupport NitroTpmSupport - - // Indicates whether a local Precision Time Protocol (PTP) hardware clock (PHC) is - // supported. - PhcSupport PhcSupport - - // Describes the placement group settings for the instance type. - PlacementGroupInfo *PlacementGroupInfo - - // Describes the processor. - ProcessorInfo *ProcessorInfo - - // Indicates whether reboot migration during a user-initiated reboot is supported - // for instances that have a scheduled system-reboot event. For more information, - // see [Enable or disable reboot migration]in the Amazon EC2 User Guide. - // - // [Enable or disable reboot migration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/schedevents_actions_reboot.html#reboot-migration - RebootMigrationSupport RebootMigrationSupport - - // The supported boot modes. For more information, see [Boot modes] in the Amazon EC2 User - // Guide. - // - // [Boot modes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html - SupportedBootModes []BootModeType - - // The supported root device types. - SupportedRootDeviceTypes []RootDeviceType - - // Indicates whether the instance type is offered for spot, On-Demand, or Capacity - // Blocks. - SupportedUsageClasses []UsageClassType - - // The supported virtualization types. - SupportedVirtualizationTypes []VirtualizationType - - // Describes the vCPU configurations for the instance type. - VCpuInfo *VCpuInfo - - noSmithyDocumentSerde -} - -// The list of instance types with the specified instance attributes. -type InstanceTypeInfoFromInstanceRequirements struct { - - // The matching instance type. - InstanceType *string - - noSmithyDocumentSerde -} - -// The instance types offered. -type InstanceTypeOffering struct { - - // The instance type. For more information, see [Instance types] in the Amazon EC2 User Guide. - // - // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType InstanceType - - // The identifier for the location. This depends on the location type. For - // example, if the location type is region , the location is the Region code (for - // example, us-east-2 .) - Location *string - - // The location type. - LocationType LocationType - - noSmithyDocumentSerde -} - -// Information about the Capacity Reservation usage. -type InstanceUsage struct { - - // The ID of the Amazon Web Services account that is making use of the Capacity - // Reservation. - AccountId *string - - // The number of instances the Amazon Web Services account currently has in the - // Capacity Reservation. - UsedInstanceCount *int32 - - noSmithyDocumentSerde -} - -// Describes service integrations with VPC Flow logs. -type IntegrateServices struct { - - // Information about the integration with Amazon Athena. - AthenaIntegrations []AthenaIntegration - - noSmithyDocumentSerde -} - -// Describes an internet gateway. -type InternetGateway struct { - - // Any VPCs attached to the internet gateway. - Attachments []InternetGatewayAttachment - - // The ID of the internet gateway. - InternetGatewayId *string - - // The ID of the Amazon Web Services account that owns the internet gateway. - OwnerId *string - - // Any tags assigned to the internet gateway. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the attachment of a VPC to an internet gateway or an egress-only -// internet gateway. -type InternetGatewayAttachment struct { - - // The current state of the attachment. For an internet gateway, the state is - // available when attached to a VPC; otherwise, this value is not returned. - State AttachmentStatus - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// IPAM is a VPC feature that you can use to automate your IP address management -// workflows including assigning, tracking, troubleshooting, and auditing IP -// addresses across Amazon Web Services Regions and accounts throughout your Amazon -// Web Services Organization. For more information, see [What is IPAM?]in the Amazon VPC IPAM -// User Guide. -// -// [What is IPAM?]: https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html -type Ipam struct { - - // The IPAM's default resource discovery association ID. - DefaultResourceDiscoveryAssociationId *string - - // The IPAM's default resource discovery ID. - DefaultResourceDiscoveryId *string - - // The description for the IPAM. - Description *string - - // Enable this option to use your own GUA ranges as private IPv6 addresses. This - // option is disabled by default. - EnablePrivateGua *bool - - // The Amazon Resource Name (ARN) of the IPAM. - IpamArn *string - - // The ID of the IPAM. - IpamId *string - - // The Amazon Web Services Region of the IPAM. - IpamRegion *string - - // A metered account is an Amazon Web Services account that is charged for active - // IP addresses managed in IPAM. For more information, see [Enable cost distribution]in the Amazon VPC IPAM - // User Guide. - // - // Possible values: - // - // - ipam-owner (default): The Amazon Web Services account which owns the IPAM is - // charged for all active IP addresses managed in IPAM. - // - // - resource-owner : The Amazon Web Services account that owns the IP address is - // charged for the active IP address. - // - // [Enable cost distribution]: https://docs.aws.amazon.com/vpc/latest/ipam/ipam-enable-cost-distro.html - MeteredAccount IpamMeteredAccount - - // The operating Regions for an IPAM. Operating Regions are Amazon Web Services - // Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only - // discovers and monitors resources in the Amazon Web Services Regions you select - // as operating Regions. - // - // For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User - // Guide. - // - // [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html - OperatingRegions []IpamOperatingRegion - - // The Amazon Web Services account ID of the owner of the IPAM. - OwnerId *string - - // The ID of the IPAM's default private scope. - PrivateDefaultScopeId *string - - // The ID of the IPAM's default public scope. - PublicDefaultScopeId *string - - // The IPAM's resource discovery association count. - ResourceDiscoveryAssociationCount *int32 - - // The number of scopes in the IPAM. The scope quota is 5. For more information on - // quotas, see [Quotas in IPAM]in the Amazon VPC IPAM User Guide. - // - // [Quotas in IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - ScopeCount *int32 - - // The state of the IPAM. - State IpamState - - // The state message. - StateMessage *string - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - Tags []Tag - - // IPAM is offered in a Free Tier and an Advanced Tier. For more information about - // the features available in each tier and the costs associated with the tiers, see - // [Amazon VPC pricing > IPAM tab]. - // - // [Amazon VPC pricing > IPAM tab]: http://aws.amazon.com/vpc/pricing/ - Tier IpamTier - - noSmithyDocumentSerde -} - -// The historical record of a CIDR within an IPAM scope. For more information, see [View the history of IP addresses] -// in the Amazon VPC IPAM User Guide. -// -// [View the history of IP addresses]: https://docs.aws.amazon.com/vpc/latest/ipam/view-history-cidr-ipam.html -type IpamAddressHistoryRecord struct { - - // The CIDR of the resource. - ResourceCidr *string - - // The compliance status of a resource. For more information on compliance - // statuses, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. - // - // [Monitor CIDR usage by resource]: https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html - ResourceComplianceStatus IpamComplianceStatus - - // The ID of the resource. - ResourceId *string - - // The name of the resource. - ResourceName *string - - // The overlap status of an IPAM resource. The overlap status tells you if the - // CIDR for a resource overlaps with another CIDR in the scope. For more - // information on overlap statuses, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. - // - // [Monitor CIDR usage by resource]: https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html - ResourceOverlapStatus IpamOverlapStatus - - // The ID of the resource owner. - ResourceOwnerId *string - - // The Amazon Web Services Region of the resource. - ResourceRegion *string - - // The type of the resource. - ResourceType IpamAddressHistoryResourceType - - // Sampled end time of the resource-to-CIDR association within the IPAM scope. - // Changes are picked up in periodic snapshots, so the end time may have occurred - // before this specific time. - SampledEndTime *time.Time - - // Sampled start time of the resource-to-CIDR association within the IPAM scope. - // Changes are picked up in periodic snapshots, so the start time may have occurred - // before this specific time. - SampledStartTime *time.Time - - // The VPC ID of the resource. - VpcId *string - - noSmithyDocumentSerde -} - -// A signed document that proves that you are authorized to bring the specified IP -// address range to Amazon using BYOIP. -type IpamCidrAuthorizationContext struct { - - // The plain-text authorization message for the prefix and account. - Message *string - - // The signed authorization message for the prefix and account. - Signature *string - - noSmithyDocumentSerde -} - -// An IPAM discovered account. A discovered account is an Amazon Web Services -// account that is monitored under a resource discovery. If you have integrated -// IPAM with Amazon Web Services Organizations, all accounts in the organization -// are discovered accounts. -type IpamDiscoveredAccount struct { - - // The account ID. - AccountId *string - - // The Amazon Web Services Region that the account information is returned from. - // An account can be discovered in multiple regions and will have a separate - // discovered account for each Region. - DiscoveryRegion *string - - // The resource discovery failure reason. - FailureReason *IpamDiscoveryFailureReason - - // The last attempted resource discovery time. - LastAttemptedDiscoveryTime *time.Time - - // The last successful resource discovery time. - LastSuccessfulDiscoveryTime *time.Time - - // The ID of an Organizational Unit in Amazon Web Services Organizations. - OrganizationalUnitId *string - - noSmithyDocumentSerde -} - -// A public IP Address discovered by IPAM. -type IpamDiscoveredPublicAddress struct { - - // The IP address. - Address *string - - // The allocation ID of the resource the IP address is assigned to. - AddressAllocationId *string - - // The ID of the owner of the resource the IP address is assigned to. - AddressOwnerId *string - - // The Region of the resource the IP address is assigned to. - AddressRegion *string - - // The IP address type. - AddressType IpamPublicAddressType - - // The association status. - AssociationStatus IpamPublicAddressAssociationStatus - - // The instance ID of the instance the assigned IP address is assigned to. - InstanceId *string - - // The resource discovery ID. - IpamResourceDiscoveryId *string - - // The Availability Zone (AZ) or Local Zone (LZ) network border group that the - // resource that the IP address is assigned to is in. Defaults to an AZ network - // border group. For more information on available Local Zones, see [Local Zone availability]in the Amazon - // EC2 User Guide. - // - // [Local Zone availability]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - NetworkBorderGroup *string - - // The description of the network interface that IP address is assigned to. - NetworkInterfaceDescription *string - - // The network interface ID of the resource with the assigned IP address. - NetworkInterfaceId *string - - // The ID of the public IPv4 pool that the resource with the assigned IP address - // is from. - PublicIpv4PoolId *string - - // The last successful resource discovery time. - SampleTime *time.Time - - // Security groups associated with the resource that the IP address is assigned to. - SecurityGroups []IpamPublicAddressSecurityGroup - - // The Amazon Web Services service associated with the IP address. - Service IpamPublicAddressAwsService - - // The resource ARN or ID. - ServiceResource *string - - // The ID of the subnet that the resource with the assigned IP address is in. - SubnetId *string - - // Tags associated with the IP address. - Tags *IpamPublicAddressTags - - // The ID of the VPC that the resource with the assigned IP address is in. - VpcId *string - - noSmithyDocumentSerde -} - -// An IPAM discovered resource CIDR. A discovered resource is a resource CIDR -// monitored under a resource discovery. The following resources can be discovered: -// VPCs, Public IPv4 pools, VPC subnets, and Elastic IP addresses. The discovered -// resource CIDR is the IP address range in CIDR notation that is associated with -// the resource. -type IpamDiscoveredResourceCidr struct { - - // The Availability Zone ID. - AvailabilityZoneId *string - - // The source that allocated the IP address space. byoip or amazon indicates - // public IP address space allocated by Amazon or space that you have allocated - // with Bring your own IP (BYOIP). none indicates private space. - IpSource IpamResourceCidrIpSource - - // The percentage of IP address space in use. To convert the decimal to a - // percentage, multiply the decimal by 100. Note the following: - // - // - For resources that are VPCs, this is the percentage of IP address space in - // the VPC that's taken up by subnet CIDRs. - // - // - For resources that are subnets, if the subnet has an IPv4 CIDR provisioned - // to it, this is the percentage of IPv4 address space in the subnet that's in use. - // If the subnet has an IPv6 CIDR provisioned to it, the percentage of IPv6 address - // space in use is not represented. The percentage of IPv6 address space in use - // cannot currently be calculated. - // - // - For resources that are public IPv4 pools, this is the percentage of IP - // address space in the pool that's been allocated to Elastic IP addresses (EIPs). - IpUsage *float64 - - // The resource discovery ID. - IpamResourceDiscoveryId *string - - // For elastic network interfaces, this is the status of whether or not the - // elastic network interface is attached. - NetworkInterfaceAttachmentStatus IpamNetworkInterfaceAttachmentStatus - - // The resource CIDR. - ResourceCidr *string - - // The resource ID. - ResourceId *string - - // The resource owner ID. - ResourceOwnerId *string - - // The resource Region. - ResourceRegion *string - - // The resource tags. - ResourceTags []IpamResourceTag - - // The resource type. - ResourceType IpamResourceType - - // The last successful resource discovery time. - SampleTime *time.Time - - // The subnet ID. - SubnetId *string - - // The VPC ID. - VpcId *string - - noSmithyDocumentSerde -} - -// The discovery failure reason. -type IpamDiscoveryFailureReason struct { - - // The discovery failure code. - // - // - assume-role-failure - IPAM could not assume the Amazon Web Services IAM - // service-linked role. This could be because of any of the following: - // - // - SLR has not been created yet and IPAM is still creating it. - // - // - You have opted-out of the IPAM home Region. - // - // - Account you are using as your IPAM account has been suspended. - // - // - throttling-failure - IPAM account is already using the allotted transactions - // per second and IPAM is receiving a throttling error when assuming the Amazon Web - // Services IAM SLR. - // - // - unauthorized-failure - Amazon Web Services account making the request is not - // authorized. For more information, see [AuthFailure]in the Amazon Elastic Compute Cloud API - // Reference. - // - // [AuthFailure]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html - Code IpamDiscoveryFailureCode - - // The discovery failure message. - Message *string - - noSmithyDocumentSerde -} - -// A verification token is an Amazon Web Services-generated random value that you -// can use to prove ownership of an external resource. For example, you can use a -// verification token to validate that you control a public IP address range when -// you bring an IP address range to Amazon Web Services (BYOIP). -type IpamExternalResourceVerificationToken struct { - - // ARN of the IPAM that created the token. - IpamArn *string - - // Token ARN. - IpamExternalResourceVerificationTokenArn *string - - // The ID of the token. - IpamExternalResourceVerificationTokenId *string - - // The ID of the IPAM that created the token. - IpamId *string - - // Region of the IPAM that created the token. - IpamRegion *string - - // Token expiration. - NotAfter *time.Time - - // Token state. - State IpamExternalResourceVerificationTokenState - - // Token status. - Status TokenState - - // Token tags. - Tags []Tag - - // Token name. - TokenName *string - - // Token value. - TokenValue *string - - noSmithyDocumentSerde -} - -// The operating Regions for an IPAM. Operating Regions are Amazon Web Services -// Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only -// discovers and monitors resources in the Amazon Web Services Regions you select -// as operating Regions. -// -// For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User -// Guide. -// -// [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html -type IpamOperatingRegion struct { - - // The name of the operating Region. - RegionName *string - - noSmithyDocumentSerde -} - -// If your IPAM is integrated with Amazon Web Services Organizations and you add -// an organizational unit (OU) exclusion, IPAM will not manage the IP addresses in -// accounts in that OU exclusion. -type IpamOrganizationalUnitExclusion struct { - - // An Amazon Web Services Organizations entity path. For more information on the - // entity path, see [Understand the Amazon Web Services Organizations entity path]in the Amazon Web Services Identity and Access Management User - // Guide. - // - // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path - OrganizationsEntityPath *string - - noSmithyDocumentSerde -} - -// In IPAM, a pool is a collection of contiguous IP addresses CIDRs. Pools enable -// you to organize your IP addresses according to your routing and security needs. -// For example, if you have separate routing and security needs for development and -// production applications, you can create a pool for each. -type IpamPool struct { - - // The address family of the pool. - AddressFamily AddressFamily - - // The default netmask length for allocations added to this pool. If, for example, - // the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new - // allocations will default to 10.0.0.0/16. - AllocationDefaultNetmaskLength *int32 - - // The maximum netmask length possible for CIDR allocations in this IPAM pool to - // be compliant. The maximum netmask length must be greater than the minimum - // netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible - // netmask lengths for IPv6 addresses are 0 - 128. - AllocationMaxNetmaskLength *int32 - - // The minimum netmask length required for CIDR allocations in this IPAM pool to - // be compliant. The minimum netmask length must be less than the maximum netmask - // length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask - // lengths for IPv6 addresses are 0 - 128. - AllocationMinNetmaskLength *int32 - - // Tags that are required for resources that use CIDRs from this IPAM pool. - // Resources that do not have these tags will not be allowed to allocate space from - // the pool. If the resources have their tags changed after they have allocated - // space or if the allocation tagging requirements are changed on the pool, the - // resource may be marked as noncompliant. - AllocationResourceTags []IpamResourceTag - - // If selected, IPAM will continuously look for resources within the CIDR range of - // this pool and automatically import them as allocations into your IPAM. The CIDRs - // that will be allocated for these resources must not already be allocated to - // other resources in order for the import to succeed. IPAM will import a CIDR - // regardless of its compliance with the pool's allocation rules, so a resource - // might be imported and subsequently marked as noncompliant. If IPAM discovers - // multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM - // discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of - // them only. - // - // A locale must be set on the pool for this feature to work. - AutoImport *bool - - // Limits which service in Amazon Web Services that the pool can be used in. - // "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. - AwsService IpamPoolAwsService - - // The description of the IPAM pool. - Description *string - - // The ARN of the IPAM. - IpamArn *string - - // The Amazon Resource Name (ARN) of the IPAM pool. - IpamPoolArn *string - - // The ID of the IPAM pool. - IpamPoolId *string - - // The Amazon Web Services Region of the IPAM pool. - IpamRegion *string - - // The ARN of the scope of the IPAM pool. - IpamScopeArn *string - - // In IPAM, a scope is the highest-level container within IPAM. An IPAM contains - // two default scopes. Each scope represents the IP space for a single network. The - // private scope is intended for all private IP address space. The public scope is - // intended for all public IP address space. Scopes enable you to reuse IP - // addresses across multiple unconnected networks without causing IP address - // overlap or conflict. - IpamScopeType IpamScopeType - - // The locale of the IPAM pool. - // - // The locale for the pool should be one of the following: - // - // - An Amazon Web Services Region where you want this IPAM pool to be available - // for allocations. - // - // - The network border group for an Amazon Web Services Local Zone where you - // want this IPAM pool to be available for allocations ([supported Local Zones] ). This option is only - // available for IPAM IPv4 pools in the public scope. - // - // If you choose an Amazon Web Services Region for locale that has not been - // configured as an operating Region for the IPAM, you'll get an error. - // - // [supported Local Zones]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail - Locale *string - - // The Amazon Web Services account ID of the owner of the IPAM pool. - OwnerId *string - - // The depth of pools in your IPAM pool. The pool depth quota is 10. For more - // information, see [Quotas in IPAM]in the Amazon VPC IPAM User Guide. - // - // [Quotas in IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - PoolDepth *int32 - - // The IP address source for pools in the public scope. Only used for provisioning - // IP address CIDRs to pools in the public scope. Default is BYOIP . For more - // information, see [Create IPv6 pools]in the Amazon VPC IPAM User Guide. By default, you can add - // only one Amazon-provided IPv6 CIDR block to a top-level IPv6 pool. For - // information on increasing the default limit, see [Quotas for your IPAM]in the Amazon VPC IPAM User - // Guide. - // - // [Create IPv6 pools]: https://docs.aws.amazon.com/vpc/latest/ipam/intro-create-ipv6-pools.html - // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html - PublicIpSource IpamPoolPublicIpSource - - // Determines if a pool is publicly advertisable. This option is not available for - // pools with AddressFamily set to ipv4 . - PubliclyAdvertisable *bool - - // The ID of the source IPAM pool. You can use this option to create an IPAM pool - // within an existing source pool. - SourceIpamPoolId *string - - // The resource used to provision CIDRs to a resource planning pool. - SourceResource *IpamPoolSourceResource - - // The state of the IPAM pool. - State IpamPoolState - - // The state message. - StateMessage *string - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - Tags []Tag - - noSmithyDocumentSerde -} - -// In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM -// pool or to a resource. -type IpamPoolAllocation struct { - - // The CIDR for the allocation. A CIDR is a representation of an IP address and - // its associated network mask (or netmask) and refers to a range of IP addresses. - // An IPv4 CIDR example is 10.24.34.0/23 . An IPv6 CIDR example is 2001:DB8::/32 . - Cidr *string - - // A description of the pool allocation. - Description *string - - // The ID of an allocation. - IpamPoolAllocationId *string - - // The ID of the resource. - ResourceId *string - - // The owner of the resource. - ResourceOwner *string - - // The Amazon Web Services Region of the resource. - ResourceRegion *string - - // The type of the resource. - ResourceType IpamPoolAllocationResourceType - - noSmithyDocumentSerde -} - -// A CIDR provisioned to an IPAM pool. -type IpamPoolCidr struct { - - // The CIDR provisioned to the IPAM pool. A CIDR is a representation of an IP - // address and its associated network mask (or netmask) and refers to a range of IP - // addresses. An IPv4 CIDR example is 10.24.34.0/23 . An IPv6 CIDR example is - // 2001:DB8::/32 . - Cidr *string - - // Details related to why an IPAM pool CIDR failed to be provisioned. - FailureReason *IpamPoolCidrFailureReason - - // The IPAM pool CIDR ID. - IpamPoolCidrId *string - - // The netmask length of the CIDR you'd like to provision to a pool. Can be used - // for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for - // provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP - // CIDRs to top-level pools. "NetmaskLength" or "Cidr" is required. - NetmaskLength *int32 - - // The state of the CIDR. - State IpamPoolCidrState - - noSmithyDocumentSerde -} - -// Details related to why an IPAM pool CIDR failed to be provisioned. -type IpamPoolCidrFailureReason struct { - - // An error code related to why an IPAM pool CIDR failed to be provisioned. - Code IpamPoolCidrFailureCode - - // A message related to why an IPAM pool CIDR failed to be provisioned. - Message *string - - noSmithyDocumentSerde -} - -// The resource used to provision CIDRs to a resource planning pool. -type IpamPoolSourceResource struct { - - // The source resource ID. - ResourceId *string - - // The source resource owner. - ResourceOwner *string - - // The source resource Region. - ResourceRegion *string - - // The source resource type. - ResourceType IpamPoolSourceResourceType - - noSmithyDocumentSerde -} - -// The resource used to provision CIDRs to a resource planning pool. -type IpamPoolSourceResourceRequest struct { - - // The source resource ID. - ResourceId *string - - // The source resource owner. - ResourceOwner *string - - // The source resource Region. - ResourceRegion *string - - // The source resource type. - ResourceType IpamPoolSourceResourceType - - noSmithyDocumentSerde -} - -// The security group that the resource with the public IP address is in. -type IpamPublicAddressSecurityGroup struct { - - // The security group's ID. - GroupId *string - - // The security group's name. - GroupName *string - - noSmithyDocumentSerde -} - -// A tag for a public IP address discovered by IPAM. -type IpamPublicAddressTag struct { - - // The tag's key. - Key *string - - // The tag's value. - Value *string - - noSmithyDocumentSerde -} - -// Tags for a public IP address discovered by IPAM. -type IpamPublicAddressTags struct { - - // Tags for an Elastic IP address. - EipTags []IpamPublicAddressTag - - noSmithyDocumentSerde -} - -// The CIDR for an IPAM resource. -type IpamResourceCidr struct { - - // The Availability Zone ID. - AvailabilityZoneId *string - - // The compliance status of the IPAM resource. For more information on compliance - // statuses, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. - // - // [Monitor CIDR usage by resource]: https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html - ComplianceStatus IpamComplianceStatus - - // The percentage of IP address space in use. To convert the decimal to a - // percentage, multiply the decimal by 100. Note the following: - // - // - For resources that are VPCs, this is the percentage of IP address space in - // the VPC that's taken up by subnet CIDRs. - // - // - For resources that are subnets, if the subnet has an IPv4 CIDR provisioned - // to it, this is the percentage of IPv4 address space in the subnet that's in use. - // If the subnet has an IPv6 CIDR provisioned to it, the percentage of IPv6 address - // space in use is not represented. The percentage of IPv6 address space in use - // cannot currently be calculated. - // - // - For resources that are public IPv4 pools, this is the percentage of IP - // address space in the pool that's been allocated to Elastic IP addresses (EIPs). - IpUsage *float64 - - // The IPAM ID for an IPAM resource. - IpamId *string - - // The pool ID for an IPAM resource. - IpamPoolId *string - - // The scope ID for an IPAM resource. - IpamScopeId *string - - // The management state of the resource. For more information about management - // states, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. - // - // [Monitor CIDR usage by resource]: https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html - ManagementState IpamManagementState - - // The overlap status of an IPAM resource. The overlap status tells you if the - // CIDR for a resource overlaps with another CIDR in the scope. For more - // information on overlap statuses, see [Monitor CIDR usage by resource]in the Amazon VPC IPAM User Guide. - // - // [Monitor CIDR usage by resource]: https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html - OverlapStatus IpamOverlapStatus - - // The CIDR for an IPAM resource. - ResourceCidr *string - - // The ID of an IPAM resource. - ResourceId *string - - // The name of an IPAM resource. - ResourceName *string - - // The Amazon Web Services account number of the owner of an IPAM resource. - ResourceOwnerId *string - - // The Amazon Web Services Region for an IPAM resource. - ResourceRegion *string - - // The tags for an IPAM resource. - ResourceTags []IpamResourceTag - - // The type of IPAM resource. - ResourceType IpamResourceType - - // The ID of a VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// A resource discovery is an IPAM component that enables IPAM to manage and -// monitor resources that belong to the owning account. -type IpamResourceDiscovery struct { - - // The resource discovery description. - Description *string - - // The resource discovery Amazon Resource Name (ARN). - IpamResourceDiscoveryArn *string - - // The resource discovery ID. - IpamResourceDiscoveryId *string - - // The resource discovery Region. - IpamResourceDiscoveryRegion *string - - // Defines if the resource discovery is the default. The default resource - // discovery is the resource discovery automatically created when you create an - // IPAM. - IsDefault *bool - - // The operating Regions for the resource discovery. Operating Regions are Amazon - // Web Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM - // only discovers and monitors resources in the Amazon Web Services Regions you - // select as operating Regions. - OperatingRegions []IpamOperatingRegion - - // If your IPAM is integrated with Amazon Web Services Organizations and you add - // an organizational unit (OU) exclusion, IPAM will not manage the IP addresses in - // accounts in that OU exclusion. - OrganizationalUnitExclusions []IpamOrganizationalUnitExclusion - - // The ID of the owner. - OwnerId *string - - // The lifecycle state of the resource discovery. - // - // - create-in-progress - Resource discovery is being created. - // - // - create-complete - Resource discovery creation is complete. - // - // - create-failed - Resource discovery creation has failed. - // - // - modify-in-progress - Resource discovery is being modified. - // - // - modify-complete - Resource discovery modification is complete. - // - // - modify-failed - Resource discovery modification has failed. - // - // - delete-in-progress - Resource discovery is being deleted. - // - // - delete-complete - Resource discovery deletion is complete. - // - // - delete-failed - Resource discovery deletion has failed. - // - // - isolate-in-progress - Amazon Web Services account that created the resource - // discovery has been removed and the resource discovery is being isolated. - // - // - isolate-complete - Resource discovery isolation is complete. - // - // - restore-in-progress - Amazon Web Services account that created the resource - // discovery and was isolated has been restored. - State IpamResourceDiscoveryState - - // A tag is a label that you assign to an Amazon Web Services resource. Each tag - // consists of a key and an optional value. You can use tags to search and filter - // your resources or track your Amazon Web Services costs. - Tags []Tag - - noSmithyDocumentSerde -} - -// An IPAM resource discovery association. An associated resource discovery is a -// resource discovery that has been associated with an IPAM. IPAM aggregates the -// resource CIDRs discovered by the associated resource discovery. -type IpamResourceDiscoveryAssociation struct { - - // The IPAM ARN. - IpamArn *string - - // The IPAM ID. - IpamId *string - - // The IPAM home Region. - IpamRegion *string - - // The resource discovery association Amazon Resource Name (ARN). - IpamResourceDiscoveryAssociationArn *string - - // The resource discovery association ID. - IpamResourceDiscoveryAssociationId *string - - // The resource discovery ID. - IpamResourceDiscoveryId *string - - // Defines if the resource discovery is the default. When you create an IPAM, a - // default resource discovery is created for your IPAM and it's associated with - // your IPAM. - IsDefault *bool - - // The Amazon Web Services account ID of the resource discovery owner. - OwnerId *string - - // The resource discovery status. - // - // - active - Connection or permissions required to read the results of the - // resource discovery are intact. - // - // - not-found - Connection or permissions required to read the results of the - // resource discovery are broken. This may happen if the owner of the resource - // discovery stopped sharing it or deleted the resource discovery. Verify the - // resource discovery still exists and the Amazon Web Services RAM resource share - // is still intact. - ResourceDiscoveryStatus IpamAssociatedResourceDiscoveryStatus - - // The lifecycle state of the association when you associate or disassociate a - // resource discovery. - // - // - associate-in-progress - Resource discovery is being associated. - // - // - associate-complete - Resource discovery association is complete. - // - // - associate-failed - Resource discovery association has failed. - // - // - disassociate-in-progress - Resource discovery is being disassociated. - // - // - disassociate-complete - Resource discovery disassociation is complete. - // - // - disassociate-failed - Resource discovery disassociation has failed. - // - // - isolate-in-progress - Amazon Web Services account that created the resource - // discovery association has been removed and the resource discovery associatation - // is being isolated. - // - // - isolate-complete - Resource discovery isolation is complete.. - // - // - restore-in-progress - Resource discovery is being restored. - State IpamResourceDiscoveryAssociationState - - // A tag is a label that you assign to an Amazon Web Services resource. Each tag - // consists of a key and an optional value. You can use tags to search and filter - // your resources or track your Amazon Web Services costs. - Tags []Tag - - noSmithyDocumentSerde -} - -// The key/value combination of a tag assigned to the resource. Use the tag key in -// the filter name and the tag value as the filter value. For example, to find all -// resources that have a tag with the key Owner and the value TeamA , specify -// tag:Owner for the filter name and TeamA for the filter value. -type IpamResourceTag struct { - - // The key of a tag assigned to the resource. Use this filter to find all - // resources assigned a tag with a specific key, regardless of the tag value. - Key *string - - // The value of the tag. - Value *string - - noSmithyDocumentSerde -} - -// In IPAM, a scope is the highest-level container within IPAM. An IPAM contains -// two default scopes. Each scope represents the IP space for a single network. The -// private scope is intended for all private IP address space. The public scope is -// intended for all public IP address space. Scopes enable you to reuse IP -// addresses across multiple unconnected networks without causing IP address -// overlap or conflict. -// -// For more information, see [How IPAM works] in the Amazon VPC IPAM User Guide. -// -// [How IPAM works]: https://docs.aws.amazon.com/vpc/latest/ipam/how-it-works-ipam.html -type IpamScope struct { - - // The description of the scope. - Description *string - - // The ARN of the IPAM. - IpamArn *string - - // The Amazon Web Services Region of the IPAM scope. - IpamRegion *string - - // The Amazon Resource Name (ARN) of the scope. - IpamScopeArn *string - - // The ID of the scope. - IpamScopeId *string - - // The type of the scope. - IpamScopeType IpamScopeType - - // Defines if the scope is the default scope or not. - IsDefault *bool - - // The Amazon Web Services account ID of the owner of the scope. - OwnerId *string - - // The number of pools in the scope. - PoolCount *int32 - - // The state of the IPAM scope. - State IpamScopeState - - // The key/value combination of a tag assigned to the resource. Use the tag key in - // the filter name and the tag value as the filter value. For example, to find all - // resources that have a tag with the key Owner and the value TeamA , specify - // tag:Owner for the filter name and TeamA for the filter value. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the permissions for a security group rule. -type IpPermission struct { - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types). - FromPort *int32 - - // The IP protocol name ( tcp , udp , icmp , icmpv6 ) or number (see [Protocol Numbers]). - // - // Use -1 to specify all protocols. When authorizing security group rules, - // specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 - // allows traffic on all ports, regardless of any port range you specify. For tcp , - // udp , and icmp , you must specify a port range. For icmpv6 , the port range is - // optional; if you omit the port range, traffic for all types and codes is - // allowed. - // - // [Protocol Numbers]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // The IPv4 address ranges. - IpRanges []IpRange - - // The IPv6 address ranges. - Ipv6Ranges []Ipv6Range - - // The prefix list IDs. - PrefixListIds []PrefixListId - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the - // start port is -1 (all ICMP types), then the end port must be -1 (all ICMP - // codes). - ToPort *int32 - - // The security group and Amazon Web Services account ID pairs. - UserIdGroupPairs []UserIdGroupPair - - noSmithyDocumentSerde -} - -// Describes an IPv4 address range. -type IpRange struct { - - // The IPv4 address range. You can either specify a CIDR block or a source - // security group, not both. To specify a single IPv4 address, use the /32 prefix - // length. - // - // Amazon Web Services [canonicalizes] IPv4 and IPv6 CIDRs. For example, if you specify - // 100.68.0.18/18 for the CIDR block, Amazon Web Services canonicalizes the CIDR - // block to 100.68.0.0/18. Any subsequent DescribeSecurityGroups and - // DescribeSecurityGroupRules calls will return the canonicalized form of the CIDR - // block. Additionally, if you attempt to add another rule with the non-canonical - // form of the CIDR (such as 100.68.0.18/18) and there is already a rule for the - // canonicalized form of the CIDR block (such as 100.68.0.0/18), the API throws an - // duplicate rule error. - // - // [canonicalizes]: https://en.wikipedia.org/wiki/Canonicalization - CidrIp *string - - // A description for the security group rule that references this IPv4 address - // range. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, - // 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - Description *string - - noSmithyDocumentSerde -} - -// Describes an IPv4 prefix. -type Ipv4PrefixSpecification struct { - - // The IPv4 prefix. For information, see [Assigning prefixes to network interfaces] in the Amazon EC2 User Guide. - // - // [Assigning prefixes to network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html - Ipv4Prefix *string - - noSmithyDocumentSerde -} - -// Describes the IPv4 prefix option for a network interface. -type Ipv4PrefixSpecificationRequest struct { - - // The IPv4 prefix. For information, see [Assigning prefixes to network interfaces] in the Amazon EC2 User Guide. - // - // [Assigning prefixes to network interfaces]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html - Ipv4Prefix *string - - noSmithyDocumentSerde -} - -// Information about the IPv4 delegated prefixes assigned to a network interface. -type Ipv4PrefixSpecificationResponse struct { - - // The IPv4 delegated prefixes assigned to the network interface. - Ipv4Prefix *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 CIDR block association. -type Ipv6CidrAssociation struct { - - // The resource that's associated with the IPv6 CIDR block. - AssociatedResource *string - - // The IPv6 CIDR block. - Ipv6Cidr *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 CIDR block. -type Ipv6CidrBlock struct { - - // The IPv6 CIDR block. - Ipv6CidrBlock *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 address pool. -type Ipv6Pool struct { - - // The description for the address pool. - Description *string - - // The CIDR blocks for the address pool. - PoolCidrBlocks []PoolCidrBlock - - // The ID of the address pool. - PoolId *string - - // Any tags for the address pool. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the IPv6 prefix. -type Ipv6PrefixSpecification struct { - - // The IPv6 prefix. - Ipv6Prefix *string - - noSmithyDocumentSerde -} - -// Describes the IPv6 prefix option for a network interface. -type Ipv6PrefixSpecificationRequest struct { - - // The IPv6 prefix. - Ipv6Prefix *string - - noSmithyDocumentSerde -} - -// Information about the IPv6 delegated prefixes assigned to a network interface. -type Ipv6PrefixSpecificationResponse struct { - - // The IPv6 delegated prefixes assigned to the network interface. - Ipv6Prefix *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 address range. -type Ipv6Range struct { - - // The IPv6 address range. You can either specify a CIDR block or a source - // security group, not both. To specify a single IPv6 address, use the /128 prefix - // length. - // - // Amazon Web Services [canonicalizes] IPv4 and IPv6 CIDRs. For example, if you specify - // 100.68.0.18/18 for the CIDR block, Amazon Web Services canonicalizes the CIDR - // block to 100.68.0.0/18. Any subsequent DescribeSecurityGroups and - // DescribeSecurityGroupRules calls will return the canonicalized form of the CIDR - // block. Additionally, if you attempt to add another rule with the non-canonical - // form of the CIDR (such as 100.68.0.18/18) and there is already a rule for the - // canonicalized form of the CIDR block (such as 100.68.0.0/18), the API throws an - // duplicate rule error. - // - // [canonicalizes]: https://en.wikipedia.org/wiki/Canonicalization - CidrIpv6 *string - - // A description for the security group rule that references this IPv6 address - // range. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, - // 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - Description *string - - noSmithyDocumentSerde -} - -// Describes a key pair. -type KeyPairInfo struct { - - // If you used Amazon EC2 to create the key pair, this is the date and time when - // the key was created, in [ISO 8601 date-time format], in the UTC time zone. - // - // If you imported an existing key pair to Amazon EC2, this is the date and time - // the key was imported, in [ISO 8601 date-time format], in the UTC time zone. - // - // [ISO 8601 date-time format]: https://www.iso.org/iso-8601-date-and-time-format.html - CreateTime *time.Time - - // If you used CreateKeyPair to create the key pair: - // - // - For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER - // encoded private key. - // - // - For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 - // digest, which is the default for OpenSSH, starting with [OpenSSH 6.8]. - // - // If you used ImportKeyPair to provide Amazon Web Services the public key: - // - // - For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as - // specified in section 4 of RFC4716. - // - // - For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 - // digest, which is the default for OpenSSH, starting with [OpenSSH 6.8]. - // - // [OpenSSH 6.8]: http://www.openssh.com/txt/release-6.8 - KeyFingerprint *string - - // The name of the key pair. - KeyName *string - - // The ID of the key pair. - KeyPairId *string - - // The type of key pair. - KeyType KeyType - - // The public key material. - PublicKey *string - - // Any tags applied to the key pair. - Tags []Tag - - noSmithyDocumentSerde -} - -// The last error that occurred for a VPC endpoint. -type LastError struct { - - // The error code for the VPC endpoint error. - Code *string - - // The error message for the VPC endpoint error. - Message *string - - noSmithyDocumentSerde -} - -// Describes a launch permission. -type LaunchPermission struct { - - // The name of the group. - Group PermissionGroup - - // The Amazon Resource Name (ARN) of an organization. - OrganizationArn *string - - // The Amazon Resource Name (ARN) of an organizational unit (OU). - OrganizationalUnitArn *string - - // The Amazon Web Services account ID. - // - // Constraints: Up to 10 000 account IDs can be specified in a single request. - UserId *string - - noSmithyDocumentSerde -} - -// Describes a launch permission modification. -type LaunchPermissionModifications struct { - - // The Amazon Web Services account ID, organization ARN, or OU ARN to add to the - // list of launch permissions for the AMI. - Add []LaunchPermission - - // The Amazon Web Services account ID, organization ARN, or OU ARN to remove from - // the list of launch permissions for the AMI. - Remove []LaunchPermission - - noSmithyDocumentSerde -} - -// Describes the launch specification for an instance. -type LaunchSpecification struct { - - // Deprecated. - AddressingType *string - - // The block device mapping entries. - BlockDeviceMappings []BlockDeviceMapping - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration stack - // to provide optimal EBS I/O performance. This optimization isn't available with - // all instance types. Additional usage charges apply when using an EBS Optimized - // instance. - // - // Default: false - EbsOptimized *bool - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification - - // The ID of the AMI. - ImageId *string - - // The instance type. Only one instance type can be specified. - InstanceType InstanceType - - // The ID of the kernel. - KernelId *string - - // The name of the key pair. - KeyName *string - - // Describes the monitoring of an instance. - Monitoring *RunInstancesMonitoringEnabled - - // The network interfaces. If you specify a network interface, you must specify - // subnet IDs and security group IDs using the network interface. - NetworkInterfaces []InstanceNetworkInterfaceSpecification - - // The placement information for the instance. - Placement *SpotPlacement - - // The ID of the RAM disk. - RamdiskId *string - - // The IDs of the security groups. - SecurityGroups []GroupIdentifier - - // The ID of the subnet in which to launch the instance. - SubnetId *string - - // The base64-encoded user data that instances use when starting up. User data is - // limited to 16 KB. - UserData *string - - noSmithyDocumentSerde -} - -// Describes a launch template. -type LaunchTemplate struct { - - // The time launch template was created. - CreateTime *time.Time - - // The principal that created the launch template. - CreatedBy *string - - // The version number of the default version of the launch template. - DefaultVersionNumber *int64 - - // The version number of the latest version of the launch template. - LatestVersionNumber *int64 - - // The ID of the launch template. - LaunchTemplateId *string - - // The name of the launch template. - LaunchTemplateName *string - - // The entity that manages the launch template. - Operator *OperatorResponse - - // The tags for the launch template. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a launch template and overrides. -type LaunchTemplateAndOverridesResponse struct { - - // The launch template. - LaunchTemplateSpecification *FleetLaunchTemplateSpecification - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides *FleetLaunchTemplateOverrides - - noSmithyDocumentSerde -} - -// Describes a block device mapping. -type LaunchTemplateBlockDeviceMapping struct { - - // The device name. - DeviceName *string - - // Information about the block device for an EBS volume. - Ebs *LaunchTemplateEbsBlockDevice - - // To omit the device from the block device mapping, specify an empty string. - NoDevice *string - - // The virtual device name (ephemeralN). - VirtualName *string - - noSmithyDocumentSerde -} - -// Describes a block device mapping. -type LaunchTemplateBlockDeviceMappingRequest struct { - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *LaunchTemplateEbsBlockDeviceRequest - - // To omit the device from the block device mapping, specify an empty string. - NoDevice *string - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes can - // specify mappings for ephemeral0 and ephemeral1. The number of available instance - // store volumes depends on the instance type. After you connect to the instance, - // you must mount the volume. - VirtualName *string - - noSmithyDocumentSerde -} - -// Describes an instance's Capacity Reservation targeting option. You can specify -// only one option at a time. Use the CapacityReservationPreference parameter to -// configure the instance to run in On-Demand capacity or to run in any open -// Capacity Reservation that has matching attributes (instance type, platform, -// Availability Zone). Use the CapacityReservationTarget parameter to explicitly -// target a specific Capacity Reservation or a Capacity Reservation group. -type LaunchTemplateCapacityReservationSpecificationRequest struct { - - // Indicates the instance's Capacity Reservation preferences. Possible preferences - // include: - // - // - capacity-reservations-only - The instance will only run in a Capacity - // Reservation or Capacity Reservation group. If capacity isn't available, the - // instance will fail to launch. - // - // - open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone, tenancy). - // - // - none - The instance avoids running in a Capacity Reservation even if one is - // available. The instance runs in On-Demand capacity. - CapacityReservationPreference CapacityReservationPreference - - // Information about the target Capacity Reservation or Capacity Reservation group. - CapacityReservationTarget *CapacityReservationTarget - - noSmithyDocumentSerde -} - -// Information about the Capacity Reservation targeting option. -type LaunchTemplateCapacityReservationSpecificationResponse struct { - - // Indicates the instance's Capacity Reservation preferences. Possible preferences - // include: - // - // - open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone). - // - // - none - The instance avoids running in a Capacity Reservation even if one is - // available. The instance runs in On-Demand capacity. - CapacityReservationPreference CapacityReservationPreference - - // Information about the target Capacity Reservation or Capacity Reservation group. - CapacityReservationTarget *CapacityReservationTargetResponse - - noSmithyDocumentSerde -} - -// Describes a launch template and overrides. -type LaunchTemplateConfig struct { - - // The launch template to use. Make sure that the launch template does not contain - // the NetworkInterfaceId parameter because you can't specify a network interface - // ID in a Spot Fleet. - LaunchTemplateSpecification *FleetLaunchTemplateSpecification - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides []LaunchTemplateOverrides - - noSmithyDocumentSerde -} - -// The CPU options for the instance. -type LaunchTemplateCpuOptions struct { - - // Indicates whether the instance is enabled for AMD SEV-SNP. For more - // information, see [AMD SEV-SNP for Amazon EC2 instances]. - // - // [AMD SEV-SNP for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html - AmdSevSnp AmdSevSnpSpecification - - // The number of CPU cores for the instance. - CoreCount *int32 - - // The number of threads per CPU core. - ThreadsPerCore *int32 - - noSmithyDocumentSerde -} - -// The CPU options for the instance. Both the core count and threads per core must -// be specified in the request. -type LaunchTemplateCpuOptionsRequest struct { - - // Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is - // supported with M6a, R6a, and C6a instance types only. For more information, see [AMD SEV-SNP for Amazon EC2 instances] - // . - // - // [AMD SEV-SNP for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html - AmdSevSnp AmdSevSnpSpecification - - // The number of CPU cores for the instance. - CoreCount *int32 - - // The number of threads per CPU core. To disable multithreading for the instance, - // specify a value of 1 . Otherwise, specify the default value of 2 . - ThreadsPerCore *int32 - - noSmithyDocumentSerde -} - -// Describes a block device for an EBS volume. -type LaunchTemplateEbsBlockDevice struct { - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool - - // Indicates whether the EBS volume is encrypted. - Encrypted *bool - - // The number of I/O operations per second (IOPS) that the volume supports. - Iops *int32 - - // Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed - // KMS key to use for EBS encryption. - KmsKeyId *string - - // The ID of the snapshot. - SnapshotId *string - - // The throughput that the volume supports, in MiB/s. - Throughput *int32 - - // The Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate) specified for the volume, in MiB/s. If no volume - // initialization rate was specified, the value is null . - VolumeInitializationRate *int32 - - // The size of the volume, in GiB. - VolumeSize *int32 - - // The volume type. - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// The parameters for a block device for an EBS volume. -type LaunchTemplateEbsBlockDeviceRequest struct { - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool - - // Indicates whether the EBS volume is encrypted. Encrypted volumes can only be - // attached to instances that support Amazon EBS encryption. If you are creating a - // volume from a snapshot, you can't specify an encryption value. - Encrypted *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - // - // The following are the supported values for each volume type: - // - // - gp3 : 3,000 - 16,000 IOPS - // - // - io1 : 100 - 64,000 IOPS - // - // - io2 : 100 - 256,000 IOPS - // - // For io2 volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System]. On other instances, - // you can achieve performance up to 32,000 IOPS. - // - // This parameter is supported for io1 , io2 , and gp3 volumes only. - // - // [instances built on the Nitro System]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html - Iops *int32 - - // Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed - // KMS key to use for EBS encryption. - KmsKeyId *string - - // The ID of the snapshot. - SnapshotId *string - - // The throughput to provision for a gp3 volume, with a maximum of 1,000 MiB/s. - // - // Valid Range: Minimum value of 125. Maximum value of 1000. - Throughput *int32 - - // Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate), in MiB/s, at which to download the snapshot blocks from - // Amazon S3 to the volume. This is also known as volume initialization. Specifying - // a volume initialization rate ensures that the volume is initialized at a - // predictable and consistent rate after creation. - // - // This parameter is supported only for volumes created from snapshots. Omit this - // parameter if: - // - // - You want to create the volume using fast snapshot restore. You must specify - // a snapshot that is enabled for fast snapshot restore. In this case, the volume - // is fully initialized at creation. - // - // If you specify a snapshot that is enabled for fast snapshot restore and a - // volume initialization rate, the volume will be initialized at the specified rate - // instead of fast snapshot restore. - // - // - You want to create a volume that is initialized at the default rate. - // - // For more information, see [Initialize Amazon EBS volumes] in the Amazon EC2 User Guide. - // - // Valid range: 100 - 300 MiB/s - // - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - VolumeInitializationRate *int32 - - // The size of the volume, in GiBs. You must specify either a snapshot ID or a - // volume size. The following are the supported volumes sizes for each volume type: - // - // - gp2 and gp3 : 1 - 16,384 GiB - // - // - io1 : 4 - 16,384 GiB - // - // - io2 : 4 - 65,536 GiB - // - // - st1 and sc1 : 125 - 16,384 GiB - // - // - standard : 1 - 1024 GiB - VolumeSize *int32 - - // The volume type. For more information, see [Amazon EBS volume types] in the Amazon EBS User Guide. - // - // [Amazon EBS volume types]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes an elastic inference accelerator. -type LaunchTemplateElasticInferenceAccelerator struct { - - // The type of elastic inference accelerator. The possible values are - // eia1.medium, eia1.large, and eia1.xlarge. - // - // This member is required. - Type *string - - // The number of elastic inference accelerators to attach to the instance. - // - // Default: 1 - Count *int32 - - noSmithyDocumentSerde -} - -// Amazon Elastic Inference is no longer available. -// -// Describes an elastic inference accelerator. -type LaunchTemplateElasticInferenceAcceleratorResponse struct { - - // The number of elastic inference accelerators to attach to the instance. - // - // Default: 1 - Count *int32 - - // The type of elastic inference accelerator. The possible values are - // eia1.medium, eia1.large, and eia1.xlarge. - Type *string - - noSmithyDocumentSerde -} - -// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) -// technology to increase the maximum bandwidth used per stream and minimize tail -// latency of network traffic between EC2 instances. With ENA Express, you can -// communicate between two EC2 instances in the same subnet within the same -// account, or in different accounts. Both sending and receiving instances must -// have ENA Express enabled. -// -// To improve the reliability of network packet delivery, ENA Express reorders -// network packets on the receiving end by default. However, some UDP-based -// applications are designed to handle network packets that are out of order to -// reduce the overhead for packet delivery at the network layer. When ENA Express -// is enabled, you can specify whether UDP network traffic uses it. -type LaunchTemplateEnaSrdSpecification struct { - - // Indicates whether ENA Express is enabled for the network interface. - EnaSrdEnabled *bool - - // Configures ENA Express for UDP network traffic. - EnaSrdUdpSpecification *LaunchTemplateEnaSrdUdpSpecification - - noSmithyDocumentSerde -} - -// ENA Express is compatible with both TCP and UDP transport protocols. When it's -// enabled, TCP traffic automatically uses it. However, some UDP-based applications -// are designed to handle network packets that are out of order, without a need for -// retransmission, such as live video broadcasting or other near-real-time -// applications. For UDP traffic, you can specify whether to use ENA Express, based -// on your application environment needs. -type LaunchTemplateEnaSrdUdpSpecification struct { - - // Indicates whether UDP traffic to and from the instance uses ENA Express. To - // specify this setting, you must first enable ENA Express. - EnaSrdUdpEnabled *bool - - noSmithyDocumentSerde -} - -// Indicates whether the instance is enabled for Amazon Web Services Nitro -// Enclaves. -type LaunchTemplateEnclaveOptions struct { - - // If this parameter is set to true , the instance is enabled for Amazon Web - // Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services - // Nitro Enclaves. - Enabled *bool - - noSmithyDocumentSerde -} - -// Indicates whether the instance is enabled for Amazon Web Services Nitro -// Enclaves. For more information, see [What is Nitro Enclaves?]in the Amazon Web Services Nitro Enclaves -// User Guide. -// -// [What is Nitro Enclaves?]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html -type LaunchTemplateEnclaveOptionsRequest struct { - - // To enable the instance for Amazon Web Services Nitro Enclaves, set this - // parameter to true . - Enabled *bool - - noSmithyDocumentSerde -} - -// Indicates whether an instance is configured for hibernation. -type LaunchTemplateHibernationOptions struct { - - // If this parameter is set to true , the instance is enabled for hibernation; - // otherwise, it is not enabled for hibernation. - Configured *bool - - noSmithyDocumentSerde -} - -// Indicates whether the instance is configured for hibernation. This parameter is -// valid only if the instance meets the [hibernation prerequisites]. -// -// [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html -type LaunchTemplateHibernationOptionsRequest struct { - - // If you set this parameter to true , the instance is enabled for hibernation. - // - // Default: false - Configured *bool - - noSmithyDocumentSerde -} - -// Describes an IAM instance profile. -type LaunchTemplateIamInstanceProfileSpecification struct { - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string - - // The name of the instance profile. - Name *string - - noSmithyDocumentSerde -} - -// An IAM instance profile. -type LaunchTemplateIamInstanceProfileSpecificationRequest struct { - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string - - // The name of the instance profile. - Name *string - - noSmithyDocumentSerde -} - -// The maintenance options of your instance. -type LaunchTemplateInstanceMaintenanceOptions struct { - - // Disables the automatic recovery behavior of your instance or sets it to default. - AutoRecovery LaunchTemplateAutoRecoveryState - - noSmithyDocumentSerde -} - -// The maintenance options of your instance. -type LaunchTemplateInstanceMaintenanceOptionsRequest struct { - - // Disables the automatic recovery behavior of your instance or sets it to - // default. For more information, see [Simplified automatic recovery]. - // - // [Simplified automatic recovery]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery - AutoRecovery LaunchTemplateAutoRecoveryState - - noSmithyDocumentSerde -} - -// The market (purchasing) option for the instances. -type LaunchTemplateInstanceMarketOptions struct { - - // The market type. - MarketType MarketType - - // The options for Spot Instances. - SpotOptions *LaunchTemplateSpotMarketOptions - - noSmithyDocumentSerde -} - -// The market (purchasing) option for the instances. -type LaunchTemplateInstanceMarketOptionsRequest struct { - - // The market type. - MarketType MarketType - - // The options for Spot Instances. - SpotOptions *LaunchTemplateSpotMarketOptionsRequest - - noSmithyDocumentSerde -} - -// The metadata options for the instance. For more information, see [Use instance metadata to manage your EC2 instance] in the Amazon -// EC2 User Guide. -// -// [Use instance metadata to manage your EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html -type LaunchTemplateInstanceMetadataOptions struct { - - // Enables or disables the HTTP metadata endpoint on your instances. If the - // parameter is not specified, the default state is enabled . - // - // If you specify a value of disabled , you will not be able to access your - // instance metadata. - HttpEndpoint LaunchTemplateInstanceMetadataEndpointState - - // Enables or disables the IPv6 endpoint for the instance metadata service. - // - // Default: disabled - HttpProtocolIpv6 LaunchTemplateInstanceMetadataProtocolIpv6 - - // The desired HTTP PUT response hop limit for instance metadata requests. The - // larger the number, the further instance metadata requests can travel. - // - // Default: 1 - // - // Possible values: Integers from 1 to 64 - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional - IMDSv2 is optional. You can choose whether to send a session - // token in your instance metadata retrieval requests. If you retrieve IAM role - // credentials without a session token, you receive the IMDSv1 role credentials. If - // you retrieve IAM role credentials using a valid session token, you receive the - // IMDSv2 role credentials. - // - // - required - IMDSv2 is required. You must send a session token in your - // instance metadata retrieval requests. With this option, retrieving the IAM role - // credentials always returns IMDSv2 credentials; IMDSv1 credentials are not - // available. - HttpTokens LaunchTemplateHttpTokensState - - // Set to enabled to allow access to instance tags from the instance metadata. Set - // to disabled to turn off access to instance tags from the instance metadata. For - // more information, see [View tags for your EC2 instances using instance metadata]. - // - // Default: disabled - // - // [View tags for your EC2 instances using instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-tags-in-IMDS.html - InstanceMetadataTags LaunchTemplateInstanceMetadataTagsState - - // The state of the metadata option changes. - // - // pending - The metadata options are being updated and the instance is not ready - // to process metadata traffic with the new selection. - // - // applied - The metadata options have been successfully applied on the instance. - State LaunchTemplateInstanceMetadataOptionsState - - noSmithyDocumentSerde -} - -// The metadata options for the instance. For more information, see [Use instance metadata to manage your EC2 instance] in the Amazon -// EC2 User Guide. -// -// [Use instance metadata to manage your EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html -type LaunchTemplateInstanceMetadataOptionsRequest struct { - - // Enables or disables the HTTP metadata endpoint on your instances. If the - // parameter is not specified, the default state is enabled . - // - // If you specify a value of disabled , you will not be able to access your - // instance metadata. - HttpEndpoint LaunchTemplateInstanceMetadataEndpointState - - // Enables or disables the IPv6 endpoint for the instance metadata service. - // - // Default: disabled - HttpProtocolIpv6 LaunchTemplateInstanceMetadataProtocolIpv6 - - // The desired HTTP PUT response hop limit for instance metadata requests. The - // larger the number, the further instance metadata requests can travel. - // - // Default: 1 - // - // Possible values: Integers from 1 to 64 - HttpPutResponseHopLimit *int32 - - // Indicates whether IMDSv2 is required. - // - // - optional - IMDSv2 is optional. You can choose whether to send a session - // token in your instance metadata retrieval requests. If you retrieve IAM role - // credentials without a session token, you receive the IMDSv1 role credentials. If - // you retrieve IAM role credentials using a valid session token, you receive the - // IMDSv2 role credentials. - // - // - required - IMDSv2 is required. You must send a session token in your - // instance metadata retrieval requests. With this option, retrieving the IAM role - // credentials always returns IMDSv2 credentials; IMDSv1 credentials are not - // available. - // - // Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for - // your instance is v2.0 , the default is required . - HttpTokens LaunchTemplateHttpTokensState - - // Set to enabled to allow access to instance tags from the instance metadata. Set - // to disabled to turn off access to instance tags from the instance metadata. For - // more information, see [View tags for your EC2 instances using instance metadata]. - // - // Default: disabled - // - // [View tags for your EC2 instances using instance metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-tags-in-IMDS.html - InstanceMetadataTags LaunchTemplateInstanceMetadataTagsState - - noSmithyDocumentSerde -} - -// Describes a network interface. -type LaunchTemplateInstanceNetworkInterfaceSpecification struct { - - // Indicates whether to associate a Carrier IP address with eth0 for a new network - // interface. - // - // Use this option when you launch an instance in a Wavelength Zone and want to - // associate a Carrier IP address with the network interface. For more information - // about Carrier IP addresses, see [Carrier IP address]in the Wavelength Developer Guide. - // - // [Carrier IP address]: https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#provider-owned-ip - AssociateCarrierIpAddress *bool - - // Indicates whether to associate a public IPv4 address with eth0 for a new - // network interface. - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - AssociatePublicIpAddress *bool - - // A security group connection tracking specification that enables you to set the - // timeout for connection tracking on an Elastic network interface. For more - // information, see [Idle connection tracking timeout]in the Amazon EC2 User Guide. - // - // [Idle connection tracking timeout]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts - ConnectionTrackingSpecification *ConnectionTrackingSpecification - - // Indicates whether the network interface is deleted when the instance is - // terminated. - DeleteOnTermination *bool - - // A description for the network interface. - Description *string - - // The device index for the network interface attachment. - DeviceIndex *int32 - - // The number of ENA queues created with the instance. - EnaQueueCount *int32 - - // Contains the ENA Express settings for instances launched from your launch - // template. - EnaSrdSpecification *LaunchTemplateEnaSrdSpecification - - // The IDs of one or more security groups. - Groups []string - - // The type of network interface. - InterfaceType *string - - // The number of IPv4 prefixes that Amazon Web Services automatically assigned to - // the network interface. - Ipv4PrefixCount *int32 - - // One or more IPv4 prefixes assigned to the network interface. - Ipv4Prefixes []Ipv4PrefixSpecificationResponse - - // The number of IPv6 addresses for the network interface. - Ipv6AddressCount *int32 - - // The IPv6 addresses for the network interface. - Ipv6Addresses []InstanceIpv6Address - - // The number of IPv6 prefixes that Amazon Web Services automatically assigned to - // the network interface. - Ipv6PrefixCount *int32 - - // One or more IPv6 prefixes assigned to the network interface. - Ipv6Prefixes []Ipv6PrefixSpecificationResponse - - // The index of the network card. - NetworkCardIndex *int32 - - // The ID of the network interface. - NetworkInterfaceId *string - - // The primary IPv6 address of the network interface. When you enable an IPv6 GUA - // address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 - // address until the instance is terminated or the network interface is detached. - // For more information about primary IPv6 addresses, see [RunInstances]. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - PrimaryIpv6 *bool - - // The primary private IPv4 address of the network interface. - PrivateIpAddress *string - - // One or more private IPv4 addresses. - PrivateIpAddresses []PrivateIpAddressSpecification - - // The number of secondary private IPv4 addresses for the network interface. - SecondaryPrivateIpAddressCount *int32 - - // The ID of the subnet for the network interface. - SubnetId *string - - noSmithyDocumentSerde -} - -// The parameters for a network interface. -type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { - - // Associates a Carrier IP address with eth0 for a new network interface. - // - // Use this option when you launch an instance in a Wavelength Zone and want to - // associate a Carrier IP address with the network interface. For more information - // about Carrier IP addresses, see [Carrier IP addresses]in the Wavelength Developer Guide. - // - // [Carrier IP addresses]: https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#provider-owned-ip - AssociateCarrierIpAddress *bool - - // Associates a public IPv4 address with eth0 for a new network interface. - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - AssociatePublicIpAddress *bool - - // A security group connection tracking specification that enables you to set the - // timeout for connection tracking on an Elastic network interface. For more - // information, see [Idle connection tracking timeout]in the Amazon EC2 User Guide. - // - // [Idle connection tracking timeout]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts - ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest - - // Indicates whether the network interface is deleted when the instance is - // terminated. - DeleteOnTermination *bool - - // A description for the network interface. - Description *string - - // The device index for the network interface attachment. The primary network - // interface has a device index of 0. Each network interface is of type interface , - // you must specify a device index. If you create a launch template that includes - // secondary network interfaces but not a primary network interface, then you must - // add a primary network interface as a launch parameter when you launch an - // instance from the template. - DeviceIndex *int32 - - // The number of ENA queues to be created with the instance. - EnaQueueCount *int32 - - // Configure ENA Express settings for your launch template. - EnaSrdSpecification *EnaSrdSpecificationRequest - - // The IDs of one or more security groups. - Groups []string - - // The type of network interface. To create an Elastic Fabric Adapter (EFA), - // specify efa or efa . For more information, see [Elastic Fabric Adapter for AI/ML and HPC workloads on Amazon EC2] in the Amazon EC2 User Guide. - // - // If you are not creating an EFA, specify interface or omit this parameter. - // - // If you specify efa-only , do not assign any IP addresses to the network - // interface. EFA-only network interfaces do not support IP addresses. - // - // Valid values: interface | efa | efa-only - // - // [Elastic Fabric Adapter for AI/ML and HPC workloads on Amazon EC2]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html - InterfaceType *string - - // The number of IPv4 prefixes to be automatically assigned to the network - // interface. You cannot use this option if you use the Ipv4Prefix option. - Ipv4PrefixCount *int32 - - // One or more IPv4 prefixes to be assigned to the network interface. You cannot - // use this option if you use the Ipv4PrefixCount option. - Ipv4Prefixes []Ipv4PrefixSpecificationRequest - - // The number of IPv6 addresses to assign to a network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't use - // this option if specifying specific IPv6 addresses. - Ipv6AddressCount *int32 - - // One or more specific IPv6 addresses from the IPv6 CIDR block range of your - // subnet. You can't use this option if you're specifying a number of IPv6 - // addresses. - Ipv6Addresses []InstanceIpv6AddressRequest - - // The number of IPv6 prefixes to be automatically assigned to the network - // interface. You cannot use this option if you use the Ipv6Prefix option. - Ipv6PrefixCount *int32 - - // One or more IPv6 prefixes to be assigned to the network interface. You cannot - // use this option if you use the Ipv6PrefixCount option. - Ipv6Prefixes []Ipv6PrefixSpecificationRequest - - // The index of the network card. Some instance types support multiple network - // cards. The primary network interface must be assigned to network card index 0. - // The default is network card index 0. - NetworkCardIndex *int32 - - // The ID of the network interface. - NetworkInterfaceId *string - - // The primary IPv6 address of the network interface. When you enable an IPv6 GUA - // address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 - // address until the instance is terminated or the network interface is detached. - // For more information about primary IPv6 addresses, see [RunInstances]. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - PrimaryIpv6 *bool - - // The primary private IPv4 address of the network interface. - PrivateIpAddress *string - - // One or more private IPv4 addresses. - PrivateIpAddresses []PrivateIpAddressSpecification - - // The number of secondary private IPv4 addresses to assign to a network interface. - SecondaryPrivateIpAddressCount *int32 - - // The ID of the subnet for the network interface. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes a license configuration. -type LaunchTemplateLicenseConfiguration struct { - - // The Amazon Resource Name (ARN) of the license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// Describes a license configuration. -type LaunchTemplateLicenseConfigurationRequest struct { - - // The Amazon Resource Name (ARN) of the license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// With network performance options, you can adjust your bandwidth preferences to -// meet the needs of the workload that runs on your instance at launch. -type LaunchTemplateNetworkPerformanceOptions struct { - - // When you configure network bandwidth weighting, you can boost baseline - // bandwidth for either networking or EBS by up to 25%. The total available - // baseline bandwidth for your instance remains the same. The default option uses - // the standard bandwidth configuration for your instance type. - BandwidthWeighting InstanceBandwidthWeighting - - noSmithyDocumentSerde -} - -// When you configure network performance options in your launch template, your -// instance is geared for performance improvements based on the workload that it -// runs as soon as it's available. -type LaunchTemplateNetworkPerformanceOptionsRequest struct { - - // Specify the bandwidth weighting option to boost the associated type of baseline - // bandwidth, as follows: - // - // default This option uses the standard bandwidth configuration for your instance - // type. - // - // vpc-1 This option boosts your networking baseline bandwidth and reduces your - // EBS baseline bandwidth. - // - // ebs-1 This option boosts your EBS baseline bandwidth and reduces your - // networking baseline bandwidth. - BandwidthWeighting InstanceBandwidthWeighting - - noSmithyDocumentSerde -} - -// Describes overrides for a launch template. -type LaunchTemplateOverrides struct { - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string - - // The instance requirements. When you specify instance requirements, Amazon EC2 - // will identify instance types with the provided requirements, and then use your - // On-Demand and Spot allocation strategies to launch instances from these instance - // types, in the same way as when you specify a list of instance types. - // - // If you specify InstanceRequirements , you can't specify InstanceType . - InstanceRequirements *InstanceRequirements - - // The instance type. - InstanceType InstanceType - - // The priority for the launch template override. The highest priority is launched - // first. - // - // If OnDemandAllocationStrategy is set to prioritized , Spot Fleet uses priority - // to determine which launch template override to use first in fulfilling On-Demand - // capacity. - // - // If the Spot AllocationStrategy is set to capacityOptimizedPrioritized , Spot - // Fleet uses priority on a best-effort basis to determine which launch template - // override to use in fulfilling Spot capacity, but optimizes for capacity first. - // - // Valid values are whole numbers starting at 0 . The lower the number, the higher - // the priority. If no number is set, the launch template override has the lowest - // priority. You can set the same priority for different launch template overrides. - Priority *float64 - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The ID of the subnet in which to launch the instances. - SubnetId *string - - // The number of units provided by the specified instance type. These are the same - // units that you chose to set the target capacity in terms of instances, or a - // performance characteristic such as vCPUs, memory, or I/O. - // - // If the target capacity divided by this value is not a whole number, Amazon EC2 - // rounds the number of instances to the next whole number. If this value is not - // specified, the default is 1. - // - // When specifying weights, the price used in the lowestPrice and - // priceCapacityOptimized allocation strategies is per unit hour (where the - // instance price is divided by the specified weight). However, if all the - // specified weights are above the requested TargetCapacity , resulting in only 1 - // instance being launched, the price used is per instance hour. - WeightedCapacity *float64 - - noSmithyDocumentSerde -} - -// Describes the placement of an instance. -type LaunchTemplatePlacement struct { - - // The affinity setting for the instance on the Dedicated Host. - Affinity *string - - // The Availability Zone of the instance. - AvailabilityZone *string - - // The Group ID of the placement group. You must specify the Placement Group Group - // ID to launch an instance in a shared placement group. - GroupId *string - - // The name of the placement group for the instance. - GroupName *string - - // The ID of the Dedicated Host for the instance. - HostId *string - - // The ARN of the host resource group in which to launch the instances. - HostResourceGroupArn *string - - // The number of the partition the instance should launch in. Valid only if the - // placement group strategy is set to partition . - PartitionNumber *int32 - - // Reserved for future use. - SpreadDomain *string - - // The tenancy of the instance. An instance with a tenancy of dedicated runs on - // single-tenant hardware. - Tenancy Tenancy - - noSmithyDocumentSerde -} - -// Describes the placement of an instance. -type LaunchTemplatePlacementRequest struct { - - // The affinity setting for an instance on a Dedicated Host. - Affinity *string - - // The Availability Zone for the instance. - AvailabilityZone *string - - // The Group Id of a placement group. You must specify the Placement Group Group - // Id to launch an instance in a shared placement group. - GroupId *string - - // The name of the placement group for the instance. - GroupName *string - - // The ID of the Dedicated Host for the instance. - HostId *string - - // The ARN of the host resource group in which to launch the instances. If you - // specify a host resource group ARN, omit the Tenancy parameter or set it to host . - HostResourceGroupArn *string - - // The number of the partition the instance should launch in. Valid only if the - // placement group strategy is set to partition . - PartitionNumber *int32 - - // Reserved for future use. - SpreadDomain *string - - // The tenancy of the instance. An instance with a tenancy of dedicated runs on - // single-tenant hardware. - Tenancy Tenancy - - noSmithyDocumentSerde -} - -// Describes the options for instance hostnames. -type LaunchTemplatePrivateDnsNameOptions struct { - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname to assign to an instance. - HostnameType HostnameType - - noSmithyDocumentSerde -} - -// Describes the options for instance hostnames. -type LaunchTemplatePrivateDnsNameOptionsRequest struct { - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname for Amazon EC2 instances. For IPv4 only subnets, an - // instance DNS name must be based on the instance IPv4 address. For IPv6 native - // subnets, an instance DNS name must be based on the instance ID. For dual-stack - // subnets, you can specify whether DNS names use the instance IPv4 address or the - // instance ID. - HostnameType HostnameType - - noSmithyDocumentSerde -} - -// Describes the monitoring for the instance. -type LaunchTemplatesMonitoring struct { - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes the monitoring for the instance. -type LaunchTemplatesMonitoringRequest struct { - - // Specify true to enable detailed monitoring. Otherwise, basic monitoring is - // enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes the launch template to use. -type LaunchTemplateSpecification struct { - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateId *string - - // The name of the launch template. - // - // You must specify either the launch template ID or the launch template name, but - // not both. - LaunchTemplateName *string - - // The launch template version number, $Latest , or $Default . - // - // A value of $Latest uses the latest version of the launch template. - // - // A value of $Default uses the default version of the launch template. - // - // Default: The default version of the launch template. - Version *string - - noSmithyDocumentSerde -} - -// The options for Spot Instances. -type LaunchTemplateSpotMarketOptions struct { - - // The required duration for the Spot Instances (also known as Spot blocks), in - // minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360). - BlockDurationMinutes *int32 - - // The behavior when a Spot Instance is interrupted. - InstanceInterruptionBehavior InstanceInterruptionBehavior - - // The maximum hourly price you're willing to pay for a Spot Instance. We do not - // recommend using this parameter because it can lead to increased interruptions. - // If you do not specify this parameter, you will pay the current Spot price. If - // you do specify this parameter, it must be more than USD $0.001. Specifying a - // value below USD $0.001 will result in an InvalidParameterValue error message - // when the launch template is used to launch an instance. - MaxPrice *string - - // The Spot Instance request type. - SpotInstanceType SpotInstanceType - - // The end date of the request. For a one-time request, the request remains active - // until all instances launch, the request is canceled, or this date is reached. If - // the request is persistent, it remains active until it is canceled or this date - // and time is reached. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// The options for Spot Instances. -type LaunchTemplateSpotMarketOptionsRequest struct { - - // Deprecated. - BlockDurationMinutes *int32 - - // The behavior when a Spot Instance is interrupted. The default is terminate . - InstanceInterruptionBehavior InstanceInterruptionBehavior - - // The maximum hourly price you're willing to pay for a Spot Instance. We do not - // recommend using this parameter because it can lead to increased interruptions. - // If you do not specify this parameter, you will pay the current Spot price. If - // you do specify this parameter, it must be more than USD $0.001. Specifying a - // value below USD $0.001 will result in an InvalidParameterValue error message - // when the launch template is used to launch an instance. - // - // If you specify a maximum price, your Spot Instances will be interrupted more - // frequently than if you do not specify this parameter. - MaxPrice *string - - // The Spot Instance request type. - SpotInstanceType SpotInstanceType - - // The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). Supported - // only for persistent requests. - // - // - For a persistent request, the request remains active until the ValidUntil - // date and time is reached. Otherwise, the request remains active until you cancel - // it. - // - // - For a one-time request, ValidUntil is not supported. The request remains - // active until all instances launch or you cancel the request. - // - // Default: 7 days from the current date - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// The tags specification for the launch template. -type LaunchTemplateTagSpecification struct { - - // The type of resource to tag. - ResourceType ResourceType - - // The tags for the resource. - Tags []Tag - - noSmithyDocumentSerde -} - -// The tags specification for the resources that are created during instance -// launch. -type LaunchTemplateTagSpecificationRequest struct { - - // The type of resource to tag. - // - // Valid Values lists all resource types for Amazon EC2 that can be tagged. When - // you create a launch template, you can specify tags for the following resource - // types only: instance | volume | network-interface | spot-instances-request . If - // the instance does not include the resource type that you specify, the instance - // launch fails. For example, not all instance types include a volume. - // - // To tag a resource after it has been created, see [CreateTags]. - // - // [CreateTags]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html - ResourceType ResourceType - - // The tags to apply to the resource. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a launch template version. -type LaunchTemplateVersion struct { - - // The time the version was created. - CreateTime *time.Time - - // The principal that created the version. - CreatedBy *string - - // Indicates whether the version is the default version. - DefaultVersion *bool - - // Information about the launch template. - LaunchTemplateData *ResponseLaunchTemplateData - - // The ID of the launch template. - LaunchTemplateId *string - - // The name of the launch template. - LaunchTemplateName *string - - // The entity that manages the launch template. - Operator *OperatorResponse - - // The description for the version. - VersionDescription *string - - // The version number. - VersionNumber *int64 - - noSmithyDocumentSerde -} - -// Describes a license configuration. -type LicenseConfiguration struct { - - // The Amazon Resource Name (ARN) of the license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// Describes a license configuration. -type LicenseConfigurationRequest struct { - - // The Amazon Resource Name (ARN) of the license configuration. - LicenseConfigurationArn *string - - noSmithyDocumentSerde -} - -// Describes the Classic Load Balancers and target groups to attach to a Spot -// Fleet request. -type LoadBalancersConfig struct { - - // The Classic Load Balancers. - ClassicLoadBalancersConfig *ClassicLoadBalancersConfig - - // The target groups. - TargetGroupsConfig *TargetGroupsConfig - - noSmithyDocumentSerde -} - -// Describes a load permission. -type LoadPermission struct { - - // The name of the group. - Group PermissionGroup - - // The Amazon Web Services account ID. - UserId *string - - noSmithyDocumentSerde -} - -// Describes modifications to the load permissions of an Amazon FPGA image (AFI). -type LoadPermissionModifications struct { - - // The load permissions to add. - Add []LoadPermissionRequest - - // The load permissions to remove. - Remove []LoadPermissionRequest - - noSmithyDocumentSerde -} - -// Describes a load permission. -type LoadPermissionRequest struct { - - // The name of the group. - Group PermissionGroup - - // The Amazon Web Services account ID. - UserId *string - - noSmithyDocumentSerde -} - -// Describes a local gateway. -type LocalGateway struct { - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the local gateway. - OwnerId *string - - // The state of the local gateway. - State *string - - // The tags assigned to the local gateway. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a route for a local gateway route table. -type LocalGatewayRoute struct { - - // The ID of the customer-owned address pool. - CoipPoolId *string - - // The CIDR block used for destination matches. - DestinationCidrBlock *string - - // The ID of the prefix list. - DestinationPrefixListId *string - - // The Amazon Resource Name (ARN) of the local gateway route table. - LocalGatewayRouteTableArn *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The ID of the virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The ID of the Amazon Web Services account that owns the local gateway route. - OwnerId *string - - // The state of the route. - State LocalGatewayRouteState - - // The ID of the subnet. - SubnetId *string - - // The route type. - Type LocalGatewayRouteType - - noSmithyDocumentSerde -} - -// Describes a local gateway route table. -type LocalGatewayRouteTable struct { - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Name (ARN) of the local gateway route table. - LocalGatewayRouteTableArn *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The mode of the local gateway route table. - Mode LocalGatewayRouteTableMode - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the local gateway route - // table. - OwnerId *string - - // The state of the local gateway route table. - State *string - - // Information about the state change. - StateReason *StateReason - - // The tags assigned to the local gateway route table. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an association between a local gateway route table and a virtual -// interface group. -type LocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Name (ARN) of the local gateway route table for the virtual - // interface group. - LocalGatewayRouteTableArn *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The ID of the association. - LocalGatewayRouteTableVirtualInterfaceGroupAssociationId *string - - // The ID of the virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The ID of the Amazon Web Services account that owns the local gateway virtual - // interface group association. - OwnerId *string - - // The state of the association. - State *string - - // The tags assigned to the association. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes an association between a local gateway route table and a VPC. -type LocalGatewayRouteTableVpcAssociation struct { - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Name (ARN) of the local gateway route table for the - // association. - LocalGatewayRouteTableArn *string - - // The ID of the local gateway route table. - LocalGatewayRouteTableId *string - - // The ID of the association. - LocalGatewayRouteTableVpcAssociationId *string - - // The ID of the Amazon Web Services account that owns the local gateway route - // table for the association. - OwnerId *string - - // The state of the association. - State *string - - // The tags assigned to the association. - Tags []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes a local gateway virtual interface. -type LocalGatewayVirtualInterface struct { - - // The current state of the local gateway virtual interface. - ConfigurationState LocalGatewayVirtualInterfaceConfigurationState - - // The local address. - LocalAddress *string - - // The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local - // gateway. - LocalBgpAsn *int32 - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Number (ARN) of the local gateway virtual interface. - LocalGatewayVirtualInterfaceArn *string - - // The ID of the local gateway virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The ID of the virtual interface. - LocalGatewayVirtualInterfaceId *string - - // The Outpost LAG ID. - OutpostLagId *string - - // The ID of the Amazon Web Services account that owns the local gateway virtual - // interface. - OwnerId *string - - // The peer address. - PeerAddress *string - - // The peer BGP ASN. - PeerBgpAsn *int32 - - // The extended 32-bit ASN of the BGP peer for use with larger ASN values. - PeerBgpAsnExtended *int64 - - // The tags assigned to the virtual interface. - Tags []Tag - - // The ID of the VLAN. - Vlan *int32 - - noSmithyDocumentSerde -} - -// Describes a local gateway virtual interface group. -type LocalGatewayVirtualInterfaceGroup struct { - - // The current state of the local gateway virtual interface group. - ConfigurationState LocalGatewayVirtualInterfaceGroupConfigurationState - - // The Autonomous System Number(ASN) for the local Border Gateway Protocol (BGP). - LocalBgpAsn *int32 - - // The extended 32-bit ASN for the local BGP configuration. - LocalBgpAsnExtended *int64 - - // The ID of the local gateway. - LocalGatewayId *string - - // The Amazon Resource Number (ARN) of the local gateway virtual interface group. - LocalGatewayVirtualInterfaceGroupArn *string - - // The ID of the virtual interface group. - LocalGatewayVirtualInterfaceGroupId *string - - // The IDs of the virtual interfaces. - LocalGatewayVirtualInterfaceIds []string - - // The ID of the Amazon Web Services account that owns the local gateway virtual - // interface group. - OwnerId *string - - // The tags assigned to the virtual interface group. - Tags []Tag - - noSmithyDocumentSerde -} - -// Information about a locked snapshot. -type LockedSnapshotsInfo struct { - - // The compliance mode cooling-off period, in hours. - CoolOffPeriod *int32 - - // The date and time at which the compliance mode cooling-off period expires, in - // the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ ). - CoolOffPeriodExpiresOn *time.Time - - // The date and time at which the snapshot was locked, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - LockCreatedOn *time.Time - - // The period of time for which the snapshot is locked, in days. - LockDuration *int32 - - // The date and time at which the lock duration started, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - // - // If you lock a snapshot that is in the pending state, the lock duration starts - // only once the snapshot enters the completed state. - LockDurationStartTime *time.Time - - // The date and time at which the lock will expire, in the UTC time zone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - LockExpiresOn *time.Time - - // The state of the snapshot lock. Valid states include: - // - // - compliance-cooloff - The snapshot has been locked in compliance mode but it - // is still within the cooling-off period. The snapshot can't be deleted, but it - // can be unlocked and the lock settings can be modified by users with appropriate - // permissions. - // - // - governance - The snapshot is locked in governance mode. The snapshot can't - // be deleted, but it can be unlocked and the lock settings can be modified by - // users with appropriate permissions. - // - // - compliance - The snapshot is locked in compliance mode and the cooling-off - // period has expired. The snapshot can't be unlocked or deleted. The lock duration - // can only be increased by users with appropriate permissions. - // - // - expired - The snapshot was locked in compliance or governance mode but the - // lock duration has expired. The snapshot is not locked and can be deleted. - LockState LockState - - // The account ID of the Amazon Web Services account that owns the snapshot. - OwnerId *string - - // The ID of the snapshot. - SnapshotId *string - - noSmithyDocumentSerde -} - -// Information about the EC2 Mac Dedicated Host. -type MacHost struct { - - // The EC2 Mac Dedicated Host ID. - HostId *string - - // The latest macOS versions that the EC2 Mac Dedicated Host can launch without - // being upgraded. - MacOSLatestSupportedVersions []string - - noSmithyDocumentSerde -} - -// Information about a System Integrity Protection (SIP) modification task or -// volume ownership delegation task for an Amazon EC2 Mac instance. -type MacModificationTask struct { - - // The ID of the Amazon EC2 Mac instance. - InstanceId *string - - // The ID of task. - MacModificationTaskId *string - - // [SIP modification tasks only] Information about the SIP configuration. - MacSystemIntegrityProtectionConfig *MacSystemIntegrityProtectionConfiguration - - // The date and time the task was created, in the UTC timezone ( - // YYYY-MM-DDThh:mm:ss.sssZ ). - StartTime *time.Time - - // The tags assigned to the task. - Tags []Tag - - // The state of the task. - TaskState MacModificationTaskState - - // The type of task. - TaskType MacModificationTaskType - - noSmithyDocumentSerde -} - -// Describes the configuration for a System Integrity Protection (SIP) -// modification task. -type MacSystemIntegrityProtectionConfiguration struct { - - // Indicates whether Apple Internal was enabled or disabled by the task. - AppleInternal MacSystemIntegrityProtectionSettingStatus - - // Indicates whether Base System was enabled or disabled by the task. - BaseSystem MacSystemIntegrityProtectionSettingStatus - - // Indicates whether Dtrace Restrictions was enabled or disabled by the task. - DTraceRestrictions MacSystemIntegrityProtectionSettingStatus - - // Indicates whether Debugging Restrictions was enabled or disabled by the task. - DebuggingRestrictions MacSystemIntegrityProtectionSettingStatus - - // Indicates whether Filesystem Protections was enabled or disabled by the task. - FilesystemProtections MacSystemIntegrityProtectionSettingStatus - - // Indicates whether Kext Signing was enabled or disabled by the task. - KextSigning MacSystemIntegrityProtectionSettingStatus - - // Indicates whether NVRAM Protections was enabled or disabled by the task. - NvramProtections MacSystemIntegrityProtectionSettingStatus - - // Indicates SIP was enabled or disabled by the task. - Status MacSystemIntegrityProtectionSettingStatus - - noSmithyDocumentSerde -} - -// Describes a custom configuration for a System Integrity Protection (SIP) -// modification task. -type MacSystemIntegrityProtectionConfigurationRequest struct { - - // Enables or disables Apple Internal. - AppleInternal MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Base System. - BaseSystem MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Dtrace Restrictions. - DTraceRestrictions MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Debugging Restrictions. - DebuggingRestrictions MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Filesystem Protections. - FilesystemProtections MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Kext Signing. - KextSigning MacSystemIntegrityProtectionSettingStatus - - // Enables or disables Nvram Protections. - NvramProtections MacSystemIntegrityProtectionSettingStatus - - noSmithyDocumentSerde -} - -// Details for Site-to-Site VPN tunnel endpoint maintenance events. -type MaintenanceDetails struct { - - // Timestamp of last applied maintenance. - LastMaintenanceApplied *time.Time - - // The timestamp after which Amazon Web Services will automatically apply - // maintenance. - MaintenanceAutoAppliedAfter *time.Time - - // Verify existence of a pending maintenance. - PendingMaintenance *string - - noSmithyDocumentSerde -} - -// Describes a managed prefix list. -type ManagedPrefixList struct { - - // The IP address version. - AddressFamily *string - - // The maximum number of entries for the prefix list. - MaxEntries *int32 - - // The ID of the owner of the prefix list. - OwnerId *string - - // The Amazon Resource Name (ARN) for the prefix list. - PrefixListArn *string - - // The ID of the prefix list. - PrefixListId *string - - // The name of the prefix list. - PrefixListName *string - - // The current state of the prefix list. - State PrefixListState - - // The state message. - StateMessage *string - - // The tags for the prefix list. - Tags []Tag - - // The version of the prefix list. - Version *int64 - - noSmithyDocumentSerde -} - -// Describes the media accelerators for the instance type. -type MediaAcceleratorInfo struct { - - // Describes the media accelerators for the instance type. - Accelerators []MediaDeviceInfo - - // The total size of the memory for the media accelerators for the instance type, - // in MiB. - TotalMediaMemoryInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes the media accelerators for the instance type. -type MediaDeviceInfo struct { - - // The number of media accelerators for the instance type. - Count *int32 - - // The manufacturer of the media accelerator. - Manufacturer *string - - // Describes the memory available to the media accelerator. - MemoryInfo *MediaDeviceMemoryInfo - - // The name of the media accelerator. - Name *string - - noSmithyDocumentSerde -} - -// Describes the memory available to the media accelerator. -type MediaDeviceMemoryInfo struct { - - // The size of the memory available to each media accelerator, in MiB. - SizeInMiB *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of memory per vCPU, in GiB. -type MemoryGiBPerVCpu struct { - - // The maximum amount of memory per vCPU, in GiB. If this parameter is not - // specified, there is no maximum limit. - Max *float64 - - // The minimum amount of memory per vCPU, in GiB. If this parameter is not - // specified, there is no minimum limit. - Min *float64 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of memory per vCPU, in GiB. -type MemoryGiBPerVCpuRequest struct { - - // The maximum amount of memory per vCPU, in GiB. To specify no maximum limit, - // omit this parameter. - Max *float64 - - // The minimum amount of memory per vCPU, in GiB. To specify no minimum limit, - // omit this parameter. - Min *float64 - - noSmithyDocumentSerde -} - -// Describes the memory for the instance type. -type MemoryInfo struct { - - // The size of the memory, in MiB. - SizeInMiB *int64 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of memory, in MiB. -type MemoryMiB struct { - - // The maximum amount of memory, in MiB. If this parameter is not specified, there - // is no maximum limit. - Max *int32 - - // The minimum amount of memory, in MiB. If this parameter is not specified, there - // is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of memory, in MiB. -type MemoryMiBRequest struct { - - // The minimum amount of memory, in MiB. To specify no minimum limit, specify 0 . - // - // This member is required. - Min *int32 - - // The maximum amount of memory, in MiB. To specify no maximum limit, omit this - // parameter. - Max *int32 - - noSmithyDocumentSerde -} - -// Indicates whether the network was healthy or degraded at a particular point. -// The value is aggregated from the startDate to the endDate . Currently only -// five_minutes is supported. -type MetricPoint struct { - - // The end date for the metric point. The ending time must be formatted as - // yyyy-mm-ddThh:mm:ss . For example, 2022-06-12T12:00:00.000Z . - EndDate *time.Time - - // The start date for the metric point. The starting date for the metric point. - // The starting time must be formatted as yyyy-mm-ddThh:mm:ss . For example, - // 2022-06-10T12:00:00.000Z . - StartDate *time.Time - - // The status of the metric point. - Status *string - - Value *float32 - - noSmithyDocumentSerde -} - -// The transit gateway options. -type ModifyTransitGatewayOptions struct { - - // Adds IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 CIDR - // block or larger for IPv4, or a size /64 CIDR block or larger for IPv6. - AddTransitGatewayCidrBlocks []string - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for - // 32-bit ASNs. - // - // The modify ASN operation is not allowed on a transit gateway if it has the - // following attachments: - // - // - Dynamic VPN - // - // - Static VPN - // - // - Direct Connect Gateway - // - // - Connect - // - // You must first delete all transit gateway attachments configured prior to - // modifying the ASN on the transit gateway. - AmazonSideAsn *int64 - - // The ID of the default association route table. - AssociationDefaultRouteTableId *string - - // Enable or disable automatic acceptance of attachment requests. - AutoAcceptSharedAttachments AutoAcceptSharedAttachmentsValue - - // Enable or disable automatic association with the default association route - // table. - DefaultRouteTableAssociation DefaultRouteTableAssociationValue - - // Enable or disable automatic propagation of routes to the default propagation - // route table. - DefaultRouteTablePropagation DefaultRouteTablePropagationValue - - // Enable or disable DNS support. - DnsSupport DnsSupportValue - - // The ID of the default propagation route table. - PropagationDefaultRouteTableId *string - - // Removes CIDR blocks for the transit gateway. - RemoveTransitGatewayCidrBlocks []string - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is disabled by default. - // - // For more information about security group referencing, see [Security group referencing] in the Amazon Web - // Services Transit Gateways Guide. - // - // [Security group referencing]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - // Enable or disable Equal Cost Multipath Protocol support. - VpnEcmpSupport VpnEcmpSupportValue - - noSmithyDocumentSerde -} - -// Describes the options for a VPC attachment. -type ModifyTransitGatewayVpcAttachmentRequestOptions struct { - - // Enable or disable support for appliance mode. If enabled, a traffic flow - // between a source and destination uses the same Availability Zone for the VPC - // attachment for the lifetime of that flow. The default is disable . - ApplianceModeSupport ApplianceModeSupportValue - - // Enable or disable DNS support. The default is enable . - DnsSupport DnsSupportValue - - // Enable or disable IPv6 support. The default is enable . - Ipv6Support Ipv6SupportValue - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is disabled by default. - // - // For more information about security group referencing, see [Security group referencing] in the Amazon Web - // Services Transit Gateways Guide. - // - // [Security group referencing]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - noSmithyDocumentSerde -} - -// The CIDR options for a Verified Access endpoint. -type ModifyVerifiedAccessEndpointCidrOptions struct { - - // The port ranges. - PortRanges []ModifyVerifiedAccessEndpointPortRange - - noSmithyDocumentSerde -} - -// Describes the options when modifying a Verified Access endpoint with the -// network-interface type. -type ModifyVerifiedAccessEndpointEniOptions struct { - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []ModifyVerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - noSmithyDocumentSerde -} - -// Describes a load balancer when creating an Amazon Web Services Verified Access -// endpoint using the load-balancer type. -type ModifyVerifiedAccessEndpointLoadBalancerOptions struct { - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []ModifyVerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the port range for a Verified Access endpoint. -type ModifyVerifiedAccessEndpointPortRange struct { - - // The start of the port range. - FromPort *int32 - - // The end of the port range. - ToPort *int32 - - noSmithyDocumentSerde -} - -// The RDS options for a Verified Access endpoint. -type ModifyVerifiedAccessEndpointRdsOptions struct { - - // The port. - Port *int32 - - // The RDS endpoint. - RdsEndpoint *string - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the OpenID Connect (OIDC) options. -type ModifyVerifiedAccessNativeApplicationOidcOptions struct { - - // The authorization endpoint of the IdP. - AuthorizationEndpoint *string - - // The OAuth 2.0 client identifier. - ClientId *string - - // The OAuth 2.0 client secret. - ClientSecret *string - - // The OIDC issuer identifier of the IdP. - Issuer *string - - // The public signing key endpoint. - PublicSigningKeyEndpoint *string - - // The set of user claims to be requested from the IdP. - Scope *string - - // The token endpoint of the IdP. - TokenEndpoint *string - - // The user info endpoint of the IdP. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Modifies the configuration of the specified device-based Amazon Web Services -// Verified Access trust provider. -type ModifyVerifiedAccessTrustProviderDeviceOptions struct { - - // The URL Amazon Web Services Verified Access will use to verify the - // authenticity of the device tokens. - PublicSigningKeyUrl *string - - noSmithyDocumentSerde -} - -// Options for an OpenID Connect-compatible user-identity trust provider. -type ModifyVerifiedAccessTrustProviderOidcOptions struct { - - // The OIDC authorization endpoint. - AuthorizationEndpoint *string - - // The client identifier. - ClientId *string - - // The client secret. - ClientSecret *string - - // The OIDC issuer. - Issuer *string - - // OpenID Connect (OIDC) scopes are used by an application during authentication - // to authorize access to a user's details. Each scope returns a specific set of - // user attributes. - Scope *string - - // The OIDC token endpoint. - TokenEndpoint *string - - // The OIDC user info endpoint. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// The Amazon Web Services Site-to-Site VPN tunnel options to modify. -type ModifyVpnTunnelOptionsSpecification struct { - - // The action to take after DPD timeout occurs. Specify restart to restart the IKE - // initiation. Specify clear to end the IKE session. - // - // Valid Values: clear | none | restart - // - // Default: clear - DPDTimeoutAction *string - - // The number of seconds after which a DPD timeout occurs. A DPD timeout of 40 - // seconds means that the VPN endpoint will consider the peer dead 30 seconds after - // the first failed keep-alive. - // - // Constraints: A value greater than or equal to 30. - // - // Default: 40 - DPDTimeoutSeconds *int32 - - // Turn on or off tunnel endpoint lifecycle control feature. - EnableTunnelLifecycleControl *bool - - // The IKE versions that are permitted for the VPN tunnel. - // - // Valid values: ikev1 | ikev2 - IKEVersions []IKEVersionsRequestListValue - - // Options for logging VPN tunnel activity. - LogOptions *VpnTunnelLogOptionsSpecification - - // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel - // for phase 1 IKE negotiations. - // - // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 - Phase1DHGroupNumbers []Phase1DHGroupNumbersRequestListValue - - // One or more encryption algorithms that are permitted for the VPN tunnel for - // phase 1 IKE negotiations. - // - // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 - Phase1EncryptionAlgorithms []Phase1EncryptionAlgorithmsRequestListValue - - // One or more integrity algorithms that are permitted for the VPN tunnel for - // phase 1 IKE negotiations. - // - // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 - Phase1IntegrityAlgorithms []Phase1IntegrityAlgorithmsRequestListValue - - // The lifetime for phase 1 of the IKE negotiation, in seconds. - // - // Constraints: A value between 900 and 28,800. - // - // Default: 28800 - Phase1LifetimeSeconds *int32 - - // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel - // for phase 2 IKE negotiations. - // - // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 - Phase2DHGroupNumbers []Phase2DHGroupNumbersRequestListValue - - // One or more encryption algorithms that are permitted for the VPN tunnel for - // phase 2 IKE negotiations. - // - // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 - Phase2EncryptionAlgorithms []Phase2EncryptionAlgorithmsRequestListValue - - // One or more integrity algorithms that are permitted for the VPN tunnel for - // phase 2 IKE negotiations. - // - // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 - Phase2IntegrityAlgorithms []Phase2IntegrityAlgorithmsRequestListValue - - // The lifetime for phase 2 of the IKE negotiation, in seconds. - // - // Constraints: A value between 900 and 3,600. The value must be less than the - // value for Phase1LifetimeSeconds . - // - // Default: 3600 - Phase2LifetimeSeconds *int32 - - // The pre-shared key (PSK) to establish initial authentication between the - // virtual private gateway and the customer gateway. - // - // Constraints: Allowed characters are alphanumeric characters, periods (.), and - // underscores (_). Must be between 8 and 64 characters in length and cannot start - // with zero (0). - PreSharedKey *string - - // The percentage of the rekey window (determined by RekeyMarginTimeSeconds ) - // during which the rekey time is randomly selected. - // - // Constraints: A value between 0 and 100. - // - // Default: 100 - RekeyFuzzPercentage *int32 - - // The margin time, in seconds, before the phase 2 lifetime expires, during which - // the Amazon Web Services side of the VPN connection performs an IKE rekey. The - // exact time of the rekey is randomly selected based on the value for - // RekeyFuzzPercentage . - // - // Constraints: A value between 60 and half of Phase2LifetimeSeconds . - // - // Default: 270 - RekeyMarginTimeSeconds *int32 - - // The number of packets in an IKE replay window. - // - // Constraints: A value between 64 and 2048. - // - // Default: 1024 - ReplayWindowSize *int32 - - // The action to take when the establishing the tunnel for the VPN connection. By - // default, your customer gateway device must initiate the IKE negotiation and - // bring up the tunnel. Specify start for Amazon Web Services to initiate the IKE - // negotiation. - // - // Valid Values: add | start - // - // Default: add - StartupAction *string - - // The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks - // must be unique across all VPN connections that use the same virtual private - // gateway. - // - // Constraints: A size /30 CIDR block from the 169.254.0.0/16 range. The following - // CIDR blocks are reserved and cannot be used: - // - // - 169.254.0.0/30 - // - // - 169.254.1.0/30 - // - // - 169.254.2.0/30 - // - // - 169.254.3.0/30 - // - // - 169.254.4.0/30 - // - // - 169.254.5.0/30 - // - // - 169.254.169.252/30 - TunnelInsideCidr *string - - // The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks - // must be unique across all VPN connections that use the same transit gateway. - // - // Constraints: A size /126 CIDR block from the local fd00::/8 range. - TunnelInsideIpv6Cidr *string - - noSmithyDocumentSerde -} - -// Describes the monitoring of an instance. -type Monitoring struct { - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - State MonitoringState - - noSmithyDocumentSerde -} - -// This action is deprecated. -// -// Describes the status of a moving Elastic IP address. -type MovingAddressStatus struct { - - // The status of the Elastic IP address that's being moved or restored. - MoveStatus MoveStatus - - // The Elastic IP address. - PublicIp *string - - noSmithyDocumentSerde -} - -// Describes a NAT gateway. -type NatGateway struct { - - // Indicates whether the NAT gateway supports public or private connectivity. - ConnectivityType ConnectivityType - - // The date and time the NAT gateway was created. - CreateTime *time.Time - - // The date and time the NAT gateway was deleted, if applicable. - DeleteTime *time.Time - - // If the NAT gateway could not be created, specifies the error code for the - // failure. ( InsufficientFreeAddressesInSubnet | Gateway.NotAttached | - // InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | - // InvalidSubnetID.NotFound ) - FailureCode *string - - // If the NAT gateway could not be created, specifies the error message for the - // failure, that corresponds to the error code. - // - // - For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free - // addresses to create this NAT gateway" - // - // - For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway - // attached" - // - // - For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx - // could not be associated with this NAT gateway" - // - // - For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is - // already associated" - // - // - For InternalError: "Network interface eni-xxxxxxxx, created and used - // internally by this NAT gateway is in an invalid state. Please try again." - // - // - For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does - // not exist or could not be found." - FailureMessage *string - - // Information about the IP addresses and network interface associated with the - // NAT gateway. - NatGatewayAddresses []NatGatewayAddress - - // The ID of the NAT gateway. - NatGatewayId *string - - // Reserved. If you need to sustain traffic greater than the [documented limits], contact Amazon Web - // Services Support. - // - // [documented limits]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-gateways - ProvisionedBandwidth *ProvisionedBandwidth - - // The state of the NAT gateway. - // - // - pending : The NAT gateway is being created and is not ready to process - // traffic. - // - // - failed : The NAT gateway could not be created. Check the failureCode and - // failureMessage fields for the reason. - // - // - available : The NAT gateway is able to process traffic. This status remains - // until you delete the NAT gateway, and does not indicate the health of the NAT - // gateway. - // - // - deleting : The NAT gateway is in the process of being terminated and may - // still be processing traffic. - // - // - deleted : The NAT gateway has been terminated and is no longer processing - // traffic. - State NatGatewayState - - // The ID of the subnet in which the NAT gateway is located. - SubnetId *string - - // The tags for the NAT gateway. - Tags []Tag - - // The ID of the VPC in which the NAT gateway is located. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes the IP addresses and network interface associated with a NAT gateway. -type NatGatewayAddress struct { - - // [Public NAT gateway only] The allocation ID of the Elastic IP address that's - // associated with the NAT gateway. - AllocationId *string - - // [Public NAT gateway only] The association ID of the Elastic IP address that's - // associated with the NAT gateway. - AssociationId *string - - // The address failure message. - FailureMessage *string - - // Defines if the IP address is the primary address. - IsPrimary *bool - - // The ID of the network interface associated with the NAT gateway. - NetworkInterfaceId *string - - // The private IP address associated with the NAT gateway. - PrivateIp *string - - // [Public NAT gateway only] The Elastic IP address associated with the NAT - // gateway. - PublicIp *string - - // The address status. - Status NatGatewayAddressStatus - - noSmithyDocumentSerde -} - -// Describes the OpenID Connect (OIDC) options. -type NativeApplicationOidcOptions struct { - - // The authorization endpoint of the IdP. - AuthorizationEndpoint *string - - // The OAuth 2.0 client identifier. - ClientId *string - - // The OIDC issuer identifier of the IdP. - Issuer *string - - // The public signing key endpoint. - PublicSigningKeyEndpoint *string - - // The set of user claims to be requested from the IdP. - Scope *string - - // The token endpoint of the IdP. - TokenEndpoint *string - - // The user info endpoint of the IdP. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Describes a network ACL. -type NetworkAcl struct { - - // Any associations between the network ACL and your subnets - Associations []NetworkAclAssociation - - // The entries (rules) in the network ACL. - Entries []NetworkAclEntry - - // Indicates whether this is the default network ACL for the VPC. - IsDefault *bool - - // The ID of the network ACL. - NetworkAclId *string - - // The ID of the Amazon Web Services account that owns the network ACL. - OwnerId *string - - // Any tags assigned to the network ACL. - Tags []Tag - - // The ID of the VPC for the network ACL. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes an association between a network ACL and a subnet. -type NetworkAclAssociation struct { - - // The ID of the association between a network ACL and a subnet. - NetworkAclAssociationId *string - - // The ID of the network ACL. - NetworkAclId *string - - // The ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes an entry in a network ACL. -type NetworkAclEntry struct { - - // The IPv4 network range to allow or deny, in CIDR notation. - CidrBlock *string - - // Indicates whether the rule is an egress rule (applied to traffic leaving the - // subnet). - Egress *bool - - // ICMP protocol: The ICMP type and code. - IcmpTypeCode *IcmpTypeCode - - // The IPv6 network range to allow or deny, in CIDR notation. - Ipv6CidrBlock *string - - // TCP or UDP protocols: The range of ports the rule applies to. - PortRange *PortRange - - // The protocol number. A value of "-1" means all protocols. - Protocol *string - - // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction RuleAction - - // The rule number for the entry. ACL entries are processed in ascending order by - // rule number. - RuleNumber *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of network bandwidth, in gigabits per second -// (Gbps). -// -// Setting the minimum bandwidth does not guarantee that your instance will -// achieve the minimum bandwidth. Amazon EC2 will identify instance types that -// support the specified minimum bandwidth, but the actual bandwidth of your -// instance might go below the specified minimum at times. For more information, -// see [Available instance bandwidth]in the Amazon EC2 User Guide. -// -// [Available instance bandwidth]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth -type NetworkBandwidthGbps struct { - - // The maximum amount of network bandwidth, in Gbps. If this parameter is not - // specified, there is no maximum limit. - Max *float64 - - // The minimum amount of network bandwidth, in Gbps. If this parameter is not - // specified, there is no minimum limit. - Min *float64 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of network bandwidth, in gigabits per second -// (Gbps). -// -// Setting the minimum bandwidth does not guarantee that your instance will -// achieve the minimum bandwidth. Amazon EC2 will identify instance types that -// support the specified minimum bandwidth, but the actual bandwidth of your -// instance might go below the specified minimum at times. For more information, -// see [Available instance bandwidth]in the Amazon EC2 User Guide. -// -// [Available instance bandwidth]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth -type NetworkBandwidthGbpsRequest struct { - - // The maximum amount of network bandwidth, in Gbps. To specify no maximum limit, - // omit this parameter. - Max *float64 - - // The minimum amount of network bandwidth, in Gbps. To specify no minimum limit, - // omit this parameter. - Min *float64 - - noSmithyDocumentSerde -} - -// Describes the network card support of the instance type. -type NetworkCardInfo struct { - - // The baseline network performance of the network card, in Gbps. - BaselineBandwidthInGbps *float64 - - // The default number of the ENA queues for each interface. - DefaultEnaQueueCountPerInterface *int32 - - // The maximum number of the ENA queues. - MaximumEnaQueueCount *int32 - - // The maximum number of the ENA queues for each interface. - MaximumEnaQueueCountPerInterface *int32 - - // The maximum number of network interfaces for the network card. - MaximumNetworkInterfaces *int32 - - // The index of the network card. - NetworkCardIndex *int32 - - // The network performance of the network card. - NetworkPerformance *string - - // The peak (burst) network performance of the network card, in Gbps. - PeakBandwidthInGbps *float64 - - noSmithyDocumentSerde -} - -// Describes the networking features of the instance type. -type NetworkInfo struct { - - // A list of valid settings for configurable bandwidth weighting for the instance - // type, if supported. - BandwidthWeightings []BandwidthWeightingType - - // The index of the default network card, starting at 0. - DefaultNetworkCardIndex *int32 - - // Describes the Elastic Fabric Adapters for the instance type. - EfaInfo *EfaInfo - - // Indicates whether Elastic Fabric Adapter (EFA) is supported. - EfaSupported *bool - - // Indicates whether the instance type supports ENA Express. ENA Express uses - // Amazon Web Services Scalable Reliable Datagram (SRD) technology to increase the - // maximum bandwidth used per stream and minimize tail latency of network traffic - // between EC2 instances. - EnaSrdSupported *bool - - // Indicates whether Elastic Network Adapter (ENA) is supported. - EnaSupport EnaSupport - - // Indicates whether the instance type automatically encrypts in-transit traffic - // between instances. - EncryptionInTransitSupported *bool - - // Indicates whether changing the number of ENA queues is supported. - FlexibleEnaQueuesSupport FlexibleEnaQueuesSupport - - // The maximum number of IPv4 addresses per network interface. - Ipv4AddressesPerInterface *int32 - - // The maximum number of IPv6 addresses per network interface. - Ipv6AddressesPerInterface *int32 - - // Indicates whether IPv6 is supported. - Ipv6Supported *bool - - // The maximum number of physical network cards that can be allocated to the - // instance. - MaximumNetworkCards *int32 - - // The maximum number of network interfaces for the instance type. - MaximumNetworkInterfaces *int32 - - // Describes the network cards for the instance type. - NetworkCards []NetworkCardInfo - - // The network performance. - NetworkPerformance *string - - noSmithyDocumentSerde -} - -// Describes a Network Access Scope. -type NetworkInsightsAccessScope struct { - - // The creation date. - CreatedDate *time.Time - - // The Amazon Resource Name (ARN) of the Network Access Scope. - NetworkInsightsAccessScopeArn *string - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - // The tags. - Tags []Tag - - // The last updated date. - UpdatedDate *time.Time - - noSmithyDocumentSerde -} - -// Describes a Network Access Scope analysis. -type NetworkInsightsAccessScopeAnalysis struct { - - // The number of network interfaces analyzed. - AnalyzedEniCount *int32 - - // The analysis end date. - EndDate *time.Time - - // Indicates whether there are findings. - FindingsFound FindingsFound - - // The Amazon Resource Name (ARN) of the Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysisArn *string - - // The ID of the Network Access Scope analysis. - NetworkInsightsAccessScopeAnalysisId *string - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - // The analysis start date. - StartDate *time.Time - - // The status. - Status AnalysisStatus - - // The status message. - StatusMessage *string - - // The tags. - Tags []Tag - - // The warning message. - WarningMessage *string - - noSmithyDocumentSerde -} - -// Describes the Network Access Scope content. -type NetworkInsightsAccessScopeContent struct { - - // The paths to exclude. - ExcludePaths []AccessScopePath - - // The paths to match. - MatchPaths []AccessScopePath - - // The ID of the Network Access Scope. - NetworkInsightsAccessScopeId *string - - noSmithyDocumentSerde -} - -// Describes a network insights analysis. -type NetworkInsightsAnalysis struct { - - // The member accounts that contain resources that the path can traverse. - AdditionalAccounts []string - - // Potential intermediate components. - AlternatePathHints []AlternatePathHint - - // The explanations. For more information, see [Reachability Analyzer explanation codes]. - // - // [Reachability Analyzer explanation codes]: https://docs.aws.amazon.com/vpc/latest/reachability/explanation-codes.html - Explanations []Explanation - - // The Amazon Resource Names (ARN) of the resources that the path must traverse. - FilterInArns []string - - // The Amazon Resource Names (ARN) of the resources that the path must ignore. - FilterOutArns []string - - // The components in the path from source to destination. - ForwardPathComponents []PathComponent - - // The Amazon Resource Name (ARN) of the network insights analysis. - NetworkInsightsAnalysisArn *string - - // The ID of the network insights analysis. - NetworkInsightsAnalysisId *string - - // The ID of the path. - NetworkInsightsPathId *string - - // Indicates whether the destination is reachable from the source. - NetworkPathFound *bool - - // The components in the path from destination to source. - ReturnPathComponents []PathComponent - - // The time the analysis started. - StartDate *time.Time - - // The status of the network insights analysis. - Status AnalysisStatus - - // The status message, if the status is failed . - StatusMessage *string - - // Potential intermediate accounts. - SuggestedAccounts []string - - // The tags. - Tags []Tag - - // The warning message. - WarningMessage *string - - noSmithyDocumentSerde -} - -// Describes a path. -type NetworkInsightsPath struct { - - // The time stamp when the path was created. - CreatedDate *time.Time - - // The ID of the destination. - Destination *string - - // The Amazon Resource Name (ARN) of the destination. - DestinationArn *string - - // The IP address of the destination. - DestinationIp *string - - // The destination port. - DestinationPort *int32 - - // Scopes the analysis to network paths that match specific filters at the - // destination. - FilterAtDestination *PathFilter - - // Scopes the analysis to network paths that match specific filters at the source. - FilterAtSource *PathFilter - - // The Amazon Resource Name (ARN) of the path. - NetworkInsightsPathArn *string - - // The ID of the path. - NetworkInsightsPathId *string - - // The protocol. - Protocol Protocol - - // The ID of the source. - Source *string - - // The Amazon Resource Name (ARN) of the source. - SourceArn *string - - // The IP address of the source. - SourceIp *string - - // The tags associated with the path. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a network interface. -type NetworkInterface struct { - - // The subnets associated with this network interface. - AssociatedSubnets []string - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation - - // The network interface attachment. - Attachment *NetworkInterfaceAttachment - - // The Availability Zone. - AvailabilityZone *string - - // A security group connection tracking configuration that enables you to set the - // timeout for connection tracking on an Elastic network interface. For more - // information, see [Connection tracking timeouts]in the Amazon EC2 User Guide. - // - // [Connection tracking timeouts]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts - ConnectionTrackingConfiguration *ConnectionTrackingConfiguration - - // Indicates whether a network interface with an IPv6 address is unreachable from - // the public internet. If the value is true , inbound traffic from the internet is - // dropped and you cannot assign an elastic IP address to the network interface. - // The network interface is reachable from peered VPCs and resources connected - // through a transit gateway, including on-premises networks. - DenyAllIgwTraffic *bool - - // A description. - Description *string - - // Any security groups for the network interface. - Groups []GroupIdentifier - - // The type of network interface. - InterfaceType NetworkInterfaceType - - // The IPv4 prefixes that are assigned to the network interface. - Ipv4Prefixes []Ipv4PrefixSpecification - - // The IPv6 globally unique address associated with the network interface. - Ipv6Address *string - - // The IPv6 addresses associated with the network interface. - Ipv6Addresses []NetworkInterfaceIpv6Address - - // Indicates whether this is an IPv6 only network interface. - Ipv6Native *bool - - // The IPv6 prefixes that are assigned to the network interface. - Ipv6Prefixes []Ipv6PrefixSpecification - - // The MAC address. - MacAddress *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The service provider that manages the network interface. - Operator *OperatorResponse - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The Amazon Web Services account ID of the owner of the network interface. - OwnerId *string - - // The private hostname. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User Guide. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - PrivateDnsName *string - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string - - // The private IPv4 addresses associated with the network interface. - PrivateIpAddresses []NetworkInterfacePrivateIpAddress - - // A public hostname. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User Guide. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - PublicDnsName *string - - // Public hostname type options. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User - // Guide. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - PublicIpDnsNameOptions *PublicIpDnsNameOptions - - // The alias or Amazon Web Services account ID of the principal or service that - // created the network interface. - RequesterId *string - - // Indicates whether the network interface is being managed by Amazon Web Services. - RequesterManaged *bool - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *bool - - // The status of the network interface. - Status NetworkInterfaceStatus - - // The ID of the subnet. - SubnetId *string - - // Any tags assigned to the network interface. - TagSet []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes association information for an Elastic IP address (IPv4 only), or a -// Carrier IP address (for a network interface which resides in a subnet in a -// Wavelength Zone). -type NetworkInterfaceAssociation struct { - - // The allocation ID. - AllocationId *string - - // The association ID. - AssociationId *string - - // The carrier IP address associated with the network interface. - // - // This option is only available when the network interface is in a subnet which - // is associated with a Wavelength Zone. - CarrierIp *string - - // The customer-owned IP address associated with the network interface. - CustomerOwnedIp *string - - // The ID of the Elastic IP address owner. - IpOwnerId *string - - // The public DNS name. - PublicDnsName *string - - // The address of the Elastic IP address bound to the network interface. - PublicIp *string - - noSmithyDocumentSerde -} - -// Describes a network interface attachment. -type NetworkInterfaceAttachment struct { - - // The timestamp indicating when the attachment initiated. - AttachTime *time.Time - - // The ID of the network interface attachment. - AttachmentId *string - - // Indicates whether the network interface is deleted when the instance is - // terminated. - DeleteOnTermination *bool - - // The device index of the network interface attachment on the instance. - DeviceIndex *int32 - - // The number of ENA queues created with the instance. - EnaQueueCount *int32 - - // Configures ENA Express for the network interface that this action attaches to - // the instance. - EnaSrdSpecification *AttachmentEnaSrdSpecification - - // The ID of the instance. - InstanceId *string - - // The Amazon Web Services account ID of the owner of the instance. - InstanceOwnerId *string - - // The index of the network card. - NetworkCardIndex *int32 - - // The attachment state. - Status AttachmentStatus - - noSmithyDocumentSerde -} - -// Describes an attachment change. -type NetworkInterfaceAttachmentChanges struct { - - // The ID of the network interface attachment. - AttachmentId *string - - // The default number of the ENA queues. - DefaultEnaQueueCount *bool - - // Indicates whether the network interface is deleted when the instance is - // terminated. - DeleteOnTermination *bool - - // The number of ENA queues to be created with the instance. - EnaQueueCount *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum number of network interfaces. -type NetworkInterfaceCount struct { - - // The maximum number of network interfaces. If this parameter is not specified, - // there is no maximum limit. - Max *int32 - - // The minimum number of network interfaces. If this parameter is not specified, - // there is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum number of network interfaces. -type NetworkInterfaceCountRequest struct { - - // The maximum number of network interfaces. To specify no maximum limit, omit - // this parameter. - Max *int32 - - // The minimum number of network interfaces. To specify no minimum limit, omit - // this parameter. - Min *int32 - - noSmithyDocumentSerde -} - -// Describes an IPv6 address associated with a network interface. -type NetworkInterfaceIpv6Address struct { - - // The IPv6 address. - Ipv6Address *string - - // Determines if an IPv6 address associated with a network interface is the - // primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, - // the first IPv6 GUA will be made the primary IPv6 address until the instance is - // terminated or the network interface is detached. For more information, see [ModifyNetworkInterfaceAttribute]. - // - // [ModifyNetworkInterfaceAttribute]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyNetworkInterfaceAttribute.html - IsPrimaryIpv6 *bool - - // An IPv6-enabled public hostname for a network interface. Requests from within - // the VPC or from the internet resolve to the IPv6 GUA of the network interface. - // For more information, see [EC2 instance hostnames, DNS names, and domains]in the Amazon EC2 User Guide. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - PublicIpv6DnsName *string - - noSmithyDocumentSerde -} - -// Describes a permission for a network interface. -type NetworkInterfacePermission struct { - - // The Amazon Web Services account ID. - AwsAccountId *string - - // The Amazon Web Services service. - AwsService *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The ID of the network interface permission. - NetworkInterfacePermissionId *string - - // The type of permission. - Permission InterfacePermissionType - - // Information about the state of the permission. - PermissionState *NetworkInterfacePermissionState - - noSmithyDocumentSerde -} - -// Describes the state of a network interface permission. -type NetworkInterfacePermissionState struct { - - // The state of the permission. - State NetworkInterfacePermissionStateCode - - // A status message, if applicable. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Describes the private IPv4 address of a network interface. -type NetworkInterfacePrivateIpAddress struct { - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation - - // Indicates whether this IPv4 address is the primary private IPv4 address of the - // network interface. - Primary *bool - - // The private DNS name. - PrivateDnsName *string - - // The private IPv4 address. - PrivateIpAddress *string - - noSmithyDocumentSerde -} - -// Describes the cores available to the neuron accelerator. -type NeuronDeviceCoreInfo struct { - - // The number of cores available to the neuron accelerator. - Count *int32 - - // The version of the neuron accelerator. - Version *int32 - - noSmithyDocumentSerde -} - -// Describes the neuron accelerators for the instance type. -type NeuronDeviceInfo struct { - - // Describes the cores available to each neuron accelerator. - CoreInfo *NeuronDeviceCoreInfo - - // The number of neuron accelerators for the instance type. - Count *int32 - - // Describes the memory available to each neuron accelerator. - MemoryInfo *NeuronDeviceMemoryInfo - - // The name of the neuron accelerator. - Name *string - - noSmithyDocumentSerde -} - -// Describes the memory available to the neuron accelerator. -type NeuronDeviceMemoryInfo struct { - - // The size of the memory available to the neuron accelerator, in MiB. - SizeInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes the neuron accelerators for the instance type. -type NeuronInfo struct { - - // Describes the neuron accelerators for the instance type. - NeuronDevices []NeuronDeviceInfo - - // The total size of the memory for the neuron accelerators for the instance type, - // in MiB. - TotalNeuronDeviceMemoryInMiB *int32 - - noSmithyDocumentSerde -} - -// Describes a DHCP configuration option. -type NewDhcpConfiguration struct { - - // The name of a DHCP option. - Key *string - - // The values for the DHCP option. - Values []string - - noSmithyDocumentSerde -} - -// Describes the supported NitroTPM versions for the instance type. -type NitroTpmInfo struct { - - // Indicates the supported NitroTPM versions. - SupportedVersions []string - - noSmithyDocumentSerde -} - -// Describes the options for an OpenID Connect-compatible user-identity trust -// provider. -type OidcOptions struct { - - // The OIDC authorization endpoint. - AuthorizationEndpoint *string - - // The client identifier. - ClientId *string - - // The client secret. - ClientSecret *string - - // The OIDC issuer. - Issuer *string - - // The OpenID Connect (OIDC) scope specified. - Scope *string - - // The OIDC token endpoint. - TokenEndpoint *string - - // The OIDC user info endpoint. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Describes the configuration of On-Demand Instances in an EC2 Fleet. -type OnDemandOptions struct { - - // The strategy that determines the order of the launch template overrides to use - // in fulfilling On-Demand capacity. - // - // lowest-price - EC2 Fleet uses price to determine the order, launching the - // lowest price first. - // - // prioritized - EC2 Fleet uses the priority that you assigned to each launch - // template override, launching the highest priority first. - // - // Default: lowest-price - AllocationStrategy FleetOnDemandAllocationStrategy - - // The strategy for using unused Capacity Reservations for fulfilling On-Demand - // capacity. - // - // Supported only for fleets of type instant . - CapacityReservationOptions *CapacityReservationOptions - - // The maximum amount per hour for On-Demand Instances that you're willing to pay. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The maxTotalPrice does not account for surplus - // credits, and, if you use surplus credits, your final cost might be higher than - // what you specified for maxTotalPrice . For more information, see [Surplus credits can incur charges] in the Amazon - // EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - MaxTotalPrice *string - - // The minimum target capacity for On-Demand Instances in the fleet. If this - // minimum capacity isn't reached, no instances are launched. - // - // Constraints: Maximum value of 1000 . Supported only for fleets of type instant . - // - // At least one of the following must be specified: SingleAvailabilityZone | - // SingleInstanceType - MinTargetCapacity *int32 - - // Indicates that the fleet launches all On-Demand Instances into a single - // Availability Zone. - // - // Supported only for fleets of type instant . - SingleAvailabilityZone *bool - - // Indicates that the fleet uses a single instance type to launch all On-Demand - // Instances in the fleet. - // - // Supported only for fleets of type instant . - SingleInstanceType *bool - - noSmithyDocumentSerde -} - -// Describes the configuration of On-Demand Instances in an EC2 Fleet. -type OnDemandOptionsRequest struct { - - // The strategy that determines the order of the launch template overrides to use - // in fulfilling On-Demand capacity. - // - // lowest-price - EC2 Fleet uses price to determine the order, launching the - // lowest price first. - // - // prioritized - EC2 Fleet uses the priority that you assigned to each launch - // template override, launching the highest priority first. - // - // Default: lowest-price - AllocationStrategy FleetOnDemandAllocationStrategy - - // The strategy for using unused Capacity Reservations for fulfilling On-Demand - // capacity. - // - // Supported only for fleets of type instant . - CapacityReservationOptions *CapacityReservationOptionsRequest - - // The maximum amount per hour for On-Demand Instances that you're willing to pay. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The MaxTotalPrice does not account for surplus - // credits, and, if you use surplus credits, your final cost might be higher than - // what you specified for MaxTotalPrice . For more information, see [Surplus credits can incur charges] in the Amazon - // EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - MaxTotalPrice *string - - // The minimum target capacity for On-Demand Instances in the fleet. If this - // minimum capacity isn't reached, no instances are launched. - // - // Constraints: Maximum value of 1000 . Supported only for fleets of type instant . - // - // At least one of the following must be specified: SingleAvailabilityZone | - // SingleInstanceType - MinTargetCapacity *int32 - - // Indicates that the fleet launches all On-Demand Instances into a single - // Availability Zone. - // - // Supported only for fleets of type instant . - SingleAvailabilityZone *bool - - // Indicates that the fleet uses a single instance type to launch all On-Demand - // Instances in the fleet. - // - // Supported only for fleets of type instant . - SingleInstanceType *bool - - noSmithyDocumentSerde -} - -// The service provider that manages the resource. -type OperatorRequest struct { - - // The service provider that manages the resource. - Principal *string - - noSmithyDocumentSerde -} - -// Describes whether the resource is managed by a service provider and, if so, -// describes the service provider that manages it. -type OperatorResponse struct { - - // If true , the resource is managed by a service provider. - Managed *bool - - // If managed is true , then the principal is returned. The principal is the - // service provider that manages the resource. - Principal *string - - noSmithyDocumentSerde -} - -// Describes an Outpost link aggregation group (LAG). -type OutpostLag struct { - - // The IDs of the local gateway virtual interfaces associated with the Outpost LAG. - LocalGatewayVirtualInterfaceIds []string - - // The Amazon Resource Number (ARN) of the Outpost LAG. - OutpostArn *string - - // The ID of the Outpost LAG. - OutpostLagId *string - - // The ID of the Outpost LAG owner. - OwnerId *string - - // The service link virtual interface IDs associated with the Outpost LAG. - ServiceLinkVirtualInterfaceIds []string - - // The current state of the Outpost LAG. - State *string - - // The tags associated with the Outpost LAG. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a packet header statement. -type PacketHeaderStatement struct { - - // The destination addresses. - DestinationAddresses []string - - // The destination ports. - DestinationPorts []string - - // The destination prefix lists. - DestinationPrefixLists []string - - // The protocols. - Protocols []Protocol - - // The source addresses. - SourceAddresses []string - - // The source ports. - SourcePorts []string - - // The source prefix lists. - SourcePrefixLists []string - - noSmithyDocumentSerde -} - -// Describes a packet header statement. -type PacketHeaderStatementRequest struct { - - // The destination addresses. - DestinationAddresses []string - - // The destination ports. - DestinationPorts []string - - // The destination prefix lists. - DestinationPrefixLists []string - - // The protocols. - Protocols []Protocol - - // The source addresses. - SourceAddresses []string - - // The source ports. - SourcePorts []string - - // The source prefix lists. - SourcePrefixLists []string - - noSmithyDocumentSerde -} - -// Describes a path component. -type PathComponent struct { - - // The network ACL rule. - AclRule *AnalysisAclRule - - // The additional details. - AdditionalDetails []AdditionalDetail - - // The resource to which the path component is attached. - AttachedTo *AnalysisComponent - - // The component. - Component *AnalysisComponent - - // The destination VPC. - DestinationVpc *AnalysisComponent - - // The load balancer listener. - ElasticLoadBalancerListener *AnalysisComponent - - // The explanation codes. - Explanations []Explanation - - // The Network Firewall stateful rule. - FirewallStatefulRule *FirewallStatefulRule - - // The Network Firewall stateless rule. - FirewallStatelessRule *FirewallStatelessRule - - // The inbound header. - InboundHeader *AnalysisPacketHeader - - // The outbound header. - OutboundHeader *AnalysisPacketHeader - - // The route table route. - RouteTableRoute *AnalysisRouteTableRoute - - // The security group rule. - SecurityGroupRule *AnalysisSecurityGroupRule - - // The sequence number. - SequenceNumber *int32 - - // The name of the VPC endpoint service. - ServiceName *string - - // The source VPC. - SourceVpc *AnalysisComponent - - // The subnet. - Subnet *AnalysisComponent - - // The transit gateway. - TransitGateway *AnalysisComponent - - // The route in a transit gateway route table. - TransitGatewayRouteTableRoute *TransitGatewayRouteTableRoute - - // The component VPC. - Vpc *AnalysisComponent - - noSmithyDocumentSerde -} - -// Describes a set of filters for a path analysis. Use path filters to scope the -// analysis when there can be multiple resulting paths. -type PathFilter struct { - - // The destination IPv4 address. - DestinationAddress *string - - // The destination port range. - DestinationPortRange *FilterPortRange - - // The source IPv4 address. - SourceAddress *string - - // The source port range. - SourcePortRange *FilterPortRange - - noSmithyDocumentSerde -} - -// Describes a set of filters for a path analysis. Use path filters to scope the -// analysis when there can be multiple resulting paths. -type PathRequestFilter struct { - - // The destination IPv4 address. - DestinationAddress *string - - // The destination port range. - DestinationPortRange *RequestFilterPortRange - - // The source IPv4 address. - SourceAddress *string - - // The source port range. - SourcePortRange *RequestFilterPortRange - - noSmithyDocumentSerde -} - -// Describes a path statement. -type PathStatement struct { - - // The packet header statement. - PacketHeaderStatement *PacketHeaderStatement - - // The resource statement. - ResourceStatement *ResourceStatement - - noSmithyDocumentSerde -} - -// Describes a path statement. -type PathStatementRequest struct { - - // The packet header statement. - PacketHeaderStatement *PacketHeaderStatementRequest - - // The resource statement. - ResourceStatement *ResourceStatementRequest - - noSmithyDocumentSerde -} - -// Describes the data that identifies an Amazon FPGA image (AFI) on the PCI bus. -type PciId struct { - - // The ID of the device. - DeviceId *string - - // The ID of the subsystem. - SubsystemId *string - - // The ID of the vendor for the subsystem. - SubsystemVendorId *string - - // The ID of the vendor. - VendorId *string - - noSmithyDocumentSerde -} - -// The status of the transit gateway peering attachment. -type PeeringAttachmentStatus struct { - - // The status code. - Code *string - - // The status message, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Describes the VPC peering connection options. -type PeeringConnectionOptions struct { - - // If true, the public DNS hostnames of instances in the specified VPC resolve to - // private IP addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalVpcToRemoteClassicLink *bool - - noSmithyDocumentSerde -} - -// The VPC peering connection options. -type PeeringConnectionOptionsRequest struct { - - // If true, enables a local VPC to resolve public DNS hostnames to private IP - // addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalVpcToRemoteClassicLink *bool - - noSmithyDocumentSerde -} - -// Information about the transit gateway in the peering attachment. -type PeeringTgwInfo struct { - - // The ID of the core network where the transit gateway peer is located. - CoreNetworkId *string - - // The ID of the Amazon Web Services account that owns the transit gateway. - OwnerId *string - - // The Region of the transit gateway. - Region *string - - // The ID of the transit gateway. - TransitGatewayId *string - - noSmithyDocumentSerde -} - -// Specify an instance family to use as the baseline reference for CPU -// performance. All instance types that match your specified attributes will be -// compared against the CPU performance of the referenced instance family, -// regardless of CPU manufacturer or architecture. -// -// Currently, only one instance family can be specified in the list. -type PerformanceFactorReference struct { - - // The instance family to use as a baseline reference. - // - // Ensure that you specify the correct value for the instance family. The instance - // family is everything before the period ( . ) in the instance type name. For - // example, in the instance type c6i.large , the instance family is c6i , not c6 . - // For more information, see [Amazon EC2 instance type naming conventions]in Amazon EC2 Instance Types. - // - // The following instance families are not supported for performance protection: - // - // - c1 - // - // - g3 | g3s - // - // - hpc7g - // - // - m1 | m2 - // - // - mac1 | mac2 | mac2-m1ultra | mac2-m2 | mac2-m2pro - // - // - p3dn | p4d | p5 - // - // - t1 - // - // - u-12tb1 | u-18tb1 | u-24tb1 | u-3tb1 | u-6tb1 | u-9tb1 | u7i-12tb | - // u7in-16tb | u7in-24tb | u7in-32tb - // - // If you enable performance protection by specifying a supported instance family, - // the returned instance types will exclude the above unsupported instance - // families. - // - // If you specify an unsupported instance family as a value for baseline - // performance, the API returns an empty response for [GetInstanceTypesFromInstanceRequirements]and an exception for [CreateFleet], [RequestSpotFleet], [ModifyFleet], - // and [ModifySpotFleetRequest]. - // - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements - // [ModifySpotFleetRequest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySpotFleetRequest - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - // [Amazon EC2 instance type naming conventions]: https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-type-names.html - // [RequestSpotFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet - // [ModifyFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyFleet - InstanceFamily *string - - noSmithyDocumentSerde -} - -// Specify an instance family to use as the baseline reference for CPU -// performance. All instance types that match your specified attributes will be -// compared against the CPU performance of the referenced instance family, -// regardless of CPU manufacturer or architecture. -// -// Currently, only one instance family can be specified in the list. -type PerformanceFactorReferenceRequest struct { - - // The instance family to use as a baseline reference. - // - // Ensure that you specify the correct value for the instance family. The instance - // family is everything before the period ( . ) in the instance type name. For - // example, in the instance type c6i.large , the instance family is c6i , not c6 . - // For more information, see [Amazon EC2 instance type naming conventions]in Amazon EC2 Instance Types. - // - // The following instance families are not supported for performance protection: - // - // - c1 - // - // - g3 | g3s - // - // - hpc7g - // - // - m1 | m2 - // - // - mac1 | mac2 | mac2-m1ultra | mac2-m2 | mac2-m2pro - // - // - p3dn | p4d | p5 - // - // - t1 - // - // - u-12tb1 | u-18tb1 | u-24tb1 | u-3tb1 | u-6tb1 | u-9tb1 | u7i-12tb | - // u7in-16tb | u7in-24tb | u7in-32tb - // - // If you enable performance protection by specifying a supported instance family, - // the returned instance types will exclude the above unsupported instance - // families. - // - // If you specify an unsupported instance family as a value for baseline - // performance, the API returns an empty response for [GetInstanceTypesFromInstanceRequirements]and an exception for [CreateFleet], [RequestSpotFleet], [ModifyFleet], - // and [ModifySpotFleetRequest]. - // - // [GetInstanceTypesFromInstanceRequirements]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements - // [ModifySpotFleetRequest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySpotFleetRequest - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - // [Amazon EC2 instance type naming conventions]: https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-type-names.html - // [RequestSpotFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet - // [ModifyFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyFleet - InstanceFamily *string - - noSmithyDocumentSerde -} - -// The Diffie-Hellmann group number for phase 1 IKE negotiations. -type Phase1DHGroupNumbersListValue struct { - - // The Diffie-Hellmann group number. - Value *int32 - - noSmithyDocumentSerde -} - -// Specifies a Diffie-Hellman group number for the VPN tunnel for phase 1 IKE -// negotiations. -type Phase1DHGroupNumbersRequestListValue struct { - - // The Diffie-Hellmann group number. - Value *int32 - - noSmithyDocumentSerde -} - -// The encryption algorithm for phase 1 IKE negotiations. -type Phase1EncryptionAlgorithmsListValue struct { - - // The value for the encryption algorithm. - Value *string - - noSmithyDocumentSerde -} - -// Specifies the encryption algorithm for the VPN tunnel for phase 1 IKE -// negotiations. -type Phase1EncryptionAlgorithmsRequestListValue struct { - - // The value for the encryption algorithm. - Value *string - - noSmithyDocumentSerde -} - -// The integrity algorithm for phase 1 IKE negotiations. -type Phase1IntegrityAlgorithmsListValue struct { - - // The value for the integrity algorithm. - Value *string - - noSmithyDocumentSerde -} - -// Specifies the integrity algorithm for the VPN tunnel for phase 1 IKE -// negotiations. -type Phase1IntegrityAlgorithmsRequestListValue struct { - - // The value for the integrity algorithm. - Value *string - - noSmithyDocumentSerde -} - -// The Diffie-Hellmann group number for phase 2 IKE negotiations. -type Phase2DHGroupNumbersListValue struct { - - // The Diffie-Hellmann group number. - Value *int32 - - noSmithyDocumentSerde -} - -// Specifies a Diffie-Hellman group number for the VPN tunnel for phase 2 IKE -// negotiations. -type Phase2DHGroupNumbersRequestListValue struct { - - // The Diffie-Hellmann group number. - Value *int32 - - noSmithyDocumentSerde -} - -// The encryption algorithm for phase 2 IKE negotiations. -type Phase2EncryptionAlgorithmsListValue struct { - - // The encryption algorithm. - Value *string - - noSmithyDocumentSerde -} - -// Specifies the encryption algorithm for the VPN tunnel for phase 2 IKE -// negotiations. -type Phase2EncryptionAlgorithmsRequestListValue struct { - - // The encryption algorithm. - Value *string - - noSmithyDocumentSerde -} - -// The integrity algorithm for phase 2 IKE negotiations. -type Phase2IntegrityAlgorithmsListValue struct { - - // The integrity algorithm. - Value *string - - noSmithyDocumentSerde -} - -// Specifies the integrity algorithm for the VPN tunnel for phase 2 IKE -// negotiations. -type Phase2IntegrityAlgorithmsRequestListValue struct { - - // The integrity algorithm. - Value *string - - noSmithyDocumentSerde -} - -// Describes the placement of an instance. -type Placement struct { - - // The affinity setting for the instance on the Dedicated Host. - // - // This parameter is not supported for [CreateFleet] or [ImportInstance]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - // [ImportInstance]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html - Affinity *string - - // The Availability Zone of the instance. - // - // If not specified, an Availability Zone will be automatically chosen for you - // based on the load balancing criteria for the Region. - // - // This parameter is not supported for [CreateFleet]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - AvailabilityZone *string - - // The ID of the placement group that the instance is in. If you specify GroupId , - // you can't specify GroupName . - GroupId *string - - // The name of the placement group that the instance is in. If you specify - // GroupName , you can't specify GroupId . - GroupName *string - - // The ID of the Dedicated Host on which the instance resides. - // - // This parameter is not supported for [CreateFleet] or [ImportInstance]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - // [ImportInstance]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html - HostId *string - - // The ARN of the host resource group in which to launch the instances. - // - // If you specify this parameter, either omit the Tenancy parameter or set it to - // host . - // - // This parameter is not supported for [CreateFleet]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - HostResourceGroupArn *string - - // The number of the partition that the instance is in. Valid only if the - // placement group strategy is set to partition . - // - // This parameter is not supported for [CreateFleet]. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - PartitionNumber *int32 - - // Reserved for future use. - SpreadDomain *string - - // The tenancy of the instance. An instance with a tenancy of dedicated runs on - // single-tenant hardware. - // - // This parameter is not supported for [CreateFleet]. The host tenancy is not supported for [ImportInstance] or - // for T3 instances that are configured for the unlimited CPU credit option. - // - // [CreateFleet]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet - // [ImportInstance]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html - Tenancy Tenancy - - noSmithyDocumentSerde -} - -// Describes a placement group. -type PlacementGroup struct { - - // The Amazon Resource Name (ARN) of the placement group. - GroupArn *string - - // The ID of the placement group. - GroupId *string - - // The name of the placement group. - GroupName *string - - // The number of partitions. Valid only if strategy is set to partition . - PartitionCount *int32 - - // The spread level for the placement group. Only Outpost placement groups can be - // spread across hosts. - SpreadLevel SpreadLevel - - // The state of the placement group. - State PlacementGroupState - - // The placement strategy. - Strategy PlacementStrategy - - // Any tags applied to the placement group. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the placement group support of the instance type. -type PlacementGroupInfo struct { - - // The supported placement group types. - SupportedStrategies []PlacementGroupStrategy - - noSmithyDocumentSerde -} - -// Describes the placement of an instance. -type PlacementResponse struct { - - // The name of the placement group that the instance is in. - GroupName *string - - noSmithyDocumentSerde -} - -// Describes a CIDR block for an address pool. -type PoolCidrBlock struct { - - // The CIDR block. - Cidr *string - - noSmithyDocumentSerde -} - -// Describes a range of ports. -type PortRange struct { - - // The first port in the range. - From *int32 - - // The last port in the range. - To *int32 - - noSmithyDocumentSerde -} - -// Describes prefixes for Amazon Web Services services. -type PrefixList struct { - - // The IP address range of the Amazon Web Services service. - Cidrs []string - - // The ID of the prefix. - PrefixListId *string - - // The name of the prefix. - PrefixListName *string - - noSmithyDocumentSerde -} - -// Describes the resource with which a prefix list is associated. -type PrefixListAssociation struct { - - // The ID of the resource. - ResourceId *string - - // The owner of the resource. - ResourceOwner *string - - noSmithyDocumentSerde -} - -// Describes a prefix list entry. -type PrefixListEntry struct { - - // The CIDR block. - Cidr *string - - // The description. - Description *string - - noSmithyDocumentSerde -} - -// Describes a prefix list ID. -type PrefixListId struct { - - // A description for the security group rule that references this prefix list ID. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, - // 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string - - // The ID of the prefix. - PrefixListId *string - - noSmithyDocumentSerde -} - -// Describes the price for a Reserved Instance. -type PriceSchedule struct { - - // The current price schedule, as determined by the term remaining for the - // Reserved Instance in the listing. - // - // A specific price schedule is always in effect, but only one price schedule can - // be active at any time. Take, for example, a Reserved Instance listing that has - // five months remaining in its term. When you specify price schedules for five - // months and two months, this means that schedule 1, covering the first three - // months of the remaining term, will be active during months 5, 4, and 3. Then - // schedule 2, covering the last two months of the term, will be active for months - // 2 and 1. - Active *bool - - // The currency for transacting the Reserved Instance resale. At this time, the - // only supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The fixed price for the term. - Price *float64 - - // The number of months remaining in the reservation. For example, 2 is the second - // to the last month before the capacity reservation expires. - Term *int64 - - noSmithyDocumentSerde -} - -// Describes the price for a Reserved Instance. -type PriceScheduleSpecification struct { - - // The currency for transacting the Reserved Instance resale. At this time, the - // only supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The fixed price for the term. - Price *float64 - - // The number of months remaining in the reservation. For example, 2 is the second - // to the last month before the capacity reservation expires. - Term *int64 - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance offering. -type PricingDetail struct { - - // The number of reservations available for the price. - Count *int32 - - // The price per instance. - Price *float64 - - noSmithyDocumentSerde -} - -// PrincipalIdFormat description -type PrincipalIdFormat struct { - - // PrincipalIdFormatARN description - Arn *string - - // PrincipalIdFormatStatuses description - Statuses []IdFormat - - noSmithyDocumentSerde -} - -// Information about the Private DNS name for interface endpoints. -type PrivateDnsDetails struct { - - // The private DNS name assigned to the VPC endpoint service. - PrivateDnsName *string - - noSmithyDocumentSerde -} - -// Information about the private DNS name for the service endpoint. -type PrivateDnsNameConfiguration struct { - - // The name of the record subdomain the service provider needs to create. The - // service provider adds the value text to the name . - Name *string - - // The verification state of the VPC endpoint service. - // - // >Consumers of the endpoint service can use the private name only when the state - // is verified . - State DnsNameState - - // The endpoint service verification type, for example TXT. - Type *string - - // The value the service provider adds to the private DNS name domain record - // before verification. - Value *string - - noSmithyDocumentSerde -} - -// Describes the options for instance hostnames. -type PrivateDnsNameOptionsOnLaunch struct { - - // Indicates whether to respond to DNS queries for instance hostname with DNS AAAA - // records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS - // name must be based on the instance IPv4 address. For IPv6 only subnets, an - // instance DNS name must be based on the instance ID. For dual-stack subnets, you - // can specify whether DNS names use the instance IPv4 address or the instance ID. - HostnameType HostnameType - - noSmithyDocumentSerde -} - -// Describes the options for instance hostnames. -type PrivateDnsNameOptionsRequest struct { - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS - // name must be based on the instance IPv4 address. For IPv6 only subnets, an - // instance DNS name must be based on the instance ID. For dual-stack subnets, you - // can specify whether DNS names use the instance IPv4 address or the instance ID. - HostnameType HostnameType - - noSmithyDocumentSerde -} - -// Describes the options for instance hostnames. -type PrivateDnsNameOptionsResponse struct { - - // Indicates whether to respond to DNS queries for instance hostnames with DNS - // AAAA records. - EnableResourceNameDnsAAAARecord *bool - - // Indicates whether to respond to DNS queries for instance hostnames with DNS A - // records. - EnableResourceNameDnsARecord *bool - - // The type of hostname to assign to an instance. - HostnameType HostnameType - - noSmithyDocumentSerde -} - -// Describes a secondary private IPv4 address for a network interface. -type PrivateIpAddressSpecification struct { - - // Indicates whether the private IPv4 address is the primary private IPv4 address. - // Only one IPv4 address can be designated as primary. - Primary *bool - - // The private IPv4 address. - PrivateIpAddress *string - - noSmithyDocumentSerde -} - -// Describes the processor used by the instance type. -type ProcessorInfo struct { - - // The manufacturer of the processor. - Manufacturer *string - - // The architectures supported by the instance type. - SupportedArchitectures []ArchitectureType - - // Indicates whether the instance type supports AMD SEV-SNP. If the request - // returns amd-sev-snp , AMD SEV-SNP is supported. Otherwise, it is not supported. - // For more information, see [AMD SEV-SNP]. - // - // [AMD SEV-SNP]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html - SupportedFeatures []SupportedAdditionalProcessorFeature - - // The speed of the processor, in GHz. - SustainedClockSpeedInGhz *float64 - - noSmithyDocumentSerde -} - -// Describes a product code. -type ProductCode struct { - - // The product code. - ProductCodeId *string - - // The type of product code. - ProductCodeType ProductCodeValues - - noSmithyDocumentSerde -} - -// Describes a virtual private gateway propagating route. -type PropagatingVgw struct { - - // The ID of the virtual private gateway. - GatewayId *string - - noSmithyDocumentSerde -} - -// Reserved. If you need to sustain traffic greater than the [documented limits], contact Amazon Web -// Services Support. -// -// [documented limits]: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-gateways -type ProvisionedBandwidth struct { - - // Reserved. - ProvisionTime *time.Time - - // Reserved. - Provisioned *string - - // Reserved. - RequestTime *time.Time - - // Reserved. - Requested *string - - // Reserved. - Status *string - - noSmithyDocumentSerde -} - -// The status of an updated pointer (PTR) record for an Elastic IP address. -type PtrUpdateStatus struct { - - // The reason for the PTR record update. - Reason *string - - // The status of the PTR record update. - Status *string - - // The value for the PTR record update. - Value *string - - noSmithyDocumentSerde -} - -// Public hostname type options. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User -// Guide. -// -// [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html -type PublicIpDnsNameOptions struct { - - // The public hostname type. For more information, see [EC2 instance hostnames, DNS names, and domains] in the Amazon EC2 User - // Guide. - // - // [EC2 instance hostnames, DNS names, and domains]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html - DnsHostnameType *string - - // A dual-stack public hostname for a network interface. Requests from within the - // VPC resolve to both the private IPv4 address and the IPv6 Global Unicast Address - // of the network interface. Requests from the internet resolve to both the public - // IPv4 and the IPv6 GUA address of the network interface. - PublicDualStackDnsName *string - - // An IPv4-enabled public hostname for a network interface. Requests from within - // the VPC resolve to the private primary IPv4 address of the network interface. - // Requests from the internet resolve to the public IPv4 address of the network - // interface. - PublicIpv4DnsName *string - - // An IPv6-enabled public hostname for a network interface. Requests from within - // the VPC or from the internet resolve to the IPv6 GUA of the network interface. - PublicIpv6DnsName *string - - noSmithyDocumentSerde -} - -// Describes an IPv4 address pool. -type PublicIpv4Pool struct { - - // A description of the address pool. - Description *string - - // The name of the location from which the address pool is advertised. A network - // border group is a unique set of Availability Zones or Local Zones from where - // Amazon Web Services advertises public IP addresses. - NetworkBorderGroup *string - - // The address ranges. - PoolAddressRanges []PublicIpv4PoolRange - - // The ID of the address pool. - PoolId *string - - // Any tags for the address pool. - Tags []Tag - - // The total number of addresses. - TotalAddressCount *int32 - - // The total number of available addresses. - TotalAvailableAddressCount *int32 - - noSmithyDocumentSerde -} - -// Describes an address range of an IPv4 address pool. -type PublicIpv4PoolRange struct { - - // The number of addresses in the range. - AddressCount *int32 - - // The number of available addresses in the range. - AvailableAddressCount *int32 - - // The first IP address in the range. - FirstAddress *string - - // The last IP address in the range. - LastAddress *string - - noSmithyDocumentSerde -} - -// Describes the result of the purchase. -type Purchase struct { - - // The currency in which the UpfrontPrice and HourlyPrice amounts are specified. - // At this time, the only supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The duration of the reservation's term in seconds. - Duration *int32 - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []string - - // The ID of the reservation. - HostReservationId *string - - // The hourly price of the reservation per hour. - HourlyPrice *string - - // The instance family on the Dedicated Host that the reservation can be - // associated with. - InstanceFamily *string - - // The payment option for the reservation. - PaymentOption PaymentOption - - // The upfront price of the reservation. - UpfrontPrice *string - - noSmithyDocumentSerde -} - -// Describes a request to purchase Scheduled Instances. -type PurchaseRequest struct { - - // The number of instances. - // - // This member is required. - InstanceCount *int32 - - // The purchase token. - // - // This member is required. - PurchaseToken *string - - noSmithyDocumentSerde -} - -// Describes a recurring charge. -type RecurringCharge struct { - - // The amount of the recurring charge. - Amount *float64 - - // The frequency of the recurring charge. - Frequency RecurringChargeFrequency - - noSmithyDocumentSerde -} - -// Describes the security group that is referenced in the security group rule. -type ReferencedSecurityGroup struct { - - // The ID of the security group. - GroupId *string - - // The status of a VPC peering connection, if applicable. - PeeringStatus *string - - // The Amazon Web Services account ID. - UserId *string - - // The ID of the VPC. - VpcId *string - - // The ID of the VPC peering connection (if applicable). - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// Describes a Region. -type Region struct { - - // The Region service endpoint. - Endpoint *string - - // The Region opt-in status. The possible values are opt-in-not-required , opted-in - // , and not-opted-in . - OptInStatus *string - - // The name of the Region. - RegionName *string - - noSmithyDocumentSerde -} - -// A summary report for the attribute for a Region. -type RegionalSummary struct { - - // The number of accounts in the Region with the same configuration value for the - // attribute that is most frequently observed. - NumberOfMatchedAccounts *int32 - - // The number of accounts in the Region with a configuration value different from - // the most frequently observed value for the attribute. - NumberOfUnmatchedAccounts *int32 - - // The Amazon Web Services Region. - RegionName *string - - noSmithyDocumentSerde -} - -// Information about the tag keys to register for the current Region. You can -// either specify individual tag keys or register all tag keys in the current -// Region. You must specify either IncludeAllTagsOfInstance or InstanceTagKeys in -// the request -type RegisterInstanceTagAttributeRequest struct { - - // Indicates whether to register all tag keys in the current Region. Specify true - // to register all tag keys. - IncludeAllTagsOfInstance *bool - - // The tag keys to register. - InstanceTagKeys []string - - noSmithyDocumentSerde -} - -// Remove an operating Region from an IPAM. Operating Regions are Amazon Web -// Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only -// discovers and monitors resources in the Amazon Web Services Regions you select -// as operating Regions. -// -// For more information about operating Regions, see [Create an IPAM] in the Amazon VPC IPAM User -// Guide -// -// [Create an IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html -type RemoveIpamOperatingRegion struct { - - // The name of the operating Region you want to remove. - RegionName *string - - noSmithyDocumentSerde -} - -// Remove an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is -// integrated with Amazon Web Services Organizations and you add an organizational -// unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that -// OU exclusion. There is a limit on the number of exclusions you can create. For -// more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. -// -// [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html -type RemoveIpamOrganizationalUnitExclusion struct { - - // An Amazon Web Services Organizations entity path. Build the path for the OU(s) - // using Amazon Web Services Organizations IDs separated by a / . Include all child - // OUs by ending the path with /* . - // - // - Example 1 - // - // - Path to a child OU: - // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/ - // - // - In this example, o-a1b2c3d4e5 is the organization ID, r-f6g7h8i9j0example is - // the root ID , ou-ghi0-awsccccc is an OU ID, and ou-jkl0-awsddddd is a child OU - // ID. - // - // - IPAM will not manage the IP addresses in accounts in the child OU. - // - // - Example 2 - // - // - Path where all child OUs will be part of the exclusion: - // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/* - // - // - In this example, IPAM will not manage the IP addresses in accounts in the - // OU ( ou-ghi0-awsccccc ) or in accounts in any OUs that are children of the OU. - // - // For more information on how to construct an entity path, see [Understand the Amazon Web Services Organizations entity path] in the Amazon Web - // Services Identity and Access Management User Guide. - // - // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path - OrganizationsEntityPath *string - - noSmithyDocumentSerde -} - -// An entry for a prefix list. -type RemovePrefixListEntry struct { - - // The CIDR block. - // - // This member is required. - Cidr *string - - noSmithyDocumentSerde -} - -// Information about a root volume replacement task. -type ReplaceRootVolumeTask struct { - - // The time the task completed. - CompleteTime *string - - // Indicates whether the original root volume is to be deleted after the root - // volume replacement task completes. - DeleteReplacedRootVolume *bool - - // The ID of the AMI used to create the replacement root volume. - ImageId *string - - // The ID of the instance for which the root volume replacement task was created. - InstanceId *string - - // The ID of the root volume replacement task. - ReplaceRootVolumeTaskId *string - - // The ID of the snapshot used to create the replacement root volume. - SnapshotId *string - - // The time the task was started. - StartTime *string - - // The tags assigned to the task. - Tags []Tag - - // The state of the task. The task can be in one of the following states: - // - // - pending - the replacement volume is being created. - // - // - in-progress - the original volume is being detached and the replacement - // volume is being attached. - // - // - succeeded - the replacement volume has been successfully attached to the - // instance and the instance is available. - // - // - failing - the replacement task is in the process of failing. - // - // - failed - the replacement task has failed but the original root volume is - // still attached. - // - // - failing-detached - the replacement task is in the process of failing. The - // instance might have no root volume attached. - // - // - failed-detached - the replacement task has failed and the instance has no - // root volume attached. - TaskState ReplaceRootVolumeTaskState - - noSmithyDocumentSerde -} - -// Describes a port range. -type RequestFilterPortRange struct { - - // The first port in the range. - FromPort *int32 - - // The last port in the range. - ToPort *int32 - - noSmithyDocumentSerde -} - -// A tag on an IPAM resource. -type RequestIpamResourceTag struct { - - // The key of a tag assigned to the resource. Use this filter to find all - // resources assigned a tag with a specific key, regardless of the tag value. - Key *string - - // The value for the tag. - Value *string - - noSmithyDocumentSerde -} - -// The information to include in the launch template. -// -// You must specify at least one parameter for the launch template data. -type RequestLaunchTemplateData struct { - - // The block device mapping. - BlockDeviceMappings []LaunchTemplateBlockDeviceMappingRequest - - // The Capacity Reservation targeting option. If you do not specify this - // parameter, the instance's Capacity Reservation preference defaults to open , - // which enables it to run in any open Capacity Reservation that has matching - // attributes (instance type, platform, Availability Zone). - CapacityReservationSpecification *LaunchTemplateCapacityReservationSpecificationRequest - - // The CPU options for the instance. For more information, see [CPU options for Amazon EC2 instances] in the Amazon EC2 - // User Guide. - // - // [CPU options for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html - CpuOptions *LaunchTemplateCpuOptionsRequest - - // The credit option for CPU usage of the instance. Valid only for T instances. - CreditSpecification *CreditSpecificationRequest - - // Indicates whether to enable the instance for stop protection. For more - // information, see [Enable stop protection for your EC2 instances]in the Amazon EC2 User Guide. - // - // [Enable stop protection for your EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html - DisableApiStop *bool - - // Indicates whether termination protection is enabled for the instance. The - // default is false , which means that you can terminate the instance using the - // Amazon EC2 console, command line tools, or API. You can enable termination - // protection when you launch an instance, while the instance is running, or while - // the instance is stopped. - DisableApiTermination *bool - - // Indicates whether the instance is optimized for Amazon EBS I/O. This - // optimization provides dedicated throughput to Amazon EBS and an optimized - // configuration stack to provide optimal Amazon EBS I/O performance. This - // optimization isn't available with all instance types. Additional usage charges - // apply when using an EBS-optimized instance. - EbsOptimized *bool - - // Deprecated. - // - // Amazon Elastic Graphics reached end of life on January 8, 2024. - ElasticGpuSpecifications []ElasticGpuSpecification - - // Amazon Elastic Inference is no longer available. - // - // An elastic inference accelerator to associate with the instance. Elastic - // inference accelerators are a resource you can attach to your Amazon EC2 - // instances to accelerate your Deep Learning (DL) inference workloads. - // - // You cannot specify accelerators from different generations in the same request. - ElasticInferenceAccelerators []LaunchTemplateElasticInferenceAccelerator - - // Indicates whether the instance is enabled for Amazon Web Services Nitro - // Enclaves. For more information, see [What is Nitro Enclaves?]in the Amazon Web Services Nitro Enclaves - // User Guide. - // - // You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same - // instance. - // - // [What is Nitro Enclaves?]: https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html - EnclaveOptions *LaunchTemplateEnclaveOptionsRequest - - // Indicates whether an instance is enabled for hibernation. This parameter is - // valid only if the instance meets the [hibernation prerequisites]. For more information, see [Hibernate your Amazon EC2 instance] in the Amazon - // EC2 User Guide. - // - // [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html - // [hibernation prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html - HibernationOptions *LaunchTemplateHibernationOptionsRequest - - // The name or Amazon Resource Name (ARN) of an IAM instance profile. - IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest - - // The ID of the AMI in the format ami-0ac394d6a3example . - // - // Alternatively, you can specify a Systems Manager parameter, using one of the - // following formats. The Systems Manager parameter will resolve to an AMI ID on - // launch. - // - // To reference a public parameter: - // - // - resolve:ssm:public-parameter - // - // To reference a parameter stored in the same account: - // - // - resolve:ssm:parameter-name - // - // - resolve:ssm:parameter-name:version-number - // - // - resolve:ssm:parameter-name:label - // - // To reference a parameter shared from another Amazon Web Services account: - // - // - resolve:ssm:parameter-ARN - // - // - resolve:ssm:parameter-ARN:version-number - // - // - resolve:ssm:parameter-ARN:label - // - // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. - // - // If the launch template will be used for an EC2 Fleet or Spot Fleet, note the - // following: - // - // - Only EC2 Fleets of type instant support specifying a Systems Manager - // parameter. - // - // - For EC2 Fleets of type maintain or request , or for Spot Fleets, you must - // specify the AMI ID. - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ImageId *string - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - // - // Default: stop - InstanceInitiatedShutdownBehavior ShutdownBehavior - - // The market (purchasing) option for the instances. - InstanceMarketOptions *LaunchTemplateInstanceMarketOptionsRequest - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with these attributes. - // - // You must specify VCpuCount and MemoryMiB . All other attributes are optional. - // Any unspecified optional attribute is set to its default. - // - // When you specify multiple attributes, you get instance types that satisfy all - // of the specified attributes. If you specify multiple values for an attribute, - // you get instance types that satisfy any of the specified values. - // - // To limit the list of instance types from which Amazon EC2 can identify matching - // instance types, you can use one of the following parameters, but not both in the - // same request: - // - // - AllowedInstanceTypes - The instance types to include in the list. All other - // instance types are ignored, even if they match your specified attributes. - // - // - ExcludedInstanceTypes - The instance types to exclude from the list, even if - // they match your specified attributes. - // - // If you specify InstanceRequirements , you can't specify InstanceType . - // - // Attribute-based instance type selection is only supported when using Auto - // Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to - // use the launch template in the [launch instance wizard], or with the [RunInstances] API or [AWS::EC2::Instance] Amazon Web Services - // CloudFormation resource, you can't specify InstanceRequirements . - // - // For more information, see [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet] and [Spot placement score] in the Amazon EC2 User Guide. - // - // [Specify attributes for instance type selection for EC2 Fleet or Spot Fleet]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html - // [AWS::EC2::Instance]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html - // [Spot placement score]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-score.html - // [launch instance wizard]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance-wizard.html - InstanceRequirements *InstanceRequirementsRequest - - // The instance type. For more information, see [Amazon EC2 instance types] in the Amazon EC2 User Guide. - // - // If you specify InstanceType , you can't specify InstanceRequirements . - // - // [Amazon EC2 instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html - InstanceType InstanceType - - // The ID of the kernel. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see [User provided kernels]in the Amazon Linux 2 User Guide. - // - // [User provided kernels]: https://docs.aws.amazon.com/linux/al2/ug/UserProvidedKernels.html - KernelId *string - - // The name of the key pair. You can create a key pair using [CreateKeyPair] or [ImportKeyPair]. - // - // If you do not specify a key pair, you can't connect to the instance unless you - // choose an AMI that is configured to allow users another way to log in. - // - // [ImportKeyPair]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html - // [CreateKeyPair]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html - KeyName *string - - // The license configurations. - LicenseSpecifications []LaunchTemplateLicenseConfigurationRequest - - // The maintenance options for the instance. - MaintenanceOptions *LaunchTemplateInstanceMaintenanceOptionsRequest - - // The metadata options for the instance. For more information, see [Configure the Instance Metadata Service options] in the Amazon - // EC2 User Guide. - // - // [Configure the Instance Metadata Service options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html - MetadataOptions *LaunchTemplateInstanceMetadataOptionsRequest - - // The monitoring for the instance. - Monitoring *LaunchTemplatesMonitoringRequest - - // The network interfaces for the instance. - NetworkInterfaces []LaunchTemplateInstanceNetworkInterfaceSpecificationRequest - - // Contains launch template settings to boost network performance for the type of - // workload that runs on your instance. - NetworkPerformanceOptions *LaunchTemplateNetworkPerformanceOptionsRequest - - // The entity that manages the launch template. - Operator *OperatorRequest - - // The placement for the instance. - Placement *LaunchTemplatePlacementRequest - - // The options for the instance hostname. The default values are inherited from - // the subnet. - PrivateDnsNameOptions *LaunchTemplatePrivateDnsNameOptionsRequest - - // The ID of the RAM disk. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see [User provided kernels]in the Amazon EC2 User Guide. - // - // [User provided kernels]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html - RamDiskId *string - - // The IDs of the security groups. - // - // If you specify a network interface, you must specify any security groups as - // part of the network interface instead of using this parameter. - SecurityGroupIds []string - - // The names of the security groups. For a nondefault VPC, you must use security - // group IDs instead. - // - // If you specify a network interface, you must specify any security groups as - // part of the network interface instead of using this parameter. - SecurityGroups []string - - // The tags to apply to the resources that are created during instance launch. - // These tags are not applied to the launch template. - TagSpecifications []LaunchTemplateTagSpecificationRequest - - // The user data to make available to the instance. You must provide - // base64-encoded text. User data is limited to 16 KB. For more information, see [Run commands when you launch an EC2 instance with user data input] - // in the Amazon EC2 User Guide. - // - // If you are creating the launch template for use with Batch, the user data must - // be provided in the [MIME multi-part archive format]. For more information, see [Amazon EC2 user data in launch templates] in the Batch User Guide. - // - // [Amazon EC2 user data in launch templates]: https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html#lt-user-data - // [Run commands when you launch an EC2 instance with user data input]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html - // [MIME multi-part archive format]: https://cloudinit.readthedocs.io/en/latest/topics/format.html#mime-multi-part-archive - UserData *string - - noSmithyDocumentSerde -} - -// Describes the launch specification for an instance. -type RequestSpotLaunchSpecification struct { - - // Deprecated. - AddressingType *string - - // The block device mapping entries. You can't specify both a snapshot ID and an - // encryption value. This is because only blank volumes can be encrypted on - // creation. If a snapshot is the basis for a volume, it is not blank and its - // encryption status is used for the volume encryption status. - BlockDeviceMappings []BlockDeviceMapping - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration stack - // to provide optimal EBS I/O performance. This optimization isn't available with - // all instance types. Additional usage charges apply when using an EBS Optimized - // instance. - // - // Default: false - EbsOptimized *bool - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification - - // The ID of the AMI. - ImageId *string - - // The instance type. Only one instance type can be specified. - InstanceType InstanceType - - // The ID of the kernel. - KernelId *string - - // The name of the key pair. - KeyName *string - - // Indicates whether basic or detailed monitoring is enabled for the instance. - // - // Default: Disabled - Monitoring *RunInstancesMonitoringEnabled - - // The network interfaces. If you specify a network interface, you must specify - // subnet IDs and security group IDs using the network interface. - NetworkInterfaces []InstanceNetworkInterfaceSpecification - - // The placement information for the instance. - Placement *SpotPlacement - - // The ID of the RAM disk. - RamdiskId *string - - // The IDs of the security groups. - SecurityGroupIds []string - - // Not supported. - SecurityGroups []string - - // The ID of the subnet in which to launch the instance. - SubnetId *string - - // The base64-encoded user data that instances use when starting up. User data is - // limited to 16 KB. - UserData *string - - noSmithyDocumentSerde -} - -// Describes a launch request for one or more instances, and includes owner, -// requester, and security group information that applies to all instances in the -// launch request. -type Reservation struct { - - // Not supported. - Groups []GroupIdentifier - - // The instances. - Instances []Instance - - // The ID of the Amazon Web Services account that owns the reservation. - OwnerId *string - - // The ID of the requester that launched the instances on your behalf (for - // example, Amazon Web Services Management Console or Auto Scaling). - RequesterId *string - - // The ID of the reservation. - ReservationId *string - - noSmithyDocumentSerde -} - -// Information about an instance type to use in a Capacity Reservation Fleet. -type ReservationFleetInstanceSpecification struct { - - // The Availability Zone in which the Capacity Reservation Fleet reserves the - // capacity. A Capacity Reservation Fleet can't span Availability Zones. All - // instance type specifications that you specify for the Fleet must use the same - // Availability Zone. - AvailabilityZone *string - - // The ID of the Availability Zone in which the Capacity Reservation Fleet - // reserves the capacity. A Capacity Reservation Fleet can't span Availability - // Zones. All instance type specifications that you specify for the Fleet must use - // the same Availability Zone. - AvailabilityZoneId *string - - // Indicates whether the Capacity Reservation Fleet supports EBS-optimized - // instances types. This optimization provides dedicated throughput to Amazon EBS - // and an optimized configuration stack to provide optimal I/O performance. This - // optimization isn't available with all instance types. Additional usage charges - // apply when using EBS-optimized instance types. - EbsOptimized *bool - - // The type of operating system for which the Capacity Reservation Fleet reserves - // capacity. - InstancePlatform CapacityReservationInstancePlatform - - // The instance type for which the Capacity Reservation Fleet reserves capacity. - InstanceType InstanceType - - // The priority to assign to the instance type. This value is used to determine - // which of the instance types specified for the Fleet should be prioritized for - // use. A lower value indicates a high priority. For more information, see [Instance type priority]in the - // Amazon EC2 User Guide. - // - // [Instance type priority]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#instance-priority - Priority *int32 - - // The number of capacity units provided by the specified instance type. This - // value, together with the total target capacity that you specify for the Fleet - // determine the number of instances for which the Fleet reserves capacity. Both - // values are based on units that make sense for your workload. For more - // information, see [Total target capacity]in the Amazon EC2 User Guide. - // - // [Total target capacity]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity - Weight *float64 - - noSmithyDocumentSerde -} - -// The cost associated with the Reserved Instance. -type ReservationValue struct { - - // The hourly rate of the reservation. - HourlyPrice *string - - // The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice - // * number of hours remaining). - RemainingTotalValue *string - - // The remaining upfront cost of the reservation. - RemainingUpfrontValue *string - - noSmithyDocumentSerde -} - -// Describes the limit price of a Reserved Instance offering. -type ReservedInstanceLimitPrice struct { - - // Used for Reserved Instance Marketplace offerings. Specifies the limit price on - // the total order (instanceCount * price). - Amount *float64 - - // The currency in which the limitPrice amount is specified. At this time, the - // only supported currency is USD . - CurrencyCode CurrencyCodeValues - - noSmithyDocumentSerde -} - -// The total value of the Convertible Reserved Instance. -type ReservedInstanceReservationValue struct { - - // The total value of the Convertible Reserved Instance that you are exchanging. - ReservationValue *ReservationValue - - // The ID of the Convertible Reserved Instance that you are exchanging. - ReservedInstanceId *string - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance. -type ReservedInstances struct { - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // The currency of the Reserved Instance. It's specified using ISO 4217 standard - // currency codes. At this time, the only supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The duration of the Reserved Instance, in seconds. - Duration *int64 - - // The time when the Reserved Instance expires. - End *time.Time - - // The purchase price of the Reserved Instance. - FixedPrice *float32 - - // The number of reservations purchased. - InstanceCount *int32 - - // The tenancy of the instance. - InstanceTenancy Tenancy - - // The instance type on which the Reserved Instance can be used. - InstanceType InstanceType - - // The offering class of the Reserved Instance. - OfferingClass OfferingClassType - - // The Reserved Instance offering type. - OfferingType OfferingTypeValues - - // The Reserved Instance product platform description. - ProductDescription RIProductDescription - - // The recurring charge tag assigned to the resource. - RecurringCharges []RecurringCharge - - // The ID of the Reserved Instance. - ReservedInstancesId *string - - // The scope of the Reserved Instance. - Scope Scope - - // The date and time the Reserved Instance started. - Start *time.Time - - // The state of the Reserved Instance purchase. - State ReservedInstanceState - - // Any tags assigned to the resource. - Tags []Tag - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float32 - - noSmithyDocumentSerde -} - -// Describes the configuration settings for the modified Reserved Instances. -type ReservedInstancesConfiguration struct { - - // The Availability Zone for the modified Reserved Instances. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // The number of modified Reserved Instances. - // - // This is a required field for a request. - InstanceCount *int32 - - // The instance type for the modified Reserved Instances. - InstanceType InstanceType - - // The network platform of the modified Reserved Instances. - Platform *string - - // Whether the Reserved Instance is applied to instances in a Region or instances - // in a specific Availability Zone. - Scope Scope - - noSmithyDocumentSerde -} - -// Describes the ID of a Reserved Instance. -type ReservedInstancesId struct { - - // The ID of the Reserved Instance. - ReservedInstancesId *string - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance listing. -type ReservedInstancesListing struct { - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The time the listing was created. - CreateDate *time.Time - - // The number of instances in this state. - InstanceCounts []InstanceCount - - // The price of the Reserved Instance listing. - PriceSchedules []PriceSchedule - - // The ID of the Reserved Instance. - ReservedInstancesId *string - - // The ID of the Reserved Instance listing. - ReservedInstancesListingId *string - - // The status of the Reserved Instance listing. - Status ListingStatus - - // The reason for the current status of the Reserved Instance listing. The - // response can be blank. - StatusMessage *string - - // Any tags assigned to the resource. - Tags []Tag - - // The last modified timestamp of the listing. - UpdateDate *time.Time - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance modification. -type ReservedInstancesModification struct { - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // The time when the modification request was created. - CreateDate *time.Time - - // The time for the modification to become effective. - EffectiveDate *time.Time - - // Contains target configurations along with their corresponding new Reserved - // Instance IDs. - ModificationResults []ReservedInstancesModificationResult - - // The IDs of one or more Reserved Instances. - ReservedInstancesIds []ReservedInstancesId - - // A unique ID for the Reserved Instance modification. - ReservedInstancesModificationId *string - - // The status of the Reserved Instances modification request. - Status *string - - // The reason for the status. - StatusMessage *string - - // The time when the modification request was last updated. - UpdateDate *time.Time - - noSmithyDocumentSerde -} - -// Describes the modification request/s. -type ReservedInstancesModificationResult struct { - - // The ID for the Reserved Instances that were created as part of the modification - // request. This field is only available when the modification is fulfilled. - ReservedInstancesId *string - - // The target Reserved Instances configurations supplied as part of the - // modification request. - TargetConfiguration *ReservedInstancesConfiguration - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance offering. -type ReservedInstancesOffering struct { - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // The currency of the Reserved Instance offering you are purchasing. It's - // specified using ISO 4217 standard currency codes. At this time, the only - // supported currency is USD . - CurrencyCode CurrencyCodeValues - - // The duration of the Reserved Instance, in seconds. - Duration *int64 - - // The purchase price of the Reserved Instance. - FixedPrice *float32 - - // The tenancy of the instance. - InstanceTenancy Tenancy - - // The instance type on which the Reserved Instance can be used. - InstanceType InstanceType - - // Indicates whether the offering is available through the Reserved Instance - // Marketplace (resale) or Amazon Web Services. If it's a Reserved Instance - // Marketplace offering, this is true . - Marketplace *bool - - // If convertible it can be exchanged for Reserved Instances of the same or higher - // monetary value, with different configurations. If standard , it is not possible - // to perform an exchange. - OfferingClass OfferingClassType - - // The Reserved Instance offering type. - OfferingType OfferingTypeValues - - // The pricing details of the Reserved Instance offering. - PricingDetails []PricingDetail - - // The Reserved Instance product platform description. - ProductDescription RIProductDescription - - // The recurring charge tag assigned to the resource. - RecurringCharges []RecurringCharge - - // The ID of the Reserved Instance offering. This is the offering ID used in GetReservedInstancesExchangeQuote to - // confirm that an exchange can be made. - ReservedInstancesOfferingId *string - - // Whether the Reserved Instance is applied to instances in a Region or an - // Availability Zone. - Scope Scope - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float32 - - noSmithyDocumentSerde -} - -// Describes a resource statement. -type ResourceStatement struct { - - // The resource types. - ResourceTypes []string - - // The resources. - Resources []string - - noSmithyDocumentSerde -} - -// Describes a resource statement. -type ResourceStatementRequest struct { - - // The resource types. - ResourceTypes []string - - // The resources. - Resources []string - - noSmithyDocumentSerde -} - -// Describes the error that's returned when you cannot delete a launch template -// version. -type ResponseError struct { - - // The error code. - Code LaunchTemplateErrorCode - - // The error message, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// The information for a launch template. -type ResponseLaunchTemplateData struct { - - // The block device mappings. - BlockDeviceMappings []LaunchTemplateBlockDeviceMapping - - // Information about the Capacity Reservation targeting option. - CapacityReservationSpecification *LaunchTemplateCapacityReservationSpecificationResponse - - // The CPU options for the instance. For more information, see [CPU options for Amazon EC2 instances] in the Amazon EC2 - // User Guide. - // - // [CPU options for Amazon EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html - CpuOptions *LaunchTemplateCpuOptions - - // The credit option for CPU usage of the instance. - CreditSpecification *CreditSpecification - - // Indicates whether the instance is enabled for stop protection. For more - // information, see [Enable stop protection for your EC2 instances]in the Amazon EC2 User Guide. - // - // [Enable stop protection for your EC2 instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html - DisableApiStop *bool - - // If set to true , indicates that the instance cannot be terminated using the - // Amazon EC2 console, command line tool, or API. - DisableApiTermination *bool - - // Indicates whether the instance is optimized for Amazon EBS I/O. - EbsOptimized *bool - - // Deprecated. - // - // Amazon Elastic Graphics reached end of life on January 8, 2024. - ElasticGpuSpecifications []ElasticGpuSpecificationResponse - - // Amazon Elastic Inference is no longer available. - // - // An elastic inference accelerator to associate with the instance. Elastic - // inference accelerators are a resource you can attach to your Amazon EC2 - // instances to accelerate your Deep Learning (DL) inference workloads. - // - // You cannot specify accelerators from different generations in the same request. - ElasticInferenceAccelerators []LaunchTemplateElasticInferenceAcceleratorResponse - - // Indicates whether the instance is enabled for Amazon Web Services Nitro - // Enclaves. - EnclaveOptions *LaunchTemplateEnclaveOptions - - // Indicates whether an instance is configured for hibernation. For more - // information, see [Hibernate your Amazon EC2 instance]in the Amazon EC2 User Guide. - // - // [Hibernate your Amazon EC2 instance]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html - HibernationOptions *LaunchTemplateHibernationOptions - - // The IAM instance profile. - IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecification - - // The ID of the AMI or a Systems Manager parameter. The Systems Manager parameter - // will resolve to the ID of the AMI at instance launch. - // - // The value depends on what you specified in the request. The possible values are: - // - // - If an AMI ID was specified in the request, then this is the AMI ID. - // - // - If a Systems Manager parameter was specified in the request, and - // ResolveAlias was configured as true , then this is the AMI ID that the - // parameter is mapped to in the Parameter Store. - // - // - If a Systems Manager parameter was specified in the request, and - // ResolveAlias was configured as false , then this is the parameter value. - // - // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. - // - // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id - ImageId *string - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior ShutdownBehavior - - // The market (purchasing) option for the instances. - InstanceMarketOptions *LaunchTemplateInstanceMarketOptions - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with these attributes. - // - // If you specify InstanceRequirements , you can't specify InstanceTypes . - InstanceRequirements *InstanceRequirements - - // The instance type. - InstanceType InstanceType - - // The ID of the kernel, if applicable. - KernelId *string - - // The name of the key pair. - KeyName *string - - // The license configurations. - LicenseSpecifications []LaunchTemplateLicenseConfiguration - - // The maintenance options for your instance. - MaintenanceOptions *LaunchTemplateInstanceMaintenanceOptions - - // The metadata options for the instance. For more information, see [Configure the Instance Metadata Service options] in the Amazon - // EC2 User Guide. - // - // [Configure the Instance Metadata Service options]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html - MetadataOptions *LaunchTemplateInstanceMetadataOptions - - // The monitoring for the instance. - Monitoring *LaunchTemplatesMonitoring - - // The network interfaces. - NetworkInterfaces []LaunchTemplateInstanceNetworkInterfaceSpecification - - // Contains the launch template settings for network performance options for your - // instance. - NetworkPerformanceOptions *LaunchTemplateNetworkPerformanceOptions - - // The entity that manages the launch template. - Operator *OperatorResponse - - // The placement of the instance. - Placement *LaunchTemplatePlacement - - // The options for the instance hostname. - PrivateDnsNameOptions *LaunchTemplatePrivateDnsNameOptions - - // The ID of the RAM disk, if applicable. - RamDiskId *string - - // The security group IDs. - SecurityGroupIds []string - - // The security group names. - SecurityGroups []string - - // The tags that are applied to the resources that are created during instance - // launch. - TagSpecifications []LaunchTemplateTagSpecification - - // The user data for the instance. - UserData *string - - noSmithyDocumentSerde -} - -// A security group rule removed with [RevokeSecurityGroupEgress] or [RevokeSecurityGroupIngress]. -// -// [RevokeSecurityGroupIngress]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RevokeSecurityGroupIngress.html -// [RevokeSecurityGroupEgress]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RevokeSecurityGroupEgress.html -type RevokedSecurityGroupRule struct { - - // The IPv4 CIDR of the traffic source. - CidrIpv4 *string - - // The IPv6 CIDR of the traffic source. - CidrIpv6 *string - - // A description of the revoked security group rule. - Description *string - - // The 'from' port number of the security group rule. - FromPort *int32 - - // A security group ID. - GroupId *string - - // The security group rule's protocol. - IpProtocol *string - - // Defines if a security group rule is an outbound rule. - IsEgress *bool - - // The ID of a prefix list that's the traffic source. - PrefixListId *string - - // The ID of a referenced security group. - ReferencedGroupId *string - - // A security group rule ID. - SecurityGroupRuleId *string - - // The 'to' port number of the security group rule. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes a route in a route table. -type Route struct { - - // The ID of the carrier gateway. - CarrierGatewayId *string - - // The Amazon Resource Name (ARN) of the core network. - CoreNetworkArn *string - - // The IPv4 CIDR block used for the destination match. - DestinationCidrBlock *string - - // The IPv6 CIDR block used for the destination match. - DestinationIpv6CidrBlock *string - - // The prefix of the Amazon Web Services service. - DestinationPrefixListId *string - - // The ID of the egress-only internet gateway. - EgressOnlyInternetGatewayId *string - - // The ID of a gateway attached to your VPC. - GatewayId *string - - // The ID of a NAT instance in your VPC. - InstanceId *string - - // The ID of Amazon Web Services account that owns the instance. - InstanceOwnerId *string - - // The ID of the local gateway. - LocalGatewayId *string - - // The ID of a NAT gateway. - NatGatewayId *string - - // The ID of the network interface. - NetworkInterfaceId *string - - // The Amazon Resource Name (ARN) of the ODB network. - OdbNetworkArn *string - - // Describes how the route was created. - // - // - CreateRouteTable - The route was automatically created when the route table - // was created. - // - // - CreateRoute - The route was manually added to the route table. - // - // - EnableVgwRoutePropagation - The route was propagated by route propagation. - Origin RouteOrigin - - // The state of the route. The blackhole state indicates that the route's target - // isn't available (for example, the specified gateway isn't attached to the VPC, - // or the specified NAT instance has been terminated). - State RouteState - - // The ID of a transit gateway. - TransitGatewayId *string - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// Describes a route server and its configuration. -// -// Amazon VPC Route Server simplifies routing for traffic between workloads that -// are deployed within a VPC and its internet gateways. With this feature, VPC -// Route Server dynamically updates VPC and internet gateway route tables with your -// preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those -// workloads. This enables you to automatically reroute traffic within a VPC, which -// increases the manageability of VPC routing and interoperability with third-party -// workloads. -// -// Route server supports the follow route table types: -// -// - VPC route tables not associated with subnets -// -// - Subnet route tables -// -// - Internet gateway route tables -// -// Route server does not support route tables associated with virtual private -// gateways. To propagate routes into a transit gateway route table, use [Transit Gateway Connect]. -// -// [Transit Gateway Connect]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html -type RouteServer struct { - - // The Border Gateway Protocol (BGP) Autonomous System Number (ASN) for the - // appliance. Valid values are from 1 to 4294967295. We recommend using a private - // ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. - AmazonSideAsn *int64 - - // The number of minutes a route server will wait after BGP is re-established to - // unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. The - // default value is 1. Only valid if persistRoutesState is 'enabled'. - // - // If you set the duration to 1 minute, then when your network appliance - // re-establishes BGP with route server, it has 1 minute to relearn it's adjacent - // network and advertise those routes to route server before route server resumes - // normal functionality. In most cases, 1 minute is probably sufficient. If, - // however, you have concerns that your BGP network may not be capable of fully - // re-establishing and re-learning everything in 1 minute, you can increase the - // duration up to 5 minutes. - PersistRoutesDuration *int64 - - // The current state of route persistence for the route server. - PersistRoutesState RouteServerPersistRoutesState - - // The unique identifier of the route server. - RouteServerId *string - - // Indicates whether SNS notifications are enabled for the route server. Enabling - // SNS notifications persists BGP status changes to an SNS topic provisioned by - // Amazon Web Services. - SnsNotificationsEnabled *bool - - // The ARN of the SNS topic where notifications are published. - SnsTopicArn *string - - // The current state of the route server. - State RouteServerState - - // Any tags assigned to the route server. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the association between a route server and a VPC. -// -// A route server association is the connection established between a route server -// and a VPC. -type RouteServerAssociation struct { - - // The ID of the associated route server. - RouteServerId *string - - // The current state of the association. - State RouteServerAssociationState - - // The ID of the associated VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// The current status of Bidirectional Forwarding Detection (BFD) for a BGP -// session. -type RouteServerBfdStatus struct { - - // The operational status of the BFD session. - Status RouteServerBfdState - - noSmithyDocumentSerde -} - -// The BGP configuration options for a route server peer. -type RouteServerBgpOptions struct { - - // The Border Gateway Protocol (BGP) Autonomous System Number (ASN) for the - // appliance. Valid values are from 1 to 4294967295. We recommend using a private - // ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. - PeerAsn *int64 - - // The liveness detection protocol used for the BGP peer. - // - // The requested liveness detection protocol for the BGP peer. - // - // - bgp-keepalive : The standard BGP keep alive mechanism ([RFC4271] ) that is stable but - // may take longer to fail-over in cases of network impact or router failure. - // - // - bfd : An additional Bidirectional Forwarding Detection (BFD) protocol ([RFC5880] ) - // that enables fast failover by using more sensitive liveness detection. - // - // Defaults to bgp-keepalive . - // - // [RFC5880]: https://www.rfc-editor.org/rfc/rfc5880 - // [RFC4271]: https://www.rfc-editor.org/rfc/rfc4271#page-21 - PeerLivenessDetection RouteServerPeerLivenessMode - - noSmithyDocumentSerde -} - -// The BGP configuration options requested for a route server peer. -type RouteServerBgpOptionsRequest struct { - - // The Border Gateway Protocol (BGP) Autonomous System Number (ASN) for the - // appliance. Valid values are from 1 to 4294967295. We recommend using a private - // ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. - // - // This member is required. - PeerAsn *int64 - - // The requested liveness detection protocol for the BGP peer. - // - // - bgp-keepalive : The standard BGP keep alive mechanism ([RFC4271] ) that is stable but - // may take longer to fail-over in cases of network impact or router failure. - // - // - bfd : An additional Bidirectional Forwarding Detection (BFD) protocol ([RFC5880] ) - // that enables fast failover by using more sensitive liveness detection. - // - // Defaults to bgp-keepalive . - // - // [RFC5880]: https://www.rfc-editor.org/rfc/rfc5880 - // [RFC4271]: https://www.rfc-editor.org/rfc/rfc4271#page-21 - PeerLivenessDetection RouteServerPeerLivenessMode - - noSmithyDocumentSerde -} - -// The current status of a BGP session. -type RouteServerBgpStatus struct { - - // The operational status of the BGP session. The status enables you to monitor - // session liveness if you lack monitoring on your router/appliance. - Status RouteServerBgpState - - noSmithyDocumentSerde -} - -// Describes a route server endpoint and its properties. -// -// A route server endpoint is an Amazon Web Services-managed component inside a -// subnet that facilitates [BGP (Border Gateway Protocol)]connections between your route server and your BGP -// peers. -// -// [BGP (Border Gateway Protocol)]: https://en.wikipedia.org/wiki/Border_Gateway_Protocol -type RouteServerEndpoint struct { - - // The IP address of the Elastic network interface for the endpoint. - EniAddress *string - - // The ID of the Elastic network interface for the endpoint. - EniId *string - - // The reason for any failure in endpoint creation or operation. - FailureReason *string - - // The unique identifier of the route server endpoint. - RouteServerEndpointId *string - - // The ID of the route server associated with this endpoint. - RouteServerId *string - - // The current state of the route server endpoint. - State RouteServerEndpointState - - // The ID of the subnet to place the route server endpoint into. - SubnetId *string - - // Any tags assigned to the route server endpoint. - Tags []Tag - - // The ID of the VPC containing the endpoint. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes a BGP peer configuration for a route server endpoint. -// -// A route server peer is a session between a route server endpoint and the device -// deployed in Amazon Web Services (such as a firewall appliance or other network -// security function running on an EC2 instance). The device must meet these -// requirements: -// -// - Have an elastic network interface in the VPC -// -// - Support BGP (Border Gateway Protocol) -// -// - Can initiate BGP sessions -type RouteServerPeer struct { - - // The current status of the BFD session with this peer. - BfdStatus *RouteServerBfdStatus - - // The BGP configuration options for this peer, including ASN (Autonomous System - // Number) and BFD (Bidrectional Forwarding Detection) settings. - BgpOptions *RouteServerBgpOptions - - // The current status of the BGP session with this peer. - BgpStatus *RouteServerBgpStatus - - // The IP address of the Elastic network interface for the route server endpoint. - EndpointEniAddress *string - - // The ID of the Elastic network interface for the route server endpoint. - EndpointEniId *string - - // The reason for any failure in peer creation or operation. - FailureReason *string - - // The IPv4 address of the peer device. - PeerAddress *string - - // The ID of the route server endpoint associated with this peer. - RouteServerEndpointId *string - - // The ID of the route server associated with this peer. - RouteServerId *string - - // The unique identifier of the route server peer. - RouteServerPeerId *string - - // The current state of the route server peer. - State RouteServerPeerState - - // The ID of the subnet containing the route server peer. - SubnetId *string - - // Any tags assigned to the route server peer. - Tags []Tag - - // The ID of the VPC containing the route server peer. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes the route propagation configuration between a route server and a -// route table. -// -// When enabled, route server propagation installs the routes in the FIB on the -// route table you've specified. Route server supports IPv4 and IPv6 route -// propagation. -type RouteServerPropagation struct { - - // The ID of the route server configured for route propagation. - RouteServerId *string - - // The ID of the route table configured for route server propagation. - RouteTableId *string - - // The current state of route propagation. - State RouteServerPropagationState - - noSmithyDocumentSerde -} - -// Describes a route in the route server's routing database. -type RouteServerRoute struct { - - // The AS path attributes of the BGP route. - AsPaths []string - - // The Multi-Exit Discriminator (MED) value of the BGP route. - Med *int32 - - // The IP address for the next hop. - NextHopIp *string - - // The destination CIDR block of the route. - Prefix *string - - // Details about the installation status of this route in route tables. - RouteInstallationDetails []RouteServerRouteInstallationDetail - - // The ID of the route server endpoint that received this route. - RouteServerEndpointId *string - - // The ID of the route server peer that advertised this route. - RouteServerPeerId *string - - // The current status of the route in the routing database. Values are in-rib or - // in-fib depending on if the routes are in the RIB or the FIB database. - // - // The [Routing Information Base (RIB)] serves as a database that stores all the routing information and network - // topology data collected by a router or routing system, such as routes learned - // from BGP peers. The RIB is constantly updated as new routing information is - // received or existing routes change. This ensures that the route server always - // has the most current view of the network topology and can make optimal routing - // decisions. - // - // The [Forwarding Information Base (FIB)] serves as a forwarding table for what route server has determined are the - // best-path routes in the RIB after evaluating all available routing information - // and policies. The FIB routes are installed on the route tables. The FIB is - // recomputed whenever there are changes to the RIB. - // - // [Routing Information Base (RIB)]: https://en.wikipedia.org/wiki/Routing_table - // [Forwarding Information Base (FIB)]: https://en.wikipedia.org/wiki/Forwarding_information_base - RouteStatus RouteServerRouteStatus - - noSmithyDocumentSerde -} - -// Describes the installation status of a route in a route table. -type RouteServerRouteInstallationDetail struct { - - // The current installation status of the route in the route table. - RouteInstallationStatus RouteServerRouteInstallationStatus - - // The reason for the current installation status of the route. - RouteInstallationStatusReason *string - - // The ID of the route table where the route is being installed. - RouteTableId *string - - noSmithyDocumentSerde -} - -// Describes a route table. -type RouteTable struct { - - // The associations between the route table and your subnets or gateways. - Associations []RouteTableAssociation - - // The ID of the Amazon Web Services account that owns the route table. - OwnerId *string - - // Any virtual private gateway (VGW) propagating routes. - PropagatingVgws []PropagatingVgw - - // The ID of the route table. - RouteTableId *string - - // The routes in the route table. - Routes []Route - - // Any tags assigned to the route table. - Tags []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes an association between a route table and a subnet or gateway. -type RouteTableAssociation struct { - - // The state of the association. - AssociationState *RouteTableAssociationState - - // The ID of the internet gateway or virtual private gateway. - GatewayId *string - - // Indicates whether this is the main route table. - Main *bool - - // The ID of the association. - RouteTableAssociationId *string - - // The ID of the route table. - RouteTableId *string - - // The ID of the subnet. A subnet ID is not returned for an implicit association. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes the state of an association between a route table and a subnet or -// gateway. -type RouteTableAssociationState struct { - - // The state of the association. - State RouteTableAssociationStateCode - - // The status message, if applicable. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Describes the rule options for a stateful rule group. -type RuleGroupRuleOptionsPair struct { - - // The ARN of the rule group. - RuleGroupArn *string - - // The rule options. - RuleOptions []RuleOption - - noSmithyDocumentSerde -} - -// Describes the type of a stateful rule group. -type RuleGroupTypePair struct { - - // The ARN of the rule group. - RuleGroupArn *string - - // The rule group type. The possible values are Domain List and Suricata . - RuleGroupType *string - - noSmithyDocumentSerde -} - -// Describes additional settings for a stateful rule. -type RuleOption struct { - - // The Suricata keyword. - Keyword *string - - // The settings for the keyword. - Settings []string - - noSmithyDocumentSerde -} - -// Describes the monitoring of an instance. -type RunInstancesMonitoringEnabled struct { - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - // - // This member is required. - Enabled *bool - - noSmithyDocumentSerde -} - -// The tags to apply to the AMI object that will be stored in the Amazon S3 -// bucket. For more information, see [Categorizing your storage using tags]in the Amazon Simple Storage Service User -// Guide. -// -// [Categorizing your storage using tags]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html -type S3ObjectTag struct { - - // The key of the tag. - // - // Constraints: Tag keys are case-sensitive and can be up to 128 Unicode - // characters in length. May not begin with aws :. - Key *string - - // The value of the tag. - // - // Constraints: Tag values are case-sensitive and can be up to 256 Unicode - // characters in length. - Value *string - - noSmithyDocumentSerde -} - -// Describes the storage parameters for Amazon S3 and Amazon S3 buckets for an -// instance store-backed AMI. -type S3Storage struct { - - // The access key ID of the owner of the bucket. Before you specify a value for - // your access key ID, review and follow the guidance in [Best Practices for Amazon Web Services accounts]in the Account - // ManagementReference Guide. - // - // [Best Practices for Amazon Web Services accounts]: https://docs.aws.amazon.com/accounts/latest/reference/best-practices.html - AWSAccessKeyId *string - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify a - // bucket that belongs to someone else, Amazon EC2 returns an error. - Bucket *string - - // The beginning of the file name of the AMI. - Prefix *string - - // An Amazon S3 upload policy that gives Amazon EC2 permission to upload items - // into Amazon S3 on your behalf. - UploadPolicy []byte - - // The signature of the JSON document. - UploadPolicySignature *string - - noSmithyDocumentSerde -} - -// Describes a Scheduled Instance. -type ScheduledInstance struct { - - // The Availability Zone. - AvailabilityZone *string - - // The date when the Scheduled Instance was purchased. - CreateDate *time.Time - - // The hourly price for a single instance. - HourlyPrice *string - - // The number of instances. - InstanceCount *int32 - - // The instance type. - InstanceType *string - - // The network platform. - NetworkPlatform *string - - // The time for the next schedule to start. - NextSlotStartTime *time.Time - - // The platform ( Linux/UNIX or Windows ). - Platform *string - - // The time that the previous schedule ended or will end. - PreviousSlotEndTime *time.Time - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence - - // The Scheduled Instance ID. - ScheduledInstanceId *string - - // The number of hours in the schedule. - SlotDurationInHours *int32 - - // The end date for the Scheduled Instance. - TermEndDate *time.Time - - // The start date for the Scheduled Instance. - TermStartDate *time.Time - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int32 - - noSmithyDocumentSerde -} - -// Describes a schedule that is available for your Scheduled Instances. -type ScheduledInstanceAvailability struct { - - // The Availability Zone. - AvailabilityZone *string - - // The number of available instances. - AvailableInstanceCount *int32 - - // The time period for the first schedule to start. - FirstSlotStartTime *time.Time - - // The hourly price for a single instance. - HourlyPrice *string - - // The instance type. You can specify one of the C3, C4, M4, or R3 instance types. - InstanceType *string - - // The maximum term. The only possible value is 365 days. - MaxTermDurationInDays *int32 - - // The minimum term. The only possible value is 365 days. - MinTermDurationInDays *int32 - - // The network platform. - NetworkPlatform *string - - // The platform ( Linux/UNIX or Windows ). - Platform *string - - // The purchase token. This token expires in two hours. - PurchaseToken *string - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence - - // The number of hours in the schedule. - SlotDurationInHours *int32 - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int32 - - noSmithyDocumentSerde -} - -// Describes the recurring schedule for a Scheduled Instance. -type ScheduledInstanceRecurrence struct { - - // The frequency ( Daily , Weekly , or Monthly ). - Frequency *string - - // The interval quantity. The interval unit depends on the value of frequency . For - // example, every 2 weeks or every 2 months. - Interval *int32 - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 is - // Sunday). - OccurrenceDaySet []int32 - - // Indicates whether the occurrence is relative to the end of the specified week - // or month. - OccurrenceRelativeToEnd *bool - - // The unit for occurrenceDaySet ( DayOfWeek or DayOfMonth ). - OccurrenceUnit *string - - noSmithyDocumentSerde -} - -// Describes the recurring schedule for a Scheduled Instance. -type ScheduledInstanceRecurrenceRequest struct { - - // The frequency ( Daily , Weekly , or Monthly ). - Frequency *string - - // The interval quantity. The interval unit depends on the value of Frequency . For - // example, every 2 weeks or every 2 months. - Interval *int32 - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 is - // Sunday). You can't specify this value with a daily schedule. If the occurrence - // is relative to the end of the month, you can specify only a single day. - OccurrenceDays []int32 - - // Indicates whether the occurrence is relative to the end of the specified week - // or month. You can't specify this value with a daily schedule. - OccurrenceRelativeToEnd *bool - - // The unit for OccurrenceDays ( DayOfWeek or DayOfMonth ). This value is required - // for a monthly schedule. You can't specify DayOfWeek with a weekly schedule. You - // can't specify this value with a daily schedule. - OccurrenceUnit *string - - noSmithyDocumentSerde -} - -// Describes a block device mapping for a Scheduled Instance. -type ScheduledInstancesBlockDeviceMapping struct { - - // The device name (for example, /dev/sdh or xvdh ). - DeviceName *string - - // Parameters used to set up EBS volumes automatically when the instance is - // launched. - Ebs *ScheduledInstancesEbs - - // To omit the device from the block device mapping, specify an empty string. - NoDevice *string - - // The virtual device name ( ephemeral N). Instance store volumes are numbered - // starting from 0. An instance type with two available instance store volumes can - // specify mappings for ephemeral0 and ephemeral1 . The number of available - // instance store volumes depends on the instance type. After you connect to the - // instance, you must mount the volume. - // - // Constraints: For M3 instances, you must specify instance store volumes in the - // block device mapping for the instance. When you launch an M3 instance, we ignore - // any instance store volumes specified in the block device mapping for the AMI. - VirtualName *string - - noSmithyDocumentSerde -} - -// Describes an EBS volume for a Scheduled Instance. -type ScheduledInstancesEbs struct { - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool - - // Indicates whether the volume is encrypted. You can attached encrypted volumes - // only to instances that support them. - Encrypted *bool - - // The number of I/O operations per second (IOPS) to provision for a gp3 , io1 , or - // io2 volume. - Iops *int32 - - // The ID of the snapshot. - SnapshotId *string - - // The size of the volume, in GiB. - // - // Default: If you're creating the volume from a snapshot and don't specify a - // volume size, the default is the snapshot size. - VolumeSize *int32 - - // The volume type. - // - // Default: gp2 - VolumeType *string - - noSmithyDocumentSerde -} - -// Describes an IAM instance profile for a Scheduled Instance. -type ScheduledInstancesIamInstanceProfile struct { - - // The Amazon Resource Name (ARN). - Arn *string - - // The name. - Name *string - - noSmithyDocumentSerde -} - -// Describes an IPv6 address. -type ScheduledInstancesIpv6Address struct { - - // The IPv6 address. - Ipv6Address *string - - noSmithyDocumentSerde -} - -// Describes the launch specification for a Scheduled Instance. -// -// If you are launching the Scheduled Instance in EC2-VPC, you must specify the ID -// of the subnet. You can specify the subnet using either SubnetId or -// NetworkInterface . -type ScheduledInstancesLaunchSpecification struct { - - // The ID of the Amazon Machine Image (AMI). - // - // This member is required. - ImageId *string - - // The block device mapping entries. - BlockDeviceMappings []ScheduledInstancesBlockDeviceMapping - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration stack - // to provide optimal EBS I/O performance. This optimization isn't available with - // all instance types. Additional usage charges apply when using an EBS-optimized - // instance. - // - // Default: false - EbsOptimized *bool - - // The IAM instance profile. - IamInstanceProfile *ScheduledInstancesIamInstanceProfile - - // The instance type. - InstanceType *string - - // The ID of the kernel. - KernelId *string - - // The name of the key pair. - KeyName *string - - // Enable or disable monitoring for the instances. - Monitoring *ScheduledInstancesMonitoring - - // The network interfaces. - NetworkInterfaces []ScheduledInstancesNetworkInterface - - // The placement information. - Placement *ScheduledInstancesPlacement - - // The ID of the RAM disk. - RamdiskId *string - - // The IDs of the security groups. - SecurityGroupIds []string - - // The ID of the subnet in which to launch the instances. - SubnetId *string - - // The base64-encoded MIME user data. - UserData *string - - noSmithyDocumentSerde -} - -// Describes whether monitoring is enabled for a Scheduled Instance. -type ScheduledInstancesMonitoring struct { - - // Indicates whether monitoring is enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes a network interface for a Scheduled Instance. -type ScheduledInstancesNetworkInterface struct { - - // Indicates whether to assign a public IPv4 address to instances launched in a - // VPC. The public IPv4 address can only be assigned to a network interface for - // eth0, and can only be assigned to a new network interface, not an existing one. - // You cannot specify more than one network interface in the request. If launching - // into a default subnet, the default value is true . - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - AssociatePublicIpAddress *bool - - // Indicates whether to delete the interface when the instance is terminated. - DeleteOnTermination *bool - - // The description. - Description *string - - // The index of the device for the network interface attachment. - DeviceIndex *int32 - - // The IDs of the security groups. - Groups []string - - // The number of IPv6 addresses to assign to the network interface. The IPv6 - // addresses are automatically selected from the subnet range. - Ipv6AddressCount *int32 - - // The specific IPv6 addresses from the subnet range. - Ipv6Addresses []ScheduledInstancesIpv6Address - - // The ID of the network interface. - NetworkInterfaceId *string - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string - - // The private IPv4 addresses. - PrivateIpAddressConfigs []ScheduledInstancesPrivateIpAddressConfig - - // The number of secondary private IPv4 addresses. - SecondaryPrivateIpAddressCount *int32 - - // The ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes the placement for a Scheduled Instance. -type ScheduledInstancesPlacement struct { - - // The Availability Zone. - AvailabilityZone *string - - // The name of the placement group. - GroupName *string - - noSmithyDocumentSerde -} - -// Describes a private IPv4 address for a Scheduled Instance. -type ScheduledInstancesPrivateIpAddressConfig struct { - - // Indicates whether this is a primary IPv4 address. Otherwise, this is a - // secondary IPv4 address. - Primary *bool - - // The IPv4 address. - PrivateIpAddress *string - - noSmithyDocumentSerde -} - -// Describes a security group. -type SecurityGroup struct { - - // A description of the security group. - Description *string - - // The ID of the security group. - GroupId *string - - // The name of the security group. - GroupName *string - - // The inbound rules associated with the security group. - IpPermissions []IpPermission - - // The outbound rules associated with the security group. - IpPermissionsEgress []IpPermission - - // The Amazon Web Services account ID of the owner of the security group. - OwnerId *string - - // The ARN of the security group. - SecurityGroupArn *string - - // Any tags assigned to the security group. - Tags []Tag - - // The ID of the VPC for the security group. - VpcId *string - - noSmithyDocumentSerde -} - -// A security group that can be used by interfaces in the VPC. -type SecurityGroupForVpc struct { - - // The security group's description. - Description *string - - // The security group ID. - GroupId *string - - // The security group name. - GroupName *string - - // The security group owner ID. - OwnerId *string - - // The VPC ID in which the security group was created. - PrimaryVpcId *string - - // The security group tags. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a security group. -type SecurityGroupIdentifier struct { - - // The ID of the security group. - GroupId *string - - // The name of the security group. - GroupName *string - - noSmithyDocumentSerde -} - -// Describes a VPC with a security group that references your security group. -type SecurityGroupReference struct { - - // The ID of your security group. - GroupId *string - - // The ID of the VPC with the referencing security group. - ReferencingVpcId *string - - // The ID of the transit gateway (if applicable). - TransitGatewayId *string - - // The ID of the VPC peering connection (if applicable). For more information - // about security group referencing for peering connections, see [Update your security groups to reference peer security groups]in the VPC - // Peering Guide. - // - // [Update your security groups to reference peer security groups]: https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// Describes a security group rule. -type SecurityGroupRule struct { - - // The IPv4 CIDR range. - CidrIpv4 *string - - // The IPv6 CIDR range. - CidrIpv6 *string - - // The security group rule description. - Description *string - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types). - FromPort *int32 - - // The ID of the security group. - GroupId *string - - // The ID of the Amazon Web Services account that owns the security group. - GroupOwnerId *string - - // The IP protocol name ( tcp , udp , icmp , icmpv6 ) or number (see [Protocol Numbers]). - // - // Use -1 to specify all protocols. - // - // [Protocol Numbers]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // Indicates whether the security group rule is an outbound rule. - IsEgress *bool - - // The ID of the prefix list. - PrefixListId *string - - // Describes the security group that is referenced in the rule. - ReferencedGroupInfo *ReferencedSecurityGroup - - // The ARN of the security group rule. - SecurityGroupRuleArn *string - - // The ID of the security group rule. - SecurityGroupRuleId *string - - // The tags applied to the security group rule. - Tags []Tag - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the - // start port is -1 (all ICMP types), then the end port must be -1 (all ICMP - // codes). - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes the description of a security group rule. -// -// You can use this when you want to update the security group rule description -// for either an inbound or outbound rule. -type SecurityGroupRuleDescription struct { - - // The description of the security group rule. - Description *string - - // The ID of the security group rule. - SecurityGroupRuleId *string - - noSmithyDocumentSerde -} - -// Describes a security group rule. -// -// You must specify exactly one of the following parameters, based on the rule -// type: -// -// - CidrIpv4 -// -// - CidrIpv6 -// -// - PrefixListId -// -// - ReferencedGroupId -// -// Amazon Web Services [canonicalizes] IPv4 and IPv6 CIDRs. For example, if you specify -// 100.68.0.18/18 for the CIDR block, Amazon Web Services canonicalizes the CIDR -// block to 100.68.0.0/18. Any subsequent DescribeSecurityGroups and -// DescribeSecurityGroupRules calls will return the canonicalized form of the CIDR -// block. Additionally, if you attempt to add another rule with the non-canonical -// form of the CIDR (such as 100.68.0.18/18) and there is already a rule for the -// canonicalized form of the CIDR block (such as 100.68.0.0/18), the API throws an -// duplicate rule error. -// -// When you modify a rule, you cannot change the rule type. For example, if the -// rule uses an IPv4 address range, you must use CidrIpv4 to specify a new IPv4 -// address range. -// -// [canonicalizes]: https://en.wikipedia.org/wiki/Canonicalization -type SecurityGroupRuleRequest struct { - - // The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix - // length. - CidrIpv4 *string - - // The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix - // length. - CidrIpv6 *string - - // The description of the security group rule. - Description *string - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types). - FromPort *int32 - - // The IP protocol name ( tcp , udp , icmp , icmpv6 ) or number (see [Protocol Numbers]). - // - // Use -1 to specify all protocols. - // - // [Protocol Numbers]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // The ID of the prefix list. - PrefixListId *string - - // The ID of the security group that is referenced in the security group rule. - ReferencedGroupId *string - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the - // start port is -1 (all ICMP types), then the end port must be -1 (all ICMP - // codes). - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes an update to a security group rule. -type SecurityGroupRuleUpdate struct { - - // The ID of the security group rule. - // - // This member is required. - SecurityGroupRuleId *string - - // Information about the security group rule. - SecurityGroupRule *SecurityGroupRuleRequest - - noSmithyDocumentSerde -} - -// A security group association with a VPC that you made with [AssociateSecurityGroupVpc]. -// -// [AssociateSecurityGroupVpc]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateSecurityGroupVpc.html -type SecurityGroupVpcAssociation struct { - - // The association's security group ID. - GroupId *string - - // The Amazon Web Services account ID of the owner of the security group. - GroupOwnerId *string - - // The association's state. - State SecurityGroupVpcAssociationState - - // The association's state reason. - StateReason *string - - // The association's VPC ID. - VpcId *string - - // The Amazon Web Services account ID of the owner of the VPC. - VpcOwnerId *string - - noSmithyDocumentSerde -} - -// Describes a service configuration for a VPC endpoint service. -type ServiceConfiguration struct { - - // Indicates whether requests from other Amazon Web Services accounts to create an - // endpoint to the service must first be accepted. - AcceptanceRequired *bool - - // The Availability Zones in which the service is available. - AvailabilityZones []string - - // The DNS names for the service. - BaseEndpointDnsNames []string - - // The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service. - GatewayLoadBalancerArns []string - - // Indicates whether the service manages its VPC endpoints. Management of the - // service VPC endpoints using the VPC endpoint API is restricted. - ManagesVpcEndpoints *bool - - // The Amazon Resource Names (ARNs) of the Network Load Balancers for the service. - NetworkLoadBalancerArns []string - - // The payer responsibility. - PayerResponsibility PayerResponsibility - - // The private DNS name for the service. - PrivateDnsName *string - - // Information about the endpoint service private DNS name configuration. - PrivateDnsNameConfiguration *PrivateDnsNameConfiguration - - // Indicates whether consumers can access the service from a Region other than the - // Region where the service is hosted. - RemoteAccessEnabled *bool - - // The ID of the service. - ServiceId *string - - // The name of the service. - ServiceName *string - - // The service state. - ServiceState ServiceState - - // The type of service. - ServiceType []ServiceTypeDetail - - // The supported IP address types. - SupportedIpAddressTypes []ServiceConnectivityType - - // The supported Regions. - SupportedRegions []SupportedRegionDetail - - // The tags assigned to the service. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a VPC endpoint service. -type ServiceDetail struct { - - // Indicates whether VPC endpoint connection requests to the service must be - // accepted by the service owner. - AcceptanceRequired *bool - - // The Availability Zones in which the service is available. - AvailabilityZones []string - - // The DNS names for the service. - BaseEndpointDnsNames []string - - // Indicates whether the service manages its VPC endpoints. Management of the - // service VPC endpoints using the VPC endpoint API is restricted. - ManagesVpcEndpoints *bool - - // The Amazon Web Services account ID of the service owner. - Owner *string - - // The payer responsibility. - PayerResponsibility PayerResponsibility - - // The private DNS name for the service. - PrivateDnsName *string - - // The verification state of the VPC endpoint service. - // - // Consumers of the endpoint service cannot use the private name when the state is - // not verified . - PrivateDnsNameVerificationState DnsNameState - - // The private DNS names assigned to the VPC endpoint service. - PrivateDnsNames []PrivateDnsDetails - - // The ID of the endpoint service. - ServiceId *string - - // The name of the service. - ServiceName *string - - // The Region where the service is hosted. - ServiceRegion *string - - // The type of service. - ServiceType []ServiceTypeDetail - - // The supported IP address types. - SupportedIpAddressTypes []ServiceConnectivityType - - // The tags assigned to the service. - Tags []Tag - - // Indicates whether the service supports endpoint policies. - VpcEndpointPolicySupported *bool - - noSmithyDocumentSerde -} - -// Describes the service link virtual interfaces that establish connectivity -// between Amazon Web Services Outpost and on-premises networks. -type ServiceLinkVirtualInterface struct { - - // The current state of the service link virtual interface. - ConfigurationState ServiceLinkVirtualInterfaceConfigurationState - - // The IPv4 address assigned to the local gateway virtual interface on the Outpost - // side. - LocalAddress *string - - // The Outpost Amazon Resource Number (ARN) for the service link virtual interface. - OutpostArn *string - - // The Outpost ID for the service link virtual interface. - OutpostId *string - - // The link aggregation group (LAG) ID for the service link virtual interface. - OutpostLagId *string - - // The ID of the Amazon Web Services account that owns the service link virtual - // interface.. - OwnerId *string - - // The IPv4 peer address for the service link virtual interface. - PeerAddress *string - - // The ASN for the Border Gateway Protocol (BGP) associated with the service link - // virtual interface. - PeerBgpAsn *int64 - - // The Amazon Resource Number (ARN) for the service link virtual interface. - ServiceLinkVirtualInterfaceArn *string - - // The ID of the service link virtual interface. - ServiceLinkVirtualInterfaceId *string - - // The tags associated with the service link virtual interface. - Tags []Tag - - // The virtual local area network for the service link virtual interface. - Vlan *int32 - - noSmithyDocumentSerde -} - -// Describes the type of service for a VPC endpoint. -type ServiceTypeDetail struct { - - // The type of service. - ServiceType ServiceType - - noSmithyDocumentSerde -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -// The time period must span less than one day. -type SlotDateTimeRangeRequest struct { - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - // - // This member is required. - EarliestTime *time.Time - - // The latest date and time, in UTC, for the Scheduled Instance to start. This - // value must be later than or equal to the earliest date and at most three months - // in the future. - // - // This member is required. - LatestTime *time.Time - - noSmithyDocumentSerde -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -type SlotStartTimeRangeRequest struct { - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - EarliestTime *time.Time - - // The latest date and time, in UTC, for the Scheduled Instance to start. - LatestTime *time.Time - - noSmithyDocumentSerde -} - -// Describes a snapshot. -type Snapshot struct { - - // The Availability Zone or Local Zone of the snapshot. For example, us-west-1a - // (Availability Zone) or us-west-2-lax-1a (Local Zone). - AvailabilityZone *string - - // Only for snapshot copies created with time-based snapshot copy operations. - // - // The completion duration requested for the time-based snapshot copy operation. - CompletionDurationMinutes *int32 - - // The time stamp when the snapshot was completed. - CompletionTime *time.Time - - // The data encryption key identifier for the snapshot. This value is a unique - // identifier that corresponds to the data encryption key that was used to encrypt - // the original volume or snapshot copy. Because data encryption keys are inherited - // by volumes created from snapshots, and vice versa, if snapshots share the same - // data encryption key identifier, then they belong to the same volume/snapshot - // lineage. This parameter is only returned by DescribeSnapshots. - DataEncryptionKeyId *string - - // The description for the snapshot. - Description *string - - // Indicates whether the snapshot is encrypted. - Encrypted *bool - - // The full size of the snapshot, in bytes. - // - // This is not the incremental size of the snapshot. This is the full snapshot - // size and represents the size of all the blocks that were written to the source - // volume at the time the snapshot was created. - FullSnapshotSizeInBytes *int64 - - // The Amazon Resource Name (ARN) of the KMS key that was used to protect the - // volume encryption key for the parent volume. - KmsKeyId *string - - // The ARN of the Outpost on which the snapshot is stored. For more information, - // see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. - // - // [Amazon EBS local snapshots on Outposts]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html - OutpostArn *string - - // The Amazon Web Services owner alias, from an Amazon-maintained list ( amazon ). - // This is not the user-configured Amazon Web Services account alias set using the - // IAM console. - OwnerAlias *string - - // The ID of the Amazon Web Services account that owns the EBS snapshot. - OwnerId *string - - // The progress of the snapshot, as a percentage. - Progress *string - - // Only for archived snapshots that are temporarily restored. Indicates the date - // and time when a temporarily restored snapshot will be automatically re-archived. - RestoreExpiryTime *time.Time - - // The ID of the snapshot. Each snapshot receives a unique identifier when it is - // created. - SnapshotId *string - - // Reserved for future use. - SseType SSEType - - // The time stamp when the snapshot was initiated. - StartTime *time.Time - - // The snapshot state. - State SnapshotState - - // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy - // operation fails (for example, if the proper KMS permissions are not obtained) - // this field displays error state details to help you diagnose why the error - // occurred. This parameter is only returned by DescribeSnapshots. - StateMessage *string - - // The storage tier in which the snapshot is stored. standard indicates that the - // snapshot is stored in the standard snapshot storage tier and that it is ready - // for use. archive indicates that the snapshot is currently archived and that it - // must be restored before it can be used. - StorageTier StorageTier - - // Any tags assigned to the snapshot. - Tags []Tag - - // Only for snapshot copies. - // - // Indicates whether the snapshot copy was created with a standard or time-based - // snapshot copy operation. Time-based snapshot copy operations complete within the - // completion duration specified in the request. Standard snapshot copy operations - // are completed on a best-effort basis. - // - // - standard - The snapshot copy was created with a standard snapshot copy - // operation. - // - // - time-based - The snapshot copy was created with a time-based snapshot copy - // operation. - TransferType TransferType - - // The ID of the volume that was used to create the snapshot. Snapshots created by - // the CopySnapshotaction have an arbitrary volume ID that should not be used for any purpose. - VolumeId *string - - // The size of the volume, in GiB. - VolumeSize *int32 - - noSmithyDocumentSerde -} - -// Describes the snapshot created from the imported disk. -type SnapshotDetail struct { - - // A description for the snapshot. - Description *string - - // The block device mapping for the snapshot. - DeviceName *string - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 - - // The format of the disk image from which the snapshot is created. - Format *string - - // The percentage of progress for the task. - Progress *string - - // The snapshot ID of the disk being imported. - SnapshotId *string - - // A brief status of the snapshot creation. - Status *string - - // A detailed status message for the snapshot creation. - StatusMessage *string - - // The URL used to access the disk image. - Url *string - - // The Amazon S3 bucket for the disk image. - UserBucket *UserBucketDetails - - noSmithyDocumentSerde -} - -// The disk container object for the import snapshot request. -type SnapshotDiskContainer struct { - - // The description of the disk image being imported. - Description *string - - // The format of the disk image being imported. - // - // Valid values: VHD | VMDK | RAW - Format *string - - // The URL to the Amazon S3-based disk image being imported. It can either be a - // https URL (https://..) or an Amazon S3 URL (s3://..). - Url *string - - // The Amazon S3 bucket for the disk image. - UserBucket *UserBucket - - noSmithyDocumentSerde -} - -// Information about a snapshot. -type SnapshotInfo struct { - - // The Availability Zone or Local Zone of the snapshots. For example, us-west-1a - // (Availability Zone) or us-west-2-lax-1a (Local Zone). - AvailabilityZone *string - - // Description specified by the CreateSnapshotRequest that has been applied to all - // snapshots. - Description *string - - // Indicates whether the snapshot is encrypted. - Encrypted *bool - - // The ARN of the Outpost on which the snapshot is stored. For more information, - // see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. - // - // [Amazon EBS local snapshots on Outposts]: https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html - OutpostArn *string - - // Account id used when creating this snapshot. - OwnerId *string - - // Progress this snapshot has made towards completing. - Progress *string - - // Snapshot id that can be used to describe this snapshot. - SnapshotId *string - - // Reserved for future use. - SseType SSEType - - // Time this snapshot was started. This is the same for all snapshots initiated by - // the same request. - StartTime *time.Time - - // Current state of the snapshot. - State SnapshotState - - // Tags associated with this snapshot. - Tags []Tag - - // Source volume from which this snapshot was created. - VolumeId *string - - // Size of the volume from which this snapshot was created. - VolumeSize *int32 - - noSmithyDocumentSerde -} - -// Information about a snapshot that is currently in the Recycle Bin. -type SnapshotRecycleBinInfo struct { - - // The description for the snapshot. - Description *string - - // The date and time when the snapshot entered the Recycle Bin. - RecycleBinEnterTime *time.Time - - // The date and time when the snapshot is to be permanently deleted from the - // Recycle Bin. - RecycleBinExitTime *time.Time - - // The ID of the snapshot. - SnapshotId *string - - // The ID of the volume from which the snapshot was created. - VolumeId *string - - noSmithyDocumentSerde -} - -// Details about the import snapshot task. -type SnapshotTaskDetail struct { - - // The description of the disk image being imported. - Description *string - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 - - // Indicates whether the snapshot is encrypted. - Encrypted *bool - - // The format of the disk image from which the snapshot is created. - Format *string - - // The identifier for the KMS key that was used to create the encrypted snapshot. - KmsKeyId *string - - // The percentage of completion for the import snapshot task. - Progress *string - - // The snapshot ID of the disk being imported. - SnapshotId *string - - // A brief status for the import snapshot task. - Status *string - - // A detailed status message for the import snapshot task. - StatusMessage *string - - // The URL of the disk image from which the snapshot is created. - Url *string - - // The Amazon S3 bucket for the disk image. - UserBucket *UserBucketDetails - - noSmithyDocumentSerde -} - -// Provides information about a snapshot's storage tier. -type SnapshotTierStatus struct { - - // The date and time when the last archive process was completed. - ArchivalCompleteTime *time.Time - - // The status of the last archive or restore process. - LastTieringOperationStatus TieringOperationStatus - - // A message describing the status of the last archive or restore process. - LastTieringOperationStatusDetail *string - - // The progress of the last archive or restore process, as a percentage. - LastTieringProgress *int32 - - // The date and time when the last archive or restore process was started. - LastTieringStartTime *time.Time - - // The ID of the Amazon Web Services account that owns the snapshot. - OwnerId *string - - // Only for archived snapshots that are temporarily restored. Indicates the date - // and time when a temporarily restored snapshot will be automatically re-archived. - RestoreExpiryTime *time.Time - - // The ID of the snapshot. - SnapshotId *string - - // The state of the snapshot. - Status SnapshotState - - // The storage tier in which the snapshot is stored. standard indicates that the - // snapshot is stored in the standard snapshot storage tier and that it is ready - // for use. archive indicates that the snapshot is currently archived and that it - // must be restored before it can be used. - StorageTier StorageTier - - // The tags that are assigned to the snapshot. - Tags []Tag - - // The ID of the volume from which the snapshot was created. - VolumeId *string - - noSmithyDocumentSerde -} - -// The Spot Instance replacement strategy to use when Amazon EC2 emits a signal -// that your Spot Instance is at an elevated risk of being interrupted. For more -// information, see [Capacity rebalancing]in the Amazon EC2 User Guide. -// -// [Capacity rebalancing]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-capacity-rebalance.html -type SpotCapacityRebalance struct { - - // The replacement strategy to use. Only available for fleets of type maintain . - // - // launch - Spot Fleet launches a new replacement Spot Instance when a rebalance - // notification is emitted for an existing Spot Instance in the fleet. Spot Fleet - // does not terminate the instances that receive a rebalance notification. You can - // terminate the old instances, or you can leave them running. You are charged for - // all instances while they are running. - // - // launch-before-terminate - Spot Fleet launches a new replacement Spot Instance - // when a rebalance notification is emitted for an existing Spot Instance in the - // fleet, and then, after a delay that you specify (in TerminationDelay ), - // terminates the instances that received a rebalance notification. - ReplacementStrategy ReplacementStrategy - - // The amount of time (in seconds) that Amazon EC2 waits before terminating the - // old Spot Instance after launching a new replacement Spot Instance. - // - // Required when ReplacementStrategy is set to launch-before-terminate . - // - // Not valid when ReplacementStrategy is set to launch . - // - // Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds. - TerminationDelay *int32 - - noSmithyDocumentSerde -} - -// Describes the data feed for a Spot Instance. -type SpotDatafeedSubscription struct { - - // The name of the Amazon S3 bucket where the Spot Instance data feed is located. - Bucket *string - - // The fault codes for the Spot Instance request, if any. - Fault *SpotInstanceStateFault - - // The Amazon Web Services account ID of the account. - OwnerId *string - - // The prefix for the data feed files. - Prefix *string - - // The state of the Spot Instance data feed subscription. - State DatafeedSubscriptionState - - noSmithyDocumentSerde -} - -// Describes the launch specification for one or more Spot Instances. If you -// include On-Demand capacity in your fleet request or want to specify an EFA -// network device, you can't use SpotFleetLaunchSpecification ; you must use [LaunchTemplateConfig]. -// -// [LaunchTemplateConfig]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateConfig.html -type SpotFleetLaunchSpecification struct { - - // Deprecated. - AddressingType *string - - // One or more block devices that are mapped to the Spot Instances. You can't - // specify both a snapshot ID and an encryption value. This is because only blank - // volumes can be encrypted on creation. If a snapshot is the basis for a volume, - // it is not blank and its encryption status is used for the volume encryption - // status. - BlockDeviceMappings []BlockDeviceMapping - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration stack - // to provide optimal EBS I/O performance. This optimization isn't available with - // all instance types. Additional usage charges apply when using an EBS Optimized - // instance. - // - // Default: false - EbsOptimized *bool - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification - - // The ID of the AMI. - ImageId *string - - // The attributes for the instance types. When you specify instance attributes, - // Amazon EC2 will identify instance types with those attributes. - // - // If you specify InstanceRequirements , you can't specify InstanceType . - InstanceRequirements *InstanceRequirements - - // The instance type. - InstanceType InstanceType - - // The ID of the kernel. - KernelId *string - - // The name of the key pair. - KeyName *string - - // Enable or disable monitoring for the instances. - Monitoring *SpotFleetMonitoring - - // The network interfaces. - // - // SpotFleetLaunchSpecification does not support Elastic Fabric Adapter (EFA). You - // must use [LaunchTemplateConfig]instead. - // - // [LaunchTemplateConfig]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateConfig.html - NetworkInterfaces []InstanceNetworkInterfaceSpecification - - // The placement information. - Placement *SpotPlacement - - // The ID of the RAM disk. Some kernels require additional drivers at launch. - // Check the kernel requirements for information about whether you need to specify - // a RAM disk. To find kernel requirements, refer to the Amazon Web Services - // Resource Center and search for the kernel ID. - RamdiskId *string - - // The security groups. - // - // If you specify a network interface, you must specify any security groups as - // part of the network interface instead of using this parameter. - SecurityGroups []GroupIdentifier - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The IDs of the subnets in which to launch the instances. To specify multiple - // subnets, separate them using commas; for example, "subnet-1234abcdeexample1, - // subnet-0987cdef6example2". - // - // If you specify a network interface, you must specify any subnets as part of the - // network interface instead of using this parameter. - SubnetId *string - - // The tags to apply during creation. - TagSpecifications []SpotFleetTagSpecification - - // The base64-encoded user data that instances use when starting up. User data is - // limited to 16 KB. - UserData *string - - // The number of units provided by the specified instance type. These are the same - // units that you chose to set the target capacity in terms of instances, or a - // performance characteristic such as vCPUs, memory, or I/O. - // - // If the target capacity divided by this value is not a whole number, Amazon EC2 - // rounds the number of instances to the next whole number. If this value is not - // specified, the default is 1. - // - // When specifying weights, the price used in the lowestPrice and - // priceCapacityOptimized allocation strategies is per unit hour (where the - // instance price is divided by the specified weight). However, if all the - // specified weights are above the requested TargetCapacity , resulting in only 1 - // instance being launched, the price used is per instance hour. - WeightedCapacity *float64 - - noSmithyDocumentSerde -} - -// Describes whether monitoring is enabled. -type SpotFleetMonitoring struct { - - // Enables monitoring for the instance. - // - // Default: false - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes a Spot Fleet request. -type SpotFleetRequestConfig struct { - - // The progress of the Spot Fleet request. If there is an error, the status is - // error . After all requests are placed, the status is pending_fulfillment . If - // the size of the fleet is equal to or greater than its target capacity, the - // status is fulfilled . If the size of the fleet is decreased, the status is - // pending_termination while Spot Instances are terminating. - ActivityStatus ActivityStatus - - // The creation date and time of the request. - CreateTime *time.Time - - // The configuration of the Spot Fleet request. - SpotFleetRequestConfig *SpotFleetRequestConfigData - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string - - // The state of the Spot Fleet request. - SpotFleetRequestState BatchState - - // The tags for a Spot Fleet resource. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the configuration of a Spot Fleet request. -type SpotFleetRequestConfigData struct { - - // The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role - // that grants the Spot Fleet the permission to request, launch, terminate, and tag - // instances on your behalf. For more information, see [Spot Fleet prerequisites]in the Amazon EC2 User - // Guide. Spot Fleet can terminate Spot Instances on your behalf when you cancel - // its Spot Fleet request using [CancelSpotFleetRequests]or when the Spot Fleet request expires, if you set - // TerminateInstancesWithExpiration . - // - // [CancelSpotFleetRequests]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CancelSpotFleetRequests - // [Spot Fleet prerequisites]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html#spot-fleet-prerequisites - // - // This member is required. - IamFleetRole *string - - // The number of units to request for the Spot Fleet. You can choose to set the - // target capacity in terms of instances or a performance characteristic that is - // important to your application workload, such as vCPUs, memory, or I/O. If the - // request type is maintain , you can specify a target capacity of 0 and add - // capacity later. - // - // This member is required. - TargetCapacity *int32 - - // The strategy that determines how to allocate the target Spot Instance capacity - // across the Spot Instance pools specified by the Spot Fleet launch configuration. - // For more information, see [Allocation strategies for Spot Instances]in the Amazon EC2 User Guide. - // - // priceCapacityOptimized (recommended) Spot Fleet identifies the pools with the - // highest capacity availability for the number of instances that are launching. - // This means that we will request Spot Instances from the pools that we believe - // have the lowest chance of interruption in the near term. Spot Fleet then - // requests Spot Instances from the lowest priced of these pools. - // - // capacityOptimized Spot Fleet identifies the pools with the highest capacity - // availability for the number of instances that are launching. This means that we - // will request Spot Instances from the pools that we believe have the lowest - // chance of interruption in the near term. To give certain instance types a higher - // chance of launching first, use capacityOptimizedPrioritized . Set a priority for - // each instance type by using the Priority parameter for LaunchTemplateOverrides . - // You can assign the same priority to different LaunchTemplateOverrides . EC2 - // implements the priorities on a best-effort basis, but optimizes for capacity - // first. capacityOptimizedPrioritized is supported only if your Spot Fleet uses a - // launch template. Note that if the OnDemandAllocationStrategy is set to - // prioritized , the same priority is applied when fulfilling On-Demand capacity. - // - // diversified Spot Fleet requests instances from all of the Spot Instance pools - // that you specify. - // - // lowestPrice (not recommended) We don't recommend the lowestPrice allocation - // strategy because it has the highest risk of interruption for your Spot - // Instances. - // - // Spot Fleet requests instances from the lowest priced Spot Instance pool that - // has available capacity. If the lowest priced pool doesn't have available - // capacity, the Spot Instances come from the next lowest priced pool that has - // available capacity. If a pool runs out of capacity before fulfilling your - // desired capacity, Spot Fleet will continue to fulfill your request by drawing - // from the next lowest priced pool. To ensure that your desired capacity is met, - // you might receive Spot Instances from several pools. Because this strategy only - // considers instance price and not capacity availability, it might lead to high - // interruption rates. - // - // Default: lowestPrice - // - // [Allocation strategies for Spot Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-allocation-strategy.html - AllocationStrategy AllocationStrategy - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of your listings. This helps to avoid duplicate listings. For more information, - // see [Ensuring Idempotency]. - // - // [Ensuring Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html - ClientToken *string - - // Reserved. - Context *string - - // Indicates whether running instances should be terminated if you decrease the - // target capacity of the Spot Fleet request below the current size of the Spot - // Fleet. - // - // Supported only for fleets of type maintain . - ExcessCapacityTerminationPolicy ExcessCapacityTerminationPolicy - - // The number of units fulfilled by this request compared to the set target - // capacity. You cannot set this value. - FulfilledCapacity *float64 - - // The behavior when a Spot Instance is interrupted. The default is terminate . - InstanceInterruptionBehavior InstanceInterruptionBehavior - - // The number of Spot pools across which to allocate your target Spot capacity. - // Valid only when Spot AllocationStrategy is set to lowest-price . Spot Fleet - // selects the cheapest Spot pools and evenly allocates your target Spot capacity - // across the number of Spot pools that you specify. - // - // Note that Spot Fleet attempts to draw Spot Instances from the number of pools - // that you specify on a best effort basis. If a pool runs out of Spot capacity - // before fulfilling your target capacity, Spot Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your target - // capacity is met, you might receive Spot Instances from more than the number of - // pools that you specified. Similarly, if most of the pools have no Spot capacity, - // you might receive your full target capacity from fewer than the number of pools - // that you specified. - InstancePoolsToUseCount *int32 - - // The launch specifications for the Spot Fleet request. If you specify - // LaunchSpecifications , you can't specify LaunchTemplateConfigs . If you include - // On-Demand capacity in your request, you must use LaunchTemplateConfigs . - // - // If an AMI specified in a launch specification is deregistered or disabled, no - // new instances can be launched from the AMI. For fleets of type maintain , the - // target capacity will not be maintained. - LaunchSpecifications []SpotFleetLaunchSpecification - - // The launch template and overrides. If you specify LaunchTemplateConfigs , you - // can't specify LaunchSpecifications . If you include On-Demand capacity in your - // request, you must use LaunchTemplateConfigs . - LaunchTemplateConfigs []LaunchTemplateConfig - - // One or more Classic Load Balancers and target groups to attach to the Spot - // Fleet request. Spot Fleet registers the running Spot Instances with the - // specified Classic Load Balancers and target groups. - // - // With Network Load Balancers, Spot Fleet cannot register instances that have the - // following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, - // M1, M2, M3, and T1. - LoadBalancersConfig *LoadBalancersConfig - - // The order of the launch template overrides to use in fulfilling On-Demand - // capacity. If you specify lowestPrice , Spot Fleet uses price to determine the - // order, launching the lowest price first. If you specify prioritized , Spot Fleet - // uses the priority that you assign to each Spot Fleet launch template override, - // launching the highest priority first. If you do not specify a value, Spot Fleet - // defaults to lowestPrice . - OnDemandAllocationStrategy OnDemandAllocationStrategy - - // The number of On-Demand units fulfilled by this request compared to the set - // target On-Demand capacity. - OnDemandFulfilledCapacity *float64 - - // The maximum amount per hour for On-Demand Instances that you're willing to pay. - // You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice - // parameter, or both parameters to ensure that your fleet cost does not exceed - // your budget. If you set a maximum price per hour for the On-Demand Instances and - // Spot Instances in your request, Spot Fleet will launch instances until it - // reaches the maximum amount you're willing to pay. When the maximum amount you're - // willing to pay is reached, the fleet stops launching instances even if it hasn’t - // met the target capacity. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The onDemandMaxTotalPrice does not account for - // surplus credits, and, if you use surplus credits, your final cost might be - // higher than what you specified for onDemandMaxTotalPrice . For more information, - // see [Surplus credits can incur charges]in the Amazon EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - OnDemandMaxTotalPrice *string - - // The number of On-Demand units to request. You can choose to set the target - // capacity in terms of instances or a performance characteristic that is important - // to your application workload, such as vCPUs, memory, or I/O. If the request type - // is maintain , you can specify a target capacity of 0 and add capacity later. - OnDemandTargetCapacity *int32 - - // Indicates whether Spot Fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool - - // The strategies for managing your Spot Instances that are at an elevated risk of - // being interrupted. - SpotMaintenanceStrategies *SpotMaintenanceStrategies - - // The maximum amount per hour for Spot Instances that you're willing to pay. You - // can use the spotMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, - // or both parameters to ensure that your fleet cost does not exceed your budget. - // If you set a maximum price per hour for the On-Demand Instances and Spot - // Instances in your request, Spot Fleet will launch instances until it reaches the - // maximum amount you're willing to pay. When the maximum amount you're willing to - // pay is reached, the fleet stops launching instances even if it hasn’t met the - // target capacity. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The spotMaxTotalPrice does not account for surplus - // credits, and, if you use surplus credits, your final cost might be higher than - // what you specified for spotMaxTotalPrice . For more information, see [Surplus credits can incur charges] in the - // Amazon EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - SpotMaxTotalPrice *string - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The key-value pair for tagging the Spot Fleet request on creation. The value - // for ResourceType must be spot-fleet-request , otherwise the Spot Fleet request - // fails. To tag instances at launch, specify the tags in the [launch template](valid only if you - // use LaunchTemplateConfigs ) or in the [SpotFleetTagSpecification] (valid only if you use - // LaunchSpecifications ). For information about tagging after launch, see [Tag your resources]. - // - // [SpotFleetTagSpecification]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetTagSpecification.html - // [launch template]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template - // [Tag your resources]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources - TagSpecifications []TagSpecification - - // The unit for the target capacity. You can specify this parameter only when - // using attribute-based instance type selection. - // - // Default: units (the number of instances) - TargetCapacityUnitType TargetCapacityUnitType - - // Indicates whether running Spot Instances are terminated when the Spot Fleet - // request expires. - TerminateInstancesWithExpiration *bool - - // The type of request. Indicates whether the Spot Fleet only requests the target - // capacity or also attempts to maintain it. When this value is request , the Spot - // Fleet only places the required requests. It does not attempt to replenish Spot - // Instances if capacity is diminished, nor does it submit requests in alternative - // Spot pools if capacity is not available. When this value is maintain , the Spot - // Fleet maintains the target capacity. The Spot Fleet places the required requests - // to meet capacity and automatically replenishes any interrupted instances. - // Default: maintain . instant is listed but is not used by Spot Fleet. - Type FleetType - - // The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). - // By default, Amazon EC2 starts fulfilling the request immediately. - ValidFrom *time.Time - - // The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). - // After the end date and time, no new Spot Instance requests are placed or able to - // fulfill the request. If no value is specified, the Spot Fleet request remains - // until you cancel it. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// The tags for a Spot Fleet resource. -type SpotFleetTagSpecification struct { - - // The type of resource. Currently, the only resource type that is supported is - // instance . To tag the Spot Fleet request on creation, use the TagSpecifications - // parameter in [SpotFleetRequestConfigData]. - // - // [SpotFleetRequestConfigData]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetRequestConfigData.html - ResourceType ResourceType - - // The tags. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes a Spot Instance request. -type SpotInstanceRequest struct { - - // Deprecated. - ActualBlockHourlyPrice *string - - // The Availability Zone group. If you specify the same Availability Zone group - // for all Spot Instance requests, all Spot Instances are launched in the same - // Availability Zone. - AvailabilityZoneGroup *string - - // Deprecated. - BlockDurationMinutes *int32 - - // The date and time when the Spot Instance request was created, in UTC format - // (for example, YYYY-MM-DDTHH:MM:SSZ). - CreateTime *time.Time - - // The fault codes for the Spot Instance request, if any. - Fault *SpotInstanceStateFault - - // The instance ID, if an instance has been launched to fulfill the Spot Instance - // request. - InstanceId *string - - // The behavior when a Spot Instance is interrupted. - InstanceInterruptionBehavior InstanceInterruptionBehavior - - // The instance launch group. Launch groups are Spot Instances that launch - // together and terminate together. - LaunchGroup *string - - // Additional information for launching instances. - LaunchSpecification *LaunchSpecification - - // The Availability Zone in which the request is launched. - LaunchedAvailabilityZone *string - - // The product description associated with the Spot Instance. - ProductDescription RIProductDescription - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The state of the Spot Instance request. Spot request status information helps - // track your Spot Instance requests. For more information, see [Spot request status]in the Amazon EC2 - // User Guide. - // - // [Spot request status]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html - State SpotInstanceState - - // The status code and status message describing the Spot Instance request. - Status *SpotInstanceStatus - - // Any tags assigned to the resource. - Tags []Tag - - // The Spot Instance request type. - Type SpotInstanceType - - // The start date of the request, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). The request becomes active at this date and time. - ValidFrom *time.Time - - // The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). - // - // - For a persistent request, the request remains active until the validUntil - // date and time is reached. Otherwise, the request remains active until you cancel - // it. - // - // - For a one-time request, the request remains active until all instances - // launch, the request is canceled, or the validUntil date and time is reached. - // By default, the request is valid for 7 days from the date the request was - // created. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// Describes a Spot Instance state change. -type SpotInstanceStateFault struct { - - // The reason code for the Spot Instance state change. - Code *string - - // The message for the Spot Instance state change. - Message *string - - noSmithyDocumentSerde -} - -// Describes the status of a Spot Instance request. -type SpotInstanceStatus struct { - - // The status code. For a list of status codes, see [Spot request status codes] in the Amazon EC2 User Guide. - // - // [Spot request status codes]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html#spot-instance-request-status-understand - Code *string - - // The description for the status code. - Message *string - - // The date and time of the most recent status update, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - UpdateTime *time.Time - - noSmithyDocumentSerde -} - -// The strategies for managing your Spot Instances that are at an elevated risk of -// being interrupted. -type SpotMaintenanceStrategies struct { - - // The Spot Instance replacement strategy to use when Amazon EC2 emits a signal - // that your Spot Instance is at an elevated risk of being interrupted. For more - // information, see [Capacity rebalancing]in the Amazon EC2 User Guide. - // - // [Capacity rebalancing]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-capacity-rebalance.html - CapacityRebalance *SpotCapacityRebalance - - noSmithyDocumentSerde -} - -// The options for Spot Instances. -type SpotMarketOptions struct { - - // Deprecated. - BlockDurationMinutes *int32 - - // The behavior when a Spot Instance is interrupted. - // - // If Configured (for [HibernationOptions]HibernationOptions ) is set to true , the - // InstanceInterruptionBehavior parameter is automatically set to hibernate . If - // you set it to stop or terminate , you'll get an error. - // - // If Configured (for [HibernationOptions]HibernationOptions ) is set to false or null , the - // InstanceInterruptionBehavior parameter is automatically set to terminate . You - // can also set it to stop or hibernate . - // - // For more information, see [Interruption behavior] in the Amazon EC2 User Guide. - // - // [HibernationOptions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html - // [Interruption behavior]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/interruption-behavior.html - InstanceInterruptionBehavior InstanceInterruptionBehavior - - // The maximum hourly price that you're willing to pay for a Spot Instance. We do - // not recommend using this parameter because it can lead to increased - // interruptions. If you do not specify this parameter, you will pay the current - // Spot price. - // - // If you specify a maximum price, your Spot Instances will be interrupted more - // frequently than if you do not specify this parameter. - // - // If you specify a maximum price, it must be more than USD $0.001. Specifying a - // value below USD $0.001 will result in an InvalidParameterValue error message. - MaxPrice *string - - // The Spot Instance request type. For [RunInstances], persistent Spot Instance requests are - // only supported when the instance interruption behavior is either hibernate or - // stop . - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances - SpotInstanceType SpotInstanceType - - // The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). Supported - // only for persistent requests. - // - // - For a persistent request, the request remains active until the ValidUntil - // date and time is reached. Otherwise, the request remains active until you cancel - // it. - // - // - For a one-time request, ValidUntil is not supported. The request remains - // active until all instances launch or you cancel the request. - ValidUntil *time.Time - - noSmithyDocumentSerde -} - -// Describes the configuration of Spot Instances in an EC2 Fleet. -type SpotOptions struct { - - // The strategy that determines how to allocate the target Spot Instance capacity - // across the Spot Instance pools specified by the EC2 Fleet launch configuration. - // For more information, see [Allocation strategies for Spot Instances]in the Amazon EC2 User Guide. - // - // price-capacity-optimized (recommended) EC2 Fleet identifies the pools with the - // highest capacity availability for the number of instances that are launching. - // This means that we will request Spot Instances from the pools that we believe - // have the lowest chance of interruption in the near term. EC2 Fleet then requests - // Spot Instances from the lowest priced of these pools. - // - // capacity-optimized EC2 Fleet identifies the pools with the highest capacity - // availability for the number of instances that are launching. This means that we - // will request Spot Instances from the pools that we believe have the lowest - // chance of interruption in the near term. To give certain instance types a higher - // chance of launching first, use capacity-optimized-prioritized . Set a priority - // for each instance type by using the Priority parameter for - // LaunchTemplateOverrides . You can assign the same priority to different - // LaunchTemplateOverrides . EC2 implements the priorities on a best-effort basis, - // but optimizes for capacity first. capacity-optimized-prioritized is supported - // only if your EC2 Fleet uses a launch template. Note that if the On-Demand - // AllocationStrategy is set to prioritized , the same priority is applied when - // fulfilling On-Demand capacity. - // - // diversified EC2 Fleet requests instances from all of the Spot Instance pools - // that you specify. - // - // lowest-price (not recommended) We don't recommend the lowest-price allocation - // strategy because it has the highest risk of interruption for your Spot - // Instances. - // - // EC2 Fleet requests instances from the lowest priced Spot Instance pool that has - // available capacity. If the lowest priced pool doesn't have available capacity, - // the Spot Instances come from the next lowest priced pool that has available - // capacity. If a pool runs out of capacity before fulfilling your desired - // capacity, EC2 Fleet will continue to fulfill your request by drawing from the - // next lowest priced pool. To ensure that your desired capacity is met, you might - // receive Spot Instances from several pools. Because this strategy only considers - // instance price and not capacity availability, it might lead to high interruption - // rates. - // - // Default: lowest-price - // - // [Allocation strategies for Spot Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html - AllocationStrategy SpotAllocationStrategy - - // The behavior when a Spot Instance is interrupted. - // - // Default: terminate - InstanceInterruptionBehavior SpotInstanceInterruptionBehavior - - // The number of Spot pools across which to allocate your target Spot capacity. - // Supported only when AllocationStrategy is set to lowest-price . EC2 Fleet - // selects the cheapest Spot pools and evenly allocates your target Spot capacity - // across the number of Spot pools that you specify. - // - // Note that EC2 Fleet attempts to draw Spot Instances from the number of pools - // that you specify on a best effort basis. If a pool runs out of Spot capacity - // before fulfilling your target capacity, EC2 Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your target - // capacity is met, you might receive Spot Instances from more than the number of - // pools that you specified. Similarly, if most of the pools have no Spot capacity, - // you might receive your full target capacity from fewer than the number of pools - // that you specified. - InstancePoolsToUseCount *int32 - - // The strategies for managing your workloads on your Spot Instances that will be - // interrupted. Currently only the capacity rebalance strategy is available. - MaintenanceStrategies *FleetSpotMaintenanceStrategies - - // The maximum amount per hour for Spot Instances that you're willing to pay. We - // do not recommend using this parameter because it can lead to increased - // interruptions. If you do not specify this parameter, you will pay the current - // Spot price. - // - // If you specify a maximum price, your Spot Instances will be interrupted more - // frequently than if you do not specify this parameter. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The maxTotalPrice does not account for surplus - // credits, and, if you use surplus credits, your final cost might be higher than - // what you specified for maxTotalPrice . For more information, see [Surplus credits can incur charges] in the Amazon - // EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - MaxTotalPrice *string - - // The minimum target capacity for Spot Instances in the fleet. If this minimum - // capacity isn't reached, no instances are launched. - // - // Constraints: Maximum value of 1000 . Supported only for fleets of type instant . - // - // At least one of the following must be specified: SingleAvailabilityZone | - // SingleInstanceType - MinTargetCapacity *int32 - - // Indicates that the fleet launches all Spot Instances into a single Availability - // Zone. - // - // Supported only for fleets of type instant . - SingleAvailabilityZone *bool - - // Indicates that the fleet uses a single instance type to launch all Spot - // Instances in the fleet. - // - // Supported only for fleets of type instant . - SingleInstanceType *bool - - noSmithyDocumentSerde -} - -// Describes the configuration of Spot Instances in an EC2 Fleet request. -type SpotOptionsRequest struct { - - // The strategy that determines how to allocate the target Spot Instance capacity - // across the Spot Instance pools specified by the EC2 Fleet launch configuration. - // For more information, see [Allocation strategies for Spot Instances]in the Amazon EC2 User Guide. - // - // price-capacity-optimized (recommended) EC2 Fleet identifies the pools with the - // highest capacity availability for the number of instances that are launching. - // This means that we will request Spot Instances from the pools that we believe - // have the lowest chance of interruption in the near term. EC2 Fleet then requests - // Spot Instances from the lowest priced of these pools. - // - // capacity-optimized EC2 Fleet identifies the pools with the highest capacity - // availability for the number of instances that are launching. This means that we - // will request Spot Instances from the pools that we believe have the lowest - // chance of interruption in the near term. To give certain instance types a higher - // chance of launching first, use capacity-optimized-prioritized . Set a priority - // for each instance type by using the Priority parameter for - // LaunchTemplateOverrides . You can assign the same priority to different - // LaunchTemplateOverrides . EC2 implements the priorities on a best-effort basis, - // but optimizes for capacity first. capacity-optimized-prioritized is supported - // only if your EC2 Fleet uses a launch template. Note that if the On-Demand - // AllocationStrategy is set to prioritized , the same priority is applied when - // fulfilling On-Demand capacity. - // - // diversified EC2 Fleet requests instances from all of the Spot Instance pools - // that you specify. - // - // lowest-price (not recommended) We don't recommend the lowest-price allocation - // strategy because it has the highest risk of interruption for your Spot - // Instances. - // - // EC2 Fleet requests instances from the lowest priced Spot Instance pool that has - // available capacity. If the lowest priced pool doesn't have available capacity, - // the Spot Instances come from the next lowest priced pool that has available - // capacity. If a pool runs out of capacity before fulfilling your desired - // capacity, EC2 Fleet will continue to fulfill your request by drawing from the - // next lowest priced pool. To ensure that your desired capacity is met, you might - // receive Spot Instances from several pools. Because this strategy only considers - // instance price and not capacity availability, it might lead to high interruption - // rates. - // - // Default: lowest-price - // - // [Allocation strategies for Spot Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html - AllocationStrategy SpotAllocationStrategy - - // The behavior when a Spot Instance is interrupted. - // - // Default: terminate - InstanceInterruptionBehavior SpotInstanceInterruptionBehavior - - // The number of Spot pools across which to allocate your target Spot capacity. - // Supported only when Spot AllocationStrategy is set to lowest-price . EC2 Fleet - // selects the cheapest Spot pools and evenly allocates your target Spot capacity - // across the number of Spot pools that you specify. - // - // Note that EC2 Fleet attempts to draw Spot Instances from the number of pools - // that you specify on a best effort basis. If a pool runs out of Spot capacity - // before fulfilling your target capacity, EC2 Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your target - // capacity is met, you might receive Spot Instances from more than the number of - // pools that you specified. Similarly, if most of the pools have no Spot capacity, - // you might receive your full target capacity from fewer than the number of pools - // that you specified. - InstancePoolsToUseCount *int32 - - // The strategies for managing your Spot Instances that are at an elevated risk of - // being interrupted. - MaintenanceStrategies *FleetSpotMaintenanceStrategiesRequest - - // The maximum amount per hour for Spot Instances that you're willing to pay. We - // do not recommend using this parameter because it can lead to increased - // interruptions. If you do not specify this parameter, you will pay the current - // Spot price. - // - // If you specify a maximum price, your Spot Instances will be interrupted more - // frequently than if you do not specify this parameter. - // - // If your fleet includes T instances that are configured as unlimited , and if - // their average CPU usage exceeds the baseline utilization, you will incur a - // charge for surplus credits. The MaxTotalPrice does not account for surplus - // credits, and, if you use surplus credits, your final cost might be higher than - // what you specified for MaxTotalPrice . For more information, see [Surplus credits can incur charges] in the Amazon - // EC2 User Guide. - // - // [Surplus credits can incur charges]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits - MaxTotalPrice *string - - // The minimum target capacity for Spot Instances in the fleet. If this minimum - // capacity isn't reached, no instances are launched. - // - // Constraints: Maximum value of 1000 . Supported only for fleets of type instant . - // - // At least one of the following must be specified: SingleAvailabilityZone | - // SingleInstanceType - MinTargetCapacity *int32 - - // Indicates that the fleet launches all Spot Instances into a single Availability - // Zone. - // - // Supported only for fleets of type instant . - SingleAvailabilityZone *bool - - // Indicates that the fleet uses a single instance type to launch all Spot - // Instances in the fleet. - // - // Supported only for fleets of type instant . - SingleInstanceType *bool - - noSmithyDocumentSerde -} - -// Describes Spot Instance placement. -type SpotPlacement struct { - - // The Availability Zone. - // - // [Spot Fleet only] To specify multiple Availability Zones, separate them using - // commas; for example, "us-west-2a, us-west-2b". - AvailabilityZone *string - - // The name of the placement group. - GroupName *string - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is - // not supported for Spot Instances. - Tenancy Tenancy - - noSmithyDocumentSerde -} - -// The Spot placement score for this Region or Availability Zone. The score is -// calculated based on the assumption that the capacity-optimized allocation -// strategy is used and that all of the Availability Zones in the Region can be -// used. -type SpotPlacementScore struct { - - // The Availability Zone. - AvailabilityZoneId *string - - // The Region. - Region *string - - // The placement score, on a scale from 1 to 10 . A score of 10 indicates that - // your Spot request is highly likely to succeed in this Region or Availability - // Zone. A score of 1 indicates that your Spot request is not likely to succeed. - Score *int32 - - noSmithyDocumentSerde -} - -// The maximum price per unit hour that you are willing to pay for a Spot -// Instance. We do not recommend using this parameter because it can lead to -// increased interruptions. If you do not specify this parameter, you will pay the -// current Spot price. -// -// If you specify a maximum price, your instances will be interrupted more -// frequently than if you do not specify this parameter. -type SpotPrice struct { - - // The Availability Zone. - AvailabilityZone *string - - // The instance type. - InstanceType InstanceType - - // A general description of the AMI. - ProductDescription RIProductDescription - - // The maximum price per unit hour that you are willing to pay for a Spot - // Instance. We do not recommend using this parameter because it can lead to - // increased interruptions. If you do not specify this parameter, you will pay the - // current Spot price. - // - // If you specify a maximum price, your instances will be interrupted more - // frequently than if you do not specify this parameter. - SpotPrice *string - - // The date and time the request was created, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time - - noSmithyDocumentSerde -} - -// Describes a stale rule in a security group. -type StaleIpPermission struct { - - // If the protocol is TCP or UDP, this is the start of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types). - FromPort *int32 - - // The IP protocol name ( tcp , udp , icmp , icmpv6 ) or number (see [Protocol Numbers)]. - // - // [Protocol Numbers)]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - IpProtocol *string - - // The IP ranges. Not applicable for stale security group rules. - IpRanges []string - - // The prefix list IDs. Not applicable for stale security group rules. - PrefixListIds []string - - // If the protocol is TCP or UDP, this is the end of the port range. If the - // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). - ToPort *int32 - - // The security group pairs. Returns the ID of the referenced security group and - // VPC, and the ID and status of the VPC peering connection. - UserIdGroupPairs []UserIdGroupPair - - noSmithyDocumentSerde -} - -// Describes a stale security group (a security group that contains stale rules). -type StaleSecurityGroup struct { - - // The description of the security group. - Description *string - - // The ID of the security group. - GroupId *string - - // The name of the security group. - GroupName *string - - // Information about the stale inbound rules in the security group. - StaleIpPermissions []StaleIpPermission - - // Information about the stale outbound rules in the security group. - StaleIpPermissionsEgress []StaleIpPermission - - // The ID of the VPC for the security group. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes a state change. -type StateReason struct { - - // The reason code for the state change. - Code *string - - // The message for the state change. - // - // - Server.InsufficientInstanceCapacity : There was insufficient capacity - // available to satisfy the launch request. - // - // - Server.InternalError : An internal error caused the instance to terminate - // during launch. - // - // - Server.ScheduledStop : The instance was stopped due to a scheduled - // retirement. - // - // - Server.SpotInstanceShutdown : The instance was stopped because the number of - // Spot requests with a maximum price equal to or higher than the Spot price - // exceeded available capacity or because of an increase in the Spot price. - // - // - Server.SpotInstanceTermination : The instance was terminated because the - // number of Spot requests with a maximum price equal to or higher than the Spot - // price exceeded available capacity or because of an increase in the Spot price. - // - // - Client.InstanceInitiatedShutdown : The instance was shut down from the - // operating system of the instance. - // - // - Client.InstanceTerminated : The instance was terminated or rebooted during - // AMI creation. - // - // - Client.InternalError : A client error caused the instance to terminate - // during launch. - // - // - Client.InvalidSnapshot.NotFound : The specified snapshot was not found. - // - // - Client.UserInitiatedHibernate : Hibernation was initiated on the instance. - // - // - Client.UserInitiatedShutdown : The instance was shut down using the Amazon - // EC2 API. - // - // - Client.VolumeLimitExceeded : The limit on the number of EBS volumes or total - // storage was exceeded. Decrease usage or request an increase in your account - // limits. - Message *string - - noSmithyDocumentSerde -} - -// Describes the storage location for an instance store-backed AMI. -type Storage struct { - - // An Amazon S3 storage location. - S3 *S3Storage - - noSmithyDocumentSerde -} - -// Describes a storage location in Amazon S3. -type StorageLocation struct { - - // The name of the S3 bucket. - Bucket *string - - // The key. - Key *string - - noSmithyDocumentSerde -} - -// The information about the AMI store task, including the progress of the task. -type StoreImageTaskResult struct { - - // The ID of the AMI that is being stored. - AmiId *string - - // The name of the Amazon S3 bucket that contains the stored AMI object. - Bucket *string - - // The progress of the task as a percentage. - ProgressPercentage *int32 - - // The name of the stored AMI object in the bucket. - S3objectKey *string - - // If the tasks fails, the reason for the failure is returned. If the task - // succeeds, null is returned. - StoreTaskFailureReason *string - - // The state of the store task ( InProgress , Completed , or Failed ). - StoreTaskState *string - - // The time the task started. - TaskStartTime *time.Time - - noSmithyDocumentSerde -} - -// Describes a subnet. -type Subnet struct { - - // Indicates whether a network interface created in this subnet (including a - // network interface created by RunInstances) receives an IPv6 address. - AssignIpv6AddressOnCreation *bool - - // The Availability Zone of the subnet. - AvailabilityZone *string - - // The AZ ID of the subnet. - AvailabilityZoneId *string - - // The number of unused private IPv4 addresses in the subnet. The IPv4 addresses - // for any stopped instances are considered unavailable. - AvailableIpAddressCount *int32 - - // The state of VPC Block Public Access (BPA). - BlockPublicAccessStates *BlockPublicAccessStates - - // The IPv4 CIDR block assigned to the subnet. - CidrBlock *string - - // The customer-owned IPv4 address pool associated with the subnet. - CustomerOwnedIpv4Pool *string - - // Indicates whether this is the default subnet for the Availability Zone. - DefaultForAz *bool - - // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this - // subnet should return synthetic IPv6 addresses for IPv4-only destinations. - EnableDns64 *bool - - // Indicates the device position for local network interfaces in this subnet. For - // example, 1 indicates local network interfaces in this subnet are the secondary - // network interface (eth1). - EnableLniAtDeviceIndex *int32 - - // Information about the IPv6 CIDR blocks associated with the subnet. - Ipv6CidrBlockAssociationSet []SubnetIpv6CidrBlockAssociation - - // Indicates whether this is an IPv6 only subnet. - Ipv6Native *bool - - // Indicates whether a network interface created in this subnet (including a - // network interface created by RunInstances) receives a customer-owned IPv4 address. - MapCustomerOwnedIpOnLaunch *bool - - // Indicates whether instances launched in this subnet receive a public IPv4 - // address. - // - // Amazon Web Services charges for all public IPv4 addresses, including public - // IPv4 addresses associated with running instances and Elastic IP addresses. For - // more information, see the Public IPv4 Address tab on the [Amazon VPC pricing page]. - // - // [Amazon VPC pricing page]: http://aws.amazon.com/vpc/pricing/ - MapPublicIpOnLaunch *bool - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The ID of the Amazon Web Services account that owns the subnet. - OwnerId *string - - // The type of hostnames to assign to instances in the subnet at launch. An - // instance hostname is based on the IPv4 address or ID of the instance. - PrivateDnsNameOptionsOnLaunch *PrivateDnsNameOptionsOnLaunch - - // The current state of the subnet. - // - // - failed : The underlying infrastructure to support the subnet failed to - // provision as expected. - // - // - failed-insufficient-capacity : The underlying infrastructure to support the - // subnet failed to provision due to a shortage of EC2 instance capacity. - State SubnetState - - // The Amazon Resource Name (ARN) of the subnet. - SubnetArn *string - - // The ID of the subnet. - SubnetId *string - - // Any tags assigned to the subnet. - Tags []Tag - - // Indicates if this is a subnet used with Amazon Elastic VMware Service (EVS). - // Possible values are Elastic VMware Service or no value. For more information - // about Amazon EVS, see [Amazon Elastic VMware Service API Reference]. - // - // [Amazon Elastic VMware Service API Reference]: https://docs.aws.amazon.com/evs/latest/APIReference/Welcome.html - Type *string - - // The ID of the VPC the subnet is in. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes the subnet association with the transit gateway multicast domain. -type SubnetAssociation struct { - - // The state of the subnet association. - State TransitGatewayMulitcastDomainAssociationState - - // The ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes the state of a CIDR block. -type SubnetCidrBlockState struct { - - // The state of a CIDR block. - State SubnetCidrBlockStateCode - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Describes a subnet CIDR reservation. -type SubnetCidrReservation struct { - - // The CIDR that has been reserved. - Cidr *string - - // The description assigned to the subnet CIDR reservation. - Description *string - - // The ID of the account that owns the subnet CIDR reservation. - OwnerId *string - - // The type of reservation. - ReservationType SubnetCidrReservationType - - // The ID of the subnet CIDR reservation. - SubnetCidrReservationId *string - - // The ID of the subnet. - SubnetId *string - - // The tags assigned to the subnet CIDR reservation. - Tags []Tag - - noSmithyDocumentSerde -} - -// Describes the configuration of a subnet for a VPC endpoint. -type SubnetConfiguration struct { - - // The IPv4 address to assign to the endpoint network interface in the subnet. You - // must provide an IPv4 address if the VPC endpoint supports IPv4. - // - // If you specify an IPv4 address when modifying a VPC endpoint, we replace the - // existing endpoint network interface with a new endpoint network interface with - // this IP address. This process temporarily disconnects the subnet and the VPC - // endpoint. - Ipv4 *string - - // The IPv6 address to assign to the endpoint network interface in the subnet. You - // must provide an IPv6 address if the VPC endpoint supports IPv6. - // - // If you specify an IPv6 address when modifying a VPC endpoint, we replace the - // existing endpoint network interface with a new endpoint network interface with - // this IP address. This process temporarily disconnects the subnet and the VPC - // endpoint. - Ipv6 *string - - // The ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -// Prefixes of the subnet IP. -type SubnetIpPrefixes struct { - - // Array of SubnetIpPrefixes objects. - IpPrefixes []string - - // ID of the subnet. - SubnetId *string - - noSmithyDocumentSerde -} - -// Describes an association between a subnet and an IPv6 CIDR block. -type SubnetIpv6CidrBlockAssociation struct { - - // The ID of the association. - AssociationId *string - - // The source that allocated the IP address space. byoip or amazon indicates - // public IP address space allocated by Amazon or space that you have allocated - // with Bring your own IP (BYOIP). none indicates private space. - IpSource IpSource - - // Public IPv6 addresses are those advertised on the internet from Amazon Web - // Services. Private IP addresses are not and cannot be advertised on the internet - // from Amazon Web Services. - Ipv6AddressAttribute Ipv6AddressAttribute - - // The IPv6 CIDR block. - Ipv6CidrBlock *string - - // The state of the CIDR block. - Ipv6CidrBlockState *SubnetCidrBlockState - - noSmithyDocumentSerde -} - -// Describes an Infrastructure Performance subscription. -type Subscription struct { - - // The Region or Availability Zone that's the target for the subscription. For - // example, eu-west-1 . - Destination *string - - // The metric used for the subscription. - Metric MetricType - - // The data aggregation time for the subscription. - Period PeriodType - - // The Region or Availability Zone that's the source for the subscription. For - // example, us-east-1 . - Source *string - - // The statistic used for the subscription. - Statistic StatisticType - - noSmithyDocumentSerde -} - -// Describes the burstable performance instance whose credit option for CPU usage -// was successfully modified. -type SuccessfulInstanceCreditSpecificationItem struct { - - // The ID of the instance. - InstanceId *string - - noSmithyDocumentSerde -} - -// Describes a Reserved Instance whose queued purchase was successfully deleted. -type SuccessfulQueuedPurchaseDeletion struct { - - // The ID of the Reserved Instance. - ReservedInstancesId *string - - noSmithyDocumentSerde -} - -// Describes a supported Region. -type SupportedRegionDetail struct { - - // The Region code. - Region *string - - // The service state. The possible values are Pending , Available , Deleting , - // Deleted , Failed , and Closed . - ServiceState *string - - noSmithyDocumentSerde -} - -// Describes a tag. -type Tag struct { - - // The key of the tag. - // - // Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode - // characters. May not begin with aws: . - Key *string - - // The value of the tag. - // - // Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode - // characters. - Value *string - - noSmithyDocumentSerde -} - -// Describes a tag. -type TagDescription struct { - - // The tag key. - Key *string - - // The ID of the resource. - ResourceId *string - - // The resource type. - ResourceType ResourceType - - // The tag value. - Value *string - - noSmithyDocumentSerde -} - -// The tags to apply to a resource when the resource is being created. When you -// specify a tag, you must specify the resource type to tag, otherwise the request -// will fail. -// -// The Valid Values lists all the resource types that can be tagged. However, the -// action you're using might not support tagging all of these resource types. If -// you try to tag a resource type that is unsupported for the action you're using, -// you'll get an error. -type TagSpecification struct { - - // The type of resource to tag on creation. - ResourceType ResourceType - - // The tags to apply to the resource. - Tags []Tag - - noSmithyDocumentSerde -} - -// The number of units to request. You can choose to set the target capacity in -// terms of instances or a performance characteristic that is important to your -// application workload, such as vCPUs, memory, or I/O. If the request type is -// maintain , you can specify a target capacity of 0 and add capacity later. -// -// You can use the On-Demand Instance MaxTotalPrice parameter, the Spot Instance -// MaxTotalPrice , or both to ensure that your fleet cost does not exceed your -// budget. If you set a maximum price per hour for the On-Demand Instances and Spot -// Instances in your request, EC2 Fleet will launch instances until it reaches the -// maximum amount that you're willing to pay. When the maximum amount you're -// willing to pay is reached, the fleet stops launching instances even if it hasn’t -// met the target capacity. The MaxTotalPrice parameters are located in [OnDemandOptions] and [SpotOptions]. -// -// [OnDemandOptions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_OnDemandOptions.html -// [SpotOptions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotOptions -type TargetCapacitySpecification struct { - - // The default target capacity type. - DefaultTargetCapacityType DefaultTargetCapacityType - - // The number of On-Demand units to request. If you specify a target capacity for - // Spot units, you cannot specify a target capacity for On-Demand units. - OnDemandTargetCapacity *int32 - - // The maximum number of Spot units to launch. If you specify a target capacity - // for On-Demand units, you cannot specify a target capacity for Spot units. - SpotTargetCapacity *int32 - - // The unit for the target capacity. - TargetCapacityUnitType TargetCapacityUnitType - - // The number of units to request, filled the default target capacity type. - TotalTargetCapacity *int32 - - noSmithyDocumentSerde -} - -// The number of units to request. You can choose to set the target capacity as -// the number of instances. Or you can set the target capacity to a performance -// characteristic that is important to your application workload, such as vCPUs, -// memory, or I/O. If the request type is maintain , you can specify a target -// capacity of 0 and add capacity later. -// -// You can use the On-Demand Instance MaxTotalPrice parameter, the Spot Instance -// MaxTotalPrice parameter, or both parameters to ensure that your fleet cost does -// not exceed your budget. If you set a maximum price per hour for the On-Demand -// Instances and Spot Instances in your request, EC2 Fleet will launch instances -// until it reaches the maximum amount that you're willing to pay. When the maximum -// amount you're willing to pay is reached, the fleet stops launching instances -// even if it hasn't met the target capacity. The MaxTotalPrice parameters are -// located in [OnDemandOptionsRequest]and [SpotOptionsRequest]. -// -// [OnDemandOptionsRequest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_OnDemandOptionsRequest -// [SpotOptionsRequest]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotOptionsRequest -type TargetCapacitySpecificationRequest struct { - - // The number of units to request, filled using the default target capacity type. - // - // This member is required. - TotalTargetCapacity *int32 - - // The default target capacity type. - DefaultTargetCapacityType DefaultTargetCapacityType - - // The number of On-Demand units to request. - OnDemandTargetCapacity *int32 - - // The number of Spot units to request. - SpotTargetCapacity *int32 - - // The unit for the target capacity. You can specify this parameter only when - // using attributed-based instance type selection. - // - // Default: units (the number of instances) - TargetCapacityUnitType TargetCapacityUnitType - - noSmithyDocumentSerde -} - -// Information about the Convertible Reserved Instance offering. -type TargetConfiguration struct { - - // The number of instances the Convertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int32 - - // The ID of the Convertible Reserved Instance offering. - OfferingId *string - - noSmithyDocumentSerde -} - -// Details about the target configuration. -type TargetConfigurationRequest struct { - - // The Convertible Reserved Instance offering ID. - // - // This member is required. - OfferingId *string - - // The number of instances the Convertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int32 - - noSmithyDocumentSerde -} - -// Describes a load balancer target group. -type TargetGroup struct { - - // The Amazon Resource Name (ARN) of the target group. - Arn *string - - noSmithyDocumentSerde -} - -// Describes the target groups to attach to a Spot Fleet. Spot Fleet registers the -// running Spot Instances with these target groups. -type TargetGroupsConfig struct { - - // One or more target groups. - TargetGroups []TargetGroup - - noSmithyDocumentSerde -} - -// Describes a target network associated with a Client VPN endpoint. -type TargetNetwork struct { - - // The ID of the association. - AssociationId *string - - // The ID of the Client VPN endpoint with which the target network is associated. - ClientVpnEndpointId *string - - // The IDs of the security groups applied to the target network association. - SecurityGroups []string - - // The current state of the target network association. - Status *AssociationStatus - - // The ID of the subnet specified as the target network. - TargetNetworkId *string - - // The ID of the VPC in which the target network (subnet) is located. - VpcId *string - - noSmithyDocumentSerde -} - -// The total value of the new Convertible Reserved Instances. -type TargetReservationValue struct { - - // The total value of the Convertible Reserved Instances that make up the - // exchange. This is the sum of the list value, remaining upfront price, and - // additional upfront cost of the exchange. - ReservationValue *ReservationValue - - // The configuration of the Convertible Reserved Instances that make up the - // exchange. - TargetConfiguration *TargetConfiguration - - noSmithyDocumentSerde -} - -// Information about a terminated Client VPN endpoint client connection. -type TerminateConnectionStatus struct { - - // The ID of the client connection. - ConnectionId *string - - // A message about the status of the client connection, if applicable. - CurrentStatus *ClientVpnConnectionStatus - - // The state of the client connection. - PreviousStatus *ClientVpnConnectionStatus - - noSmithyDocumentSerde -} - -// Describes a through resource statement. -type ThroughResourcesStatement struct { - - // The resource statement. - ResourceStatement *ResourceStatement - - noSmithyDocumentSerde -} - -// Describes a through resource statement. -type ThroughResourcesStatementRequest struct { - - // The resource statement. - ResourceStatement *ResourceStatementRequest - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of total local storage, in GB. -type TotalLocalStorageGB struct { - - // The maximum amount of total local storage, in GB. If this parameter is not - // specified, there is no maximum limit. - Max *float64 - - // The minimum amount of total local storage, in GB. If this parameter is not - // specified, there is no minimum limit. - Min *float64 - - noSmithyDocumentSerde -} - -// The minimum and maximum amount of total local storage, in GB. -type TotalLocalStorageGBRequest struct { - - // The maximum amount of total local storage, in GB. To specify no maximum limit, - // omit this parameter. - Max *float64 - - // The minimum amount of total local storage, in GB. To specify no minimum limit, - // omit this parameter. - Min *float64 - - noSmithyDocumentSerde -} - -// Describes the Traffic Mirror filter. -type TrafficMirrorFilter struct { - - // The description of the Traffic Mirror filter. - Description *string - - // Information about the egress rules that are associated with the Traffic Mirror - // filter. - EgressFilterRules []TrafficMirrorFilterRule - - // Information about the ingress rules that are associated with the Traffic Mirror - // filter. - IngressFilterRules []TrafficMirrorFilterRule - - // The network service traffic that is associated with the Traffic Mirror filter. - NetworkServices []TrafficMirrorNetworkService - - // The tags assigned to the Traffic Mirror filter. - Tags []Tag - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterId *string - - noSmithyDocumentSerde -} - -// Describes the Traffic Mirror rule. -type TrafficMirrorFilterRule struct { - - // The description of the Traffic Mirror rule. - Description *string - - // The destination CIDR block assigned to the Traffic Mirror rule. - DestinationCidrBlock *string - - // The destination port range assigned to the Traffic Mirror rule. - DestinationPortRange *TrafficMirrorPortRange - - // The protocol assigned to the Traffic Mirror rule. - Protocol *int32 - - // The action assigned to the Traffic Mirror rule. - RuleAction TrafficMirrorRuleAction - - // The rule number of the Traffic Mirror rule. - RuleNumber *int32 - - // The source CIDR block assigned to the Traffic Mirror rule. - SourceCidrBlock *string - - // The source port range assigned to the Traffic Mirror rule. - SourcePortRange *TrafficMirrorPortRange - - // Tags on Traffic Mirroring filter rules. - Tags []Tag - - // The traffic direction assigned to the Traffic Mirror rule. - TrafficDirection TrafficDirection - - // The ID of the Traffic Mirror filter that the rule is associated with. - TrafficMirrorFilterId *string - - // The ID of the Traffic Mirror rule. - TrafficMirrorFilterRuleId *string - - noSmithyDocumentSerde -} - -// Describes the Traffic Mirror port range. -type TrafficMirrorPortRange struct { - - // The start of the Traffic Mirror port range. This applies to the TCP and UDP - // protocols. - FromPort *int32 - - // The end of the Traffic Mirror port range. This applies to the TCP and UDP - // protocols. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Information about the Traffic Mirror filter rule port range. -type TrafficMirrorPortRangeRequest struct { - - // The first port in the Traffic Mirror port range. This applies to the TCP and - // UDP protocols. - FromPort *int32 - - // The last port in the Traffic Mirror port range. This applies to the TCP and UDP - // protocols. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes a Traffic Mirror session. -type TrafficMirrorSession struct { - - // The description of the Traffic Mirror session. - Description *string - - // The ID of the Traffic Mirror session's network interface. - NetworkInterfaceId *string - - // The ID of the account that owns the Traffic Mirror session. - OwnerId *string - - // The number of bytes in each packet to mirror. These are the bytes after the - // VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. - // For example, if you set this value to 100, then the first 100 bytes that meet - // the filter criteria are copied to the target. Do not specify this parameter when - // you want to mirror the entire packet - PacketLength *int32 - - // The session number determines the order in which sessions are evaluated when an - // interface is used by multiple sessions. The first session with a matching filter - // is the one that mirrors the packets. - // - // Valid values are 1-32766. - SessionNumber *int32 - - // The tags assigned to the Traffic Mirror session. - Tags []Tag - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterId *string - - // The ID for the Traffic Mirror session. - TrafficMirrorSessionId *string - - // The ID of the Traffic Mirror target. - TrafficMirrorTargetId *string - - // The virtual network ID associated with the Traffic Mirror session. - VirtualNetworkId *int32 - - noSmithyDocumentSerde -} - -// Describes a Traffic Mirror target. -type TrafficMirrorTarget struct { - - // Information about the Traffic Mirror target. - Description *string - - // The ID of the Gateway Load Balancer endpoint. - GatewayLoadBalancerEndpointId *string - - // The network interface ID that is attached to the target. - NetworkInterfaceId *string - - // The Amazon Resource Name (ARN) of the Network Load Balancer. - NetworkLoadBalancerArn *string - - // The ID of the account that owns the Traffic Mirror target. - OwnerId *string - - // The tags assigned to the Traffic Mirror target. - Tags []Tag - - // The ID of the Traffic Mirror target. - TrafficMirrorTargetId *string - - // The type of Traffic Mirror target. - Type TrafficMirrorTargetType - - noSmithyDocumentSerde -} - -// Describes a transit gateway. -type TransitGateway struct { - - // The creation time. - CreationTime *time.Time - - // The description of the transit gateway. - Description *string - - // The transit gateway options. - Options *TransitGatewayOptions - - // The ID of the Amazon Web Services account that owns the transit gateway. - OwnerId *string - - // The state of the transit gateway. - State TransitGatewayState - - // The tags for the transit gateway. - Tags []Tag - - // The Amazon Resource Name (ARN) of the transit gateway. - TransitGatewayArn *string - - // The ID of the transit gateway. - TransitGatewayId *string - - noSmithyDocumentSerde -} - -// Describes an association between a resource attachment and a transit gateway -// route table. -type TransitGatewayAssociation struct { - - // The ID of the resource. - ResourceId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The state of the association. - State TransitGatewayAssociationState - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes an attachment between a resource and a transit gateway. -type TransitGatewayAttachment struct { - - // The association. - Association *TransitGatewayAttachmentAssociation - - // The creation time. - CreationTime *time.Time - - // The ID of the resource. - ResourceId *string - - // The ID of the Amazon Web Services account that owns the resource. - ResourceOwnerId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The attachment state. Note that the initiating state has been deprecated. - State TransitGatewayAttachmentState - - // The tags for the attachment. - Tags []Tag - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the Amazon Web Services account that owns the transit gateway. - TransitGatewayOwnerId *string - - noSmithyDocumentSerde -} - -// Describes an association. -type TransitGatewayAttachmentAssociation struct { - - // The state of the association. - State TransitGatewayAssociationState - - // The ID of the route table for the transit gateway. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// The BGP configuration information. -type TransitGatewayAttachmentBgpConfiguration struct { - - // The BGP status. - BgpStatus BgpStatus - - // The interior BGP peer IP address for the appliance. - PeerAddress *string - - // The peer Autonomous System Number (ASN). - PeerAsn *int64 - - // The interior BGP peer IP address for the transit gateway. - TransitGatewayAddress *string - - // The transit gateway Autonomous System Number (ASN). - TransitGatewayAsn *int64 - - noSmithyDocumentSerde -} - -// Describes a propagation route table. -type TransitGatewayAttachmentPropagation struct { - - // The state of the propagation route table. - State TransitGatewayPropagationState - - // The ID of the propagation route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway Connect attachment. -type TransitGatewayConnect struct { - - // The creation time. - CreationTime *time.Time - - // The Connect attachment options. - Options *TransitGatewayConnectOptions - - // The state of the attachment. - State TransitGatewayAttachmentState - - // The tags for the attachment. - Tags []Tag - - // The ID of the Connect attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the attachment from which the Connect attachment was created. - TransportTransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes the Connect attachment options. -type TransitGatewayConnectOptions struct { - - // The tunnel protocol. - Protocol ProtocolValue - - noSmithyDocumentSerde -} - -// Describes a transit gateway Connect peer. -type TransitGatewayConnectPeer struct { - - // The Connect peer details. - ConnectPeerConfiguration *TransitGatewayConnectPeerConfiguration - - // The creation time. - CreationTime *time.Time - - // The state of the Connect peer. - State TransitGatewayConnectPeerState - - // The tags for the Connect peer. - Tags []Tag - - // The ID of the Connect attachment. - TransitGatewayAttachmentId *string - - // The ID of the Connect peer. - TransitGatewayConnectPeerId *string - - noSmithyDocumentSerde -} - -// Describes the Connect peer details. -type TransitGatewayConnectPeerConfiguration struct { - - // The BGP configuration details. - BgpConfigurations []TransitGatewayAttachmentBgpConfiguration - - // The range of interior BGP peer IP addresses. - InsideCidrBlocks []string - - // The Connect peer IP address on the appliance side of the tunnel. - PeerAddress *string - - // The tunnel protocol. - Protocol ProtocolValue - - // The Connect peer IP address on the transit gateway side of the tunnel. - TransitGatewayAddress *string - - noSmithyDocumentSerde -} - -// The BGP options for the Connect attachment. -type TransitGatewayConnectRequestBgpOptions struct { - - // The peer Autonomous System Number (ASN). - PeerAsn *int64 - - noSmithyDocumentSerde -} - -// Describes the deregistered transit gateway multicast group members. -type TransitGatewayMulticastDeregisteredGroupMembers struct { - - // The network interface IDs of the deregistered members. - DeregisteredNetworkInterfaceIds []string - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the deregistered transit gateway multicast group sources. -type TransitGatewayMulticastDeregisteredGroupSources struct { - - // The network interface IDs of the non-registered members. - DeregisteredNetworkInterfaceIds []string - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the transit gateway multicast domain. -type TransitGatewayMulticastDomain struct { - - // The time the transit gateway multicast domain was created. - CreationTime *time.Time - - // The options for the transit gateway multicast domain. - Options *TransitGatewayMulticastDomainOptions - - // The ID of the Amazon Web Services account that owns the transit gateway - // multicast domain. - OwnerId *string - - // The state of the transit gateway multicast domain. - State TransitGatewayMulticastDomainState - - // The tags for the transit gateway multicast domain. - Tags []Tag - - // The ID of the transit gateway. - TransitGatewayId *string - - // The Amazon Resource Name (ARN) of the transit gateway multicast domain. - TransitGatewayMulticastDomainArn *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the resources associated with the transit gateway multicast domain. -type TransitGatewayMulticastDomainAssociation struct { - - // The ID of the resource. - ResourceId *string - - // The ID of the Amazon Web Services account that owns the transit gateway - // multicast domain association resource. - ResourceOwnerId *string - - // The type of resource, for example a VPC attachment. - ResourceType TransitGatewayAttachmentResourceType - - // The subnet associated with the transit gateway multicast domain. - Subnet *SubnetAssociation - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes the multicast domain associations. -type TransitGatewayMulticastDomainAssociations struct { - - // The ID of the resource. - ResourceId *string - - // The ID of the Amazon Web Services account that owns the resource. - ResourceOwnerId *string - - // The type of resource, for example a VPC attachment. - ResourceType TransitGatewayAttachmentResourceType - - // The subnets associated with the multicast domain. - Subnets []SubnetAssociation - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the options for a transit gateway multicast domain. -type TransitGatewayMulticastDomainOptions struct { - - // Indicates whether to automatically cross-account subnet associations that are - // associated with the transit gateway multicast domain. - AutoAcceptSharedAssociations AutoAcceptSharedAssociationsValue - - // Indicates whether Internet Group Management Protocol (IGMP) version 2 is turned - // on for the transit gateway multicast domain. - Igmpv2Support Igmpv2SupportValue - - // Indicates whether support for statically configuring transit gateway multicast - // group sources is turned on. - StaticSourcesSupport StaticSourcesSupportValue - - noSmithyDocumentSerde -} - -// Describes the transit gateway multicast group resources. -type TransitGatewayMulticastGroup struct { - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // Indicates that the resource is a transit gateway multicast group member. - GroupMember *bool - - // Indicates that the resource is a transit gateway multicast group member. - GroupSource *bool - - // The member type (for example, static ). - MemberType MembershipType - - // The ID of the transit gateway attachment. - NetworkInterfaceId *string - - // The ID of the resource. - ResourceId *string - - // The ID of the Amazon Web Services account that owns the transit gateway - // multicast domain group resource. - ResourceOwnerId *string - - // The type of resource, for example a VPC attachment. - ResourceType TransitGatewayAttachmentResourceType - - // The source type. - SourceType MembershipType - - // The ID of the subnet. - SubnetId *string - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes the registered transit gateway multicast group members. -type TransitGatewayMulticastRegisteredGroupMembers struct { - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The ID of the registered network interfaces. - RegisteredNetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the members registered with the transit gateway multicast group. -type TransitGatewayMulticastRegisteredGroupSources struct { - - // The IP address assigned to the transit gateway multicast group. - GroupIpAddress *string - - // The IDs of the network interfaces members registered with the transit gateway - // multicast group. - RegisteredNetworkInterfaceIds []string - - // The ID of the transit gateway multicast domain. - TransitGatewayMulticastDomainId *string - - noSmithyDocumentSerde -} - -// Describes the options for a transit gateway. -type TransitGatewayOptions struct { - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for - // 32-bit ASNs. - AmazonSideAsn *int64 - - // The ID of the default association route table. - AssociationDefaultRouteTableId *string - - // Indicates whether attachment requests are automatically accepted. - AutoAcceptSharedAttachments AutoAcceptSharedAttachmentsValue - - // Indicates whether resource attachments are automatically associated with the - // default association route table. Enabled by default. If - // defaultRouteTableAssociation is set to enable , Amazon Web Services Transit - // Gateway will create the default transit gateway route table. - DefaultRouteTableAssociation DefaultRouteTableAssociationValue - - // Indicates whether resource attachments automatically propagate routes to the - // default propagation route table. Enabled by default. If - // defaultRouteTablePropagation is set to enable , Amazon Web Services Transit - // Gateway will create the default transit gateway route table. - DefaultRouteTablePropagation DefaultRouteTablePropagationValue - - // Indicates whether DNS support is enabled. - DnsSupport DnsSupportValue - - // Indicates whether multicast is enabled on the transit gateway - MulticastSupport MulticastSupportValue - - // The ID of the default propagation route table. - PropagationDefaultRouteTableId *string - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is disabled by default. - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - // The transit gateway CIDR blocks. - TransitGatewayCidrBlocks []string - - // Indicates whether Equal Cost Multipath Protocol support is enabled. - VpnEcmpSupport VpnEcmpSupportValue - - noSmithyDocumentSerde -} - -// Describes the transit gateway peering attachment. -type TransitGatewayPeeringAttachment struct { - - // Information about the accepter transit gateway. - AccepterTgwInfo *PeeringTgwInfo - - // The ID of the accepter transit gateway attachment. - AccepterTransitGatewayAttachmentId *string - - // The time the transit gateway peering attachment was created. - CreationTime *time.Time - - // Details about the transit gateway peering attachment. - Options *TransitGatewayPeeringAttachmentOptions - - // Information about the requester transit gateway. - RequesterTgwInfo *PeeringTgwInfo - - // The state of the transit gateway peering attachment. Note that the initiating - // state has been deprecated. - State TransitGatewayAttachmentState - - // The status of the transit gateway peering attachment. - Status *PeeringAttachmentStatus - - // The tags for the transit gateway peering attachment. - Tags []Tag - - // The ID of the transit gateway peering attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes dynamic routing for the transit gateway peering attachment. -type TransitGatewayPeeringAttachmentOptions struct { - - // Describes whether dynamic routing is enabled or disabled for the transit - // gateway peering attachment. - DynamicRouting DynamicRoutingValue - - noSmithyDocumentSerde -} - -// Describes a rule associated with a transit gateway policy. -type TransitGatewayPolicyRule struct { - - // The destination CIDR block for the transit gateway policy rule. - DestinationCidrBlock *string - - // The port range for the transit gateway policy rule. Currently this is set to * - // (all). - DestinationPortRange *string - - // The meta data tags used for the transit gateway policy rule. - MetaData *TransitGatewayPolicyRuleMetaData - - // The protocol used by the transit gateway policy rule. - Protocol *string - - // The source CIDR block for the transit gateway policy rule. - SourceCidrBlock *string - - // The port range for the transit gateway policy rule. Currently this is set to * - // (all). - SourcePortRange *string - - noSmithyDocumentSerde -} - -// Describes the meta data tags associated with a transit gateway policy rule. -type TransitGatewayPolicyRuleMetaData struct { - - // The key name for the transit gateway policy rule meta data tag. - MetaDataKey *string - - // The value of the key for the transit gateway policy rule meta data tag. - MetaDataValue *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway policy table. -type TransitGatewayPolicyTable struct { - - // The timestamp when the transit gateway policy table was created. - CreationTime *time.Time - - // The state of the transit gateway policy table - State TransitGatewayPolicyTableState - - // he key-value pairs associated with the transit gateway policy table. - Tags []Tag - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the transit gateway policy table. - TransitGatewayPolicyTableId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway policy table association. -type TransitGatewayPolicyTableAssociation struct { - - // The resource ID of the transit gateway attachment. - ResourceId *string - - // The resource type for the transit gateway policy table association. - ResourceType TransitGatewayAttachmentResourceType - - // The state of the transit gateway policy table association. - State TransitGatewayAssociationState - - // The ID of the transit gateway attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway policy table. - TransitGatewayPolicyTableId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway policy table entry -type TransitGatewayPolicyTableEntry struct { - - // The policy rule associated with the transit gateway policy table. - PolicyRule *TransitGatewayPolicyRule - - // The rule number for the transit gateway policy table entry. - PolicyRuleNumber *string - - // The ID of the target route table. - TargetRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway prefix list attachment. -type TransitGatewayPrefixListAttachment struct { - - // The ID of the resource. - ResourceId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes a prefix list reference. -type TransitGatewayPrefixListReference struct { - - // Indicates whether traffic that matches this route is dropped. - Blackhole *bool - - // The ID of the prefix list. - PrefixListId *string - - // The ID of the prefix list owner. - PrefixListOwnerId *string - - // The state of the prefix list reference. - State TransitGatewayPrefixListReferenceState - - // Information about the transit gateway attachment. - TransitGatewayAttachment *TransitGatewayPrefixListAttachment - - // The ID of the transit gateway route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes route propagation. -type TransitGatewayPropagation struct { - - // The ID of the resource. - ResourceId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The state. - State TransitGatewayPropagationState - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - // The ID of the transit gateway route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes the options for a transit gateway. -type TransitGatewayRequestOptions struct { - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for - // 32-bit ASNs. The default is 64512 . - AmazonSideAsn *int64 - - // Enable or disable automatic acceptance of attachment requests. Disabled by - // default. - AutoAcceptSharedAttachments AutoAcceptSharedAttachmentsValue - - // Enable or disable automatic association with the default association route - // table. Enabled by default. - DefaultRouteTableAssociation DefaultRouteTableAssociationValue - - // Enable or disable automatic propagation of routes to the default propagation - // route table. Enabled by default. - DefaultRouteTablePropagation DefaultRouteTablePropagationValue - - // Enable or disable DNS support. Enabled by default. - DnsSupport DnsSupportValue - - // Indicates whether multicast is enabled on the transit gateway - MulticastSupport MulticastSupportValue - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is disabled by default. - // - // For more information about security group referencing, see [Security group referencing] in the Amazon Web - // Services Transit Gateways Guide. - // - // [Security group referencing]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - // One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size - // /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6. - TransitGatewayCidrBlocks []string - - // Enable or disable Equal Cost Multipath Protocol support. Enabled by default. - VpnEcmpSupport VpnEcmpSupportValue - - noSmithyDocumentSerde -} - -// Describes a route for a transit gateway route table. -type TransitGatewayRoute struct { - - // The CIDR block used for destination matches. - DestinationCidrBlock *string - - // The ID of the prefix list used for destination matches. - PrefixListId *string - - // The state of the route. - State TransitGatewayRouteState - - // The attachments. - TransitGatewayAttachments []TransitGatewayRouteAttachment - - // The ID of the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - // The route type. - Type TransitGatewayRouteType - - noSmithyDocumentSerde -} - -// Describes a route attachment. -type TransitGatewayRouteAttachment struct { - - // The ID of the resource. - ResourceId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway route table. -type TransitGatewayRouteTable struct { - - // The creation time. - CreationTime *time.Time - - // Indicates whether this is the default association route table for the transit - // gateway. - DefaultAssociationRouteTable *bool - - // Indicates whether this is the default propagation route table for the transit - // gateway. - DefaultPropagationRouteTable *bool - - // The state of the transit gateway route table. - State TransitGatewayRouteTableState - - // Any tags assigned to the route table. - Tags []Tag - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the transit gateway route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes a transit gateway route table announcement. -type TransitGatewayRouteTableAnnouncement struct { - - // The direction for the route table announcement. - AnnouncementDirection TransitGatewayRouteTableAnnouncementDirection - - // The ID of the core network for the transit gateway route table announcement. - CoreNetworkId *string - - // The timestamp when the transit gateway route table announcement was created. - CreationTime *time.Time - - // The ID of the core network ID for the peer. - PeerCoreNetworkId *string - - // The ID of the peer transit gateway. - PeerTransitGatewayId *string - - // The ID of the peering attachment. - PeeringAttachmentId *string - - // The state of the transit gateway announcement. - State TransitGatewayRouteTableAnnouncementState - - // The key-value pairs associated with the route table announcement. - Tags []Tag - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - // The ID of the transit gateway route table. - TransitGatewayRouteTableId *string - - noSmithyDocumentSerde -} - -// Describes an association between a route table and a resource attachment. -type TransitGatewayRouteTableAssociation struct { - - // The ID of the resource. - ResourceId *string - - // The resource type. Note that the tgw-peering resource type has been deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The state of the association. - State TransitGatewayAssociationState - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - noSmithyDocumentSerde -} - -// Describes a route table propagation. -type TransitGatewayRouteTablePropagation struct { - - // The ID of the resource. - ResourceId *string - - // The type of resource. Note that the tgw-peering resource type has been - // deprecated. - ResourceType TransitGatewayAttachmentResourceType - - // The state of the resource. - State TransitGatewayPropagationState - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway route table announcement. - TransitGatewayRouteTableAnnouncementId *string - - noSmithyDocumentSerde -} - -// Describes a route in a transit gateway route table. -type TransitGatewayRouteTableRoute struct { - - // The ID of the route attachment. - AttachmentId *string - - // The CIDR block used for destination matches. - DestinationCidr *string - - // The ID of the prefix list. - PrefixListId *string - - // The ID of the resource for the route attachment. - ResourceId *string - - // The resource type for the route attachment. - ResourceType *string - - // The route origin. The following are the possible values: - // - // - static - // - // - propagated - RouteOrigin *string - - // The state of the route. - State *string - - noSmithyDocumentSerde -} - -// Describes a VPC attachment. -type TransitGatewayVpcAttachment struct { - - // The creation time. - CreationTime *time.Time - - // The VPC attachment options. - Options *TransitGatewayVpcAttachmentOptions - - // The state of the VPC attachment. Note that the initiating state has been - // deprecated. - State TransitGatewayAttachmentState - - // The IDs of the subnets. - SubnetIds []string - - // The tags for the VPC attachment. - Tags []Tag - - // The ID of the attachment. - TransitGatewayAttachmentId *string - - // The ID of the transit gateway. - TransitGatewayId *string - - // The ID of the VPC. - VpcId *string - - // The ID of the Amazon Web Services account that owns the VPC. - VpcOwnerId *string - - noSmithyDocumentSerde -} - -// Describes the VPC attachment options. -type TransitGatewayVpcAttachmentOptions struct { - - // Indicates whether appliance mode support is enabled. - ApplianceModeSupport ApplianceModeSupportValue - - // Indicates whether DNS support is enabled. - DnsSupport DnsSupportValue - - // Indicates whether IPv6 support is disabled. - Ipv6Support Ipv6SupportValue - - // Enables you to reference a security group across VPCs attached to a transit - // gateway to simplify security group management. - // - // This option is enabled by default. - // - // For more information about security group referencing, see [Security group referencing] in the Amazon Web - // Services Transit Gateways Guide. - // - // [Security group referencing]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security - SecurityGroupReferencingSupport SecurityGroupReferencingSupportValue - - noSmithyDocumentSerde -} - -// Information about an association between a branch network interface with a -// trunk network interface. -type TrunkInterfaceAssociation struct { - - // The ID of the association. - AssociationId *string - - // The ID of the branch network interface. - BranchInterfaceId *string - - // The application key when you use the GRE protocol. - GreKey *int32 - - // The interface protocol. Valid values are VLAN and GRE . - InterfaceProtocol InterfaceProtocolType - - // The tags for the trunk interface association. - Tags []Tag - - // The ID of the trunk network interface. - TrunkInterfaceId *string - - // The ID of the VLAN when you use the VLAN protocol. - VlanId *int32 - - noSmithyDocumentSerde -} - -// The VPN tunnel options. -type TunnelOption struct { - - // The action to take after a DPD timeout occurs. - DpdTimeoutAction *string - - // The number of seconds after which a DPD timeout occurs. - DpdTimeoutSeconds *int32 - - // Status of tunnel endpoint lifecycle control feature. - EnableTunnelLifecycleControl *bool - - // The IKE versions that are permitted for the VPN tunnel. - IkeVersions []IKEVersionsListValue - - // Options for logging VPN tunnel activity. - LogOptions *VpnTunnelLogOptions - - // The external IP address of the VPN tunnel. - OutsideIpAddress *string - - // The permitted Diffie-Hellman group numbers for the VPN tunnel for phase 1 IKE - // negotiations. - Phase1DHGroupNumbers []Phase1DHGroupNumbersListValue - - // The permitted encryption algorithms for the VPN tunnel for phase 1 IKE - // negotiations. - Phase1EncryptionAlgorithms []Phase1EncryptionAlgorithmsListValue - - // The permitted integrity algorithms for the VPN tunnel for phase 1 IKE - // negotiations. - Phase1IntegrityAlgorithms []Phase1IntegrityAlgorithmsListValue - - // The lifetime for phase 1 of the IKE negotiation, in seconds. - Phase1LifetimeSeconds *int32 - - // The permitted Diffie-Hellman group numbers for the VPN tunnel for phase 2 IKE - // negotiations. - Phase2DHGroupNumbers []Phase2DHGroupNumbersListValue - - // The permitted encryption algorithms for the VPN tunnel for phase 2 IKE - // negotiations. - Phase2EncryptionAlgorithms []Phase2EncryptionAlgorithmsListValue - - // The permitted integrity algorithms for the VPN tunnel for phase 2 IKE - // negotiations. - Phase2IntegrityAlgorithms []Phase2IntegrityAlgorithmsListValue - - // The lifetime for phase 2 of the IKE negotiation, in seconds. - Phase2LifetimeSeconds *int32 - - // The pre-shared key (PSK) to establish initial authentication between the - // virtual private gateway and the customer gateway. - PreSharedKey *string - - // The percentage of the rekey window determined by RekeyMarginTimeSeconds during - // which the rekey time is randomly selected. - RekeyFuzzPercentage *int32 - - // The margin time, in seconds, before the phase 2 lifetime expires, during which - // the Amazon Web Services side of the VPN connection performs an IKE rekey. - RekeyMarginTimeSeconds *int32 - - // The number of packets in an IKE replay window. - ReplayWindowSize *int32 - - // The action to take when the establishing the VPN tunnels for a VPN connection. - StartupAction *string - - // The range of inside IPv4 addresses for the tunnel. - TunnelInsideCidr *string - - // The range of inside IPv6 addresses for the tunnel. - TunnelInsideIpv6Cidr *string - - noSmithyDocumentSerde -} - -// Describes the burstable performance instance whose credit option for CPU usage -// was not modified. -type UnsuccessfulInstanceCreditSpecificationItem struct { - - // The applicable error for the burstable performance instance whose credit option - // for CPU usage was not modified. - Error *UnsuccessfulInstanceCreditSpecificationItemError - - // The ID of the instance. - InstanceId *string - - noSmithyDocumentSerde -} - -// Information about the error for the burstable performance instance whose credit -// option for CPU usage was not modified. -type UnsuccessfulInstanceCreditSpecificationItemError struct { - - // The error code. - Code UnsuccessfulInstanceCreditSpecificationErrorCode - - // The applicable error message. - Message *string - - noSmithyDocumentSerde -} - -// Information about items that were not successfully processed in a batch call. -type UnsuccessfulItem struct { - - // Information about the error. - Error *UnsuccessfulItemError - - // The ID of the resource. - ResourceId *string - - noSmithyDocumentSerde -} - -// Information about the error that occurred. For more information about errors, -// see [Error codes]. -// -// [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html -type UnsuccessfulItemError struct { - - // The error code. - Code *string - - // The error message accompanying the error code. - Message *string - - noSmithyDocumentSerde -} - -// Describes the Amazon S3 bucket for the disk image. -type UserBucket struct { - - // The name of the Amazon S3 bucket where the disk image is located. - S3Bucket *string - - // The file name of the disk image. - S3Key *string - - noSmithyDocumentSerde -} - -// Describes the Amazon S3 bucket for the disk image. -type UserBucketDetails struct { - - // The Amazon S3 bucket from which the disk image was created. - S3Bucket *string - - // The file name of the disk image. - S3Key *string - - noSmithyDocumentSerde -} - -// Describes the user data for an instance. -type UserData struct { - - // The user data. If you are using an Amazon Web Services SDK or command line - // tool, Base64-encoding is performed for you, and you can load the text from a - // file. Otherwise, you must provide Base64-encoded text. - Data *string - - noSmithyDocumentSerde -} - -// Describes a security group and Amazon Web Services account ID pair. -type UserIdGroupPair struct { - - // A description for the security group rule that references this user ID group - // pair. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, - // 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string - - // The ID of the security group. - GroupId *string - - // [Default VPC] The name of the security group. For a security group in a - // nondefault VPC, use the security group ID. - // - // For a referenced security group in another VPC, this value is not returned if - // the referenced security group is deleted. - GroupName *string - - // The status of a VPC peering connection, if applicable. - PeeringStatus *string - - // The ID of an Amazon Web Services account. - // - // For a referenced security group in another VPC, the account ID of the - // referenced security group is returned in the response. If the referenced - // security group is deleted, this value is not returned. - UserId *string - - // The ID of the VPC for the referenced security group, if applicable. - VpcId *string - - // The ID of the VPC peering connection, if applicable. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// The error code and error message that is returned for a parameter or parameter -// combination that is not valid when a new launch template or new version of a -// launch template is created. -type ValidationError struct { - - // The error code that indicates why the parameter or parameter combination is not - // valid. For more information about error codes, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html - Code *string - - // The error message that describes why the parameter or parameter combination is - // not valid. For more information about error messages, see [Error codes]. - // - // [Error codes]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html - Message *string - - noSmithyDocumentSerde -} - -// The error codes and error messages that are returned for the parameters or -// parameter combinations that are not valid when a new launch template or new -// version of a launch template is created. -type ValidationWarning struct { - - // The error codes and error messages. - Errors []ValidationError - - noSmithyDocumentSerde -} - -// The minimum and maximum number of vCPUs. -type VCpuCountRange struct { - - // The maximum number of vCPUs. If this parameter is not specified, there is no - // maximum limit. - Max *int32 - - // The minimum number of vCPUs. If the value is 0 , there is no minimum limit. - Min *int32 - - noSmithyDocumentSerde -} - -// The minimum and maximum number of vCPUs. -type VCpuCountRangeRequest struct { - - // The minimum number of vCPUs. To specify no minimum limit, specify 0 . - // - // This member is required. - Min *int32 - - // The maximum number of vCPUs. To specify no maximum limit, omit this parameter. - Max *int32 - - noSmithyDocumentSerde -} - -// Describes the vCPU configurations for the instance type. -type VCpuInfo struct { - - // The default number of cores for the instance type. - DefaultCores *int32 - - // The default number of threads per core for the instance type. - DefaultThreadsPerCore *int32 - - // The default number of vCPUs for the instance type. - DefaultVCpus *int32 - - // The valid number of cores that can be configured for the instance type. - ValidCores []int32 - - // The valid number of threads per core that can be configured for the instance - // type. - ValidThreadsPerCore []int32 - - noSmithyDocumentSerde -} - -// An Amazon Web Services Verified Access endpoint specifies the application that -// Amazon Web Services Verified Access provides access to. It must be attached to -// an Amazon Web Services Verified Access group. An Amazon Web Services Verified -// Access endpoint must also have an attached access policy before you attached it -// to a group. -type VerifiedAccessEndpoint struct { - - // The DNS name for users to reach your application. - ApplicationDomain *string - - // The type of attachment used to provide connectivity between the Amazon Web - // Services Verified Access endpoint and the application. - AttachmentType VerifiedAccessEndpointAttachmentType - - // The options for a CIDR endpoint. - CidrOptions *VerifiedAccessEndpointCidrOptions - - // The creation time. - CreationTime *string - - // The deletion time. - DeletionTime *string - - // A description for the Amazon Web Services Verified Access endpoint. - Description *string - - // Returned if endpoint has a device trust provider attached. - DeviceValidationDomain *string - - // The ARN of a public TLS/SSL certificate imported into or created with ACM. - DomainCertificateArn *string - - // A DNS name that is generated for the endpoint. - EndpointDomain *string - - // The type of Amazon Web Services Verified Access endpoint. Incoming application - // requests will be sent to an IP address, load balancer or a network interface - // depending on the endpoint type specified. - EndpointType VerifiedAccessEndpointType - - // The last updated time. - LastUpdatedTime *string - - // The load balancer details if creating the Amazon Web Services Verified Access - // endpoint as load-balancer type. - LoadBalancerOptions *VerifiedAccessEndpointLoadBalancerOptions - - // The options for network-interface type endpoint. - NetworkInterfaceOptions *VerifiedAccessEndpointEniOptions - - // The options for an RDS endpoint. - RdsOptions *VerifiedAccessEndpointRdsOptions - - // The IDs of the security groups for the endpoint. - SecurityGroupIds []string - - // The options in use for server side encryption. - SseSpecification *VerifiedAccessSseSpecificationResponse - - // The endpoint status. - Status *VerifiedAccessEndpointStatus - - // The tags. - Tags []Tag - - // The ID of the Amazon Web Services Verified Access endpoint. - VerifiedAccessEndpointId *string - - // The ID of the Amazon Web Services Verified Access group. - VerifiedAccessGroupId *string - - // The ID of the Amazon Web Services Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -// Describes the CIDR options for a Verified Access endpoint. -type VerifiedAccessEndpointCidrOptions struct { - - // The CIDR. - Cidr *string - - // The port ranges. - PortRanges []VerifiedAccessEndpointPortRange - - // The protocol. - Protocol VerifiedAccessEndpointProtocol - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Options for a network-interface type endpoint. -type VerifiedAccessEndpointEniOptions struct { - - // The ID of the network interface. - NetworkInterfaceId *string - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []VerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - noSmithyDocumentSerde -} - -// Describes a load balancer when creating an Amazon Web Services Verified Access -// endpoint using the load-balancer type. -type VerifiedAccessEndpointLoadBalancerOptions struct { - - // The ARN of the load balancer. - LoadBalancerArn *string - - // The IP port number. - Port *int32 - - // The port ranges. - PortRanges []VerifiedAccessEndpointPortRange - - // The IP protocol. - Protocol VerifiedAccessEndpointProtocol - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes a port range. -type VerifiedAccessEndpointPortRange struct { - - // The start of the port range. - FromPort *int32 - - // The end of the port range. - ToPort *int32 - - noSmithyDocumentSerde -} - -// Describes the RDS options for a Verified Access endpoint. -type VerifiedAccessEndpointRdsOptions struct { - - // The port. - Port *int32 - - // The protocol. - Protocol VerifiedAccessEndpointProtocol - - // The ARN of the DB cluster. - RdsDbClusterArn *string - - // The ARN of the RDS instance. - RdsDbInstanceArn *string - - // The ARN of the RDS proxy. - RdsDbProxyArn *string - - // The RDS endpoint. - RdsEndpoint *string - - // The IDs of the subnets. - SubnetIds []string - - noSmithyDocumentSerde -} - -// Describes the status of a Verified Access endpoint. -type VerifiedAccessEndpointStatus struct { - - // The status code of the Verified Access endpoint. - Code VerifiedAccessEndpointStatusCode - - // The status message of the Verified Access endpoint. - Message *string - - noSmithyDocumentSerde -} - -// Describes the targets for the specified Verified Access endpoint. -type VerifiedAccessEndpointTarget struct { - - // The ID of the Verified Access endpoint. - VerifiedAccessEndpointId *string - - // The DNS name of the target. - VerifiedAccessEndpointTargetDns *string - - // The IP address of the target. - VerifiedAccessEndpointTargetIpAddress *string - - noSmithyDocumentSerde -} - -// Describes a Verified Access group. -type VerifiedAccessGroup struct { - - // The creation time. - CreationTime *string - - // The deletion time. - DeletionTime *string - - // A description for the Amazon Web Services Verified Access group. - Description *string - - // The last updated time. - LastUpdatedTime *string - - // The Amazon Web Services account number that owns the group. - Owner *string - - // The options in use for server side encryption. - SseSpecification *VerifiedAccessSseSpecificationResponse - - // The tags. - Tags []Tag - - // The ARN of the Verified Access group. - VerifiedAccessGroupArn *string - - // The ID of the Verified Access group. - VerifiedAccessGroupId *string - - // The ID of the Amazon Web Services Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -// Describes a Verified Access instance. -type VerifiedAccessInstance struct { - - // The custom subdomain. - CidrEndpointsCustomSubDomain *VerifiedAccessInstanceCustomSubDomain - - // The creation time. - CreationTime *string - - // A description for the Amazon Web Services Verified Access instance. - Description *string - - // Indicates whether support for Federal Information Processing Standards (FIPS) - // is enabled on the instance. - FipsEnabled *bool - - // The last updated time. - LastUpdatedTime *string - - // The tags. - Tags []Tag - - // The ID of the Amazon Web Services Verified Access instance. - VerifiedAccessInstanceId *string - - // The IDs of the Amazon Web Services Verified Access trust providers. - VerifiedAccessTrustProviders []VerifiedAccessTrustProviderCondensed - - noSmithyDocumentSerde -} - -// Describes a custom subdomain for a network CIDR endpoint for Verified Access. -type VerifiedAccessInstanceCustomSubDomain struct { - - // The name servers. - Nameservers []string - - // The subdomain. - SubDomain *string - - noSmithyDocumentSerde -} - -// Describes logging options for an Amazon Web Services Verified Access instance. -type VerifiedAccessInstanceLoggingConfiguration struct { - - // Details about the logging options. - AccessLogs *VerifiedAccessLogs - - // The ID of the Amazon Web Services Verified Access instance. - VerifiedAccessInstanceId *string - - noSmithyDocumentSerde -} - -// Describes a set of routes. -type VerifiedAccessInstanceOpenVpnClientConfiguration struct { - - // The base64-encoded Open VPN client configuration. - Config *string - - // The routes. - Routes []VerifiedAccessInstanceOpenVpnClientConfigurationRoute - - noSmithyDocumentSerde -} - -// Describes a route. -type VerifiedAccessInstanceOpenVpnClientConfigurationRoute struct { - - // The CIDR block. - Cidr *string - - noSmithyDocumentSerde -} - -// Describes the trust provider. -type VerifiedAccessInstanceUserTrustProviderClientConfiguration struct { - - // The authorization endpoint of the IdP. - AuthorizationEndpoint *string - - // The OAuth 2.0 client identifier. - ClientId *string - - // The OAuth 2.0 client secret. - ClientSecret *string - - // The OIDC issuer identifier of the IdP. - Issuer *string - - // Indicates whether Proof of Key Code Exchange (PKCE) is enabled. - PkceEnabled *bool - - // The public signing key endpoint. - PublicSigningKeyEndpoint *string - - // The set of user claims to be requested from the IdP. - Scopes *string - - // The token endpoint of the IdP. - TokenEndpoint *string - - // The trust provider type. - Type UserTrustProviderType - - // The user info endpoint of the IdP. - UserInfoEndpoint *string - - noSmithyDocumentSerde -} - -// Options for CloudWatch Logs as a logging destination. -type VerifiedAccessLogCloudWatchLogsDestination struct { - - // The delivery status for access logs. - DeliveryStatus *VerifiedAccessLogDeliveryStatus - - // Indicates whether logging is enabled. - Enabled *bool - - // The ID of the CloudWatch Logs log group. - LogGroup *string - - noSmithyDocumentSerde -} - -// Options for CloudWatch Logs as a logging destination. -type VerifiedAccessLogCloudWatchLogsDestinationOptions struct { - - // Indicates whether logging is enabled. - // - // This member is required. - Enabled *bool - - // The ID of the CloudWatch Logs log group. - LogGroup *string - - noSmithyDocumentSerde -} - -// Describes a log delivery status. -type VerifiedAccessLogDeliveryStatus struct { - - // The status code. - Code VerifiedAccessLogDeliveryStatusCode - - // The status message. - Message *string - - noSmithyDocumentSerde -} - -// Options for Kinesis as a logging destination. -type VerifiedAccessLogKinesisDataFirehoseDestination struct { - - // The delivery status. - DeliveryStatus *VerifiedAccessLogDeliveryStatus - - // The ID of the delivery stream. - DeliveryStream *string - - // Indicates whether logging is enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -// Describes Amazon Kinesis Data Firehose logging options. -type VerifiedAccessLogKinesisDataFirehoseDestinationOptions struct { - - // Indicates whether logging is enabled. - // - // This member is required. - Enabled *bool - - // The ID of the delivery stream. - DeliveryStream *string - - noSmithyDocumentSerde -} - -// Options for Verified Access logs. -type VerifiedAccessLogOptions struct { - - // Sends Verified Access logs to CloudWatch Logs. - CloudWatchLogs *VerifiedAccessLogCloudWatchLogsDestinationOptions - - // Indicates whether to include trust data sent by trust providers in the logs. - IncludeTrustContext *bool - - // Sends Verified Access logs to Kinesis. - KinesisDataFirehose *VerifiedAccessLogKinesisDataFirehoseDestinationOptions - - // The logging version. - // - // Valid values: ocsf-0.1 | ocsf-1.0.0-rc.2 - LogVersion *string - - // Sends Verified Access logs to Amazon S3. - S3 *VerifiedAccessLogS3DestinationOptions - - noSmithyDocumentSerde -} - -// Describes the options for Verified Access logs. -type VerifiedAccessLogs struct { - - // CloudWatch Logs logging destination. - CloudWatchLogs *VerifiedAccessLogCloudWatchLogsDestination - - // Indicates whether trust data is included in the logs. - IncludeTrustContext *bool - - // Kinesis logging destination. - KinesisDataFirehose *VerifiedAccessLogKinesisDataFirehoseDestination - - // The log version. - LogVersion *string - - // Amazon S3 logging options. - S3 *VerifiedAccessLogS3Destination - - noSmithyDocumentSerde -} - -// Options for Amazon S3 as a logging destination. -type VerifiedAccessLogS3Destination struct { - - // The bucket name. - BucketName *string - - // The Amazon Web Services account number that owns the bucket. - BucketOwner *string - - // The delivery status. - DeliveryStatus *VerifiedAccessLogDeliveryStatus - - // Indicates whether logging is enabled. - Enabled *bool - - // The bucket prefix. - Prefix *string - - noSmithyDocumentSerde -} - -// Options for Amazon S3 as a logging destination. -type VerifiedAccessLogS3DestinationOptions struct { - - // Indicates whether logging is enabled. - // - // This member is required. - Enabled *bool - - // The bucket name. - BucketName *string - - // The ID of the Amazon Web Services account that owns the Amazon S3 bucket. - BucketOwner *string - - // The bucket prefix. - Prefix *string - - noSmithyDocumentSerde -} - -// Verified Access provides server side encryption by default to data at rest -// -// using Amazon Web Services-owned KMS keys. You also have the option of using -// customer managed KMS keys, which can be specified using the options below. -type VerifiedAccessSseSpecificationRequest struct { - - // Enable or disable the use of customer managed KMS keys for server side - // encryption. - // - // Valid values: True | False - CustomerManagedKeyEnabled *bool - - // The ARN of the KMS key. - KmsKeyArn *string - - noSmithyDocumentSerde -} - -// The options in use for server side encryption. -type VerifiedAccessSseSpecificationResponse struct { - - // Indicates whether customer managed KMS keys are in use for server side - // encryption. - // - // Valid values: True | False - CustomerManagedKeyEnabled *bool - - // The ARN of the KMS key. - KmsKeyArn *string - - noSmithyDocumentSerde -} - -// Describes a Verified Access trust provider. -type VerifiedAccessTrustProvider struct { - - // The creation time. - CreationTime *string - - // A description for the Amazon Web Services Verified Access trust provider. - Description *string - - // The options for device-identity trust provider. - DeviceOptions *DeviceOptions - - // The type of device-based trust provider. - DeviceTrustProviderType DeviceTrustProviderType - - // The last updated time. - LastUpdatedTime *string - - // The OpenID Connect (OIDC) options. - NativeApplicationOidcOptions *NativeApplicationOidcOptions - - // The options for an OpenID Connect-compatible user-identity trust provider. - OidcOptions *OidcOptions - - // The identifier to be used when working with policy rules. - PolicyReferenceName *string - - // The options in use for server side encryption. - SseSpecification *VerifiedAccessSseSpecificationResponse - - // The tags. - Tags []Tag - - // The type of Verified Access trust provider. - TrustProviderType TrustProviderType - - // The type of user-based trust provider. - UserTrustProviderType UserTrustProviderType - - // The ID of the Amazon Web Services Verified Access trust provider. - VerifiedAccessTrustProviderId *string - - noSmithyDocumentSerde -} - -// Condensed information about a trust provider. -type VerifiedAccessTrustProviderCondensed struct { - - // The description of trust provider. - Description *string - - // The type of device-based trust provider. - DeviceTrustProviderType DeviceTrustProviderType - - // The type of trust provider (user- or device-based). - TrustProviderType TrustProviderType - - // The type of user-based trust provider. - UserTrustProviderType UserTrustProviderType - - // The ID of the trust provider. - VerifiedAccessTrustProviderId *string - - noSmithyDocumentSerde -} - -// Describes telemetry for a VPN tunnel. -type VgwTelemetry struct { - - // The number of accepted routes. - AcceptedRouteCount *int32 - - // The Amazon Resource Name (ARN) of the VPN tunnel endpoint certificate. - CertificateArn *string - - // The date and time of the last change in status. This field is updated when - // changes in IKE (Phase 1), IPSec (Phase 2), or BGP status are detected. - LastStatusChange *time.Time - - // The Internet-routable IP address of the virtual private gateway's outside - // interface. - OutsideIpAddress *string - - // The status of the VPN tunnel. - Status TelemetryStatus - - // If an error occurs, a description of the error. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Describes a volume. -type Volume struct { - - // This parameter is not returned by CreateVolume. - // - // Information about the volume attachments. - Attachments []VolumeAttachment - - // The Availability Zone for the volume. - AvailabilityZone *string - - // The time stamp when volume creation was initiated. - CreateTime *time.Time - - // Indicates whether the volume is encrypted. - Encrypted *bool - - // This parameter is not returned by CreateVolume. - // - // Indicates whether the volume was created using fast snapshot restore. - FastRestored *bool - - // The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 - // volumes, this represents the number of IOPS that are provisioned for the volume. - // For gp2 volumes, this represents the baseline performance of the volume and the - // rate at which the volume accumulates I/O credits for bursting. - Iops *int32 - - // The Amazon Resource Name (ARN) of the KMS key that was used to protect the - // volume encryption key for the volume. - KmsKeyId *string - - // Indicates whether Amazon EBS Multi-Attach is enabled. - MultiAttachEnabled *bool - - // The service provider that manages the volume. - Operator *OperatorResponse - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The size of the volume, in GiBs. - Size *int32 - - // The snapshot from which the volume was created, if applicable. - SnapshotId *string - - // This parameter is not returned by CreateVolume. - // - // Reserved for future use. - SseType SSEType - - // The volume state. - State VolumeState - - // Any tags assigned to the volume. - Tags []Tag - - // The throughput that the volume supports, in MiB/s. - Throughput *int32 - - // The ID of the volume. - VolumeId *string - - // The Amazon EBS Provisioned Rate for Volume Initialization (volume - // initialization rate) specified for the volume during creation, in MiB/s. If no - // volume initialization rate was specified, the value is null . - VolumeInitializationRate *int32 - - // The volume type. - VolumeType VolumeType - - noSmithyDocumentSerde -} - -// Describes volume attachment details. -type VolumeAttachment struct { - - // The ARN of the Amazon Web Services-managed resource to which the volume is - // attached. - AssociatedResource *string - - // The time stamp when the attachment initiated. - AttachTime *time.Time - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool - - // The device name. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - Device *string - - // The ID of the instance. - // - // If the volume is attached to an Amazon Web Services-managed resource, this - // parameter returns null . - InstanceId *string - - // The service principal of the Amazon Web Services service that owns the - // underlying resource to which the volume is attached. - // - // This parameter is returned only for volumes that are attached to Amazon Web - // Services-managed resources. - InstanceOwningService *string - - // The attachment state of the volume. - State VolumeAttachmentState - - // The ID of the volume. - VolumeId *string - - noSmithyDocumentSerde -} - -// Describes an EBS volume. -type VolumeDetail struct { - - // The size of the volume, in GiB. - // - // This member is required. - Size *int64 - - noSmithyDocumentSerde -} - -// Describes the modification status of an EBS volume. -type VolumeModification struct { - - // The modification completion or failure time. - EndTime *time.Time - - // The current modification state. - ModificationState VolumeModificationState - - // The original IOPS rate of the volume. - OriginalIops *int32 - - // The original setting for Amazon EBS Multi-Attach. - OriginalMultiAttachEnabled *bool - - // The original size of the volume, in GiB. - OriginalSize *int32 - - // The original throughput of the volume, in MiB/s. - OriginalThroughput *int32 - - // The original EBS volume type of the volume. - OriginalVolumeType VolumeType - - // The modification progress, from 0 to 100 percent complete. - Progress *int64 - - // The modification start time. - StartTime *time.Time - - // A status message about the modification progress or failure. - StatusMessage *string - - // The target IOPS rate of the volume. - TargetIops *int32 - - // The target setting for Amazon EBS Multi-Attach. - TargetMultiAttachEnabled *bool - - // The target size of the volume, in GiB. - TargetSize *int32 - - // The target throughput of the volume, in MiB/s. - TargetThroughput *int32 - - // The target EBS volume type of the volume. - TargetVolumeType VolumeType - - // The ID of the volume. - VolumeId *string - - noSmithyDocumentSerde -} - -// Describes a volume status operation code. -type VolumeStatusAction struct { - - // The code identifying the operation, for example, enable-volume-io . - Code *string - - // A description of the operation. - Description *string - - // The ID of the event associated with this operation. - EventId *string - - // The event type associated with this operation. - EventType *string - - noSmithyDocumentSerde -} - -// Information about the instances to which the volume is attached. -type VolumeStatusAttachmentStatus struct { - - // The ID of the attached instance. - InstanceId *string - - // The maximum IOPS supported by the attached instance. - IoPerformance *string - - noSmithyDocumentSerde -} - -// Describes a volume status. -type VolumeStatusDetails struct { - - // The name of the volume status. - // - // - io-enabled - Indicates the volume I/O status. For more information, see [Amazon EBS volume status checks]. - // - // - io-performance - Indicates the volume performance status. For more - // information, see [Amazon EBS volume status checks]. - // - // - initialization-state - Indicates the status of the volume initialization - // process. For more information, see [Initialize Amazon EBS volumes]. - // - // [Amazon EBS volume status checks]: https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-checks.html - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - Name VolumeStatusName - - // The intended status of the volume status. - Status *string - - noSmithyDocumentSerde -} - -// Describes a volume status event. -type VolumeStatusEvent struct { - - // A description of the event. - Description *string - - // The ID of this event. - EventId *string - - // The type of this event. - EventType *string - - // The ID of the instance associated with the event. - InstanceId *string - - // The latest end time of the event. - NotAfter *time.Time - - // The earliest start time of the event. - NotBefore *time.Time - - noSmithyDocumentSerde -} - -// Describes the status of a volume. -type VolumeStatusInfo struct { - - // The details of the volume status. - Details []VolumeStatusDetails - - // The status of the volume. - Status VolumeStatusInfoStatus - - noSmithyDocumentSerde -} - -// Describes the volume status. -type VolumeStatusItem struct { - - // The details of the operation. - Actions []VolumeStatusAction - - // Information about the instances to which the volume is attached. - AttachmentStatuses []VolumeStatusAttachmentStatus - - // The Availability Zone of the volume. - AvailabilityZone *string - - // The ID of the Availability Zone. - AvailabilityZoneId *string - - // A list of events associated with the volume. - Events []VolumeStatusEvent - - // Information about the volume initialization. It can take up to 5 minutes for - // the volume initialization information to be updated. - // - // Only available for volumes created from snapshots. Not available for empty - // volumes created without a snapshot. - // - // For more information, see [Initialize Amazon EBS volumes]. - // - // [Initialize Amazon EBS volumes]: https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html - InitializationStatusDetails *InitializationStatusDetails - - // The Amazon Resource Name (ARN) of the Outpost. - OutpostArn *string - - // The volume ID. - VolumeId *string - - // The volume status. - VolumeStatus *VolumeStatusInfo - - noSmithyDocumentSerde -} - -// Describes a VPC. -type Vpc struct { - - // The state of VPC Block Public Access (BPA). - BlockPublicAccessStates *BlockPublicAccessStates - - // The primary IPv4 CIDR block for the VPC. - CidrBlock *string - - // Information about the IPv4 CIDR blocks associated with the VPC. - CidrBlockAssociationSet []VpcCidrBlockAssociation - - // The ID of the set of DHCP options you've associated with the VPC. - DhcpOptionsId *string - - EncryptionControl *VpcEncryptionControl - - // The allowed tenancy of instances launched into the VPC. - InstanceTenancy Tenancy - - // Information about the IPv6 CIDR blocks associated with the VPC. - Ipv6CidrBlockAssociationSet []VpcIpv6CidrBlockAssociation - - // Indicates whether the VPC is the default VPC. - IsDefault *bool - - // The ID of the Amazon Web Services account that owns the VPC. - OwnerId *string - - // The current state of the VPC. - State VpcState - - // Any tags assigned to the VPC. - Tags []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes an attachment between a virtual private gateway and a VPC. -type VpcAttachment struct { - - // The current state of the attachment. - State AttachmentStatus - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// A VPC BPA exclusion is a mode that can be applied to a single VPC or subnet -// that exempts it from the account’s BPA mode and will allow bidirectional or -// egress-only access. You can create BPA exclusions for VPCs and subnets even when -// BPA is not enabled on the account to ensure that there is no traffic disruption -// to the exclusions when VPC BPA is turned on. To learn more about VPC BPA, see [Block public access to VPCs and subnets] -// in the Amazon VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -type VpcBlockPublicAccessExclusion struct { - - // When the exclusion was created. - CreationTimestamp *time.Time - - // When the exclusion was deleted. - DeletionTimestamp *time.Time - - // The ID of the exclusion. - ExclusionId *string - - // The exclusion mode for internet gateway traffic. - // - // - allow-bidirectional : Allow all internet traffic to and from the excluded - // VPCs and subnets. - // - // - allow-egress : Allow outbound internet traffic from the excluded VPCs and - // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only - // applies when VPC Block Public Access is set to Bidirectional. - InternetGatewayExclusionMode InternetGatewayExclusionMode - - // When the exclusion was last updated. - LastUpdateTimestamp *time.Time - - // The reason for the current exclusion state. - Reason *string - - // The ARN of the exclusion. - ResourceArn *string - - // The state of the exclusion. - State VpcBlockPublicAccessExclusionState - - // tag - The key/value combination of a tag assigned to the resource. Use the tag - // key in the filter name and the tag value as the filter value. For example, to - // find all resources that have a tag with the key Owner and the value TeamA , - // specify tag:Owner for the filter name and TeamA for the filter value. - Tags []Tag - - noSmithyDocumentSerde -} - -// VPC Block Public Access (BPA) enables you to block resources in VPCs and -// subnets that you own in a Region from reaching or being reached from the -// internet through internet gateways and egress-only internet gateways. To learn -// more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon VPC User Guide. -// -// [Block public access to VPCs and subnets]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html -type VpcBlockPublicAccessOptions struct { - - // An Amazon Web Services account ID. - AwsAccountId *string - - // An Amazon Web Services Region. - AwsRegion *string - - // Determines if exclusions are allowed. If you have [enabled VPC BPA at the Organization level], exclusions may be - // not-allowed . Otherwise, they are allowed . - // - // [enabled VPC BPA at the Organization level]: https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html#security-vpc-bpa-exclusions-orgs - ExclusionsAllowed VpcBlockPublicAccessExclusionsAllowed - - // The current mode of VPC BPA. - // - // - off : VPC BPA is not enabled and traffic is allowed to and from internet - // gateways and egress-only internet gateways in this Region. - // - // - block-bidirectional : Block all traffic to and from internet gateways and - // egress-only internet gateways in this Region (except for excluded VPCs and - // subnets). - // - // - block-ingress : Block all internet traffic to the VPCs in this Region - // (except for VPCs or subnets which are excluded). Only traffic to and from NAT - // gateways and egress-only internet gateways is allowed because these gateways - // only allow outbound connections to be established. - InternetGatewayBlockMode InternetGatewayBlockMode - - // The last time the VPC BPA mode was updated. - LastUpdateTimestamp *time.Time - - // The entity that manages the state of VPC BPA. Possible values include: - // - // - account - The state is managed by the account. - // - // - declarative-policy - The state is managed by a declarative policy and can't - // be modified by the account. - ManagedBy ManagedBy - - // The reason for the current state. - Reason *string - - // The current state of VPC BPA. - State VpcBlockPublicAccessState - - noSmithyDocumentSerde -} - -// Describes an IPv4 CIDR block associated with a VPC. -type VpcCidrBlockAssociation struct { - - // The association ID for the IPv4 CIDR block. - AssociationId *string - - // The IPv4 CIDR block. - CidrBlock *string - - // Information about the state of the CIDR block. - CidrBlockState *VpcCidrBlockState - - noSmithyDocumentSerde -} - -// Describes the state of a CIDR block. -type VpcCidrBlockState struct { - - // The state of the CIDR block. - State VpcCidrBlockStateCode - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string - - noSmithyDocumentSerde -} - -// Deprecated. -// -// Describes whether a VPC is enabled for ClassicLink. -type VpcClassicLink struct { - - // Indicates whether the VPC is enabled for ClassicLink. - ClassicLinkEnabled *bool - - // Any tags assigned to the VPC. - Tags []Tag - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -type VpcEncryptionControl struct { - Mode VpcEncryptionControlMode - - ResourceExclusions *VpcEncryptionControlExclusions - - State VpcEncryptionControlState - - StateMessage *string - - Tags []Tag - - VpcEncryptionControlId *string - - VpcId *string - - noSmithyDocumentSerde -} - -type VpcEncryptionControlExclusion struct { - State VpcEncryptionControlExclusionState - - StateMessage *string - - noSmithyDocumentSerde -} - -type VpcEncryptionControlExclusions struct { - EgressOnlyInternetGateway *VpcEncryptionControlExclusion - - InternetGateway *VpcEncryptionControlExclusion - - NatGateway *VpcEncryptionControlExclusion - - VirtualPrivateGateway *VpcEncryptionControlExclusion - - VpcPeering *VpcEncryptionControlExclusion - - noSmithyDocumentSerde -} - -// Describes a VPC endpoint. -type VpcEndpoint struct { - - // The date and time that the endpoint was created. - CreationTimestamp *time.Time - - // (Interface endpoint) The DNS entries for the endpoint. - DnsEntries []DnsEntry - - // The DNS options for the endpoint. - DnsOptions *DnsOptions - - // Reason for the failure. - FailureReason *string - - // (Interface endpoint) Information about the security groups that are associated - // with the network interface. - Groups []SecurityGroupIdentifier - - // The IP address type for the endpoint. - IpAddressType IpAddressType - - // Array of IPv4 prefixes. - Ipv4Prefixes []SubnetIpPrefixes - - // Array of IPv6 prefixes. - Ipv6Prefixes []SubnetIpPrefixes - - // The last error that occurred for endpoint. - LastError *LastError - - // (Interface endpoint) The network interfaces for the endpoint. - NetworkInterfaceIds []string - - // The ID of the Amazon Web Services account that owns the endpoint. - OwnerId *string - - // The policy document associated with the endpoint, if applicable. - PolicyDocument *string - - // (Interface endpoint) Indicates whether the VPC is associated with a private - // hosted zone. - PrivateDnsEnabled *bool - - // Indicates whether the endpoint is being managed by its service. - RequesterManaged *bool - - // The Amazon Resource Name (ARN) of the resource configuration. - ResourceConfigurationArn *string - - // (Gateway endpoint) The IDs of the route tables associated with the endpoint. - RouteTableIds []string - - // The name of the service to which the endpoint is associated. - ServiceName *string - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string - - // The Region where the service is hosted. - ServiceRegion *string - - // The state of the endpoint. - State State - - // (Interface endpoint) The subnets for the endpoint. - SubnetIds []string - - // The tags assigned to the endpoint. - Tags []Tag - - // The ID of the endpoint. - VpcEndpointId *string - - // The type of endpoint. - VpcEndpointType VpcEndpointType - - // The ID of the VPC to which the endpoint is associated. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes the VPC resources, VPC endpoint services, Lattice services, or -// service networks associated with the VPC endpoint. -type VpcEndpointAssociation struct { - - // The connectivity status of the resources associated to a VPC endpoint. The - // resource is accessible if the associated resource configuration is AVAILABLE , - // otherwise the resource is inaccessible. - AssociatedResourceAccessibility *string - - // The Amazon Resource Name (ARN) of the associated resource. - AssociatedResourceArn *string - - // The DNS entry of the VPC endpoint association. - DnsEntry *DnsEntry - - // An error code related to why an VPC endpoint association failed. - FailureCode *string - - // A message related to why an VPC endpoint association failed. - FailureReason *string - - // The ID of the VPC endpoint association. - Id *string - - // The private DNS entry of the VPC endpoint association. - PrivateDnsEntry *DnsEntry - - // The Amazon Resource Name (ARN) of the resource configuration group. - ResourceConfigurationGroupArn *string - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string - - // The name of the service network. - ServiceNetworkName *string - - // The tags to apply to the VPC endpoint association. - Tags []Tag - - // The ID of the VPC endpoint. - VpcEndpointId *string - - noSmithyDocumentSerde -} - -// Describes a VPC endpoint connection to a service. -type VpcEndpointConnection struct { - - // The date and time that the VPC endpoint was created. - CreationTimestamp *time.Time - - // The DNS entries for the VPC endpoint. - DnsEntries []DnsEntry - - // The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service. - GatewayLoadBalancerArns []string - - // The IP address type for the endpoint. - IpAddressType IpAddressType - - // The Amazon Resource Names (ARNs) of the network load balancers for the service. - NetworkLoadBalancerArns []string - - // The ID of the service to which the endpoint is connected. - ServiceId *string - - // The tags. - Tags []Tag - - // The ID of the VPC endpoint connection. - VpcEndpointConnectionId *string - - // The ID of the VPC endpoint. - VpcEndpointId *string - - // The ID of the Amazon Web Services account that owns the VPC endpoint. - VpcEndpointOwner *string - - // The Region of the endpoint. - VpcEndpointRegion *string - - // The state of the VPC endpoint. - VpcEndpointState State - - noSmithyDocumentSerde -} - -// Describes an IPv6 CIDR block associated with a VPC. -type VpcIpv6CidrBlockAssociation struct { - - // The association ID for the IPv6 CIDR block. - AssociationId *string - - // The source that allocated the IP address space. byoip or amazon indicates - // public IP address space allocated by Amazon or space that you have allocated - // with Bring your own IP (BYOIP). none indicates private space. - IpSource IpSource - - // Public IPv6 addresses are those advertised on the internet from Amazon Web - // Services. Private IP addresses are not and cannot be advertised on the internet - // from Amazon Web Services. - Ipv6AddressAttribute Ipv6AddressAttribute - - // The IPv6 CIDR block. - Ipv6CidrBlock *string - - // Information about the state of the CIDR block. - Ipv6CidrBlockState *VpcCidrBlockState - - // The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. - Ipv6Pool *string - - // The name of the unique set of Availability Zones, Local Zones, or Wavelength - // Zones from which Amazon Web Services advertises IP addresses, for example, - // us-east-1-wl1-bos-wlz-1 . - NetworkBorderGroup *string - - noSmithyDocumentSerde -} - -// Describes a VPC peering connection. -type VpcPeeringConnection struct { - - // Information about the accepter VPC. CIDR block information is only returned - // when describing an active VPC peering connection. - AccepterVpcInfo *VpcPeeringConnectionVpcInfo - - // The time that an unaccepted VPC peering connection will expire. - ExpirationTime *time.Time - - // Information about the requester VPC. CIDR block information is only returned - // when describing an active VPC peering connection. - RequesterVpcInfo *VpcPeeringConnectionVpcInfo - - // The status of the VPC peering connection. - Status *VpcPeeringConnectionStateReason - - // Any tags assigned to the resource. - Tags []Tag - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string - - noSmithyDocumentSerde -} - -// Describes the VPC peering connection options. -type VpcPeeringConnectionOptionsDescription struct { - - // Indicates whether a local VPC can resolve public DNS hostnames to private IP - // addresses when queried from instances in a peer VPC. - AllowDnsResolutionFromRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool - - // Deprecated. - AllowEgressFromLocalVpcToRemoteClassicLink *bool - - noSmithyDocumentSerde -} - -// Describes the status of a VPC peering connection. -type VpcPeeringConnectionStateReason struct { - - // The status of the VPC peering connection. - Code VpcPeeringConnectionStateReasonCode - - // A message that provides more information about the status, if applicable. - Message *string - - noSmithyDocumentSerde -} - -// Describes a VPC in a VPC peering connection. -type VpcPeeringConnectionVpcInfo struct { - - // The IPv4 CIDR block for the VPC. - CidrBlock *string - - // Information about the IPv4 CIDR blocks for the VPC. - CidrBlockSet []CidrBlock - - // The IPv6 CIDR block for the VPC. - Ipv6CidrBlockSet []Ipv6CidrBlock - - // The ID of the Amazon Web Services account that owns the VPC. - OwnerId *string - - // Information about the VPC peering connection options for the accepter or - // requester VPC. - PeeringOptions *VpcPeeringConnectionOptionsDescription - - // The Region in which the VPC is located. - Region *string - - // The ID of the VPC. - VpcId *string - - noSmithyDocumentSerde -} - -// Describes a VPN connection. -type VpnConnection struct { - - // The category of the VPN connection. A value of VPN indicates an Amazon Web - // Services VPN connection. A value of VPN-Classic indicates an Amazon Web - // Services Classic VPN connection. - Category *string - - // The ARN of the core network. - CoreNetworkArn *string - - // The ARN of the core network attachment. - CoreNetworkAttachmentArn *string - - // The configuration information for the VPN connection's customer gateway (in the - // native XML format). This element is always present in the CreateVpnConnectionresponse; however, - // it's present in the DescribeVpnConnectionsresponse only if the VPN connection is in the pending or - // available state. - CustomerGatewayConfiguration *string - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayId *string - - // The current state of the gateway association. - GatewayAssociationState GatewayAssociationState - - // The VPN connection options. - Options *VpnConnectionOptions - - // The Amazon Resource Name (ARN) of the Secrets Manager secret storing the - // pre-shared key(s) for the VPN connection. - PreSharedKeyArn *string - - // The static routes associated with the VPN connection. - Routes []VpnStaticRoute - - // The current state of the VPN connection. - State VpnState - - // Any tags assigned to the VPN connection. - Tags []Tag - - // The ID of the transit gateway associated with the VPN connection. - TransitGatewayId *string - - // The type of VPN connection. - Type GatewayType - - // Information about the VPN tunnel. - VgwTelemetry []VgwTelemetry - - // The ID of the VPN connection. - VpnConnectionId *string - - // The ID of the virtual private gateway at the Amazon Web Services side of the - // VPN connection. - VpnGatewayId *string - - noSmithyDocumentSerde -} - -// List of customer gateway devices that have a sample configuration file -// available for use. You can also see the list of device types with sample -// configuration files available under [Your customer gateway device]in the Amazon Web Services Site-to-Site VPN -// User Guide. -// -// [Your customer gateway device]: https://docs.aws.amazon.com/vpn/latest/s2svpn/your-cgw.html -type VpnConnectionDeviceType struct { - - // Customer gateway device platform. - Platform *string - - // Customer gateway device software version. - Software *string - - // Customer gateway device vendor. - Vendor *string - - // Customer gateway device identifier. - VpnConnectionDeviceTypeId *string - - noSmithyDocumentSerde -} - -// Describes VPN connection options. -type VpnConnectionOptions struct { - - // Indicates whether acceleration is enabled for the VPN connection. - EnableAcceleration *bool - - // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. - LocalIpv4NetworkCidr *string - - // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. - LocalIpv6NetworkCidr *string - - // The type of IPv4 address assigned to the outside interface of the customer - // gateway. - // - // Valid values: PrivateIpv4 | PublicIpv4 | Ipv6 - // - // Default: PublicIpv4 - OutsideIpAddressType *string - - // The IPv4 CIDR on the Amazon Web Services side of the VPN connection. - RemoteIpv4NetworkCidr *string - - // The IPv6 CIDR on the Amazon Web Services side of the VPN connection. - RemoteIpv6NetworkCidr *string - - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool - - // The transit gateway attachment ID in use for the VPN tunnel. - TransportTransitGatewayAttachmentId *string - - // Indicates whether the VPN tunnels process IPv4 or IPv6 traffic. - TunnelInsideIpVersion TunnelInsideIpVersion - - // Indicates the VPN tunnel options. - TunnelOptions []TunnelOption - - noSmithyDocumentSerde -} - -// Describes VPN connection options. -type VpnConnectionOptionsSpecification struct { - - // Indicate whether to enable acceleration for the VPN connection. - // - // Default: false - EnableAcceleration *bool - - // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. - // - // Default: 0.0.0.0/0 - LocalIpv4NetworkCidr *string - - // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. - // - // Default: ::/0 - LocalIpv6NetworkCidr *string - - // The type of IP address assigned to the outside interface of the customer - // gateway device. - // - // Valid values: PrivateIpv4 | PublicIpv4 | Ipv6 - // - // Default: PublicIpv4 - OutsideIpAddressType *string - - // The IPv4 CIDR on the Amazon Web Services side of the VPN connection. - // - // Default: 0.0.0.0/0 - RemoteIpv4NetworkCidr *string - - // The IPv6 CIDR on the Amazon Web Services side of the VPN connection. - // - // Default: ::/0 - RemoteIpv6NetworkCidr *string - - // Indicate whether the VPN connection uses static routes only. If you are - // creating a VPN connection for a device that does not support BGP, you must - // specify true . Use CreateVpnConnectionRoute to create a static route. - // - // Default: false - StaticRoutesOnly *bool - - // The transit gateway attachment ID to use for the VPN tunnel. - // - // Required if OutsideIpAddressType is set to PrivateIpv4 . - TransportTransitGatewayAttachmentId *string - - // Indicate whether the VPN tunnels process IPv4 or IPv6 traffic. - // - // Default: ipv4 - TunnelInsideIpVersion TunnelInsideIpVersion - - // The tunnel options for the VPN connection. - TunnelOptions []VpnTunnelOptionsSpecification - - noSmithyDocumentSerde -} - -// Describes a virtual private gateway. -type VpnGateway struct { - - // The private Autonomous System Number (ASN) for the Amazon side of a BGP session. - AmazonSideAsn *int64 - - // The Availability Zone where the virtual private gateway was created, if - // applicable. This field may be empty or not returned. - AvailabilityZone *string - - // The current state of the virtual private gateway. - State VpnState - - // Any tags assigned to the virtual private gateway. - Tags []Tag - - // The type of VPN connection the virtual private gateway supports. - Type GatewayType - - // Any VPCs attached to the virtual private gateway. - VpcAttachments []VpcAttachment - - // The ID of the virtual private gateway. - VpnGatewayId *string - - noSmithyDocumentSerde -} - -// Describes a static route for a VPN connection. -type VpnStaticRoute struct { - - // The CIDR block associated with the local subnet of the customer data center. - DestinationCidrBlock *string - - // Indicates how the routes were provided. - Source VpnStaticRouteSource - - // The current state of the static route. - State VpnState - - noSmithyDocumentSerde -} - -// Options for logging VPN tunnel activity. -type VpnTunnelLogOptions struct { - - // Options for sending VPN tunnel logs to CloudWatch. - CloudWatchLogOptions *CloudWatchLogOptions - - noSmithyDocumentSerde -} - -// Options for logging VPN tunnel activity. -type VpnTunnelLogOptionsSpecification struct { - - // Options for sending VPN tunnel logs to CloudWatch. - CloudWatchLogOptions *CloudWatchLogOptionsSpecification - - noSmithyDocumentSerde -} - -// The tunnel options for a single VPN tunnel. -type VpnTunnelOptionsSpecification struct { - - // The action to take after DPD timeout occurs. Specify restart to restart the IKE - // initiation. Specify clear to end the IKE session. - // - // Valid Values: clear | none | restart - // - // Default: clear - DPDTimeoutAction *string - - // The number of seconds after which a DPD timeout occurs. - // - // Constraints: A value greater than or equal to 30. - // - // Default: 30 - DPDTimeoutSeconds *int32 - - // Turn on or off tunnel endpoint lifecycle control feature. - EnableTunnelLifecycleControl *bool - - // The IKE versions that are permitted for the VPN tunnel. - // - // Valid values: ikev1 | ikev2 - IKEVersions []IKEVersionsRequestListValue - - // Options for logging VPN tunnel activity. - LogOptions *VpnTunnelLogOptionsSpecification - - // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel - // for phase 1 IKE negotiations. - // - // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 - Phase1DHGroupNumbers []Phase1DHGroupNumbersRequestListValue - - // One or more encryption algorithms that are permitted for the VPN tunnel for - // phase 1 IKE negotiations. - // - // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 - Phase1EncryptionAlgorithms []Phase1EncryptionAlgorithmsRequestListValue - - // One or more integrity algorithms that are permitted for the VPN tunnel for - // phase 1 IKE negotiations. - // - // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 - Phase1IntegrityAlgorithms []Phase1IntegrityAlgorithmsRequestListValue - - // The lifetime for phase 1 of the IKE negotiation, in seconds. - // - // Constraints: A value between 900 and 28,800. - // - // Default: 28800 - Phase1LifetimeSeconds *int32 - - // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel - // for phase 2 IKE negotiations. - // - // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 - Phase2DHGroupNumbers []Phase2DHGroupNumbersRequestListValue - - // One or more encryption algorithms that are permitted for the VPN tunnel for - // phase 2 IKE negotiations. - // - // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 - Phase2EncryptionAlgorithms []Phase2EncryptionAlgorithmsRequestListValue - - // One or more integrity algorithms that are permitted for the VPN tunnel for - // phase 2 IKE negotiations. - // - // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 - Phase2IntegrityAlgorithms []Phase2IntegrityAlgorithmsRequestListValue - - // The lifetime for phase 2 of the IKE negotiation, in seconds. - // - // Constraints: A value between 900 and 3,600. The value must be less than the - // value for Phase1LifetimeSeconds . - // - // Default: 3600 - Phase2LifetimeSeconds *int32 - - // The pre-shared key (PSK) to establish initial authentication between the - // virtual private gateway and customer gateway. - // - // Constraints: Allowed characters are alphanumeric characters, periods (.), and - // underscores (_). Must be between 8 and 64 characters in length and cannot start - // with zero (0). - PreSharedKey *string - - // The percentage of the rekey window (determined by RekeyMarginTimeSeconds ) - // during which the rekey time is randomly selected. - // - // Constraints: A value between 0 and 100. - // - // Default: 100 - RekeyFuzzPercentage *int32 - - // The margin time, in seconds, before the phase 2 lifetime expires, during which - // the Amazon Web Services side of the VPN connection performs an IKE rekey. The - // exact time of the rekey is randomly selected based on the value for - // RekeyFuzzPercentage . - // - // Constraints: A value between 60 and half of Phase2LifetimeSeconds . - // - // Default: 270 - RekeyMarginTimeSeconds *int32 - - // The number of packets in an IKE replay window. - // - // Constraints: A value between 64 and 2048. - // - // Default: 1024 - ReplayWindowSize *int32 - - // The action to take when the establishing the tunnel for the VPN connection. By - // default, your customer gateway device must initiate the IKE negotiation and - // bring up the tunnel. Specify start for Amazon Web Services to initiate the IKE - // negotiation. - // - // Valid Values: add | start - // - // Default: add - StartupAction *string - - // The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks - // must be unique across all VPN connections that use the same virtual private - // gateway. - // - // Constraints: A size /30 CIDR block from the 169.254.0.0/16 range. The following - // CIDR blocks are reserved and cannot be used: - // - // - 169.254.0.0/30 - // - // - 169.254.1.0/30 - // - // - 169.254.2.0/30 - // - // - 169.254.3.0/30 - // - // - 169.254.4.0/30 - // - // - 169.254.5.0/30 - // - // - 169.254.169.252/30 - TunnelInsideCidr *string - - // The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks - // must be unique across all VPN connections that use the same transit gateway. - // - // Constraints: A size /126 CIDR block from the local fd00::/8 range. - TunnelInsideIpv6Cidr *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/validators.go deleted file mode 100644 index d590e5855..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ec2/validators.go +++ /dev/null @@ -1,20632 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ec2 - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAcceptAddressTransfer struct { -} - -func (*validateOpAcceptAddressTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptAddressTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptAddressTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptAddressTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptCapacityReservationBillingOwnership struct { -} - -func (*validateOpAcceptCapacityReservationBillingOwnership) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptCapacityReservationBillingOwnership) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptCapacityReservationBillingOwnershipInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptCapacityReservationBillingOwnershipInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptReservedInstancesExchangeQuote struct { -} - -func (*validateOpAcceptReservedInstancesExchangeQuote) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptReservedInstancesExchangeQuote) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptReservedInstancesExchangeQuoteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptReservedInstancesExchangeQuoteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptTransitGatewayPeeringAttachment struct { -} - -func (*validateOpAcceptTransitGatewayPeeringAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptTransitGatewayPeeringAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptTransitGatewayPeeringAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptTransitGatewayPeeringAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptTransitGatewayVpcAttachment struct { -} - -func (*validateOpAcceptTransitGatewayVpcAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptTransitGatewayVpcAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptTransitGatewayVpcAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptTransitGatewayVpcAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptVpcEndpointConnections struct { -} - -func (*validateOpAcceptVpcEndpointConnections) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptVpcEndpointConnections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptVpcEndpointConnectionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptVpcEndpointConnectionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAcceptVpcPeeringConnection struct { -} - -func (*validateOpAcceptVpcPeeringConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptVpcPeeringConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptVpcPeeringConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptVpcPeeringConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAdvertiseByoipCidr struct { -} - -func (*validateOpAdvertiseByoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAdvertiseByoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AdvertiseByoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAdvertiseByoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAllocateIpamPoolCidr struct { -} - -func (*validateOpAllocateIpamPoolCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAllocateIpamPoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AllocateIpamPoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAllocateIpamPoolCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpApplySecurityGroupsToClientVpnTargetNetwork struct { -} - -func (*validateOpApplySecurityGroupsToClientVpnTargetNetwork) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpApplySecurityGroupsToClientVpnTargetNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ApplySecurityGroupsToClientVpnTargetNetworkInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpApplySecurityGroupsToClientVpnTargetNetworkInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssignIpv6Addresses struct { -} - -func (*validateOpAssignIpv6Addresses) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssignIpv6Addresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssignIpv6AddressesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssignIpv6AddressesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssignPrivateIpAddresses struct { -} - -func (*validateOpAssignPrivateIpAddresses) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssignPrivateIpAddresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssignPrivateIpAddressesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssignPrivateIpAddressesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssignPrivateNatGatewayAddress struct { -} - -func (*validateOpAssignPrivateNatGatewayAddress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssignPrivateNatGatewayAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssignPrivateNatGatewayAddressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssignPrivateNatGatewayAddressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateCapacityReservationBillingOwner struct { -} - -func (*validateOpAssociateCapacityReservationBillingOwner) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateCapacityReservationBillingOwner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateCapacityReservationBillingOwnerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateCapacityReservationBillingOwnerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateClientVpnTargetNetwork struct { -} - -func (*validateOpAssociateClientVpnTargetNetwork) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateClientVpnTargetNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateClientVpnTargetNetworkInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateClientVpnTargetNetworkInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateDhcpOptions struct { -} - -func (*validateOpAssociateDhcpOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateDhcpOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateDhcpOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateDhcpOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateEnclaveCertificateIamRole struct { -} - -func (*validateOpAssociateEnclaveCertificateIamRole) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateEnclaveCertificateIamRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateEnclaveCertificateIamRoleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateEnclaveCertificateIamRoleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateIamInstanceProfile struct { -} - -func (*validateOpAssociateIamInstanceProfile) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateIamInstanceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateIamInstanceProfileInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateIamInstanceProfileInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateInstanceEventWindow struct { -} - -func (*validateOpAssociateInstanceEventWindow) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateInstanceEventWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateInstanceEventWindowInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateInstanceEventWindowInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateIpamByoasn struct { -} - -func (*validateOpAssociateIpamByoasn) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateIpamByoasnInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateIpamByoasnInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateIpamResourceDiscovery struct { -} - -func (*validateOpAssociateIpamResourceDiscovery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateIpamResourceDiscoveryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateNatGatewayAddress struct { -} - -func (*validateOpAssociateNatGatewayAddress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateNatGatewayAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateNatGatewayAddressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateNatGatewayAddressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateRouteServer struct { -} - -func (*validateOpAssociateRouteServer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateRouteServerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateRouteTable struct { -} - -func (*validateOpAssociateRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateSecurityGroupVpc struct { -} - -func (*validateOpAssociateSecurityGroupVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateSecurityGroupVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateSecurityGroupVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateSecurityGroupVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateSubnetCidrBlock struct { -} - -func (*validateOpAssociateSubnetCidrBlock) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateSubnetCidrBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateSubnetCidrBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateSubnetCidrBlockInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateTransitGatewayMulticastDomain struct { -} - -func (*validateOpAssociateTransitGatewayMulticastDomain) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateTransitGatewayMulticastDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateTransitGatewayMulticastDomainInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateTransitGatewayMulticastDomainInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateTransitGatewayPolicyTable struct { -} - -func (*validateOpAssociateTransitGatewayPolicyTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateTransitGatewayPolicyTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateTransitGatewayPolicyTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateTransitGatewayPolicyTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateTransitGatewayRouteTable struct { -} - -func (*validateOpAssociateTransitGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateTransitGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateTransitGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateTransitGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateTrunkInterface struct { -} - -func (*validateOpAssociateTrunkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateTrunkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateTrunkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateTrunkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateVpcCidrBlock struct { -} - -func (*validateOpAssociateVpcCidrBlock) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateVpcCidrBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateVpcCidrBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateVpcCidrBlockInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachClassicLinkVpc struct { -} - -func (*validateOpAttachClassicLinkVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachClassicLinkVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachClassicLinkVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachClassicLinkVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachInternetGateway struct { -} - -func (*validateOpAttachInternetGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachInternetGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachInternetGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachInternetGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachNetworkInterface struct { -} - -func (*validateOpAttachNetworkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachNetworkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachNetworkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachVerifiedAccessTrustProvider struct { -} - -func (*validateOpAttachVerifiedAccessTrustProvider) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachVerifiedAccessTrustProviderInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachVolume struct { -} - -func (*validateOpAttachVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachVpnGateway struct { -} - -func (*validateOpAttachVpnGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachVpnGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachVpnGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachVpnGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAuthorizeClientVpnIngress struct { -} - -func (*validateOpAuthorizeClientVpnIngress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAuthorizeClientVpnIngress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AuthorizeClientVpnIngressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAuthorizeClientVpnIngressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAuthorizeSecurityGroupEgress struct { -} - -func (*validateOpAuthorizeSecurityGroupEgress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAuthorizeSecurityGroupEgress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AuthorizeSecurityGroupEgressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAuthorizeSecurityGroupEgressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpBundleInstance struct { -} - -func (*validateOpBundleInstance) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpBundleInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*BundleInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpBundleInstanceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelBundleTask struct { -} - -func (*validateOpCancelBundleTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelBundleTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelBundleTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelBundleTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelCapacityReservationFleets struct { -} - -func (*validateOpCancelCapacityReservationFleets) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelCapacityReservationFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelCapacityReservationFleetsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelCapacityReservationFleetsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelCapacityReservation struct { -} - -func (*validateOpCancelCapacityReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelCapacityReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelCapacityReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelCapacityReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelConversionTask struct { -} - -func (*validateOpCancelConversionTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelConversionTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelConversionTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelConversionTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelDeclarativePoliciesReport struct { -} - -func (*validateOpCancelDeclarativePoliciesReport) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelDeclarativePoliciesReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelDeclarativePoliciesReportInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelDeclarativePoliciesReportInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelExportTask struct { -} - -func (*validateOpCancelExportTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelExportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelExportTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelExportTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelImageLaunchPermission struct { -} - -func (*validateOpCancelImageLaunchPermission) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelImageLaunchPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelImageLaunchPermissionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelImageLaunchPermissionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelReservedInstancesListing struct { -} - -func (*validateOpCancelReservedInstancesListing) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelReservedInstancesListing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelReservedInstancesListingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelReservedInstancesListingInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelSpotFleetRequests struct { -} - -func (*validateOpCancelSpotFleetRequests) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelSpotFleetRequests) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelSpotFleetRequestsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelSpotFleetRequestsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelSpotInstanceRequests struct { -} - -func (*validateOpCancelSpotInstanceRequests) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelSpotInstanceRequests) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelSpotInstanceRequestsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelSpotInstanceRequestsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpConfirmProductInstance struct { -} - -func (*validateOpConfirmProductInstance) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpConfirmProductInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ConfirmProductInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpConfirmProductInstanceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCopyFpgaImage struct { -} - -func (*validateOpCopyFpgaImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCopyFpgaImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CopyFpgaImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCopyFpgaImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCopyImage struct { -} - -func (*validateOpCopyImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCopyImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CopyImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCopyImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCopySnapshot struct { -} - -func (*validateOpCopySnapshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCopySnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CopySnapshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCopySnapshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCapacityReservationBySplitting struct { -} - -func (*validateOpCreateCapacityReservationBySplitting) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCapacityReservationBySplitting) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCapacityReservationBySplittingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCapacityReservationBySplittingInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCapacityReservationFleet struct { -} - -func (*validateOpCreateCapacityReservationFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCapacityReservationFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCapacityReservationFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCapacityReservationFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCapacityReservation struct { -} - -func (*validateOpCreateCapacityReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCapacityReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCapacityReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCapacityReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCarrierGateway struct { -} - -func (*validateOpCreateCarrierGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCarrierGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCarrierGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCarrierGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateClientVpnEndpoint struct { -} - -func (*validateOpCreateClientVpnEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateClientVpnEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateClientVpnEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateClientVpnEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateClientVpnRoute struct { -} - -func (*validateOpCreateClientVpnRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateClientVpnRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateClientVpnRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateClientVpnRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCoipCidr struct { -} - -func (*validateOpCreateCoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCoipPool struct { -} - -func (*validateOpCreateCoipPool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCoipPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCoipPoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCoipPoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCustomerGateway struct { -} - -func (*validateOpCreateCustomerGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCustomerGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCustomerGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCustomerGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateDefaultSubnet struct { -} - -func (*validateOpCreateDefaultSubnet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateDefaultSubnet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateDefaultSubnetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateDefaultSubnetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateDelegateMacVolumeOwnershipTask struct { -} - -func (*validateOpCreateDelegateMacVolumeOwnershipTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateDelegateMacVolumeOwnershipTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateDelegateMacVolumeOwnershipTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateDelegateMacVolumeOwnershipTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateDhcpOptions struct { -} - -func (*validateOpCreateDhcpOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateDhcpOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateDhcpOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateDhcpOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateEgressOnlyInternetGateway struct { -} - -func (*validateOpCreateEgressOnlyInternetGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateEgressOnlyInternetGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateEgressOnlyInternetGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateEgressOnlyInternetGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateFleet struct { -} - -func (*validateOpCreateFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateFlowLogs struct { -} - -func (*validateOpCreateFlowLogs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateFlowLogs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateFlowLogsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateFlowLogsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateFpgaImage struct { -} - -func (*validateOpCreateFpgaImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateFpgaImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateFpgaImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateFpgaImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateImage struct { -} - -func (*validateOpCreateImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateInstanceConnectEndpoint struct { -} - -func (*validateOpCreateInstanceConnectEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateInstanceConnectEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateInstanceConnectEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateInstanceConnectEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateInstanceExportTask struct { -} - -func (*validateOpCreateInstanceExportTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateInstanceExportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateInstanceExportTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateInstanceExportTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateIpamExternalResourceVerificationToken struct { -} - -func (*validateOpCreateIpamExternalResourceVerificationToken) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateIpamExternalResourceVerificationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateIpamExternalResourceVerificationTokenInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateIpamExternalResourceVerificationTokenInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateIpamPool struct { -} - -func (*validateOpCreateIpamPool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateIpamPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateIpamPoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateIpamPoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateIpamScope struct { -} - -func (*validateOpCreateIpamScope) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateIpamScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateIpamScopeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateIpamScopeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateKeyPair struct { -} - -func (*validateOpCreateKeyPair) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateKeyPairInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateKeyPairInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLaunchTemplate struct { -} - -func (*validateOpCreateLaunchTemplate) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLaunchTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLaunchTemplateInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLaunchTemplateInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLaunchTemplateVersion struct { -} - -func (*validateOpCreateLaunchTemplateVersion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLaunchTemplateVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLaunchTemplateVersionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLaunchTemplateVersionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayRoute struct { -} - -func (*validateOpCreateLocalGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayRouteTable struct { -} - -func (*validateOpCreateLocalGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayRouteTableVpcAssociation struct { -} - -func (*validateOpCreateLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayRouteTableVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayRouteTableVpcAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayRouteTableVpcAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayVirtualInterfaceGroup struct { -} - -func (*validateOpCreateLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayVirtualInterfaceGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayVirtualInterfaceGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayVirtualInterfaceGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateLocalGatewayVirtualInterface struct { -} - -func (*validateOpCreateLocalGatewayVirtualInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateLocalGatewayVirtualInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateLocalGatewayVirtualInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateLocalGatewayVirtualInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateMacSystemIntegrityProtectionModificationTask struct { -} - -func (*validateOpCreateMacSystemIntegrityProtectionModificationTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateMacSystemIntegrityProtectionModificationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateMacSystemIntegrityProtectionModificationTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateMacSystemIntegrityProtectionModificationTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateManagedPrefixList struct { -} - -func (*validateOpCreateManagedPrefixList) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateManagedPrefixList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateManagedPrefixListInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateManagedPrefixListInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNatGateway struct { -} - -func (*validateOpCreateNatGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNatGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNatGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNatGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkAclEntry struct { -} - -func (*validateOpCreateNetworkAclEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkAclEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkAclEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkAclEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkAcl struct { -} - -func (*validateOpCreateNetworkAcl) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkAcl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkAclInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkInsightsAccessScope struct { -} - -func (*validateOpCreateNetworkInsightsAccessScope) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkInsightsAccessScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkInsightsAccessScopeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkInsightsAccessScopeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkInsightsPath struct { -} - -func (*validateOpCreateNetworkInsightsPath) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkInsightsPath) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkInsightsPathInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkInsightsPathInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkInterface struct { -} - -func (*validateOpCreateNetworkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNetworkInterfacePermission struct { -} - -func (*validateOpCreateNetworkInterfacePermission) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNetworkInterfacePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNetworkInterfacePermissionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNetworkInterfacePermissionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateReplaceRootVolumeTask struct { -} - -func (*validateOpCreateReplaceRootVolumeTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateReplaceRootVolumeTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateReplaceRootVolumeTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateReplaceRootVolumeTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateReservedInstancesListing struct { -} - -func (*validateOpCreateReservedInstancesListing) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateReservedInstancesListing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateReservedInstancesListingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateReservedInstancesListingInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRestoreImageTask struct { -} - -func (*validateOpCreateRestoreImageTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRestoreImageTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRestoreImageTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRestoreImageTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRoute struct { -} - -func (*validateOpCreateRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRouteServerEndpoint struct { -} - -func (*validateOpCreateRouteServerEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRouteServerEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRouteServerEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRouteServerEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRouteServer struct { -} - -func (*validateOpCreateRouteServer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRouteServerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRouteServerPeer struct { -} - -func (*validateOpCreateRouteServerPeer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRouteServerPeer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRouteServerPeerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRouteServerPeerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateRouteTable struct { -} - -func (*validateOpCreateRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSecurityGroup struct { -} - -func (*validateOpCreateSecurityGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSecurityGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSecurityGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSecurityGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSnapshot struct { -} - -func (*validateOpCreateSnapshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSnapshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSnapshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSnapshots struct { -} - -func (*validateOpCreateSnapshots) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSnapshots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSnapshotsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSnapshotsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSpotDatafeedSubscription struct { -} - -func (*validateOpCreateSpotDatafeedSubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSpotDatafeedSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSpotDatafeedSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSpotDatafeedSubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateStoreImageTask struct { -} - -func (*validateOpCreateStoreImageTask) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateStoreImageTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateStoreImageTaskInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateStoreImageTaskInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSubnetCidrReservation struct { -} - -func (*validateOpCreateSubnetCidrReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSubnetCidrReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSubnetCidrReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSubnetCidrReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSubnet struct { -} - -func (*validateOpCreateSubnet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSubnet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSubnetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSubnetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTags struct { -} - -func (*validateOpCreateTags) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTagsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTagsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTrafficMirrorFilterRule struct { -} - -func (*validateOpCreateTrafficMirrorFilterRule) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTrafficMirrorFilterRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTrafficMirrorFilterRuleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTrafficMirrorFilterRuleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTrafficMirrorSession struct { -} - -func (*validateOpCreateTrafficMirrorSession) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTrafficMirrorSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTrafficMirrorSessionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTrafficMirrorSessionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayConnect struct { -} - -func (*validateOpCreateTransitGatewayConnect) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayConnect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayConnectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayConnectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayConnectPeer struct { -} - -func (*validateOpCreateTransitGatewayConnectPeer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayConnectPeer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayConnectPeerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayConnectPeerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayMulticastDomain struct { -} - -func (*validateOpCreateTransitGatewayMulticastDomain) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayMulticastDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayMulticastDomainInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayMulticastDomainInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayPeeringAttachment struct { -} - -func (*validateOpCreateTransitGatewayPeeringAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayPeeringAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayPeeringAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayPeeringAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayPolicyTable struct { -} - -func (*validateOpCreateTransitGatewayPolicyTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayPolicyTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayPolicyTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayPolicyTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayPrefixListReference struct { -} - -func (*validateOpCreateTransitGatewayPrefixListReference) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayPrefixListReference) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayPrefixListReferenceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayPrefixListReferenceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayRoute struct { -} - -func (*validateOpCreateTransitGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayRouteTableAnnouncement struct { -} - -func (*validateOpCreateTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayRouteTableAnnouncement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayRouteTableAnnouncementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayRouteTableAnnouncementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayRouteTable struct { -} - -func (*validateOpCreateTransitGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTransitGatewayVpcAttachment struct { -} - -func (*validateOpCreateTransitGatewayVpcAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTransitGatewayVpcAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTransitGatewayVpcAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTransitGatewayVpcAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVerifiedAccessEndpoint struct { -} - -func (*validateOpCreateVerifiedAccessEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVerifiedAccessEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVerifiedAccessGroup struct { -} - -func (*validateOpCreateVerifiedAccessGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVerifiedAccessGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVerifiedAccessTrustProvider struct { -} - -func (*validateOpCreateVerifiedAccessTrustProvider) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVerifiedAccessTrustProviderInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVolume struct { -} - -func (*validateOpCreateVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpcBlockPublicAccessExclusion struct { -} - -func (*validateOpCreateVpcBlockPublicAccessExclusion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpcBlockPublicAccessExclusion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpcBlockPublicAccessExclusionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpcBlockPublicAccessExclusionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpcEndpointConnectionNotification struct { -} - -func (*validateOpCreateVpcEndpointConnectionNotification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpcEndpointConnectionNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpcEndpointConnectionNotificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpcEndpointConnectionNotificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpcEndpoint struct { -} - -func (*validateOpCreateVpcEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpcEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpcEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpcPeeringConnection struct { -} - -func (*validateOpCreateVpcPeeringConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpcPeeringConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpcPeeringConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpcPeeringConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpnConnection struct { -} - -func (*validateOpCreateVpnConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpnConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpnConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpnConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpnConnectionRoute struct { -} - -func (*validateOpCreateVpnConnectionRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpnConnectionRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpnConnectionRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpnConnectionRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateVpnGateway struct { -} - -func (*validateOpCreateVpnGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateVpnGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateVpnGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateVpnGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCarrierGateway struct { -} - -func (*validateOpDeleteCarrierGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCarrierGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCarrierGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCarrierGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteClientVpnEndpoint struct { -} - -func (*validateOpDeleteClientVpnEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteClientVpnEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteClientVpnEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteClientVpnEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteClientVpnRoute struct { -} - -func (*validateOpDeleteClientVpnRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteClientVpnRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteClientVpnRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteClientVpnRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCoipCidr struct { -} - -func (*validateOpDeleteCoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCoipPool struct { -} - -func (*validateOpDeleteCoipPool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCoipPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCoipPoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCoipPoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCustomerGateway struct { -} - -func (*validateOpDeleteCustomerGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCustomerGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCustomerGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCustomerGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteDhcpOptions struct { -} - -func (*validateOpDeleteDhcpOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteDhcpOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteDhcpOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteDhcpOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteEgressOnlyInternetGateway struct { -} - -func (*validateOpDeleteEgressOnlyInternetGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteEgressOnlyInternetGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteEgressOnlyInternetGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteEgressOnlyInternetGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteFleets struct { -} - -func (*validateOpDeleteFleets) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteFleetsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteFleetsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteFlowLogs struct { -} - -func (*validateOpDeleteFlowLogs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteFlowLogs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteFlowLogsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteFlowLogsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteFpgaImage struct { -} - -func (*validateOpDeleteFpgaImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteFpgaImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteFpgaImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteFpgaImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteInstanceConnectEndpoint struct { -} - -func (*validateOpDeleteInstanceConnectEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteInstanceConnectEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteInstanceConnectEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteInstanceConnectEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteInstanceEventWindow struct { -} - -func (*validateOpDeleteInstanceEventWindow) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteInstanceEventWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteInstanceEventWindowInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteInstanceEventWindowInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteInternetGateway struct { -} - -func (*validateOpDeleteInternetGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteInternetGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteInternetGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteInternetGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteIpamExternalResourceVerificationToken struct { -} - -func (*validateOpDeleteIpamExternalResourceVerificationToken) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteIpamExternalResourceVerificationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteIpamExternalResourceVerificationTokenInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteIpamExternalResourceVerificationTokenInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteIpam struct { -} - -func (*validateOpDeleteIpam) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteIpam) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteIpamInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteIpamInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteIpamPool struct { -} - -func (*validateOpDeleteIpamPool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteIpamPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteIpamPoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteIpamPoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteIpamResourceDiscovery struct { -} - -func (*validateOpDeleteIpamResourceDiscovery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteIpamResourceDiscoveryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteIpamScope struct { -} - -func (*validateOpDeleteIpamScope) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteIpamScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteIpamScopeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteIpamScopeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLaunchTemplateVersions struct { -} - -func (*validateOpDeleteLaunchTemplateVersions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLaunchTemplateVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLaunchTemplateVersionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLaunchTemplateVersionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayRoute struct { -} - -func (*validateOpDeleteLocalGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayRouteTable struct { -} - -func (*validateOpDeleteLocalGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { -} - -func (*validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayRouteTableVpcAssociation struct { -} - -func (*validateOpDeleteLocalGatewayRouteTableVpcAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayRouteTableVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayRouteTableVpcAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayRouteTableVpcAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayVirtualInterfaceGroup struct { -} - -func (*validateOpDeleteLocalGatewayVirtualInterfaceGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayVirtualInterfaceGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayVirtualInterfaceGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayVirtualInterfaceGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteLocalGatewayVirtualInterface struct { -} - -func (*validateOpDeleteLocalGatewayVirtualInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteLocalGatewayVirtualInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteLocalGatewayVirtualInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteLocalGatewayVirtualInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteManagedPrefixList struct { -} - -func (*validateOpDeleteManagedPrefixList) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteManagedPrefixList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteManagedPrefixListInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteManagedPrefixListInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNatGateway struct { -} - -func (*validateOpDeleteNatGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNatGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNatGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNatGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkAclEntry struct { -} - -func (*validateOpDeleteNetworkAclEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkAclEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkAclEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkAclEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkAcl struct { -} - -func (*validateOpDeleteNetworkAcl) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkAcl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkAclInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInsightsAccessScopeAnalysis struct { -} - -func (*validateOpDeleteNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInsightsAccessScopeAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInsightsAccessScopeAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInsightsAccessScopeAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInsightsAccessScope struct { -} - -func (*validateOpDeleteNetworkInsightsAccessScope) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInsightsAccessScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInsightsAccessScopeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInsightsAccessScopeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInsightsAnalysis struct { -} - -func (*validateOpDeleteNetworkInsightsAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInsightsAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInsightsAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInsightsAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInsightsPath struct { -} - -func (*validateOpDeleteNetworkInsightsPath) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInsightsPath) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInsightsPathInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInsightsPathInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInterface struct { -} - -func (*validateOpDeleteNetworkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNetworkInterfacePermission struct { -} - -func (*validateOpDeleteNetworkInterfacePermission) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNetworkInterfacePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNetworkInterfacePermissionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNetworkInterfacePermissionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeletePlacementGroup struct { -} - -func (*validateOpDeletePlacementGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeletePlacementGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeletePlacementGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeletePlacementGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeletePublicIpv4Pool struct { -} - -func (*validateOpDeletePublicIpv4Pool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeletePublicIpv4Pool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeletePublicIpv4PoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeletePublicIpv4PoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteQueuedReservedInstances struct { -} - -func (*validateOpDeleteQueuedReservedInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteQueuedReservedInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteQueuedReservedInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteQueuedReservedInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteRoute struct { -} - -func (*validateOpDeleteRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteRouteServerEndpoint struct { -} - -func (*validateOpDeleteRouteServerEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteRouteServerEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteRouteServerEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteRouteServerEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteRouteServer struct { -} - -func (*validateOpDeleteRouteServer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteRouteServerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteRouteServerPeer struct { -} - -func (*validateOpDeleteRouteServerPeer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteRouteServerPeer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteRouteServerPeerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteRouteServerPeerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteRouteTable struct { -} - -func (*validateOpDeleteRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteSnapshot struct { -} - -func (*validateOpDeleteSnapshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteSnapshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteSnapshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteSubnetCidrReservation struct { -} - -func (*validateOpDeleteSubnetCidrReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteSubnetCidrReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteSubnetCidrReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteSubnetCidrReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteSubnet struct { -} - -func (*validateOpDeleteSubnet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteSubnet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteSubnetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteSubnetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTags struct { -} - -func (*validateOpDeleteTags) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTagsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTagsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTrafficMirrorFilter struct { -} - -func (*validateOpDeleteTrafficMirrorFilter) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTrafficMirrorFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTrafficMirrorFilterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTrafficMirrorFilterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTrafficMirrorFilterRule struct { -} - -func (*validateOpDeleteTrafficMirrorFilterRule) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTrafficMirrorFilterRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTrafficMirrorFilterRuleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTrafficMirrorFilterRuleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTrafficMirrorSession struct { -} - -func (*validateOpDeleteTrafficMirrorSession) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTrafficMirrorSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTrafficMirrorSessionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTrafficMirrorSessionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTrafficMirrorTarget struct { -} - -func (*validateOpDeleteTrafficMirrorTarget) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTrafficMirrorTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTrafficMirrorTargetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTrafficMirrorTargetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayConnect struct { -} - -func (*validateOpDeleteTransitGatewayConnect) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayConnect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayConnectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayConnectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayConnectPeer struct { -} - -func (*validateOpDeleteTransitGatewayConnectPeer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayConnectPeer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayConnectPeerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayConnectPeerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGateway struct { -} - -func (*validateOpDeleteTransitGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayMulticastDomain struct { -} - -func (*validateOpDeleteTransitGatewayMulticastDomain) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayMulticastDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayMulticastDomainInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayMulticastDomainInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayPeeringAttachment struct { -} - -func (*validateOpDeleteTransitGatewayPeeringAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayPeeringAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayPeeringAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayPeeringAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayPolicyTable struct { -} - -func (*validateOpDeleteTransitGatewayPolicyTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayPolicyTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayPolicyTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayPolicyTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayPrefixListReference struct { -} - -func (*validateOpDeleteTransitGatewayPrefixListReference) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayPrefixListReference) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayPrefixListReferenceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayPrefixListReferenceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayRoute struct { -} - -func (*validateOpDeleteTransitGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayRouteTableAnnouncement struct { -} - -func (*validateOpDeleteTransitGatewayRouteTableAnnouncement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayRouteTableAnnouncement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayRouteTableAnnouncementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayRouteTableAnnouncementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayRouteTable struct { -} - -func (*validateOpDeleteTransitGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteTransitGatewayVpcAttachment struct { -} - -func (*validateOpDeleteTransitGatewayVpcAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteTransitGatewayVpcAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteTransitGatewayVpcAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteTransitGatewayVpcAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVerifiedAccessEndpoint struct { -} - -func (*validateOpDeleteVerifiedAccessEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVerifiedAccessEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVerifiedAccessGroup struct { -} - -func (*validateOpDeleteVerifiedAccessGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVerifiedAccessGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVerifiedAccessInstance struct { -} - -func (*validateOpDeleteVerifiedAccessInstance) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVerifiedAccessInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVerifiedAccessInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVerifiedAccessInstanceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVerifiedAccessTrustProvider struct { -} - -func (*validateOpDeleteVerifiedAccessTrustProvider) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVerifiedAccessTrustProviderInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVolume struct { -} - -func (*validateOpDeleteVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpcBlockPublicAccessExclusion struct { -} - -func (*validateOpDeleteVpcBlockPublicAccessExclusion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpcBlockPublicAccessExclusion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcBlockPublicAccessExclusionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcBlockPublicAccessExclusionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpcEndpointConnectionNotifications struct { -} - -func (*validateOpDeleteVpcEndpointConnectionNotifications) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpcEndpointConnectionNotifications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcEndpointConnectionNotificationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcEndpointConnectionNotificationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpcEndpointServiceConfigurations struct { -} - -func (*validateOpDeleteVpcEndpointServiceConfigurations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpcEndpointServiceConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcEndpointServiceConfigurationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcEndpointServiceConfigurationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpcEndpoints struct { -} - -func (*validateOpDeleteVpcEndpoints) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpcEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcEndpointsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcEndpointsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpc struct { -} - -func (*validateOpDeleteVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpcPeeringConnection struct { -} - -func (*validateOpDeleteVpcPeeringConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpcPeeringConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpcPeeringConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpcPeeringConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpnConnection struct { -} - -func (*validateOpDeleteVpnConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpnConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpnConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpnConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpnConnectionRoute struct { -} - -func (*validateOpDeleteVpnConnectionRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpnConnectionRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpnConnectionRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpnConnectionRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteVpnGateway struct { -} - -func (*validateOpDeleteVpnGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteVpnGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteVpnGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteVpnGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeprovisionByoipCidr struct { -} - -func (*validateOpDeprovisionByoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeprovisionByoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeprovisionByoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeprovisionByoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeprovisionIpamByoasn struct { -} - -func (*validateOpDeprovisionIpamByoasn) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeprovisionIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeprovisionIpamByoasnInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeprovisionIpamByoasnInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeprovisionIpamPoolCidr struct { -} - -func (*validateOpDeprovisionIpamPoolCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeprovisionIpamPoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeprovisionIpamPoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeprovisionIpamPoolCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeprovisionPublicIpv4PoolCidr struct { -} - -func (*validateOpDeprovisionPublicIpv4PoolCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeprovisionPublicIpv4PoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeprovisionPublicIpv4PoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeprovisionPublicIpv4PoolCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeregisterImage struct { -} - -func (*validateOpDeregisterImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeregisterImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeregisterImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeregisterImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeregisterInstanceEventNotificationAttributes struct { -} - -func (*validateOpDeregisterInstanceEventNotificationAttributes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeregisterInstanceEventNotificationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeregisterInstanceEventNotificationAttributesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeregisterInstanceEventNotificationAttributesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeByoipCidrs struct { -} - -func (*validateOpDescribeByoipCidrs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeByoipCidrs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeByoipCidrsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeByoipCidrsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCapacityBlockExtensionOfferings struct { -} - -func (*validateOpDescribeCapacityBlockExtensionOfferings) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCapacityBlockExtensionOfferings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCapacityBlockExtensionOfferingsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCapacityBlockExtensionOfferingsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCapacityBlockOfferings struct { -} - -func (*validateOpDescribeCapacityBlockOfferings) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCapacityBlockOfferings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCapacityBlockOfferingsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCapacityBlockOfferingsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCapacityReservationBillingRequests struct { -} - -func (*validateOpDescribeCapacityReservationBillingRequests) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCapacityReservationBillingRequests) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCapacityReservationBillingRequestsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCapacityReservationBillingRequestsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeClientVpnAuthorizationRules struct { -} - -func (*validateOpDescribeClientVpnAuthorizationRules) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeClientVpnAuthorizationRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeClientVpnAuthorizationRulesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeClientVpnAuthorizationRulesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeClientVpnConnections struct { -} - -func (*validateOpDescribeClientVpnConnections) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeClientVpnConnections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeClientVpnConnectionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeClientVpnConnectionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeClientVpnRoutes struct { -} - -func (*validateOpDescribeClientVpnRoutes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeClientVpnRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeClientVpnRoutesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeClientVpnRoutesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeClientVpnTargetNetworks struct { -} - -func (*validateOpDescribeClientVpnTargetNetworks) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeClientVpnTargetNetworks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeClientVpnTargetNetworksInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeClientVpnTargetNetworksInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeFleetHistory struct { -} - -func (*validateOpDescribeFleetHistory) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeFleetHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeFleetHistoryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeFleetHistoryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeFleetInstances struct { -} - -func (*validateOpDescribeFleetInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeFleetInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeFleetInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeFleetInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeFpgaImageAttribute struct { -} - -func (*validateOpDescribeFpgaImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeFpgaImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeFpgaImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeFpgaImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeIdentityIdFormat struct { -} - -func (*validateOpDescribeIdentityIdFormat) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeIdentityIdFormat) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeIdentityIdFormatInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeIdentityIdFormatInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeImageAttribute struct { -} - -func (*validateOpDescribeImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeInstanceAttribute struct { -} - -func (*validateOpDescribeInstanceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeInstanceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeInstanceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeInstanceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeNetworkInterfaceAttribute struct { -} - -func (*validateOpDescribeNetworkInterfaceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeNetworkInterfaceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeNetworkInterfaceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeNetworkInterfaceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeScheduledInstanceAvailability struct { -} - -func (*validateOpDescribeScheduledInstanceAvailability) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeScheduledInstanceAvailability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeScheduledInstanceAvailabilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeScheduledInstanceAvailabilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeSecurityGroupReferences struct { -} - -func (*validateOpDescribeSecurityGroupReferences) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeSecurityGroupReferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeSecurityGroupReferencesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeSecurityGroupReferencesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeSnapshotAttribute struct { -} - -func (*validateOpDescribeSnapshotAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeSnapshotAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeSnapshotAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeSnapshotAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeSpotFleetInstances struct { -} - -func (*validateOpDescribeSpotFleetInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeSpotFleetInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeSpotFleetInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeSpotFleetInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeSpotFleetRequestHistory struct { -} - -func (*validateOpDescribeSpotFleetRequestHistory) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeSpotFleetRequestHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeSpotFleetRequestHistoryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeSpotFleetRequestHistoryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeStaleSecurityGroups struct { -} - -func (*validateOpDescribeStaleSecurityGroups) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeStaleSecurityGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeStaleSecurityGroupsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeStaleSecurityGroupsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeVolumeAttribute struct { -} - -func (*validateOpDescribeVolumeAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeVolumeAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeVolumeAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeVolumeAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeVpcAttribute struct { -} - -func (*validateOpDescribeVpcAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeVpcAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeVpcAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeVpcAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeVpcEndpointServicePermissions struct { -} - -func (*validateOpDescribeVpcEndpointServicePermissions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeVpcEndpointServicePermissions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeVpcEndpointServicePermissionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeVpcEndpointServicePermissionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachClassicLinkVpc struct { -} - -func (*validateOpDetachClassicLinkVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachClassicLinkVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachClassicLinkVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachClassicLinkVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachInternetGateway struct { -} - -func (*validateOpDetachInternetGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachInternetGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachInternetGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachInternetGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachNetworkInterface struct { -} - -func (*validateOpDetachNetworkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachNetworkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachNetworkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachVerifiedAccessTrustProvider struct { -} - -func (*validateOpDetachVerifiedAccessTrustProvider) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachVerifiedAccessTrustProviderInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachVolume struct { -} - -func (*validateOpDetachVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachVpnGateway struct { -} - -func (*validateOpDetachVpnGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachVpnGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachVpnGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachVpnGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableAddressTransfer struct { -} - -func (*validateOpDisableAddressTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableAddressTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableAddressTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableAddressTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableFastLaunch struct { -} - -func (*validateOpDisableFastLaunch) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableFastLaunch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableFastLaunchInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableFastLaunchInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableFastSnapshotRestores struct { -} - -func (*validateOpDisableFastSnapshotRestores) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableFastSnapshotRestores) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableFastSnapshotRestoresInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableFastSnapshotRestoresInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableImageDeprecation struct { -} - -func (*validateOpDisableImageDeprecation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableImageDeprecation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableImageDeprecationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableImageDeprecationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableImageDeregistrationProtection struct { -} - -func (*validateOpDisableImageDeregistrationProtection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableImageDeregistrationProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableImageDeregistrationProtectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableImageDeregistrationProtectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableImage struct { -} - -func (*validateOpDisableImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableIpamOrganizationAdminAccount struct { -} - -func (*validateOpDisableIpamOrganizationAdminAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableIpamOrganizationAdminAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableIpamOrganizationAdminAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableIpamOrganizationAdminAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableRouteServerPropagation struct { -} - -func (*validateOpDisableRouteServerPropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableRouteServerPropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableRouteServerPropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableRouteServerPropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableTransitGatewayRouteTablePropagation struct { -} - -func (*validateOpDisableTransitGatewayRouteTablePropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableTransitGatewayRouteTablePropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableTransitGatewayRouteTablePropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableTransitGatewayRouteTablePropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableVgwRoutePropagation struct { -} - -func (*validateOpDisableVgwRoutePropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableVgwRoutePropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableVgwRoutePropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableVgwRoutePropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableVpcClassicLink struct { -} - -func (*validateOpDisableVpcClassicLink) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableVpcClassicLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableVpcClassicLinkInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableVpcClassicLinkInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateCapacityReservationBillingOwner struct { -} - -func (*validateOpDisassociateCapacityReservationBillingOwner) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateCapacityReservationBillingOwner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateCapacityReservationBillingOwnerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateCapacityReservationBillingOwnerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateClientVpnTargetNetwork struct { -} - -func (*validateOpDisassociateClientVpnTargetNetwork) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateClientVpnTargetNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateClientVpnTargetNetworkInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateClientVpnTargetNetworkInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateEnclaveCertificateIamRole struct { -} - -func (*validateOpDisassociateEnclaveCertificateIamRole) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateEnclaveCertificateIamRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateEnclaveCertificateIamRoleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateEnclaveCertificateIamRoleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateIamInstanceProfile struct { -} - -func (*validateOpDisassociateIamInstanceProfile) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateIamInstanceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateIamInstanceProfileInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateIamInstanceProfileInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateInstanceEventWindow struct { -} - -func (*validateOpDisassociateInstanceEventWindow) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateInstanceEventWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateInstanceEventWindowInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateInstanceEventWindowInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateIpamByoasn struct { -} - -func (*validateOpDisassociateIpamByoasn) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateIpamByoasnInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateIpamByoasnInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateIpamResourceDiscovery struct { -} - -func (*validateOpDisassociateIpamResourceDiscovery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateIpamResourceDiscoveryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateNatGatewayAddress struct { -} - -func (*validateOpDisassociateNatGatewayAddress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateNatGatewayAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateNatGatewayAddressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateNatGatewayAddressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateRouteServer struct { -} - -func (*validateOpDisassociateRouteServer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateRouteServerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateRouteTable struct { -} - -func (*validateOpDisassociateRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateSecurityGroupVpc struct { -} - -func (*validateOpDisassociateSecurityGroupVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateSecurityGroupVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateSecurityGroupVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateSecurityGroupVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateSubnetCidrBlock struct { -} - -func (*validateOpDisassociateSubnetCidrBlock) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateSubnetCidrBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateSubnetCidrBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateSubnetCidrBlockInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateTransitGatewayMulticastDomain struct { -} - -func (*validateOpDisassociateTransitGatewayMulticastDomain) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateTransitGatewayMulticastDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateTransitGatewayMulticastDomainInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateTransitGatewayMulticastDomainInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateTransitGatewayPolicyTable struct { -} - -func (*validateOpDisassociateTransitGatewayPolicyTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateTransitGatewayPolicyTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateTransitGatewayPolicyTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateTransitGatewayPolicyTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateTransitGatewayRouteTable struct { -} - -func (*validateOpDisassociateTransitGatewayRouteTable) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateTransitGatewayRouteTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateTransitGatewayRouteTableInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateTransitGatewayRouteTableInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateTrunkInterface struct { -} - -func (*validateOpDisassociateTrunkInterface) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateTrunkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateTrunkInterfaceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateTrunkInterfaceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateVpcCidrBlock struct { -} - -func (*validateOpDisassociateVpcCidrBlock) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateVpcCidrBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateVpcCidrBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateVpcCidrBlockInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableAddressTransfer struct { -} - -func (*validateOpEnableAddressTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableAddressTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableAddressTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableAddressTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableAllowedImagesSettings struct { -} - -func (*validateOpEnableAllowedImagesSettings) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableAllowedImagesSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableAllowedImagesSettingsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableAllowedImagesSettingsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableFastLaunch struct { -} - -func (*validateOpEnableFastLaunch) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableFastLaunch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableFastLaunchInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableFastLaunchInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableFastSnapshotRestores struct { -} - -func (*validateOpEnableFastSnapshotRestores) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableFastSnapshotRestores) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableFastSnapshotRestoresInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableFastSnapshotRestoresInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableImageBlockPublicAccess struct { -} - -func (*validateOpEnableImageBlockPublicAccess) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableImageBlockPublicAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableImageBlockPublicAccessInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableImageBlockPublicAccessInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableImageDeprecation struct { -} - -func (*validateOpEnableImageDeprecation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableImageDeprecation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableImageDeprecationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableImageDeprecationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableImageDeregistrationProtection struct { -} - -func (*validateOpEnableImageDeregistrationProtection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableImageDeregistrationProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableImageDeregistrationProtectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableImageDeregistrationProtectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableImage struct { -} - -func (*validateOpEnableImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableIpamOrganizationAdminAccount struct { -} - -func (*validateOpEnableIpamOrganizationAdminAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableIpamOrganizationAdminAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableIpamOrganizationAdminAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableIpamOrganizationAdminAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableRouteServerPropagation struct { -} - -func (*validateOpEnableRouteServerPropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableRouteServerPropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableRouteServerPropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableRouteServerPropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableSnapshotBlockPublicAccess struct { -} - -func (*validateOpEnableSnapshotBlockPublicAccess) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableSnapshotBlockPublicAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableSnapshotBlockPublicAccessInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableSnapshotBlockPublicAccessInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableTransitGatewayRouteTablePropagation struct { -} - -func (*validateOpEnableTransitGatewayRouteTablePropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableTransitGatewayRouteTablePropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableTransitGatewayRouteTablePropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableTransitGatewayRouteTablePropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableVgwRoutePropagation struct { -} - -func (*validateOpEnableVgwRoutePropagation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableVgwRoutePropagation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableVgwRoutePropagationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableVgwRoutePropagationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableVolumeIO struct { -} - -func (*validateOpEnableVolumeIO) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableVolumeIO) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableVolumeIOInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableVolumeIOInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableVpcClassicLink struct { -} - -func (*validateOpEnableVpcClassicLink) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableVpcClassicLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableVpcClassicLinkInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableVpcClassicLinkInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpExportClientVpnClientCertificateRevocationList struct { -} - -func (*validateOpExportClientVpnClientCertificateRevocationList) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpExportClientVpnClientCertificateRevocationList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ExportClientVpnClientCertificateRevocationListInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpExportClientVpnClientCertificateRevocationListInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpExportClientVpnClientConfiguration struct { -} - -func (*validateOpExportClientVpnClientConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpExportClientVpnClientConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ExportClientVpnClientConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpExportClientVpnClientConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpExportImage struct { -} - -func (*validateOpExportImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpExportImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ExportImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpExportImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpExportTransitGatewayRoutes struct { -} - -func (*validateOpExportTransitGatewayRoutes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpExportTransitGatewayRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ExportTransitGatewayRoutesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpExportTransitGatewayRoutesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpExportVerifiedAccessInstanceClientConfiguration struct { -} - -func (*validateOpExportVerifiedAccessInstanceClientConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpExportVerifiedAccessInstanceClientConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ExportVerifiedAccessInstanceClientConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpExportVerifiedAccessInstanceClientConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetActiveVpnTunnelStatus struct { -} - -func (*validateOpGetActiveVpnTunnelStatus) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetActiveVpnTunnelStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetActiveVpnTunnelStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetActiveVpnTunnelStatusInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetAssociatedEnclaveCertificateIamRoles struct { -} - -func (*validateOpGetAssociatedEnclaveCertificateIamRoles) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetAssociatedEnclaveCertificateIamRoles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetAssociatedEnclaveCertificateIamRolesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetAssociatedEnclaveCertificateIamRolesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetAssociatedIpv6PoolCidrs struct { -} - -func (*validateOpGetAssociatedIpv6PoolCidrs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetAssociatedIpv6PoolCidrs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetAssociatedIpv6PoolCidrsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetAssociatedIpv6PoolCidrsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCapacityReservationUsage struct { -} - -func (*validateOpGetCapacityReservationUsage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCapacityReservationUsage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCapacityReservationUsageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCapacityReservationUsageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCoipPoolUsage struct { -} - -func (*validateOpGetCoipPoolUsage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCoipPoolUsage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCoipPoolUsageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCoipPoolUsageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetConsoleOutput struct { -} - -func (*validateOpGetConsoleOutput) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetConsoleOutput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetConsoleOutputInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetConsoleOutputInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetConsoleScreenshot struct { -} - -func (*validateOpGetConsoleScreenshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetConsoleScreenshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetConsoleScreenshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetConsoleScreenshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDeclarativePoliciesReportSummary struct { -} - -func (*validateOpGetDeclarativePoliciesReportSummary) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDeclarativePoliciesReportSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDeclarativePoliciesReportSummaryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDeclarativePoliciesReportSummaryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDefaultCreditSpecification struct { -} - -func (*validateOpGetDefaultCreditSpecification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDefaultCreditSpecification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDefaultCreditSpecificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDefaultCreditSpecificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetFlowLogsIntegrationTemplate struct { -} - -func (*validateOpGetFlowLogsIntegrationTemplate) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetFlowLogsIntegrationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetFlowLogsIntegrationTemplateInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetFlowLogsIntegrationTemplateInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetGroupsForCapacityReservation struct { -} - -func (*validateOpGetGroupsForCapacityReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetGroupsForCapacityReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetGroupsForCapacityReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetGroupsForCapacityReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetHostReservationPurchasePreview struct { -} - -func (*validateOpGetHostReservationPurchasePreview) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetHostReservationPurchasePreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetHostReservationPurchasePreviewInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetHostReservationPurchasePreviewInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetInstanceTpmEkPub struct { -} - -func (*validateOpGetInstanceTpmEkPub) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetInstanceTpmEkPub) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetInstanceTpmEkPubInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetInstanceTpmEkPubInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetInstanceTypesFromInstanceRequirements struct { -} - -func (*validateOpGetInstanceTypesFromInstanceRequirements) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetInstanceTypesFromInstanceRequirements) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetInstanceTypesFromInstanceRequirementsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetInstanceTypesFromInstanceRequirementsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetInstanceUefiData struct { -} - -func (*validateOpGetInstanceUefiData) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetInstanceUefiData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetInstanceUefiDataInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetInstanceUefiDataInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamAddressHistory struct { -} - -func (*validateOpGetIpamAddressHistory) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamAddressHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamAddressHistoryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamAddressHistoryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamDiscoveredAccounts struct { -} - -func (*validateOpGetIpamDiscoveredAccounts) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamDiscoveredAccounts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamDiscoveredAccountsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamDiscoveredAccountsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamDiscoveredPublicAddresses struct { -} - -func (*validateOpGetIpamDiscoveredPublicAddresses) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamDiscoveredPublicAddresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamDiscoveredPublicAddressesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamDiscoveredPublicAddressesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamDiscoveredResourceCidrs struct { -} - -func (*validateOpGetIpamDiscoveredResourceCidrs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamDiscoveredResourceCidrs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamDiscoveredResourceCidrsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamDiscoveredResourceCidrsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamPoolAllocations struct { -} - -func (*validateOpGetIpamPoolAllocations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamPoolAllocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamPoolAllocationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamPoolAllocationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamPoolCidrs struct { -} - -func (*validateOpGetIpamPoolCidrs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamPoolCidrs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamPoolCidrsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamPoolCidrsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetIpamResourceCidrs struct { -} - -func (*validateOpGetIpamResourceCidrs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetIpamResourceCidrs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetIpamResourceCidrsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetIpamResourceCidrsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetLaunchTemplateData struct { -} - -func (*validateOpGetLaunchTemplateData) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetLaunchTemplateData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetLaunchTemplateDataInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetLaunchTemplateDataInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetManagedPrefixListAssociations struct { -} - -func (*validateOpGetManagedPrefixListAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetManagedPrefixListAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetManagedPrefixListAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetManagedPrefixListAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetManagedPrefixListEntries struct { -} - -func (*validateOpGetManagedPrefixListEntries) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetManagedPrefixListEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetManagedPrefixListEntriesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetManagedPrefixListEntriesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetNetworkInsightsAccessScopeAnalysisFindings struct { -} - -func (*validateOpGetNetworkInsightsAccessScopeAnalysisFindings) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetNetworkInsightsAccessScopeAnalysisFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetNetworkInsightsAccessScopeAnalysisFindingsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetNetworkInsightsAccessScopeAnalysisFindingsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetNetworkInsightsAccessScopeContent struct { -} - -func (*validateOpGetNetworkInsightsAccessScopeContent) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetNetworkInsightsAccessScopeContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetNetworkInsightsAccessScopeContentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetNetworkInsightsAccessScopeContentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetPasswordData struct { -} - -func (*validateOpGetPasswordData) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetPasswordData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetPasswordDataInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetPasswordDataInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetReservedInstancesExchangeQuote struct { -} - -func (*validateOpGetReservedInstancesExchangeQuote) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetReservedInstancesExchangeQuote) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetReservedInstancesExchangeQuoteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetReservedInstancesExchangeQuoteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetRouteServerAssociations struct { -} - -func (*validateOpGetRouteServerAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetRouteServerAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetRouteServerAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetRouteServerAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetRouteServerPropagations struct { -} - -func (*validateOpGetRouteServerPropagations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetRouteServerPropagations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetRouteServerPropagationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetRouteServerPropagationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetRouteServerRoutingDatabase struct { -} - -func (*validateOpGetRouteServerRoutingDatabase) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetRouteServerRoutingDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetRouteServerRoutingDatabaseInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetRouteServerRoutingDatabaseInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSecurityGroupsForVpc struct { -} - -func (*validateOpGetSecurityGroupsForVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSecurityGroupsForVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSecurityGroupsForVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSecurityGroupsForVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSpotPlacementScores struct { -} - -func (*validateOpGetSpotPlacementScores) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSpotPlacementScores) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSpotPlacementScoresInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSpotPlacementScoresInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSubnetCidrReservations struct { -} - -func (*validateOpGetSubnetCidrReservations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSubnetCidrReservations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSubnetCidrReservationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSubnetCidrReservationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayAttachmentPropagations struct { -} - -func (*validateOpGetTransitGatewayAttachmentPropagations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayAttachmentPropagations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayAttachmentPropagationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayAttachmentPropagationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayMulticastDomainAssociations struct { -} - -func (*validateOpGetTransitGatewayMulticastDomainAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayMulticastDomainAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayMulticastDomainAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayMulticastDomainAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayPolicyTableAssociations struct { -} - -func (*validateOpGetTransitGatewayPolicyTableAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayPolicyTableAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayPolicyTableAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayPolicyTableAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayPolicyTableEntries struct { -} - -func (*validateOpGetTransitGatewayPolicyTableEntries) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayPolicyTableEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayPolicyTableEntriesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayPolicyTableEntriesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayPrefixListReferences struct { -} - -func (*validateOpGetTransitGatewayPrefixListReferences) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayPrefixListReferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayPrefixListReferencesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayPrefixListReferencesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayRouteTableAssociations struct { -} - -func (*validateOpGetTransitGatewayRouteTableAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayRouteTableAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayRouteTableAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayRouteTableAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTransitGatewayRouteTablePropagations struct { -} - -func (*validateOpGetTransitGatewayRouteTablePropagations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTransitGatewayRouteTablePropagations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTransitGatewayRouteTablePropagationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTransitGatewayRouteTablePropagationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetVerifiedAccessEndpointPolicy struct { -} - -func (*validateOpGetVerifiedAccessEndpointPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetVerifiedAccessEndpointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetVerifiedAccessEndpointPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetVerifiedAccessEndpointPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetVerifiedAccessEndpointTargets struct { -} - -func (*validateOpGetVerifiedAccessEndpointTargets) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetVerifiedAccessEndpointTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetVerifiedAccessEndpointTargetsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetVerifiedAccessEndpointTargetsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetVerifiedAccessGroupPolicy struct { -} - -func (*validateOpGetVerifiedAccessGroupPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetVerifiedAccessGroupPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetVerifiedAccessGroupPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetVerifiedAccessGroupPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetVpnConnectionDeviceSampleConfiguration struct { -} - -func (*validateOpGetVpnConnectionDeviceSampleConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetVpnConnectionDeviceSampleConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetVpnConnectionDeviceSampleConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetVpnConnectionDeviceSampleConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetVpnTunnelReplacementStatus struct { -} - -func (*validateOpGetVpnTunnelReplacementStatus) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetVpnTunnelReplacementStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetVpnTunnelReplacementStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetVpnTunnelReplacementStatusInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpImportClientVpnClientCertificateRevocationList struct { -} - -func (*validateOpImportClientVpnClientCertificateRevocationList) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpImportClientVpnClientCertificateRevocationList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ImportClientVpnClientCertificateRevocationListInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpImportClientVpnClientCertificateRevocationListInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpImportInstance struct { -} - -func (*validateOpImportInstance) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpImportInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ImportInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpImportInstanceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpImportKeyPair struct { -} - -func (*validateOpImportKeyPair) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpImportKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ImportKeyPairInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpImportKeyPairInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpImportVolume struct { -} - -func (*validateOpImportVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpImportVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ImportVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpImportVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpLockSnapshot struct { -} - -func (*validateOpLockSnapshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpLockSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*LockSnapshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpLockSnapshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyAddressAttribute struct { -} - -func (*validateOpModifyAddressAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyAddressAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyAddressAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyAddressAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyAvailabilityZoneGroup struct { -} - -func (*validateOpModifyAvailabilityZoneGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyAvailabilityZoneGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyAvailabilityZoneGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyAvailabilityZoneGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyCapacityReservationFleet struct { -} - -func (*validateOpModifyCapacityReservationFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyCapacityReservationFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyCapacityReservationFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyCapacityReservationFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyCapacityReservation struct { -} - -func (*validateOpModifyCapacityReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyCapacityReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyCapacityReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyCapacityReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyClientVpnEndpoint struct { -} - -func (*validateOpModifyClientVpnEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyClientVpnEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyClientVpnEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyClientVpnEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyDefaultCreditSpecification struct { -} - -func (*validateOpModifyDefaultCreditSpecification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyDefaultCreditSpecification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyDefaultCreditSpecificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyDefaultCreditSpecificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyEbsDefaultKmsKeyId struct { -} - -func (*validateOpModifyEbsDefaultKmsKeyId) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyEbsDefaultKmsKeyId) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyEbsDefaultKmsKeyIdInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyEbsDefaultKmsKeyIdInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyFleet struct { -} - -func (*validateOpModifyFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyFpgaImageAttribute struct { -} - -func (*validateOpModifyFpgaImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyFpgaImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyFpgaImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyFpgaImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyHosts struct { -} - -func (*validateOpModifyHosts) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyHosts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyHostsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyHostsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIdentityIdFormat struct { -} - -func (*validateOpModifyIdentityIdFormat) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIdentityIdFormat) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIdentityIdFormatInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIdentityIdFormatInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIdFormat struct { -} - -func (*validateOpModifyIdFormat) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIdFormat) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIdFormatInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIdFormatInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyImageAttribute struct { -} - -func (*validateOpModifyImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceAttribute struct { -} - -func (*validateOpModifyInstanceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceCapacityReservationAttributes struct { -} - -func (*validateOpModifyInstanceCapacityReservationAttributes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceCapacityReservationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceCapacityReservationAttributesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceCapacityReservationAttributesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceCpuOptions struct { -} - -func (*validateOpModifyInstanceCpuOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceCpuOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceCpuOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceCpuOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceCreditSpecification struct { -} - -func (*validateOpModifyInstanceCreditSpecification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceCreditSpecification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceCreditSpecificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceCreditSpecificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceEventStartTime struct { -} - -func (*validateOpModifyInstanceEventStartTime) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceEventStartTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceEventStartTimeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceEventStartTimeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceEventWindow struct { -} - -func (*validateOpModifyInstanceEventWindow) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceEventWindow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceEventWindowInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceEventWindowInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceMaintenanceOptions struct { -} - -func (*validateOpModifyInstanceMaintenanceOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceMaintenanceOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceMaintenanceOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceMaintenanceOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceMetadataOptions struct { -} - -func (*validateOpModifyInstanceMetadataOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceMetadataOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceMetadataOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceMetadataOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstanceNetworkPerformanceOptions struct { -} - -func (*validateOpModifyInstanceNetworkPerformanceOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstanceNetworkPerformanceOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstanceNetworkPerformanceOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstanceNetworkPerformanceOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyInstancePlacement struct { -} - -func (*validateOpModifyInstancePlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyInstancePlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyInstancePlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyInstancePlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIpam struct { -} - -func (*validateOpModifyIpam) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIpam) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIpamInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIpamInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIpamPool struct { -} - -func (*validateOpModifyIpamPool) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIpamPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIpamPoolInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIpamPoolInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIpamResourceCidr struct { -} - -func (*validateOpModifyIpamResourceCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIpamResourceCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIpamResourceCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIpamResourceCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIpamResourceDiscovery struct { -} - -func (*validateOpModifyIpamResourceDiscovery) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIpamResourceDiscovery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIpamResourceDiscoveryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIpamResourceDiscoveryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyIpamScope struct { -} - -func (*validateOpModifyIpamScope) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyIpamScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyIpamScopeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyIpamScopeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyLocalGatewayRoute struct { -} - -func (*validateOpModifyLocalGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyLocalGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyLocalGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyLocalGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyManagedPrefixList struct { -} - -func (*validateOpModifyManagedPrefixList) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyManagedPrefixList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyManagedPrefixListInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyManagedPrefixListInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyNetworkInterfaceAttribute struct { -} - -func (*validateOpModifyNetworkInterfaceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyNetworkInterfaceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyNetworkInterfaceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyNetworkInterfaceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyPrivateDnsNameOptions struct { -} - -func (*validateOpModifyPrivateDnsNameOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyPrivateDnsNameOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyPrivateDnsNameOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyPrivateDnsNameOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyPublicIpDnsNameOptions struct { -} - -func (*validateOpModifyPublicIpDnsNameOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyPublicIpDnsNameOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyPublicIpDnsNameOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyPublicIpDnsNameOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyReservedInstances struct { -} - -func (*validateOpModifyReservedInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyReservedInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyReservedInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyReservedInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyRouteServer struct { -} - -func (*validateOpModifyRouteServer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyRouteServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyRouteServerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyRouteServerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifySecurityGroupRules struct { -} - -func (*validateOpModifySecurityGroupRules) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifySecurityGroupRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifySecurityGroupRulesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifySecurityGroupRulesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifySnapshotAttribute struct { -} - -func (*validateOpModifySnapshotAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifySnapshotAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifySnapshotAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifySnapshotAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifySnapshotTier struct { -} - -func (*validateOpModifySnapshotTier) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifySnapshotTier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifySnapshotTierInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifySnapshotTierInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifySpotFleetRequest struct { -} - -func (*validateOpModifySpotFleetRequest) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifySpotFleetRequest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifySpotFleetRequestInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifySpotFleetRequestInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifySubnetAttribute struct { -} - -func (*validateOpModifySubnetAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifySubnetAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifySubnetAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifySubnetAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTrafficMirrorFilterNetworkServices struct { -} - -func (*validateOpModifyTrafficMirrorFilterNetworkServices) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTrafficMirrorFilterNetworkServices) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTrafficMirrorFilterNetworkServicesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTrafficMirrorFilterNetworkServicesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTrafficMirrorFilterRule struct { -} - -func (*validateOpModifyTrafficMirrorFilterRule) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTrafficMirrorFilterRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTrafficMirrorFilterRuleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTrafficMirrorFilterRuleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTrafficMirrorSession struct { -} - -func (*validateOpModifyTrafficMirrorSession) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTrafficMirrorSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTrafficMirrorSessionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTrafficMirrorSessionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTransitGateway struct { -} - -func (*validateOpModifyTransitGateway) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTransitGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTransitGatewayInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTransitGatewayInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTransitGatewayPrefixListReference struct { -} - -func (*validateOpModifyTransitGatewayPrefixListReference) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTransitGatewayPrefixListReference) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTransitGatewayPrefixListReferenceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTransitGatewayPrefixListReferenceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyTransitGatewayVpcAttachment struct { -} - -func (*validateOpModifyTransitGatewayVpcAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyTransitGatewayVpcAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyTransitGatewayVpcAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyTransitGatewayVpcAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessEndpoint struct { -} - -func (*validateOpModifyVerifiedAccessEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessEndpointPolicy struct { -} - -func (*validateOpModifyVerifiedAccessEndpointPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessEndpointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessEndpointPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessEndpointPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessGroup struct { -} - -func (*validateOpModifyVerifiedAccessGroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessGroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessGroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessGroupPolicy struct { -} - -func (*validateOpModifyVerifiedAccessGroupPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessGroupPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessGroupPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessGroupPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessInstance struct { -} - -func (*validateOpModifyVerifiedAccessInstance) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessInstanceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessInstanceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessInstanceLoggingConfiguration struct { -} - -func (*validateOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessInstanceLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessInstanceLoggingConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessInstanceLoggingConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVerifiedAccessTrustProvider struct { -} - -func (*validateOpModifyVerifiedAccessTrustProvider) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVerifiedAccessTrustProvider) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVerifiedAccessTrustProviderInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVerifiedAccessTrustProviderInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVolumeAttribute struct { -} - -func (*validateOpModifyVolumeAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVolumeAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVolumeAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVolumeAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVolume struct { -} - -func (*validateOpModifyVolume) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVolumeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVolumeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcAttribute struct { -} - -func (*validateOpModifyVpcAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcBlockPublicAccessExclusion struct { -} - -func (*validateOpModifyVpcBlockPublicAccessExclusion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcBlockPublicAccessExclusion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcBlockPublicAccessExclusionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcBlockPublicAccessExclusionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcBlockPublicAccessOptions struct { -} - -func (*validateOpModifyVpcBlockPublicAccessOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcBlockPublicAccessOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcBlockPublicAccessOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcBlockPublicAccessOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcEndpointConnectionNotification struct { -} - -func (*validateOpModifyVpcEndpointConnectionNotification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcEndpointConnectionNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcEndpointConnectionNotificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcEndpointConnectionNotificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcEndpoint struct { -} - -func (*validateOpModifyVpcEndpoint) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcEndpointInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcEndpointInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcEndpointServiceConfiguration struct { -} - -func (*validateOpModifyVpcEndpointServiceConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcEndpointServiceConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcEndpointServiceConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcEndpointServiceConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcEndpointServicePayerResponsibility struct { -} - -func (*validateOpModifyVpcEndpointServicePayerResponsibility) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcEndpointServicePayerResponsibility) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcEndpointServicePayerResponsibilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcEndpointServicePayerResponsibilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcEndpointServicePermissions struct { -} - -func (*validateOpModifyVpcEndpointServicePermissions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcEndpointServicePermissions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcEndpointServicePermissionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcEndpointServicePermissionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcPeeringConnectionOptions struct { -} - -func (*validateOpModifyVpcPeeringConnectionOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcPeeringConnectionOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcPeeringConnectionOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcPeeringConnectionOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpcTenancy struct { -} - -func (*validateOpModifyVpcTenancy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpcTenancy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpcTenancyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpcTenancyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpnConnection struct { -} - -func (*validateOpModifyVpnConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpnConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpnConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpnConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpnConnectionOptions struct { -} - -func (*validateOpModifyVpnConnectionOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpnConnectionOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpnConnectionOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpnConnectionOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpnTunnelCertificate struct { -} - -func (*validateOpModifyVpnTunnelCertificate) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpnTunnelCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpnTunnelCertificateInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpnTunnelCertificateInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpModifyVpnTunnelOptions struct { -} - -func (*validateOpModifyVpnTunnelOptions) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpModifyVpnTunnelOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ModifyVpnTunnelOptionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpModifyVpnTunnelOptionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpMonitorInstances struct { -} - -func (*validateOpMonitorInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpMonitorInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*MonitorInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpMonitorInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpMoveAddressToVpc struct { -} - -func (*validateOpMoveAddressToVpc) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpMoveAddressToVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*MoveAddressToVpcInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpMoveAddressToVpcInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpMoveByoipCidrToIpam struct { -} - -func (*validateOpMoveByoipCidrToIpam) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpMoveByoipCidrToIpam) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*MoveByoipCidrToIpamInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpMoveByoipCidrToIpamInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpMoveCapacityReservationInstances struct { -} - -func (*validateOpMoveCapacityReservationInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpMoveCapacityReservationInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*MoveCapacityReservationInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpMoveCapacityReservationInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpProvisionByoipCidr struct { -} - -func (*validateOpProvisionByoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpProvisionByoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ProvisionByoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpProvisionByoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpProvisionIpamByoasn struct { -} - -func (*validateOpProvisionIpamByoasn) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpProvisionIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ProvisionIpamByoasnInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpProvisionIpamByoasnInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpProvisionIpamPoolCidr struct { -} - -func (*validateOpProvisionIpamPoolCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpProvisionIpamPoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ProvisionIpamPoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpProvisionIpamPoolCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpProvisionPublicIpv4PoolCidr struct { -} - -func (*validateOpProvisionPublicIpv4PoolCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpProvisionPublicIpv4PoolCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ProvisionPublicIpv4PoolCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpProvisionPublicIpv4PoolCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPurchaseCapacityBlockExtension struct { -} - -func (*validateOpPurchaseCapacityBlockExtension) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPurchaseCapacityBlockExtension) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PurchaseCapacityBlockExtensionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPurchaseCapacityBlockExtensionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPurchaseCapacityBlock struct { -} - -func (*validateOpPurchaseCapacityBlock) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPurchaseCapacityBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PurchaseCapacityBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPurchaseCapacityBlockInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPurchaseHostReservation struct { -} - -func (*validateOpPurchaseHostReservation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPurchaseHostReservation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PurchaseHostReservationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPurchaseHostReservationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPurchaseReservedInstancesOffering struct { -} - -func (*validateOpPurchaseReservedInstancesOffering) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPurchaseReservedInstancesOffering) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PurchaseReservedInstancesOfferingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPurchaseReservedInstancesOfferingInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPurchaseScheduledInstances struct { -} - -func (*validateOpPurchaseScheduledInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPurchaseScheduledInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PurchaseScheduledInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPurchaseScheduledInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRebootInstances struct { -} - -func (*validateOpRebootInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRebootInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RebootInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRebootInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterImage struct { -} - -func (*validateOpRegisterImage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterImageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterImageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterInstanceEventNotificationAttributes struct { -} - -func (*validateOpRegisterInstanceEventNotificationAttributes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterInstanceEventNotificationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterInstanceEventNotificationAttributesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterInstanceEventNotificationAttributesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterTransitGatewayMulticastGroupMembers struct { -} - -func (*validateOpRegisterTransitGatewayMulticastGroupMembers) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterTransitGatewayMulticastGroupMembers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterTransitGatewayMulticastGroupMembersInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterTransitGatewayMulticastGroupMembersInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterTransitGatewayMulticastGroupSources struct { -} - -func (*validateOpRegisterTransitGatewayMulticastGroupSources) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterTransitGatewayMulticastGroupSources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterTransitGatewayMulticastGroupSourcesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterTransitGatewayMulticastGroupSourcesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRejectCapacityReservationBillingOwnership struct { -} - -func (*validateOpRejectCapacityReservationBillingOwnership) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRejectCapacityReservationBillingOwnership) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RejectCapacityReservationBillingOwnershipInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRejectCapacityReservationBillingOwnershipInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRejectTransitGatewayPeeringAttachment struct { -} - -func (*validateOpRejectTransitGatewayPeeringAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRejectTransitGatewayPeeringAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RejectTransitGatewayPeeringAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRejectTransitGatewayPeeringAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRejectTransitGatewayVpcAttachment struct { -} - -func (*validateOpRejectTransitGatewayVpcAttachment) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRejectTransitGatewayVpcAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RejectTransitGatewayVpcAttachmentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRejectTransitGatewayVpcAttachmentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRejectVpcEndpointConnections struct { -} - -func (*validateOpRejectVpcEndpointConnections) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRejectVpcEndpointConnections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RejectVpcEndpointConnectionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRejectVpcEndpointConnectionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRejectVpcPeeringConnection struct { -} - -func (*validateOpRejectVpcPeeringConnection) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRejectVpcPeeringConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RejectVpcPeeringConnectionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRejectVpcPeeringConnectionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReleaseHosts struct { -} - -func (*validateOpReleaseHosts) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReleaseHosts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReleaseHostsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReleaseHostsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReleaseIpamPoolAllocation struct { -} - -func (*validateOpReleaseIpamPoolAllocation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReleaseIpamPoolAllocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReleaseIpamPoolAllocationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReleaseIpamPoolAllocationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceIamInstanceProfileAssociation struct { -} - -func (*validateOpReplaceIamInstanceProfileAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceIamInstanceProfileAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceIamInstanceProfileAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceIamInstanceProfileAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceNetworkAclAssociation struct { -} - -func (*validateOpReplaceNetworkAclAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceNetworkAclAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceNetworkAclAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceNetworkAclAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceNetworkAclEntry struct { -} - -func (*validateOpReplaceNetworkAclEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceNetworkAclEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceNetworkAclEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceNetworkAclEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceRoute struct { -} - -func (*validateOpReplaceRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceRouteTableAssociation struct { -} - -func (*validateOpReplaceRouteTableAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceRouteTableAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceRouteTableAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceRouteTableAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceTransitGatewayRoute struct { -} - -func (*validateOpReplaceTransitGatewayRoute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceTransitGatewayRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceTransitGatewayRouteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceTransitGatewayRouteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReplaceVpnTunnel struct { -} - -func (*validateOpReplaceVpnTunnel) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReplaceVpnTunnel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReplaceVpnTunnelInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReplaceVpnTunnelInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpReportInstanceStatus struct { -} - -func (*validateOpReportInstanceStatus) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpReportInstanceStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ReportInstanceStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpReportInstanceStatusInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRequestSpotFleet struct { -} - -func (*validateOpRequestSpotFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRequestSpotFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RequestSpotFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRequestSpotFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRequestSpotInstances struct { -} - -func (*validateOpRequestSpotInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRequestSpotInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RequestSpotInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRequestSpotInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetAddressAttribute struct { -} - -func (*validateOpResetAddressAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetAddressAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetAddressAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetAddressAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetFpgaImageAttribute struct { -} - -func (*validateOpResetFpgaImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetFpgaImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetFpgaImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetFpgaImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetImageAttribute struct { -} - -func (*validateOpResetImageAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetImageAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetImageAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetImageAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetInstanceAttribute struct { -} - -func (*validateOpResetInstanceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetInstanceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetInstanceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetInstanceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetNetworkInterfaceAttribute struct { -} - -func (*validateOpResetNetworkInterfaceAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetNetworkInterfaceAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetNetworkInterfaceAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetNetworkInterfaceAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpResetSnapshotAttribute struct { -} - -func (*validateOpResetSnapshotAttribute) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpResetSnapshotAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ResetSnapshotAttributeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpResetSnapshotAttributeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRestoreAddressToClassic struct { -} - -func (*validateOpRestoreAddressToClassic) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRestoreAddressToClassic) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RestoreAddressToClassicInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRestoreAddressToClassicInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRestoreImageFromRecycleBin struct { -} - -func (*validateOpRestoreImageFromRecycleBin) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRestoreImageFromRecycleBin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RestoreImageFromRecycleBinInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRestoreImageFromRecycleBinInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRestoreManagedPrefixListVersion struct { -} - -func (*validateOpRestoreManagedPrefixListVersion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRestoreManagedPrefixListVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RestoreManagedPrefixListVersionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRestoreManagedPrefixListVersionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRestoreSnapshotFromRecycleBin struct { -} - -func (*validateOpRestoreSnapshotFromRecycleBin) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRestoreSnapshotFromRecycleBin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RestoreSnapshotFromRecycleBinInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRestoreSnapshotFromRecycleBinInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRestoreSnapshotTier struct { -} - -func (*validateOpRestoreSnapshotTier) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRestoreSnapshotTier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RestoreSnapshotTierInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRestoreSnapshotTierInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRevokeClientVpnIngress struct { -} - -func (*validateOpRevokeClientVpnIngress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRevokeClientVpnIngress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RevokeClientVpnIngressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRevokeClientVpnIngressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRevokeSecurityGroupEgress struct { -} - -func (*validateOpRevokeSecurityGroupEgress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRevokeSecurityGroupEgress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RevokeSecurityGroupEgressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRevokeSecurityGroupEgressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRunInstances struct { -} - -func (*validateOpRunInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRunInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RunInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRunInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRunScheduledInstances struct { -} - -func (*validateOpRunScheduledInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRunScheduledInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RunScheduledInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRunScheduledInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpSearchLocalGatewayRoutes struct { -} - -func (*validateOpSearchLocalGatewayRoutes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpSearchLocalGatewayRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*SearchLocalGatewayRoutesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpSearchLocalGatewayRoutesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpSearchTransitGatewayMulticastGroups struct { -} - -func (*validateOpSearchTransitGatewayMulticastGroups) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpSearchTransitGatewayMulticastGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*SearchTransitGatewayMulticastGroupsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpSearchTransitGatewayMulticastGroupsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpSearchTransitGatewayRoutes struct { -} - -func (*validateOpSearchTransitGatewayRoutes) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpSearchTransitGatewayRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*SearchTransitGatewayRoutesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpSearchTransitGatewayRoutesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpSendDiagnosticInterrupt struct { -} - -func (*validateOpSendDiagnosticInterrupt) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpSendDiagnosticInterrupt) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*SendDiagnosticInterruptInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpSendDiagnosticInterruptInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartDeclarativePoliciesReport struct { -} - -func (*validateOpStartDeclarativePoliciesReport) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartDeclarativePoliciesReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartDeclarativePoliciesReportInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartDeclarativePoliciesReportInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartInstances struct { -} - -func (*validateOpStartInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartNetworkInsightsAccessScopeAnalysis struct { -} - -func (*validateOpStartNetworkInsightsAccessScopeAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartNetworkInsightsAccessScopeAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartNetworkInsightsAccessScopeAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartNetworkInsightsAccessScopeAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartNetworkInsightsAnalysis struct { -} - -func (*validateOpStartNetworkInsightsAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartNetworkInsightsAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartNetworkInsightsAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartNetworkInsightsAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartVpcEndpointServicePrivateDnsVerification struct { -} - -func (*validateOpStartVpcEndpointServicePrivateDnsVerification) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartVpcEndpointServicePrivateDnsVerification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartVpcEndpointServicePrivateDnsVerificationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartVpcEndpointServicePrivateDnsVerificationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStopInstances struct { -} - -func (*validateOpStopInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStopInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StopInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStopInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTerminateClientVpnConnections struct { -} - -func (*validateOpTerminateClientVpnConnections) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTerminateClientVpnConnections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TerminateClientVpnConnectionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTerminateClientVpnConnectionsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTerminateInstances struct { -} - -func (*validateOpTerminateInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTerminateInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TerminateInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTerminateInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnassignIpv6Addresses struct { -} - -func (*validateOpUnassignIpv6Addresses) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnassignIpv6Addresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnassignIpv6AddressesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnassignIpv6AddressesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnassignPrivateIpAddresses struct { -} - -func (*validateOpUnassignPrivateIpAddresses) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnassignPrivateIpAddresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnassignPrivateIpAddressesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnassignPrivateIpAddressesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnassignPrivateNatGatewayAddress struct { -} - -func (*validateOpUnassignPrivateNatGatewayAddress) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnassignPrivateNatGatewayAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnassignPrivateNatGatewayAddressInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnassignPrivateNatGatewayAddressInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnlockSnapshot struct { -} - -func (*validateOpUnlockSnapshot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnlockSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnlockSnapshotInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnlockSnapshotInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnmonitorInstances struct { -} - -func (*validateOpUnmonitorInstances) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnmonitorInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnmonitorInstancesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnmonitorInstancesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpWithdrawByoipCidr struct { -} - -func (*validateOpWithdrawByoipCidr) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpWithdrawByoipCidr) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*WithdrawByoipCidrInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpWithdrawByoipCidrInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAcceptAddressTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptAddressTransfer{}, middleware.After) -} - -func addOpAcceptCapacityReservationBillingOwnershipValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptCapacityReservationBillingOwnership{}, middleware.After) -} - -func addOpAcceptReservedInstancesExchangeQuoteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptReservedInstancesExchangeQuote{}, middleware.After) -} - -func addOpAcceptTransitGatewayPeeringAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptTransitGatewayPeeringAttachment{}, middleware.After) -} - -func addOpAcceptTransitGatewayVpcAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptTransitGatewayVpcAttachment{}, middleware.After) -} - -func addOpAcceptVpcEndpointConnectionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptVpcEndpointConnections{}, middleware.After) -} - -func addOpAcceptVpcPeeringConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptVpcPeeringConnection{}, middleware.After) -} - -func addOpAdvertiseByoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAdvertiseByoipCidr{}, middleware.After) -} - -func addOpAllocateIpamPoolCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAllocateIpamPoolCidr{}, middleware.After) -} - -func addOpApplySecurityGroupsToClientVpnTargetNetworkValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpApplySecurityGroupsToClientVpnTargetNetwork{}, middleware.After) -} - -func addOpAssignIpv6AddressesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssignIpv6Addresses{}, middleware.After) -} - -func addOpAssignPrivateIpAddressesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssignPrivateIpAddresses{}, middleware.After) -} - -func addOpAssignPrivateNatGatewayAddressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssignPrivateNatGatewayAddress{}, middleware.After) -} - -func addOpAssociateCapacityReservationBillingOwnerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateCapacityReservationBillingOwner{}, middleware.After) -} - -func addOpAssociateClientVpnTargetNetworkValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateClientVpnTargetNetwork{}, middleware.After) -} - -func addOpAssociateDhcpOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateDhcpOptions{}, middleware.After) -} - -func addOpAssociateEnclaveCertificateIamRoleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateEnclaveCertificateIamRole{}, middleware.After) -} - -func addOpAssociateIamInstanceProfileValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateIamInstanceProfile{}, middleware.After) -} - -func addOpAssociateInstanceEventWindowValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateInstanceEventWindow{}, middleware.After) -} - -func addOpAssociateIpamByoasnValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateIpamByoasn{}, middleware.After) -} - -func addOpAssociateIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateIpamResourceDiscovery{}, middleware.After) -} - -func addOpAssociateNatGatewayAddressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateNatGatewayAddress{}, middleware.After) -} - -func addOpAssociateRouteServerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateRouteServer{}, middleware.After) -} - -func addOpAssociateRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateRouteTable{}, middleware.After) -} - -func addOpAssociateSecurityGroupVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateSecurityGroupVpc{}, middleware.After) -} - -func addOpAssociateSubnetCidrBlockValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateSubnetCidrBlock{}, middleware.After) -} - -func addOpAssociateTransitGatewayMulticastDomainValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateTransitGatewayMulticastDomain{}, middleware.After) -} - -func addOpAssociateTransitGatewayPolicyTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateTransitGatewayPolicyTable{}, middleware.After) -} - -func addOpAssociateTransitGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateTransitGatewayRouteTable{}, middleware.After) -} - -func addOpAssociateTrunkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateTrunkInterface{}, middleware.After) -} - -func addOpAssociateVpcCidrBlockValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateVpcCidrBlock{}, middleware.After) -} - -func addOpAttachClassicLinkVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachClassicLinkVpc{}, middleware.After) -} - -func addOpAttachInternetGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachInternetGateway{}, middleware.After) -} - -func addOpAttachNetworkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachNetworkInterface{}, middleware.After) -} - -func addOpAttachVerifiedAccessTrustProviderValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachVerifiedAccessTrustProvider{}, middleware.After) -} - -func addOpAttachVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachVolume{}, middleware.After) -} - -func addOpAttachVpnGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachVpnGateway{}, middleware.After) -} - -func addOpAuthorizeClientVpnIngressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAuthorizeClientVpnIngress{}, middleware.After) -} - -func addOpAuthorizeSecurityGroupEgressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAuthorizeSecurityGroupEgress{}, middleware.After) -} - -func addOpBundleInstanceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpBundleInstance{}, middleware.After) -} - -func addOpCancelBundleTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelBundleTask{}, middleware.After) -} - -func addOpCancelCapacityReservationFleetsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelCapacityReservationFleets{}, middleware.After) -} - -func addOpCancelCapacityReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelCapacityReservation{}, middleware.After) -} - -func addOpCancelConversionTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelConversionTask{}, middleware.After) -} - -func addOpCancelDeclarativePoliciesReportValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelDeclarativePoliciesReport{}, middleware.After) -} - -func addOpCancelExportTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelExportTask{}, middleware.After) -} - -func addOpCancelImageLaunchPermissionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelImageLaunchPermission{}, middleware.After) -} - -func addOpCancelReservedInstancesListingValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelReservedInstancesListing{}, middleware.After) -} - -func addOpCancelSpotFleetRequestsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelSpotFleetRequests{}, middleware.After) -} - -func addOpCancelSpotInstanceRequestsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelSpotInstanceRequests{}, middleware.After) -} - -func addOpConfirmProductInstanceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpConfirmProductInstance{}, middleware.After) -} - -func addOpCopyFpgaImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCopyFpgaImage{}, middleware.After) -} - -func addOpCopyImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCopyImage{}, middleware.After) -} - -func addOpCopySnapshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCopySnapshot{}, middleware.After) -} - -func addOpCreateCapacityReservationBySplittingValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCapacityReservationBySplitting{}, middleware.After) -} - -func addOpCreateCapacityReservationFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCapacityReservationFleet{}, middleware.After) -} - -func addOpCreateCapacityReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCapacityReservation{}, middleware.After) -} - -func addOpCreateCarrierGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCarrierGateway{}, middleware.After) -} - -func addOpCreateClientVpnEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateClientVpnEndpoint{}, middleware.After) -} - -func addOpCreateClientVpnRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateClientVpnRoute{}, middleware.After) -} - -func addOpCreateCoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCoipCidr{}, middleware.After) -} - -func addOpCreateCoipPoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCoipPool{}, middleware.After) -} - -func addOpCreateCustomerGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCustomerGateway{}, middleware.After) -} - -func addOpCreateDefaultSubnetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateDefaultSubnet{}, middleware.After) -} - -func addOpCreateDelegateMacVolumeOwnershipTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateDelegateMacVolumeOwnershipTask{}, middleware.After) -} - -func addOpCreateDhcpOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateDhcpOptions{}, middleware.After) -} - -func addOpCreateEgressOnlyInternetGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateEgressOnlyInternetGateway{}, middleware.After) -} - -func addOpCreateFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateFleet{}, middleware.After) -} - -func addOpCreateFlowLogsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateFlowLogs{}, middleware.After) -} - -func addOpCreateFpgaImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateFpgaImage{}, middleware.After) -} - -func addOpCreateImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateImage{}, middleware.After) -} - -func addOpCreateInstanceConnectEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateInstanceConnectEndpoint{}, middleware.After) -} - -func addOpCreateInstanceExportTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateInstanceExportTask{}, middleware.After) -} - -func addOpCreateIpamExternalResourceVerificationTokenValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateIpamExternalResourceVerificationToken{}, middleware.After) -} - -func addOpCreateIpamPoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateIpamPool{}, middleware.After) -} - -func addOpCreateIpamScopeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateIpamScope{}, middleware.After) -} - -func addOpCreateKeyPairValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateKeyPair{}, middleware.After) -} - -func addOpCreateLaunchTemplateValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLaunchTemplate{}, middleware.After) -} - -func addOpCreateLaunchTemplateVersionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLaunchTemplateVersion{}, middleware.After) -} - -func addOpCreateLocalGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayRoute{}, middleware.After) -} - -func addOpCreateLocalGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayRouteTable{}, middleware.After) -} - -func addOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) -} - -func addOpCreateLocalGatewayRouteTableVpcAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayRouteTableVpcAssociation{}, middleware.After) -} - -func addOpCreateLocalGatewayVirtualInterfaceGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayVirtualInterfaceGroup{}, middleware.After) -} - -func addOpCreateLocalGatewayVirtualInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateLocalGatewayVirtualInterface{}, middleware.After) -} - -func addOpCreateMacSystemIntegrityProtectionModificationTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateMacSystemIntegrityProtectionModificationTask{}, middleware.After) -} - -func addOpCreateManagedPrefixListValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateManagedPrefixList{}, middleware.After) -} - -func addOpCreateNatGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNatGateway{}, middleware.After) -} - -func addOpCreateNetworkAclEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkAclEntry{}, middleware.After) -} - -func addOpCreateNetworkAclValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkAcl{}, middleware.After) -} - -func addOpCreateNetworkInsightsAccessScopeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkInsightsAccessScope{}, middleware.After) -} - -func addOpCreateNetworkInsightsPathValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkInsightsPath{}, middleware.After) -} - -func addOpCreateNetworkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkInterface{}, middleware.After) -} - -func addOpCreateNetworkInterfacePermissionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNetworkInterfacePermission{}, middleware.After) -} - -func addOpCreateReplaceRootVolumeTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateReplaceRootVolumeTask{}, middleware.After) -} - -func addOpCreateReservedInstancesListingValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateReservedInstancesListing{}, middleware.After) -} - -func addOpCreateRestoreImageTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRestoreImageTask{}, middleware.After) -} - -func addOpCreateRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRoute{}, middleware.After) -} - -func addOpCreateRouteServerEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRouteServerEndpoint{}, middleware.After) -} - -func addOpCreateRouteServerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRouteServer{}, middleware.After) -} - -func addOpCreateRouteServerPeerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRouteServerPeer{}, middleware.After) -} - -func addOpCreateRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateRouteTable{}, middleware.After) -} - -func addOpCreateSecurityGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSecurityGroup{}, middleware.After) -} - -func addOpCreateSnapshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSnapshot{}, middleware.After) -} - -func addOpCreateSnapshotsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSnapshots{}, middleware.After) -} - -func addOpCreateSpotDatafeedSubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSpotDatafeedSubscription{}, middleware.After) -} - -func addOpCreateStoreImageTaskValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateStoreImageTask{}, middleware.After) -} - -func addOpCreateSubnetCidrReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSubnetCidrReservation{}, middleware.After) -} - -func addOpCreateSubnetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSubnet{}, middleware.After) -} - -func addOpCreateTagsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTags{}, middleware.After) -} - -func addOpCreateTrafficMirrorFilterRuleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTrafficMirrorFilterRule{}, middleware.After) -} - -func addOpCreateTrafficMirrorSessionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTrafficMirrorSession{}, middleware.After) -} - -func addOpCreateTransitGatewayConnectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayConnect{}, middleware.After) -} - -func addOpCreateTransitGatewayConnectPeerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayConnectPeer{}, middleware.After) -} - -func addOpCreateTransitGatewayMulticastDomainValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayMulticastDomain{}, middleware.After) -} - -func addOpCreateTransitGatewayPeeringAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayPeeringAttachment{}, middleware.After) -} - -func addOpCreateTransitGatewayPolicyTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayPolicyTable{}, middleware.After) -} - -func addOpCreateTransitGatewayPrefixListReferenceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayPrefixListReference{}, middleware.After) -} - -func addOpCreateTransitGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayRoute{}, middleware.After) -} - -func addOpCreateTransitGatewayRouteTableAnnouncementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayRouteTableAnnouncement{}, middleware.After) -} - -func addOpCreateTransitGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayRouteTable{}, middleware.After) -} - -func addOpCreateTransitGatewayVpcAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTransitGatewayVpcAttachment{}, middleware.After) -} - -func addOpCreateVerifiedAccessEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVerifiedAccessEndpoint{}, middleware.After) -} - -func addOpCreateVerifiedAccessGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVerifiedAccessGroup{}, middleware.After) -} - -func addOpCreateVerifiedAccessTrustProviderValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVerifiedAccessTrustProvider{}, middleware.After) -} - -func addOpCreateVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVolume{}, middleware.After) -} - -func addOpCreateVpcBlockPublicAccessExclusionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpcBlockPublicAccessExclusion{}, middleware.After) -} - -func addOpCreateVpcEndpointConnectionNotificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpcEndpointConnectionNotification{}, middleware.After) -} - -func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) -} - -func addOpCreateVpcPeeringConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpcPeeringConnection{}, middleware.After) -} - -func addOpCreateVpnConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpnConnection{}, middleware.After) -} - -func addOpCreateVpnConnectionRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpnConnectionRoute{}, middleware.After) -} - -func addOpCreateVpnGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateVpnGateway{}, middleware.After) -} - -func addOpDeleteCarrierGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCarrierGateway{}, middleware.After) -} - -func addOpDeleteClientVpnEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteClientVpnEndpoint{}, middleware.After) -} - -func addOpDeleteClientVpnRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteClientVpnRoute{}, middleware.After) -} - -func addOpDeleteCoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCoipCidr{}, middleware.After) -} - -func addOpDeleteCoipPoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCoipPool{}, middleware.After) -} - -func addOpDeleteCustomerGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCustomerGateway{}, middleware.After) -} - -func addOpDeleteDhcpOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteDhcpOptions{}, middleware.After) -} - -func addOpDeleteEgressOnlyInternetGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteEgressOnlyInternetGateway{}, middleware.After) -} - -func addOpDeleteFleetsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteFleets{}, middleware.After) -} - -func addOpDeleteFlowLogsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteFlowLogs{}, middleware.After) -} - -func addOpDeleteFpgaImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteFpgaImage{}, middleware.After) -} - -func addOpDeleteInstanceConnectEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteInstanceConnectEndpoint{}, middleware.After) -} - -func addOpDeleteInstanceEventWindowValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteInstanceEventWindow{}, middleware.After) -} - -func addOpDeleteInternetGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteInternetGateway{}, middleware.After) -} - -func addOpDeleteIpamExternalResourceVerificationTokenValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteIpamExternalResourceVerificationToken{}, middleware.After) -} - -func addOpDeleteIpamValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteIpam{}, middleware.After) -} - -func addOpDeleteIpamPoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteIpamPool{}, middleware.After) -} - -func addOpDeleteIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteIpamResourceDiscovery{}, middleware.After) -} - -func addOpDeleteIpamScopeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteIpamScope{}, middleware.After) -} - -func addOpDeleteLaunchTemplateVersionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLaunchTemplateVersions{}, middleware.After) -} - -func addOpDeleteLocalGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayRoute{}, middleware.After) -} - -func addOpDeleteLocalGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayRouteTable{}, middleware.After) -} - -func addOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation{}, middleware.After) -} - -func addOpDeleteLocalGatewayRouteTableVpcAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayRouteTableVpcAssociation{}, middleware.After) -} - -func addOpDeleteLocalGatewayVirtualInterfaceGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayVirtualInterfaceGroup{}, middleware.After) -} - -func addOpDeleteLocalGatewayVirtualInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteLocalGatewayVirtualInterface{}, middleware.After) -} - -func addOpDeleteManagedPrefixListValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteManagedPrefixList{}, middleware.After) -} - -func addOpDeleteNatGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNatGateway{}, middleware.After) -} - -func addOpDeleteNetworkAclEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkAclEntry{}, middleware.After) -} - -func addOpDeleteNetworkAclValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkAcl{}, middleware.After) -} - -func addOpDeleteNetworkInsightsAccessScopeAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInsightsAccessScopeAnalysis{}, middleware.After) -} - -func addOpDeleteNetworkInsightsAccessScopeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInsightsAccessScope{}, middleware.After) -} - -func addOpDeleteNetworkInsightsAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInsightsAnalysis{}, middleware.After) -} - -func addOpDeleteNetworkInsightsPathValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInsightsPath{}, middleware.After) -} - -func addOpDeleteNetworkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInterface{}, middleware.After) -} - -func addOpDeleteNetworkInterfacePermissionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNetworkInterfacePermission{}, middleware.After) -} - -func addOpDeletePlacementGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeletePlacementGroup{}, middleware.After) -} - -func addOpDeletePublicIpv4PoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeletePublicIpv4Pool{}, middleware.After) -} - -func addOpDeleteQueuedReservedInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteQueuedReservedInstances{}, middleware.After) -} - -func addOpDeleteRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteRoute{}, middleware.After) -} - -func addOpDeleteRouteServerEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteRouteServerEndpoint{}, middleware.After) -} - -func addOpDeleteRouteServerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteRouteServer{}, middleware.After) -} - -func addOpDeleteRouteServerPeerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteRouteServerPeer{}, middleware.After) -} - -func addOpDeleteRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteRouteTable{}, middleware.After) -} - -func addOpDeleteSnapshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteSnapshot{}, middleware.After) -} - -func addOpDeleteSubnetCidrReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteSubnetCidrReservation{}, middleware.After) -} - -func addOpDeleteSubnetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteSubnet{}, middleware.After) -} - -func addOpDeleteTagsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTags{}, middleware.After) -} - -func addOpDeleteTrafficMirrorFilterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTrafficMirrorFilter{}, middleware.After) -} - -func addOpDeleteTrafficMirrorFilterRuleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTrafficMirrorFilterRule{}, middleware.After) -} - -func addOpDeleteTrafficMirrorSessionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTrafficMirrorSession{}, middleware.After) -} - -func addOpDeleteTrafficMirrorTargetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTrafficMirrorTarget{}, middleware.After) -} - -func addOpDeleteTransitGatewayConnectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayConnect{}, middleware.After) -} - -func addOpDeleteTransitGatewayConnectPeerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayConnectPeer{}, middleware.After) -} - -func addOpDeleteTransitGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGateway{}, middleware.After) -} - -func addOpDeleteTransitGatewayMulticastDomainValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayMulticastDomain{}, middleware.After) -} - -func addOpDeleteTransitGatewayPeeringAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayPeeringAttachment{}, middleware.After) -} - -func addOpDeleteTransitGatewayPolicyTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayPolicyTable{}, middleware.After) -} - -func addOpDeleteTransitGatewayPrefixListReferenceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayPrefixListReference{}, middleware.After) -} - -func addOpDeleteTransitGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayRoute{}, middleware.After) -} - -func addOpDeleteTransitGatewayRouteTableAnnouncementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayRouteTableAnnouncement{}, middleware.After) -} - -func addOpDeleteTransitGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayRouteTable{}, middleware.After) -} - -func addOpDeleteTransitGatewayVpcAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteTransitGatewayVpcAttachment{}, middleware.After) -} - -func addOpDeleteVerifiedAccessEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVerifiedAccessEndpoint{}, middleware.After) -} - -func addOpDeleteVerifiedAccessGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVerifiedAccessGroup{}, middleware.After) -} - -func addOpDeleteVerifiedAccessInstanceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVerifiedAccessInstance{}, middleware.After) -} - -func addOpDeleteVerifiedAccessTrustProviderValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVerifiedAccessTrustProvider{}, middleware.After) -} - -func addOpDeleteVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVolume{}, middleware.After) -} - -func addOpDeleteVpcBlockPublicAccessExclusionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpcBlockPublicAccessExclusion{}, middleware.After) -} - -func addOpDeleteVpcEndpointConnectionNotificationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpcEndpointConnectionNotifications{}, middleware.After) -} - -func addOpDeleteVpcEndpointServiceConfigurationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpcEndpointServiceConfigurations{}, middleware.After) -} - -func addOpDeleteVpcEndpointsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpcEndpoints{}, middleware.After) -} - -func addOpDeleteVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpc{}, middleware.After) -} - -func addOpDeleteVpcPeeringConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpcPeeringConnection{}, middleware.After) -} - -func addOpDeleteVpnConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpnConnection{}, middleware.After) -} - -func addOpDeleteVpnConnectionRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpnConnectionRoute{}, middleware.After) -} - -func addOpDeleteVpnGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteVpnGateway{}, middleware.After) -} - -func addOpDeprovisionByoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeprovisionByoipCidr{}, middleware.After) -} - -func addOpDeprovisionIpamByoasnValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeprovisionIpamByoasn{}, middleware.After) -} - -func addOpDeprovisionIpamPoolCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeprovisionIpamPoolCidr{}, middleware.After) -} - -func addOpDeprovisionPublicIpv4PoolCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeprovisionPublicIpv4PoolCidr{}, middleware.After) -} - -func addOpDeregisterImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeregisterImage{}, middleware.After) -} - -func addOpDeregisterInstanceEventNotificationAttributesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeregisterInstanceEventNotificationAttributes{}, middleware.After) -} - -func addOpDescribeByoipCidrsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeByoipCidrs{}, middleware.After) -} - -func addOpDescribeCapacityBlockExtensionOfferingsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) -} - -func addOpDescribeCapacityBlockOfferingsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCapacityBlockOfferings{}, middleware.After) -} - -func addOpDescribeCapacityReservationBillingRequestsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCapacityReservationBillingRequests{}, middleware.After) -} - -func addOpDescribeClientVpnAuthorizationRulesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeClientVpnAuthorizationRules{}, middleware.After) -} - -func addOpDescribeClientVpnConnectionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeClientVpnConnections{}, middleware.After) -} - -func addOpDescribeClientVpnRoutesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeClientVpnRoutes{}, middleware.After) -} - -func addOpDescribeClientVpnTargetNetworksValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeClientVpnTargetNetworks{}, middleware.After) -} - -func addOpDescribeFleetHistoryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeFleetHistory{}, middleware.After) -} - -func addOpDescribeFleetInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeFleetInstances{}, middleware.After) -} - -func addOpDescribeFpgaImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeFpgaImageAttribute{}, middleware.After) -} - -func addOpDescribeIdentityIdFormatValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeIdentityIdFormat{}, middleware.After) -} - -func addOpDescribeImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeImageAttribute{}, middleware.After) -} - -func addOpDescribeInstanceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeInstanceAttribute{}, middleware.After) -} - -func addOpDescribeNetworkInterfaceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeNetworkInterfaceAttribute{}, middleware.After) -} - -func addOpDescribeScheduledInstanceAvailabilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeScheduledInstanceAvailability{}, middleware.After) -} - -func addOpDescribeSecurityGroupReferencesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeSecurityGroupReferences{}, middleware.After) -} - -func addOpDescribeSnapshotAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeSnapshotAttribute{}, middleware.After) -} - -func addOpDescribeSpotFleetInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeSpotFleetInstances{}, middleware.After) -} - -func addOpDescribeSpotFleetRequestHistoryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeSpotFleetRequestHistory{}, middleware.After) -} - -func addOpDescribeStaleSecurityGroupsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeStaleSecurityGroups{}, middleware.After) -} - -func addOpDescribeVolumeAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeVolumeAttribute{}, middleware.After) -} - -func addOpDescribeVpcAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeVpcAttribute{}, middleware.After) -} - -func addOpDescribeVpcEndpointServicePermissionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeVpcEndpointServicePermissions{}, middleware.After) -} - -func addOpDetachClassicLinkVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachClassicLinkVpc{}, middleware.After) -} - -func addOpDetachInternetGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachInternetGateway{}, middleware.After) -} - -func addOpDetachNetworkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachNetworkInterface{}, middleware.After) -} - -func addOpDetachVerifiedAccessTrustProviderValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachVerifiedAccessTrustProvider{}, middleware.After) -} - -func addOpDetachVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachVolume{}, middleware.After) -} - -func addOpDetachVpnGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachVpnGateway{}, middleware.After) -} - -func addOpDisableAddressTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableAddressTransfer{}, middleware.After) -} - -func addOpDisableFastLaunchValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableFastLaunch{}, middleware.After) -} - -func addOpDisableFastSnapshotRestoresValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableFastSnapshotRestores{}, middleware.After) -} - -func addOpDisableImageDeprecationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableImageDeprecation{}, middleware.After) -} - -func addOpDisableImageDeregistrationProtectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableImageDeregistrationProtection{}, middleware.After) -} - -func addOpDisableImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableImage{}, middleware.After) -} - -func addOpDisableIpamOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableIpamOrganizationAdminAccount{}, middleware.After) -} - -func addOpDisableRouteServerPropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableRouteServerPropagation{}, middleware.After) -} - -func addOpDisableTransitGatewayRouteTablePropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableTransitGatewayRouteTablePropagation{}, middleware.After) -} - -func addOpDisableVgwRoutePropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableVgwRoutePropagation{}, middleware.After) -} - -func addOpDisableVpcClassicLinkValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableVpcClassicLink{}, middleware.After) -} - -func addOpDisassociateCapacityReservationBillingOwnerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateCapacityReservationBillingOwner{}, middleware.After) -} - -func addOpDisassociateClientVpnTargetNetworkValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateClientVpnTargetNetwork{}, middleware.After) -} - -func addOpDisassociateEnclaveCertificateIamRoleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateEnclaveCertificateIamRole{}, middleware.After) -} - -func addOpDisassociateIamInstanceProfileValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateIamInstanceProfile{}, middleware.After) -} - -func addOpDisassociateInstanceEventWindowValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateInstanceEventWindow{}, middleware.After) -} - -func addOpDisassociateIpamByoasnValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateIpamByoasn{}, middleware.After) -} - -func addOpDisassociateIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateIpamResourceDiscovery{}, middleware.After) -} - -func addOpDisassociateNatGatewayAddressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateNatGatewayAddress{}, middleware.After) -} - -func addOpDisassociateRouteServerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateRouteServer{}, middleware.After) -} - -func addOpDisassociateRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateRouteTable{}, middleware.After) -} - -func addOpDisassociateSecurityGroupVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateSecurityGroupVpc{}, middleware.After) -} - -func addOpDisassociateSubnetCidrBlockValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateSubnetCidrBlock{}, middleware.After) -} - -func addOpDisassociateTransitGatewayMulticastDomainValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateTransitGatewayMulticastDomain{}, middleware.After) -} - -func addOpDisassociateTransitGatewayPolicyTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateTransitGatewayPolicyTable{}, middleware.After) -} - -func addOpDisassociateTransitGatewayRouteTableValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateTransitGatewayRouteTable{}, middleware.After) -} - -func addOpDisassociateTrunkInterfaceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateTrunkInterface{}, middleware.After) -} - -func addOpDisassociateVpcCidrBlockValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateVpcCidrBlock{}, middleware.After) -} - -func addOpEnableAddressTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableAddressTransfer{}, middleware.After) -} - -func addOpEnableAllowedImagesSettingsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableAllowedImagesSettings{}, middleware.After) -} - -func addOpEnableFastLaunchValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableFastLaunch{}, middleware.After) -} - -func addOpEnableFastSnapshotRestoresValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableFastSnapshotRestores{}, middleware.After) -} - -func addOpEnableImageBlockPublicAccessValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableImageBlockPublicAccess{}, middleware.After) -} - -func addOpEnableImageDeprecationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableImageDeprecation{}, middleware.After) -} - -func addOpEnableImageDeregistrationProtectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableImageDeregistrationProtection{}, middleware.After) -} - -func addOpEnableImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableImage{}, middleware.After) -} - -func addOpEnableIpamOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableIpamOrganizationAdminAccount{}, middleware.After) -} - -func addOpEnableRouteServerPropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableRouteServerPropagation{}, middleware.After) -} - -func addOpEnableSnapshotBlockPublicAccessValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableSnapshotBlockPublicAccess{}, middleware.After) -} - -func addOpEnableTransitGatewayRouteTablePropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableTransitGatewayRouteTablePropagation{}, middleware.After) -} - -func addOpEnableVgwRoutePropagationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableVgwRoutePropagation{}, middleware.After) -} - -func addOpEnableVolumeIOValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableVolumeIO{}, middleware.After) -} - -func addOpEnableVpcClassicLinkValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableVpcClassicLink{}, middleware.After) -} - -func addOpExportClientVpnClientCertificateRevocationListValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpExportClientVpnClientCertificateRevocationList{}, middleware.After) -} - -func addOpExportClientVpnClientConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpExportClientVpnClientConfiguration{}, middleware.After) -} - -func addOpExportImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpExportImage{}, middleware.After) -} - -func addOpExportTransitGatewayRoutesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpExportTransitGatewayRoutes{}, middleware.After) -} - -func addOpExportVerifiedAccessInstanceClientConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpExportVerifiedAccessInstanceClientConfiguration{}, middleware.After) -} - -func addOpGetActiveVpnTunnelStatusValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetActiveVpnTunnelStatus{}, middleware.After) -} - -func addOpGetAssociatedEnclaveCertificateIamRolesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetAssociatedEnclaveCertificateIamRoles{}, middleware.After) -} - -func addOpGetAssociatedIpv6PoolCidrsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetAssociatedIpv6PoolCidrs{}, middleware.After) -} - -func addOpGetCapacityReservationUsageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCapacityReservationUsage{}, middleware.After) -} - -func addOpGetCoipPoolUsageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCoipPoolUsage{}, middleware.After) -} - -func addOpGetConsoleOutputValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetConsoleOutput{}, middleware.After) -} - -func addOpGetConsoleScreenshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetConsoleScreenshot{}, middleware.After) -} - -func addOpGetDeclarativePoliciesReportSummaryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDeclarativePoliciesReportSummary{}, middleware.After) -} - -func addOpGetDefaultCreditSpecificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDefaultCreditSpecification{}, middleware.After) -} - -func addOpGetFlowLogsIntegrationTemplateValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetFlowLogsIntegrationTemplate{}, middleware.After) -} - -func addOpGetGroupsForCapacityReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetGroupsForCapacityReservation{}, middleware.After) -} - -func addOpGetHostReservationPurchasePreviewValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetHostReservationPurchasePreview{}, middleware.After) -} - -func addOpGetInstanceTpmEkPubValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetInstanceTpmEkPub{}, middleware.After) -} - -func addOpGetInstanceTypesFromInstanceRequirementsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetInstanceTypesFromInstanceRequirements{}, middleware.After) -} - -func addOpGetInstanceUefiDataValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetInstanceUefiData{}, middleware.After) -} - -func addOpGetIpamAddressHistoryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamAddressHistory{}, middleware.After) -} - -func addOpGetIpamDiscoveredAccountsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamDiscoveredAccounts{}, middleware.After) -} - -func addOpGetIpamDiscoveredPublicAddressesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamDiscoveredPublicAddresses{}, middleware.After) -} - -func addOpGetIpamDiscoveredResourceCidrsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamDiscoveredResourceCidrs{}, middleware.After) -} - -func addOpGetIpamPoolAllocationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamPoolAllocations{}, middleware.After) -} - -func addOpGetIpamPoolCidrsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamPoolCidrs{}, middleware.After) -} - -func addOpGetIpamResourceCidrsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetIpamResourceCidrs{}, middleware.After) -} - -func addOpGetLaunchTemplateDataValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetLaunchTemplateData{}, middleware.After) -} - -func addOpGetManagedPrefixListAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetManagedPrefixListAssociations{}, middleware.After) -} - -func addOpGetManagedPrefixListEntriesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetManagedPrefixListEntries{}, middleware.After) -} - -func addOpGetNetworkInsightsAccessScopeAnalysisFindingsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetNetworkInsightsAccessScopeAnalysisFindings{}, middleware.After) -} - -func addOpGetNetworkInsightsAccessScopeContentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetNetworkInsightsAccessScopeContent{}, middleware.After) -} - -func addOpGetPasswordDataValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetPasswordData{}, middleware.After) -} - -func addOpGetReservedInstancesExchangeQuoteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetReservedInstancesExchangeQuote{}, middleware.After) -} - -func addOpGetRouteServerAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetRouteServerAssociations{}, middleware.After) -} - -func addOpGetRouteServerPropagationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetRouteServerPropagations{}, middleware.After) -} - -func addOpGetRouteServerRoutingDatabaseValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetRouteServerRoutingDatabase{}, middleware.After) -} - -func addOpGetSecurityGroupsForVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSecurityGroupsForVpc{}, middleware.After) -} - -func addOpGetSpotPlacementScoresValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSpotPlacementScores{}, middleware.After) -} - -func addOpGetSubnetCidrReservationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSubnetCidrReservations{}, middleware.After) -} - -func addOpGetTransitGatewayAttachmentPropagationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayAttachmentPropagations{}, middleware.After) -} - -func addOpGetTransitGatewayMulticastDomainAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayMulticastDomainAssociations{}, middleware.After) -} - -func addOpGetTransitGatewayPolicyTableAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayPolicyTableAssociations{}, middleware.After) -} - -func addOpGetTransitGatewayPolicyTableEntriesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayPolicyTableEntries{}, middleware.After) -} - -func addOpGetTransitGatewayPrefixListReferencesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayPrefixListReferences{}, middleware.After) -} - -func addOpGetTransitGatewayRouteTableAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayRouteTableAssociations{}, middleware.After) -} - -func addOpGetTransitGatewayRouteTablePropagationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTransitGatewayRouteTablePropagations{}, middleware.After) -} - -func addOpGetVerifiedAccessEndpointPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetVerifiedAccessEndpointPolicy{}, middleware.After) -} - -func addOpGetVerifiedAccessEndpointTargetsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetVerifiedAccessEndpointTargets{}, middleware.After) -} - -func addOpGetVerifiedAccessGroupPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetVerifiedAccessGroupPolicy{}, middleware.After) -} - -func addOpGetVpnConnectionDeviceSampleConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetVpnConnectionDeviceSampleConfiguration{}, middleware.After) -} - -func addOpGetVpnTunnelReplacementStatusValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetVpnTunnelReplacementStatus{}, middleware.After) -} - -func addOpImportClientVpnClientCertificateRevocationListValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpImportClientVpnClientCertificateRevocationList{}, middleware.After) -} - -func addOpImportInstanceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpImportInstance{}, middleware.After) -} - -func addOpImportKeyPairValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpImportKeyPair{}, middleware.After) -} - -func addOpImportVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpImportVolume{}, middleware.After) -} - -func addOpLockSnapshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpLockSnapshot{}, middleware.After) -} - -func addOpModifyAddressAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyAddressAttribute{}, middleware.After) -} - -func addOpModifyAvailabilityZoneGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyAvailabilityZoneGroup{}, middleware.After) -} - -func addOpModifyCapacityReservationFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyCapacityReservationFleet{}, middleware.After) -} - -func addOpModifyCapacityReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyCapacityReservation{}, middleware.After) -} - -func addOpModifyClientVpnEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyClientVpnEndpoint{}, middleware.After) -} - -func addOpModifyDefaultCreditSpecificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyDefaultCreditSpecification{}, middleware.After) -} - -func addOpModifyEbsDefaultKmsKeyIdValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyEbsDefaultKmsKeyId{}, middleware.After) -} - -func addOpModifyFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyFleet{}, middleware.After) -} - -func addOpModifyFpgaImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyFpgaImageAttribute{}, middleware.After) -} - -func addOpModifyHostsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyHosts{}, middleware.After) -} - -func addOpModifyIdentityIdFormatValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIdentityIdFormat{}, middleware.After) -} - -func addOpModifyIdFormatValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIdFormat{}, middleware.After) -} - -func addOpModifyImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyImageAttribute{}, middleware.After) -} - -func addOpModifyInstanceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceAttribute{}, middleware.After) -} - -func addOpModifyInstanceCapacityReservationAttributesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceCapacityReservationAttributes{}, middleware.After) -} - -func addOpModifyInstanceCpuOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceCpuOptions{}, middleware.After) -} - -func addOpModifyInstanceCreditSpecificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceCreditSpecification{}, middleware.After) -} - -func addOpModifyInstanceEventStartTimeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceEventStartTime{}, middleware.After) -} - -func addOpModifyInstanceEventWindowValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceEventWindow{}, middleware.After) -} - -func addOpModifyInstanceMaintenanceOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceMaintenanceOptions{}, middleware.After) -} - -func addOpModifyInstanceMetadataOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceMetadataOptions{}, middleware.After) -} - -func addOpModifyInstanceNetworkPerformanceOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstanceNetworkPerformanceOptions{}, middleware.After) -} - -func addOpModifyInstancePlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyInstancePlacement{}, middleware.After) -} - -func addOpModifyIpamValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIpam{}, middleware.After) -} - -func addOpModifyIpamPoolValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIpamPool{}, middleware.After) -} - -func addOpModifyIpamResourceCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIpamResourceCidr{}, middleware.After) -} - -func addOpModifyIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIpamResourceDiscovery{}, middleware.After) -} - -func addOpModifyIpamScopeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyIpamScope{}, middleware.After) -} - -func addOpModifyLocalGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyLocalGatewayRoute{}, middleware.After) -} - -func addOpModifyManagedPrefixListValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyManagedPrefixList{}, middleware.After) -} - -func addOpModifyNetworkInterfaceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyNetworkInterfaceAttribute{}, middleware.After) -} - -func addOpModifyPrivateDnsNameOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyPrivateDnsNameOptions{}, middleware.After) -} - -func addOpModifyPublicIpDnsNameOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyPublicIpDnsNameOptions{}, middleware.After) -} - -func addOpModifyReservedInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyReservedInstances{}, middleware.After) -} - -func addOpModifyRouteServerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyRouteServer{}, middleware.After) -} - -func addOpModifySecurityGroupRulesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifySecurityGroupRules{}, middleware.After) -} - -func addOpModifySnapshotAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifySnapshotAttribute{}, middleware.After) -} - -func addOpModifySnapshotTierValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifySnapshotTier{}, middleware.After) -} - -func addOpModifySpotFleetRequestValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifySpotFleetRequest{}, middleware.After) -} - -func addOpModifySubnetAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifySubnetAttribute{}, middleware.After) -} - -func addOpModifyTrafficMirrorFilterNetworkServicesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTrafficMirrorFilterNetworkServices{}, middleware.After) -} - -func addOpModifyTrafficMirrorFilterRuleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTrafficMirrorFilterRule{}, middleware.After) -} - -func addOpModifyTrafficMirrorSessionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTrafficMirrorSession{}, middleware.After) -} - -func addOpModifyTransitGatewayValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTransitGateway{}, middleware.After) -} - -func addOpModifyTransitGatewayPrefixListReferenceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTransitGatewayPrefixListReference{}, middleware.After) -} - -func addOpModifyTransitGatewayVpcAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyTransitGatewayVpcAttachment{}, middleware.After) -} - -func addOpModifyVerifiedAccessEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessEndpoint{}, middleware.After) -} - -func addOpModifyVerifiedAccessEndpointPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessEndpointPolicy{}, middleware.After) -} - -func addOpModifyVerifiedAccessGroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessGroup{}, middleware.After) -} - -func addOpModifyVerifiedAccessGroupPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessGroupPolicy{}, middleware.After) -} - -func addOpModifyVerifiedAccessInstanceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessInstance{}, middleware.After) -} - -func addOpModifyVerifiedAccessInstanceLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessInstanceLoggingConfiguration{}, middleware.After) -} - -func addOpModifyVerifiedAccessTrustProviderValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVerifiedAccessTrustProvider{}, middleware.After) -} - -func addOpModifyVolumeAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVolumeAttribute{}, middleware.After) -} - -func addOpModifyVolumeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVolume{}, middleware.After) -} - -func addOpModifyVpcAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcAttribute{}, middleware.After) -} - -func addOpModifyVpcBlockPublicAccessExclusionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcBlockPublicAccessExclusion{}, middleware.After) -} - -func addOpModifyVpcBlockPublicAccessOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcBlockPublicAccessOptions{}, middleware.After) -} - -func addOpModifyVpcEndpointConnectionNotificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcEndpointConnectionNotification{}, middleware.After) -} - -func addOpModifyVpcEndpointValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcEndpoint{}, middleware.After) -} - -func addOpModifyVpcEndpointServiceConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcEndpointServiceConfiguration{}, middleware.After) -} - -func addOpModifyVpcEndpointServicePayerResponsibilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcEndpointServicePayerResponsibility{}, middleware.After) -} - -func addOpModifyVpcEndpointServicePermissionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcEndpointServicePermissions{}, middleware.After) -} - -func addOpModifyVpcPeeringConnectionOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcPeeringConnectionOptions{}, middleware.After) -} - -func addOpModifyVpcTenancyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpcTenancy{}, middleware.After) -} - -func addOpModifyVpnConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpnConnection{}, middleware.After) -} - -func addOpModifyVpnConnectionOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpnConnectionOptions{}, middleware.After) -} - -func addOpModifyVpnTunnelCertificateValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpnTunnelCertificate{}, middleware.After) -} - -func addOpModifyVpnTunnelOptionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpModifyVpnTunnelOptions{}, middleware.After) -} - -func addOpMonitorInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpMonitorInstances{}, middleware.After) -} - -func addOpMoveAddressToVpcValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpMoveAddressToVpc{}, middleware.After) -} - -func addOpMoveByoipCidrToIpamValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpMoveByoipCidrToIpam{}, middleware.After) -} - -func addOpMoveCapacityReservationInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpMoveCapacityReservationInstances{}, middleware.After) -} - -func addOpProvisionByoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpProvisionByoipCidr{}, middleware.After) -} - -func addOpProvisionIpamByoasnValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpProvisionIpamByoasn{}, middleware.After) -} - -func addOpProvisionIpamPoolCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpProvisionIpamPoolCidr{}, middleware.After) -} - -func addOpProvisionPublicIpv4PoolCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpProvisionPublicIpv4PoolCidr{}, middleware.After) -} - -func addOpPurchaseCapacityBlockExtensionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPurchaseCapacityBlockExtension{}, middleware.After) -} - -func addOpPurchaseCapacityBlockValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPurchaseCapacityBlock{}, middleware.After) -} - -func addOpPurchaseHostReservationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPurchaseHostReservation{}, middleware.After) -} - -func addOpPurchaseReservedInstancesOfferingValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPurchaseReservedInstancesOffering{}, middleware.After) -} - -func addOpPurchaseScheduledInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPurchaseScheduledInstances{}, middleware.After) -} - -func addOpRebootInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRebootInstances{}, middleware.After) -} - -func addOpRegisterImageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterImage{}, middleware.After) -} - -func addOpRegisterInstanceEventNotificationAttributesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterInstanceEventNotificationAttributes{}, middleware.After) -} - -func addOpRegisterTransitGatewayMulticastGroupMembersValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterTransitGatewayMulticastGroupMembers{}, middleware.After) -} - -func addOpRegisterTransitGatewayMulticastGroupSourcesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterTransitGatewayMulticastGroupSources{}, middleware.After) -} - -func addOpRejectCapacityReservationBillingOwnershipValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRejectCapacityReservationBillingOwnership{}, middleware.After) -} - -func addOpRejectTransitGatewayPeeringAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRejectTransitGatewayPeeringAttachment{}, middleware.After) -} - -func addOpRejectTransitGatewayVpcAttachmentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRejectTransitGatewayVpcAttachment{}, middleware.After) -} - -func addOpRejectVpcEndpointConnectionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRejectVpcEndpointConnections{}, middleware.After) -} - -func addOpRejectVpcPeeringConnectionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRejectVpcPeeringConnection{}, middleware.After) -} - -func addOpReleaseHostsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReleaseHosts{}, middleware.After) -} - -func addOpReleaseIpamPoolAllocationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReleaseIpamPoolAllocation{}, middleware.After) -} - -func addOpReplaceIamInstanceProfileAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceIamInstanceProfileAssociation{}, middleware.After) -} - -func addOpReplaceNetworkAclAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceNetworkAclAssociation{}, middleware.After) -} - -func addOpReplaceNetworkAclEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceNetworkAclEntry{}, middleware.After) -} - -func addOpReplaceRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceRoute{}, middleware.After) -} - -func addOpReplaceRouteTableAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceRouteTableAssociation{}, middleware.After) -} - -func addOpReplaceTransitGatewayRouteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceTransitGatewayRoute{}, middleware.After) -} - -func addOpReplaceVpnTunnelValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReplaceVpnTunnel{}, middleware.After) -} - -func addOpReportInstanceStatusValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpReportInstanceStatus{}, middleware.After) -} - -func addOpRequestSpotFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRequestSpotFleet{}, middleware.After) -} - -func addOpRequestSpotInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRequestSpotInstances{}, middleware.After) -} - -func addOpResetAddressAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetAddressAttribute{}, middleware.After) -} - -func addOpResetFpgaImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetFpgaImageAttribute{}, middleware.After) -} - -func addOpResetImageAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetImageAttribute{}, middleware.After) -} - -func addOpResetInstanceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetInstanceAttribute{}, middleware.After) -} - -func addOpResetNetworkInterfaceAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetNetworkInterfaceAttribute{}, middleware.After) -} - -func addOpResetSnapshotAttributeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpResetSnapshotAttribute{}, middleware.After) -} - -func addOpRestoreAddressToClassicValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRestoreAddressToClassic{}, middleware.After) -} - -func addOpRestoreImageFromRecycleBinValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRestoreImageFromRecycleBin{}, middleware.After) -} - -func addOpRestoreManagedPrefixListVersionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRestoreManagedPrefixListVersion{}, middleware.After) -} - -func addOpRestoreSnapshotFromRecycleBinValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRestoreSnapshotFromRecycleBin{}, middleware.After) -} - -func addOpRestoreSnapshotTierValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRestoreSnapshotTier{}, middleware.After) -} - -func addOpRevokeClientVpnIngressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRevokeClientVpnIngress{}, middleware.After) -} - -func addOpRevokeSecurityGroupEgressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRevokeSecurityGroupEgress{}, middleware.After) -} - -func addOpRunInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRunInstances{}, middleware.After) -} - -func addOpRunScheduledInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRunScheduledInstances{}, middleware.After) -} - -func addOpSearchLocalGatewayRoutesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpSearchLocalGatewayRoutes{}, middleware.After) -} - -func addOpSearchTransitGatewayMulticastGroupsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpSearchTransitGatewayMulticastGroups{}, middleware.After) -} - -func addOpSearchTransitGatewayRoutesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpSearchTransitGatewayRoutes{}, middleware.After) -} - -func addOpSendDiagnosticInterruptValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpSendDiagnosticInterrupt{}, middleware.After) -} - -func addOpStartDeclarativePoliciesReportValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartDeclarativePoliciesReport{}, middleware.After) -} - -func addOpStartInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartInstances{}, middleware.After) -} - -func addOpStartNetworkInsightsAccessScopeAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartNetworkInsightsAccessScopeAnalysis{}, middleware.After) -} - -func addOpStartNetworkInsightsAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartNetworkInsightsAnalysis{}, middleware.After) -} - -func addOpStartVpcEndpointServicePrivateDnsVerificationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartVpcEndpointServicePrivateDnsVerification{}, middleware.After) -} - -func addOpStopInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStopInstances{}, middleware.After) -} - -func addOpTerminateClientVpnConnectionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTerminateClientVpnConnections{}, middleware.After) -} - -func addOpTerminateInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTerminateInstances{}, middleware.After) -} - -func addOpUnassignIpv6AddressesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnassignIpv6Addresses{}, middleware.After) -} - -func addOpUnassignPrivateIpAddressesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnassignPrivateIpAddresses{}, middleware.After) -} - -func addOpUnassignPrivateNatGatewayAddressValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnassignPrivateNatGatewayAddress{}, middleware.After) -} - -func addOpUnlockSnapshotValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnlockSnapshot{}, middleware.After) -} - -func addOpUnmonitorInstancesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnmonitorInstances{}, middleware.After) -} - -func addOpWithdrawByoipCidrValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpWithdrawByoipCidr{}, middleware.After) -} - -func validateAddPrefixListEntries(v []types.AddPrefixListEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AddPrefixListEntries"} - for i := range v { - if err := validateAddPrefixListEntry(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAddPrefixListEntry(v *types.AddPrefixListEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AddPrefixListEntry"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAsnAuthorizationContext(v *types.AsnAuthorizationContext) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AsnAuthorizationContext"} - if v.Message == nil { - invalidParams.Add(smithy.NewErrParamRequired("Message")) - } - if v.Signature == nil { - invalidParams.Add(smithy.NewErrParamRequired("Signature")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAthenaIntegration(v *types.AthenaIntegration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AthenaIntegration"} - if v.IntegrationResultS3DestinationArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("IntegrationResultS3DestinationArn")) - } - if len(v.PartitionLoadFrequency) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PartitionLoadFrequency")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAthenaIntegrationsSet(v []types.AthenaIntegration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AthenaIntegrationsSet"} - for i := range v { - if err := validateAthenaIntegration(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCidrAuthorizationContext(v *types.CidrAuthorizationContext) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CidrAuthorizationContext"} - if v.Message == nil { - invalidParams.Add(smithy.NewErrParamRequired("Message")) - } - if v.Signature == nil { - invalidParams.Add(smithy.NewErrParamRequired("Signature")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCreateTransitGatewayConnectRequestOptions(v *types.CreateTransitGatewayConnectRequestOptions) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayConnectRequestOptions"} - if len(v.Protocol) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Protocol")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCreditSpecificationRequest(v *types.CreditSpecificationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreditSpecificationRequest"} - if v.CpuCredits == nil { - invalidParams.Add(smithy.NewErrParamRequired("CpuCredits")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateDiskImage(v *types.DiskImage) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DiskImage"} - if v.Image != nil { - if err := validateDiskImageDetail(v.Image); err != nil { - invalidParams.AddNested("Image", err.(smithy.InvalidParamsError)) - } - } - if v.Volume != nil { - if err := validateVolumeDetail(v.Volume); err != nil { - invalidParams.AddNested("Volume", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateDiskImageDetail(v *types.DiskImageDetail) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DiskImageDetail"} - if len(v.Format) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Format")) - } - if v.Bytes == nil { - invalidParams.Add(smithy.NewErrParamRequired("Bytes")) - } - if v.ImportManifestUrl == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImportManifestUrl")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateDiskImageList(v []types.DiskImage) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DiskImageList"} - for i := range v { - if err := validateDiskImage(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateElasticGpuSpecification(v *types.ElasticGpuSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ElasticGpuSpecification"} - if v.Type == nil { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateElasticGpuSpecificationList(v []types.ElasticGpuSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ElasticGpuSpecificationList"} - for i := range v { - if err := validateElasticGpuSpecification(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateElasticGpuSpecifications(v []types.ElasticGpuSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ElasticGpuSpecifications"} - for i := range v { - if err := validateElasticGpuSpecification(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateElasticInferenceAccelerator(v *types.ElasticInferenceAccelerator) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ElasticInferenceAccelerator"} - if v.Type == nil { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateElasticInferenceAccelerators(v []types.ElasticInferenceAccelerator) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ElasticInferenceAccelerators"} - for i := range v { - if err := validateElasticInferenceAccelerator(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateExportTaskS3LocationRequest(v *types.ExportTaskS3LocationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportTaskS3LocationRequest"} - if v.S3Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateFastLaunchLaunchTemplateSpecificationRequest(v *types.FastLaunchLaunchTemplateSpecificationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FastLaunchLaunchTemplateSpecificationRequest"} - if v.Version == nil { - invalidParams.Add(smithy.NewErrParamRequired("Version")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateFleetLaunchTemplateConfigListRequest(v []types.FleetLaunchTemplateConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FleetLaunchTemplateConfigListRequest"} - for i := range v { - if err := validateFleetLaunchTemplateConfigRequest(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateFleetLaunchTemplateConfigRequest(v *types.FleetLaunchTemplateConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FleetLaunchTemplateConfigRequest"} - if v.Overrides != nil { - if err := validateFleetLaunchTemplateOverridesListRequest(v.Overrides); err != nil { - invalidParams.AddNested("Overrides", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateFleetLaunchTemplateOverridesListRequest(v []types.FleetLaunchTemplateOverridesRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FleetLaunchTemplateOverridesListRequest"} - for i := range v { - if err := validateFleetLaunchTemplateOverridesRequest(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateFleetLaunchTemplateOverridesRequest(v *types.FleetLaunchTemplateOverridesRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FleetLaunchTemplateOverridesRequest"} - if v.InstanceRequirements != nil { - if err := validateInstanceRequirementsRequest(v.InstanceRequirements); err != nil { - invalidParams.AddNested("InstanceRequirements", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateInstanceCreditSpecificationListRequest(v []types.InstanceCreditSpecificationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InstanceCreditSpecificationListRequest"} - for i := range v { - if err := validateInstanceCreditSpecificationRequest(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateInstanceCreditSpecificationRequest(v *types.InstanceCreditSpecificationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InstanceCreditSpecificationRequest"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateInstanceRequirementsRequest(v *types.InstanceRequirementsRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InstanceRequirementsRequest"} - if v.VCpuCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("VCpuCount")) - } else if v.VCpuCount != nil { - if err := validateVCpuCountRangeRequest(v.VCpuCount); err != nil { - invalidParams.AddNested("VCpuCount", err.(smithy.InvalidParamsError)) - } - } - if v.MemoryMiB == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemoryMiB")) - } else if v.MemoryMiB != nil { - if err := validateMemoryMiBRequest(v.MemoryMiB); err != nil { - invalidParams.AddNested("MemoryMiB", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateInstanceRequirementsWithMetadataRequest(v *types.InstanceRequirementsWithMetadataRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InstanceRequirementsWithMetadataRequest"} - if v.InstanceRequirements != nil { - if err := validateInstanceRequirementsRequest(v.InstanceRequirements); err != nil { - invalidParams.AddNested("InstanceRequirements", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateInstanceSpecification(v *types.InstanceSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InstanceSpecification"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateIntegrateServices(v *types.IntegrateServices) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "IntegrateServices"} - if v.AthenaIntegrations != nil { - if err := validateAthenaIntegrationsSet(v.AthenaIntegrations); err != nil { - invalidParams.AddNested("AthenaIntegrations", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateLaunchTemplateElasticInferenceAccelerator(v *types.LaunchTemplateElasticInferenceAccelerator) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "LaunchTemplateElasticInferenceAccelerator"} - if v.Type == nil { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateLaunchTemplateElasticInferenceAcceleratorList(v []types.LaunchTemplateElasticInferenceAccelerator) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "LaunchTemplateElasticInferenceAcceleratorList"} - for i := range v { - if err := validateLaunchTemplateElasticInferenceAccelerator(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateMemoryMiBRequest(v *types.MemoryMiBRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MemoryMiBRequest"} - if v.Min == nil { - invalidParams.Add(smithy.NewErrParamRequired("Min")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validatePurchaseRequest(v *types.PurchaseRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseRequest"} - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if v.PurchaseToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("PurchaseToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validatePurchaseRequestSet(v []types.PurchaseRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseRequestSet"} - for i := range v { - if err := validatePurchaseRequest(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRemovePrefixListEntries(v []types.RemovePrefixListEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RemovePrefixListEntries"} - for i := range v { - if err := validateRemovePrefixListEntry(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRemovePrefixListEntry(v *types.RemovePrefixListEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RemovePrefixListEntry"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRequestLaunchTemplateData(v *types.RequestLaunchTemplateData) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RequestLaunchTemplateData"} - if v.ElasticGpuSpecifications != nil { - if err := validateElasticGpuSpecificationList(v.ElasticGpuSpecifications); err != nil { - invalidParams.AddNested("ElasticGpuSpecifications", err.(smithy.InvalidParamsError)) - } - } - if v.ElasticInferenceAccelerators != nil { - if err := validateLaunchTemplateElasticInferenceAcceleratorList(v.ElasticInferenceAccelerators); err != nil { - invalidParams.AddNested("ElasticInferenceAccelerators", err.(smithy.InvalidParamsError)) - } - } - if v.CreditSpecification != nil { - if err := validateCreditSpecificationRequest(v.CreditSpecification); err != nil { - invalidParams.AddNested("CreditSpecification", err.(smithy.InvalidParamsError)) - } - } - if v.InstanceRequirements != nil { - if err := validateInstanceRequirementsRequest(v.InstanceRequirements); err != nil { - invalidParams.AddNested("InstanceRequirements", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRequestSpotLaunchSpecification(v *types.RequestSpotLaunchSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RequestSpotLaunchSpecification"} - if v.Monitoring != nil { - if err := validateRunInstancesMonitoringEnabled(v.Monitoring); err != nil { - invalidParams.AddNested("Monitoring", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRouteServerBgpOptionsRequest(v *types.RouteServerBgpOptionsRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RouteServerBgpOptionsRequest"} - if v.PeerAsn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerAsn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRunInstancesMonitoringEnabled(v *types.RunInstancesMonitoringEnabled) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RunInstancesMonitoringEnabled"} - if v.Enabled == nil { - invalidParams.Add(smithy.NewErrParamRequired("Enabled")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateScheduledInstancesLaunchSpecification(v *types.ScheduledInstancesLaunchSpecification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ScheduledInstancesLaunchSpecification"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSecurityGroupRuleUpdate(v *types.SecurityGroupRuleUpdate) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SecurityGroupRuleUpdate"} - if v.SecurityGroupRuleId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupRuleId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSecurityGroupRuleUpdateList(v []types.SecurityGroupRuleUpdate) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SecurityGroupRuleUpdateList"} - for i := range v { - if err := validateSecurityGroupRuleUpdate(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSlotDateTimeRangeRequest(v *types.SlotDateTimeRangeRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SlotDateTimeRangeRequest"} - if v.EarliestTime == nil { - invalidParams.Add(smithy.NewErrParamRequired("EarliestTime")) - } - if v.LatestTime == nil { - invalidParams.Add(smithy.NewErrParamRequired("LatestTime")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSpotFleetRequestConfigData(v *types.SpotFleetRequestConfigData) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SpotFleetRequestConfigData"} - if v.IamFleetRole == nil { - invalidParams.Add(smithy.NewErrParamRequired("IamFleetRole")) - } - if v.TargetCapacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetCapacity")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTargetCapacitySpecificationRequest(v *types.TargetCapacitySpecificationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TargetCapacitySpecificationRequest"} - if v.TotalTargetCapacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("TotalTargetCapacity")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTargetConfigurationRequest(v *types.TargetConfigurationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TargetConfigurationRequest"} - if v.OfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OfferingId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTargetConfigurationRequestSet(v []types.TargetConfigurationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TargetConfigurationRequestSet"} - for i := range v { - if err := validateTargetConfigurationRequest(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVCpuCountRangeRequest(v *types.VCpuCountRangeRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VCpuCountRangeRequest"} - if v.Min == nil { - invalidParams.Add(smithy.NewErrParamRequired("Min")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVerifiedAccessLogCloudWatchLogsDestinationOptions(v *types.VerifiedAccessLogCloudWatchLogsDestinationOptions) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VerifiedAccessLogCloudWatchLogsDestinationOptions"} - if v.Enabled == nil { - invalidParams.Add(smithy.NewErrParamRequired("Enabled")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVerifiedAccessLogKinesisDataFirehoseDestinationOptions(v *types.VerifiedAccessLogKinesisDataFirehoseDestinationOptions) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VerifiedAccessLogKinesisDataFirehoseDestinationOptions"} - if v.Enabled == nil { - invalidParams.Add(smithy.NewErrParamRequired("Enabled")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVerifiedAccessLogOptions(v *types.VerifiedAccessLogOptions) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VerifiedAccessLogOptions"} - if v.S3 != nil { - if err := validateVerifiedAccessLogS3DestinationOptions(v.S3); err != nil { - invalidParams.AddNested("S3", err.(smithy.InvalidParamsError)) - } - } - if v.CloudWatchLogs != nil { - if err := validateVerifiedAccessLogCloudWatchLogsDestinationOptions(v.CloudWatchLogs); err != nil { - invalidParams.AddNested("CloudWatchLogs", err.(smithy.InvalidParamsError)) - } - } - if v.KinesisDataFirehose != nil { - if err := validateVerifiedAccessLogKinesisDataFirehoseDestinationOptions(v.KinesisDataFirehose); err != nil { - invalidParams.AddNested("KinesisDataFirehose", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVerifiedAccessLogS3DestinationOptions(v *types.VerifiedAccessLogS3DestinationOptions) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VerifiedAccessLogS3DestinationOptions"} - if v.Enabled == nil { - invalidParams.Add(smithy.NewErrParamRequired("Enabled")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVolumeDetail(v *types.VolumeDetail) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VolumeDetail"} - if v.Size == nil { - invalidParams.Add(smithy.NewErrParamRequired("Size")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptAddressTransferInput(v *AcceptAddressTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptAddressTransferInput"} - if v.Address == nil { - invalidParams.Add(smithy.NewErrParamRequired("Address")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptCapacityReservationBillingOwnershipInput(v *AcceptCapacityReservationBillingOwnershipInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptCapacityReservationBillingOwnershipInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptReservedInstancesExchangeQuoteInput(v *AcceptReservedInstancesExchangeQuoteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptReservedInstancesExchangeQuoteInput"} - if v.ReservedInstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstanceIds")) - } - if v.TargetConfigurations != nil { - if err := validateTargetConfigurationRequestSet(v.TargetConfigurations); err != nil { - invalidParams.AddNested("TargetConfigurations", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptTransitGatewayPeeringAttachmentInput(v *AcceptTransitGatewayPeeringAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptTransitGatewayPeeringAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptTransitGatewayVpcAttachmentInput(v *AcceptTransitGatewayVpcAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptTransitGatewayVpcAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptVpcEndpointConnectionsInput(v *AcceptVpcEndpointConnectionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptVpcEndpointConnectionsInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if v.VpcEndpointIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptVpcPeeringConnectionInput(v *AcceptVpcPeeringConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptVpcPeeringConnectionInput"} - if v.VpcPeeringConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcPeeringConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAdvertiseByoipCidrInput(v *AdvertiseByoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AdvertiseByoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAllocateIpamPoolCidrInput(v *AllocateIpamPoolCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AllocateIpamPoolCidrInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpApplySecurityGroupsToClientVpnTargetNetworkInput(v *ApplySecurityGroupsToClientVpnTargetNetworkInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ApplySecurityGroupsToClientVpnTargetNetworkInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if v.SecurityGroupIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssignIpv6AddressesInput(v *AssignIpv6AddressesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssignIpv6AddressesInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssignPrivateIpAddressesInput(v *AssignPrivateIpAddressesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssignPrivateIpAddressesInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssignPrivateNatGatewayAddressInput(v *AssignPrivateNatGatewayAddressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssignPrivateNatGatewayAddressInput"} - if v.NatGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NatGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateCapacityReservationBillingOwnerInput(v *AssociateCapacityReservationBillingOwnerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateCapacityReservationBillingOwnerInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if v.UnusedReservationBillingOwnerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("UnusedReservationBillingOwnerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateClientVpnTargetNetworkInput(v *AssociateClientVpnTargetNetworkInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateClientVpnTargetNetworkInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateDhcpOptionsInput(v *AssociateDhcpOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateDhcpOptionsInput"} - if v.DhcpOptionsId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DhcpOptionsId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateEnclaveCertificateIamRoleInput(v *AssociateEnclaveCertificateIamRoleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateEnclaveCertificateIamRoleInput"} - if v.CertificateArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CertificateArn")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateIamInstanceProfileInput(v *AssociateIamInstanceProfileInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateIamInstanceProfileInput"} - if v.IamInstanceProfile == nil { - invalidParams.Add(smithy.NewErrParamRequired("IamInstanceProfile")) - } - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateInstanceEventWindowInput(v *AssociateInstanceEventWindowInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateInstanceEventWindowInput"} - if v.InstanceEventWindowId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceEventWindowId")) - } - if v.AssociationTarget == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationTarget")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateIpamByoasnInput(v *AssociateIpamByoasnInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateIpamByoasnInput"} - if v.Asn == nil { - invalidParams.Add(smithy.NewErrParamRequired("Asn")) - } - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateIpamResourceDiscoveryInput(v *AssociateIpamResourceDiscoveryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateIpamResourceDiscoveryInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateNatGatewayAddressInput(v *AssociateNatGatewayAddressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateNatGatewayAddressInput"} - if v.NatGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NatGatewayId")) - } - if v.AllocationIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("AllocationIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateRouteServerInput(v *AssociateRouteServerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateRouteServerInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateRouteTableInput(v *AssociateRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateRouteTableInput"} - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateSecurityGroupVpcInput(v *AssociateSecurityGroupVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateSecurityGroupVpcInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateSubnetCidrBlockInput(v *AssociateSubnetCidrBlockInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateSubnetCidrBlockInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateTransitGatewayMulticastDomainInput(v *AssociateTransitGatewayMulticastDomainInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateTransitGatewayMulticastDomainInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if v.SubnetIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateTransitGatewayPolicyTableInput(v *AssociateTransitGatewayPolicyTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateTransitGatewayPolicyTableInput"} - if v.TransitGatewayPolicyTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayPolicyTableId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateTransitGatewayRouteTableInput(v *AssociateTransitGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateTransitGatewayRouteTableInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateTrunkInterfaceInput(v *AssociateTrunkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateTrunkInterfaceInput"} - if v.BranchInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("BranchInterfaceId")) - } - if v.TrunkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrunkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateVpcCidrBlockInput(v *AssociateVpcCidrBlockInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateVpcCidrBlockInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachClassicLinkVpcInput(v *AttachClassicLinkVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachClassicLinkVpcInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if v.Groups == nil { - invalidParams.Add(smithy.NewErrParamRequired("Groups")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachInternetGatewayInput(v *AttachInternetGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachInternetGatewayInput"} - if v.InternetGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachNetworkInterfaceInput(v *AttachNetworkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachNetworkInterfaceInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.DeviceIndex == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceIndex")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachVerifiedAccessTrustProviderInput(v *AttachVerifiedAccessTrustProviderInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachVerifiedAccessTrustProviderInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if v.VerifiedAccessTrustProviderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessTrustProviderId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachVolumeInput(v *AttachVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachVolumeInput"} - if v.Device == nil { - invalidParams.Add(smithy.NewErrParamRequired("Device")) - } - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachVpnGatewayInput(v *AttachVpnGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachVpnGatewayInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if v.VpnGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAuthorizeClientVpnIngressInput(v *AuthorizeClientVpnIngressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AuthorizeClientVpnIngressInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.TargetNetworkCidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetNetworkCidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAuthorizeSecurityGroupEgressInput(v *AuthorizeSecurityGroupEgressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AuthorizeSecurityGroupEgressInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpBundleInstanceInput(v *BundleInstanceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "BundleInstanceInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.Storage == nil { - invalidParams.Add(smithy.NewErrParamRequired("Storage")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelBundleTaskInput(v *CancelBundleTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelBundleTaskInput"} - if v.BundleId == nil { - invalidParams.Add(smithy.NewErrParamRequired("BundleId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelCapacityReservationFleetsInput(v *CancelCapacityReservationFleetsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelCapacityReservationFleetsInput"} - if v.CapacityReservationFleetIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationFleetIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelCapacityReservationInput(v *CancelCapacityReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelCapacityReservationInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelConversionTaskInput(v *CancelConversionTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelConversionTaskInput"} - if v.ConversionTaskId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConversionTaskId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelDeclarativePoliciesReportInput(v *CancelDeclarativePoliciesReportInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelDeclarativePoliciesReportInput"} - if v.ReportId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReportId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelExportTaskInput"} - if v.ExportTaskId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ExportTaskId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelImageLaunchPermissionInput(v *CancelImageLaunchPermissionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelImageLaunchPermissionInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelReservedInstancesListingInput(v *CancelReservedInstancesListingInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelReservedInstancesListingInput"} - if v.ReservedInstancesListingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstancesListingId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelSpotFleetRequestsInput(v *CancelSpotFleetRequestsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelSpotFleetRequestsInput"} - if v.SpotFleetRequestIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotFleetRequestIds")) - } - if v.TerminateInstances == nil { - invalidParams.Add(smithy.NewErrParamRequired("TerminateInstances")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelSpotInstanceRequestsInput(v *CancelSpotInstanceRequestsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelSpotInstanceRequestsInput"} - if v.SpotInstanceRequestIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotInstanceRequestIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpConfirmProductInstanceInput(v *ConfirmProductInstanceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ConfirmProductInstanceInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.ProductCode == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProductCode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCopyFpgaImageInput(v *CopyFpgaImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CopyFpgaImageInput"} - if v.SourceFpgaImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceFpgaImageId")) - } - if v.SourceRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCopyImageInput(v *CopyImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CopyImageInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.SourceImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceImageId")) - } - if v.SourceRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCopySnapshotInput(v *CopySnapshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CopySnapshotInput"} - if v.SourceRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceRegion")) - } - if v.SourceSnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceSnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCapacityReservationBySplittingInput(v *CreateCapacityReservationBySplittingInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCapacityReservationBySplittingInput"} - if v.SourceCapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceCapacityReservationId")) - } - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCapacityReservationFleetInput(v *CreateCapacityReservationFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCapacityReservationFleetInput"} - if v.InstanceTypeSpecifications == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceTypeSpecifications")) - } - if v.TotalTargetCapacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("TotalTargetCapacity")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCapacityReservationInput(v *CreateCapacityReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCapacityReservationInput"} - if v.InstanceType == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) - } - if len(v.InstancePlatform) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InstancePlatform")) - } - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCarrierGatewayInput(v *CreateCarrierGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCarrierGatewayInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateClientVpnEndpointInput(v *CreateClientVpnEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateClientVpnEndpointInput"} - if v.ClientCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientCidrBlock")) - } - if v.ServerCertificateArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServerCertificateArn")) - } - if v.AuthenticationOptions == nil { - invalidParams.Add(smithy.NewErrParamRequired("AuthenticationOptions")) - } - if v.ConnectionLogOptions == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionLogOptions")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateClientVpnRouteInput(v *CreateClientVpnRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateClientVpnRouteInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.TargetVpcSubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetVpcSubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCoipCidrInput(v *CreateCoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.CoipPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CoipPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCoipPoolInput(v *CreateCoipPoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCoipPoolInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCustomerGatewayInput(v *CreateCustomerGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCustomerGatewayInput"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateDefaultSubnetInput(v *CreateDefaultSubnetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateDefaultSubnetInput"} - if v.AvailabilityZone == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateDelegateMacVolumeOwnershipTaskInput(v *CreateDelegateMacVolumeOwnershipTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateDelegateMacVolumeOwnershipTaskInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.MacCredentials == nil { - invalidParams.Add(smithy.NewErrParamRequired("MacCredentials")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateDhcpOptionsInput(v *CreateDhcpOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateDhcpOptionsInput"} - if v.DhcpConfigurations == nil { - invalidParams.Add(smithy.NewErrParamRequired("DhcpConfigurations")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateEgressOnlyInternetGatewayInput(v *CreateEgressOnlyInternetGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateEgressOnlyInternetGatewayInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateFleetInput(v *CreateFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateFleetInput"} - if v.LaunchTemplateConfigs == nil { - invalidParams.Add(smithy.NewErrParamRequired("LaunchTemplateConfigs")) - } else if v.LaunchTemplateConfigs != nil { - if err := validateFleetLaunchTemplateConfigListRequest(v.LaunchTemplateConfigs); err != nil { - invalidParams.AddNested("LaunchTemplateConfigs", err.(smithy.InvalidParamsError)) - } - } - if v.TargetCapacitySpecification == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetCapacitySpecification")) - } else if v.TargetCapacitySpecification != nil { - if err := validateTargetCapacitySpecificationRequest(v.TargetCapacitySpecification); err != nil { - invalidParams.AddNested("TargetCapacitySpecification", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateFlowLogsInput(v *CreateFlowLogsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateFlowLogsInput"} - if v.ResourceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceIds")) - } - if len(v.ResourceType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateFpgaImageInput(v *CreateFpgaImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateFpgaImageInput"} - if v.InputStorageLocation == nil { - invalidParams.Add(smithy.NewErrParamRequired("InputStorageLocation")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateImageInput(v *CreateImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateImageInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateInstanceConnectEndpointInput(v *CreateInstanceConnectEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateInstanceConnectEndpointInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateInstanceExportTaskInput(v *CreateInstanceExportTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateInstanceExportTaskInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.TargetEnvironment) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("TargetEnvironment")) - } - if v.ExportToS3Task == nil { - invalidParams.Add(smithy.NewErrParamRequired("ExportToS3Task")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateIpamExternalResourceVerificationTokenInput(v *CreateIpamExternalResourceVerificationTokenInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateIpamExternalResourceVerificationTokenInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateIpamPoolInput(v *CreateIpamPoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateIpamPoolInput"} - if v.IpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamScopeId")) - } - if len(v.AddressFamily) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("AddressFamily")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateIpamScopeInput(v *CreateIpamScopeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateIpamScopeInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateKeyPairInput(v *CreateKeyPairInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateKeyPairInput"} - if v.KeyName == nil { - invalidParams.Add(smithy.NewErrParamRequired("KeyName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLaunchTemplateInput(v *CreateLaunchTemplateInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLaunchTemplateInput"} - if v.LaunchTemplateName == nil { - invalidParams.Add(smithy.NewErrParamRequired("LaunchTemplateName")) - } - if v.LaunchTemplateData == nil { - invalidParams.Add(smithy.NewErrParamRequired("LaunchTemplateData")) - } else if v.LaunchTemplateData != nil { - if err := validateRequestLaunchTemplateData(v.LaunchTemplateData); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLaunchTemplateVersionInput(v *CreateLaunchTemplateVersionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLaunchTemplateVersionInput"} - if v.LaunchTemplateData == nil { - invalidParams.Add(smithy.NewErrParamRequired("LaunchTemplateData")) - } else if v.LaunchTemplateData != nil { - if err := validateRequestLaunchTemplateData(v.LaunchTemplateData); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayRouteInput(v *CreateLocalGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayRouteInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayRouteTableInput(v *CreateLocalGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayRouteTableInput"} - if v.LocalGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(v *CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if v.LocalGatewayVirtualInterfaceGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayVirtualInterfaceGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayRouteTableVpcAssociationInput(v *CreateLocalGatewayRouteTableVpcAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayRouteTableVpcAssociationInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayVirtualInterfaceGroupInput(v *CreateLocalGatewayVirtualInterfaceGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayVirtualInterfaceGroupInput"} - if v.LocalGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateLocalGatewayVirtualInterfaceInput(v *CreateLocalGatewayVirtualInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateLocalGatewayVirtualInterfaceInput"} - if v.LocalGatewayVirtualInterfaceGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayVirtualInterfaceGroupId")) - } - if v.OutpostLagId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OutpostLagId")) - } - if v.Vlan == nil { - invalidParams.Add(smithy.NewErrParamRequired("Vlan")) - } - if v.LocalAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalAddress")) - } - if v.PeerAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerAddress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateMacSystemIntegrityProtectionModificationTaskInput(v *CreateMacSystemIntegrityProtectionModificationTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateMacSystemIntegrityProtectionModificationTaskInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.MacSystemIntegrityProtectionStatus) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("MacSystemIntegrityProtectionStatus")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateManagedPrefixListInput(v *CreateManagedPrefixListInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateManagedPrefixListInput"} - if v.PrefixListName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListName")) - } - if v.Entries != nil { - if err := validateAddPrefixListEntries(v.Entries); err != nil { - invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) - } - } - if v.MaxEntries == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxEntries")) - } - if v.AddressFamily == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddressFamily")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNatGatewayInput(v *CreateNatGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNatGatewayInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkAclEntryInput(v *CreateNetworkAclEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkAclEntryInput"} - if v.NetworkAclId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkAclId")) - } - if v.RuleNumber == nil { - invalidParams.Add(smithy.NewErrParamRequired("RuleNumber")) - } - if v.Protocol == nil { - invalidParams.Add(smithy.NewErrParamRequired("Protocol")) - } - if len(v.RuleAction) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RuleAction")) - } - if v.Egress == nil { - invalidParams.Add(smithy.NewErrParamRequired("Egress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkAclInput(v *CreateNetworkAclInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkAclInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkInsightsAccessScopeInput(v *CreateNetworkInsightsAccessScopeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkInsightsAccessScopeInput"} - if v.ClientToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkInsightsPathInput(v *CreateNetworkInsightsPathInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkInsightsPathInput"} - if v.Source == nil { - invalidParams.Add(smithy.NewErrParamRequired("Source")) - } - if len(v.Protocol) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Protocol")) - } - if v.ClientToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkInterfaceInput(v *CreateNetworkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkInterfaceInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNetworkInterfacePermissionInput(v *CreateNetworkInterfacePermissionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkInterfacePermissionInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if len(v.Permission) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Permission")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateReplaceRootVolumeTaskInput(v *CreateReplaceRootVolumeTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateReplaceRootVolumeTaskInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateReservedInstancesListingInput(v *CreateReservedInstancesListingInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateReservedInstancesListingInput"} - if v.ReservedInstancesId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstancesId")) - } - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if v.PriceSchedules == nil { - invalidParams.Add(smithy.NewErrParamRequired("PriceSchedules")) - } - if v.ClientToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRestoreImageTaskInput(v *CreateRestoreImageTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRestoreImageTaskInput"} - if v.Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("Bucket")) - } - if v.ObjectKey == nil { - invalidParams.Add(smithy.NewErrParamRequired("ObjectKey")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRouteInput(v *CreateRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRouteInput"} - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRouteServerEndpointInput(v *CreateRouteServerEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRouteServerEndpointInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRouteServerInput(v *CreateRouteServerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRouteServerInput"} - if v.AmazonSideAsn == nil { - invalidParams.Add(smithy.NewErrParamRequired("AmazonSideAsn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRouteServerPeerInput(v *CreateRouteServerPeerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRouteServerPeerInput"} - if v.RouteServerEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerEndpointId")) - } - if v.PeerAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerAddress")) - } - if v.BgpOptions == nil { - invalidParams.Add(smithy.NewErrParamRequired("BgpOptions")) - } else if v.BgpOptions != nil { - if err := validateRouteServerBgpOptionsRequest(v.BgpOptions); err != nil { - invalidParams.AddNested("BgpOptions", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateRouteTableInput(v *CreateRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateRouteTableInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSecurityGroupInput(v *CreateSecurityGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSecurityGroupInput"} - if v.Description == nil { - invalidParams.Add(smithy.NewErrParamRequired("Description")) - } - if v.GroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSnapshotInput(v *CreateSnapshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSnapshotsInput(v *CreateSnapshotsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotsInput"} - if v.InstanceSpecification == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceSpecification")) - } else if v.InstanceSpecification != nil { - if err := validateInstanceSpecification(v.InstanceSpecification); err != nil { - invalidParams.AddNested("InstanceSpecification", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSpotDatafeedSubscriptionInput(v *CreateSpotDatafeedSubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSpotDatafeedSubscriptionInput"} - if v.Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("Bucket")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateStoreImageTaskInput(v *CreateStoreImageTaskInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateStoreImageTaskInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if v.Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("Bucket")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSubnetCidrReservationInput(v *CreateSubnetCidrReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSubnetCidrReservationInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if len(v.ReservationType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ReservationType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSubnetInput(v *CreateSubnetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSubnetInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTagsInput(v *CreateTagsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTagsInput"} - if v.Resources == nil { - invalidParams.Add(smithy.NewErrParamRequired("Resources")) - } - if v.Tags == nil { - invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTrafficMirrorFilterRuleInput(v *CreateTrafficMirrorFilterRuleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTrafficMirrorFilterRuleInput"} - if v.TrafficMirrorFilterId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterId")) - } - if len(v.TrafficDirection) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("TrafficDirection")) - } - if v.RuleNumber == nil { - invalidParams.Add(smithy.NewErrParamRequired("RuleNumber")) - } - if len(v.RuleAction) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RuleAction")) - } - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.SourceCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceCidrBlock")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTrafficMirrorSessionInput(v *CreateTrafficMirrorSessionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTrafficMirrorSessionInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if v.TrafficMirrorTargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorTargetId")) - } - if v.TrafficMirrorFilterId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterId")) - } - if v.SessionNumber == nil { - invalidParams.Add(smithy.NewErrParamRequired("SessionNumber")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayConnectInput(v *CreateTransitGatewayConnectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayConnectInput"} - if v.TransportTransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransportTransitGatewayAttachmentId")) - } - if v.Options == nil { - invalidParams.Add(smithy.NewErrParamRequired("Options")) - } else if v.Options != nil { - if err := validateCreateTransitGatewayConnectRequestOptions(v.Options); err != nil { - invalidParams.AddNested("Options", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayConnectPeerInput(v *CreateTransitGatewayConnectPeerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayConnectPeerInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if v.PeerAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerAddress")) - } - if v.InsideCidrBlocks == nil { - invalidParams.Add(smithy.NewErrParamRequired("InsideCidrBlocks")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayMulticastDomainInput(v *CreateTransitGatewayMulticastDomainInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayMulticastDomainInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayPeeringAttachmentInput(v *CreateTransitGatewayPeeringAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayPeeringAttachmentInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if v.PeerTransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerTransitGatewayId")) - } - if v.PeerAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerAccountId")) - } - if v.PeerRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeerRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayPolicyTableInput(v *CreateTransitGatewayPolicyTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayPolicyTableInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayPrefixListReferenceInput(v *CreateTransitGatewayPrefixListReferenceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayPrefixListReferenceInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayRouteInput(v *CreateTransitGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayRouteInput"} - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayRouteTableAnnouncementInput(v *CreateTransitGatewayRouteTableAnnouncementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayRouteTableAnnouncementInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.PeeringAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PeeringAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayRouteTableInput(v *CreateTransitGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayRouteTableInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTransitGatewayVpcAttachmentInput(v *CreateTransitGatewayVpcAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTransitGatewayVpcAttachmentInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if v.SubnetIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVerifiedAccessEndpointInput(v *CreateVerifiedAccessEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVerifiedAccessEndpointInput"} - if v.VerifiedAccessGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessGroupId")) - } - if len(v.EndpointType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("EndpointType")) - } - if len(v.AttachmentType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("AttachmentType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVerifiedAccessGroupInput(v *CreateVerifiedAccessGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVerifiedAccessGroupInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVerifiedAccessTrustProviderInput(v *CreateVerifiedAccessTrustProviderInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVerifiedAccessTrustProviderInput"} - if len(v.TrustProviderType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("TrustProviderType")) - } - if v.PolicyReferenceName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyReferenceName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVolumeInput(v *CreateVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVolumeInput"} - if v.AvailabilityZone == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpcBlockPublicAccessExclusionInput(v *CreateVpcBlockPublicAccessExclusionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpcBlockPublicAccessExclusionInput"} - if len(v.InternetGatewayExclusionMode) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayExclusionMode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpcEndpointConnectionNotificationInput(v *CreateVpcEndpointConnectionNotificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointConnectionNotificationInput"} - if v.ConnectionNotificationArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionNotificationArn")) - } - if v.ConnectionEvents == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionEvents")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpcPeeringConnectionInput(v *CreateVpcPeeringConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpcPeeringConnectionInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpnConnectionInput(v *CreateVpnConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpnConnectionInput"} - if v.CustomerGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CustomerGatewayId")) - } - if v.Type == nil { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpnConnectionRouteInput(v *CreateVpnConnectionRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpnConnectionRouteInput"} - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateVpnGatewayInput(v *CreateVpnGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateVpnGatewayInput"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCarrierGatewayInput(v *DeleteCarrierGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCarrierGatewayInput"} - if v.CarrierGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CarrierGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteClientVpnEndpointInput(v *DeleteClientVpnEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteClientVpnEndpointInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteClientVpnRouteInput(v *DeleteClientVpnRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteClientVpnRouteInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCoipCidrInput(v *DeleteCoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.CoipPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CoipPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCoipPoolInput(v *DeleteCoipPoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCoipPoolInput"} - if v.CoipPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CoipPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCustomerGatewayInput(v *DeleteCustomerGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomerGatewayInput"} - if v.CustomerGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CustomerGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteDhcpOptionsInput(v *DeleteDhcpOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteDhcpOptionsInput"} - if v.DhcpOptionsId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DhcpOptionsId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteEgressOnlyInternetGatewayInput(v *DeleteEgressOnlyInternetGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteEgressOnlyInternetGatewayInput"} - if v.EgressOnlyInternetGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("EgressOnlyInternetGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteFleetsInput(v *DeleteFleetsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteFleetsInput"} - if v.FleetIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("FleetIds")) - } - if v.TerminateInstances == nil { - invalidParams.Add(smithy.NewErrParamRequired("TerminateInstances")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteFlowLogsInput(v *DeleteFlowLogsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteFlowLogsInput"} - if v.FlowLogIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("FlowLogIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteFpgaImageInput(v *DeleteFpgaImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteFpgaImageInput"} - if v.FpgaImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FpgaImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteInstanceConnectEndpointInput(v *DeleteInstanceConnectEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceConnectEndpointInput"} - if v.InstanceConnectEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceConnectEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteInstanceEventWindowInput(v *DeleteInstanceEventWindowInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceEventWindowInput"} - if v.InstanceEventWindowId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceEventWindowId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteInternetGatewayInput(v *DeleteInternetGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteInternetGatewayInput"} - if v.InternetGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteIpamExternalResourceVerificationTokenInput(v *DeleteIpamExternalResourceVerificationTokenInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteIpamExternalResourceVerificationTokenInput"} - if v.IpamExternalResourceVerificationTokenId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamExternalResourceVerificationTokenId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteIpamInput(v *DeleteIpamInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteIpamInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteIpamPoolInput(v *DeleteIpamPoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteIpamPoolInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteIpamResourceDiscoveryInput(v *DeleteIpamResourceDiscoveryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteIpamResourceDiscoveryInput"} - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteIpamScopeInput(v *DeleteIpamScopeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteIpamScopeInput"} - if v.IpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLaunchTemplateVersionsInput(v *DeleteLaunchTemplateVersionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLaunchTemplateVersionsInput"} - if v.Versions == nil { - invalidParams.Add(smithy.NewErrParamRequired("Versions")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayRouteInput(v *DeleteLocalGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayRouteInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayRouteTableInput(v *DeleteLocalGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayRouteTableInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput(v *DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationInput"} - if v.LocalGatewayRouteTableVirtualInterfaceGroupAssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableVirtualInterfaceGroupAssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayRouteTableVpcAssociationInput(v *DeleteLocalGatewayRouteTableVpcAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayRouteTableVpcAssociationInput"} - if v.LocalGatewayRouteTableVpcAssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableVpcAssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayVirtualInterfaceGroupInput(v *DeleteLocalGatewayVirtualInterfaceGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayVirtualInterfaceGroupInput"} - if v.LocalGatewayVirtualInterfaceGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayVirtualInterfaceGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteLocalGatewayVirtualInterfaceInput(v *DeleteLocalGatewayVirtualInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteLocalGatewayVirtualInterfaceInput"} - if v.LocalGatewayVirtualInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayVirtualInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteManagedPrefixListInput(v *DeleteManagedPrefixListInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteManagedPrefixListInput"} - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNatGatewayInput(v *DeleteNatGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNatGatewayInput"} - if v.NatGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NatGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkAclEntryInput(v *DeleteNetworkAclEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkAclEntryInput"} - if v.NetworkAclId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkAclId")) - } - if v.RuleNumber == nil { - invalidParams.Add(smithy.NewErrParamRequired("RuleNumber")) - } - if v.Egress == nil { - invalidParams.Add(smithy.NewErrParamRequired("Egress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkAclInput(v *DeleteNetworkAclInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkAclInput"} - if v.NetworkAclId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkAclId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInsightsAccessScopeAnalysisInput(v *DeleteNetworkInsightsAccessScopeAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInsightsAccessScopeAnalysisInput"} - if v.NetworkInsightsAccessScopeAnalysisId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAccessScopeAnalysisId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInsightsAccessScopeInput(v *DeleteNetworkInsightsAccessScopeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInsightsAccessScopeInput"} - if v.NetworkInsightsAccessScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAccessScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInsightsAnalysisInput(v *DeleteNetworkInsightsAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInsightsAnalysisInput"} - if v.NetworkInsightsAnalysisId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAnalysisId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInsightsPathInput(v *DeleteNetworkInsightsPathInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInsightsPathInput"} - if v.NetworkInsightsPathId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsPathId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInterfaceInput(v *DeleteNetworkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInterfaceInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNetworkInterfacePermissionInput(v *DeleteNetworkInterfacePermissionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNetworkInterfacePermissionInput"} - if v.NetworkInterfacePermissionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfacePermissionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeletePlacementGroupInput(v *DeletePlacementGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeletePlacementGroupInput"} - if v.GroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeletePublicIpv4PoolInput(v *DeletePublicIpv4PoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeletePublicIpv4PoolInput"} - if v.PoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteQueuedReservedInstancesInput(v *DeleteQueuedReservedInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteQueuedReservedInstancesInput"} - if v.ReservedInstancesIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstancesIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteRouteInput(v *DeleteRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteInput"} - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteRouteServerEndpointInput(v *DeleteRouteServerEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteServerEndpointInput"} - if v.RouteServerEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteRouteServerInput(v *DeleteRouteServerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteServerInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteRouteServerPeerInput(v *DeleteRouteServerPeerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteServerPeerInput"} - if v.RouteServerPeerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerPeerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteRouteTableInput(v *DeleteRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteTableInput"} - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteSnapshotInput(v *DeleteSnapshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteSnapshotInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteSubnetCidrReservationInput(v *DeleteSubnetCidrReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteSubnetCidrReservationInput"} - if v.SubnetCidrReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetCidrReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteSubnetInput(v *DeleteSubnetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteSubnetInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTagsInput(v *DeleteTagsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTagsInput"} - if v.Resources == nil { - invalidParams.Add(smithy.NewErrParamRequired("Resources")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTrafficMirrorFilterInput(v *DeleteTrafficMirrorFilterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTrafficMirrorFilterInput"} - if v.TrafficMirrorFilterId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTrafficMirrorFilterRuleInput(v *DeleteTrafficMirrorFilterRuleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTrafficMirrorFilterRuleInput"} - if v.TrafficMirrorFilterRuleId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterRuleId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTrafficMirrorSessionInput(v *DeleteTrafficMirrorSessionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTrafficMirrorSessionInput"} - if v.TrafficMirrorSessionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorSessionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTrafficMirrorTargetInput(v *DeleteTrafficMirrorTargetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTrafficMirrorTargetInput"} - if v.TrafficMirrorTargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorTargetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayConnectInput(v *DeleteTransitGatewayConnectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayConnectInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayConnectPeerInput(v *DeleteTransitGatewayConnectPeerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayConnectPeerInput"} - if v.TransitGatewayConnectPeerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayConnectPeerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayInput(v *DeleteTransitGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayMulticastDomainInput(v *DeleteTransitGatewayMulticastDomainInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayMulticastDomainInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayPeeringAttachmentInput(v *DeleteTransitGatewayPeeringAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayPeeringAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayPolicyTableInput(v *DeleteTransitGatewayPolicyTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayPolicyTableInput"} - if v.TransitGatewayPolicyTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayPolicyTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayPrefixListReferenceInput(v *DeleteTransitGatewayPrefixListReferenceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayPrefixListReferenceInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayRouteInput(v *DeleteTransitGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayRouteInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayRouteTableAnnouncementInput(v *DeleteTransitGatewayRouteTableAnnouncementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayRouteTableAnnouncementInput"} - if v.TransitGatewayRouteTableAnnouncementId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableAnnouncementId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayRouteTableInput(v *DeleteTransitGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayRouteTableInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteTransitGatewayVpcAttachmentInput(v *DeleteTransitGatewayVpcAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteTransitGatewayVpcAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVerifiedAccessEndpointInput(v *DeleteVerifiedAccessEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVerifiedAccessEndpointInput"} - if v.VerifiedAccessEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVerifiedAccessGroupInput(v *DeleteVerifiedAccessGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVerifiedAccessGroupInput"} - if v.VerifiedAccessGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVerifiedAccessInstanceInput(v *DeleteVerifiedAccessInstanceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVerifiedAccessInstanceInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVerifiedAccessTrustProviderInput(v *DeleteVerifiedAccessTrustProviderInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVerifiedAccessTrustProviderInput"} - if v.VerifiedAccessTrustProviderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessTrustProviderId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVolumeInput(v *DeleteVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVolumeInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcBlockPublicAccessExclusionInput(v *DeleteVpcBlockPublicAccessExclusionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcBlockPublicAccessExclusionInput"} - if v.ExclusionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ExclusionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcEndpointConnectionNotificationsInput(v *DeleteVpcEndpointConnectionNotificationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointConnectionNotificationsInput"} - if v.ConnectionNotificationIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionNotificationIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcEndpointServiceConfigurationsInput(v *DeleteVpcEndpointServiceConfigurationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointServiceConfigurationsInput"} - if v.ServiceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcEndpointsInput(v *DeleteVpcEndpointsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointsInput"} - if v.VpcEndpointIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcInput(v *DeleteVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpcPeeringConnectionInput(v *DeleteVpcPeeringConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcPeeringConnectionInput"} - if v.VpcPeeringConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcPeeringConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpnConnectionInput(v *DeleteVpnConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpnConnectionInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpnConnectionRouteInput(v *DeleteVpnConnectionRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpnConnectionRouteInput"} - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteVpnGatewayInput(v *DeleteVpnGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteVpnGatewayInput"} - if v.VpnGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeprovisionByoipCidrInput(v *DeprovisionByoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeprovisionByoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeprovisionIpamByoasnInput(v *DeprovisionIpamByoasnInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeprovisionIpamByoasnInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if v.Asn == nil { - invalidParams.Add(smithy.NewErrParamRequired("Asn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeprovisionIpamPoolCidrInput(v *DeprovisionIpamPoolCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeprovisionIpamPoolCidrInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeprovisionPublicIpv4PoolCidrInput(v *DeprovisionPublicIpv4PoolCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeprovisionPublicIpv4PoolCidrInput"} - if v.PoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PoolId")) - } - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeregisterImageInput(v *DeregisterImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeregisterImageInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeregisterInstanceEventNotificationAttributesInput(v *DeregisterInstanceEventNotificationAttributesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeregisterInstanceEventNotificationAttributesInput"} - if v.InstanceTagAttribute == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceTagAttribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeByoipCidrsInput(v *DescribeByoipCidrsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeByoipCidrsInput"} - if v.MaxResults == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxResults")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCapacityBlockExtensionOfferingsInput(v *DescribeCapacityBlockExtensionOfferingsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCapacityBlockExtensionOfferingsInput"} - if v.CapacityBlockExtensionDurationHours == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityBlockExtensionDurationHours")) - } - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCapacityBlockOfferingsInput(v *DescribeCapacityBlockOfferingsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCapacityBlockOfferingsInput"} - if v.CapacityDurationHours == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityDurationHours")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCapacityReservationBillingRequestsInput(v *DescribeCapacityReservationBillingRequestsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCapacityReservationBillingRequestsInput"} - if len(v.Role) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Role")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeClientVpnAuthorizationRulesInput(v *DescribeClientVpnAuthorizationRulesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeClientVpnAuthorizationRulesInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeClientVpnConnectionsInput(v *DescribeClientVpnConnectionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeClientVpnConnectionsInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeClientVpnRoutesInput(v *DescribeClientVpnRoutesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeClientVpnRoutesInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeClientVpnTargetNetworksInput(v *DescribeClientVpnTargetNetworksInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeClientVpnTargetNetworksInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeFleetHistoryInput(v *DescribeFleetHistoryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeFleetHistoryInput"} - if v.FleetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FleetId")) - } - if v.StartTime == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartTime")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeFleetInstancesInput(v *DescribeFleetInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeFleetInstancesInput"} - if v.FleetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FleetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeFpgaImageAttributeInput(v *DescribeFpgaImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeFpgaImageAttributeInput"} - if v.FpgaImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FpgaImageId")) - } - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeIdentityIdFormatInput(v *DescribeIdentityIdFormatInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeIdentityIdFormatInput"} - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeImageAttributeInput(v *DescribeImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeImageAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeInstanceAttributeInput(v *DescribeInstanceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeInstanceAttributeInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeNetworkInterfaceAttributeInput(v *DescribeNetworkInterfaceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeNetworkInterfaceAttributeInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeScheduledInstanceAvailabilityInput(v *DescribeScheduledInstanceAvailabilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeScheduledInstanceAvailabilityInput"} - if v.FirstSlotStartTimeRange == nil { - invalidParams.Add(smithy.NewErrParamRequired("FirstSlotStartTimeRange")) - } else if v.FirstSlotStartTimeRange != nil { - if err := validateSlotDateTimeRangeRequest(v.FirstSlotStartTimeRange); err != nil { - invalidParams.AddNested("FirstSlotStartTimeRange", err.(smithy.InvalidParamsError)) - } - } - if v.Recurrence == nil { - invalidParams.Add(smithy.NewErrParamRequired("Recurrence")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeSecurityGroupReferencesInput(v *DescribeSecurityGroupReferencesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeSecurityGroupReferencesInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeSnapshotAttributeInput(v *DescribeSnapshotAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeSnapshotAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeSpotFleetInstancesInput(v *DescribeSpotFleetInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeSpotFleetInstancesInput"} - if v.SpotFleetRequestId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotFleetRequestId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeSpotFleetRequestHistoryInput(v *DescribeSpotFleetRequestHistoryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeSpotFleetRequestHistoryInput"} - if v.SpotFleetRequestId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotFleetRequestId")) - } - if v.StartTime == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartTime")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeStaleSecurityGroupsInput(v *DescribeStaleSecurityGroupsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeStaleSecurityGroupsInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeVolumeAttributeInput(v *DescribeVolumeAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeVolumeAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeVpcAttributeInput(v *DescribeVpcAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeVpcEndpointServicePermissionsInput(v *DescribeVpcEndpointServicePermissionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcEndpointServicePermissionsInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachClassicLinkVpcInput(v *DetachClassicLinkVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachClassicLinkVpcInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachInternetGatewayInput(v *DetachInternetGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachInternetGatewayInput"} - if v.InternetGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachNetworkInterfaceInput(v *DetachNetworkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachNetworkInterfaceInput"} - if v.AttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachVerifiedAccessTrustProviderInput(v *DetachVerifiedAccessTrustProviderInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachVerifiedAccessTrustProviderInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if v.VerifiedAccessTrustProviderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessTrustProviderId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachVolumeInput(v *DetachVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachVolumeInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachVpnGatewayInput(v *DetachVpnGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachVpnGatewayInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if v.VpnGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableAddressTransferInput(v *DisableAddressTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableAddressTransferInput"} - if v.AllocationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AllocationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableFastLaunchInput(v *DisableFastLaunchInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableFastLaunchInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableFastSnapshotRestoresInput(v *DisableFastSnapshotRestoresInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableFastSnapshotRestoresInput"} - if v.AvailabilityZones == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZones")) - } - if v.SourceSnapshotIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceSnapshotIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableImageDeprecationInput(v *DisableImageDeprecationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableImageDeprecationInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableImageDeregistrationProtectionInput(v *DisableImageDeregistrationProtectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableImageDeregistrationProtectionInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableImageInput(v *DisableImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableImageInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableIpamOrganizationAdminAccountInput(v *DisableIpamOrganizationAdminAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableIpamOrganizationAdminAccountInput"} - if v.DelegatedAdminAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DelegatedAdminAccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableRouteServerPropagationInput(v *DisableRouteServerPropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableRouteServerPropagationInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableTransitGatewayRouteTablePropagationInput(v *DisableTransitGatewayRouteTablePropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableTransitGatewayRouteTablePropagationInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableVgwRoutePropagationInput(v *DisableVgwRoutePropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableVgwRoutePropagationInput"} - if v.GatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GatewayId")) - } - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableVpcClassicLinkInput(v *DisableVpcClassicLinkInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableVpcClassicLinkInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateCapacityReservationBillingOwnerInput(v *DisassociateCapacityReservationBillingOwnerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateCapacityReservationBillingOwnerInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if v.UnusedReservationBillingOwnerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("UnusedReservationBillingOwnerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateClientVpnTargetNetworkInput(v *DisassociateClientVpnTargetNetworkInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateClientVpnTargetNetworkInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateEnclaveCertificateIamRoleInput(v *DisassociateEnclaveCertificateIamRoleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateEnclaveCertificateIamRoleInput"} - if v.CertificateArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CertificateArn")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateIamInstanceProfileInput(v *DisassociateIamInstanceProfileInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateIamInstanceProfileInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateInstanceEventWindowInput(v *DisassociateInstanceEventWindowInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateInstanceEventWindowInput"} - if v.InstanceEventWindowId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceEventWindowId")) - } - if v.AssociationTarget == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationTarget")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateIpamByoasnInput(v *DisassociateIpamByoasnInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateIpamByoasnInput"} - if v.Asn == nil { - invalidParams.Add(smithy.NewErrParamRequired("Asn")) - } - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateIpamResourceDiscoveryInput(v *DisassociateIpamResourceDiscoveryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateIpamResourceDiscoveryInput"} - if v.IpamResourceDiscoveryAssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryAssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateNatGatewayAddressInput(v *DisassociateNatGatewayAddressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateNatGatewayAddressInput"} - if v.NatGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NatGatewayId")) - } - if v.AssociationIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateRouteServerInput(v *DisassociateRouteServerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateRouteServerInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateRouteTableInput(v *DisassociateRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateRouteTableInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateSecurityGroupVpcInput(v *DisassociateSecurityGroupVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateSecurityGroupVpcInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateSubnetCidrBlockInput(v *DisassociateSubnetCidrBlockInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateSubnetCidrBlockInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateTransitGatewayMulticastDomainInput(v *DisassociateTransitGatewayMulticastDomainInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateTransitGatewayMulticastDomainInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if v.SubnetIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateTransitGatewayPolicyTableInput(v *DisassociateTransitGatewayPolicyTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateTransitGatewayPolicyTableInput"} - if v.TransitGatewayPolicyTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayPolicyTableId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateTransitGatewayRouteTableInput(v *DisassociateTransitGatewayRouteTableInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateTransitGatewayRouteTableInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateTrunkInterfaceInput(v *DisassociateTrunkInterfaceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateTrunkInterfaceInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateVpcCidrBlockInput(v *DisassociateVpcCidrBlockInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateVpcCidrBlockInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableAddressTransferInput(v *EnableAddressTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableAddressTransferInput"} - if v.AllocationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AllocationId")) - } - if v.TransferAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransferAccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableAllowedImagesSettingsInput(v *EnableAllowedImagesSettingsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableAllowedImagesSettingsInput"} - if len(v.AllowedImagesSettingsState) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("AllowedImagesSettingsState")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableFastLaunchInput(v *EnableFastLaunchInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableFastLaunchInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if v.LaunchTemplate != nil { - if err := validateFastLaunchLaunchTemplateSpecificationRequest(v.LaunchTemplate); err != nil { - invalidParams.AddNested("LaunchTemplate", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableFastSnapshotRestoresInput(v *EnableFastSnapshotRestoresInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableFastSnapshotRestoresInput"} - if v.AvailabilityZones == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZones")) - } - if v.SourceSnapshotIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceSnapshotIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableImageBlockPublicAccessInput(v *EnableImageBlockPublicAccessInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableImageBlockPublicAccessInput"} - if len(v.ImageBlockPublicAccessState) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ImageBlockPublicAccessState")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableImageDeprecationInput(v *EnableImageDeprecationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableImageDeprecationInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if v.DeprecateAt == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeprecateAt")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableImageDeregistrationProtectionInput(v *EnableImageDeregistrationProtectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableImageDeregistrationProtectionInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableImageInput(v *EnableImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableImageInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableIpamOrganizationAdminAccountInput(v *EnableIpamOrganizationAdminAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableIpamOrganizationAdminAccountInput"} - if v.DelegatedAdminAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DelegatedAdminAccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableRouteServerPropagationInput(v *EnableRouteServerPropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableRouteServerPropagationInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableSnapshotBlockPublicAccessInput(v *EnableSnapshotBlockPublicAccessInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableSnapshotBlockPublicAccessInput"} - if len(v.State) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("State")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableTransitGatewayRouteTablePropagationInput(v *EnableTransitGatewayRouteTablePropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableTransitGatewayRouteTablePropagationInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableVgwRoutePropagationInput(v *EnableVgwRoutePropagationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableVgwRoutePropagationInput"} - if v.GatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GatewayId")) - } - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableVolumeIOInput(v *EnableVolumeIOInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableVolumeIOInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableVpcClassicLinkInput(v *EnableVpcClassicLinkInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableVpcClassicLinkInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpExportClientVpnClientCertificateRevocationListInput(v *ExportClientVpnClientCertificateRevocationListInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportClientVpnClientCertificateRevocationListInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpExportClientVpnClientConfigurationInput(v *ExportClientVpnClientConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportClientVpnClientConfigurationInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpExportImageInput(v *ExportImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportImageInput"} - if len(v.DiskImageFormat) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("DiskImageFormat")) - } - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if v.S3ExportLocation == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3ExportLocation")) - } else if v.S3ExportLocation != nil { - if err := validateExportTaskS3LocationRequest(v.S3ExportLocation); err != nil { - invalidParams.AddNested("S3ExportLocation", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpExportTransitGatewayRoutesInput(v *ExportTransitGatewayRoutesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportTransitGatewayRoutesInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.S3Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpExportVerifiedAccessInstanceClientConfigurationInput(v *ExportVerifiedAccessInstanceClientConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ExportVerifiedAccessInstanceClientConfigurationInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetActiveVpnTunnelStatusInput(v *GetActiveVpnTunnelStatusInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetActiveVpnTunnelStatusInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnTunnelOutsideIpAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetAssociatedEnclaveCertificateIamRolesInput(v *GetAssociatedEnclaveCertificateIamRolesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetAssociatedEnclaveCertificateIamRolesInput"} - if v.CertificateArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CertificateArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetAssociatedIpv6PoolCidrsInput(v *GetAssociatedIpv6PoolCidrsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetAssociatedIpv6PoolCidrsInput"} - if v.PoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCapacityReservationUsageInput(v *GetCapacityReservationUsageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCapacityReservationUsageInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCoipPoolUsageInput(v *GetCoipPoolUsageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCoipPoolUsageInput"} - if v.PoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetConsoleOutputInput(v *GetConsoleOutputInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetConsoleOutputInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetConsoleScreenshotInput(v *GetConsoleScreenshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetConsoleScreenshotInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDeclarativePoliciesReportSummaryInput(v *GetDeclarativePoliciesReportSummaryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDeclarativePoliciesReportSummaryInput"} - if v.ReportId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReportId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDefaultCreditSpecificationInput(v *GetDefaultCreditSpecificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDefaultCreditSpecificationInput"} - if len(v.InstanceFamily) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InstanceFamily")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetFlowLogsIntegrationTemplateInput(v *GetFlowLogsIntegrationTemplateInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetFlowLogsIntegrationTemplateInput"} - if v.FlowLogId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FlowLogId")) - } - if v.ConfigDeliveryS3DestinationArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConfigDeliveryS3DestinationArn")) - } - if v.IntegrateServices == nil { - invalidParams.Add(smithy.NewErrParamRequired("IntegrateServices")) - } else if v.IntegrateServices != nil { - if err := validateIntegrateServices(v.IntegrateServices); err != nil { - invalidParams.AddNested("IntegrateServices", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetGroupsForCapacityReservationInput(v *GetGroupsForCapacityReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetGroupsForCapacityReservationInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetHostReservationPurchasePreviewInput(v *GetHostReservationPurchasePreviewInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetHostReservationPurchasePreviewInput"} - if v.HostIdSet == nil { - invalidParams.Add(smithy.NewErrParamRequired("HostIdSet")) - } - if v.OfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OfferingId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetInstanceTpmEkPubInput(v *GetInstanceTpmEkPubInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetInstanceTpmEkPubInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.KeyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("KeyType")) - } - if len(v.KeyFormat) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("KeyFormat")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetInstanceTypesFromInstanceRequirementsInput(v *GetInstanceTypesFromInstanceRequirementsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetInstanceTypesFromInstanceRequirementsInput"} - if v.ArchitectureTypes == nil { - invalidParams.Add(smithy.NewErrParamRequired("ArchitectureTypes")) - } - if v.VirtualizationTypes == nil { - invalidParams.Add(smithy.NewErrParamRequired("VirtualizationTypes")) - } - if v.InstanceRequirements == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceRequirements")) - } else if v.InstanceRequirements != nil { - if err := validateInstanceRequirementsRequest(v.InstanceRequirements); err != nil { - invalidParams.AddNested("InstanceRequirements", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetInstanceUefiDataInput(v *GetInstanceUefiDataInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetInstanceUefiDataInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamAddressHistoryInput(v *GetIpamAddressHistoryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamAddressHistoryInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.IpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamDiscoveredAccountsInput(v *GetIpamDiscoveredAccountsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamDiscoveredAccountsInput"} - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if v.DiscoveryRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("DiscoveryRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamDiscoveredPublicAddressesInput(v *GetIpamDiscoveredPublicAddressesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamDiscoveredPublicAddressesInput"} - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if v.AddressRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddressRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamDiscoveredResourceCidrsInput(v *GetIpamDiscoveredResourceCidrsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamDiscoveredResourceCidrsInput"} - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if v.ResourceRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceRegion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamPoolAllocationsInput(v *GetIpamPoolAllocationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamPoolAllocationsInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamPoolCidrsInput(v *GetIpamPoolCidrsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamPoolCidrsInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetIpamResourceCidrsInput(v *GetIpamResourceCidrsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetIpamResourceCidrsInput"} - if v.IpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetLaunchTemplateDataInput(v *GetLaunchTemplateDataInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetLaunchTemplateDataInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetManagedPrefixListAssociationsInput(v *GetManagedPrefixListAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetManagedPrefixListAssociationsInput"} - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetManagedPrefixListEntriesInput(v *GetManagedPrefixListEntriesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetManagedPrefixListEntriesInput"} - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetNetworkInsightsAccessScopeAnalysisFindingsInput(v *GetNetworkInsightsAccessScopeAnalysisFindingsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetNetworkInsightsAccessScopeAnalysisFindingsInput"} - if v.NetworkInsightsAccessScopeAnalysisId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAccessScopeAnalysisId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetNetworkInsightsAccessScopeContentInput(v *GetNetworkInsightsAccessScopeContentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetNetworkInsightsAccessScopeContentInput"} - if v.NetworkInsightsAccessScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAccessScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetPasswordDataInput(v *GetPasswordDataInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetPasswordDataInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetReservedInstancesExchangeQuoteInput(v *GetReservedInstancesExchangeQuoteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetReservedInstancesExchangeQuoteInput"} - if v.ReservedInstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstanceIds")) - } - if v.TargetConfigurations != nil { - if err := validateTargetConfigurationRequestSet(v.TargetConfigurations); err != nil { - invalidParams.AddNested("TargetConfigurations", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetRouteServerAssociationsInput(v *GetRouteServerAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetRouteServerAssociationsInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetRouteServerPropagationsInput(v *GetRouteServerPropagationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetRouteServerPropagationsInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetRouteServerRoutingDatabaseInput(v *GetRouteServerRoutingDatabaseInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetRouteServerRoutingDatabaseInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSecurityGroupsForVpcInput(v *GetSecurityGroupsForVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSecurityGroupsForVpcInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSpotPlacementScoresInput(v *GetSpotPlacementScoresInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSpotPlacementScoresInput"} - if v.TargetCapacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetCapacity")) - } - if v.InstanceRequirementsWithMetadata != nil { - if err := validateInstanceRequirementsWithMetadataRequest(v.InstanceRequirementsWithMetadata); err != nil { - invalidParams.AddNested("InstanceRequirementsWithMetadata", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSubnetCidrReservationsInput(v *GetSubnetCidrReservationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSubnetCidrReservationsInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayAttachmentPropagationsInput(v *GetTransitGatewayAttachmentPropagationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayAttachmentPropagationsInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayMulticastDomainAssociationsInput(v *GetTransitGatewayMulticastDomainAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayMulticastDomainAssociationsInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayPolicyTableAssociationsInput(v *GetTransitGatewayPolicyTableAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayPolicyTableAssociationsInput"} - if v.TransitGatewayPolicyTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayPolicyTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayPolicyTableEntriesInput(v *GetTransitGatewayPolicyTableEntriesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayPolicyTableEntriesInput"} - if v.TransitGatewayPolicyTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayPolicyTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayPrefixListReferencesInput(v *GetTransitGatewayPrefixListReferencesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayPrefixListReferencesInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayRouteTableAssociationsInput(v *GetTransitGatewayRouteTableAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayRouteTableAssociationsInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTransitGatewayRouteTablePropagationsInput(v *GetTransitGatewayRouteTablePropagationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTransitGatewayRouteTablePropagationsInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetVerifiedAccessEndpointPolicyInput(v *GetVerifiedAccessEndpointPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetVerifiedAccessEndpointPolicyInput"} - if v.VerifiedAccessEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetVerifiedAccessEndpointTargetsInput(v *GetVerifiedAccessEndpointTargetsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetVerifiedAccessEndpointTargetsInput"} - if v.VerifiedAccessEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetVerifiedAccessGroupPolicyInput(v *GetVerifiedAccessGroupPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetVerifiedAccessGroupPolicyInput"} - if v.VerifiedAccessGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetVpnConnectionDeviceSampleConfigurationInput(v *GetVpnConnectionDeviceSampleConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetVpnConnectionDeviceSampleConfigurationInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnConnectionDeviceTypeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionDeviceTypeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetVpnTunnelReplacementStatusInput(v *GetVpnTunnelReplacementStatusInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetVpnTunnelReplacementStatusInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnTunnelOutsideIpAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpImportClientVpnClientCertificateRevocationListInput(v *ImportClientVpnClientCertificateRevocationListInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ImportClientVpnClientCertificateRevocationListInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.CertificateRevocationList == nil { - invalidParams.Add(smithy.NewErrParamRequired("CertificateRevocationList")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpImportInstanceInput(v *ImportInstanceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ImportInstanceInput"} - if v.DiskImages != nil { - if err := validateDiskImageList(v.DiskImages); err != nil { - invalidParams.AddNested("DiskImages", err.(smithy.InvalidParamsError)) - } - } - if len(v.Platform) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Platform")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpImportKeyPairInput(v *ImportKeyPairInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ImportKeyPairInput"} - if v.KeyName == nil { - invalidParams.Add(smithy.NewErrParamRequired("KeyName")) - } - if v.PublicKeyMaterial == nil { - invalidParams.Add(smithy.NewErrParamRequired("PublicKeyMaterial")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpImportVolumeInput(v *ImportVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ImportVolumeInput"} - if v.AvailabilityZone == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone")) - } - if v.Image == nil { - invalidParams.Add(smithy.NewErrParamRequired("Image")) - } else if v.Image != nil { - if err := validateDiskImageDetail(v.Image); err != nil { - invalidParams.AddNested("Image", err.(smithy.InvalidParamsError)) - } - } - if v.Volume == nil { - invalidParams.Add(smithy.NewErrParamRequired("Volume")) - } else if v.Volume != nil { - if err := validateVolumeDetail(v.Volume); err != nil { - invalidParams.AddNested("Volume", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpLockSnapshotInput(v *LockSnapshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "LockSnapshotInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if len(v.LockMode) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("LockMode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyAddressAttributeInput(v *ModifyAddressAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyAddressAttributeInput"} - if v.AllocationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AllocationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyAvailabilityZoneGroupInput(v *ModifyAvailabilityZoneGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyAvailabilityZoneGroupInput"} - if v.GroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupName")) - } - if len(v.OptInStatus) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("OptInStatus")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyCapacityReservationFleetInput(v *ModifyCapacityReservationFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyCapacityReservationFleetInput"} - if v.CapacityReservationFleetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationFleetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyCapacityReservationInput(v *ModifyCapacityReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyCapacityReservationInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyClientVpnEndpointInput(v *ModifyClientVpnEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyClientVpnEndpointInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyDefaultCreditSpecificationInput(v *ModifyDefaultCreditSpecificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyDefaultCreditSpecificationInput"} - if len(v.InstanceFamily) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InstanceFamily")) - } - if v.CpuCredits == nil { - invalidParams.Add(smithy.NewErrParamRequired("CpuCredits")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyEbsDefaultKmsKeyIdInput(v *ModifyEbsDefaultKmsKeyIdInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyEbsDefaultKmsKeyIdInput"} - if v.KmsKeyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyFleetInput(v *ModifyFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyFleetInput"} - if v.LaunchTemplateConfigs != nil { - if err := validateFleetLaunchTemplateConfigListRequest(v.LaunchTemplateConfigs); err != nil { - invalidParams.AddNested("LaunchTemplateConfigs", err.(smithy.InvalidParamsError)) - } - } - if v.FleetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FleetId")) - } - if v.TargetCapacitySpecification != nil { - if err := validateTargetCapacitySpecificationRequest(v.TargetCapacitySpecification); err != nil { - invalidParams.AddNested("TargetCapacitySpecification", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyFpgaImageAttributeInput(v *ModifyFpgaImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyFpgaImageAttributeInput"} - if v.FpgaImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FpgaImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyHostsInput(v *ModifyHostsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyHostsInput"} - if v.HostIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("HostIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIdentityIdFormatInput(v *ModifyIdentityIdFormatInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIdentityIdFormatInput"} - if v.Resource == nil { - invalidParams.Add(smithy.NewErrParamRequired("Resource")) - } - if v.UseLongIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("UseLongIds")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIdFormatInput(v *ModifyIdFormatInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIdFormatInput"} - if v.Resource == nil { - invalidParams.Add(smithy.NewErrParamRequired("Resource")) - } - if v.UseLongIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("UseLongIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyImageAttributeInput(v *ModifyImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyImageAttributeInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceAttributeInput(v *ModifyInstanceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceAttributeInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceCapacityReservationAttributesInput(v *ModifyInstanceCapacityReservationAttributesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceCapacityReservationAttributesInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.CapacityReservationSpecification == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationSpecification")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceCpuOptionsInput(v *ModifyInstanceCpuOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceCpuOptionsInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.CoreCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("CoreCount")) - } - if v.ThreadsPerCore == nil { - invalidParams.Add(smithy.NewErrParamRequired("ThreadsPerCore")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceCreditSpecificationInput(v *ModifyInstanceCreditSpecificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceCreditSpecificationInput"} - if v.InstanceCreditSpecifications == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCreditSpecifications")) - } else if v.InstanceCreditSpecifications != nil { - if err := validateInstanceCreditSpecificationListRequest(v.InstanceCreditSpecifications); err != nil { - invalidParams.AddNested("InstanceCreditSpecifications", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceEventStartTimeInput(v *ModifyInstanceEventStartTimeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceEventStartTimeInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if v.InstanceEventId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceEventId")) - } - if v.NotBefore == nil { - invalidParams.Add(smithy.NewErrParamRequired("NotBefore")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceEventWindowInput(v *ModifyInstanceEventWindowInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceEventWindowInput"} - if v.InstanceEventWindowId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceEventWindowId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceMaintenanceOptionsInput(v *ModifyInstanceMaintenanceOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceMaintenanceOptionsInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceMetadataOptionsInput(v *ModifyInstanceMetadataOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceMetadataOptionsInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstanceNetworkPerformanceOptionsInput(v *ModifyInstanceNetworkPerformanceOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceNetworkPerformanceOptionsInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.BandwidthWeighting) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("BandwidthWeighting")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyInstancePlacementInput(v *ModifyInstancePlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyInstancePlacementInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIpamInput(v *ModifyIpamInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIpamInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIpamPoolInput(v *ModifyIpamPoolInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIpamPoolInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIpamResourceCidrInput(v *ModifyIpamResourceCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIpamResourceCidrInput"} - if v.ResourceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) - } - if v.ResourceCidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceCidr")) - } - if v.ResourceRegion == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceRegion")) - } - if v.CurrentIpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CurrentIpamScopeId")) - } - if v.Monitored == nil { - invalidParams.Add(smithy.NewErrParamRequired("Monitored")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIpamResourceDiscoveryInput(v *ModifyIpamResourceDiscoveryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIpamResourceDiscoveryInput"} - if v.IpamResourceDiscoveryId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyIpamScopeInput(v *ModifyIpamScopeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyIpamScopeInput"} - if v.IpamScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamScopeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyLocalGatewayRouteInput(v *ModifyLocalGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyLocalGatewayRouteInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyManagedPrefixListInput(v *ModifyManagedPrefixListInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyManagedPrefixListInput"} - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if v.AddEntries != nil { - if err := validateAddPrefixListEntries(v.AddEntries); err != nil { - invalidParams.AddNested("AddEntries", err.(smithy.InvalidParamsError)) - } - } - if v.RemoveEntries != nil { - if err := validateRemovePrefixListEntries(v.RemoveEntries); err != nil { - invalidParams.AddNested("RemoveEntries", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyNetworkInterfaceAttributeInput(v *ModifyNetworkInterfaceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyNetworkInterfaceAttributeInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyPrivateDnsNameOptionsInput(v *ModifyPrivateDnsNameOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyPrivateDnsNameOptionsInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyPublicIpDnsNameOptionsInput(v *ModifyPublicIpDnsNameOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyPublicIpDnsNameOptionsInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if len(v.HostnameType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("HostnameType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyReservedInstancesInput(v *ModifyReservedInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyReservedInstancesInput"} - if v.ReservedInstancesIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstancesIds")) - } - if v.TargetConfigurations == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetConfigurations")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyRouteServerInput(v *ModifyRouteServerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyRouteServerInput"} - if v.RouteServerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteServerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifySecurityGroupRulesInput(v *ModifySecurityGroupRulesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifySecurityGroupRulesInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if v.SecurityGroupRules == nil { - invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupRules")) - } else if v.SecurityGroupRules != nil { - if err := validateSecurityGroupRuleUpdateList(v.SecurityGroupRules); err != nil { - invalidParams.AddNested("SecurityGroupRules", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifySnapshotAttributeInput(v *ModifySnapshotAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifySnapshotAttributeInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifySnapshotTierInput(v *ModifySnapshotTierInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifySnapshotTierInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifySpotFleetRequestInput(v *ModifySpotFleetRequestInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifySpotFleetRequestInput"} - if v.SpotFleetRequestId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotFleetRequestId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifySubnetAttributeInput(v *ModifySubnetAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifySubnetAttributeInput"} - if v.SubnetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTrafficMirrorFilterNetworkServicesInput(v *ModifyTrafficMirrorFilterNetworkServicesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTrafficMirrorFilterNetworkServicesInput"} - if v.TrafficMirrorFilterId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTrafficMirrorFilterRuleInput(v *ModifyTrafficMirrorFilterRuleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTrafficMirrorFilterRuleInput"} - if v.TrafficMirrorFilterRuleId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorFilterRuleId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTrafficMirrorSessionInput(v *ModifyTrafficMirrorSessionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTrafficMirrorSessionInput"} - if v.TrafficMirrorSessionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficMirrorSessionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTransitGatewayInput(v *ModifyTransitGatewayInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTransitGatewayInput"} - if v.TransitGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTransitGatewayPrefixListReferenceInput(v *ModifyTransitGatewayPrefixListReferenceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTransitGatewayPrefixListReferenceInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyTransitGatewayVpcAttachmentInput(v *ModifyTransitGatewayVpcAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyTransitGatewayVpcAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessEndpointInput(v *ModifyVerifiedAccessEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessEndpointInput"} - if v.VerifiedAccessEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessEndpointPolicyInput(v *ModifyVerifiedAccessEndpointPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessEndpointPolicyInput"} - if v.VerifiedAccessEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessGroupInput(v *ModifyVerifiedAccessGroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessGroupInput"} - if v.VerifiedAccessGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessGroupPolicyInput(v *ModifyVerifiedAccessGroupPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessGroupPolicyInput"} - if v.VerifiedAccessGroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessGroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessInstanceInput(v *ModifyVerifiedAccessInstanceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessInstanceInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessInstanceLoggingConfigurationInput(v *ModifyVerifiedAccessInstanceLoggingConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessInstanceLoggingConfigurationInput"} - if v.VerifiedAccessInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessInstanceId")) - } - if v.AccessLogs == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessLogs")) - } else if v.AccessLogs != nil { - if err := validateVerifiedAccessLogOptions(v.AccessLogs); err != nil { - invalidParams.AddNested("AccessLogs", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVerifiedAccessTrustProviderInput(v *ModifyVerifiedAccessTrustProviderInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVerifiedAccessTrustProviderInput"} - if v.VerifiedAccessTrustProviderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VerifiedAccessTrustProviderId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVolumeAttributeInput(v *ModifyVolumeAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVolumeAttributeInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVolumeInput(v *ModifyVolumeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVolumeInput"} - if v.VolumeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcAttributeInput(v *ModifyVpcAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcAttributeInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcBlockPublicAccessExclusionInput(v *ModifyVpcBlockPublicAccessExclusionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcBlockPublicAccessExclusionInput"} - if v.ExclusionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ExclusionId")) - } - if len(v.InternetGatewayExclusionMode) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayExclusionMode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcBlockPublicAccessOptionsInput(v *ModifyVpcBlockPublicAccessOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcBlockPublicAccessOptionsInput"} - if len(v.InternetGatewayBlockMode) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InternetGatewayBlockMode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcEndpointConnectionNotificationInput(v *ModifyVpcEndpointConnectionNotificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcEndpointConnectionNotificationInput"} - if v.ConnectionNotificationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectionNotificationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcEndpointInput(v *ModifyVpcEndpointInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcEndpointInput"} - if v.VpcEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcEndpointServiceConfigurationInput(v *ModifyVpcEndpointServiceConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcEndpointServiceConfigurationInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcEndpointServicePayerResponsibilityInput(v *ModifyVpcEndpointServicePayerResponsibilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcEndpointServicePayerResponsibilityInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if len(v.PayerResponsibility) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PayerResponsibility")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcEndpointServicePermissionsInput(v *ModifyVpcEndpointServicePermissionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcEndpointServicePermissionsInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcPeeringConnectionOptionsInput(v *ModifyVpcPeeringConnectionOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcPeeringConnectionOptionsInput"} - if v.VpcPeeringConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcPeeringConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpcTenancyInput(v *ModifyVpcTenancyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpcTenancyInput"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) - } - if len(v.InstanceTenancy) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InstanceTenancy")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpnConnectionInput(v *ModifyVpnConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpnConnectionInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpnConnectionOptionsInput(v *ModifyVpnConnectionOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpnConnectionOptionsInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpnTunnelCertificateInput(v *ModifyVpnTunnelCertificateInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpnTunnelCertificateInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnTunnelOutsideIpAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpModifyVpnTunnelOptionsInput(v *ModifyVpnTunnelOptionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ModifyVpnTunnelOptionsInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnTunnelOutsideIpAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) - } - if v.TunnelOptions == nil { - invalidParams.Add(smithy.NewErrParamRequired("TunnelOptions")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpMonitorInstancesInput(v *MonitorInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MonitorInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpMoveAddressToVpcInput(v *MoveAddressToVpcInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MoveAddressToVpcInput"} - if v.PublicIp == nil { - invalidParams.Add(smithy.NewErrParamRequired("PublicIp")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpMoveByoipCidrToIpamInput(v *MoveByoipCidrToIpamInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MoveByoipCidrToIpamInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if v.IpamPoolOwner == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolOwner")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpMoveCapacityReservationInstancesInput(v *MoveCapacityReservationInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MoveCapacityReservationInstancesInput"} - if v.SourceCapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceCapacityReservationId")) - } - if v.DestinationCapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCapacityReservationId")) - } - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpProvisionByoipCidrInput(v *ProvisionByoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProvisionByoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.CidrAuthorizationContext != nil { - if err := validateCidrAuthorizationContext(v.CidrAuthorizationContext); err != nil { - invalidParams.AddNested("CidrAuthorizationContext", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpProvisionIpamByoasnInput(v *ProvisionIpamByoasnInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProvisionIpamByoasnInput"} - if v.IpamId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamId")) - } - if v.Asn == nil { - invalidParams.Add(smithy.NewErrParamRequired("Asn")) - } - if v.AsnAuthorizationContext == nil { - invalidParams.Add(smithy.NewErrParamRequired("AsnAuthorizationContext")) - } else if v.AsnAuthorizationContext != nil { - if err := validateAsnAuthorizationContext(v.AsnAuthorizationContext); err != nil { - invalidParams.AddNested("AsnAuthorizationContext", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpProvisionIpamPoolCidrInput(v *ProvisionIpamPoolCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProvisionIpamPoolCidrInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpProvisionPublicIpv4PoolCidrInput(v *ProvisionPublicIpv4PoolCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProvisionPublicIpv4PoolCidrInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if v.PoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PoolId")) - } - if v.NetmaskLength == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetmaskLength")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPurchaseCapacityBlockExtensionInput(v *PurchaseCapacityBlockExtensionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseCapacityBlockExtensionInput"} - if v.CapacityBlockExtensionOfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityBlockExtensionOfferingId")) - } - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPurchaseCapacityBlockInput(v *PurchaseCapacityBlockInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseCapacityBlockInput"} - if v.CapacityBlockOfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityBlockOfferingId")) - } - if len(v.InstancePlatform) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("InstancePlatform")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPurchaseHostReservationInput(v *PurchaseHostReservationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseHostReservationInput"} - if v.HostIdSet == nil { - invalidParams.Add(smithy.NewErrParamRequired("HostIdSet")) - } - if v.OfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OfferingId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPurchaseReservedInstancesOfferingInput(v *PurchaseReservedInstancesOfferingInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseReservedInstancesOfferingInput"} - if v.InstanceCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceCount")) - } - if v.ReservedInstancesOfferingId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReservedInstancesOfferingId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPurchaseScheduledInstancesInput(v *PurchaseScheduledInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PurchaseScheduledInstancesInput"} - if v.PurchaseRequests == nil { - invalidParams.Add(smithy.NewErrParamRequired("PurchaseRequests")) - } else if v.PurchaseRequests != nil { - if err := validatePurchaseRequestSet(v.PurchaseRequests); err != nil { - invalidParams.AddNested("PurchaseRequests", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRebootInstancesInput(v *RebootInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RebootInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterImageInput(v *RegisterImageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterImageInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterInstanceEventNotificationAttributesInput(v *RegisterInstanceEventNotificationAttributesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterInstanceEventNotificationAttributesInput"} - if v.InstanceTagAttribute == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceTagAttribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterTransitGatewayMulticastGroupMembersInput(v *RegisterTransitGatewayMulticastGroupMembersInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterTransitGatewayMulticastGroupMembersInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if v.NetworkInterfaceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterTransitGatewayMulticastGroupSourcesInput(v *RegisterTransitGatewayMulticastGroupSourcesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterTransitGatewayMulticastGroupSourcesInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if v.NetworkInterfaceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRejectCapacityReservationBillingOwnershipInput(v *RejectCapacityReservationBillingOwnershipInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RejectCapacityReservationBillingOwnershipInput"} - if v.CapacityReservationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRejectTransitGatewayPeeringAttachmentInput(v *RejectTransitGatewayPeeringAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RejectTransitGatewayPeeringAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRejectTransitGatewayVpcAttachmentInput(v *RejectTransitGatewayVpcAttachmentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RejectTransitGatewayVpcAttachmentInput"} - if v.TransitGatewayAttachmentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRejectVpcEndpointConnectionsInput(v *RejectVpcEndpointConnectionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RejectVpcEndpointConnectionsInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if v.VpcEndpointIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRejectVpcPeeringConnectionInput(v *RejectVpcPeeringConnectionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RejectVpcPeeringConnectionInput"} - if v.VpcPeeringConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcPeeringConnectionId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReleaseHostsInput(v *ReleaseHostsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReleaseHostsInput"} - if v.HostIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("HostIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReleaseIpamPoolAllocationInput(v *ReleaseIpamPoolAllocationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReleaseIpamPoolAllocationInput"} - if v.IpamPoolId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolId")) - } - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if v.IpamPoolAllocationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("IpamPoolAllocationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceIamInstanceProfileAssociationInput(v *ReplaceIamInstanceProfileAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceIamInstanceProfileAssociationInput"} - if v.IamInstanceProfile == nil { - invalidParams.Add(smithy.NewErrParamRequired("IamInstanceProfile")) - } - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceNetworkAclAssociationInput(v *ReplaceNetworkAclAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceNetworkAclAssociationInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if v.NetworkAclId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkAclId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceNetworkAclEntryInput(v *ReplaceNetworkAclEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceNetworkAclEntryInput"} - if v.NetworkAclId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkAclId")) - } - if v.RuleNumber == nil { - invalidParams.Add(smithy.NewErrParamRequired("RuleNumber")) - } - if v.Protocol == nil { - invalidParams.Add(smithy.NewErrParamRequired("Protocol")) - } - if len(v.RuleAction) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RuleAction")) - } - if v.Egress == nil { - invalidParams.Add(smithy.NewErrParamRequired("Egress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceRouteInput(v *ReplaceRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceRouteInput"} - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceRouteTableAssociationInput(v *ReplaceRouteTableAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceRouteTableAssociationInput"} - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if v.RouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceTransitGatewayRouteInput(v *ReplaceTransitGatewayRouteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceTransitGatewayRouteInput"} - if v.DestinationCidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationCidrBlock")) - } - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReplaceVpnTunnelInput(v *ReplaceVpnTunnelInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReplaceVpnTunnelInput"} - if v.VpnConnectionId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) - } - if v.VpnTunnelOutsideIpAddress == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpReportInstanceStatusInput(v *ReportInstanceStatusInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ReportInstanceStatusInput"} - if v.Instances == nil { - invalidParams.Add(smithy.NewErrParamRequired("Instances")) - } - if len(v.Status) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Status")) - } - if v.ReasonCodes == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReasonCodes")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRequestSpotFleetInput(v *RequestSpotFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RequestSpotFleetInput"} - if v.SpotFleetRequestConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("SpotFleetRequestConfig")) - } else if v.SpotFleetRequestConfig != nil { - if err := validateSpotFleetRequestConfigData(v.SpotFleetRequestConfig); err != nil { - invalidParams.AddNested("SpotFleetRequestConfig", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRequestSpotInstancesInput(v *RequestSpotInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RequestSpotInstancesInput"} - if v.LaunchSpecification != nil { - if err := validateRequestSpotLaunchSpecification(v.LaunchSpecification); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetAddressAttributeInput(v *ResetAddressAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetAddressAttributeInput"} - if v.AllocationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AllocationId")) - } - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetFpgaImageAttributeInput(v *ResetFpgaImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetFpgaImageAttributeInput"} - if v.FpgaImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FpgaImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetImageAttributeInput(v *ResetImageAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetImageAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetInstanceAttributeInput(v *ResetInstanceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetInstanceAttributeInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetNetworkInterfaceAttributeInput(v *ResetNetworkInterfaceAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetNetworkInterfaceAttributeInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpResetSnapshotAttributeInput(v *ResetSnapshotAttributeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResetSnapshotAttributeInput"} - if len(v.Attribute) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Attribute")) - } - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRestoreAddressToClassicInput(v *RestoreAddressToClassicInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RestoreAddressToClassicInput"} - if v.PublicIp == nil { - invalidParams.Add(smithy.NewErrParamRequired("PublicIp")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRestoreImageFromRecycleBinInput(v *RestoreImageFromRecycleBinInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RestoreImageFromRecycleBinInput"} - if v.ImageId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRestoreManagedPrefixListVersionInput(v *RestoreManagedPrefixListVersionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RestoreManagedPrefixListVersionInput"} - if v.PrefixListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrefixListId")) - } - if v.PreviousVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("PreviousVersion")) - } - if v.CurrentVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRestoreSnapshotFromRecycleBinInput(v *RestoreSnapshotFromRecycleBinInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RestoreSnapshotFromRecycleBinInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRestoreSnapshotTierInput(v *RestoreSnapshotTierInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RestoreSnapshotTierInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRevokeClientVpnIngressInput(v *RevokeClientVpnIngressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RevokeClientVpnIngressInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if v.TargetNetworkCidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetNetworkCidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRevokeSecurityGroupEgressInput(v *RevokeSecurityGroupEgressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RevokeSecurityGroupEgressInput"} - if v.GroupId == nil { - invalidParams.Add(smithy.NewErrParamRequired("GroupId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRunInstancesInput(v *RunInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RunInstancesInput"} - if v.MaxCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxCount")) - } - if v.MinCount == nil { - invalidParams.Add(smithy.NewErrParamRequired("MinCount")) - } - if v.Monitoring != nil { - if err := validateRunInstancesMonitoringEnabled(v.Monitoring); err != nil { - invalidParams.AddNested("Monitoring", err.(smithy.InvalidParamsError)) - } - } - if v.ElasticGpuSpecification != nil { - if err := validateElasticGpuSpecifications(v.ElasticGpuSpecification); err != nil { - invalidParams.AddNested("ElasticGpuSpecification", err.(smithy.InvalidParamsError)) - } - } - if v.ElasticInferenceAccelerators != nil { - if err := validateElasticInferenceAccelerators(v.ElasticInferenceAccelerators); err != nil { - invalidParams.AddNested("ElasticInferenceAccelerators", err.(smithy.InvalidParamsError)) - } - } - if v.CreditSpecification != nil { - if err := validateCreditSpecificationRequest(v.CreditSpecification); err != nil { - invalidParams.AddNested("CreditSpecification", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRunScheduledInstancesInput(v *RunScheduledInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RunScheduledInstancesInput"} - if v.LaunchSpecification == nil { - invalidParams.Add(smithy.NewErrParamRequired("LaunchSpecification")) - } else if v.LaunchSpecification != nil { - if err := validateScheduledInstancesLaunchSpecification(v.LaunchSpecification); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(smithy.InvalidParamsError)) - } - } - if v.ScheduledInstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ScheduledInstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpSearchLocalGatewayRoutesInput(v *SearchLocalGatewayRoutesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SearchLocalGatewayRoutesInput"} - if v.LocalGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("LocalGatewayRouteTableId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpSearchTransitGatewayMulticastGroupsInput(v *SearchTransitGatewayMulticastGroupsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SearchTransitGatewayMulticastGroupsInput"} - if v.TransitGatewayMulticastDomainId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayMulticastDomainId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpSearchTransitGatewayRoutesInput(v *SearchTransitGatewayRoutesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SearchTransitGatewayRoutesInput"} - if v.TransitGatewayRouteTableId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TransitGatewayRouteTableId")) - } - if v.Filters == nil { - invalidParams.Add(smithy.NewErrParamRequired("Filters")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpSendDiagnosticInterruptInput(v *SendDiagnosticInterruptInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SendDiagnosticInterruptInput"} - if v.InstanceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartDeclarativePoliciesReportInput(v *StartDeclarativePoliciesReportInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartDeclarativePoliciesReportInput"} - if v.S3Bucket == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) - } - if v.TargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartInstancesInput(v *StartInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartNetworkInsightsAccessScopeAnalysisInput(v *StartNetworkInsightsAccessScopeAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartNetworkInsightsAccessScopeAnalysisInput"} - if v.NetworkInsightsAccessScopeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsAccessScopeId")) - } - if v.ClientToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartNetworkInsightsAnalysisInput(v *StartNetworkInsightsAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartNetworkInsightsAnalysisInput"} - if v.NetworkInsightsPathId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInsightsPathId")) - } - if v.ClientToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartVpcEndpointServicePrivateDnsVerificationInput(v *StartVpcEndpointServicePrivateDnsVerificationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartVpcEndpointServicePrivateDnsVerificationInput"} - if v.ServiceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStopInstancesInput(v *StopInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StopInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTerminateClientVpnConnectionsInput(v *TerminateClientVpnConnectionsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TerminateClientVpnConnectionsInput"} - if v.ClientVpnEndpointId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientVpnEndpointId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTerminateInstancesInput(v *TerminateInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TerminateInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnassignIpv6AddressesInput(v *UnassignIpv6AddressesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnassignIpv6AddressesInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnassignPrivateIpAddressesInput(v *UnassignPrivateIpAddressesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnassignPrivateIpAddressesInput"} - if v.NetworkInterfaceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnassignPrivateNatGatewayAddressInput(v *UnassignPrivateNatGatewayAddressInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnassignPrivateNatGatewayAddressInput"} - if v.NatGatewayId == nil { - invalidParams.Add(smithy.NewErrParamRequired("NatGatewayId")) - } - if v.PrivateIpAddresses == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrivateIpAddresses")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnlockSnapshotInput(v *UnlockSnapshotInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnlockSnapshotInput"} - if v.SnapshotId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnmonitorInstancesInput(v *UnmonitorInstancesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnmonitorInstancesInput"} - if v.InstanceIds == nil { - invalidParams.Add(smithy.NewErrParamRequired("InstanceIds")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpWithdrawByoipCidrInput(v *WithdrawByoipCidrInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "WithdrawByoipCidrInput"} - if v.Cidr == nil { - invalidParams.Add(smithy.NewErrParamRequired("Cidr")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} 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 deleted file mode 100644 index 607fc0922..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ /dev/null @@ -1,176 +0,0 @@ -# v1.13.1 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. - -# v1.13.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. - -# v1.12.4 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. - -# v1.12.3 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 - -# v1.12.2 (2025-01-24) - -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.12.1 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. - -# v1.12.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. - -# v1.11.5 (2024-09-20) - -* No change notes available for this release. - -# v1.11.4 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. - -# v1.11.3 (2024-06-28) - -* No change notes available for this release. - -# v1.11.2 (2024-03-29) - -* No change notes available for this release. - -# v1.11.1 (2024-02-21) - -* No change notes available for this release. - -# v1.11.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. - -# v1.10.4 (2023-12-07) - -* No change notes available for this release. - -# v1.10.3 (2023-11-30) - -* No change notes available for this release. - -# v1.10.2 (2023-11-29) - -* No change notes available for this release. - -# v1.10.1 (2023-11-15) - -* No change notes available for this release. - -# v1.10.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). - -# v1.9.15 (2023-10-06) - -* No change notes available for this release. - -# v1.9.14 (2023-08-18) - -* No change notes available for this release. - -# v1.9.13 (2023-08-07) - -* No change notes available for this release. - -# v1.9.12 (2023-07-31) - -* No change notes available for this release. - -# v1.9.11 (2022-12-02) - -* No change notes available for this release. - -# v1.9.10 (2022-10-24) - -* No change notes available for this release. - -# v1.9.9 (2022-09-14) - -* No change notes available for this release. - -# v1.9.8 (2022-09-02) - -* No change notes available for this release. - -# v1.9.7 (2022-08-31) - -* No change notes available for this release. - -# v1.9.6 (2022-08-29) - -* No change notes available for this release. - -# v1.9.5 (2022-08-11) - -* No change notes available for this release. - -# v1.9.4 (2022-08-09) - -* No change notes available for this release. - -# v1.9.3 (2022-06-29) - -* No change notes available for this release. - -# v1.9.2 (2022-06-07) - -* No change notes available for this release. - -# v1.9.1 (2022-03-24) - -* No change notes available for this release. - -# v1.9.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.8.0 (2022-02-24) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.7.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.6.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.5.0 (2021-11-06) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.4.0 (2021-10-21) - -* **Feature**: Updated to latest version - -# v1.3.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.2.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. - -# v1.2.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version - -# v1.2.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version - -# v1.1.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go deleted file mode 100644 index 3f451fc9b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go +++ /dev/null @@ -1,176 +0,0 @@ -package acceptencoding - -import ( - "compress/gzip" - "context" - "fmt" - "io" - - "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -const acceptEncodingHeaderKey = "Accept-Encoding" -const contentEncodingHeaderKey = "Content-Encoding" - -// AddAcceptEncodingGzipOptions provides the options for the -// AddAcceptEncodingGzip middleware setup. -type AddAcceptEncodingGzipOptions struct { - Enable bool -} - -// AddAcceptEncodingGzip explicitly adds handling for accept-encoding GZIP -// middleware to the operation stack. This allows checksums to be correctly -// computed without disabling GZIP support. -func AddAcceptEncodingGzip(stack *middleware.Stack, options AddAcceptEncodingGzipOptions) error { - if options.Enable { - if err := stack.Finalize.Add(&EnableGzip{}, middleware.Before); err != nil { - return err - } - if err := stack.Deserialize.Insert(&DecompressGzip{}, "OperationDeserializer", middleware.After); err != nil { - return err - } - return nil - } - - return stack.Finalize.Add(&DisableGzip{}, middleware.Before) -} - -// DisableGzip provides the middleware that will -// disable the underlying http client automatically enabling for gzip -// decompress content-encoding support. -type DisableGzip struct{} - -// ID returns the id for the middleware. -func (*DisableGzip) ID() string { - return "DisableAcceptEncodingGzip" -} - -// HandleFinalize implements the FinalizeMiddleware interface. -func (*DisableGzip) HandleFinalize( - ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - output middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := input.Request.(*smithyhttp.Request) - if !ok { - return output, metadata, &smithy.SerializationError{ - Err: fmt.Errorf("unknown request type %T", input.Request), - } - } - - // Explicitly enable gzip support, this will prevent the http client from - // auto extracting the zipped content. - req.Header.Set(acceptEncodingHeaderKey, "identity") - - return next.HandleFinalize(ctx, input) -} - -// EnableGzip provides a middleware to enable support for -// gzip responses, with manual decompression. This prevents the underlying HTTP -// client from performing the gzip decompression automatically. -type EnableGzip struct{} - -// ID returns the id for the middleware. -func (*EnableGzip) ID() string { - return "AcceptEncodingGzip" -} - -// HandleFinalize implements the FinalizeMiddleware interface. -func (*EnableGzip) HandleFinalize( - ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - output middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := input.Request.(*smithyhttp.Request) - if !ok { - return output, metadata, &smithy.SerializationError{ - Err: fmt.Errorf("unknown request type %T", input.Request), - } - } - - // Explicitly enable gzip support, this will prevent the http client from - // auto extracting the zipped content. - req.Header.Set(acceptEncodingHeaderKey, "gzip") - - return next.HandleFinalize(ctx, input) -} - -// DecompressGzip provides the middleware for decompressing a gzip -// response from the service. -type DecompressGzip struct{} - -// ID returns the id for the middleware. -func (*DecompressGzip) ID() string { - return "DecompressGzip" -} - -// HandleDeserialize implements the DeserializeMiddlware interface. -func (*DecompressGzip) HandleDeserialize( - ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - output middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - output, metadata, err = next.HandleDeserialize(ctx, input) - if err != nil { - return output, metadata, err - } - - resp, ok := output.RawResponse.(*smithyhttp.Response) - if !ok { - return output, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("unknown response type %T", output.RawResponse), - } - } - if v := resp.Header.Get(contentEncodingHeaderKey); v != "gzip" { - return output, metadata, err - } - - // Clear content length since it will no longer be valid once the response - // body is decompressed. - resp.Header.Del("Content-Length") - resp.ContentLength = -1 - - resp.Body = wrapGzipReader(resp.Body) - - return output, metadata, err -} - -type gzipReader struct { - reader io.ReadCloser - gzip *gzip.Reader -} - -func wrapGzipReader(reader io.ReadCloser) *gzipReader { - return &gzipReader{ - reader: reader, - } -} - -// Read wraps the gzip reader around the underlying io.Reader to extract the -// response bytes on the fly. -func (g *gzipReader) Read(b []byte) (n int, err error) { - if g.gzip == nil { - g.gzip, err = gzip.NewReader(g.reader) - if err != nil { - g.gzip = nil // ensure uninitialized gzip value isn't used in close. - return 0, fmt.Errorf("failed to decompress gzip response, %w", err) - } - } - - return g.gzip.Read(b) -} - -func (g *gzipReader) Close() error { - if g.gzip == nil { - return nil - } - - if err := g.gzip.Close(); err != nil { - g.reader.Close() - return fmt.Errorf("failed to decompress gzip response, %w", err) - } - - return g.reader.Close() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go deleted file mode 100644 index 7056d9bf6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Package acceptencoding provides customizations associated with Accept Encoding Header. - -# Accept encoding gzip - -The Go HTTP client automatically supports accept-encoding and content-encoding -gzip by default. This default behavior is not desired by the SDK, and prevents -validating the response body's checksum. To prevent this the SDK must manually -control usage of content-encoding gzip. - -To control content-encoding, the SDK must always set the `Accept-Encoding` -header to a value. This prevents the HTTP client from using gzip automatically. -When gzip is enabled on the API client, the SDK's customization will control -decompressing the gzip data in order to not break the checksum validation. When -gzip is disabled, the API client will disable gzip, preventing the HTTP -client's default behavior. - -An `EnableAcceptEncodingGzip` option may or may not be present depending on the client using -the below middleware. The option if present can be used to enable auto decompressing -gzip by the SDK. -*/ -package acceptencoding 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 deleted file mode 100644 index 7a0b6aae2..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package acceptencoding - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.1" 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 deleted file mode 100644 index 6f143784e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ /dev/null @@ -1,482 +0,0 @@ -# v1.13.9 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.8 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.7 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.6 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.5 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2025-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2025-08-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.18 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.17 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.16 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.15 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.14 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.11 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.12.9 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.7 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.5 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.20 (2024-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.19 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.18 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.17 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.16 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.15 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.14 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.13 (2024-06-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.12 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.11 (2024-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.10 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.9 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.8 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.7 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.6 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.5 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.4 (2024-03-05) - -* **Bug Fix**: Restore typo'd API `AddAsIsInternalPresigingMiddleware` as an alias for backwards compatibility. - -# v1.11.3 (2024-03-04) - -* **Bug Fix**: Correct a typo in internal AddAsIsPresigningMiddleware API. - -# v1.11.2 (2024-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.1 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.10 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.9 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.8 (2023-12-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.7 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.6 (2023-11-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.4 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.3 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.2 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.1 (2023-11-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.37 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.36 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.35 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.34 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.33 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.32 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.31 (2023-07-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.30 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.29 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.28 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.27 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.26 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.25 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.24 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.23 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.22 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.19 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2022-02-24) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.2 (2021-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-11-06) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go deleted file mode 100644 index 5d5286f92..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go +++ /dev/null @@ -1,56 +0,0 @@ -package presignedurl - -import ( - "context" - - "github.com/aws/smithy-go/middleware" -) - -// WithIsPresigning adds the isPresigning sentinel value to a context to signal -// that the middleware stack is using the presign flow. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func WithIsPresigning(ctx context.Context) context.Context { - return middleware.WithStackValue(ctx, isPresigningKey{}, true) -} - -// GetIsPresigning returns if the context contains the isPresigning sentinel -// value for presigning flows. -// -// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues -// to clear all stack values. -func GetIsPresigning(ctx context.Context) bool { - v, _ := middleware.GetStackValue(ctx, isPresigningKey{}).(bool) - return v -} - -type isPresigningKey struct{} - -// AddAsIsPresigningMiddleware adds a middleware to the head of the stack that -// will update the stack's context to be flagged as being invoked for the -// purpose of presigning. -func AddAsIsPresigningMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(asIsPresigningMiddleware{}, middleware.Before) -} - -// AddAsIsPresigingMiddleware is an alias for backwards compatibility. -// -// Deprecated: This API was released with a typo. Use -// [AddAsIsPresigningMiddleware] instead. -func AddAsIsPresigingMiddleware(stack *middleware.Stack) error { - return AddAsIsPresigningMiddleware(stack) -} - -type asIsPresigningMiddleware struct{} - -func (asIsPresigningMiddleware) ID() string { return "AsIsPresigningMiddleware" } - -func (asIsPresigningMiddleware) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - ctx = WithIsPresigning(ctx) - return next.HandleInitialize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.go deleted file mode 100644 index 1b85375cf..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package presignedurl provides the customizations for API clients to fill in -// presigned URLs into input parameters. -package presignedurl 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 deleted file mode 100644 index bc347369d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package presignedurl - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.go deleted file mode 100644 index 1e2f5c812..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.go +++ /dev/null @@ -1,110 +0,0 @@ -package presignedurl - -import ( - "context" - "fmt" - - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - - "github.com/aws/smithy-go/middleware" -) - -// URLPresigner provides the interface to presign the input parameters in to a -// presigned URL. -type URLPresigner interface { - // PresignURL presigns a URL. - PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) -} - -// ParameterAccessor provides an collection of accessor to for retrieving and -// setting the values needed to PresignedURL generation -type ParameterAccessor struct { - // GetPresignedURL accessor points to a function that retrieves a presigned url if present - GetPresignedURL func(interface{}) (string, bool, error) - - // GetSourceRegion accessor points to a function that retrieves source region for presigned url - GetSourceRegion func(interface{}) (string, bool, error) - - // CopyInput accessor points to a function that takes in an input, and returns a copy. - CopyInput func(interface{}) (interface{}, error) - - // SetDestinationRegion accessor points to a function that sets destination region on api input struct - SetDestinationRegion func(interface{}, string) error - - // SetPresignedURL accessor points to a function that sets presigned url on api input struct - SetPresignedURL func(interface{}, string) error -} - -// Options provides the set of options needed by the presigned URL middleware. -type Options struct { - // Accessor are the parameter accessors used by this middleware - Accessor ParameterAccessor - - // Presigner is the URLPresigner used by the middleware - Presigner URLPresigner -} - -// AddMiddleware adds the Presign URL middleware to the middleware stack. -func AddMiddleware(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&presign{options: opts}, middleware.Before) -} - -// RemoveMiddleware removes the Presign URL middleware from the stack. -func RemoveMiddleware(stack *middleware.Stack) error { - _, err := stack.Initialize.Remove((*presign)(nil).ID()) - return err -} - -type presign struct { - options Options -} - -func (m *presign) ID() string { return "Presign" } - -func (m *presign) HandleInitialize( - ctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler, -) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - // If PresignedURL is already set ignore middleware. - if _, ok, err := m.options.Accessor.GetPresignedURL(input.Parameters); err != nil { - return out, metadata, fmt.Errorf("presign middleware failed, %w", err) - } else if ok { - return next.HandleInitialize(ctx, input) - } - - // If have source region is not set ignore middleware. - srcRegion, ok, err := m.options.Accessor.GetSourceRegion(input.Parameters) - if err != nil { - return out, metadata, fmt.Errorf("presign middleware failed, %w", err) - } else if !ok || len(srcRegion) == 0 { - return next.HandleInitialize(ctx, input) - } - - // Create a copy of the original input so the destination region value can - // be added. This ensures that value does not leak into the original - // request parameters. - paramCpy, err := m.options.Accessor.CopyInput(input.Parameters) - if err != nil { - return out, metadata, fmt.Errorf("unable to create presigned URL, %w", err) - } - - // Destination region is the API client's configured region. - dstRegion := awsmiddleware.GetRegion(ctx) - if err = m.options.Accessor.SetDestinationRegion(paramCpy, dstRegion); err != nil { - return out, metadata, fmt.Errorf("presign middleware failed, %w", err) - } - - presignedReq, err := m.options.Presigner.PresignURL(ctx, srcRegion, paramCpy) - if err != nil { - return out, metadata, fmt.Errorf("unable to create presigned URL, %w", err) - } - - // Update the original input with the presigned URL value. - if err = m.options.Accessor.SetPresignedURL(input.Parameters, presignedReq.URL); err != nil { - return out, metadata, fmt.Errorf("presign middleware failed, %w", err) - } - - return next.HandleInitialize(ctx, input) -} 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 deleted file mode 100644 index 4c5e39d87..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ /dev/null @@ -1,675 +0,0 @@ -# v1.29.6 (2025-09-29) - -* No change notes available for this release. - -# v1.29.5 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.4 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.3 (2025-09-10) - -* No change notes available for this release. - -# v1.29.2 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.1 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2025-08-28) - -* **Feature**: Remove incorrect endpoint tests - -# v1.28.3 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.2 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2025-08-20) - -* **Bug Fix**: Remove unused deserialization code. - -# v1.28.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.6 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.5 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.4 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.3 (2025-04-03) - -* No change notes available for this release. - -# v1.25.2 (2025-03-25) - -* No change notes available for this release. - -# v1.25.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.25.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.16 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.15 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.14 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.13 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.12 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.24.11 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.24.10 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.9 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.8 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.7 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.6 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.5 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.24.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.4 (2024-10-03) - -* No change notes available for this release. - -# v1.23.3 (2024-09-27) - -* No change notes available for this release. - -# v1.23.2 (2024-09-25) - -* No change notes available for this release. - -# v1.23.1 (2024-09-23) - -* No change notes available for this release. - -# v1.23.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.8 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.22.7 (2024-09-04) - -* No change notes available for this release. - -# v1.22.6 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.5 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.4 (2024-07-18) - -* No change notes available for this release. - -# v1.22.3 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.2 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.21.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.12 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.11 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.10 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.9 (2024-05-23) - -* No change notes available for this release. - -# v1.20.8 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.7 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.6 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.20.5 (2024-04-05) - -* No change notes available for this release. - -# v1.20.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.19.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.19.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.7 (2024-01-18) - -* No change notes available for this release. - -# v1.18.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.18.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.18.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.17.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2023-10-02) - -* **Feature**: Fix FIPS Endpoints in aws-us-gov. - -# v1.14.1 (2023-09-22) - -* No change notes available for this release. - -# v1.14.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.13.6 (2023-08-31) - -* No change notes available for this release. - -# v1.13.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2023-08-01) - -* No change notes available for this release. - -# v1.13.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2023-06-15) - -* No change notes available for this release. - -# v1.12.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2023-05-04) - -* No change notes available for this release. - -# v1.12.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2023-04-10) - -* No change notes available for this release. - -# v1.12.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.12.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.12.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.11.28 (2022-12-20) - -* No change notes available for this release. - -# v1.11.27 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.26 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.25 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.24 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.23 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.22 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.21 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.20 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.19 (2022-08-30) - -* **Documentation**: Documentation updates for the AWS IAM Identity Center Portal CLI Reference. - -# v1.11.18 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.17 (2022-08-15) - -* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) - -# v1.11.16 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.15 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.14 (2022-08-08) - -* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.13 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.12 (2022-07-11) - -* No change notes available for this release. - -# v1.11.11 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.10 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.9 (2022-06-16) - -* No change notes available for this release. - -# v1.11.8 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.7 (2022-05-26) - -* No change notes available for this release. - -# v1.11.6 (2022-05-25) - -* No change notes available for this release. - -# v1.11.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Documentation**: Updated API models -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.6.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Feature**: Updated service to latest API model. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/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 deleted file mode 100644 index 2c498e468..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ /dev/null @@ -1,1019 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "SSO" -const ServiceAPIVersion = "2019-06-10" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sso") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/sso") -} - -// Client provides the API client to make operations call for AWS Single Sign-On. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sso") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sso", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sso") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} 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 deleted file mode 100644 index df5dc1674..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sso/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the STS short-term credentials for a given role name that is assigned -// to the user. -func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredentialsInput, optFns ...func(*Options)) (*GetRoleCredentialsOutput, error) { - if params == nil { - params = &GetRoleCredentialsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRoleCredentials", params, optFns, c.addOperationGetRoleCredentialsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetRoleCredentialsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetRoleCredentialsInput struct { - - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html - // - // This member is required. - AccessToken *string - - // The identifier for the AWS account that is assigned to the user. - // - // This member is required. - AccountId *string - - // The friendly name of the role that is assigned to the user. - // - // This member is required. - RoleName *string - - noSmithyDocumentSerde -} - -type GetRoleCredentialsOutput struct { - - // The credentials for the role that is assigned to the user. - RoleCredentials *types.RoleCredentials - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRoleCredentials{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRoleCredentials"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoleCredentials(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetRoleCredentials(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetRoleCredentials", - } -} 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 deleted file mode 100644 index 2a3b2ad90..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sso/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all roles that are assigned to the user for a given AWS account. -func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesInput, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { - if params == nil { - params = &ListAccountRolesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccountRoles", params, optFns, c.addOperationListAccountRolesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccountRolesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccountRolesInput struct { - - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html - // - // This member is required. - AccessToken *string - - // The identifier for the AWS account that is assigned to the user. - // - // This member is required. - AccountId *string - - // The number of items that clients can request per page. - MaxResults *int32 - - // The page token from the previous response output when you request subsequent - // pages. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccountRolesOutput struct { - - // The page token client that is used to retrieve the list of accounts. - NextToken *string - - // A paginated response with the list of roles and the next token if more results - // are available. - RoleList []types.RoleInfo - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccountRoles{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountRoles"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAccountRolesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountRoles(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListAccountRolesPaginatorOptions is the paginator options for ListAccountRoles -type ListAccountRolesPaginatorOptions struct { - // The number of items that clients can request per page. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccountRolesPaginator is a paginator for ListAccountRoles -type ListAccountRolesPaginator struct { - options ListAccountRolesPaginatorOptions - client ListAccountRolesAPIClient - params *ListAccountRolesInput - nextToken *string - firstPage bool -} - -// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator -func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { - if params == nil { - params = &ListAccountRolesInput{} - } - - options := ListAccountRolesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccountRolesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccountRolesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccountRoles page. -func (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccountRoles(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccountRolesAPIClient is a client that implements the ListAccountRoles -// operation. -type ListAccountRolesAPIClient interface { - ListAccountRoles(context.Context, *ListAccountRolesInput, ...func(*Options)) (*ListAccountRolesOutput, error) -} - -var _ ListAccountRolesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccountRoles(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccountRoles", - } -} 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 deleted file mode 100644 index f6114a7c1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sso/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all AWS accounts assigned to the user. These AWS accounts are assigned by -// the administrator of the account. For more information, see [Assign User Access]in the IAM Identity -// Center User Guide. This operation returns a paginated response. -// -// [Assign User Access]: https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers -func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { - if params == nil { - params = &ListAccountsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, c.addOperationListAccountsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccountsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccountsInput struct { - - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html - // - // This member is required. - AccessToken *string - - // This is the number of items clients can request per page. - MaxResults *int32 - - // (Optional) When requesting subsequent pages, this is the page token from the - // previous response output. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccountsOutput struct { - - // A paginated response with the list of account information and the next token if - // more results are available. - AccountList []types.AccountInfo - - // The page token client that is used to retrieve the list of accounts. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccounts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccounts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAccountsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListAccountsPaginatorOptions is the paginator options for ListAccounts -type ListAccountsPaginatorOptions struct { - // This is the number of items clients can request per page. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccountsPaginator is a paginator for ListAccounts -type ListAccountsPaginator struct { - options ListAccountsPaginatorOptions - client ListAccountsAPIClient - params *ListAccountsInput - nextToken *string - firstPage bool -} - -// NewListAccountsPaginator returns a new ListAccountsPaginator -func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { - if params == nil { - params = &ListAccountsInput{} - } - - options := ListAccountsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccountsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccountsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccounts page. -func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccountsAPIClient is a client that implements the ListAccounts operation. -type ListAccountsAPIClient interface { - ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) -} - -var _ ListAccountsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccounts", - } -} 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 deleted file mode 100644 index 2c7f181c3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the locally stored SSO tokens from the client-side cache and sends an -// API call to the IAM Identity Center service to invalidate the corresponding -// server-side IAM Identity Center sign in session. -// -// If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM -// Identity Center sign in session is used to obtain an IAM session, as specified -// in the corresponding IAM Identity Center permission set. More specifically, IAM -// Identity Center assumes an IAM role in the target account on behalf of the user, -// and the corresponding temporary AWS credentials are returned to the client. -// -// After user logout, any existing IAM role sessions that were created by using -// IAM Identity Center permission sets continue based on the duration configured in -// the permission set. For more information, see [User authentications]in the IAM Identity Center User -// Guide. -// -// [User authentications]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html -func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) { - if params == nil { - params = &LogoutInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "Logout", params, optFns, c.addOperationLogoutMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*LogoutOutput) - out.ResultMetadata = metadata - return out, nil -} - -type LogoutInput struct { - - // The token issued by the CreateToken API call. For more information, see [CreateToken] in the - // IAM Identity Center OIDC API Reference Guide. - // - // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html - // - // This member is required. - AccessToken *string - - noSmithyDocumentSerde -} - -type LogoutOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpLogout{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "Logout"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpLogoutValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLogout(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opLogout(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "Logout", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go deleted file mode 100644 index 708e53c5a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ - "GetRoleCredentials": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "ListAccountRoles": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "ListAccounts": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "Logout": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, -} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "awsssoportal") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} 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 a889f3c7a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go +++ /dev/null @@ -1,1172 +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" - "io/ioutil" - "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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorLogout(response, &metadata) - } - output := &LogoutOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - 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/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go deleted file mode 100644 index 7f6e429fd..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package sso provides the API client, operations, and parameter types for AWS -// Single Sign-On. -// -// AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web -// service that makes it easy for you to assign user access to IAM Identity Center -// resources such as the AWS access portal. Users can get AWS account applications -// and roles assigned to them and get federated into the application. -// -// Although AWS Single Sign-On was renamed, the sso and identitystore API -// namespaces will continue to retain their original name for backward -// compatibility purposes. For more information, see [IAM Identity Center rename]. -// -// This reference guide describes the IAM Identity Center Portal operations that -// you can call programatically and includes detailed information on data types and -// errors. -// -// AWS provides SDKs that consist of libraries and sample code for various -// programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android. -// The SDKs provide a convenient way to create programmatic access to IAM Identity -// Center and other AWS services. For more information about the AWS SDKs, -// including how to download and install them, see [Tools for Amazon Web Services]. -// -// [Tools for Amazon Web Services]: http://aws.amazon.com/tools/ -// [IAM Identity Center rename]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed -package sso diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go deleted file mode 100644 index 2b22ab779..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ /dev/null @@ -1,558 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "awsssoportal" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://portal.sso-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://portal.sso.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://portal.sso-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://portal.sso.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://portal.sso.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} 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 deleted file mode 100644 index 1a88fe4df..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_GetRoleCredentials.go", - "api_op_ListAccountRoles.go", - "api_op_ListAccounts.go", - "api_op_Logout.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.22", - "module": "github.com/aws/aws-sdk-go-v2/service/sso", - "unstable": false -} 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 deleted file mode 100644 index 3628768ce..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package sso - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.29.6" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go deleted file mode 100644 index 8bb8730be..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ /dev/null @@ -1,603 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver SSO endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "portal.sso.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "portal.sso-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "af-south-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.af-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "af-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-east-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-northeast-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-northeast-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-3", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-northeast-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-3", - }, - }, - endpoints.EndpointKey{ - Region: "ap-south-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-southeast-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-southeast-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-southeast-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-3", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-4", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-southeast-4.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-4", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-5", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ap-southeast-5.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-5", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-7", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-central-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ca-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.ca-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-central-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-central-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-central-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-north-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-north-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-north-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-south-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-3", - }: endpoints.Endpoint{ - Hostname: "portal.sso.eu-west-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-3", - }, - }, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.il-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "il-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "me-central-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.me-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "me-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "me-south-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.me-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "me-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "mx-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.sa-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "sa-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-east-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - }, - endpoints.EndpointKey{ - Region: "us-west-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "portal.sso.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "portal.sso-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "cn-north-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.cn-north-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-north-1", - }, - }, - endpoints.EndpointKey{ - Region: "cn-northwest-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.cn-northwest-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "portal.sso.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "portal.sso-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "portal.sso-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "portal.sso.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-gov-east-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - }: endpoints.Endpoint{ - Hostname: "portal.sso.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, -} 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 deleted file mode 100644 index 277550af4..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/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/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go deleted file mode 100644 index e97a126e8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// Indicates that a problem occurred with the input to the request. For example, a -// required parameter might be missing or out of range. -type InvalidRequestException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified resource doesn't exist. -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the request is being made too frequently and is more than what -// the server can handle. -type TooManyRequestsException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *TooManyRequestsException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *TooManyRequestsException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "TooManyRequestsException" - } - return *e.ErrorCodeOverride -} -func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -type UnauthorizedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnauthorizedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnauthorizedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnauthorizedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnauthorizedException" - } - return *e.ErrorCodeOverride -} -func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } 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 deleted file mode 100644 index 07ac468e3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" -) - -// Provides information about your AWS account. -type AccountInfo struct { - - // The identifier of the AWS account that is assigned to the user. - AccountId *string - - // The display name of the AWS account that is assigned to the user. - AccountName *string - - // The email address of the AWS account that is assigned to the user. - EmailAddress *string - - noSmithyDocumentSerde -} - -// Provides information about the role credentials that are assigned to the user. -type RoleCredentials struct { - - // The identifier used for the temporary security credentials. For more - // information, see [Using Temporary Security Credentials to Request Access to AWS Resources]in the AWS IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html - AccessKeyId *string - - // The date on which temporary security credentials expire. - Expiration int64 - - // The key that is used to sign the request. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS - // IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html - SecretAccessKey *string - - // The token used for temporary credentials. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS - // IAM User Guide. - // - // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html - SessionToken *string - - noSmithyDocumentSerde -} - -// Provides information about the role that is assigned to the user. -type RoleInfo struct { - - // The identifier of the AWS account assigned to the user. - AccountId *string - - // The friendly name of the role that is assigned to the user. - RoleName *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go deleted file mode 100644 index f6bf461f7..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go +++ /dev/null @@ -1,175 +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/middleware" -) - -type validateOpGetRoleCredentials struct { -} - -func (*validateOpGetRoleCredentials) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetRoleCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetRoleCredentialsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetRoleCredentialsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAccountRoles struct { -} - -func (*validateOpListAccountRoles) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAccountRoles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAccountRolesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAccountRolesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAccounts struct { -} - -func (*validateOpListAccounts) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAccounts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAccountsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAccountsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpLogout struct { -} - -func (*validateOpLogout) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpLogout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*LogoutInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpLogoutInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpGetRoleCredentialsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetRoleCredentials{}, middleware.After) -} - -func addOpListAccountRolesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAccountRoles{}, middleware.After) -} - -func addOpListAccountsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAccounts{}, middleware.After) -} - -func addOpLogoutValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpLogout{}, middleware.After) -} - -func validateOpGetRoleCredentialsInput(v *GetRoleCredentialsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetRoleCredentialsInput"} - if v.RoleName == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleName")) - } - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if v.AccessToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAccountRolesInput(v *ListAccountRolesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAccountRolesInput"} - if v.AccessToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) - } - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAccountsInput(v *ListAccountsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAccountsInput"} - if v.AccessToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpLogoutInput(v *LogoutInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "LogoutInput"} - if v.AccessToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} 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 deleted file mode 100644 index dc5e399a8..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ /dev/null @@ -1,671 +0,0 @@ -# v1.35.1 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.0 (2025-09-23) - -* **Feature**: This release includes exception definition and documentation updates. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.5 (2025-09-22) - -* No change notes available for this release. - -# v1.34.4 (2025-09-10) - -* No change notes available for this release. - -# v1.34.3 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.2 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.1 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.0 (2025-08-26) - -* **Feature**: Remove incorrect endpoint tests - -# v1.33.2 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.1 (2025-08-20) - -* **Bug Fix**: Remove unused deserialization code. - -# v1.33.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.4 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.3 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.2 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.1 (2025-04-03) - -* No change notes available for this release. - -# v1.30.0 (2025-03-27) - -* **Feature**: This release adds AwsAdditionalDetails in the CreateTokenWithIAM API response. - -# v1.29.2 (2025-03-24) - -* No change notes available for this release. - -# v1.29.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.29.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.15 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.14 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.13 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.12 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.11 (2025-01-24) - -* **Documentation**: Fixed typos in the descriptions. -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.28.10 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.28.9 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.8 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.7 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.6 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.5 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.4 (2024-10-03) - -* No change notes available for this release. - -# v1.27.3 (2024-09-27) - -* No change notes available for this release. - -# v1.27.2 (2024-09-25) - -* No change notes available for this release. - -# v1.27.1 (2024-09-23) - -* No change notes available for this release. - -# v1.27.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.8 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.26.7 (2024-09-04) - -* No change notes available for this release. - -# v1.26.6 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.5 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.4 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.3 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.2 (2024-07-03) - -* No change notes available for this release. - -# v1.26.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.25.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.6 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.5 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.4 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.3 (2024-05-23) - -* No change notes available for this release. - -# v1.24.2 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.1 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2024-05-10) - -* **Feature**: Updated request parameters for PKCE support. - -# v1.23.5 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.23.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.22.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.22.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.7 (2024-01-16) - -* No change notes available for this release. - -# v1.21.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.21.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.21.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.3 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.20.1 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2023-11-17) - -* **Feature**: Adding support for `sso-oauth:CreateTokenWithIAM`. - -# v1.19.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-09-22) - -* No change notes available for this release. - -# v1.17.0 (2023-09-20) - -* **Feature**: Update FIPS endpoints in aws-us-gov. - -# v1.16.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.15.6 (2023-09-05) - -* No change notes available for this release. - -# v1.15.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2023-08-01) - -* No change notes available for this release. - -# v1.15.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.12 (2023-06-15) - -* No change notes available for this release. - -# v1.14.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.10 (2023-05-04) - -* No change notes available for this release. - -# v1.14.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.8 (2023-04-10) - -* No change notes available for this release. - -# v1.14.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.14.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.14.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.13.11 (2022-12-19) - -* No change notes available for this release. - -# v1.13.10 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.9 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.8 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.7 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.6 (2022-09-30) - -* **Documentation**: Documentation updates for the IAM Identity Center OIDC CLI Reference. - -# v1.13.5 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-08-25) - -* **Feature**: Updated required request parameters on IAM Identity Center's OIDC CreateToken action. - -# v1.12.14 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2022-08-08) - -* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.11 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2022-07-11) - -* No change notes available for this release. - -# v1.12.9 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.7 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2022-05-27) - -* No change notes available for this release. - -# v1.12.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-01-07) - -* **Feature**: API client updated -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-10-11) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-09-17) - -* **Feature**: Updated API client and endpoints to latest revision. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-08-27) - -* **Feature**: Updated API model to latest revision. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/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 deleted file mode 100644 index 12ad2f5d9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ /dev/null @@ -1,1019 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "SSO OIDC" -const ServiceAPIVersion = "2019-06-10" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/ssooidc") -} - -// Client provides the API client to make operations call for AWS SSO OIDC. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} 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 deleted file mode 100644 index 681eb4087..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates and returns access and refresh tokens for clients that are -// authenticated using client secrets. The access token can be used to fetch -// short-lived credentials for the assigned AWS accounts or to access application -// APIs using bearer authentication. -func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) { - if params == nil { - params = &CreateTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateToken", params, optFns, c.addOperationCreateTokenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTokenInput struct { - - // The unique identifier string for the client or application. This value comes - // from the result of the RegisterClientAPI. - // - // This member is required. - ClientId *string - - // A secret string generated for the client. This value should come from the - // persisted result of the RegisterClientAPI. - // - // This member is required. - ClientSecret *string - - // Supports the following OAuth grant types: Authorization Code, Device Code, and - // Refresh Token. Specify one of the following values, depending on the grant type - // that you want: - // - // * Authorization Code - authorization_code - // - // * Device Code - urn:ietf:params:oauth:grant-type:device_code - // - // * Refresh Token - refresh_token - // - // This member is required. - GrantType *string - - // Used only when calling this API for the Authorization Code grant type. The - // short-lived code is used to identify this authorization request. - Code *string - - // Used only when calling this API for the Authorization Code grant type. This - // value is generated by the client and presented to validate the original code - // challenge value the client passed at authorization time. - CodeVerifier *string - - // Used only when calling this API for the Device Code grant type. This - // short-lived code is used to identify this authorization request. This comes from - // the result of the StartDeviceAuthorizationAPI. - DeviceCode *string - - // Used only when calling this API for the Authorization Code grant type. This - // value specifies the location of the client or application that has registered to - // receive the authorization code. - RedirectUri *string - - // Used only when calling this API for the Refresh Token grant type. This token is - // used to refresh short-lived tokens, such as the access token, that might expire. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html - RefreshToken *string - - // The list of scopes for which authorization is requested. This parameter has no - // effect; the access token will always include all scopes configured during client - // registration. - Scope []string - - noSmithyDocumentSerde -} - -type CreateTokenOutput struct { - - // A bearer token to access Amazon Web Services accounts and applications assigned - // to a user. - AccessToken *string - - // Indicates the time in seconds when an access token will expire. - ExpiresIn int32 - - // The idToken is not implemented or supported. For more information about the - // features and limitations of the current IAM Identity Center OIDC implementation, - // see Considerations for Using this Guide in the [IAM Identity Center OIDC API Reference]. - // - // A JSON Web Token (JWT) that identifies who is associated with the issued access - // token. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html - IdToken *string - - // A token that, if present, can be used to refresh a previously issued access - // token that might have expired. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html - RefreshToken *string - - // Used to notify the client that the returned token is an access token. The - // supported token type is Bearer . - TokenType *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTokenValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateToken", - } -} 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 deleted file mode 100644 index d7a27da59..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates and returns access and refresh tokens for authorized client -// applications that are authenticated using any IAM entity, such as a service role -// or user. These tokens might contain defined scopes that specify permissions such -// as read:profile or write:data . Through downscoping, you can use the scopes -// parameter to request tokens with reduced permissions compared to the original -// client application's permissions or, if applicable, the refresh token's scopes. -// The access token can be used to fetch short-lived credentials for the assigned -// Amazon Web Services accounts or to access application APIs using bearer -// authentication. -// -// This API is used with Signature Version 4. For more information, see [Amazon Web Services Signature Version 4 for API Requests]. -// -// [Amazon Web Services Signature Version 4 for API Requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html -func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) { - if params == nil { - params = &CreateTokenWithIAMInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateTokenWithIAM", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateTokenWithIAMOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateTokenWithIAMInput struct { - - // The unique identifier string for the client or application. This value is an - // application ARN that has OAuth grants configured. - // - // This member is required. - ClientId *string - - // Supports the following OAuth grant types: Authorization Code, Refresh Token, - // JWT Bearer, and Token Exchange. Specify one of the following values, depending - // on the grant type that you want: - // - // * Authorization Code - authorization_code - // - // * Refresh Token - refresh_token - // - // * JWT Bearer - urn:ietf:params:oauth:grant-type:jwt-bearer - // - // * Token Exchange - urn:ietf:params:oauth:grant-type:token-exchange - // - // This member is required. - GrantType *string - - // Used only when calling this API for the JWT Bearer grant type. This value - // specifies the JSON Web Token (JWT) issued by a trusted token issuer. To - // authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the - // application. - Assertion *string - - // Used only when calling this API for the Authorization Code grant type. This - // short-lived code is used to identify this authorization request. The code is - // obtained through a redirect from IAM Identity Center to a redirect URI persisted - // in the Authorization Code GrantOptions for the application. - Code *string - - // Used only when calling this API for the Authorization Code grant type. This - // value is generated by the client and presented to validate the original code - // challenge value the client passed at authorization time. - CodeVerifier *string - - // Used only when calling this API for the Authorization Code grant type. This - // value specifies the location of the client or application that has registered to - // receive the authorization code. - RedirectUri *string - - // Used only when calling this API for the Refresh Token grant type. This token is - // used to refresh short-lived tokens, such as the access token, that might expire. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html - RefreshToken *string - - // Used only when calling this API for the Token Exchange grant type. This value - // specifies the type of token that the requester can receive. The following values - // are supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token - // - // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token - RequestedTokenType *string - - // The list of scopes for which authorization is requested. The access token that - // is issued is limited to the scopes that are granted. If the value is not - // specified, IAM Identity Center authorizes all scopes configured for the - // application, including the following default scopes: openid , aws , - // sts:identity_context . - Scope []string - - // Used only when calling this API for the Token Exchange grant type. This value - // specifies the subject of the exchange. The value of the subject token must be an - // access token issued by IAM Identity Center to a different client or application. - // The access token must have authorized scopes that indicate the requested - // application as a target audience. - SubjectToken *string - - // Used only when calling this API for the Token Exchange grant type. This value - // specifies the type of token that is passed as the subject of the exchange. The - // following value is supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token - SubjectTokenType *string - - noSmithyDocumentSerde -} - -type CreateTokenWithIAMOutput struct { - - // A bearer token to access Amazon Web Services accounts and applications assigned - // to a user. - AccessToken *string - - // A structure containing information from IAM Identity Center managed user and - // group information. - AwsAdditionalDetails *types.AwsAdditionalDetails - - // Indicates the time in seconds when an access token will expire. - ExpiresIn int32 - - // A JSON Web Token (JWT) that identifies the user associated with the issued - // access token. - IdToken *string - - // Indicates the type of tokens that are issued by IAM Identity Center. The - // following values are supported: - // - // * Access Token - urn:ietf:params:oauth:token-type:access_token - // - // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token - IssuedTokenType *string - - // A token that, if present, can be used to refresh a previously issued access - // token that might have expired. - // - // For more information about the features and limitations of the current IAM - // Identity Center OIDC implementation, see Considerations for Using this Guide in - // the [IAM Identity Center OIDC API Reference]. - // - // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html - RefreshToken *string - - // The list of scopes for which authorization is granted. The access token that is - // issued is limited to the scopes that are granted. - Scope []string - - // Used to notify the requester that the returned token is an access token. The - // supported token type is Bearer . - TokenType *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTokenWithIAM"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateTokenWithIAM", - } -} 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 deleted file mode 100644 index 8d50092fb..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Registers a public client with IAM Identity Center. This allows clients to -// perform authorization using the authorization code grant with Proof Key for Code -// Exchange (PKCE) or the device code grant. -func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) { - if params == nil { - params = &RegisterClientInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterClientOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterClientInput struct { - - // The friendly name of the client. - // - // This member is required. - ClientName *string - - // The type of client. The service supports only public as a client type. Anything - // other than public will be rejected by the service. - // - // This member is required. - ClientType *string - - // This IAM Identity Center application ARN is used to define - // administrator-managed configuration for public client access to resources. At - // authorization, the scopes, grants, and redirect URI available to this client - // will be restricted by this application resource. - EntitledApplicationArn *string - - // The list of OAuth 2.0 grant types that are defined by the client. This list is - // used to restrict the token granting flows available to the client. Supports the - // following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh - // Token. - // - // * Authorization Code - authorization_code - // - // * Device Code - urn:ietf:params:oauth:grant-type:device_code - // - // * Refresh Token - refresh_token - GrantTypes []string - - // The IAM Identity Center Issuer URL associated with an instance of IAM Identity - // Center. This value is needed for user access to resources through the client. - IssuerUrl *string - - // The list of redirect URI that are defined by the client. At completion of - // authorization, this list is used to restrict what locations the user agent can - // be redirected back to. - RedirectUris []string - - // The list of scopes that are defined by the client. Upon authorization, this - // list is used to restrict permissions when granting an access token. - Scopes []string - - noSmithyDocumentSerde -} - -type RegisterClientOutput struct { - - // An endpoint that the client can use to request authorization. - AuthorizationEndpoint *string - - // The unique identifier string for each client. This client uses this identifier - // to get authenticated by the service in subsequent calls. - ClientId *string - - // Indicates the time at which the clientId and clientSecret were issued. - ClientIdIssuedAt int64 - - // A secret string generated for the client. The client will use this string to - // get authenticated by the service in subsequent calls. - ClientSecret *string - - // Indicates the time at which the clientId and clientSecret will become invalid. - ClientSecretExpiresAt int64 - - // An endpoint that the client can use to create tokens. - TokenEndpoint *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterClient"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterClientValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterClient", - } -} 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 deleted file mode 100644 index 7242ac82b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Initiates device authorization by requesting a pair of verification codes from -// the authorization service. -func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDeviceAuthorizationInput, optFns ...func(*Options)) (*StartDeviceAuthorizationOutput, error) { - if params == nil { - params = &StartDeviceAuthorizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartDeviceAuthorization", params, optFns, c.addOperationStartDeviceAuthorizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartDeviceAuthorizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartDeviceAuthorizationInput struct { - - // The unique identifier string for the client that is registered with IAM - // Identity Center. This value should come from the persisted result of the RegisterClientAPI - // operation. - // - // This member is required. - ClientId *string - - // A secret string that is generated for the client. This value should come from - // the persisted result of the RegisterClientAPI operation. - // - // This member is required. - ClientSecret *string - - // The URL for the Amazon Web Services access portal. For more information, see [Using the Amazon Web Services access portal] - // in the IAM Identity Center User Guide. - // - // [Using the Amazon Web Services access portal]: https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html - // - // This member is required. - StartUrl *string - - noSmithyDocumentSerde -} - -type StartDeviceAuthorizationOutput struct { - - // The short-lived code that is used by the device when polling for a session - // token. - DeviceCode *string - - // Indicates the number of seconds in which the verification code will become - // invalid. - ExpiresIn int32 - - // Indicates the number of seconds the client must wait between attempts when - // polling for a session. - Interval int32 - - // A one-time user verification code. This is needed to authorize an in-use device. - UserCode *string - - // The URI of the verification page that takes the userCode to authorize the - // device. - VerificationUri *string - - // An alternate URL that the client can use to automatically launch a browser. - // This process skips the manual step in which the user visits the verification - // page and enters their code. - VerificationUriComplete *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartDeviceAuthorization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeviceAuthorization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartDeviceAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartDeviceAuthorization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go deleted file mode 100644 index 89b01c629..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go +++ /dev/null @@ -1,357 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ - "CreateToken": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "RegisterClient": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "StartDeviceAuthorization": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, -} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "sso-oauth") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} 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 fb9a0df51..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go +++ /dev/null @@ -1,2244 +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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_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/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go deleted file mode 100644 index aa9cf731d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package ssooidc provides the API client, operations, and parameter types for -// AWS SSO OIDC. -// -// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a -// client (such as CLI or a native application) to register with IAM Identity -// Center. The service also enables the client to fetch the user’s access token -// upon successful authentication and authorization with IAM Identity Center. -// -// # API namespaces -// -// IAM Identity Center uses the sso and identitystore API namespaces. IAM Identity -// Center OpenID Connect uses the sso-oauth namespace. -// -// # Considerations for using this guide -// -// Before you begin using this guide, we recommend that you first review the -// following important information about how the IAM Identity Center OIDC service -// works. -// -// - The IAM Identity Center OIDC service currently implements only the portions -// of the OAuth 2.0 Device Authorization Grant standard ([https://tools.ietf.org/html/rfc8628] ) that are necessary to -// enable single sign-on authentication with the CLI. -// -// - With older versions of the CLI, the service only emits OIDC access tokens, -// so to obtain a new token, users must explicitly re-authenticate. To access the -// OIDC flow that supports token refresh and doesn’t require re-authentication, -// update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with -// support for OIDC token refresh and configurable IAM Identity Center session -// durations. For more information, see [Configure Amazon Web Services access portal session duration]. -// -// - The access tokens provided by this service grant access to all Amazon Web -// Services account entitlements assigned to an IAM Identity Center user, not just -// a particular application. -// -// - The documentation in this guide does not describe the mechanism to convert -// the access token into Amazon Web Services Auth (“sigv4”) credentials for use -// with IAM-protected Amazon Web Services service endpoints. For more information, -// see [GetRoleCredentials]in the IAM Identity Center Portal API Reference Guide. -// -// For general information about IAM Identity Center, see [What is IAM Identity Center?] in the IAM Identity -// Center User Guide. -// -// [Configure Amazon Web Services access portal session duration]: https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html -// [GetRoleCredentials]: https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html -// [https://tools.ietf.org/html/rfc8628]: https://tools.ietf.org/html/rfc8628 -// [What is IAM Identity Center?]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html -package ssooidc diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go deleted file mode 100644 index 1e001f7a9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go +++ /dev/null @@ -1,558 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "sso-oauth" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO_OIDC") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO OIDC", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://oidc-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://oidc.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://oidc-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://oidc.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://oidc.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} 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 deleted file mode 100644 index f3b0b242a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_CreateToken.go", - "api_op_CreateTokenWithIAM.go", - "api_op_RegisterClient.go", - "api_op_StartDeviceAuthorization.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/enums.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.22", - "module": "github.com/aws/aws-sdk-go-v2/service/ssooidc", - "unstable": false -} 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 deleted file mode 100644 index 765f6371d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package ssooidc - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.35.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go deleted file mode 100644 index f15c1a3ff..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go +++ /dev/null @@ -1,603 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver SSO OIDC endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "oidc.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "oidc-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "af-south-1", - }: endpoints.Endpoint{ - Hostname: "oidc.af-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "af-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-east-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-northeast-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-northeast-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-northeast-3", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-northeast-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-northeast-3", - }, - }, - endpoints.EndpointKey{ - Region: "ap-south-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-south-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-southeast-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-1", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-southeast-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-2", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-southeast-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-3", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-4", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-southeast-4.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-4", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-5", - }: endpoints.Endpoint{ - Hostname: "oidc.ap-southeast-5.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ap-southeast-5", - }, - }, - endpoints.EndpointKey{ - Region: "ap-southeast-7", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-central-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ca-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{ - Hostname: "oidc.ca-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "ca-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-central-2", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-central-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-central-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-north-1", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-north-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-north-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-south-1", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-south-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-south-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-1", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-2", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-2", - }, - }, - endpoints.EndpointKey{ - Region: "eu-west-3", - }: endpoints.Endpoint{ - Hostname: "oidc.eu-west-3.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-west-3", - }, - }, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{ - Hostname: "oidc.il-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "il-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "me-central-1", - }: endpoints.Endpoint{ - Hostname: "oidc.me-central-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "me-central-1", - }, - }, - endpoints.EndpointKey{ - Region: "me-south-1", - }: endpoints.Endpoint{ - Hostname: "oidc.me-south-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "me-south-1", - }, - }, - endpoints.EndpointKey{ - Region: "mx-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - }: endpoints.Endpoint{ - Hostname: "oidc.sa-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "sa-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{ - Hostname: "oidc.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-east-2", - }: endpoints.Endpoint{ - Hostname: "oidc.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - }, - endpoints.EndpointKey{ - Region: "us-west-1", - }: endpoints.Endpoint{ - Hostname: "oidc.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{ - Hostname: "oidc.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "oidc.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "oidc-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "cn-north-1", - }: endpoints.Endpoint{ - Hostname: "oidc.cn-north-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-north-1", - }, - }, - endpoints.EndpointKey{ - Region: "cn-northwest-1", - }: endpoints.Endpoint{ - Hostname: "oidc.cn-northwest-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "oidc.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "oidc-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "oidc-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "oidc.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-gov-east-1", - }: endpoints.Endpoint{ - Hostname: "oidc.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - }: endpoints.Endpoint{ - Hostname: "oidc.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, -} 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 deleted file mode 100644 index f35f3d5a3..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/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/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/enums.go deleted file mode 100644 index b14a3c058..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/enums.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type AccessDeniedExceptionReason string - -// Enum values for AccessDeniedExceptionReason -const ( - AccessDeniedExceptionReasonKmsAccessDenied AccessDeniedExceptionReason = "KMS_AccessDeniedException" -) - -// Values returns all known values for AccessDeniedExceptionReason. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccessDeniedExceptionReason) Values() []AccessDeniedExceptionReason { - return []AccessDeniedExceptionReason{ - "KMS_AccessDeniedException", - } -} - -type InvalidRequestExceptionReason string - -// Enum values for InvalidRequestExceptionReason -const ( - InvalidRequestExceptionReasonKmsKeyNotFound InvalidRequestExceptionReason = "KMS_NotFoundException" - InvalidRequestExceptionReasonKmsInvalidKeyUsage InvalidRequestExceptionReason = "KMS_InvalidKeyUsageException" - InvalidRequestExceptionReasonKmsInvalidState InvalidRequestExceptionReason = "KMS_InvalidStateException" - InvalidRequestExceptionReasonKmsDisabledKey InvalidRequestExceptionReason = "KMS_DisabledException" -) - -// Values returns all known values for InvalidRequestExceptionReason. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InvalidRequestExceptionReason) Values() []InvalidRequestExceptionReason { - return []InvalidRequestExceptionReason{ - "KMS_NotFoundException", - "KMS_InvalidKeyUsageException", - "KMS_InvalidStateException", - "KMS_DisabledException", - } -} 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 deleted file mode 100644 index a1a3c7ef0..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Reason AccessDeniedExceptionReason - Error_description *string - - noSmithyDocumentSerde -} - -func (e *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that a request to authorize a client with an access user session -// token is pending. -type AuthorizationPendingException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *AuthorizationPendingException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AuthorizationPendingException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AuthorizationPendingException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AuthorizationPendingException" - } - return *e.ErrorCodeOverride -} -func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the token issued by the service is expired and is no longer -// valid. -type ExpiredTokenException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *ExpiredTokenException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ExpiredTokenException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ExpiredTokenException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ExpiredTokenException" - } - return *e.ErrorCodeOverride -} -func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that an error from the service occurred while trying to process a -// request. -type InternalServerException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InternalServerException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InternalServerException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InternalServerException" - } - return *e.ErrorCodeOverride -} -func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// 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 -// clientSecret . -type InvalidClientException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InvalidClientException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidClientException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidClientException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidClientException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the client information sent in the request during registration -// is invalid. -type InvalidClientMetadataException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InvalidClientMetadataException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidClientMetadataException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidClientMetadataException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidClientMetadataException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that a request contains an invalid grant. This can occur if a client -// makes a CreateTokenrequest with an invalid grant type. -type InvalidGrantException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - 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 } - -// Indicates that one or more redirect URI in the request is not supported for -// this operation. -type InvalidRedirectUriException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InvalidRedirectUriException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRedirectUriException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRedirectUriException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRedirectUriException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRedirectUriException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that something is wrong with the input to the request. For example, a -// required parameter might be missing or out of range. -type InvalidRequestException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Reason InvalidRequestExceptionReason - Error_description *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// 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. -type InvalidRequestRegionException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - Endpoint *string - Region *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestRegionException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestRegionException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestRegionException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestRegionException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the scope provided in the request is invalid. -type InvalidScopeException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - 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 } - -// Indicates that the client is making the request too frequently and is more than -// the service can handle. -type SlowDownException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *SlowDownException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *SlowDownException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *SlowDownException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "SlowDownException" - } - return *e.ErrorCodeOverride -} -func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// 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. -type UnauthorizedClientException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *UnauthorizedClientException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnauthorizedClientException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnauthorizedClientException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnauthorizedClientException" - } - return *e.ErrorCodeOverride -} -func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Indicates that the grant type in the request is not supported by the service. -type UnsupportedGrantTypeException struct { - Message *string - - ErrorCodeOverride *string - - Error_ *string - Error_description *string - - noSmithyDocumentSerde -} - -func (e *UnsupportedGrantTypeException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnsupportedGrantTypeException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnsupportedGrantTypeException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnsupportedGrantTypeException" - } - return *e.ErrorCodeOverride -} -func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } 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 deleted file mode 100644 index de15e8f05..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" -) - -// This structure contains Amazon Web Services-specific parameter extensions and -// the [identity context]. -// -// [identity context]: https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html -type AwsAdditionalDetails struct { - - // The trusted context assertion is signed and encrypted by STS. It provides - // access to sts:identity_context claim in the idToken without JWT parsing - // - // Identity context comprises information that Amazon Web Services services use to - // make authorization decisions when they receive requests. - IdentityContext *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go deleted file mode 100644 index 9c17e4c8e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "context" - "fmt" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpCreateToken struct { -} - -func (*validateOpCreateToken) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTokenInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTokenInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateTokenWithIAM struct { -} - -func (*validateOpCreateTokenWithIAM) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateTokenWithIAMInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateTokenWithIAMInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterClient struct { -} - -func (*validateOpRegisterClient) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterClientInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterClientInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartDeviceAuthorization struct { -} - -func (*validateOpStartDeviceAuthorization) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartDeviceAuthorizationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartDeviceAuthorizationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After) -} - -func addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After) -} - -func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After) -} - -func addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After) -} - -func validateOpCreateTokenInput(v *CreateTokenInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"} - if v.ClientId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientId")) - } - if v.ClientSecret == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) - } - if v.GrantType == nil { - invalidParams.Add(smithy.NewErrParamRequired("GrantType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateTokenWithIAMInput"} - if v.ClientId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientId")) - } - if v.GrantType == nil { - invalidParams.Add(smithy.NewErrParamRequired("GrantType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterClientInput(v *RegisterClientInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterClientInput"} - if v.ClientName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientName")) - } - if v.ClientType == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartDeviceAuthorizationInput"} - if v.ClientId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientId")) - } - if v.ClientSecret == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) - } - if v.StartUrl == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartUrl")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} 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 deleted file mode 100644 index 77183922d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ /dev/null @@ -1,710 +0,0 @@ -# v1.38.6 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.5 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.4 (2025-09-10) - -* No change notes available for this release. - -# v1.38.3 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.2 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.1 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.0 (2025-08-21) - -* **Feature**: Remove incorrect endpoint tests -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.1 (2025-08-20) - -* **Bug Fix**: Remove unused deserialization code. - -# v1.37.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.36.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.1 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.0 (2025-06-17) - -* **Feature**: The AWS Security Token Service APIs AssumeRoleWithSAML and AssumeRoleWithWebIdentity can now be invoked without pre-configured AWS credentials in the SDK configuration. -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.21 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.20 (2025-06-06) - -* No change notes available for this release. - -# v1.33.19 (2025-04-10) - -* No change notes available for this release. - -# v1.33.18 (2025-04-03) - -* No change notes available for this release. - -# v1.33.17 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.33.16 (2025-02-27) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.15 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.14 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.13 (2025-02-04) - -* No change notes available for this release. - -# v1.33.12 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.11 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.10 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.33.9 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.33.8 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.7 (2025-01-14) - -* No change notes available for this release. - -# v1.33.6 (2025-01-10) - -* **Documentation**: Fixed typos in the descriptions. - -# v1.33.5 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.4 (2025-01-08) - -* No change notes available for this release. - -# v1.33.3 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.2 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.1 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.0 (2024-11-14) - -* **Feature**: This release introduces the new API 'AssumeRoot', which returns short-term credentials that you can use to perform privileged tasks. - -# v1.32.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.4 (2024-10-03) - -* No change notes available for this release. - -# v1.31.3 (2024-09-27) - -* No change notes available for this release. - -# v1.31.2 (2024-09-25) - -* No change notes available for this release. - -# v1.31.1 (2024-09-23) - -* No change notes available for this release. - -# v1.31.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.8 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.30.7 (2024-09-04) - -* No change notes available for this release. - -# v1.30.6 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.5 (2024-08-22) - -* No change notes available for this release. - -# v1.30.4 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.3 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.2 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.29.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.13 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.12 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.11 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.10 (2024-05-23) - -* No change notes available for this release. - -# v1.28.9 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.8 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.7 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.28.6 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.5 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.4 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.3 (2024-03-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.2 (2024-03-04) - -* **Bug Fix**: Update internal/presigned-url dependency for corrected API name. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.27.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.27.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.7 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.6 (2023-12-20) - -* No change notes available for this release. - -# v1.26.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.26.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. -* **Bug Fix**: STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication. - -# v1.26.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Documentation**: Documentation updates for AWS Security Token Service. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.6 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.5 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.25.4 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.3 (2023-11-17) - -* **Documentation**: API updates for the AWS Security Token Service - -# v1.25.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2023-10-02) - -* **Feature**: STS API updates for assumeRole - -# v1.22.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.21.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2023-08-01) - -* No change notes available for this release. - -# v1.21.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2023-07-25) - -* **Feature**: API updates for the AWS Security Token Service - -# v1.19.3 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2023-06-15) - -* No change notes available for this release. - -# v1.19.1 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2023-05-08) - -* **Feature**: Documentation updates for AWS Security Token Service. - -# v1.18.11 (2023-05-04) - -* No change notes available for this release. - -# v1.18.10 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.9 (2023-04-10) - -* No change notes available for this release. - -# v1.18.8 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.7 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.6 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.18.4 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. - -# v1.18.2 (2023-01-25) - -* **Documentation**: Doc only change to update wording in a key topic - -# v1.18.1 (2023-01-23) - -* No change notes available for this release. - -# v1.18.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.17.7 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.6 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2022-11-22) - -* No change notes available for this release. - -# v1.17.4 (2022-11-17) - -* **Documentation**: Documentation updates for AWS Security Token Service. - -# v1.17.3 (2022-11-16) - -* No change notes available for this release. - -# v1.17.2 (2022-11-10) - -* No change notes available for this release. - -# v1.17.1 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2022-10-21) - -* **Feature**: Add presign functionality for sts:AssumeRole operation -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.19 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.18 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.17 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.16 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.15 (2022-08-30) - -* No change notes available for this release. - -# v1.16.14 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.13 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.12 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.11 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.10 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.9 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.8 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.7 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.6 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2022-05-16) - -* **Documentation**: Documentation updates for AWS Security Token Service. - -# v1.16.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Documentation**: Updated service client model to latest release. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2021-12-21) - -* **Feature**: Updated to latest service endpoints - -# v1.11.1 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2021-11-30) - -* **Feature**: API client updated - -# v1.10.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-11-12) - -* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. - -# v1.9.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-10-21) - -* **Feature**: API client updated -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.2 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-07-15) - -* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. -* **Documentation**: Updated service model to latest revision. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-06-25) - -* **Feature**: API client updated -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go deleted file mode 100644 index 6658babc9..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ /dev/null @@ -1,1171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/protocol/query" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" - presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "STS" -const ServiceAPIVersion = "2011-06-15" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sts") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/sts") -} - -// Client provides the API client to make operations call for AWS Security Token -// Service. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -// HTTPPresignerV4 represents presigner interface used by presign url client -type HTTPPresignerV4 interface { - PresignHTTP( - ctx context.Context, credentials aws.Credentials, r *http.Request, - payloadHash string, service string, region string, signingTime time.Time, - optFns ...func(*v4.SignerOptions), - ) (url string, signedHeader http.Header, err error) -} - -// PresignOptions represents the presign client options -type PresignOptions struct { - - // ClientOptions are list of functional options to mutate client options used by - // the presign client. - ClientOptions []func(*Options) - - // Presigner is the presigner used by the presign url client - Presigner HTTPPresignerV4 -} - -func (o PresignOptions) copy() PresignOptions { - clientOptions := make([]func(*Options), len(o.ClientOptions)) - copy(clientOptions, o.ClientOptions) - o.ClientOptions = clientOptions - return o -} - -// WithPresignClientFromClientOptions is a helper utility to retrieve a function -// that takes PresignOption as input -func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) { - return withPresignClientFromClientOptions(optFns).options -} - -type withPresignClientFromClientOptions []func(*Options) - -func (w withPresignClientFromClientOptions) options(o *PresignOptions) { - o.ClientOptions = append(o.ClientOptions, w...) -} - -// PresignClient represents the presign url client -type PresignClient struct { - client *Client - options PresignOptions -} - -// NewPresignClient generates a presign client using provided API Client and -// presign options -func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient { - var options PresignOptions - for _, fn := range optFns { - fn(&options) - } - if len(options.ClientOptions) != 0 { - c = New(c.options, options.ClientOptions...) - } - - if options.Presigner == nil { - options.Presigner = newDefaultV4Signer(c.options) - } - - return &PresignClient{ - client: c, - options: options, - } -} - -func withNopHTTPClientAPIOption(o *Options) { - o.HTTPClient = smithyhttp.NopClient{} -} - -type presignContextPolyfillMiddleware struct { -} - -func (*presignContextPolyfillMiddleware) ID() string { - return "presignContextPolyfill" -} - -func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - schemeID := rscheme.Scheme.SchemeID() - - if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { - if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningName(ctx, sn) - } - if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningRegion(ctx, sr) - } - } else if schemeID == "aws.auth#sigv4a" { - if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningName(ctx, sn) - } - if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { - ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) - } - } - - return next.HandleFinalize(ctx, in) -} - -type presignConverter PresignOptions - -func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { - if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { - stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) - } - if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { - stack.Finalize.Remove((*retry.Attempt)(nil).ID()) - } - if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) - } - stack.Deserialize.Clear() - stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) - stack.Build.Remove("UserAgent") - if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { - return err - } - - pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ - CredentialsProvider: options.Credentials, - Presigner: c.Presigner, - LogSigning: options.ClientLogMode.IsSigning(), - }) - if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { - return err - } - if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { - return err - } - // convert request to a GET request - err = query.AddAsGetRequestMiddleware(stack) - if err != nil { - return err - } - err = presignedurlcust.AddAsIsPresigningMiddleware(stack) - if err != nil { - return err - } - return nil -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go deleted file mode 100644 index f3a93418f..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go +++ /dev/null @@ -1,580 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of temporary security credentials that you can use to access -// Amazon Web Services resources. These temporary credentials consist of an access -// key ID, a secret access key, and a security token. Typically, you use AssumeRole -// within your account or for cross-account access. For a comparison of AssumeRole -// with other API operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the -// IAM User Guide. -// -// # Permissions -// -// The temporary security credentials created by AssumeRole can be used to make -// API calls to any Amazon Web Services service with the following exception: You -// cannot call the Amazon Web Services STS GetFederationToken or GetSessionToken -// API operations. -// -// (Optional) You can pass inline or managed session policies to this operation. -// You can pass a single JSON policy document to use as an inline session policy. -// You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use -// as managed session policies. The plaintext that you use for both inline and -// managed session policies can't exceed 2,048 characters. Passing policies to this -// operation returns new temporary credentials. The resulting session's permissions -// are the intersection of the role's identity-based policy and the session -// policies. You can use the role's temporary credentials in subsequent Amazon Web -// Services API calls to access resources in the account that owns the role. You -// cannot use session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// When you create a role, you create two policies: a role trust policy that -// specifies who can assume the role, and a permissions policy that specifies what -// can be done with the role. You specify the trusted principal that is allowed to -// assume the role in the role trust policy. -// -// To assume a role from a different account, your Amazon Web Services account -// must be trusted by the role. The trust relationship is defined in the role's -// trust policy when the role is created. That trust policy states which accounts -// are allowed to delegate that access to users in the account. -// -// A user who wants to access a role in a different account must also have -// permissions that are delegated from the account administrator. The administrator -// must attach a policy that allows the user to call AssumeRole for the ARN of the -// role in the other account. -// -// To allow a user to assume a role in the same account, you can do either of the -// following: -// -// - Attach a policy to the user that allows the user to call AssumeRole (as long -// as the role's trust policy trusts the account). -// -// - Add the user as a principal directly in the role's trust policy. -// -// You can do either because the role’s trust policy acts as an IAM resource-based -// policy. When a resource-based policy grants access to a principal in the same -// account, no additional identity-based policy is required. For more information -// about trust policies and resource-based policies, see [IAM Policies]in the IAM User Guide. -// -// # Tags -// -// (Optional) You can pass tag key-value pairs to your session. These tags are -// called session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM -// User Guide. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # Using MFA with AssumeRole -// -// (Optional) You can include multi-factor authentication (MFA) information when -// you call AssumeRole . This is useful for cross-account scenarios to ensure that -// the user that assumes the role has been authenticated with an Amazon Web -// Services MFA device. In that scenario, the trust policy of the role being -// assumed includes a condition that tests for MFA authentication. If the caller -// does not include valid MFA information, the request to assume the role is -// denied. The condition in a trust policy that tests for MFA authentication might -// look like the following example. -// -// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} -// -// For more information, see [Configuring MFA-Protected API Access] in the IAM User Guide guide. -// -// To use MFA with AssumeRole , you pass values for the SerialNumber and TokenCode -// parameters. The SerialNumber value identifies the user's hardware or virtual -// MFA device. The TokenCode is the time-based one-time password (TOTP) that the -// MFA device produces. -// -// [Configuring MFA-Protected API Access]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining -// [IAM Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) { - if params == nil { - params = &AssumeRoleInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssumeRole", params, optFns, c.addOperationAssumeRoleMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssumeRoleOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssumeRoleInput struct { - - // The Amazon Resource Name (ARN) of the role to assume. - // - // This member is required. - RoleArn *string - - // An identifier for the assumed role session. - // - // Use the role session name to uniquely identify a session when the same role is - // assumed by different principals or for different reasons. In cross-account - // scenarios, the role session name is visible to, and can be logged by the account - // that owns the role. The role session name is also used in the ARN of the assumed - // role principal. This means that subsequent cross-account API requests that use - // the temporary security credentials will expose the role session name to the - // external account in their CloudTrail logs. - // - // For security purposes, administrators can view this field in [CloudTrail logs] to help identify - // who performed an action in Amazon Web Services. Your administrator might require - // that you specify your user name as the session name when you assume the role. - // For more information, see [sts:RoleSessionName]sts:RoleSessionName . - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds - // [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname - // - // This member is required. - RoleSessionName *string - - // The duration, in seconds, of the role session. The value specified can range - // from 900 seconds (15 minutes) up to the maximum session duration set for the - // role. The maximum session duration setting can have a value from 1 hour to 12 - // hours. If you specify a value higher than this setting or the administrator - // setting (whichever is lower), the operation fails. For example, if you specify a - // session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. - // - // Role chaining limits your Amazon Web Services CLI or Amazon Web Services API - // role session to a maximum of one hour. When you use the AssumeRole API - // operation to assume a role, you can specify the duration of your role session - // with the DurationSeconds parameter. You can specify a parameter value of up to - // 43200 seconds (12 hours), depending on the maximum session duration setting for - // your role. However, if you assume a role using role chaining and provide a - // DurationSeconds parameter value greater than one hour, the operation fails. To - // learn how to view the maximum value for your role, see [Update the maximum session duration for a role]. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html - DurationSeconds *int32 - - // A unique identifier that might be required when you assume a role in another - // account. If the administrator of the account to which the role belongs provided - // you with an external ID, then provide that value in the ExternalId parameter. - // This value can be any string, such as a passphrase or account number. A - // cross-account role is usually set up to trust everyone in an account. Therefore, - // the administrator of the trusting account might send an external ID to the - // administrator of the trusted account. That way, only someone with the ID can - // assume the role, rather than everyone in the account. For more information about - // the external ID, see [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@:/- - // - // [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html - ExternalId *string - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent Amazon Web Services API calls to - // access resources in the account that owns the role. You cannot use session - // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // For more information about role session permissions, see [Session policies]. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - Policy *string - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to - // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - PolicyArns []types.PolicyDescriptorType - - // A list of previously acquired trusted context assertions in the format of a - // JSON array. The trusted context assertion is signed and encrypted by Amazon Web - // Services STS. - // - // The following is an example of a ProvidedContext value that includes a single - // trusted context assertion and the ARN of the context provider from which the - // trusted context assertion was generated. - // - // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}] - ProvidedContexts []types.ProvidedContext - - // The identification number of the MFA device that is associated with the user - // who is making the AssumeRole call. Specify this value if the trust policy of - // the role being assumed includes a condition that requires MFA authentication. - // The value is either the serial number for a hardware device (such as - // GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as - // arn:aws:iam::123456789012:mfa/user ). - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - SerialNumber *string - - // The source identity specified by the principal that is calling the AssumeRole - // operation. The source identity value persists across [chained role]sessions. - // - // You can require users to specify a source identity when they assume a role. You - // do this by using the [sts:SourceIdentity]sts:SourceIdentity condition key in a role trust policy. - // You can use source identity information in CloudTrail logs to determine who took - // actions with a role. You can use the aws:SourceIdentity condition key to - // further control access to Amazon Web Services resources based on the value of - // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the - // IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: +=,.@-. You cannot use a - // value that begins with the text aws: . This prefix is reserved for Amazon Web - // Services internal use. - // - // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - // [sts:SourceIdentity]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity - SourceIdentity *string - - // A list of session tags that you want to pass. Each session tag consists of a - // key name and an associated value. For more information about session tags, see [Tagging Amazon Web Services STS Sessions] - // in the IAM User Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plaintext - // session tag keys can’t exceed 128 characters, and the values can’t exceed 256 - // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the role. When you do, session tags override a role tag with the same key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This means - // that you cannot have separate Department and department tag keys. Assume that - // the role has the Department = Marketing tag and you pass the department = - // engineering session tag. Department and department are not saved as separate - // tags, and the session tag passed in the request takes precedence over the role - // tag. - // - // Additionally, if you used temporary credentials to perform this operation, the - // new session inherits any transitive session tags from the calling session. If - // you pass a session tag with the same key as an inherited tag, the operation - // fails. To view the inherited tags for a session, see the CloudTrail logs. For - // more information, see [Viewing Session Tags in CloudTrail]in the IAM User Guide. - // - // [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length - // [Viewing Session Tags in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs - Tags []types.Tag - - // The value provided by the MFA device, if the trust policy of the role being - // assumed requires MFA. (In other words, if the policy includes a condition that - // tests for MFA). If the role being assumed requires MFA and if the TokenCode - // value is missing or expired, the AssumeRole call returns an "access denied" - // error. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. - TokenCode *string - - // A list of keys for session tags that you want to set as transitive. If you set - // a tag key as transitive, the corresponding key and value passes to subsequent - // sessions in a role chain. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. - // - // This parameter is optional. The transitive status of a session tag does not - // impact its packed binary size. - // - // If you choose not to specify a transitive tag key, then no tags are passed from - // this session to any subsequent sessions. - // - // [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining - TransitiveTagKeys []string - - noSmithyDocumentSerde -} - -// Contains the response to a successful AssumeRole request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. -type AssumeRoleOutput struct { - - // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers - // that you can use to refer to the resulting temporary security credentials. For - // example, you can reference these credentials as a principal in a resource-based - // policy by using the ARN or assumed role ID. The ARN and ID include the - // RoleSessionName that you specified when you called AssumeRole . - AssumedRoleUser *types.AssumedRoleUser - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // A percentage value that indicates the packed size of the session policies and - // session tags combined passed in the request. The request fails if the packed - // size is greater than 100 percent, which means the policies and tags exceeded the - // allowed space. - PackedPolicySize *int32 - - // The source identity specified by the principal that is calling the AssumeRole - // operation. - // - // You can require users to specify a source identity when they assume a role. You - // do this by using the sts:SourceIdentity condition key in a role trust policy. - // You can use source identity information in CloudTrail logs to determine who took - // actions with a role. You can use the aws:SourceIdentity condition key to - // further control access to Amazon Web Services resources based on the value of - // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the - // IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - SourceIdentity *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRole{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRole"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssumeRoleValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssumeRole", - } -} - -// PresignAssumeRole is used to generate a presigned HTTP Request which contains -// presigned URL, signed headers and HTTP method used. -func (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { - if params == nil { - params = &AssumeRoleInput{} - } - options := c.options.copy() - for _, fn := range optFns { - fn(&options) - } - clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) - - result, _, err := c.client.invokeOperation(ctx, "AssumeRole", params, clientOptFns, - c.client.addOperationAssumeRoleMiddlewares, - presignConverter(options).convertToPresignMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*v4.PresignedHTTPRequest) - return out, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go deleted file mode 100644 index 9dcceec12..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go +++ /dev/null @@ -1,488 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of temporary security credentials for users who have been -// authenticated via a SAML authentication response. This operation provides a -// mechanism for tying an enterprise identity store or directory to role-based -// Amazon Web Services access without user-specific credentials or configuration. -// For a comparison of AssumeRoleWithSAML with the other API operations that -// produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. -// -// The temporary security credentials returned by this operation consist of an -// access key ID, a secret access key, and a security token. Applications can use -// these temporary security credentials to sign calls to Amazon Web Services -// services. -// -// # Session Duration -// -// By default, the temporary security credentials created by AssumeRoleWithSAML -// last for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. Your role session lasts for the -// duration that you specify, or until the time specified in the SAML -// authentication response's SessionNotOnOrAfter value, whichever is shorter. You -// can provide a DurationSeconds value from 900 seconds (15 minutes) up to the -// maximum session duration setting for the role. This setting can have a value -// from 1 hour to 12 hours. To learn how to view the maximum value for your role, -// see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console URL. -// For more information, see [Using IAM Roles]in the IAM User Guide. -// -// [Role chaining]limits your CLI or Amazon Web Services API role session to a maximum of one -// hour. When you use the AssumeRole API operation to assume a role, you can -// specify the duration of your role session with the DurationSeconds parameter. -// You can specify a parameter value of up to 43200 seconds (12 hours), depending -// on the maximum session duration setting for your role. However, if you assume a -// role using role chaining and provide a DurationSeconds parameter value greater -// than one hour, the operation fails. -// -// # Permissions -// -// The temporary security credentials created by AssumeRoleWithSAML can be used to -// make API calls to any Amazon Web Services service with the following exception: -// you cannot call the STS GetFederationToken or GetSessionToken API operations. -// -// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a -// single JSON policy document to use as an inline session policy. You can also -// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed -// session policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. Passing policies to this operation -// returns new temporary credentials. The resulting session's permissions are the -// intersection of the role's identity-based policy and the session policies. You -// can use the role's temporary credentials in subsequent Amazon Web Services API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// Calling AssumeRoleWithSAML does not require the use of Amazon Web Services -// security credentials. The identity of the caller is validated by using keys in -// the metadata document that is uploaded for the SAML provider entity for your -// identity provider. -// -// Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. The -// entry includes the value in the NameID element of the SAML assertion. We -// recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the -// persistent identifier ( urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). -// -// # Tags -// -// (Optional) You can configure your IdP to pass attributes into your SAML -// assertion as session tags. Each session tag consists of a key name and an -// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User -// Guide. -// -// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed -// 128 characters and the values can’t exceed 256 characters. For these and -// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. -// -// An Amazon Web Services conversion compresses the passed inline session policy, -// managed policy ARNs, and session tags into a packed binary format that has a -// separate limit. Your request can fail for this limit even if your plaintext -// meets the other requirements. The PackedPolicySize response element indicates -// by percentage how close the policies and tags for your request are to the upper -// size limit. -// -// You can pass a session tag with the same key as a tag that is attached to the -// role. When you do, session tags override the role's tags with the same key. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # SAML Configuration -// -// Before your application can call AssumeRoleWithSAML , you must configure your -// SAML identity provider (IdP) to issue the claims required by Amazon Web -// Services. Additionally, you must use Identity and Access Management (IAM) to -// create a SAML provider entity in your Amazon Web Services account that -// represents your identity provider. You must also create an IAM role that -// specifies this SAML provider in its trust policy. -// -// For more information, see the following resources: -// -// [About SAML 2.0-based Federation] -// - in the IAM User Guide. -// -// [Creating SAML Identity Providers] -// - in the IAM User Guide. -// -// [Configuring a Relying Party and Claims] -// - in the IAM User Guide. -// -// [Creating a Role for SAML 2.0 Federation] -// - in the IAM User Guide. -// -// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session -// [Creating a Role for SAML 2.0 Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html -// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length -// [Creating SAML Identity Providers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html -// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -// [Configuring a Relying Party and Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html -// [Role chaining]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining -// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [About SAML 2.0-based Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining -func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) { - if params == nil { - params = &AssumeRoleWithSAMLInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithSAML", params, optFns, c.addOperationAssumeRoleWithSAMLMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssumeRoleWithSAMLOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssumeRoleWithSAMLInput struct { - - // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the - // IdP. - // - // This member is required. - PrincipalArn *string - - // The Amazon Resource Name (ARN) of the role that the caller is assuming. - // - // This member is required. - RoleArn *string - - // The base64 encoded SAML authentication response provided by the IdP. - // - // For more information, see [Configuring a Relying Party and Adding Claims] in the IAM User Guide. - // - // [Configuring a Relying Party and Adding Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html - // - // This member is required. - SAMLAssertion *string - - // The duration, in seconds, of the role session. Your role session lasts for the - // duration that you specify for the DurationSeconds parameter, or until the time - // specified in the SAML authentication response's SessionNotOnOrAfter value, - // whichever is shorter. You can provide a DurationSeconds value from 900 seconds - // (15 minutes) up to the maximum session duration setting for the role. This - // setting can have a value from 1 hour to 12 hours. If you specify a value higher - // than this setting, the operation fails. For example, if you specify a session - // duration of 12 hours, but your administrator set the maximum session duration to - // 6 hours, your operation fails. To learn how to view the maximum value for your - // role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html - DurationSeconds *int32 - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent Amazon Web Services API calls to - // access resources in the account that owns the role. You cannot use session - // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // For more information about role session permissions, see [Session policies]. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - Policy *string - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to - // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - PolicyArns []types.PolicyDescriptorType - - noSmithyDocumentSerde -} - -// Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. -type AssumeRoleWithSAMLOutput struct { - - // The identifiers for the temporary security credentials that the operation - // returns. - AssumedRoleUser *types.AssumedRoleUser - - // The value of the Recipient attribute of the SubjectConfirmationData element of - // the SAML assertion. - Audience *string - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // The value of the Issuer element of the SAML assertion. - Issuer *string - - // A hash value based on the concatenation of the following: - // - // - The Issuer response value. - // - // - The Amazon Web Services account ID. - // - // - The friendly name (the last part of the ARN) of the SAML provider in IAM. - // - // The combination of NameQualifier and Subject can be used to uniquely identify a - // user. - // - // The following pseudocode shows how the hash value is calculated: - // - // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) - NameQualifier *string - - // A percentage value that indicates the packed size of the session policies and - // session tags combined passed in the request. The request fails if the packed - // size is greater than 100 percent, which means the policies and tags exceeded the - // allowed space. - PackedPolicySize *int32 - - // The value in the SourceIdentity attribute in the SAML assertion. The source - // identity value persists across [chained role]sessions. - // - // You can require users to set a source identity value when they assume a role. - // You do this by using the sts:SourceIdentity condition key in a role trust - // policy. That way, actions that are taken with the role are associated with that - // user. After the source identity is set, the value cannot be changed. It is - // present in the request for all actions that are taken by the role and persists - // across [chained role]sessions. You can configure your SAML identity provider to use an - // attribute associated with your users, like user name or email, as the source - // identity when calling AssumeRoleWithSAML . You do this by adding an attribute to - // the SAML assertion. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in - // the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - SourceIdentity *string - - // The value of the NameID element in the Subject element of the SAML assertion. - Subject *string - - // The format of the name ID, as defined by the Format attribute in the NameID - // element of the SAML assertion. Typical examples of the format are transient or - // persistent . - // - // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format , - // that prefix is removed. For example, - // urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient . - // If the format includes any other prefix, the format is returned with no - // modifications. - SubjectType *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithSAML{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithSAML"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssumeRoleWithSAML", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go deleted file mode 100644 index 5975a0cde..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go +++ /dev/null @@ -1,508 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of temporary security credentials for users who have been -// authenticated in a mobile or web application with a web identity provider. -// Example providers include the OAuth 2.0 providers Login with Amazon and -// Facebook, or any OpenID Connect-compatible identity provider such as Google or [Amazon Cognito federated identities]. -// -// For mobile applications, we recommend that you use Amazon Cognito. You can use -// Amazon Cognito with the [Amazon Web Services SDK for iOS Developer Guide]and the [Amazon Web Services SDK for Android Developer Guide] to uniquely identify a user. You can also -// supply the user with a consistent identity throughout the lifetime of an -// application. -// -// To learn more about Amazon Cognito, see [Amazon Cognito identity pools] in Amazon Cognito Developer Guide. -// -// Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web -// Services security credentials. Therefore, you can distribute an application (for -// example, on mobile devices) that requests temporary security credentials without -// including long-term Amazon Web Services credentials in the application. You also -// don't need to deploy server-based proxy services that use long-term Amazon Web -// Services credentials. Instead, the identity of the caller is validated by using -// a token from the web identity provider. For a comparison of -// AssumeRoleWithWebIdentity with the other API operations that produce temporary -// credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. -// -// The temporary security credentials returned by this API consist of an access -// key ID, a secret access key, and a security token. Applications can use these -// temporary security credentials to sign calls to Amazon Web Services service API -// operations. -// -// # Session Duration -// -// By default, the temporary security credentials created by -// AssumeRoleWithWebIdentity last for one hour. However, you can use the optional -// DurationSeconds parameter to specify the duration of your session. You can -// provide a value from 900 seconds (15 minutes) up to the maximum session duration -// setting for the role. This setting can have a value from 1 hour to 12 hours. To -// learn how to view the maximum value for your role, see [Update the maximum session duration for a role]in the IAM User Guide. -// The maximum session duration limit applies when you use the AssumeRole* API -// operations or the assume-role* CLI commands. However the limit does not apply -// when you use those operations to create a console URL. For more information, see -// [Using IAM Roles]in the IAM User Guide. -// -// # Permissions -// -// The temporary security credentials created by AssumeRoleWithWebIdentity can be -// used to make API calls to any Amazon Web Services service with the following -// exception: you cannot call the STS GetFederationToken or GetSessionToken API -// operations. -// -// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a -// single JSON policy document to use as an inline session policy. You can also -// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed -// session policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. Passing policies to this operation -// returns new temporary credentials. The resulting session's permissions are the -// intersection of the role's identity-based policy and the session policies. You -// can use the role's temporary credentials in subsequent Amazon Web Services API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see [Session Policies]in the IAM User Guide. -// -// # Tags -// -// (Optional) You can configure your IdP to pass attributes into your web identity -// token as session tags. Each session tag consists of a key name and an associated -// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide. -// -// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed -// 128 characters and the values can’t exceed 256 characters. For these and -// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. -// -// An Amazon Web Services conversion compresses the passed inline session policy, -// managed policy ARNs, and session tags into a packed binary format that has a -// separate limit. Your request can fail for this limit even if your plaintext -// meets the other requirements. The PackedPolicySize response element indicates -// by percentage how close the policies and tags for your request are to the upper -// size limit. -// -// You can pass a session tag with the same key as a tag that is attached to the -// role. When you do, the session tag overrides the role tag with the same key. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during role -// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. -// -// # Identities -// -// Before your application can call AssumeRoleWithWebIdentity , you must have an -// identity token from a supported identity provider and create a role that the -// application can assume. The role that your application assumes must trust the -// identity provider that is associated with the identity token. In other words, -// the identity provider must be specified in the role's trust policy. -// -// Calling AssumeRoleWithWebIdentity can result in an entry in your CloudTrail -// logs. The entry includes the [Subject]of the provided web identity token. We recommend -// that you avoid using any personally identifiable information (PII) in this -// field. For example, you could instead use a GUID or a pairwise identifier, as [suggested in the OIDC specification]. -// -// For more information about how to use OIDC federation and the -// AssumeRoleWithWebIdentity API, see the following resources: -// -// [Using Web Identity Federation API Operations for Mobile Apps] -// - and [Federation Through a Web-based Identity Provider]. -// -// [Amazon Web Services SDK for iOS Developer Guide] -// - and [Amazon Web Services SDK for Android Developer Guide]. These toolkits contain sample apps that show how to invoke the -// identity providers. The toolkits then show how to use the information from these -// providers to get and use temporary security credentials. -// -// [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/ -// [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/ -// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length -// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html -// [Subject]: http://openid.net/specs/openid-connect-core-1_0.html#Claims -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -// [Amazon Cognito identity pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html -// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity -// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining -// [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration -// [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html -// [suggested in the OIDC specification]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes -func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) { - if params == nil { - params = &AssumeRoleWithWebIdentityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithWebIdentity", params, optFns, c.addOperationAssumeRoleWithWebIdentityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssumeRoleWithWebIdentityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssumeRoleWithWebIdentityInput struct { - - // The Amazon Resource Name (ARN) of the role that the caller is assuming. - // - // Additional considerations apply to Amazon Cognito identity pools that assume [cross-account IAM roles]. - // The trust policies of these roles must accept the cognito-identity.amazonaws.com - // service principal and must contain the cognito-identity.amazonaws.com:aud - // condition key to restrict role assumption to users from your intended identity - // pools. A policy that trusts Amazon Cognito identity pools without this condition - // creates a risk that a user from an unintended identity pool can assume the role. - // For more information, see [Trust policies for IAM roles in Basic (Classic) authentication]in the Amazon Cognito Developer Guide. - // - // [cross-account IAM roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html - // [Trust policies for IAM roles in Basic (Classic) authentication]: https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#trust-policies - // - // This member is required. - RoleArn *string - - // An identifier for the assumed role session. Typically, you pass the name or - // identifier that is associated with the user who is using your application. That - // way, the temporary security credentials that your application will use are - // associated with that user. This session name is included as part of the ARN and - // assumed role ID in the AssumedRoleUser response element. - // - // For security purposes, administrators can view this field in [CloudTrail logs] to help identify - // who performed an action in Amazon Web Services. Your administrator might require - // that you specify your user name as the session name when you assume the role. - // For more information, see [sts:RoleSessionName]sts:RoleSessionName . - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds - // [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname - // - // This member is required. - RoleSessionName *string - - // The OAuth 2.0 access token or OpenID Connect ID token that is provided by the - // identity provider. Your application must get this token by authenticating the - // user who is using your application with a web identity provider before the - // application makes an AssumeRoleWithWebIdentity call. Timestamps in the token - // must be formatted as either an integer or a long integer. Tokens must be signed - // using either RSA keys (RS256, RS384, or RS512) or ECDSA keys (ES256, ES384, or - // ES512). - // - // This member is required. - WebIdentityToken *string - - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) up to the maximum session duration setting for the role. - // This setting can have a value from 1 hour to 12 hours. If you specify a value - // higher than this setting, the operation fails. For example, if you specify a - // session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request to - // the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. - // - // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session - // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html - DurationSeconds *int32 - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent Amazon Web Services API calls to - // access resources in the account that owns the role. You cannot use session - // policies to grant more permissions than those allowed by the identity-based - // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM - // User Guide. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // For more information about role session permissions, see [Session policies]. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - Policy *string - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to - // use as managed session policies. The policies must exist in the same account as - // the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plaintext that you use for both inline and managed session policies - // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the - // Amazon Web Services General Reference. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent Amazon Web Services API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see [Session Policies]in the IAM User Guide. - // - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - PolicyArns []types.PolicyDescriptorType - - // The fully qualified host component of the domain name of the OAuth 2.0 identity - // provider. Do not specify this value for an OpenID Connect identity provider. - // - // Currently www.amazon.com and graph.facebook.com are the only supported identity - // providers for OAuth 2.0 access tokens. Do not include URL schemes and port - // numbers. - // - // Do not specify this value for OpenID Connect ID tokens. - ProviderId *string - - noSmithyDocumentSerde -} - -// Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. -type AssumeRoleWithWebIdentityOutput struct { - - // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers - // that you can use to refer to the resulting temporary security credentials. For - // example, you can reference these credentials as a principal in a resource-based - // policy by using the ARN or assumed role ID. The ARN and ID include the - // RoleSessionName that you specified when you called AssumeRole . - AssumedRoleUser *types.AssumedRoleUser - - // The intended audience (also known as client ID) of the web identity token. This - // is traditionally the client identifier issued to the application that requested - // the web identity token. - Audience *string - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // A percentage value that indicates the packed size of the session policies and - // session tags combined passed in the request. The request fails if the packed - // size is greater than 100 percent, which means the policies and tags exceeded the - // allowed space. - PackedPolicySize *int32 - - // The issuing authority of the web identity token presented. For OpenID Connect - // ID tokens, this contains the value of the iss field. For OAuth 2.0 access - // tokens, this contains the value of the ProviderId parameter that was passed in - // the AssumeRoleWithWebIdentity request. - Provider *string - - // The value of the source identity that is returned in the JSON web token (JWT) - // from the identity provider. - // - // You can require users to set a source identity value when they assume a role. - // You do this by using the sts:SourceIdentity condition key in a role trust - // policy. That way, actions that are taken with the role are associated with that - // user. After the source identity is set, the value cannot be changed. It is - // present in the request for all actions that are taken by the role and persists - // across [chained role]sessions. You can configure your identity provider to use an attribute - // associated with your users, like user name or email, as the source identity when - // calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON - // web token. To learn more about OIDC tokens and claims, see [Using Tokens with User Pools]in the Amazon - // Cognito Developer Guide. For more information about using source identity, see [Monitor and control actions taken with assumed roles] - // in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - // [Using Tokens with User Pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html - SourceIdentity *string - - // The unique user identifier that is returned by the identity provider. This - // identifier is associated with the WebIdentityToken that was submitted with the - // AssumeRoleWithWebIdentity call. The identifier is typically unique to the user - // and the application that acquired the WebIdentityToken (pairwise identifier). - // For OpenID Connect ID tokens, this field contains the value returned by the - // identity provider as the token's sub (Subject) claim. - SubjectFromWebIdentityToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithWebIdentity{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithWebIdentity"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssumeRoleWithWebIdentity", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go deleted file mode 100644 index 571f06728..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of short term credentials you can use to perform privileged tasks -// on a member account in your organization. -// -// Before you can launch a privileged session, you must have centralized root -// access in your organization. For steps to enable this feature, see [Centralize root access for member accounts]in the IAM -// User Guide. -// -// The STS global endpoint is not supported for AssumeRoot. You must send this -// request to a Regional STS endpoint. For more information, see [Endpoints]. -// -// You can track AssumeRoot in CloudTrail logs to determine what actions were -// performed in a session. For more information, see [Track privileged tasks in CloudTrail]in the IAM User Guide. -// -// [Endpoints]: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html#sts-endpoints -// [Track privileged tasks in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html -// [Centralize root access for member accounts]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html -func (c *Client) AssumeRoot(ctx context.Context, params *AssumeRootInput, optFns ...func(*Options)) (*AssumeRootOutput, error) { - if params == nil { - params = &AssumeRootInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssumeRoot", params, optFns, c.addOperationAssumeRootMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssumeRootOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssumeRootInput struct { - - // The member account principal ARN or account ID. - // - // This member is required. - TargetPrincipal *string - - // The identity based policy that scopes the session to the privileged tasks that - // can be performed. You can use one of following Amazon Web Services managed - // policies to scope root session actions. - // - // [IAMAuditRootUserCredentials] - // - // [IAMCreateRootUserPassword] - // - // [IAMDeleteRootUserCredentials] - // - // [S3UnlockBucketPolicy] - // - // [SQSUnlockQueuePolicy] - // - // [IAMDeleteRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials - // [IAMCreateRootUserPassword]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword - // [IAMAuditRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials - // [S3UnlockBucketPolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy - // [SQSUnlockQueuePolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy - // - // This member is required. - TaskPolicyArn *types.PolicyDescriptorType - - // The duration, in seconds, of the privileged session. The value can range from 0 - // seconds up to the maximum session duration of 900 seconds (15 minutes). If you - // specify a value higher than this setting, the operation fails. - // - // By default, the value is set to 900 seconds. - DurationSeconds *int32 - - noSmithyDocumentSerde -} - -type AssumeRootOutput struct { - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // The source identity specified by the principal that is calling the AssumeRoot - // operation. - // - // You can use the aws:SourceIdentity condition key to control access based on the - // value of source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles] - // in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html - SourceIdentity *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoot{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoot{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoot"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssumeRootValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoot(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssumeRoot(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssumeRoot", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go deleted file mode 100644 index 786bac89b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Decodes additional information about the authorization status of a request from -// an encoded message returned in response to an Amazon Web Services request. -// -// For example, if a user is not authorized to perform an operation that he or she -// has requested, the request returns a Client.UnauthorizedOperation response (an -// HTTP 403 response). Some Amazon Web Services operations additionally return an -// encoded message that can provide details about this authorization failure. -// -// Only certain Amazon Web Services operations return an encoded authorization -// message. The documentation for an individual operation indicates whether that -// operation returns an encoded message in addition to returning an HTTP code. -// -// The message is encoded because the details of the authorization status can -// contain privileged information that the user who requested the operation should -// not see. To decode an authorization status message, a user must be granted -// permissions through an IAM [policy]to request the DecodeAuthorizationMessage ( -// sts:DecodeAuthorizationMessage ) action. -// -// The decoded message includes the following type of information: -// -// - Whether the request was denied due to an explicit deny or due to the -// absence of an explicit allow. For more information, see [Determining Whether a Request is Allowed or Denied]in the IAM User -// Guide. -// -// - The principal who made the request. -// -// - The requested action. -// -// - The requested resource. -// -// - The values of condition keys in the context of the user's request. -// -// [Determining Whether a Request is Allowed or Denied]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow -// [policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html -func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) { - if params == nil { - params = &DecodeAuthorizationMessageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DecodeAuthorizationMessage", params, optFns, c.addOperationDecodeAuthorizationMessageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DecodeAuthorizationMessageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DecodeAuthorizationMessageInput struct { - - // The encoded message that was returned with the response. - // - // This member is required. - EncodedMessage *string - - noSmithyDocumentSerde -} - -// A document that contains additional information about the authorization status -// of a request from an encoded message that is returned in response to an Amazon -// Web Services request. -type DecodeAuthorizationMessageOutput struct { - - // The API returns a response with the decoded message. - DecodedMessage *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDecodeAuthorizationMessage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DecodeAuthorizationMessage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DecodeAuthorizationMessage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go deleted file mode 100644 index 6c1f87898..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the account identifier for the specified access key ID. -// -// Access keys consist of two parts: an access key ID (for example, -// AKIAIOSFODNN7EXAMPLE ) and a secret access key (for example, -// wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). For more information about access -// keys, see [Managing Access Keys for IAM Users]in the IAM User Guide. -// -// When you pass an access key ID to this operation, it returns the ID of the -// Amazon Web Services account to which the keys belong. Access key IDs beginning -// with AKIA are long-term credentials for an IAM user or the Amazon Web Services -// account root user. Access key IDs beginning with ASIA are temporary credentials -// that are created using STS operations. If the account in the response belongs to -// you, you can sign in as the root user and review your root user access keys. -// Then, you can pull a [credentials report]to learn which IAM user owns the keys. To learn who -// requested the temporary credentials for an ASIA access key, view the STS events -// in your [CloudTrail logs]in the IAM User Guide. -// -// This operation does not indicate the state of the access key. The key might be -// active, inactive, or deleted. Active keys might not have permissions to perform -// an operation. Providing a deleted access key might return an error that the key -// doesn't exist. -// -// [credentials report]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html -// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html -// [Managing Access Keys for IAM Users]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html -func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) { - if params == nil { - params = &GetAccessKeyInfoInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAccessKeyInfo", params, optFns, c.addOperationGetAccessKeyInfoMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAccessKeyInfoOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAccessKeyInfoInput struct { - - // The identifier of an access key. - // - // This parameter allows (through its regex pattern) a string of characters that - // can consist of any upper- or lowercase letter or digit. - // - // This member is required. - AccessKeyId *string - - noSmithyDocumentSerde -} - -type GetAccessKeyInfoOutput struct { - - // The number used to identify the Amazon Web Services account. - Account *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetAccessKeyInfo{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessKeyInfo"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAccessKeyInfo", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go deleted file mode 100644 index 7d0653398..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns details about the IAM user or role whose credentials are used to call -// the operation. -// -// No permissions are required to perform this operation. If an administrator -// attaches a policy to your identity that explicitly denies access to the -// sts:GetCallerIdentity action, you can still perform this operation. Permissions -// are not required because the same information is returned when access is denied. -// To view an example response, see [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]in the IAM User Guide. -// -// [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa -func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) { - if params == nil { - params = &GetCallerIdentityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCallerIdentity", params, optFns, c.addOperationGetCallerIdentityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCallerIdentityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCallerIdentityInput struct { - noSmithyDocumentSerde -} - -// Contains the response to a successful GetCallerIdentity request, including information about the -// entity making the request. -type GetCallerIdentityOutput struct { - - // The Amazon Web Services account ID number of the account that owns or contains - // the calling entity. - Account *string - - // The Amazon Web Services ARN associated with the calling entity. - Arn *string - - // The unique identifier of the calling entity. The exact value depends on the - // type of entity that is making the call. The values returned are those listed in - // the aws:userid column in the [Principal table]found on the Policy Variables reference page in - // the IAM User Guide. - // - // [Principal table]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable - UserId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetCallerIdentity{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCallerIdentity"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCallerIdentity", - } -} - -// PresignGetCallerIdentity is used to generate a presigned HTTP Request which -// contains presigned URL, signed headers and HTTP method used. -func (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { - if params == nil { - params = &GetCallerIdentityInput{} - } - options := c.options.copy() - for _, fn := range optFns { - fn(&options) - } - clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) - - result, _, err := c.client.invokeOperation(ctx, "GetCallerIdentity", params, clientOptFns, - c.client.addOperationGetCallerIdentityMiddlewares, - presignConverter(options).convertToPresignMiddleware, - ) - if err != nil { - return nil, err - } - - out := result.(*v4.PresignedHTTPRequest) - return out, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go deleted file mode 100644 index 1c2f28e51..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go +++ /dev/null @@ -1,429 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of temporary security credentials (consisting of an access key -// ID, a secret access key, and a security token) for a user. A typical use is in a -// proxy application that gets temporary security credentials on behalf of -// distributed applications inside a corporate network. -// -// You must call the GetFederationToken operation using the long-term security -// credentials of an IAM user. As a result, this call is appropriate in contexts -// where those credentials can be safeguarded, usually in a server-based -// application. For a comparison of GetFederationToken with the other API -// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. -// -// Although it is possible to call GetFederationToken using the security -// credentials of an Amazon Web Services account root user rather than an IAM user -// that you create for the purpose of a proxy application, we do not recommend it. -// For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in the IAM User Guide. -// -// You can create a mobile-based or browser-based app that can authenticate users -// using a web identity provider like Login with Amazon, Facebook, Google, or an -// OpenID Connect-compatible identity provider. In this case, we recommend that you -// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User -// Guide. -// -// # Session duration -// -// The temporary credentials are valid for the specified duration, from 900 -// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default -// session duration is 43,200 seconds (12 hours). Temporary credentials obtained by -// using the root user credentials have a maximum duration of 3,600 seconds (1 -// hour). -// -// # Permissions -// -// You can use the temporary credentials created by GetFederationToken in any -// Amazon Web Services service with the following exceptions: -// -// - You cannot call any IAM operations using the CLI or the Amazon Web Services -// API. This limitation does not apply to console sessions. -// -// - You cannot call any STS operations except GetCallerIdentity . -// -// You can use temporary credentials for single sign-on (SSO) to the console. -// -// You must pass an inline or managed [session policy] to this operation. You can pass a single -// JSON policy document to use as an inline session policy. You can also specify up -// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session -// policies. The plaintext that you use for both inline and managed session -// policies can't exceed 2,048 characters. -// -// Though the session policy parameters are optional, if you do not pass a policy, -// then the resulting federated user session has no permissions. When you pass -// session policies, the session permissions are the intersection of the IAM user -// policies and the session policies that you pass. This gives you a way to further -// restrict the permissions for a federated user. You cannot use session policies -// to grant more permissions than those that are defined in the permissions policy -// of the IAM user. For more information, see [Session Policies]in the IAM User Guide. For -// information about using GetFederationToken to create temporary security -// credentials, see [GetFederationToken—Federation Through a Custom Identity Broker]. -// -// You can use the credentials to access a resource that has a resource-based -// policy. If that policy specifically references the federated user session in the -// Principal element of the policy, the session has the permissions allowed by the -// policy. These permissions are granted in addition to the permissions granted by -// the session policies. -// -// # Tags -// -// (Optional) You can pass tag key-value pairs to your session. These are called -// session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM User -// Guide. -// -// You can create a mobile-based or browser-based app that can authenticate users -// using a web identity provider like Login with Amazon, Facebook, Google, or an -// OpenID Connect-compatible identity provider. In this case, we recommend that you -// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User -// Guide. -// -// An administrator must grant you the permissions necessary to pass session tags. -// The administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. -// -// Tag key–value pairs are not case sensitive, but case is preserved. This means -// that you cannot have separate Department and department tag keys. Assume that -// the user that you are federating has the Department = Marketing tag and you -// pass the department = engineering session tag. Department and department are -// not saved as separate tags, and the session tag passed in the request takes -// precedence over the user tag. -// -// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity -// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Amazon Cognito]: http://aws.amazon.com/cognito/ -// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [GetFederationToken—Federation Through a Custom Identity Broker]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken -// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html -// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html -func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) { - if params == nil { - params = &GetFederationTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetFederationToken", params, optFns, c.addOperationGetFederationTokenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetFederationTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetFederationTokenInput struct { - - // The name of the federated user. The name is used as an identifier for the - // temporary security credentials (such as Bob ). For example, you can reference - // the federated user name in a resource-based policy, such as in an Amazon S3 - // bucket policy. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- - // - // This member is required. - Name *string - - // The duration, in seconds, that the session should last. Acceptable durations - // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds - // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained - // using root user credentials are restricted to a maximum of 3,600 seconds (one - // hour). If the specified duration is longer than one hour, the session obtained - // by using root user credentials defaults to one hour. - DurationSeconds *int32 - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // You must pass an inline or managed [session policy] to this operation. You can pass a single - // JSON policy document to use as an inline session policy. You can also specify up - // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session - // policies. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection of - // the IAM user policies and the session policies that you pass. This gives you a - // way to further restrict the permissions for a federated user. You cannot use - // session policies to grant more permissions than those that are defined in the - // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User - // Guide. - // - // The resulting credentials can be used to access a resource that has a - // resource-based policy. If that policy specifically references the federated user - // session in the Principal element of the policy, the session has the permissions - // allowed by the policy. These permissions are granted in addition to the - // permissions that are granted by the session policies. - // - // The plaintext that you use for both inline and managed session policies can't - // exceed 2,048 characters. The JSON policy characters can be any ASCII character - // from the space character to the end of the valid character list (\u0020 through - // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - Policy *string - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to - // use as a managed session policy. The policies must exist in the same account as - // the IAM user that is requesting federated access. - // - // You must pass an inline or managed [session policy] to this operation. You can pass a single - // JSON policy document to use as an inline session policy. You can also specify up - // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session - // policies. The plaintext that you use for both inline and managed session - // policies can't exceed 2,048 characters. You can provide up to 10 managed policy - // ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General - // Reference. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection of - // the IAM user policies and the session policies that you pass. This gives you a - // way to further restrict the permissions for a federated user. You cannot use - // session policies to grant more permissions than those that are defined in the - // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User - // Guide. - // - // The resulting credentials can be used to access a resource that has a - // resource-based policy. If that policy specifically references the federated user - // session in the Principal element of the policy, the session has the permissions - // allowed by the policy. These permissions are granted in addition to the - // permissions that are granted by the session policies. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - PolicyArns []types.PolicyDescriptorType - - // A list of session tags. Each session tag consists of a key name and an - // associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User - // Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plaintext - // session tag keys can’t exceed 128 characters and the values can’t exceed 256 - // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. - // - // An Amazon Web Services conversion compresses the passed inline session policy, - // managed policy ARNs, and session tags into a packed binary format that has a - // separate limit. Your request can fail for this limit even if your plaintext - // meets the other requirements. The PackedPolicySize response element indicates - // by percentage how close the policies and tags for your request are to the upper - // size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the user you are federating. When you do, session tags override a user tag - // with the same key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This means - // that you cannot have separate Department and department tag keys. Assume that - // the role has the Department = Marketing tag and you pass the department = - // engineering session tag. Department and department are not saved as separate - // tags, and the session tag passed in the request takes precedence over the role - // tag. - // - // [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length - Tags []types.Tag - - noSmithyDocumentSerde -} - -// Contains the response to a successful GetFederationToken request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. -type GetFederationTokenOutput struct { - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // Identifiers for the federated user associated with the credentials (such as - // arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use - // the federated user's ARN in your resource-based policies, such as an Amazon S3 - // bucket policy. - FederatedUser *types.FederatedUser - - // A percentage value that indicates the packed size of the session policies and - // session tags combined passed in the request. The request fails if the packed - // size is greater than 100 percent, which means the policies and tags exceeded the - // allowed space. - PackedPolicySize *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetFederationToken{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetFederationToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetFederationToken", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go deleted file mode 100644 index 256046990..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a set of temporary credentials for an Amazon Web Services account or -// IAM user. The credentials consist of an access key ID, a secret access key, and -// a security token. Typically, you use GetSessionToken if you want to use MFA to -// protect programmatic calls to specific Amazon Web Services API operations like -// Amazon EC2 StopInstances . -// -// MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is -// associated with their MFA device. Using the temporary security credentials that -// the call returns, IAM users can then make programmatic calls to API operations -// that require MFA authentication. An incorrect MFA code causes the API to return -// an access denied error. For a comparison of GetSessionToken with the other API -// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. -// -// No permissions are required for users to perform this operation. The purpose of -// the sts:GetSessionToken operation is to authenticate the user using MFA. You -// cannot use policies to control authentication operations. For more information, -// see [Permissions for GetSessionToken]in the IAM User Guide. -// -// # Session Duration -// -// The GetSessionToken operation must be called by using the long-term Amazon Web -// Services security credentials of an IAM user. Credentials that are created by -// IAM users are valid for the duration that you specify. This duration can range -// from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), -// with a default of 43,200 seconds (12 hours). Credentials based on account -// credentials can range from 900 seconds (15 minutes) up to 3,600 seconds (1 -// hour), with a default of 1 hour. -// -// # Permissions -// -// The temporary security credentials created by GetSessionToken can be used to -// make API calls to any Amazon Web Services service with the following exceptions: -// -// - You cannot call any IAM API operations unless MFA authentication -// information is included in the request. -// -// - You cannot call any STS API except AssumeRole or GetCallerIdentity . -// -// The credentials that GetSessionToken returns are based on permissions -// associated with the IAM user whose credentials were used to call the operation. -// The temporary credentials have the same permissions as the IAM user. -// -// Although it is possible to call GetSessionToken using the security credentials -// of an Amazon Web Services account root user rather than an IAM user, we do not -// recommend it. If GetSessionToken is called using root user credentials, the -// temporary credentials have root user permissions. For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in -// the IAM User Guide -// -// For more information about using GetSessionToken to create temporary -// credentials, see [Temporary Credentials for Users in Untrusted Environments]in the IAM User Guide. -// -// [Permissions for GetSessionToken]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html -// [Temporary Credentials for Users in Untrusted Environments]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken -// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials -// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html -// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html -func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) { - if params == nil { - params = &GetSessionTokenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSessionToken", params, optFns, c.addOperationGetSessionTokenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSessionTokenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSessionTokenInput struct { - - // The duration, in seconds, that the credentials should remain valid. Acceptable - // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600 - // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions for - // Amazon Web Services account owners are restricted to a maximum of 3,600 seconds - // (one hour). If the duration is longer than one hour, the session for Amazon Web - // Services account owners defaults to one hour. - DurationSeconds *int32 - - // The identification number of the MFA device that is associated with the IAM - // user who is making the GetSessionToken call. Specify this value if the IAM user - // has a policy that requires MFA authentication. The value is either the serial - // number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name - // (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You - // can find the device for an IAM user by going to the Amazon Web Services - // Management Console and viewing the user's security credentials. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@:/- - SerialNumber *string - - // The value provided by the MFA device, if MFA is required. If any policy - // requires the IAM user to submit an MFA code, specify this value. If MFA - // authentication is required, the user must provide a code when requesting a set - // of temporary security credentials. A user who fails to provide the code receives - // an "access denied" response when requesting resources that require MFA - // authentication. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. - TokenCode *string - - noSmithyDocumentSerde -} - -// Contains the response to a successful GetSessionToken request, including temporary Amazon Web -// Services credentials that can be used to make Amazon Web Services requests. -type GetSessionTokenOutput struct { - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. - Credentials *types.Credentials - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSessionToken{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSessionToken"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSessionToken", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go deleted file mode 100644 index 2a81b3fb1..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ - "AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, - - "AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - {SchemeID: smithyauth.SchemeIDAnonymous}, - } - }, -} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "sts") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} 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 deleted file mode 100644 index a1ac917ec..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ /dev/null @@ -1,2710 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "bytes" - "context" - "encoding/xml" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - smithy "github.com/aws/smithy-go" - smithyxml "github.com/aws/smithy-go/encoding/xml" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strconv" - "strings" -) - -type awsAwsquery_deserializeOpAssumeRole struct { -} - -func (*awsAwsquery_deserializeOpAssumeRole) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpAssumeRole) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorAssumeRole(response, &metadata) - } - output := &AssumeRoleOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("AssumeRoleResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentAssumeRoleOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorAssumeRole(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocument", errorCode): - return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PackedPolicyTooLarge", errorCode): - return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) - - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpAssumeRoleWithSAML struct { -} - -func (*awsAwsquery_deserializeOpAssumeRoleWithSAML) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response, &metadata) - } - output := &AssumeRoleWithSAMLOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("AssumeRoleWithSAMLResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("IDPRejectedClaim", errorCode): - return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) - - case strings.EqualFold("InvalidIdentityToken", errorCode): - return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocument", errorCode): - return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PackedPolicyTooLarge", errorCode): - return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) - - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpAssumeRoleWithWebIdentity struct { -} - -func (*awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response, &metadata) - } - output := &AssumeRoleWithWebIdentityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("AssumeRoleWithWebIdentityResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("IDPCommunicationError", errorCode): - return awsAwsquery_deserializeErrorIDPCommunicationErrorException(response, errorBody) - - case strings.EqualFold("IDPRejectedClaim", errorCode): - return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) - - case strings.EqualFold("InvalidIdentityToken", errorCode): - return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocument", errorCode): - return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PackedPolicyTooLarge", errorCode): - return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) - - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpAssumeRoot struct { -} - -func (*awsAwsquery_deserializeOpAssumeRoot) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpAssumeRoot) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoot(response, &metadata) - } - output := &AssumeRootOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("AssumeRootResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentAssumeRootOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorAssumeRoot(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpDecodeAuthorizationMessage struct { -} - -func (*awsAwsquery_deserializeOpDecodeAuthorizationMessage) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response, &metadata) - } - output := &DecodeAuthorizationMessageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DecodeAuthorizationMessageResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("InvalidAuthorizationMessageException", errorCode): - return awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpGetAccessKeyInfo struct { -} - -func (*awsAwsquery_deserializeOpGetAccessKeyInfo) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response, &metadata) - } - output := &GetAccessKeyInfoOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetAccessKeyInfoResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorGetAccessKeyInfo(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpGetCallerIdentity struct { -} - -func (*awsAwsquery_deserializeOpGetCallerIdentity) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpGetCallerIdentity) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetCallerIdentity(response, &metadata) - } - output := &GetCallerIdentityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetCallerIdentityResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorGetCallerIdentity(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpGetFederationToken struct { -} - -func (*awsAwsquery_deserializeOpGetFederationToken) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpGetFederationToken) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetFederationToken(response, &metadata) - } - output := &GetFederationTokenOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetFederationTokenResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorGetFederationToken(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("MalformedPolicyDocument", errorCode): - return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PackedPolicyTooLarge", errorCode): - return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) - - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpGetSessionToken struct { -} - -func (*awsAwsquery_deserializeOpGetSessionToken) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpGetSessionToken) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetSessionToken(response, &metadata) - } - output := &GetSessionTokenOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetSessionTokenResult") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(&output, 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 out, metadata, err - } - - return out, metadata, err -} - -func awsAwsquery_deserializeOpErrorGetSessionToken(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 - - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) - if err != nil { - return err - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - case strings.EqualFold("RegionDisabledException", errorCode): - return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ExpiredTokenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentExpiredTokenException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IDPCommunicationErrorException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IDPRejectedClaimException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidAuthorizationMessageException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidIdentityTokenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.MalformedPolicyDocumentException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PackedPolicyTooLargeException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.RegionDisabledException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - 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(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - 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(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentRegionDisabledException(&output, 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(), - } - } - - return output -} - -func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.AssumedRoleUser - if *v == nil { - sv = &types.AssumedRoleUser{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("AssumedRoleId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AssumedRoleId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Credentials - if *v == nil { - sv = &types.Credentials{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AccessKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccessKeyId = ptr.String(xtv) - } - - case strings.EqualFold("Expiration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Expiration = ptr.Time(t) - } - - case strings.EqualFold("SecretAccessKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecretAccessKey = ptr.String(xtv) - } - - case strings.EqualFold("SessionToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SessionToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ExpiredTokenException - if *v == nil { - sv = &types.ExpiredTokenException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FederatedUser - if *v == nil { - sv = &types.FederatedUser{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("FederatedUserId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FederatedUserId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IDPCommunicationErrorException - if *v == nil { - sv = &types.IDPCommunicationErrorException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.IDPRejectedClaimException - if *v == nil { - sv = &types.IDPRejectedClaimException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InvalidAuthorizationMessageException - if *v == nil { - sv = &types.InvalidAuthorizationMessageException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InvalidIdentityTokenException - if *v == nil { - sv = &types.InvalidIdentityTokenException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.MalformedPolicyDocumentException - if *v == nil { - sv = &types.MalformedPolicyDocumentException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.PackedPolicyTooLargeException - if *v == nil { - sv = &types.PackedPolicyTooLargeException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RegionDisabledException - if *v == nil { - sv = &types.RegionDisabledException{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssumeRoleOutput - if *v == nil { - sv = &AssumeRoleOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AssumedRoleUser", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("PackedPolicySize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PackedPolicySize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("SourceIdentity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIdentity = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWithSAMLOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssumeRoleWithSAMLOutput - if *v == nil { - sv = &AssumeRoleWithSAMLOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AssumedRoleUser", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Audience", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Audience = ptr.String(xtv) - } - - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Issuer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Issuer = ptr.String(xtv) - } - - case strings.EqualFold("NameQualifier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NameQualifier = ptr.String(xtv) - } - - case strings.EqualFold("PackedPolicySize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PackedPolicySize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("SourceIdentity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIdentity = ptr.String(xtv) - } - - case strings.EqualFold("Subject", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Subject = ptr.String(xtv) - } - - case strings.EqualFold("SubjectType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubjectType = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **AssumeRoleWithWebIdentityOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssumeRoleWithWebIdentityOutput - if *v == nil { - sv = &AssumeRoleWithWebIdentityOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AssumedRoleUser", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Audience", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Audience = ptr.String(xtv) - } - - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("PackedPolicySize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PackedPolicySize = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("Provider", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Provider = ptr.String(xtv) - } - - case strings.EqualFold("SourceIdentity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIdentity = ptr.String(xtv) - } - - case strings.EqualFold("SubjectFromWebIdentityToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubjectFromWebIdentityToken = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentAssumeRootOutput(v **AssumeRootOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *AssumeRootOutput - if *v == nil { - sv = &AssumeRootOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("SourceIdentity", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceIdentity = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(v **DecodeAuthorizationMessageOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DecodeAuthorizationMessageOutput - if *v == nil { - sv = &DecodeAuthorizationMessageOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("DecodedMessage", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DecodedMessage = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(v **GetAccessKeyInfoOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAccessKeyInfoOutput - if *v == nil { - sv = &GetAccessKeyInfoOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Account", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Account = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(v **GetCallerIdentityOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetCallerIdentityOutput - if *v == nil { - sv = &GetCallerIdentityOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Account", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Account = ptr.String(xtv) - } - - case strings.EqualFold("Arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("UserId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserId = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederationTokenOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetFederationTokenOutput - if *v == nil { - sv = &GetFederationTokenOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("FederatedUser", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentFederatedUser(&sv.FederatedUser, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("PackedPolicySize", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.PackedPolicySize = ptr.Int32(int32(i64)) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetSessionTokenOutput - if *v == nil { - sv = &GetSessionTokenOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Credentials", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go deleted file mode 100644 index cbb19c7f6..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package sts provides the API client, operations, and parameter types for AWS -// Security Token Service. -// -// # Security Token Service -// -// Security Token Service (STS) enables you to request temporary, -// limited-privilege credentials for users. This guide provides descriptions of the -// STS API. For more information about using this service, see [Temporary Security Credentials]. -// -// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html -package sts diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go deleted file mode 100644 index 945682e1a..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ /dev/null @@ -1,1139 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "sts" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_STS") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "STS", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string - - // Whether the global endpoint should be used, rather then the regional endpoint - // for us-east-1. - // - // Defaults to false if no value is - // provided. - // - // AWS::STS::UseGlobalEndpoint - UseGlobalEndpoint *bool -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - if p.UseGlobalEndpoint == nil { - return fmt.Errorf("parameter UseGlobalEndpoint is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - - if p.UseGlobalEndpoint == nil { - p.UseGlobalEndpoint = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - _UseGlobalEndpoint := *params.UseGlobalEndpoint - _ = _UseGlobalEndpoint - - if _UseGlobalEndpoint == true { - if !(params.Endpoint != nil) { - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == false { - if _UseDualStack == false { - if _Region == "ap-northeast-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "ap-south-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "ap-southeast-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "ap-southeast-2" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "aws-global" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "ca-central-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "eu-central-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "eu-north-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "eu-west-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "eu-west-2" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "eu-west-3" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "sa-east-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "us-east-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "us-east-2" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "us-west-1" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - if _Region == "us-west-2" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, _Region) - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - } - } - } - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - if _Region == "aws-global" { - uriString := "https://sts.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "sts") - smithyhttp.SetSigV4ASigningName(&sp, "sts") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://sts.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json deleted file mode 100644 index 86bb3b79b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5", - "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AssumeRole.go", - "api_op_AssumeRoleWithSAML.go", - "api_op_AssumeRoleWithWebIdentity.go", - "api_op_AssumeRoot.go", - "api_op_DecodeAuthorizationMessage.go", - "api_op_GetAccessKeyInfo.go", - "api_op_GetCallerIdentity.go", - "api_op_GetFederationToken.go", - "api_op_GetSessionToken.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.22", - "module": "github.com/aws/aws-sdk-go-v2/service/sts", - "unstable": false -} 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 deleted file mode 100644 index dd0eacf56..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package sts - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.38.6" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go deleted file mode 100644 index 1dc87dd6b..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go +++ /dev/null @@ -1,563 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver STS endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "sts.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "sts-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "af-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-4", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-5", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-6", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-7", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "aws-global", - }: endpoints.Endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "ca-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-central-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "mx-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.us-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-east-1-fips", - }: endpoints.Endpoint{ - Hostname: "sts-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.us-east-2.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-east-2-fips", - }: endpoints.Endpoint{ - Hostname: "sts-fips.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.us-west-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-1-fips", - }: endpoints.Endpoint{ - Hostname: "sts-fips.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.us-west-2.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-2-fips", - }: endpoints.Endpoint{ - Hostname: "sts-fips.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - Deprecated: aws.TrueTernary, - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "sts.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "sts-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "cn-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "cn-northwest-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-iso-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-iso-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isob-east-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "eu-isoe-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isof-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-isof-south-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "sts.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "sts-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "sts.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-gov-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts.us-gov-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-gov-east-1-fips", - }: endpoints.Endpoint{ - Hostname: "sts.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "sts.us-gov-west-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1-fips", - }: endpoints.Endpoint{ - Hostname: "sts.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - Deprecated: aws.TrueTernary, - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go deleted file mode 100644 index f60b7d338..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go deleted file mode 100644 index 96b222136..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go +++ /dev/null @@ -1,1005 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/query" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - 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" - "path" -) - -type awsAwsquery_serializeOpAssumeRole struct { -} - -func (*awsAwsquery_serializeOpAssumeRole) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpAssumeRole) 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.(*AssumeRoleInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssumeRole") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentAssumeRoleInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpAssumeRoleWithSAML struct { -} - -func (*awsAwsquery_serializeOpAssumeRoleWithSAML) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) 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.(*AssumeRoleWithSAMLInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssumeRoleWithSAML") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpAssumeRoleWithWebIdentity struct { -} - -func (*awsAwsquery_serializeOpAssumeRoleWithWebIdentity) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) 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.(*AssumeRoleWithWebIdentityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssumeRoleWithWebIdentity") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpAssumeRoot struct { -} - -func (*awsAwsquery_serializeOpAssumeRoot) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpAssumeRoot) 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.(*AssumeRootInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AssumeRoot") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentAssumeRootInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpDecodeAuthorizationMessage struct { -} - -func (*awsAwsquery_serializeOpDecodeAuthorizationMessage) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) 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.(*DecodeAuthorizationMessageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DecodeAuthorizationMessage") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpGetAccessKeyInfo struct { -} - -func (*awsAwsquery_serializeOpGetAccessKeyInfo) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpGetAccessKeyInfo) 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.(*GetAccessKeyInfoInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetAccessKeyInfo") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpGetCallerIdentity struct { -} - -func (*awsAwsquery_serializeOpGetCallerIdentity) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpGetCallerIdentity) 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.(*GetCallerIdentityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetCallerIdentity") - body.Key("Version").String("2011-06-15") - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpGetFederationToken struct { -} - -func (*awsAwsquery_serializeOpGetFederationToken) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpGetFederationToken) 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.(*GetFederationTokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetFederationToken") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentGetFederationTokenInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsquery_serializeOpGetSessionToken struct { -} - -func (*awsAwsquery_serializeOpGetSessionToken) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsquery_serializeOpGetSessionToken) 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.(*GetSessionTokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetSessionToken") - body.Key("Version").String("2011-06-15") - - if err := awsAwsquery_serializeOpDocumentGetSessionTokenInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error { - array := value.Array("member") - - for i := range v { - av := array.Value() - if err := awsAwsquery_serializeDocumentPolicyDescriptorType(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptorType, value query.Value) error { - object := value.Object() - _ = object - - if v.Arn != nil { - objectKey := object.Key("arn") - objectKey.String(*v.Arn) - } - - return nil -} - -func awsAwsquery_serializeDocumentProvidedContext(v *types.ProvidedContext, value query.Value) error { - object := value.Object() - _ = object - - if v.ContextAssertion != nil { - objectKey := object.Key("ContextAssertion") - objectKey.String(*v.ContextAssertion) - } - - if v.ProviderArn != nil { - objectKey := object.Key("ProviderArn") - objectKey.String(*v.ProviderArn) - } - - return nil -} - -func awsAwsquery_serializeDocumentProvidedContextsListType(v []types.ProvidedContext, value query.Value) error { - array := value.Array("member") - - for i := range v { - av := array.Value() - if err := awsAwsquery_serializeDocumentProvidedContext(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { - object := value.Object() - _ = object - - if v.Key != nil { - objectKey := object.Key("Key") - objectKey.String(*v.Key) - } - - if v.Value != nil { - objectKey := object.Key("Value") - objectKey.String(*v.Value) - } - - return nil -} - -func awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) error { - array := value.Array("member") - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) error { - array := value.Array("member") - - for i := range v { - av := array.Value() - if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.ExternalId != nil { - objectKey := object.Key("ExternalId") - objectKey.String(*v.ExternalId) - } - - if v.Policy != nil { - objectKey := object.Key("Policy") - objectKey.String(*v.Policy) - } - - if v.PolicyArns != nil { - objectKey := object.Key("PolicyArns") - if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { - return err - } - } - - if v.ProvidedContexts != nil { - objectKey := object.Key("ProvidedContexts") - if err := awsAwsquery_serializeDocumentProvidedContextsListType(v.ProvidedContexts, objectKey); err != nil { - return err - } - } - - if v.RoleArn != nil { - objectKey := object.Key("RoleArn") - objectKey.String(*v.RoleArn) - } - - if v.RoleSessionName != nil { - objectKey := object.Key("RoleSessionName") - objectKey.String(*v.RoleSessionName) - } - - if v.SerialNumber != nil { - objectKey := object.Key("SerialNumber") - objectKey.String(*v.SerialNumber) - } - - if v.SourceIdentity != nil { - objectKey := object.Key("SourceIdentity") - objectKey.String(*v.SourceIdentity) - } - - if v.Tags != nil { - objectKey := object.Key("Tags") - if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { - return err - } - } - - if v.TokenCode != nil { - objectKey := object.Key("TokenCode") - objectKey.String(*v.TokenCode) - } - - if v.TransitiveTagKeys != nil { - objectKey := object.Key("TransitiveTagKeys") - if err := awsAwsquery_serializeDocumentTagKeyListType(v.TransitiveTagKeys, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.Policy != nil { - objectKey := object.Key("Policy") - objectKey.String(*v.Policy) - } - - if v.PolicyArns != nil { - objectKey := object.Key("PolicyArns") - if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { - return err - } - } - - if v.PrincipalArn != nil { - objectKey := object.Key("PrincipalArn") - objectKey.String(*v.PrincipalArn) - } - - if v.RoleArn != nil { - objectKey := object.Key("RoleArn") - objectKey.String(*v.RoleArn) - } - - if v.SAMLAssertion != nil { - objectKey := object.Key("SAMLAssertion") - objectKey.String(*v.SAMLAssertion) - } - - return nil -} - -func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.Policy != nil { - objectKey := object.Key("Policy") - objectKey.String(*v.Policy) - } - - if v.PolicyArns != nil { - objectKey := object.Key("PolicyArns") - if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { - return err - } - } - - if v.ProviderId != nil { - objectKey := object.Key("ProviderId") - objectKey.String(*v.ProviderId) - } - - if v.RoleArn != nil { - objectKey := object.Key("RoleArn") - objectKey.String(*v.RoleArn) - } - - if v.RoleSessionName != nil { - objectKey := object.Key("RoleSessionName") - objectKey.String(*v.RoleSessionName) - } - - if v.WebIdentityToken != nil { - objectKey := object.Key("WebIdentityToken") - objectKey.String(*v.WebIdentityToken) - } - - return nil -} - -func awsAwsquery_serializeOpDocumentAssumeRootInput(v *AssumeRootInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.TargetPrincipal != nil { - objectKey := object.Key("TargetPrincipal") - objectKey.String(*v.TargetPrincipal) - } - - if v.TaskPolicyArn != nil { - objectKey := object.Key("TaskPolicyArn") - if err := awsAwsquery_serializeDocumentPolicyDescriptorType(v.TaskPolicyArn, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput, value query.Value) error { - object := value.Object() - _ = object - - if v.EncodedMessage != nil { - objectKey := object.Key("EncodedMessage") - objectKey.String(*v.EncodedMessage) - } - - return nil -} - -func awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(v *GetAccessKeyInfoInput, value query.Value) error { - object := value.Object() - _ = object - - if v.AccessKeyId != nil { - objectKey := object.Key("AccessKeyId") - objectKey.String(*v.AccessKeyId) - } - - return nil -} - -func awsAwsquery_serializeOpDocumentGetCallerIdentityInput(v *GetCallerIdentityInput, value query.Value) error { - object := value.Object() - _ = object - - return nil -} - -func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationTokenInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.Name != nil { - objectKey := object.Key("Name") - objectKey.String(*v.Name) - } - - if v.Policy != nil { - objectKey := object.Key("Policy") - objectKey.String(*v.Policy) - } - - if v.PolicyArns != nil { - objectKey := object.Key("PolicyArns") - if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { - return err - } - } - - if v.Tags != nil { - objectKey := object.Key("Tags") - if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { - return err - } - } - - return nil -} - -func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput, value query.Value) error { - object := value.Object() - _ = object - - if v.DurationSeconds != nil { - objectKey := object.Key("DurationSeconds") - objectKey.Integer(*v.DurationSeconds) - } - - if v.SerialNumber != nil { - objectKey := object.Key("SerialNumber") - objectKey.String(*v.SerialNumber) - } - - if v.TokenCode != nil { - objectKey := object.Key("TokenCode") - objectKey.String(*v.TokenCode) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go deleted file mode 100644 index 041629bba..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// The web identity token that was passed is expired or is not valid. Get a new -// identity token from the identity provider and then retry the request. -type ExpiredTokenException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ExpiredTokenException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ExpiredTokenException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ExpiredTokenException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ExpiredTokenException" - } - return *e.ErrorCodeOverride -} -func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The request could not be fulfilled because the identity provider (IDP) that was -// asked to verify the incoming identity token could not be reached. This is often -// a transient error caused by network conditions. Retry the request a limited -// number of times so that you don't exceed the request rate. If the error -// persists, the identity provider might be down or not responding. -type IDPCommunicationErrorException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *IDPCommunicationErrorException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *IDPCommunicationErrorException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *IDPCommunicationErrorException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "IDPCommunicationError" - } - return *e.ErrorCodeOverride -} -func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The identity provider (IdP) reported that authentication failed. This might be -// because the claim is invalid. -// -// If this error is returned for the AssumeRoleWithWebIdentity operation, it can -// also mean that the claim has expired or has been explicitly revoked. -type IDPRejectedClaimException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *IDPRejectedClaimException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *IDPRejectedClaimException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *IDPRejectedClaimException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "IDPRejectedClaim" - } - return *e.ErrorCodeOverride -} -func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The error returned if the message passed to DecodeAuthorizationMessage was -// invalid. This can happen if the token contains invalid characters, such as line -// breaks, or if the message has expired. -type InvalidAuthorizationMessageException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidAuthorizationMessageException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidAuthorizationMessageException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidAuthorizationMessageException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidAuthorizationMessageException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The web identity token that was passed could not be validated by Amazon Web -// Services. Get a new identity token from the identity provider and then retry the -// request. -type InvalidIdentityTokenException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidIdentityTokenException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidIdentityTokenException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidIdentityTokenException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidIdentityToken" - } - return *e.ErrorCodeOverride -} -func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -type MalformedPolicyDocumentException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *MalformedPolicyDocumentException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *MalformedPolicyDocumentException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *MalformedPolicyDocumentException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "MalformedPolicyDocument" - } - return *e.ErrorCodeOverride -} -func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An Amazon Web Services conversion -// compresses the session policy document, session policy ARNs, and session tags -// into a packed binary format that has a separate limit. The error message -// indicates by percentage how close the policies and tags are to the upper size -// limit. For more information, see [Passing Session Tags in STS]in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see [IAM and STS Entity Character Limits]in the IAM User Guide. -// -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -// [IAM and STS Entity Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length -type PackedPolicyTooLargeException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PackedPolicyTooLargeException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PackedPolicyTooLargeException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PackedPolicyTooLargeException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PackedPolicyTooLarge" - } - return *e.ErrorCodeOverride -} -func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see [Activating and Deactivating STS in an Amazon Web Services Region]in the IAM -// User Guide. -// -// [Activating and Deactivating STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html -type RegionDisabledException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *RegionDisabledException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *RegionDisabledException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *RegionDisabledException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "RegionDisabledException" - } - return *e.ErrorCodeOverride -} -func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go deleted file mode 100644 index dff7a3c2e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// The identifiers for the temporary security credentials that the operation -// returns. -type AssumedRoleUser struct { - - // The ARN of the temporary security credentials that are returned from the AssumeRole - // action. For more information about ARNs and how to use them in policies, see [IAM Identifiers]in - // the IAM User Guide. - // - // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html - // - // This member is required. - Arn *string - - // A unique identifier that contains the role ID and the role session name of the - // role that is being assumed. The role ID is generated by Amazon Web Services when - // the role is created. - // - // This member is required. - AssumedRoleId *string - - noSmithyDocumentSerde -} - -// Amazon Web Services credentials for API authentication. -type Credentials struct { - - // The access key ID that identifies the temporary security credentials. - // - // This member is required. - AccessKeyId *string - - // The date on which the current credentials expire. - // - // This member is required. - Expiration *time.Time - - // The secret access key that can be used to sign requests. - // - // This member is required. - SecretAccessKey *string - - // The token that users must pass to the service API to use the temporary - // credentials. - // - // This member is required. - SessionToken *string - - noSmithyDocumentSerde -} - -// Identifiers for the federated user that is associated with the credentials. -type FederatedUser struct { - - // The ARN that specifies the federated user that is associated with the - // credentials. For more information about ARNs and how to use them in policies, - // see [IAM Identifiers]in the IAM User Guide. - // - // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html - // - // This member is required. - Arn *string - - // The string that identifies the federated user associated with the credentials, - // similar to the unique ID of an IAM user. - // - // This member is required. - FederatedUserId *string - - noSmithyDocumentSerde -} - -// A reference to the IAM managed policy that is passed as a session policy for a -// role session or a federated user session. -type PolicyDescriptorType struct { - - // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session - // policy for the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web - // Services General Reference. - // - // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html - Arn *string - - noSmithyDocumentSerde -} - -// Contains information about the provided context. This includes the signed and -// encrypted trusted context assertion and the context provider ARN from which the -// trusted context assertion was generated. -type ProvidedContext struct { - - // The signed and encrypted trusted context assertion generated by the context - // provider. The trusted context assertion is signed and encrypted by Amazon Web - // Services STS. - ContextAssertion *string - - // The context provider ARN from which the trusted context assertion was generated. - ProviderArn *string - - noSmithyDocumentSerde -} - -// You can pass custom key-value pair attributes when you assume a role or -// federate a user. These are called session tags. You can then use the session -// tags to control access to resources. For more information, see [Tagging Amazon Web Services STS Sessions]in the IAM User -// Guide. -// -// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html -type Tag struct { - - // The key for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag keys can’t - // exceed 128 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User - // Guide. - // - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length - // - // This member is required. - Key *string - - // The value for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag values can’t - // exceed 256 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User - // Guide. - // - // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length - // - // This member is required. - Value *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go deleted file mode 100644 index 1026e2211..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go +++ /dev/null @@ -1,347 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sts - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/sts/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAssumeRole struct { -} - -func (*validateOpAssumeRole) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssumeRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssumeRoleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssumeRoleInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssumeRoleWithSAML struct { -} - -func (*validateOpAssumeRoleWithSAML) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssumeRoleWithSAML) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssumeRoleWithSAMLInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssumeRoleWithSAMLInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssumeRoleWithWebIdentity struct { -} - -func (*validateOpAssumeRoleWithWebIdentity) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssumeRoleWithWebIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssumeRoleWithWebIdentityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssumeRoot struct { -} - -func (*validateOpAssumeRoot) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssumeRoot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssumeRootInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssumeRootInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDecodeAuthorizationMessage struct { -} - -func (*validateOpDecodeAuthorizationMessage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDecodeAuthorizationMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DecodeAuthorizationMessageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDecodeAuthorizationMessageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetAccessKeyInfo struct { -} - -func (*validateOpGetAccessKeyInfo) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetAccessKeyInfo) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetAccessKeyInfoInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetAccessKeyInfoInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetFederationToken struct { -} - -func (*validateOpGetFederationToken) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetFederationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetFederationTokenInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetFederationTokenInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAssumeRoleValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssumeRole{}, middleware.After) -} - -func addOpAssumeRoleWithSAMLValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssumeRoleWithSAML{}, middleware.After) -} - -func addOpAssumeRoleWithWebIdentityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssumeRoleWithWebIdentity{}, middleware.After) -} - -func addOpAssumeRootValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssumeRoot{}, middleware.After) -} - -func addOpDecodeAuthorizationMessageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDecodeAuthorizationMessage{}, middleware.After) -} - -func addOpGetAccessKeyInfoValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetAccessKeyInfo{}, middleware.After) -} - -func addOpGetFederationTokenValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetFederationToken{}, middleware.After) -} - -func validateTag(v *types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "Tag"} - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) - } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTagListType(v []types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagListType"} - for i := range v { - if err := validateTag(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssumeRoleInput(v *AssumeRoleInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleInput"} - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if v.RoleSessionName == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName")) - } - if v.Tags != nil { - if err := validateTagListType(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithSAMLInput"} - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if v.SAMLAssertion == nil { - invalidParams.Add(smithy.NewErrParamRequired("SAMLAssertion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithWebIdentityInput"} - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if v.RoleSessionName == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName")) - } - if v.WebIdentityToken == nil { - invalidParams.Add(smithy.NewErrParamRequired("WebIdentityToken")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssumeRootInput(v *AssumeRootInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssumeRootInput"} - if v.TargetPrincipal == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetPrincipal")) - } - if v.TaskPolicyArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("TaskPolicyArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DecodeAuthorizationMessageInput"} - if v.EncodedMessage == nil { - invalidParams.Add(smithy.NewErrParamRequired("EncodedMessage")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetAccessKeyInfoInput(v *GetAccessKeyInfoInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetAccessKeyInfoInput"} - if v.AccessKeyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessKeyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetFederationTokenInput(v *GetFederationTokenInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetFederationTokenInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Tags != nil { - if err := validateTagListType(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/vendor/github.com/aws/smithy-go/.gitignore b/vendor/github.com/aws/smithy-go/.gitignore deleted file mode 100644 index 2518b3491..000000000 --- a/vendor/github.com/aws/smithy-go/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Eclipse -.classpath -.project -.settings/ - -# Intellij -.idea/ -*.iml -*.iws - -# Mac -.DS_Store - -# Maven -target/ -**/dependency-reduced-pom.xml - -# Gradle -/.gradle -build/ -*/out/ -*/*/out/ - -# VS Code -bin/ -.vscode/ - -# make -c.out diff --git a/vendor/github.com/aws/smithy-go/.travis.yml b/vendor/github.com/aws/smithy-go/.travis.yml deleted file mode 100644 index f8d1035cc..000000000 --- a/vendor/github.com/aws/smithy-go/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go -sudo: true -dist: bionic - -branches: - only: - - main - -os: - - linux - - osx - # Travis doesn't work with windows and Go tip - #- windows - -go: - - tip - -matrix: - allow_failures: - - go: tip - -before_install: - - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi - - (cd /tmp/; go get golang.org/x/lint/golint) - -script: - - make go test -v ./...; - diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md deleted file mode 100644 index 8b6ab2950..000000000 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ /dev/null @@ -1,330 +0,0 @@ -# Release (2025-08-27) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.23.0 - * **Feature**: Sort map keys in JSON Document types. - -# Release (2025-07-24) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.5 - * **Feature**: Add HTTP interceptors. - -# Release (2025-06-16) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.4 - * **Bug Fix**: Fix CBOR serd empty check for string and enum fields - * **Bug Fix**: Fix HTTP metrics data race. - * **Bug Fix**: Replace usages of deprecated ioutil package. - -# Release (2025-02-17) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.3 - * **Dependency Update**: Bump minimum Go version to 1.22 per our language support policy. - -# Release (2025-01-21) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.2 - * **Bug Fix**: Fix HTTP metrics data race. - * **Bug Fix**: Replace usages of deprecated ioutil package. - -# Release (2024-11-15) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.1 - * **Bug Fix**: Fix failure to replace URI path segments when their names overlap. - -# Release (2024-10-03) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.22.0 - * **Feature**: Add HTTP client metrics. - -# Release (2024-09-25) - -## Module Highlights -* `github.com/aws/smithy-go/aws-http-auth`: [v1.0.0](aws-http-auth/CHANGELOG.md#v100-2024-09-25) - * **Release**: Initial release of module aws-http-auth, which implements generically consumable SigV4 and SigV4a request signing. - -# Release (2024-09-19) - -## General Highlights -* **Dependency Update**: Updated to the latest SDK module versions - -## Module Highlights -* `github.com/aws/smithy-go`: v1.21.0 - * **Feature**: Add tracing and metrics APIs, and builtin instrumentation for both, in generated clients. -* `github.com/aws/smithy-go/metrics/smithyotelmetrics`: [v1.0.0](metrics/smithyotelmetrics/CHANGELOG.md#v100-2024-09-19) - * **Release**: Initial release of `smithyotelmetrics` module, which is used to adapt an OpenTelemetry SDK meter provider to be used with Smithy clients. -* `github.com/aws/smithy-go/tracing/smithyoteltracing`: [v1.0.0](tracing/smithyoteltracing/CHANGELOG.md#v100-2024-09-19) - * **Release**: Initial release of `smithyoteltracing` module, which is used to adapt an OpenTelemetry SDK tracer provider to be used with Smithy clients. - -# Release (2024-08-14) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.20.4 - * **Dependency Update**: Bump minimum Go version to 1.21. - -# Release (2024-06-27) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.20.3 - * **Bug Fix**: Fix encoding/cbor test overflow on x86. - -# Release (2024-03-29) - -* No change notes available for this release. - -# Release (2024-02-21) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.20.1 - * **Bug Fix**: Remove runtime dependency on go-cmp. - -# Release (2024-02-13) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.20.0 - * **Feature**: Add codegen definition for sigv4a trait. - * **Feature**: Bump minimum Go version to 1.20 per our language support policy. - -# Release (2023-12-07) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.19.0 - * **Feature**: Support modeled request compression. - -# Release (2023-11-30) - -* No change notes available for this release. - -# Release (2023-11-29) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.18.0 - * **Feature**: Expose Options() method on generated service clients. - -# Release (2023-11-15) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.17.0 - * **Feature**: Support identity/auth components of client reference architecture. - -# Release (2023-10-31) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.16.0 - * **Feature**: **LANG**: Bump minimum go version to 1.19. - -# Release (2023-10-06) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.15.0 - * **Feature**: Add `http.WithHeaderComment` middleware. - -# Release (2023-08-18) - -* No change notes available for this release. - -# Release (2023-08-07) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.14.1 - * **Bug Fix**: Prevent duplicated error returns in EndpointResolverV2 default implementation. - -# Release (2023-07-31) - -## General Highlights -* **Feature**: Adds support for smithy-modeled endpoint resolution. - -# Release (2022-12-02) - -* No change notes available for this release. - -# Release (2022-10-24) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.13.4 - * **Bug Fix**: fixed document type checking for encoding nested types - -# Release (2022-09-14) - -* No change notes available for this release. - -# Release (v1.13.2) - -* No change notes available for this release. - -# Release (v1.13.1) - -* No change notes available for this release. - -# Release (v1.13.0) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.13.0 - * **Feature**: Adds support for the Smithy httpBearerAuth authentication trait to smithy-go. This allows the SDK to support the bearer authentication flow for API operations decorated with httpBearerAuth. An API client will need to be provided with its own bearer.TokenProvider implementation or use the bearer.StaticTokenProvider implementation. - -# Release (v1.12.1) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.12.1 - * **Bug Fix**: Fixes a bug where JSON object keys were not escaped. - -# Release (v1.12.0) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.12.0 - * **Feature**: `transport/http`: Add utility for setting context metadata when operation serializer automatically assigns content-type default value. - -# Release (v1.11.3) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.11.3 - * **Dependency Update**: Updates smithy-go unit test dependency go-cmp to 0.5.8. - -# Release (v1.11.2) - -* No change notes available for this release. - -# Release (v1.11.1) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.11.1 - * **Bug Fix**: Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. Related to [aws/aws-sdk-go-v2#1583](https://github.com/aws/aws-sdk-go-v2/issues/1583) - -# Release (v1.11.0) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.11.0 - * **Feature**: Updates deserialization of header list to supported quoted strings - -# Release (v1.10.0) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.10.0 - * **Feature**: Add `ptr.Duration`, `ptr.ToDuration`, `ptr.DurationSlice`, `ptr.ToDurationSlice`, `ptr.DurationMap`, and `ptr.ToDurationMap` functions for the `time.Duration` type. - -# Release (v1.9.1) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.9.1 - * **Documentation**: Fixes various typos in Go package documentation. - -# Release (v1.9.0) - -## Module Highlights -* `github.com/aws/smithy-go`: v1.9.0 - * **Feature**: sync: OnceErr, can be used to concurrently record a signal when an error has occurred. - * **Bug Fix**: `transport/http`: CloseResponseBody and ErrorCloseResponseBody middleware have been updated to ensure that the body is fully drained before closing. - -# Release v1.8.1 - -### Smithy Go Module -* **Bug Fix**: Fixed an issue that would cause the HTTP Content-Length to be set to 0 if the stream body was not set. - * Fixes [aws/aws-sdk-go-v2#1418](https://github.com/aws/aws-sdk-go-v2/issues/1418) - -# Release v1.8.0 - -### Smithy Go Module - -* `time`: Add support for parsing additional DateTime timestamp format ([#324](https://github.com/aws/smithy-go/pull/324)) - * Adds support for parsing DateTime timestamp formatted time similar to RFC 3339, but without the `Z` character, nor UTC offset. - * Fixes [#1387](https://github.com/aws/aws-sdk-go-v2/issues/1387) - -# Release v1.7.0 - -### Smithy Go Module -* `ptr`: Handle error for deferred file close call ([#314](https://github.com/aws/smithy-go/pull/314)) - * Handle error for defer close call -* `middleware`: Add Clone to Metadata ([#318](https://github.com/aws/smithy-go/pull/318)) - * Adds a new Clone method to the middleware Metadata type. This provides a shallow clone of the entries in the Metadata. -* `document`: Add new package for document shape serialization support ([#310](https://github.com/aws/smithy-go/pull/310)) - -### Codegen -* Add Smithy Document Shape Support ([#310](https://github.com/aws/smithy-go/pull/310)) - * Adds support for Smithy Document shapes and supporting types for protocols to implement support - -# Release v1.6.0 (2021-07-15) - -### Smithy Go Module -* `encoding/httpbinding`: Support has been added for encoding `float32` and `float64` values that are `NaN`, `Infinity`, or `-Infinity`. ([#316](https://github.com/aws/smithy-go/pull/316)) - -### Codegen -* Adds support for handling `float32` and `float64` `NaN` values in HTTP Protocol Unit Tests. ([#316](https://github.com/aws/smithy-go/pull/316)) -* Adds support protocol generator implementations to override the error code string returned by `ErrorCode` methods on generated error types. ([#315](https://github.com/aws/smithy-go/pull/315)) - -# Release v1.5.0 (2021-06-25) - -### Smithy Go module -* `time`: Update time parsing to not be as strict for HTTPDate and DateTime ([#307](https://github.com/aws/smithy-go/pull/307)) - * Fixes [#302](https://github.com/aws/smithy-go/issues/302) by changing time to UTC before formatting so no local offset time is lost. - -### Codegen -* Adds support for integrating client members via plugins ([#301](https://github.com/aws/smithy-go/pull/301)) -* Fix serialization of enum types marked with payload trait ([#296](https://github.com/aws/smithy-go/pull/296)) -* Update generation of API client modules to include a manifest of files generated ([#283](https://github.com/aws/smithy-go/pull/283)) -* Update Group Java group ID for smithy-go generator ([#298](https://github.com/aws/smithy-go/pull/298)) -* Support the delegation of determining the errors that can occur for an operation ([#304](https://github.com/aws/smithy-go/pull/304)) -* Support for marking and documenting deprecated client config fields. ([#303](https://github.com/aws/smithy-go/pull/303)) - -# Release v1.4.0 (2021-05-06) - -### Smithy Go module -* `encoding/xml`: Fix escaping of Next Line and Line Start in XML Encoder ([#267](https://github.com/aws/smithy-go/pull/267)) - -### Codegen -* Add support for Smithy 1.7 ([#289](https://github.com/aws/smithy-go/pull/289)) -* Add support for httpQueryParams location -* Add support for model renaming conflict resolution with service closure - -# Release v1.3.1 (2021-04-08) - -### Smithy Go module -* `transport/http`: Loosen endpoint hostname validation to allow specifying port numbers. ([#279](https://github.com/aws/smithy-go/pull/279)) -* `io`: Fix RingBuffer panics due to out of bounds index. ([#282](https://github.com/aws/smithy-go/pull/282)) - -# Release v1.3.0 (2021-04-01) - -### Smithy Go module -* `transport/http`: Add utility to safely join string to url path, and url raw query. - -### Codegen -* Update HttpBindingProtocolGenerator to use http/transport JoinPath and JoinQuery utility. - -# Release v1.2.0 (2021-03-12) - -### Smithy Go module -* Fix support for parsing shortened year format in HTTP Date header. -* Fix GitHub APIDiff action workflow to get gorelease tool correctly. -* Fix codegen artifact unit test for Go 1.16 - -### Codegen -* Fix generating paginator nil parameter handling before usage. -* Fix Serialize unboxed members decorated as required. -* Add ability to define resolvers at both client construction and operation invocation. -* Support for extending paginators with custom runtime trait diff --git a/vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.md b/vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.md deleted file mode 100644 index 5b627cfa6..000000000 --- a/vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,4 +0,0 @@ -## Code of Conduct -This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). -For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact -opensource-codeofconduct@amazon.com with any additional questions or comments. diff --git a/vendor/github.com/aws/smithy-go/CONTRIBUTING.md b/vendor/github.com/aws/smithy-go/CONTRIBUTING.md deleted file mode 100644 index 1f8d01ff6..000000000 --- a/vendor/github.com/aws/smithy-go/CONTRIBUTING.md +++ /dev/null @@ -1,90 +0,0 @@ -# Contributing Guidelines - -Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional -documentation, we greatly value feedback and contributions from our community. - -Please read through this document before submitting any issues or pull requests to ensure we have all the necessary -information to effectively respond to your bug report or contribution. - - -## Reporting Bugs/Feature Requests - -We welcome you to use the GitHub issue tracker to report bugs or suggest features. - -When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already -reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: - -* A reproducible test case or series of steps -* The version of our code being used -* Any modifications you've made relevant to the bug -* Anything unusual about your environment or deployment - - -## Contributing via Pull Requests -Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: - -1. You are working against the latest source on the *main* branch. -2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. -3. You open an issue to discuss any significant work - we would hate for your time to be wasted. - -To send us a pull request, please: - -1. Fork the repository. -2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. -3. Ensure local tests pass. -4. Commit to your fork using clear commit messages. -5. Send us a pull request, answering any default questions in the pull request interface. -6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. - -GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and -[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). - -### Changelog Documents - -(You can SKIP this step if you are only changing the code generator, and not the runtime). - -When submitting a pull request please include a changelog file on a folder named `.changelog`. -These are used to generate the content `CHANGELOG.md` and Release Notes. The format of the file is as follows: - -``` -{ - "id": "12345678-1234-1234-1234-123456789012" - "type": "bugfix" - "collapse": true - "description": "Fix improper use of printf-style functions.", - "modules": [ - "." - ] -} -``` - -* id: a UUID. This should also be used for the name of the file, so if your id is `12345678-1234-1234-1234-123456789012` the file should be named `12345678-1234-1234-1234-123456789012.json/` -* type: one of the following: - * bugfix: Fixing an existing bug - * Feature: Adding a new feature to an existing service - * Release: Releasing a new module - * Dependency: Updating dependencies - * Announcement: Making an announcement, like deprecation of a module -* collapse: whether this change should appear separately on the release notes on every module listed on `modules` (`"collapse": false`), or if it should show up as a single entry (`"collapse": true`) - * For the smithy-go repository this should always be `false` -* description: Description of this change. Most of the times is the same as the title of the PR -* modules: which Go modules does this change impact. The root module is expressed as "." - - -## Finding contributions to work on -Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. - - -## Code of Conduct -This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). -For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact -opensource-codeofconduct@amazon.com with any additional questions or comments. - - -## Security issue notifications -If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. - - -## Licensing - -See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. diff --git a/vendor/github.com/aws/smithy-go/LICENSE b/vendor/github.com/aws/smithy-go/LICENSE deleted file mode 100644 index 67db85882..000000000 --- a/vendor/github.com/aws/smithy-go/LICENSE +++ /dev/null @@ -1,175 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/aws/smithy-go/Makefile b/vendor/github.com/aws/smithy-go/Makefile deleted file mode 100644 index 34b17ab2f..000000000 --- a/vendor/github.com/aws/smithy-go/Makefile +++ /dev/null @@ -1,125 +0,0 @@ -PRE_RELEASE_VERSION ?= - -RELEASE_MANIFEST_FILE ?= -RELEASE_CHGLOG_DESC_FILE ?= - -REPOTOOLS_VERSION ?= latest -REPOTOOLS_MODULE = github.com/awslabs/aws-go-multi-module-repository-tools -REPOTOOLS_CMD_CALCULATE_RELEASE = ${REPOTOOLS_MODULE}/cmd/calculaterelease@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS ?= -REPOTOOLS_CMD_UPDATE_REQUIRES = ${REPOTOOLS_MODULE}/cmd/updaterequires@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_UPDATE_MODULE_METADATA = ${REPOTOOLS_MODULE}/cmd/updatemodulemeta@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION} -REPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION} - -UNIT_TEST_TAGS= -BUILD_TAGS= - -ifneq ($(PRE_RELEASE_VERSION),) - REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION} -endif - -smithy-publish-local: - cd codegen && ./gradlew publishToMavenLocal - -smithy-build: - cd codegen && ./gradlew build - -smithy-clean: - cd codegen && ./gradlew clean - -GRADLE_RETRIES := 3 -GRADLE_SLEEP := 2 - -# We're making a call to ./gradlew to trigger downloading Gradle and -# starting the daemon. Any call works, so using `./gradlew help` -ensure-gradle-up: - @cd codegen && for i in $(shell seq 1 $(GRADLE_RETRIES)); do \ - echo "Checking if Gradle daemon is up, attempt $$i..."; \ - if ./gradlew help; then \ - echo "Gradle daemon is up!"; \ - exit 0; \ - fi; \ - echo "Failed to start Gradle, retrying in $(GRADLE_SLEEP) seconds..."; \ - sleep $(GRADLE_SLEEP); \ - done; \ - echo "Failed to start Gradle after $(GRADLE_RETRIES) attempts."; \ - exit 1 - -################## -# Linting/Verify # -################## -.PHONY: verify vet cover - -verify: vet - -vet: - go vet ${BUILD_TAGS} --all ./... - -cover: - go test ${BUILD_TAGS} -coverprofile c.out ./... - @cover=`go tool cover -func c.out | grep '^total:' | awk '{ print $$3+0 }'`; \ - echo "total (statements): $$cover%"; - -################ -# Unit Testing # -################ -.PHONY: unit unit-race unit-test unit-race-test - -unit: verify - go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ - go test -timeout=1m ${UNIT_TEST_TAGS} ./... - -unit-race: verify - go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ - go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... - -unit-test: verify - go test -timeout=1m ${UNIT_TEST_TAGS} ./... - -unit-race-test: verify - go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... - -##################### -# Release Process # -##################### -.PHONY: preview-release pre-release-validation release - -preview-release: - go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS} - -pre-release-validation: - @if [[ -z "${RELEASE_MANIFEST_FILE}" ]]; then \ - echo "RELEASE_MANIFEST_FILE is required to specify the file to write the release manifest" && false; \ - fi - @if [[ -z "${RELEASE_CHGLOG_DESC_FILE}" ]]; then \ - echo "RELEASE_CHGLOG_DESC_FILE is required to specify the file to write the release notes" && false; \ - fi - -release: pre-release-validation - go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} -o ${RELEASE_MANIFEST_FILE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS} - go run ${REPOTOOLS_CMD_UPDATE_REQUIRES} -release ${RELEASE_MANIFEST_FILE} - go run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} -release ${RELEASE_MANIFEST_FILE} - go run ${REPOTOOLS_CMD_GENERATE_CHANGELOG} -release ${RELEASE_MANIFEST_FILE} -o ${RELEASE_CHGLOG_DESC_FILE} - go run ${REPOTOOLS_CMD_CHANGELOG} rm -all - go run ${REPOTOOLS_CMD_TAG_RELEASE} -release ${RELEASE_MANIFEST_FILE} - -module-version: - @go run ${REPOTOOLS_CMD_MODULE_VERSION} . - -############## -# Repo Tools # -############## -.PHONY: install-changelog - -external-changelog: - mkdir -p .changelog - cp changelog-template.json .changelog/00000000-0000-0000-0000-000000000000.json - @echo "Generate a new UUID and update the file at .changelog/00000000-0000-0000-0000-000000000000.json" - @echo "Make sure to rename the file with your new id, like .changelog/12345678-1234-1234-1234-123456789012.json" - @echo "See CONTRIBUTING.md 'Changelog Documents' and an example at https://github.com/aws/smithy-go/pull/543/files" - -install-changelog: - go install ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} diff --git a/vendor/github.com/aws/smithy-go/NOTICE b/vendor/github.com/aws/smithy-go/NOTICE deleted file mode 100644 index 616fc5889..000000000 --- a/vendor/github.com/aws/smithy-go/NOTICE +++ /dev/null @@ -1 +0,0 @@ -Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md deleted file mode 100644 index 77a74ae0c..000000000 --- a/vendor/github.com/aws/smithy-go/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# Smithy Go - -[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml) - -[Smithy](https://smithy.io/) code generators for Go and the accompanying smithy-go runtime. - -The smithy-go runtime requires a minimum version of Go 1.22. - -**WARNING: All interfaces are subject to change.** - -## :no_entry_sign: DO NOT use the code generators in this repository - -**The code generators in this repository do not generate working clients at -this time.** - -In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java), -such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html), -in order to generate transport mechanisms and serialization/deserialization -code ("serde") accordingly. - -The code generator does not currently support any protocols out of the box. -Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) -exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are -tracking the movement of those out of the SDK into smithy-go in -[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no -timeline for doing so. - -## Plugins - -This repository implements the following Smithy build plugins: - -| ID | GAV prefix | Description | -|----|------------|-------------| -| `go-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go client code generation for Smithy models. | -| `go-server-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go server code generation for Smithy models. | -| `go-shape-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go shape code generation (types only) for Smithy models. | - -**NOTE: Build plugins are not currently published to mavenCentral. You must publish to mavenLocal to make the build plugins visible to the Smithy CLI. The artifact version is currently fixed at 0.1.0.** - -## `go-codegen` - -### Configuration - -[`GoSettings`](codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java) -contains all of the settings enabled from `smithy-build.json` and helper -methods and types. The up-to-date list of top-level properties enabled for -`go-client-codegen` can be found in `GoSettings::from()`. - -| Setting | Type | Required | Description | -|-----------------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------| -| `service` | string | yes | The Shape ID of the service for which to generate the client. | -| `module` | string | yes | Name of the module in `generated.json` (and `go.mod` if `generateGoMod` is enabled) and `doc.go`. | -| `generateGoMod` | boolean | | Whether to generate a default `go.mod` file. The default value is `false`. | -| `goDirective` | string | | [Go directive](https://go.dev/ref/mod#go-mod-file-go) of the module. The default value is the minimum supported Go version. | - -### Supported protocols - -| Protocol | Notes | -|----------|-------| -| [`smithy.protocols#rpcv2Cbor`](https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html) | Event streaming not yet implemented. | - -### Example - -This example applies the `go-codegen` build plugin to the Smithy quickstart -example created from `smithy init`: - -```json -{ - "version": "1.0", - "sources": [ - "models" - ], - "maven": { - "dependencies": [ - "software.amazon.smithy.go:smithy-go-codegen:0.1.0" - ] - }, - "plugins": { - "go-codegen": { - "service": "example.weather#Weather", - "module": "github.com/example/weather", - "generateGoMod": true, - "goDirective": "1.22" - } - } -} -``` - -## `go-server-codegen` - -This plugin is a work-in-progress and is currently undocumented. - -## `go-shape-codegen` - -This plugin is a work-in-progress and is currently undocumented. - -## License - -This project is licensed under the Apache-2.0 License. - diff --git a/vendor/github.com/aws/smithy-go/auth/auth.go b/vendor/github.com/aws/smithy-go/auth/auth.go deleted file mode 100644 index 5bdb70c9a..000000000 --- a/vendor/github.com/aws/smithy-go/auth/auth.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package auth defines protocol-agnostic authentication types for smithy -// clients. -package auth diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/docs.go b/vendor/github.com/aws/smithy-go/auth/bearer/docs.go deleted file mode 100644 index 1c9b9715c..000000000 --- a/vendor/github.com/aws/smithy-go/auth/bearer/docs.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package bearer provides middleware and utilities for authenticating API -// operation calls with a Bearer Token. -package bearer diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go b/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go deleted file mode 100644 index 8c7d72099..000000000 --- a/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go +++ /dev/null @@ -1,104 +0,0 @@ -package bearer - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Message is the middleware stack's request transport message value. -type Message interface{} - -// Signer provides an interface for implementations to decorate a request -// message with a bearer token. The signer is responsible for validating the -// message type is compatible with the signer. -type Signer interface { - SignWithBearerToken(context.Context, Token, Message) (Message, error) -} - -// AuthenticationMiddleware provides the Finalize middleware step for signing -// an request message with a bearer token. -type AuthenticationMiddleware struct { - signer Signer - tokenProvider TokenProvider -} - -// AddAuthenticationMiddleware helper adds the AuthenticationMiddleware to the -// middleware Stack in the Finalize step with the options provided. -func AddAuthenticationMiddleware(s *middleware.Stack, signer Signer, tokenProvider TokenProvider) error { - return s.Finalize.Add( - NewAuthenticationMiddleware(signer, tokenProvider), - middleware.After, - ) -} - -// NewAuthenticationMiddleware returns an initialized AuthenticationMiddleware. -func NewAuthenticationMiddleware(signer Signer, tokenProvider TokenProvider) *AuthenticationMiddleware { - return &AuthenticationMiddleware{ - signer: signer, - tokenProvider: tokenProvider, - } -} - -const authenticationMiddlewareID = "BearerTokenAuthentication" - -// ID returns the resolver identifier -func (m *AuthenticationMiddleware) ID() string { - return authenticationMiddlewareID -} - -// HandleFinalize implements the FinalizeMiddleware interface in order to -// update the request with bearer token authentication. -func (m *AuthenticationMiddleware) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - token, err := m.tokenProvider.RetrieveBearerToken(ctx) - if err != nil { - return out, metadata, fmt.Errorf("failed AuthenticationMiddleware wrap message, %w", err) - } - - signedMessage, err := m.signer.SignWithBearerToken(ctx, token, in.Request) - if err != nil { - return out, metadata, fmt.Errorf("failed AuthenticationMiddleware sign message, %w", err) - } - - in.Request = signedMessage - return next.HandleFinalize(ctx, in) -} - -// SignHTTPSMessage provides a bearer token authentication implementation that -// will sign the message with the provided bearer token. -// -// Will fail if the message is not a smithy-go HTTP request or the request is -// not HTTPS. -type SignHTTPSMessage struct{} - -// NewSignHTTPSMessage returns an initialized signer for HTTP messages. -func NewSignHTTPSMessage() *SignHTTPSMessage { - return &SignHTTPSMessage{} -} - -// SignWithBearerToken returns a copy of the HTTP request with the bearer token -// added via the "Authorization" header, per RFC 6750, https://datatracker.ietf.org/doc/html/rfc6750. -// -// Returns an error if the request's URL scheme is not HTTPS, or the request -// message is not an smithy-go HTTP Request pointer type. -func (SignHTTPSMessage) SignWithBearerToken(ctx context.Context, token Token, message Message) (Message, error) { - req, ok := message.(*smithyhttp.Request) - if !ok { - return nil, fmt.Errorf("expect smithy-go HTTP Request, got %T", message) - } - - if !req.IsHTTPS() { - return nil, fmt.Errorf("bearer token with HTTP request requires HTTPS") - } - - reqClone := req.Clone() - reqClone.Header.Set("Authorization", "Bearer "+token.Value) - - return reqClone, nil -} diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/token.go b/vendor/github.com/aws/smithy-go/auth/bearer/token.go deleted file mode 100644 index be260d4c7..000000000 --- a/vendor/github.com/aws/smithy-go/auth/bearer/token.go +++ /dev/null @@ -1,50 +0,0 @@ -package bearer - -import ( - "context" - "time" -) - -// Token provides a type wrapping a bearer token and expiration metadata. -type Token struct { - Value string - - CanExpire bool - Expires time.Time -} - -// Expired returns if the token's Expires time is before or equal to the time -// provided. If CanExpires is false, Expired will always return false. -func (t Token) Expired(now time.Time) bool { - if !t.CanExpire { - return false - } - now = now.Round(0) - return now.Equal(t.Expires) || now.After(t.Expires) -} - -// TokenProvider provides interface for retrieving bearer tokens. -type TokenProvider interface { - RetrieveBearerToken(context.Context) (Token, error) -} - -// TokenProviderFunc provides a helper utility to wrap a function as a type -// that implements the TokenProvider interface. -type TokenProviderFunc func(context.Context) (Token, error) - -// RetrieveBearerToken calls the wrapped function, returning the Token or -// error. -func (fn TokenProviderFunc) RetrieveBearerToken(ctx context.Context) (Token, error) { - return fn(ctx) -} - -// StaticTokenProvider provides a utility for wrapping a static bearer token -// value within an implementation of a token provider. -type StaticTokenProvider struct { - Token Token -} - -// RetrieveBearerToken returns the static token specified. -func (s StaticTokenProvider) RetrieveBearerToken(context.Context) (Token, error) { - return s.Token, nil -} diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go b/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go deleted file mode 100644 index 223ddf52b..000000000 --- a/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go +++ /dev/null @@ -1,208 +0,0 @@ -package bearer - -import ( - "context" - "fmt" - "sync/atomic" - "time" - - smithycontext "github.com/aws/smithy-go/context" - "github.com/aws/smithy-go/internal/sync/singleflight" -) - -// package variable that can be override in unit tests. -var timeNow = time.Now - -// TokenCacheOptions provides a set of optional configuration options for the -// TokenCache TokenProvider. -type TokenCacheOptions struct { - // The duration before the token will expire when the credentials will be - // refreshed. If DisableAsyncRefresh is true, the RetrieveBearerToken calls - // will be blocking. - // - // Asynchronous refreshes are deduplicated, and only one will be in-flight - // at a time. If the token expires while an asynchronous refresh is in - // flight, the next call to RetrieveBearerToken will block on that refresh - // to return. - RefreshBeforeExpires time.Duration - - // The timeout the underlying TokenProvider's RetrieveBearerToken call must - // return within, or will be canceled. Defaults to 0, no timeout. - // - // If 0 timeout, its possible for the underlying tokenProvider's - // RetrieveBearerToken call to block forever. Preventing subsequent - // TokenCache attempts to refresh the token. - // - // If this timeout is reached all pending deduplicated calls to - // TokenCache RetrieveBearerToken will fail with an error. - RetrieveBearerTokenTimeout time.Duration - - // The minimum duration between asynchronous refresh attempts. If the next - // asynchronous recent refresh attempt was within the minimum delay - // duration, the call to retrieve will return the current cached token, if - // not expired. - // - // The asynchronous retrieve is deduplicated across multiple calls when - // RetrieveBearerToken is called. The asynchronous retrieve is not a - // periodic task. It is only performed when the token has not yet expired, - // and the current item is within the RefreshBeforeExpires window, and the - // TokenCache's RetrieveBearerToken method is called. - // - // If 0, (default) there will be no minimum delay between asynchronous - // refresh attempts. - // - // If DisableAsyncRefresh is true, this option is ignored. - AsyncRefreshMinimumDelay time.Duration - - // Sets if the TokenCache will attempt to refresh the token in the - // background asynchronously instead of blocking for credentials to be - // refreshed. If disabled token refresh will be blocking. - // - // The first call to RetrieveBearerToken will always be blocking, because - // there is no cached token. - DisableAsyncRefresh bool -} - -// TokenCache provides an utility to cache Bearer Authentication tokens from a -// wrapped TokenProvider. The TokenCache can be has options to configure the -// cache's early and asynchronous refresh of the token. -type TokenCache struct { - options TokenCacheOptions - provider TokenProvider - - cachedToken atomic.Value - lastRefreshAttemptTime atomic.Value - sfGroup singleflight.Group -} - -// NewTokenCache returns a initialized TokenCache that implements the -// TokenProvider interface. Wrapping the provider passed in. Also taking a set -// of optional functional option parameters to configure the token cache. -func NewTokenCache(provider TokenProvider, optFns ...func(*TokenCacheOptions)) *TokenCache { - var options TokenCacheOptions - for _, fn := range optFns { - fn(&options) - } - - return &TokenCache{ - options: options, - provider: provider, - } -} - -// RetrieveBearerToken returns the token if it could be obtained, or error if a -// valid token could not be retrieved. -// -// The passed in Context's cancel/deadline/timeout will impacting only this -// individual retrieve call and not any other already queued up calls. This -// means underlying provider's RetrieveBearerToken calls could block for ever, -// and not be canceled with the Context. Set RetrieveBearerTokenTimeout to -// provide a timeout, preventing the underlying TokenProvider blocking forever. -// -// By default, if the passed in Context is canceled, all of its values will be -// considered expired. The wrapped TokenProvider will not be able to lookup the -// values from the Context once it is expired. This is done to protect against -// expired values no longer being valid. To disable this behavior, use -// smithy-go's context.WithPreserveExpiredValues to add a value to the Context -// before calling RetrieveBearerToken to enable support for expired values. -// -// Without RetrieveBearerTokenTimeout there is the potential for a underlying -// Provider's RetrieveBearerToken call to sit forever. Blocking in subsequent -// attempts at refreshing the token. -func (p *TokenCache) RetrieveBearerToken(ctx context.Context) (Token, error) { - cachedToken, ok := p.getCachedToken() - if !ok || cachedToken.Expired(timeNow()) { - return p.refreshBearerToken(ctx) - } - - // Check if the token should be refreshed before it expires. - refreshToken := cachedToken.Expired(timeNow().Add(p.options.RefreshBeforeExpires)) - if !refreshToken { - return cachedToken, nil - } - - if p.options.DisableAsyncRefresh { - return p.refreshBearerToken(ctx) - } - - p.tryAsyncRefresh(ctx) - - return cachedToken, nil -} - -// tryAsyncRefresh attempts to asynchronously refresh the token returning the -// already cached token. If it AsyncRefreshMinimumDelay option is not zero, and -// the duration since the last refresh is less than that value, nothing will be -// done. -func (p *TokenCache) tryAsyncRefresh(ctx context.Context) { - if p.options.AsyncRefreshMinimumDelay != 0 { - var lastRefreshAttempt time.Time - if v := p.lastRefreshAttemptTime.Load(); v != nil { - lastRefreshAttempt = v.(time.Time) - } - - if timeNow().Before(lastRefreshAttempt.Add(p.options.AsyncRefreshMinimumDelay)) { - return - } - } - - // Ignore the returned channel so this won't be blocking, and limit the - // number of additional goroutines created. - p.sfGroup.DoChan("async-refresh", func() (interface{}, error) { - res, err := p.refreshBearerToken(ctx) - if p.options.AsyncRefreshMinimumDelay != 0 { - var refreshAttempt time.Time - if err != nil { - refreshAttempt = timeNow() - } - p.lastRefreshAttemptTime.Store(refreshAttempt) - } - - return res, err - }) -} - -func (p *TokenCache) refreshBearerToken(ctx context.Context) (Token, error) { - resCh := p.sfGroup.DoChan("refresh-token", func() (interface{}, error) { - ctx := smithycontext.WithSuppressCancel(ctx) - if v := p.options.RetrieveBearerTokenTimeout; v != 0 { - var cancel func() - ctx, cancel = context.WithTimeout(ctx, v) - defer cancel() - } - return p.singleRetrieve(ctx) - }) - - select { - case res := <-resCh: - return res.Val.(Token), res.Err - case <-ctx.Done(): - return Token{}, fmt.Errorf("retrieve bearer token canceled, %w", ctx.Err()) - } -} - -func (p *TokenCache) singleRetrieve(ctx context.Context) (interface{}, error) { - token, err := p.provider.RetrieveBearerToken(ctx) - if err != nil { - return Token{}, fmt.Errorf("failed to retrieve bearer token, %w", err) - } - - p.cachedToken.Store(&token) - return token, nil -} - -// getCachedToken returns the currently cached token and true if found. Returns -// false if no token is cached. -func (p *TokenCache) getCachedToken() (Token, bool) { - v := p.cachedToken.Load() - if v == nil { - return Token{}, false - } - - t := v.(*Token) - if t == nil || t.Value == "" { - return Token{}, false - } - - return *t, true -} diff --git a/vendor/github.com/aws/smithy-go/auth/identity.go b/vendor/github.com/aws/smithy-go/auth/identity.go deleted file mode 100644 index ba8cf70d4..000000000 --- a/vendor/github.com/aws/smithy-go/auth/identity.go +++ /dev/null @@ -1,47 +0,0 @@ -package auth - -import ( - "context" - "time" - - "github.com/aws/smithy-go" -) - -// Identity contains information that identifies who the user making the -// request is. -type Identity interface { - Expiration() time.Time -} - -// IdentityResolver defines the interface through which an Identity is -// retrieved. -type IdentityResolver interface { - GetIdentity(context.Context, smithy.Properties) (Identity, error) -} - -// IdentityResolverOptions defines the interface through which an entity can be -// queried to retrieve an IdentityResolver for a given auth scheme. -type IdentityResolverOptions interface { - GetIdentityResolver(schemeID string) IdentityResolver -} - -// AnonymousIdentity is a sentinel to indicate no identity. -type AnonymousIdentity struct{} - -var _ Identity = (*AnonymousIdentity)(nil) - -// Expiration returns the zero value for time, as anonymous identity never -// expires. -func (*AnonymousIdentity) Expiration() time.Time { - return time.Time{} -} - -// AnonymousIdentityResolver returns AnonymousIdentity. -type AnonymousIdentityResolver struct{} - -var _ IdentityResolver = (*AnonymousIdentityResolver)(nil) - -// GetIdentity returns AnonymousIdentity. -func (*AnonymousIdentityResolver) GetIdentity(_ context.Context, _ smithy.Properties) (Identity, error) { - return &AnonymousIdentity{}, nil -} diff --git a/vendor/github.com/aws/smithy-go/auth/option.go b/vendor/github.com/aws/smithy-go/auth/option.go deleted file mode 100644 index d5dabff04..000000000 --- a/vendor/github.com/aws/smithy-go/auth/option.go +++ /dev/null @@ -1,25 +0,0 @@ -package auth - -import "github.com/aws/smithy-go" - -type ( - authOptionsKey struct{} -) - -// Option represents a possible authentication method for an operation. -type Option struct { - SchemeID string - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -// GetAuthOptions gets auth Options from Properties. -func GetAuthOptions(p *smithy.Properties) ([]*Option, bool) { - v, ok := p.Get(authOptionsKey{}).([]*Option) - return v, ok -} - -// SetAuthOptions sets auth Options on Properties. -func SetAuthOptions(p *smithy.Properties, options []*Option) { - p.Set(authOptionsKey{}, options) -} diff --git a/vendor/github.com/aws/smithy-go/auth/scheme_id.go b/vendor/github.com/aws/smithy-go/auth/scheme_id.go deleted file mode 100644 index fb6a57c64..000000000 --- a/vendor/github.com/aws/smithy-go/auth/scheme_id.go +++ /dev/null @@ -1,20 +0,0 @@ -package auth - -// Anonymous -const ( - SchemeIDAnonymous = "smithy.api#noAuth" -) - -// HTTP auth schemes -const ( - SchemeIDHTTPBasic = "smithy.api#httpBasicAuth" - SchemeIDHTTPDigest = "smithy.api#httpDigestAuth" - SchemeIDHTTPBearer = "smithy.api#httpBearerAuth" - SchemeIDHTTPAPIKey = "smithy.api#httpApiKeyAuth" -) - -// AWS auth schemes -const ( - SchemeIDSigV4 = "aws.auth#sigv4" - SchemeIDSigV4A = "aws.auth#sigv4a" -) diff --git a/vendor/github.com/aws/smithy-go/changelog-template.json b/vendor/github.com/aws/smithy-go/changelog-template.json deleted file mode 100644 index d36e2b3e1..000000000 --- a/vendor/github.com/aws/smithy-go/changelog-template.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "00000000-0000-0000-0000-000000000000", - "type": "feature|bugfix|dependency", - "description": "Description of your changes", - "collapse": false, - "modules": [ - "." - ] -} diff --git a/vendor/github.com/aws/smithy-go/context/suppress_expired.go b/vendor/github.com/aws/smithy-go/context/suppress_expired.go deleted file mode 100644 index a39b84a27..000000000 --- a/vendor/github.com/aws/smithy-go/context/suppress_expired.go +++ /dev/null @@ -1,81 +0,0 @@ -package context - -import "context" - -// valueOnlyContext provides a utility to preserve only the values of a -// Context. Suppressing any cancellation or deadline on that context being -// propagated downstream of this value. -// -// If preserveExpiredValues is false (default), and the valueCtx is canceled, -// calls to lookup values with the Values method, will always return nil. Setting -// preserveExpiredValues to true, will allow the valueOnlyContext to lookup -// values in valueCtx even if valueCtx is canceled. -// -// Based on the Go standard libraries net/lookup.go onlyValuesCtx utility. -// https://github.com/golang/go/blob/da2773fe3e2f6106634673a38dc3a6eb875fe7d8/src/net/lookup.go -type valueOnlyContext struct { - context.Context - - preserveExpiredValues bool - valuesCtx context.Context -} - -var _ context.Context = (*valueOnlyContext)(nil) - -// Value looks up the key, returning its value. If configured to not preserve -// values of expired context, and the wrapping context is canceled, nil will be -// returned. -func (v *valueOnlyContext) Value(key interface{}) interface{} { - if !v.preserveExpiredValues { - select { - case <-v.valuesCtx.Done(): - return nil - default: - } - } - - return v.valuesCtx.Value(key) -} - -// WithSuppressCancel wraps the Context value, suppressing its deadline and -// cancellation events being propagated downstream to consumer of the returned -// context. -// -// By default the wrapped Context's Values are available downstream until the -// wrapped Context is canceled. Once the wrapped Context is canceled, Values -// method called on the context return will no longer lookup any key. As they -// are now considered expired. -// -// To override this behavior, use WithPreserveExpiredValues on the Context -// before it is wrapped by WithSuppressCancel. This will make the Context -// returned by WithSuppressCancel allow lookup of expired values. -func WithSuppressCancel(ctx context.Context) context.Context { - return &valueOnlyContext{ - Context: context.Background(), - valuesCtx: ctx, - - preserveExpiredValues: GetPreserveExpiredValues(ctx), - } -} - -type preserveExpiredValuesKey struct{} - -// WithPreserveExpiredValues adds a Value to the Context if expired values -// should be preserved, and looked up by a Context wrapped by -// WithSuppressCancel. -// -// WithPreserveExpiredValues must be added as a value to a Context, before that -// Context is wrapped by WithSuppressCancel -func WithPreserveExpiredValues(ctx context.Context, enable bool) context.Context { - return context.WithValue(ctx, preserveExpiredValuesKey{}, enable) -} - -// GetPreserveExpiredValues looks up, and returns the PreserveExpressValues -// value in the context. Returning true if enabled, false otherwise. -func GetPreserveExpiredValues(ctx context.Context) bool { - v := ctx.Value(preserveExpiredValuesKey{}) - if v != nil { - return v.(bool) - } - return false -} diff --git a/vendor/github.com/aws/smithy-go/doc.go b/vendor/github.com/aws/smithy-go/doc.go deleted file mode 100644 index 87b0c74b7..000000000 --- a/vendor/github.com/aws/smithy-go/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package smithy provides the core components for a Smithy SDK. -package smithy diff --git a/vendor/github.com/aws/smithy-go/document.go b/vendor/github.com/aws/smithy-go/document.go deleted file mode 100644 index dec498c57..000000000 --- a/vendor/github.com/aws/smithy-go/document.go +++ /dev/null @@ -1,10 +0,0 @@ -package smithy - -// Document provides access to loosely structured data in a document-like -// format. -// -// Deprecated: See the github.com/aws/smithy-go/document package. -type Document interface { - UnmarshalDocument(interface{}) error - GetValue() (interface{}, error) -} diff --git a/vendor/github.com/aws/smithy-go/document/doc.go b/vendor/github.com/aws/smithy-go/document/doc.go deleted file mode 100644 index 03055b7a1..000000000 --- a/vendor/github.com/aws/smithy-go/document/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Package document provides interface definitions and error types for document types. -// -// A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send -// UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 -// strings to these values. -// -// API Clients expose document constructors in their respective client document packages which must be used to -// Marshal and Unmarshal Go types to and from their respective protocol representations. -// -// See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from -// document types. -package document diff --git a/vendor/github.com/aws/smithy-go/document/document.go b/vendor/github.com/aws/smithy-go/document/document.go deleted file mode 100644 index 8f852d95c..000000000 --- a/vendor/github.com/aws/smithy-go/document/document.go +++ /dev/null @@ -1,153 +0,0 @@ -package document - -import ( - "fmt" - "math/big" - "strconv" -) - -// Marshaler is an interface for a type that marshals a document to its protocol-specific byte representation and -// returns the resulting bytes. A non-nil error will be returned if an error is encountered during marshaling. -// -// Marshal supports basic scalars (int,uint,float,bool,string), big.Int, and big.Float, maps, slices, and structs. -// Anonymous nested types are flattened based on Go anonymous type visibility. -// -// When defining struct types. the `document` struct tag can be used to control how the value will be -// marshaled into the resulting protocol document. -// -// // Field is ignored -// Field int `document:"-"` -// -// // Field object of key "myName" -// Field int `document:"myName"` -// -// // Field object key of key "myName", and -// // Field is omitted if the field is a zero value for the type. -// Field int `document:"myName,omitempty"` -// -// // Field object key of "Field", and -// // Field is omitted if the field is a zero value for the type. -// Field int `document:",omitempty"` -// -// All struct fields, including anonymous fields, are marshaled unless the -// any of the following conditions are meet. -// -// - the field is not exported -// - document field tag is "-" -// - document field tag specifies "omitempty", and is a zero value. -// -// Pointer and interface values are encoded as the value pointed to or -// contained in the interface. A nil value encodes as a null -// value unless `omitempty` struct tag is provided. -// -// Channel, complex, and function values are not encoded and will be skipped -// when walking the value to be marshaled. -// -// time.Time is not supported and will cause the Marshaler to return an error. These values should be represented -// by your application as a string or numerical representation. -// -// Errors that occur when marshaling will stop the marshaler, and return the error. -// -// Marshal cannot represent cyclic data structures and will not handle them. -// Passing cyclic structures to Marshal will result in an infinite recursion. -type Marshaler interface { - MarshalSmithyDocument() ([]byte, error) -} - -// Unmarshaler is an interface for a type that unmarshals a document from its protocol-specific representation, and -// stores the result into the value pointed by v. If v is nil or not a pointer then InvalidUnmarshalError will be -// returned. -// -// Unmarshaler supports the same encodings produced by a document Marshaler. This includes support for the `document` -// struct field tag for controlling how struct fields are unmarshaled. -// -// Both generic interface{} and concrete types are valid unmarshal destination types. When unmarshaling a document -// into an empty interface the Unmarshaler will store one of these values: -// bool, for boolean values -// document.Number, for arbitrary-precision numbers (int64, float64, big.Int, big.Float) -// string, for string values -// []interface{}, for array values -// map[string]interface{}, for objects -// nil, for null values -// -// When unmarshaling, any error that occurs will halt the unmarshal and return the error. -type Unmarshaler interface { - UnmarshalSmithyDocument(v interface{}) error -} - -type noSerde interface { - noSmithyDocumentSerde() -} - -// NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled -// into a protocol document. -type NoSerde struct{} - -func (n NoSerde) noSmithyDocumentSerde() {} - -var _ noSerde = (*NoSerde)(nil) - -// IsNoSerde returns whether the given type implements the no smithy document serde interface. -func IsNoSerde(x interface{}) bool { - _, ok := x.(noSerde) - return ok -} - -// Number is an arbitrary precision numerical value -type Number string - -// Int64 returns the number as a string. -func (n Number) String() string { - return string(n) -} - -// Int64 returns the number as an int64. -func (n Number) Int64() (int64, error) { - return n.intOfBitSize(64) -} - -func (n Number) intOfBitSize(bitSize int) (int64, error) { - return strconv.ParseInt(string(n), 10, bitSize) -} - -// Uint64 returns the number as a uint64. -func (n Number) Uint64() (uint64, error) { - return n.uintOfBitSize(64) -} - -func (n Number) uintOfBitSize(bitSize int) (uint64, error) { - return strconv.ParseUint(string(n), 10, bitSize) -} - -// Float32 returns the number parsed as a 32-bit float, returns a float64. -func (n Number) Float32() (float64, error) { - return n.floatOfBitSize(32) -} - -// Float64 returns the number as a float64. -func (n Number) Float64() (float64, error) { - return n.floatOfBitSize(64) -} - -// Float64 returns the number as a float64. -func (n Number) floatOfBitSize(bitSize int) (float64, error) { - return strconv.ParseFloat(string(n), bitSize) -} - -// BigFloat attempts to convert the number to a big.Float, returns an error if the operation fails. -func (n Number) BigFloat() (*big.Float, error) { - f, ok := (&big.Float{}).SetString(string(n)) - if !ok { - return nil, fmt.Errorf("failed to convert to big.Float") - } - return f, nil -} - -// BigInt attempts to convert the number to a big.Int, returns an error if the operation fails. -func (n Number) BigInt() (*big.Int, error) { - f, ok := (&big.Int{}).SetString(string(n), 10) - if !ok { - return nil, fmt.Errorf("failed to convert to big.Float") - } - return f, nil -} diff --git a/vendor/github.com/aws/smithy-go/document/errors.go b/vendor/github.com/aws/smithy-go/document/errors.go deleted file mode 100644 index 046a7a765..000000000 --- a/vendor/github.com/aws/smithy-go/document/errors.go +++ /dev/null @@ -1,75 +0,0 @@ -package document - -import ( - "fmt" - "reflect" -) - -// UnmarshalTypeError is an error type representing an error -// unmarshaling a Smithy document to a Go value type. This is different -// from UnmarshalError in that it does not wrap an underlying error type. -type UnmarshalTypeError struct { - Value string - Type reflect.Type -} - -// Error returns the string representation of the error. -// Satisfying the error interface. -func (e *UnmarshalTypeError) Error() string { - return fmt.Sprintf("unmarshal failed, cannot unmarshal %s into Go value type %s", - e.Value, e.Type.String()) -} - -// An InvalidUnmarshalError is an error type representing an invalid type -// encountered while unmarshaling a Smithy document to a Go value type. -type InvalidUnmarshalError struct { - Type reflect.Type -} - -// Error returns the string representation of the error. -// Satisfying the error interface. -func (e *InvalidUnmarshalError) Error() string { - var msg string - if e.Type == nil { - msg = "cannot unmarshal to nil value" - } else if e.Type.Kind() != reflect.Ptr { - msg = fmt.Sprintf("cannot unmarshal to non-pointer value, got %s", e.Type.String()) - } else { - msg = fmt.Sprintf("cannot unmarshal to nil value, %s", e.Type.String()) - } - - return fmt.Sprintf("unmarshal failed, %s", msg) -} - -// An UnmarshalError wraps an error that occurred while unmarshaling a -// Smithy document into a Go type. This is different from -// UnmarshalTypeError in that it wraps the underlying error that occurred. -type UnmarshalError struct { - Err error - Value string - Type reflect.Type -} - -// Unwrap returns the underlying unmarshaling error -func (e *UnmarshalError) Unwrap() error { - return e.Err -} - -// Error returns the string representation of the error. -// Satisfying the error interface. -func (e *UnmarshalError) Error() string { - return fmt.Sprintf("unmarshal failed, cannot unmarshal %q into %s, %v", - e.Value, e.Type.String(), e.Err) -} - -// An InvalidMarshalError is an error type representing an error -// occurring when marshaling a Go value type. -type InvalidMarshalError struct { - Message string -} - -// Error returns the string representation of the error. -// Satisfying the error interface. -func (e *InvalidMarshalError) Error() string { - return fmt.Sprintf("marshal failed, %s", e.Message) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/doc.go b/vendor/github.com/aws/smithy-go/encoding/doc.go deleted file mode 100644 index 792fdfa08..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package encoding provides utilities for encoding values for specific -// document encodings. - -package encoding diff --git a/vendor/github.com/aws/smithy-go/encoding/encoding.go b/vendor/github.com/aws/smithy-go/encoding/encoding.go deleted file mode 100644 index 2fdfb5225..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/encoding.go +++ /dev/null @@ -1,40 +0,0 @@ -package encoding - -import ( - "fmt" - "math" - "strconv" -) - -// EncodeFloat encodes a float value as per the stdlib encoder for json and xml protocol -// This encodes a float value into dst while attempting to conform to ES6 ToString for Numbers -// -// Based on encoding/json floatEncoder from the Go Standard Library -// https://golang.org/src/encoding/json/encode.go -func EncodeFloat(dst []byte, v float64, bits int) []byte { - if math.IsInf(v, 0) || math.IsNaN(v) { - panic(fmt.Sprintf("invalid float value: %s", strconv.FormatFloat(v, 'g', -1, bits))) - } - - abs := math.Abs(v) - fmt := byte('f') - - if abs != 0 { - if bits == 64 && (abs < 1e-6 || abs >= 1e21) || bits == 32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) { - fmt = 'e' - } - } - - dst = strconv.AppendFloat(dst, v, fmt, -1, bits) - - if fmt == 'e' { - // clean up e-09 to e-9 - n := len(dst) - if n >= 4 && dst[n-4] == 'e' && dst[n-3] == '-' && dst[n-2] == '0' { - dst[n-2] = dst[n-1] - dst = dst[:n-1] - } - } - - return dst -} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go deleted file mode 100644 index 543e7cf03..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go +++ /dev/null @@ -1,123 +0,0 @@ -package httpbinding - -import ( - "fmt" - "net/http" - "net/url" - "strconv" - "strings" -) - -const ( - contentLengthHeader = "Content-Length" - floatNaN = "NaN" - floatInfinity = "Infinity" - floatNegInfinity = "-Infinity" -) - -// An Encoder provides encoding of REST URI path, query, and header components -// of an HTTP request. Can also encode a stream as the payload. -// -// Does not support SetFields. -type Encoder struct { - path, rawPath, pathBuffer []byte - - query url.Values - header http.Header -} - -// NewEncoder creates a new encoder from the passed in request. It assumes that -// raw path contains no valuable information at this point, so it passes in path -// as path and raw path for subsequent trans -func NewEncoder(path, query string, headers http.Header) (*Encoder, error) { - return NewEncoderWithRawPath(path, path, query, headers) -} - -// NewHTTPBindingEncoder creates a new encoder from the passed in request. All query and -// header values will be added on top of the request's existing values. Overwriting -// duplicate values. -func NewEncoderWithRawPath(path, rawPath, query string, headers http.Header) (*Encoder, error) { - parseQuery, err := url.ParseQuery(query) - if err != nil { - return nil, fmt.Errorf("failed to parse query string: %w", err) - } - - e := &Encoder{ - path: []byte(path), - rawPath: []byte(rawPath), - query: parseQuery, - header: headers.Clone(), - } - - return e, nil -} - -// Encode returns a REST protocol encoder for encoding HTTP bindings. -// -// Due net/http requiring `Content-Length` to be specified on the http.Request#ContentLength directly. Encode -// will look for whether the header is present, and if so will remove it and set the respective value on http.Request. -// -// Returns any error occurring during encoding. -func (e *Encoder) Encode(req *http.Request) (*http.Request, error) { - req.URL.Path, req.URL.RawPath = string(e.path), string(e.rawPath) - req.URL.RawQuery = e.query.Encode() - - // net/http ignores Content-Length header and requires it to be set on http.Request - if v := e.header.Get(contentLengthHeader); len(v) > 0 { - iv, err := strconv.ParseInt(v, 10, 64) - if err != nil { - return nil, err - } - req.ContentLength = iv - e.header.Del(contentLengthHeader) - } - - req.Header = e.header - - return req, nil -} - -// AddHeader returns a HeaderValue for appending to the given header name -func (e *Encoder) AddHeader(key string) HeaderValue { - return newHeaderValue(e.header, key, true) -} - -// SetHeader returns a HeaderValue for setting the given header name -func (e *Encoder) SetHeader(key string) HeaderValue { - return newHeaderValue(e.header, key, false) -} - -// Headers returns a Header used for encoding headers with the given prefix -func (e *Encoder) Headers(prefix string) Headers { - return Headers{ - header: e.header, - prefix: strings.TrimSpace(prefix), - } -} - -// HasHeader returns if a header with the key specified exists with one or -// more value. -func (e Encoder) HasHeader(key string) bool { - return len(e.header[key]) != 0 -} - -// SetURI returns a URIValue used for setting the given path key -func (e *Encoder) SetURI(key string) URIValue { - return newURIValue(&e.path, &e.rawPath, &e.pathBuffer, key) -} - -// SetQuery returns a QueryValue used for setting the given query key -func (e *Encoder) SetQuery(key string) QueryValue { - return NewQueryValue(e.query, key, false) -} - -// AddQuery returns a QueryValue used for appending the given query key -func (e *Encoder) AddQuery(key string) QueryValue { - return NewQueryValue(e.query, key, true) -} - -// HasQuery returns if a query with the key specified exists with one or -// more values. -func (e *Encoder) HasQuery(key string) bool { - return len(e.query.Get(key)) != 0 -} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go deleted file mode 100644 index f9256e175..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go +++ /dev/null @@ -1,122 +0,0 @@ -package httpbinding - -import ( - "encoding/base64" - "math" - "math/big" - "net/http" - "strconv" - "strings" -) - -// Headers is used to encode header keys using a provided prefix -type Headers struct { - header http.Header - prefix string -} - -// AddHeader returns a HeaderValue used to append values to prefix+key -func (h Headers) AddHeader(key string) HeaderValue { - return h.newHeaderValue(key, true) -} - -// SetHeader returns a HeaderValue used to set the value of prefix+key -func (h Headers) SetHeader(key string) HeaderValue { - return h.newHeaderValue(key, false) -} - -func (h Headers) newHeaderValue(key string, append bool) HeaderValue { - return newHeaderValue(h.header, h.prefix+strings.TrimSpace(key), append) -} - -// HeaderValue is used to encode values to an HTTP header -type HeaderValue struct { - header http.Header - key string - append bool -} - -func newHeaderValue(header http.Header, key string, append bool) HeaderValue { - return HeaderValue{header: header, key: strings.TrimSpace(key), append: append} -} - -func (h HeaderValue) modifyHeader(value string) { - if h.append { - h.header[h.key] = append(h.header[h.key], value) - } else { - h.header[h.key] = append(h.header[h.key][:0], value) - } -} - -// String encodes the value v as the header string value -func (h HeaderValue) String(v string) { - h.modifyHeader(v) -} - -// Byte encodes the value v as a query string value -func (h HeaderValue) Byte(v int8) { - h.Long(int64(v)) -} - -// Short encodes the value v as a query string value -func (h HeaderValue) Short(v int16) { - h.Long(int64(v)) -} - -// Integer encodes the value v as the header string value -func (h HeaderValue) Integer(v int32) { - h.Long(int64(v)) -} - -// Long encodes the value v as the header string value -func (h HeaderValue) Long(v int64) { - h.modifyHeader(strconv.FormatInt(v, 10)) -} - -// Boolean encodes the value v as a query string value -func (h HeaderValue) Boolean(v bool) { - h.modifyHeader(strconv.FormatBool(v)) -} - -// Float encodes the value v as a query string value -func (h HeaderValue) Float(v float32) { - h.float(float64(v), 32) -} - -// Double encodes the value v as a query string value -func (h HeaderValue) Double(v float64) { - h.float(v, 64) -} - -func (h HeaderValue) float(v float64, bitSize int) { - switch { - case math.IsNaN(v): - h.String(floatNaN) - case math.IsInf(v, 1): - h.String(floatInfinity) - case math.IsInf(v, -1): - h.String(floatNegInfinity) - default: - h.modifyHeader(strconv.FormatFloat(v, 'f', -1, bitSize)) - } -} - -// BigInteger encodes the value v as a query string value -func (h HeaderValue) BigInteger(v *big.Int) { - h.modifyHeader(v.String()) -} - -// BigDecimal encodes the value v as a query string value -func (h HeaderValue) BigDecimal(v *big.Float) { - if i, accuracy := v.Int64(); accuracy == big.Exact { - h.Long(i) - return - } - h.modifyHeader(v.Text('e', -1)) -} - -// Blob encodes the value v as a base64 header string value -func (h HeaderValue) Blob(v []byte) { - encodeToString := base64.StdEncoding.EncodeToString(v) - h.modifyHeader(encodeToString) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go deleted file mode 100644 index 9ae308540..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go +++ /dev/null @@ -1,108 +0,0 @@ -package httpbinding - -import ( - "bytes" - "fmt" -) - -const ( - uriTokenStart = '{' - uriTokenStop = '}' - uriTokenSkip = '+' -) - -func bufCap(b []byte, n int) []byte { - if cap(b) < n { - return make([]byte, 0, n) - } - - return b[0:0] -} - -// replacePathElement replaces a single element in the path []byte. -// Escape is used to control whether the value will be escaped using Amazon path escape style. -func replacePathElement(path, fieldBuf []byte, key, val string, escape bool) ([]byte, []byte, error) { - // search for "{}". If not found, search for the greedy version "{+}". If none are found, return error - fieldBuf = bufCap(fieldBuf, len(key)+2) // { } - fieldBuf = append(fieldBuf, uriTokenStart) - fieldBuf = append(fieldBuf, key...) - fieldBuf = append(fieldBuf, uriTokenStop) - - start := bytes.Index(path, fieldBuf) - encodeSep := true - if start < 0 { - fieldBuf = bufCap(fieldBuf, len(key)+3) // { [+] } - fieldBuf = append(fieldBuf, uriTokenStart) - fieldBuf = append(fieldBuf, key...) - fieldBuf = append(fieldBuf, uriTokenSkip) - fieldBuf = append(fieldBuf, uriTokenStop) - - start = bytes.Index(path, fieldBuf) - if start < 0 { - return path, fieldBuf, fmt.Errorf("invalid path index, start=%d. %s", start, path) - } - encodeSep = false - } - end := start + len(fieldBuf) - - if escape { - val = EscapePath(val, encodeSep) - } - - fieldBuf = bufCap(fieldBuf, len(val)) - fieldBuf = append(fieldBuf, val...) - - keyLen := end - start - valLen := len(fieldBuf) - - if keyLen == valLen { - copy(path[start:], fieldBuf) - return path, fieldBuf, nil - } - - newLen := len(path) + (valLen - keyLen) - if len(path) < newLen { - path = path[:cap(path)] - } - if cap(path) < newLen { - newURI := make([]byte, newLen) - copy(newURI, path) - path = newURI - } - - // shift - copy(path[start+valLen:], path[end:]) - path = path[:newLen] - copy(path[start:], fieldBuf) - - return path, fieldBuf, nil -} - -// EscapePath escapes part of a URL path in Amazon style. -func EscapePath(path string, encodeSep bool) string { - var buf bytes.Buffer - for i := 0; i < len(path); i++ { - c := path[i] - if noEscape[c] || (c == '/' && !encodeSep) { - buf.WriteByte(c) - } else { - fmt.Fprintf(&buf, "%%%02X", c) - } - } - return buf.String() -} - -var noEscape [256]bool - -func init() { - for i := 0; i < len(noEscape); i++ { - // AWS expects every character except these to be escaped - noEscape[i] = (i >= 'A' && i <= 'Z') || - (i >= 'a' && i <= 'z') || - (i >= '0' && i <= '9') || - i == '-' || - i == '.' || - i == '_' || - i == '~' - } -} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go deleted file mode 100644 index c2e7d0a20..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go +++ /dev/null @@ -1,107 +0,0 @@ -package httpbinding - -import ( - "encoding/base64" - "math" - "math/big" - "net/url" - "strconv" -) - -// QueryValue is used to encode query key values -type QueryValue struct { - query url.Values - key string - append bool -} - -// NewQueryValue creates a new QueryValue which enables encoding -// a query value into the given url.Values. -func NewQueryValue(query url.Values, key string, append bool) QueryValue { - return QueryValue{ - query: query, - key: key, - append: append, - } -} - -func (qv QueryValue) updateKey(value string) { - if qv.append { - qv.query.Add(qv.key, value) - } else { - qv.query.Set(qv.key, value) - } -} - -// Blob encodes v as a base64 query string value -func (qv QueryValue) Blob(v []byte) { - encodeToString := base64.StdEncoding.EncodeToString(v) - qv.updateKey(encodeToString) -} - -// Boolean encodes v as a query string value -func (qv QueryValue) Boolean(v bool) { - qv.updateKey(strconv.FormatBool(v)) -} - -// String encodes v as a query string value -func (qv QueryValue) String(v string) { - qv.updateKey(v) -} - -// Byte encodes v as a query string value -func (qv QueryValue) Byte(v int8) { - qv.Long(int64(v)) -} - -// Short encodes v as a query string value -func (qv QueryValue) Short(v int16) { - qv.Long(int64(v)) -} - -// Integer encodes v as a query string value -func (qv QueryValue) Integer(v int32) { - qv.Long(int64(v)) -} - -// Long encodes v as a query string value -func (qv QueryValue) Long(v int64) { - qv.updateKey(strconv.FormatInt(v, 10)) -} - -// Float encodes v as a query string value -func (qv QueryValue) Float(v float32) { - qv.float(float64(v), 32) -} - -// Double encodes v as a query string value -func (qv QueryValue) Double(v float64) { - qv.float(v, 64) -} - -func (qv QueryValue) float(v float64, bitSize int) { - switch { - case math.IsNaN(v): - qv.String(floatNaN) - case math.IsInf(v, 1): - qv.String(floatInfinity) - case math.IsInf(v, -1): - qv.String(floatNegInfinity) - default: - qv.updateKey(strconv.FormatFloat(v, 'f', -1, bitSize)) - } -} - -// BigInteger encodes v as a query string value -func (qv QueryValue) BigInteger(v *big.Int) { - qv.updateKey(v.String()) -} - -// BigDecimal encodes v as a query string value -func (qv QueryValue) BigDecimal(v *big.Float) { - if i, accuracy := v.Int64(); accuracy == big.Exact { - qv.Long(i) - return - } - qv.updateKey(v.Text('e', -1)) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go deleted file mode 100644 index f04e11984..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go +++ /dev/null @@ -1,111 +0,0 @@ -package httpbinding - -import ( - "math" - "math/big" - "strconv" - "strings" -) - -// URIValue is used to encode named URI parameters -type URIValue struct { - path, rawPath, buffer *[]byte - - key string -} - -func newURIValue(path *[]byte, rawPath *[]byte, buffer *[]byte, key string) URIValue { - return URIValue{path: path, rawPath: rawPath, buffer: buffer, key: key} -} - -func (u URIValue) modifyURI(value string) (err error) { - *u.path, *u.buffer, err = replacePathElement(*u.path, *u.buffer, u.key, value, false) - if err != nil { - return err - } - *u.rawPath, *u.buffer, err = replacePathElement(*u.rawPath, *u.buffer, u.key, value, true) - return err -} - -// Boolean encodes v as a URI string value -func (u URIValue) Boolean(v bool) error { - return u.modifyURI(strconv.FormatBool(v)) -} - -// String encodes v as a URI string value -func (u URIValue) String(v string) error { - return u.modifyURI(v) -} - -// Byte encodes v as a URI string value -func (u URIValue) Byte(v int8) error { - return u.Long(int64(v)) -} - -// Short encodes v as a URI string value -func (u URIValue) Short(v int16) error { - return u.Long(int64(v)) -} - -// Integer encodes v as a URI string value -func (u URIValue) Integer(v int32) error { - return u.Long(int64(v)) -} - -// Long encodes v as a URI string value -func (u URIValue) Long(v int64) error { - return u.modifyURI(strconv.FormatInt(v, 10)) -} - -// Float encodes v as a query string value -func (u URIValue) Float(v float32) error { - return u.float(float64(v), 32) -} - -// Double encodes v as a query string value -func (u URIValue) Double(v float64) error { - return u.float(v, 64) -} - -func (u URIValue) float(v float64, bitSize int) error { - switch { - case math.IsNaN(v): - return u.String(floatNaN) - case math.IsInf(v, 1): - return u.String(floatInfinity) - case math.IsInf(v, -1): - return u.String(floatNegInfinity) - default: - return u.modifyURI(strconv.FormatFloat(v, 'f', -1, bitSize)) - } -} - -// BigInteger encodes v as a query string value -func (u URIValue) BigInteger(v *big.Int) error { - return u.modifyURI(v.String()) -} - -// BigDecimal encodes v as a query string value -func (u URIValue) BigDecimal(v *big.Float) error { - if i, accuracy := v.Int64(); accuracy == big.Exact { - return u.Long(i) - } - return u.modifyURI(v.Text('e', -1)) -} - -// SplitURI parses a Smithy HTTP binding trait URI -func SplitURI(uri string) (path, query string) { - queryStart := strings.IndexRune(uri, '?') - if queryStart == -1 { - path = uri - return path, query - } - - path = uri[:queryStart] - if queryStart+1 >= len(uri) { - return path, query - } - query = uri[queryStart+1:] - - return path, query -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/array.go b/vendor/github.com/aws/smithy-go/encoding/json/array.go deleted file mode 100644 index 7a232f660..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/array.go +++ /dev/null @@ -1,35 +0,0 @@ -package json - -import ( - "bytes" -) - -// Array represents the encoding of a JSON Array -type Array struct { - w *bytes.Buffer - writeComma bool - scratch *[]byte -} - -func newArray(w *bytes.Buffer, scratch *[]byte) *Array { - w.WriteRune(leftBracket) - return &Array{w: w, scratch: scratch} -} - -// Value adds a new element to the JSON Array. -// Returns a Value type that is used to encode -// the array element. -func (a *Array) Value() Value { - if a.writeComma { - a.w.WriteRune(comma) - } else { - a.writeComma = true - } - - return newValue(a.w, a.scratch) -} - -// Close encodes the end of the JSON Array -func (a *Array) Close() { - a.w.WriteRune(rightBracket) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/constants.go b/vendor/github.com/aws/smithy-go/encoding/json/constants.go deleted file mode 100644 index 91044092a..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/constants.go +++ /dev/null @@ -1,15 +0,0 @@ -package json - -const ( - leftBrace = '{' - rightBrace = '}' - - leftBracket = '[' - rightBracket = ']' - - comma = ',' - quote = '"' - colon = ':' - - null = "null" -) diff --git a/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go b/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go deleted file mode 100644 index 7050c85b3..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go +++ /dev/null @@ -1,139 +0,0 @@ -package json - -import ( - "bytes" - "encoding/json" - "fmt" - "io" -) - -// DiscardUnknownField discards unknown fields from a decoder body. -// This function is useful while deserializing a JSON body with additional -// unknown information that should be discarded. -func DiscardUnknownField(decoder *json.Decoder) error { - // This deliberately does not share logic with CollectUnknownField, even - // though it could, because if we were to delegate to that then we'd incur - // extra allocations and general memory usage. - v, err := decoder.Token() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - - if _, ok := v.(json.Delim); ok { - for decoder.More() { - err = DiscardUnknownField(decoder) - } - endToken, err := decoder.Token() - if err != nil { - return err - } - if _, ok := endToken.(json.Delim); !ok { - return fmt.Errorf("invalid JSON : expected json delimiter, found %T %v", - endToken, endToken) - } - } - - return nil -} - -// CollectUnknownField grabs the contents of unknown fields from the decoder body -// and returns them as a byte slice. This is useful for skipping unknown fields without -// completely discarding them. -func CollectUnknownField(decoder *json.Decoder) ([]byte, error) { - result, err := collectUnknownField(decoder) - if err != nil { - return nil, err - } - - buff := bytes.NewBuffer(nil) - encoder := json.NewEncoder(buff) - - if err := encoder.Encode(result); err != nil { - return nil, err - } - - return buff.Bytes(), nil -} - -func collectUnknownField(decoder *json.Decoder) (interface{}, error) { - // Grab the initial value. This could either be a concrete value like a string or a a - // delimiter. - token, err := decoder.Token() - if err == io.EOF { - return nil, nil - } - if err != nil { - return nil, err - } - - // If it's an array or object, we'll need to recurse. - delim, ok := token.(json.Delim) - if ok { - var result interface{} - if delim == '{' { - result, err = collectUnknownObject(decoder) - if err != nil { - return nil, err - } - } else { - result, err = collectUnknownArray(decoder) - if err != nil { - return nil, err - } - } - - // Discard the closing token. decoder.Token handles checking for matching delimiters - if _, err := decoder.Token(); err != nil { - return nil, err - } - return result, nil - } - - return token, nil -} - -func collectUnknownArray(decoder *json.Decoder) ([]interface{}, error) { - // We need to create an empty array here instead of a nil array, since by getting - // into this function at all we necessarily have seen a non-nil list. - array := []interface{}{} - - for decoder.More() { - value, err := collectUnknownField(decoder) - if err != nil { - return nil, err - } - array = append(array, value) - } - - return array, nil -} - -func collectUnknownObject(decoder *json.Decoder) (map[string]interface{}, error) { - object := make(map[string]interface{}) - - for decoder.More() { - key, err := collectUnknownField(decoder) - if err != nil { - return nil, err - } - - // Keys have to be strings, which is particularly important as the encoder - // won't except a map with interface{} keys - stringKey, ok := key.(string) - if !ok { - return nil, fmt.Errorf("expected string key, found %T", key) - } - - value, err := collectUnknownField(decoder) - if err != nil { - return nil, err - } - - object[stringKey] = value - } - - return object, nil -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/encoder.go b/vendor/github.com/aws/smithy-go/encoding/json/encoder.go deleted file mode 100644 index 8772953f1..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/encoder.go +++ /dev/null @@ -1,30 +0,0 @@ -package json - -import ( - "bytes" -) - -// Encoder is JSON encoder that supports construction of JSON values -// using methods. -type Encoder struct { - w *bytes.Buffer - Value -} - -// NewEncoder returns a new JSON encoder -func NewEncoder() *Encoder { - writer := bytes.NewBuffer(nil) - scratch := make([]byte, 64) - - return &Encoder{w: writer, Value: newValue(writer, &scratch)} -} - -// String returns the String output of the JSON encoder -func (e Encoder) String() string { - return e.w.String() -} - -// Bytes returns the []byte slice of the JSON encoder -func (e Encoder) Bytes() []byte { - return e.w.Bytes() -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/escape.go b/vendor/github.com/aws/smithy-go/encoding/json/escape.go deleted file mode 100644 index d984d0cdc..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/escape.go +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copied and modified from Go 1.8 stdlib's encoding/json/#safeSet - -package json - -import ( - "bytes" - "unicode/utf8" -) - -// safeSet holds the value true if the ASCII character with the given array -// position can be represented inside a JSON string without any further -// escaping. -// -// All values are true except for the ASCII control characters (0-31), the -// double quote ("), and the backslash character ("\"). -var safeSet = [utf8.RuneSelf]bool{ - ' ': true, - '!': true, - '"': false, - '#': true, - '$': true, - '%': true, - '&': true, - '\'': true, - '(': true, - ')': true, - '*': true, - '+': true, - ',': true, - '-': true, - '.': true, - '/': true, - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - ':': true, - ';': true, - '<': true, - '=': true, - '>': true, - '?': true, - '@': true, - 'A': true, - 'B': true, - 'C': true, - 'D': true, - 'E': true, - 'F': true, - 'G': true, - 'H': true, - 'I': true, - 'J': true, - 'K': true, - 'L': true, - 'M': true, - 'N': true, - 'O': true, - 'P': true, - 'Q': true, - 'R': true, - 'S': true, - 'T': true, - 'U': true, - 'V': true, - 'W': true, - 'X': true, - 'Y': true, - 'Z': true, - '[': true, - '\\': false, - ']': true, - '^': true, - '_': true, - '`': true, - 'a': true, - 'b': true, - 'c': true, - 'd': true, - 'e': true, - 'f': true, - 'g': true, - 'h': true, - 'i': true, - 'j': true, - 'k': true, - 'l': true, - 'm': true, - 'n': true, - 'o': true, - 'p': true, - 'q': true, - 'r': true, - 's': true, - 't': true, - 'u': true, - 'v': true, - 'w': true, - 'x': true, - 'y': true, - 'z': true, - '{': true, - '|': true, - '}': true, - '~': true, - '\u007f': true, -} - -// copied from Go 1.8 stdlib's encoding/json/#hex -var hex = "0123456789abcdef" - -// escapeStringBytes escapes and writes the passed in string bytes to the dst -// buffer -// -// Copied and modifed from Go 1.8 stdlib's encodeing/json/#encodeState.stringBytes -func escapeStringBytes(e *bytes.Buffer, s []byte) { - e.WriteByte('"') - start := 0 - for i := 0; i < len(s); { - if b := s[i]; b < utf8.RuneSelf { - if safeSet[b] { - i++ - continue - } - if start < i { - e.Write(s[start:i]) - } - switch b { - case '\\', '"': - e.WriteByte('\\') - e.WriteByte(b) - case '\n': - e.WriteByte('\\') - e.WriteByte('n') - case '\r': - e.WriteByte('\\') - e.WriteByte('r') - case '\t': - e.WriteByte('\\') - e.WriteByte('t') - default: - // This encodes bytes < 0x20 except for \t, \n and \r. - // If escapeHTML is set, it also escapes <, >, and & - // because they can lead to security holes when - // user-controlled strings are rendered into JSON - // and served to some browsers. - e.WriteString(`\u00`) - e.WriteByte(hex[b>>4]) - e.WriteByte(hex[b&0xF]) - } - i++ - start = i - continue - } - c, size := utf8.DecodeRune(s[i:]) - if c == utf8.RuneError && size == 1 { - if start < i { - e.Write(s[start:i]) - } - e.WriteString(`\ufffd`) - i += size - start = i - continue - } - // U+2028 is LINE SEPARATOR. - // U+2029 is PARAGRAPH SEPARATOR. - // They are both technically valid characters in JSON strings, - // but don't work in JSONP, which has to be evaluated as JavaScript, - // and can lead to security holes there. It is valid JSON to - // escape them, so we do so unconditionally. - // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion. - if c == '\u2028' || c == '\u2029' { - if start < i { - e.Write(s[start:i]) - } - e.WriteString(`\u202`) - e.WriteByte(hex[c&0xF]) - i += size - start = i - continue - } - i += size - } - if start < len(s) { - e.Write(s[start:]) - } - e.WriteByte('"') -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/object.go b/vendor/github.com/aws/smithy-go/encoding/json/object.go deleted file mode 100644 index 722346d03..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/object.go +++ /dev/null @@ -1,40 +0,0 @@ -package json - -import ( - "bytes" -) - -// Object represents the encoding of a JSON Object type -type Object struct { - w *bytes.Buffer - writeComma bool - scratch *[]byte -} - -func newObject(w *bytes.Buffer, scratch *[]byte) *Object { - w.WriteRune(leftBrace) - return &Object{w: w, scratch: scratch} -} - -func (o *Object) writeKey(key string) { - escapeStringBytes(o.w, []byte(key)) - o.w.WriteRune(colon) -} - -// Key adds the given named key to the JSON object. -// Returns a Value encoder that should be used to encode -// a JSON value type. -func (o *Object) Key(name string) Value { - if o.writeComma { - o.w.WriteRune(comma) - } else { - o.writeComma = true - } - o.writeKey(name) - return newValue(o.w, o.scratch) -} - -// Close encodes the end of the JSON Object -func (o *Object) Close() { - o.w.WriteRune(rightBrace) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/value.go b/vendor/github.com/aws/smithy-go/encoding/json/value.go deleted file mode 100644 index b41ff1e15..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/json/value.go +++ /dev/null @@ -1,149 +0,0 @@ -package json - -import ( - "bytes" - "encoding/base64" - "math/big" - "strconv" - - "github.com/aws/smithy-go/encoding" -) - -// Value represents a JSON Value type -// JSON Value types: Object, Array, String, Number, Boolean, and Null -type Value struct { - w *bytes.Buffer - scratch *[]byte -} - -// newValue returns a new Value encoder -func newValue(w *bytes.Buffer, scratch *[]byte) Value { - return Value{w: w, scratch: scratch} -} - -// String encodes v as a JSON string -func (jv Value) String(v string) { - escapeStringBytes(jv.w, []byte(v)) -} - -// Byte encodes v as a JSON number -func (jv Value) Byte(v int8) { - jv.Long(int64(v)) -} - -// Short encodes v as a JSON number -func (jv Value) Short(v int16) { - jv.Long(int64(v)) -} - -// Integer encodes v as a JSON number -func (jv Value) Integer(v int32) { - jv.Long(int64(v)) -} - -// Long encodes v as a JSON number -func (jv Value) Long(v int64) { - *jv.scratch = strconv.AppendInt((*jv.scratch)[:0], v, 10) - jv.w.Write(*jv.scratch) -} - -// ULong encodes v as a JSON number -func (jv Value) ULong(v uint64) { - *jv.scratch = strconv.AppendUint((*jv.scratch)[:0], v, 10) - jv.w.Write(*jv.scratch) -} - -// Float encodes v as a JSON number -func (jv Value) Float(v float32) { - jv.float(float64(v), 32) -} - -// Double encodes v as a JSON number -func (jv Value) Double(v float64) { - jv.float(v, 64) -} - -func (jv Value) float(v float64, bits int) { - *jv.scratch = encoding.EncodeFloat((*jv.scratch)[:0], v, bits) - jv.w.Write(*jv.scratch) -} - -// Boolean encodes v as a JSON boolean -func (jv Value) Boolean(v bool) { - *jv.scratch = strconv.AppendBool((*jv.scratch)[:0], v) - jv.w.Write(*jv.scratch) -} - -// Base64EncodeBytes writes v as a base64 value in JSON string -func (jv Value) Base64EncodeBytes(v []byte) { - encodeByteSlice(jv.w, (*jv.scratch)[:0], v) -} - -// Write writes v directly to the JSON document -func (jv Value) Write(v []byte) { - jv.w.Write(v) -} - -// Array returns a new Array encoder -func (jv Value) Array() *Array { - return newArray(jv.w, jv.scratch) -} - -// Object returns a new Object encoder -func (jv Value) Object() *Object { - return newObject(jv.w, jv.scratch) -} - -// Null encodes a null JSON value -func (jv Value) Null() { - jv.w.WriteString(null) -} - -// BigInteger encodes v as JSON value -func (jv Value) BigInteger(v *big.Int) { - jv.w.Write([]byte(v.Text(10))) -} - -// BigDecimal encodes v as JSON value -func (jv Value) BigDecimal(v *big.Float) { - if i, accuracy := v.Int64(); accuracy == big.Exact { - jv.Long(i) - return - } - // TODO: Should this try to match ES6 ToString similar to stdlib JSON? - jv.w.Write([]byte(v.Text('e', -1))) -} - -// Based on encoding/json encodeByteSlice from the Go Standard Library -// https://golang.org/src/encoding/json/encode.go -func encodeByteSlice(w *bytes.Buffer, scratch []byte, v []byte) { - if v == nil { - w.WriteString(null) - return - } - - w.WriteRune(quote) - - encodedLen := base64.StdEncoding.EncodedLen(len(v)) - if encodedLen <= len(scratch) { - // If the encoded bytes fit in e.scratch, avoid an extra - // allocation and use the cheaper Encoding.Encode. - dst := scratch[:encodedLen] - base64.StdEncoding.Encode(dst, v) - w.Write(dst) - } else if encodedLen <= 1024 { - // The encoded bytes are short enough to allocate for, and - // Encoding.Encode is still cheaper. - dst := make([]byte, encodedLen) - base64.StdEncoding.Encode(dst, v) - w.Write(dst) - } else { - // The encoded bytes are too long to cheaply allocate, and - // Encoding.Encode is no longer noticeably cheaper. - enc := base64.NewEncoder(base64.StdEncoding, w) - enc.Write(v) - enc.Close() - } - - w.WriteRune(quote) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/array.go b/vendor/github.com/aws/smithy-go/encoding/xml/array.go deleted file mode 100644 index 508f3c997..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/array.go +++ /dev/null @@ -1,49 +0,0 @@ -package xml - -// arrayMemberWrapper is the default member wrapper tag name for XML Array type -var arrayMemberWrapper = StartElement{ - Name: Name{Local: "member"}, -} - -// Array represents the encoding of a XML array type -type Array struct { - w writer - scratch *[]byte - - // member start element is the array member wrapper start element - memberStartElement StartElement - - // isFlattened indicates if the array is a flattened array. - isFlattened bool -} - -// newArray returns an array encoder. -// It also takes in the member start element, array start element. -// It takes in a isFlattened bool, indicating that an array is flattened array. -// -// A wrapped array ["value1", "value2"] is represented as -// `value1value2`. - -// A flattened array `someList: ["value1", "value2"]` is represented as -// `value1value2`. -func newArray(w writer, scratch *[]byte, memberStartElement StartElement, arrayStartElement StartElement, isFlattened bool) *Array { - var memberWrapper = memberStartElement - if isFlattened { - memberWrapper = arrayStartElement - } - - return &Array{ - w: w, - scratch: scratch, - memberStartElement: memberWrapper, - isFlattened: isFlattened, - } -} - -// Member adds a new member to the XML array. -// It returns a Value encoder. -func (a *Array) Member() Value { - v := newValue(a.w, a.scratch, a.memberStartElement) - v.isFlattened = a.isFlattened - return v -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/constants.go b/vendor/github.com/aws/smithy-go/encoding/xml/constants.go deleted file mode 100644 index ccee90a63..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/constants.go +++ /dev/null @@ -1,10 +0,0 @@ -package xml - -const ( - leftAngleBracket = '<' - rightAngleBracket = '>' - forwardSlash = '/' - colon = ':' - equals = '=' - quote = '"' -) diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/doc.go b/vendor/github.com/aws/smithy-go/encoding/xml/doc.go deleted file mode 100644 index f9200093e..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/doc.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Package xml holds the XMl encoder utility. This utility is written in accordance to our design to delegate to -shape serializer function in which a xml.Value will be passed around. - -Resources followed: https://smithy.io/2.0/spec/protocol-traits.html#xml-bindings - -Member Element - -Member element should be used to encode xml shapes into xml elements except for flattened xml shapes. Member element -write their own element start tag. These elements should always be closed. - -Flattened Element - -Flattened element should be used to encode shapes marked with flattened trait into xml elements. Flattened element -do not write a start tag, and thus should not be closed. - -Simple types encoding - -All simple type methods on value such as String(), Long() etc; auto close the associated member element. - -Array - -Array returns the collection encoder. It has two modes, wrapped and flattened encoding. - -Wrapped arrays have two methods Array() and ArrayWithCustomName() which facilitate array member wrapping. -By default, a wrapped array members are wrapped with `member` named start element. - - appletree - -Flattened arrays rely on Value being marked as flattened. -If a shape is marked as flattened, Array() will use the shape element name as wrapper for array elements. - - appletree - -Map - -Map is the map encoder. It has two modes, wrapped and flattened encoding. - -Wrapped map has Array() method, which facilitate map member wrapping. -By default, a wrapped map members are wrapped with `entry` named start element. - - appletreesnowice - -Flattened map rely on Value being marked as flattened. -If a shape is marked as flattened, Map() will use the shape element name as wrapper for map entry elements. - - appletreesnowice -*/ -package xml diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/element.go b/vendor/github.com/aws/smithy-go/encoding/xml/element.go deleted file mode 100644 index ae84e7999..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/element.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copied and modified from Go 1.14 stdlib's encoding/xml - -package xml - -// A Name represents an XML name (Local) annotated -// with a name space identifier (Space). -// In tokens returned by Decoder.Token, the Space identifier -// is given as a canonical URL, not the short prefix used -// in the document being parsed. -type Name struct { - Space, Local string -} - -// An Attr represents an attribute in an XML element (Name=Value). -type Attr struct { - Name Name - Value string -} - -/* -NewAttribute returns a pointer to an attribute. -It takes in a local name aka attribute name, and value -representing the attribute value. -*/ -func NewAttribute(local, value string) Attr { - return Attr{ - Name: Name{ - Local: local, - }, - Value: value, - } -} - -/* -NewNamespaceAttribute returns a pointer to an attribute. -It takes in a local name aka attribute name, and value -representing the attribute value. - -NewNamespaceAttribute appends `xmlns:` in front of namespace -prefix. - -For creating a name space attribute representing -`xmlns:prefix="http://example.com`, the breakdown would be: -local = "prefix" -value = "http://example.com" -*/ -func NewNamespaceAttribute(local, value string) Attr { - attr := NewAttribute(local, value) - - // default name space identifier - attr.Name.Space = "xmlns" - return attr -} - -// A StartElement represents an XML start element. -type StartElement struct { - Name Name - Attr []Attr -} - -// Copy creates a new copy of StartElement. -func (e StartElement) Copy() StartElement { - attrs := make([]Attr, len(e.Attr)) - copy(attrs, e.Attr) - e.Attr = attrs - return e -} - -// End returns the corresponding XML end element. -func (e StartElement) End() EndElement { - return EndElement{e.Name} -} - -// returns true if start element local name is empty -func (e StartElement) isZero() bool { - return len(e.Name.Local) == 0 -} - -// An EndElement represents an XML end element. -type EndElement struct { - Name Name -} - -// returns true if end element local name is empty -func (e EndElement) isZero() bool { - return len(e.Name.Local) == 0 -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/encoder.go b/vendor/github.com/aws/smithy-go/encoding/xml/encoder.go deleted file mode 100644 index 16fb3dddb..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/encoder.go +++ /dev/null @@ -1,51 +0,0 @@ -package xml - -// writer interface used by the xml encoder to write an encoded xml -// document in a writer. -type writer interface { - - // Write takes in a byte slice and returns number of bytes written and error - Write(p []byte) (n int, err error) - - // WriteRune takes in a rune and returns number of bytes written and error - WriteRune(r rune) (n int, err error) - - // WriteString takes in a string and returns number of bytes written and error - WriteString(s string) (n int, err error) - - // String method returns a string - String() string - - // Bytes return a byte slice. - Bytes() []byte -} - -// Encoder is an XML encoder that supports construction of XML values -// using methods. The encoder takes in a writer and maintains a scratch buffer. -type Encoder struct { - w writer - scratch *[]byte -} - -// NewEncoder returns an XML encoder -func NewEncoder(w writer) *Encoder { - scratch := make([]byte, 64) - - return &Encoder{w: w, scratch: &scratch} -} - -// String returns the string output of the XML encoder -func (e Encoder) String() string { - return e.w.String() -} - -// Bytes returns the []byte slice of the XML encoder -func (e Encoder) Bytes() []byte { - return e.w.Bytes() -} - -// RootElement builds a root element encoding -// It writes it's start element tag. The value should be closed. -func (e Encoder) RootElement(element StartElement) Value { - return newValue(e.w, e.scratch, element) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/error_utils.go b/vendor/github.com/aws/smithy-go/encoding/xml/error_utils.go deleted file mode 100644 index f3db6ccca..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/error_utils.go +++ /dev/null @@ -1,51 +0,0 @@ -package xml - -import ( - "encoding/xml" - "fmt" - "io" -) - -// ErrorComponents represents the error response fields -// that will be deserialized from an xml error response body -type ErrorComponents struct { - Code string - Message string -} - -// GetErrorResponseComponents returns the error fields from an xml error response body -func GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error) { - if noErrorWrapping { - var errResponse noWrappedErrorResponse - if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { - return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) - } - return ErrorComponents{ - Code: errResponse.Code, - Message: errResponse.Message, - }, nil - } - - var errResponse wrappedErrorResponse - if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { - return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) - } - return ErrorComponents{ - Code: errResponse.Code, - Message: errResponse.Message, - }, nil -} - -// noWrappedErrorResponse represents the error response body with -// no internal ... -type wrappedErrorResponse struct { - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/escape.go b/vendor/github.com/aws/smithy-go/encoding/xml/escape.go deleted file mode 100644 index 1c5479af6..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/escape.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copied and modified from Go 1.14 stdlib's encoding/xml - -package xml - -import ( - "unicode/utf8" -) - -// Copied from Go 1.14 stdlib's encoding/xml -var ( - escQuot = []byte(""") // shorter than """ - escApos = []byte("'") // shorter than "'" - escAmp = []byte("&") - escLT = []byte("<") - escGT = []byte(">") - escTab = []byte(" ") - escNL = []byte(" ") - escCR = []byte(" ") - escFFFD = []byte("\uFFFD") // Unicode replacement character - - // Additional Escapes - escNextLine = []byte("…") - escLS = []byte("
") -) - -// Decide whether the given rune is in the XML Character Range, per -// the Char production of https://www.xml.com/axml/testaxml.htm, -// Section 2.2 Characters. -func isInCharacterRange(r rune) (inrange bool) { - return r == 0x09 || - r == 0x0A || - r == 0x0D || - r >= 0x20 && r <= 0xD7FF || - r >= 0xE000 && r <= 0xFFFD || - r >= 0x10000 && r <= 0x10FFFF -} - -// TODO: When do we need to escape the string? -// Based on encoding/xml escapeString from the Go Standard Library. -// https://golang.org/src/encoding/xml/xml.go -func escapeString(e writer, s string) { - var esc []byte - last := 0 - for i := 0; i < len(s); { - r, width := utf8.DecodeRuneInString(s[i:]) - i += width - switch r { - case '"': - esc = escQuot - case '\'': - esc = escApos - case '&': - esc = escAmp - case '<': - esc = escLT - case '>': - esc = escGT - case '\t': - esc = escTab - case '\n': - esc = escNL - case '\r': - esc = escCR - case '\u0085': - // Not escaped by stdlib - esc = escNextLine - case '\u2028': - // Not escaped by stdlib - esc = escLS - default: - if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { - esc = escFFFD - break - } - continue - } - e.WriteString(s[last : i-width]) - e.Write(esc) - last = i - } - e.WriteString(s[last:]) -} - -// escapeText writes to w the properly escaped XML equivalent -// of the plain text data s. If escapeNewline is true, newline -// characters will be escaped. -// -// Based on encoding/xml escapeText from the Go Standard Library. -// https://golang.org/src/encoding/xml/xml.go -func escapeText(e writer, s []byte) { - var esc []byte - last := 0 - for i := 0; i < len(s); { - r, width := utf8.DecodeRune(s[i:]) - i += width - switch r { - case '"': - esc = escQuot - case '\'': - esc = escApos - case '&': - esc = escAmp - case '<': - esc = escLT - case '>': - esc = escGT - case '\t': - esc = escTab - case '\n': - // This always escapes newline, which is different than stdlib's optional - // escape of new line. - esc = escNL - case '\r': - esc = escCR - case '\u0085': - // Not escaped by stdlib - esc = escNextLine - case '\u2028': - // Not escaped by stdlib - esc = escLS - default: - if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { - esc = escFFFD - break - } - continue - } - e.Write(s[last : i-width]) - e.Write(esc) - last = i - } - e.Write(s[last:]) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/map.go b/vendor/github.com/aws/smithy-go/encoding/xml/map.go deleted file mode 100644 index e42858965..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/map.go +++ /dev/null @@ -1,53 +0,0 @@ -package xml - -// mapEntryWrapper is the default member wrapper start element for XML Map entry -var mapEntryWrapper = StartElement{ - Name: Name{Local: "entry"}, -} - -// Map represents the encoding of a XML map type -type Map struct { - w writer - scratch *[]byte - - // member start element is the map entry wrapper start element - memberStartElement StartElement - - // isFlattened returns true if the map is a flattened map - isFlattened bool -} - -// newMap returns a map encoder which sets the default map -// entry wrapper to `entry`. -// -// A map `someMap : {{key:"abc", value:"123"}}` is represented as -// `abc123`. -func newMap(w writer, scratch *[]byte) *Map { - return &Map{ - w: w, - scratch: scratch, - memberStartElement: mapEntryWrapper, - } -} - -// newFlattenedMap returns a map encoder which sets the map -// entry wrapper to the passed in memberWrapper`. -// -// A flattened map `someMap : {{key:"abc", value:"123"}}` is represented as -// `abc123`. -func newFlattenedMap(w writer, scratch *[]byte, memberWrapper StartElement) *Map { - return &Map{ - w: w, - scratch: scratch, - memberStartElement: memberWrapper, - isFlattened: true, - } -} - -// Entry returns a Value encoder with map's element. -// It writes the member wrapper start tag for each entry. -func (m *Map) Entry() Value { - v := newValue(m.w, m.scratch, m.memberStartElement) - v.isFlattened = m.isFlattened - return v -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/value.go b/vendor/github.com/aws/smithy-go/encoding/xml/value.go deleted file mode 100644 index 09434b2c0..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/value.go +++ /dev/null @@ -1,302 +0,0 @@ -package xml - -import ( - "encoding/base64" - "fmt" - "math/big" - "strconv" - - "github.com/aws/smithy-go/encoding" -) - -// Value represents an XML Value type -// XML Value types: Object, Array, Map, String, Number, Boolean. -type Value struct { - w writer - scratch *[]byte - - // xml start element is the associated start element for the Value - startElement StartElement - - // indicates if the Value represents a flattened shape - isFlattened bool -} - -// newFlattenedValue returns a Value encoder. newFlattenedValue does NOT write the start element tag -func newFlattenedValue(w writer, scratch *[]byte, startElement StartElement) Value { - return Value{ - w: w, - scratch: scratch, - startElement: startElement, - } -} - -// newValue writes the start element xml tag and returns a Value -func newValue(w writer, scratch *[]byte, startElement StartElement) Value { - writeStartElement(w, startElement) - return Value{w: w, scratch: scratch, startElement: startElement} -} - -// writeStartElement takes in a start element and writes it. -// It handles namespace, attributes in start element. -func writeStartElement(w writer, el StartElement) error { - if el.isZero() { - return fmt.Errorf("xml start element cannot be nil") - } - - w.WriteRune(leftAngleBracket) - - if len(el.Name.Space) != 0 { - escapeString(w, el.Name.Space) - w.WriteRune(colon) - } - escapeString(w, el.Name.Local) - for _, attr := range el.Attr { - w.WriteRune(' ') - writeAttribute(w, &attr) - } - - w.WriteRune(rightAngleBracket) - return nil -} - -// writeAttribute writes an attribute from a provided Attribute -// For a namespace attribute, the attr.Name.Space must be defined as "xmlns". -// https://www.w3.org/TR/REC-xml-names/#NT-DefaultAttName -func writeAttribute(w writer, attr *Attr) { - // if local, space both are not empty - if len(attr.Name.Space) != 0 && len(attr.Name.Local) != 0 { - escapeString(w, attr.Name.Space) - w.WriteRune(colon) - } - - // if prefix is empty, the default `xmlns` space should be used as prefix. - if len(attr.Name.Local) == 0 { - attr.Name.Local = attr.Name.Space - } - - escapeString(w, attr.Name.Local) - w.WriteRune(equals) - w.WriteRune(quote) - escapeString(w, attr.Value) - w.WriteRune(quote) -} - -// writeEndElement takes in a end element and writes it. -func writeEndElement(w writer, el EndElement) error { - if el.isZero() { - return fmt.Errorf("xml end element cannot be nil") - } - - w.WriteRune(leftAngleBracket) - w.WriteRune(forwardSlash) - - if len(el.Name.Space) != 0 { - escapeString(w, el.Name.Space) - w.WriteRune(colon) - } - escapeString(w, el.Name.Local) - w.WriteRune(rightAngleBracket) - - return nil -} - -// String encodes v as a XML string. -// It will auto close the parent xml element tag. -func (xv Value) String(v string) { - escapeString(xv.w, v) - xv.Close() -} - -// Byte encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Byte(v int8) { - xv.Long(int64(v)) -} - -// Short encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Short(v int16) { - xv.Long(int64(v)) -} - -// Integer encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Integer(v int32) { - xv.Long(int64(v)) -} - -// Long encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Long(v int64) { - *xv.scratch = strconv.AppendInt((*xv.scratch)[:0], v, 10) - xv.w.Write(*xv.scratch) - - xv.Close() -} - -// Float encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Float(v float32) { - xv.float(float64(v), 32) - xv.Close() -} - -// Double encodes v as a XML number. -// It will auto close the parent xml element tag. -func (xv Value) Double(v float64) { - xv.float(v, 64) - xv.Close() -} - -func (xv Value) float(v float64, bits int) { - *xv.scratch = encoding.EncodeFloat((*xv.scratch)[:0], v, bits) - xv.w.Write(*xv.scratch) -} - -// Boolean encodes v as a XML boolean. -// It will auto close the parent xml element tag. -func (xv Value) Boolean(v bool) { - *xv.scratch = strconv.AppendBool((*xv.scratch)[:0], v) - xv.w.Write(*xv.scratch) - - xv.Close() -} - -// Base64EncodeBytes writes v as a base64 value in XML string. -// It will auto close the parent xml element tag. -func (xv Value) Base64EncodeBytes(v []byte) { - encodeByteSlice(xv.w, (*xv.scratch)[:0], v) - xv.Close() -} - -// BigInteger encodes v big.Int as XML value. -// It will auto close the parent xml element tag. -func (xv Value) BigInteger(v *big.Int) { - xv.w.Write([]byte(v.Text(10))) - xv.Close() -} - -// BigDecimal encodes v big.Float as XML value. -// It will auto close the parent xml element tag. -func (xv Value) BigDecimal(v *big.Float) { - if i, accuracy := v.Int64(); accuracy == big.Exact { - xv.Long(i) - return - } - - xv.w.Write([]byte(v.Text('e', -1))) - xv.Close() -} - -// Write writes v directly to the xml document -// if escapeXMLText is set to true, write will escape text. -// It will auto close the parent xml element tag. -func (xv Value) Write(v []byte, escapeXMLText bool) { - // escape and write xml text - if escapeXMLText { - escapeText(xv.w, v) - } else { - // write xml directly - xv.w.Write(v) - } - - xv.Close() -} - -// MemberElement does member element encoding. It returns a Value. -// Member Element method should be used for all shapes except flattened shapes. -// -// A call to MemberElement will write nested element tags directly using the -// provided start element. The value returned by MemberElement should be closed. -func (xv Value) MemberElement(element StartElement) Value { - return newValue(xv.w, xv.scratch, element) -} - -// FlattenedElement returns flattened element encoding. It returns a Value. -// This method should be used for flattened shapes. -// -// Unlike MemberElement, flattened element will NOT write element tags -// directly for the associated start element. -// -// The value returned by the FlattenedElement does not need to be closed. -func (xv Value) FlattenedElement(element StartElement) Value { - v := newFlattenedValue(xv.w, xv.scratch, element) - v.isFlattened = true - return v -} - -// Array returns an array encoder. By default, the members of array are -// wrapped with `` element tag. -// If value is marked as flattened, the start element is used to wrap the members instead of -// the `` element. -func (xv Value) Array() *Array { - return newArray(xv.w, xv.scratch, arrayMemberWrapper, xv.startElement, xv.isFlattened) -} - -/* -ArrayWithCustomName returns an array encoder. - -It takes named start element as an argument, the named start element will used to wrap xml array entries. -for eg, `entry1` -Here `customName` named start element will be wrapped on each array member. -*/ -func (xv Value) ArrayWithCustomName(element StartElement) *Array { - return newArray(xv.w, xv.scratch, element, xv.startElement, xv.isFlattened) -} - -/* -Map returns a map encoder. By default, the map entries are -wrapped with `` element tag. - -If value is marked as flattened, the start element is used to wrap the entry instead of -the `` element. -*/ -func (xv Value) Map() *Map { - // flattened map - if xv.isFlattened { - return newFlattenedMap(xv.w, xv.scratch, xv.startElement) - } - - // un-flattened map - return newMap(xv.w, xv.scratch) -} - -// encodeByteSlice is modified copy of json encoder's encodeByteSlice. -// It is used to base64 encode a byte slice. -func encodeByteSlice(w writer, scratch []byte, v []byte) { - if v == nil { - return - } - - encodedLen := base64.StdEncoding.EncodedLen(len(v)) - if encodedLen <= len(scratch) { - // If the encoded bytes fit in e.scratch, avoid an extra - // allocation and use the cheaper Encoding.Encode. - dst := scratch[:encodedLen] - base64.StdEncoding.Encode(dst, v) - w.Write(dst) - } else if encodedLen <= 1024 { - // The encoded bytes are short enough to allocate for, and - // Encoding.Encode is still cheaper. - dst := make([]byte, encodedLen) - base64.StdEncoding.Encode(dst, v) - w.Write(dst) - } else { - // The encoded bytes are too long to cheaply allocate, and - // Encoding.Encode is no longer noticeably cheaper. - enc := base64.NewEncoder(base64.StdEncoding, w) - enc.Write(v) - enc.Close() - } -} - -// IsFlattened returns true if value is for flattened shape. -func (xv Value) IsFlattened() bool { - return xv.isFlattened -} - -// Close closes the value. -func (xv Value) Close() { - writeEndElement(xv.w, xv.startElement.End()) -} diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.go b/vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.go deleted file mode 100644 index dc4eebdff..000000000 --- a/vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.go +++ /dev/null @@ -1,154 +0,0 @@ -package xml - -import ( - "encoding/xml" - "fmt" - "strings" -) - -// NodeDecoder is a XML decoder wrapper that is responsible to decoding -// a single XML Node element and it's nested member elements. This wrapper decoder -// takes in the start element of the top level node being decoded. -type NodeDecoder struct { - Decoder *xml.Decoder - StartEl xml.StartElement -} - -// WrapNodeDecoder returns an initialized XMLNodeDecoder -func WrapNodeDecoder(decoder *xml.Decoder, startEl xml.StartElement) NodeDecoder { - return NodeDecoder{ - Decoder: decoder, - StartEl: startEl, - } -} - -// Token on a Node Decoder returns a xml StartElement. It returns a boolean that indicates the -// a token is the node decoder's end node token; and an error which indicates any error -// that occurred while retrieving the start element -func (d NodeDecoder) Token() (t xml.StartElement, done bool, err error) { - for { - token, e := d.Decoder.Token() - if e != nil { - return t, done, e - } - - // check if we reach end of the node being decoded - if el, ok := token.(xml.EndElement); ok { - return t, el == d.StartEl.End(), err - } - - if t, ok := token.(xml.StartElement); ok { - return restoreAttrNamespaces(t), false, err - } - - // skip token if it is a comment or preamble or empty space value due to indentation - // or if it's a value and is not expected - } -} - -// restoreAttrNamespaces update XML attributes to restore the short namespaces found within -// the raw XML document. -func restoreAttrNamespaces(node xml.StartElement) xml.StartElement { - if len(node.Attr) == 0 { - return node - } - - // Generate a mapping of XML namespace values to their short names. - ns := map[string]string{} - for _, a := range node.Attr { - if a.Name.Space == "xmlns" { - ns[a.Value] = a.Name.Local - break - } - } - - for i, a := range node.Attr { - if a.Name.Space == "xmlns" { - continue - } - // By default, xml.Decoder will fully resolve these namespaces. So if you had - // then by default the second attribute would have the `Name.Space` resolved to `baz`. But we need it to - // continue to resolve as `bar` so we can easily identify it later on. - if v, ok := ns[node.Attr[i].Name.Space]; ok { - node.Attr[i].Name.Space = v - } - } - return node -} - -// GetElement looks for the given tag name at the current level, and returns the element if found, and -// skipping over non-matching elements. Returns an error if the node is not found, or if an error occurs while walking -// the document. -func (d NodeDecoder) GetElement(name string) (t xml.StartElement, err error) { - for { - token, done, err := d.Token() - if err != nil { - return t, err - } - if done { - return t, fmt.Errorf("%s node not found", name) - } - switch { - case strings.EqualFold(name, token.Name.Local): - return token, nil - default: - err = d.Decoder.Skip() - if err != nil { - return t, err - } - } - } -} - -// Value provides an abstraction to retrieve char data value within an xml element. -// The method will return an error if it encounters a nested xml element instead of char data. -// This method should only be used to retrieve simple type or blob shape values as []byte. -func (d NodeDecoder) Value() (c []byte, err error) { - t, e := d.Decoder.Token() - if e != nil { - return c, e - } - - endElement := d.StartEl.End() - - switch ev := t.(type) { - case xml.CharData: - c = ev.Copy() - case xml.EndElement: // end tag or self-closing - if ev == endElement { - return []byte{}, err - } - return c, fmt.Errorf("expected value for %v element, got %T type %v instead", d.StartEl.Name.Local, t, t) - default: - return c, fmt.Errorf("expected value for %v element, got %T type %v instead", d.StartEl.Name.Local, t, t) - } - - t, e = d.Decoder.Token() - if e != nil { - return c, e - } - - if ev, ok := t.(xml.EndElement); ok { - if ev == endElement { - return c, err - } - } - - return c, fmt.Errorf("expected end element %v, got %T type %v instead", endElement, t, t) -} - -// FetchRootElement takes in a decoder and returns the first start element within the xml body. -// This function is useful in fetching the start element of an XML response and ignore the -// comments and preamble -func FetchRootElement(decoder *xml.Decoder) (startElement xml.StartElement, err error) { - for { - t, e := decoder.Token() - if e != nil { - return startElement, e - } - - if startElement, ok := t.(xml.StartElement); ok { - return startElement, err - } - } -} diff --git a/vendor/github.com/aws/smithy-go/endpoints/endpoint.go b/vendor/github.com/aws/smithy-go/endpoints/endpoint.go deleted file mode 100644 index f778272be..000000000 --- a/vendor/github.com/aws/smithy-go/endpoints/endpoint.go +++ /dev/null @@ -1,23 +0,0 @@ -package transport - -import ( - "net/http" - "net/url" - - "github.com/aws/smithy-go" -) - -// Endpoint is the endpoint object returned by Endpoint resolution V2 -type Endpoint struct { - // The complete URL minimally specifying the scheme and host. - // May optionally specify the port and base path component. - URI url.URL - - // An optional set of headers to be sent using transport layer headers. - Headers http.Header - - // A grab-bag property map of endpoint attributes. The - // values present here are subject to change, or being add/removed at any - // time. - Properties smithy.Properties -} diff --git a/vendor/github.com/aws/smithy-go/errors.go b/vendor/github.com/aws/smithy-go/errors.go deleted file mode 100644 index d6948d020..000000000 --- a/vendor/github.com/aws/smithy-go/errors.go +++ /dev/null @@ -1,137 +0,0 @@ -package smithy - -import "fmt" - -// APIError provides the generic API and protocol agnostic error type all SDK -// generated exception types will implement. -type APIError interface { - error - - // ErrorCode returns the error code for the API exception. - ErrorCode() string - // ErrorMessage returns the error message for the API exception. - ErrorMessage() string - // ErrorFault returns the fault for the API exception. - ErrorFault() ErrorFault -} - -// GenericAPIError provides a generic concrete API error type that SDKs can use -// to deserialize error responses into. Should be used for unmodeled or untyped -// errors. -type GenericAPIError struct { - Code string - Message string - Fault ErrorFault -} - -// ErrorCode returns the error code for the API exception. -func (e *GenericAPIError) ErrorCode() string { return e.Code } - -// ErrorMessage returns the error message for the API exception. -func (e *GenericAPIError) ErrorMessage() string { return e.Message } - -// ErrorFault returns the fault for the API exception. -func (e *GenericAPIError) ErrorFault() ErrorFault { return e.Fault } - -func (e *GenericAPIError) Error() string { - return fmt.Sprintf("api error %s: %s", e.Code, e.Message) -} - -var _ APIError = (*GenericAPIError)(nil) - -// OperationError decorates an underlying error which occurred while invoking -// an operation with names of the operation and API. -type OperationError struct { - ServiceID string - OperationName string - Err error -} - -// Service returns the name of the API service the error occurred with. -func (e *OperationError) Service() string { return e.ServiceID } - -// Operation returns the name of the API operation the error occurred with. -func (e *OperationError) Operation() string { return e.OperationName } - -// Unwrap returns the nested error if any, or nil. -func (e *OperationError) Unwrap() error { return e.Err } - -func (e *OperationError) Error() string { - return fmt.Sprintf("operation error %s: %s, %v", e.ServiceID, e.OperationName, e.Err) -} - -// DeserializationError provides a wrapper for an error that occurs during -// deserialization. -type DeserializationError struct { - Err error // original error - Snapshot []byte -} - -// Error returns a formatted error for DeserializationError -func (e *DeserializationError) Error() string { - const msg = "deserialization failed" - if e.Err == nil { - return msg - } - return fmt.Sprintf("%s, %v", msg, e.Err) -} - -// Unwrap returns the underlying Error in DeserializationError -func (e *DeserializationError) Unwrap() error { return e.Err } - -// ErrorFault provides the type for a Smithy API error fault. -type ErrorFault int - -// ErrorFault enumeration values -const ( - FaultUnknown ErrorFault = iota - FaultServer - FaultClient -) - -func (f ErrorFault) String() string { - switch f { - case FaultServer: - return "server" - case FaultClient: - return "client" - default: - return "unknown" - } -} - -// SerializationError represents an error that occurred while attempting to serialize a request -type SerializationError struct { - Err error // original error -} - -// Error returns a formatted error for SerializationError -func (e *SerializationError) Error() string { - const msg = "serialization failed" - if e.Err == nil { - return msg - } - return fmt.Sprintf("%s: %v", msg, e.Err) -} - -// Unwrap returns the underlying Error in SerializationError -func (e *SerializationError) Unwrap() error { return e.Err } - -// CanceledError is the error that will be returned by an API request that was -// canceled. API operations given a Context may return this error when -// canceled. -type CanceledError struct { - Err error -} - -// CanceledError returns true to satisfy interfaces checking for canceled errors. -func (*CanceledError) CanceledError() bool { return true } - -// Unwrap returns the underlying error, if there was one. -func (e *CanceledError) Unwrap() error { - return e.Err -} - -func (e *CanceledError) Error() string { - return fmt.Sprintf("canceled, %v", e.Err) -} diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go deleted file mode 100644 index 945db0af3..000000000 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package smithy - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.0" diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE deleted file mode 100644 index fe6a62006..000000000 --- a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go deleted file mode 100644 index 9c9d02b94..000000000 --- a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package singleflight provides a duplicate function call suppression -// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight -// package. The package is forked, because the package a part of the unstable -// and unversioned golang.org/x/sync module. -// -// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight - -package singleflight diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go deleted file mode 100644 index e8a1b17d5..000000000 --- a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package singleflight - -import ( - "bytes" - "errors" - "fmt" - "runtime" - "runtime/debug" - "sync" -) - -// errGoexit indicates the runtime.Goexit was called in -// the user given function. -var errGoexit = errors.New("runtime.Goexit was called") - -// A panicError is an arbitrary value recovered from a panic -// with the stack trace during the execution of given function. -type panicError struct { - value interface{} - stack []byte -} - -// Error implements error interface. -func (p *panicError) Error() string { - return fmt.Sprintf("%v\n\n%s", p.value, p.stack) -} - -func newPanicError(v interface{}) error { - stack := debug.Stack() - - // The first line of the stack trace is of the form "goroutine N [status]:" - // but by the time the panic reaches Do the goroutine may no longer exist - // and its status will have changed. Trim out the misleading line. - if line := bytes.IndexByte(stack[:], '\n'); line >= 0 { - stack = stack[line+1:] - } - return &panicError{value: v, stack: stack} -} - -// call is an in-flight or completed singleflight.Do call -type call struct { - wg sync.WaitGroup - - // These fields are written once before the WaitGroup is done - // and are only read after the WaitGroup is done. - val interface{} - err error - - // forgotten indicates whether Forget was called with this call's key - // while the call was still in flight. - forgotten bool - - // These fields are read and written with the singleflight - // mutex held before the WaitGroup is done, and are read but - // not written after the WaitGroup is done. - dups int - chans []chan<- Result -} - -// Group represents a class of work and forms a namespace in -// which units of work can be executed with duplicate suppression. -type Group struct { - mu sync.Mutex // protects m - m map[string]*call // lazily initialized -} - -// Result holds the results of Do, so they can be passed -// on a channel. -type Result struct { - Val interface{} - Err error - Shared bool -} - -// Do executes and returns the results of the given function, making -// sure that only one execution is in-flight for a given key at a -// time. If a duplicate comes in, the duplicate caller waits for the -// original to complete and receives the same results. -// The return value shared indicates whether v was given to multiple callers. -func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - g.mu.Unlock() - c.wg.Wait() - - if e, ok := c.err.(*panicError); ok { - panic(e) - } else if c.err == errGoexit { - runtime.Goexit() - } - return c.val, c.err, true - } - c := new(call) - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - g.doCall(c, key, fn) - return c.val, c.err, c.dups > 0 -} - -// DoChan is like Do but returns a channel that will receive the -// results when they are ready. -// -// The returned channel will not be closed. -func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { - ch := make(chan Result, 1) - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - c.chans = append(c.chans, ch) - g.mu.Unlock() - return ch - } - c := &call{chans: []chan<- Result{ch}} - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - go g.doCall(c, key, fn) - - return ch -} - -// doCall handles the single call for a key. -func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { - normalReturn := false - recovered := false - - // use double-defer to distinguish panic from runtime.Goexit, - // more details see https://golang.org/cl/134395 - defer func() { - // the given function invoked runtime.Goexit - if !normalReturn && !recovered { - c.err = errGoexit - } - - c.wg.Done() - g.mu.Lock() - defer g.mu.Unlock() - if !c.forgotten { - delete(g.m, key) - } - - if e, ok := c.err.(*panicError); ok { - // In order to prevent the waiting channels from being blocked forever, - // needs to ensure that this panic cannot be recovered. - if len(c.chans) > 0 { - go panic(e) - select {} // Keep this goroutine around so that it will appear in the crash dump. - } else { - panic(e) - } - } else if c.err == errGoexit { - // Already in the process of goexit, no need to call again - } else { - // Normal return - for _, ch := range c.chans { - ch <- Result{c.val, c.err, c.dups > 0} - } - } - }() - - func() { - defer func() { - if !normalReturn { - // Ideally, we would wait to take a stack trace until we've determined - // whether this is a panic or a runtime.Goexit. - // - // Unfortunately, the only way we can distinguish the two is to see - // whether the recover stopped the goroutine from terminating, and by - // the time we know that, the part of the stack trace relevant to the - // panic has been discarded. - if r := recover(); r != nil { - c.err = newPanicError(r) - } - } - }() - - c.val, c.err = fn() - normalReturn = true - }() - - if !normalReturn { - recovered = true - } -} - -// Forget tells the singleflight to forget about a key. Future calls -// to Do for this key will call the function rather than waiting for -// an earlier call to complete. -func (g *Group) Forget(key string) { - g.mu.Lock() - if c, ok := g.m[key]; ok { - c.forgotten = true - } - delete(g.m, key) - g.mu.Unlock() -} diff --git a/vendor/github.com/aws/smithy-go/io/byte.go b/vendor/github.com/aws/smithy-go/io/byte.go deleted file mode 100644 index f8417c15b..000000000 --- a/vendor/github.com/aws/smithy-go/io/byte.go +++ /dev/null @@ -1,12 +0,0 @@ -package io - -const ( - // Byte is 8 bits - Byte int64 = 1 - // KibiByte (KiB) is 1024 Bytes - KibiByte = Byte * 1024 - // MebiByte (MiB) is 1024 KiB - MebiByte = KibiByte * 1024 - // GibiByte (GiB) is 1024 MiB - GibiByte = MebiByte * 1024 -) diff --git a/vendor/github.com/aws/smithy-go/io/doc.go b/vendor/github.com/aws/smithy-go/io/doc.go deleted file mode 100644 index a6a33eaf5..000000000 --- a/vendor/github.com/aws/smithy-go/io/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package io provides utilities for Smithy generated API clients. -package io diff --git a/vendor/github.com/aws/smithy-go/io/reader.go b/vendor/github.com/aws/smithy-go/io/reader.go deleted file mode 100644 index 07063f296..000000000 --- a/vendor/github.com/aws/smithy-go/io/reader.go +++ /dev/null @@ -1,16 +0,0 @@ -package io - -import ( - "io" -) - -// ReadSeekNopCloser wraps an io.ReadSeeker with an additional Close method -// that does nothing. -type ReadSeekNopCloser struct { - io.ReadSeeker -} - -// Close does nothing. -func (ReadSeekNopCloser) Close() error { - return nil -} diff --git a/vendor/github.com/aws/smithy-go/io/ringbuffer.go b/vendor/github.com/aws/smithy-go/io/ringbuffer.go deleted file mode 100644 index 06b476add..000000000 --- a/vendor/github.com/aws/smithy-go/io/ringbuffer.go +++ /dev/null @@ -1,94 +0,0 @@ -package io - -import ( - "bytes" - "io" -) - -// RingBuffer struct satisfies io.ReadWrite interface. -// -// ReadBuffer is a revolving buffer data structure, which can be used to store snapshots of data in a -// revolving window. -type RingBuffer struct { - slice []byte - start int - end int - size int -} - -// NewRingBuffer method takes in a byte slice as an input and returns a RingBuffer. -func NewRingBuffer(slice []byte) *RingBuffer { - ringBuf := RingBuffer{ - slice: slice, - } - return &ringBuf -} - -// Write method inserts the elements in a byte slice, and returns the number of bytes written along with any error. -func (r *RingBuffer) Write(p []byte) (int, error) { - for _, b := range p { - // check if end points to invalid index, we need to circle back - if r.end == len(r.slice) { - r.end = 0 - } - // check if start points to invalid index, we need to circle back - if r.start == len(r.slice) { - r.start = 0 - } - // if ring buffer is filled, increment the start index - if r.size == len(r.slice) { - r.size-- - r.start++ - } - - r.slice[r.end] = b - r.end++ - r.size++ - } - return len(p), nil -} - -// Read copies the data on the ring buffer into the byte slice provided to the method. -// Returns the read count along with any error encountered while reading. -func (r *RingBuffer) Read(p []byte) (int, error) { - // readCount keeps track of the number of bytes read - var readCount int - for j := 0; j < len(p); j++ { - // if ring buffer is empty or completely read - // return EOF error. - if r.size == 0 { - return readCount, io.EOF - } - - if r.start == len(r.slice) { - r.start = 0 - } - - p[j] = r.slice[r.start] - readCount++ - // increment the start pointer for ring buffer - r.start++ - // decrement the size of ring buffer - r.size-- - } - return readCount, nil -} - -// Len returns the number of unread bytes in the buffer. -func (r *RingBuffer) Len() int { - return r.size -} - -// Bytes returns a copy of the RingBuffer's bytes. -func (r RingBuffer) Bytes() []byte { - var b bytes.Buffer - io.Copy(&b, &r) - return b.Bytes() -} - -// Reset resets the ring buffer. -func (r *RingBuffer) Reset() { - *r = RingBuffer{ - slice: r.slice, - } -} diff --git a/vendor/github.com/aws/smithy-go/local-mod-replace.sh b/vendor/github.com/aws/smithy-go/local-mod-replace.sh deleted file mode 100644 index 800bf3769..000000000 --- a/vendor/github.com/aws/smithy-go/local-mod-replace.sh +++ /dev/null @@ -1,39 +0,0 @@ -#1/usr/bin/env bash - -PROJECT_DIR="" -SMITHY_SOURCE_DIR=$(cd `dirname $0` && pwd) - -usage() { - echo "Usage: $0 [-s SMITHY_SOURCE_DIR] [-d PROJECT_DIR]" 1>&2 - exit 1 -} - -while getopts "hs:d:" options; do - case "${options}" in - s) - SMITHY_SOURCE_DIR=${OPTARG} - if [ "$SMITHY_SOURCE_DIR" == "" ]; then - echo "path to smithy-go source directory is required" || exit - usage - fi - ;; - d) - PROJECT_DIR=${OPTARG} - ;; - h) - usage - ;; - *) - usage - ;; - esac -done - -if [ "$PROJECT_DIR" != "" ]; then - cd $PROJECT_DIR || exit -fi - -go mod graph | awk '{print $1}' | cut -d '@' -f 1 | sort | uniq | grep "github.com/aws/smithy-go" | while read x; do - repPath=${x/github.com\/aws\/smithy-go/${SMITHY_SOURCE_DIR}} - echo -replace $x=$repPath -done | xargs go mod edit diff --git a/vendor/github.com/aws/smithy-go/logging/logger.go b/vendor/github.com/aws/smithy-go/logging/logger.go deleted file mode 100644 index 2071924bd..000000000 --- a/vendor/github.com/aws/smithy-go/logging/logger.go +++ /dev/null @@ -1,82 +0,0 @@ -package logging - -import ( - "context" - "io" - "log" -) - -// Classification is the type of the log entry's classification name. -type Classification string - -// Set of standard classifications that can be used by clients and middleware -const ( - Warn Classification = "WARN" - Debug Classification = "DEBUG" -) - -// Logger is an interface for logging entries at certain classifications. -type Logger interface { - // Logf is expected to support the standard fmt package "verbs". - Logf(classification Classification, format string, v ...interface{}) -} - -// LoggerFunc is a wrapper around a function to satisfy the Logger interface. -type LoggerFunc func(classification Classification, format string, v ...interface{}) - -// Logf delegates the logging request to the wrapped function. -func (f LoggerFunc) Logf(classification Classification, format string, v ...interface{}) { - f(classification, format, v...) -} - -// ContextLogger is an optional interface a Logger implementation may expose that provides -// the ability to create context aware log entries. -type ContextLogger interface { - WithContext(context.Context) Logger -} - -// WithContext will pass the provided context to logger if it implements the ContextLogger interface and return the resulting -// logger. Otherwise the logger will be returned as is. As a special case if a nil logger is provided, a Nop logger will -// be returned to the caller. -func WithContext(ctx context.Context, logger Logger) Logger { - if logger == nil { - return Nop{} - } - - cl, ok := logger.(ContextLogger) - if !ok { - return logger - } - - return cl.WithContext(ctx) -} - -// Nop is a Logger implementation that simply does not perform any logging. -type Nop struct{} - -// Logf simply returns without performing any action -func (n Nop) Logf(Classification, string, ...interface{}) { - return -} - -// StandardLogger is a Logger implementation that wraps the standard library logger, and delegates logging to it's -// Printf method. -type StandardLogger struct { - Logger *log.Logger -} - -// Logf logs the given classification and message to the underlying logger. -func (s StandardLogger) Logf(classification Classification, format string, v ...interface{}) { - if len(classification) != 0 { - format = string(classification) + " " + format - } - - s.Logger.Printf(format, v...) -} - -// NewStandardLogger returns a new StandardLogger -func NewStandardLogger(writer io.Writer) *StandardLogger { - return &StandardLogger{ - Logger: log.New(writer, "SDK ", log.LstdFlags), - } -} diff --git a/vendor/github.com/aws/smithy-go/metrics/metrics.go b/vendor/github.com/aws/smithy-go/metrics/metrics.go deleted file mode 100644 index c009d9f27..000000000 --- a/vendor/github.com/aws/smithy-go/metrics/metrics.go +++ /dev/null @@ -1,136 +0,0 @@ -// Package metrics defines the metrics APIs used by Smithy clients. -package metrics - -import ( - "context" - - "github.com/aws/smithy-go" -) - -// MeterProvider is the entry point for creating a Meter. -type MeterProvider interface { - Meter(scope string, opts ...MeterOption) Meter -} - -// MeterOption applies configuration to a Meter. -type MeterOption func(o *MeterOptions) - -// MeterOptions represents configuration for a Meter. -type MeterOptions struct { - Properties smithy.Properties -} - -// Meter is the entry point for creation of measurement instruments. -type Meter interface { - // integer/synchronous - Int64Counter(name string, opts ...InstrumentOption) (Int64Counter, error) - Int64UpDownCounter(name string, opts ...InstrumentOption) (Int64UpDownCounter, error) - Int64Gauge(name string, opts ...InstrumentOption) (Int64Gauge, error) - Int64Histogram(name string, opts ...InstrumentOption) (Int64Histogram, error) - - // integer/asynchronous - Int64AsyncCounter(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) - Int64AsyncUpDownCounter(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) - Int64AsyncGauge(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) - - // floating-point/synchronous - Float64Counter(name string, opts ...InstrumentOption) (Float64Counter, error) - Float64UpDownCounter(name string, opts ...InstrumentOption) (Float64UpDownCounter, error) - Float64Gauge(name string, opts ...InstrumentOption) (Float64Gauge, error) - Float64Histogram(name string, opts ...InstrumentOption) (Float64Histogram, error) - - // floating-point/asynchronous - Float64AsyncCounter(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) - Float64AsyncUpDownCounter(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) - Float64AsyncGauge(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) -} - -// InstrumentOption applies configuration to an instrument. -type InstrumentOption func(o *InstrumentOptions) - -// InstrumentOptions represents configuration for an instrument. -type InstrumentOptions struct { - UnitLabel string - Description string -} - -// Int64Counter measures a monotonically increasing int64 value. -type Int64Counter interface { - Add(context.Context, int64, ...RecordMetricOption) -} - -// Int64UpDownCounter measures a fluctuating int64 value. -type Int64UpDownCounter interface { - Add(context.Context, int64, ...RecordMetricOption) -} - -// Int64Gauge samples a discrete int64 value. -type Int64Gauge interface { - Sample(context.Context, int64, ...RecordMetricOption) -} - -// Int64Histogram records multiple data points for an int64 value. -type Int64Histogram interface { - Record(context.Context, int64, ...RecordMetricOption) -} - -// Float64Counter measures a monotonically increasing float64 value. -type Float64Counter interface { - Add(context.Context, float64, ...RecordMetricOption) -} - -// Float64UpDownCounter measures a fluctuating float64 value. -type Float64UpDownCounter interface { - Add(context.Context, float64, ...RecordMetricOption) -} - -// Float64Gauge samples a discrete float64 value. -type Float64Gauge interface { - Sample(context.Context, float64, ...RecordMetricOption) -} - -// Float64Histogram records multiple data points for an float64 value. -type Float64Histogram interface { - Record(context.Context, float64, ...RecordMetricOption) -} - -// AsyncInstrument is the universal handle returned for creation of all async -// instruments. -// -// Callers use the Stop() API to unregister the callback passed at instrument -// creation. -type AsyncInstrument interface { - Stop() -} - -// Int64Callback describes a function invoked when an async int64 instrument is -// read. -type Int64Callback func(context.Context, Int64Observer) - -// Int64Observer is the interface passed to async int64 instruments. -// -// Callers use the Observe() API of this interface to report metrics to the -// underlying collector. -type Int64Observer interface { - Observe(context.Context, int64, ...RecordMetricOption) -} - -// Float64Callback describes a function invoked when an async float64 -// instrument is read. -type Float64Callback func(context.Context, Float64Observer) - -// Float64Observer is the interface passed to async int64 instruments. -// -// Callers use the Observe() API of this interface to report metrics to the -// underlying collector. -type Float64Observer interface { - Observe(context.Context, float64, ...RecordMetricOption) -} - -// RecordMetricOption applies configuration to a recorded metric. -type RecordMetricOption func(o *RecordMetricOptions) - -// RecordMetricOptions represents configuration for a recorded metric. -type RecordMetricOptions struct { - Properties smithy.Properties -} diff --git a/vendor/github.com/aws/smithy-go/metrics/nop.go b/vendor/github.com/aws/smithy-go/metrics/nop.go deleted file mode 100644 index fb374e1fb..000000000 --- a/vendor/github.com/aws/smithy-go/metrics/nop.go +++ /dev/null @@ -1,67 +0,0 @@ -package metrics - -import "context" - -// NopMeterProvider is a no-op metrics implementation. -type NopMeterProvider struct{} - -var _ MeterProvider = (*NopMeterProvider)(nil) - -// Meter returns a meter which creates no-op instruments. -func (NopMeterProvider) Meter(string, ...MeterOption) Meter { - return nopMeter{} -} - -type nopMeter struct{} - -var _ Meter = (*nopMeter)(nil) - -func (nopMeter) Int64Counter(string, ...InstrumentOption) (Int64Counter, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64UpDownCounter(string, ...InstrumentOption) (Int64UpDownCounter, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64Gauge(string, ...InstrumentOption) (Int64Gauge, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64Histogram(string, ...InstrumentOption) (Int64Histogram, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64AsyncCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64AsyncUpDownCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Int64AsyncGauge(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil -} -func (nopMeter) Float64Counter(string, ...InstrumentOption) (Float64Counter, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64UpDownCounter(string, ...InstrumentOption) (Float64UpDownCounter, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64Gauge(string, ...InstrumentOption) (Float64Gauge, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64Histogram(string, ...InstrumentOption) (Float64Histogram, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64AsyncCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64AsyncUpDownCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil -} -func (nopMeter) Float64AsyncGauge(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil -} - -type nopInstrument[N any] struct{} - -func (nopInstrument[N]) Add(context.Context, N, ...RecordMetricOption) {} -func (nopInstrument[N]) Sample(context.Context, N, ...RecordMetricOption) {} -func (nopInstrument[N]) Record(context.Context, N, ...RecordMetricOption) {} -func (nopInstrument[_]) Stop() {} diff --git a/vendor/github.com/aws/smithy-go/middleware/context.go b/vendor/github.com/aws/smithy-go/middleware/context.go deleted file mode 100644 index f51aa4f04..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/context.go +++ /dev/null @@ -1,41 +0,0 @@ -package middleware - -import "context" - -type ( - serviceIDKey struct{} - operationNameKey struct{} -) - -// WithServiceID adds a service ID to the context, scoped to middleware stack -// values. -// -// This API is called in the client runtime when bootstrapping an operation and -// should not typically be used directly. -func WithServiceID(parent context.Context, id string) context.Context { - return WithStackValue(parent, serviceIDKey{}, id) -} - -// GetServiceID retrieves the service ID from the context. This is typically -// the service shape's name from its Smithy model. Service clients for specific -// systems (e.g. AWS SDK) may use an alternate designated value. -func GetServiceID(ctx context.Context) string { - id, _ := GetStackValue(ctx, serviceIDKey{}).(string) - return id -} - -// WithOperationName adds the operation name to the context, scoped to -// middleware stack values. -// -// This API is called in the client runtime when bootstrapping an operation and -// should not typically be used directly. -func WithOperationName(parent context.Context, id string) context.Context { - return WithStackValue(parent, operationNameKey{}, id) -} - -// GetOperationName retrieves the operation name from the context. This is -// typically the operation shape's name from its Smithy model. -func GetOperationName(ctx context.Context) string { - name, _ := GetStackValue(ctx, operationNameKey{}).(string) - return name -} diff --git a/vendor/github.com/aws/smithy-go/middleware/doc.go b/vendor/github.com/aws/smithy-go/middleware/doc.go deleted file mode 100644 index 9858928a7..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/doc.go +++ /dev/null @@ -1,67 +0,0 @@ -// Package middleware provides transport agnostic middleware for decorating SDK -// handlers. -// -// The Smithy middleware stack provides ordered behavior to be invoked on an -// underlying handler. The stack is separated into steps that are invoked in a -// static order. A step is a collection of middleware that are injected into a -// ordered list defined by the user. The user may add, insert, swap, and remove a -// step's middleware. When the stack is invoked the step middleware become static, -// and their order cannot be modified. -// -// A stack and its step middleware are **not** safe to modify concurrently. -// -// A stack will use the ordered list of middleware to decorate a underlying -// handler. A handler could be something like an HTTP Client that round trips an -// API operation over HTTP. -// -// Smithy Middleware Stack -// -// A Stack is a collection of middleware that wrap a handler. The stack can be -// broken down into discreet steps. Each step may contain zero or more middleware -// specific to that stack's step. -// -// A Stack Step is a predefined set of middleware that are invoked in a static -// order by the Stack. These steps represent fixed points in the middleware stack -// for organizing specific behavior, such as serialize and build. A Stack Step is -// composed of zero or more middleware that are specific to that step. A step may -// define its own set of input/output parameters the generic input/output -// parameters are cast from. A step calls its middleware recursively, before -// calling the next step in the stack returning the result or error of the step -// middleware decorating the underlying handler. -// -// * Initialize: Prepares the input, and sets any default parameters as needed, -// (e.g. idempotency token, and presigned URLs). -// -// * Serialize: Serializes the prepared input into a data structure that can be -// consumed by the target transport's message, (e.g. REST-JSON serialization). -// -// * Build: Adds additional metadata to the serialized transport message, (e.g. -// HTTP's Content-Length header, or body checksum). Decorations and -// modifications to the message should be copied to all message attempts. -// -// * Finalize: Performs final preparations needed before sending the message. The -// message should already be complete by this stage, and is only alternated to -// meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request -// signing). -// -// * Deserialize: Reacts to the handler's response returned by the recipient of -// the request message. Deserializes the response into a structured type or -// error above stacks can react to. -// -// Adding Middleware to a Stack Step -// -// Middleware can be added to a step front or back, or relative, by name, to an -// existing middleware in that stack. If a middleware does not have a name, a -// unique name will be generated at the middleware and be added to the step. -// -// // Create middleware stack -// stack := middleware.NewStack() -// -// // Add middleware to stack steps -// stack.Initialize.Add(paramValidationMiddleware, middleware.After) -// stack.Serialize.Add(marshalOperationFoo, middleware.After) -// stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) -// -// // Invoke middleware on handler. -// resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) -package middleware diff --git a/vendor/github.com/aws/smithy-go/middleware/logging.go b/vendor/github.com/aws/smithy-go/middleware/logging.go deleted file mode 100644 index c2f0dbb6b..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/logging.go +++ /dev/null @@ -1,46 +0,0 @@ -package middleware - -import ( - "context" - - "github.com/aws/smithy-go/logging" -) - -// loggerKey is the context value key for which the logger is associated with. -type loggerKey struct{} - -// GetLogger takes a context to retrieve a Logger from. If no logger is present on the context a logging.Nop logger -// is returned. If the logger retrieved from context supports the ContextLogger interface, the context will be passed -// to the WithContext method and the resulting logger will be returned. Otherwise the stored logger is returned as is. -func GetLogger(ctx context.Context) logging.Logger { - logger, ok := ctx.Value(loggerKey{}).(logging.Logger) - if !ok || logger == nil { - return logging.Nop{} - } - - return logging.WithContext(ctx, logger) -} - -// SetLogger sets the provided logger value on the provided ctx. -func SetLogger(ctx context.Context, logger logging.Logger) context.Context { - return context.WithValue(ctx, loggerKey{}, logger) -} - -type setLogger struct { - Logger logging.Logger -} - -// AddSetLoggerMiddleware adds a middleware that will add the provided logger to the middleware context. -func AddSetLoggerMiddleware(stack *Stack, logger logging.Logger) error { - return stack.Initialize.Add(&setLogger{Logger: logger}, After) -} - -func (a *setLogger) ID() string { - return "SetLogger" -} - -func (a *setLogger) HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) ( - out InitializeOutput, metadata Metadata, err error, -) { - return next.HandleInitialize(SetLogger(ctx, a.Logger), in) -} diff --git a/vendor/github.com/aws/smithy-go/middleware/metadata.go b/vendor/github.com/aws/smithy-go/middleware/metadata.go deleted file mode 100644 index 7bb7dbcf5..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/metadata.go +++ /dev/null @@ -1,65 +0,0 @@ -package middleware - -// MetadataReader provides an interface for reading metadata from the -// underlying metadata container. -type MetadataReader interface { - Get(key interface{}) interface{} -} - -// Metadata provides storing and reading metadata values. Keys may be any -// comparable value type. Get and set will panic if key is not a comparable -// value type. -// -// Metadata uses lazy initialization, and Set method must be called as an -// addressable value, or pointer. Not doing so may cause key/value pair to not -// be set. -type Metadata struct { - values map[interface{}]interface{} -} - -// Get attempts to retrieve the value the key points to. Returns nil if the -// key was not found. -// -// Panics if key type is not comparable. -func (m Metadata) Get(key interface{}) interface{} { - return m.values[key] -} - -// Clone creates a shallow copy of Metadata entries, returning a new Metadata -// value with the original entries copied into it. -func (m Metadata) Clone() Metadata { - vs := make(map[interface{}]interface{}, len(m.values)) - for k, v := range m.values { - vs[k] = v - } - - return Metadata{ - values: vs, - } -} - -// Set stores the value pointed to by the key. If a value already exists at -// that key it will be replaced with the new value. -// -// Set method must be called as an addressable value, or pointer. If Set is not -// called as an addressable value or pointer, the key value pair being set may -// be lost. -// -// Panics if the key type is not comparable. -func (m *Metadata) Set(key, value interface{}) { - if m.values == nil { - m.values = map[interface{}]interface{}{} - } - m.values[key] = value -} - -// Has returns whether the key exists in the metadata. -// -// Panics if the key type is not comparable. -func (m Metadata) Has(key interface{}) bool { - if m.values == nil { - return false - } - _, ok := m.values[key] - return ok -} diff --git a/vendor/github.com/aws/smithy-go/middleware/middleware.go b/vendor/github.com/aws/smithy-go/middleware/middleware.go deleted file mode 100644 index 803b7c751..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/middleware.go +++ /dev/null @@ -1,71 +0,0 @@ -package middleware - -import ( - "context" -) - -// Handler provides the interface for performing the logic to obtain an output, -// or error for the given input. -type Handler interface { - // Handle performs logic to obtain an output for the given input. Handler - // should be decorated with middleware to perform input specific behavior. - Handle(ctx context.Context, input interface{}) ( - output interface{}, metadata Metadata, err error, - ) -} - -// HandlerFunc provides a wrapper around a function pointer to be used as a -// middleware handler. -type HandlerFunc func(ctx context.Context, input interface{}) ( - output interface{}, metadata Metadata, err error, -) - -// Handle invokes the underlying function, returning the result. -func (fn HandlerFunc) Handle(ctx context.Context, input interface{}) ( - output interface{}, metadata Metadata, err error, -) { - return fn(ctx, input) -} - -// Middleware provides the interface to call handlers in a chain. -type Middleware interface { - // ID provides a unique identifier for the middleware. - ID() string - - // Performs the middleware's handling of the input, returning the output, - // or error. The middleware can invoke the next Handler if handling should - // continue. - HandleMiddleware(ctx context.Context, input interface{}, next Handler) ( - output interface{}, metadata Metadata, err error, - ) -} - -// decoratedHandler wraps a middleware in order to to call the next handler in -// the chain. -type decoratedHandler struct { - // The next handler to be called. - Next Handler - - // The current middleware decorating the handler. - With Middleware -} - -// Handle implements the Handler interface to handle a operation invocation. -func (m decoratedHandler) Handle(ctx context.Context, input interface{}) ( - output interface{}, metadata Metadata, err error, -) { - return m.With.HandleMiddleware(ctx, input, m.Next) -} - -// DecorateHandler decorates a handler with a middleware. Wrapping the handler -// with the middleware. -func DecorateHandler(h Handler, with ...Middleware) Handler { - for i := len(with) - 1; i >= 0; i-- { - h = decoratedHandler{ - Next: h, - With: with[i], - } - } - - return h -} diff --git a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go b/vendor/github.com/aws/smithy-go/middleware/ordered_group.go deleted file mode 100644 index 4b195308c..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go +++ /dev/null @@ -1,268 +0,0 @@ -package middleware - -import "fmt" - -// RelativePosition provides specifying the relative position of a middleware -// in an ordered group. -type RelativePosition int - -// Relative position for middleware in steps. -const ( - After RelativePosition = iota - Before -) - -type ider interface { - ID() string -} - -// orderedIDs provides an ordered collection of items with relative ordering -// by name. -type orderedIDs struct { - order *relativeOrder - items map[string]ider -} - -const baseOrderedItems = 5 - -func newOrderedIDs() *orderedIDs { - return &orderedIDs{ - order: newRelativeOrder(), - items: make(map[string]ider, baseOrderedItems), - } -} - -// Add injects the item to the relative position of the item group. Returns an -// error if the item already exists. -func (g *orderedIDs) Add(m ider, pos RelativePosition) error { - id := m.ID() - if len(id) == 0 { - return fmt.Errorf("empty ID, ID must not be empty") - } - - if err := g.order.Add(pos, id); err != nil { - return err - } - - g.items[id] = m - return nil -} - -// Insert injects the item relative to an existing item id. Returns an error if -// the original item does not exist, or the item being added already exists. -func (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) error { - if len(m.ID()) == 0 { - return fmt.Errorf("insert ID must not be empty") - } - if len(relativeTo) == 0 { - return fmt.Errorf("relative to ID must not be empty") - } - - if err := g.order.Insert(relativeTo, pos, m.ID()); err != nil { - return err - } - - g.items[m.ID()] = m - return nil -} - -// Get returns the ider identified by id. If ider is not present, returns false. -func (g *orderedIDs) Get(id string) (ider, bool) { - v, ok := g.items[id] - return v, ok -} - -// Swap removes the item by id, replacing it with the new item. Returns an error -// if the original item doesn't exist. -func (g *orderedIDs) Swap(id string, m ider) (ider, error) { - if len(id) == 0 { - return nil, fmt.Errorf("swap from ID must not be empty") - } - - iderID := m.ID() - if len(iderID) == 0 { - return nil, fmt.Errorf("swap to ID must not be empty") - } - - if err := g.order.Swap(id, iderID); err != nil { - return nil, err - } - - removed := g.items[id] - - delete(g.items, id) - g.items[iderID] = m - - return removed, nil -} - -// Remove removes the item by id. Returns an error if the item -// doesn't exist. -func (g *orderedIDs) Remove(id string) (ider, error) { - if len(id) == 0 { - return nil, fmt.Errorf("remove ID must not be empty") - } - - if err := g.order.Remove(id); err != nil { - return nil, err - } - - removed := g.items[id] - delete(g.items, id) - return removed, nil -} - -func (g *orderedIDs) List() []string { - items := g.order.List() - order := make([]string, len(items)) - copy(order, items) - return order -} - -// Clear removes all entries and slots. -func (g *orderedIDs) Clear() { - g.order.Clear() - g.items = map[string]ider{} -} - -// GetOrder returns the item in the order it should be invoked in. -func (g *orderedIDs) GetOrder() []interface{} { - order := g.order.List() - ordered := make([]interface{}, len(order)) - for i := 0; i < len(order); i++ { - ordered[i] = g.items[order[i]] - } - - return ordered -} - -// relativeOrder provides ordering of item -type relativeOrder struct { - order []string -} - -func newRelativeOrder() *relativeOrder { - return &relativeOrder{ - order: make([]string, 0, baseOrderedItems), - } -} - -// Add inserts an item into the order relative to the position provided. -func (s *relativeOrder) Add(pos RelativePosition, ids ...string) error { - if len(ids) == 0 { - return nil - } - - for _, id := range ids { - if _, ok := s.has(id); ok { - return fmt.Errorf("already exists, %v", id) - } - } - - switch pos { - case Before: - return s.insert(0, Before, ids...) - - case After: - s.order = append(s.order, ids...) - - default: - return fmt.Errorf("invalid position, %v", int(pos)) - } - - return nil -} - -// Insert injects an item before or after the relative item. Returns -// an error if the relative item does not exist. -func (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...string) error { - if len(ids) == 0 { - return nil - } - - for _, id := range ids { - if _, ok := s.has(id); ok { - return fmt.Errorf("already exists, %v", id) - } - } - - i, ok := s.has(relativeTo) - if !ok { - return fmt.Errorf("not found, %v", relativeTo) - } - - return s.insert(i, pos, ids...) -} - -// Swap will replace the item id with the to item. Returns an -// error if the original item id does not exist. Allows swapping out an -// item for another item with the same id. -func (s *relativeOrder) Swap(id, to string) error { - i, ok := s.has(id) - if !ok { - return fmt.Errorf("not found, %v", id) - } - - if _, ok = s.has(to); ok && id != to { - return fmt.Errorf("already exists, %v", to) - } - - s.order[i] = to - return nil -} - -func (s *relativeOrder) Remove(id string) error { - i, ok := s.has(id) - if !ok { - return fmt.Errorf("not found, %v", id) - } - - s.order = append(s.order[:i], s.order[i+1:]...) - return nil -} - -func (s *relativeOrder) List() []string { - return s.order -} - -func (s *relativeOrder) Clear() { - s.order = s.order[0:0] -} - -func (s *relativeOrder) insert(i int, pos RelativePosition, ids ...string) error { - switch pos { - case Before: - n := len(ids) - var src []string - if n <= cap(s.order)-len(s.order) { - s.order = s.order[:len(s.order)+n] - src = s.order - } else { - src = s.order - s.order = make([]string, len(s.order)+n) - copy(s.order[:i], src[:i]) // only when allocating a new slice do we need to copy the front half - } - copy(s.order[i+n:], src[i:]) - copy(s.order[i:], ids) - case After: - if i == len(s.order)-1 || len(s.order) == 0 { - s.order = append(s.order, ids...) - } else { - s.order = append(s.order[:i+1], append(ids, s.order[i+1:]...)...) - } - - default: - return fmt.Errorf("invalid position, %v", int(pos)) - } - - return nil -} - -func (s *relativeOrder) has(id string) (i int, found bool) { - for i := 0; i < len(s.order); i++ { - if s.order[i] == id { - return i, true - } - } - return 0, false -} diff --git a/vendor/github.com/aws/smithy-go/middleware/stack.go b/vendor/github.com/aws/smithy-go/middleware/stack.go deleted file mode 100644 index 45ccb5b93..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/stack.go +++ /dev/null @@ -1,209 +0,0 @@ -package middleware - -import ( - "context" - "io" - "strings" -) - -// Stack provides protocol and transport agnostic set of middleware split into -// distinct steps. Steps have specific transitions between them, that are -// managed by the individual step. -// -// Steps are composed as middleware around the underlying handler in the -// following order: -// -// Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler -// -// Any middleware within the chain may choose to stop and return an error or -// response. Since the middleware decorate the handler like a call stack, each -// middleware will receive the result of the next middleware in the chain. -// Middleware that does not need to react to an input, or result must forward -// along the input down the chain, or return the result back up the chain. -// -// Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler -type Stack struct { - // Initialize prepares the input, and sets any default parameters as - // needed, (e.g. idempotency token, and presigned URLs). - // - // Takes Input Parameters, and returns result or error. - // - // Receives result or error from Serialize step. - Initialize *InitializeStep - - // Serialize serializes the prepared input into a data structure that can be consumed - // by the target transport's message, (e.g. REST-JSON serialization) - // - // Converts Input Parameters into a Request, and returns the result or error. - // - // Receives result or error from Build step. - Serialize *SerializeStep - - // Build adds additional metadata to the serialized transport message - // (e.g. HTTP's Content-Length header, or body checksum). Decorations and - // modifications to the message should be copied to all message attempts. - // - // Takes Request, and returns result or error. - // - // Receives result or error from Finalize step. - Build *BuildStep - - // Finalize performs final preparations needed before sending the message. The - // message should already be complete by this stage, and is only alternated - // to meet the expectations of the recipient (e.g. Retry and AWS SigV4 - // request signing) - // - // Takes Request, and returns result or error. - // - // Receives result or error from Deserialize step. - Finalize *FinalizeStep - - // Deserialize reacts to the handler's response returned by the recipient of the request - // message. Deserializes the response into a structured type or error above - // stacks can react to. - // - // Should only forward Request to underlying handler. - // - // Takes Request, and returns result or error. - // - // Receives raw response, or error from underlying handler. - Deserialize *DeserializeStep - - id string -} - -// NewStack returns an initialize empty stack. -func NewStack(id string, newRequestFn func() interface{}) *Stack { - return &Stack{ - id: id, - Initialize: NewInitializeStep(), - Serialize: NewSerializeStep(newRequestFn), - Build: NewBuildStep(), - Finalize: NewFinalizeStep(), - Deserialize: NewDeserializeStep(), - } -} - -// ID returns the unique ID for the stack as a middleware. -func (s *Stack) ID() string { return s.id } - -// HandleMiddleware invokes the middleware stack decorating the next handler. -// Each step of stack will be invoked in order before calling the next step. -// With the next handler call last. -// -// The input value must be the input parameters of the operation being -// performed. -// -// Will return the result of the operation, or error. -func (s *Stack) HandleMiddleware(ctx context.Context, input interface{}, next Handler) ( - output interface{}, metadata Metadata, err error, -) { - h := DecorateHandler(next, - s.Initialize, - s.Serialize, - s.Build, - s.Finalize, - s.Deserialize, - ) - - return h.Handle(ctx, input) -} - -// List returns a list of all middleware in the stack by step. -func (s *Stack) List() []string { - var l []string - l = append(l, s.id) - - l = append(l, s.Initialize.ID()) - l = append(l, s.Initialize.List()...) - - l = append(l, s.Serialize.ID()) - l = append(l, s.Serialize.List()...) - - l = append(l, s.Build.ID()) - l = append(l, s.Build.List()...) - - l = append(l, s.Finalize.ID()) - l = append(l, s.Finalize.List()...) - - l = append(l, s.Deserialize.ID()) - l = append(l, s.Deserialize.List()...) - - return l -} - -func (s *Stack) String() string { - var b strings.Builder - - w := &indentWriter{w: &b} - - w.WriteLine(s.id) - w.Push() - - writeStepItems(w, s.Initialize) - writeStepItems(w, s.Serialize) - writeStepItems(w, s.Build) - writeStepItems(w, s.Finalize) - writeStepItems(w, s.Deserialize) - - return b.String() -} - -type stackStepper interface { - ID() string - List() []string -} - -func writeStepItems(w *indentWriter, s stackStepper) { - type lister interface { - List() []string - } - - w.WriteLine(s.ID()) - w.Push() - - defer w.Pop() - - // ignore stack to prevent circular iterations - if _, ok := s.(*Stack); ok { - return - } - - for _, id := range s.List() { - w.WriteLine(id) - } -} - -type stringWriter interface { - io.Writer - WriteString(string) (int, error) - WriteRune(rune) (int, error) -} - -type indentWriter struct { - w stringWriter - depth int -} - -const indentDepth = "\t\t\t\t\t\t\t\t\t\t" - -func (w *indentWriter) Push() { - w.depth++ -} - -func (w *indentWriter) Pop() { - w.depth-- - if w.depth < 0 { - w.depth = 0 - } -} - -func (w *indentWriter) WriteLine(v string) { - w.w.WriteString(indentDepth[:w.depth]) - - v = strings.ReplaceAll(v, "\n", "\\n") - v = strings.ReplaceAll(v, "\r", "\\r") - - w.w.WriteString(v) - w.w.WriteRune('\n') -} diff --git a/vendor/github.com/aws/smithy-go/middleware/stack_values.go b/vendor/github.com/aws/smithy-go/middleware/stack_values.go deleted file mode 100644 index ef96009ba..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/stack_values.go +++ /dev/null @@ -1,100 +0,0 @@ -package middleware - -import ( - "context" - "reflect" - "strings" -) - -// WithStackValue adds a key value pair to the context that is intended to be -// scoped to a stack. Use ClearStackValues to get a new context with all stack -// values cleared. -func WithStackValue(ctx context.Context, key, value interface{}) context.Context { - md, _ := ctx.Value(stackValuesKey{}).(*stackValues) - - md = withStackValue(md, key, value) - return context.WithValue(ctx, stackValuesKey{}, md) -} - -// ClearStackValues returns a context without any stack values. -func ClearStackValues(ctx context.Context) context.Context { - return context.WithValue(ctx, stackValuesKey{}, nil) -} - -// GetStackValues returns the value pointed to by the key within the stack -// values, if it is present. -func GetStackValue(ctx context.Context, key interface{}) interface{} { - md, _ := ctx.Value(stackValuesKey{}).(*stackValues) - if md == nil { - return nil - } - - return md.Value(key) -} - -type stackValuesKey struct{} - -type stackValues struct { - key interface{} - value interface{} - parent *stackValues -} - -func withStackValue(parent *stackValues, key, value interface{}) *stackValues { - if key == nil { - panic("nil key") - } - if !reflect.TypeOf(key).Comparable() { - panic("key is not comparable") - } - return &stackValues{key: key, value: value, parent: parent} -} - -func (m *stackValues) Value(key interface{}) interface{} { - if key == m.key { - return m.value - } - - if m.parent == nil { - return nil - } - - return m.parent.Value(key) -} - -func (c *stackValues) String() string { - var str strings.Builder - - cc := c - for cc == nil { - str.WriteString("(" + - reflect.TypeOf(c.key).String() + - ": " + - stringify(cc.value) + - ")") - if cc.parent != nil { - str.WriteString(" -> ") - } - cc = cc.parent - } - str.WriteRune('}') - - return str.String() -} - -type stringer interface { - String() string -} - -// stringify tries a bit to stringify v, without using fmt, since we don't -// want context depending on the unicode tables. This is only used by -// *valueCtx.String(). -func stringify(v interface{}) string { - switch s := v.(type) { - case stringer: - return s.String() - case string: - return s - } - return "" -} diff --git a/vendor/github.com/aws/smithy-go/middleware/step_build.go b/vendor/github.com/aws/smithy-go/middleware/step_build.go deleted file mode 100644 index 7e1d94cae..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/step_build.go +++ /dev/null @@ -1,211 +0,0 @@ -package middleware - -import ( - "context" -) - -// BuildInput provides the input parameters for the BuildMiddleware to consume. -// BuildMiddleware may modify the Request value before forwarding the input -// along to the next BuildHandler. -type BuildInput struct { - Request interface{} -} - -// BuildOutput provides the result returned by the next BuildHandler. -type BuildOutput struct { - Result interface{} -} - -// BuildHandler provides the interface for the next handler the -// BuildMiddleware will call in the middleware chain. -type BuildHandler interface { - HandleBuild(ctx context.Context, in BuildInput) ( - out BuildOutput, metadata Metadata, err error, - ) -} - -// BuildMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next BuildHandler for further -// processing. -type BuildMiddleware interface { - // Unique ID for the middleware in theBuildStep. The step does not allow - // duplicate IDs. - ID() string - - // Invokes the middleware behavior which must delegate to the next handler - // for the middleware chain to continue. The method must return a result or - // error to its caller. - HandleBuild(ctx context.Context, in BuildInput, next BuildHandler) ( - out BuildOutput, metadata Metadata, err error, - ) -} - -// BuildMiddlewareFunc returns a BuildMiddleware with the unique ID provided, -// and the func to be invoked. -func BuildMiddlewareFunc(id string, fn func(context.Context, BuildInput, BuildHandler) (BuildOutput, Metadata, error)) BuildMiddleware { - return buildMiddlewareFunc{ - id: id, - fn: fn, - } -} - -type buildMiddlewareFunc struct { - // Unique ID for the middleware. - id string - - // Middleware function to be called. - fn func(context.Context, BuildInput, BuildHandler) (BuildOutput, Metadata, error) -} - -// ID returns the unique ID for the middleware. -func (s buildMiddlewareFunc) ID() string { return s.id } - -// HandleBuild invokes the middleware Fn. -func (s buildMiddlewareFunc) HandleBuild(ctx context.Context, in BuildInput, next BuildHandler) ( - out BuildOutput, metadata Metadata, err error, -) { - return s.fn(ctx, in, next) -} - -var _ BuildMiddleware = (buildMiddlewareFunc{}) - -// BuildStep provides the ordered grouping of BuildMiddleware to be invoked on -// a handler. -type BuildStep struct { - ids *orderedIDs -} - -// NewBuildStep returns a BuildStep ready to have middleware for -// initialization added to it. -func NewBuildStep() *BuildStep { - return &BuildStep{ - ids: newOrderedIDs(), - } -} - -var _ Middleware = (*BuildStep)(nil) - -// ID returns the unique name of the step as a middleware. -func (s *BuildStep) ID() string { - return "Build stack step" -} - -// HandleMiddleware invokes the middleware by decorating the next handler -// provided. Returns the result of the middleware and handler being invoked. -// -// Implements Middleware interface. -func (s *BuildStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( - out interface{}, metadata Metadata, err error, -) { - order := s.ids.GetOrder() - - var h BuildHandler = buildWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedBuildHandler{ - Next: h, - With: order[i].(BuildMiddleware), - } - } - - sIn := BuildInput{ - Request: in, - } - - res, metadata, err := h.HandleBuild(ctx, sIn) - return res.Result, metadata, err -} - -// Get retrieves the middleware identified by id. If the middleware is not present, returns false. -func (s *BuildStep) Get(id string) (BuildMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { - return nil, false - } - return get.(BuildMiddleware), ok -} - -// Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. -func (s *BuildStep) Add(m BuildMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) -} - -// Insert injects the middleware relative to an existing middleware id. -// Returns an error if the original middleware does not exist, or the middleware -// being added already exists. -func (s *BuildStep) Insert(m BuildMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) -} - -// Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or an error if the middleware to be removed -// doesn't exist. -func (s *BuildStep) Swap(id string, m BuildMiddleware) (BuildMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err - } - - return removed.(BuildMiddleware), nil -} - -// Remove removes the middleware by id. Returns error if the middleware -// doesn't exist. -func (s *BuildStep) Remove(id string) (BuildMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err - } - - return removed.(BuildMiddleware), nil -} - -// List returns a list of the middleware in the step. -func (s *BuildStep) List() []string { - return s.ids.List() -} - -// Clear removes all middleware in the step. -func (s *BuildStep) Clear() { - s.ids.Clear() -} - -type buildWrapHandler struct { - Next Handler -} - -var _ BuildHandler = (*buildWrapHandler)(nil) - -// Implements BuildHandler, converts types and delegates to underlying -// generic handler. -func (w buildWrapHandler) HandleBuild(ctx context.Context, in BuildInput) ( - out BuildOutput, metadata Metadata, err error, -) { - res, metadata, err := w.Next.Handle(ctx, in.Request) - return BuildOutput{ - Result: res, - }, metadata, err -} - -type decoratedBuildHandler struct { - Next BuildHandler - With BuildMiddleware -} - -var _ BuildHandler = (*decoratedBuildHandler)(nil) - -func (h decoratedBuildHandler) HandleBuild(ctx context.Context, in BuildInput) ( - out BuildOutput, metadata Metadata, err error, -) { - return h.With.HandleBuild(ctx, in, h.Next) -} - -// BuildHandlerFunc provides a wrapper around a function to be used as a build middleware handler. -type BuildHandlerFunc func(context.Context, BuildInput) (BuildOutput, Metadata, error) - -// HandleBuild invokes the wrapped function with the provided arguments. -func (b BuildHandlerFunc) HandleBuild(ctx context.Context, in BuildInput) (BuildOutput, Metadata, error) { - return b(ctx, in) -} - -var _ BuildHandler = BuildHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go b/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go deleted file mode 100644 index 448607215..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go +++ /dev/null @@ -1,217 +0,0 @@ -package middleware - -import ( - "context" -) - -// DeserializeInput provides the input parameters for the DeserializeInput to -// consume. DeserializeMiddleware should not modify the Request, and instead -// forward it along to the next DeserializeHandler. -type DeserializeInput struct { - Request interface{} -} - -// DeserializeOutput provides the result returned by the next -// DeserializeHandler. The DeserializeMiddleware should deserialize the -// RawResponse into a Result that can be consumed by middleware higher up in -// the stack. -type DeserializeOutput struct { - RawResponse interface{} - Result interface{} -} - -// DeserializeHandler provides the interface for the next handler the -// DeserializeMiddleware will call in the middleware chain. -type DeserializeHandler interface { - HandleDeserialize(ctx context.Context, in DeserializeInput) ( - out DeserializeOutput, metadata Metadata, err error, - ) -} - -// DeserializeMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next DeserializeHandler for further -// processing. -type DeserializeMiddleware interface { - // ID returns a unique ID for the middleware in the DeserializeStep. The step does not - // allow duplicate IDs. - ID() string - - // HandleDeserialize invokes the middleware behavior which must delegate to the next handler - // for the middleware chain to continue. The method must return a result or - // error to its caller. - HandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) ( - out DeserializeOutput, metadata Metadata, err error, - ) -} - -// DeserializeMiddlewareFunc returns a DeserializeMiddleware with the unique ID -// provided, and the func to be invoked. -func DeserializeMiddlewareFunc(id string, fn func(context.Context, DeserializeInput, DeserializeHandler) (DeserializeOutput, Metadata, error)) DeserializeMiddleware { - return deserializeMiddlewareFunc{ - id: id, - fn: fn, - } -} - -type deserializeMiddlewareFunc struct { - // Unique ID for the middleware. - id string - - // Middleware function to be called. - fn func(context.Context, DeserializeInput, DeserializeHandler) ( - DeserializeOutput, Metadata, error, - ) -} - -// ID returns the unique ID for the middleware. -func (s deserializeMiddlewareFunc) ID() string { return s.id } - -// HandleDeserialize invokes the middleware Fn. -func (s deserializeMiddlewareFunc) HandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) ( - out DeserializeOutput, metadata Metadata, err error, -) { - return s.fn(ctx, in, next) -} - -var _ DeserializeMiddleware = (deserializeMiddlewareFunc{}) - -// DeserializeStep provides the ordered grouping of DeserializeMiddleware to be -// invoked on a handler. -type DeserializeStep struct { - ids *orderedIDs -} - -// NewDeserializeStep returns a DeserializeStep ready to have middleware for -// initialization added to it. -func NewDeserializeStep() *DeserializeStep { - return &DeserializeStep{ - ids: newOrderedIDs(), - } -} - -var _ Middleware = (*DeserializeStep)(nil) - -// ID returns the unique ID of the step as a middleware. -func (s *DeserializeStep) ID() string { - return "Deserialize stack step" -} - -// HandleMiddleware invokes the middleware by decorating the next handler -// provided. Returns the result of the middleware and handler being invoked. -// -// Implements Middleware interface. -func (s *DeserializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( - out interface{}, metadata Metadata, err error, -) { - order := s.ids.GetOrder() - - var h DeserializeHandler = deserializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedDeserializeHandler{ - Next: h, - With: order[i].(DeserializeMiddleware), - } - } - - sIn := DeserializeInput{ - Request: in, - } - - res, metadata, err := h.HandleDeserialize(ctx, sIn) - return res.Result, metadata, err -} - -// Get retrieves the middleware identified by id. If the middleware is not present, returns false. -func (s *DeserializeStep) Get(id string) (DeserializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { - return nil, false - } - return get.(DeserializeMiddleware), ok -} - -// Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. -func (s *DeserializeStep) Add(m DeserializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) -} - -// Insert injects the middleware relative to an existing middleware ID. -// Returns error if the original middleware does not exist, or the middleware -// being added already exists. -func (s *DeserializeStep) Insert(m DeserializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) -} - -// Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or error if the middleware to be removed -// doesn't exist. -func (s *DeserializeStep) Swap(id string, m DeserializeMiddleware) (DeserializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err - } - - return removed.(DeserializeMiddleware), nil -} - -// Remove removes the middleware by id. Returns error if the middleware -// doesn't exist. -func (s *DeserializeStep) Remove(id string) (DeserializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err - } - - return removed.(DeserializeMiddleware), nil -} - -// List returns a list of the middleware in the step. -func (s *DeserializeStep) List() []string { - return s.ids.List() -} - -// Clear removes all middleware in the step. -func (s *DeserializeStep) Clear() { - s.ids.Clear() -} - -type deserializeWrapHandler struct { - Next Handler -} - -var _ DeserializeHandler = (*deserializeWrapHandler)(nil) - -// HandleDeserialize implements DeserializeHandler, converts types and delegates to underlying -// generic handler. -func (w deserializeWrapHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) ( - out DeserializeOutput, metadata Metadata, err error, -) { - resp, metadata, err := w.Next.Handle(ctx, in.Request) - return DeserializeOutput{ - RawResponse: resp, - }, metadata, err -} - -type decoratedDeserializeHandler struct { - Next DeserializeHandler - With DeserializeMiddleware -} - -var _ DeserializeHandler = (*decoratedDeserializeHandler)(nil) - -func (h decoratedDeserializeHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) ( - out DeserializeOutput, metadata Metadata, err error, -) { - return h.With.HandleDeserialize(ctx, in, h.Next) -} - -// DeserializeHandlerFunc provides a wrapper around a function to be used as a deserialize middleware handler. -type DeserializeHandlerFunc func(context.Context, DeserializeInput) (DeserializeOutput, Metadata, error) - -// HandleDeserialize invokes the wrapped function with the given arguments. -func (d DeserializeHandlerFunc) HandleDeserialize(ctx context.Context, in DeserializeInput) (DeserializeOutput, Metadata, error) { - return d(ctx, in) -} - -var _ DeserializeHandler = DeserializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go b/vendor/github.com/aws/smithy-go/middleware/step_finalize.go deleted file mode 100644 index 065e3885d..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go +++ /dev/null @@ -1,211 +0,0 @@ -package middleware - -import "context" - -// FinalizeInput provides the input parameters for the FinalizeMiddleware to -// consume. FinalizeMiddleware may modify the Request value before forwarding -// the FinalizeInput along to the next next FinalizeHandler. -type FinalizeInput struct { - Request interface{} -} - -// FinalizeOutput provides the result returned by the next FinalizeHandler. -type FinalizeOutput struct { - Result interface{} -} - -// FinalizeHandler provides the interface for the next handler the -// FinalizeMiddleware will call in the middleware chain. -type FinalizeHandler interface { - HandleFinalize(ctx context.Context, in FinalizeInput) ( - out FinalizeOutput, metadata Metadata, err error, - ) -} - -// FinalizeMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next FinalizeHandler for further -// processing. -type FinalizeMiddleware interface { - // ID returns a unique ID for the middleware in the FinalizeStep. The step does not - // allow duplicate IDs. - ID() string - - // HandleFinalize invokes the middleware behavior which must delegate to the next handler - // for the middleware chain to continue. The method must return a result or - // error to its caller. - HandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) ( - out FinalizeOutput, metadata Metadata, err error, - ) -} - -// FinalizeMiddlewareFunc returns a FinalizeMiddleware with the unique ID -// provided, and the func to be invoked. -func FinalizeMiddlewareFunc(id string, fn func(context.Context, FinalizeInput, FinalizeHandler) (FinalizeOutput, Metadata, error)) FinalizeMiddleware { - return finalizeMiddlewareFunc{ - id: id, - fn: fn, - } -} - -type finalizeMiddlewareFunc struct { - // Unique ID for the middleware. - id string - - // Middleware function to be called. - fn func(context.Context, FinalizeInput, FinalizeHandler) ( - FinalizeOutput, Metadata, error, - ) -} - -// ID returns the unique ID for the middleware. -func (s finalizeMiddlewareFunc) ID() string { return s.id } - -// HandleFinalize invokes the middleware Fn. -func (s finalizeMiddlewareFunc) HandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) ( - out FinalizeOutput, metadata Metadata, err error, -) { - return s.fn(ctx, in, next) -} - -var _ FinalizeMiddleware = (finalizeMiddlewareFunc{}) - -// FinalizeStep provides the ordered grouping of FinalizeMiddleware to be -// invoked on a handler. -type FinalizeStep struct { - ids *orderedIDs -} - -// NewFinalizeStep returns a FinalizeStep ready to have middleware for -// initialization added to it. -func NewFinalizeStep() *FinalizeStep { - return &FinalizeStep{ - ids: newOrderedIDs(), - } -} - -var _ Middleware = (*FinalizeStep)(nil) - -// ID returns the unique id of the step as a middleware. -func (s *FinalizeStep) ID() string { - return "Finalize stack step" -} - -// HandleMiddleware invokes the middleware by decorating the next handler -// provided. Returns the result of the middleware and handler being invoked. -// -// Implements Middleware interface. -func (s *FinalizeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( - out interface{}, metadata Metadata, err error, -) { - order := s.ids.GetOrder() - - var h FinalizeHandler = finalizeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedFinalizeHandler{ - Next: h, - With: order[i].(FinalizeMiddleware), - } - } - - sIn := FinalizeInput{ - Request: in, - } - - res, metadata, err := h.HandleFinalize(ctx, sIn) - return res.Result, metadata, err -} - -// Get retrieves the middleware identified by id. If the middleware is not present, returns false. -func (s *FinalizeStep) Get(id string) (FinalizeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { - return nil, false - } - return get.(FinalizeMiddleware), ok -} - -// Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. -func (s *FinalizeStep) Add(m FinalizeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) -} - -// Insert injects the middleware relative to an existing middleware ID. -// Returns error if the original middleware does not exist, or the middleware -// being added already exists. -func (s *FinalizeStep) Insert(m FinalizeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) -} - -// Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or error if the middleware to be removed -// doesn't exist. -func (s *FinalizeStep) Swap(id string, m FinalizeMiddleware) (FinalizeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err - } - - return removed.(FinalizeMiddleware), nil -} - -// Remove removes the middleware by id. Returns error if the middleware -// doesn't exist. -func (s *FinalizeStep) Remove(id string) (FinalizeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err - } - - return removed.(FinalizeMiddleware), nil -} - -// List returns a list of the middleware in the step. -func (s *FinalizeStep) List() []string { - return s.ids.List() -} - -// Clear removes all middleware in the step. -func (s *FinalizeStep) Clear() { - s.ids.Clear() -} - -type finalizeWrapHandler struct { - Next Handler -} - -var _ FinalizeHandler = (*finalizeWrapHandler)(nil) - -// HandleFinalize implements FinalizeHandler, converts types and delegates to underlying -// generic handler. -func (w finalizeWrapHandler) HandleFinalize(ctx context.Context, in FinalizeInput) ( - out FinalizeOutput, metadata Metadata, err error, -) { - res, metadata, err := w.Next.Handle(ctx, in.Request) - return FinalizeOutput{ - Result: res, - }, metadata, err -} - -type decoratedFinalizeHandler struct { - Next FinalizeHandler - With FinalizeMiddleware -} - -var _ FinalizeHandler = (*decoratedFinalizeHandler)(nil) - -func (h decoratedFinalizeHandler) HandleFinalize(ctx context.Context, in FinalizeInput) ( - out FinalizeOutput, metadata Metadata, err error, -) { - return h.With.HandleFinalize(ctx, in, h.Next) -} - -// FinalizeHandlerFunc provides a wrapper around a function to be used as a finalize middleware handler. -type FinalizeHandlerFunc func(context.Context, FinalizeInput) (FinalizeOutput, Metadata, error) - -// HandleFinalize invokes the wrapped function with the given arguments. -func (f FinalizeHandlerFunc) HandleFinalize(ctx context.Context, in FinalizeInput) (FinalizeOutput, Metadata, error) { - return f(ctx, in) -} - -var _ FinalizeHandler = FinalizeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go b/vendor/github.com/aws/smithy-go/middleware/step_initialize.go deleted file mode 100644 index fe359144d..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go +++ /dev/null @@ -1,211 +0,0 @@ -package middleware - -import "context" - -// InitializeInput wraps the input parameters for the InitializeMiddlewares to -// consume. InitializeMiddleware may modify the parameter value before -// forwarding it along to the next InitializeHandler. -type InitializeInput struct { - Parameters interface{} -} - -// InitializeOutput provides the result returned by the next InitializeHandler. -type InitializeOutput struct { - Result interface{} -} - -// InitializeHandler provides the interface for the next handler the -// InitializeMiddleware will call in the middleware chain. -type InitializeHandler interface { - HandleInitialize(ctx context.Context, in InitializeInput) ( - out InitializeOutput, metadata Metadata, err error, - ) -} - -// InitializeMiddleware provides the interface for middleware specific to the -// initialize step. Delegates to the next InitializeHandler for further -// processing. -type InitializeMiddleware interface { - // ID returns a unique ID for the middleware in the InitializeStep. The step does not - // allow duplicate IDs. - ID() string - - // HandleInitialize invokes the middleware behavior which must delegate to the next handler - // for the middleware chain to continue. The method must return a result or - // error to its caller. - HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) ( - out InitializeOutput, metadata Metadata, err error, - ) -} - -// InitializeMiddlewareFunc returns a InitializeMiddleware with the unique ID provided, -// and the func to be invoked. -func InitializeMiddlewareFunc(id string, fn func(context.Context, InitializeInput, InitializeHandler) (InitializeOutput, Metadata, error)) InitializeMiddleware { - return initializeMiddlewareFunc{ - id: id, - fn: fn, - } -} - -type initializeMiddlewareFunc struct { - // Unique ID for the middleware. - id string - - // Middleware function to be called. - fn func(context.Context, InitializeInput, InitializeHandler) ( - InitializeOutput, Metadata, error, - ) -} - -// ID returns the unique ID for the middleware. -func (s initializeMiddlewareFunc) ID() string { return s.id } - -// HandleInitialize invokes the middleware Fn. -func (s initializeMiddlewareFunc) HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) ( - out InitializeOutput, metadata Metadata, err error, -) { - return s.fn(ctx, in, next) -} - -var _ InitializeMiddleware = (initializeMiddlewareFunc{}) - -// InitializeStep provides the ordered grouping of InitializeMiddleware to be -// invoked on a handler. -type InitializeStep struct { - ids *orderedIDs -} - -// NewInitializeStep returns an InitializeStep ready to have middleware for -// initialization added to it. -func NewInitializeStep() *InitializeStep { - return &InitializeStep{ - ids: newOrderedIDs(), - } -} - -var _ Middleware = (*InitializeStep)(nil) - -// ID returns the unique ID of the step as a middleware. -func (s *InitializeStep) ID() string { - return "Initialize stack step" -} - -// HandleMiddleware invokes the middleware by decorating the next handler -// provided. Returns the result of the middleware and handler being invoked. -// -// Implements Middleware interface. -func (s *InitializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( - out interface{}, metadata Metadata, err error, -) { - order := s.ids.GetOrder() - - var h InitializeHandler = initializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedInitializeHandler{ - Next: h, - With: order[i].(InitializeMiddleware), - } - } - - sIn := InitializeInput{ - Parameters: in, - } - - res, metadata, err := h.HandleInitialize(ctx, sIn) - return res.Result, metadata, err -} - -// Get retrieves the middleware identified by id. If the middleware is not present, returns false. -func (s *InitializeStep) Get(id string) (InitializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { - return nil, false - } - return get.(InitializeMiddleware), ok -} - -// Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. -func (s *InitializeStep) Add(m InitializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) -} - -// Insert injects the middleware relative to an existing middleware ID. -// Returns error if the original middleware does not exist, or the middleware -// being added already exists. -func (s *InitializeStep) Insert(m InitializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) -} - -// Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or error if the middleware to be removed -// doesn't exist. -func (s *InitializeStep) Swap(id string, m InitializeMiddleware) (InitializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err - } - - return removed.(InitializeMiddleware), nil -} - -// Remove removes the middleware by id. Returns error if the middleware -// doesn't exist. -func (s *InitializeStep) Remove(id string) (InitializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err - } - - return removed.(InitializeMiddleware), nil -} - -// List returns a list of the middleware in the step. -func (s *InitializeStep) List() []string { - return s.ids.List() -} - -// Clear removes all middleware in the step. -func (s *InitializeStep) Clear() { - s.ids.Clear() -} - -type initializeWrapHandler struct { - Next Handler -} - -var _ InitializeHandler = (*initializeWrapHandler)(nil) - -// HandleInitialize implements InitializeHandler, converts types and delegates to underlying -// generic handler. -func (w initializeWrapHandler) HandleInitialize(ctx context.Context, in InitializeInput) ( - out InitializeOutput, metadata Metadata, err error, -) { - res, metadata, err := w.Next.Handle(ctx, in.Parameters) - return InitializeOutput{ - Result: res, - }, metadata, err -} - -type decoratedInitializeHandler struct { - Next InitializeHandler - With InitializeMiddleware -} - -var _ InitializeHandler = (*decoratedInitializeHandler)(nil) - -func (h decoratedInitializeHandler) HandleInitialize(ctx context.Context, in InitializeInput) ( - out InitializeOutput, metadata Metadata, err error, -) { - return h.With.HandleInitialize(ctx, in, h.Next) -} - -// InitializeHandlerFunc provides a wrapper around a function to be used as an initialize middleware handler. -type InitializeHandlerFunc func(context.Context, InitializeInput) (InitializeOutput, Metadata, error) - -// HandleInitialize calls the wrapped function with the provided arguments. -func (i InitializeHandlerFunc) HandleInitialize(ctx context.Context, in InitializeInput) (InitializeOutput, Metadata, error) { - return i(ctx, in) -} - -var _ InitializeHandler = InitializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go b/vendor/github.com/aws/smithy-go/middleware/step_serialize.go deleted file mode 100644 index 114bafced..000000000 --- a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go +++ /dev/null @@ -1,219 +0,0 @@ -package middleware - -import "context" - -// SerializeInput provides the input parameters for the SerializeMiddleware to -// consume. SerializeMiddleware may modify the Request value before forwarding -// SerializeInput along to the next SerializeHandler. The Parameters member -// should not be modified by SerializeMiddleware, InitializeMiddleware should -// be responsible for modifying the provided Parameter value. -type SerializeInput struct { - Parameters interface{} - Request interface{} -} - -// SerializeOutput provides the result returned by the next SerializeHandler. -type SerializeOutput struct { - Result interface{} -} - -// SerializeHandler provides the interface for the next handler the -// SerializeMiddleware will call in the middleware chain. -type SerializeHandler interface { - HandleSerialize(ctx context.Context, in SerializeInput) ( - out SerializeOutput, metadata Metadata, err error, - ) -} - -// SerializeMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next SerializeHandler for further -// processing. -type SerializeMiddleware interface { - // ID returns a unique ID for the middleware in the SerializeStep. The step does not - // allow duplicate IDs. - ID() string - - // HandleSerialize invokes the middleware behavior which must delegate to the next handler - // for the middleware chain to continue. The method must return a result or - // error to its caller. - HandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) ( - out SerializeOutput, metadata Metadata, err error, - ) -} - -// SerializeMiddlewareFunc returns a SerializeMiddleware with the unique ID -// provided, and the func to be invoked. -func SerializeMiddlewareFunc(id string, fn func(context.Context, SerializeInput, SerializeHandler) (SerializeOutput, Metadata, error)) SerializeMiddleware { - return serializeMiddlewareFunc{ - id: id, - fn: fn, - } -} - -type serializeMiddlewareFunc struct { - // Unique ID for the middleware. - id string - - // Middleware function to be called. - fn func(context.Context, SerializeInput, SerializeHandler) ( - SerializeOutput, Metadata, error, - ) -} - -// ID returns the unique ID for the middleware. -func (s serializeMiddlewareFunc) ID() string { return s.id } - -// HandleSerialize invokes the middleware Fn. -func (s serializeMiddlewareFunc) HandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) ( - out SerializeOutput, metadata Metadata, err error, -) { - return s.fn(ctx, in, next) -} - -var _ SerializeMiddleware = (serializeMiddlewareFunc{}) - -// SerializeStep provides the ordered grouping of SerializeMiddleware to be -// invoked on a handler. -type SerializeStep struct { - newRequest func() interface{} - ids *orderedIDs -} - -// NewSerializeStep returns a SerializeStep ready to have middleware for -// initialization added to it. The newRequest func parameter is used to -// initialize the transport specific request for the stack SerializeStep to -// serialize the input parameters into. -func NewSerializeStep(newRequest func() interface{}) *SerializeStep { - return &SerializeStep{ - ids: newOrderedIDs(), - newRequest: newRequest, - } -} - -var _ Middleware = (*SerializeStep)(nil) - -// ID returns the unique ID of the step as a middleware. -func (s *SerializeStep) ID() string { - return "Serialize stack step" -} - -// HandleMiddleware invokes the middleware by decorating the next handler -// provided. Returns the result of the middleware and handler being invoked. -// -// Implements Middleware interface. -func (s *SerializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( - out interface{}, metadata Metadata, err error, -) { - order := s.ids.GetOrder() - - var h SerializeHandler = serializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedSerializeHandler{ - Next: h, - With: order[i].(SerializeMiddleware), - } - } - - sIn := SerializeInput{ - Parameters: in, - Request: s.newRequest(), - } - - res, metadata, err := h.HandleSerialize(ctx, sIn) - return res.Result, metadata, err -} - -// Get retrieves the middleware identified by id. If the middleware is not present, returns false. -func (s *SerializeStep) Get(id string) (SerializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { - return nil, false - } - return get.(SerializeMiddleware), ok -} - -// Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. -func (s *SerializeStep) Add(m SerializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) -} - -// Insert injects the middleware relative to an existing middleware ID. -// Returns error if the original middleware does not exist, or the middleware -// being added already exists. -func (s *SerializeStep) Insert(m SerializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) -} - -// Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or error if the middleware to be removed -// doesn't exist. -func (s *SerializeStep) Swap(id string, m SerializeMiddleware) (SerializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err - } - - return removed.(SerializeMiddleware), nil -} - -// Remove removes the middleware by id. Returns error if the middleware -// doesn't exist. -func (s *SerializeStep) Remove(id string) (SerializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err - } - - return removed.(SerializeMiddleware), nil -} - -// List returns a list of the middleware in the step. -func (s *SerializeStep) List() []string { - return s.ids.List() -} - -// Clear removes all middleware in the step. -func (s *SerializeStep) Clear() { - s.ids.Clear() -} - -type serializeWrapHandler struct { - Next Handler -} - -var _ SerializeHandler = (*serializeWrapHandler)(nil) - -// Implements SerializeHandler, converts types and delegates to underlying -// generic handler. -func (w serializeWrapHandler) HandleSerialize(ctx context.Context, in SerializeInput) ( - out SerializeOutput, metadata Metadata, err error, -) { - res, metadata, err := w.Next.Handle(ctx, in.Request) - return SerializeOutput{ - Result: res, - }, metadata, err -} - -type decoratedSerializeHandler struct { - Next SerializeHandler - With SerializeMiddleware -} - -var _ SerializeHandler = (*decoratedSerializeHandler)(nil) - -func (h decoratedSerializeHandler) HandleSerialize(ctx context.Context, in SerializeInput) ( - out SerializeOutput, metadata Metadata, err error, -) { - return h.With.HandleSerialize(ctx, in, h.Next) -} - -// SerializeHandlerFunc provides a wrapper around a function to be used as a serialize middleware handler. -type SerializeHandlerFunc func(context.Context, SerializeInput) (SerializeOutput, Metadata, error) - -// HandleSerialize calls the wrapped function with the provided arguments. -func (s SerializeHandlerFunc) HandleSerialize(ctx context.Context, in SerializeInput) (SerializeOutput, Metadata, error) { - return s(ctx, in) -} - -var _ SerializeHandler = SerializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/modman.toml b/vendor/github.com/aws/smithy-go/modman.toml deleted file mode 100644 index aac582fa2..000000000 --- a/vendor/github.com/aws/smithy-go/modman.toml +++ /dev/null @@ -1,9 +0,0 @@ -[dependencies] - -[modules] - - [modules.codegen] - no_tag = true - - [modules."codegen/smithy-go-codegen/build/test-generated/go/internal/testmodule"] - no_tag = true diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go deleted file mode 100644 index 004d78f21..000000000 --- a/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go +++ /dev/null @@ -1,30 +0,0 @@ -package requestcompression - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" -) - -func gzipCompress(input io.Reader) ([]byte, error) { - var b bytes.Buffer - w, err := gzip.NewWriterLevel(&b, gzip.DefaultCompression) - if err != nil { - return nil, fmt.Errorf("failed to create gzip writer, %v", err) - } - - inBytes, err := io.ReadAll(input) - if err != nil { - return nil, fmt.Errorf("failed read payload to compress, %v", err) - } - - if _, err = w.Write(inBytes); err != nil { - return nil, fmt.Errorf("failed to write payload to be compressed, %v", err) - } - if err = w.Close(); err != nil { - return nil, fmt.Errorf("failed to flush payload being compressed, %v", err) - } - - return b.Bytes(), nil -} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go deleted file mode 100644 index 06c16afc1..000000000 --- a/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go +++ /dev/null @@ -1,52 +0,0 @@ -package requestcompression - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "net/http" -) - -const captureUncompressedRequestID = "CaptureUncompressedRequest" - -// AddCaptureUncompressedRequestMiddleware captures http request before compress encoding for check -func AddCaptureUncompressedRequestMiddleware(stack *middleware.Stack, buf *bytes.Buffer) error { - return stack.Serialize.Insert(&captureUncompressedRequestMiddleware{ - buf: buf, - }, "RequestCompression", middleware.Before) -} - -type captureUncompressedRequestMiddleware struct { - req *http.Request - buf *bytes.Buffer - bytes []byte -} - -// ID returns id of the captureUncompressedRequestMiddleware -func (*captureUncompressedRequestMiddleware) ID() string { - return captureUncompressedRequestID -} - -// HandleSerialize captures request payload before it is compressed by request compression middleware -func (m *captureUncompressedRequestMiddleware) HandleSerialize(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, -) ( - output middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := input.Request.(*smithyhttp.Request) - if !ok { - return output, metadata, fmt.Errorf("error when retrieving http request") - } - - _, err = io.Copy(m.buf, request.GetStream()) - if err != nil { - return output, metadata, fmt.Errorf("error when copying http request stream: %q", err) - } - if err = request.RewindStream(); err != nil { - return output, metadata, fmt.Errorf("error when rewinding request stream: %q", err) - } - - return next.HandleSerialize(ctx, input) -} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go deleted file mode 100644 index 7c4147603..000000000 --- a/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go +++ /dev/null @@ -1,103 +0,0 @@ -// Package requestcompression implements runtime support for smithy-modeled -// request compression. -// -// This package is designated as private and is intended for use only by the -// smithy client runtime. The exported API therein is not considered stable and -// is subject to breaking changes without notice. -package requestcompression - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/transport/http" - "io" -) - -const MaxRequestMinCompressSizeBytes = 10485760 - -// Enumeration values for supported compress Algorithms. -const ( - GZIP = "gzip" -) - -type compressFunc func(io.Reader) ([]byte, error) - -var allowedAlgorithms = map[string]compressFunc{ - GZIP: gzipCompress, -} - -// AddRequestCompression add requestCompression middleware to op stack -func AddRequestCompression(stack *middleware.Stack, disabled bool, minBytes int64, algorithms []string) error { - return stack.Serialize.Add(&requestCompression{ - disableRequestCompression: disabled, - requestMinCompressSizeBytes: minBytes, - compressAlgorithms: algorithms, - }, middleware.After) -} - -type requestCompression struct { - disableRequestCompression bool - requestMinCompressSizeBytes int64 - compressAlgorithms []string -} - -// ID returns the ID of the middleware -func (m requestCompression) ID() string { - return "RequestCompression" -} - -// HandleSerialize gzip compress the request's stream/body if enabled by config fields -func (m requestCompression) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if m.disableRequestCompression { - return next.HandleSerialize(ctx, in) - } - // still need to check requestMinCompressSizeBytes in case it is out of range after service client config - if m.requestMinCompressSizeBytes < 0 || m.requestMinCompressSizeBytes > MaxRequestMinCompressSizeBytes { - return out, metadata, fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", m.requestMinCompressSizeBytes) - } - - req, ok := in.Request.(*http.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown request type %T", req) - } - - for _, algorithm := range m.compressAlgorithms { - compressFunc := allowedAlgorithms[algorithm] - if compressFunc != nil { - if stream := req.GetStream(); stream != nil { - size, found, err := req.StreamLength() - if err != nil { - return out, metadata, fmt.Errorf("error while finding request stream length, %v", err) - } else if !found || size < m.requestMinCompressSizeBytes { - return next.HandleSerialize(ctx, in) - } - - compressedBytes, err := compressFunc(stream) - if err != nil { - return out, metadata, fmt.Errorf("failed to compress request stream, %v", err) - } - - var newReq *http.Request - if newReq, err = req.SetStream(bytes.NewReader(compressedBytes)); err != nil { - return out, metadata, fmt.Errorf("failed to set request stream, %v", err) - } - *req = *newReq - - if val := req.Header.Get("Content-Encoding"); val != "" { - req.Header.Set("Content-Encoding", fmt.Sprintf("%s, %s", val, algorithm)) - } else { - req.Header.Set("Content-Encoding", algorithm) - } - } - break - } - } - - return next.HandleSerialize(ctx, in) -} diff --git a/vendor/github.com/aws/smithy-go/properties.go b/vendor/github.com/aws/smithy-go/properties.go deleted file mode 100644 index 68df4c4e0..000000000 --- a/vendor/github.com/aws/smithy-go/properties.go +++ /dev/null @@ -1,69 +0,0 @@ -package smithy - -import "maps" - -// PropertiesReader provides an interface for reading metadata from the -// underlying metadata container. -type PropertiesReader interface { - Get(key any) any -} - -// Properties provides storing and reading metadata values. Keys may be any -// comparable value type. Get and Set will panic if a key is not comparable. -// -// The zero value for a Properties instance is ready for reads/writes without -// any additional initialization. -type Properties struct { - values map[any]any -} - -// Get attempts to retrieve the value the key points to. Returns nil if the -// key was not found. -// -// Panics if key type is not comparable. -func (m *Properties) Get(key any) any { - m.lazyInit() - return m.values[key] -} - -// Set stores the value pointed to by the key. If a value already exists at -// that key it will be replaced with the new value. -// -// Panics if the key type is not comparable. -func (m *Properties) Set(key, value any) { - m.lazyInit() - m.values[key] = value -} - -// Has returns whether the key exists in the metadata. -// -// Panics if the key type is not comparable. -func (m *Properties) Has(key any) bool { - m.lazyInit() - _, ok := m.values[key] - return ok -} - -// SetAll accepts all of the given Properties into the receiver, overwriting -// any existing keys in the case of conflicts. -func (m *Properties) SetAll(other *Properties) { - if other.values == nil { - return - } - - m.lazyInit() - for k, v := range other.values { - m.values[k] = v - } -} - -// Values returns a shallow clone of the property set's values. -func (m *Properties) Values() map[any]any { - return maps.Clone(m.values) -} - -func (m *Properties) lazyInit() { - if m.values == nil { - m.values = map[any]any{} - } -} diff --git a/vendor/github.com/aws/smithy-go/ptr/doc.go b/vendor/github.com/aws/smithy-go/ptr/doc.go deleted file mode 100644 index bc1f69961..000000000 --- a/vendor/github.com/aws/smithy-go/ptr/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package ptr provides utilities for converting scalar literal type values to and from pointers inline. -package ptr - -//go:generate go run -tags codegen generate.go -//go:generate gofmt -w -s . diff --git a/vendor/github.com/aws/smithy-go/ptr/from_ptr.go b/vendor/github.com/aws/smithy-go/ptr/from_ptr.go deleted file mode 100644 index a2845bb2c..000000000 --- a/vendor/github.com/aws/smithy-go/ptr/from_ptr.go +++ /dev/null @@ -1,601 +0,0 @@ -// Code generated by smithy-go/ptr/generate.go DO NOT EDIT. -package ptr - -import ( - "time" -) - -// ToBool returns bool value dereferenced if the passed -// in pointer was not nil. Returns a bool zero value if the -// pointer was nil. -func ToBool(p *bool) (v bool) { - if p == nil { - return v - } - - return *p -} - -// ToBoolSlice returns a slice of bool values, that are -// dereferenced if the passed in pointer was not nil. Returns a bool -// zero value if the pointer was nil. -func ToBoolSlice(vs []*bool) []bool { - ps := make([]bool, len(vs)) - for i, v := range vs { - ps[i] = ToBool(v) - } - - return ps -} - -// ToBoolMap returns a map of bool values, that are -// dereferenced if the passed in pointer was not nil. The bool -// zero value is used if the pointer was nil. -func ToBoolMap(vs map[string]*bool) map[string]bool { - ps := make(map[string]bool, len(vs)) - for k, v := range vs { - ps[k] = ToBool(v) - } - - return ps -} - -// ToByte returns byte value dereferenced if the passed -// in pointer was not nil. Returns a byte zero value if the -// pointer was nil. -func ToByte(p *byte) (v byte) { - if p == nil { - return v - } - - return *p -} - -// ToByteSlice returns a slice of byte values, that are -// dereferenced if the passed in pointer was not nil. Returns a byte -// zero value if the pointer was nil. -func ToByteSlice(vs []*byte) []byte { - ps := make([]byte, len(vs)) - for i, v := range vs { - ps[i] = ToByte(v) - } - - return ps -} - -// ToByteMap returns a map of byte values, that are -// dereferenced if the passed in pointer was not nil. The byte -// zero value is used if the pointer was nil. -func ToByteMap(vs map[string]*byte) map[string]byte { - ps := make(map[string]byte, len(vs)) - for k, v := range vs { - ps[k] = ToByte(v) - } - - return ps -} - -// ToString returns string value dereferenced if the passed -// in pointer was not nil. Returns a string zero value if the -// pointer was nil. -func ToString(p *string) (v string) { - if p == nil { - return v - } - - return *p -} - -// ToStringSlice returns a slice of string values, that are -// dereferenced if the passed in pointer was not nil. Returns a string -// zero value if the pointer was nil. -func ToStringSlice(vs []*string) []string { - ps := make([]string, len(vs)) - for i, v := range vs { - ps[i] = ToString(v) - } - - return ps -} - -// ToStringMap returns a map of string values, that are -// dereferenced if the passed in pointer was not nil. The string -// zero value is used if the pointer was nil. -func ToStringMap(vs map[string]*string) map[string]string { - ps := make(map[string]string, len(vs)) - for k, v := range vs { - ps[k] = ToString(v) - } - - return ps -} - -// ToInt returns int value dereferenced if the passed -// in pointer was not nil. Returns a int zero value if the -// pointer was nil. -func ToInt(p *int) (v int) { - if p == nil { - return v - } - - return *p -} - -// ToIntSlice returns a slice of int values, that are -// dereferenced if the passed in pointer was not nil. Returns a int -// zero value if the pointer was nil. -func ToIntSlice(vs []*int) []int { - ps := make([]int, len(vs)) - for i, v := range vs { - ps[i] = ToInt(v) - } - - return ps -} - -// ToIntMap returns a map of int values, that are -// dereferenced if the passed in pointer was not nil. The int -// zero value is used if the pointer was nil. -func ToIntMap(vs map[string]*int) map[string]int { - ps := make(map[string]int, len(vs)) - for k, v := range vs { - ps[k] = ToInt(v) - } - - return ps -} - -// ToInt8 returns int8 value dereferenced if the passed -// in pointer was not nil. Returns a int8 zero value if the -// pointer was nil. -func ToInt8(p *int8) (v int8) { - if p == nil { - return v - } - - return *p -} - -// ToInt8Slice returns a slice of int8 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int8 -// zero value if the pointer was nil. -func ToInt8Slice(vs []*int8) []int8 { - ps := make([]int8, len(vs)) - for i, v := range vs { - ps[i] = ToInt8(v) - } - - return ps -} - -// ToInt8Map returns a map of int8 values, that are -// dereferenced if the passed in pointer was not nil. The int8 -// zero value is used if the pointer was nil. -func ToInt8Map(vs map[string]*int8) map[string]int8 { - ps := make(map[string]int8, len(vs)) - for k, v := range vs { - ps[k] = ToInt8(v) - } - - return ps -} - -// ToInt16 returns int16 value dereferenced if the passed -// in pointer was not nil. Returns a int16 zero value if the -// pointer was nil. -func ToInt16(p *int16) (v int16) { - if p == nil { - return v - } - - return *p -} - -// ToInt16Slice returns a slice of int16 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int16 -// zero value if the pointer was nil. -func ToInt16Slice(vs []*int16) []int16 { - ps := make([]int16, len(vs)) - for i, v := range vs { - ps[i] = ToInt16(v) - } - - return ps -} - -// ToInt16Map returns a map of int16 values, that are -// dereferenced if the passed in pointer was not nil. The int16 -// zero value is used if the pointer was nil. -func ToInt16Map(vs map[string]*int16) map[string]int16 { - ps := make(map[string]int16, len(vs)) - for k, v := range vs { - ps[k] = ToInt16(v) - } - - return ps -} - -// ToInt32 returns int32 value dereferenced if the passed -// in pointer was not nil. Returns a int32 zero value if the -// pointer was nil. -func ToInt32(p *int32) (v int32) { - if p == nil { - return v - } - - return *p -} - -// ToInt32Slice returns a slice of int32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int32 -// zero value if the pointer was nil. -func ToInt32Slice(vs []*int32) []int32 { - ps := make([]int32, len(vs)) - for i, v := range vs { - ps[i] = ToInt32(v) - } - - return ps -} - -// ToInt32Map returns a map of int32 values, that are -// dereferenced if the passed in pointer was not nil. The int32 -// zero value is used if the pointer was nil. -func ToInt32Map(vs map[string]*int32) map[string]int32 { - ps := make(map[string]int32, len(vs)) - for k, v := range vs { - ps[k] = ToInt32(v) - } - - return ps -} - -// ToInt64 returns int64 value dereferenced if the passed -// in pointer was not nil. Returns a int64 zero value if the -// pointer was nil. -func ToInt64(p *int64) (v int64) { - if p == nil { - return v - } - - return *p -} - -// ToInt64Slice returns a slice of int64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a int64 -// zero value if the pointer was nil. -func ToInt64Slice(vs []*int64) []int64 { - ps := make([]int64, len(vs)) - for i, v := range vs { - ps[i] = ToInt64(v) - } - - return ps -} - -// ToInt64Map returns a map of int64 values, that are -// dereferenced if the passed in pointer was not nil. The int64 -// zero value is used if the pointer was nil. -func ToInt64Map(vs map[string]*int64) map[string]int64 { - ps := make(map[string]int64, len(vs)) - for k, v := range vs { - ps[k] = ToInt64(v) - } - - return ps -} - -// ToUint returns uint value dereferenced if the passed -// in pointer was not nil. Returns a uint zero value if the -// pointer was nil. -func ToUint(p *uint) (v uint) { - if p == nil { - return v - } - - return *p -} - -// ToUintSlice returns a slice of uint values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint -// zero value if the pointer was nil. -func ToUintSlice(vs []*uint) []uint { - ps := make([]uint, len(vs)) - for i, v := range vs { - ps[i] = ToUint(v) - } - - return ps -} - -// ToUintMap returns a map of uint values, that are -// dereferenced if the passed in pointer was not nil. The uint -// zero value is used if the pointer was nil. -func ToUintMap(vs map[string]*uint) map[string]uint { - ps := make(map[string]uint, len(vs)) - for k, v := range vs { - ps[k] = ToUint(v) - } - - return ps -} - -// ToUint8 returns uint8 value dereferenced if the passed -// in pointer was not nil. Returns a uint8 zero value if the -// pointer was nil. -func ToUint8(p *uint8) (v uint8) { - if p == nil { - return v - } - - return *p -} - -// ToUint8Slice returns a slice of uint8 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint8 -// zero value if the pointer was nil. -func ToUint8Slice(vs []*uint8) []uint8 { - ps := make([]uint8, len(vs)) - for i, v := range vs { - ps[i] = ToUint8(v) - } - - return ps -} - -// ToUint8Map returns a map of uint8 values, that are -// dereferenced if the passed in pointer was not nil. The uint8 -// zero value is used if the pointer was nil. -func ToUint8Map(vs map[string]*uint8) map[string]uint8 { - ps := make(map[string]uint8, len(vs)) - for k, v := range vs { - ps[k] = ToUint8(v) - } - - return ps -} - -// ToUint16 returns uint16 value dereferenced if the passed -// in pointer was not nil. Returns a uint16 zero value if the -// pointer was nil. -func ToUint16(p *uint16) (v uint16) { - if p == nil { - return v - } - - return *p -} - -// ToUint16Slice returns a slice of uint16 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint16 -// zero value if the pointer was nil. -func ToUint16Slice(vs []*uint16) []uint16 { - ps := make([]uint16, len(vs)) - for i, v := range vs { - ps[i] = ToUint16(v) - } - - return ps -} - -// ToUint16Map returns a map of uint16 values, that are -// dereferenced if the passed in pointer was not nil. The uint16 -// zero value is used if the pointer was nil. -func ToUint16Map(vs map[string]*uint16) map[string]uint16 { - ps := make(map[string]uint16, len(vs)) - for k, v := range vs { - ps[k] = ToUint16(v) - } - - return ps -} - -// ToUint32 returns uint32 value dereferenced if the passed -// in pointer was not nil. Returns a uint32 zero value if the -// pointer was nil. -func ToUint32(p *uint32) (v uint32) { - if p == nil { - return v - } - - return *p -} - -// ToUint32Slice returns a slice of uint32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint32 -// zero value if the pointer was nil. -func ToUint32Slice(vs []*uint32) []uint32 { - ps := make([]uint32, len(vs)) - for i, v := range vs { - ps[i] = ToUint32(v) - } - - return ps -} - -// ToUint32Map returns a map of uint32 values, that are -// dereferenced if the passed in pointer was not nil. The uint32 -// zero value is used if the pointer was nil. -func ToUint32Map(vs map[string]*uint32) map[string]uint32 { - ps := make(map[string]uint32, len(vs)) - for k, v := range vs { - ps[k] = ToUint32(v) - } - - return ps -} - -// ToUint64 returns uint64 value dereferenced if the passed -// in pointer was not nil. Returns a uint64 zero value if the -// pointer was nil. -func ToUint64(p *uint64) (v uint64) { - if p == nil { - return v - } - - return *p -} - -// ToUint64Slice returns a slice of uint64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a uint64 -// zero value if the pointer was nil. -func ToUint64Slice(vs []*uint64) []uint64 { - ps := make([]uint64, len(vs)) - for i, v := range vs { - ps[i] = ToUint64(v) - } - - return ps -} - -// ToUint64Map returns a map of uint64 values, that are -// dereferenced if the passed in pointer was not nil. The uint64 -// zero value is used if the pointer was nil. -func ToUint64Map(vs map[string]*uint64) map[string]uint64 { - ps := make(map[string]uint64, len(vs)) - for k, v := range vs { - ps[k] = ToUint64(v) - } - - return ps -} - -// ToFloat32 returns float32 value dereferenced if the passed -// in pointer was not nil. Returns a float32 zero value if the -// pointer was nil. -func ToFloat32(p *float32) (v float32) { - if p == nil { - return v - } - - return *p -} - -// ToFloat32Slice returns a slice of float32 values, that are -// dereferenced if the passed in pointer was not nil. Returns a float32 -// zero value if the pointer was nil. -func ToFloat32Slice(vs []*float32) []float32 { - ps := make([]float32, len(vs)) - for i, v := range vs { - ps[i] = ToFloat32(v) - } - - return ps -} - -// ToFloat32Map returns a map of float32 values, that are -// dereferenced if the passed in pointer was not nil. The float32 -// zero value is used if the pointer was nil. -func ToFloat32Map(vs map[string]*float32) map[string]float32 { - ps := make(map[string]float32, len(vs)) - for k, v := range vs { - ps[k] = ToFloat32(v) - } - - return ps -} - -// ToFloat64 returns float64 value dereferenced if the passed -// in pointer was not nil. Returns a float64 zero value if the -// pointer was nil. -func ToFloat64(p *float64) (v float64) { - if p == nil { - return v - } - - return *p -} - -// ToFloat64Slice returns a slice of float64 values, that are -// dereferenced if the passed in pointer was not nil. Returns a float64 -// zero value if the pointer was nil. -func ToFloat64Slice(vs []*float64) []float64 { - ps := make([]float64, len(vs)) - for i, v := range vs { - ps[i] = ToFloat64(v) - } - - return ps -} - -// ToFloat64Map returns a map of float64 values, that are -// dereferenced if the passed in pointer was not nil. The float64 -// zero value is used if the pointer was nil. -func ToFloat64Map(vs map[string]*float64) map[string]float64 { - ps := make(map[string]float64, len(vs)) - for k, v := range vs { - ps[k] = ToFloat64(v) - } - - return ps -} - -// ToTime returns time.Time value dereferenced if the passed -// in pointer was not nil. Returns a time.Time zero value if the -// pointer was nil. -func ToTime(p *time.Time) (v time.Time) { - if p == nil { - return v - } - - return *p -} - -// ToTimeSlice returns a slice of time.Time values, that are -// dereferenced if the passed in pointer was not nil. Returns a time.Time -// zero value if the pointer was nil. -func ToTimeSlice(vs []*time.Time) []time.Time { - ps := make([]time.Time, len(vs)) - for i, v := range vs { - ps[i] = ToTime(v) - } - - return ps -} - -// ToTimeMap returns a map of time.Time values, that are -// dereferenced if the passed in pointer was not nil. The time.Time -// zero value is used if the pointer was nil. -func ToTimeMap(vs map[string]*time.Time) map[string]time.Time { - ps := make(map[string]time.Time, len(vs)) - for k, v := range vs { - ps[k] = ToTime(v) - } - - return ps -} - -// ToDuration returns time.Duration value dereferenced if the passed -// in pointer was not nil. Returns a time.Duration zero value if the -// pointer was nil. -func ToDuration(p *time.Duration) (v time.Duration) { - if p == nil { - return v - } - - return *p -} - -// ToDurationSlice returns a slice of time.Duration values, that are -// dereferenced if the passed in pointer was not nil. Returns a time.Duration -// zero value if the pointer was nil. -func ToDurationSlice(vs []*time.Duration) []time.Duration { - ps := make([]time.Duration, len(vs)) - for i, v := range vs { - ps[i] = ToDuration(v) - } - - return ps -} - -// ToDurationMap returns a map of time.Duration values, that are -// dereferenced if the passed in pointer was not nil. The time.Duration -// zero value is used if the pointer was nil. -func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration { - ps := make(map[string]time.Duration, len(vs)) - for k, v := range vs { - ps[k] = ToDuration(v) - } - - return ps -} diff --git a/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go b/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go deleted file mode 100644 index 97f01011e..000000000 --- a/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build codegen -// +build codegen - -package ptr - -import "strings" - -func GetScalars() Scalars { - return Scalars{ - {Type: "bool"}, - {Type: "byte"}, - {Type: "string"}, - {Type: "int"}, - {Type: "int8"}, - {Type: "int16"}, - {Type: "int32"}, - {Type: "int64"}, - {Type: "uint"}, - {Type: "uint8"}, - {Type: "uint16"}, - {Type: "uint32"}, - {Type: "uint64"}, - {Type: "float32"}, - {Type: "float64"}, - {Type: "Time", Import: &Import{Path: "time"}}, - {Type: "Duration", Import: &Import{Path: "time"}}, - } -} - -// Import provides the import path and optional alias -type Import struct { - Path string - Alias string -} - -// Package returns the Go package name for the import. Returns alias if set. -func (i Import) Package() string { - if v := i.Alias; len(v) != 0 { - return v - } - - if v := i.Path; len(v) != 0 { - parts := strings.Split(v, "/") - pkg := parts[len(parts)-1] - return pkg - } - - return "" -} - -// Scalar provides the definition of a type to generate pointer utilities for. -type Scalar struct { - Type string - Import *Import -} - -// Name returns the exported function name for the type. -func (t Scalar) Name() string { - return strings.Title(t.Type) -} - -// Symbol returns the scalar's Go symbol with path if needed. -func (t Scalar) Symbol() string { - if t.Import != nil { - return t.Import.Package() + "." + t.Type - } - return t.Type -} - -// Scalars is a list of scalars. -type Scalars []Scalar - -// Imports returns all imports for the scalars. -func (ts Scalars) Imports() []*Import { - imports := []*Import{} - for _, t := range ts { - if v := t.Import; v != nil { - imports = append(imports, v) - } - } - - return imports -} diff --git a/vendor/github.com/aws/smithy-go/ptr/to_ptr.go b/vendor/github.com/aws/smithy-go/ptr/to_ptr.go deleted file mode 100644 index 0bfbbecbd..000000000 --- a/vendor/github.com/aws/smithy-go/ptr/to_ptr.go +++ /dev/null @@ -1,499 +0,0 @@ -// Code generated by smithy-go/ptr/generate.go DO NOT EDIT. -package ptr - -import ( - "time" -) - -// Bool returns a pointer value for the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolSlice returns a slice of bool pointers from the values -// passed in. -func BoolSlice(vs []bool) []*bool { - ps := make([]*bool, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// BoolMap returns a map of bool pointers from the values -// passed in. -func BoolMap(vs map[string]bool) map[string]*bool { - ps := make(map[string]*bool, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Byte returns a pointer value for the byte value passed in. -func Byte(v byte) *byte { - return &v -} - -// ByteSlice returns a slice of byte pointers from the values -// passed in. -func ByteSlice(vs []byte) []*byte { - ps := make([]*byte, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// ByteMap returns a map of byte pointers from the values -// passed in. -func ByteMap(vs map[string]byte) map[string]*byte { - ps := make(map[string]*byte, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// String returns a pointer value for the string value passed in. -func String(v string) *string { - return &v -} - -// StringSlice returns a slice of string pointers from the values -// passed in. -func StringSlice(vs []string) []*string { - ps := make([]*string, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// StringMap returns a map of string pointers from the values -// passed in. -func StringMap(vs map[string]string) map[string]*string { - ps := make(map[string]*string, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Int returns a pointer value for the int value passed in. -func Int(v int) *int { - return &v -} - -// IntSlice returns a slice of int pointers from the values -// passed in. -func IntSlice(vs []int) []*int { - ps := make([]*int, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// IntMap returns a map of int pointers from the values -// passed in. -func IntMap(vs map[string]int) map[string]*int { - ps := make(map[string]*int, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Int8 returns a pointer value for the int8 value passed in. -func Int8(v int8) *int8 { - return &v -} - -// Int8Slice returns a slice of int8 pointers from the values -// passed in. -func Int8Slice(vs []int8) []*int8 { - ps := make([]*int8, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Int8Map returns a map of int8 pointers from the values -// passed in. -func Int8Map(vs map[string]int8) map[string]*int8 { - ps := make(map[string]*int8, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Int16 returns a pointer value for the int16 value passed in. -func Int16(v int16) *int16 { - return &v -} - -// Int16Slice returns a slice of int16 pointers from the values -// passed in. -func Int16Slice(vs []int16) []*int16 { - ps := make([]*int16, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Int16Map returns a map of int16 pointers from the values -// passed in. -func Int16Map(vs map[string]int16) map[string]*int16 { - ps := make(map[string]*int16, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Int32 returns a pointer value for the int32 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Slice returns a slice of int32 pointers from the values -// passed in. -func Int32Slice(vs []int32) []*int32 { - ps := make([]*int32, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Int32Map returns a map of int32 pointers from the values -// passed in. -func Int32Map(vs map[string]int32) map[string]*int32 { - ps := make(map[string]*int32, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Int64 returns a pointer value for the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Slice returns a slice of int64 pointers from the values -// passed in. -func Int64Slice(vs []int64) []*int64 { - ps := make([]*int64, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Int64Map returns a map of int64 pointers from the values -// passed in. -func Int64Map(vs map[string]int64) map[string]*int64 { - ps := make(map[string]*int64, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Uint returns a pointer value for the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintSlice returns a slice of uint pointers from the values -// passed in. -func UintSlice(vs []uint) []*uint { - ps := make([]*uint, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// UintMap returns a map of uint pointers from the values -// passed in. -func UintMap(vs map[string]uint) map[string]*uint { - ps := make(map[string]*uint, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Uint8 returns a pointer value for the uint8 value passed in. -func Uint8(v uint8) *uint8 { - return &v -} - -// Uint8Slice returns a slice of uint8 pointers from the values -// passed in. -func Uint8Slice(vs []uint8) []*uint8 { - ps := make([]*uint8, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Uint8Map returns a map of uint8 pointers from the values -// passed in. -func Uint8Map(vs map[string]uint8) map[string]*uint8 { - ps := make(map[string]*uint8, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Uint16 returns a pointer value for the uint16 value passed in. -func Uint16(v uint16) *uint16 { - return &v -} - -// Uint16Slice returns a slice of uint16 pointers from the values -// passed in. -func Uint16Slice(vs []uint16) []*uint16 { - ps := make([]*uint16, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Uint16Map returns a map of uint16 pointers from the values -// passed in. -func Uint16Map(vs map[string]uint16) map[string]*uint16 { - ps := make(map[string]*uint16, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Uint32 returns a pointer value for the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Slice returns a slice of uint32 pointers from the values -// passed in. -func Uint32Slice(vs []uint32) []*uint32 { - ps := make([]*uint32, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Uint32Map returns a map of uint32 pointers from the values -// passed in. -func Uint32Map(vs map[string]uint32) map[string]*uint32 { - ps := make(map[string]*uint32, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Uint64 returns a pointer value for the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Slice returns a slice of uint64 pointers from the values -// passed in. -func Uint64Slice(vs []uint64) []*uint64 { - ps := make([]*uint64, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Uint64Map returns a map of uint64 pointers from the values -// passed in. -func Uint64Map(vs map[string]uint64) map[string]*uint64 { - ps := make(map[string]*uint64, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Float32 returns a pointer value for the float32 value passed in. -func Float32(v float32) *float32 { - return &v -} - -// Float32Slice returns a slice of float32 pointers from the values -// passed in. -func Float32Slice(vs []float32) []*float32 { - ps := make([]*float32, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Float32Map returns a map of float32 pointers from the values -// passed in. -func Float32Map(vs map[string]float32) map[string]*float32 { - ps := make(map[string]*float32, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Float64 returns a pointer value for the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Slice returns a slice of float64 pointers from the values -// passed in. -func Float64Slice(vs []float64) []*float64 { - ps := make([]*float64, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// Float64Map returns a map of float64 pointers from the values -// passed in. -func Float64Map(vs map[string]float64) map[string]*float64 { - ps := make(map[string]*float64, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Time returns a pointer value for the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeSlice returns a slice of time.Time pointers from the values -// passed in. -func TimeSlice(vs []time.Time) []*time.Time { - ps := make([]*time.Time, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// TimeMap returns a map of time.Time pointers from the values -// passed in. -func TimeMap(vs map[string]time.Time) map[string]*time.Time { - ps := make(map[string]*time.Time, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} - -// Duration returns a pointer value for the time.Duration value passed in. -func Duration(v time.Duration) *time.Duration { - return &v -} - -// DurationSlice returns a slice of time.Duration pointers from the values -// passed in. -func DurationSlice(vs []time.Duration) []*time.Duration { - ps := make([]*time.Duration, len(vs)) - for i, v := range vs { - vv := v - ps[i] = &vv - } - - return ps -} - -// DurationMap returns a map of time.Duration pointers from the values -// passed in. -func DurationMap(vs map[string]time.Duration) map[string]*time.Duration { - ps := make(map[string]*time.Duration, len(vs)) - for k, v := range vs { - vv := v - ps[k] = &vv - } - - return ps -} diff --git a/vendor/github.com/aws/smithy-go/rand/doc.go b/vendor/github.com/aws/smithy-go/rand/doc.go deleted file mode 100644 index f8b25d562..000000000 --- a/vendor/github.com/aws/smithy-go/rand/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package rand provides utilities for creating and working with random value -// generators. -package rand diff --git a/vendor/github.com/aws/smithy-go/rand/rand.go b/vendor/github.com/aws/smithy-go/rand/rand.go deleted file mode 100644 index 9c479f62b..000000000 --- a/vendor/github.com/aws/smithy-go/rand/rand.go +++ /dev/null @@ -1,31 +0,0 @@ -package rand - -import ( - "crypto/rand" - "fmt" - "io" - "math/big" -) - -func init() { - Reader = rand.Reader -} - -// Reader provides a random reader that can reset during testing. -var Reader io.Reader - -// Int63n returns a int64 between zero and value of max, read from an io.Reader source. -func Int63n(reader io.Reader, max int64) (int64, error) { - bi, err := rand.Int(reader, big.NewInt(max)) - if err != nil { - return 0, fmt.Errorf("failed to read random value, %w", err) - } - - return bi.Int64(), nil -} - -// CryptoRandInt63n returns a random int64 between zero and value of max -// obtained from the crypto rand source. -func CryptoRandInt63n(max int64) (int64, error) { - return Int63n(Reader, max) -} diff --git a/vendor/github.com/aws/smithy-go/rand/uuid.go b/vendor/github.com/aws/smithy-go/rand/uuid.go deleted file mode 100644 index dc81cbc68..000000000 --- a/vendor/github.com/aws/smithy-go/rand/uuid.go +++ /dev/null @@ -1,87 +0,0 @@ -package rand - -import ( - "encoding/hex" - "io" -) - -const dash byte = '-' - -// UUIDIdempotencyToken provides a utility to get idempotency tokens in the -// UUID format. -type UUIDIdempotencyToken struct { - uuid *UUID -} - -// NewUUIDIdempotencyToken returns a idempotency token provider returning -// tokens in the UUID random format using the reader provided. -func NewUUIDIdempotencyToken(r io.Reader) *UUIDIdempotencyToken { - return &UUIDIdempotencyToken{uuid: NewUUID(r)} -} - -// GetIdempotencyToken returns a random UUID value for Idempotency token. -func (u UUIDIdempotencyToken) GetIdempotencyToken() (string, error) { - return u.uuid.GetUUID() -} - -// UUID provides computing random UUID version 4 values from a random source -// reader. -type UUID struct { - randSrc io.Reader -} - -// NewUUID returns an initialized UUID value that can be used to retrieve -// random UUID version 4 values. -func NewUUID(r io.Reader) *UUID { - return &UUID{randSrc: r} -} - -// GetUUID returns a random UUID version 4 string representation sourced from the random reader the -// UUID was created with. Returns an error if unable to compute the UUID. -func (r *UUID) GetUUID() (string, error) { - var b [16]byte - if _, err := io.ReadFull(r.randSrc, b[:]); err != nil { - return "", err - } - r.makeUUIDv4(b[:]) - return format(b), nil -} - -// GetBytes returns a byte slice containing a random UUID version 4 sourced from the random reader the -// UUID was created with. Returns an error if unable to compute the UUID. -func (r *UUID) GetBytes() (u []byte, err error) { - u = make([]byte, 16) - if _, err = io.ReadFull(r.randSrc, u); err != nil { - return u, err - } - r.makeUUIDv4(u) - return u, nil -} - -func (r *UUID) makeUUIDv4(u []byte) { - // 13th character is "4" - u[6] = (u[6] & 0x0f) | 0x40 // Version 4 - // 17th character is "8", "9", "a", or "b" - u[8] = (u[8] & 0x3f) | 0x80 // Variant most significant bits are 10x where x can be either 1 or 0 -} - -// Format returns the canonical text representation of a UUID. -// This implementation is optimized to not use fmt. -// Example: 82e42f16-b6cc-4d5b-95f5-d403c4befd3d -func format(u [16]byte) string { - // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 - - var scratch [36]byte - - hex.Encode(scratch[:8], u[0:4]) - scratch[8] = dash - hex.Encode(scratch[9:13], u[4:6]) - scratch[13] = dash - hex.Encode(scratch[14:18], u[6:8]) - scratch[18] = dash - hex.Encode(scratch[19:23], u[8:10]) - scratch[23] = dash - hex.Encode(scratch[24:], u[10:]) - - return string(scratch[:]) -} diff --git a/vendor/github.com/aws/smithy-go/time/time.go b/vendor/github.com/aws/smithy-go/time/time.go deleted file mode 100644 index b552a09f8..000000000 --- a/vendor/github.com/aws/smithy-go/time/time.go +++ /dev/null @@ -1,134 +0,0 @@ -package time - -import ( - "context" - "fmt" - "math/big" - "strings" - "time" -) - -const ( - // dateTimeFormat is a IMF-fixdate formatted RFC3339 section 5.6 - dateTimeFormatInput = "2006-01-02T15:04:05.999999999Z" - dateTimeFormatInputNoZ = "2006-01-02T15:04:05.999999999" - dateTimeFormatOutput = "2006-01-02T15:04:05.999Z" - - // httpDateFormat is a date time defined by RFC 7231#section-7.1.1.1 - // IMF-fixdate with no UTC offset. - httpDateFormat = "Mon, 02 Jan 2006 15:04:05 GMT" - // Additional formats needed for compatibility. - httpDateFormatSingleDigitDay = "Mon, _2 Jan 2006 15:04:05 GMT" - httpDateFormatSingleDigitDayTwoDigitYear = "Mon, _2 Jan 06 15:04:05 GMT" -) - -var millisecondFloat = big.NewFloat(1e3) - -// FormatDateTime formats value as a date-time, (RFC3339 section 5.6) -// -// Example: 1985-04-12T23:20:50.52Z -func FormatDateTime(value time.Time) string { - return value.UTC().Format(dateTimeFormatOutput) -} - -// ParseDateTime parses a string as a date-time, (RFC3339 section 5.6) -// -// Example: 1985-04-12T23:20:50.52Z -func ParseDateTime(value string) (time.Time, error) { - return tryParse(value, - dateTimeFormatInput, - dateTimeFormatInputNoZ, - time.RFC3339Nano, - time.RFC3339, - ) -} - -// FormatHTTPDate formats value as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate) -// -// Example: Tue, 29 Apr 2014 18:30:38 GMT -func FormatHTTPDate(value time.Time) string { - return value.UTC().Format(httpDateFormat) -} - -// ParseHTTPDate parses a string as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate) -// -// Example: Tue, 29 Apr 2014 18:30:38 GMT -func ParseHTTPDate(value string) (time.Time, error) { - return tryParse(value, - httpDateFormat, - httpDateFormatSingleDigitDay, - httpDateFormatSingleDigitDayTwoDigitYear, - time.RFC850, - time.ANSIC, - ) -} - -// FormatEpochSeconds returns value as a Unix time in seconds with with decimal precision -// -// Example: 1515531081.123 -func FormatEpochSeconds(value time.Time) float64 { - ms := value.UnixNano() / int64(time.Millisecond) - return float64(ms) / 1e3 -} - -// ParseEpochSeconds returns value as a Unix time in seconds with with decimal precision -// -// Example: 1515531081.123 -func ParseEpochSeconds(value float64) time.Time { - f := big.NewFloat(value) - f = f.Mul(f, millisecondFloat) - i, _ := f.Int64() - // Offset to `UTC` because time.Unix returns the time value based on system - // local setting. - return time.Unix(0, i*1e6).UTC() -} - -func tryParse(v string, formats ...string) (time.Time, error) { - var errs parseErrors - for _, f := range formats { - t, err := time.Parse(f, v) - if err != nil { - errs = append(errs, parseError{ - Format: f, - Err: err, - }) - continue - } - return t, nil - } - - return time.Time{}, fmt.Errorf("unable to parse time string, %w", errs) -} - -type parseErrors []parseError - -func (es parseErrors) Error() string { - var s strings.Builder - for _, e := range es { - fmt.Fprintf(&s, "\n * %q: %v", e.Format, e.Err) - } - - return "parse errors:" + s.String() -} - -type parseError struct { - Format string - Err error -} - -// SleepWithContext will wait for the timer duration to expire, or until the context -// is canceled. Whichever happens first. If the context is canceled the -// Context's error will be returned. -func SleepWithContext(ctx context.Context, dur time.Duration) error { - t := time.NewTimer(dur) - defer t.Stop() - - select { - case <-t.C: - break - case <-ctx.Done(): - return ctx.Err() - } - - return nil -} diff --git a/vendor/github.com/aws/smithy-go/tracing/context.go b/vendor/github.com/aws/smithy-go/tracing/context.go deleted file mode 100644 index a404ed9d3..000000000 --- a/vendor/github.com/aws/smithy-go/tracing/context.go +++ /dev/null @@ -1,96 +0,0 @@ -package tracing - -import "context" - -type ( - operationTracerKey struct{} - spanLineageKey struct{} -) - -// GetSpan returns the active trace Span on the context. -// -// The boolean in the return indicates whether a Span was actually in the -// context, but a no-op implementation will be returned if not, so callers -// can generally disregard the boolean unless they wish to explicitly confirm -// presence/absence of a Span. -func GetSpan(ctx context.Context) (Span, bool) { - lineage := getLineage(ctx) - if len(lineage) == 0 { - return nopSpan{}, false - } - - return lineage[len(lineage)-1], true -} - -// WithSpan sets the active trace Span on the context. -func WithSpan(parent context.Context, span Span) context.Context { - lineage := getLineage(parent) - if len(lineage) == 0 { - return context.WithValue(parent, spanLineageKey{}, []Span{span}) - } - - lineage = append(lineage, span) - return context.WithValue(parent, spanLineageKey{}, lineage) -} - -// PopSpan pops the current Span off the context, setting the active Span on -// the returned Context back to its parent and returning the REMOVED one. -// -// PopSpan on a context with no active Span will return a no-op instance. -// -// This is mostly necessary for the runtime to manage base trace spans due to -// the wrapped-function nature of the middleware stack. End-users of Smithy -// clients SHOULD NOT generally be using this API. -func PopSpan(parent context.Context) (context.Context, Span) { - lineage := getLineage(parent) - if len(lineage) == 0 { - return parent, nopSpan{} - } - - span := lineage[len(lineage)-1] - lineage = lineage[:len(lineage)-1] - return context.WithValue(parent, spanLineageKey{}, lineage), span -} - -func getLineage(ctx context.Context) []Span { - v := ctx.Value(spanLineageKey{}) - if v == nil { - return nil - } - - return v.([]Span) -} - -// GetOperationTracer returns the embedded operation-scoped Tracer on a -// Context. -// -// The boolean in the return indicates whether a Tracer was actually in the -// context, but a no-op implementation will be returned if not, so callers -// can generally disregard the boolean unless they wish to explicitly confirm -// presence/absence of a Tracer. -func GetOperationTracer(ctx context.Context) (Tracer, bool) { - v := ctx.Value(operationTracerKey{}) - if v == nil { - return nopTracer{}, false - } - - return v.(Tracer), true -} - -// WithOperationTracer returns a child Context embedding the given Tracer. -// -// The runtime will use this embed a scoped tracer for client operations, -// Smithy/SDK client callers DO NOT need to do this explicitly. -func WithOperationTracer(parent context.Context, tracer Tracer) context.Context { - return context.WithValue(parent, operationTracerKey{}, tracer) -} - -// StartSpan is a convenience API for creating tracing Spans from a Context. -// -// StartSpan uses the operation-scoped Tracer, previously stored using -// [WithOperationTracer], to start the Span. If a Tracer has not been embedded -// the returned Span will be a no-op implementation. -func StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { - tracer, _ := GetOperationTracer(ctx) - return tracer.StartSpan(ctx, name, opts...) -} diff --git a/vendor/github.com/aws/smithy-go/tracing/nop.go b/vendor/github.com/aws/smithy-go/tracing/nop.go deleted file mode 100644 index 573d28b1c..000000000 --- a/vendor/github.com/aws/smithy-go/tracing/nop.go +++ /dev/null @@ -1,32 +0,0 @@ -package tracing - -import "context" - -// NopTracerProvider is a no-op tracing implementation. -type NopTracerProvider struct{} - -var _ TracerProvider = (*NopTracerProvider)(nil) - -// Tracer returns a tracer which creates no-op spans. -func (NopTracerProvider) Tracer(string, ...TracerOption) Tracer { - return nopTracer{} -} - -type nopTracer struct{} - -var _ Tracer = (*nopTracer)(nil) - -func (nopTracer) StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { - return ctx, nopSpan{} -} - -type nopSpan struct{} - -var _ Span = (*nopSpan)(nil) - -func (nopSpan) Name() string { return "" } -func (nopSpan) Context() SpanContext { return SpanContext{} } -func (nopSpan) AddEvent(string, ...EventOption) {} -func (nopSpan) SetProperty(any, any) {} -func (nopSpan) SetStatus(SpanStatus) {} -func (nopSpan) End() {} diff --git a/vendor/github.com/aws/smithy-go/tracing/tracing.go b/vendor/github.com/aws/smithy-go/tracing/tracing.go deleted file mode 100644 index 089ed3932..000000000 --- a/vendor/github.com/aws/smithy-go/tracing/tracing.go +++ /dev/null @@ -1,95 +0,0 @@ -// Package tracing defines tracing APIs to be used by Smithy clients. -package tracing - -import ( - "context" - - "github.com/aws/smithy-go" -) - -// SpanStatus records the "success" state of an observed span. -type SpanStatus int - -// Enumeration of SpanStatus. -const ( - SpanStatusUnset SpanStatus = iota - SpanStatusOK - SpanStatusError -) - -// SpanKind indicates the nature of the work being performed. -type SpanKind int - -// Enumeration of SpanKind. -const ( - SpanKindInternal SpanKind = iota - SpanKindClient - SpanKindServer - SpanKindProducer - SpanKindConsumer -) - -// TracerProvider is the entry point for creating client traces. -type TracerProvider interface { - Tracer(scope string, opts ...TracerOption) Tracer -} - -// TracerOption applies configuration to a tracer. -type TracerOption func(o *TracerOptions) - -// TracerOptions represent configuration for tracers. -type TracerOptions struct { - Properties smithy.Properties -} - -// Tracer is the entry point for creating observed client Spans. -// -// Spans created by tracers propagate by existing on the Context. Consumers of -// the API can use [GetSpan] to pull the active Span from a Context. -// -// Creation of child Spans is implicit through Context persistence. If -// CreateSpan is called with a Context that holds a Span, the result will be a -// child of that Span. -type Tracer interface { - StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) -} - -// SpanOption applies configuration to a span. -type SpanOption func(o *SpanOptions) - -// SpanOptions represent configuration for span events. -type SpanOptions struct { - Kind SpanKind - Properties smithy.Properties -} - -// Span records a conceptually individual unit of work that takes place in a -// Smithy client operation. -type Span interface { - Name() string - Context() SpanContext - AddEvent(name string, opts ...EventOption) - SetStatus(status SpanStatus) - SetProperty(k, v any) - End() -} - -// EventOption applies configuration to a span event. -type EventOption func(o *EventOptions) - -// EventOptions represent configuration for span events. -type EventOptions struct { - Properties smithy.Properties -} - -// SpanContext uniquely identifies a Span. -type SpanContext struct { - TraceID string - SpanID string - IsRemote bool -} - -// IsValid is true when a span has nonzero trace and span IDs. -func (ctx *SpanContext) IsValid() bool { - return len(ctx.TraceID) != 0 && len(ctx.SpanID) != 0 -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth.go b/vendor/github.com/aws/smithy-go/transport/http/auth.go deleted file mode 100644 index 58e1ab5ef..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/auth.go +++ /dev/null @@ -1,21 +0,0 @@ -package http - -import ( - "context" - - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" -) - -// AuthScheme defines an HTTP authentication scheme. -type AuthScheme interface { - SchemeID() string - IdentityResolver(auth.IdentityResolverOptions) auth.IdentityResolver - Signer() Signer -} - -// Signer defines the interface through which HTTP requests are supplemented -// with an Identity. -type Signer interface { - SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go b/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go deleted file mode 100644 index d60cf2a60..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go +++ /dev/null @@ -1,45 +0,0 @@ -package http - -import ( - "context" - - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/auth" -) - -// NewAnonymousScheme returns the anonymous HTTP auth scheme. -func NewAnonymousScheme() AuthScheme { - return &authScheme{ - schemeID: auth.SchemeIDAnonymous, - signer: &nopSigner{}, - } -} - -// authScheme is parameterized to generically implement the exported AuthScheme -// interface -type authScheme struct { - schemeID string - signer Signer -} - -var _ AuthScheme = (*authScheme)(nil) - -func (s *authScheme) SchemeID() string { - return s.schemeID -} - -func (s *authScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { - return o.GetIdentityResolver(s.schemeID) -} - -func (s *authScheme) Signer() Signer { - return s.signer -} - -type nopSigner struct{} - -var _ Signer = (*nopSigner)(nil) - -func (*nopSigner) SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error { - return nil -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go b/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go deleted file mode 100644 index bc4ad6e79..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go +++ /dev/null @@ -1,70 +0,0 @@ -package http - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/middleware" -) - -const contentMD5Header = "Content-Md5" - -// contentMD5Checksum provides a middleware to compute and set -// content-md5 checksum for a http request -type contentMD5Checksum struct { -} - -// AddContentChecksumMiddleware adds checksum middleware to middleware's -// build step. -func AddContentChecksumMiddleware(stack *middleware.Stack) error { - // This middleware must be executed before request body is set. - return stack.Build.Add(&contentMD5Checksum{}, middleware.Before) -} - -// ID returns the identifier for the checksum middleware -func (m *contentMD5Checksum) ID() string { return "ContentChecksum" } - -// HandleBuild adds behavior to compute md5 checksum and add content-md5 header -// on http request -func (m *contentMD5Checksum) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown request type %T", req) - } - - // if Content-MD5 header is already present, return - if v := req.Header.Get(contentMD5Header); len(v) != 0 { - return next.HandleBuild(ctx, in) - } - - // fetch the request stream. - stream := req.GetStream() - // compute checksum if payload is explicit - if stream != nil { - if !req.IsStreamSeekable() { - return out, metadata, fmt.Errorf( - "unseekable stream is not supported for computing md5 checksum") - } - - v, err := computeMD5Checksum(stream) - if err != nil { - return out, metadata, fmt.Errorf("error computing md5 checksum, %w", err) - } - - // reset the request stream - if err := req.RewindStream(); err != nil { - return out, metadata, fmt.Errorf( - "error rewinding request stream after computing md5 checksum, %w", err) - } - - // set the 'Content-MD5' header - req.Header.Set(contentMD5Header, string(v)) - } - - // set md5 header value - return next.HandleBuild(ctx, in) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/client.go b/vendor/github.com/aws/smithy-go/transport/http/client.go deleted file mode 100644 index 0fceae81d..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/client.go +++ /dev/null @@ -1,161 +0,0 @@ -package http - -import ( - "context" - "fmt" - "net/http" - - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" -) - -// ClientDo provides the interface for custom HTTP client implementations. -type ClientDo interface { - Do(*http.Request) (*http.Response, error) -} - -// ClientDoFunc provides a helper to wrap a function as an HTTP client for -// round tripping requests. -type ClientDoFunc func(*http.Request) (*http.Response, error) - -// Do will invoke the underlying func, returning the result. -func (fn ClientDoFunc) Do(r *http.Request) (*http.Response, error) { - return fn(r) -} - -// ClientHandler wraps a client that implements the HTTP Do method. Standard -// implementation is http.Client. -type ClientHandler struct { - client ClientDo - - Meter metrics.Meter // For HTTP client metrics. -} - -// NewClientHandler returns an initialized middleware handler for the client. -// -// Deprecated: Use [NewClientHandlerWithOptions]. -func NewClientHandler(client ClientDo) ClientHandler { - return NewClientHandlerWithOptions(client) -} - -// NewClientHandlerWithOptions returns an initialized middleware handler for the client -// with applied options. -func NewClientHandlerWithOptions(client ClientDo, opts ...func(*ClientHandler)) ClientHandler { - h := ClientHandler{ - client: client, - } - for _, opt := range opts { - opt(&h) - } - if h.Meter == nil { - h.Meter = metrics.NopMeterProvider{}.Meter("") - } - return h -} - -// Handle implements the middleware Handler interface, that will invoke the -// underlying HTTP client. Requires the input to be a Smithy *Request. Returns -// a smithy *Response, or error if the request failed. -func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( - out interface{}, metadata middleware.Metadata, err error, -) { - ctx, span := tracing.StartSpan(ctx, "DoHTTPRequest") - defer span.End() - - ctx, client, err := withMetrics(ctx, c.client, c.Meter) - if err != nil { - return nil, metadata, fmt.Errorf("instrument with HTTP metrics: %w", err) - } - - req, ok := input.(*Request) - if !ok { - return nil, metadata, fmt.Errorf("expect Smithy http.Request value as input, got unsupported type %T", input) - } - - builtRequest := req.Build(ctx) - if err := ValidateEndpointHost(builtRequest.Host); err != nil { - return nil, metadata, err - } - - span.SetProperty("http.method", req.Method) - span.SetProperty("http.request_content_length", -1) // at least indicate unknown - length, ok, err := req.StreamLength() - if err != nil { - return nil, metadata, err - } - if ok { - span.SetProperty("http.request_content_length", length) - } - - resp, err := client.Do(builtRequest) - if resp == nil { - // Ensure a http response value is always present to prevent unexpected - // panics. - resp = &http.Response{ - Header: http.Header{}, - Body: http.NoBody, - } - } - if err != nil { - err = &RequestSendError{Err: err} - - // Override the error with a context canceled error, if that was canceled. - select { - case <-ctx.Done(): - err = &smithy.CanceledError{Err: ctx.Err()} - default: - } - } - - // HTTP RoundTripper *should* close the request body. But this may not happen in a timely manner. - // So instead Smithy *Request Build wraps the body to be sent in a safe closer that will clear the - // stream reference so that it can be safely reused. - if builtRequest.Body != nil { - _ = builtRequest.Body.Close() - } - - span.SetProperty("net.protocol.version", fmt.Sprintf("%d.%d", resp.ProtoMajor, resp.ProtoMinor)) - span.SetProperty("http.status_code", resp.StatusCode) - span.SetProperty("http.response_content_length", resp.ContentLength) - - return &Response{Response: resp}, metadata, err -} - -// RequestSendError provides a generic request transport error. This error -// should wrap errors making HTTP client requests. -// -// The ClientHandler will wrap the HTTP client's error if the client request -// fails, and did not fail because of context canceled. -type RequestSendError struct { - Err error -} - -// ConnectionError returns that the error is related to not being able to send -// the request, or receive a response from the service. -func (e *RequestSendError) ConnectionError() bool { - return true -} - -// Unwrap returns the underlying error, if there was one. -func (e *RequestSendError) Unwrap() error { - return e.Err -} - -func (e *RequestSendError) Error() string { - return fmt.Sprintf("request send failed, %v", e.Err) -} - -// NopClient provides a client that ignores the request, and returns an empty -// successful HTTP response value. -type NopClient struct{} - -// Do ignores the request and returns a 200 status empty response. -func (NopClient) Do(r *http.Request) (*http.Response, error) { - return &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: http.NoBody, - }, nil -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/doc.go b/vendor/github.com/aws/smithy-go/transport/http/doc.go deleted file mode 100644 index 07366ac85..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* -Package http provides the HTTP transport client and request/response types -needed to round trip API operation calls with an service. -*/ -package http diff --git a/vendor/github.com/aws/smithy-go/transport/http/headerlist.go b/vendor/github.com/aws/smithy-go/transport/http/headerlist.go deleted file mode 100644 index cbc9deb4d..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/headerlist.go +++ /dev/null @@ -1,163 +0,0 @@ -package http - -import ( - "fmt" - "strconv" - "strings" - "unicode" -) - -func splitHeaderListValues(vs []string, splitFn func(string) ([]string, error)) ([]string, error) { - values := make([]string, 0, len(vs)) - - for i := 0; i < len(vs); i++ { - parts, err := splitFn(vs[i]) - if err != nil { - return nil, err - } - values = append(values, parts...) - } - - return values, nil -} - -// SplitHeaderListValues attempts to split the elements of the slice by commas, -// and return a list of all values separated. Returns error if unable to -// separate the values. -func SplitHeaderListValues(vs []string) ([]string, error) { - return splitHeaderListValues(vs, quotedCommaSplit) -} - -func quotedCommaSplit(v string) (parts []string, err error) { - v = strings.TrimSpace(v) - - expectMore := true - for i := 0; i < len(v); i++ { - if unicode.IsSpace(rune(v[i])) { - continue - } - expectMore = false - - // leading space in part is ignored. - // Start of value must be non-space, or quote. - // - // - If quote, enter quoted mode, find next non-escaped quote to - // terminate the value. - // - Otherwise, find next comma to terminate value. - - remaining := v[i:] - - var value string - var valueLen int - if remaining[0] == '"' { - //------------------------------ - // Quoted value - //------------------------------ - var j int - var skipQuote bool - for j += 1; j < len(remaining); j++ { - if remaining[j] == '\\' || (remaining[j] != '\\' && skipQuote) { - skipQuote = !skipQuote - continue - } - if remaining[j] == '"' { - break - } - } - if j == len(remaining) || j == 1 { - return nil, fmt.Errorf("value %v missing closing double quote", - remaining) - } - valueLen = j + 1 - - tail := remaining[valueLen:] - var k int - for ; k < len(tail); k++ { - if !unicode.IsSpace(rune(tail[k])) && tail[k] != ',' { - return nil, fmt.Errorf("value %v has non-space trailing characters", - remaining) - } - if tail[k] == ',' { - expectMore = true - break - } - } - value = remaining[:valueLen] - value, err = strconv.Unquote(value) - if err != nil { - return nil, fmt.Errorf("failed to unquote value %v, %w", value, err) - } - - // Pad valueLen to include trailing space(s) so `i` is updated correctly. - valueLen += k - - } else { - //------------------------------ - // Unquoted value - //------------------------------ - - // Index of the next comma is the length of the value, or end of string. - valueLen = strings.Index(remaining, ",") - if valueLen != -1 { - expectMore = true - } else { - valueLen = len(remaining) - } - value = strings.TrimSpace(remaining[:valueLen]) - } - - i += valueLen - parts = append(parts, value) - - } - - if expectMore { - parts = append(parts, "") - } - - return parts, nil -} - -// SplitHTTPDateTimestampHeaderListValues attempts to split the HTTP-Date -// timestamp values in the slice by commas, and return a list of all values -// separated. The split is aware of the HTTP-Date timestamp format, and will skip -// comma within the timestamp value. Returns an error if unable to split the -// timestamp values. -func SplitHTTPDateTimestampHeaderListValues(vs []string) ([]string, error) { - return splitHeaderListValues(vs, splitHTTPDateHeaderValue) -} - -func splitHTTPDateHeaderValue(v string) ([]string, error) { - if n := strings.Count(v, ","); n <= 1 { - // Nothing to do if only contains a no, or single HTTPDate value - return []string{v}, nil - } else if n%2 == 0 { - return nil, fmt.Errorf("invalid timestamp HTTPDate header comma separations, %q", v) - } - - var parts []string - var i, j int - - var doSplit bool - for ; i < len(v); i++ { - if v[i] == ',' { - if doSplit { - doSplit = false - parts = append(parts, strings.TrimSpace(v[j:i])) - j = i + 1 - } else { - // Skip the first comma in the timestamp value since that - // separates the day from the rest of the timestamp. - // - // Tue, 17 Dec 2019 23:48:18 GMT - doSplit = true - } - } - } - // Add final part - if j < len(v) { - parts = append(parts, strings.TrimSpace(v[j:])) - } - - return parts, nil -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/host.go b/vendor/github.com/aws/smithy-go/transport/http/host.go deleted file mode 100644 index db9801bea..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/host.go +++ /dev/null @@ -1,89 +0,0 @@ -package http - -import ( - "fmt" - "net" - "strconv" - "strings" -) - -// ValidateEndpointHost validates that the host string passed in is a valid RFC -// 3986 host. Returns error if the host is not valid. -func ValidateEndpointHost(host string) error { - var errors strings.Builder - var hostname string - var port string - var err error - - if strings.Contains(host, ":") { - hostname, port, err = net.SplitHostPort(host) - if err != nil { - errors.WriteString(fmt.Sprintf("\n endpoint %v, failed to parse, got ", host)) - errors.WriteString(err.Error()) - } - - if !ValidPortNumber(port) { - errors.WriteString(fmt.Sprintf("port number should be in range [0-65535], got %v", port)) - } - } else { - hostname = host - } - - labels := strings.Split(hostname, ".") - for i, label := range labels { - if i == len(labels)-1 && len(label) == 0 { - // Allow trailing dot for FQDN hosts. - continue - } - - if !ValidHostLabel(label) { - errors.WriteString("\nendpoint host domain labels must match \"[a-zA-Z0-9-]{1,63}\", but found: ") - errors.WriteString(label) - } - } - - if len(hostname) == 0 && len(port) != 0 { - errors.WriteString("\nendpoint host with port must not be empty") - } - - if len(hostname) > 255 { - errors.WriteString(fmt.Sprintf("\nendpoint host must be less than 255 characters, but was %d", len(hostname))) - } - - if len(errors.String()) > 0 { - return fmt.Errorf("invalid endpoint host%s", errors.String()) - } - return nil -} - -// ValidPortNumber returns whether the port is valid RFC 3986 port. -func ValidPortNumber(port string) bool { - i, err := strconv.Atoi(port) - if err != nil { - return false - } - - if i < 0 || i > 65535 { - return false - } - return true -} - -// ValidHostLabel returns whether the label is a valid RFC 3986 host label. -func ValidHostLabel(label string) bool { - if l := len(label); l == 0 || l > 63 { - return false - } - for _, r := range label { - switch { - case r >= '0' && r <= '9': - case r >= 'A' && r <= 'Z': - case r >= 'a' && r <= 'z': - case r == '-': - default: - return false - } - } - - return true -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/interceptor.go b/vendor/github.com/aws/smithy-go/transport/http/interceptor.go deleted file mode 100644 index e21f2632a..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/interceptor.go +++ /dev/null @@ -1,321 +0,0 @@ -package http - -import ( - "context" -) - -func icopy[T any](v []T) []T { - s := make([]T, len(v)) - copy(s, v) - return s -} - -// InterceptorContext is all the information available in different -// interceptors. -// -// Not all information is available in each interceptor, see each interface -// definition for more details. -type InterceptorContext struct { - Input any - Request *Request - - Output any - Response *Response -} - -// InterceptorRegistry holds a list of operation interceptors. -// -// Interceptors allow callers to insert custom behavior at well-defined points -// within a client's operation lifecycle. -// -// # Interceptor context -// -// All interceptors are invoked with a context object that contains input and -// output containers for the operation. The individual fields that are -// available will depend on what the interceptor is and, in certain -// interceptors, how far the operation was able to progress. See the -// documentation for each interface definition for more information about field -// availability. -// -// Implementations MUST NOT directly mutate the values of the fields in the -// interceptor context. They are free to mutate the existing values _pointed -// to_ by those fields, however. -// -// # Returning errors -// -// All interceptors can return errors. If an interceptor returns an error -// _before_ the client's retry loop, the operation will fail immediately. If -// one returns an error _within_ the retry loop, the error WILL be considered -// according to the client's retry policy. -// -// # Adding interceptors -// -// Idiomatically you will simply use one of the Add() receiver methods to -// register interceptors as desired. However, the list for each interface is -// exported on the registry struct and the caller is free to manipulate it -// directly, for example, to register a number of interceptors all at once, or -// to remove one that was previously registered. -// -// The base SDK client WILL NOT add any interceptors. SDK operations and -// customizations are implemented in terms of middleware. -// -// Modifications to the registry will not persist across operation calls when -// using per-operation functional options. This means you can register -// interceptors on a per-operation basis without affecting other operations. -type InterceptorRegistry struct { - BeforeExecution []BeforeExecutionInterceptor - BeforeSerialization []BeforeSerializationInterceptor - AfterSerialization []AfterSerializationInterceptor - BeforeRetryLoop []BeforeRetryLoopInterceptor - BeforeAttempt []BeforeAttemptInterceptor - BeforeSigning []BeforeSigningInterceptor - AfterSigning []AfterSigningInterceptor - BeforeTransmit []BeforeTransmitInterceptor - AfterTransmit []AfterTransmitInterceptor - BeforeDeserialization []BeforeDeserializationInterceptor - AfterDeserialization []AfterDeserializationInterceptor - AfterAttempt []AfterAttemptInterceptor - AfterExecution []AfterExecutionInterceptor -} - -// Copy returns a deep copy of the registry. This is used by SDK clients on -// each operation call in order to prevent per-op config mutation from -// persisting. -func (i *InterceptorRegistry) Copy() InterceptorRegistry { - return InterceptorRegistry{ - BeforeExecution: icopy(i.BeforeExecution), - BeforeSerialization: icopy(i.BeforeSerialization), - AfterSerialization: icopy(i.AfterSerialization), - BeforeRetryLoop: icopy(i.BeforeRetryLoop), - BeforeAttempt: icopy(i.BeforeAttempt), - BeforeSigning: icopy(i.BeforeSigning), - AfterSigning: icopy(i.AfterSigning), - BeforeTransmit: icopy(i.BeforeTransmit), - AfterTransmit: icopy(i.AfterTransmit), - BeforeDeserialization: icopy(i.BeforeDeserialization), - AfterDeserialization: icopy(i.AfterDeserialization), - AfterAttempt: icopy(i.AfterAttempt), - AfterExecution: icopy(i.AfterExecution), - } -} - -// AddBeforeExecution registers the provided BeforeExecutionInterceptor. -func (i *InterceptorRegistry) AddBeforeExecution(v BeforeExecutionInterceptor) { - i.BeforeExecution = append(i.BeforeExecution, v) -} - -// AddBeforeSerialization registers the provided BeforeSerializationInterceptor. -func (i *InterceptorRegistry) AddBeforeSerialization(v BeforeSerializationInterceptor) { - i.BeforeSerialization = append(i.BeforeSerialization, v) -} - -// AddAfterSerialization registers the provided AfterSerializationInterceptor. -func (i *InterceptorRegistry) AddAfterSerialization(v AfterSerializationInterceptor) { - i.AfterSerialization = append(i.AfterSerialization, v) -} - -// AddBeforeRetryLoop registers the provided BeforeRetryLoopInterceptor. -func (i *InterceptorRegistry) AddBeforeRetryLoop(v BeforeRetryLoopInterceptor) { - i.BeforeRetryLoop = append(i.BeforeRetryLoop, v) -} - -// AddBeforeAttempt registers the provided BeforeAttemptInterceptor. -func (i *InterceptorRegistry) AddBeforeAttempt(v BeforeAttemptInterceptor) { - i.BeforeAttempt = append(i.BeforeAttempt, v) -} - -// AddBeforeSigning registers the provided BeforeSigningInterceptor. -func (i *InterceptorRegistry) AddBeforeSigning(v BeforeSigningInterceptor) { - i.BeforeSigning = append(i.BeforeSigning, v) -} - -// AddAfterSigning registers the provided AfterSigningInterceptor. -func (i *InterceptorRegistry) AddAfterSigning(v AfterSigningInterceptor) { - i.AfterSigning = append(i.AfterSigning, v) -} - -// AddBeforeTransmit registers the provided BeforeTransmitInterceptor. -func (i *InterceptorRegistry) AddBeforeTransmit(v BeforeTransmitInterceptor) { - i.BeforeTransmit = append(i.BeforeTransmit, v) -} - -// AddAfterTransmit registers the provided AfterTransmitInterceptor. -func (i *InterceptorRegistry) AddAfterTransmit(v AfterTransmitInterceptor) { - i.AfterTransmit = append(i.AfterTransmit, v) -} - -// AddBeforeDeserialization registers the provided BeforeDeserializationInterceptor. -func (i *InterceptorRegistry) AddBeforeDeserialization(v BeforeDeserializationInterceptor) { - i.BeforeDeserialization = append(i.BeforeDeserialization, v) -} - -// AddAfterDeserialization registers the provided AfterDeserializationInterceptor. -func (i *InterceptorRegistry) AddAfterDeserialization(v AfterDeserializationInterceptor) { - i.AfterDeserialization = append(i.AfterDeserialization, v) -} - -// AddAfterAttempt registers the provided AfterAttemptInterceptor. -func (i *InterceptorRegistry) AddAfterAttempt(v AfterAttemptInterceptor) { - i.AfterAttempt = append(i.AfterAttempt, v) -} - -// AddAfterExecution registers the provided AfterExecutionInterceptor. -func (i *InterceptorRegistry) AddAfterExecution(v AfterExecutionInterceptor) { - i.AfterExecution = append(i.AfterExecution, v) -} - -// BeforeExecutionInterceptor runs before anything else in the operation -// lifecycle. -// -// Available InterceptorContext fields: -// - Input -type BeforeExecutionInterceptor interface { - BeforeExecution(ctx context.Context, in *InterceptorContext) error -} - -// BeforeSerializationInterceptor runs before the operation input is serialized -// into its transport request. -// -// Serialization occurs before the operation's retry loop. -// -// Available InterceptorContext fields: -// - Input -type BeforeSerializationInterceptor interface { - BeforeSerialization(ctx context.Context, in *InterceptorContext) error -} - -// AfterSerializationInterceptor runs after the operation input is serialized -// into its transport request. -// -// Available InterceptorContext fields: -// - Input -// - Request -type AfterSerializationInterceptor interface { - AfterSerialization(ctx context.Context, in *InterceptorContext) error -} - -// BeforeRetryLoopInterceptor runs right before the operation enters the retry loop. -// -// Available InterceptorContext fields: -// - Input -// - Request -type BeforeRetryLoopInterceptor interface { - BeforeRetryLoop(ctx context.Context, in *InterceptorContext) error -} - -// BeforeAttemptInterceptor runs right before every attempt in the retry loop. -// -// If this interceptor returns an error, AfterAttempt interceptors WILL NOT be -// invoked. -// -// Available InterceptorContext fields: -// - Input -// - Request -type BeforeAttemptInterceptor interface { - BeforeAttempt(ctx context.Context, in *InterceptorContext) error -} - -// BeforeSigningInterceptor runs right before the request is signed. -// -// Signing occurs within the operation's retry loop. -// -// Available InterceptorContext fields: -// - Input -// - Request -type BeforeSigningInterceptor interface { - BeforeSigning(ctx context.Context, in *InterceptorContext) error -} - -// AfterSigningInterceptor runs right after the request is signed. -// -// It is unsafe to modify the outgoing HTTP request at or past this hook, since -// doing so may invalidate the signature of the request. -// -// Available InterceptorContext fields: -// - Input -// - Request -type AfterSigningInterceptor interface { - AfterSigning(ctx context.Context, in *InterceptorContext) error -} - -// BeforeTransmitInterceptor runs right before the HTTP request is sent. -// -// HTTP transmit occurs within the operation's retry loop. -// -// Available InterceptorContext fields: -// - Input -// - Request -type BeforeTransmitInterceptor interface { - BeforeTransmit(ctx context.Context, in *InterceptorContext) error -} - -// AfterTransmitInterceptor runs right after the HTTP response is received. -// -// It will always be invoked when a response is received, regardless of its -// status code. Conversely, it WILL NOT be invoked if the HTTP round-trip was -// not successful, e.g. because of a DNS resolution error -// -// Available InterceptorContext fields: -// - Input -// - Request -// - Response -type AfterTransmitInterceptor interface { - AfterTransmit(ctx context.Context, in *InterceptorContext) error -} - -// BeforeDeserializationInterceptor runs right before the incoming HTTP response -// is deserialized. -// -// This interceptor IS NOT invoked if the HTTP round-trip was not successful. -// -// Deserialization occurs within the operation's retry loop. -// -// Available InterceptorContext fields: -// - Input -// - Request -// - Response -type BeforeDeserializationInterceptor interface { - BeforeDeserialization(ctx context.Context, in *InterceptorContext) error -} - -// AfterDeserializationInterceptor runs right after the incoming HTTP response -// is deserialized. This hook is invoked regardless of whether the deserialized -// result was an error. -// -// This interceptor IS NOT invoked if the HTTP round-trip was not successful. -// -// Available InterceptorContext fields: -// - Input -// - Output (IF the operation had a success-level response) -// - Request -// - Response -type AfterDeserializationInterceptor interface { - AfterDeserialization(ctx context.Context, in *InterceptorContext) error -} - -// AfterAttemptInterceptor runs right after the incoming HTTP response -// is deserialized. This hook is invoked regardless of whether the deserialized -// result was an error, or if another interceptor within the retry loop -// returned an error. -// -// Available InterceptorContext fields: -// - Input -// - Output (IF the operation had a success-level response) -// - Request (IF the operation did not return an error during serialization) -// - Response (IF the operation was able to transmit the HTTP request) -type AfterAttemptInterceptor interface { - AfterAttempt(ctx context.Context, in *InterceptorContext) error -} - -// AfterExecutionInterceptor runs after everything else. It runs regardless of -// how far the operation progressed in its lifecycle, and regardless of whether -// the operation succeeded or failed. -// -// Available InterceptorContext fields: -// - Input -// - Output (IF the operation had a success-level response) -// - Request (IF the operation did not return an error during serialization) -// - Response (IF the operation was able to transmit the HTTP request) -type AfterExecutionInterceptor interface { - AfterExecution(ctx context.Context, in *InterceptorContext) error -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go b/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go deleted file mode 100644 index 2cc4b57f8..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go +++ /dev/null @@ -1,325 +0,0 @@ -package http - -import ( - "context" - "errors" - - "github.com/aws/smithy-go/middleware" -) - -type ictxKey struct{} - -func withIctx(ctx context.Context) context.Context { - return middleware.WithStackValue(ctx, ictxKey{}, &InterceptorContext{}) -} - -func getIctx(ctx context.Context) *InterceptorContext { - return middleware.GetStackValue(ctx, ictxKey{}).(*InterceptorContext) -} - -// InterceptExecution runs Before/AfterExecutionInterceptors. -type InterceptExecution struct { - BeforeExecution []BeforeExecutionInterceptor - AfterExecution []AfterExecutionInterceptor -} - -// ID identifies the middleware. -func (m *InterceptExecution) ID() string { - return "InterceptExecution" -} - -// HandleInitialize runs the interceptors. -func (m *InterceptExecution) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - out middleware.InitializeOutput, md middleware.Metadata, err error, -) { - ctx = withIctx(ctx) - getIctx(ctx).Input = in.Parameters - - for _, i := range m.BeforeExecution { - if err := i.BeforeExecution(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - out, md, err = next.HandleInitialize(ctx, in) - - for _, i := range m.AfterExecution { - if err := i.AfterExecution(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return out, md, err -} - -// InterceptBeforeSerialization runs BeforeSerializationInterceptors. -type InterceptBeforeSerialization struct { - Interceptors []BeforeSerializationInterceptor -} - -// ID identifies the middleware. -func (m *InterceptBeforeSerialization) ID() string { - return "InterceptBeforeSerialization" -} - -// HandleSerialize runs the interceptors. -func (m *InterceptBeforeSerialization) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.Interceptors { - if err := i.BeforeSerialization(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return next.HandleSerialize(ctx, in) -} - -// InterceptAfterSerialization runs AfterSerializationInterceptors. -type InterceptAfterSerialization struct { - Interceptors []AfterSerializationInterceptor -} - -// ID identifies the middleware. -func (m *InterceptAfterSerialization) ID() string { - return "InterceptAfterSerialization" -} - -// HandleSerialize runs the interceptors. -func (m *InterceptAfterSerialization) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, md middleware.Metadata, err error, -) { - getIctx(ctx).Request = in.Request.(*Request) - - for _, i := range m.Interceptors { - if err := i.AfterSerialization(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return next.HandleSerialize(ctx, in) -} - -// InterceptBeforeRetryLoop runs BeforeRetryLoopInterceptors. -type InterceptBeforeRetryLoop struct { - Interceptors []BeforeRetryLoopInterceptor -} - -// ID identifies the middleware. -func (m *InterceptBeforeRetryLoop) ID() string { - return "InterceptBeforeRetryLoop" -} - -// HandleFinalize runs the interceptors. -func (m *InterceptBeforeRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.Interceptors { - if err := i.BeforeRetryLoop(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return next.HandleFinalize(ctx, in) -} - -// InterceptBeforeSigning runs BeforeSigningInterceptors. -type InterceptBeforeSigning struct { - Interceptors []BeforeSigningInterceptor -} - -// ID identifies the middleware. -func (m *InterceptBeforeSigning) ID() string { - return "InterceptBeforeSigning" -} - -// HandleFinalize runs the interceptors. -func (m *InterceptBeforeSigning) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.Interceptors { - if err := i.BeforeSigning(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return next.HandleFinalize(ctx, in) -} - -// InterceptAfterSigning runs AfterSigningInterceptors. -type InterceptAfterSigning struct { - Interceptors []AfterSigningInterceptor -} - -// ID identifies the middleware. -func (m *InterceptAfterSigning) ID() string { - return "InterceptAfterSigning" -} - -// HandleFinalize runs the interceptors. -func (m *InterceptAfterSigning) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.Interceptors { - if err := i.AfterSigning(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return next.HandleFinalize(ctx, in) -} - -// InterceptTransmit runs BeforeTransmitInterceptors and AfterTransmitInterceptors. -type InterceptTransmit struct { - BeforeTransmit []BeforeTransmitInterceptor - AfterTransmit []AfterTransmitInterceptor -} - -// ID identifies the middleware. -func (m *InterceptTransmit) ID() string { - return "InterceptTransmit" -} - -// HandleDeserialize runs the interceptors. -func (m *InterceptTransmit) HandleDeserialize( - ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - out middleware.DeserializeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.BeforeTransmit { - if err := i.BeforeTransmit(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - out, md, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, md, err - } - - // the root of the decorated middleware guarantees this will be here - // (client.go: ClientHandler.Handle) - getIctx(ctx).Response = out.RawResponse.(*Response) - - for _, i := range m.AfterTransmit { - if err := i.AfterTransmit(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return out, md, err -} - -// InterceptBeforeDeserialization runs BeforeDeserializationInterceptors. -type InterceptBeforeDeserialization struct { - Interceptors []BeforeDeserializationInterceptor -} - -// ID identifies the middleware. -func (m *InterceptBeforeDeserialization) ID() string { - return "InterceptBeforeDeserialization" -} - -// HandleDeserialize runs the interceptors. -func (m *InterceptBeforeDeserialization) HandleDeserialize( - ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - out middleware.DeserializeOutput, md middleware.Metadata, err error, -) { - out, md, err = next.HandleDeserialize(ctx, in) - if err != nil { - var terr *RequestSendError - if errors.As(err, &terr) { - return out, md, err - } - } - - for _, i := range m.Interceptors { - if err := i.BeforeDeserialization(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return out, md, err -} - -// InterceptAfterDeserialization runs AfterDeserializationInterceptors. -type InterceptAfterDeserialization struct { - Interceptors []AfterDeserializationInterceptor -} - -// ID identifies the middleware. -func (m *InterceptAfterDeserialization) ID() string { - return "InterceptAfterDeserialization" -} - -// HandleDeserialize runs the interceptors. -func (m *InterceptAfterDeserialization) HandleDeserialize( - ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - out middleware.DeserializeOutput, md middleware.Metadata, err error, -) { - out, md, err = next.HandleDeserialize(ctx, in) - if err != nil { - var terr *RequestSendError - if errors.As(err, &terr) { - return out, md, err - } - } - - getIctx(ctx).Output = out.Result - - for _, i := range m.Interceptors { - if err := i.AfterDeserialization(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return out, md, err -} - -// InterceptAttempt runs AfterAttemptInterceptors. -type InterceptAttempt struct { - BeforeAttempt []BeforeAttemptInterceptor - AfterAttempt []AfterAttemptInterceptor -} - -// ID identifies the middleware. -func (m *InterceptAttempt) ID() string { - return "InterceptAttempt" -} - -// HandleFinalize runs the interceptors. -func (m *InterceptAttempt) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - out middleware.FinalizeOutput, md middleware.Metadata, err error, -) { - for _, i := range m.BeforeAttempt { - if err := i.BeforeAttempt(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - out, md, err = next.HandleFinalize(ctx, in) - - for _, i := range m.AfterAttempt { - if err := i.AfterAttempt(ctx, getIctx(ctx)); err != nil { - return out, md, err - } - } - - return out, md, err -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go b/vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go deleted file mode 100644 index 941a8d6b5..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go +++ /dev/null @@ -1,75 +0,0 @@ -package io - -import ( - "io" - "sync" -) - -// NewSafeReadCloser returns a new safeReadCloser that wraps readCloser. -func NewSafeReadCloser(readCloser io.ReadCloser) io.ReadCloser { - sr := &safeReadCloser{ - readCloser: readCloser, - } - - if _, ok := readCloser.(io.WriterTo); ok { - return &safeWriteToReadCloser{safeReadCloser: sr} - } - - return sr -} - -// safeWriteToReadCloser wraps a safeReadCloser but exposes a WriteTo interface implementation. This will panic -// if the underlying io.ReadClose does not support WriteTo. Use NewSafeReadCloser to ensure the proper handling of this -// type. -type safeWriteToReadCloser struct { - *safeReadCloser -} - -// WriteTo implements the io.WriteTo interface. -func (r *safeWriteToReadCloser) WriteTo(w io.Writer) (int64, error) { - r.safeReadCloser.mtx.Lock() - defer r.safeReadCloser.mtx.Unlock() - - if r.safeReadCloser.closed { - return 0, io.EOF - } - - return r.safeReadCloser.readCloser.(io.WriterTo).WriteTo(w) -} - -// safeReadCloser wraps a io.ReadCloser and presents an io.ReadCloser interface. When Close is called on safeReadCloser -// the underlying Close method will be executed, and then the reference to the reader will be dropped. This type -// is meant to be used with the net/http library which will retain a reference to the request body for the lifetime -// of a goroutine connection. Wrapping in this manner will ensure that no data race conditions are falsely reported. -// This type is thread-safe. -type safeReadCloser struct { - readCloser io.ReadCloser - closed bool - mtx sync.Mutex -} - -// Read reads up to len(p) bytes into p from the underlying read. If the reader is closed io.EOF will be returned. -func (r *safeReadCloser) Read(p []byte) (n int, err error) { - r.mtx.Lock() - defer r.mtx.Unlock() - if r.closed { - return 0, io.EOF - } - - return r.readCloser.Read(p) -} - -// Close calls the underlying io.ReadCloser's Close method, removes the reference to the reader, and returns any error -// reported from Close. Subsequent calls to Close will always return a nil error. -func (r *safeReadCloser) Close() error { - r.mtx.Lock() - defer r.mtx.Unlock() - if r.closed { - return nil - } - - r.closed = true - rc := r.readCloser - r.readCloser = nil - return rc.Close() -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go b/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go deleted file mode 100644 index 5d6a4b23a..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go +++ /dev/null @@ -1,25 +0,0 @@ -package http - -import ( - "crypto/md5" - "encoding/base64" - "fmt" - "io" -) - -// computeMD5Checksum computes base64 md5 checksum of an io.Reader's contents. -// Returns the byte slice of md5 checksum and an error. -func computeMD5Checksum(r io.Reader) ([]byte, error) { - h := md5.New() - // copy errors may be assumed to be from the body. - _, err := io.Copy(h, r) - if err != nil { - return nil, fmt.Errorf("failed to read body: %w", err) - } - - // encode the md5 checksum in base64. - sum := h.Sum(nil) - sum64 := make([]byte, base64.StdEncoding.EncodedLen(len(sum))) - base64.StdEncoding.Encode(sum64, sum) - return sum64, nil -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/metrics.go b/vendor/github.com/aws/smithy-go/transport/http/metrics.go deleted file mode 100644 index d1beaa595..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/metrics.go +++ /dev/null @@ -1,198 +0,0 @@ -package http - -import ( - "context" - "crypto/tls" - "net/http" - "net/http/httptrace" - "sync/atomic" - "time" - - "github.com/aws/smithy-go/metrics" -) - -var now = time.Now - -// withMetrics instruments an HTTP client and context to collect HTTP metrics. -func withMetrics(parent context.Context, client ClientDo, meter metrics.Meter) ( - context.Context, ClientDo, error, -) { - hm, err := newHTTPMetrics(meter) - if err != nil { - return nil, nil, err - } - - ctx := httptrace.WithClientTrace(parent, &httptrace.ClientTrace{ - DNSStart: hm.DNSStart, - ConnectStart: hm.ConnectStart, - TLSHandshakeStart: hm.TLSHandshakeStart, - - GotConn: hm.GotConn(parent), - PutIdleConn: hm.PutIdleConn(parent), - ConnectDone: hm.ConnectDone(parent), - DNSDone: hm.DNSDone(parent), - TLSHandshakeDone: hm.TLSHandshakeDone(parent), - GotFirstResponseByte: hm.GotFirstResponseByte(parent), - }) - return ctx, &timedClientDo{client, hm}, nil -} - -type timedClientDo struct { - ClientDo - hm *httpMetrics -} - -func (c *timedClientDo) Do(r *http.Request) (*http.Response, error) { - c.hm.doStart.Store(now()) - resp, err := c.ClientDo.Do(r) - - c.hm.DoRequestDuration.Record(r.Context(), c.hm.doStart.Elapsed()) - return resp, err -} - -type httpMetrics struct { - DNSLookupDuration metrics.Float64Histogram // client.http.connections.dns_lookup_duration - ConnectDuration metrics.Float64Histogram // client.http.connections.acquire_duration - TLSHandshakeDuration metrics.Float64Histogram // client.http.connections.tls_handshake_duration - ConnectionUsage metrics.Int64UpDownCounter // client.http.connections.usage - - DoRequestDuration metrics.Float64Histogram // client.http.do_request_duration - TimeToFirstByte metrics.Float64Histogram // client.http.time_to_first_byte - - doStart safeTime - dnsStart safeTime - connectStart safeTime - tlsStart safeTime -} - -func newHTTPMetrics(meter metrics.Meter) (*httpMetrics, error) { - hm := &httpMetrics{} - - var err error - hm.DNSLookupDuration, err = meter.Float64Histogram("client.http.connections.dns_lookup_duration", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "The time it takes a request to perform DNS lookup." - }) - if err != nil { - return nil, err - } - hm.ConnectDuration, err = meter.Float64Histogram("client.http.connections.acquire_duration", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "The time it takes a request to acquire a connection." - }) - if err != nil { - return nil, err - } - hm.TLSHandshakeDuration, err = meter.Float64Histogram("client.http.connections.tls_handshake_duration", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "The time it takes an HTTP request to perform the TLS handshake." - }) - if err != nil { - return nil, err - } - hm.ConnectionUsage, err = meter.Int64UpDownCounter("client.http.connections.usage", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "{connection}" - o.Description = "Current state of connections pool." - }) - if err != nil { - return nil, err - } - hm.DoRequestDuration, err = meter.Float64Histogram("client.http.do_request_duration", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "Time spent performing an entire HTTP transaction." - }) - if err != nil { - return nil, err - } - hm.TimeToFirstByte, err = meter.Float64Histogram("client.http.time_to_first_byte", func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = "Time from start of transaction to when the first response byte is available." - }) - if err != nil { - return nil, err - } - - return hm, nil -} - -func (m *httpMetrics) DNSStart(httptrace.DNSStartInfo) { - m.dnsStart.Store(now()) -} - -func (m *httpMetrics) ConnectStart(string, string) { - m.connectStart.Store(now()) -} - -func (m *httpMetrics) TLSHandshakeStart() { - m.tlsStart.Store(now()) -} - -func (m *httpMetrics) GotConn(ctx context.Context) func(httptrace.GotConnInfo) { - return func(httptrace.GotConnInfo) { - m.addConnAcquired(ctx, 1) - } -} - -func (m *httpMetrics) PutIdleConn(ctx context.Context) func(error) { - return func(error) { - m.addConnAcquired(ctx, -1) - } -} - -func (m *httpMetrics) DNSDone(ctx context.Context) func(httptrace.DNSDoneInfo) { - return func(httptrace.DNSDoneInfo) { - m.DNSLookupDuration.Record(ctx, m.dnsStart.Elapsed()) - } -} - -func (m *httpMetrics) ConnectDone(ctx context.Context) func(string, string, error) { - return func(string, string, error) { - m.ConnectDuration.Record(ctx, m.connectStart.Elapsed()) - } -} - -func (m *httpMetrics) TLSHandshakeDone(ctx context.Context) func(tls.ConnectionState, error) { - return func(tls.ConnectionState, error) { - m.TLSHandshakeDuration.Record(ctx, m.tlsStart.Elapsed()) - } -} - -func (m *httpMetrics) GotFirstResponseByte(ctx context.Context) func() { - return func() { - m.TimeToFirstByte.Record(ctx, m.doStart.Elapsed()) - } -} - -func (m *httpMetrics) addConnAcquired(ctx context.Context, incr int64) { - m.ConnectionUsage.Add(ctx, incr, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("state", "acquired") - }) -} - -// Not used: it is recommended to track acquired vs idle conn, but we can't -// determine when something is truly idle with the current HTTP client hooks -// available to us. -func (m *httpMetrics) addConnIdle(ctx context.Context, incr int64) { - m.ConnectionUsage.Add(ctx, incr, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("state", "idle") - }) -} - -type safeTime struct { - atomic.Value // time.Time -} - -func (st *safeTime) Store(v time.Time) { - st.Value.Store(v) -} - -func (st *safeTime) Load() time.Time { - t, _ := st.Value.Load().(time.Time) - return t -} - -func (st *safeTime) Elapsed() float64 { - end := now() - elapsed := end.Sub(st.Load()) - return float64(elapsed) / 1e9 -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go deleted file mode 100644 index 914338f2e..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go +++ /dev/null @@ -1,79 +0,0 @@ -package http - -import ( - "context" - "io" - - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" -) - -// AddErrorCloseResponseBodyMiddleware adds the middleware to automatically -// close the response body of an operation request if the request response -// failed. -func AddErrorCloseResponseBodyMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&errorCloseResponseBodyMiddleware{}, "OperationDeserializer", middleware.Before) -} - -type errorCloseResponseBodyMiddleware struct{} - -func (*errorCloseResponseBodyMiddleware) ID() string { - return "ErrorCloseResponseBody" -} - -func (m *errorCloseResponseBodyMiddleware) HandleDeserialize( - ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - output middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err := next.HandleDeserialize(ctx, input) - if err != nil { - if resp, ok := out.RawResponse.(*Response); ok && resp != nil && resp.Body != nil { - // Consume the full body to prevent TCP connection resets on some platforms - _, _ = io.Copy(io.Discard, resp.Body) - // Do not validate that the response closes successfully. - resp.Body.Close() - } - } - - return out, metadata, err -} - -// AddCloseResponseBodyMiddleware adds the middleware to automatically close -// the response body of an operation request, after the response had been -// deserialized. -func AddCloseResponseBodyMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&closeResponseBody{}, "OperationDeserializer", middleware.Before) -} - -type closeResponseBody struct{} - -func (*closeResponseBody) ID() string { - return "CloseResponseBody" -} - -func (m *closeResponseBody) HandleDeserialize( - ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - output middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err := next.HandleDeserialize(ctx, input) - if err != nil { - return out, metadata, err - } - - if resp, ok := out.RawResponse.(*Response); ok { - // Consume the full body to prevent TCP connection resets on some platforms - _, copyErr := io.Copy(io.Discard, resp.Body) - if copyErr != nil { - middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse") - } - - closeErr := resp.Body.Close() - if closeErr != nil { - middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse") - } - } - - return out, metadata, err -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go deleted file mode 100644 index 9969389bb..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go +++ /dev/null @@ -1,84 +0,0 @@ -package http - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/middleware" -) - -// ComputeContentLength provides a middleware to set the content-length -// header for the length of a serialize request body. -type ComputeContentLength struct { -} - -// AddComputeContentLengthMiddleware adds ComputeContentLength to the middleware -// stack's Build step. -func AddComputeContentLengthMiddleware(stack *middleware.Stack) error { - return stack.Build.Add(&ComputeContentLength{}, middleware.After) -} - -// ID returns the identifier for the ComputeContentLength. -func (m *ComputeContentLength) ID() string { return "ComputeContentLength" } - -// HandleBuild adds the length of the serialized request to the HTTP header -// if the length can be determined. -func (m *ComputeContentLength) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown request type %T", req) - } - - // do nothing if request content-length was set to 0 or above. - if req.ContentLength >= 0 { - return next.HandleBuild(ctx, in) - } - - // attempt to compute stream length - if n, ok, err := req.StreamLength(); err != nil { - return out, metadata, fmt.Errorf( - "failed getting length of request stream, %w", err) - } else if ok { - req.ContentLength = n - } - - return next.HandleBuild(ctx, in) -} - -// validateContentLength provides a middleware to validate the content-length -// is valid (greater than zero), for the serialized request payload. -type validateContentLength struct{} - -// ValidateContentLengthHeader adds middleware that validates request content-length -// is set to value greater than zero. -func ValidateContentLengthHeader(stack *middleware.Stack) error { - return stack.Build.Add(&validateContentLength{}, middleware.After) -} - -// ID returns the identifier for the ComputeContentLength. -func (m *validateContentLength) ID() string { return "ValidateContentLength" } - -// HandleBuild adds the length of the serialized request to the HTTP header -// if the length can be determined. -func (m *validateContentLength) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown request type %T", req) - } - - // if request content-length was set to less than 0, return an error - if req.ContentLength < 0 { - return out, metadata, fmt.Errorf( - "content length for payload is required and must be at least 0") - } - - return next.HandleBuild(ctx, in) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go deleted file mode 100644 index 855c22720..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go +++ /dev/null @@ -1,81 +0,0 @@ -package http - -import ( - "context" - "fmt" - "net/http" - - "github.com/aws/smithy-go/middleware" -) - -// WithHeaderComment instruments a middleware stack to append an HTTP field -// comment to the given header as specified in RFC 9110 -// (https://www.rfc-editor.org/rfc/rfc9110#name-comments). -// -// The header is case-insensitive. If the provided header exists when the -// middleware runs, the content will be inserted as-is enclosed in parentheses. -// -// Note that per the HTTP specification, comments are only allowed in fields -// containing "comment" as part of their field value definition, but this API -// will NOT verify whether the provided header is one of them. -// -// WithHeaderComment MAY be applied more than once to a middleware stack and/or -// more than once per header. -func WithHeaderComment(header, content string) func(*middleware.Stack) error { - return func(s *middleware.Stack) error { - m, err := getOrAddHeaderComment(s) - if err != nil { - return fmt.Errorf("get or add header comment: %v", err) - } - - m.values.Add(header, content) - return nil - } -} - -type headerCommentMiddleware struct { - values http.Header // hijack case-insensitive access APIs -} - -func (*headerCommentMiddleware) ID() string { - return "headerComment" -} - -func (m *headerCommentMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - r, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - for h, contents := range m.values { - for _, c := range contents { - if existing := r.Header.Get(h); existing != "" { - r.Header.Set(h, fmt.Sprintf("%s (%s)", existing, c)) - } - } - } - - return next.HandleBuild(ctx, in) -} - -func getOrAddHeaderComment(s *middleware.Stack) (*headerCommentMiddleware, error) { - id := (*headerCommentMiddleware)(nil).ID() - m, ok := s.Build.Get(id) - if !ok { - m := &headerCommentMiddleware{values: http.Header{}} - if err := s.Build.Add(m, middleware.After); err != nil { - return nil, fmt.Errorf("add build: %v", err) - } - - return m, nil - } - - hc, ok := m.(*headerCommentMiddleware) - if !ok { - return nil, fmt.Errorf("existing middleware w/ id %s is not *headerCommentMiddleware", id) - } - - return hc, nil -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go deleted file mode 100644 index eac32b4ba..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go +++ /dev/null @@ -1,167 +0,0 @@ -package http - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/middleware" -) - -type isContentTypeAutoSet struct{} - -// SetIsContentTypeDefaultValue returns a Context specifying if the request's -// content-type header was set to a default value. -func SetIsContentTypeDefaultValue(ctx context.Context, isDefault bool) context.Context { - return context.WithValue(ctx, isContentTypeAutoSet{}, isDefault) -} - -// GetIsContentTypeDefaultValue returns if the content-type HTTP header on the -// request is a default value that was auto assigned by an operation -// serializer. Allows middleware post serialization to know if the content-type -// was auto set to a default value or not. -// -// Also returns false if the Context value was never updated to include if -// content-type was set to a default value. -func GetIsContentTypeDefaultValue(ctx context.Context) bool { - v, _ := ctx.Value(isContentTypeAutoSet{}).(bool) - return v -} - -// AddNoPayloadDefaultContentTypeRemover Adds the DefaultContentTypeRemover -// middleware to the stack after the operation serializer. This middleware will -// remove the content-type header from the request if it was set as a default -// value, and no request payload is present. -// -// Returns error if unable to add the middleware. -func AddNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) { - err = stack.Serialize.Insert(removeDefaultContentType{}, - "OperationSerializer", middleware.After) - if err != nil { - return fmt.Errorf("failed to add %s serialize middleware, %w", - removeDefaultContentType{}.ID(), err) - } - - return nil -} - -// RemoveNoPayloadDefaultContentTypeRemover removes the -// DefaultContentTypeRemover middleware from the stack. Returns an error if -// unable to remove the middleware. -func RemoveNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) { - _, err = stack.Serialize.Remove(removeDefaultContentType{}.ID()) - if err != nil { - return fmt.Errorf("failed to remove %s serialize middleware, %w", - removeDefaultContentType{}.ID(), err) - - } - return nil -} - -// removeDefaultContentType provides after serialization middleware that will -// remove the content-type header from an HTTP request if the header was set as -// a default value by the operation serializer, and there is no request payload. -type removeDefaultContentType struct{} - -// ID returns the middleware ID -func (removeDefaultContentType) ID() string { return "RemoveDefaultContentType" } - -// HandleSerialize implements the serialization middleware. -func (removeDefaultContentType) HandleSerialize( - ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, -) ( - out middleware.SerializeOutput, meta middleware.Metadata, err error, -) { - req, ok := input.Request.(*Request) - if !ok { - return out, meta, fmt.Errorf( - "unexpected request type %T for removeDefaultContentType middleware", - input.Request) - } - - if GetIsContentTypeDefaultValue(ctx) && req.GetStream() == nil { - req.Header.Del("Content-Type") - input.Request = req - } - - return next.HandleSerialize(ctx, input) -} - -type headerValue struct { - header string - value string - append bool -} - -type headerValueHelper struct { - headerValues []headerValue -} - -func (h *headerValueHelper) addHeaderValue(value headerValue) { - h.headerValues = append(h.headerValues, value) -} - -func (h *headerValueHelper) ID() string { - return "HTTPHeaderHelper" -} - -func (h *headerValueHelper) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (out middleware.BuildOutput, metadata middleware.Metadata, err error) { - req, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - for _, value := range h.headerValues { - if value.append { - req.Header.Add(value.header, value.value) - } else { - req.Header.Set(value.header, value.value) - } - } - - return next.HandleBuild(ctx, in) -} - -func getOrAddHeaderValueHelper(stack *middleware.Stack) (*headerValueHelper, error) { - id := (*headerValueHelper)(nil).ID() - m, ok := stack.Build.Get(id) - if !ok { - m = &headerValueHelper{} - err := stack.Build.Add(m, middleware.After) - if err != nil { - return nil, err - } - } - - requestUserAgent, ok := m.(*headerValueHelper) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", m, id) - } - - return requestUserAgent, nil -} - -// AddHeaderValue returns a stack mutator that adds the header value pair to header. -// Appends to any existing values if present. -func AddHeaderValue(header string, value string) func(stack *middleware.Stack) error { - return func(stack *middleware.Stack) error { - helper, err := getOrAddHeaderValueHelper(stack) - if err != nil { - return err - } - helper.addHeaderValue(headerValue{header: header, value: value, append: true}) - return nil - } -} - -// SetHeaderValue returns a stack mutator that adds the header value pair to header. -// Replaces any existing values if present. -func SetHeaderValue(header string, value string) func(stack *middleware.Stack) error { - return func(stack *middleware.Stack) error { - helper, err := getOrAddHeaderValueHelper(stack) - if err != nil { - return err - } - helper.addHeaderValue(headerValue{header: header, value: value, append: false}) - return nil - } -} 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 deleted file mode 100644 index d5909b0a2..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go +++ /dev/null @@ -1,75 +0,0 @@ -package http - -import ( - "context" - "fmt" - "net/http/httputil" - - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" -) - -// RequestResponseLogger is a deserialize middleware that will log the request and response HTTP messages and optionally -// their respective bodies. Will not perform any logging if none of the options are set. -type RequestResponseLogger struct { - LogRequest bool - LogRequestWithBody bool - - LogResponse bool - LogResponseWithBody bool -} - -// ID is the middleware identifier. -func (r *RequestResponseLogger) ID() string { - return "RequestResponseLogger" -} - -// HandleDeserialize will log the request and response HTTP messages if configured accordingly. -func (r *RequestResponseLogger) HandleDeserialize( - ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, -) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - logger := middleware.GetLogger(ctx) - - if r.LogRequest || r.LogRequestWithBody { - smithyRequest, ok := in.Request.(*Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in) - } - - rc := smithyRequest.Build(ctx) - reqBytes, err := httputil.DumpRequestOut(rc, r.LogRequestWithBody) - if err != nil { - return out, metadata, err - } - - logger.Logf(logging.Debug, "Request\n%v", string(reqBytes)) - - if r.LogRequestWithBody { - smithyRequest, err = smithyRequest.SetStream(rc.Body) - if err != nil { - return out, metadata, err - } - in.Request = smithyRequest - } - } - - out, metadata, err = next.HandleDeserialize(ctx, in) - - if (err == nil) && (r.LogResponse || r.LogResponseWithBody) { - smithyResponse, ok := out.RawResponse.(*Response) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", out.RawResponse) - } - - respBytes, err := httputil.DumpResponse(smithyResponse.Response, r.LogResponseWithBody) - if err != nil { - return out, metadata, fmt.Errorf("failed to dump response %w", err) - } - - logger.Logf(logging.Debug, "Response\n%v", string(respBytes)) - } - - return out, metadata, err -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go deleted file mode 100644 index d6079b259..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go +++ /dev/null @@ -1,51 +0,0 @@ -package http - -import ( - "context" - - "github.com/aws/smithy-go/middleware" -) - -type ( - hostnameImmutableKey struct{} - hostPrefixDisableKey struct{} -) - -// GetHostnameImmutable retrieves whether the endpoint hostname should be considered -// immutable or not. -// -// Scoped to stack values. Use middleware#ClearStackValues to clear all stack -// values. -func GetHostnameImmutable(ctx context.Context) (v bool) { - v, _ = middleware.GetStackValue(ctx, hostnameImmutableKey{}).(bool) - return v -} - -// SetHostnameImmutable sets or modifies whether the request's endpoint hostname -// should be considered immutable or not. -// -// Scoped to stack values. Use middleware#ClearStackValues to clear all stack -// values. -func SetHostnameImmutable(ctx context.Context, value bool) context.Context { - return middleware.WithStackValue(ctx, hostnameImmutableKey{}, value) -} - -// IsEndpointHostPrefixDisabled retrieves whether the hostname prefixing is -// disabled. -// -// Scoped to stack values. Use middleware#ClearStackValues to clear all stack -// values. -func IsEndpointHostPrefixDisabled(ctx context.Context) (v bool) { - v, _ = middleware.GetStackValue(ctx, hostPrefixDisableKey{}).(bool) - return v -} - -// DisableEndpointHostPrefix sets or modifies whether the request's endpoint host -// prefixing should be disabled. If value is true, endpoint host prefixing -// will be disabled. -// -// Scoped to stack values. Use middleware#ClearStackValues to clear all stack -// values. -func DisableEndpointHostPrefix(ctx context.Context, value bool) context.Context { - return middleware.WithStackValue(ctx, hostPrefixDisableKey{}, value) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go deleted file mode 100644 index 326cb8a6c..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go +++ /dev/null @@ -1,79 +0,0 @@ -package http - -import ( - "context" - "fmt" - "github.com/aws/smithy-go/middleware" - "strings" -) - -// MinimumProtocolError is an error type indicating that the established connection did not meet the expected minimum -// HTTP protocol version. -type MinimumProtocolError struct { - proto string - expectedProtoMajor int - expectedProtoMinor int -} - -// Error returns the error message. -func (m *MinimumProtocolError) Error() string { - return fmt.Sprintf("operation requires minimum HTTP protocol of HTTP/%d.%d, but was %s", - m.expectedProtoMajor, m.expectedProtoMinor, m.proto) -} - -// RequireMinimumProtocol is a deserialization middleware that asserts that the established HTTP connection -// meets the minimum major ad minor version. -type RequireMinimumProtocol struct { - ProtoMajor int - ProtoMinor int -} - -// AddRequireMinimumProtocol adds the RequireMinimumProtocol middleware to the stack using the provided minimum -// protocol major and minor version. -func AddRequireMinimumProtocol(stack *middleware.Stack, major, minor int) error { - return stack.Deserialize.Insert(&RequireMinimumProtocol{ - ProtoMajor: major, - ProtoMinor: minor, - }, "OperationDeserializer", middleware.Before) -} - -// ID returns the middleware identifier string. -func (r *RequireMinimumProtocol) ID() string { - return "RequireMinimumProtocol" -} - -// HandleDeserialize asserts that the established connection is a HTTP connection with the minimum major and minor -// protocol version. -func (r *RequireMinimumProtocol) 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.(*Response) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse) - } - - if !strings.HasPrefix(response.Proto, "HTTP") { - return out, metadata, &MinimumProtocolError{ - proto: response.Proto, - expectedProtoMajor: r.ProtoMajor, - expectedProtoMinor: r.ProtoMinor, - } - } - - if response.ProtoMajor < r.ProtoMajor || response.ProtoMinor < r.ProtoMinor { - return out, metadata, &MinimumProtocolError{ - proto: response.Proto, - expectedProtoMajor: r.ProtoMajor, - expectedProtoMinor: r.ProtoMinor, - } - } - - return out, metadata, err -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/properties.go b/vendor/github.com/aws/smithy-go/transport/http/properties.go deleted file mode 100644 index c65aa3932..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/properties.go +++ /dev/null @@ -1,80 +0,0 @@ -package http - -import smithy "github.com/aws/smithy-go" - -type ( - sigV4SigningNameKey struct{} - sigV4SigningRegionKey struct{} - - sigV4ASigningNameKey struct{} - sigV4ASigningRegionsKey struct{} - - isUnsignedPayloadKey struct{} - disableDoubleEncodingKey struct{} -) - -// GetSigV4SigningName gets the signing name from Properties. -func GetSigV4SigningName(p *smithy.Properties) (string, bool) { - v, ok := p.Get(sigV4SigningNameKey{}).(string) - return v, ok -} - -// SetSigV4SigningName sets the signing name on Properties. -func SetSigV4SigningName(p *smithy.Properties, name string) { - p.Set(sigV4SigningNameKey{}, name) -} - -// GetSigV4SigningRegion gets the signing region from Properties. -func GetSigV4SigningRegion(p *smithy.Properties) (string, bool) { - v, ok := p.Get(sigV4SigningRegionKey{}).(string) - return v, ok -} - -// SetSigV4SigningRegion sets the signing region on Properties. -func SetSigV4SigningRegion(p *smithy.Properties, region string) { - p.Set(sigV4SigningRegionKey{}, region) -} - -// GetSigV4ASigningName gets the v4a signing name from Properties. -func GetSigV4ASigningName(p *smithy.Properties) (string, bool) { - v, ok := p.Get(sigV4ASigningNameKey{}).(string) - return v, ok -} - -// SetSigV4ASigningName sets the signing name on Properties. -func SetSigV4ASigningName(p *smithy.Properties, name string) { - p.Set(sigV4ASigningNameKey{}, name) -} - -// GetSigV4ASigningRegion gets the v4a signing region set from Properties. -func GetSigV4ASigningRegions(p *smithy.Properties) ([]string, bool) { - v, ok := p.Get(sigV4ASigningRegionsKey{}).([]string) - return v, ok -} - -// SetSigV4ASigningRegions sets the v4a signing region set on Properties. -func SetSigV4ASigningRegions(p *smithy.Properties, regions []string) { - p.Set(sigV4ASigningRegionsKey{}, regions) -} - -// GetIsUnsignedPayload gets whether the payload is unsigned from Properties. -func GetIsUnsignedPayload(p *smithy.Properties) (bool, bool) { - v, ok := p.Get(isUnsignedPayloadKey{}).(bool) - return v, ok -} - -// SetIsUnsignedPayload sets whether the payload is unsigned on Properties. -func SetIsUnsignedPayload(p *smithy.Properties, isUnsignedPayload bool) { - p.Set(isUnsignedPayloadKey{}, isUnsignedPayload) -} - -// GetDisableDoubleEncoding gets whether the payload is unsigned from Properties. -func GetDisableDoubleEncoding(p *smithy.Properties) (bool, bool) { - v, ok := p.Get(disableDoubleEncodingKey{}).(bool) - return v, ok -} - -// SetDisableDoubleEncoding sets whether the payload is unsigned on Properties. -func SetDisableDoubleEncoding(p *smithy.Properties, disableDoubleEncoding bool) { - p.Set(disableDoubleEncodingKey{}, disableDoubleEncoding) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/request.go b/vendor/github.com/aws/smithy-go/transport/http/request.go deleted file mode 100644 index 5cbf6f10a..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/request.go +++ /dev/null @@ -1,188 +0,0 @@ -package http - -import ( - "context" - "fmt" - "io" - "net/http" - "net/url" - "strings" - - iointernal "github.com/aws/smithy-go/transport/http/internal/io" -) - -// Request provides the HTTP specific request structure for HTTP specific -// middleware steps to use to serialize input, and send an operation's request. -type Request struct { - *http.Request - stream io.Reader - isStreamSeekable bool - streamStartPos int64 -} - -// NewStackRequest returns an initialized request ready to be populated with the -// HTTP request details. Returns empty interface so the function can be used as -// a parameter to the Smithy middleware Stack constructor. -func NewStackRequest() interface{} { - return &Request{ - Request: &http.Request{ - URL: &url.URL{}, - Header: http.Header{}, - ContentLength: -1, // default to unknown length - }, - } -} - -// IsHTTPS returns if the request is HTTPS. Returns false if no endpoint URL is set. -func (r *Request) IsHTTPS() bool { - if r.URL == nil { - return false - } - return strings.EqualFold(r.URL.Scheme, "https") -} - -// Clone returns a deep copy of the Request for the new context. A reference to -// the Stream is copied, but the underlying stream is not copied. -func (r *Request) Clone() *Request { - rc := *r - rc.Request = rc.Request.Clone(context.TODO()) - return &rc -} - -// StreamLength returns the number of bytes of the serialized stream attached -// to the request and ok set. If the length cannot be determined, an error will -// be returned. -func (r *Request) StreamLength() (size int64, ok bool, err error) { - return streamLength(r.stream, r.isStreamSeekable, r.streamStartPos) -} - -func streamLength(stream io.Reader, seekable bool, startPos int64) (size int64, ok bool, err error) { - if stream == nil { - return 0, true, nil - } - - if l, ok := stream.(interface{ Len() int }); ok { - return int64(l.Len()), true, nil - } - - if !seekable { - return 0, false, nil - } - - s := stream.(io.Seeker) - endOffset, err := s.Seek(0, io.SeekEnd) - if err != nil { - return 0, false, err - } - - // The reason to seek to streamStartPos instead of 0 is to ensure that the - // SDK only sends the stream from the starting position the user's - // application provided it to the SDK at. For example application opens a - // file, and wants to skip the first N bytes uploading the rest. The - // application would move the file's offset N bytes, then hand it off to - // the SDK to send the remaining. The SDK should respect that initial offset. - _, err = s.Seek(startPos, io.SeekStart) - if err != nil { - return 0, false, err - } - - return endOffset - startPos, true, nil -} - -// RewindStream will rewind the io.Reader to the relative start position if it -// is an io.Seeker. -func (r *Request) RewindStream() error { - // If there is no stream there is nothing to rewind. - if r.stream == nil { - return nil - } - - if !r.isStreamSeekable { - return fmt.Errorf("request stream is not seekable") - } - _, err := r.stream.(io.Seeker).Seek(r.streamStartPos, io.SeekStart) - return err -} - -// GetStream returns the request stream io.Reader if a stream is set. If no -// stream is present nil will be returned. -func (r *Request) GetStream() io.Reader { - return r.stream -} - -// IsStreamSeekable returns whether the stream is seekable. -func (r *Request) IsStreamSeekable() bool { - return r.isStreamSeekable -} - -// SetStream returns a clone of the request with the stream set to the provided -// reader. May return an error if the provided reader is seekable but returns -// an error. -func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { - rc = r.Clone() - - if reader == http.NoBody { - reader = nil - } - - var isStreamSeekable bool - var streamStartPos int64 - switch v := reader.(type) { - case io.Seeker: - n, err := v.Seek(0, io.SeekCurrent) - if err != nil { - return r, err - } - isStreamSeekable = true - streamStartPos = n - default: - // If the stream length can be determined, and is determined to be empty, - // use a nil stream to prevent confusion between empty vs not-empty - // streams. - length, ok, err := streamLength(reader, false, 0) - if err != nil { - return nil, err - } else if ok && length == 0 { - reader = nil - } - } - - rc.stream = reader - rc.isStreamSeekable = isStreamSeekable - rc.streamStartPos = streamStartPos - - return rc, err -} - -// Build returns a build standard HTTP request value from the Smithy request. -// The request's stream is wrapped in a safe container that allows it to be -// reused for subsequent attempts. -func (r *Request) Build(ctx context.Context) *http.Request { - req := r.Request.Clone(ctx) - - if r.stream == nil && req.ContentLength == -1 { - req.ContentLength = 0 - } - - switch stream := r.stream.(type) { - case *io.PipeReader: - req.Body = io.NopCloser(stream) - req.ContentLength = -1 - default: - // HTTP Client Request must only have a non-nil body if the - // ContentLength is explicitly unknown (-1) or non-zero. The HTTP - // Client will interpret a non-nil body and ContentLength 0 as - // "unknown". This is unwanted behavior. - if req.ContentLength != 0 && r.stream != nil { - req.Body = iointernal.NewSafeReadCloser(io.NopCloser(stream)) - } - } - - return req -} - -// RequestCloner is a function that can take an input request type and clone the request -// for use in a subsequent retry attempt. -func RequestCloner(v interface{}) interface{} { - return v.(*Request).Clone() -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/response.go b/vendor/github.com/aws/smithy-go/transport/http/response.go deleted file mode 100644 index 0c13bfcc8..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/response.go +++ /dev/null @@ -1,34 +0,0 @@ -package http - -import ( - "fmt" - "net/http" -) - -// Response provides the HTTP specific response structure for HTTP specific -// middleware steps to use to deserialize the response from an operation call. -type Response struct { - *http.Response -} - -// ResponseError provides the HTTP centric error type wrapping the underlying -// error with the HTTP response value. -type ResponseError struct { - Response *Response - Err error -} - -// HTTPStatusCode returns the HTTP response status code received from the service. -func (e *ResponseError) HTTPStatusCode() int { return e.Response.StatusCode } - -// HTTPResponse returns the HTTP response received from the service. -func (e *ResponseError) HTTPResponse() *Response { return e.Response } - -// Unwrap returns the nested error if any, or nil. -func (e *ResponseError) Unwrap() error { return e.Err } - -func (e *ResponseError) Error() string { - return fmt.Sprintf( - "http response error StatusCode: %d, %v", - e.Response.StatusCode, e.Err) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/time.go b/vendor/github.com/aws/smithy-go/transport/http/time.go deleted file mode 100644 index 607b196a8..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/time.go +++ /dev/null @@ -1,13 +0,0 @@ -package http - -import ( - "time" - - smithytime "github.com/aws/smithy-go/time" -) - -// ParseTime parses a time string like the HTTP Date header. This uses a more -// relaxed rule set for date parsing compared to the standard library. -func ParseTime(text string) (t time.Time, err error) { - return smithytime.ParseHTTPDate(text) -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/url.go b/vendor/github.com/aws/smithy-go/transport/http/url.go deleted file mode 100644 index 60a5fc100..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/url.go +++ /dev/null @@ -1,44 +0,0 @@ -package http - -import "strings" - -// JoinPath returns an absolute URL path composed of the two paths provided. -// Enforces that the returned path begins with '/'. If added path is empty the -// returned path suffix will match the first parameter suffix. -func JoinPath(a, b string) string { - if len(a) == 0 { - a = "/" - } else if a[0] != '/' { - a = "/" + a - } - - if len(b) != 0 && b[0] == '/' { - b = b[1:] - } - - if len(b) != 0 && len(a) > 1 && a[len(a)-1] != '/' { - a = a + "/" - } - - return a + b -} - -// JoinRawQuery returns an absolute raw query expression. Any duplicate '&' -// will be collapsed to single separator between values. -func JoinRawQuery(a, b string) string { - a = strings.TrimFunc(a, isAmpersand) - b = strings.TrimFunc(b, isAmpersand) - - if len(a) == 0 { - return b - } - if len(b) == 0 { - return a - } - - return a + "&" + b -} - -func isAmpersand(v rune) bool { - return v == '&' -} diff --git a/vendor/github.com/aws/smithy-go/transport/http/user_agent.go b/vendor/github.com/aws/smithy-go/transport/http/user_agent.go deleted file mode 100644 index 71a7e0d8a..000000000 --- a/vendor/github.com/aws/smithy-go/transport/http/user_agent.go +++ /dev/null @@ -1,37 +0,0 @@ -package http - -import ( - "strings" -) - -// UserAgentBuilder is a builder for a HTTP User-Agent string. -type UserAgentBuilder struct { - sb strings.Builder -} - -// NewUserAgentBuilder returns a new UserAgentBuilder. -func NewUserAgentBuilder() *UserAgentBuilder { - return &UserAgentBuilder{sb: strings.Builder{}} -} - -// AddKey adds the named component/product to the agent string -func (u *UserAgentBuilder) AddKey(key string) { - u.appendTo(key) -} - -// AddKeyValue adds the named key to the agent string with the given value. -func (u *UserAgentBuilder) AddKeyValue(key, value string) { - u.appendTo(key + "/" + value) -} - -// Build returns the constructed User-Agent string. May be called multiple times. -func (u *UserAgentBuilder) Build() string { - return u.sb.String() -} - -func (u *UserAgentBuilder) appendTo(value string) { - if u.sb.Len() > 0 { - u.sb.WriteRune(' ') - } - u.sb.WriteString(value) -} diff --git a/vendor/github.com/aws/smithy-go/validation.go b/vendor/github.com/aws/smithy-go/validation.go deleted file mode 100644 index b5eedc1f9..000000000 --- a/vendor/github.com/aws/smithy-go/validation.go +++ /dev/null @@ -1,140 +0,0 @@ -package smithy - -import ( - "bytes" - "fmt" - "strings" -) - -// An InvalidParamsError provides wrapping of invalid parameter errors found when -// validating API operation input parameters. -type InvalidParamsError struct { - // Context is the base context of the invalid parameter group. - Context string - errs []InvalidParamError -} - -// Add adds a new invalid parameter error to the collection of invalid -// parameters. The context of the invalid parameter will be updated to reflect -// this collection. -func (e *InvalidParamsError) Add(err InvalidParamError) { - err.SetContext(e.Context) - e.errs = append(e.errs, err) -} - -// AddNested adds the invalid parameter errors from another InvalidParamsError -// value into this collection. The nested errors will have their nested context -// updated and base context to reflect the merging. -// -// Use for nested validations errors. -func (e *InvalidParamsError) AddNested(nestedCtx string, nested InvalidParamsError) { - for _, err := range nested.errs { - err.SetContext(e.Context) - err.AddNestedContext(nestedCtx) - e.errs = append(e.errs, err) - } -} - -// Len returns the number of invalid parameter errors -func (e *InvalidParamsError) Len() int { - return len(e.errs) -} - -// Error returns the string formatted form of the invalid parameters. -func (e InvalidParamsError) Error() string { - w := &bytes.Buffer{} - fmt.Fprintf(w, "%d validation error(s) found.\n", len(e.errs)) - - for _, err := range e.errs { - fmt.Fprintf(w, "- %s\n", err.Error()) - } - - return w.String() -} - -// Errs returns a slice of the invalid parameters -func (e InvalidParamsError) Errs() []error { - errs := make([]error, len(e.errs)) - for i := 0; i < len(errs); i++ { - errs[i] = e.errs[i] - } - - return errs -} - -// An InvalidParamError represents an invalid parameter error type. -type InvalidParamError interface { - error - - // Field name the error occurred on. - Field() string - - // SetContext updates the context of the error. - SetContext(string) - - // AddNestedContext updates the error's context to include a nested level. - AddNestedContext(string) -} - -type invalidParamError struct { - context string - nestedContext string - field string - reason string -} - -// Error returns the string version of the invalid parameter error. -func (e invalidParamError) Error() string { - return fmt.Sprintf("%s, %s.", e.reason, e.Field()) -} - -// Field Returns the field and context the error occurred. -func (e invalidParamError) Field() string { - sb := &strings.Builder{} - sb.WriteString(e.context) - if sb.Len() > 0 { - if len(e.nestedContext) == 0 || (len(e.nestedContext) > 0 && e.nestedContext[:1] != "[") { - sb.WriteRune('.') - } - } - if len(e.nestedContext) > 0 { - sb.WriteString(e.nestedContext) - sb.WriteRune('.') - } - sb.WriteString(e.field) - return sb.String() -} - -// SetContext updates the base context of the error. -func (e *invalidParamError) SetContext(ctx string) { - e.context = ctx -} - -// AddNestedContext prepends a context to the field's path. -func (e *invalidParamError) AddNestedContext(ctx string) { - if len(e.nestedContext) == 0 { - e.nestedContext = ctx - return - } - // Check if our nested context is an index into a slice or map - if e.nestedContext[:1] != "[" { - e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) - return - } - e.nestedContext = ctx + e.nestedContext -} - -// An ParamRequiredError represents an required parameter error. -type ParamRequiredError struct { - invalidParamError -} - -// NewErrParamRequired creates a new required parameter error. -func NewErrParamRequired(field string) *ParamRequiredError { - return &ParamRequiredError{ - invalidParamError{ - field: field, - reason: fmt.Sprintf("missing required field"), - }, - } -} diff --git a/vendor/github.com/aws/smithy-go/waiter/logger.go b/vendor/github.com/aws/smithy-go/waiter/logger.go deleted file mode 100644 index 8d70a03ff..000000000 --- a/vendor/github.com/aws/smithy-go/waiter/logger.go +++ /dev/null @@ -1,36 +0,0 @@ -package waiter - -import ( - "context" - "fmt" - - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" -) - -// Logger is the Logger middleware used by the waiter to log an attempt -type Logger struct { - // Attempt is the current attempt to be logged - Attempt int64 -} - -// ID representing the Logger middleware -func (*Logger) ID() string { - return "WaiterLogger" -} - -// HandleInitialize performs handling of request in initialize stack step -func (m *Logger) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - logger := middleware.GetLogger(ctx) - - logger.Logf(logging.Debug, fmt.Sprintf("attempting waiter request, attempt count: %d", m.Attempt)) - - return next.HandleInitialize(ctx, in) -} - -// AddLogger is a helper util to add waiter logger after `SetLogger` middleware in -func (m Logger) AddLogger(stack *middleware.Stack) error { - return stack.Initialize.Insert(&m, "SetLogger", middleware.After) -} diff --git a/vendor/github.com/aws/smithy-go/waiter/waiter.go b/vendor/github.com/aws/smithy-go/waiter/waiter.go deleted file mode 100644 index 03e46e2ee..000000000 --- a/vendor/github.com/aws/smithy-go/waiter/waiter.go +++ /dev/null @@ -1,66 +0,0 @@ -package waiter - -import ( - "fmt" - "math" - "time" - - "github.com/aws/smithy-go/rand" -) - -// ComputeDelay computes delay between waiter attempts. The function takes in a current attempt count, -// minimum delay, maximum delay, and remaining wait time for waiter as input. The inputs minDelay and maxDelay -// must always be greater than 0, along with minDelay lesser than or equal to maxDelay. -// -// Returns the computed delay and if next attempt count is possible within the given input time constraints. -// Note that the zeroth attempt results in no delay. -func ComputeDelay(attempt int64, minDelay, maxDelay, remainingTime time.Duration) (delay time.Duration, err error) { - // zeroth attempt, no delay - if attempt <= 0 { - return 0, nil - } - - // remainingTime is zero or less, no delay - if remainingTime <= 0 { - return 0, nil - } - - // validate min delay is greater than 0 - if minDelay == 0 { - return 0, fmt.Errorf("minDelay must be greater than zero when computing Delay") - } - - // validate max delay is greater than 0 - if maxDelay == 0 { - return 0, fmt.Errorf("maxDelay must be greater than zero when computing Delay") - } - - // Get attempt ceiling to prevent integer overflow. - attemptCeiling := (math.Log(float64(maxDelay/minDelay)) / math.Log(2)) + 1 - - if attempt > int64(attemptCeiling) { - delay = maxDelay - } else { - // Compute exponential delay based on attempt. - ri := 1 << uint64(attempt-1) - // compute delay - delay = minDelay * time.Duration(ri) - } - - if delay != minDelay { - // randomize to get jitter between min delay and delay value - d, err := rand.CryptoRandInt63n(int64(delay - minDelay)) - if err != nil { - return 0, fmt.Errorf("error computing retry jitter, %w", err) - } - - delay = time.Duration(d) + minDelay - } - - // check if this is the last attempt possible and compute delay accordingly - if remainingTime-delay <= minDelay { - delay = remainingTime - minDelay - } - - return delay, nil -} diff --git a/vendor/github.com/cenkalti/backoff/v4/.gitignore b/vendor/github.com/cenkalti/backoff/v4/.gitignore deleted file mode 100644 index 50d95c548..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -# IDEs -.idea/ diff --git a/vendor/github.com/cenkalti/backoff/v4/LICENSE b/vendor/github.com/cenkalti/backoff/v4/LICENSE deleted file mode 100644 index 89b817996..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Cenk Altı - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/cenkalti/backoff/v4/README.md b/vendor/github.com/cenkalti/backoff/v4/README.md deleted file mode 100644 index 9433004a2..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Coverage Status][coveralls image]][coveralls] - -This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. - -[Exponential backoff][exponential backoff wiki] -is an algorithm that uses feedback to multiplicatively decrease the rate of some process, -in order to gradually find an acceptable rate. -The retries exponentially increase and stop increasing when a certain threshold is met. - -## Usage - -Import path is `github.com/cenkalti/backoff/v4`. Please note the version part at the end. - -Use https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation. - -## Contributing - -* I would like to keep this library as small as possible. -* Please don't send a PR without opening an issue and discussing it first. -* If proposed change is not a common use case, I will probably not accept it. - -[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4 -[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png -[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master -[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master - -[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java -[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff - -[advanced example]: https://pkg.go.dev/github.com/cenkalti/backoff/v4?tab=doc#pkg-examples diff --git a/vendor/github.com/cenkalti/backoff/v4/backoff.go b/vendor/github.com/cenkalti/backoff/v4/backoff.go deleted file mode 100644 index 3676ee405..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/backoff.go +++ /dev/null @@ -1,66 +0,0 @@ -// Package backoff implements backoff algorithms for retrying operations. -// -// Use Retry function for retrying operations that may fail. -// If Retry does not meet your needs, -// copy/paste the function into your project and modify as you wish. -// -// There is also Ticker type similar to time.Ticker. -// You can use it if you need to work with channels. -// -// See Examples section below for usage examples. -package backoff - -import "time" - -// BackOff is a backoff policy for retrying an operation. -type BackOff interface { - // NextBackOff returns the duration to wait before retrying the operation, - // or backoff. Stop to indicate that no more retries should be made. - // - // Example usage: - // - // duration := backoff.NextBackOff(); - // if (duration == backoff.Stop) { - // // Do not retry operation. - // } else { - // // Sleep for duration and retry operation. - // } - // - NextBackOff() time.Duration - - // Reset to initial state. - Reset() -} - -// Stop indicates that no more retries should be made for use in NextBackOff(). -const Stop time.Duration = -1 - -// ZeroBackOff is a fixed backoff policy whose backoff time is always zero, -// meaning that the operation is retried immediately without waiting, indefinitely. -type ZeroBackOff struct{} - -func (b *ZeroBackOff) Reset() {} - -func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 } - -// StopBackOff is a fixed backoff policy that always returns backoff.Stop for -// NextBackOff(), meaning that the operation should never be retried. -type StopBackOff struct{} - -func (b *StopBackOff) Reset() {} - -func (b *StopBackOff) NextBackOff() time.Duration { return Stop } - -// ConstantBackOff is a backoff policy that always returns the same backoff delay. -// This is in contrast to an exponential backoff policy, -// which returns a delay that grows longer as you call NextBackOff() over and over again. -type ConstantBackOff struct { - Interval time.Duration -} - -func (b *ConstantBackOff) Reset() {} -func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval } - -func NewConstantBackOff(d time.Duration) *ConstantBackOff { - return &ConstantBackOff{Interval: d} -} diff --git a/vendor/github.com/cenkalti/backoff/v4/context.go b/vendor/github.com/cenkalti/backoff/v4/context.go deleted file mode 100644 index 48482330e..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/context.go +++ /dev/null @@ -1,62 +0,0 @@ -package backoff - -import ( - "context" - "time" -) - -// BackOffContext is a backoff policy that stops retrying after the context -// is canceled. -type BackOffContext interface { // nolint: golint - BackOff - Context() context.Context -} - -type backOffContext struct { - BackOff - ctx context.Context -} - -// WithContext returns a BackOffContext with context ctx -// -// ctx must not be nil -func WithContext(b BackOff, ctx context.Context) BackOffContext { // nolint: golint - if ctx == nil { - panic("nil context") - } - - if b, ok := b.(*backOffContext); ok { - return &backOffContext{ - BackOff: b.BackOff, - ctx: ctx, - } - } - - return &backOffContext{ - BackOff: b, - ctx: ctx, - } -} - -func getContext(b BackOff) context.Context { - if cb, ok := b.(BackOffContext); ok { - return cb.Context() - } - if tb, ok := b.(*backOffTries); ok { - return getContext(tb.delegate) - } - return context.Background() -} - -func (b *backOffContext) Context() context.Context { - return b.ctx -} - -func (b *backOffContext) NextBackOff() time.Duration { - select { - case <-b.ctx.Done(): - return Stop - default: - return b.BackOff.NextBackOff() - } -} diff --git a/vendor/github.com/cenkalti/backoff/v4/exponential.go b/vendor/github.com/cenkalti/backoff/v4/exponential.go deleted file mode 100644 index aac99f196..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/exponential.go +++ /dev/null @@ -1,216 +0,0 @@ -package backoff - -import ( - "math/rand" - "time" -) - -/* -ExponentialBackOff is a backoff implementation that increases the backoff -period for each retry attempt using a randomization function that grows exponentially. - -NextBackOff() is calculated using the following formula: - - randomized interval = - RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor]) - -In other words NextBackOff() will range between the randomization factor -percentage below and above the retry interval. - -For example, given the following parameters: - - RetryInterval = 2 - RandomizationFactor = 0.5 - Multiplier = 2 - -the actual backoff period used in the next retry attempt will range between 1 and 3 seconds, -multiplied by the exponential, that is, between 2 and 6 seconds. - -Note: MaxInterval caps the RetryInterval and not the randomized interval. - -If the time elapsed since an ExponentialBackOff instance is created goes past the -MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. - -The elapsed time can be reset by calling Reset(). - -Example: Given the following default arguments, for 10 tries the sequence will be, -and assuming we go over the MaxElapsedTime on the 10th try: - - Request # RetryInterval (seconds) Randomized Interval (seconds) - - 1 0.5 [0.25, 0.75] - 2 0.75 [0.375, 1.125] - 3 1.125 [0.562, 1.687] - 4 1.687 [0.8435, 2.53] - 5 2.53 [1.265, 3.795] - 6 3.795 [1.897, 5.692] - 7 5.692 [2.846, 8.538] - 8 8.538 [4.269, 12.807] - 9 12.807 [6.403, 19.210] - 10 19.210 backoff.Stop - -Note: Implementation is not thread-safe. -*/ -type ExponentialBackOff struct { - InitialInterval time.Duration - RandomizationFactor float64 - Multiplier float64 - MaxInterval time.Duration - // After MaxElapsedTime the ExponentialBackOff returns Stop. - // It never stops if MaxElapsedTime == 0. - MaxElapsedTime time.Duration - Stop time.Duration - Clock Clock - - currentInterval time.Duration - startTime time.Time -} - -// Clock is an interface that returns current time for BackOff. -type Clock interface { - Now() time.Time -} - -// ExponentialBackOffOpts is a function type used to configure ExponentialBackOff options. -type ExponentialBackOffOpts func(*ExponentialBackOff) - -// Default values for ExponentialBackOff. -const ( - DefaultInitialInterval = 500 * time.Millisecond - DefaultRandomizationFactor = 0.5 - DefaultMultiplier = 1.5 - DefaultMaxInterval = 60 * time.Second - DefaultMaxElapsedTime = 15 * time.Minute -) - -// NewExponentialBackOff creates an instance of ExponentialBackOff using default values. -func NewExponentialBackOff(opts ...ExponentialBackOffOpts) *ExponentialBackOff { - b := &ExponentialBackOff{ - InitialInterval: DefaultInitialInterval, - RandomizationFactor: DefaultRandomizationFactor, - Multiplier: DefaultMultiplier, - MaxInterval: DefaultMaxInterval, - MaxElapsedTime: DefaultMaxElapsedTime, - Stop: Stop, - Clock: SystemClock, - } - for _, fn := range opts { - fn(b) - } - b.Reset() - return b -} - -// WithInitialInterval sets the initial interval between retries. -func WithInitialInterval(duration time.Duration) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.InitialInterval = duration - } -} - -// WithRandomizationFactor sets the randomization factor to add jitter to intervals. -func WithRandomizationFactor(randomizationFactor float64) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.RandomizationFactor = randomizationFactor - } -} - -// WithMultiplier sets the multiplier for increasing the interval after each retry. -func WithMultiplier(multiplier float64) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.Multiplier = multiplier - } -} - -// WithMaxInterval sets the maximum interval between retries. -func WithMaxInterval(duration time.Duration) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.MaxInterval = duration - } -} - -// WithMaxElapsedTime sets the maximum total time for retries. -func WithMaxElapsedTime(duration time.Duration) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.MaxElapsedTime = duration - } -} - -// WithRetryStopDuration sets the duration after which retries should stop. -func WithRetryStopDuration(duration time.Duration) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.Stop = duration - } -} - -// WithClockProvider sets the clock used to measure time. -func WithClockProvider(clock Clock) ExponentialBackOffOpts { - return func(ebo *ExponentialBackOff) { - ebo.Clock = clock - } -} - -type systemClock struct{} - -func (t systemClock) Now() time.Time { - return time.Now() -} - -// SystemClock implements Clock interface that uses time.Now(). -var SystemClock = systemClock{} - -// Reset the interval back to the initial retry interval and restarts the timer. -// Reset must be called before using b. -func (b *ExponentialBackOff) Reset() { - b.currentInterval = b.InitialInterval - b.startTime = b.Clock.Now() -} - -// NextBackOff calculates the next backoff interval using the formula: -// Randomized interval = RetryInterval * (1 ± RandomizationFactor) -func (b *ExponentialBackOff) NextBackOff() time.Duration { - // Make sure we have not gone over the maximum elapsed time. - elapsed := b.GetElapsedTime() - next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval) - b.incrementCurrentInterval() - if b.MaxElapsedTime != 0 && elapsed+next > b.MaxElapsedTime { - return b.Stop - } - return next -} - -// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance -// is created and is reset when Reset() is called. -// -// The elapsed time is computed using time.Now().UnixNano(). It is -// safe to call even while the backoff policy is used by a running -// ticker. -func (b *ExponentialBackOff) GetElapsedTime() time.Duration { - return b.Clock.Now().Sub(b.startTime) -} - -// Increments the current interval by multiplying it with the multiplier. -func (b *ExponentialBackOff) incrementCurrentInterval() { - // Check for overflow, if overflow is detected set the current interval to the max interval. - if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier { - b.currentInterval = b.MaxInterval - } else { - b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier) - } -} - -// Returns a random value from the following interval: -// [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval]. -func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { - if randomizationFactor == 0 { - return currentInterval // make sure no randomness is used when randomizationFactor is 0. - } - var delta = randomizationFactor * float64(currentInterval) - var minInterval = float64(currentInterval) - delta - var maxInterval = float64(currentInterval) + delta - - // Get a random value from the range [minInterval, maxInterval]. - // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then - // we want a 33% chance for selecting either 1, 2 or 3. - return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) -} diff --git a/vendor/github.com/cenkalti/backoff/v4/retry.go b/vendor/github.com/cenkalti/backoff/v4/retry.go deleted file mode 100644 index b9c0c51cd..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/retry.go +++ /dev/null @@ -1,146 +0,0 @@ -package backoff - -import ( - "errors" - "time" -) - -// An OperationWithData is executing by RetryWithData() or RetryNotifyWithData(). -// The operation will be retried using a backoff policy if it returns an error. -type OperationWithData[T any] func() (T, error) - -// An Operation is executing by Retry() or RetryNotify(). -// The operation will be retried using a backoff policy if it returns an error. -type Operation func() error - -func (o Operation) withEmptyData() OperationWithData[struct{}] { - return func() (struct{}, error) { - return struct{}{}, o() - } -} - -// Notify is a notify-on-error function. It receives an operation error and -// backoff delay if the operation failed (with an error). -// -// NOTE that if the backoff policy stated to stop retrying, -// the notify function isn't called. -type Notify func(error, time.Duration) - -// Retry the operation o until it does not return error or BackOff stops. -// o is guaranteed to be run at least once. -// -// If o returns a *PermanentError, the operation is not retried, and the -// wrapped error is returned. -// -// Retry sleeps the goroutine for the duration returned by BackOff after a -// failed operation returns. -func Retry(o Operation, b BackOff) error { - return RetryNotify(o, b, nil) -} - -// RetryWithData is like Retry but returns data in the response too. -func RetryWithData[T any](o OperationWithData[T], b BackOff) (T, error) { - return RetryNotifyWithData(o, b, nil) -} - -// RetryNotify calls notify function with the error and wait duration -// for each failed attempt before sleep. -func RetryNotify(operation Operation, b BackOff, notify Notify) error { - return RetryNotifyWithTimer(operation, b, notify, nil) -} - -// RetryNotifyWithData is like RetryNotify but returns data in the response too. -func RetryNotifyWithData[T any](operation OperationWithData[T], b BackOff, notify Notify) (T, error) { - return doRetryNotify(operation, b, notify, nil) -} - -// RetryNotifyWithTimer calls notify function with the error and wait duration using the given Timer -// for each failed attempt before sleep. -// A default timer that uses system timer is used when nil is passed. -func RetryNotifyWithTimer(operation Operation, b BackOff, notify Notify, t Timer) error { - _, err := doRetryNotify(operation.withEmptyData(), b, notify, t) - return err -} - -// RetryNotifyWithTimerAndData is like RetryNotifyWithTimer but returns data in the response too. -func RetryNotifyWithTimerAndData[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) { - return doRetryNotify(operation, b, notify, t) -} - -func doRetryNotify[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) { - var ( - err error - next time.Duration - res T - ) - if t == nil { - t = &defaultTimer{} - } - - defer func() { - t.Stop() - }() - - ctx := getContext(b) - - b.Reset() - for { - res, err = operation() - if err == nil { - return res, nil - } - - var permanent *PermanentError - if errors.As(err, &permanent) { - return res, permanent.Err - } - - if next = b.NextBackOff(); next == Stop { - if cerr := ctx.Err(); cerr != nil { - return res, cerr - } - - return res, err - } - - if notify != nil { - notify(err, next) - } - - t.Start(next) - - select { - case <-ctx.Done(): - return res, ctx.Err() - case <-t.C(): - } - } -} - -// PermanentError signals that the operation should not be retried. -type PermanentError struct { - Err error -} - -func (e *PermanentError) Error() string { - return e.Err.Error() -} - -func (e *PermanentError) Unwrap() error { - return e.Err -} - -func (e *PermanentError) Is(target error) bool { - _, ok := target.(*PermanentError) - return ok -} - -// Permanent wraps the given err in a *PermanentError. -func Permanent(err error) error { - if err == nil { - return nil - } - return &PermanentError{ - Err: err, - } -} diff --git a/vendor/github.com/cenkalti/backoff/v4/ticker.go b/vendor/github.com/cenkalti/backoff/v4/ticker.go deleted file mode 100644 index df9d68bce..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/ticker.go +++ /dev/null @@ -1,97 +0,0 @@ -package backoff - -import ( - "context" - "sync" - "time" -) - -// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff. -// -// Ticks will continue to arrive when the previous operation is still running, -// so operations that take a while to fail could run in quick succession. -type Ticker struct { - C <-chan time.Time - c chan time.Time - b BackOff - ctx context.Context - timer Timer - stop chan struct{} - stopOnce sync.Once -} - -// NewTicker returns a new Ticker containing a channel that will send -// the time at times specified by the BackOff argument. Ticker is -// guaranteed to tick at least once. The channel is closed when Stop -// method is called or BackOff stops. It is not safe to manipulate the -// provided backoff policy (notably calling NextBackOff or Reset) -// while the ticker is running. -func NewTicker(b BackOff) *Ticker { - return NewTickerWithTimer(b, &defaultTimer{}) -} - -// NewTickerWithTimer returns a new Ticker with a custom timer. -// A default timer that uses system timer is used when nil is passed. -func NewTickerWithTimer(b BackOff, timer Timer) *Ticker { - if timer == nil { - timer = &defaultTimer{} - } - c := make(chan time.Time) - t := &Ticker{ - C: c, - c: c, - b: b, - ctx: getContext(b), - timer: timer, - stop: make(chan struct{}), - } - t.b.Reset() - go t.run() - return t -} - -// Stop turns off a ticker. After Stop, no more ticks will be sent. -func (t *Ticker) Stop() { - t.stopOnce.Do(func() { close(t.stop) }) -} - -func (t *Ticker) run() { - c := t.c - defer close(c) - - // Ticker is guaranteed to tick at least once. - afterC := t.send(time.Now()) - - for { - if afterC == nil { - return - } - - select { - case tick := <-afterC: - afterC = t.send(tick) - case <-t.stop: - t.c = nil // Prevent future ticks from being sent to the channel. - return - case <-t.ctx.Done(): - return - } - } -} - -func (t *Ticker) send(tick time.Time) <-chan time.Time { - select { - case t.c <- tick: - case <-t.stop: - return nil - } - - next := t.b.NextBackOff() - if next == Stop { - t.Stop() - return nil - } - - t.timer.Start(next) - return t.timer.C() -} diff --git a/vendor/github.com/cenkalti/backoff/v4/timer.go b/vendor/github.com/cenkalti/backoff/v4/timer.go deleted file mode 100644 index 8120d0213..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/timer.go +++ /dev/null @@ -1,35 +0,0 @@ -package backoff - -import "time" - -type Timer interface { - Start(duration time.Duration) - Stop() - C() <-chan time.Time -} - -// defaultTimer implements Timer interface using time.Timer -type defaultTimer struct { - timer *time.Timer -} - -// C returns the timers channel which receives the current time when the timer fires. -func (t *defaultTimer) C() <-chan time.Time { - return t.timer.C -} - -// Start starts the timer to fire after the given duration -func (t *defaultTimer) Start(duration time.Duration) { - if t.timer == nil { - t.timer = time.NewTimer(duration) - } else { - t.timer.Reset(duration) - } -} - -// Stop is called when the timer is not used anymore and resources may be freed. -func (t *defaultTimer) Stop() { - if t.timer != nil { - t.timer.Stop() - } -} diff --git a/vendor/github.com/cenkalti/backoff/v4/tries.go b/vendor/github.com/cenkalti/backoff/v4/tries.go deleted file mode 100644 index 28d58ca37..000000000 --- a/vendor/github.com/cenkalti/backoff/v4/tries.go +++ /dev/null @@ -1,38 +0,0 @@ -package backoff - -import "time" - -/* -WithMaxRetries creates a wrapper around another BackOff, which will -return Stop if NextBackOff() has been called too many times since -the last time Reset() was called - -Note: Implementation is not thread-safe. -*/ -func WithMaxRetries(b BackOff, max uint64) BackOff { - return &backOffTries{delegate: b, maxTries: max} -} - -type backOffTries struct { - delegate BackOff - maxTries uint64 - numTries uint64 -} - -func (b *backOffTries) NextBackOff() time.Duration { - if b.maxTries == 0 { - return Stop - } - if b.maxTries > 0 { - if b.maxTries <= b.numTries { - return Stop - } - b.numTries++ - } - return b.delegate.NextBackOff() -} - -func (b *backOffTries) Reset() { - b.numTries = 0 - b.delegate.Reset() -} diff --git a/vendor/github.com/distribution/reference/.gitattributes b/vendor/github.com/distribution/reference/.gitattributes deleted file mode 100644 index d207b1802..000000000 --- a/vendor/github.com/distribution/reference/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/vendor/github.com/distribution/reference/.gitignore b/vendor/github.com/distribution/reference/.gitignore deleted file mode 100644 index dc07e6b04..000000000 --- a/vendor/github.com/distribution/reference/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Cover profiles -*.out diff --git a/vendor/github.com/distribution/reference/.golangci.yml b/vendor/github.com/distribution/reference/.golangci.yml deleted file mode 100644 index 793f0bb7e..000000000 --- a/vendor/github.com/distribution/reference/.golangci.yml +++ /dev/null @@ -1,18 +0,0 @@ -linters: - enable: - - bodyclose - - dupword # Checks for duplicate words in the source code - - gofmt - - goimports - - ineffassign - - misspell - - revive - - staticcheck - - unconvert - - unused - - vet - disable: - - errcheck - -run: - deadline: 2m diff --git a/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md b/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md deleted file mode 100644 index 48f6704c6..000000000 --- a/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md +++ /dev/null @@ -1,5 +0,0 @@ -# Code of Conduct - -We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). - -Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io) in order to report violations of the Code of Conduct. diff --git a/vendor/github.com/distribution/reference/CONTRIBUTING.md b/vendor/github.com/distribution/reference/CONTRIBUTING.md deleted file mode 100644 index ab2194665..000000000 --- a/vendor/github.com/distribution/reference/CONTRIBUTING.md +++ /dev/null @@ -1,114 +0,0 @@ -# Contributing to the reference library - -## Community help - -If you need help, please ask in the [#distribution](https://cloud-native.slack.com/archives/C01GVR8SY4R) channel on CNCF community slack. -[Click here for an invite to the CNCF community slack](https://slack.cncf.io/) - -## Reporting security issues - -The maintainers take security seriously. If you discover a security -issue, please bring it to their attention right away! - -Please **DO NOT** file a public issue, instead send your report privately to -[cncf-distribution-security@lists.cncf.io](mailto:cncf-distribution-security@lists.cncf.io). - -## Reporting an issue properly - -By following these simple rules you will get better and faster feedback on your issue. - - - search the bugtracker for an already reported issue - -### If you found an issue that describes your problem: - - - please read other user comments first, and confirm this is the same issue: a given error condition might be indicative of different problems - you may also find a workaround in the comments - - please refrain from adding "same thing here" or "+1" comments - - you don't need to comment on an issue to get notified of updates: just hit the "subscribe" button - - comment if you have some new, technical and relevant information to add to the case - - __DO NOT__ comment on closed issues or merged PRs. If you think you have a related problem, open up a new issue and reference the PR or issue. - -### If you have not found an existing issue that describes your problem: - - 1. create a new issue, with a succinct title that describes your issue: - - bad title: "It doesn't work with my docker" - - good title: "Private registry push fail: 400 error with E_INVALID_DIGEST" - 2. copy the output of (or similar for other container tools): - - `docker version` - - `docker info` - - `docker exec registry --version` - 3. copy the command line you used to launch your Registry - 4. restart your docker daemon in debug mode (add `-D` to the daemon launch arguments) - 5. reproduce your problem and get your docker daemon logs showing the error - 6. if relevant, copy your registry logs that show the error - 7. provide any relevant detail about your specific Registry configuration (e.g., storage backend used) - 8. indicate if you are using an enterprise proxy, Nginx, or anything else between you and your Registry - -## Contributing Code - -Contributions should be made via pull requests. Pull requests will be reviewed -by one or more maintainers or reviewers and merged when acceptable. - -You should follow the basic GitHub workflow: - - 1. Use your own [fork](https://help.github.com/en/articles/about-forks) - 2. Create your [change](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) - 3. Test your code - 4. [Commit](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) your work, always [sign your commits](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) - 5. Push your change to your fork and create a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) - -Refer to [containerd's contribution guide](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) -for tips on creating a successful contribution. - -## Sign your work - -The sign-off is a simple line at the end of the explanation for the patch. Your -signature certifies that you wrote the patch or otherwise have the right to pass -it on as an open-source patch. The rules are pretty simple: if you can certify -the below (from [developercertificate.org](http://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -Then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -Use your real name (sorry, no pseudonyms or anonymous contributions.) - -If you set your `user.name` and `user.email` git configs, you can sign your -commit automatically with `git commit -s`. diff --git a/vendor/github.com/distribution/reference/GOVERNANCE.md b/vendor/github.com/distribution/reference/GOVERNANCE.md deleted file mode 100644 index 200045b05..000000000 --- a/vendor/github.com/distribution/reference/GOVERNANCE.md +++ /dev/null @@ -1,144 +0,0 @@ -# distribution/reference Project Governance - -Distribution [Code of Conduct](./CODE-OF-CONDUCT.md) can be found here. - -For specific guidance on practical contribution steps please -see our [CONTRIBUTING.md](./CONTRIBUTING.md) guide. - -## Maintainership - -There are different types of maintainers, with different responsibilities, but -all maintainers have 3 things in common: - -1) They share responsibility in the project's success. -2) They have made a long-term, recurring time investment to improve the project. -3) They spend that time doing whatever needs to be done, not necessarily what -is the most interesting or fun. - -Maintainers are often under-appreciated, because their work is harder to appreciate. -It's easy to appreciate a really cool and technically advanced feature. It's harder -to appreciate the absence of bugs, the slow but steady improvement in stability, -or the reliability of a release process. But those things distinguish a good -project from a great one. - -## Reviewers - -A reviewer is a core role within the project. -They share in reviewing issues and pull requests and their LGTM counts towards the -required LGTM count to merge a code change into the project. - -Reviewers are part of the organization but do not have write access. -Becoming a reviewer is a core aspect in the journey to becoming a maintainer. - -## Adding maintainers - -Maintainers are first and foremost contributors that have shown they are -committed to the long term success of a project. Contributors wanting to become -maintainers are expected to be deeply involved in contributing code, pull -request review, and triage of issues in the project for more than three months. - -Just contributing does not make you a maintainer, it is about building trust -with the current maintainers of the project and being a person that they can -depend on and trust to make decisions in the best interest of the project. - -Periodically, the existing maintainers curate a list of contributors that have -shown regular activity on the project over the prior months. From this list, -maintainer candidates are selected and proposed in a pull request or a -maintainers communication channel. - -After a candidate has been announced to the maintainers, the existing -maintainers are given five business days to discuss the candidate, raise -objections and cast their vote. Votes may take place on the communication -channel or via pull request comment. Candidates must be approved by at least 66% -of the current maintainers by adding their vote on the mailing list. The -reviewer role has the same process but only requires 33% of current maintainers. -Only maintainers of the repository that the candidate is proposed for are -allowed to vote. - -If a candidate is approved, a maintainer will contact the candidate to invite -the candidate to open a pull request that adds the contributor to the -MAINTAINERS file. The voting process may take place inside a pull request if a -maintainer has already discussed the candidacy with the candidate and a -maintainer is willing to be a sponsor by opening the pull request. The candidate -becomes a maintainer once the pull request is merged. - -## Stepping down policy - -Life priorities, interests, and passions can change. If you're a maintainer but -feel you must remove yourself from the list, inform other maintainers that you -intend to step down, and if possible, help find someone to pick up your work. -At the very least, ensure your work can be continued where you left off. - -After you've informed other maintainers, create a pull request to remove -yourself from the MAINTAINERS file. - -## Removal of inactive maintainers - -Similar to the procedure for adding new maintainers, existing maintainers can -be removed from the list if they do not show significant activity on the -project. Periodically, the maintainers review the list of maintainers and their -activity over the last three months. - -If a maintainer has shown insufficient activity over this period, a neutral -person will contact the maintainer to ask if they want to continue being -a maintainer. If the maintainer decides to step down as a maintainer, they -open a pull request to be removed from the MAINTAINERS file. - -If the maintainer wants to remain a maintainer, but is unable to perform the -required duties they can be removed with a vote of at least 66% of the current -maintainers. In this case, maintainers should first propose the change to -maintainers via the maintainers communication channel, then open a pull request -for voting. The voting period is five business days. The voting pull request -should not come as a surpise to any maintainer and any discussion related to -performance must not be discussed on the pull request. - -## How are decisions made? - -Docker distribution is an open-source project with an open design philosophy. -This means that the repository is the source of truth for EVERY aspect of the -project, including its philosophy, design, road map, and APIs. *If it's part of -the project, it's in the repo. If it's in the repo, it's part of the project.* - -As a result, all decisions can be expressed as changes to the repository. An -implementation change is a change to the source code. An API change is a change -to the API specification. A philosophy change is a change to the philosophy -manifesto, and so on. - -All decisions affecting distribution, big and small, follow the same 3 steps: - -* Step 1: Open a pull request. Anyone can do this. - -* Step 2: Discuss the pull request. Anyone can do this. - -* Step 3: Merge or refuse the pull request. Who does this depends on the nature -of the pull request and which areas of the project it affects. - -## Helping contributors with the DCO - -The [DCO or `Sign your work`](./CONTRIBUTING.md#sign-your-work) -requirement is not intended as a roadblock or speed bump. - -Some contributors are not as familiar with `git`, or have used a web -based editor, and thus asking them to `git commit --amend -s` is not the best -way forward. - -In this case, maintainers can update the commits based on clause (c) of the DCO. -The most trivial way for a contributor to allow the maintainer to do this, is to -add a DCO signature in a pull requests's comment, or a maintainer can simply -note that the change is sufficiently trivial that it does not substantially -change the existing contribution - i.e., a spelling change. - -When you add someone's DCO, please also add your own to keep a log. - -## I'm a maintainer. Should I make pull requests too? - -Yes. Nobody should ever push to master directly. All changes should be -made through a pull request. - -## Conflict Resolution - -If you have a technical dispute that you feel has reached an impasse with a -subset of the community, any contributor may open an issue, specifically -calling for a resolution vote of the current core maintainers to resolve the -dispute. The same voting quorums required (2/3) for adding and removing -maintainers will apply to conflict resolution. diff --git a/vendor/github.com/distribution/reference/LICENSE b/vendor/github.com/distribution/reference/LICENSE deleted file mode 100644 index e06d20818..000000000 --- a/vendor/github.com/distribution/reference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/vendor/github.com/distribution/reference/MAINTAINERS b/vendor/github.com/distribution/reference/MAINTAINERS deleted file mode 100644 index 9e0a60c8b..000000000 --- a/vendor/github.com/distribution/reference/MAINTAINERS +++ /dev/null @@ -1,26 +0,0 @@ -# Distribution project maintainers & reviewers -# -# See GOVERNANCE.md for maintainer versus reviewer roles -# -# MAINTAINERS (cncf-distribution-maintainers@lists.cncf.io) -# GitHub ID, Name, Email address -"chrispat","Chris Patterson","chrispat@github.com" -"clarkbw","Bryan Clark","clarkbw@github.com" -"corhere","Cory Snider","csnider@mirantis.com" -"deleteriousEffect","Hayley Swimelar","hswimelar@gitlab.com" -"heww","He Weiwei","hweiwei@vmware.com" -"joaodrp","João Pereira","jpereira@gitlab.com" -"justincormack","Justin Cormack","justin.cormack@docker.com" -"squizzi","Kyle Squizzato","ksquizzato@mirantis.com" -"milosgajdos","Milos Gajdos","milosthegajdos@gmail.com" -"sargun","Sargun Dhillon","sargun@sargun.me" -"wy65701436","Wang Yan","wangyan@vmware.com" -"stevelasker","Steve Lasker","steve.lasker@microsoft.com" -# -# REVIEWERS -# GitHub ID, Name, Email address -"dmcgowan","Derek McGowan","derek@mcgstyle.net" -"stevvooe","Stephen Day","stevvooe@gmail.com" -"thajeztah","Sebastiaan van Stijn","github@gone.nl" -"DavidSpek", "David van der Spek", "vanderspek.david@gmail.com" -"Jamstah", "James Hewitt", "james.hewitt@gmail.com" diff --git a/vendor/github.com/distribution/reference/Makefile b/vendor/github.com/distribution/reference/Makefile deleted file mode 100644 index c78576b75..000000000 --- a/vendor/github.com/distribution/reference/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Project packages. -PACKAGES=$(shell go list ./...) - -# Flags passed to `go test` -BUILDFLAGS ?= -TESTFLAGS ?= - -.PHONY: all build test coverage -.DEFAULT: all - -all: build - -build: ## no binaries to build, so just check compilation suceeds - go build ${BUILDFLAGS} ./... - -test: ## run tests - go test ${TESTFLAGS} ./... - -coverage: ## generate coverprofiles from the unit tests - rm -f coverage.txt - go test ${TESTFLAGS} -cover -coverprofile=cover.out ./... - -.PHONY: help -help: - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_\/%-]+:.*?##/ { printf " \033[36m%-27s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) diff --git a/vendor/github.com/distribution/reference/README.md b/vendor/github.com/distribution/reference/README.md deleted file mode 100644 index 172a02e0b..000000000 --- a/vendor/github.com/distribution/reference/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Distribution reference - -Go library to handle references to container images. - - - -[![Build Status](https://github.com/distribution/reference/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/distribution/reference/actions?query=workflow%3ACI) -[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/distribution/reference) -[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE) -[![codecov](https://codecov.io/gh/distribution/reference/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/reference) -[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference?ref=badge_shield) - -This repository contains a library for handling references to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. - -## Contribution - -Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute -issues, fixes, and patches to this project. - -## Communication - -For async communication and long running discussions please use issues and pull requests on the github repo. -This will be the best place to discuss design and implementation. - -For sync communication we have a #distribution channel in the [CNCF Slack](https://slack.cncf.io/) -that everyone is welcome to join and chat about development. - -## Licenses - -The distribution codebase is released under the [Apache 2.0 license](LICENSE). diff --git a/vendor/github.com/distribution/reference/SECURITY.md b/vendor/github.com/distribution/reference/SECURITY.md deleted file mode 100644 index aaf983c0f..000000000 --- a/vendor/github.com/distribution/reference/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Reporting a Vulnerability - -The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away! - -Please DO NOT file a public issue, instead send your report privately to cncf-distribution-security@lists.cncf.io. diff --git a/vendor/github.com/distribution/reference/distribution-logo.svg b/vendor/github.com/distribution/reference/distribution-logo.svg deleted file mode 100644 index cc9f4073b..000000000 --- a/vendor/github.com/distribution/reference/distribution-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/github.com/distribution/reference/helpers.go b/vendor/github.com/distribution/reference/helpers.go deleted file mode 100644 index d10c7ef83..000000000 --- a/vendor/github.com/distribution/reference/helpers.go +++ /dev/null @@ -1,42 +0,0 @@ -package reference - -import "path" - -// IsNameOnly returns true if reference only contains a repo name. -func IsNameOnly(ref Named) bool { - if _, ok := ref.(NamedTagged); ok { - return false - } - if _, ok := ref.(Canonical); ok { - return false - } - return true -} - -// FamiliarName returns the familiar name string -// for the given named, familiarizing if needed. -func FamiliarName(ref Named) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().Name() - } - return ref.Name() -} - -// FamiliarString returns the familiar string representation -// for the given reference, familiarizing if needed. -func FamiliarString(ref Reference) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().String() - } - return ref.String() -} - -// FamiliarMatch reports whether ref matches the specified pattern. -// See [path.Match] for supported patterns. -func FamiliarMatch(pattern string, ref Reference) (bool, error) { - matched, err := path.Match(pattern, FamiliarString(ref)) - if namedRef, isNamed := ref.(Named); isNamed && !matched { - matched, _ = path.Match(pattern, FamiliarName(namedRef)) - } - return matched, err -} diff --git a/vendor/github.com/distribution/reference/normalize.go b/vendor/github.com/distribution/reference/normalize.go deleted file mode 100644 index f4128314c..000000000 --- a/vendor/github.com/distribution/reference/normalize.go +++ /dev/null @@ -1,255 +0,0 @@ -package reference - -import ( - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // legacyDefaultDomain is the legacy domain for Docker Hub (which was - // originally named "the Docker Index"). This domain is still used for - // authentication and image search, which were part of the "v1" Docker - // registry specification. - // - // This domain will continue to be supported, but there are plans to consolidate - // legacy domains to new "canonical" domains. Once those domains are decided - // on, we must update the normalization functions, but preserve compatibility - // with existing installs, clients, and user configuration. - legacyDefaultDomain = "index.docker.io" - - // defaultDomain is the default domain used for images on Docker Hub. - // It is used to normalize "familiar" names to canonical names, for example, - // to convert "ubuntu" to "docker.io/library/ubuntu:latest". - // - // Note that actual domain of Docker Hub's registry is registry-1.docker.io. - // This domain will continue to be supported, but there are plans to consolidate - // legacy domains to new "canonical" domains. Once those domains are decided - // on, we must update the normalization functions, but preserve compatibility - // with existing installs, clients, and user configuration. - defaultDomain = "docker.io" - - // officialRepoPrefix is the namespace used for official images on Docker Hub. - // It is used to normalize "familiar" names to canonical names, for example, - // to convert "ubuntu" to "docker.io/library/ubuntu:latest". - officialRepoPrefix = "library/" - - // defaultTag is the default tag if no tag is provided. - defaultTag = "latest" -) - -// normalizedNamed represents a name which has been -// normalized and has a familiar form. A familiar name -// is what is used in Docker UI. An example normalized -// name is "docker.io/library/ubuntu" and corresponding -// familiar name of "ubuntu". -type normalizedNamed interface { - Named - Familiar() Named -} - -// ParseNormalizedNamed parses a string into a named reference -// transforming a familiar name from Docker UI to a fully -// qualified reference. If the value may be an identifier -// use ParseAnyReference. -func ParseNormalizedNamed(s string) (Named, error) { - if ok := anchoredIdentifierRegexp.MatchString(s); ok { - return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) - } - domain, remainder := splitDockerDomain(s) - var remote string - if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { - remote = remainder[:tagSep] - } else { - remote = remainder - } - if strings.ToLower(remote) != remote { - return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remote) - } - - ref, err := Parse(domain + "/" + remainder) - if err != nil { - return nil, err - } - named, isNamed := ref.(Named) - if !isNamed { - return nil, fmt.Errorf("reference %s has no name", ref.String()) - } - return named, nil -} - -// namedTaggedDigested is a reference that has both a tag and a digest. -type namedTaggedDigested interface { - NamedTagged - Digested -} - -// ParseDockerRef normalizes the image reference following the docker convention, -// which allows for references to contain both a tag and a digest. It returns a -// reference that is either tagged or digested. For references containing both -// a tag and a digest, it returns a digested reference. For example, the following -// reference: -// -// docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// Is returned as a digested reference (with the ":latest" tag removed): -// -// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// References that are already "tagged" or "digested" are returned unmodified: -// -// // Already a digested reference -// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// // Already a named reference -// docker.io/library/busybox:latest -func ParseDockerRef(ref string) (Named, error) { - named, err := ParseNormalizedNamed(ref) - if err != nil { - return nil, err - } - if canonical, ok := named.(namedTaggedDigested); ok { - // The reference is both tagged and digested; only return digested. - newNamed, err := WithName(canonical.Name()) - if err != nil { - return nil, err - } - return WithDigest(newNamed, canonical.Digest()) - } - return TagNameOnly(named), nil -} - -// splitDockerDomain splits a repository name to domain and remote-name. -// If no valid domain is found, the default domain is used. Repository name -// needs to be already validated before. -func splitDockerDomain(name string) (domain, remoteName string) { - maybeDomain, maybeRemoteName, ok := strings.Cut(name, "/") - if !ok { - // Fast-path for single element ("familiar" names), such as "ubuntu" - // or "ubuntu:latest". Familiar names must be handled separately, to - // prevent them from being handled as "hostname:port". - // - // Canonicalize them as "docker.io/library/name[:tag]" - - // FIXME(thaJeztah): account for bare "localhost" or "example.com" names, which SHOULD be considered a domain. - return defaultDomain, officialRepoPrefix + name - } - - switch { - case maybeDomain == localhost: - // localhost is a reserved namespace and always considered a domain. - domain, remoteName = maybeDomain, maybeRemoteName - case maybeDomain == legacyDefaultDomain: - // canonicalize the Docker Hub and legacy "Docker Index" domains. - domain, remoteName = defaultDomain, maybeRemoteName - case strings.ContainsAny(maybeDomain, ".:"): - // Likely a domain or IP-address: - // - // - contains a "." (e.g., "example.com" or "127.0.0.1") - // - contains a ":" (e.g., "example:5000", "::1", or "[::1]:5000") - domain, remoteName = maybeDomain, maybeRemoteName - case strings.ToLower(maybeDomain) != maybeDomain: - // Uppercase namespaces are not allowed, so if the first element - // is not lowercase, we assume it to be a domain-name. - domain, remoteName = maybeDomain, maybeRemoteName - default: - // None of the above: it's not a domain, so use the default, and - // use the name input the remote-name. - domain, remoteName = defaultDomain, name - } - - if domain == defaultDomain && !strings.ContainsRune(remoteName, '/') { - // Canonicalize "familiar" names, but only on Docker Hub, not - // on other domains: - // - // "docker.io/ubuntu[:tag]" => "docker.io/library/ubuntu[:tag]" - remoteName = officialRepoPrefix + remoteName - } - - return domain, remoteName -} - -// familiarizeName returns a shortened version of the name familiar -// to the Docker UI. Familiar names have the default domain -// "docker.io" and "library/" repository prefix removed. -// For example, "docker.io/library/redis" will have the familiar -// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". -// Returns a familiarized named only reference. -func familiarizeName(named namedRepository) repository { - repo := repository{ - domain: named.Domain(), - path: named.Path(), - } - - if repo.domain == defaultDomain { - repo.domain = "" - // Handle official repositories which have the pattern "library/" - if strings.HasPrefix(repo.path, officialRepoPrefix) { - // TODO(thaJeztah): this check may be too strict, as it assumes the - // "library/" namespace does not have nested namespaces. While this - // is true (currently), technically it would be possible for Docker - // Hub to use those (e.g. "library/distros/ubuntu:latest"). - // See https://github.com/distribution/distribution/pull/3769#issuecomment-1302031785. - if remainder := strings.TrimPrefix(repo.path, officialRepoPrefix); !strings.ContainsRune(remainder, '/') { - repo.path = remainder - } - } - } - return repo -} - -func (r reference) Familiar() Named { - return reference{ - namedRepository: familiarizeName(r.namedRepository), - tag: r.tag, - digest: r.digest, - } -} - -func (r repository) Familiar() Named { - return familiarizeName(r) -} - -func (t taggedReference) Familiar() Named { - return taggedReference{ - namedRepository: familiarizeName(t.namedRepository), - tag: t.tag, - } -} - -func (c canonicalReference) Familiar() Named { - return canonicalReference{ - namedRepository: familiarizeName(c.namedRepository), - digest: c.digest, - } -} - -// TagNameOnly adds the default tag "latest" to a reference if it only has -// a repo name. -func TagNameOnly(ref Named) Named { - if IsNameOnly(ref) { - namedTagged, err := WithTag(ref, defaultTag) - if err != nil { - // Default tag must be valid, to create a NamedTagged - // type with non-validated input the WithTag function - // should be used instead - panic(err) - } - return namedTagged - } - return ref -} - -// ParseAnyReference parses a reference string as a possible identifier, -// full digest, or familiar name. -func ParseAnyReference(ref string) (Reference, error) { - if ok := anchoredIdentifierRegexp.MatchString(ref); ok { - return digestReference("sha256:" + ref), nil - } - if dgst, err := digest.Parse(ref); err == nil { - return digestReference(dgst), nil - } - - return ParseNormalizedNamed(ref) -} diff --git a/vendor/github.com/distribution/reference/reference.go b/vendor/github.com/distribution/reference/reference.go deleted file mode 100644 index 900398bde..000000000 --- a/vendor/github.com/distribution/reference/reference.go +++ /dev/null @@ -1,432 +0,0 @@ -// Package reference provides a general type to represent any way of referencing images within the registry. -// Its main purpose is to abstract tags and digests (content-addressable hash). -// -// Grammar -// -// reference := name [ ":" tag ] [ "@" digest ] -// name := [domain '/'] remote-name -// domain := host [':' port-number] -// host := domain-name | IPv4address | \[ IPv6address \] ; rfc3986 appendix-A -// domain-name := domain-component ['.' domain-component]* -// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ -// port-number := /[0-9]+/ -// path-component := alpha-numeric [separator alpha-numeric]* -// path (or "remote-name") := path-component ['/' path-component]* -// alpha-numeric := /[a-z0-9]+/ -// separator := /[_.]|__|[-]*/ -// -// tag := /[\w][\w.-]{0,127}/ -// -// digest := digest-algorithm ":" digest-hex -// digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* -// digest-algorithm-separator := /[+.-_]/ -// digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ -// digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value -// -// identifier := /[a-f0-9]{64}/ -package reference - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // RepositoryNameTotalLengthMax is the maximum total number of characters in a repository name. - RepositoryNameTotalLengthMax = 255 - - // NameTotalLengthMax is the maximum total number of characters in a repository name. - // - // Deprecated: use [RepositoryNameTotalLengthMax] instead. - NameTotalLengthMax = RepositoryNameTotalLengthMax -) - -var ( - // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. - ErrReferenceInvalidFormat = errors.New("invalid reference format") - - // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. - ErrTagInvalidFormat = errors.New("invalid tag format") - - // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. - ErrDigestInvalidFormat = errors.New("invalid digest format") - - // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. - ErrNameContainsUppercase = errors.New("repository name must be lowercase") - - // ErrNameEmpty is returned for empty, invalid repository names. - ErrNameEmpty = errors.New("repository name must have at least one component") - - // ErrNameTooLong is returned when a repository name is longer than RepositoryNameTotalLengthMax. - ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", RepositoryNameTotalLengthMax) - - // ErrNameNotCanonical is returned when a name is not canonical. - ErrNameNotCanonical = errors.New("repository name must be canonical") -) - -// Reference is an opaque object reference identifier that may include -// modifiers such as a hostname, name, tag, and digest. -type Reference interface { - // String returns the full reference - String() string -} - -// Field provides a wrapper type for resolving correct reference types when -// working with encoding. -type Field struct { - reference Reference -} - -// AsField wraps a reference in a Field for encoding. -func AsField(reference Reference) Field { - return Field{reference} -} - -// Reference unwraps the reference type from the field to -// return the Reference object. This object should be -// of the appropriate type to further check for different -// reference types. -func (f Field) Reference() Reference { - return f.reference -} - -// MarshalText serializes the field to byte text which -// is the string of the reference. -func (f Field) MarshalText() (p []byte, err error) { - return []byte(f.reference.String()), nil -} - -// UnmarshalText parses text bytes by invoking the -// reference parser to ensure the appropriately -// typed reference object is wrapped by field. -func (f *Field) UnmarshalText(p []byte) error { - r, err := Parse(string(p)) - if err != nil { - return err - } - - f.reference = r - return nil -} - -// Named is an object with a full name -type Named interface { - Reference - Name() string -} - -// Tagged is an object which has a tag -type Tagged interface { - Reference - Tag() string -} - -// NamedTagged is an object including a name and tag. -type NamedTagged interface { - Named - Tag() string -} - -// Digested is an object which has a digest -// in which it can be referenced by -type Digested interface { - Reference - Digest() digest.Digest -} - -// Canonical reference is an object with a fully unique -// name including a name with domain and digest -type Canonical interface { - Named - Digest() digest.Digest -} - -// namedRepository is a reference to a repository with a name. -// A namedRepository has both domain and path components. -type namedRepository interface { - Named - Domain() string - Path() string -} - -// Domain returns the domain part of the [Named] reference. -func Domain(named Named) string { - if r, ok := named.(namedRepository); ok { - return r.Domain() - } - domain, _ := splitDomain(named.Name()) - return domain -} - -// Path returns the name without the domain part of the [Named] reference. -func Path(named Named) (name string) { - if r, ok := named.(namedRepository); ok { - return r.Path() - } - _, path := splitDomain(named.Name()) - return path -} - -// splitDomain splits a named reference into a hostname and path string. -// If no valid hostname is found, the hostname is empty and the full value -// is returned as name -func splitDomain(name string) (string, string) { - match := anchoredNameRegexp.FindStringSubmatch(name) - if len(match) != 3 { - return "", name - } - return match[1], match[2] -} - -// Parse parses s and returns a syntactically valid Reference. -// If an error was encountered it is returned, along with a nil Reference. -func Parse(s string) (Reference, error) { - matches := ReferenceRegexp.FindStringSubmatch(s) - if matches == nil { - if s == "" { - return nil, ErrNameEmpty - } - if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { - return nil, ErrNameContainsUppercase - } - return nil, ErrReferenceInvalidFormat - } - - var repo repository - - nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) - if len(nameMatch) == 3 { - repo.domain = nameMatch[1] - repo.path = nameMatch[2] - } else { - repo.domain = "" - repo.path = matches[1] - } - - if len(repo.path) > RepositoryNameTotalLengthMax { - return nil, ErrNameTooLong - } - - ref := reference{ - namedRepository: repo, - tag: matches[2], - } - if matches[3] != "" { - var err error - ref.digest, err = digest.Parse(matches[3]) - if err != nil { - return nil, err - } - } - - r := getBestReferenceType(ref) - if r == nil { - return nil, ErrNameEmpty - } - - return r, nil -} - -// ParseNamed parses s and returns a syntactically valid reference implementing -// the Named interface. The reference must have a name and be in the canonical -// form, otherwise an error is returned. -// If an error was encountered it is returned, along with a nil Reference. -func ParseNamed(s string) (Named, error) { - named, err := ParseNormalizedNamed(s) - if err != nil { - return nil, err - } - if named.String() != s { - return nil, ErrNameNotCanonical - } - return named, nil -} - -// WithName returns a named object representing the given string. If the input -// is invalid ErrReferenceInvalidFormat will be returned. -func WithName(name string) (Named, error) { - match := anchoredNameRegexp.FindStringSubmatch(name) - if match == nil || len(match) != 3 { - return nil, ErrReferenceInvalidFormat - } - - if len(match[2]) > RepositoryNameTotalLengthMax { - return nil, ErrNameTooLong - } - - return repository{ - domain: match[1], - path: match[2], - }, nil -} - -// WithTag combines the name from "name" and the tag from "tag" to form a -// reference incorporating both the name and the tag. -func WithTag(name Named, tag string) (NamedTagged, error) { - if !anchoredTagRegexp.MatchString(tag) { - return nil, ErrTagInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if canonical, ok := name.(Canonical); ok { - return reference{ - namedRepository: repo, - tag: tag, - digest: canonical.Digest(), - }, nil - } - return taggedReference{ - namedRepository: repo, - tag: tag, - }, nil -} - -// WithDigest combines the name from "name" and the digest from "digest" to form -// a reference incorporating both the name and the digest. -func WithDigest(name Named, digest digest.Digest) (Canonical, error) { - if !anchoredDigestRegexp.MatchString(digest.String()) { - return nil, ErrDigestInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if tagged, ok := name.(Tagged); ok { - return reference{ - namedRepository: repo, - tag: tagged.Tag(), - digest: digest, - }, nil - } - return canonicalReference{ - namedRepository: repo, - digest: digest, - }, nil -} - -// TrimNamed removes any tag or digest from the named reference. -func TrimNamed(ref Named) Named { - repo := repository{} - if r, ok := ref.(namedRepository); ok { - repo.domain, repo.path = r.Domain(), r.Path() - } else { - repo.domain, repo.path = splitDomain(ref.Name()) - } - return repo -} - -func getBestReferenceType(ref reference) Reference { - if ref.Name() == "" { - // Allow digest only references - if ref.digest != "" { - return digestReference(ref.digest) - } - return nil - } - if ref.tag == "" { - if ref.digest != "" { - return canonicalReference{ - namedRepository: ref.namedRepository, - digest: ref.digest, - } - } - return ref.namedRepository - } - if ref.digest == "" { - return taggedReference{ - namedRepository: ref.namedRepository, - tag: ref.tag, - } - } - - return ref -} - -type reference struct { - namedRepository - tag string - digest digest.Digest -} - -func (r reference) String() string { - return r.Name() + ":" + r.tag + "@" + r.digest.String() -} - -func (r reference) Tag() string { - return r.tag -} - -func (r reference) Digest() digest.Digest { - return r.digest -} - -type repository struct { - domain string - path string -} - -func (r repository) String() string { - return r.Name() -} - -func (r repository) Name() string { - if r.domain == "" { - return r.path - } - return r.domain + "/" + r.path -} - -func (r repository) Domain() string { - return r.domain -} - -func (r repository) Path() string { - return r.path -} - -type digestReference digest.Digest - -func (d digestReference) String() string { - return digest.Digest(d).String() -} - -func (d digestReference) Digest() digest.Digest { - return digest.Digest(d) -} - -type taggedReference struct { - namedRepository - tag string -} - -func (t taggedReference) String() string { - return t.Name() + ":" + t.tag -} - -func (t taggedReference) Tag() string { - return t.tag -} - -type canonicalReference struct { - namedRepository - digest digest.Digest -} - -func (c canonicalReference) String() string { - return c.Name() + "@" + c.digest.String() -} - -func (c canonicalReference) Digest() digest.Digest { - return c.digest -} diff --git a/vendor/github.com/distribution/reference/regexp.go b/vendor/github.com/distribution/reference/regexp.go deleted file mode 100644 index 65bc49d79..000000000 --- a/vendor/github.com/distribution/reference/regexp.go +++ /dev/null @@ -1,163 +0,0 @@ -package reference - -import ( - "regexp" - "strings" -) - -// DigestRegexp matches well-formed digests, including algorithm (e.g. "sha256:"). -var DigestRegexp = regexp.MustCompile(digestPat) - -// DomainRegexp matches hostname or IP-addresses, optionally including a port -// number. It defines the structure of potential domain components that may be -// part of image names. This is purposely a subset of what is allowed by DNS to -// ensure backwards compatibility with Docker image names. It may be a subset of -// DNS domain name, an IPv4 address in decimal format, or an IPv6 address between -// square brackets (excluding zone identifiers as defined by [RFC 6874] or special -// addresses such as IPv4-Mapped). -// -// [RFC 6874]: https://www.rfc-editor.org/rfc/rfc6874. -var DomainRegexp = regexp.MustCompile(domainAndPort) - -// IdentifierRegexp is the format for string identifier used as a -// content addressable identifier using sha256. These identifiers -// are like digests without the algorithm, since sha256 is used. -var IdentifierRegexp = regexp.MustCompile(identifier) - -// NameRegexp is the format for the name component of references, including -// an optional domain and port, but without tag or digest suffix. -var NameRegexp = regexp.MustCompile(namePat) - -// ReferenceRegexp is the full supported format of a reference. The regexp -// is anchored and has capturing groups for name, tag, and digest -// components. -var ReferenceRegexp = regexp.MustCompile(referencePat) - -// TagRegexp matches valid tag names. From [docker/docker:graph/tags.go]. -// -// [docker/docker:graph/tags.go]: https://github.com/moby/moby/blob/v1.6.0/graph/tags.go#L26-L28 -var TagRegexp = regexp.MustCompile(tag) - -const ( - // alphanumeric defines the alphanumeric atom, typically a - // component of names. This only allows lower case characters and digits. - alphanumeric = `[a-z0-9]+` - - // separator defines the separators allowed to be embedded in name - // components. This allows one period, one or two underscore and multiple - // dashes. Repeated dashes and underscores are intentionally treated - // differently. In order to support valid hostnames as name components, - // supporting repeated dash was added. Additionally double underscore is - // now allowed as a separator to loosen the restriction for previously - // supported names. - separator = `(?:[._]|__|[-]+)` - - // localhost is treated as a special value for domain-name. Any other - // domain-name without a "." or a ":port" are considered a path component. - localhost = `localhost` - - // domainNameComponent restricts the registry domain component of a - // repository name to start with a component as defined by DomainRegexp. - domainNameComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])` - - // optionalPort matches an optional port-number including the port separator - // (e.g. ":80"). - optionalPort = `(?::[0-9]+)?` - - // tag matches valid tag names. From docker/docker:graph/tags.go. - tag = `[\w][\w.-]{0,127}` - - // digestPat matches well-formed digests, including algorithm (e.g. "sha256:"). - // - // TODO(thaJeztah): this should follow the same rules as https://pkg.go.dev/github.com/opencontainers/go-digest@v1.0.0#DigestRegexp - // so that go-digest defines the canonical format. Note that the go-digest is - // more relaxed: - // - it allows multiple algorithms (e.g. "sha256+b64:") to allow - // future expansion of supported algorithms. - // - it allows the "" value to use urlsafe base64 encoding as defined - // in [rfc4648, section 5]. - // - // [rfc4648, section 5]: https://www.rfc-editor.org/rfc/rfc4648#section-5. - digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` - - // identifier is the format for a content addressable identifier using sha256. - // These identifiers are like digests without the algorithm, since sha256 is used. - identifier = `([a-f0-9]{64})` - - // ipv6address are enclosed between square brackets and may be represented - // in many ways, see rfc5952. Only IPv6 in compressed or uncompressed format - // are allowed, IPv6 zone identifiers (rfc6874) or Special addresses such as - // IPv4-Mapped are deliberately excluded. - ipv6address = `\[(?:[a-fA-F0-9:]+)\]` -) - -var ( - // domainName defines the structure of potential domain components - // that may be part of image names. This is purposely a subset of what is - // allowed by DNS to ensure backwards compatibility with Docker image - // names. This includes IPv4 addresses on decimal format. - domainName = domainNameComponent + anyTimes(`\.`+domainNameComponent) - - // host defines the structure of potential domains based on the URI - // Host subcomponent on rfc3986. It may be a subset of DNS domain name, - // or an IPv4 address in decimal format, or an IPv6 address between square - // brackets (excluding zone identifiers as defined by rfc6874 or special - // addresses such as IPv4-Mapped). - host = `(?:` + domainName + `|` + ipv6address + `)` - - // allowed by the URI Host subcomponent on rfc3986 to ensure backwards - // compatibility with Docker image names. - domainAndPort = host + optionalPort - - // anchoredTagRegexp matches valid tag names, anchored at the start and - // end of the matched string. - anchoredTagRegexp = regexp.MustCompile(anchored(tag)) - - // anchoredDigestRegexp matches valid digests, anchored at the start and - // end of the matched string. - anchoredDigestRegexp = regexp.MustCompile(anchored(digestPat)) - - // pathComponent restricts path-components to start with an alphanumeric - // character, with following parts able to be separated by a separator - // (one period, one or two underscore and multiple dashes). - pathComponent = alphanumeric + anyTimes(separator+alphanumeric) - - // remoteName matches the remote-name of a repository. It consists of one - // or more forward slash (/) delimited path-components: - // - // pathComponent[[/pathComponent] ...] // e.g., "library/ubuntu" - remoteName = pathComponent + anyTimes(`/`+pathComponent) - namePat = optional(domainAndPort+`/`) + remoteName - - // anchoredNameRegexp is used to parse a name value, capturing the - // domain and trailing components. - anchoredNameRegexp = regexp.MustCompile(anchored(optional(capture(domainAndPort), `/`), capture(remoteName))) - - referencePat = anchored(capture(namePat), optional(`:`, capture(tag)), optional(`@`, capture(digestPat))) - - // anchoredIdentifierRegexp is used to check or match an - // identifier value, anchored at start and end of string. - anchoredIdentifierRegexp = regexp.MustCompile(anchored(identifier)) -) - -// optional wraps the expression in a non-capturing group and makes the -// production optional. -func optional(res ...string) string { - return `(?:` + strings.Join(res, "") + `)?` -} - -// anyTimes wraps the expression in a non-capturing group that can occur -// any number of times. -func anyTimes(res ...string) string { - return `(?:` + strings.Join(res, "") + `)*` -} - -// capture wraps the expression in a capturing group. -func capture(res ...string) string { - return `(` + strings.Join(res, "") + `)` -} - -// anchored anchors the regular expression by adding start and end delimiters. -func anchored(res ...string) string { - return `^` + strings.Join(res, "") + `$` -} diff --git a/vendor/github.com/distribution/reference/sort.go b/vendor/github.com/distribution/reference/sort.go deleted file mode 100644 index 416c37b07..000000000 --- a/vendor/github.com/distribution/reference/sort.go +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package reference - -import ( - "sort" -) - -// Sort sorts string references preferring higher information references. -// -// The precedence is as follows: -// -// 1. [Named] + [Tagged] + [Digested] (e.g., "docker.io/library/busybox:latest@sha256:") -// 2. [Named] + [Tagged] (e.g., "docker.io/library/busybox:latest") -// 3. [Named] + [Digested] (e.g., "docker.io/library/busybo@sha256:") -// 4. [Named] (e.g., "docker.io/library/busybox") -// 5. [Digested] (e.g., "docker.io@sha256:") -// 6. Parse error -func Sort(references []string) []string { - var prefs []Reference - var bad []string - - for _, ref := range references { - pref, err := ParseAnyReference(ref) - if err != nil { - bad = append(bad, ref) - } else { - prefs = append(prefs, pref) - } - } - sort.Slice(prefs, func(a, b int) bool { - ar := refRank(prefs[a]) - br := refRank(prefs[b]) - if ar == br { - return prefs[a].String() < prefs[b].String() - } - return ar < br - }) - sort.Strings(bad) - var refs []string - for _, pref := range prefs { - refs = append(refs, pref.String()) - } - return append(refs, bad...) -} - -func refRank(ref Reference) uint8 { - if _, ok := ref.(Named); ok { - if _, ok = ref.(Tagged); ok { - if _, ok = ref.(Digested); ok { - return 1 - } - return 2 - } - if _, ok = ref.(Digested); ok { - return 3 - } - return 4 - } - return 5 -} diff --git a/vendor/github.com/emicklei/go-restful/v3/.travis.yml b/vendor/github.com/emicklei/go-restful/v3/.travis.yml deleted file mode 100644 index 3a0bf5ff1..000000000 --- a/vendor/github.com/emicklei/go-restful/v3/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.x - -before_install: - - go test -v - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md index 6f24dfff5..4fcd920ab 100644 --- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md @@ -1,5 +1,9 @@ # Change history of go-restful +## [v3.13.0] - 2025-08-14 + +- optimize performance of path matching in CurlyRouter ( thanks @wenhuang, Wen Huang) + ## [v3.12.2] - 2025-02-21 - allow empty payloads in post,put,patch, issue #580 ( thanks @liggitt, Jordan Liggitt) diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md index 3fb40d198..50a79ab69 100644 --- a/vendor/github.com/emicklei/go-restful/v3/README.md +++ b/vendor/github.com/emicklei/go-restful/v3/README.md @@ -84,6 +84,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Configurable (trace) logging - Customizable gzip/deflate readers and writers using CompressorProvider registration - Inject your own http.Handler using the `HttpMiddlewareHandlerToFilter` function +- Added `SetPathTokenCacheEnabled` and `SetCustomVerbCacheEnabled` to disable regexp caching (default=true) ## How to customize There are several hooks to customize the behavior of the go-restful package. diff --git a/vendor/github.com/emicklei/go-restful/v3/curly.go b/vendor/github.com/emicklei/go-restful/v3/curly.go index 6fd2bcd5a..eec43bfd0 100644 --- a/vendor/github.com/emicklei/go-restful/v3/curly.go +++ b/vendor/github.com/emicklei/go-restful/v3/curly.go @@ -9,11 +9,35 @@ import ( "regexp" "sort" "strings" + "sync" ) // CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets. type CurlyRouter struct{} +var ( + regexCache sync.Map // Cache for compiled regex patterns + pathTokenCacheEnabled = true // Enable/disable path token regex caching +) + +// SetPathTokenCacheEnabled enables or disables path token regex caching for CurlyRouter. +// When disabled, regex patterns will be compiled on every request. +// When enabled (default), compiled regex patterns are cached for better performance. +func SetPathTokenCacheEnabled(enabled bool) { + pathTokenCacheEnabled = enabled +} + +// getCachedRegexp retrieves a compiled regex from the cache if found and valid. +// Returns the regex and true if found and valid, nil and false otherwise. +func getCachedRegexp(cache *sync.Map, pattern string) (*regexp.Regexp, bool) { + if cached, found := cache.Load(pattern); found { + if regex, ok := cached.(*regexp.Regexp); ok { + return regex, true + } + } + return nil, false +} + // SelectRoute is part of the Router interface and returns the best match // for the WebService and its Route for the given Request. func (c CurlyRouter) SelectRoute( @@ -113,8 +137,28 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque } return true, true } - matched, err := regexp.MatchString(regPart, requestToken) - return (matched && err == nil), false + + // Check cache first (if enabled) + if pathTokenCacheEnabled { + if regex, found := getCachedRegexp(®exCache, regPart); found { + matched := regex.MatchString(requestToken) + return matched, false + } + } + + // Compile the regex + regex, err := regexp.Compile(regPart) + if err != nil { + return false, false + } + + // Cache the regex (if enabled) + if pathTokenCacheEnabled { + regexCache.Store(regPart, regex) + } + + matched := regex.MatchString(requestToken) + return matched, false } var jsr311Router = RouterJSR311{} @@ -168,7 +212,7 @@ func (c CurlyRouter) computeWebserviceScore(requestTokens []string, routeTokens if matchesToken { score++ // extra score for regex match } - } + } } else { // not a parameter if eachRequestToken != eachRouteToken { diff --git a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go index bfc17efde..0b98eeb09 100644 --- a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go +++ b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go @@ -1,14 +1,28 @@ package restful +// Copyright 2025 Ernest Micklei. All rights reserved. +// Use of this source code is governed by a license +// that can be found in the LICENSE file. + import ( "fmt" "regexp" + "sync" ) var ( - customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") + customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") + customVerbCache sync.Map // Cache for compiled custom verb regexes + customVerbCacheEnabled = true // Enable/disable custom verb regex caching ) +// SetCustomVerbCacheEnabled enables or disables custom verb regex caching. +// When disabled, custom verb regex patterns will be compiled on every request. +// When enabled (default), compiled custom verb regex patterns are cached for better performance. +func SetCustomVerbCacheEnabled(enabled bool) { + customVerbCacheEnabled = enabled +} + func hasCustomVerb(routeToken string) bool { return customVerbReg.MatchString(routeToken) } @@ -20,7 +34,23 @@ func isMatchCustomVerb(routeToken string, pathToken string) bool { } customVerb := rs[1] - specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb)) + regexPattern := fmt.Sprintf(":%s$", customVerb) + + // Check cache first (if enabled) + if customVerbCacheEnabled { + if specificVerbReg, found := getCachedRegexp(&customVerbCache, regexPattern); found { + return specificVerbReg.MatchString(pathToken) + } + } + + // Compile the regex + specificVerbReg := regexp.MustCompile(regexPattern) + + // Cache the regex (if enabled) + if customVerbCacheEnabled { + customVerbCache.Store(regexPattern, specificVerbReg) + } + return specificVerbReg.MatchString(pathToken) } diff --git a/vendor/github.com/emicklei/go-restful/v3/doc.go b/vendor/github.com/emicklei/go-restful/v3/doc.go index 69b13057d..80809225b 100644 --- a/vendor/github.com/emicklei/go-restful/v3/doc.go +++ b/vendor/github.com/emicklei/go-restful/v3/doc.go @@ -1,7 +1,7 @@ /* Package restful , a lean package for creating REST-style WebServices without magic. -WebServices and Routes +### WebServices and Routes A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls. Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes. @@ -30,14 +30,14 @@ The (*Request, *Response) arguments provide functions for reading information fr See the example https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go with a full implementation. -Regular expression matching Routes +### Regular expression matching Routes A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path. For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters. Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax) This feature requires the use of a CurlyRouter. -Containers +### Containers A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests. Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container. @@ -47,7 +47,7 @@ You can create your own Container and create a new http.Server for that particul container := restful.NewContainer() server := &http.Server{Addr: ":8081", Handler: container} -Filters +### Filters A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc. @@ -60,22 +60,21 @@ Use the following statement to pass the request,response pair to the next filter chain.ProcessFilter(req, resp) -Container Filters +### Container Filters These are processed before any registered WebService. // install a (global) filter for the default container (processed before any webservice) restful.Filter(globalLogging) -WebService Filters +### WebService Filters These are processed before any Route of a WebService. // install a webservice filter (processed before any route) ws.Filter(webserviceLogging).Filter(measureTime) - -Route Filters +### Route Filters These are processed before calling the function associated with the Route. @@ -84,7 +83,7 @@ These are processed before calling the function associated with the Route. See the example https://github.com/emicklei/go-restful/blob/v3/examples/filters/restful-filters.go with full implementations. -Response Encoding +### Response Encoding Two encodings are supported: gzip and deflate. To enable this for all responses: @@ -95,20 +94,20 @@ Alternatively, you can create a Filter that performs the encoding and install it See the example https://github.com/emicklei/go-restful/blob/v3/examples/encoding/restful-encoding-filter.go -OPTIONS support +### OPTIONS support By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request. Filter(OPTIONSFilter()) -CORS +### CORS By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests. cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} Filter(cors.Filter) -Error Handling +### Error Handling Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why. For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation. @@ -137,11 +136,11 @@ The request does not have or has an unknown Accept Header set for this operation The request does not have or has an unknown Content-Type Header set for this operation. -ServiceError +### ServiceError In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response. -Performance options +### Performance options This package has several options that affect the performance of your service. It is important to understand them and how you can change it. @@ -156,30 +155,27 @@ Default value is true If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool. Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation. -Trouble shooting +### Trouble shooting This package has the means to produce detail logging of the complete Http request matching process and filter invocation. Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as: restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) -Logging +### Logging The restful.SetLogger() method allows you to override the logger used by the package. By default restful uses the standard library `log` package and logs to stdout. Different logging packages are supported as long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your preferred package is simple. -Resources +### Resources -[project]: https://github.com/emicklei/go-restful +(c) 2012-2025, http://ernestmicklei.com. MIT License +[project]: https://github.com/emicklei/go-restful [examples]: https://github.com/emicklei/go-restful/blob/master/examples - -[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ - +[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ [showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape - -(c) 2012-2015, http://ernestmicklei.com. MIT License */ package restful diff --git a/vendor/github.com/felixge/httpsnoop/.gitignore b/vendor/github.com/felixge/httpsnoop/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/felixge/httpsnoop/LICENSE.txt b/vendor/github.com/felixge/httpsnoop/LICENSE.txt deleted file mode 100644 index e028b46a9..000000000 --- a/vendor/github.com/felixge/httpsnoop/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/vendor/github.com/felixge/httpsnoop/Makefile b/vendor/github.com/felixge/httpsnoop/Makefile deleted file mode 100644 index 4e12afdd9..000000000 --- a/vendor/github.com/felixge/httpsnoop/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -.PHONY: ci generate clean - -ci: clean generate - go test -race -v ./... - -generate: - go generate . - -clean: - rm -rf *_generated*.go diff --git a/vendor/github.com/felixge/httpsnoop/README.md b/vendor/github.com/felixge/httpsnoop/README.md deleted file mode 100644 index cf6b42f3d..000000000 --- a/vendor/github.com/felixge/httpsnoop/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# httpsnoop - -Package httpsnoop provides an easy way to capture http related metrics (i.e. -response time, bytes written, and http status code) from your application's -http.Handlers. - -Doing this requires non-trivial wrapping of the http.ResponseWriter interface, -which is also exposed for users interested in a more low-level API. - -[![Go Reference](https://pkg.go.dev/badge/github.com/felixge/httpsnoop.svg)](https://pkg.go.dev/github.com/felixge/httpsnoop) -[![Build Status](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml/badge.svg)](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml) - -## Usage Example - -```go -// myH is your app's http handler, perhaps a http.ServeMux or similar. -var myH http.Handler -// wrappedH wraps myH in order to log every request. -wrappedH := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - m := httpsnoop.CaptureMetrics(myH, w, r) - log.Printf( - "%s %s (code=%d dt=%s written=%d)", - r.Method, - r.URL, - m.Code, - m.Duration, - m.Written, - ) -}) -http.ListenAndServe(":8080", wrappedH) -``` - -## Why this package exists - -Instrumenting an application's http.Handler is surprisingly difficult. - -However if you google for e.g. "capture ResponseWriter status code" you'll find -lots of advise and code examples that suggest it to be a fairly trivial -undertaking. Unfortunately everything I've seen so far has a high chance of -breaking your application. - -The main problem is that a `http.ResponseWriter` often implements additional -interfaces such as `http.Flusher`, `http.CloseNotifier`, `http.Hijacker`, `http.Pusher`, and -`io.ReaderFrom`. So the naive approach of just wrapping `http.ResponseWriter` -in your own struct that also implements the `http.ResponseWriter` interface -will hide the additional interfaces mentioned above. This has a high change of -introducing subtle bugs into any non-trivial application. - -Another approach I've seen people take is to return a struct that implements -all of the interfaces above. However, that's also problematic, because it's -difficult to fake some of these interfaces behaviors when the underlying -`http.ResponseWriter` doesn't have an implementation. It's also dangerous, -because an application may choose to operate differently, merely because it -detects the presence of these additional interfaces. - -This package solves this problem by checking which additional interfaces a -`http.ResponseWriter` implements, returning a wrapped version implementing the -exact same set of interfaces. - -Additionally this package properly handles edge cases such as `WriteHeader` not -being called, or called more than once, as well as concurrent calls to -`http.ResponseWriter` methods, and even calls happening after the wrapped -`ServeHTTP` has already returned. - -Unfortunately this package is not perfect either. It's possible that it is -still missing some interfaces provided by the go core (let me know if you find -one), and it won't work for applications adding their own interfaces into the -mix. You can however use `httpsnoop.Unwrap(w)` to access the underlying -`http.ResponseWriter` and type-assert the result to its other interfaces. - -However, hopefully the explanation above has sufficiently scared you of rolling -your own solution to this problem. httpsnoop may still break your application, -but at least it tries to avoid it as much as possible. - -Anyway, the real problem here is that smuggling additional interfaces inside -`http.ResponseWriter` is a problematic design choice, but it probably goes as -deep as the Go language specification itself. But that's okay, I still prefer -Go over the alternatives ;). - -## Performance - -``` -BenchmarkBaseline-8 20000 94912 ns/op -BenchmarkCaptureMetrics-8 20000 95461 ns/op -``` - -As you can see, using `CaptureMetrics` on a vanilla http.Handler introduces an -overhead of ~500 ns per http request on my machine. However, the margin of -error appears to be larger than that, therefor it should be reasonable to -assume that the overhead introduced by `CaptureMetrics` is absolutely -negligible. - -## License - -MIT diff --git a/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/vendor/github.com/felixge/httpsnoop/capture_metrics.go deleted file mode 100644 index bec7b71b3..000000000 --- a/vendor/github.com/felixge/httpsnoop/capture_metrics.go +++ /dev/null @@ -1,86 +0,0 @@ -package httpsnoop - -import ( - "io" - "net/http" - "time" -) - -// Metrics holds metrics captured from CaptureMetrics. -type Metrics struct { - // Code is the first http response code passed to the WriteHeader func of - // the ResponseWriter. If no such call is made, a default code of 200 is - // assumed instead. - Code int - // Duration is the time it took to execute the handler. - Duration time.Duration - // Written is the number of bytes successfully written by the Write or - // ReadFrom function of the ResponseWriter. ResponseWriters may also write - // data to their underlaying connection directly (e.g. headers), but those - // are not tracked. Therefor the number of Written bytes will usually match - // the size of the response body. - Written int64 -} - -// CaptureMetrics wraps the given hnd, executes it with the given w and r, and -// returns the metrics it captured from it. -func CaptureMetrics(hnd http.Handler, w http.ResponseWriter, r *http.Request) Metrics { - return CaptureMetricsFn(w, func(ww http.ResponseWriter) { - hnd.ServeHTTP(ww, r) - }) -} - -// CaptureMetricsFn wraps w and calls fn with the wrapped w and returns the -// resulting metrics. This is very similar to CaptureMetrics (which is just -// sugar on top of this func), but is a more usable interface if your -// application doesn't use the Go http.Handler interface. -func CaptureMetricsFn(w http.ResponseWriter, fn func(http.ResponseWriter)) Metrics { - m := Metrics{Code: http.StatusOK} - m.CaptureMetrics(w, fn) - return m -} - -// CaptureMetrics wraps w and calls fn with the wrapped w and updates -// Metrics m with the resulting metrics. This is similar to CaptureMetricsFn, -// but allows one to customize starting Metrics object. -func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWriter)) { - var ( - start = time.Now() - headerWritten bool - hooks = Hooks{ - WriteHeader: func(next WriteHeaderFunc) WriteHeaderFunc { - return func(code int) { - next(code) - - if !(code >= 100 && code <= 199) && !headerWritten { - m.Code = code - headerWritten = true - } - } - }, - - Write: func(next WriteFunc) WriteFunc { - return func(p []byte) (int, error) { - n, err := next(p) - - m.Written += int64(n) - headerWritten = true - return n, err - } - }, - - ReadFrom: func(next ReadFromFunc) ReadFromFunc { - return func(src io.Reader) (int64, error) { - n, err := next(src) - - headerWritten = true - m.Written += n - return n, err - } - }, - } - ) - - fn(Wrap(w, hooks)) - m.Duration += time.Since(start) -} diff --git a/vendor/github.com/felixge/httpsnoop/docs.go b/vendor/github.com/felixge/httpsnoop/docs.go deleted file mode 100644 index 203c35b3c..000000000 --- a/vendor/github.com/felixge/httpsnoop/docs.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package httpsnoop provides an easy way to capture http related metrics (i.e. -// response time, bytes written, and http status code) from your application's -// http.Handlers. -// -// Doing this requires non-trivial wrapping of the http.ResponseWriter -// interface, which is also exposed for users interested in a more low-level -// API. -package httpsnoop - -//go:generate go run codegen/main.go diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go deleted file mode 100644 index 101cedde6..000000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go +++ /dev/null @@ -1,436 +0,0 @@ -// +build go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// PushFunc is part of the http.Pusher interface. -type PushFunc func(target string, opts *http.PushOptions) error - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc - Push func(PushFunc) PushFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// - http.Pusher -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - _, i4 := w.(http.Pusher) - switch { - // combination 1/32 - case !i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/32 - case !i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Pusher - }{rw, rw, rw} - // combination 3/32 - case !i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 4/32 - case !i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw} - // combination 5/32 - case !i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 6/32 - case !i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - http.Pusher - }{rw, rw, rw, rw} - // combination 7/32 - case !i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 8/32 - case !i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 9/32 - case !i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 10/32 - case !i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw} - // combination 11/32 - case !i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 12/32 - case !i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 13/32 - case !i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 14/32 - case !i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 15/32 - case !i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 16/32 - case !i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 17/32 - case i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 18/32 - case i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Pusher - }{rw, rw, rw, rw} - // combination 19/32 - case i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 20/32 - case i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 21/32 - case i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 22/32 - case i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 23/32 - case i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 24/32 - case i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 25/32 - case i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 26/32 - case i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 27/32 - case i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 28/32 - case i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 29/32 - case i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 30/32 - case i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 31/32 - case i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - // combination 32/32 - case i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -func (w *rw) Push(target string, opts *http.PushOptions) error { - f := w.w.(http.Pusher).Push - if w.h.Push != nil { - f = w.h.Push(f) - } - return f(target, opts) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go deleted file mode 100644 index e0951df15..000000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go +++ /dev/null @@ -1,278 +0,0 @@ -// +build !go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - switch { - // combination 1/16 - case !i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/16 - case !i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 3/16 - case !i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 4/16 - case !i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 5/16 - case !i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 6/16 - case !i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 7/16 - case !i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 8/16 - case !i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 9/16 - case i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 10/16 - case i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 11/16 - case i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 12/16 - case i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 13/16 - case i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 14/16 - case i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 15/16 - case i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 16/16 - case i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/go-logr/stdr/LICENSE b/vendor/github.com/go-logr/stdr/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/vendor/github.com/go-logr/stdr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-logr/stdr/README.md b/vendor/github.com/go-logr/stdr/README.md deleted file mode 100644 index 515866789..000000000 --- a/vendor/github.com/go-logr/stdr/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Minimal Go logging using logr and Go's standard library - -[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/stdr.svg)](https://pkg.go.dev/github.com/go-logr/stdr) - -This package implements the [logr interface](https://github.com/go-logr/logr) -in terms of Go's standard log package(https://pkg.go.dev/log). diff --git a/vendor/github.com/go-logr/stdr/stdr.go b/vendor/github.com/go-logr/stdr/stdr.go deleted file mode 100644 index 93a8aab51..000000000 --- a/vendor/github.com/go-logr/stdr/stdr.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package stdr implements github.com/go-logr/logr.Logger in terms of -// Go's standard log package. -package stdr - -import ( - "log" - "os" - - "github.com/go-logr/logr" - "github.com/go-logr/logr/funcr" -) - -// The global verbosity level. See SetVerbosity(). -var globalVerbosity int - -// SetVerbosity sets the global level against which all info logs will be -// compared. If this is greater than or equal to the "V" of the logger, the -// message will be logged. A higher value here means more logs will be written. -// The previous verbosity value is returned. This is not concurrent-safe - -// callers must be sure to call it from only one goroutine. -func SetVerbosity(v int) int { - old := globalVerbosity - globalVerbosity = v - return old -} - -// New returns a logr.Logger which is implemented by Go's standard log package, -// or something like it. If std is nil, this will use a default logger -// instead. -// -// Example: stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) -func New(std StdLogger) logr.Logger { - return NewWithOptions(std, Options{}) -} - -// NewWithOptions returns a logr.Logger which is implemented by Go's standard -// log package, or something like it. See New for details. -func NewWithOptions(std StdLogger, opts Options) logr.Logger { - if std == nil { - // Go's log.Default() is only available in 1.16 and higher. - std = log.New(os.Stderr, "", log.LstdFlags) - } - - if opts.Depth < 0 { - opts.Depth = 0 - } - - fopts := funcr.Options{ - LogCaller: funcr.MessageClass(opts.LogCaller), - } - - sl := &logger{ - Formatter: funcr.NewFormatter(fopts), - std: std, - } - - // For skipping our own logger.Info/Error. - sl.Formatter.AddCallDepth(1 + opts.Depth) - - return logr.New(sl) -} - -// Options carries parameters which influence the way logs are generated. -type Options struct { - // Depth biases the assumed number of call frames to the "true" caller. - // This is useful when the calling code calls a function which then calls - // stdr (e.g. a logging shim to another API). Values less than zero will - // be treated as zero. - Depth int - - // LogCaller tells stdr to add a "caller" key to some or all log lines. - // Go's log package has options to log this natively, too. - LogCaller MessageClass - - // TODO: add an option to log the date/time -} - -// MessageClass indicates which category or categories of messages to consider. -type MessageClass int - -const ( - // None ignores all message classes. - None MessageClass = iota - // All considers all message classes. - All - // Info only considers info messages. - Info - // Error only considers error messages. - Error -) - -// StdLogger is the subset of the Go stdlib log.Logger API that is needed for -// this adapter. -type StdLogger interface { - // Output is the same as log.Output and log.Logger.Output. - Output(calldepth int, logline string) error -} - -type logger struct { - funcr.Formatter - std StdLogger -} - -var _ logr.LogSink = &logger{} -var _ logr.CallDepthLogSink = &logger{} - -func (l logger) Enabled(level int) bool { - return globalVerbosity >= level -} - -func (l logger) Info(level int, msg string, kvList ...interface{}) { - prefix, args := l.FormatInfo(level, msg, kvList) - if prefix != "" { - args = prefix + ": " + args - } - _ = l.std.Output(l.Formatter.GetDepth()+1, args) -} - -func (l logger) Error(err error, msg string, kvList ...interface{}) { - prefix, args := l.FormatError(err, msg, kvList) - if prefix != "" { - args = prefix + ": " + args - } - _ = l.std.Output(l.Formatter.GetDepth()+1, args) -} - -func (l logger) WithName(name string) logr.LogSink { - l.Formatter.AddName(name) - return &l -} - -func (l logger) WithValues(kvList ...interface{}) logr.LogSink { - l.Formatter.AddValues(kvList) - return &l -} - -func (l logger) WithCallDepth(depth int) logr.LogSink { - l.Formatter.AddCallDepth(depth) - return &l -} - -// Underlier exposes access to the underlying logging implementation. Since -// callers only have a logr.Logger, they have to know which implementation is -// in use, so this interface is less of an abstraction and more of way to test -// type conversion. -type Underlier interface { - GetUnderlying() StdLogger -} - -// GetUnderlying returns the StdLogger underneath this logger. Since StdLogger -// is itself an interface, the result may or may not be a Go log.Logger. -func (l logger) GetUnderlying() StdLogger { - return l.std -} diff --git a/vendor/github.com/go-openapi/swag/.codecov.yml b/vendor/github.com/go-openapi/swag/.codecov.yml new file mode 100644 index 000000000..3354f44b2 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/.codecov.yml @@ -0,0 +1,4 @@ +ignore: + - jsonutils/fixtures_test + - jsonutils/adapters/ifaces/mocks + - jsonutils/adapters/testintegration/benchmarks diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index 80e2be004..126264a6b 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -1,60 +1,78 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 3 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - maligned - - lll - - gochecknoinits - - gochecknoglobals + - cyclop + - depguard + - errchkjson + - errorlint + - exhaustruct + - forcetypeassert - funlen - - godox + - gochecknoglobals + - gochecknoinits - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - gomnd - - exhaustivestruct - - goerr113 - - errorlint - - nestif - godot - - gofumpt + - godox + - gomoddirectives + - gosmopolitan + - inamedparam + - intrange + - ireturn + - lll + - musttag + - modernize + - nestif + - nlreturn + - nonamedreturns + - noinlineerr - paralleltest - - tparallel + - recvcheck + - testpackage - thelper - - ifshort - - exhaustruct + - tagliatelle + - tparallel + - unparam - varnamelen - - gci - - depguard - - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn - - forcetypeassert - - cyclop - # deprecated linters - - deadcode - - interfacer - - scopelint - - varcheck - - structcheck - - golint - - nosnakecase + - whitespace + - wrapcheck + - wsl + - wsl_v5 + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 diff --git a/vendor/github.com/go-openapi/swag/.mockery.yml b/vendor/github.com/go-openapi/swag/.mockery.yml new file mode 100644 index 000000000..8557cb58d --- /dev/null +++ b/vendor/github.com/go-openapi/swag/.mockery.yml @@ -0,0 +1,30 @@ +all: false +dir: '{{.InterfaceDir}}' +filename: mocks_test.go +force-file-write: true +formatter: goimports +include-auto-generated: false +log-level: info +structname: '{{.Mock}}{{.InterfaceName}}' +pkgname: '{{.SrcPackageName}}' +recursive: false +require-template-schema-exists: true +template: matryer +template-schema: '{{.Template}}.schema.json' +packages: + github.com/go-openapi/swag/jsonutils/adapters/ifaces: + config: + dir: jsonutils/adapters/ifaces/mocks + filename: mocks.go + pkgname: 'mocks' + force-file-write: true + all: true + github.com/go-openapi/swag/jsonutils/adapters/testintegration: + config: + inpackage: true + dir: jsonutils/adapters/testintegration + force-file-write: true + all: true + interfaces: + EJMarshaler: + EJUnmarshaler: diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md index a72922299..371fd55fd 100644 --- a/vendor/github.com/go-openapi/swag/README.md +++ b/vendor/github.com/go-openapi/swag/README.md @@ -1,23 +1,239 @@ # Swag [![Build Status](https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) +[![license](https://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) [![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/swag.svg)](https://pkg.go.dev/github.com/go-openapi/swag) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) -Contains a bunch of helper functions for go-openapi and go-swagger projects. +Package `swag` contains a bunch of helper functions for go-openapi and go-swagger projects. You may also use it standalone for your projects. -* convert between value and pointers for builtin types -* convert from string to builtin types (wraps strconv) -* fast json concatenation -* search in path -* load from file or http -* name mangling +> **NOTE** +> `swag` is one of the foundational building blocks of the go-openapi initiative. +> Most repositories in `github.com/go-openapi/...` depend on it in some way. +> And so does our CLI tool `github.com/go-swagger/go-swagger`, +> as well as the code generated by this tool. +* [Contents](#contents) +* [Dependencies](#dependencies) +* [Release Notes](#release-notes) +* [Licensing](#licensing) +* [Note to contributors](#note-to-contributors) +* [TODOs, suggestions and plans](#todos-suggestions-and-plans) -This repo has only few dependencies outside of the standard library: +## Contents -* YAML utilities depend on `gopkg.in/yaml.v3` -* `github.com/mailru/easyjson v0.7.7` +`go-openapi/swag` exposes a collection of relatively independent modules. + +Moving forward, no additional feature will be added to the `swag` API directly at the root package level, +which remains there for backward-compatibility purposes. All exported top-level features are now deprecated. + +Child modules will continue to evolve and some new ones may be added in the future. + +| Module | Content | Main features | +|---------------|---------|---------------| +| `cmdutils` | utilities to work with CLIs || +| `conv` | type conversion utilities | convert between values and pointers for any types
convert from string to builtin types (wraps `strconv`)
require `./typeutils` (test dependency)
| +| `fileutils` | file utilities | | +| `jsonname` | JSON utilities | infer JSON names from `go` properties
| +| `jsonutils` | JSON utilities | fast json concatenation
read and write JSON from and to dynamic `go` data structures
~require `github.com/mailru/easyjson`~
| +| `loading` | file loading | load from file or http
require `./yamlutils`
| +| `mangling` | safe name generation | name mangling for `go`
| +| `netutils` | networking utilities | host, port from address
| +| `stringutils` | `string` utilities | search in slice (with case-insensitive)
split/join query parameters as arrays
| +| `typeutils` | `go` types utilities | check the zero value for any type
safe check for a nil value
| +| `yamlutils` | YAML utilities | converting YAML to JSON
loading YAML into a dynamic YAML document
maintaining the original order of keys in YAML objects
require `./jsonutils`
~require `github.com/mailru/easyjson`~
require `go.yaml.in/yaml/v3`
| + +--- + +## Dependencies + +The root module `github.com/go-openapi/swag` at the repo level maintains a few +dependencies outside of the standard library. + +* YAML utilities depend on `go.yaml.in/yaml/v3` +* JSON utilities depend on their registered adapter module: + * by default, only the standard library is used + * `github.com/mailru/easyjson` is now only a dependency for module + `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`, + for users willing to import that module. + * integration tests and benchmarks use all the dependencies are published as their own module +* other dependencies are test dependencies drawn from `github.com/stretchr/testify` + +## Release notes + +### v0.25.4 + +** mangling** + +Bug fix + +* [x] mangler may panic with pluralized overlapping initialisms + +Tests + +* [x] introduced fuzz tests + +### v0.25.3 + +** mangling** + +Bug fix + +* [x] mangler may panic with pluralized initialisms + +### v0.25.2 + +Minor changes due to internal maintenance that don't affect the behavior of the library. + +* [x] removed indirect test dependencies by switching all tests to `go-openapi/testify`, + a fork of `stretch/testify` with zero-dependencies. +* [x] improvements to CI to catch test reports. +* [x] modernized licensing annotations in source code, using the more compact SPDX annotations + rather than the full license terms. +* [x] simplified a bit JSON & YAML testing by using newly available assertions +* started the journey to an OpenSSF score card badge: + * [x] explicited permissions in CI workflows + * [x] published security policy + * pinned dependencies to github actions + * introduced fuzzing in tests + +### v0.25.1 + +* fixes a data race that could occur when using the standard library implementation of a JSON ordered map + +### v0.25.0 + +**New with this release**: + +* requires `go1.24`, as iterators are being introduced +* removes the dependency to `mailru/easyjson` by default (#68) + * functionality remains the same, but performance may somewhat degrade for applications + that relied on `easyjson` + * users of the JSON or YAML utilities who want to use `easyjson` as their preferred JSON serializer library + will be able to do so by registering this the corresponding JSON adapter at runtime. See below. + * ordered keys in JSON and YAML objects: this feature used to rely solely on `easyjson`. + With this release, an implementation relying on the standard `encoding/json` is provided. + * an independent [benchmark](./jsonutils/adapters/testintegration/benchmarks/README.md) to compare the different adapters +* improves the "float is integer" check (`conv.IsFloat64AJSONInteger`) (#59) +* removes the _direct_ dependency to `gopkg.in/yaml.v3` (indirect dependency is still incurred through `stretchr/testify`) (#127) +* exposed `conv.IsNil()` (previously kept private): a safe nil check (accounting for the "non-nil interface with nil value" nonsensical go trick) + +**What coming next?** + +Moving forward, we want to : +* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds. +* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other + similar libraries may be interesting too. + + +**How to explicitly register a dependency at runtime**? + +The following would maintain how JSON utilities proposed by `swag` used work, up to `v0.24.1`. + + ```go + import ( + "github.com/go-openapi/swag/jsonutils/adapters" + easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json" + ) + + func init() { + easyjson.Register(adapters.Registry) + } + ``` + +Subsequent calls to `jsonutils.ReadJSON()` or `jsonutils.WriteJSON()` will switch to `easyjson` +whenever the passed data structures implement the `easyjson.Unmarshaler` or `easyjson.Marshaler` respectively, +or fallback to the standard library. + +For more details, you may also look at our +[integration tests](jsonutils/adapters/testintegration/integration_suite_test.go#29). + +### v0.24.0 + +With this release, we have largely modernized the API of `swag`: + +* The traditional `swag` API is still supported: code that imports `swag` will still + compile and work the same. +* A deprecation notice is published to encourage consumers of this library to adopt + the newer API +* **Deprecation notice** + * configuration through global variables is now deprecated, in favor of options passed as parameters + * all helper functions are moved to more specialized packages, which are exposed as + go modules. Importing such a module would reduce the footprint of dependencies. + * _all_ functions, variables, constants exposed by the deprecated API have now moved, so + that consumers of the new API no longer need to import github.com/go-openapi/swag, but + should import the desired sub-module(s). + +**New with this release**: + +* [x] type converters and pointer to value helpers now support generic types +* [x] name mangling now support pluralized initialisms (issue #46) + Strings like "contact IDs" are now recognized as such a plural form and mangled as a linter would expect. +* [x] performance: small improvements to reduce the overhead of convert/format wrappers (see issues #110, or PR #108) +* [x] performance: name mangling utilities run ~ 10% faster (PR #115) + +--- + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). + +## Note to contributors + +A mono-repo structure comes with some unavoidable extra pains... + +* Testing + +> The usual `go test ./...` command, run from the root of this repo won't work any longer to test all submodules. +> +> Each module constitutes an independant unit of test. So you have to run `go test` inside each module. +> Or you may take a look at how this is achieved by CI +> [here] https://github.com/go-openapi/swag/blob/master/.github/workflows/go-test.yml). +> +> There are also some alternative tricks using `go work`, for local development, if you feel comfortable with +> go workspaces. Perhaps some day, we'll have a `go work test` to run all tests without any hack. + +* Releasing + +> Each module follows its own independant module versioning. +> +> So you have tags like `mangling/v0.24.0`, `fileutils/v0.24.0` etc that are used by `go mod` and `go get` +> to refer to the tagged version of each module specifically. +> +> This means we may release patches etc to each module independently. +> +> We'd like to adopt the rule that modules in this repo would only differ by a patch version +> (e.g. `v0.24.5` vs `v0.24.3`), and we'll level all modules whenever a minor version is introduced. +> +> A script in `./hack` is provided to tag all modules with the same version in one go. + +* Continuous integration + +> At this moment, all tests in all modules are systematically run over the full test matrix (3 platform x 2 go releases). +> This generates quite a lot of jobs. +> +> We ought to reduce the number of jobs required to test a PR focused on only a few modules. + +## Todos, suggestions and plans + +All kinds of contributions are welcome. + +A few ideas: + +* [x] Complete the split of dependencies to isolate easyjson from the rest +* [x] Improve CI to reduce needed tests +* [x] Replace dependency to `gopkg.in/yaml.v3` (`yamlutil`) +* [ ] Improve mangling utilities (improve readability, support for capitalized words, + better word substitution for non-letter symbols...) +* [ ] Move back to this common shared pot a few of the technical features introduced by go-swagger independently + (e.g. mangle go package names, search package with go modules support, ...) +* [ ] Apply a similar mono-repo approach to go-openapi/strfmt which suffer from similar woes: bloated API, + imposed dependency to some database driver. +* [ ] Adapt `go-swagger` (incl. generated code) to the new `swag` API. +* [ ] Factorize some tests, as there is a lot of redundant testing code in `jsonutils` +* [ ] Benchmark & profiling: publish independently the tool built to analyze and chart benchmarks (e.g. similar to `benchvisual`) +* [ ] more thorough testing for nil / null case +* [ ] ci pipeline to manage releases +* [ ] cleaner mockery generation (doesn't work out of the box for all sub-modules) diff --git a/vendor/github.com/go-openapi/swag/SECURITY.md b/vendor/github.com/go-openapi/swag/SECURITY.md new file mode 100644 index 000000000..72296a831 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +This policy outlines the commitment and practices of the go-openapi maintainers regarding security. + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 0.25.x | :white_check_mark: | + +## Reporting a vulnerability + +If you become aware of a security vulnerability that affects the current repository, +please report it privately to the maintainers. + +Please follow the instructions provided by github to +[Privately report a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). + +TL;DR: on Github, navigate to the project's "Security" tab then click on "Report a vulnerability". diff --git a/vendor/cel.dev/expr/LICENSE b/vendor/github.com/go-openapi/swag/cmdutils/LICENSE similarity index 100% rename from vendor/cel.dev/expr/LICENSE rename to vendor/github.com/go-openapi/swag/cmdutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go new file mode 100644 index 000000000..6c7bbb26f --- /dev/null +++ b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package cmdutils + +// CommandLineOptionsGroup represents a group of user-defined command line options. +// +// This is for instance used to configure command line arguments in API servers generated by go-swagger. +type CommandLineOptionsGroup struct { + ShortDescription string + LongDescription string + Options any +} diff --git a/vendor/github.com/go-openapi/swag/cmdutils/doc.go b/vendor/github.com/go-openapi/swag/cmdutils/doc.go new file mode 100644 index 000000000..31f2c3753 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/cmdutils/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package cmdutils brings helpers for CLIs produced by go-openapi +package cmdutils diff --git a/vendor/github.com/go-openapi/swag/cmdutils_iface.go b/vendor/github.com/go-openapi/swag/cmdutils_iface.go new file mode 100644 index 000000000..bd0c1fc12 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/cmdutils_iface.go @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/cmdutils" + +// CommandLineOptionsGroup represents a group of user-defined command line options. +// +// Deprecated: use [cmdutils.CommandLineOptionsGroup] instead. +type CommandLineOptionsGroup = cmdutils.CommandLineOptionsGroup diff --git a/vendor/github.com/moby/spdystream/LICENSE b/vendor/github.com/go-openapi/swag/conv/LICENSE similarity index 100% rename from vendor/github.com/moby/spdystream/LICENSE rename to vendor/github.com/go-openapi/swag/conv/LICENSE diff --git a/vendor/github.com/go-openapi/swag/conv/convert.go b/vendor/github.com/go-openapi/swag/conv/convert.go new file mode 100644 index 000000000..f205c3913 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/convert.go @@ -0,0 +1,161 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package conv + +import ( + "math" + "strconv" + "strings" +) + +// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER +const ( + maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1 + minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1 + epsilon float64 = 1e-9 +) + +// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive. +func IsFloat64AJSONInteger(f float64) bool { + if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat { + return false + } + rounded := math.Round(f) + if f == rounded { + return true + } + if rounded == 0 { // f = 0.0 exited above + return false + } + + diff := math.Abs(f - rounded) + if diff == 0 { + return true + } + + // relative error Abs{f - Round(f)) / Round(f)} < ε ; Round(f) + return diff < epsilon*math.Abs(rounded) +} + +// ConvertFloat turns a string into a float numerical value. +func ConvertFloat[T Float](str string) (T, error) { + var v T + f, err := strconv.ParseFloat(str, bitsize(v)) + if err != nil { + return 0, err + } + + return T(f), nil +} + +// ConvertInteger turns a string into a signed integer. +func ConvertInteger[T Signed](str string) (T, error) { + var v T + f, err := strconv.ParseInt(str, 10, bitsize(v)) + if err != nil { + return 0, err + } + + return T(f), nil +} + +// ConvertUinteger turns a string into an unsigned integer. +func ConvertUinteger[T Unsigned](str string) (T, error) { + var v T + f, err := strconv.ParseUint(str, 10, bitsize(v)) + if err != nil { + return 0, err + } + + return T(f), nil +} + +// ConvertBool turns a string into a boolean. +// +// It supports a few more "true" strings than [strconv.ParseBool]: +// +// - it is not case sensitive ("trUe" or "FalsE" work) +// - "ok", "yes", "y", "on", "selected", "checked", "enabled" are all true +// - everything that is not true is false: there is never an actual error returned +func ConvertBool(str string) (bool, error) { + switch strings.ToLower(str) { + case "true", + "1", + "yes", + "ok", + "y", + "on", + "selected", + "checked", + "t", + "enabled": + return true, nil + default: + return false, nil + } +} + +// ConvertFloat32 turns a string into a float32. +func ConvertFloat32(str string) (float32, error) { return ConvertFloat[float32](str) } + +// ConvertFloat64 turns a string into a float64 +func ConvertFloat64(str string) (float64, error) { return ConvertFloat[float64](str) } + +// ConvertInt8 turns a string into an int8 +func ConvertInt8(str string) (int8, error) { return ConvertInteger[int8](str) } + +// ConvertInt16 turns a string into an int16 +func ConvertInt16(str string) (int16, error) { + i, err := strconv.ParseInt(str, 10, 16) + if err != nil { + return 0, err + } + return int16(i), nil +} + +// ConvertInt32 turns a string into an int32 +func ConvertInt32(str string) (int32, error) { + i, err := strconv.ParseInt(str, 10, 32) + if err != nil { + return 0, err + } + return int32(i), nil +} + +// ConvertInt64 turns a string into an int64 +func ConvertInt64(str string) (int64, error) { + return strconv.ParseInt(str, 10, 64) +} + +// ConvertUint8 turns a string into an uint8 +func ConvertUint8(str string) (uint8, error) { + i, err := strconv.ParseUint(str, 10, 8) + if err != nil { + return 0, err + } + return uint8(i), nil +} + +// ConvertUint16 turns a string into an uint16 +func ConvertUint16(str string) (uint16, error) { + i, err := strconv.ParseUint(str, 10, 16) + if err != nil { + return 0, err + } + return uint16(i), nil +} + +// ConvertUint32 turns a string into an uint32 +func ConvertUint32(str string) (uint32, error) { + i, err := strconv.ParseUint(str, 10, 32) + if err != nil { + return 0, err + } + return uint32(i), nil +} + +// ConvertUint64 turns a string into an uint64 +func ConvertUint64(str string) (uint64, error) { + return strconv.ParseUint(str, 10, 64) +} diff --git a/vendor/github.com/go-openapi/swag/conv/convert_types.go b/vendor/github.com/go-openapi/swag/conv/convert_types.go new file mode 100644 index 000000000..cf4c6495e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/convert_types.go @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package conv + +// Unlicensed credits (idea, concept) +// +// The idea to convert values to pointers and the other way around, was inspired, eons ago, by the aws go sdk. +// +// Nowadays, all sensible API sdk's expose a similar functionality. + +// Pointer returns a pointer to the value passed in. +func Pointer[T any](v T) *T { + return &v +} + +// Value returns a shallow copy of the value of the pointer passed in. +// +// If the pointer is nil, the returned value is the zero value. +func Value[T any](v *T) T { + if v != nil { + return *v + } + + var zero T + return zero +} + +// PointerSlice converts a slice of values into a slice of pointers. +func PointerSlice[T any](src []T) []*T { + dst := make([]*T, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// ValueSlice converts a slice of pointers into a slice of values. +// +// nil elements are zero values. +func ValueSlice[T any](src []*T) []T { + dst := make([]T, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// PointerMap converts a map of values into a map of pointers. +func PointerMap[K comparable, T any](src map[K]T) map[K]*T { + dst := make(map[K]*T) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// ValueMap converts a map of pointers into a map of values. +// +// nil elements are skipped. +func ValueMap[K comparable, T any](src map[K]*T) map[K]T { + dst := make(map[K]T) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} diff --git a/vendor/github.com/go-openapi/swag/conv/doc.go b/vendor/github.com/go-openapi/swag/conv/doc.go new file mode 100644 index 000000000..1bd6ead6e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/doc.go @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package conv exposes utilities to convert types. +// +// The Convert and Format families of functions are essentially a shorthand to [strconv] functions, +// using the decimal representation of numbers. +// +// Features: +// +// - from string representation to value ("Convert*") and reciprocally ("Format*") +// - from pointer to value ([Value]) and reciprocally ([Pointer]) +// - from slice of values to slice of pointers ([PointerSlice]) and reciprocally ([ValueSlice]) +// - from map of values to map of pointers ([PointerMap]) and reciprocally ([ValueMap]) +package conv diff --git a/vendor/github.com/go-openapi/swag/conv/format.go b/vendor/github.com/go-openapi/swag/conv/format.go new file mode 100644 index 000000000..5b87b8e14 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/format.go @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package conv + +import ( + "strconv" +) + +// FormatInteger turns an integer type into a string. +func FormatInteger[T Signed](value T) string { + return strconv.FormatInt(int64(value), 10) +} + +// FormatUinteger turns an unsigned integer type into a string. +func FormatUinteger[T Unsigned](value T) string { + return strconv.FormatUint(uint64(value), 10) +} + +// FormatFloat turns a floating point numerical value into a string. +func FormatFloat[T Float](value T) string { + return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value)) +} + +// FormatBool turns a boolean into a string. +func FormatBool(value bool) string { + return strconv.FormatBool(value) +} diff --git a/vendor/github.com/go-openapi/swag/conv/sizeof.go b/vendor/github.com/go-openapi/swag/conv/sizeof.go new file mode 100644 index 000000000..494346557 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/sizeof.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package conv + +import "unsafe" + +// bitsize returns the size in bits of a type. +// +// NOTE: [unsafe.SizeOf] simply returns the size in bytes of the value. +// For primitive types T, the generic stencil is precompiled and this value +// is resolved at compile time, resulting in an immediate call to [strconv.ParseFloat]. +// +// We may leave up to the go compiler to simplify this function into a +// constant value, which happens in practice at least for primitive types +// (e.g. numerical types). +func bitsize[T Numerical](value T) int { + const bitsPerByte = 8 + return int(unsafe.Sizeof(value)) * bitsPerByte +} diff --git a/vendor/github.com/go-openapi/swag/conv/type_constraints.go b/vendor/github.com/go-openapi/swag/conv/type_constraints.go new file mode 100644 index 000000000..81135e827 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv/type_constraints.go @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package conv + +type ( + // these type constraints are redefined after golang.org/x/exp/constraints, + // because importing that package causes an undesired go upgrade. + + // Signed integer types, cf. [golang.org/x/exp/constraints.Signed] + Signed interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 + } + + // Unsigned integer types, cf. [golang.org/x/exp/constraints.Unsigned] + Unsigned interface { + ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr + } + + // Float numerical types, cf. [golang.org/x/exp/constraints.Float] + Float interface { + ~float32 | ~float64 + } + + // Numerical types + Numerical interface { + Signed | Unsigned | Float + } +) diff --git a/vendor/github.com/go-openapi/swag/conv_iface.go b/vendor/github.com/go-openapi/swag/conv_iface.go new file mode 100644 index 000000000..eea7b2e56 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/conv_iface.go @@ -0,0 +1,486 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import ( + "time" + + "github.com/go-openapi/swag/conv" +) + +// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive. +// +// Deprecated: use [conv.IsFloat64AJSONInteger] instead. +func IsFloat64AJSONInteger(f float64) bool { return conv.IsFloat64AJSONInteger(f) } + +// ConvertBool turns a string into a boolean. +// +// Deprecated: use [conv.ConvertBool] instead. +func ConvertBool(str string) (bool, error) { return conv.ConvertBool(str) } + +// ConvertFloat32 turns a string into a float32. +// +// Deprecated: use [conv.ConvertFloat32] instead. Alternatively, you may use the generic version [conv.ConvertFloat]. +func ConvertFloat32(str string) (float32, error) { return conv.ConvertFloat[float32](str) } + +// ConvertFloat64 turns a string into a float64. +// +// Deprecated: use [conv.ConvertFloat64] instead. Alternatively, you may use the generic version [conv.ConvertFloat]. +func ConvertFloat64(str string) (float64, error) { return conv.ConvertFloat[float64](str) } + +// ConvertInt8 turns a string into an int8. +// +// Deprecated: use [conv.ConvertInt8] instead. Alternatively, you may use the generic version [conv.ConvertInteger]. +func ConvertInt8(str string) (int8, error) { return conv.ConvertInteger[int8](str) } + +// ConvertInt16 turns a string into an int16. +// +// Deprecated: use [conv.ConvertInt16] instead. Alternatively, you may use the generic version [conv.ConvertInteger]. +func ConvertInt16(str string) (int16, error) { return conv.ConvertInteger[int16](str) } + +// ConvertInt32 turns a string into an int32. +// +// Deprecated: use [conv.ConvertInt32] instead. Alternatively, you may use the generic version [conv.ConvertInteger]. +func ConvertInt32(str string) (int32, error) { return conv.ConvertInteger[int32](str) } + +// ConvertInt64 turns a string into an int64. +// +// Deprecated: use [conv.ConvertInt64] instead. Alternatively, you may use the generic version [conv.ConvertInteger]. +func ConvertInt64(str string) (int64, error) { return conv.ConvertInteger[int64](str) } + +// ConvertUint8 turns a string into an uint8. +// +// Deprecated: use [conv.ConvertUint8] instead. Alternatively, you may use the generic version [conv.ConvertUinteger]. +func ConvertUint8(str string) (uint8, error) { return conv.ConvertUinteger[uint8](str) } + +// ConvertUint16 turns a string into an uint16. +// +// Deprecated: use [conv.ConvertUint16] instead. Alternatively, you may use the generic version [conv.ConvertUinteger]. +func ConvertUint16(str string) (uint16, error) { return conv.ConvertUinteger[uint16](str) } + +// ConvertUint32 turns a string into an uint32. +// +// Deprecated: use [conv.ConvertUint32] instead. Alternatively, you may use the generic version [conv.ConvertUinteger]. +func ConvertUint32(str string) (uint32, error) { return conv.ConvertUinteger[uint32](str) } + +// ConvertUint64 turns a string into an uint64. +// +// Deprecated: use [conv.ConvertUint64] instead. Alternatively, you may use the generic version [conv.ConvertUinteger]. +func ConvertUint64(str string) (uint64, error) { return conv.ConvertUinteger[uint64](str) } + +// FormatBool turns a boolean into a string. +// +// Deprecated: use [conv.FormatBool] instead. +func FormatBool(value bool) string { return conv.FormatBool(value) } + +// FormatFloat32 turns a float32 into a string. +// +// Deprecated: use [conv.FormatFloat] instead. +func FormatFloat32(value float32) string { return conv.FormatFloat(value) } + +// FormatFloat64 turns a float64 into a string. +// +// Deprecated: use [conv.FormatFloat] instead. +func FormatFloat64(value float64) string { return conv.FormatFloat(value) } + +// FormatInt8 turns an int8 into a string. +// +// Deprecated: use [conv.FormatInteger] instead. +func FormatInt8(value int8) string { return conv.FormatInteger(value) } + +// FormatInt16 turns an int16 into a string. +// +// Deprecated: use [conv.FormatInteger] instead. +func FormatInt16(value int16) string { return conv.FormatInteger(value) } + +// FormatInt32 turns an int32 into a string +// +// Deprecated: use [conv.FormatInteger] instead. +func FormatInt32(value int32) string { return conv.FormatInteger(value) } + +// FormatInt64 turns an int64 into a string. +// +// Deprecated: use [conv.FormatInteger] instead. +func FormatInt64(value int64) string { return conv.FormatInteger(value) } + +// FormatUint8 turns an uint8 into a string. +// +// Deprecated: use [conv.FormatUinteger] instead. +func FormatUint8(value uint8) string { return conv.FormatUinteger(value) } + +// FormatUint16 turns an uint16 into a string. +// +// Deprecated: use [conv.FormatUinteger] instead. +func FormatUint16(value uint16) string { return conv.FormatUinteger(value) } + +// FormatUint32 turns an uint32 into a string. +// +// Deprecated: use [conv.FormatUinteger] instead. +func FormatUint32(value uint32) string { return conv.FormatUinteger(value) } + +// FormatUint64 turns an uint64 into a string. +// +// Deprecated: use [conv.FormatUinteger] instead. +func FormatUint64(value uint64) string { return conv.FormatUinteger(value) } + +// String turn a pointer to of the string value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func String(v string) *string { return conv.Pointer(v) } + +// StringValue turn the value of the string pointer passed in or +// "" if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func StringValue(v *string) string { return conv.Value(v) } + +// StringSlice converts a slice of string values into a slice of string pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func StringSlice(src []string) []*string { return conv.PointerSlice(src) } + +// StringValueSlice converts a slice of string pointers into a slice of string values. +// +// Deprecated: use [conv.ValueSlice] instead. +func StringValueSlice(src []*string) []string { return conv.ValueSlice(src) } + +// StringMap converts a string map of string values into a string map of string pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func StringMap(src map[string]string) map[string]*string { return conv.PointerMap(src) } + +// StringValueMap converts a string map of string pointers into a string map of string values. +// +// Deprecated: use [conv.ValueMap] instead. +func StringValueMap(src map[string]*string) map[string]string { return conv.ValueMap(src) } + +// Bool turn a pointer to of the bool value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Bool(v bool) *bool { return conv.Pointer(v) } + +// BoolValue turn the value of the bool pointer passed in or false if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func BoolValue(v *bool) bool { return conv.Value(v) } + +// BoolSlice converts a slice of bool values into a slice of bool pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func BoolSlice(src []bool) []*bool { return conv.PointerSlice(src) } + +// BoolValueSlice converts a slice of bool pointers into a slice of bool values. +// +// Deprecated: use [conv.ValueSlice] instead. +func BoolValueSlice(src []*bool) []bool { return conv.ValueSlice(src) } + +// BoolMap converts a string map of bool values into a string map of bool pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func BoolMap(src map[string]bool) map[string]*bool { return conv.PointerMap(src) } + +// BoolValueMap converts a string map of bool pointers into a string map of bool values. +// +// Deprecated: use [conv.ValueMap] instead. +func BoolValueMap(src map[string]*bool) map[string]bool { return conv.ValueMap(src) } + +// Int turn a pointer to of the int value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Int(v int) *int { return conv.Pointer(v) } + +// IntValue turn the value of the int pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func IntValue(v *int) int { return conv.Value(v) } + +// IntSlice converts a slice of int values into a slice of int pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func IntSlice(src []int) []*int { return conv.PointerSlice(src) } + +// IntValueSlice converts a slice of int pointers into a slice of int values. +// +// Deprecated: use [conv.ValueSlice] instead. +func IntValueSlice(src []*int) []int { return conv.ValueSlice(src) } + +// IntMap converts a string map of int values into a string map of int pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func IntMap(src map[string]int) map[string]*int { return conv.PointerMap(src) } + +// IntValueMap converts a string map of int pointers into a string map of int values. +// +// Deprecated: use [conv.ValueMap] instead. +func IntValueMap(src map[string]*int) map[string]int { return conv.ValueMap(src) } + +// Int32 turn a pointer to of the int32 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Int32(v int32) *int32 { return conv.Pointer(v) } + +// Int32Value turn the value of the int32 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Int32Value(v *int32) int32 { return conv.Value(v) } + +// Int32Slice converts a slice of int32 values into a slice of int32 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Int32Slice(src []int32) []*int32 { return conv.PointerSlice(src) } + +// Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Int32ValueSlice(src []*int32) []int32 { return conv.ValueSlice(src) } + +// Int32Map converts a string map of int32 values into a string map of int32 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Int32Map(src map[string]int32) map[string]*int32 { return conv.PointerMap(src) } + +// Int32ValueMap converts a string map of int32 pointers into a string map of int32 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Int32ValueMap(src map[string]*int32) map[string]int32 { return conv.ValueMap(src) } + +// Int64 turn a pointer to of the int64 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Int64(v int64) *int64 { return conv.Pointer(v) } + +// Int64Value turn the value of the int64 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Int64Value(v *int64) int64 { return conv.Value(v) } + +// Int64Slice converts a slice of int64 values into a slice of int64 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Int64Slice(src []int64) []*int64 { return conv.PointerSlice(src) } + +// Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Int64ValueSlice(src []*int64) []int64 { return conv.ValueSlice(src) } + +// Int64Map converts a string map of int64 values into a string map of int64 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Int64Map(src map[string]int64) map[string]*int64 { return conv.PointerMap(src) } + +// Int64ValueMap converts a string map of int64 pointers into a string map of int64 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Int64ValueMap(src map[string]*int64) map[string]int64 { return conv.ValueMap(src) } + +// Uint16 turn a pointer to of the uint16 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Uint16(v uint16) *uint16 { return conv.Pointer(v) } + +// Uint16Value turn the value of the uint16 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Uint16Value(v *uint16) uint16 { return conv.Value(v) } + +// Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Uint16Slice(src []uint16) []*uint16 { return conv.PointerSlice(src) } + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Uint16ValueSlice(src []*uint16) []uint16 { return conv.ValueSlice(src) } + +// Uint16Map converts a string map of uint16 values into a string map of uint16 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Uint16Map(src map[string]uint16) map[string]*uint16 { return conv.PointerMap(src) } + +// Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { return conv.ValueMap(src) } + +// Uint turn a pointer to of the uint value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Uint(v uint) *uint { return conv.Pointer(v) } + +// UintValue turn the value of the uint pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func UintValue(v *uint) uint { return conv.Value(v) } + +// UintSlice converts a slice of uint values into a slice of uint pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func UintSlice(src []uint) []*uint { return conv.PointerSlice(src) } + +// UintValueSlice converts a slice of uint pointers into a slice of uint values. +// +// Deprecated: use [conv.ValueSlice] instead. +func UintValueSlice(src []*uint) []uint { return conv.ValueSlice(src) } + +// UintMap converts a string map of uint values into a string map of uint pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func UintMap(src map[string]uint) map[string]*uint { return conv.PointerMap(src) } + +// UintValueMap converts a string map of uint pointers into a string map of uint values. +// +// Deprecated: use [conv.ValueMap] instead. +func UintValueMap(src map[string]*uint) map[string]uint { return conv.ValueMap(src) } + +// Uint32 turn a pointer to of the uint32 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Uint32(v uint32) *uint32 { return conv.Pointer(v) } + +// Uint32Value turn the value of the uint32 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Uint32Value(v *uint32) uint32 { return conv.Value(v) } + +// Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Uint32Slice(src []uint32) []*uint32 { return conv.PointerSlice(src) } + +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Uint32ValueSlice(src []*uint32) []uint32 { return conv.ValueSlice(src) } + +// Uint32Map converts a string map of uint32 values into a string map of uint32 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Uint32Map(src map[string]uint32) map[string]*uint32 { return conv.PointerMap(src) } + +// Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return conv.ValueMap(src) } + +// Uint64 turn a pointer to of the uint64 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Uint64(v uint64) *uint64 { return conv.Pointer(v) } + +// Uint64Value turn the value of the uint64 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Uint64Value(v *uint64) uint64 { return conv.Value(v) } + +// Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Uint64Slice(src []uint64) []*uint64 { return conv.PointerSlice(src) } + +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Uint64ValueSlice(src []*uint64) []uint64 { return conv.ValueSlice(src) } + +// Uint64Map converts a string map of uint64 values into a string map of uint64 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Uint64Map(src map[string]uint64) map[string]*uint64 { return conv.PointerMap(src) } + +// Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return conv.ValueMap(src) } + +// Float32 turn a pointer to of the float32 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Float32(v float32) *float32 { return conv.Pointer(v) } + +// Float32Value turn the value of the float32 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Float32Value(v *float32) float32 { return conv.Value(v) } + +// Float32Slice converts a slice of float32 values into a slice of float32 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Float32Slice(src []float32) []*float32 { return conv.PointerSlice(src) } + +// Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Float32ValueSlice(src []*float32) []float32 { return conv.ValueSlice(src) } + +// Float32Map converts a string map of float32 values into a string map of float32 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Float32Map(src map[string]float32) map[string]*float32 { return conv.PointerMap(src) } + +// Float32ValueMap converts a string map of float32 pointers into a string map of float32 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Float32ValueMap(src map[string]*float32) map[string]float32 { return conv.ValueMap(src) } + +// Float64 turn a pointer to of the float64 value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Float64(v float64) *float64 { return conv.Pointer(v) } + +// Float64Value turn the value of the float64 pointer passed in or 0 if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func Float64Value(v *float64) float64 { return conv.Value(v) } + +// Float64Slice converts a slice of float64 values into a slice of float64 pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func Float64Slice(src []float64) []*float64 { return conv.PointerSlice(src) } + +// Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values. +// +// Deprecated: use [conv.ValueSlice] instead. +func Float64ValueSlice(src []*float64) []float64 { return conv.ValueSlice(src) } + +// Float64Map converts a string map of float64 values into a string map of float64 pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func Float64Map(src map[string]float64) map[string]*float64 { return conv.PointerMap(src) } + +// Float64ValueMap converts a string map of float64 pointers into a string map of float64 values. +// +// Deprecated: use [conv.ValueMap] instead. +func Float64ValueMap(src map[string]*float64) map[string]float64 { return conv.ValueMap(src) } + +// Time turn a pointer to of the time.Time value passed in. +// +// Deprecated: use [conv.Pointer] instead. +func Time(v time.Time) *time.Time { return conv.Pointer(v) } + +// TimeValue turn the value of the time.Time pointer passed in or time.Time{} if the pointer is nil. +// +// Deprecated: use [conv.Value] instead. +func TimeValue(v *time.Time) time.Time { return conv.Value(v) } + +// TimeSlice converts a slice of time.Time values into a slice of time.Time pointers. +// +// Deprecated: use [conv.PointerSlice] instead. +func TimeSlice(src []time.Time) []*time.Time { return conv.PointerSlice(src) } + +// TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values +// +// Deprecated: use [conv.ValueSlice] instead. +func TimeValueSlice(src []*time.Time) []time.Time { return conv.ValueSlice(src) } + +// TimeMap converts a string map of time.Time values into a string map of time.Time pointers. +// +// Deprecated: use [conv.PointerMap] instead. +func TimeMap(src map[string]time.Time) map[string]*time.Time { return conv.PointerMap(src) } + +// TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values. +// +// Deprecated: use [conv.ValueMap] instead. +func TimeValueMap(src map[string]*time.Time) map[string]time.Time { return conv.ValueMap(src) } diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go deleted file mode 100644 index fc085aeb8..000000000 --- a/vendor/github.com/go-openapi/swag/convert.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "math" - "strconv" - "strings" -) - -// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER -const ( - maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1 - minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1 - epsilon float64 = 1e-9 -) - -// IsFloat64AJSONInteger allow for integers [-2^53, 2^53-1] inclusive -func IsFloat64AJSONInteger(f float64) bool { - if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat { - return false - } - fa := math.Abs(f) - g := float64(uint64(f)) - ga := math.Abs(g) - - diff := math.Abs(f - g) - - // more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases - switch { - case f == g: // best case - return true - case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case - return true - case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values - return diff < (epsilon * math.SmallestNonzeroFloat64) - } - // check the relative error - return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon -} - -var evaluatesAsTrue map[string]struct{} - -func init() { - evaluatesAsTrue = map[string]struct{}{ - "true": {}, - "1": {}, - "yes": {}, - "ok": {}, - "y": {}, - "on": {}, - "selected": {}, - "checked": {}, - "t": {}, - "enabled": {}, - } -} - -// ConvertBool turn a string into a boolean -func ConvertBool(str string) (bool, error) { - _, ok := evaluatesAsTrue[strings.ToLower(str)] - return ok, nil -} - -// ConvertFloat32 turn a string into a float32 -func ConvertFloat32(str string) (float32, error) { - f, err := strconv.ParseFloat(str, 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -// ConvertFloat64 turn a string into a float64 -func ConvertFloat64(str string) (float64, error) { - return strconv.ParseFloat(str, 64) -} - -// ConvertInt8 turn a string into an int8 -func ConvertInt8(str string) (int8, error) { - i, err := strconv.ParseInt(str, 10, 8) - if err != nil { - return 0, err - } - return int8(i), nil -} - -// ConvertInt16 turn a string into an int16 -func ConvertInt16(str string) (int16, error) { - i, err := strconv.ParseInt(str, 10, 16) - if err != nil { - return 0, err - } - return int16(i), nil -} - -// ConvertInt32 turn a string into an int32 -func ConvertInt32(str string) (int32, error) { - i, err := strconv.ParseInt(str, 10, 32) - if err != nil { - return 0, err - } - return int32(i), nil -} - -// ConvertInt64 turn a string into an int64 -func ConvertInt64(str string) (int64, error) { - return strconv.ParseInt(str, 10, 64) -} - -// ConvertUint8 turn a string into an uint8 -func ConvertUint8(str string) (uint8, error) { - i, err := strconv.ParseUint(str, 10, 8) - if err != nil { - return 0, err - } - return uint8(i), nil -} - -// ConvertUint16 turn a string into an uint16 -func ConvertUint16(str string) (uint16, error) { - i, err := strconv.ParseUint(str, 10, 16) - if err != nil { - return 0, err - } - return uint16(i), nil -} - -// ConvertUint32 turn a string into an uint32 -func ConvertUint32(str string) (uint32, error) { - i, err := strconv.ParseUint(str, 10, 32) - if err != nil { - return 0, err - } - return uint32(i), nil -} - -// ConvertUint64 turn a string into an uint64 -func ConvertUint64(str string) (uint64, error) { - return strconv.ParseUint(str, 10, 64) -} - -// FormatBool turns a boolean into a string -func FormatBool(value bool) string { - return strconv.FormatBool(value) -} - -// FormatFloat32 turns a float32 into a string -func FormatFloat32(value float32) string { - return strconv.FormatFloat(float64(value), 'f', -1, 32) -} - -// FormatFloat64 turns a float64 into a string -func FormatFloat64(value float64) string { - return strconv.FormatFloat(value, 'f', -1, 64) -} - -// FormatInt8 turns an int8 into a string -func FormatInt8(value int8) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt16 turns an int16 into a string -func FormatInt16(value int16) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt32 turns an int32 into a string -func FormatInt32(value int32) string { - return strconv.Itoa(int(value)) -} - -// FormatInt64 turns an int64 into a string -func FormatInt64(value int64) string { - return strconv.FormatInt(value, 10) -} - -// FormatUint8 turns an uint8 into a string -func FormatUint8(value uint8) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint16 turns an uint16 into a string -func FormatUint16(value uint16) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint32 turns an uint32 into a string -func FormatUint32(value uint32) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint64 turns an uint64 into a string -func FormatUint64(value uint64) string { - return strconv.FormatUint(value, 10) -} diff --git a/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go deleted file mode 100644 index c49cc473a..000000000 --- a/vendor/github.com/go-openapi/swag/convert_types.go +++ /dev/null @@ -1,730 +0,0 @@ -package swag - -import "time" - -// This file was taken from the aws go sdk - -// String returns a pointer to of the string value passed in. -func String(v string) *string { - return &v -} - -// StringValue returns the value of the string pointer passed in or -// "" if the pointer is nil. -func StringValue(v *string) string { - if v != nil { - return *v - } - return "" -} - -// StringSlice converts a slice of string values into a slice of -// string pointers -func StringSlice(src []string) []*string { - dst := make([]*string, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// StringValueSlice converts a slice of string pointers into a slice of -// string values -func StringValueSlice(src []*string) []string { - dst := make([]string, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// StringMap converts a string map of string values into a string -// map of string pointers -func StringMap(src map[string]string) map[string]*string { - dst := make(map[string]*string) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// StringValueMap converts a string map of string pointers into a string -// map of string values -func StringValueMap(src map[string]*string) map[string]string { - dst := make(map[string]string) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Bool returns a pointer to of the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolValue returns the value of the bool pointer passed in or -// false if the pointer is nil. -func BoolValue(v *bool) bool { - if v != nil { - return *v - } - return false -} - -// BoolSlice converts a slice of bool values into a slice of -// bool pointers -func BoolSlice(src []bool) []*bool { - dst := make([]*bool, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// BoolValueSlice converts a slice of bool pointers into a slice of -// bool values -func BoolValueSlice(src []*bool) []bool { - dst := make([]bool, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// BoolMap converts a string map of bool values into a string -// map of bool pointers -func BoolMap(src map[string]bool) map[string]*bool { - dst := make(map[string]*bool) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// BoolValueMap converts a string map of bool pointers into a string -// map of bool values -func BoolValueMap(src map[string]*bool) map[string]bool { - dst := make(map[string]bool) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int returns a pointer to of the int value passed in. -func Int(v int) *int { - return &v -} - -// IntValue returns the value of the int pointer passed in or -// 0 if the pointer is nil. -func IntValue(v *int) int { - if v != nil { - return *v - } - return 0 -} - -// IntSlice converts a slice of int values into a slice of -// int pointers -func IntSlice(src []int) []*int { - dst := make([]*int, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// IntValueSlice converts a slice of int pointers into a slice of -// int values -func IntValueSlice(src []*int) []int { - dst := make([]int, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// IntMap converts a string map of int values into a string -// map of int pointers -func IntMap(src map[string]int) map[string]*int { - dst := make(map[string]*int) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// IntValueMap converts a string map of int pointers into a string -// map of int values -func IntValueMap(src map[string]*int) map[string]int { - dst := make(map[string]int) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int32 returns a pointer to of the int32 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int32 pointer passed in or -// 0 if the pointer is nil. -func Int32Value(v *int32) int32 { - if v != nil { - return *v - } - return 0 -} - -// Int32Slice converts a slice of int32 values into a slice of -// int32 pointers -func Int32Slice(src []int32) []*int32 { - dst := make([]*int32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int32ValueSlice converts a slice of int32 pointers into a slice of -// int32 values -func Int32ValueSlice(src []*int32) []int32 { - dst := make([]int32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int32Map converts a string map of int32 values into a string -// map of int32 pointers -func Int32Map(src map[string]int32) map[string]*int32 { - dst := make(map[string]*int32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int32ValueMap converts a string map of int32 pointers into a string -// map of int32 values -func Int32ValueMap(src map[string]*int32) map[string]int32 { - dst := make(map[string]int32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int64 returns a pointer to of the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int64Value(v *int64) int64 { - if v != nil { - return *v - } - return 0 -} - -// Int64Slice converts a slice of int64 values into a slice of -// int64 pointers -func Int64Slice(src []int64) []*int64 { - dst := make([]*int64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int64ValueSlice converts a slice of int64 pointers into a slice of -// int64 values -func Int64ValueSlice(src []*int64) []int64 { - dst := make([]int64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int64Map converts a string map of int64 values into a string -// map of int64 pointers -func Int64Map(src map[string]int64) map[string]*int64 { - dst := make(map[string]*int64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int64ValueMap converts a string map of int64 pointers into a string -// map of int64 values -func Int64ValueMap(src map[string]*int64) map[string]int64 { - dst := make(map[string]int64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint16 returns a pointer to of the uint16 value passed in. -func Uint16(v uint16) *uint16 { - return &v -} - -// Uint16Value returns the value of the uint16 pointer passed in or -// 0 if the pointer is nil. -func Uint16Value(v *uint16) uint16 { - if v != nil { - return *v - } - - return 0 -} - -// Uint16Slice converts a slice of uint16 values into a slice of -// uint16 pointers -func Uint16Slice(src []uint16) []*uint16 { - dst := make([]*uint16, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - - return dst -} - -// Uint16ValueSlice converts a slice of uint16 pointers into a slice of -// uint16 values -func Uint16ValueSlice(src []*uint16) []uint16 { - dst := make([]uint16, len(src)) - - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - - return dst -} - -// Uint16Map converts a string map of uint16 values into a string -// map of uint16 pointers -func Uint16Map(src map[string]uint16) map[string]*uint16 { - dst := make(map[string]*uint16) - - for k, val := range src { - v := val - dst[k] = &v - } - - return dst -} - -// Uint16ValueMap converts a string map of uint16 pointers into a string -// map of uint16 values -func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { - dst := make(map[string]uint16) - - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - - return dst -} - -// Uint returns a pointer to of the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pointer passed in or -// 0 if the pointer is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values into a slice of -// uint pointers -func UintSlice(src []uint) []*uint { - dst := make([]*uint, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// UintValueSlice converts a slice of uint pointers into a slice of -// uint values -func UintValueSlice(src []*uint) []uint { - dst := make([]uint, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// UintMap converts a string map of uint values into a string -// map of uint pointers -func UintMap(src map[string]uint) map[string]*uint { - dst := make(map[string]*uint) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// UintValueMap converts a string map of uint pointers into a string -// map of uint values -func UintValueMap(src map[string]*uint) map[string]uint { - dst := make(map[string]uint) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint32 returns a pointer to of the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint32 pointer passed in or -// 0 if the pointer is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint32 values into a slice of -// uint32 pointers -func Uint32Slice(src []uint32) []*uint32 { - dst := make([]*uint32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint32ValueSlice converts a slice of uint32 pointers into a slice of -// uint32 values -func Uint32ValueSlice(src []*uint32) []uint32 { - dst := make([]uint32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint32Map converts a string map of uint32 values into a string -// map of uint32 pointers -func Uint32Map(src map[string]uint32) map[string]*uint32 { - dst := make(map[string]*uint32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint32ValueMap converts a string map of uint32 pointers into a string -// map of uint32 values -func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { - dst := make(map[string]uint32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint64 returns a pointer to of the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pointer passed in or -// 0 if the pointer is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values into a slice of -// uint64 pointers -func Uint64Slice(src []uint64) []*uint64 { - dst := make([]*uint64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint64ValueSlice converts a slice of uint64 pointers into a slice of -// uint64 values -func Uint64ValueSlice(src []*uint64) []uint64 { - dst := make([]uint64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint64Map converts a string map of uint64 values into a string -// map of uint64 pointers -func Uint64Map(src map[string]uint64) map[string]*uint64 { - dst := make(map[string]*uint64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint64ValueMap converts a string map of uint64 pointers into a string -// map of uint64 values -func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { - dst := make(map[string]uint64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float32 returns a pointer to of the float32 value passed in. -func Float32(v float32) *float32 { - return &v -} - -// Float32Value returns the value of the float32 pointer passed in or -// 0 if the pointer is nil. -func Float32Value(v *float32) float32 { - if v != nil { - return *v - } - - return 0 -} - -// Float32Slice converts a slice of float32 values into a slice of -// float32 pointers -func Float32Slice(src []float32) []*float32 { - dst := make([]*float32, len(src)) - - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - - return dst -} - -// Float32ValueSlice converts a slice of float32 pointers into a slice of -// float32 values -func Float32ValueSlice(src []*float32) []float32 { - dst := make([]float32, len(src)) - - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - - return dst -} - -// Float32Map converts a string map of float32 values into a string -// map of float32 pointers -func Float32Map(src map[string]float32) map[string]*float32 { - dst := make(map[string]*float32) - - for k, val := range src { - v := val - dst[k] = &v - } - - return dst -} - -// Float32ValueMap converts a string map of float32 pointers into a string -// map of float32 values -func Float32ValueMap(src map[string]*float32) map[string]float32 { - dst := make(map[string]float32) - - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - - return dst -} - -// Float64 returns a pointer to of the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Value returns the value of the float64 pointer passed in or -// 0 if the pointer is nil. -func Float64Value(v *float64) float64 { - if v != nil { - return *v - } - return 0 -} - -// Float64Slice converts a slice of float64 values into a slice of -// float64 pointers -func Float64Slice(src []float64) []*float64 { - dst := make([]*float64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float64ValueSlice converts a slice of float64 pointers into a slice of -// float64 values -func Float64ValueSlice(src []*float64) []float64 { - dst := make([]float64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float64Map converts a string map of float64 values into a string -// map of float64 pointers -func Float64Map(src map[string]float64) map[string]*float64 { - dst := make(map[string]*float64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float64ValueMap converts a string map of float64 pointers into a string -// map of float64 values -func Float64ValueMap(src map[string]*float64) map[string]float64 { - dst := make(map[string]float64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Time returns a pointer to of the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeValue returns the value of the time.Time pointer passed in or -// time.Time{} if the pointer is nil. -func TimeValue(v *time.Time) time.Time { - if v != nil { - return *v - } - return time.Time{} -} - -// TimeSlice converts a slice of time.Time values into a slice of -// time.Time pointers -func TimeSlice(src []time.Time) []*time.Time { - dst := make([]*time.Time, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// TimeValueSlice converts a slice of time.Time pointers into a slice of -// time.Time values -func TimeValueSlice(src []*time.Time) []time.Time { - dst := make([]time.Time, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// TimeMap converts a string map of time.Time values into a string -// map of time.Time pointers -func TimeMap(src map[string]time.Time) map[string]*time.Time { - dst := make(map[string]*time.Time) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// TimeValueMap converts a string map of time.Time pointers into a string -// map of time.Time values -func TimeValueMap(src map[string]*time.Time) map[string]time.Time { - dst := make(map[string]time.Time) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go index 55094cb74..b54b57478 100644 --- a/vendor/github.com/go-openapi/swag/doc.go +++ b/vendor/github.com/go-openapi/swag/doc.go @@ -1,31 +1,47 @@ -// Copyright 2015 go-swagger maintainers +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package swag contains a bunch of helper functions for go-openapi and go-swagger projects. // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// You may also use it standalone for your projects. // -// http://www.apache.org/licenses/LICENSE-2.0 +// NOTE: all features that used to be exposed as package-level members (constants, variables, +// functions and types) are now deprecated and are superseded by equivalent features in +// more specialized sub-packages. +// Moving forward, no additional feature will be added to the [swag] API directly at the root package level, +// which remains there for backward-compatibility purposes. // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package swag contains a bunch of helper functions for go-openapi and go-swagger projects. - -You may also use it standalone for your projects. - - - convert between value and pointers for builtin types - - convert from string to builtin types (wraps strconv) - - fast json concatenation - - search in path - - load from file or http - - name mangling - -This repo has only few dependencies outside of the standard library: - - - YAML utilities depend on gopkg.in/yaml.v2 -*/ +// Child modules will continue to evolve or some new ones may be added in the future. +// +// # Modules +// +// - [cmdutils] utilities to work with CLIs +// +// - [conv] type conversion utilities +// +// - [fileutils] file utilities +// +// - [jsonname] JSON utilities +// +// - [jsonutils] JSON utilities +// +// - [loading] file loading +// +// - [mangling] safe name generation +// +// - [netutils] networking utilities +// +// - [stringutils] `string` utilities +// +// - [typeutils] `go` types utilities +// +// - [yamlutils] YAML utilities +// +// # Dependencies +// +// This repo has a few dependencies outside of the standard library: +// +// - YAML utilities depend on [go.yaml.in/yaml/v3] package swag + +//go:generate mockery diff --git a/vendor/github.com/go-openapi/swag/file.go b/vendor/github.com/go-openapi/swag/file.go deleted file mode 100644 index 16accc55f..000000000 --- a/vendor/github.com/go-openapi/swag/file.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import "mime/multipart" - -// File represents an uploaded file. -type File struct { - Data multipart.File - Header *multipart.FileHeader -} - -// Read bytes from the file -func (f *File) Read(p []byte) (n int, err error) { - return f.Data.Read(p) -} - -// Close the file -func (f *File) Close() error { - return f.Data.Close() -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE b/vendor/github.com/go-openapi/swag/fileutils/LICENSE similarity index 100% rename from vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE rename to vendor/github.com/go-openapi/swag/fileutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/fileutils/doc.go b/vendor/github.com/go-openapi/swag/fileutils/doc.go new file mode 100644 index 000000000..859a200d8 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/fileutils/doc.go @@ -0,0 +1,10 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package fileutils exposes utilities to deal with files and paths. +// +// Currently, there is: +// - [File] to represent an abstraction of an uploaded file. +// For instance, this is used by [github.com/go-openapi/runtime.File]. +// - path search utilities (e.g. finding packages in the GO search path) +package fileutils diff --git a/vendor/github.com/go-openapi/swag/fileutils/file.go b/vendor/github.com/go-openapi/swag/fileutils/file.go new file mode 100644 index 000000000..5ad4cfaea --- /dev/null +++ b/vendor/github.com/go-openapi/swag/fileutils/file.go @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package fileutils + +import "mime/multipart" + +// File represents an uploaded file. +type File struct { + Data multipart.File + Header *multipart.FileHeader +} + +// Read bytes from the file +func (f *File) Read(p []byte) (n int, err error) { + return f.Data.Read(p) +} + +// Close the file +func (f *File) Close() error { + return f.Data.Close() +} diff --git a/vendor/github.com/go-openapi/swag/path.go b/vendor/github.com/go-openapi/swag/fileutils/path.go similarity index 58% rename from vendor/github.com/go-openapi/swag/path.go rename to vendor/github.com/go-openapi/swag/fileutils/path.go index 941bd0176..dd09f690b 100644 --- a/vendor/github.com/go-openapi/swag/path.go +++ b/vendor/github.com/go-openapi/swag/fileutils/path.go @@ -1,18 +1,7 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 -package swag +package fileutils import ( "os" @@ -21,10 +10,8 @@ import ( "strings" ) -const ( - // GOPATHKey represents the env key for gopath - GOPATHKey = "GOPATH" -) +// GOPATHKey represents the env key for gopath +const GOPATHKey = "GOPATH" // FindInSearchPath finds a package in a provided lists of paths func FindInSearchPath(searchPath, pkg string) string { @@ -40,11 +27,17 @@ func FindInSearchPath(searchPath, pkg string) string { } // FindInGoSearchPath finds a package in the $GOPATH:$GOROOT +// +// Deprecated: this function is no longer relevant with modern go. +// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24. func FindInGoSearchPath(pkg string) string { return FindInSearchPath(FullGoSearchPath(), pkg) } // FullGoSearchPath gets the search paths for finding packages +// +// Deprecated: this function is no longer relevant with modern go. +// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24. func FullGoSearchPath() string { allPaths := os.Getenv(GOPATHKey) if allPaths == "" { diff --git a/vendor/github.com/go-openapi/swag/fileutils_iface.go b/vendor/github.com/go-openapi/swag/fileutils_iface.go new file mode 100644 index 000000000..f3e79a0e4 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/fileutils_iface.go @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/fileutils" + +// GOPATHKey represents the env key for gopath +// +// Deprecated: use [fileutils.GOPATHKey] instead. +const GOPATHKey = fileutils.GOPATHKey + +// File represents an uploaded file. +// +// Deprecated: use [fileutils.File] instead. +type File = fileutils.File + +// FindInSearchPath finds a package in a provided lists of paths. +// +// Deprecated: use [fileutils.FindInSearchPath] instead. +func FindInSearchPath(searchPath, pkg string) string { + return fileutils.FindInSearchPath(searchPath, pkg) +} + +// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT +// +// Deprecated: use [fileutils.FindInGoSearchPath] instead. +func FindInGoSearchPath(pkg string) string { return fileutils.FindInGoSearchPath(pkg) } + +// FullGoSearchPath gets the search paths for finding packages +// +// Deprecated: use [fileutils.FullGoSearchPath] instead. +func FullGoSearchPath() string { return fileutils.FullGoSearchPath() } diff --git a/vendor/github.com/go-openapi/swag/initialism_index.go b/vendor/github.com/go-openapi/swag/initialism_index.go deleted file mode 100644 index 20a359bb6..000000000 --- a/vendor/github.com/go-openapi/swag/initialism_index.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "sort" - "strings" - "sync" -) - -var ( - // commonInitialisms are common acronyms that are kept as whole uppercased words. - commonInitialisms *indexOfInitialisms - - // initialisms is a slice of sorted initialisms - initialisms []string - - // a copy of initialisms pre-baked as []rune - initialismsRunes [][]rune - initialismsUpperCased [][]rune - - isInitialism func(string) bool - - maxAllocMatches int -) - -func init() { - // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769 - configuredInitialisms := map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTPS": true, - "HTTP": true, - "ID": true, - "IP": true, - "IPv4": true, - "IPv6": true, - "JSON": true, - "LHS": true, - "OAI": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, - } - - // a thread-safe index of initialisms - commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms) - initialisms = commonInitialisms.sorted() - initialismsRunes = asRunes(initialisms) - initialismsUpperCased = asUpperCased(initialisms) - maxAllocMatches = maxAllocHeuristic(initialismsRunes) - - // a test function - isInitialism = commonInitialisms.isInitialism -} - -func asRunes(in []string) [][]rune { - out := make([][]rune, len(in)) - for i, initialism := range in { - out[i] = []rune(initialism) - } - - return out -} - -func asUpperCased(in []string) [][]rune { - out := make([][]rune, len(in)) - - for i, initialism := range in { - out[i] = []rune(upper(trim(initialism))) - } - - return out -} - -func maxAllocHeuristic(in [][]rune) int { - heuristic := make(map[rune]int) - for _, initialism := range in { - heuristic[initialism[0]]++ - } - - var maxAlloc int - for _, val := range heuristic { - if val > maxAlloc { - maxAlloc = val - } - } - - return maxAlloc -} - -// AddInitialisms add additional initialisms -func AddInitialisms(words ...string) { - for _, word := range words { - // commonInitialisms[upper(word)] = true - commonInitialisms.add(upper(word)) - } - // sort again - initialisms = commonInitialisms.sorted() - initialismsRunes = asRunes(initialisms) - initialismsUpperCased = asUpperCased(initialisms) -} - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Since go1.9, this may be implemented with sync.Map. -type indexOfInitialisms struct { - sortMutex *sync.Mutex - index *sync.Map -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - sortMutex: new(sync.Mutex), - index: new(sync.Map), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - for k, v := range initial { - m.index.Store(k, v) - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - _, ok := m.index.Load(key) - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.index.Store(key, true) - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - m.index.Range(func(key, _ interface{}) bool { - k := key.(string) - result = append(result, k) - return true - }) - sort.Sort(sort.Reverse(byInitialism(result))) - return -} - -type byInitialism []string - -func (s byInitialism) Len() int { - return len(s) -} -func (s byInitialism) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s byInitialism) Less(i, j int) bool { - if len(s[i]) != len(s[j]) { - return len(s[i]) < len(s[j]) - } - - return strings.Compare(s[i], s[j]) > 0 -} diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go deleted file mode 100644 index 7e9902ca3..000000000 --- a/vendor/github.com/go-openapi/swag/json.go +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "bytes" - "encoding/json" - "log" - "reflect" - "strings" - "sync" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// nullJSON represents a JSON object with null type -var nullJSON = []byte("null") - -// DefaultJSONNameProvider the default cache for types -var DefaultJSONNameProvider = NewNameProvider() - -const comma = byte(',') - -var closers map[byte]byte - -func init() { - closers = map[byte]byte{ - '{': '}', - '[': ']', - } -} - -type ejMarshaler interface { - MarshalEasyJSON(w *jwriter.Writer) -} - -type ejUnmarshaler interface { - UnmarshalEasyJSON(w *jlexer.Lexer) -} - -// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler -// so it takes the fastest option available. -func WriteJSON(data interface{}) ([]byte, error) { - if d, ok := data.(ejMarshaler); ok { - jw := new(jwriter.Writer) - d.MarshalEasyJSON(jw) - return jw.BuildBytes() - } - if d, ok := data.(json.Marshaler); ok { - return d.MarshalJSON() - } - return json.Marshal(data) -} - -// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler -// so it takes the fastest option available -func ReadJSON(data []byte, value interface{}) error { - trimmedData := bytes.Trim(data, "\x00") - if d, ok := value.(ejUnmarshaler); ok { - jl := &jlexer.Lexer{Data: trimmedData} - d.UnmarshalEasyJSON(jl) - return jl.Error() - } - if d, ok := value.(json.Unmarshaler); ok { - return d.UnmarshalJSON(trimmedData) - } - return json.Unmarshal(trimmedData, value) -} - -// DynamicJSONToStruct converts an untyped json structure into a struct -func DynamicJSONToStruct(data interface{}, target interface{}) error { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := WriteJSON(data) - if err != nil { - return err - } - return ReadJSON(b, target) -} - -// ConcatJSON concatenates multiple json objects efficiently -func ConcatJSON(blobs ...[]byte) []byte { - if len(blobs) == 0 { - return nil - } - - last := len(blobs) - 1 - for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) { - // strips trailing null objects - last-- - if last < 0 { - // there was nothing but "null"s or nil... - return nil - } - } - if last == 0 { - return blobs[0] - } - - var opening, closing byte - var idx, a int - buf := bytes.NewBuffer(nil) - - for i, b := range blobs[:last+1] { - if b == nil || bytes.Equal(b, nullJSON) { - // a null object is in the list: skip it - continue - } - if len(b) > 0 && opening == 0 { // is this an array or an object? - opening, closing = b[0], closers[b[0]] - } - - if opening != '{' && opening != '[' { - continue // don't know how to concatenate non container objects - } - - if len(b) < 3 { // yep empty but also the last one, so closing this thing - if i == last && a > 0 { - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - continue - } - - idx = 0 - if a > 0 { // we need to join with a comma for everything beyond the first non-empty item - if err := buf.WriteByte(comma); err != nil { - log.Println(err) - } - idx = 1 // this is not the first or the last so we want to drop the leading bracket - } - - if i != last { // not the last one, strip brackets - if _, err := buf.Write(b[idx : len(b)-1]); err != nil { - log.Println(err) - } - } else { // last one, strip only the leading bracket - if _, err := buf.Write(b[idx:]); err != nil { - log.Println(err) - } - } - a++ - } - // somehow it ended up being empty, so provide a default value - if buf.Len() == 0 { - if err := buf.WriteByte(opening); err != nil { - log.Println(err) - } - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - return buf.Bytes() -} - -// ToDynamicJSON turns an object into a properly JSON typed structure -func ToDynamicJSON(data interface{}) interface{} { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - var res interface{} - if err := json.Unmarshal(b, &res); err != nil { - log.Println(err) - } - return res -} - -// FromDynamicJSON turns an object into a properly JSON typed structure -func FromDynamicJSON(data, target interface{}) error { - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - return json.Unmarshal(b, target) -} - -// NameProvider represents an object capable of translating from go property names -// to json property names -// This type is thread-safe. -type NameProvider struct { - lock *sync.Mutex - index map[reflect.Type]nameIndex -} - -type nameIndex struct { - jsonNames map[string]string - goNames map[string]string -} - -// NewNameProvider creates a new name provider -func NewNameProvider() *NameProvider { - return &NameProvider{ - lock: &sync.Mutex{}, - index: make(map[reflect.Type]nameIndex), - } -} - -func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { - for i := 0; i < tpe.NumField(); i++ { - targetDes := tpe.Field(i) - - if targetDes.PkgPath != "" { // unexported - continue - } - - if targetDes.Anonymous { // walk embedded structures tree down first - buildnameIndex(targetDes.Type, idx, reverseIdx) - continue - } - - if tag := targetDes.Tag.Get("json"); tag != "" { - - parts := strings.Split(tag, ",") - if len(parts) == 0 { - continue - } - - nm := parts[0] - if nm == "-" { - continue - } - if nm == "" { // empty string means we want to use the Go name - nm = targetDes.Name - } - - idx[nm] = targetDes.Name - reverseIdx[targetDes.Name] = nm - } - } -} - -func newNameIndex(tpe reflect.Type) nameIndex { - var idx = make(map[string]string, tpe.NumField()) - var reverseIdx = make(map[string]string, tpe.NumField()) - - buildnameIndex(tpe, idx, reverseIdx) - return nameIndex{jsonNames: idx, goNames: reverseIdx} -} - -// GetJSONNames gets all the json property names for a type -func (n *NameProvider) GetJSONNames(subject interface{}) []string { - n.lock.Lock() - defer n.lock.Unlock() - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - - res := make([]string, 0, len(names.jsonNames)) - for k := range names.jsonNames { - res = append(res, k) - } - return res -} - -// GetJSONName gets the json name for a go property name -func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetJSONNameForType(tpe, name) -} - -// GetJSONNameForType gets the json name for a go property name on a given type -func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.goNames[name] - return nme, ok -} - -func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex { - names := newNameIndex(tpe) - n.index[tpe] = names - return names -} - -// GetGoName gets the go name for a json property name -func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetGoNameForType(tpe, name) -} - -// GetGoNameForType gets the go name for a given type for a json property name -func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.jsonNames[name] - return nme, ok -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/LICENSE b/vendor/github.com/go-openapi/swag/jsonname/LICENSE similarity index 100% rename from vendor/google.golang.org/genproto/googleapis/api/LICENSE rename to vendor/github.com/go-openapi/swag/jsonname/LICENSE diff --git a/vendor/github.com/go-openapi/swag/jsonname/doc.go b/vendor/github.com/go-openapi/swag/jsonname/doc.go new file mode 100644 index 000000000..79232eaca --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonname/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package jsonname is a provider of json property names from go properties. +package jsonname diff --git a/vendor/github.com/go-openapi/swag/jsonname/name_provider.go b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go new file mode 100644 index 000000000..8eaf1bece --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonname + +import ( + "reflect" + "strings" + "sync" +) + +// DefaultJSONNameProvider is the default cache for types. +var DefaultJSONNameProvider = NewNameProvider() + +// NameProvider represents an object capable of translating from go property names +// to json property names. +// +// This type is thread-safe. +// +// See [github.com/go-openapi/jsonpointer.Pointer] for an example. +type NameProvider struct { + lock *sync.Mutex + index map[reflect.Type]nameIndex +} + +type nameIndex struct { + jsonNames map[string]string + goNames map[string]string +} + +// NewNameProvider creates a new name provider +func NewNameProvider() *NameProvider { + return &NameProvider{ + lock: &sync.Mutex{}, + index: make(map[reflect.Type]nameIndex), + } +} + +func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { + for i := 0; i < tpe.NumField(); i++ { + targetDes := tpe.Field(i) + + if targetDes.PkgPath != "" { // unexported + continue + } + + if targetDes.Anonymous { // walk embedded structures tree down first + buildnameIndex(targetDes.Type, idx, reverseIdx) + continue + } + + if tag := targetDes.Tag.Get("json"); tag != "" { + + parts := strings.Split(tag, ",") + if len(parts) == 0 { + continue + } + + nm := parts[0] + if nm == "-" { + continue + } + if nm == "" { // empty string means we want to use the Go name + nm = targetDes.Name + } + + idx[nm] = targetDes.Name + reverseIdx[targetDes.Name] = nm + } + } +} + +func newNameIndex(tpe reflect.Type) nameIndex { + var idx = make(map[string]string, tpe.NumField()) + var reverseIdx = make(map[string]string, tpe.NumField()) + + buildnameIndex(tpe, idx, reverseIdx) + return nameIndex{jsonNames: idx, goNames: reverseIdx} +} + +// GetJSONNames gets all the json property names for a type +func (n *NameProvider) GetJSONNames(subject any) []string { + n.lock.Lock() + defer n.lock.Unlock() + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + names, ok := n.index[tpe] + if !ok { + names = n.makeNameIndex(tpe) + } + + res := make([]string, 0, len(names.jsonNames)) + for k := range names.jsonNames { + res = append(res, k) + } + return res +} + +// GetJSONName gets the json name for a go property name +func (n *NameProvider) GetJSONName(subject any, name string) (string, bool) { + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + return n.GetJSONNameForType(tpe, name) +} + +// GetJSONNameForType gets the json name for a go property name on a given type +func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { + n.lock.Lock() + defer n.lock.Unlock() + names, ok := n.index[tpe] + if !ok { + names = n.makeNameIndex(tpe) + } + nme, ok := names.goNames[name] + return nme, ok +} + +// GetGoName gets the go name for a json property name +func (n *NameProvider) GetGoName(subject any, name string) (string, bool) { + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + return n.GetGoNameForType(tpe, name) +} + +// GetGoNameForType gets the go name for a given type for a json property name +func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { + n.lock.Lock() + defer n.lock.Unlock() + names, ok := n.index[tpe] + if !ok { + names = n.makeNameIndex(tpe) + } + nme, ok := names.jsonNames[name] + return nme, ok +} + +func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex { + names := newNameIndex(tpe) + n.index[tpe] = names + return names +} diff --git a/vendor/github.com/go-openapi/swag/jsonname_iface.go b/vendor/github.com/go-openapi/swag/jsonname_iface.go new file mode 100644 index 000000000..303a007f6 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonname_iface.go @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import ( + "github.com/go-openapi/swag/jsonname" +) + +// DefaultJSONNameProvider is the default cache for types +// +// Deprecated: use [jsonname.DefaultJSONNameProvider] instead. +var DefaultJSONNameProvider = jsonname.DefaultJSONNameProvider + +// NameProvider represents an object capable of translating from go property names +// to json property names. +// +// Deprecated: use [jsonname.NameProvider] instead. +type NameProvider = jsonname.NameProvider + +// NewNameProvider creates a new name provider +// +// Deprecated: use [jsonname.NewNameProvider] instead. +func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() } diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE b/vendor/github.com/go-openapi/swag/jsonutils/LICENSE similarity index 100% rename from vendor/google.golang.org/genproto/googleapis/rpc/LICENSE rename to vendor/github.com/go-openapi/swag/jsonutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/jsonutils/README.md b/vendor/github.com/go-openapi/swag/jsonutils/README.md new file mode 100644 index 000000000..d745cdb46 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/README.md @@ -0,0 +1,108 @@ + # jsonutils + +`jsonutils` exposes a few tools to work with JSON: + +- a fast, simple `Concat` to concatenate (not merge) JSON objects and arrays +- `FromDynamicJSON` to convert a data structure into a "dynamic JSON" data structure +- `ReadJSON` and `WriteJSON` behave like `json.Unmarshal` and `json.Marshal`, + with the ability to use another underlying serialization library through an `Adapter` + configured at runtime +- a `JSONMapSlice` structure that may be used to store JSON objects with the order of keys maintained + +## Dynamic JSON + +We call "dynamic JSON" the go data structure that results from unmarshaling JSON like this: + +```go + var value any + jsonBytes := `{"a": 1, ... }` + _ = json.Unmarshal(jsonBytes, &value) +``` + +In this configuration, the standard library mappings are as follows: + +| JSON | go | +|-----------|------------------| +| `number` | `float64` | +| `string` | `string` | +| `boolean` | `bool` | +| `null` | `nil` | +| `object` | `map[string]any` | +| `array` | `[]any` | + +## Map slices + +When using `JSONMapSlice`, the ordering of keys is ensured by replacing +mappings to `map[string]any` by a `JSONMapSlice` which is an (ordered) +slice of `JSONMapItem`s. + +Notice that a similar feature is available for YAML (see [`yamlutils`](../yamlutils)), +with a `YAMLMapSlice` type based on the `JSONMapSlice`. + +`JSONMapSlice` is similar to an ordered map, but the keys are not retrieved +in constant time. + +Another difference with the the above standard mappings is that numbers don't always map +to a `float64`: if the value is a JSON integer, it unmarshals to `int64`. + +See also [some examples](https://pkg.go.dev/github.com/go-openapi/swag/jsonutils#pkg-examples) + +## Adapters + +`ReadJSON`, `WriteJSON` and `FromDynamicJSON` (which is a combination of the latter two) +are wrappers on top of `json.Unmarshal` and `json.Marshal`. + +By default, the adapter merely wraps the standard library. + +The adapter may be used to register other JSON serialization libraries, +possibly several ones at the same time. + +If the value passed is identified as an "ordered map" (i.e. implements `ifaces.Ordered` +or `ifaces.SetOrdered`, the adapter favors the "ordered" JSON behavior and tries to +find a registered implementation that support ordered keys in objects. + +Our standard library implementation supports this. + +As of `v0.25.0`, we support through such an adapter the popular `mailru/easyjson` +library, which kicks in when the passed values support the `easyjson.Unmarshaler` +or `easyjson.Marshaler` interfaces. + +In the future, we plan to add more similar libraries that compete on the go JSON +serializers scene. + +## Registering an adapter + +In package `github.com/go-openapi/swag/easyjson/adapters`, several adapters are available. + +Each adapter is an independent go module. Hence you'll pick its dependencies only if you import it. + +At this moment we provide: +* `stdlib`: JSON adapter based on the standard library +* `easyjson`: JSON adapter based on the `github.com/mailru/easyjson` + +The adapters provide the basic `Marshal` and `Unmarshal` capabilities, plus an implementation +of the `MapSlice` pattern. + +You may also build your own adapter based on your specific use-case. An adapter is not required to implement +all capabilities. + +Every adapter comes with a `Register` function, possibly with some options, to register the adapter +to a global registry. + +For example, to enable `easyjson` to be used in `ReadJSON` and `WriteJSON`, you would write something like: + +```go + import ( + "github.com/go-openapi/swag/jsonutils/adapters" + easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json" + ) + + func init() { + easyjson.Register(adapters.Registry) + } +``` + +You may register several adapters. In this case, capability matching is evaluated from the last registered +adapters (LIFO). + +## [Benchmarks](./adapters/testintegration/benchmarks/README.md) diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go new file mode 100644 index 000000000..76d3898fc --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package adapters exposes a registry of adapters to multiple +// JSON serialization libraries. +// +// All interfaces are defined in package [ifaces.Adapter]. +package adapters diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go new file mode 100644 index 000000000..1fd43a1fa --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package ifaces exposes all interfaces to work with adapters. +package ifaces diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go new file mode 100644 index 000000000..7805e5e5e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go @@ -0,0 +1,84 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package ifaces + +import ( + _ "encoding/json" // for documentation purpose + "iter" +) + +// Ordered knows how to iterate over the (key,value) pairs of a JSON object. +type Ordered interface { + OrderedItems() iter.Seq2[string, any] +} + +// SetOrdered knows how to append or update the keys of a JSON object, +// given an iterator over (key,value) pairs. +// +// If the provided iterator is nil then the receiver should be set to nil. +type SetOrdered interface { + SetOrderedItems(iter.Seq2[string, any]) +} + +// OrderedMap represent a JSON object (i.e. like a map[string,any]), +// and knows how to serialize and deserialize JSON with the order of keys maintained. +type OrderedMap interface { + Ordered + SetOrdered + + OrderedMarshalJSON() ([]byte, error) + OrderedUnmarshalJSON([]byte) error +} + +// MarshalAdapter behaves likes the standard library [json.Marshal]. +type MarshalAdapter interface { + Poolable + + Marshal(any) ([]byte, error) +} + +// OrderedMarshalAdapter behaves likes the standard library [json.Marshal], preserving the order of keys in objects. +type OrderedMarshalAdapter interface { + Poolable + + OrderedMarshal(Ordered) ([]byte, error) +} + +// UnmarshalAdapter behaves likes the standard library [json.Unmarshal]. +type UnmarshalAdapter interface { + Poolable + + Unmarshal([]byte, any) error +} + +// OrderedUnmarshalAdapter behaves likes the standard library [json.Unmarshal], preserving the order of keys in objects. +type OrderedUnmarshalAdapter interface { + Poolable + + OrderedUnmarshal([]byte, SetOrdered) error +} + +// Adapter exposes an interface like the standard [json] library. +type Adapter interface { + MarshalAdapter + UnmarshalAdapter + + OrderedAdapter +} + +// OrderedAdapter exposes interfaces to process JSON and keep the order of object keys. +type OrderedAdapter interface { + OrderedMarshalAdapter + OrderedUnmarshalAdapter + NewOrderedMap(capacity int) OrderedMap +} + +type Poolable interface { + // Self-redeem: for [Adapter] s that are allocated from a pool. + // The [Adapter] must not be used after calling [Redeem]. + Redeem() + + // Reset the state of the [Adapter], if any. + Reset() +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go new file mode 100644 index 000000000..2d6c69f4e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package ifaces + +import ( + "strings" +) + +// Capability indicates what a JSON adapter is capable of. +type Capability uint8 + +const ( + CapabilityMarshalJSON Capability = 1 << iota + CapabilityUnmarshalJSON + CapabilityOrderedMarshalJSON + CapabilityOrderedUnmarshalJSON + CapabilityOrderedMap +) + +func (c Capability) String() string { + switch c { + case CapabilityMarshalJSON: + return "MarshalJSON" + case CapabilityUnmarshalJSON: + return "UnmarshalJSON" + case CapabilityOrderedMarshalJSON: + return "OrderedMarshalJSON" + case CapabilityOrderedUnmarshalJSON: + return "OrderedUnmarshalJSON" + case CapabilityOrderedMap: + return "OrderedMap" + default: + return "" + } +} + +// Capabilities holds several unitary capability flags +type Capabilities uint8 + +// Has some capability flag enabled. +func (c Capabilities) Has(capability Capability) bool { + return Capability(c)&capability > 0 +} + +func (c Capabilities) String() string { + var w strings.Builder + + first := true + for _, capability := range []Capability{ + CapabilityMarshalJSON, + CapabilityUnmarshalJSON, + CapabilityOrderedMarshalJSON, + CapabilityOrderedUnmarshalJSON, + CapabilityOrderedMap, + } { + if c.Has(capability) { + if !first { + w.WriteByte('|') + } else { + first = false + } + w.WriteString(capability.String()) + } + } + + return w.String() +} + +const ( + AllCapabilities Capabilities = Capabilities(uint8(CapabilityMarshalJSON) | + uint8(CapabilityUnmarshalJSON) | + uint8(CapabilityOrderedMarshalJSON) | + uint8(CapabilityOrderedUnmarshalJSON) | + uint8(CapabilityOrderedMap)) + + AllUnorderedCapabilities Capabilities = Capabilities(uint8(CapabilityMarshalJSON) | uint8(CapabilityUnmarshalJSON)) +) + +// RegistryEntry describes how any given adapter registers its capabilities to the [Registrar]. +type RegistryEntry struct { + Who string + What Capabilities + Constructor func() Adapter + Support func(what Capability, value any) bool +} + +// Registrar is a type that knows how to keep registration calls from adapters. +type Registrar interface { + RegisterFor(RegistryEntry) +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go new file mode 100644 index 000000000..3062acaff --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go @@ -0,0 +1,229 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package adapters + +import ( + "fmt" + "reflect" + "slices" + "sync" + + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" + stdlib "github.com/go-openapi/swag/jsonutils/adapters/stdlib/json" +) + +// Registry holds the global registry for registered adapters. +var Registry = NewRegistrar() + +var ( + defaultRegistered = stdlib.Register + + _ ifaces.Registrar = &Registrar{} +) + +type registryError string + +func (e registryError) Error() string { + return string(e) +} + +// ErrRegistry indicates an error returned by the [Registrar]. +var ErrRegistry registryError = "JSON adapters registry error" + +type registry []*ifaces.RegistryEntry + +// Registrar holds registered [ifaces.Adapters] for different serialization capabilities. +// +// Internally, it maintains a cache for data types that favor a given adapter. +type Registrar struct { + marshalerRegistry registry + unmarshalerRegistry registry + orderedMarshalerRegistry registry + orderedUnmarshalerRegistry registry + orderedMapRegistry registry + + gmx sync.RWMutex + + // cache indexed by value type, so we don't have to lookup + marshalerCache map[reflect.Type]*ifaces.RegistryEntry + unmarshalerCache map[reflect.Type]*ifaces.RegistryEntry + orderedMarshalerCache map[reflect.Type]*ifaces.RegistryEntry + orderedUnmarshalerCache map[reflect.Type]*ifaces.RegistryEntry + orderedMapCache map[reflect.Type]*ifaces.RegistryEntry +} + +func NewRegistrar() *Registrar { + r := &Registrar{} + + r.marshalerRegistry = make(registry, 0, 1) + r.unmarshalerRegistry = make(registry, 0, 1) + r.orderedMarshalerRegistry = make(registry, 0, 1) + r.orderedUnmarshalerRegistry = make(registry, 0, 1) + r.orderedMapRegistry = make(registry, 0, 1) + + r.marshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry) + r.unmarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry) + r.orderedMarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry) + r.orderedUnmarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry) + r.orderedMapCache = make(map[reflect.Type]*ifaces.RegistryEntry) + + defaultRegistered(r) + + return r +} + +// ClearCache resets the internal type cache. +func (r *Registrar) ClearCache() { + r.gmx.Lock() + r.clearCache() + r.gmx.Unlock() +} + +// Reset the [Registrar] to its defaults. +func (r *Registrar) Reset() { + r.gmx.Lock() + r.clearCache() + r.marshalerRegistry = r.marshalerRegistry[:0] + r.unmarshalerRegistry = r.unmarshalerRegistry[:0] + r.orderedMarshalerRegistry = r.orderedMarshalerRegistry[:0] + r.orderedUnmarshalerRegistry = r.orderedUnmarshalerRegistry[:0] + r.orderedMapRegistry = r.orderedMapRegistry[:0] + r.gmx.Unlock() + + defaultRegistered(r) +} + +// RegisterFor registers an adapter for some JSON capabilities. +func (r *Registrar) RegisterFor(entry ifaces.RegistryEntry) { + r.gmx.Lock() + if entry.What.Has(ifaces.CapabilityMarshalJSON) { + e := entry + e.What &= ifaces.Capabilities(ifaces.CapabilityMarshalJSON) + r.marshalerRegistry = slices.Insert(r.marshalerRegistry, 0, &e) + } + if entry.What.Has(ifaces.CapabilityUnmarshalJSON) { + e := entry + e.What &= ifaces.Capabilities(ifaces.CapabilityUnmarshalJSON) + r.unmarshalerRegistry = slices.Insert(r.unmarshalerRegistry, 0, &e) + } + if entry.What.Has(ifaces.CapabilityOrderedMarshalJSON) { + e := entry + e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedMarshalJSON) + r.orderedMarshalerRegistry = slices.Insert(r.orderedMarshalerRegistry, 0, &e) + } + if entry.What.Has(ifaces.CapabilityOrderedUnmarshalJSON) { + e := entry + e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedUnmarshalJSON) + r.orderedUnmarshalerRegistry = slices.Insert(r.orderedUnmarshalerRegistry, 0, &e) + } + if entry.What.Has(ifaces.CapabilityOrderedMap) { + e := entry + e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedMap) + r.orderedMapRegistry = slices.Insert(r.orderedMapRegistry, 0, &e) + } + r.gmx.Unlock() +} + +// AdapterFor returns an [ifaces.Adapter] that supports this capability for this type of value. +// +// The [ifaces.Adapter] may be redeemed to its pool using its Redeem() method, for adapters that support global +// pooling. When this is not the case, the redeem function is just a no-operation. +func (r *Registrar) AdapterFor(capability ifaces.Capability, value any) ifaces.Adapter { + entry := r.findFirstFor(capability, value) + if entry == nil { + return nil + } + + return entry.Constructor() +} + +func (r *Registrar) clearCache() { + clear(r.marshalerCache) + clear(r.unmarshalerCache) + clear(r.orderedMarshalerCache) + clear(r.orderedUnmarshalerCache) + clear(r.orderedMapCache) +} + +func (r *Registrar) findFirstFor(capability ifaces.Capability, value any) *ifaces.RegistryEntry { + switch capability { + case ifaces.CapabilityMarshalJSON: + return r.findFirstInRegistryFor(r.marshalerRegistry, r.marshalerCache, capability, value) + case ifaces.CapabilityUnmarshalJSON: + return r.findFirstInRegistryFor(r.unmarshalerRegistry, r.unmarshalerCache, capability, value) + case ifaces.CapabilityOrderedMarshalJSON: + return r.findFirstInRegistryFor(r.orderedMarshalerRegistry, r.orderedMarshalerCache, capability, value) + case ifaces.CapabilityOrderedUnmarshalJSON: + return r.findFirstInRegistryFor(r.orderedUnmarshalerRegistry, r.orderedUnmarshalerCache, capability, value) + case ifaces.CapabilityOrderedMap: + return r.findFirstInRegistryFor(r.orderedMapRegistry, r.orderedMapCache, capability, value) + default: + panic(fmt.Errorf("unsupported capability %d: %w", capability, ErrRegistry)) + } +} + +func (r *Registrar) findFirstInRegistryFor(reg registry, cache map[reflect.Type]*ifaces.RegistryEntry, capability ifaces.Capability, value any) *ifaces.RegistryEntry { + r.gmx.RLock() + if len(reg) > 1 { + if entry, ok := cache[reflect.TypeOf(value)]; ok { + // cache hit + r.gmx.RUnlock() + return entry + } + } + + for _, entry := range reg { + if !entry.Support(capability, value) { + continue + } + + r.gmx.RUnlock() + + // update the internal cache + r.gmx.Lock() + cache[reflect.TypeOf(value)] = entry + r.gmx.Unlock() + + return entry + } + + // no adapter found + r.gmx.RUnlock() + + return nil +} + +// MarshalAdapterFor returns the first adapter that knows how to Marshal this type of value. +func MarshalAdapterFor(value any) ifaces.MarshalAdapter { + return Registry.AdapterFor(ifaces.CapabilityMarshalJSON, value) +} + +// OrderedMarshalAdapterFor returns the first adapter that knows how to OrderedMarshal this type of value. +func OrderedMarshalAdapterFor(value ifaces.Ordered) ifaces.OrderedMarshalAdapter { + return Registry.AdapterFor(ifaces.CapabilityOrderedMarshalJSON, value) +} + +// UnmarshalAdapterFor returns the first adapter that knows how to Unmarshal this type of value. +func UnmarshalAdapterFor(value any) ifaces.UnmarshalAdapter { + return Registry.AdapterFor(ifaces.CapabilityUnmarshalJSON, value) +} + +// OrderedUnmarshalAdapterFor provides the first adapter that knows how to OrderedUnmarshal this type of value. +func OrderedUnmarshalAdapterFor(value ifaces.SetOrdered) ifaces.OrderedUnmarshalAdapter { + return Registry.AdapterFor(ifaces.CapabilityOrderedUnmarshalJSON, value) +} + +// NewOrderedMap provides the "ordered map" implementation provided by the registry. +func NewOrderedMap(capacity int) ifaces.OrderedMap { + var v any + adapter := Registry.AdapterFor(ifaces.CapabilityOrderedUnmarshalJSON, v) + if adapter == nil { + return nil + } + + defer adapter.Redeem() + return adapter.NewOrderedMap(capacity) +} + +func noopRedeemer() {} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go new file mode 100644 index 000000000..0213ff5c2 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go @@ -0,0 +1,115 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + stdjson "encoding/json" + + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" + "github.com/go-openapi/swag/typeutils" +) + +const sensibleBufferSize = 8192 + +type jsonError string + +func (e jsonError) Error() string { + return string(e) +} + +// ErrStdlib indicates that an error comes from the stdlib JSON adapter +var ErrStdlib jsonError = "error from the JSON adapter stdlib" + +var _ ifaces.Adapter = &Adapter{} + +type Adapter struct { +} + +// NewAdapter yields an [ifaces.Adapter] using the standard library. +func NewAdapter() *Adapter { + return &Adapter{} +} + +func (a *Adapter) Marshal(value any) ([]byte, error) { + return stdjson.Marshal(value) +} + +func (a *Adapter) Unmarshal(data []byte, value any) error { + return stdjson.Unmarshal(data, value) +} + +func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) { + w := poolOfWriters.Borrow() + defer func() { + poolOfWriters.Redeem(w) + }() + + if typeutils.IsNil(value) { + w.RawString("null") + + return w.BuildBytes() + } + + w.RawByte('{') + first := true + for k, v := range value.OrderedItems() { + if first { + first = false + } else { + w.RawByte(',') + } + + w.String(k) + w.RawByte(':') + + switch val := v.(type) { + case ifaces.Ordered: + w.Raw(a.OrderedMarshal(val)) + default: + w.Raw(stdjson.Marshal(v)) + } + } + + w.RawByte('}') + + return w.BuildBytes() +} + +func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdered) error { + var m MapSlice + if err := m.OrderedUnmarshalJSON(data); err != nil { + return err + } + + if typeutils.IsNil(m) { + // force input value to nil + value.SetOrderedItems(nil) + + return nil + } + + value.SetOrderedItems(m.OrderedItems()) + + return nil +} + +func (a *Adapter) NewOrderedMap(capacity int) ifaces.OrderedMap { + m := make(MapSlice, 0, capacity) + + return &m +} + +// Redeem the [Adapter] when it comes from a pool. +// +// The adapter becomes immediately unusable once redeemed. +func (a *Adapter) Redeem() { + if a == nil { + return + } + + RedeemAdapter(a) +} + +func (a *Adapter) Reset() { +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go new file mode 100644 index 000000000..5ea1b4404 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package json implements an [ifaces.Adapter] using the standard library. +package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go new file mode 100644 index 000000000..b5aa1c797 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go @@ -0,0 +1,320 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + stdjson "encoding/json" + "errors" + "fmt" + "io" + "math" + "strconv" + + "github.com/go-openapi/swag/conv" +) + +type token struct { + stdjson.Token +} + +func (t token) String() string { + if t == invalidToken { + return "invalid token" + } + if t == eofToken { + return "EOF" + } + + return fmt.Sprintf("%v", t.Token) +} + +func (t token) Kind() tokenKind { + switch t.Token.(type) { + case nil: + return tokenNull + case stdjson.Delim: + return tokenDelim + case bool: + return tokenBool + case float64: + return tokenFloat + case stdjson.Number: + return tokenNumber + case string: + return tokenString + default: + return tokenUndef + } +} + +func (t token) Delim() byte { + r, ok := t.Token.(stdjson.Delim) + if !ok { + return 0 + } + + return byte(r) +} + +type tokenKind uint8 + +const ( + tokenUndef tokenKind = iota + tokenString + tokenNumber + tokenFloat + tokenBool + tokenNull + tokenDelim +) + +var ( + invalidToken = token{ + Token: stdjson.Token(struct{}{}), + } + + eofToken = token{ + Token: stdjson.Token(&struct{}{}), + } + + undefToken = token{ + Token: stdjson.Token(uint8(0)), + } +) + +// jlexer apes easyjson's jlexer, but uses the standard library decoder under the hood. +type jlexer struct { + buf *bytesReader + dec *stdjson.Decoder + err error + // current token + next token + // started bool +} + +type bytesReader struct { + buf []byte + offset int +} + +func (b *bytesReader) Reset() { + b.buf = nil + b.offset = 0 +} + +func (b *bytesReader) Read(p []byte) (int, error) { + if b.offset >= len(b.buf) { + return 0, io.EOF + } + + n := len(p) + buf := b.buf[b.offset:] + m := len(buf) + + if n >= m { + copy(p, buf) + b.offset += m + + return m, nil + } + + copy(p, buf[:n]) + b.offset += n + + return n, nil +} + +var _ io.Reader = &bytesReader{} + +func newLexer(data []byte) *jlexer { + l := &jlexer{ + // current: undefToken, + next: undefToken, + } + l.buf = &bytesReader{ + buf: data, + } + l.dec = stdjson.NewDecoder(l.buf) // unfortunately, cannot pool this + + return l +} + +func (l *jlexer) Reset() { + l.err = nil + l.next = undefToken + // leave l.dec and l.buf alone, since they are replaced at every Borrow +} + +func (l *jlexer) Error() error { + return l.err +} + +func (l *jlexer) SetErr(err error) { + l.err = err +} + +func (l *jlexer) Ok() bool { + return l.err == nil +} + +// NextToken consumes a token +func (l *jlexer) NextToken() token { + if !l.Ok() { + return invalidToken + } + + if l.next != undefToken { + next := l.next + l.next = undefToken + + return next + } + + return l.fetchToken() +} + +// PeekToken returns the next token without consuming it +func (l *jlexer) PeekToken() token { + if l.next == undefToken { + l.next = l.fetchToken() + } + + return l.next +} + +func (l *jlexer) Skip() { + _ = l.NextToken() +} + +func (l *jlexer) IsDelim(c byte) bool { + if !l.Ok() { + return false + } + + next := l.PeekToken() + if next.Kind() != tokenDelim { + return false + } + + if next.Delim() != c { + return false + } + + return true +} + +func (l *jlexer) IsNull() bool { + if !l.Ok() { + return false + } + + next := l.PeekToken() + + return next.Kind() == tokenNull +} + +func (l *jlexer) Delim(c byte) { + if !l.Ok() { + return + } + + tok := l.NextToken() + if tok.Kind() != tokenDelim { + l.err = fmt.Errorf("expected a delimiter token but got '%v': %w", tok, ErrStdlib) + + return + } + + if tok.Delim() != c { + l.err = fmt.Errorf("expected delimiter '%q' but got '%q': %w", c, tok.Delim(), ErrStdlib) + } +} + +func (l *jlexer) Null() { + if !l.Ok() { + return + } + + tok := l.NextToken() + if tok.Kind() != tokenNull { + l.err = fmt.Errorf("expected a null token but got '%v': %w", tok, ErrStdlib) + } +} + +func (l *jlexer) Number() any { + if !l.Ok() { + return 0 + } + + tok := l.NextToken() + + switch tok.Kind() { //nolint:exhaustive + case tokenNumber: + n := tok.Token.(stdjson.Number).String() + f, _ := strconv.ParseFloat(n, 64) + if conv.IsFloat64AJSONInteger(f) { + return int64(math.Trunc(f)) + } + + return f + + case tokenFloat: + f := tok.Token.(float64) + if conv.IsFloat64AJSONInteger(f) { + return int64(math.Trunc(f)) + } + + return f + + default: + l.err = fmt.Errorf("expected a number token but got '%v': %w", tok, ErrStdlib) + + return 0 + } +} + +func (l *jlexer) Bool() bool { + if !l.Ok() { + return false + } + + tok := l.NextToken() + if tok.Kind() != tokenBool { + l.err = fmt.Errorf("expected a bool token but got '%v': %w", tok, ErrStdlib) + + return false + } + + return tok.Token.(bool) +} + +func (l *jlexer) String() string { + if !l.Ok() { + return "" + } + + tok := l.NextToken() + if tok.Kind() != tokenString { + l.err = fmt.Errorf("expected a string token but got '%v': %w", tok, ErrStdlib) + + return "" + } + + return tok.Token.(string) +} + +// Commas and colons are elided. +func (l *jlexer) fetchToken() token { + jtok, err := l.dec.Token() + if err != nil { + if errors.Is(err, io.EOF) { + return eofToken + } + + l.err = errors.Join(err, ErrStdlib) + return invalidToken + } + + return token{Token: jtok} +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go new file mode 100644 index 000000000..54deef406 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go @@ -0,0 +1,266 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + stdjson "encoding/json" + "fmt" + "iter" + + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" +) + +var _ ifaces.OrderedMap = &MapSlice{} + +// MapSlice represents a JSON object, with the order of keys maintained. +type MapSlice []MapItem + +func (s MapSlice) OrderedItems() iter.Seq2[string, any] { + return func(yield func(string, any) bool) { + for _, item := range s { + if !yield(item.Key, item.Value) { + return + } + } + } +} + +func (s *MapSlice) SetOrderedItems(items iter.Seq2[string, any]) { + if items == nil { + *s = nil + + return + } + + m := *s + if len(m) > 0 { + // update mode + idx := make(map[string]int, len(m)) + + for i, item := range m { + idx[item.Key] = i + } + + for k, v := range items { + idx, ok := idx[k] + if ok { + m[idx].Value = v + + continue + } + m = append(m, MapItem{Key: k, Value: v}) + } + + *s = m + + return + } + + for k, v := range items { + m = append(m, MapItem{Key: k, Value: v}) + } + + *s = m +} + +// MarshalJSON renders a [MapSlice] as JSON bytes, preserving the order of keys. +func (s MapSlice) MarshalJSON() ([]byte, error) { + return s.OrderedMarshalJSON() +} + +func (s MapSlice) OrderedMarshalJSON() ([]byte, error) { + w := poolOfWriters.Borrow() + defer func() { + poolOfWriters.Redeem(w) + }() + + s.marshalObject(w) + + return w.BuildBytes() // this clones data, so it's okay to redeem the writer and its buffer +} + +// UnmarshalJSON builds a [MapSlice] from JSON bytes, preserving the order of keys. +// +// Inner objects are unmarshaled as [MapSlice] slices and not map[string]any. +func (s *MapSlice) UnmarshalJSON(data []byte) error { + return s.OrderedUnmarshalJSON(data) +} + +func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error { + l := poolOfLexers.Borrow(data) + defer func() { + poolOfLexers.Redeem(l) + }() + + s.unmarshalObject(l) + + return l.Error() +} + +func (s MapSlice) marshalObject(w *jwriter) { + if s == nil { + w.RawString("null") + + return + } + + w.RawByte('{') + + if len(s) == 0 { + w.RawByte('}') + + return + } + + s[0].marshalJSON(w) + + for i := 1; i < len(s); i++ { + w.RawByte(',') + s[i].marshalJSON(w) + } + + w.RawByte('}') +} + +func (s *MapSlice) unmarshalObject(in *jlexer) { + if in.IsNull() { + in.Skip() + + return + } + + in.Delim('{') // consume token + if !in.Ok() { + return + } + + result := make(MapSlice, 0) + + for in.Ok() && !in.IsDelim('}') { + var mi MapItem + + mi.unmarshalKeyValue(in) + result = append(result, mi) + } + + in.Delim('}') + + if !in.Ok() { + return + } + + *s = result +} + +// MapItem represents the value of a key in a JSON object held by [MapSlice]. +// +// Notice that [MapItem] should not be marshaled to or unmarshaled from JSON directly, +// use this type as part of a [MapSlice] when dealing with JSON bytes. +type MapItem struct { + Key string + Value any +} + +func (s MapItem) marshalJSON(w *jwriter) { + w.String(s.Key) + w.RawByte(':') + w.Raw(stdjson.Marshal(s.Value)) +} + +func (s *MapItem) unmarshalKeyValue(in *jlexer) { + key := in.String() // consume string + value := s.asInterface(in) // consume any value, including termination tokens '}' or ']' + + if !in.Ok() { + return + } + + s.Key = key + s.Value = value +} + +func (s *MapItem) unmarshalArray(in *jlexer) []any { + if in.IsNull() { + in.Skip() + + return nil + } + + in.Delim('[') // consume token + if !in.Ok() { + return nil + } + + ret := make([]any, 0) + + for in.Ok() && !in.IsDelim(']') { + ret = append(ret, s.asInterface(in)) + } + + in.Delim(']') + if !in.Ok() { + return nil + } + + return ret +} + +// asInterface is very much like [jlexer.Lexer.Interface], but unmarshals an object +// into a [MapSlice], not a map[string]any. +// +// We have to force parsing errors somehow, since [jlexer.Lexer] doesn't let us +// set a parsing error directly. +func (s *MapItem) asInterface(in *jlexer) any { + if !in.Ok() { + return nil + } + + tok := in.PeekToken() // look-ahead what the next token looks like + kind := tok.Kind() + + switch kind { + case tokenString: + return in.String() // consume string + + case tokenNumber, tokenFloat: + return in.Number() + + case tokenBool: + return in.Bool() + + case tokenNull: + in.Null() + + return nil + + case tokenDelim: + switch tok.Delim() { + case '{': // not consumed yet + ret := make(MapSlice, 0) + ret.unmarshalObject(in) // consumes the terminating '}' + + if in.Ok() { + return ret + } + + // lexer is in an error state: will exhaust + return nil + + case '[': // not consumed yet + return s.unmarshalArray(in) // consumes the terminating ']' + default: + in.SetErr(fmt.Errorf("unexpected delimiter: %v: %w", tok, ErrStdlib)) // force error + return nil + } + + case tokenUndef: + fallthrough + default: + if in.Ok() { + in.SetErr(fmt.Errorf("unexpected token: %v: %w", tok, ErrStdlib)) // force error + } + + return nil + } +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go new file mode 100644 index 000000000..709b97c30 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go @@ -0,0 +1,143 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + "encoding/json" + "sync" + + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" +) + +type adaptersPool struct { + sync.Pool +} + +func (p *adaptersPool) Borrow() *Adapter { + return p.Get().(*Adapter) +} + +func (p *adaptersPool) BorrowIface() ifaces.Adapter { + return p.Get().(*Adapter) +} + +func (p *adaptersPool) Redeem(a *Adapter) { + p.Put(a) +} + +type writersPool struct { + sync.Pool +} + +func (p *writersPool) Borrow() *jwriter { + ptr := p.Get() + + jw := ptr.(*jwriter) + jw.Reset() + + return jw +} + +func (p *writersPool) Redeem(w *jwriter) { + p.Put(w) +} + +type lexersPool struct { + sync.Pool +} + +func (p *lexersPool) Borrow(data []byte) *jlexer { + ptr := p.Get() + + l := ptr.(*jlexer) + l.buf = poolOfReaders.Borrow(data) + l.dec = json.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API + l.Reset() + + return l +} + +func (p *lexersPool) Redeem(l *jlexer) { + l.dec = nil + discard := l.buf + l.buf = nil + poolOfReaders.Redeem(discard) + p.Put(l) +} + +type readersPool struct { + sync.Pool +} + +func (p *readersPool) Borrow(data []byte) *bytesReader { + ptr := p.Get() + + b := ptr.(*bytesReader) + b.Reset() + b.buf = data + + return b +} + +func (p *readersPool) Redeem(b *bytesReader) { + p.Put(b) +} + +var ( + poolOfAdapters = &adaptersPool{ + Pool: sync.Pool{ + New: func() any { + return NewAdapter() + }, + }, + } + + poolOfWriters = &writersPool{ + Pool: sync.Pool{ + New: func() any { + return newJWriter() + }, + }, + } + + poolOfLexers = &lexersPool{ + Pool: sync.Pool{ + New: func() any { + return newLexer(nil) + }, + }, + } + + poolOfReaders = &readersPool{ + Pool: sync.Pool{ + New: func() any { + return &bytesReader{} + }, + }, + } +) + +// BorrowAdapter borrows an [Adapter] from the pool, recycling already allocated instances. +func BorrowAdapter() *Adapter { + return poolOfAdapters.Borrow() +} + +// BorrowAdapterIface borrows a stdlib [Adapter] and converts it directly +// to [ifaces.Adapter]. This is useful to avoid further allocations when +// translating the concrete type into an interface. +func BorrowAdapterIface() ifaces.Adapter { + return poolOfAdapters.BorrowIface() +} + +// RedeemAdapter redeems an [Adapter] to the pool, so it may be recycled. +func RedeemAdapter(a *Adapter) { + poolOfAdapters.Redeem(a) +} + +func RedeemAdapterIface(a ifaces.Adapter) { + concrete, ok := a.(*Adapter) + if ok { + poolOfAdapters.Redeem(concrete) + } +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go new file mode 100644 index 000000000..fc8818694 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + "fmt" + "reflect" + + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" +) + +func Register(dispatcher ifaces.Registrar) { + t := reflect.TypeOf(Adapter{}) + dispatcher.RegisterFor( + ifaces.RegistryEntry{ + Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()), + What: ifaces.AllCapabilities, + Constructor: BorrowAdapterIface, + Support: support, + }) +} + +func support(_ ifaces.Capability, _ any) bool { + return true +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go new file mode 100644 index 000000000..dc2325c1a --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +import ( + "bytes" + "encoding/json" + "strings" +) + +type jwriter struct { + buf *bytes.Buffer + err error +} + +func newJWriter() *jwriter { + buf := make([]byte, 0, sensibleBufferSize) + + return &jwriter{buf: bytes.NewBuffer(buf)} +} + +func (w *jwriter) Reset() { + w.buf.Reset() + w.err = nil +} + +func (w *jwriter) RawString(s string) { + if w.err != nil { + return + } + w.buf.WriteString(s) +} + +func (w *jwriter) Raw(b []byte, err error) { + if w.err != nil { + return + } + if err != nil { + w.err = err + return + } + + _, _ = w.buf.Write(b) +} + +func (w *jwriter) RawByte(c byte) { + if w.err != nil { + return + } + w.buf.WriteByte(c) +} + +var quoteReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`) + +func (w *jwriter) String(s string) { + if w.err != nil { + return + } + // escape quotes and \ + s = quoteReplacer.Replace(s) + + _ = w.buf.WriteByte('"') + json.HTMLEscape(w.buf, []byte(s)) + _ = w.buf.WriteByte('"') +} + +// BuildBytes returns a clone of the internal buffer. +func (w *jwriter) BuildBytes() ([]byte, error) { + if w.err != nil { + return nil, w.err + } + + return bytes.Clone(w.buf.Bytes()), nil +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/concat.go b/vendor/github.com/go-openapi/swag/jsonutils/concat.go new file mode 100644 index 000000000..2068503af --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/concat.go @@ -0,0 +1,92 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonutils + +import ( + "bytes" +) + +// nullJSON represents a JSON object with null type +var nullJSON = []byte("null") + +const comma = byte(',') + +var closers map[byte]byte + +func init() { + closers = map[byte]byte{ + '{': '}', + '[': ']', + } +} + +// ConcatJSON concatenates multiple json objects or arrays efficiently. +// +// Note that [ConcatJSON] performs a very simple (and fast) concatenation +// operation: it does not attempt to merge objects. +func ConcatJSON(blobs ...[]byte) []byte { + if len(blobs) == 0 { + return nil + } + + last := len(blobs) - 1 + for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) { + // strips trailing null objects + last-- + if last < 0 { + // there was nothing but "null"s or nil... + return nil + } + } + if last == 0 { + return blobs[0] + } + + var opening, closing byte + var idx, a int + buf := bytes.NewBuffer(nil) + + for i, b := range blobs[:last+1] { + if b == nil || bytes.Equal(b, nullJSON) { + // a null object is in the list: skip it + continue + } + if len(b) > 0 && opening == 0 { // is this an array or an object? + opening, closing = b[0], closers[b[0]] + } + + if opening != '{' && opening != '[' { + continue // don't know how to concatenate non container objects + } + + const minLengthIfNotEmpty = 3 + if len(b) < minLengthIfNotEmpty { // yep empty but also the last one, so closing this thing + if i == last && a > 0 { + _ = buf.WriteByte(closing) // never returns err != nil + } + continue + } + + idx = 0 + if a > 0 { // we need to join with a comma for everything beyond the first non-empty item + _ = buf.WriteByte(comma) // never returns err != nil + idx = 1 // this is not the first or the last so we want to drop the leading bracket + } + + if i != last { // not the last one, strip brackets + _, _ = buf.Write(b[idx : len(b)-1]) // never returns err != nil + } else { // last one, strip only the leading bracket + _, _ = buf.Write(b[idx:]) + } + a++ + } + + // somehow it ended up being empty, so provide a default value + if buf.Len() == 0 && (opening == '{' || opening == '[') { + _ = buf.WriteByte(opening) // never returns err != nil + _ = buf.WriteByte(closing) + } + + return buf.Bytes() +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/doc.go new file mode 100644 index 000000000..3926cc58d --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/doc.go @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package jsonutils provides helpers to work with JSON. +// +// These utilities work with dynamic go structures to and from JSON. +package jsonutils diff --git a/vendor/github.com/go-openapi/swag/jsonutils/json.go b/vendor/github.com/go-openapi/swag/jsonutils/json.go new file mode 100644 index 000000000..40753ce03 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/json.go @@ -0,0 +1,116 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonutils + +import ( + "bytes" + "encoding/json" + + "github.com/go-openapi/swag/jsonutils/adapters" + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" +) + +// WriteJSON marshals a data structure as JSON. +// +// The difference with [json.Marshal] is that it may check among several alternatives +// to do so. +// +// See [adapters.Registrar] for more details about how to configure +// multiple serialization alternatives. +// +// NOTE: to allow types that are [easyjson.Marshaler] s to use that route to process JSON, +// you now need to register the adapter for easyjson at runtime. +func WriteJSON(value any) ([]byte, error) { + if orderedMap, isOrdered := value.(ifaces.Ordered); isOrdered { + orderedMarshaler := adapters.OrderedMarshalAdapterFor(orderedMap) + + if orderedMarshaler != nil { + defer orderedMarshaler.Redeem() + + return orderedMarshaler.OrderedMarshal(orderedMap) + } + + // no support found in registered adapters, fallback to the default (unordered) case + } + + marshaler := adapters.MarshalAdapterFor(value) + if marshaler != nil { + defer marshaler.Redeem() + + return marshaler.Marshal(value) + } + + // no support found in registered adapters, fallback to the default standard library. + // + // This only happens when tinkering with the global registry of adapters, since the default handles all the above cases. + return json.Marshal(value) // Codecov ignore // this is a safeguard not easily simulated in tests +} + +// ReadJSON unmarshals JSON data into a data structure. +// +// The difference with [json.Unmarshal] is that it may check among several alternatives +// to do so. +// +// See [adapters.Registrar] for more details about how to configure +// multiple serialization alternatives. +// +// NOTE: value must be a pointer. +// +// If the provided value implements [ifaces.SetOrdered], it is a considered an "ordered map" and [ReadJSON] +// will favor an adapter that supports the [ifaces.OrderedUnmarshal] feature, or fallback to +// an unordered behavior if none is found. +// +// NOTE: to allow types that are [easyjson.Unmarshaler] s to use that route to process JSON, +// you now need to register the adapter for easyjson at runtime. +func ReadJSON(data []byte, value any) error { + trimmedData := bytes.Trim(data, "\x00") + + if orderedMap, isOrdered := value.(ifaces.SetOrdered); isOrdered { + // if the value is an ordered map, favors support for OrderedUnmarshal. + + orderedUnmarshaler := adapters.OrderedUnmarshalAdapterFor(orderedMap) + + if orderedUnmarshaler != nil { + defer orderedUnmarshaler.Redeem() + + return orderedUnmarshaler.OrderedUnmarshal(trimmedData, orderedMap) + } + + // no support found in registered adapters, fallback to the default (unordered) case + } + + unmarshaler := adapters.UnmarshalAdapterFor(value) + if unmarshaler != nil { + defer unmarshaler.Redeem() + + return unmarshaler.Unmarshal(trimmedData, value) + } + + // no support found in registered adapters, fallback to the default standard library. + // + // This only happens when tinkering with the global registry of adapters, since the default handles all the above cases. + return json.Unmarshal(trimmedData, value) // Codecov ignore // this is a safeguard not easily simulated in tests +} + +// FromDynamicJSON turns a go value into a properly JSON typed structure. +// +// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped any, +// i.e. objects are represented by map[string]any, arrays by []any, and +// all numbers are represented as float64. +// +// NOTE: target must be a pointer. +// +// # Maintaining the order of keys in objects +// +// If source and target implement [ifaces.Ordered] and [ifaces.SetOrdered] respectively, +// they are considered "ordered maps" and the order of keys is maintained in the +// "jsonification" process. In that case, map[string]any values are replaced by (ordered) [JSONMapSlice] ones. +func FromDynamicJSON(source, target any) error { + b, err := WriteJSON(source) + if err != nil { + return err + } + + return ReadJSON(b, target) +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go new file mode 100644 index 000000000..38dd3e244 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go @@ -0,0 +1,114 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonutils + +import ( + "iter" + + "github.com/go-openapi/swag/jsonutils/adapters" + "github.com/go-openapi/swag/typeutils" +) + +// JSONMapSlice represents a JSON object, with the order of keys maintained. +// +// It behaves like an ordered map, but keys can't be accessed in constant time. +type JSONMapSlice []JSONMapItem + +// OrderedItems iterates over all (key,value) pairs with the order of keys maintained. +// +// This implements the [ifaces.Ordered] interface, so that [ifaces.Adapter] s know how to marshal +// keys in the desired order. +func (s JSONMapSlice) OrderedItems() iter.Seq2[string, any] { + return func(yield func(string, any) bool) { + for _, item := range s { + if !yield(item.Key, item.Value) { + return + } + } + } +} + +// SetOrderedItems sets keys in the [JSONMapSlice] objects, as presented by +// the provided iterator. +// +// As a special case, if items is nil, this sets to receiver to a nil slice. +// +// This implements the [ifaces.SetOrdered] interface, so that [ifaces.Adapter] s know how to unmarshal +// keys in the desired order. +func (s *JSONMapSlice) SetOrderedItems(items iter.Seq2[string, any]) { + if items == nil { + // force receiver to be a nil slice + *s = nil + + return + } + + m := *s + if len(m) > 0 { + // update mode: short-circuited when unmarshaling fresh data structures + idx := make(map[string]int, len(m)) + + for i, item := range m { + idx[item.Key] = i + } + + for k, v := range items { + idx, ok := idx[k] + if ok { + m[idx].Value = v + + continue + } + + m = append(m, JSONMapItem{Key: k, Value: v}) + } + + *s = m + + return + } + + for k, v := range items { + m = append(m, JSONMapItem{Key: k, Value: v}) + } + + *s = m +} + +// MarshalJSON renders a [JSONMapSlice] as JSON bytes, preserving the order of keys. +// +// It will pick the JSON library currently configured by the [adapters.Registry] (defaults to the standard library). +func (s JSONMapSlice) MarshalJSON() ([]byte, error) { + orderedMarshaler := adapters.OrderedMarshalAdapterFor(s) + defer orderedMarshaler.Redeem() + + return orderedMarshaler.OrderedMarshal(s) +} + +// UnmarshalJSON builds a [JSONMapSlice] from JSON bytes, preserving the order of keys. +// +// Inner objects are unmarshaled as ordered [JSONMapSlice] slices and not map[string]any. +// +// It will pick the JSON library currently configured by the [adapters.Registry] (defaults to the standard library). +func (s *JSONMapSlice) UnmarshalJSON(data []byte) error { + if typeutils.IsNil(*s) { + // allow to unmarshal with a simple var declaration (nil slice) + *s = JSONMapSlice{} + } + + orderedUnmarshaler := adapters.OrderedUnmarshalAdapterFor(s) + defer orderedUnmarshaler.Redeem() + + return orderedUnmarshaler.OrderedUnmarshal(data, s) +} + +// JSONMapItem represents the value of a key in a JSON object held by [JSONMapSlice]. +// +// Notice that JSONMapItem should not be marshaled to or unmarshaled from JSON directly. +// +// Use this type as part of a [JSONMapSlice] when dealing with JSON bytes. +type JSONMapItem struct { + Key string + Value any +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils_iface.go b/vendor/github.com/go-openapi/swag/jsonutils_iface.go new file mode 100644 index 000000000..7bd4105fa --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils_iface.go @@ -0,0 +1,65 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import ( + "log" + + "github.com/go-openapi/swag/jsonutils" +) + +// JSONMapSlice represents a JSON object, with the order of keys maintained +// +// Deprecated: use [jsonutils.JSONMapSlice] instead, or [yamlutils.YAMLMapSlice] if you marshal YAML. +type JSONMapSlice = jsonutils.JSONMapSlice + +// JSONMapItem represents a JSON object, with the order of keys maintained +// +// Deprecated: use [jsonutils.JSONMapItem] instead. +type JSONMapItem = jsonutils.JSONMapItem + +// WriteJSON writes json data. +// +// Deprecated: use [jsonutils.WriteJSON] instead. +func WriteJSON(data any) ([]byte, error) { return jsonutils.WriteJSON(data) } + +// ReadJSON reads json data. +// +// Deprecated: use [jsonutils.ReadJSON] instead. +func ReadJSON(data []byte, value any) error { return jsonutils.ReadJSON(data, value) } + +// DynamicJSONToStruct converts an untyped JSON structure into a target data type. +// +// Deprecated: use [jsonutils.FromDynamicJSON] instead. +func DynamicJSONToStruct(data any, target any) error { + return jsonutils.FromDynamicJSON(data, target) +} + +// ConcatJSON concatenates multiple JSON objects efficiently. +// +// Deprecated: use [jsonutils.ConcatJSON] instead. +func ConcatJSON(blobs ...[]byte) []byte { return jsonutils.ConcatJSON(blobs...) } + +// ToDynamicJSON turns a go value into a properly JSON untyped structure. +// +// It is the same as [FromDynamicJSON], but doesn't check for errors. +// +// Deprecated: this function is a misnomer and is unsafe. Use [jsonutils.FromDynamicJSON] instead. +func ToDynamicJSON(value any) any { + var res any + if err := FromDynamicJSON(value, &res); err != nil { + log.Println(err) + } + + return res +} + +// FromDynamicJSON turns a go value into a properly JSON typed structure. +// +// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped any, +// i.e. objects are represented by map[string]any, arrays by []any, and all +// scalar values are any. +// +// Deprecated: use [jsonutils.FromDynamicJSON] instead. +func FromDynamicJSON(data, target any) error { return jsonutils.FromDynamicJSON(data, target) } diff --git a/vendor/google.golang.org/grpc/LICENSE b/vendor/github.com/go-openapi/swag/loading/LICENSE similarity index 100% rename from vendor/google.golang.org/grpc/LICENSE rename to vendor/github.com/go-openapi/swag/loading/LICENSE diff --git a/vendor/github.com/go-openapi/swag/loading/doc.go b/vendor/github.com/go-openapi/swag/loading/doc.go new file mode 100644 index 000000000..8cf7bcb8b --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package loading provides tools to load a file from http or from a local file system. +package loading diff --git a/vendor/github.com/go-openapi/swag/loading/errors.go b/vendor/github.com/go-openapi/swag/loading/errors.go new file mode 100644 index 000000000..b3964289c --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading/errors.go @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package loading + +type loadingError string + +const ( + // ErrLoader is an error raised by the file loader utility + ErrLoader loadingError = "loader error" +) + +func (e loadingError) Error() string { + return string(e) +} diff --git a/vendor/github.com/go-openapi/swag/loading/json.go b/vendor/github.com/go-openapi/swag/loading/json.go new file mode 100644 index 000000000..59db12f5c --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading/json.go @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package loading + +import ( + "encoding/json" + "errors" + "path/filepath" +) + +// JSONMatcher matches json for a file loader. +func JSONMatcher(path string) bool { + ext := filepath.Ext(path) + return ext == ".json" || ext == ".jsn" || ext == ".jso" +} + +// JSONDoc loads a json document from either a file or a remote url. +func JSONDoc(path string, opts ...Option) (json.RawMessage, error) { + data, err := LoadFromFileOrHTTP(path, opts...) + if err != nil { + return nil, errors.Join(err, ErrLoader) + } + return json.RawMessage(data), nil +} diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading/loading.go similarity index 59% rename from vendor/github.com/go-openapi/swag/loading.go rename to vendor/github.com/go-openapi/swag/loading/loading.go index 783442fdd..269fb74d1 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading/loading.go @@ -1,54 +1,26 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 -package swag +package loading import ( + "context" + "embed" "fmt" "io" "log" "net/http" "net/url" - "os" "path" "path/filepath" "runtime" "strings" - "time" ) -// LoadHTTPTimeout the default timeout for load requests -var LoadHTTPTimeout = 30 * time.Second - -// LoadHTTPBasicAuthUsername the username to use when load requests require basic auth -var LoadHTTPBasicAuthUsername = "" - -// LoadHTTPBasicAuthPassword the password to use when load requests require basic auth -var LoadHTTPBasicAuthPassword = "" - -// LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests -var LoadHTTPCustomHeaders = map[string]string{} - // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in -func LoadFromFileOrHTTP(pth string) ([]byte, error) { - return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth) -} - -// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in -// timeout arg allows for per request overriding of the request timeout -func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth) +func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) { + o := optionsWithDefaults(opts) + return LoadStrategy(pth, o.ReadFileFunc(), loadHTTPBytes(opts...), opts...)(pth) } // LoadStrategy returns a loader function for a given path or URI. @@ -81,10 +53,12 @@ func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, e // - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported) // - `file:///c:/folder/file` becomes `C:\folder\file` // - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file` -func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { +func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...Option) func(string) ([]byte, error) { if strings.HasPrefix(pth, "http") { return remote } + o := optionsWithDefaults(opts) + _, isEmbedFS := o.fs.(embed.FS) return func(p string) ([]byte, error) { upth, err := url.PathUnescape(p) @@ -92,19 +66,19 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(s return nil, err } - if !strings.HasPrefix(p, `file://`) { + cpth, hasPrefix := strings.CutPrefix(upth, "file://") + if !hasPrefix || isEmbedFS || runtime.GOOS != "windows" { + // crude processing: trim the file:// prefix. This leaves full URIs with a host with a (mostly) unexpected result // regular file path provided: just normalize slashes - return local(filepath.FromSlash(upth)) - } - - if runtime.GOOS != "windows" { - // crude processing: this leaves full URIs with a host with a (mostly) unexpected result - upth = strings.TrimPrefix(upth, `file://`) + if isEmbedFS { + // on windows, we need to slash the path if FS is an embed FS. + return local(strings.TrimLeft(filepath.ToSlash(cpth), "./")) // remove invalid leading characters for embed FS + } - return local(filepath.FromSlash(upth)) + return local(filepath.FromSlash(cpth)) } - // windows-only pre-processing of file://... URIs + // windows-only pre-processing of file://... URIs, excluding embed.FS // support for canonical file URIs on windows. u, err := url.Parse(filepath.ToSlash(upth)) @@ -139,19 +113,29 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(s } } -func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { +func loadHTTPBytes(opts ...Option) func(path string) ([]byte, error) { + o := optionsWithDefaults(opts) + return func(path string) ([]byte, error) { - client := &http.Client{Timeout: timeout} - req, err := http.NewRequest(http.MethodGet, path, nil) //nolint:noctx + client := o.client + timeoutCtx := context.Background() + var cancel func() + + if o.httpTimeout > 0 { + timeoutCtx, cancel = context.WithTimeout(timeoutCtx, o.httpTimeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, path, nil) if err != nil { return nil, err } - if LoadHTTPBasicAuthUsername != "" && LoadHTTPBasicAuthPassword != "" { - req.SetBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword) + if o.basicAuthUsername != "" && o.basicAuthPassword != "" { + req.SetBasicAuth(o.basicAuthUsername, o.basicAuthPassword) } - for key, val := range LoadHTTPCustomHeaders { + for key, val := range o.customHeaders { req.Header.Set(key, val) } @@ -168,7 +152,7 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { } if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) + return nil, fmt.Errorf("could not access document at %q [%s]: %w", path, resp.Status, ErrLoader) } return io.ReadAll(resp.Body) diff --git a/vendor/github.com/go-openapi/swag/loading/options.go b/vendor/github.com/go-openapi/swag/loading/options.go new file mode 100644 index 000000000..6674ac69e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading/options.go @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package loading + +import ( + "io/fs" + "net/http" + "os" + "time" +) + +type ( + // Option provides options for loading a file over HTTP or from a file. + Option func(*options) + + httpOptions struct { + httpTimeout time.Duration + basicAuthUsername string + basicAuthPassword string + customHeaders map[string]string + client *http.Client + } + + fileOptions struct { + fs fs.ReadFileFS + } + + options struct { + httpOptions + fileOptions + } +) + +func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) { + if fo.fs == nil { + return os.ReadFile + } + + return fo.fs.ReadFile +} + +// WithTimeout sets a timeout for the remote file loader. +// +// The default timeout is 30s. +func WithTimeout(timeout time.Duration) Option { + return func(o *options) { + o.httpTimeout = timeout + } +} + +// WithBasicAuth sets a basic authentication scheme for the remote file loader. +func WithBasicAuth(username, password string) Option { + return func(o *options) { + o.basicAuthUsername = username + o.basicAuthPassword = password + } +} + +// WithCustomHeaders sets custom headers for the remote file loader. +func WithCustomHeaders(headers map[string]string) Option { + return func(o *options) { + if o.customHeaders == nil { + o.customHeaders = make(map[string]string, len(headers)) + } + + for header, value := range headers { + o.customHeaders[header] = value + } + } +} + +// WithHTTPClient overrides the default HTTP client used to fetch a remote file. +// +// By default, [http.DefaultClient] is used. +func WithHTTPClient(client *http.Client) Option { + return func(o *options) { + o.client = client + } +} + +// WithFS sets a file system for the local file loader. +// +// If the provided file system is a [fs.ReadFileFS], the ReadFile function is used. +// Otherwise, ReadFile is wrapped using [fs.ReadFile]. +// +// By default, the file system is the one provided by the os package. +// +// For example, this may be set to consume from an embedded file system, or a rooted FS. +func WithFS(filesystem fs.FS) Option { + return func(o *options) { + if rfs, ok := filesystem.(fs.ReadFileFS); ok { + o.fs = rfs + + return + } + o.fs = readFileFS{FS: filesystem} + } +} + +type readFileFS struct { + fs.FS +} + +func (r readFileFS) ReadFile(name string) ([]byte, error) { + return fs.ReadFile(r.FS, name) +} + +func optionsWithDefaults(opts []Option) options { + const defaultTimeout = 30 * time.Second + + o := options{ + // package level defaults + httpOptions: httpOptions{ + httpTimeout: defaultTimeout, + client: http.DefaultClient, + }, + } + + for _, apply := range opts { + apply(&o) + } + + return o +} diff --git a/vendor/github.com/go-openapi/swag/loading/yaml.go b/vendor/github.com/go-openapi/swag/loading/yaml.go new file mode 100644 index 000000000..3ebb53668 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading/yaml.go @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package loading + +import ( + "encoding/json" + "path/filepath" + + "github.com/go-openapi/swag/yamlutils" +) + +// YAMLMatcher matches yaml for a file loader. +func YAMLMatcher(path string) bool { + ext := filepath.Ext(path) + return ext == ".yaml" || ext == ".yml" +} + +// YAMLDoc loads a yaml document from either http or a file and converts it to json. +func YAMLDoc(path string, opts ...Option) (json.RawMessage, error) { + yamlDoc, err := YAMLData(path, opts...) + if err != nil { + return nil, err + } + + return yamlutils.YAMLToJSON(yamlDoc) +} + +// YAMLData loads a yaml document from either http or a file. +func YAMLData(path string, opts ...Option) (any, error) { + data, err := LoadFromFileOrHTTP(path, opts...) + if err != nil { + return nil, err + } + + return yamlutils.BytesToYAMLDoc(data) +} diff --git a/vendor/github.com/go-openapi/swag/loading_iface.go b/vendor/github.com/go-openapi/swag/loading_iface.go new file mode 100644 index 000000000..27ec3fb8c --- /dev/null +++ b/vendor/github.com/go-openapi/swag/loading_iface.go @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import ( + "encoding/json" + "time" + + "github.com/go-openapi/swag/loading" +) + +var ( + // Package-level defaults for the file loading utilities (deprecated). + + // LoadHTTPTimeout the default timeout for load requests. + // + // Deprecated: use [loading.WithTimeout] instead. + LoadHTTPTimeout = 30 * time.Second + + // LoadHTTPBasicAuthUsername the username to use when load requests require basic auth. + // + // Deprecated: use [loading.WithBasicAuth] instead. + LoadHTTPBasicAuthUsername = "" + + // LoadHTTPBasicAuthPassword the password to use when load requests require basic auth. + // + // Deprecated: use [loading.WithBasicAuth] instead. + LoadHTTPBasicAuthPassword = "" + + // LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests. + // + // Deprecated: use [loading.WithCustomHeaders] instead. + LoadHTTPCustomHeaders = map[string]string{} +) + +// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the provided path. +// +// Deprecated: use [loading.LoadFromFileOrHTTP] instead. +func LoadFromFileOrHTTP(pth string, opts ...loading.Option) ([]byte, error) { + return loading.LoadFromFileOrHTTP(pth, loadingOptionsWithDefaults(opts)...) +} + +// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in +// timeout arg allows for per request overriding of the request timeout. +// +// Deprecated: use [loading.LoadFileOrHTTP] with the [loading.WithTimeout] option instead. +func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration, opts ...loading.Option) ([]byte, error) { + opts = append(opts, loading.WithTimeout(timeout)) + + return LoadFromFileOrHTTP(pth, opts...) +} + +// LoadStrategy returns a loader function for a given path or URL. +// +// Deprecated: use [loading.LoadStrategy] instead. +func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...loading.Option) func(string) ([]byte, error) { + return loading.LoadStrategy(pth, local, remote, loadingOptionsWithDefaults(opts)...) +} + +// YAMLMatcher matches yaml for a file loader. +// +// Deprecated: use [loading.YAMLMatcher] instead. +func YAMLMatcher(path string) bool { return loading.YAMLMatcher(path) } + +// YAMLDoc loads a yaml document from either http or a file and converts it to json. +// +// Deprecated: use [loading.YAMLDoc] instead. +func YAMLDoc(path string) (json.RawMessage, error) { + return loading.YAMLDoc(path) +} + +// YAMLData loads a yaml document from either http or a file. +// +// Deprecated: use [loading.YAMLData] instead. +func YAMLData(path string) (any, error) { + return loading.YAMLData(path) +} + +// loadingOptionsWithDefaults bridges deprecated default settings that use package-level variables, +// with the recommended use of loading.Option. +func loadingOptionsWithDefaults(opts []loading.Option) []loading.Option { + o := []loading.Option{ + loading.WithTimeout(LoadHTTPTimeout), + loading.WithBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword), + loading.WithCustomHeaders(LoadHTTPCustomHeaders), + } + o = append(o, opts...) + + return o +} diff --git a/vendor/github.com/go-openapi/swag/BENCHMARK.md b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md similarity index 53% rename from vendor/github.com/go-openapi/swag/BENCHMARK.md rename to vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md index e7f28ed6b..6674c63b7 100644 --- a/vendor/github.com/go-openapi/swag/BENCHMARK.md +++ b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md @@ -1,12 +1,10 @@ -# Benchmarks - -## Name mangling utilities +# Benchmarking name mangling utilities ```bash go test -bench XXX -run XXX -benchtime 30s ``` -### Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df +## Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df ``` goos: linux @@ -21,7 +19,7 @@ BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op ``` -### Benchmarks after PR #79 +## Benchmarks after PR #79 ~ x10 performance improvement and ~ /100 memory allocations. @@ -50,3 +48,43 @@ BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op ``` + +## Benchmarks at d7d2d1b895f5b6747afaff312dd2a402e69e818b + +go1.24 + +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/swag +cpu: AMD Ryzen 7 5800X 8-Core Processor +BenchmarkToXXXName/ToGoName-16 19757858 1881 ns/op 42 B/op 5 allocs/op +BenchmarkToXXXName/ToVarName-16 17494111 2094 ns/op 74 B/op 7 allocs/op +BenchmarkToXXXName/ToFileName-16 28161226 1492 ns/op 158 B/op 7 allocs/op +BenchmarkToXXXName/ToCommandName-16 23787333 1489 ns/op 158 B/op 7 allocs/op +BenchmarkToXXXName/ToHumanNameLower-16 17537257 2030 ns/op 103 B/op 6 allocs/op +BenchmarkToXXXName/ToHumanNameTitle-16 16977453 2156 ns/op 105 B/op 6 allocs/op +``` + +## Benchmarks after PR #106 + +Moving the scope of everything down to a struct allowed to reduce a bit garbage and pooling. + +On top of that, ToGoName (and thus ToVarName) have been subject to a minor optimization, removing a few allocations. + +Overall timings improve by ~ -10%. + +go1.24 + +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/swag/mangling +cpu: AMD Ryzen 7 5800X 8-Core Processor +BenchmarkToXXXName/ToGoName-16 22496130 1618 ns/op 31 B/op 3 allocs/op +BenchmarkToXXXName/ToVarName-16 22538068 1618 ns/op 33 B/op 3 allocs/op +BenchmarkToXXXName/ToFileName-16 27722977 1236 ns/op 105 B/op 6 allocs/op +BenchmarkToXXXName/ToCommandName-16 27967395 1258 ns/op 105 B/op 6 allocs/op +BenchmarkToXXXName/ToHumanNameLower-16 18587901 1917 ns/op 103 B/op 6 allocs/op +BenchmarkToXXXName/ToHumanNameTitle-16 17193208 2019 ns/op 108 B/op 7 allocs/op +``` diff --git a/vendor/k8s.io/component-helpers/LICENSE b/vendor/github.com/go-openapi/swag/mangling/LICENSE similarity index 100% rename from vendor/k8s.io/component-helpers/LICENSE rename to vendor/github.com/go-openapi/swag/mangling/LICENSE diff --git a/vendor/github.com/go-openapi/swag/mangling/doc.go b/vendor/github.com/go-openapi/swag/mangling/doc.go new file mode 100644 index 000000000..ce0d89048 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/doc.go @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package mangling provides name mangling capabilities. +// +// Name mangling is an important stage when generating code: +// it helps construct safe program identifiers that abide by the language rules +// and play along with linters. +// +// Examples: +// +// Suppose we get an object name taken from an API spec: "json_object", +// +// We may generate a legit go type name using [NameMangler.ToGoName]: "JsonObject". +// +// We may then locate this type in a source file named using [NameMangler.ToFileName]: "json_object.go". +// +// The methods exposed by the NameMangler are used to generate code in many different contexts, such as: +// +// - generating exported or unexported go identifiers from a JSON schema or an API spec +// - generating file names +// - generating human-readable comments for types and variables +// - generating JSON-like API identifiers from go code +// - ... +package mangling diff --git a/vendor/github.com/go-openapi/swag/mangling/initialism_index.go b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go new file mode 100644 index 000000000..e5b70c149 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go @@ -0,0 +1,270 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "sort" + "strings" + "unicode" + "unicode/utf8" +) + +// DefaultInitialisms returns all the initialisms configured by default for this package. +// +// # Motivation +// +// Common initialisms are acronyms for which the ordinary camel-casing rules are altered and +// for which we retain the original case. +// +// This is largely specific to the go naming conventions enforced by golint (now revive). +// +// # Example +// +// In go, "id" is a good-looking identifier, but "Id" is not and "ID" is preferred +// (notice that this stems only from conventions: the go compiler accepts all of these). +// +// Similarly, we may use "http", but not "Http". In this case, "HTTP" is preferred. +// +// # Reference and customization +// +// The default list of these casing-style exceptions is taken from the [github.com/mgechev/revive] linter for go: +// https://github.com/mgechev/revive/blob/master/lint/name.go#L93 +// +// There are a few additions to the original list, such as IPv4, IPv6 and OAI ("OpenAPI"). +// +// For these additions, "IPv4" would be preferred to "Ipv4" or "IPV4", and "OAI" to "Oai" +// +// You may redefine this list entirely using the mangler option [WithInitialisms], or simply add extra definitions +// using [WithAdditionalInitialisms]. +// +// # Mixed-case and plurals +// +// Notice that initialisms are not necessarily fully upper-cased: a mixed-case initialism indicates the preferred casing. +// +// Obviously, lower-case only initialisms do not make a lot of sense: if lower-case only initialisms are added, +// they will be considered fully capitalized. +// +// Plural forms use mixed case like "IDs". And so do values like "IPv4" or "IPv6". +// +// The [NameMangler] automatically detects simple plurals for words such as "IDs" or "APIs", +// so you don't need to configure these variants. +// +// At this moment, it doesn't support pluralization of terms that ends with an 's' (or 'S'), since there is +// no clear consensus on whether a word like DNS should be pluralized as DNSes or remain invariant. +// The [NameMangler] consider those invariant. Therefore DNSs or DNSes are not recognized as plurals for DNS. +// +// Besids, we don't want to support pluralization of terms which would otherwise conflict with another one, +// like "HTTPs" vs "HTTPS". All these should be considered invariant. Hence: "Https" matches "HTTPS" and +// "HTTPSS" is "HTTPS" followed by "S". +func DefaultInitialisms() []string { + return []string{ + "ACL", + "API", + "ASCII", + "CPU", + "CSS", + "DNS", + "EOF", + "GUID", + "HTML", + "HTTPS", + "HTTP", + "ID", + "IP", + "IPv4", // prefer the mixed case outcome IPv4 over the capitalized IPV4 + "IPv6", // prefer the mixed case outcome IPv6 over the capitalized IPV6 + "JSON", + "LHS", + "OAI", + "QPS", + "RAM", + "RHS", + "RPC", + "SLA", + "SMTP", + "SQL", + "SSH", + "TCP", + "TLS", + "TTL", + "UDP", + "UI", + "UID", + "UUID", + "URI", + "URL", + "UTF8", + "VM", + "XML", + "XMPP", + "XSRF", + "XSS", + } +} + +type indexOfInitialisms struct { + initialismsCache + + index map[string]struct{} +} + +func newIndexOfInitialisms() *indexOfInitialisms { + return &indexOfInitialisms{ + index: make(map[string]struct{}), + } +} + +func (m *indexOfInitialisms) add(words ...string) *indexOfInitialisms { + for _, word := range words { + // sanitization of injected words: trimmed from blanks, and must start with a letter + trimmed := strings.TrimSpace(word) + + firstRune, _ := utf8.DecodeRuneInString(trimmed) + if !unicode.IsLetter(firstRune) { + continue + } + + // Initialisms are case-sensitive. This means that we support mixed-case words. + // However, if specified as a lower-case string, the initialism should be fully capitalized. + if trimmed == strings.ToLower(trimmed) { + m.index[strings.ToUpper(trimmed)] = struct{}{} + + continue + } + + m.index[trimmed] = struct{}{} + } + return m +} + +func (m *indexOfInitialisms) sorted() []string { + result := make([]string, 0, len(m.index)) + for k := range m.index { + result = append(result, k) + } + sort.Sort(sort.Reverse(byInitialism(result))) + return result +} + +func (m *indexOfInitialisms) buildCache() { + m.build(m.sorted(), m.pluralForm) +} + +// initialismsCache caches all needed pre-computed and converted initialism entries, +// in the desired resolution order. +type initialismsCache struct { + initialisms []string + initialismsRunes [][]rune + initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version + initialismsPluralForm []pluralForm +} + +func (c *initialismsCache) build(in []string, pluralfunc func(string) pluralForm) { + c.initialisms = in + c.initialismsRunes = asRunes(c.initialisms) + c.initialismsUpperCased = asUpperCased(c.initialisms) + c.initialismsPluralForm = asPluralForms(c.initialisms, pluralfunc) +} + +// pluralForm denotes the kind of pluralization to be used for initialisms. +// +// At this moment, initialisms are either invariant or follow a simple plural form with an +// extra (lower case) "s". +type pluralForm uint8 + +const ( + notPlural pluralForm = iota + invariantPlural + simplePlural +) + +func (f pluralForm) String() string { + switch f { + case notPlural: + return "notPlural" + case invariantPlural: + return "invariantPlural" + case simplePlural: + return "simplePlural" + default: + return "" + } +} + +// pluralForm indicates how we want to pluralize a given initialism. +// +// Besides configured invariant forms (like HTTP and HTTPS), +// an initialism is normally pluralized by adding a single 's', like in IDs. +// +// Initialisms ending with an 'S' or an 's' are configured as invariant (we don't +// support plural forms like CSSes or DNSes, however the mechanism could be extended to +// do just that). +func (m *indexOfInitialisms) pluralForm(key string) pluralForm { + if _, ok := m.index[key]; !ok { + return notPlural + } + + if strings.HasSuffix(strings.ToUpper(key), "S") { + return invariantPlural + } + + if _, ok := m.index[key+"s"]; ok { + return invariantPlural + } + + if _, ok := m.index[key+"S"]; ok { + return invariantPlural + } + + return simplePlural +} + +type byInitialism []string + +func (s byInitialism) Len() int { + return len(s) +} +func (s byInitialism) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +// Less specifies the order in which initialisms are prioritized: +// 1. match longest first +// 2. when equal length, match in reverse lexicographical order, lower case match comes first +func (s byInitialism) Less(i, j int) bool { + if len(s[i]) != len(s[j]) { + return len(s[i]) < len(s[j]) + } + + return s[i] < s[j] +} + +func asRunes(in []string) [][]rune { + out := make([][]rune, len(in)) + for i, initialism := range in { + out[i] = []rune(initialism) + } + + return out +} + +func asUpperCased(in []string) [][]rune { + out := make([][]rune, len(in)) + + for i, initialism := range in { + out[i] = []rune(upper(trim(initialism))) + } + + return out +} + +// asPluralForms bakes an index of pluralization support. +func asPluralForms(in []string, pluralFunc func(string) pluralForm) []pluralForm { + out := make([]pluralForm, len(in)) + for i, initialism := range in { + out[i] = pluralFunc(initialism) + } + + return out +} diff --git a/vendor/github.com/go-openapi/swag/mangling/name_lexem.go b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go new file mode 100644 index 000000000..bc837e3b9 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go @@ -0,0 +1,186 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "bytes" + "strings" + "unicode" + "unicode/utf8" +) + +type ( + lexemKind uint8 + + nameLexem struct { + original string + matchedInitialism string + kind lexemKind + } +) + +const ( + lexemKindCasualName lexemKind = iota + lexemKindInitialismName +) + +func newInitialismNameLexem(original, matchedInitialism string) nameLexem { + return nameLexem{ + kind: lexemKindInitialismName, + original: original, + matchedInitialism: matchedInitialism, + } +} + +func newCasualNameLexem(original string) nameLexem { + return nameLexem{ + kind: lexemKindCasualName, + original: trim(original), // TODO: save on calls to trim + } +} + +// WriteTitleized writes the titleized lexeme to a bytes.Buffer. +// +// If the first letter cannot be capitalized, it doesn't write anything and return false, +// so the caller may attempt some workaround strategy. +func (l nameLexem) WriteTitleized(w *bytes.Buffer, alwaysUpper bool) bool { + if l.kind == lexemKindInitialismName { + w.WriteString(l.matchedInitialism) + + return true + } + + if len(l.original) == 0 { + return true + } + + if len(l.original) == 1 { + // identifier is too short: casing will depend on the context + firstByte := l.original[0] + switch { + case 'A' <= firstByte && firstByte <= 'Z': + // safe + w.WriteByte(firstByte) + + return true + case alwaysUpper && 'a' <= firstByte && firstByte <= 'z': + w.WriteByte(firstByte - 'a' + 'A') + + return true + default: + + // not a letter: skip and let the caller decide + return false + } + } + + if firstByte := l.original[0]; firstByte < utf8.RuneSelf { + // ASCII + switch { + case 'A' <= firstByte && firstByte <= 'Z': + // already an upper case letter + w.WriteString(l.original) + + return true + case 'a' <= firstByte && firstByte <= 'z': + w.WriteByte(firstByte - 'a' + 'A') + w.WriteString(l.original[1:]) + + return true + default: + // not a good candidate: doesn't start with a letter + return false + } + } + + // unicode + firstRune, idx := utf8.DecodeRuneInString(l.original) + if !unicode.IsLetter(firstRune) || !unicode.IsUpper(unicode.ToUpper(firstRune)) { + // not a good candidate: doesn't start with a letter + // or a rune for which case doesn't make sense (e.g. East-Asian runes etc) + return false + } + + rest := l.original[idx:] + w.WriteRune(unicode.ToUpper(firstRune)) + w.WriteString(strings.ToLower(rest)) + + return true +} + +// WriteLower is like write titleized but it writes a lower-case version of the lexeme. +// +// Similarly, there is no writing if the casing of the first rune doesn't make sense. +func (l nameLexem) WriteLower(w *bytes.Buffer, alwaysLower bool) bool { + if l.kind == lexemKindInitialismName { + w.WriteString(lower(l.matchedInitialism)) + + return true + } + + if len(l.original) == 0 { + return true + } + + if len(l.original) == 1 { + // identifier is too short: casing will depend on the context + firstByte := l.original[0] + switch { + case 'a' <= firstByte && firstByte <= 'z': + // safe + w.WriteByte(firstByte) + + return true + case alwaysLower && 'A' <= firstByte && firstByte <= 'Z': + w.WriteByte(firstByte - 'A' + 'a') + + return true + default: + + // not a letter: skip and let the caller decide + return false + } + } + + if firstByte := l.original[0]; firstByte < utf8.RuneSelf { + // ASCII + switch { + case 'a' <= firstByte && firstByte <= 'z': + // already a lower case letter + w.WriteString(l.original) + + return true + case 'A' <= firstByte && firstByte <= 'Z': + w.WriteByte(firstByte - 'A' + 'a') + w.WriteString(l.original[1:]) + + return true + default: + // not a good candidate: doesn't start with a letter + return false + } + } + + // unicode + firstRune, idx := utf8.DecodeRuneInString(l.original) + if !unicode.IsLetter(firstRune) || !unicode.IsLower(unicode.ToLower(firstRune)) { + // not a good candidate: doesn't start with a letter + // or a rune for which case doesn't make sense (e.g. East-Asian runes etc) + return false + } + + rest := l.original[idx:] + w.WriteRune(unicode.ToLower(firstRune)) + w.WriteString(rest) + + return true +} + +func (l nameLexem) GetOriginal() string { + return l.original +} + +func (l nameLexem) IsInitialism() bool { + return l.kind == lexemKindInitialismName +} diff --git a/vendor/github.com/go-openapi/swag/mangling/name_mangler.go b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go new file mode 100644 index 000000000..da685681d --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go @@ -0,0 +1,370 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "strings" + "unicode" +) + +// NameMangler knows how to transform sentences or words into +// identifiers that are a better fit in contexts such as: +// +// - unexported or exported go variable identifiers +// - file names +// - camel cased identifiers +// - ... +// +// The [NameMangler] is safe for concurrent use, save for its [NameMangler.AddInitialisms] method, +// which is not. +// +// # Known limitations +// +// At this moment, the [NameMangler] doesn't play well with "all caps" text: +// +// unless every single upper-cased word is declared as an initialism, capitalized words would generally +// not be transformed with the expected result, e.g. +// +// ToFileName("THIS_IS_ALL_CAPS") +// +// yields the weird outcome +// +// "t_h_i_s_i_s_a_l_l_c_a_p_s" +type NameMangler struct { + options + + index *indexOfInitialisms + + splitter splitter + splitterWithPostSplit splitter + + _ struct{} +} + +// NewNameMangler builds a name mangler ready to convert strings. +// +// The default name mangler is configured with default common initialisms and all default options. +func NewNameMangler(opts ...Option) NameMangler { + m := NameMangler{ + options: optionsWithDefaults(opts), + index: newIndexOfInitialisms(), + } + m.addInitialisms(m.commonInitialisms...) + + // a splitter that returns matches lexemes as ready-to-assemble strings: + // details of the lexemes are redeemed. + m.splitter = newSplitter( + withInitialismsCache(&m.index.initialismsCache), + withReplaceFunc(m.replaceFunc), + ) + + // a splitter that returns matches lexemes ready for post-processing + m.splitterWithPostSplit = newSplitter( + withInitialismsCache(&m.index.initialismsCache), + withReplaceFunc(m.replaceFunc), + withPostSplitInitialismCheck, + ) + + return m +} + +// AddInitialisms declares extra initialisms to the mangler. +// +// It declares extra words as "initialisms" (i.e. words that won't be camel cased or titled cased), +// on top of the existing list of common initialisms (such as ID, HTTP...). +// +// Added words must start with a (unicode) letter. If some don't, they are ignored. +// Added words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized. +// +// It is typically used just after initializing the [NameMangler]. +// +// When all initialisms are known at the time the mangler is initialized, it is preferable to +// use [NewNameMangler] with the option [WithAdditionalInitialisms]. +// +// Adding initialisms mutates the mangler and should not be carried out concurrently with other calls to the mangler. +func (m *NameMangler) AddInitialisms(words ...string) { + m.addInitialisms(words...) +} + +// Initialisms renders the list of initialisms supported by this mangler. +func (m *NameMangler) Initialisms() []string { + return m.index.initialisms +} + +// Camelize a single word. +// +// Example: +// +// - "HELLO" and "hello" become "Hello". +func (m NameMangler) Camelize(word string) string { + ru := []rune(word) + + switch len(ru) { + case 0: + return "" + case 1: + return string(unicode.ToUpper(ru[0])) + default: + camelized := poolOfBuffers.BorrowBuffer(len(word)) + camelized.Grow(len(word)) + defer func() { + poolOfBuffers.RedeemBuffer(camelized) + }() + + camelized.WriteRune(unicode.ToUpper(ru[0])) + for _, ru := range ru[1:] { + camelized.WriteRune(unicode.ToLower(ru)) + } + + return camelized.String() + } +} + +// ToFileName generates a suitable snake-case file name from a sentence. +// +// It lower-cases everything with underscore (_) as a word separator. +// +// Examples: +// +// - "Hello, Swagger" becomes "hello_swagger" +// - "HelloSwagger" becomes "hello_swagger" +func (m NameMangler) ToFileName(name string) string { + inptr := m.split(name) + in := *inptr + out := make([]string, 0, len(in)) + + for _, w := range in { + out = append(out, lower(w)) + } + poolOfStrings.RedeemStrings(inptr) + + return strings.Join(out, "_") +} + +// ToCommandName generates a suitable CLI command name from a sentence. +// +// It lower-cases everything with dash (-) as a word separator. +// +// Examples: +// +// - "Hello, Swagger" becomes "hello-swagger" +// - "HelloSwagger" becomes "hello-swagger" +func (m NameMangler) ToCommandName(name string) string { + inptr := m.split(name) + in := *inptr + out := make([]string, 0, len(in)) + + for _, w := range in { + out = append(out, lower(w)) + } + poolOfStrings.RedeemStrings(inptr) + + return strings.Join(out, "-") +} + +// ToHumanNameLower represents a code name as a human-readable series of words. +// +// It lower-cases everything with blank space as a word separator. +// +// NOTE: parts recognized as initialisms just keep their original casing. +// +// Examples: +// +// - "Hello, Swagger" becomes "hello swagger" +// - "HelloSwagger" or "Hello-Swagger" become "hello swagger" +func (m NameMangler) ToHumanNameLower(name string) string { + s := m.splitterWithPostSplit + in := s.split(name) + out := make([]string, 0, len(*in)) + + for _, w := range *in { + if !w.IsInitialism() { + out = append(out, lower(w.GetOriginal())) + } else { + out = append(out, trim(w.GetOriginal())) + } + } + + poolOfLexems.RedeemLexems(in) + + return strings.Join(out, " ") +} + +// ToHumanNameTitle represents a code name as a human-readable series of titleized words. +// +// It titleizes every word with blank space as a word separator. +// +// Examples: +// +// - "hello, Swagger" becomes "Hello Swagger" +// - "helloSwagger" becomes "Hello Swagger" +func (m NameMangler) ToHumanNameTitle(name string) string { + s := m.splitterWithPostSplit + in := s.split(name) + + out := make([]string, 0, len(*in)) + for _, w := range *in { + original := trim(w.GetOriginal()) + if !w.IsInitialism() { + out = append(out, m.Camelize(original)) + } else { + out = append(out, original) + } + } + poolOfLexems.RedeemLexems(in) + + return strings.Join(out, " ") +} + +// ToJSONName generates a camelized single-word version of a sentence. +// +// The output assembles every camelized word, but for the first word, which +// is lower-cased. +// +// Example: +// +// - "Hello_swagger" becomes "helloSwagger" +func (m NameMangler) ToJSONName(name string) string { + inptr := m.split(name) + in := *inptr + out := make([]string, 0, len(in)) + + for i, w := range in { + if i == 0 { + out = append(out, lower(w)) + continue + } + out = append(out, m.Camelize(trim(w))) + } + + poolOfStrings.RedeemStrings(inptr) + + return strings.Join(out, "") +} + +// ToVarName generates a legit unexported go variable name from a sentence. +// +// The generated name plays well with linters (see also [NameMangler.ToGoName]). +// +// Examples: +// +// - "Hello_swagger" becomes "helloSwagger" +// - "Http_server" becomes "httpServer" +// +// This name applies the same rules as [NameMangler.ToGoName] (legit exported variable), save the +// capitalization of the initial rune. +// +// Special case: when the initial part is a recognized as an initialism (like in the example above), +// the full part is lower-cased. +func (m NameMangler) ToVarName(name string) string { + return m.goIdentifier(name, false) +} + +// ToGoName generates a legit exported go variable name from a sentence. +// +// The generated name plays well with most linters. +// +// ToGoName abides by the go "exported" symbol rule starting with an upper-case letter. +// +// Examples: +// +// - "hello_swagger" becomes "HelloSwagger" +// - "Http_server" becomes "HTTPServer" +// +// # Edge cases +// +// Whenever the first rune is not eligible to upper case, a special prefix is prepended to the resulting name. +// By default this is simply "X" and you may customize this behavior using the [WithGoNamePrefixFunc] option. +// +// This happens when the first rune is not a letter, e.g. a digit, or a symbol that has no word transliteration +// (see also [WithReplaceFunc] about symbol transliterations), +// as well as for most East Asian or Devanagari runes, for which there is no such concept as upper-case. +// +// # Linting +// +// [revive], the successor of golint is the reference linter. +// +// This means that [NameMangler.ToGoName] supports the initialisms that revive checks (see also [DefaultInitialisms]). +// +// At this moment, there is no attempt to transliterate unicode into ascii, meaning that some linters +// (e.g. asciicheck, gosmopolitan) may croak on go identifiers generated from unicode input. +// +// [revive]: https://github.com/mgechev/revive +func (m NameMangler) ToGoName(name string) string { + return m.goIdentifier(name, true) +} + +func (m NameMangler) goIdentifier(name string, exported bool) string { + s := m.splitterWithPostSplit + lexems := s.split(name) + defer func() { + poolOfLexems.RedeemLexems(lexems) + }() + lexemes := *lexems + + if len(lexemes) == 0 { + return "" + } + + result := poolOfBuffers.BorrowBuffer(len(name)) + defer func() { + poolOfBuffers.RedeemBuffer(result) + }() + + firstPart := lexemes[0] + if !exported { + if ok := firstPart.WriteLower(result, true); !ok { + // NOTE: an initialism as the first part is lower-cased: no longer generates stuff like hTTPxyz. + // + // same prefixing rule applied to unexported variable as to an exported one, so that we have consistent + // names, whether the generated identifier is exported or not. + result.WriteString(strings.ToLower(m.prefixFunc()(name))) + result.WriteString(lexemes[0].GetOriginal()) + } + } else { + if ok := firstPart.WriteTitleized(result, true); !ok { + // "repairs" a lexeme that doesn't start with a letter to become + // the start a legit go name. The current strategy is very crude and simply adds a fixed prefix, + // e.g. "X". + // For instance "1_sesame_street" would be split into lexemes ["1", "sesame", "street"] and + // the first one ("1") would result in something like "X1" (with the default prefix function). + // + // NOTE: no longer forcing the first part to be fully upper-cased + result.WriteString(m.prefixFunc()(name)) + result.WriteString(lexemes[0].GetOriginal()) + } + } + + for _, lexem := range lexemes[1:] { + // NOTE: no longer forcing initialism parts to be fully upper-cased: + // * pluralized initialism preserve their trailing "s" + // * mixed-cased initialisms, such as IPv4, are preserved + if ok := lexem.WriteTitleized(result, false); !ok { + // it's not titleized: perhaps it's too short, perhaps the first rune is not a letter. + // write anyway + result.WriteString(lexem.GetOriginal()) + } + } + + return result.String() +} + +func (m *NameMangler) addInitialisms(words ...string) { + m.index.add(words...) + m.index.buildCache() +} + +// split calls the inner splitter. +func (m NameMangler) split(str string) *[]string { + s := m.splitter + lexems := s.split(str) + result := poolOfStrings.BorrowStrings() + + for _, lexem := range *lexems { + *result = append(*result, lexem.GetOriginal()) + } + poolOfLexems.RedeemLexems(lexems) + + return result +} diff --git a/vendor/github.com/go-openapi/swag/mangling/options.go b/vendor/github.com/go-openapi/swag/mangling/options.go new file mode 100644 index 000000000..3c92b2f18 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/options.go @@ -0,0 +1,150 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +type ( + // PrefixFunc defines a safeguard rule (that may depend on the input string), to prefix + // a generated go name (in [NameMangler.ToGoName] and [NameMangler.ToVarName]). + // + // See [NameMangler.ToGoName] for more about which edge cases the prefix function covers. + PrefixFunc func(string) string + + // ReplaceFunc is a transliteration function to replace special runes by a word. + ReplaceFunc func(r rune) (string, bool) + + // Option to configure a [NameMangler]. + Option func(*options) + + options struct { + commonInitialisms []string + + goNamePrefixFunc PrefixFunc + goNamePrefixFuncPtr *PrefixFunc + replaceFunc func(r rune) (string, bool) + } +) + +func (o *options) prefixFunc() PrefixFunc { + if o.goNamePrefixFuncPtr != nil && *o.goNamePrefixFuncPtr != nil { + return *o.goNamePrefixFuncPtr + } + + return o.goNamePrefixFunc +} + +// WithGoNamePrefixFunc overrides the default prefix rule to safeguard generated go names. +// +// Example: +// +// This helps convert "123" into "{prefix}123" (a very crude strategy indeed, but it works). +// +// See [github.com/go-swagger/go-swagger/generator.DefaultFuncMap] for an example. +// +// The prefix function is assumed to return a string that starts with an upper case letter. +// +// The default is to prefix with "X". +// +// See [NameMangler.ToGoName] for more about which edge cases the prefix function covers. +func WithGoNamePrefixFunc(fn PrefixFunc) Option { + return func(o *options) { + o.goNamePrefixFunc = fn + } +} + +// WithGoNamePrefixFuncPtr is like [WithGoNamePrefixFunc] but it specifies a pointer to a function. +// +// [WithGoNamePrefixFunc] should be preferred in most situations. This option should only serve the +// purpose of handling special situations where the prefix function is not an internal variable +// (e.g. an exported package global). +// +// [WithGoNamePrefixFuncPtr] supersedes [WithGoNamePrefixFunc] if it also specified. +// +// If the provided pointer is nil or points to a nil value, this option has no effect. +// +// The caller should ensure that no undesirable concurrent changes are applied to the function pointed to. +func WithGoNamePrefixFuncPtr(ptr *PrefixFunc) Option { + return func(o *options) { + o.goNamePrefixFuncPtr = ptr + } +} + +// WithInitialisms declares the initialisms this mangler supports. +// +// This supersedes any pre-loaded defaults (see [DefaultInitialisms] for more about what initialisms are). +// +// It declares words to be recognized as "initialisms" (i.e. words that won't be camel cased or titled cased). +// +// Words must start with a (unicode) letter. If some don't, they are ignored. +// Words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized. +func WithInitialisms(words ...string) Option { + return func(o *options) { + o.commonInitialisms = words + } +} + +// WithAdditionalInitialisms adds new initialisms to the currently supported list (see [DefaultInitialisms]). +// +// The same sanitization rules apply as those described for [WithInitialisms]. +func WithAdditionalInitialisms(words ...string) Option { + return func(o *options) { + o.commonInitialisms = append(o.commonInitialisms, words...) + } +} + +// WithReplaceFunc specifies a custom transliteration function instead of the default. +// +// The default translates the following characters into words as follows: +// +// - '@' -> 'At' +// - '&' -> 'And' +// - '|' -> 'Pipe' +// - '$' -> 'Dollar' +// - '!' -> 'Bang' +// +// Notice that the outcome of a transliteration should always be titleized. +func WithReplaceFunc(fn ReplaceFunc) Option { + return func(o *options) { + o.replaceFunc = fn + } +} + +func defaultPrefixFunc(_ string) string { + return "X" +} + +// defaultReplaceTable finds a word representation for special characters. +func defaultReplaceTable(r rune) (string, bool) { + switch r { + case '@': + return "At ", true + case '&': + return "And ", true + case '|': + return "Pipe ", true + case '$': + return "Dollar ", true + case '!': + return "Bang ", true + case '-': + return "", true + case '_': + return "", true + default: + return "", false + } +} + +func optionsWithDefaults(opts []Option) options { + o := options{ + commonInitialisms: DefaultInitialisms(), + goNamePrefixFunc: defaultPrefixFunc, + replaceFunc: defaultReplaceTable, + } + + for _, apply := range opts { + apply(&o) + } + + return o +} diff --git a/vendor/github.com/go-openapi/swag/mangling/pools.go b/vendor/github.com/go-openapi/swag/mangling/pools.go new file mode 100644 index 000000000..f81043514 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/pools.go @@ -0,0 +1,123 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "bytes" + "sync" +) + +const maxAllocMatches = 8 + +type ( + // memory pools of temporary objects. + // + // These are used to recycle temporarily allocated objects + // and relieve the GC from undue pressure. + + matchesPool struct { + *sync.Pool + } + + buffersPool struct { + *sync.Pool + } + + lexemsPool struct { + *sync.Pool + } + + stringsPool struct { + *sync.Pool + } +) + +var ( + // poolOfMatches holds temporary slices for recycling during the initialism match process + poolOfMatches = matchesPool{ + Pool: &sync.Pool{ + New: func() any { + s := make(initialismMatches, 0, maxAllocMatches) + + return &s + }, + }, + } + + poolOfBuffers = buffersPool{ + Pool: &sync.Pool{ + New: func() any { + return new(bytes.Buffer) + }, + }, + } + + poolOfLexems = lexemsPool{ + Pool: &sync.Pool{ + New: func() any { + s := make([]nameLexem, 0, maxAllocMatches) + + return &s + }, + }, + } + + poolOfStrings = stringsPool{ + Pool: &sync.Pool{ + New: func() any { + s := make([]string, 0, maxAllocMatches) + + return &s + }, + }, + } +) + +func (p matchesPool) BorrowMatches() *initialismMatches { + s := p.Get().(*initialismMatches) + *s = (*s)[:0] // reset slice, keep allocated capacity + + return s +} + +func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer { + s := p.Get().(*bytes.Buffer) + s.Reset() + + if s.Cap() < size { + s.Grow(size) + } + + return s +} + +func (p lexemsPool) BorrowLexems() *[]nameLexem { + s := p.Get().(*[]nameLexem) + *s = (*s)[:0] // reset slice, keep allocated capacity + + return s +} + +func (p stringsPool) BorrowStrings() *[]string { + s := p.Get().(*[]string) + *s = (*s)[:0] // reset slice, keep allocated capacity + + return s +} + +func (p matchesPool) RedeemMatches(s *initialismMatches) { + p.Put(s) +} + +func (p buffersPool) RedeemBuffer(s *bytes.Buffer) { + p.Put(s) +} + +func (p lexemsPool) RedeemLexems(s *[]nameLexem) { + p.Put(s) +} + +func (p stringsPool) RedeemStrings(s *[]string) { + p.Put(s) +} diff --git a/vendor/github.com/go-openapi/swag/mangling/split.go b/vendor/github.com/go-openapi/swag/mangling/split.go new file mode 100644 index 000000000..ed12ea256 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/split.go @@ -0,0 +1,341 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "fmt" + "unicode" +) + +type splitterOption func(*splitter) + +// withPostSplitInitialismCheck allows to catch initialisms after main split process +func withPostSplitInitialismCheck(s *splitter) { + s.postSplitInitialismCheck = true +} + +func withReplaceFunc(fn ReplaceFunc) func(*splitter) { + return func(s *splitter) { + s.replaceFunc = fn + } +} + +func withInitialismsCache(c *initialismsCache) splitterOption { + return func(s *splitter) { + s.initialismsCache = c + } +} + +type ( + initialismMatch struct { + body []rune + start, end int + complete bool + hasPlural pluralForm + } + initialismMatches []initialismMatch +) + +// String representation of a match, e.g. for debugging. +func (m initialismMatch) String() string { + return fmt.Sprintf("{body: %s (%d), start: %d, end; %d, complete: %t, hasPlural: %v}", + string(m.body), len(m.body), m.start, m.end, m.complete, m.hasPlural, + ) +} + +func (m initialismMatch) isZero() bool { + return m.start == 0 && m.end == 0 +} + +type splitter struct { + *initialismsCache + + postSplitInitialismCheck bool + replaceFunc ReplaceFunc +} + +func newSplitter(options ...splitterOption) splitter { + var s splitter + + for _, option := range options { + option(&s) + } + + if s.replaceFunc == nil { + s.replaceFunc = defaultReplaceTable + } + + return s +} + +func (s splitter) split(name string) *[]nameLexem { + nameRunes := []rune(name) + matches := s.gatherInitialismMatches(nameRunes) + if matches == nil { + return poolOfLexems.BorrowLexems() + } + + return s.mapMatchesToNameLexems(nameRunes, matches) +} + +func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches { + matches := poolOfMatches.BorrowMatches() + const minLenInitialism = 1 + if len(nameRunes) < minLenInitialism+1 { + // can't match initialism with 0 or 1 rune + return matches + } + + // first iteration + s.findMatches(matches, nameRunes, nameRunes[0], 0) + + for i, currentRune := range nameRunes[1:] { + currentRunePosition := i + 1 + // recycle allocations as we loop over runes + // with such recycling, only 2 slices should be allocated per call + // instead of o(n). + // + // BorrowMatches always yields slices with zero length (with some capacity) + newMatches := poolOfMatches.BorrowMatches() + + // check current initialism matches + for _, match := range *matches { + if keepCompleteMatch := match.complete; keepCompleteMatch { + // the match is already complete: keep it then move on to the next match + *newMatches = append(*newMatches, match) + continue + } + + if currentRunePosition-match.start == len(match.body) { + // unmatched: skip + continue + } + + // 1. by construction of the matches, we can't have currentRunePosition - match.start < 0 + // because matches have been computed with their start <= currentRunePosition in the previous + // iterations. + // 2. by construction of the matches, we can't have currentRunePosition - match.start >= len(match.body) + + currentMatchRune := match.body[currentRunePosition-match.start] + if currentMatchRune != currentRune { + // failed match, discard it then move on to the next match + continue + } + + // try to complete the current match + if currentRunePosition-match.start == len(match.body)-1 { + // we are close: the next step is to check the symbol ahead + // if it is a lowercase letter, then it is not the end of match + // but the beginning of the next word. + // + // NOTE(fredbi): this heuristic sometimes leads to counterintuitive splits and + // perhaps (not sure yet) we should check against case _alternance_. + // + // Example: + // + // In the current version, in the sentence "IDS initialism", "ID" is recognized as an initialism, + // leading to a split like "id_s_initialism" (or IDSInitialism), + // whereas in the sentence "IDx initialism", it is not and produces something like + // "i_d_x_initialism" (or IDxInitialism). The generated file name is not great. + // + // Both go identifiers are tolerated by linters. + // + // Notice that the slightly different input "IDs initialism" is correctly detected + // as a pluralized initialism and produces something like "ids_initialism" (or IDsInitialism). + + if currentRunePosition < len(nameRunes)-1 { // when before the last rune + nextRune := nameRunes[currentRunePosition+1] + + // recognize a plural form for this initialism (only simple english pluralization is supported). + if nextRune == 's' && match.hasPlural == simplePlural { + // detected a pluralized initialism + match.body = append(match.body, nextRune) + lookAhead := currentRunePosition + 1 + if lookAhead < len(nameRunes)-1 { + nextRune = nameRunes[lookAhead+1] + if newWord := unicode.IsLower(nextRune); newWord { + // it is the start of a new word. + // Match is only partial and the initialism is not recognized: + // move on to the next match, but do not advance the rune position + continue + } + } + + // this is a pluralized match: keep it + currentRunePosition++ + match.complete = true + match.hasPlural = simplePlural + match.end = currentRunePosition + *newMatches = append(*newMatches, match) + + // match is complete: keep it then move on to the next match + continue + } + + // other cases + // example: invariant plural such as "TLS" + if newWord := unicode.IsLower(nextRune); newWord { + // it is the start of a new word + // Match is only partial and the initialism is not recognized : move on + continue + } + } + + match.complete = true + match.end = currentRunePosition + } + + // append the ongoing matching attempt: it is not necessarily complete, but was successful so far. + // Let's see if it still matches on the next rune. + *newMatches = append(*newMatches, match) + } + + s.findMatches(newMatches, nameRunes, currentRune, currentRunePosition) + + poolOfMatches.RedeemMatches(matches) + matches = newMatches + } + + // it is up to the caller to redeem this last slice + return matches +} + +func (s splitter) findMatches(newMatches *initialismMatches, nameRunes []rune, currentRune rune, currentRunePosition int) { + // check for new initialism matches, based on the first character + for i, r := range s.initialismsRunes { + if r[0] != currentRune { + continue + } + + if currentRunePosition+len(r) > len(nameRunes) { + continue // not eligible: would spilll over the initial string + } + + // possible matches: all initialisms starting with the current rune and that can fit the given string (nameRunes) + *newMatches = append(*newMatches, initialismMatch{ + start: currentRunePosition, + body: r, + complete: false, + hasPlural: s.initialismsPluralForm[i], + }) + } +} + +func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem { + nameLexems := poolOfLexems.BorrowLexems() + + var lastAcceptedMatch initialismMatch + for _, match := range *matches { + if !match.complete { + continue + } + + if firstMatch := lastAcceptedMatch.isZero(); firstMatch { + s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start]) + *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body))) + + lastAcceptedMatch = match + + continue + } + + if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch { + continue + } + + middle := nameRunes[lastAcceptedMatch.end+1 : match.start] + s.appendBrokenDownCasualString(nameLexems, middle) + *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body))) + + lastAcceptedMatch = match + } + + // we have not found any accepted matches + if lastAcceptedMatch.isZero() { + *nameLexems = (*nameLexems)[:0] + s.appendBrokenDownCasualString(nameLexems, nameRunes) + } else if lastAcceptedMatch.end+1 != len(nameRunes) { + rest := nameRunes[lastAcceptedMatch.end+1:] + s.appendBrokenDownCasualString(nameLexems, rest) + } + + poolOfMatches.RedeemMatches(matches) + + return nameLexems +} + +func (s splitter) breakInitialism(original string) nameLexem { + return newInitialismNameLexem(original, original) +} + +func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) { + currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused + defer func() { + poolOfBuffers.RedeemBuffer(currentSegment) + }() + + addCasualNameLexem := func(original string) { + *segments = append(*segments, newCasualNameLexem(original)) + } + + addInitialismNameLexem := func(original, match string) { + *segments = append(*segments, newInitialismNameLexem(original, match)) + } + + var addNameLexem func(string) + if s.postSplitInitialismCheck { + addNameLexem = func(original string) { + for i := range s.initialisms { + if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) { + addInitialismNameLexem(original, s.initialisms[i]) + + return + } + } + + addCasualNameLexem(original) + } + } else { + addNameLexem = addCasualNameLexem + } + + // NOTE: (performance). The few remaining non-amortized allocations + // lay in the code below: using String() forces + for _, rn := range str { + if replace, found := s.replaceFunc(rn); found { + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + currentSegment.Reset() + } + + if replace != "" { + addNameLexem(replace) + } + + continue + } + + if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) { + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + currentSegment.Reset() + } + + continue + } + + if unicode.IsUpper(rn) { + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + } + currentSegment.Reset() + } + + currentSegment.WriteRune(rn) + } + + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + } +} diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go similarity index 60% rename from vendor/github.com/go-openapi/swag/string_bytes.go rename to vendor/github.com/go-openapi/swag/mangling/string_bytes.go index 90745d5ca..28daaf72b 100644 --- a/vendor/github.com/go-openapi/swag/string_bytes.go +++ b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go @@ -1,4 +1,7 @@ -package swag +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling import "unsafe" diff --git a/vendor/github.com/go-openapi/swag/mangling/util.go b/vendor/github.com/go-openapi/swag/mangling/util.go new file mode 100644 index 000000000..0636417e3 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling/util.go @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package mangling + +import ( + "strings" + "unicode" + "unicode/utf8" +) + +// Removes leading whitespaces +func trim(str string) string { return strings.TrimSpace(str) } + +// upper is strings.ToUpper() combined with trim +func upper(str string) string { + return strings.ToUpper(trim(str)) +} + +// lower is strings.ToLower() combined with trim +func lower(str string) string { + return strings.ToLower(trim(str)) +} + +// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but +// it ignores leading and trailing blank spaces in the compared +// string. +// +// base is assumed to be composed of upper-cased runes, and be already +// trimmed. +// +// This code is heavily inspired from strings.EqualFold. +func isEqualFoldIgnoreSpace(base []rune, str string) bool { + var i, baseIndex int + // equivalent to b := []byte(str), but without data copy + b := hackStringBytes(str) + + for i < len(b) { + if c := b[i]; c < utf8.RuneSelf { + // fast path for ASCII + if c != ' ' && c != '\t' { + break + } + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if !unicode.IsSpace(r) { + break + } + i += size + } + + if i >= len(b) { + return len(base) == 0 + } + + for _, baseRune := range base { + if i >= len(b) { + break + } + + if c := b[i]; c < utf8.RuneSelf { + // single byte rune case (ASCII) + if baseRune >= utf8.RuneSelf { + return false + } + + baseChar := byte(baseRune) + if c != baseChar && ((c < 'a') || (c > 'z') || (c-'a'+'A' != baseChar)) { + return false + } + + baseIndex++ + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if unicode.ToUpper(r) != baseRune { + return false + } + baseIndex++ + i += size + } + + if baseIndex != len(base) { + return false + } + + // all passed: now we should only have blanks + for i < len(b) { + if c := b[i]; c < utf8.RuneSelf { + // fast path for ASCII + if c != ' ' && c != '\t' { + return false + } + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if !unicode.IsSpace(r) { + return false + } + + i += size + } + + return true +} diff --git a/vendor/github.com/go-openapi/swag/mangling_iface.go b/vendor/github.com/go-openapi/swag/mangling_iface.go new file mode 100644 index 000000000..98b9a9992 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/mangling_iface.go @@ -0,0 +1,69 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/mangling" + +// GoNamePrefixFunc sets an optional rule to prefix go names +// which do not start with a letter. +// +// GoNamePrefixFunc should not be written to while concurrently using the other mangling functions of this package. +// +// Deprecated: use [mangling.WithGoNamePrefixFunc] instead. +var GoNamePrefixFunc mangling.PrefixFunc + +// swagNameMangler is a global instance of the name mangler specifically alloted +// to support deprecated functions. +var swagNameMangler = mangling.NewNameMangler( + mangling.WithGoNamePrefixFuncPtr(&GoNamePrefixFunc), +) + +// AddInitialisms adds additional initialisms to the default list (see [mangling.DefaultInitialisms]). +// +// AddInitialisms is not safe to be called concurrently. +// +// Deprecated: use [mangling.WithAdditionalInitialisms] instead. +func AddInitialisms(words ...string) { + swagNameMangler.AddInitialisms(words...) +} + +// Camelize a single word. +// +// Deprecated: use [mangling.NameMangler.Camelize] instead. +func Camelize(word string) string { return swagNameMangler.Camelize(word) } + +// ToFileName lowercases and underscores a go type name. +// +// Deprecated: use [mangling.NameMangler.ToFileName] instead. +func ToFileName(name string) string { return swagNameMangler.ToFileName(name) } + +// ToCommandName lowercases and underscores a go type name. +// +// Deprecated: use [mangling.NameMangler.ToCommandName] instead. +func ToCommandName(name string) string { return swagNameMangler.ToCommandName(name) } + +// ToHumanNameLower represents a code name as a human series of words. +// +// Deprecated: use [mangling.NameMangler.ToHumanNameLower] instead. +func ToHumanNameLower(name string) string { return swagNameMangler.ToHumanNameLower(name) } + +// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized. +// +// Deprecated: use [mangling.NameMangler.ToHumanNameTitle] instead. +func ToHumanNameTitle(name string) string { return swagNameMangler.ToHumanNameTitle(name) } + +// ToJSONName camel-cases a name which can be underscored or pascal-cased. +// +// Deprecated: use [mangling.NameMangler.ToJSONName] instead. +func ToJSONName(name string) string { return swagNameMangler.ToJSONName(name) } + +// ToVarName camel-cases a name which can be underscored or pascal-cased. +// +// Deprecated: use [mangling.NameMangler.ToVarName] instead. +func ToVarName(name string) string { return swagNameMangler.ToVarName(name) } + +// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes. +// +// Deprecated: use [mangling.NameMangler.ToGoName] instead. +func ToGoName(name string) string { return swagNameMangler.ToGoName(name) } diff --git a/vendor/github.com/go-openapi/swag/name_lexem.go b/vendor/github.com/go-openapi/swag/name_lexem.go deleted file mode 100644 index 8bb64ac32..000000000 --- a/vendor/github.com/go-openapi/swag/name_lexem.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "unicode" - "unicode/utf8" -) - -type ( - lexemKind uint8 - - nameLexem struct { - original string - matchedInitialism string - kind lexemKind - } -) - -const ( - lexemKindCasualName lexemKind = iota - lexemKindInitialismName -) - -func newInitialismNameLexem(original, matchedInitialism string) nameLexem { - return nameLexem{ - kind: lexemKindInitialismName, - original: original, - matchedInitialism: matchedInitialism, - } -} - -func newCasualNameLexem(original string) nameLexem { - return nameLexem{ - kind: lexemKindCasualName, - original: original, - } -} - -func (l nameLexem) GetUnsafeGoName() string { - if l.kind == lexemKindInitialismName { - return l.matchedInitialism - } - - var ( - first rune - rest string - ) - - for i, orig := range l.original { - if i == 0 { - first = orig - continue - } - - if i > 0 { - rest = l.original[i:] - break - } - } - - if len(l.original) > 1 { - b := poolOfBuffers.BorrowBuffer(utf8.UTFMax + len(rest)) - defer func() { - poolOfBuffers.RedeemBuffer(b) - }() - b.WriteRune(unicode.ToUpper(first)) - b.WriteString(lower(rest)) - return b.String() - } - - return l.original -} - -func (l nameLexem) GetOriginal() string { - return l.original -} - -func (l nameLexem) IsInitialism() bool { - return l.kind == lexemKindInitialismName -} diff --git a/vendor/github.com/go-openapi/swag/net.go b/vendor/github.com/go-openapi/swag/net.go deleted file mode 100644 index 821235f84..000000000 --- a/vendor/github.com/go-openapi/swag/net.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "net" - "strconv" -) - -// SplitHostPort splits a network address into a host and a port. -// The port is -1 when there is no port to be found -func SplitHostPort(addr string) (host string, port int, err error) { - h, p, err := net.SplitHostPort(addr) - if err != nil { - return "", -1, err - } - if p == "" { - return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr} - } - - pi, err := strconv.Atoi(p) - if err != nil { - return "", -1, err - } - return h, pi, nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/errors/LICENSE b/vendor/github.com/go-openapi/swag/netutils/LICENSE similarity index 100% rename from vendor/k8s.io/kube-openapi/pkg/validation/errors/LICENSE rename to vendor/github.com/go-openapi/swag/netutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/netutils/doc.go b/vendor/github.com/go-openapi/swag/netutils/doc.go new file mode 100644 index 000000000..74282f8e5 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/netutils/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package netutils provides helpers for network-related tasks. +package netutils diff --git a/vendor/github.com/go-openapi/swag/netutils/net.go b/vendor/github.com/go-openapi/swag/netutils/net.go new file mode 100644 index 000000000..82a1544af --- /dev/null +++ b/vendor/github.com/go-openapi/swag/netutils/net.go @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package netutils + +import ( + "net" + "strconv" +) + +// SplitHostPort splits a network address into a host and a port. +// +// The difference with the standard net.SplitHostPort is that the port is converted to an int. +// +// The port is -1 when there is no port to be found. +func SplitHostPort(addr string) (host string, port int, err error) { + h, p, err := net.SplitHostPort(addr) + if err != nil { + return "", -1, err + } + if p == "" { + return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr} + } + + pi, err := strconv.Atoi(p) + if err != nil { + return "", -1, err + } + + return h, pi, nil +} diff --git a/vendor/github.com/go-openapi/swag/netutils_iface.go b/vendor/github.com/go-openapi/swag/netutils_iface.go new file mode 100644 index 000000000..d658de25b --- /dev/null +++ b/vendor/github.com/go-openapi/swag/netutils_iface.go @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/netutils" + +// SplitHostPort splits a network address into a host and a port. +// +// Deprecated: use [netutils.SplitHostPort] instead. +func SplitHostPort(addr string) (host string, port int, err error) { + return netutils.SplitHostPort(addr) +} diff --git a/vendor/github.com/go-openapi/swag/split.go b/vendor/github.com/go-openapi/swag/split.go deleted file mode 100644 index 274727a86..000000000 --- a/vendor/github.com/go-openapi/swag/split.go +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "bytes" - "sync" - "unicode" - "unicode/utf8" -) - -type ( - splitter struct { - initialisms []string - initialismsRunes [][]rune - initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version - postSplitInitialismCheck bool - } - - splitterOption func(*splitter) - - initialismMatch struct { - body []rune - start, end int - complete bool - } - initialismMatches []initialismMatch -) - -type ( - // memory pools of temporary objects. - // - // These are used to recycle temporarily allocated objects - // and relieve the GC from undue pressure. - - matchesPool struct { - *sync.Pool - } - - buffersPool struct { - *sync.Pool - } - - lexemsPool struct { - *sync.Pool - } - - splittersPool struct { - *sync.Pool - } -) - -var ( - // poolOfMatches holds temporary slices for recycling during the initialism match process - poolOfMatches = matchesPool{ - Pool: &sync.Pool{ - New: func() any { - s := make(initialismMatches, 0, maxAllocMatches) - - return &s - }, - }, - } - - poolOfBuffers = buffersPool{ - Pool: &sync.Pool{ - New: func() any { - return new(bytes.Buffer) - }, - }, - } - - poolOfLexems = lexemsPool{ - Pool: &sync.Pool{ - New: func() any { - s := make([]nameLexem, 0, maxAllocMatches) - - return &s - }, - }, - } - - poolOfSplitters = splittersPool{ - Pool: &sync.Pool{ - New: func() any { - s := newSplitter() - - return &s - }, - }, - } -) - -// nameReplaceTable finds a word representation for special characters. -func nameReplaceTable(r rune) (string, bool) { - switch r { - case '@': - return "At ", true - case '&': - return "And ", true - case '|': - return "Pipe ", true - case '$': - return "Dollar ", true - case '!': - return "Bang ", true - case '-': - return "", true - case '_': - return "", true - default: - return "", false - } -} - -// split calls the splitter. -// -// Use newSplitter for more control and options -func split(str string) []string { - s := poolOfSplitters.BorrowSplitter() - lexems := s.split(str) - result := make([]string, 0, len(*lexems)) - - for _, lexem := range *lexems { - result = append(result, lexem.GetOriginal()) - } - poolOfLexems.RedeemLexems(lexems) - poolOfSplitters.RedeemSplitter(s) - - return result - -} - -func newSplitter(options ...splitterOption) splitter { - s := splitter{ - postSplitInitialismCheck: false, - initialisms: initialisms, - initialismsRunes: initialismsRunes, - initialismsUpperCased: initialismsUpperCased, - } - - for _, option := range options { - option(&s) - } - - return s -} - -// withPostSplitInitialismCheck allows to catch initialisms after main split process -func withPostSplitInitialismCheck(s *splitter) { - s.postSplitInitialismCheck = true -} - -func (p matchesPool) BorrowMatches() *initialismMatches { - s := p.Get().(*initialismMatches) - *s = (*s)[:0] // reset slice, keep allocated capacity - - return s -} - -func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer { - s := p.Get().(*bytes.Buffer) - s.Reset() - - if s.Cap() < size { - s.Grow(size) - } - - return s -} - -func (p lexemsPool) BorrowLexems() *[]nameLexem { - s := p.Get().(*[]nameLexem) - *s = (*s)[:0] // reset slice, keep allocated capacity - - return s -} - -func (p splittersPool) BorrowSplitter(options ...splitterOption) *splitter { - s := p.Get().(*splitter) - s.postSplitInitialismCheck = false // reset options - for _, apply := range options { - apply(s) - } - - return s -} - -func (p matchesPool) RedeemMatches(s *initialismMatches) { - p.Put(s) -} - -func (p buffersPool) RedeemBuffer(s *bytes.Buffer) { - p.Put(s) -} - -func (p lexemsPool) RedeemLexems(s *[]nameLexem) { - p.Put(s) -} - -func (p splittersPool) RedeemSplitter(s *splitter) { - p.Put(s) -} - -func (m initialismMatch) isZero() bool { - return m.start == 0 && m.end == 0 -} - -func (s splitter) split(name string) *[]nameLexem { - nameRunes := []rune(name) - matches := s.gatherInitialismMatches(nameRunes) - if matches == nil { - return poolOfLexems.BorrowLexems() - } - - return s.mapMatchesToNameLexems(nameRunes, matches) -} - -func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches { - var matches *initialismMatches - - for currentRunePosition, currentRune := range nameRunes { - // recycle these allocations as we loop over runes - // with such recycling, only 2 slices should be allocated per call - // instead of o(n). - newMatches := poolOfMatches.BorrowMatches() - - // check current initialism matches - if matches != nil { // skip first iteration - for _, match := range *matches { - if keepCompleteMatch := match.complete; keepCompleteMatch { - *newMatches = append(*newMatches, match) - continue - } - - // drop failed match - currentMatchRune := match.body[currentRunePosition-match.start] - if currentMatchRune != currentRune { - continue - } - - // try to complete ongoing match - if currentRunePosition-match.start == len(match.body)-1 { - // we are close; the next step is to check the symbol ahead - // if it is a small letter, then it is not the end of match - // but beginning of the next word - - if currentRunePosition < len(nameRunes)-1 { - nextRune := nameRunes[currentRunePosition+1] - if newWord := unicode.IsLower(nextRune); newWord { - // oh ok, it was the start of a new word - continue - } - } - - match.complete = true - match.end = currentRunePosition - } - - *newMatches = append(*newMatches, match) - } - } - - // check for new initialism matches - for i := range s.initialisms { - initialismRunes := s.initialismsRunes[i] - if initialismRunes[0] == currentRune { - *newMatches = append(*newMatches, initialismMatch{ - start: currentRunePosition, - body: initialismRunes, - complete: false, - }) - } - } - - if matches != nil { - poolOfMatches.RedeemMatches(matches) - } - matches = newMatches - } - - // up to the caller to redeem this last slice - return matches -} - -func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem { - nameLexems := poolOfLexems.BorrowLexems() - - var lastAcceptedMatch initialismMatch - for _, match := range *matches { - if !match.complete { - continue - } - - if firstMatch := lastAcceptedMatch.isZero(); firstMatch { - s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start]) - *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body))) - - lastAcceptedMatch = match - - continue - } - - if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch { - continue - } - - middle := nameRunes[lastAcceptedMatch.end+1 : match.start] - s.appendBrokenDownCasualString(nameLexems, middle) - *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body))) - - lastAcceptedMatch = match - } - - // we have not found any accepted matches - if lastAcceptedMatch.isZero() { - *nameLexems = (*nameLexems)[:0] - s.appendBrokenDownCasualString(nameLexems, nameRunes) - } else if lastAcceptedMatch.end+1 != len(nameRunes) { - rest := nameRunes[lastAcceptedMatch.end+1:] - s.appendBrokenDownCasualString(nameLexems, rest) - } - - poolOfMatches.RedeemMatches(matches) - - return nameLexems -} - -func (s splitter) breakInitialism(original string) nameLexem { - return newInitialismNameLexem(original, original) -} - -func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) { - currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused - defer func() { - poolOfBuffers.RedeemBuffer(currentSegment) - }() - - addCasualNameLexem := func(original string) { - *segments = append(*segments, newCasualNameLexem(original)) - } - - addInitialismNameLexem := func(original, match string) { - *segments = append(*segments, newInitialismNameLexem(original, match)) - } - - var addNameLexem func(string) - if s.postSplitInitialismCheck { - addNameLexem = func(original string) { - for i := range s.initialisms { - if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) { - addInitialismNameLexem(original, s.initialisms[i]) - - return - } - } - - addCasualNameLexem(original) - } - } else { - addNameLexem = addCasualNameLexem - } - - for _, rn := range str { - if replace, found := nameReplaceTable(rn); found { - if currentSegment.Len() > 0 { - addNameLexem(currentSegment.String()) - currentSegment.Reset() - } - - if replace != "" { - addNameLexem(replace) - } - - continue - } - - if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) { - if currentSegment.Len() > 0 { - addNameLexem(currentSegment.String()) - currentSegment.Reset() - } - - continue - } - - if unicode.IsUpper(rn) { - if currentSegment.Len() > 0 { - addNameLexem(currentSegment.String()) - } - currentSegment.Reset() - } - - currentSegment.WriteRune(rn) - } - - if currentSegment.Len() > 0 { - addNameLexem(currentSegment.String()) - } -} - -// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but -// it ignores leading and trailing blank spaces in the compared -// string. -// -// base is assumed to be composed of upper-cased runes, and be already -// trimmed. -// -// This code is heavily inspired from strings.EqualFold. -func isEqualFoldIgnoreSpace(base []rune, str string) bool { - var i, baseIndex int - // equivalent to b := []byte(str), but without data copy - b := hackStringBytes(str) - - for i < len(b) { - if c := b[i]; c < utf8.RuneSelf { - // fast path for ASCII - if c != ' ' && c != '\t' { - break - } - i++ - - continue - } - - // unicode case - r, size := utf8.DecodeRune(b[i:]) - if !unicode.IsSpace(r) { - break - } - i += size - } - - if i >= len(b) { - return len(base) == 0 - } - - for _, baseRune := range base { - if i >= len(b) { - break - } - - if c := b[i]; c < utf8.RuneSelf { - // single byte rune case (ASCII) - if baseRune >= utf8.RuneSelf { - return false - } - - baseChar := byte(baseRune) - if c != baseChar && - !('a' <= c && c <= 'z' && c-'a'+'A' == baseChar) { - return false - } - - baseIndex++ - i++ - - continue - } - - // unicode case - r, size := utf8.DecodeRune(b[i:]) - if unicode.ToUpper(r) != baseRune { - return false - } - baseIndex++ - i += size - } - - if baseIndex != len(base) { - return false - } - - // all passed: now we should only have blanks - for i < len(b) { - if c := b[i]; c < utf8.RuneSelf { - // fast path for ASCII - if c != ' ' && c != '\t' { - return false - } - i++ - - continue - } - - // unicode case - r, size := utf8.DecodeRune(b[i:]) - if !unicode.IsSpace(r) { - return false - } - - i += size - } - - return true -} diff --git a/vendor/k8s.io/kube-openapi/pkg/validation/strfmt/LICENSE b/vendor/github.com/go-openapi/swag/stringutils/LICENSE similarity index 100% rename from vendor/k8s.io/kube-openapi/pkg/validation/strfmt/LICENSE rename to vendor/github.com/go-openapi/swag/stringutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go new file mode 100644 index 000000000..28056ad25 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package stringutils + +import "strings" + +const ( + // collectionFormatComma = "csv" + collectionFormatSpace = "ssv" + collectionFormatTab = "tsv" + collectionFormatPipe = "pipes" + collectionFormatMulti = "multi" + + collectionFormatDefaultSep = "," +) + +// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute): +// +// ssv: space separated value +// tsv: tab separated value +// pipes: pipe (|) separated value +// csv: comma separated value (default) +func JoinByFormat(data []string, format string) []string { + if len(data) == 0 { + return data + } + var sep string + switch format { + case collectionFormatSpace: + sep = " " + case collectionFormatTab: + sep = "\t" + case collectionFormatPipe: + sep = "|" + case collectionFormatMulti: + return data + default: + sep = collectionFormatDefaultSep + } + return []string{strings.Join(data, sep)} +} + +// SplitByFormat splits a string by a known format: +// +// ssv: space separated value +// tsv: tab separated value +// pipes: pipe (|) separated value +// csv: comma separated value (default) +func SplitByFormat(data, format string) []string { + if data == "" { + return nil + } + var sep string + switch format { + case collectionFormatSpace: + sep = " " + case collectionFormatTab: + sep = "\t" + case collectionFormatPipe: + sep = "|" + case collectionFormatMulti: + return nil + default: + sep = collectionFormatDefaultSep + } + var result []string + for _, s := range strings.Split(data, sep) { + if ts := strings.TrimSpace(s); ts != "" { + result = append(result, ts) + } + } + return result +} diff --git a/vendor/github.com/go-openapi/swag/stringutils/doc.go b/vendor/github.com/go-openapi/swag/stringutils/doc.go new file mode 100644 index 000000000..c6d17a116 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/stringutils/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package stringutils exposes helpers to search and process strings. +package stringutils diff --git a/vendor/github.com/go-openapi/swag/stringutils/strings.go b/vendor/github.com/go-openapi/swag/stringutils/strings.go new file mode 100644 index 000000000..cd792b7d0 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/stringutils/strings.go @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package stringutils + +import ( + "slices" + "strings" +) + +// ContainsStrings searches a slice of strings for a case-sensitive match +// +// Now equivalent to the standard library [slice.Contains]. +func ContainsStrings(coll []string, item string) bool { + return slices.Contains(coll, item) +} + +// ContainsStringsCI searches a slice of strings for a case-insensitive match +func ContainsStringsCI(coll []string, item string) bool { + return slices.ContainsFunc(coll, func(e string) bool { + return strings.EqualFold(e, item) + }) +} diff --git a/vendor/github.com/go-openapi/swag/stringutils_iface.go b/vendor/github.com/go-openapi/swag/stringutils_iface.go new file mode 100644 index 000000000..dbfa48484 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/stringutils_iface.go @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/stringutils" + +// ContainsStrings searches a slice of strings for a case-sensitive match. +// +// Deprecated: use [slices.Contains] or [stringutils.ContainsStrings] instead. +func ContainsStrings(coll []string, item string) bool { + return stringutils.ContainsStrings(coll, item) +} + +// ContainsStringsCI searches a slice of strings for a case-insensitive match. +// +// Deprecated: use [stringutils.ContainsStringsCI] instead. +func ContainsStringsCI(coll []string, item string) bool { + return stringutils.ContainsStringsCI(coll, item) +} + +// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute). +// +// Deprecated: use [stringutils.JoinByFormat] instead. +func JoinByFormat(data []string, format string) []string { + return stringutils.JoinByFormat(data, format) +} + +// SplitByFormat splits a string by a known format. +// +// Deprecated: use [stringutils.SplitByFormat] instead. +func SplitByFormat(data, format string) []string { + return stringutils.SplitByFormat(data, format) +} diff --git a/vendor/k8s.io/kubelet/LICENSE b/vendor/github.com/go-openapi/swag/typeutils/LICENSE similarity index 100% rename from vendor/k8s.io/kubelet/LICENSE rename to vendor/github.com/go-openapi/swag/typeutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/typeutils/doc.go b/vendor/github.com/go-openapi/swag/typeutils/doc.go new file mode 100644 index 000000000..66bed20df --- /dev/null +++ b/vendor/github.com/go-openapi/swag/typeutils/doc.go @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package typeutils exposes utilities to inspect generic types. +package typeutils diff --git a/vendor/github.com/go-openapi/swag/typeutils/types.go b/vendor/github.com/go-openapi/swag/typeutils/types.go new file mode 100644 index 000000000..55487a673 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/typeutils/types.go @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package typeutils + +import "reflect" + +type zeroable interface { + IsZero() bool +} + +// IsZero returns true when the value passed into the function is a zero value. +// This allows for safer checking of interface values. +func IsZero(data any) bool { + v := reflect.ValueOf(data) + // check for nil data + switch v.Kind() { //nolint:exhaustive + case + reflect.Interface, + reflect.Func, + reflect.Chan, + reflect.Pointer, + reflect.UnsafePointer, + reflect.Map, + reflect.Slice: + if v.IsNil() { + return true + } + } + + // check for things that have an IsZero method instead + if vv, ok := data.(zeroable); ok { + return vv.IsZero() + } + + // continue with slightly more complex reflection + switch v.Kind() { //nolint:exhaustive + case reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Struct, reflect.Array: + return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface()) + case reflect.Invalid: + return true + default: + return false + } +} + +// IsNil checks if input is nil. +// +// For types chan, func, interface, map, pointer, or slice it returns true if its argument is nil. +// +// See [reflect.Value.IsNil]. +func IsNil(input any) bool { + if input == nil { + return true + } + + kind := reflect.TypeOf(input).Kind() + switch kind { //nolint:exhaustive + case reflect.Pointer, + reflect.UnsafePointer, + reflect.Map, + reflect.Slice, + reflect.Chan, + reflect.Interface, + reflect.Func: + return reflect.ValueOf(input).IsNil() + default: + return false + } +} diff --git a/vendor/github.com/go-openapi/swag/typeutils_iface.go b/vendor/github.com/go-openapi/swag/typeutils_iface.go new file mode 100644 index 000000000..b63813ea4 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/typeutils_iface.go @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import "github.com/go-openapi/swag/typeutils" + +// IsZero returns true when the value passed into the function is a zero value. +// This allows for safer checking of interface values. +// +// Deprecated: use [typeutils.IsZero] instead. +func IsZero(data any) bool { return typeutils.IsZero(data) } diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go deleted file mode 100644 index 5051401c4..000000000 --- a/vendor/github.com/go-openapi/swag/util.go +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "reflect" - "strings" - "unicode" - "unicode/utf8" -) - -// GoNamePrefixFunc sets an optional rule to prefix go names -// which do not start with a letter. -// -// The prefix function is assumed to return a string that starts with an upper case letter. -// -// e.g. to help convert "123" into "{prefix}123" -// -// The default is to prefix with "X" -var GoNamePrefixFunc func(string) string - -func prefixFunc(name, in string) string { - if GoNamePrefixFunc == nil { - return "X" + in - } - - return GoNamePrefixFunc(name) + in -} - -const ( - // collectionFormatComma = "csv" - collectionFormatSpace = "ssv" - collectionFormatTab = "tsv" - collectionFormatPipe = "pipes" - collectionFormatMulti = "multi" -) - -// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute): -// -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -func JoinByFormat(data []string, format string) []string { - if len(data) == 0 { - return data - } - var sep string - switch format { - case collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - return data - default: - sep = "," - } - return []string{strings.Join(data, sep)} -} - -// SplitByFormat splits a string by a known format: -// -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -func SplitByFormat(data, format string) []string { - if data == "" { - return nil - } - var sep string - switch format { - case collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - return nil - default: - sep = "," - } - var result []string - for _, s := range strings.Split(data, sep) { - if ts := strings.TrimSpace(s); ts != "" { - result = append(result, ts) - } - } - return result -} - -// Removes leading whitespaces -func trim(str string) string { - return strings.TrimSpace(str) -} - -// Shortcut to strings.ToUpper() -func upper(str string) string { - return strings.ToUpper(trim(str)) -} - -// Shortcut to strings.ToLower() -func lower(str string) string { - return strings.ToLower(trim(str)) -} - -// Camelize an uppercased word -func Camelize(word string) string { - camelized := poolOfBuffers.BorrowBuffer(len(word)) - defer func() { - poolOfBuffers.RedeemBuffer(camelized) - }() - - for pos, ru := range []rune(word) { - if pos > 0 { - camelized.WriteRune(unicode.ToLower(ru)) - } else { - camelized.WriteRune(unicode.ToUpper(ru)) - } - } - return camelized.String() -} - -// ToFileName lowercases and underscores a go type name -func ToFileName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - out = append(out, lower(w)) - } - - return strings.Join(out, "_") -} - -// ToCommandName lowercases and underscores a go type name -func ToCommandName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - out = append(out, lower(w)) - } - return strings.Join(out, "-") -} - -// ToHumanNameLower represents a code name as a human series of words -func ToHumanNameLower(name string) string { - s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) - in := s.split(name) - poolOfSplitters.RedeemSplitter(s) - out := make([]string, 0, len(*in)) - - for _, w := range *in { - if !w.IsInitialism() { - out = append(out, lower(w.GetOriginal())) - } else { - out = append(out, trim(w.GetOriginal())) - } - } - poolOfLexems.RedeemLexems(in) - - return strings.Join(out, " ") -} - -// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized -func ToHumanNameTitle(name string) string { - s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) - in := s.split(name) - poolOfSplitters.RedeemSplitter(s) - - out := make([]string, 0, len(*in)) - for _, w := range *in { - original := trim(w.GetOriginal()) - if !w.IsInitialism() { - out = append(out, Camelize(original)) - } else { - out = append(out, original) - } - } - poolOfLexems.RedeemLexems(in) - - return strings.Join(out, " ") -} - -// ToJSONName camelcases a name which can be underscored or pascal cased -func ToJSONName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for i, w := range in { - if i == 0 { - out = append(out, lower(w)) - continue - } - out = append(out, Camelize(trim(w))) - } - return strings.Join(out, "") -} - -// ToVarName camelcases a name which can be underscored or pascal cased -func ToVarName(name string) string { - res := ToGoName(name) - if isInitialism(res) { - return lower(res) - } - if len(res) <= 1 { - return lower(res) - } - return lower(res[:1]) + res[1:] -} - -// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes -func ToGoName(name string) string { - s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) - lexems := s.split(name) - poolOfSplitters.RedeemSplitter(s) - defer func() { - poolOfLexems.RedeemLexems(lexems) - }() - lexemes := *lexems - - if len(lexemes) == 0 { - return "" - } - - result := poolOfBuffers.BorrowBuffer(len(name)) - defer func() { - poolOfBuffers.RedeemBuffer(result) - }() - - // check if not starting with a letter, upper case - firstPart := lexemes[0].GetUnsafeGoName() - if lexemes[0].IsInitialism() { - firstPart = upper(firstPart) - } - - if c := firstPart[0]; c < utf8.RuneSelf { - // ASCII - switch { - case 'A' <= c && c <= 'Z': - result.WriteString(firstPart) - case 'a' <= c && c <= 'z': - result.WriteByte(c - 'a' + 'A') - result.WriteString(firstPart[1:]) - default: - result.WriteString(prefixFunc(name, firstPart)) - // NOTE: no longer check if prefixFunc returns a string that starts with uppercase: - // assume this is always the case - } - } else { - // unicode - firstRune, _ := utf8.DecodeRuneInString(firstPart) - switch { - case !unicode.IsLetter(firstRune): - result.WriteString(prefixFunc(name, firstPart)) - case !unicode.IsUpper(firstRune): - result.WriteString(prefixFunc(name, firstPart)) - /* - result.WriteRune(unicode.ToUpper(firstRune)) - result.WriteString(firstPart[offset:]) - */ - default: - result.WriteString(firstPart) - } - } - - for _, lexem := range lexemes[1:] { - goName := lexem.GetUnsafeGoName() - - // to support old behavior - if lexem.IsInitialism() { - goName = upper(goName) - } - result.WriteString(goName) - } - - return result.String() -} - -// ContainsStrings searches a slice of strings for a case-sensitive match -func ContainsStrings(coll []string, item string) bool { - for _, a := range coll { - if a == item { - return true - } - } - return false -} - -// ContainsStringsCI searches a slice of strings for a case-insensitive match -func ContainsStringsCI(coll []string, item string) bool { - for _, a := range coll { - if strings.EqualFold(a, item) { - return true - } - } - return false -} - -type zeroable interface { - IsZero() bool -} - -// IsZero returns true when the value passed into the function is a zero value. -// This allows for safer checking of interface values. -func IsZero(data interface{}) bool { - v := reflect.ValueOf(data) - // check for nil data - switch v.Kind() { //nolint:exhaustive - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - if v.IsNil() { - return true - } - } - - // check for things that have an IsZero method instead - if vv, ok := data.(zeroable); ok { - return vv.IsZero() - } - - // continue with slightly more complex reflection - switch v.Kind() { //nolint:exhaustive - case reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Struct, reflect.Array: - return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface()) - case reflect.Invalid: - return true - default: - return false - } -} - -// CommandLineOptionsGroup represents a group of user-defined command line options -type CommandLineOptionsGroup struct { - ShortDescription string - LongDescription string - Options interface{} -} diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go deleted file mode 100644 index f59e02593..000000000 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import ( - "encoding/json" - "errors" - "fmt" - "path/filepath" - "reflect" - "sort" - "strconv" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" - yaml "gopkg.in/yaml.v3" -) - -// YAMLMatcher matches yaml -func YAMLMatcher(path string) bool { - ext := filepath.Ext(path) - return ext == ".yaml" || ext == ".yml" -} - -// YAMLToJSON converts YAML unmarshaled data into json compatible data -func YAMLToJSON(data interface{}) (json.RawMessage, error) { - jm, err := transformData(data) - if err != nil { - return nil, err - } - b, err := WriteJSON(jm) - return json.RawMessage(b), err -} - -// BytesToYAMLDoc converts a byte slice into a YAML document -func BytesToYAMLDoc(data []byte) (interface{}, error) { - var document yaml.Node // preserve order that is present in the document - if err := yaml.Unmarshal(data, &document); err != nil { - return nil, err - } - if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode { - return nil, errors.New("only YAML documents that are objects are supported") - } - return &document, nil -} - -func yamlNode(root *yaml.Node) (interface{}, error) { - switch root.Kind { - case yaml.DocumentNode: - return yamlDocument(root) - case yaml.SequenceNode: - return yamlSequence(root) - case yaml.MappingNode: - return yamlMapping(root) - case yaml.ScalarNode: - return yamlScalar(root) - case yaml.AliasNode: - return yamlNode(root.Alias) - default: - return nil, fmt.Errorf("unsupported YAML node type: %v", root.Kind) - } -} - -func yamlDocument(node *yaml.Node) (interface{}, error) { - if len(node.Content) != 1 { - return nil, fmt.Errorf("unexpected YAML Document node content length: %d", len(node.Content)) - } - return yamlNode(node.Content[0]) -} - -func yamlMapping(node *yaml.Node) (interface{}, error) { - m := make(JSONMapSlice, len(node.Content)/2) - - var j int - for i := 0; i < len(node.Content); i += 2 { - var nmi JSONMapItem - k, err := yamlStringScalarC(node.Content[i]) - if err != nil { - return nil, fmt.Errorf("unable to decode YAML map key: %w", err) - } - nmi.Key = k - v, err := yamlNode(node.Content[i+1]) - if err != nil { - return nil, fmt.Errorf("unable to process YAML map value for key %q: %w", k, err) - } - nmi.Value = v - m[j] = nmi - j++ - } - return m, nil -} - -func yamlSequence(node *yaml.Node) (interface{}, error) { - s := make([]interface{}, 0) - - for i := 0; i < len(node.Content); i++ { - - v, err := yamlNode(node.Content[i]) - if err != nil { - return nil, fmt.Errorf("unable to decode YAML sequence value: %w", err) - } - s = append(s, v) - } - return s, nil -} - -const ( // See https://yaml.org/type/ - yamlStringScalar = "tag:yaml.org,2002:str" - yamlIntScalar = "tag:yaml.org,2002:int" - yamlBoolScalar = "tag:yaml.org,2002:bool" - yamlFloatScalar = "tag:yaml.org,2002:float" - yamlTimestamp = "tag:yaml.org,2002:timestamp" - yamlNull = "tag:yaml.org,2002:null" -) - -func yamlScalar(node *yaml.Node) (interface{}, error) { - switch node.LongTag() { - case yamlStringScalar: - return node.Value, nil - case yamlBoolScalar: - b, err := strconv.ParseBool(node.Value) - if err != nil { - return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w", node.Value, err) - } - return b, nil - case yamlIntScalar: - i, err := strconv.ParseInt(node.Value, 10, 64) - if err != nil { - return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w", node.Value, err) - } - return i, nil - case yamlFloatScalar: - f, err := strconv.ParseFloat(node.Value, 64) - if err != nil { - return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w", node.Value, err) - } - return f, nil - case yamlTimestamp: - return node.Value, nil - case yamlNull: - return nil, nil //nolint:nilnil - default: - return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag()) - } -} - -func yamlStringScalarC(node *yaml.Node) (string, error) { - if node.Kind != yaml.ScalarNode { - return "", fmt.Errorf("expecting a string scalar but got %q", node.Kind) - } - switch node.LongTag() { - case yamlStringScalar, yamlIntScalar, yamlFloatScalar: - return node.Value, nil - default: - return "", fmt.Errorf("YAML tag %q is not supported as map key", node.LongTag()) - } -} - -// JSONMapSlice represent a JSON object, with the order of keys maintained -type JSONMapSlice []JSONMapItem - -// MarshalJSON renders a JSONMapSlice as JSON -func (s JSONMapSlice) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapSlice as JSON, using easyJSON -func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) { - w.RawByte('{') - - ln := len(s) - last := ln - 1 - for i := 0; i < ln; i++ { - s[i].MarshalEasyJSON(w) - if i != last { // last item - w.RawByte(',') - } - } - - w.RawByte('}') -} - -// UnmarshalJSON makes a JSONMapSlice from JSON -func (s *JSONMapSlice) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapSlice from JSON, using easyJSON -func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) { - if in.IsNull() { - in.Skip() - return - } - - var result JSONMapSlice - in.Delim('{') - for !in.IsDelim('}') { - var mi JSONMapItem - mi.UnmarshalEasyJSON(in) - result = append(result, mi) - } - *s = result -} - -func (s JSONMapSlice) MarshalYAML() (interface{}, error) { - var n yaml.Node - n.Kind = yaml.DocumentNode - var nodes []*yaml.Node - for _, item := range s { - nn, err := json2yaml(item.Value) - if err != nil { - return nil, err - } - ns := []*yaml.Node{ - { - Kind: yaml.ScalarNode, - Tag: yamlStringScalar, - Value: item.Key, - }, - nn, - } - nodes = append(nodes, ns...) - } - - n.Content = []*yaml.Node{ - { - Kind: yaml.MappingNode, - Content: nodes, - }, - } - - return yaml.Marshal(&n) -} - -func isNil(input interface{}) bool { - if input == nil { - return true - } - kind := reflect.TypeOf(input).Kind() - switch kind { //nolint:exhaustive - case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan: - return reflect.ValueOf(input).IsNil() - default: - return false - } -} - -func json2yaml(item interface{}) (*yaml.Node, error) { - if isNil(item) { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Value: "null", - }, nil - } - - switch val := item.(type) { - case JSONMapSlice: - var n yaml.Node - n.Kind = yaml.MappingNode - for i := range val { - childNode, err := json2yaml(&val[i].Value) - if err != nil { - return nil, err - } - n.Content = append(n.Content, &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlStringScalar, - Value: val[i].Key, - }, childNode) - } - return &n, nil - case map[string]interface{}: - var n yaml.Node - n.Kind = yaml.MappingNode - keys := make([]string, 0, len(val)) - for k := range val { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, k := range keys { - v := val[k] - childNode, err := json2yaml(v) - if err != nil { - return nil, err - } - n.Content = append(n.Content, &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlStringScalar, - Value: k, - }, childNode) - } - return &n, nil - case []interface{}: - var n yaml.Node - n.Kind = yaml.SequenceNode - for i := range val { - childNode, err := json2yaml(val[i]) - if err != nil { - return nil, err - } - n.Content = append(n.Content, childNode) - } - return &n, nil - case string: - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlStringScalar, - Value: val, - }, nil - case float64: - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlFloatScalar, - Value: strconv.FormatFloat(val, 'f', -1, 64), - }, nil - case int64: - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlIntScalar, - Value: strconv.FormatInt(val, 10), - }, nil - case uint64: - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlIntScalar, - Value: strconv.FormatUint(val, 10), - }, nil - case bool: - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: yamlBoolScalar, - Value: strconv.FormatBool(val), - }, nil - default: - return nil, fmt.Errorf("unhandled type: %T", val) - } -} - -// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice -type JSONMapItem struct { - Key string - Value interface{} -} - -// MarshalJSON renders a JSONMapItem as JSON -func (s JSONMapItem) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapItem as JSON, using easyJSON -func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) { - w.String(s.Key) - w.RawByte(':') - w.Raw(WriteJSON(s.Value)) -} - -// UnmarshalJSON makes a JSONMapItem from JSON -func (s *JSONMapItem) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapItem from JSON, using easyJSON -func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) { - key := in.UnsafeString() - in.WantColon() - value := in.Interface() - in.WantComma() - s.Key = key - s.Value = value -} - -func transformData(input interface{}) (out interface{}, err error) { - format := func(t interface{}) (string, error) { - switch k := t.(type) { - case string: - return k, nil - case uint: - return strconv.FormatUint(uint64(k), 10), nil - case uint8: - return strconv.FormatUint(uint64(k), 10), nil - case uint16: - return strconv.FormatUint(uint64(k), 10), nil - case uint32: - return strconv.FormatUint(uint64(k), 10), nil - case uint64: - return strconv.FormatUint(k, 10), nil - case int: - return strconv.Itoa(k), nil - case int8: - return strconv.FormatInt(int64(k), 10), nil - case int16: - return strconv.FormatInt(int64(k), 10), nil - case int32: - return strconv.FormatInt(int64(k), 10), nil - case int64: - return strconv.FormatInt(k, 10), nil - default: - return "", fmt.Errorf("unexpected map key type, got: %T", k) - } - } - - switch in := input.(type) { - case yaml.Node: - return yamlNode(&in) - case *yaml.Node: - return yamlNode(in) - case map[interface{}]interface{}: - o := make(JSONMapSlice, 0, len(in)) - for ke, va := range in { - var nmi JSONMapItem - if nmi.Key, err = format(ke); err != nil { - return nil, err - } - - v, ert := transformData(va) - if ert != nil { - return nil, ert - } - nmi.Value = v - o = append(o, nmi) - } - return o, nil - case []interface{}: - len1 := len(in) - o := make([]interface{}, len1) - for i := 0; i < len1; i++ { - o[i], err = transformData(in[i]) - if err != nil { - return nil, err - } - } - return o, nil - } - return input, nil -} - -// YAMLDoc loads a yaml document from either http or a file and converts it to json -func YAMLDoc(path string) (json.RawMessage, error) { - yamlDoc, err := YAMLData(path) - if err != nil { - return nil, err - } - - data, err := YAMLToJSON(yamlDoc) - if err != nil { - return nil, err - } - - return data, nil -} - -// YAMLData loads a yaml document from either http or a file -func YAMLData(path string) (interface{}, error) { - data, err := LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - - return BytesToYAMLDoc(data) -} diff --git a/vendor/k8s.io/kubernetes/LICENSE b/vendor/github.com/go-openapi/swag/yamlutils/LICENSE similarity index 100% rename from vendor/k8s.io/kubernetes/LICENSE rename to vendor/github.com/go-openapi/swag/yamlutils/LICENSE diff --git a/vendor/github.com/go-openapi/swag/yamlutils/doc.go b/vendor/github.com/go-openapi/swag/yamlutils/doc.go new file mode 100644 index 000000000..7bb92a82f --- /dev/null +++ b/vendor/github.com/go-openapi/swag/yamlutils/doc.go @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package yamlutils provides utilities to work with YAML documents. +// +// - [BytesToYAMLDoc] to construct a [yaml.Node] document +// - [YAMLToJSON] to convert a [yaml.Node] document to JSON bytes +// - [YAMLMapSlice] to serialize and deserialize YAML with the order of keys maintained +package yamlutils + +import ( + _ "go.yaml.in/yaml/v3" // for documentation purpose only +) diff --git a/vendor/github.com/go-openapi/swag/yamlutils/errors.go b/vendor/github.com/go-openapi/swag/yamlutils/errors.go new file mode 100644 index 000000000..e87bc5e8b --- /dev/null +++ b/vendor/github.com/go-openapi/swag/yamlutils/errors.go @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package yamlutils + +type yamlError string + +const ( + // ErrYAML is an error raised by YAML utilities + ErrYAML yamlError = "yaml error" +) + +func (e yamlError) Error() string { + return string(e) +} diff --git a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go new file mode 100644 index 000000000..3daf68dbb --- /dev/null +++ b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go @@ -0,0 +1,316 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package yamlutils + +import ( + "fmt" + "iter" + "slices" + "sort" + "strconv" + + "github.com/go-openapi/swag/conv" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/jsonutils/adapters/ifaces" + "github.com/go-openapi/swag/typeutils" + yaml "go.yaml.in/yaml/v3" +) + +var ( + _ yaml.Marshaler = YAMLMapSlice{} + _ yaml.Unmarshaler = &YAMLMapSlice{} +) + +// YAMLMapSlice represents a YAML object, with the order of keys maintained. +// +// It is similar to [jsonutils.JSONMapSlice] and also knows how to marshal and unmarshal YAML. +// +// It behaves like an ordered map, but keys can't be accessed in constant time. +type YAMLMapSlice []YAMLMapItem + +// YAMLMapItem represents the value of a key in a YAML object held by [YAMLMapSlice]. +// +// It is entirely equivalent to [jsonutils.JSONMapItem], with the same limitation that +// you should not Marshal or Unmarshal directly this type, outside of a [YAMLMapSlice]. +type YAMLMapItem = jsonutils.JSONMapItem + +func (s YAMLMapSlice) OrderedItems() iter.Seq2[string, any] { + return func(yield func(string, any) bool) { + for _, item := range s { + if !yield(item.Key, item.Value) { + return + } + } + } +} + +// SetOrderedItems implements [ifaces.SetOrdered]: it merges keys passed by the iterator argument +// into the [YAMLMapSlice]. +func (s *YAMLMapSlice) SetOrderedItems(items iter.Seq2[string, any]) { + if items == nil { + // force receiver to be a nil slice + *s = nil + + return + } + + m := *s + if len(m) > 0 { + // update mode: short-circuited when unmarshaling fresh data structures + idx := make(map[string]int, len(m)) + + for i, item := range m { + idx[item.Key] = i + } + + for k, v := range items { + idx, ok := idx[k] + if ok { + m[idx].Value = v + + continue + } + + m = append(m, YAMLMapItem{Key: k, Value: v}) + } + + *s = m + + return + } + + for k, v := range items { + m = append(m, YAMLMapItem{Key: k, Value: v}) + } + + *s = m +} + +// MarshalJSON renders this YAML object as JSON bytes. +// +// The difference with standard JSON marshaling is that the order of keys is maintained. +func (s YAMLMapSlice) MarshalJSON() ([]byte, error) { + return jsonutils.JSONMapSlice(s).MarshalJSON() +} + +// UnmarshalJSON builds this YAML object from JSON bytes. +// +// The difference with standard JSON marshaling is that the order of keys is maintained. +func (s *YAMLMapSlice) UnmarshalJSON(data []byte) error { + js := jsonutils.JSONMapSlice(*s) + + if err := js.UnmarshalJSON(data); err != nil { + return err + } + + *s = YAMLMapSlice(js) + + return nil +} + +// MarshalYAML produces a YAML document as bytes +// +// The difference with standard YAML marshaling is that the order of keys is maintained. +// +// It implements [yaml.Marshaler]. +func (s YAMLMapSlice) MarshalYAML() (any, error) { + if typeutils.IsNil(s) { + return []byte("null\n"), nil + } + var n yaml.Node + n.Kind = yaml.DocumentNode + var nodes []*yaml.Node + + for _, item := range s { + nn, err := json2yaml(item.Value) + if err != nil { + return nil, err + } + + ns := []*yaml.Node{ + { + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: item.Key, + }, + nn, + } + nodes = append(nodes, ns...) + } + + n.Content = []*yaml.Node{ + { + Kind: yaml.MappingNode, + Content: nodes, + }, + } + + return yaml.Marshal(&n) +} + +// UnmarshalYAML builds a YAMLMapSlice object from a YAML document [yaml.Node]. +// +// It implements [yaml.Unmarshaler]. +func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error { + if typeutils.IsNil(*s) { + // allow to unmarshal with a simple var declaration (nil slice) + *s = YAMLMapSlice{} + } + if node == nil { + *s = nil + return nil + } + + const sensibleAllocDivider = 2 + m := slices.Grow(*s, len(node.Content)/sensibleAllocDivider) + m = m[:0] + + for i := 0; i < len(node.Content); i += 2 { + var nmi YAMLMapItem + k, err := yamlStringScalarC(node.Content[i]) + if err != nil { + return fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML) + } + nmi.Key = k + v, err := yamlNode(node.Content[i+1]) + if err != nil { + return fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML) + } + nmi.Value = v + m = append(m, nmi) + } + + *s = m + + return nil +} + +func json2yaml(item any) (*yaml.Node, error) { + if typeutils.IsNil(item) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Value: "null", + }, nil + } + + switch val := item.(type) { + case ifaces.Ordered: + return orderedYAML(val) + + case map[string]any: + var n yaml.Node + n.Kind = yaml.MappingNode + keys := make([]string, 0, len(val)) + for k := range val { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := val[k] + childNode, err := json2yaml(v) + if err != nil { + return nil, err + } + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: k, + }, childNode) + } + return &n, nil + + case []any: + var n yaml.Node + n.Kind = yaml.SequenceNode + for i := range val { + childNode, err := json2yaml(val[i]) + if err != nil { + return nil, err + } + n.Content = append(n.Content, childNode) + } + return &n, nil + case string: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: val, + }, nil + case float32: + return floatNode(val) + case float64: + return floatNode(val) + case int: + return integerNode(val) + case int8: + return integerNode(val) + case int16: + return integerNode(val) + case int32: + return integerNode(val) + case int64: + return integerNode(val) + case uint: + return uintegerNode(val) + case uint8: + return uintegerNode(val) + case uint16: + return uintegerNode(val) + case uint32: + return uintegerNode(val) + case uint64: + return uintegerNode(val) + case bool: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlBoolScalar, + Value: strconv.FormatBool(val), + }, nil + default: + return nil, fmt.Errorf("unhandled type: %T: %w", val, ErrYAML) + } +} + +func floatNode[T conv.Float](val T) (*yaml.Node, error) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlFloatScalar, + Value: conv.FormatFloat(val), + }, nil +} + +func integerNode[T conv.Signed](val T) (*yaml.Node, error) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: conv.FormatInteger(val), + }, nil +} + +func uintegerNode[T conv.Unsigned](val T) (*yaml.Node, error) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: conv.FormatUinteger(val), + }, nil +} + +func orderedYAML[T ifaces.Ordered](val T) (*yaml.Node, error) { + var n yaml.Node + n.Kind = yaml.MappingNode + for key, value := range val.OrderedItems() { + childNode, err := json2yaml(value) + if err != nil { + return nil, err + } + + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: key, + }, childNode) + } + return &n, nil +} diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go new file mode 100644 index 000000000..e3aff3c2f --- /dev/null +++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go @@ -0,0 +1,211 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package yamlutils + +import ( + json "encoding/json" + "fmt" + "strconv" + + "github.com/go-openapi/swag/jsonutils" + yaml "go.yaml.in/yaml/v3" +) + +// YAMLToJSON converts a YAML document into JSON bytes. +// +// Note: a YAML document is the output from a [yaml.Marshaler], e.g a pointer to a [yaml.Node]. +// +// [YAMLToJSON] is typically called after [BytesToYAMLDoc]. +func YAMLToJSON(value any) (json.RawMessage, error) { + jm, err := transformData(value) + if err != nil { + return nil, err + } + + b, err := jsonutils.WriteJSON(jm) + + return json.RawMessage(b), err +} + +// BytesToYAMLDoc converts a byte slice into a YAML document. +// +// This function only supports root documents that are objects. +// +// A YAML document is a pointer to a [yaml.Node]. +func BytesToYAMLDoc(data []byte) (any, error) { + var document yaml.Node // preserve order that is present in the document + if err := yaml.Unmarshal(data, &document); err != nil { + return nil, err + } + if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode { + return nil, fmt.Errorf("only YAML documents that are objects are supported: %w", ErrYAML) + } + return &document, nil +} + +func yamlNode(root *yaml.Node) (any, error) { + switch root.Kind { + case yaml.DocumentNode: + return yamlDocument(root) + case yaml.SequenceNode: + return yamlSequence(root) + case yaml.MappingNode: + return yamlMapping(root) + case yaml.ScalarNode: + return yamlScalar(root) + case yaml.AliasNode: + return yamlNode(root.Alias) + default: + return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML) + } +} + +func yamlDocument(node *yaml.Node) (any, error) { + if len(node.Content) != 1 { + return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML) + } + return yamlNode(node.Content[0]) +} + +func yamlMapping(node *yaml.Node) (any, error) { + const sensibleAllocDivider = 2 // nodes concatenate (key,value) sequences + m := make(YAMLMapSlice, len(node.Content)/sensibleAllocDivider) + + if err := m.UnmarshalYAML(node); err != nil { + return nil, err + } + + return m, nil +} + +func yamlSequence(node *yaml.Node) (any, error) { + s := make([]any, 0) + + for i := range len(node.Content) { + v, err := yamlNode(node.Content[i]) + if err != nil { + return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML) + } + s = append(s, v) + } + return s, nil +} + +const ( // See https://yaml.org/type/ + yamlStringScalar = "tag:yaml.org,2002:str" + yamlIntScalar = "tag:yaml.org,2002:int" + yamlBoolScalar = "tag:yaml.org,2002:bool" + yamlFloatScalar = "tag:yaml.org,2002:float" + yamlTimestamp = "tag:yaml.org,2002:timestamp" + yamlNull = "tag:yaml.org,2002:null" +) + +func yamlScalar(node *yaml.Node) (any, error) { + switch node.LongTag() { + case yamlStringScalar: + return node.Value, nil + case yamlBoolScalar: + b, err := strconv.ParseBool(node.Value) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w: %w", node.Value, err, ErrYAML) + } + return b, nil + case yamlIntScalar: + i, err := strconv.ParseInt(node.Value, 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w: %w", node.Value, err, ErrYAML) + } + return i, nil + case yamlFloatScalar: + f, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w: %w", node.Value, err, ErrYAML) + } + return f, nil + case yamlTimestamp: + // YAML timestamp is marshaled as string, not time + return node.Value, nil + case yamlNull: + return nil, nil //nolint:nilnil + default: + return nil, fmt.Errorf("YAML tag %q is not supported: %w", node.LongTag(), ErrYAML) + } +} + +func yamlStringScalarC(node *yaml.Node) (string, error) { + if node.Kind != yaml.ScalarNode { + return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML) + } + switch node.LongTag() { + case yamlStringScalar, yamlIntScalar, yamlFloatScalar: + return node.Value, nil + default: + return "", fmt.Errorf("YAML tag %q is not supported as map key: %w", node.LongTag(), ErrYAML) + } +} + +func format(t any) (string, error) { + switch k := t.(type) { + case string: + return k, nil + case uint: + return strconv.FormatUint(uint64(k), 10), nil + case uint8: + return strconv.FormatUint(uint64(k), 10), nil + case uint16: + return strconv.FormatUint(uint64(k), 10), nil + case uint32: + return strconv.FormatUint(uint64(k), 10), nil + case uint64: + return strconv.FormatUint(k, 10), nil + case int: + return strconv.Itoa(k), nil + case int8: + return strconv.FormatInt(int64(k), 10), nil + case int16: + return strconv.FormatInt(int64(k), 10), nil + case int32: + return strconv.FormatInt(int64(k), 10), nil + case int64: + return strconv.FormatInt(k, 10), nil + default: + return "", fmt.Errorf("unexpected map key type, got: %T: %w", k, ErrYAML) + } +} + +func transformData(input any) (out any, err error) { + switch in := input.(type) { + case yaml.Node: + return yamlNode(&in) + case *yaml.Node: + return yamlNode(in) + case map[any]any: + o := make(YAMLMapSlice, 0, len(in)) + for ke, va := range in { + var nmi YAMLMapItem + if nmi.Key, err = format(ke); err != nil { + return nil, err + } + + v, ert := transformData(va) + if ert != nil { + return nil, ert + } + nmi.Value = v + o = append(o, nmi) + } + return o, nil + case []any: + len1 := len(in) + o := make([]any, len1) + for i := range len1 { + o[i], err = transformData(in[i]) + if err != nil { + return nil, err + } + } + return o, nil + } + return input, nil +} diff --git a/vendor/github.com/go-openapi/swag/yamlutils_iface.go b/vendor/github.com/go-openapi/swag/yamlutils_iface.go new file mode 100644 index 000000000..57767efc5 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/yamlutils_iface.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package swag + +import ( + "encoding/json" + + "github.com/go-openapi/swag/yamlutils" +) + +// YAMLToJSON converts YAML unmarshaled data into json compatible data +// +// Deprecated: use [yamlutils.YAMLToJSON] instead. +func YAMLToJSON(data any) (json.RawMessage, error) { return yamlutils.YAMLToJSON(data) } + +// BytesToYAMLDoc converts a byte slice into a YAML document +// +// Deprecated: use [yamlutils.BytesToYAMLDoc] instead. +func BytesToYAMLDoc(data []byte) (any, error) { return yamlutils.BytesToYAMLDoc(data) } diff --git a/vendor/github.com/google/cel-go/LICENSE b/vendor/github.com/google/cel-go/LICENSE deleted file mode 100644 index 2493ed2eb..000000000 --- a/vendor/github.com/google/cel-go/LICENSE +++ /dev/null @@ -1,233 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -=========================================================================== -The common/types/pb/equal.go modification of proto.Equal logic -=========================================================================== -Copyright (c) 2018 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/google/cel-go/cel/BUILD.bazel b/vendor/github.com/google/cel-go/cel/BUILD.bazel deleted file mode 100644 index c12e4904d..000000000 --- a/vendor/github.com/google/cel-go/cel/BUILD.bazel +++ /dev/null @@ -1,98 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "cel.go", - "decls.go", - "env.go", - "folding.go", - "inlining.go", - "io.go", - "library.go", - "macro.go", - "optimizer.go", - "options.go", - "program.go", - "prompt.go", - "validator.go", - ], - embedsrcs = ["//cel/templates"], - importpath = "github.com/google/cel-go/cel", - visibility = ["//visibility:public"], - deps = [ - "//checker:go_default_library", - "//checker/decls:go_default_library", - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/containers:go_default_library", - "//common/decls:go_default_library", - "//common/env:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/stdlib:go_default_library", - "//common/types:go_default_library", - "//common/types/pb:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "//interpreter:go_default_library", - "//parser:go_default_library", - "@dev_cel_expr//:expr", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//reflect/protodesc:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - "@org_golang_google_protobuf//reflect/protoregistry:go_default_library", - "@org_golang_google_protobuf//types/descriptorpb:go_default_library", - "@org_golang_google_protobuf//types/dynamicpb:go_default_library", - "@org_golang_google_protobuf//types/known/anypb:go_default_library", - "@org_golang_google_protobuf//types/known/durationpb:go_default_library", - "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "cel_example_test.go", - "cel_test.go", - "decls_test.go", - "env_test.go", - "folding_test.go", - "inlining_test.go", - "io_test.go", - "optimizer_test.go", - "prompt_test.go", - "validator_test.go", - ], - data = [ - "//cel/testdata:gen_test_fds", - ], - embed = [ - ":go_default_library", - ], - embedsrcs = [ - "//cel/testdata:prompts", - ], - deps = [ - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "//ext:go_default_library", - "//test:go_default_library", - "//test/proto2pb:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//encoding/prototext:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/cel/cel.go b/vendor/github.com/google/cel-go/cel/cel.go deleted file mode 100644 index eb5a9f4cc..000000000 --- a/vendor/github.com/google/cel-go/cel/cel.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package cel defines the top-level interface for the Common Expression Language (CEL). -// -// CEL is a non-Turing complete expression language designed to parse, check, and evaluate -// expressions against user-defined environments. -package cel diff --git a/vendor/github.com/google/cel-go/cel/decls.go b/vendor/github.com/google/cel-go/cel/decls.go deleted file mode 100644 index 4d4873bd6..000000000 --- a/vendor/github.com/google/cel-go/cel/decls.go +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "fmt" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - celpb "cel.dev/expr" - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Kind indicates a CEL type's kind which is used to differentiate quickly between simple and complex types. -type Kind = types.Kind - -const ( - // DynKind represents a dynamic type. This kind only exists at type-check time. - DynKind Kind = types.DynKind - - // AnyKind represents a google.protobuf.Any type. This kind only exists at type-check time. - AnyKind = types.AnyKind - - // BoolKind represents a boolean type. - BoolKind = types.BoolKind - - // BytesKind represents a bytes type. - BytesKind = types.BytesKind - - // DoubleKind represents a double type. - DoubleKind = types.DoubleKind - - // DurationKind represents a CEL duration type. - DurationKind = types.DurationKind - - // IntKind represents an integer type. - IntKind = types.IntKind - - // ListKind represents a list type. - ListKind = types.ListKind - - // MapKind represents a map type. - MapKind = types.MapKind - - // NullTypeKind represents a null type. - NullTypeKind = types.NullTypeKind - - // OpaqueKind represents an abstract type which has no accessible fields. - OpaqueKind = types.OpaqueKind - - // StringKind represents a string type. - StringKind = types.StringKind - - // StructKind represents a structured object with typed fields. - StructKind = types.StructKind - - // TimestampKind represents a a CEL time type. - TimestampKind = types.TimestampKind - - // TypeKind represents the CEL type. - TypeKind = types.TypeKind - - // TypeParamKind represents a parameterized type whose type name will be resolved at type-check time, if possible. - TypeParamKind = types.TypeParamKind - - // UintKind represents a uint type. - UintKind = types.UintKind -) - -var ( - // AnyType represents the google.protobuf.Any type. - AnyType = types.AnyType - // BoolType represents the bool type. - BoolType = types.BoolType - // BytesType represents the bytes type. - BytesType = types.BytesType - // DoubleType represents the double type. - DoubleType = types.DoubleType - // DurationType represents the CEL duration type. - DurationType = types.DurationType - // DynType represents a dynamic CEL type whose type will be determined at runtime from context. - DynType = types.DynType - // IntType represents the int type. - IntType = types.IntType - // NullType represents the type of a null value. - NullType = types.NullType - // StringType represents the string type. - StringType = types.StringType - // TimestampType represents the time type. - TimestampType = types.TimestampType - // TypeType represents a CEL type - TypeType = types.TypeType - // UintType represents a uint type. - UintType = types.UintType - - // function references for instantiating new types. - - // ListType creates an instances of a list type value with the provided element type. - ListType = types.NewListType - // MapType creates an instance of a map type value with the provided key and value types. - MapType = types.NewMapType - // NullableType creates an instance of a nullable type with the provided wrapped type. - // - // Note: only primitive types are supported as wrapped types. - NullableType = types.NewNullableType - // OptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional. - OptionalType = types.NewOptionalType - // OpaqueType creates an abstract parameterized type with a given name. - OpaqueType = types.NewOpaqueType - // ObjectType creates a type references to an externally defined type, e.g. a protobuf message type. - ObjectType = types.NewObjectType - // TypeParamType creates a parameterized type instance. - TypeParamType = types.NewTypeParamType -) - -// Type holds a reference to a runtime type with an optional type-checked set of type parameters. -type Type = types.Type - -// Constant creates an instances of an identifier declaration with a variable name, type, and value. -func Constant(name string, t *Type, v ref.Val) EnvOption { - return func(e *Env) (*Env, error) { - e.variables = append(e.variables, decls.NewConstant(name, t, v)) - return e, nil - } -} - -// Variable creates an instance of a variable declaration with a variable name and type. -func Variable(name string, t *Type) EnvOption { - return VariableWithDoc(name, t, "") -} - -// VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string. -func VariableWithDoc(name string, t *Type, doc string) EnvOption { - return func(e *Env) (*Env, error) { - e.variables = append(e.variables, decls.NewVariableWithDoc(name, t, doc)) - return e, nil - } -} - -// VariableDecls configures a set of fully defined cel.VariableDecl instances in the environment. -func VariableDecls(vars ...*decls.VariableDecl) EnvOption { - return func(e *Env) (*Env, error) { - for _, v := range vars { - e.variables = append(e.variables, v) - } - return e, nil - } -} - -// Function defines a function and overloads with optional singleton or per-overload bindings. -// -// Using Function is roughly equivalent to calling Declarations() to declare the function signatures -// and Functions() to define the function bindings, if they have been defined. Specifying the -// same function name more than once will result in the aggregation of the function overloads. If any -// signatures conflict between the existing and new function definition an error will be raised. -// However, if the signatures are identical and the overload ids are the same, the redefinition will -// be considered a no-op. -// -// One key difference with using Function() is that each FunctionDecl provided will handle dynamic -// dispatch based on the type-signatures of the overloads provided which means overload resolution at -// runtime is handled out of the box rather than via a custom binding for overload resolution via -// Functions(): -// -// - Overloads are searched in the order they are declared -// - Dynamic dispatch for lists and maps is limited by inspection of the list and map contents -// -// at runtime. Empty lists and maps will result in a 'default dispatch' -// -// - In the event that a default dispatch occurs, the first overload provided is the one invoked -// -// If you intend to use overloads which differentiate based on the key or element type of a list or -// map, consider using a generic function instead: e.g. func(list(T)) or func(map(K, V)) as this -// will allow your implementation to determine how best to handle dispatch and the default behavior -// for empty lists and maps whose contents cannot be inspected. -// -// For functions which use parameterized opaque types (abstract types), consider using a singleton -// function which is capable of inspecting the contents of the type and resolving the appropriate -// overload as CEL can only make inferences by type-name regarding such types. -func Function(name string, opts ...FunctionOpt) EnvOption { - return func(e *Env) (*Env, error) { - fn, err := decls.NewFunction(name, opts...) - if err != nil { - return nil, err - } - return FunctionDecls(fn)(e) - } -} - -// OverloadSelector selects an overload associated with a given function when it returns true. -// -// Used in combination with the FunctionDecl.Subset method. -type OverloadSelector = decls.OverloadSelector - -// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids. -func IncludeOverloads(overloadIDs ...string) OverloadSelector { - return decls.IncludeOverloads(overloadIDs...) -} - -// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids. -func ExcludeOverloads(overloadIDs ...string) OverloadSelector { - return decls.ExcludeOverloads(overloadIDs...) -} - -// FunctionDecls provides one or more fully formed function declarations to be added to the environment. -func FunctionDecls(funcs ...*decls.FunctionDecl) EnvOption { - return func(e *Env) (*Env, error) { - var err error - for _, fn := range funcs { - if existing, found := e.functions[fn.Name()]; found { - fn, err = existing.Merge(fn) - if err != nil { - return nil, err - } - } - e.functions[fn.Name()] = fn - } - return e, nil - } -} - -// FunctionOpt defines a functional option for configuring a function declaration. -type FunctionOpt = decls.FunctionOpt - -// FunctionDocs provides a general usage documentation for the function. -// -// Use OverloadExamples to provide example usage instructions for specific overloads. -func FunctionDocs(docs ...string) FunctionOpt { - return decls.FunctionDocs(docs...) -} - -// SingletonUnaryBinding creates a singleton function definition to be used for all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonUnaryBinding(fn functions.UnaryOp, traits ...int) FunctionOpt { - return decls.SingletonUnaryBinding(fn, traits...) -} - -// SingletonBinaryImpl creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -// -// Deprecated: use SingletonBinaryBinding -func SingletonBinaryImpl(fn functions.BinaryOp, traits ...int) FunctionOpt { - return decls.SingletonBinaryBinding(fn, traits...) -} - -// SingletonBinaryBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonBinaryBinding(fn functions.BinaryOp, traits ...int) FunctionOpt { - return decls.SingletonBinaryBinding(fn, traits...) -} - -// SingletonFunctionImpl creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -// -// Deprecated: use SingletonFunctionBinding -func SingletonFunctionImpl(fn functions.FunctionOp, traits ...int) FunctionOpt { - return decls.SingletonFunctionBinding(fn, traits...) -} - -// SingletonFunctionBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonFunctionBinding(fn functions.FunctionOp, traits ...int) FunctionOpt { - return decls.SingletonFunctionBinding(fn, traits...) -} - -// DisableDeclaration disables the function signatures, effectively removing them from the type-check -// environment while preserving the runtime bindings. -func DisableDeclaration(value bool) FunctionOpt { - return decls.DisableDeclaration(value) -} - -// Overload defines a new global overload with an overload id, argument types, and result type. Through the -// use of OverloadOpt options, the overload may also be configured with a binding, an operand trait, and to -// be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func Overload(overloadID string, args []*Type, resultType *Type, opts ...OverloadOpt) FunctionOpt { - return decls.Overload(overloadID, args, resultType, opts...) -} - -// MemberOverload defines a new receiver-style overload (or member function) with an overload id, argument types, -// and result type. Through the use of OverloadOpt options, the overload may also be configured with a binding, -// an operand trait, and to be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func MemberOverload(overloadID string, args []*Type, resultType *Type, opts ...OverloadOpt) FunctionOpt { - return decls.MemberOverload(overloadID, args, resultType, opts...) -} - -// OverloadOpt is a functional option for configuring a function overload. -type OverloadOpt = decls.OverloadOpt - -// OverloadExamples configures an example of how to invoke the overload. -func OverloadExamples(docs ...string) OverloadOpt { - return decls.OverloadExamples(docs...) -} - -// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func UnaryBinding(binding functions.UnaryOp) OverloadOpt { - return decls.UnaryBinding(binding) -} - -// BinaryBinding provides the implementation of a binary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func BinaryBinding(binding functions.BinaryOp) OverloadOpt { - return decls.BinaryBinding(binding) -} - -// FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func FunctionBinding(binding functions.FunctionOp) OverloadOpt { - return decls.FunctionBinding(binding) -} - -// LateFunctionBinding indicates that the function has a binding which is not known at compile time. -// This is useful for functions which have side-effects or are not deterministically computable. -func LateFunctionBinding() OverloadOpt { - return decls.LateFunctionBinding() -} - -// OverloadIsNonStrict enables the function to be called with error and unknown argument values. -// -// Note: do not use this option unless absoluately necessary as it should be an uncommon feature. -func OverloadIsNonStrict() OverloadOpt { - return decls.OverloadIsNonStrict() -} - -// OverloadOperandTrait configures a set of traits which the first argument to the overload must implement in order to be -// successfully invoked. -func OverloadOperandTrait(trait int) OverloadOpt { - return decls.OverloadOperandTrait(trait) -} - -// TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation. -func TypeToExprType(t *Type) (*exprpb.Type, error) { - return types.TypeToExprType(t) -} - -// ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation. -func ExprTypeToType(t *exprpb.Type) (*Type, error) { - return types.ExprTypeToType(t) -} - -// ExprDeclToDeclaration converts a protobuf CEL declaration to a CEL-native declaration, either a Variable or Function. -func ExprDeclToDeclaration(d *exprpb.Decl) (EnvOption, error) { - return AlphaProtoAsDeclaration(d) -} - -// AlphaProtoAsDeclaration converts a v1alpha1.Decl value describing a variable or function into an EnvOption. -func AlphaProtoAsDeclaration(d *exprpb.Decl) (EnvOption, error) { - canonical := &celpb.Decl{} - if err := convertProto(d, canonical); err != nil { - return nil, err - } - return ProtoAsDeclaration(canonical) -} - -// ProtoAsDeclaration converts a canonical celpb.Decl value describing a variable or function into an EnvOption. -func ProtoAsDeclaration(d *celpb.Decl) (EnvOption, error) { - switch d.GetDeclKind().(type) { - case *celpb.Decl_Function: - overloads := d.GetFunction().GetOverloads() - opts := make([]FunctionOpt, len(overloads)) - for i, o := range overloads { - args := make([]*Type, len(o.GetParams())) - for j, p := range o.GetParams() { - a, err := types.ProtoAsType(p) - if err != nil { - return nil, err - } - args[j] = a - } - res, err := types.ProtoAsType(o.GetResultType()) - if err != nil { - return nil, err - } - if o.IsInstanceFunction { - opts[i] = decls.MemberOverload(o.GetOverloadId(), args, res) - } else { - opts[i] = decls.Overload(o.GetOverloadId(), args, res) - } - } - return Function(d.GetName(), opts...), nil - case *celpb.Decl_Ident: - t, err := types.ProtoAsType(d.GetIdent().GetType()) - if err != nil { - return nil, err - } - if d.GetIdent().GetValue() == nil { - return Variable(d.GetName(), t), nil - } - val, err := ast.ProtoConstantAsVal(d.GetIdent().GetValue()) - if err != nil { - return nil, err - } - return Constant(d.GetName(), t, val), nil - default: - return nil, fmt.Errorf("unsupported decl: %v", d) - } -} diff --git a/vendor/github.com/google/cel-go/cel/env.go b/vendor/github.com/google/cel-go/cel/env.go deleted file mode 100644 index bb3014464..000000000 --- a/vendor/github.com/google/cel-go/cel/env.go +++ /dev/null @@ -1,1039 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "errors" - "fmt" - "math" - "sync" - - "github.com/google/cel-go/checker" - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common" - celast "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/env" - "github.com/google/cel-go/common/stdlib" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/interpreter" - "github.com/google/cel-go/parser" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - "google.golang.org/protobuf/reflect/protoreflect" -) - -// Source interface representing a user-provided expression. -type Source = common.Source - -// Ast representing the checked or unchecked expression, its source, and related metadata such as -// source position information. -type Ast struct { - source Source - impl *celast.AST -} - -// NativeRep converts the AST to a Go-native representation. -func (ast *Ast) NativeRep() *celast.AST { - if ast == nil { - return nil - } - return ast.impl -} - -// Expr returns the proto serializable instance of the parsed/checked expression. -// -// Deprecated: prefer cel.AstToCheckedExpr() or cel.AstToParsedExpr() and call GetExpr() -// the result instead. -func (ast *Ast) Expr() *exprpb.Expr { - if ast == nil { - return nil - } - pbExpr, _ := celast.ExprToProto(ast.NativeRep().Expr()) - return pbExpr -} - -// IsChecked returns whether the Ast value has been successfully type-checked. -func (ast *Ast) IsChecked() bool { - return ast.NativeRep().IsChecked() -} - -// SourceInfo returns character offset and newline position information about expression elements. -func (ast *Ast) SourceInfo() *exprpb.SourceInfo { - if ast == nil { - return nil - } - pbInfo, _ := celast.SourceInfoToProto(ast.NativeRep().SourceInfo()) - return pbInfo -} - -// ResultType returns the output type of the expression if the Ast has been type-checked, else -// returns chkdecls.Dyn as the parse step cannot infer the type. -// -// Deprecated: use OutputType -func (ast *Ast) ResultType() *exprpb.Type { - out := ast.OutputType() - t, err := TypeToExprType(out) - if err != nil { - return chkdecls.Dyn - } - return t -} - -// OutputType returns the output type of the expression if the Ast has been type-checked, else -// returns cel.DynType as the parse step cannot infer types. -func (ast *Ast) OutputType() *Type { - if ast == nil { - return types.ErrorType - } - return ast.NativeRep().GetType(ast.NativeRep().Expr().ID()) -} - -// Source returns a view of the input used to create the Ast. This source may be complete or -// constructed from the SourceInfo. -func (ast *Ast) Source() Source { - if ast == nil { - return nil - } - return ast.source -} - -// FormatType converts a type message into a string representation. -// -// Deprecated: prefer FormatCELType -func FormatType(t *exprpb.Type) string { - return checker.FormatCheckedType(t) -} - -// FormatCELType formats a cel.Type value to a string representation. -// -// The type formatting is identical to FormatType. -func FormatCELType(t *Type) string { - return checker.FormatCELType(t) -} - -// Env encapsulates the context necessary to perform parsing, type checking, or generation of -// evaluable programs for different expressions. -type Env struct { - Container *containers.Container - variables []*decls.VariableDecl - functions map[string]*decls.FunctionDecl - macros []Macro - contextProto protoreflect.MessageDescriptor - adapter types.Adapter - provider types.Provider - features map[int]bool - appliedFeatures map[int]bool - libraries map[string]SingletonLibrary - validators []ASTValidator - costOptions []checker.CostOption - - // Internal parser representation - prsr *parser.Parser - prsrOpts []parser.Option - - // Internal checker representation - chkMutex sync.Mutex - chk *checker.Env - chkErr error - chkOnce sync.Once - chkOpts []checker.Option - - // Program options tied to the environment - progOpts []ProgramOption -} - -// ToConfig produces a YAML-serializable env.Config object from the given environment. -// -// The serialized configuration value is intended to represent a baseline set of config -// options which could be used as input to an EnvOption to configure the majority of the -// environment from a file. -// -// Note: validators, features, flags, and safe-guard settings are not yet supported by -// the serialize method. Since optimizers are a separate construct from the environment -// and the standard expression components (parse, check, evalute), they are also not -// supported by the serialize method. -func (e *Env) ToConfig(name string) (*env.Config, error) { - conf := env.NewConfig(name) - // Container settings - if e.Container != containers.DefaultContainer { - conf.SetContainer(e.Container.Name()) - } - for _, typeName := range e.Container.AliasSet() { - conf.AddImports(env.NewImport(typeName)) - } - - libOverloads := map[string][]string{} - for libName, lib := range e.libraries { - // Track the options which have been configured by a library and - // then diff the library version against the configured function - // to detect incremental overloads or rewrites. - libEnv, _ := NewCustomEnv() - libEnv, _ = Lib(lib)(libEnv) - for fnName, fnDecl := range libEnv.Functions() { - if len(fnDecl.OverloadDecls()) == 0 { - continue - } - overloads, exist := libOverloads[fnName] - if !exist { - overloads = make([]string, 0, len(fnDecl.OverloadDecls())) - } - for _, o := range fnDecl.OverloadDecls() { - overloads = append(overloads, o.ID()) - } - libOverloads[fnName] = overloads - } - subsetLib, canSubset := lib.(LibrarySubsetter) - alias := "" - if aliasLib, canAlias := lib.(LibraryAliaser); canAlias { - alias = aliasLib.LibraryAlias() - libName = alias - } - if libName == "stdlib" && canSubset { - conf.SetStdLib(subsetLib.LibrarySubset()) - continue - } - version := uint32(math.MaxUint32) - if versionLib, isVersioned := lib.(LibraryVersioner); isVersioned { - version = versionLib.LibraryVersion() - } - conf.AddExtensions(env.NewExtension(libName, version)) - } - - // If this is a custom environment without the standard env, mark the stdlib as disabled. - if conf.StdLib == nil && !e.HasLibrary("cel.lib.std") { - conf.SetStdLib(env.NewLibrarySubset().SetDisabled(true)) - } - - // Serialize the variables - vars := make([]*decls.VariableDecl, 0, len(e.Variables())) - stdTypeVars := map[string]*decls.VariableDecl{} - for _, v := range stdlib.Types() { - stdTypeVars[v.Name()] = v - } - for _, v := range e.Variables() { - if _, isStdType := stdTypeVars[v.Name()]; isStdType { - continue - } - vars = append(vars, v) - } - if e.contextProto != nil { - conf.SetContextVariable(env.NewContextVariable(string(e.contextProto.FullName()))) - skipVariables := map[string]bool{} - fields := e.contextProto.Fields() - for i := 0; i < fields.Len(); i++ { - field := fields.Get(i) - variable, err := fieldToVariable(field) - if err != nil { - return nil, fmt.Errorf("could not serialize context field variable %q, reason: %w", field.FullName(), err) - } - skipVariables[variable.Name()] = true - } - for _, v := range vars { - if _, found := skipVariables[v.Name()]; !found { - conf.AddVariableDecls(v) - } - } - } else { - conf.AddVariableDecls(vars...) - } - - // Serialize functions which are distinct from the ones configured by libraries. - for fnName, fnDecl := range e.Functions() { - if excludedOverloads, found := libOverloads[fnName]; found { - if newDecl := fnDecl.Subset(decls.ExcludeOverloads(excludedOverloads...)); newDecl != nil { - conf.AddFunctionDecls(newDecl) - } - } else { - conf.AddFunctionDecls(fnDecl) - } - } - - // Serialize validators - for _, val := range e.Validators() { - // Only add configurable validators to the env.Config as all others are - // expected to be implicitly enabled via extension libraries. - if confVal, ok := val.(ConfigurableASTValidator); ok { - conf.AddValidators(confVal.ToConfig()) - } - } - - // Serialize features - for featID, enabled := range e.features { - featName, found := featureNameByID(featID) - if !found { - // If the feature isn't named, it isn't intended to be publicly exposed - continue - } - conf.AddFeatures(env.NewFeature(featName, enabled)) - } - - return conf, nil -} - -// NewEnv creates a program environment configured with the standard library of CEL functions and -// macros. The Env value returned can parse and check any CEL program which builds upon the core -// features documented in the CEL specification. -// -// See the EnvOption helper functions for the options that can be used to configure the -// environment. -func NewEnv(opts ...EnvOption) (*Env, error) { - // Extend the statically configured standard environment, disabling eager validation to ensure - // the cost of setup for the environment is still just as cheap as it is in v0.11.x and earlier - // releases. The user provided options can easily re-enable the eager validation as they are - // processed after this default option. - stdOpts := append([]EnvOption{EagerlyValidateDeclarations(false)}, opts...) - env, err := getStdEnv() - if err != nil { - return nil, err - } - return env.Extend(stdOpts...) -} - -// NewCustomEnv creates a custom program environment which is not automatically configured with the -// standard library of functions and macros documented in the CEL spec. -// -// The purpose for using a custom environment might be for subsetting the standard library produced -// by the cel.StdLib() function. Subsetting CEL is a core aspect of its design that allows users to -// limit the compute and memory impact of a CEL program by controlling the functions and macros -// that may appear in a given expression. -// -// See the EnvOption helper functions for the options that can be used to configure the -// environment. -func NewCustomEnv(opts ...EnvOption) (*Env, error) { - registry, err := types.NewRegistry() - if err != nil { - return nil, err - } - return (&Env{ - variables: []*decls.VariableDecl{}, - functions: map[string]*decls.FunctionDecl{}, - macros: []parser.Macro{}, - Container: containers.DefaultContainer, - adapter: registry, - provider: registry, - features: map[int]bool{}, - appliedFeatures: map[int]bool{}, - libraries: map[string]SingletonLibrary{}, - validators: []ASTValidator{}, - progOpts: []ProgramOption{}, - costOptions: []checker.CostOption{}, - }).configure(opts) -} - -// Check performs type-checking on the input Ast and yields a checked Ast and/or set of Issues. -// If any `ASTValidators` are configured on the environment, they will be applied after a valid -// type-check result. If any issues are detected, the validators will provide them on the -// output Issues object. -// -// Either checking or validation has failed if the returned Issues value and its Issues.Err() -// value are non-nil. Issues should be inspected if they are non-nil, but may not represent a -// fatal error. -// -// It is possible to have both non-nil Ast and Issues values returned from this call: however, -// the mere presence of an Ast does not imply that it is valid for use. -func (e *Env) Check(ast *Ast) (*Ast, *Issues) { - // Construct the internal checker env, erroring if there is an issue adding the declarations. - chk, err := e.initChecker() - if err != nil { - errs := common.NewErrors(ast.Source()) - errs.ReportErrorString(common.NoLocation, err.Error()) - return nil, NewIssuesWithSourceInfo(errs, ast.NativeRep().SourceInfo()) - } - - checked, errs := checker.Check(ast.NativeRep(), ast.Source(), chk) - if len(errs.GetErrors()) > 0 { - return nil, NewIssuesWithSourceInfo(errs, ast.NativeRep().SourceInfo()) - } - // Manually create the Ast to ensure that the Ast source information (which may be more - // detailed than the information provided by Check), is returned to the caller. - ast = &Ast{ - source: ast.Source(), - impl: checked} - - // Avoid creating a validator config if it's not needed. - if len(e.validators) == 0 { - return ast, nil - } - - // Generate a validator configuration from the set of configured validators. - vConfig := newValidatorConfig() - for _, v := range e.validators { - if cv, ok := v.(ASTValidatorConfigurer); ok { - cv.Configure(vConfig) - } - } - // Apply additional validators on the type-checked result. - iss := NewIssuesWithSourceInfo(errs, ast.NativeRep().SourceInfo()) - for _, v := range e.validators { - v.Validate(e, vConfig, checked, iss) - } - if iss.Err() != nil { - return nil, iss - } - return ast, nil -} - -// Compile combines the Parse and Check phases CEL program compilation to produce an Ast and -// associated issues. -// -// If an error is encountered during parsing the Compile step will not continue with the Check -// phase. If non-error issues are encountered during Parse, they may be combined with any issues -// discovered during Check. -// -// Note, for parse-only uses of CEL use Parse. -func (e *Env) Compile(txt string) (*Ast, *Issues) { - return e.CompileSource(common.NewTextSource(txt)) -} - -// CompileSource combines the Parse and Check phases CEL program compilation to produce an Ast and -// associated issues. -// -// If an error is encountered during parsing the CompileSource step will not continue with the -// Check phase. If non-error issues are encountered during Parse, they may be combined with any -// issues discovered during Check. -// -// Note, for parse-only uses of CEL use Parse. -func (e *Env) CompileSource(src Source) (*Ast, *Issues) { - ast, iss := e.ParseSource(src) - if iss.Err() != nil { - return nil, iss - } - checked, iss2 := e.Check(ast) - if iss2.Err() != nil { - return nil, iss2 - } - return checked, iss2 -} - -// Extend the current environment with additional options to produce a new Env. -// -// Note, the extended Env value should not share memory with the original. It is possible, however, -// that a CustomTypeAdapter or CustomTypeProvider options could provide values which are mutable. -// To ensure separation of state between extended environments either make sure the TypeAdapter and -// TypeProvider are immutable, or that their underlying implementations are based on the -// ref.TypeRegistry which provides a Copy method which will be invoked by this method. -func (e *Env) Extend(opts ...EnvOption) (*Env, error) { - chk, chkErr := e.getCheckerOrError() - if chkErr != nil { - return nil, chkErr - } - - prsrOptsCopy := make([]parser.Option, len(e.prsrOpts)) - copy(prsrOptsCopy, e.prsrOpts) - - // The type-checker is configured with Declarations. The declarations may either be provided - // as options which have not yet been validated, or may come from a previous checker instance - // whose types have already been validated. - chkOptsCopy := make([]checker.Option, len(e.chkOpts)) - copy(chkOptsCopy, e.chkOpts) - - // Copy the declarations if needed. - if chk != nil { - // If the type-checker has already been instantiated, then the e.declarations have been - // validated within the chk instance. - chkOptsCopy = append(chkOptsCopy, checker.ValidatedDeclarations(chk)) - } - varsCopy := make([]*decls.VariableDecl, len(e.variables)) - copy(varsCopy, e.variables) - - // Copy macros and program options - macsCopy := make([]parser.Macro, len(e.macros)) - progOptsCopy := make([]ProgramOption, len(e.progOpts)) - copy(macsCopy, e.macros) - copy(progOptsCopy, e.progOpts) - - // Copy the adapter / provider if they appear to be mutable. - adapter := e.adapter - provider := e.provider - adapterReg, isAdapterReg := e.adapter.(*types.Registry) - providerReg, isProviderReg := e.provider.(*types.Registry) - // In most cases the provider and adapter will be a ref.TypeRegistry; - // however, in the rare cases where they are not, they are assumed to - // be immutable. Since it is possible to set the TypeProvider separately - // from the TypeAdapter, the possible configurations which could use a - // TypeRegistry as the base implementation are captured below. - if isAdapterReg && isProviderReg { - reg := providerReg.Copy() - provider = reg - // If the adapter and provider are the same object, set the adapter - // to the same ref.TypeRegistry as the provider. - if adapterReg == providerReg { - adapter = reg - } else { - // Otherwise, make a copy of the adapter. - adapter = adapterReg.Copy() - } - } else if isProviderReg { - provider = providerReg.Copy() - } else if isAdapterReg { - adapter = adapterReg.Copy() - } - - featuresCopy := make(map[int]bool, len(e.features)) - for k, v := range e.features { - featuresCopy[k] = v - } - appliedFeaturesCopy := make(map[int]bool, len(e.appliedFeatures)) - for k, v := range e.appliedFeatures { - appliedFeaturesCopy[k] = v - } - funcsCopy := make(map[string]*decls.FunctionDecl, len(e.functions)) - for k, v := range e.functions { - funcsCopy[k] = v - } - libsCopy := make(map[string]SingletonLibrary, len(e.libraries)) - for k, v := range e.libraries { - libsCopy[k] = v - } - validatorsCopy := make([]ASTValidator, len(e.validators)) - copy(validatorsCopy, e.validators) - costOptsCopy := make([]checker.CostOption, len(e.costOptions)) - copy(costOptsCopy, e.costOptions) - - ext := &Env{ - Container: e.Container, - variables: varsCopy, - functions: funcsCopy, - macros: macsCopy, - contextProto: e.contextProto, - progOpts: progOptsCopy, - adapter: adapter, - features: featuresCopy, - appliedFeatures: appliedFeaturesCopy, - libraries: libsCopy, - validators: validatorsCopy, - provider: provider, - chkOpts: chkOptsCopy, - prsrOpts: prsrOptsCopy, - costOptions: costOptsCopy, - } - return ext.configure(opts) -} - -// HasFeature checks whether the environment enables the given feature -// flag, as enumerated in options.go. -func (e *Env) HasFeature(flag int) bool { - enabled, has := e.features[flag] - return has && enabled -} - -// HasLibrary returns whether a specific SingletonLibrary has been configured in the environment. -func (e *Env) HasLibrary(libName string) bool { - _, exists := e.libraries[libName] - return exists -} - -// Libraries returns a list of SingletonLibrary that have been configured in the environment. -func (e *Env) Libraries() []string { - libraries := make([]string, 0, len(e.libraries)) - for libName := range e.libraries { - libraries = append(libraries, libName) - } - return libraries -} - -// HasFunction returns whether a specific function has been configured in the environment -func (e *Env) HasFunction(functionName string) bool { - _, ok := e.functions[functionName] - return ok -} - -// Functions returns a shallow copy of the Functions, keyed by function name, that have been configured in the environment. -func (e *Env) Functions() map[string]*decls.FunctionDecl { - shallowCopy := make(map[string]*decls.FunctionDecl, len(e.functions)) - for nm, fn := range e.functions { - shallowCopy[nm] = fn - } - return shallowCopy -} - -// Variables returns a shallow copy of the variables associated with the environment. -func (e *Env) Variables() []*decls.VariableDecl { - shallowCopy := make([]*decls.VariableDecl, len(e.variables)) - copy(shallowCopy, e.variables) - return shallowCopy -} - -// Macros returns a shallow copy of macros associated with the environment. -func (e *Env) Macros() []Macro { - shallowCopy := make([]Macro, len(e.macros)) - copy(shallowCopy, e.macros) - return shallowCopy -} - -// HasValidator returns whether a specific ASTValidator has been configured in the environment. -func (e *Env) HasValidator(name string) bool { - for _, v := range e.validators { - if v.Name() == name { - return true - } - } - return false -} - -// Validators returns the set of ASTValidators configured on the environment. -func (e *Env) Validators() []ASTValidator { - return e.validators[:] -} - -// Parse parses the input expression value `txt` to a Ast and/or a set of Issues. -// -// This form of Parse creates a Source value for the input `txt` and forwards to the -// ParseSource method. -func (e *Env) Parse(txt string) (*Ast, *Issues) { - src := common.NewTextSource(txt) - return e.ParseSource(src) -} - -// ParseSource parses the input source to an Ast and/or set of Issues. -// -// Parsing has failed if the returned Issues value and its Issues.Err() value is non-nil. -// Issues should be inspected if they are non-nil, but may not represent a fatal error. -// -// It is possible to have both non-nil Ast and Issues values returned from this call; however, -// the mere presence of an Ast does not imply that it is valid for use. -func (e *Env) ParseSource(src Source) (*Ast, *Issues) { - parsed, errs := e.prsr.Parse(src) - if len(errs.GetErrors()) > 0 { - return nil, &Issues{errs: errs} - } - return &Ast{source: src, impl: parsed}, nil -} - -// Program generates an evaluable instance of the Ast within the environment (Env). -func (e *Env) Program(ast *Ast, opts ...ProgramOption) (Program, error) { - return e.PlanProgram(ast.NativeRep(), opts...) -} - -// PlanProgram generates an evaluable instance of the AST in the go-native representation within -// the environment (Env). -func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) { - optSet := e.progOpts - if len(opts) != 0 { - mergedOpts := []ProgramOption{} - mergedOpts = append(mergedOpts, e.progOpts...) - mergedOpts = append(mergedOpts, opts...) - optSet = mergedOpts - } - return newProgram(e, a, optSet) -} - -// CELTypeAdapter returns the `types.Adapter` configured for the environment. -func (e *Env) CELTypeAdapter() types.Adapter { - return e.adapter -} - -// CELTypeProvider returns the `types.Provider` configured for the environment. -func (e *Env) CELTypeProvider() types.Provider { - return e.provider -} - -// TypeAdapter returns the `ref.TypeAdapter` configured for the environment. -// -// Deprecated: use CELTypeAdapter() -func (e *Env) TypeAdapter() ref.TypeAdapter { - return e.adapter -} - -// TypeProvider returns the `ref.TypeProvider` configured for the environment. -// -// Deprecated: use CELTypeProvider() -func (e *Env) TypeProvider() ref.TypeProvider { - if legacyProvider, ok := e.provider.(ref.TypeProvider); ok { - return legacyProvider - } - return &interopLegacyTypeProvider{Provider: e.provider} -} - -// UnknownVars returns a PartialActivation which marks all variables declared in the Env as -// unknown AttributePattern values. -// -// Note, the UnknownVars will behave the same as an cel.NoVars() unless the PartialAttributes -// option is provided as a ProgramOption. -func (e *Env) UnknownVars() PartialActivation { - act := interpreter.EmptyActivation() - part, _ := PartialVars(act, e.computeUnknownVars(act)...) - return part -} - -// PartialVars returns a PartialActivation where all variables not in the input variable -// set, but which have been configured in the environment, are marked as unknown. -// -// The `vars` value may either be an Activation or any valid input to the cel.NewActivation call. -// -// Note, this is equivalent to calling cel.PartialVars and manually configuring the set of unknown -// variables. For more advanced use cases of partial state where portions of an object graph, rather -// than top-level variables, are missing the PartialVars() method may be a more suitable choice. -// -// Note, the PartialVars will behave the same as cel.NoVars() unless the PartialAttributes -// option is provided as a ProgramOption. -func (e *Env) PartialVars(vars any) (PartialActivation, error) { - act, err := NewActivation(vars) - if err != nil { - return nil, err - } - return PartialVars(act, e.computeUnknownVars(act)...) -} - -// ResidualAst takes an Ast and its EvalDetails to produce a new Ast which only contains the -// attribute references which are unknown. -// -// Residual expressions are beneficial in a few scenarios: -// -// - Optimizing constant expression evaluations away. -// - Indexing and pruning expressions based on known input arguments. -// - Surfacing additional requirements that are needed in order to complete an evaluation. -// - Sharing the evaluation of an expression across multiple machines/nodes. -// -// For example, if an expression targets a 'resource' and 'request' attribute and the possible -// values for the resource are known, a PartialActivation could mark the 'request' as an unknown -// interpreter.AttributePattern and the resulting ResidualAst would be reduced to only the parts -// of the expression that reference the 'request'. -// -// Note, the expression ids within the residual AST generated through this method have no -// correlation to the expression ids of the original AST. -// -// See the PartialVars helper for how to construct a PartialActivation. -// -// TODO: Consider adding an option to generate a Program.Residual to avoid round-tripping to an -// Ast format and then Program again. -func (e *Env) ResidualAst(a *Ast, details *EvalDetails) (*Ast, error) { - ast := a.NativeRep() - pruned := interpreter.PruneAst(ast.Expr(), ast.SourceInfo().MacroCalls(), details.State()) - newAST := &Ast{source: a.Source(), impl: pruned} - expr, err := AstToString(newAST) - if err != nil { - return nil, err - } - parsed, iss := e.Parse(expr) - if iss != nil && iss.Err() != nil { - return nil, iss.Err() - } - if !a.IsChecked() { - return parsed, nil - } - checked, iss := e.Check(parsed) - if iss != nil && iss.Err() != nil { - return nil, iss.Err() - } - return checked, nil -} - -// EstimateCost estimates the cost of a type checked CEL expression using the length estimates of input data and -// extension functions provided by estimator. -func (e *Env) EstimateCost(ast *Ast, estimator checker.CostEstimator, opts ...checker.CostOption) (checker.CostEstimate, error) { - extendedOpts := make([]checker.CostOption, 0, len(e.costOptions)) - extendedOpts = append(extendedOpts, opts...) - extendedOpts = append(extendedOpts, e.costOptions...) - return checker.Cost(ast.NativeRep(), estimator, extendedOpts...) -} - -// configure applies a series of EnvOptions to the current environment. -func (e *Env) configure(opts []EnvOption) (*Env, error) { - // Customized the environment using the provided EnvOption values. If an error is - // generated at any step this, will be returned as a nil Env with a non-nil error. - var err error - for _, opt := range opts { - e, err = opt(e) - if err != nil { - return nil, err - } - } - - // If the default UTC timezone has been disabled, configure the legacy overloads - if utcTime, isSet := e.features[featureDefaultUTCTimeZone]; isSet && !utcTime { - if !e.appliedFeatures[featureDefaultUTCTimeZone] { - e.appliedFeatures[featureDefaultUTCTimeZone] = true - e, err = Lib(timeLegacyLibrary{})(e) - if err != nil { - return nil, err - } - } - } - - // Configure the parser. - prsrOpts := []parser.Option{} - prsrOpts = append(prsrOpts, e.prsrOpts...) - prsrOpts = append(prsrOpts, parser.Macros(e.macros...)) - - if e.HasFeature(featureEnableMacroCallTracking) { - prsrOpts = append(prsrOpts, parser.PopulateMacroCalls(true)) - } - if e.HasFeature(featureVariadicLogicalASTs) { - prsrOpts = append(prsrOpts, parser.EnableVariadicOperatorASTs(true)) - } - if e.HasFeature(featureIdentEscapeSyntax) { - prsrOpts = append(prsrOpts, parser.EnableIdentEscapeSyntax(true)) - } - e.prsr, err = parser.NewParser(prsrOpts...) - if err != nil { - return nil, err - } - - // Ensure that the checker init happens eagerly rather than lazily. - if e.HasFeature(featureEagerlyValidateDeclarations) { - _, err := e.initChecker() - if err != nil { - return nil, err - } - } - - return e, nil -} - -func (e *Env) initChecker() (*checker.Env, error) { - e.chkOnce.Do(func() { - chkOpts := []checker.Option{} - chkOpts = append(chkOpts, e.chkOpts...) - chkOpts = append(chkOpts, - checker.CrossTypeNumericComparisons( - e.HasFeature(featureCrossTypeNumericComparisons))) - - ce, err := checker.NewEnv(e.Container, e.provider, chkOpts...) - if err != nil { - e.setCheckerOrError(nil, err) - return - } - // Add the statically configured declarations. - err = ce.AddIdents(e.variables...) - if err != nil { - e.setCheckerOrError(nil, err) - return - } - // Add the function declarations which are derived from the FunctionDecl instances. - for _, fn := range e.functions { - if fn.IsDeclarationDisabled() { - continue - } - err = ce.AddFunctions(fn) - if err != nil { - e.setCheckerOrError(nil, err) - return - } - } - // Add function declarations here separately. - e.setCheckerOrError(ce, nil) - }) - return e.getCheckerOrError() -} - -// setCheckerOrError sets the checker.Env or error state in a concurrency-safe manner -func (e *Env) setCheckerOrError(chk *checker.Env, chkErr error) { - e.chkMutex.Lock() - e.chk = chk - e.chkErr = chkErr - e.chkMutex.Unlock() -} - -// getCheckerOrError gets the checker.Env or error state in a concurrency-safe manner -func (e *Env) getCheckerOrError() (*checker.Env, error) { - e.chkMutex.Lock() - defer e.chkMutex.Unlock() - return e.chk, e.chkErr -} - -// computeUnknownVars determines a set of missing variables based on the input activation and the -// environment's configured declaration set. -func (e *Env) computeUnknownVars(vars Activation) []*interpreter.AttributePattern { - var unknownPatterns []*interpreter.AttributePattern - for _, v := range e.variables { - varName := v.Name() - if _, found := vars.ResolveName(varName); found { - continue - } - unknownPatterns = append(unknownPatterns, interpreter.NewAttributePattern(varName)) - } - return unknownPatterns -} - -// Error type which references an expression id, a location within source, and a message. -type Error = common.Error - -// Issues defines methods for inspecting the error details of parse and check calls. -// -// Note: in the future, non-fatal warnings and notices may be inspectable via the Issues struct. -type Issues struct { - errs *common.Errors - info *celast.SourceInfo -} - -// NewIssues returns an Issues struct from a common.Errors object. -func NewIssues(errs *common.Errors) *Issues { - return NewIssuesWithSourceInfo(errs, nil) -} - -// NewIssuesWithSourceInfo returns an Issues struct from a common.Errors object with SourceInfo metatata -// which can be used with the `ReportErrorAtID` method for additional error reports within the context -// information that's inferred from an expression id. -func NewIssuesWithSourceInfo(errs *common.Errors, info *celast.SourceInfo) *Issues { - return &Issues{ - errs: errs, - info: info, - } -} - -// Err returns an error value if the issues list contains one or more errors. -func (i *Issues) Err() error { - if i == nil { - return nil - } - if len(i.Errors()) > 0 { - return errors.New(i.String()) - } - return nil -} - -// Errors returns the collection of errors encountered in more granular detail. -func (i *Issues) Errors() []*Error { - if i == nil { - return []*Error{} - } - return i.errs.GetErrors() -} - -// Append collects the issues from another Issues struct into a new Issues object. -func (i *Issues) Append(other *Issues) *Issues { - if i == nil { - return other - } - if other == nil || i == other { - return i - } - return NewIssuesWithSourceInfo(i.errs.Append(other.errs.GetErrors()), i.info) -} - -// String converts the issues to a suitable display string. -func (i *Issues) String() string { - if i == nil { - return "" - } - return i.errs.ToDisplayString() -} - -// ReportErrorAtID reports an error message with an optional set of formatting arguments. -// -// The source metadata for the expression at `id`, if present, is attached to the error report. -// To ensure that source metadata is attached to error reports, use NewIssuesWithSourceInfo. -func (i *Issues) ReportErrorAtID(id int64, message string, args ...any) { - i.errs.ReportErrorAtID(id, i.info.GetStartLocation(id), message, args...) -} - -// getStdEnv lazy initializes the CEL standard environment. -func getStdEnv() (*Env, error) { - stdEnvInit.Do(func() { - stdEnv, stdEnvErr = NewCustomEnv(StdLib(), EagerlyValidateDeclarations(true)) - }) - return stdEnv, stdEnvErr -} - -// interopCELTypeProvider layers support for the types.Provider interface on top of a ref.TypeProvider. -type interopCELTypeProvider struct { - ref.TypeProvider -} - -// FindStructType returns a types.Type instance for the given fully-qualified typeName if one exists. -// -// This method proxies to the underlying ref.TypeProvider's FindType method and converts protobuf type -// into a native type representation. If the conversion fails, the type is listed as not found. -func (p *interopCELTypeProvider) FindStructType(typeName string) (*types.Type, bool) { - if et, found := p.FindType(typeName); found { - t, err := types.ExprTypeToType(et) - if err != nil { - return nil, false - } - return t, true - } - return nil, false -} - -// FindStructFieldNames returns an empty set of field for the interop provider. -// -// To inspect the field names, migrate to a `types.Provider` implementation. -func (p *interopCELTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) { - return []string{}, false -} - -// FindStructFieldType returns a types.FieldType instance for the given fully-qualified typeName and field -// name, if one exists. -// -// This method proxies to the underlying ref.TypeProvider's FindFieldType method and converts protobuf type -// into a native type representation. If the conversion fails, the type is listed as not found. -func (p *interopCELTypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool) { - if ft, found := p.FindFieldType(structType, fieldName); found { - t, err := types.ExprTypeToType(ft.Type) - if err != nil { - return nil, false - } - return &types.FieldType{ - Type: t, - IsSet: ft.IsSet, - GetFrom: ft.GetFrom, - }, true - } - return nil, false -} - -// interopLegacyTypeProvider layers support for the ref.TypeProvider interface on top of a types.Provider. -type interopLegacyTypeProvider struct { - types.Provider -} - -// FindType retruns the protobuf Type representation for the input type name if one exists. -// -// This method proxies to the underlying types.Provider FindStructType method and converts the types.Type -// value to a protobuf Type representation. -// -// Failure to convert the type will result in the type not being found. -func (p *interopLegacyTypeProvider) FindType(typeName string) (*exprpb.Type, bool) { - if t, found := p.FindStructType(typeName); found { - et, err := types.TypeToExprType(t) - if err != nil { - return nil, false - } - return et, true - } - return nil, false -} - -// FindFieldType returns the protobuf-based FieldType representation for the input type name and field, -// if one exists. -// -// This call proxies to the types.Provider FindStructFieldType method and converts the types.FIeldType -// value to a protobuf-based ref.FieldType representation if found. -// -// Failure to convert the FieldType will result in the field not being found. -func (p *interopLegacyTypeProvider) FindFieldType(structType, fieldName string) (*ref.FieldType, bool) { - if cft, found := p.FindStructFieldType(structType, fieldName); found { - et, err := types.TypeToExprType(cft.Type) - if err != nil { - return nil, false - } - return &ref.FieldType{ - Type: et, - IsSet: cft.IsSet, - GetFrom: cft.GetFrom, - }, true - } - return nil, false -} - -var ( - stdEnvInit sync.Once - stdEnv *Env - stdEnvErr error -) diff --git a/vendor/github.com/google/cel-go/cel/folding.go b/vendor/github.com/google/cel-go/cel/folding.go deleted file mode 100644 index 40d843ece..000000000 --- a/vendor/github.com/google/cel-go/cel/folding.go +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "fmt" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// ConstantFoldingOption defines a functional option for configuring constant folding. -type ConstantFoldingOption func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) - -// MaxConstantFoldIterations limits the number of times literals may be folding during optimization. -// -// Defaults to 100 if not set. -func MaxConstantFoldIterations(limit int) ConstantFoldingOption { - return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) { - opt.maxFoldIterations = limit - return opt, nil - } -} - -// Adds an Activation which provides known values for the folding evaluator -// -// Any values the activation provides will be used by the constant folder and turned into -// literals in the AST. -// -// Defaults to the NoVars() Activation -func FoldKnownValues(knownValues Activation) ConstantFoldingOption { - return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) { - if knownValues != nil { - opt.knownValues = knownValues - } else { - opt.knownValues = NoVars() - } - return opt, nil - } -} - -// NewConstantFoldingOptimizer creates an optimizer which inlines constant scalar an aggregate -// literal values within function calls and select statements with their evaluated result. -func NewConstantFoldingOptimizer(opts ...ConstantFoldingOption) (ASTOptimizer, error) { - folder := &constantFoldingOptimizer{ - maxFoldIterations: defaultMaxConstantFoldIterations, - } - var err error - for _, o := range opts { - folder, err = o(folder) - if err != nil { - return nil, err - } - } - return folder, nil -} - -type constantFoldingOptimizer struct { - maxFoldIterations int - knownValues Activation -} - -// Optimize queries the expression graph for scalar and aggregate literal expressions within call and -// select statements and then evaluates them and replaces the call site with the literal result. -// -// Note: only values which can be represented as literals in CEL syntax are supported. -func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST { - root := ast.NavigateAST(a) - - // Walk the list of foldable expression and continue to fold until there are no more folds left. - // All of the fold candidates returned by the constantExprMatcher should succeed unless there's - // a logic bug with the selection of expressions. - constantExprMatcherCapture := func(e ast.NavigableExpr) bool { return opt.constantExprMatcher(ctx, a, e) } - foldableExprs := ast.MatchDescendants(root, constantExprMatcherCapture) - foldCount := 0 - for len(foldableExprs) != 0 && foldCount < opt.maxFoldIterations { - for _, fold := range foldableExprs { - // If the expression could be folded because it's a non-strict call, and the - // branches are pruned, continue to the next fold. - if fold.Kind() == ast.CallKind && maybePruneBranches(ctx, fold) { - continue - } - // Late-bound function calls cannot be folded. - if fold.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, fold) { - continue - } - // Otherwise, assume all context is needed to evaluate the expression. - err := opt.tryFold(ctx, a, fold) - // Ignore errors for identifiers, since there is no guarantee that the environment - // has a value for them. - if err != nil && fold.Kind() != ast.IdentKind { - ctx.ReportErrorAtID(fold.ID(), "constant-folding evaluation failed: %v", err.Error()) - return a - } - } - foldCount++ - foldableExprs = ast.MatchDescendants(root, constantExprMatcherCapture) - } - // Once all of the constants have been folded, try to run through the remaining comprehensions - // one last time. In this case, there's no guarantee they'll run, so we only update the - // target comprehension node with the literal value if the evaluation succeeds. - for _, compre := range ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) { - opt.tryFold(ctx, a, compre) - } - - // If the output is a list, map, or struct which contains optional entries, then prune it - // to make sure that the optionals, if resolved, do not surface in the output literal. - pruneOptionalElements(ctx, root) - - // Ensure that all intermediate values in the folded expression can be represented as valid - // CEL literals within the AST structure. Use `PostOrderVisit` rather than `MatchDescendents` - // to avoid extra allocations during this final pass through the AST. - ast.PostOrderVisit(root, ast.NewExprVisitor(func(e ast.Expr) { - if e.Kind() != ast.LiteralKind { - return - } - val := e.AsLiteral() - adapted, err := adaptLiteral(ctx, val) - if err != nil { - ctx.ReportErrorAtID(root.ID(), "constant-folding evaluation failed: %v", err.Error()) - return - } - ctx.UpdateExpr(e, adapted) - })) - - return a -} - -// tryFold attempts to evaluate a sub-expression to a literal. -// -// If the evaluation succeeds, the input expr value will be modified to become a literal, otherwise -// the method will return an error. -func (opt *constantFoldingOptimizer) tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error { - // Assume all context is needed to evaluate the expression. - subAST := &Ast{ - impl: ast.NewCheckedAST(ast.NewAST(expr, a.SourceInfo()), a.TypeMap(), a.ReferenceMap()), - } - prg, err := ctx.Program(subAST) - if err != nil { - return err - } - activation := opt.knownValues - if activation == nil { - activation = NoVars() - } - out, _, err := prg.Eval(activation) - if err != nil { - return err - } - // Update the fold expression to be a literal. - ctx.UpdateExpr(expr, ctx.NewLiteral(out)) - return nil -} - -func isLateBoundFunctionCall(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) bool { - call := expr.AsCall() - function := ctx.Functions()[call.FunctionName()] - if function == nil { - return false - } - return function.HasLateBinding() -} - -// maybePruneBranches inspects the non-strict call expression to determine whether -// a branch can be removed. Evaluation will naturally prune logical and / or calls, -// but conditional will not be pruned cleanly, so this is one small area where the -// constant folding step reimplements a portion of the evaluator. -func maybePruneBranches(ctx *OptimizerContext, expr ast.NavigableExpr) bool { - call := expr.AsCall() - args := call.Args() - switch call.FunctionName() { - case operators.LogicalAnd, operators.LogicalOr: - return maybeShortcircuitLogic(ctx, call.FunctionName(), args, expr) - case operators.Conditional: - cond := args[0] - truthy := args[1] - falsy := args[2] - if cond.Kind() != ast.LiteralKind { - return false - } - if cond.AsLiteral() == types.True { - ctx.UpdateExpr(expr, truthy) - } else { - ctx.UpdateExpr(expr, falsy) - } - return true - case operators.In: - haystack := args[1] - if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 { - ctx.UpdateExpr(expr, ctx.NewLiteral(types.False)) - return true - } - needle := args[0] - if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind { - needleValue := needle.AsLiteral() - list := haystack.AsList() - for _, e := range list.Elements() { - if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True { - ctx.UpdateExpr(expr, ctx.NewLiteral(types.True)) - return true - } - } - } - } - return false -} - -func maybeShortcircuitLogic(ctx *OptimizerContext, function string, args []ast.Expr, expr ast.NavigableExpr) bool { - shortcircuit := types.False - skip := types.True - if function == operators.LogicalOr { - shortcircuit = types.True - skip = types.False - } - newArgs := []ast.Expr{} - for _, arg := range args { - if arg.Kind() != ast.LiteralKind { - newArgs = append(newArgs, arg) - continue - } - if arg.AsLiteral() == skip { - continue - } - if arg.AsLiteral() == shortcircuit { - ctx.UpdateExpr(expr, arg) - return true - } - } - if len(newArgs) == 0 { - newArgs = append(newArgs, args[0]) - ctx.UpdateExpr(expr, newArgs[0]) - return true - } - if len(newArgs) == 1 { - ctx.UpdateExpr(expr, newArgs[0]) - return true - } - ctx.UpdateExpr(expr, ctx.NewCall(function, newArgs...)) - return true -} - -// pruneOptionalElements works from the bottom up to resolve optional elements within -// aggregate literals. -// -// Note, many aggregate literals will be resolved as arguments to functions or select -// statements, so this method exists to handle the case where the literal could not be -// fully resolved or exists outside of a call, select, or comprehension context. -func pruneOptionalElements(ctx *OptimizerContext, root ast.NavigableExpr) { - aggregateLiterals := ast.MatchDescendants(root, aggregateLiteralMatcher) - for _, lit := range aggregateLiterals { - switch lit.Kind() { - case ast.ListKind: - pruneOptionalListElements(ctx, lit) - case ast.MapKind: - pruneOptionalMapEntries(ctx, lit) - case ast.StructKind: - pruneOptionalStructFields(ctx, lit) - } - } -} - -func pruneOptionalListElements(ctx *OptimizerContext, e ast.Expr) { - l := e.AsList() - elems := l.Elements() - optIndices := l.OptionalIndices() - if len(optIndices) == 0 { - return - } - updatedElems := []ast.Expr{} - updatedIndices := []int32{} - newOptIndex := -1 - for _, e := range elems { - newOptIndex++ - if !l.IsOptional(int32(newOptIndex)) { - updatedElems = append(updatedElems, e) - continue - } - if e.Kind() != ast.LiteralKind { - updatedElems = append(updatedElems, e) - updatedIndices = append(updatedIndices, int32(newOptIndex)) - continue - } - optElemVal, ok := e.AsLiteral().(*types.Optional) - if !ok { - updatedElems = append(updatedElems, e) - updatedIndices = append(updatedIndices, int32(newOptIndex)) - continue - } - if !optElemVal.HasValue() { - newOptIndex-- // Skipping causes the list to get smaller. - continue - } - ctx.UpdateExpr(e, ctx.NewLiteral(optElemVal.GetValue())) - updatedElems = append(updatedElems, e) - } - ctx.UpdateExpr(e, ctx.NewList(updatedElems, updatedIndices)) -} - -func pruneOptionalMapEntries(ctx *OptimizerContext, e ast.Expr) { - m := e.AsMap() - entries := m.Entries() - updatedEntries := []ast.EntryExpr{} - modified := false - for _, e := range entries { - entry := e.AsMapEntry() - key := entry.Key() - val := entry.Value() - // If the entry is not optional, or the value-side of the optional hasn't - // been resolved to a literal, then preserve the entry as-is. - if !entry.IsOptional() || val.Kind() != ast.LiteralKind { - updatedEntries = append(updatedEntries, e) - continue - } - optElemVal, ok := val.AsLiteral().(*types.Optional) - if !ok { - updatedEntries = append(updatedEntries, e) - continue - } - // When the key is not a literal, but the value is, then it needs to be - // restored to an optional value. - if key.Kind() != ast.LiteralKind { - undoOptVal, err := adaptLiteral(ctx, optElemVal) - if err != nil { - ctx.ReportErrorAtID(val.ID(), "invalid map value literal %v: %v", optElemVal, err) - } - ctx.UpdateExpr(val, undoOptVal) - updatedEntries = append(updatedEntries, e) - continue - } - modified = true - if !optElemVal.HasValue() { - continue - } - ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue())) - updatedEntry := ctx.NewMapEntry(key, val, false) - updatedEntries = append(updatedEntries, updatedEntry) - } - if modified { - ctx.UpdateExpr(e, ctx.NewMap(updatedEntries)) - } -} - -func pruneOptionalStructFields(ctx *OptimizerContext, e ast.Expr) { - s := e.AsStruct() - fields := s.Fields() - updatedFields := []ast.EntryExpr{} - modified := false - for _, f := range fields { - field := f.AsStructField() - val := field.Value() - if !field.IsOptional() || val.Kind() != ast.LiteralKind { - updatedFields = append(updatedFields, f) - continue - } - optElemVal, ok := val.AsLiteral().(*types.Optional) - if !ok { - updatedFields = append(updatedFields, f) - continue - } - modified = true - if !optElemVal.HasValue() { - continue - } - ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue())) - updatedField := ctx.NewStructField(field.Name(), val, false) - updatedFields = append(updatedFields, updatedField) - } - if modified { - ctx.UpdateExpr(e, ctx.NewStruct(s.TypeName(), updatedFields)) - } -} - -// adaptLiteral converts a runtime CEL value to its equivalent literal expression. -// -// For strongly typed values, the type-provider will be used to reconstruct the fields -// which are present in the literal and their equivalent initialization values. -func adaptLiteral(ctx *OptimizerContext, val ref.Val) (ast.Expr, error) { - switch t := val.Type().(type) { - case *types.Type: - switch t { - case types.BoolType, types.BytesType, types.DoubleType, types.IntType, - types.NullType, types.StringType, types.UintType: - return ctx.NewLiteral(val), nil - case types.DurationType: - return ctx.NewCall( - overloads.TypeConvertDuration, - ctx.NewLiteral(val.ConvertToType(types.StringType)), - ), nil - case types.TimestampType: - return ctx.NewCall( - overloads.TypeConvertTimestamp, - ctx.NewLiteral(val.ConvertToType(types.StringType)), - ), nil - case types.OptionalType: - opt := val.(*types.Optional) - if !opt.HasValue() { - return ctx.NewCall("optional.none"), nil - } - target, err := adaptLiteral(ctx, opt.GetValue()) - if err != nil { - return nil, err - } - return ctx.NewCall("optional.of", target), nil - case types.TypeType: - return ctx.NewIdent(val.(*types.Type).TypeName()), nil - case types.ListType: - l, ok := val.(traits.Lister) - if !ok { - return nil, fmt.Errorf("failed to adapt %v to literal", val) - } - elems := make([]ast.Expr, l.Size().(types.Int)) - idx := 0 - it := l.Iterator() - for it.HasNext() == types.True { - elemVal := it.Next() - elemExpr, err := adaptLiteral(ctx, elemVal) - if err != nil { - return nil, err - } - elems[idx] = elemExpr - idx++ - } - return ctx.NewList(elems, []int32{}), nil - case types.MapType: - m, ok := val.(traits.Mapper) - if !ok { - return nil, fmt.Errorf("failed to adapt %v to literal", val) - } - entries := make([]ast.EntryExpr, m.Size().(types.Int)) - idx := 0 - it := m.Iterator() - for it.HasNext() == types.True { - keyVal := it.Next() - keyExpr, err := adaptLiteral(ctx, keyVal) - if err != nil { - return nil, err - } - valVal := m.Get(keyVal) - valExpr, err := adaptLiteral(ctx, valVal) - if err != nil { - return nil, err - } - entries[idx] = ctx.NewMapEntry(keyExpr, valExpr, false) - idx++ - } - return ctx.NewMap(entries), nil - default: - provider := ctx.CELTypeProvider() - fields, found := provider.FindStructFieldNames(t.TypeName()) - if !found { - return nil, fmt.Errorf("failed to adapt %v to literal", val) - } - tester := val.(traits.FieldTester) - indexer := val.(traits.Indexer) - fieldInits := []ast.EntryExpr{} - for _, f := range fields { - field := types.String(f) - if tester.IsSet(field) != types.True { - continue - } - fieldVal := indexer.Get(field) - fieldExpr, err := adaptLiteral(ctx, fieldVal) - if err != nil { - return nil, err - } - fieldInits = append(fieldInits, ctx.NewStructField(f, fieldExpr, false)) - } - return ctx.NewStruct(t.TypeName(), fieldInits), nil - } - } - return nil, fmt.Errorf("failed to adapt %v to literal", val) -} - -// constantExprMatcher matches calls, select statements, and comprehensions whose arguments -// are all constant scalar or aggregate literal values. -// -// Only comprehensions which are not nested are included as possible constant folds, and only -// if all variables referenced in the comprehension stack exist are only iteration or -// accumulation variables. -func (opt *constantFoldingOptimizer) constantExprMatcher(ctx *OptimizerContext, a *ast.AST, e ast.NavigableExpr) bool { - switch e.Kind() { - case ast.CallKind: - return constantCallMatcher(e) - case ast.SelectKind: - sel := e.AsSelect() // guaranteed to be a navigable value - return constantMatcher(sel.Operand().(ast.NavigableExpr)) - case ast.IdentKind: - return opt.knownValues != nil && a.ReferenceMap()[e.ID()] != nil - case ast.ComprehensionKind: - if isNestedComprehension(e) { - return false - } - vars := map[string]bool{} - constantExprs := true - visitor := ast.NewExprVisitor(func(e ast.Expr) { - if e.Kind() == ast.ComprehensionKind { - nested := e.AsComprehension() - vars[nested.AccuVar()] = true - vars[nested.IterVar()] = true - } - if e.Kind() == ast.IdentKind && !vars[e.AsIdent()] { - constantExprs = false - } - // Late-bound function calls cannot be folded. - if e.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, e) { - constantExprs = false - } - }) - ast.PreOrderVisit(e, visitor) - return constantExprs - default: - return false - } -} - -// constantCallMatcher identifies strict and non-strict calls which can be folded. -func constantCallMatcher(e ast.NavigableExpr) bool { - call := e.AsCall() - children := e.Children() - fnName := call.FunctionName() - if fnName == operators.LogicalAnd { - for _, child := range children { - if child.Kind() == ast.LiteralKind { - return true - } - } - } - if fnName == operators.LogicalOr { - for _, child := range children { - if child.Kind() == ast.LiteralKind { - return true - } - } - } - if fnName == operators.Conditional { - cond := children[0] - if cond.Kind() == ast.LiteralKind && cond.AsLiteral().Type() == types.BoolType { - return true - } - } - if fnName == operators.In { - haystack := children[1] - if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 { - return true - } - needle := children[0] - if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind { - needleValue := needle.AsLiteral() - list := haystack.AsList() - for _, e := range list.Elements() { - if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True { - return true - } - } - } - } - // convert all other calls with constant arguments - for _, child := range children { - if !constantMatcher(child) { - return false - } - } - return true -} - -func isNestedComprehension(e ast.NavigableExpr) bool { - parent, found := e.Parent() - for found { - if parent.Kind() == ast.ComprehensionKind { - return true - } - parent, found = parent.Parent() - } - return false -} - -func aggregateLiteralMatcher(e ast.NavigableExpr) bool { - return e.Kind() == ast.ListKind || e.Kind() == ast.MapKind || e.Kind() == ast.StructKind -} - -var ( - constantMatcher = ast.ConstantValueMatcher() -) - -const ( - defaultMaxConstantFoldIterations = 100 -) diff --git a/vendor/github.com/google/cel-go/cel/inlining.go b/vendor/github.com/google/cel-go/cel/inlining.go deleted file mode 100644 index a4530e19e..000000000 --- a/vendor/github.com/google/cel-go/cel/inlining.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/traits" -) - -// InlineVariable holds a variable name to be matched and an AST representing -// the expression graph which should be used to replace it. -type InlineVariable struct { - name string - alias string - def *ast.AST -} - -// Name returns the qualified variable or field selection to replace. -func (v *InlineVariable) Name() string { - return v.name -} - -// Alias returns the alias to use when performing cel.bind() calls during inlining. -func (v *InlineVariable) Alias() string { - return v.alias -} - -// Expr returns the inlined expression value. -func (v *InlineVariable) Expr() ast.Expr { - return v.def.Expr() -} - -// Type indicates the inlined expression type. -func (v *InlineVariable) Type() *Type { - return v.def.GetType(v.def.Expr().ID()) -} - -// NewInlineVariable declares a variable name to be replaced by a checked expression. -func NewInlineVariable(name string, definition *Ast) *InlineVariable { - return NewInlineVariableWithAlias(name, name, definition) -} - -// NewInlineVariableWithAlias declares a variable name to be replaced by a checked expression. -// If the variable occurs more than once, the provided alias will be used to replace the expressions -// where the variable name occurs. -func NewInlineVariableWithAlias(name, alias string, definition *Ast) *InlineVariable { - return &InlineVariable{name: name, alias: alias, def: definition.NativeRep()} -} - -// NewInliningOptimizer creates and optimizer which replaces variables with expression definitions. -// -// If a variable occurs one time, the variable is replaced by the inline definition. If the -// variable occurs more than once, the variable occurences are replaced by a cel.bind() call. -func NewInliningOptimizer(inlineVars ...*InlineVariable) ASTOptimizer { - return &inliningOptimizer{variables: inlineVars} -} - -type inliningOptimizer struct { - variables []*InlineVariable -} - -func (opt *inliningOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST { - root := ast.NavigateAST(a) - for _, inlineVar := range opt.variables { - matches := ast.MatchDescendants(root, opt.matchVariable(inlineVar.Name())) - // Skip cases where the variable isn't in the expression graph - if len(matches) == 0 { - continue - } - - // For a single match, do a direct replacement of the expression sub-graph. - if len(matches) == 1 || !isBindable(matches, inlineVar.Expr(), inlineVar.Type()) { - for _, match := range matches { - // Copy the inlined AST expr and source info. - copyExpr := ctx.CopyASTAndMetadata(inlineVar.def) - opt.inlineExpr(ctx, match, copyExpr, inlineVar.Type()) - } - continue - } - - // For multiple matches, find the least common ancestor (lca) and insert the - // variable as a cel.bind() macro. - var lca ast.NavigableExpr = root - lcaAncestorCount := 0 - ancestors := map[int64]int{} - for _, match := range matches { - // Update the identifier matches with the provided alias. - parent, found := match, true - for found { - ancestorCount, hasAncestor := ancestors[parent.ID()] - if !hasAncestor { - ancestors[parent.ID()] = 1 - parent, found = parent.Parent() - continue - } - if lcaAncestorCount < ancestorCount || (lcaAncestorCount == ancestorCount && lca.Depth() < parent.Depth()) { - lca = parent - lcaAncestorCount = ancestorCount - } - ancestors[parent.ID()] = ancestorCount + 1 - parent, found = parent.Parent() - } - aliasExpr := ctx.NewIdent(inlineVar.Alias()) - opt.inlineExpr(ctx, match, aliasExpr, inlineVar.Type()) - } - - // Copy the inlined AST expr and source info. - copyExpr := ctx.CopyASTAndMetadata(inlineVar.def) - // Update the least common ancestor by inserting a cel.bind() call to the alias. - inlined, bindMacro := ctx.NewBindMacro(lca.ID(), inlineVar.Alias(), copyExpr, lca) - opt.inlineExpr(ctx, lca, inlined, inlineVar.Type()) - ctx.SetMacroCall(lca.ID(), bindMacro) - } - return a -} - -// inlineExpr replaces the current expression with the inlined one, unless the location of the inlining -// happens within a presence test, e.g. has(a.b.c) -> inline alpha for a.b.c in which case an attempt is -// made to determine whether the inlined value can be presence or existence tested. -func (opt *inliningOptimizer) inlineExpr(ctx *OptimizerContext, prev ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) { - switch prev.Kind() { - case ast.SelectKind: - sel := prev.AsSelect() - if !sel.IsTestOnly() { - ctx.UpdateExpr(prev, inlined) - return - } - opt.rewritePresenceExpr(ctx, prev, inlined, inlinedType) - default: - ctx.UpdateExpr(prev, inlined) - } -} - -// rewritePresenceExpr converts the inlined expression, when it occurs within a has() macro, to type-safe -// expression appropriate for the inlined type, if possible. -// -// If the rewrite is not possible an error is reported at the inline expression site. -func (opt *inliningOptimizer) rewritePresenceExpr(ctx *OptimizerContext, prev, inlined ast.Expr, inlinedType *Type) { - // If the input inlined expression is not a select expression it won't work with the has() - // macro. Attempt to rewrite the presence test in terms of the typed input, otherwise error. - if inlined.Kind() == ast.SelectKind { - presenceTest, hasMacro := ctx.NewHasMacro(prev.ID(), inlined) - ctx.UpdateExpr(prev, presenceTest) - ctx.SetMacroCall(prev.ID(), hasMacro) - return - } - - ctx.ClearMacroCall(prev.ID()) - if inlinedType.IsAssignableType(NullType) { - ctx.UpdateExpr(prev, - ctx.NewCall(operators.NotEquals, - inlined, - ctx.NewLiteral(types.NullValue), - )) - return - } - if inlinedType.HasTrait(traits.SizerType) { - ctx.UpdateExpr(prev, - ctx.NewCall(operators.NotEquals, - ctx.NewMemberCall(overloads.Size, inlined), - ctx.NewLiteral(types.IntZero), - )) - return - } - ctx.ReportErrorAtID(prev.ID(), "unable to inline expression type %v into presence test", inlinedType) -} - -// isBindable indicates whether the inlined type can be used within a cel.bind() if the expression -// being replaced occurs within a presence test. Value types with a size() method or field selection -// support can be bound. -// -// In future iterations, support may also be added for indexer types which can be rewritten as an `in` -// expression; however, this would imply a rewrite of the inlined expression that may not be necessary -// in most cases. -func isBindable(matches []ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) bool { - if inlinedType.IsAssignableType(NullType) || - inlinedType.HasTrait(traits.SizerType) { - return true - } - for _, m := range matches { - if m.Kind() != ast.SelectKind { - continue - } - sel := m.AsSelect() - if sel.IsTestOnly() { - return false - } - } - return true -} - -// matchVariable matches simple identifiers, select expressions, and presence test expressions -// which match the (potentially) qualified variable name provided as input. -// -// Note, this function does not support inlining against select expressions which includes optional -// field selection. This may be a future refinement. -func (opt *inliningOptimizer) matchVariable(varName string) ast.ExprMatcher { - return func(e ast.NavigableExpr) bool { - if e.Kind() == ast.IdentKind && e.AsIdent() == varName { - return true - } - if e.Kind() == ast.SelectKind { - sel := e.AsSelect() - // While the `ToQualifiedName` call could take the select directly, this - // would skip presence tests from possible matches, which we would like - // to include. - qualName, found := containers.ToQualifiedName(sel.Operand()) - return found && qualName+"."+sel.FieldName() == varName - } - return false - } -} diff --git a/vendor/github.com/google/cel-go/cel/io.go b/vendor/github.com/google/cel-go/cel/io.go deleted file mode 100644 index 2e611228d..000000000 --- a/vendor/github.com/google/cel-go/cel/io.go +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "errors" - "fmt" - "reflect" - - "google.golang.org/protobuf/proto" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/parser" - - celpb "cel.dev/expr" - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - anypb "google.golang.org/protobuf/types/known/anypb" -) - -// CheckedExprToAst converts a checked expression proto message to an Ast. -func CheckedExprToAst(checkedExpr *exprpb.CheckedExpr) *Ast { - checked, _ := CheckedExprToAstWithSource(checkedExpr, nil) - return checked -} - -// CheckedExprToAstWithSource converts a checked expression proto message to an Ast, -// using the provided Source as the textual contents. -// -// In general the source is not necessary unless the AST has been modified between the -// `Parse` and `Check` calls as an `Ast` created from the `Parse` step will carry the source -// through future calls. -// -// Prefer CheckedExprToAst if loading expressions from storage. -func CheckedExprToAstWithSource(checkedExpr *exprpb.CheckedExpr, src Source) (*Ast, error) { - checked, err := ast.ToAST(checkedExpr) - if err != nil { - return nil, err - } - return &Ast{source: src, impl: checked}, nil -} - -// AstToCheckedExpr converts an Ast to an protobuf CheckedExpr value. -// -// If the Ast.IsChecked() returns false, this conversion method will return an error. -func AstToCheckedExpr(a *Ast) (*exprpb.CheckedExpr, error) { - if !a.IsChecked() { - return nil, fmt.Errorf("cannot convert unchecked ast") - } - return ast.ToProto(a.NativeRep()) -} - -// ParsedExprToAst converts a parsed expression proto message to an Ast. -func ParsedExprToAst(parsedExpr *exprpb.ParsedExpr) *Ast { - return ParsedExprToAstWithSource(parsedExpr, nil) -} - -// ParsedExprToAstWithSource converts a parsed expression proto message to an Ast, -// using the provided Source as the textual contents. -// -// In general you only need this if you need to recheck a previously checked -// expression, or if you need to separately check a subset of an expression. -// -// Prefer ParsedExprToAst if loading expressions from storage. -func ParsedExprToAstWithSource(parsedExpr *exprpb.ParsedExpr, src Source) *Ast { - info, _ := ast.ProtoToSourceInfo(parsedExpr.GetSourceInfo()) - if src == nil { - src = common.NewInfoSource(parsedExpr.GetSourceInfo()) - } - e, _ := ast.ProtoToExpr(parsedExpr.GetExpr()) - return &Ast{source: src, impl: ast.NewAST(e, info)} -} - -// AstToParsedExpr converts an Ast to an protobuf ParsedExpr value. -func AstToParsedExpr(a *Ast) (*exprpb.ParsedExpr, error) { - return &exprpb.ParsedExpr{ - Expr: a.Expr(), - SourceInfo: a.SourceInfo(), - }, nil -} - -// AstToString converts an Ast back to a string if possible. -// -// Note, the conversion may not be an exact replica of the original expression, but will produce -// a string that is semantically equivalent and whose textual representation is stable. -func AstToString(a *Ast) (string, error) { - return ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo()) -} - -// ExprToString converts an AST Expr node back to a string using macro call tracking metadata from -// source info if any macros are encountered within the expression. -func ExprToString(e ast.Expr, info *ast.SourceInfo) (string, error) { - return parser.Unparse(e, info) -} - -// RefValueToValue converts between ref.Val and google.api.expr.v1alpha1.Value. -// The result Value is the serialized proto form. The ref.Val must not be error or unknown. -func RefValueToValue(res ref.Val) (*exprpb.Value, error) { - return ValueAsAlphaProto(res) -} - -// ValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.Value. -// The result Value is the serialized proto form. The ref.Val must not be error or unknown. -func ValueAsAlphaProto(res ref.Val) (*exprpb.Value, error) { - canonical, err := ValueAsProto(res) - if err != nil { - return nil, err - } - alpha := &exprpb.Value{} - err = convertProto(canonical, alpha) - return alpha, err -} - -// RefValToExprValue converts between ref.Val and google.api.expr.v1alpha1.ExprValue. -// The result ExprValue is the serialized proto form. -func RefValToExprValue(res ref.Val) (*exprpb.ExprValue, error) { - return ExprValueAsAlphaProto(res) -} - -// ExprValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.ExprValue. -// The result ExprValue is the serialized proto form. -func ExprValueAsAlphaProto(res ref.Val) (*exprpb.ExprValue, error) { - canonical, err := ExprValueAsProto(res) - if err != nil { - return nil, err - } - alpha := &exprpb.ExprValue{} - err = convertProto(canonical, alpha) - return alpha, err -} - -// ExprValueAsProto converts between ref.Val and cel.expr.ExprValue. -// The result ExprValue is the serialized proto form. -func ExprValueAsProto(res ref.Val) (*celpb.ExprValue, error) { - switch res := res.(type) { - case *types.Unknown: - return &celpb.ExprValue{ - Kind: &celpb.ExprValue_Unknown{ - Unknown: &celpb.UnknownSet{ - Exprs: res.IDs(), - }, - }}, nil - case *types.Err: - return &celpb.ExprValue{ - Kind: &celpb.ExprValue_Error{ - Error: &celpb.ErrorSet{ - // Keeping the error code as UNKNOWN since there's no error codes associated with - // Cel-Go runtime errors. - Errors: []*celpb.Status{{Code: 2, Message: res.Error()}}, - }, - }, - }, nil - default: - val, err := ValueAsProto(res) - if err != nil { - return nil, err - } - return &celpb.ExprValue{ - Kind: &celpb.ExprValue_Value{Value: val}}, nil - } -} - -// ValueAsProto converts between ref.Val and cel.expr.Value. -// The result Value is the serialized proto form. The ref.Val must not be error or unknown. -func ValueAsProto(res ref.Val) (*celpb.Value, error) { - switch res.Type() { - case types.BoolType: - return &celpb.Value{ - Kind: &celpb.Value_BoolValue{BoolValue: res.Value().(bool)}}, nil - case types.BytesType: - return &celpb.Value{ - Kind: &celpb.Value_BytesValue{BytesValue: res.Value().([]byte)}}, nil - case types.DoubleType: - return &celpb.Value{ - Kind: &celpb.Value_DoubleValue{DoubleValue: res.Value().(float64)}}, nil - case types.IntType: - return &celpb.Value{ - Kind: &celpb.Value_Int64Value{Int64Value: res.Value().(int64)}}, nil - case types.ListType: - l := res.(traits.Lister) - sz := l.Size().(types.Int) - elts := make([]*celpb.Value, 0, int64(sz)) - for i := types.Int(0); i < sz; i++ { - v, err := ValueAsProto(l.Get(i)) - if err != nil { - return nil, err - } - elts = append(elts, v) - } - return &celpb.Value{ - Kind: &celpb.Value_ListValue{ - ListValue: &celpb.ListValue{Values: elts}}}, nil - case types.MapType: - mapper := res.(traits.Mapper) - sz := mapper.Size().(types.Int) - entries := make([]*celpb.MapValue_Entry, 0, int64(sz)) - for it := mapper.Iterator(); it.HasNext().(types.Bool); { - k := it.Next() - v := mapper.Get(k) - kv, err := ValueAsProto(k) - if err != nil { - return nil, err - } - vv, err := ValueAsProto(v) - if err != nil { - return nil, err - } - entries = append(entries, &celpb.MapValue_Entry{Key: kv, Value: vv}) - } - return &celpb.Value{ - Kind: &celpb.Value_MapValue{ - MapValue: &celpb.MapValue{Entries: entries}}}, nil - case types.NullType: - return &celpb.Value{ - Kind: &celpb.Value_NullValue{}}, nil - case types.StringType: - return &celpb.Value{ - Kind: &celpb.Value_StringValue{StringValue: res.Value().(string)}}, nil - case types.TypeType: - typeName := res.(ref.Type).TypeName() - return &celpb.Value{Kind: &celpb.Value_TypeValue{TypeValue: typeName}}, nil - case types.UintType: - return &celpb.Value{ - Kind: &celpb.Value_Uint64Value{Uint64Value: res.Value().(uint64)}}, nil - default: - any, err := res.ConvertToNative(anyPbType) - if err != nil { - return nil, err - } - return &celpb.Value{ - Kind: &celpb.Value_ObjectValue{ObjectValue: any.(*anypb.Any)}}, nil - } -} - -var ( - typeNameToTypeValue = map[string]ref.Val{ - "bool": types.BoolType, - "bytes": types.BytesType, - "double": types.DoubleType, - "null_type": types.NullType, - "int": types.IntType, - "list": types.ListType, - "map": types.MapType, - "string": types.StringType, - "type": types.TypeType, - "uint": types.UintType, - } - - anyPbType = reflect.TypeOf(&anypb.Any{}) -) - -// ValueToRefValue converts between google.api.expr.v1alpha1.Value and ref.Val. -func ValueToRefValue(adapter types.Adapter, v *exprpb.Value) (ref.Val, error) { - return AlphaProtoAsValue(adapter, v) -} - -// AlphaProtoAsValue converts between google.api.expr.v1alpha1.Value and ref.Val. -func AlphaProtoAsValue(adapter types.Adapter, v *exprpb.Value) (ref.Val, error) { - canonical := &celpb.Value{} - if err := convertProto(v, canonical); err != nil { - return nil, err - } - return ProtoAsValue(adapter, canonical) -} - -// ProtoAsValue converts between cel.expr.Value and ref.Val. -func ProtoAsValue(adapter types.Adapter, v *celpb.Value) (ref.Val, error) { - switch v.Kind.(type) { - case *celpb.Value_NullValue: - return types.NullValue, nil - case *celpb.Value_BoolValue: - return types.Bool(v.GetBoolValue()), nil - case *celpb.Value_Int64Value: - return types.Int(v.GetInt64Value()), nil - case *celpb.Value_Uint64Value: - return types.Uint(v.GetUint64Value()), nil - case *celpb.Value_DoubleValue: - return types.Double(v.GetDoubleValue()), nil - case *celpb.Value_StringValue: - return types.String(v.GetStringValue()), nil - case *celpb.Value_BytesValue: - return types.Bytes(v.GetBytesValue()), nil - case *celpb.Value_ObjectValue: - any := v.GetObjectValue() - msg, err := anypb.UnmarshalNew(any, proto.UnmarshalOptions{DiscardUnknown: true}) - if err != nil { - return nil, err - } - return adapter.NativeToValue(msg), nil - case *celpb.Value_MapValue: - m := v.GetMapValue() - entries := make(map[ref.Val]ref.Val) - for _, entry := range m.Entries { - key, err := ProtoAsValue(adapter, entry.Key) - if err != nil { - return nil, err - } - pb, err := ProtoAsValue(adapter, entry.Value) - if err != nil { - return nil, err - } - entries[key] = pb - } - return adapter.NativeToValue(entries), nil - case *celpb.Value_ListValue: - l := v.GetListValue() - elts := make([]ref.Val, len(l.Values)) - for i, e := range l.Values { - rv, err := ProtoAsValue(adapter, e) - if err != nil { - return nil, err - } - elts[i] = rv - } - return adapter.NativeToValue(elts), nil - case *celpb.Value_TypeValue: - typeName := v.GetTypeValue() - tv, ok := typeNameToTypeValue[typeName] - if ok { - return tv, nil - } - return types.NewObjectTypeValue(typeName), nil - } - return nil, errors.New("unknown value") -} - -func convertProto(src, dst proto.Message) error { - pb, err := proto.Marshal(src) - if err != nil { - return err - } - err = proto.Unmarshal(pb, dst) - return err -} diff --git a/vendor/github.com/google/cel-go/cel/library.go b/vendor/github.com/google/cel-go/cel/library.go deleted file mode 100644 index 59a10e81d..000000000 --- a/vendor/github.com/google/cel-go/cel/library.go +++ /dev/null @@ -1,871 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "fmt" - "math" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/env" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/stdlib" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/interpreter" - "github.com/google/cel-go/parser" -) - -const ( - optMapMacro = "optMap" - optFlatMapMacro = "optFlatMap" - hasValueFunc = "hasValue" - unwrapOptFunc = "unwrapOpt" - optionalNoneFunc = "optional.none" - optionalOfFunc = "optional.of" - optionalOfNonZeroValueFunc = "optional.ofNonZeroValue" - optionalUnwrapFunc = "optional.unwrap" - valueFunc = "value" - unusedIterVar = "#unused" -) - -// Library provides a collection of EnvOption and ProgramOption values used to configure a CEL -// environment for a particular use case or with a related set of functionality. -// -// Note, the ProgramOption values provided by a library are expected to be static and not vary -// between calls to Env.Program(). If there is a need for such dynamic configuration, prefer to -// configure these options outside the Library and within the Env.Program() call directly. -type Library interface { - // CompileOptions returns a collection of functional options for configuring the Parse / Check - // environment. - CompileOptions() []EnvOption - - // ProgramOptions returns a collection of functional options which should be included in every - // Program generated from the Env.Program() call. - ProgramOptions() []ProgramOption -} - -// SingletonLibrary refines the Library interface to ensure that libraries in this format are only -// configured once within the environment. -type SingletonLibrary interface { - Library - - // LibraryName provides a namespaced name which is used to check whether the library has already - // been configured in the environment. - LibraryName() string -} - -// LibraryAliaser generates a simple named alias for the library, for use during environment serialization. -type LibraryAliaser interface { - LibraryAlias() string -} - -// LibrarySubsetter provides the subset description associated with the library, nil if not subset. -type LibrarySubsetter interface { - LibrarySubset() *env.LibrarySubset -} - -// LibraryVersioner provides a version number for the library. -// -// If not implemented, the library version will be flagged as 'latest' during environment serialization. -type LibraryVersioner interface { - LibraryVersion() uint32 -} - -// Lib creates an EnvOption out of a Library, allowing libraries to be provided as functional args, -// and to be linked to each other. -func Lib(l Library) EnvOption { - singleton, isSingleton := l.(SingletonLibrary) - return func(e *Env) (*Env, error) { - if isSingleton { - if e.HasLibrary(singleton.LibraryName()) { - return e, nil - } - e.libraries[singleton.LibraryName()] = singleton - } - var err error - for _, opt := range l.CompileOptions() { - e, err = opt(e) - if err != nil { - return nil, err - } - } - e.progOpts = append(e.progOpts, l.ProgramOptions()...) - return e, nil - } -} - -// StdLibOption specifies a functional option for configuring the standard CEL library. -type StdLibOption func(*stdLibrary) *stdLibrary - -// StdLibSubset configures the standard library to use a subset of its functions and macros. -// -// Since the StdLib is a singleton library, only the first instance of the StdLib() environment options -// will be configured on the environment which means only the StdLibSubset() initially configured with -// the library will be used. -func StdLibSubset(subset *env.LibrarySubset) StdLibOption { - return func(lib *stdLibrary) *stdLibrary { - lib.subset = subset - return lib - } -} - -// StdLib returns an EnvOption for the standard library of CEL functions and macros. -func StdLib(opts ...StdLibOption) EnvOption { - lib := &stdLibrary{} - for _, o := range opts { - lib = o(lib) - } - return Lib(lib) -} - -// stdLibrary implements the Library interface and provides functional options for the core CEL -// features documented in the specification. -type stdLibrary struct { - subset *env.LibrarySubset -} - -// LibraryName implements the SingletonLibrary interface method. -func (*stdLibrary) LibraryName() string { - return "cel.lib.std" -} - -// LibraryAlias returns the simple name of the library. -func (*stdLibrary) LibraryAlias() string { - return "stdlib" -} - -// LibrarySubset returns the env.LibrarySubset definition associated with the CEL Library. -func (lib *stdLibrary) LibrarySubset() *env.LibrarySubset { - return lib.subset -} - -// CompileOptions returns options for the standard CEL function declarations and macros. -func (lib *stdLibrary) CompileOptions() []EnvOption { - funcs := stdlib.Functions() - macros := StandardMacros - if lib.subset != nil { - subMacros := []Macro{} - for _, m := range macros { - if lib.subset.SubsetMacro(m.Function()) { - subMacros = append(subMacros, m) - } - } - macros = subMacros - subFuncs := []*decls.FunctionDecl{} - for _, fn := range funcs { - if f, include := lib.subset.SubsetFunction(fn); include { - subFuncs = append(subFuncs, f) - } - } - funcs = subFuncs - } - return []EnvOption{ - func(e *Env) (*Env, error) { - var err error - if err = lib.subset.Validate(); err != nil { - return nil, err - } - e.variables = append(e.variables, stdlib.Types()...) - for _, fn := range funcs { - existing, found := e.functions[fn.Name()] - if found { - fn, err = existing.Merge(fn) - if err != nil { - return nil, err - } - } - e.functions[fn.Name()] = fn - } - return e, nil - }, - Macros(macros...), - } -} - -// ProgramOptions returns function implementations for the standard CEL functions. -func (*stdLibrary) ProgramOptions() []ProgramOption { - return []ProgramOption{} -} - -// OptionalTypes enable support for optional syntax and types in CEL. -// -// The optional value type makes it possible to express whether variables have -// been provided, whether a result has been computed, and in the future whether -// an object field path, map key value, or list index has a value. -// -// # Syntax Changes -// -// OptionalTypes are unlike other CEL extensions because they modify the CEL -// syntax itself, notably through the use of a `?` preceding a field name or -// index value. -// -// ## Field Selection -// -// The optional syntax in field selection is denoted as `obj.?field`. In other -// words, if a field is set, return `optional.of(obj.field)“, else -// `optional.none()`. The optional field selection is viral in the sense that -// after the first optional selection all subsequent selections or indices -// are treated as optional, i.e. the following expressions are equivalent: -// -// obj.?field.subfield -// obj.?field.?subfield -// -// ## Indexing -// -// Similar to field selection, the optional syntax can be used in index -// expressions on maps and lists: -// -// list[?0] -// map[?key] -// -// ## Optional Field Setting -// -// When creating map or message literals, if a field may be optionally set -// based on its presence, then placing a `?` before the field name or key -// will ensure the type on the right-hand side must be optional(T) where T -// is the type of the field or key-value. -// -// The following returns a map with the key expression set only if the -// subfield is present, otherwise an empty map is created: -// -// {?key: obj.?field.subfield} -// -// ## Optional Element Setting -// -// When creating list literals, an element in the list may be optionally added -// when the element expression is preceded by a `?`: -// -// [a, ?b, ?c] // return a list with either [a], [a, b], [a, b, c], or [a, c] -// -// # Optional.Of -// -// Create an optional(T) value of a given value with type T. -// -// optional.of(10) -// -// # Optional.OfNonZeroValue -// -// Create an optional(T) value of a given value with type T if it is not a -// zero-value. A zero-value the default empty value for any given CEL type, -// including empty protobuf message types. If the value is empty, the result -// of this call will be optional.none(). -// -// optional.ofNonZeroValue([1, 2, 3]) // optional(list(int)) -// optional.ofNonZeroValue([]) // optional.none() -// optional.ofNonZeroValue(0) // optional.none() -// optional.ofNonZeroValue("") // optional.none() -// -// # Optional.None -// -// Create an empty optional value. -// -// # HasValue -// -// Determine whether the optional contains a value. -// -// optional.of(b'hello').hasValue() // true -// optional.ofNonZeroValue({}).hasValue() // false -// -// # Value -// -// Get the value contained by the optional. If the optional does not have a -// value, the result will be a CEL error. -// -// optional.of(b'hello').value() // b'hello' -// optional.ofNonZeroValue({}).value() // error -// -// # Or -// -// If the value on the left-hand side is optional.none(), the optional value -// on the right hand side is returned. If the value on the left-hand set is -// valued, then it is returned. This operation is short-circuiting and will -// only evaluate as many links in the `or` chain as are needed to return a -// non-empty optional value. -// -// obj.?field.or(m[?key]) -// l[?index].or(obj.?field.subfield).or(obj.?other) -// -// # OrValue -// -// Either return the value contained within the optional on the left-hand side -// or return the alternative value on the right hand side. -// -// m[?key].orValue("none") -// -// # OptMap -// -// Apply a transformation to the optional's underlying value if it is not empty -// and return an optional typed result based on the transformation. The -// transformation expression type must return a type T which is wrapped into -// an optional. -// -// msg.?elements.optMap(e, e.size()).orValue(0) -// -// # OptFlatMap -// -// Introduced in version: 1 -// -// Apply a transformation to the optional's underlying value if it is not empty -// and return the result. The transform expression must return an optional(T) -// rather than type T. This can be useful when dealing with zero values and -// conditionally generating an empty or non-empty result in ways which cannot -// be expressed with `optMap`. -// -// msg.?elements.optFlatMap(e, e[?0]) // return the first element if present. -// -// # First -// -// Introduced in version: 2 -// -// Returns an optional with the first value from the right hand list, or -// optional.None. -// -// [1, 2, 3].first().value() == 1 -// -// # Last -// -// Introduced in version: 2 -// -// Returns an optional with the last value from the right hand list, or -// optional.None. -// -// [1, 2, 3].last().value() == 3 -// -// This is syntactic sugar for msg.elements[msg.elements.size()-1]. -// -// # Unwrap / UnwrapOpt -// -// Introduced in version: 2 -// -// Returns a list of all the values that are not none in the input list of optional values. -// Can be used as optional.unwrap(List[T]) or with postfix notation: List[T].unwrapOpt() -// -// optional.unwrap([optional.of(42), optional.none()]) == [42] -// [optional.of(42), optional.none()].unwrapOpt() == [42] -func OptionalTypes(opts ...OptionalTypesOption) EnvOption { - lib := &optionalLib{version: math.MaxUint32} - for _, opt := range opts { - lib = opt(lib) - } - return Lib(lib) -} - -type optionalLib struct { - version uint32 -} - -// OptionalTypesOption is a functional interface for configuring the strings library. -type OptionalTypesOption func(*optionalLib) *optionalLib - -// OptionalTypesVersion configures the version of the optional type library. -// -// The version limits which functions are available. Only functions introduced -// below or equal to the given version included in the library. If this option -// is not set, all functions are available. -// -// See the library documentation to determine which version a function was introduced. -// If the documentation does not state which version a function was introduced, it can -// be assumed to be introduced at version 0, when the library was first created. -func OptionalTypesVersion(version uint32) OptionalTypesOption { - return func(lib *optionalLib) *optionalLib { - lib.version = version - return lib - } -} - -// LibraryName implements the SingletonLibrary interface method. -func (*optionalLib) LibraryName() string { - return "cel.lib.optional" -} - -// LibraryAlias returns the simple name of the library. -func (*optionalLib) LibraryAlias() string { - return "optional" -} - -// LibraryVersion returns the version of the library. -func (lib *optionalLib) LibraryVersion() uint32 { - return lib.version -} - -// CompileOptions implements the Library interface method. -func (lib *optionalLib) CompileOptions() []EnvOption { - paramTypeK := TypeParamType("K") - paramTypeV := TypeParamType("V") - optionalTypeV := OptionalType(paramTypeV) - listTypeV := ListType(paramTypeV) - mapTypeKV := MapType(paramTypeK, paramTypeV) - listOptionalTypeV := ListType(optionalTypeV) - - opts := []EnvOption{ - // Enable the optional syntax in the parser. - enableOptionalSyntax(), - - // Introduce the optional type. - Types(types.OptionalType), - - // Configure the optMap and optFlatMap macros. - Macros(ReceiverMacro(optMapMacro, 2, optMap, - MacroDocs(`perform computation on the value if present and return the result as an optional`), - MacroExamples( - common.MultilineDescription( - `// sub with the prefix 'dev.cel' or optional.none()`, - `request.auth.tokens.?sub.optMap(id, 'dev.cel.' + id)`), - `optional.none().optMap(i, i * 2) // optional.none()`))), - - // Global and member functions for working with optional values. - Function(optionalOfFunc, - FunctionDocs(`create a new optional_type(T) with a value where any value is considered valid`), - Overload("optional_of", []*Type{paramTypeV}, optionalTypeV, - OverloadExamples(`optional.of(1) // optional(1)`), - UnaryBinding(func(value ref.Val) ref.Val { - return types.OptionalOf(value) - }))), - Function(optionalOfNonZeroValueFunc, - FunctionDocs(`create a new optional_type(T) with a value, if the value is not a zero or empty value`), - Overload("optional_ofNonZeroValue", []*Type{paramTypeV}, optionalTypeV, - OverloadExamples( - `optional.ofNonZeroValue(null) // optional.none()`, - `optional.ofNonZeroValue("") // optional.none()`, - `optional.ofNonZeroValue("hello") // optional.of('hello')`), - UnaryBinding(func(value ref.Val) ref.Val { - v, isZeroer := value.(traits.Zeroer) - if !isZeroer || !v.IsZeroValue() { - return types.OptionalOf(value) - } - return types.OptionalNone - }))), - Function(optionalNoneFunc, - FunctionDocs(`singleton value representing an optional without a value`), - Overload("optional_none", []*Type{}, optionalTypeV, - OverloadExamples(`optional.none()`), - FunctionBinding(func(values ...ref.Val) ref.Val { - return types.OptionalNone - }))), - Function(valueFunc, - FunctionDocs(`obtain the value contained by the optional, error if optional.none()`), - MemberOverload("optional_value", []*Type{optionalTypeV}, paramTypeV, - OverloadExamples( - `optional.of(1).value() // 1`, - `optional.none().value() // error`), - UnaryBinding(func(value ref.Val) ref.Val { - opt := value.(*types.Optional) - return opt.GetValue() - }))), - Function(hasValueFunc, - FunctionDocs(`determine whether the optional contains a value`), - MemberOverload("optional_hasValue", []*Type{optionalTypeV}, BoolType, - OverloadExamples(`optional.of({1: 2}).hasValue() // true`), - UnaryBinding(func(value ref.Val) ref.Val { - opt := value.(*types.Optional) - return types.Bool(opt.HasValue()) - }))), - - // Implementation of 'or' and 'orValue' are special-cased to support short-circuiting in the - // evaluation chain. - Function("or", - FunctionDocs(`chain optional expressions together, picking the first valued optional expression`), - MemberOverload("optional_or_optional", []*Type{optionalTypeV, optionalTypeV}, optionalTypeV, - OverloadExamples( - `optional.none().or(optional.of(1)) // optional.of(1)`, - common.MultilineDescription( - `// either a value from the first list, a value from the second, or optional.none()`, - `[1, 2, 3][?x].or([3, 4, 5][?y])`)))), - Function("orValue", - FunctionDocs(`chain optional expressions together picking the first valued optional or the default value`), - MemberOverload("optional_orValue_value", []*Type{optionalTypeV, paramTypeV}, paramTypeV, - OverloadExamples( - common.MultilineDescription( - `// pick the value for the given key if the key exists, otherwise return 'you'`, - `{'hello': 'world', 'goodbye': 'cruel world'}[?greeting].orValue('you')`)))), - - // OptSelect is handled specially by the type-checker, so the receiver's field type is used to determine the - // optput type. - Function(operators.OptSelect, - FunctionDocs(`if the field is present create an optional of the field value, otherwise return optional.none()`), - Overload("select_optional_field", []*Type{DynType, StringType}, optionalTypeV, - OverloadExamples( - `msg.?field // optional.of(field) if non-empty, otherwise optional.none()`, - `msg.?field.?nested_field // optional.of(nested_field) if both field and nested_field are non-empty.`))), - - // OptIndex is handled mostly like any other indexing operation on a list or map, so the type-checker can use - // these signatures to determine type-agreement without any special handling. - Function(operators.OptIndex, - FunctionDocs(`if the index is present create an optional of the field value, otherwise return optional.none()`), - Overload("list_optindex_optional_int", []*Type{listTypeV, IntType}, optionalTypeV, - OverloadExamples(`[1, 2, 3][?x] // element value if x is in the list size, else optional.none()`)), - Overload("optional_list_optindex_optional_int", []*Type{OptionalType(listTypeV), IntType}, optionalTypeV), - Overload("map_optindex_optional_value", []*Type{mapTypeKV, paramTypeK}, optionalTypeV, - OverloadExamples( - `map_value[?key] // value at the key if present, else optional.none()`, - common.MultilineDescription( - `// map key-value if index is a valid map key, else optional.none()`, - `{0: 2, 2: 4, 6: 8}[?index]`))), - Overload("optional_map_optindex_optional_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)), - - // Index overloads to accommodate using an optional value as the operand. - Function(operators.Index, - Overload("optional_list_index_int", []*Type{OptionalType(listTypeV), IntType}, optionalTypeV), - Overload("optional_map_index_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)), - } - if lib.version >= 1 { - opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap, - MacroDocs(`perform computation on the value if present and produce an optional value within the computation`), - MacroExamples( - common.MultilineDescription( - `// m = {'key': {}}`, - `m.?key.optFlatMap(k, k.?subkey) // optional.none()`), - common.MultilineDescription( - `// m = {'key': {'subkey': 'value'}}`, - `m.?key.optFlatMap(k, k.?subkey) // optional.of('value')`), - )))) - } - - if lib.version >= 2 { - opts = append(opts, Function("last", - FunctionDocs(`return the last value in a list if present, otherwise optional.none()`), - MemberOverload("list_last", []*Type{listTypeV}, optionalTypeV, - OverloadExamples( - `[].last() // optional.none()`, - `[1, 2, 3].last() ? optional.of(3)`), - UnaryBinding(func(v ref.Val) ref.Val { - list := v.(traits.Lister) - sz := list.Size().(types.Int) - if sz == types.IntZero { - return types.OptionalNone - } - return types.OptionalOf(list.Get(types.Int(sz - 1))) - }), - ), - )) - - opts = append(opts, Function("first", - FunctionDocs(`return the first value in a list if present, otherwise optional.none()`), - MemberOverload("list_first", []*Type{listTypeV}, optionalTypeV, - OverloadExamples( - `[].first() // optional.none()`, - `[1, 2, 3].first() ? optional.of(1)`), - UnaryBinding(func(v ref.Val) ref.Val { - list := v.(traits.Lister) - sz := list.Size().(types.Int) - if sz == types.IntZero { - return types.OptionalNone - } - return types.OptionalOf(list.Get(types.Int(0))) - }), - ), - )) - - opts = append(opts, Function(optionalUnwrapFunc, - FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`), - Overload("optional_unwrap", []*Type{listOptionalTypeV}, listTypeV, - OverloadExamples(`optional.unwrap([optional.of(1), optional.none()]) // [1]`), - UnaryBinding(optUnwrap)))) - opts = append(opts, Function(unwrapOptFunc, - FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`), - MemberOverload("optional_unwrapOpt", []*Type{listOptionalTypeV}, listTypeV, - OverloadExamples(`[optional.of(1), optional.none()].unwrapOpt() // [1]`), - UnaryBinding(optUnwrap)))) - } - - return opts -} - -// ProgramOptions implements the Library interface method. -func (lib *optionalLib) ProgramOptions() []ProgramOption { - return []ProgramOption{ - CustomDecorator(decorateOptionalOr), - } -} - -// Version returns the current version of the library. -func (lib *optionalLib) Version() uint32 { - return lib.version -} - -func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) { - varIdent := args[0] - varName := "" - switch varIdent.Kind() { - case ast.IdentKind: - varName = varIdent.AsIdent() - default: - return nil, meh.NewError(varIdent.ID(), "optMap() variable name must be a simple identifier") - } - mapExpr := args[1] - return meh.NewCall( - operators.Conditional, - meh.NewMemberCall(hasValueFunc, target), - meh.NewCall(optionalOfFunc, - meh.NewComprehension( - meh.NewList(), - unusedIterVar, - varName, - meh.NewMemberCall(valueFunc, meh.Copy(target)), - meh.NewLiteral(types.False), - meh.NewIdent(varName), - mapExpr, - ), - ), - meh.NewCall(optionalNoneFunc), - ), nil -} - -func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) { - varIdent := args[0] - varName := "" - switch varIdent.Kind() { - case ast.IdentKind: - varName = varIdent.AsIdent() - default: - return nil, meh.NewError(varIdent.ID(), "optFlatMap() variable name must be a simple identifier") - } - mapExpr := args[1] - return meh.NewCall( - operators.Conditional, - meh.NewMemberCall(hasValueFunc, target), - meh.NewComprehension( - meh.NewList(), - unusedIterVar, - varName, - meh.NewMemberCall(valueFunc, meh.Copy(target)), - meh.NewLiteral(types.False), - meh.NewIdent(varName), - mapExpr, - ), - meh.NewCall(optionalNoneFunc), - ), nil -} - -func optUnwrap(value ref.Val) ref.Val { - list := value.(traits.Lister) - var unwrappedList []ref.Val - iter := list.Iterator() - for iter.HasNext() == types.True { - val := iter.Next() - opt, isOpt := val.(*types.Optional) - if !isOpt { - return types.WrapErr(fmt.Errorf("value %v is not optional", val)) - } - if opt.HasValue() { - unwrappedList = append(unwrappedList, opt.GetValue()) - } - } - return types.DefaultTypeAdapter.NativeToValue(unwrappedList) -} - -func enableOptionalSyntax() EnvOption { - return func(e *Env) (*Env, error) { - e.prsrOpts = append(e.prsrOpts, parser.EnableOptionalSyntax(true)) - return e, nil - } -} - -// EnableErrorOnBadPresenceTest enables error generation when a presence test or optional field -// selection is performed on a primitive type. -func EnableErrorOnBadPresenceTest(value bool) EnvOption { - return features(featureEnableErrorOnBadPresenceTest, value) -} - -func decorateOptionalOr(i interpreter.Interpretable) (interpreter.Interpretable, error) { - call, ok := i.(interpreter.InterpretableCall) - if !ok { - return i, nil - } - args := call.Args() - if len(args) != 2 { - return i, nil - } - switch call.Function() { - case "or": - if call.OverloadID() != "" && call.OverloadID() != "optional_or_optional" { - return i, nil - } - return &evalOptionalOr{ - id: call.ID(), - lhs: args[0], - rhs: args[1], - }, nil - case "orValue": - if call.OverloadID() != "" && call.OverloadID() != "optional_orValue_value" { - return i, nil - } - return &evalOptionalOrValue{ - id: call.ID(), - lhs: args[0], - rhs: args[1], - }, nil - default: - return i, nil - } -} - -// evalOptionalOr selects between two optional values, either the first if it has a value, or -// the second optional expression is evaluated and returned. -type evalOptionalOr struct { - id int64 - lhs interpreter.Interpretable - rhs interpreter.Interpretable -} - -// ID implements the Interpretable interface method. -func (opt *evalOptionalOr) ID() int64 { - return opt.id -} - -// Eval evaluates the left-hand side optional to determine whether it contains a value, else -// proceeds with the right-hand side evaluation. -func (opt *evalOptionalOr) Eval(ctx interpreter.Activation) ref.Val { - // short-circuit lhs. - optLHS := opt.lhs.Eval(ctx) - optVal, ok := optLHS.(*types.Optional) - if !ok { - return optLHS - } - if optVal.HasValue() { - return optVal - } - return opt.rhs.Eval(ctx) -} - -// evalOptionalOrValue selects between an optional or a concrete value. If the optional has a value, -// its value is returned, otherwise the alternative value expression is evaluated and returned. -type evalOptionalOrValue struct { - id int64 - lhs interpreter.Interpretable - rhs interpreter.Interpretable -} - -// ID implements the Interpretable interface method. -func (opt *evalOptionalOrValue) ID() int64 { - return opt.id -} - -// Eval evaluates the left-hand side optional to determine whether it contains a value, else -// proceeds with the right-hand side evaluation. -func (opt *evalOptionalOrValue) Eval(ctx interpreter.Activation) ref.Val { - // short-circuit lhs. - optLHS := opt.lhs.Eval(ctx) - optVal, ok := optLHS.(*types.Optional) - if !ok { - return optLHS - } - if optVal.HasValue() { - return optVal.GetValue() - } - return opt.rhs.Eval(ctx) -} - -type timeLegacyLibrary struct{} - -func (timeLegacyLibrary) CompileOptions() []EnvOption { - return timeOverloadDeclarations -} - -func (timeLegacyLibrary) ProgramOptions() []ProgramOption { - return []ProgramOption{} -} - -// Declarations and functions which enable using UTC on time.Time inputs when the timezone is unspecified -// in the CEL expression. -var ( - timeOverloadDeclarations = []EnvOption{ - Function(overloads.TimeGetFullYear, - MemberOverload(overloads.TimestampToYear, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetFullYear, overloads.TimestampToYear, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetMonth, - MemberOverload(overloads.TimestampToMonth, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetMonth, overloads.TimestampToMonth, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetDayOfYear, - MemberOverload(overloads.TimestampToDayOfYear, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetDayOfYear, overloads.TimestampToDayOfYear, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetDayOfMonth, - MemberOverload(overloads.TimestampToDayOfMonthZeroBased, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetDayOfMonth, overloads.TimestampToDayOfMonthZeroBased, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetDate, - MemberOverload(overloads.TimestampToDayOfMonthOneBased, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetDate, overloads.TimestampToDayOfMonthOneBased, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetDayOfWeek, - MemberOverload(overloads.TimestampToDayOfWeek, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetDayOfWeek, overloads.TimestampToDayOfWeek, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetHours, - MemberOverload(overloads.TimestampToHours, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetHours, overloads.TimestampToHours, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetMinutes, - MemberOverload(overloads.TimestampToMinutes, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetMinutes, overloads.TimestampToMinutes, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetSeconds, - MemberOverload(overloads.TimestampToSeconds, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetSeconds, overloads.TimestampToSeconds, []ref.Val{}) - }), - ), - ), - Function(overloads.TimeGetMilliseconds, - MemberOverload(overloads.TimestampToMilliseconds, []*Type{TimestampType}, IntType, - UnaryBinding(func(ts ref.Val) ref.Val { - t := ts.(types.Timestamp) - return t.Receive(overloads.TimeGetMilliseconds, overloads.TimestampToMilliseconds, []ref.Val{}) - }), - ), - ), - } -) diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go deleted file mode 100644 index 3d3c5be1b..000000000 --- a/vendor/github.com/google/cel-go/cel/macro.go +++ /dev/null @@ -1,590 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "fmt" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/parser" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Macro describes a function signature to match and the MacroExpander to apply. -// -// Note: when a Macro should apply to multiple overloads (based on arg count) of a given function, -// a Macro should be created per arg-count or as a var arg macro. -type Macro = parser.Macro - -// MacroFactory defines an expansion function which converts a call and its arguments to a cel.Expr value. -type MacroFactory = parser.MacroExpander - -// MacroExprFactory assists with the creation of Expr values in a manner which is consistent -// the internal semantics and id generation behaviors of the parser and checker libraries. -type MacroExprFactory = parser.ExprHelper - -// MacroExpander converts a call and its associated arguments into a protobuf Expr representation. -// -// If the MacroExpander determines within the implementation that an expansion is not needed it may return -// a nil Expr value to indicate a non-match. However, if an expansion is to be performed, but the arguments -// are not well-formed, the result of the expansion will be an error. -// -// The MacroExpander accepts as arguments a MacroExprHelper as well as the arguments used in the function call -// and produces as output an Expr ast node. -// -// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil. -type MacroExpander func(eh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) - -// MacroExprHelper exposes helper methods for creating new expressions within a CEL abstract syntax tree. -// ExprHelper assists with the manipulation of proto-based Expr values in a manner which is -// consistent with the source position and expression id generation code leveraged by both -// the parser and type-checker. -type MacroExprHelper interface { - // Copy the input expression with a brand new set of identifiers. - Copy(*exprpb.Expr) *exprpb.Expr - - // LiteralBool creates an Expr value for a bool literal. - LiteralBool(value bool) *exprpb.Expr - - // LiteralBytes creates an Expr value for a byte literal. - LiteralBytes(value []byte) *exprpb.Expr - - // LiteralDouble creates an Expr value for double literal. - LiteralDouble(value float64) *exprpb.Expr - - // LiteralInt creates an Expr value for an int literal. - LiteralInt(value int64) *exprpb.Expr - - // LiteralString creates am Expr value for a string literal. - LiteralString(value string) *exprpb.Expr - - // LiteralUint creates an Expr value for a uint literal. - LiteralUint(value uint64) *exprpb.Expr - - // NewList creates a CreateList instruction where the list is comprised of the optional set - // of elements provided as arguments. - NewList(elems ...*exprpb.Expr) *exprpb.Expr - - // NewMap creates a CreateStruct instruction for a map where the map is comprised of the - // optional set of key, value entries. - NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr - - // NewMapEntry creates a Map Entry for the key, value pair. - NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry - - // NewObject creates a CreateStruct instruction for an object with a given type name and - // optional set of field initializers. - NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr - - // NewObjectFieldInit creates a new Object field initializer from the field name and value. - NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry - - // Fold creates a fold comprehension instruction. - // - // - iterVar is the iteration variable name. - // - iterRange represents the expression that resolves to a list or map where the elements or - // keys (respectively) will be iterated over. - // - accuVar is the accumulation variable name, typically parser.AccumulatorName. - // - accuInit is the initial expression whose value will be set for the accuVar prior to - // folding. - // - condition is the expression to test to determine whether to continue folding. - // - step is the expression to evaluation at the conclusion of a single fold iteration. - // - result is the computation to evaluate at the conclusion of the fold. - // - // The accuVar should not shadow variable names that you would like to reference within the - // environment in the step and condition expressions. Presently, the name __result__ is commonly - // used by built-in macros but this may change in the future. - Fold(iterVar string, - iterRange *exprpb.Expr, - accuVar string, - accuInit *exprpb.Expr, - condition *exprpb.Expr, - step *exprpb.Expr, - result *exprpb.Expr) *exprpb.Expr - - // Ident creates an identifier Expr value. - Ident(name string) *exprpb.Expr - - // AccuIdent returns an accumulator identifier for use with comprehension results. - AccuIdent() *exprpb.Expr - - // GlobalCall creates a function call Expr value for a global (free) function. - GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr - - // ReceiverCall creates a function call Expr value for a receiver-style function. - ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr - - // PresenceTest creates a Select TestOnly Expr value for modelling has() semantics. - PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr - - // Select create a field traversal Expr value. - Select(operand *exprpb.Expr, field string) *exprpb.Expr - - // OffsetLocation returns the Location of the expression identifier. - OffsetLocation(exprID int64) common.Location - - // NewError associates an error message with a given expression id. - NewError(exprID int64, message string) *Error -} - -// MacroOpt defines a functional option for configuring macro behavior. -type MacroOpt = parser.MacroOpt - -// MacroDocs configures a list of strings into a multiline description for the macro. -func MacroDocs(docs ...string) MacroOpt { - return parser.MacroDocs(docs...) -} - -// MacroExamples configures a list of examples, either as a string or common.MultilineString, -// into an example set to be provided with the macro Documentation() call. -func MacroExamples(examples ...string) MacroOpt { - return parser.MacroExamples(examples...) -} - -// GlobalMacro creates a Macro for a global function with the specified arg count. -func GlobalMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro { - return parser.NewGlobalMacro(function, argCount, factory, opts...) -} - -// ReceiverMacro creates a Macro for a receiver function matching the specified arg count. -func ReceiverMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro { - return parser.NewReceiverMacro(function, argCount, factory, opts...) -} - -// GlobalVarArgMacro creates a Macro for a global function with a variable arg count. -func GlobalVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro { - return parser.NewGlobalVarArgMacro(function, factory, opts...) -} - -// ReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count. -func ReceiverVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro { - return parser.NewReceiverVarArgMacro(function, factory, opts...) -} - -// NewGlobalMacro creates a Macro for a global function with the specified arg count. -// -// Deprecated: use GlobalMacro -func NewGlobalMacro(function string, argCount int, expander MacroExpander) Macro { - expand := adaptingExpander{expander} - return parser.NewGlobalMacro(function, argCount, expand.Expander) -} - -// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count. -// -// Deprecated: use ReceiverMacro -func NewReceiverMacro(function string, argCount int, expander MacroExpander) Macro { - expand := adaptingExpander{expander} - return parser.NewReceiverMacro(function, argCount, expand.Expander) -} - -// NewGlobalVarArgMacro creates a Macro for a global function with a variable arg count. -// -// Deprecated: use GlobalVarArgMacro -func NewGlobalVarArgMacro(function string, expander MacroExpander) Macro { - expand := adaptingExpander{expander} - return parser.NewGlobalVarArgMacro(function, expand.Expander) -} - -// NewReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count. -// -// Deprecated: use ReceiverVarArgMacro -func NewReceiverVarArgMacro(function string, expander MacroExpander) Macro { - expand := adaptingExpander{expander} - return parser.NewReceiverVarArgMacro(function, expand.Expander) -} - -// HasMacroExpander expands the input call arguments into a presence test, e.g. has(.field) -func HasMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { - ph, err := toParserHelper(meh) - if err != nil { - return nil, err - } - arg, err := adaptToExpr(args[0]) - if err != nil { - return nil, err - } - if arg.Kind() == ast.SelectKind { - s := arg.AsSelect() - return adaptToProto(ph.NewPresenceTest(s.Operand(), s.FieldName())) - } - return nil, ph.NewError(arg.ID(), "invalid argument to has() macro") -} - -// ExistsMacroExpander expands the input call arguments into a comprehension that returns true if any of the -// elements in the range match the predicate expressions: -// .exists(, ) -func ExistsMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { - ph, err := toParserHelper(meh) - if err != nil { - return nil, err - } - out, err := parser.MakeExists(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) - if err != nil { - return nil, err - } - return adaptToProto(out) -} - -// ExistsOneMacroExpander expands the input call arguments into a comprehension that returns true if exactly -// one of the elements in the range match the predicate expressions: -// .exists_one(, ) -func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { - ph, err := toParserHelper(meh) - if err != nil { - return nil, err - } - out, err := parser.MakeExistsOne(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) - if err != nil { - return nil, err - } - return adaptToProto(out) -} - -// MapMacroExpander expands the input call arguments into a comprehension that transforms each element in the -// input to produce an output list. -// -// There are two call patterns supported by map: -// -// .map(, ) -// .map(, , ) -// -// In the second form only iterVar values which return true when provided to the predicate expression -// are transformed. -func MapMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { - ph, err := toParserHelper(meh) - if err != nil { - return nil, err - } - out, err := parser.MakeMap(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) - if err != nil { - return nil, err - } - return adaptToProto(out) -} - -// FilterMacroExpander expands the input call arguments into a comprehension which produces a list which contains -// only elements which match the provided predicate expression: -// .filter(, ) -func FilterMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { - ph, err := toParserHelper(meh) - if err != nil { - return nil, err - } - out, err := parser.MakeFilter(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) - if err != nil { - return nil, err - } - return adaptToProto(out) -} - -var ( - // Aliases to each macro in the CEL standard environment. - // Note: reassigning these macro variables may result in undefined behavior. - - // HasMacro expands "has(m.f)" which tests the presence of a field, avoiding the need to - // specify the field as a string. - HasMacro = parser.HasMacro - - // AllMacro expands "range.all(var, predicate)" into a comprehension which ensures that all - // elements in the range satisfy the predicate. - AllMacro = parser.AllMacro - - // ExistsMacro expands "range.exists(var, predicate)" into a comprehension which ensures that - // some element in the range satisfies the predicate. - ExistsMacro = parser.ExistsMacro - - // ExistsOneMacro expands "range.exists_one(var, predicate)", which is true if for exactly one - // element in range the predicate holds. - ExistsOneMacro = parser.ExistsOneMacro - - // MapMacro expands "range.map(var, function)" into a comprehension which applies the function - // to each element in the range to produce a new list. - MapMacro = parser.MapMacro - - // MapFilterMacro expands "range.map(var, predicate, function)" into a comprehension which - // first filters the elements in the range by the predicate, then applies the transform function - // to produce a new list. - MapFilterMacro = parser.MapFilterMacro - - // FilterMacro expands "range.filter(var, predicate)" into a comprehension which filters - // elements in the range, producing a new list from the elements that satisfy the predicate. - FilterMacro = parser.FilterMacro - - // StandardMacros provides an alias to all the CEL macros defined in the standard environment. - StandardMacros = []Macro{ - HasMacro, AllMacro, ExistsMacro, ExistsOneMacro, MapMacro, MapFilterMacro, FilterMacro, - } - - // NoMacros provides an alias to an empty list of macros - NoMacros = []Macro{} -) - -type adaptingExpander struct { - legacyExpander MacroExpander -} - -func (adapt *adaptingExpander) Expander(eh parser.ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - var legacyTarget *exprpb.Expr = nil - var err *Error = nil - if target != nil { - legacyTarget, err = adaptToProto(target) - if err != nil { - return nil, err - } - } - legacyArgs := make([]*exprpb.Expr, len(args)) - for i, arg := range args { - legacyArgs[i], err = adaptToProto(arg) - if err != nil { - return nil, err - } - } - ah := &adaptingHelper{modernHelper: eh} - legacyExpr, err := adapt.legacyExpander(ah, legacyTarget, legacyArgs) - if err != nil { - return nil, err - } - ex, err := adaptToExpr(legacyExpr) - if err != nil { - return nil, err - } - return ex, nil -} - -func wrapErr(id int64, message string, err error) *common.Error { - return &common.Error{ - Location: common.NoLocation, - Message: fmt.Sprintf("%s: %v", message, err), - ExprID: id, - } -} - -type adaptingHelper struct { - modernHelper parser.ExprHelper -} - -// Copy the input expression with a brand new set of identifiers. -func (ah *adaptingHelper) Copy(e *exprpb.Expr) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.Copy(mustAdaptToExpr(e))) -} - -// LiteralBool creates an Expr value for a bool literal. -func (ah *adaptingHelper) LiteralBool(value bool) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bool(value))) -} - -// LiteralBytes creates an Expr value for a byte literal. -func (ah *adaptingHelper) LiteralBytes(value []byte) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bytes(value))) -} - -// LiteralDouble creates an Expr value for double literal. -func (ah *adaptingHelper) LiteralDouble(value float64) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Double(value))) -} - -// LiteralInt creates an Expr value for an int literal. -func (ah *adaptingHelper) LiteralInt(value int64) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Int(value))) -} - -// LiteralString creates am Expr value for a string literal. -func (ah *adaptingHelper) LiteralString(value string) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.String(value))) -} - -// LiteralUint creates an Expr value for a uint literal. -func (ah *adaptingHelper) LiteralUint(value uint64) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Uint(value))) -} - -// NewList creates a CreateList instruction where the list is comprised of the optional set -// of elements provided as arguments. -func (ah *adaptingHelper) NewList(elems ...*exprpb.Expr) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewList(mustAdaptToExprs(elems)...)) -} - -// NewMap creates a CreateStruct instruction for a map where the map is comprised of the -// optional set of key, value entries. -func (ah *adaptingHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr { - adaptedEntries := make([]ast.EntryExpr, len(entries)) - for i, e := range entries { - adaptedEntries[i] = mustAdaptToEntryExpr(e) - } - return mustAdaptToProto(ah.modernHelper.NewMap(adaptedEntries...)) -} - -// NewMapEntry creates a Map Entry for the key, value pair. -func (ah *adaptingHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry { - return mustAdaptToProtoEntry( - ah.modernHelper.NewMapEntry(mustAdaptToExpr(key), mustAdaptToExpr(val), optional)) -} - -// NewObject creates a CreateStruct instruction for an object with a given type name and -// optional set of field initializers. -func (ah *adaptingHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr { - adaptedEntries := make([]ast.EntryExpr, len(fieldInits)) - for i, e := range fieldInits { - adaptedEntries[i] = mustAdaptToEntryExpr(e) - } - return mustAdaptToProto(ah.modernHelper.NewStruct(typeName, adaptedEntries...)) -} - -// NewObjectFieldInit creates a new Object field initializer from the field name and value. -func (ah *adaptingHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry { - return mustAdaptToProtoEntry( - ah.modernHelper.NewStructField(field, mustAdaptToExpr(init), optional)) -} - -// Fold creates a fold comprehension instruction. -// -// - iterVar is the iteration variable name. -// - iterRange represents the expression that resolves to a list or map where the elements or -// keys (respectively) will be iterated over. -// - accuVar is the accumulation variable name, typically parser.AccumulatorName. -// - accuInit is the initial expression whose value will be set for the accuVar prior to -// folding. -// - condition is the expression to test to determine whether to continue folding. -// - step is the expression to evaluation at the conclusion of a single fold iteration. -// - result is the computation to evaluate at the conclusion of the fold. -// -// The accuVar should not shadow variable names that you would like to reference within the -// environment in the step and condition expressions. Presently, the name __result__ is commonly -// used by built-in macros but this may change in the future. -func (ah *adaptingHelper) Fold(iterVar string, - iterRange *exprpb.Expr, - accuVar string, - accuInit *exprpb.Expr, - condition *exprpb.Expr, - step *exprpb.Expr, - result *exprpb.Expr) *exprpb.Expr { - return mustAdaptToProto( - ah.modernHelper.NewComprehension( - mustAdaptToExpr(iterRange), - iterVar, - accuVar, - mustAdaptToExpr(accuInit), - mustAdaptToExpr(condition), - mustAdaptToExpr(step), - mustAdaptToExpr(result), - ), - ) -} - -// Ident creates an identifier Expr value. -func (ah *adaptingHelper) Ident(name string) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewIdent(name)) -} - -// AccuIdent returns an accumulator identifier for use with comprehension results. -func (ah *adaptingHelper) AccuIdent() *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewAccuIdent()) -} - -// GlobalCall creates a function call Expr value for a global (free) function. -func (ah *adaptingHelper) GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr { - return mustAdaptToProto(ah.modernHelper.NewCall(function, mustAdaptToExprs(args)...)) -} - -// ReceiverCall creates a function call Expr value for a receiver-style function. -func (ah *adaptingHelper) ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr { - return mustAdaptToProto( - ah.modernHelper.NewMemberCall(function, mustAdaptToExpr(target), mustAdaptToExprs(args)...)) -} - -// PresenceTest creates a Select TestOnly Expr value for modelling has() semantics. -func (ah *adaptingHelper) PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr { - op := mustAdaptToExpr(operand) - return mustAdaptToProto(ah.modernHelper.NewPresenceTest(op, field)) -} - -// Select create a field traversal Expr value. -func (ah *adaptingHelper) Select(operand *exprpb.Expr, field string) *exprpb.Expr { - op := mustAdaptToExpr(operand) - return mustAdaptToProto(ah.modernHelper.NewSelect(op, field)) -} - -// OffsetLocation returns the Location of the expression identifier. -func (ah *adaptingHelper) OffsetLocation(exprID int64) common.Location { - return ah.modernHelper.OffsetLocation(exprID) -} - -// NewError associates an error message with a given expression id. -func (ah *adaptingHelper) NewError(exprID int64, message string) *Error { - return ah.modernHelper.NewError(exprID, message) -} - -func mustAdaptToExprs(exprs []*exprpb.Expr) []ast.Expr { - adapted := make([]ast.Expr, len(exprs)) - for i, e := range exprs { - adapted[i] = mustAdaptToExpr(e) - } - return adapted -} - -func mustAdaptToExpr(e *exprpb.Expr) ast.Expr { - out, _ := adaptToExpr(e) - return out -} - -func adaptToExpr(e *exprpb.Expr) (ast.Expr, *Error) { - if e == nil { - return nil, nil - } - out, err := ast.ProtoToExpr(e) - if err != nil { - return nil, wrapErr(e.GetId(), "proto conversion failure", err) - } - return out, nil -} - -func mustAdaptToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) ast.EntryExpr { - out, _ := ast.ProtoToEntryExpr(e) - return out -} - -func mustAdaptToProto(e ast.Expr) *exprpb.Expr { - out, _ := adaptToProto(e) - return out -} - -func adaptToProto(e ast.Expr) (*exprpb.Expr, *Error) { - if e == nil { - return nil, nil - } - out, err := ast.ExprToProto(e) - if err != nil { - return nil, wrapErr(e.ID(), "expr conversion failure", err) - } - return out, nil -} - -func mustAdaptToProtoEntry(e ast.EntryExpr) *exprpb.Expr_CreateStruct_Entry { - out, _ := ast.EntryExprToProto(e) - return out -} - -func toParserHelper(meh MacroExprHelper) (parser.ExprHelper, *Error) { - ah, ok := meh.(*adaptingHelper) - if !ok { - return nil, common.NewError(0, - fmt.Sprintf("unsupported macro helper: %v (%T)", meh, meh), - common.NoLocation) - } - return ah.modernHelper, nil -} diff --git a/vendor/github.com/google/cel-go/cel/optimizer.go b/vendor/github.com/google/cel-go/cel/optimizer.go deleted file mode 100644 index 9a2a97a64..000000000 --- a/vendor/github.com/google/cel-go/cel/optimizer.go +++ /dev/null @@ -1,535 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "sort" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// StaticOptimizer contains a sequence of ASTOptimizer instances which will be applied in order. -// -// The static optimizer normalizes expression ids and type-checking run between optimization -// passes to ensure that the final optimized output is a valid expression with metadata consistent -// with what would have been generated from a parsed and checked expression. -// -// Note: source position information is best-effort and likely wrong, but optimized expressions -// should be suitable for calls to parser.Unparse. -type StaticOptimizer struct { - optimizers []ASTOptimizer -} - -// NewStaticOptimizer creates a StaticOptimizer with a sequence of ASTOptimizer's to be applied -// to a checked expression. -func NewStaticOptimizer(optimizers ...ASTOptimizer) *StaticOptimizer { - return &StaticOptimizer{ - optimizers: optimizers, - } -} - -// Optimize applies a sequence of optimizations to an Ast within a given environment. -// -// If issues are encountered, the Issues.Err() return value will be non-nil. -func (opt *StaticOptimizer) Optimize(env *Env, a *Ast) (*Ast, *Issues) { - // Make a copy of the AST to be optimized. - optimized := ast.Copy(a.NativeRep()) - ids := newIDGenerator(ast.MaxID(a.NativeRep())) - - // Create the optimizer context, could be pooled in the future. - issues := NewIssues(common.NewErrors(a.Source())) - baseFac := ast.NewExprFactory() - exprFac := &optimizerExprFactory{ - idGenerator: ids, - fac: baseFac, - sourceInfo: optimized.SourceInfo(), - } - ctx := &OptimizerContext{ - optimizerExprFactory: exprFac, - Env: env, - Issues: issues, - } - - // Apply the optimizations sequentially. - for _, o := range opt.optimizers { - optimized = o.Optimize(ctx, optimized) - if issues.Err() != nil { - return nil, issues - } - // Normalize expression id metadata including coordination with macro call metadata. - freshIDGen := newIDGenerator(0) - info := optimized.SourceInfo() - expr := optimized.Expr() - normalizeIDs(freshIDGen.renumberStable, expr, info) - cleanupMacroRefs(expr, info) - - // Recheck the updated expression for any possible type-agreement or validation errors. - parsed := &Ast{ - source: a.Source(), - impl: ast.NewAST(expr, info)} - checked, iss := ctx.Check(parsed) - if iss.Err() != nil { - return nil, iss - } - optimized = checked.NativeRep() - } - - // Return the optimized result. - return &Ast{ - source: a.Source(), - impl: optimized, - }, nil -} - -// normalizeIDs ensures that the metadata present with an AST is reset in a manner such -// that the ids within the expression correspond to the ids within macros. -func normalizeIDs(idGen ast.IDGenerator, optimized ast.Expr, info *ast.SourceInfo) { - optimized.RenumberIDs(idGen) - if len(info.MacroCalls()) == 0 { - return - } - - // Sort the macro ids to make sure that the renumbering of macro-specific variables - // is stable across normalization calls. - sortedMacroIDs := []int64{} - for id := range info.MacroCalls() { - sortedMacroIDs = append(sortedMacroIDs, id) - } - sort.Slice(sortedMacroIDs, func(i, j int) bool { return sortedMacroIDs[i] < sortedMacroIDs[j] }) - - // First, update the macro call ids themselves. - callIDMap := map[int64]int64{} - for _, id := range sortedMacroIDs { - callIDMap[id] = idGen(id) - } - // Then update the macro call definitions which refer to these ids, but - // ensure that the updates don't collide and remove macro entries which haven't - // been visited / updated yet. - type macroUpdate struct { - id int64 - call ast.Expr - } - macroUpdates := []macroUpdate{} - for _, oldID := range sortedMacroIDs { - newID := callIDMap[oldID] - call, found := info.GetMacroCall(oldID) - if !found { - continue - } - call.RenumberIDs(idGen) - macroUpdates = append(macroUpdates, macroUpdate{id: newID, call: call}) - info.ClearMacroCall(oldID) - } - for _, u := range macroUpdates { - info.SetMacroCall(u.id, u.call) - } -} - -func cleanupMacroRefs(expr ast.Expr, info *ast.SourceInfo) { - if len(info.MacroCalls()) == 0 { - return - } - - // Sanitize the macro call references once the optimized expression has been computed - // and the ids normalized between the expression and the macros. - exprRefMap := make(map[int64]struct{}) - ast.PostOrderVisit(expr, ast.NewExprVisitor(func(e ast.Expr) { - if e.ID() == 0 { - return - } - exprRefMap[e.ID()] = struct{}{} - })) - // Update the macro call id references to ensure that macro pointers are - // updated consistently across macros. - for _, call := range info.MacroCalls() { - ast.PostOrderVisit(call, ast.NewExprVisitor(func(e ast.Expr) { - if e.ID() == 0 { - return - } - exprRefMap[e.ID()] = struct{}{} - })) - } - for id := range info.MacroCalls() { - if _, found := exprRefMap[id]; !found { - info.ClearMacroCall(id) - } - } -} - -// newIDGenerator ensures that new ids are only created the first time they are encountered. -func newIDGenerator(seed int64) *idGenerator { - return &idGenerator{ - idMap: make(map[int64]int64), - seed: seed, - } -} - -type idGenerator struct { - idMap map[int64]int64 - seed int64 -} - -func (gen *idGenerator) nextID() int64 { - gen.seed++ - return gen.seed -} - -func (gen *idGenerator) renumberStable(id int64) int64 { - if id == 0 { - return 0 - } - if newID, found := gen.idMap[id]; found { - return newID - } - nextID := gen.nextID() - gen.idMap[id] = nextID - return nextID -} - -// OptimizerContext embeds Env and Issues instances to make it easy to type-check and evaluate -// subexpressions and report any errors encountered along the way. The context also embeds the -// optimizerExprFactory which can be used to generate new sub-expressions with expression ids -// consistent with the expectations of a parsed expression. -type OptimizerContext struct { - *Env - *optimizerExprFactory - *Issues -} - -// ExtendEnv auguments the context's environment with the additional options. -func (opt *OptimizerContext) ExtendEnv(opts ...EnvOption) error { - e, err := opt.Env.Extend(opts...) - if err != nil { - return err - } - opt.Env = e - return nil -} - -// ASTOptimizer applies an optimization over an AST and returns the optimized result. -type ASTOptimizer interface { - // Optimize optimizes a type-checked AST within an Environment and accumulates any issues. - Optimize(*OptimizerContext, *ast.AST) *ast.AST -} - -type optimizerExprFactory struct { - *idGenerator - fac ast.ExprFactory - sourceInfo *ast.SourceInfo -} - -// NewAST creates an AST from the current expression using the tracked source info which -// is modified and managed by the OptimizerContext. -func (opt *optimizerExprFactory) NewAST(expr ast.Expr) *ast.AST { - return ast.NewAST(expr, opt.sourceInfo) -} - -// CopyAST creates a renumbered copy of `Expr` and `SourceInfo` values of the input AST, where the -// renumbering uses the same scheme as the core optimizer logic ensuring there are no collisions -// between copies. -// -// Use this method before attempting to merge the expression from AST into another. -func (opt *optimizerExprFactory) CopyAST(a *ast.AST) (ast.Expr, *ast.SourceInfo) { - idGen := newIDGenerator(opt.nextID()) - defer func() { opt.seed = idGen.nextID() }() - copyExpr := opt.fac.CopyExpr(a.Expr()) - copyInfo := ast.CopySourceInfo(a.SourceInfo()) - normalizeIDs(idGen.renumberStable, copyExpr, copyInfo) - return copyExpr, copyInfo -} - -// CopyASTAndMetadata copies the input AST and propagates the macro metadata into the AST being -// optimized. -func (opt *optimizerExprFactory) CopyASTAndMetadata(a *ast.AST) ast.Expr { - copyExpr, copyInfo := opt.CopyAST(a) - for macroID, call := range copyInfo.MacroCalls() { - opt.SetMacroCall(macroID, call) - } - return copyExpr -} - -// ClearMacroCall clears the macro at the given expression id. -func (opt *optimizerExprFactory) ClearMacroCall(id int64) { - opt.sourceInfo.ClearMacroCall(id) -} - -// SetMacroCall sets the macro call metadata for the given macro id within the tracked source info -// metadata. -func (opt *optimizerExprFactory) SetMacroCall(id int64, expr ast.Expr) { - opt.sourceInfo.SetMacroCall(id, expr) -} - -// MacroCalls returns the map of macro calls currently in the context. -func (opt *optimizerExprFactory) MacroCalls() map[int64]ast.Expr { - return opt.sourceInfo.MacroCalls() -} - -// NewBindMacro creates an AST expression representing the expanded bind() macro, and a macro expression -// representing the unexpanded call signature to be inserted into the source info macro call metadata. -func (opt *optimizerExprFactory) NewBindMacro(macroID int64, varName string, varInit, remaining ast.Expr) (astExpr, macroExpr ast.Expr) { - varID := opt.nextID() - remainingID := opt.nextID() - remaining = opt.fac.CopyExpr(remaining) - remaining.RenumberIDs(func(id int64) int64 { - if id == macroID { - return remainingID - } - return id - }) - if call, exists := opt.sourceInfo.GetMacroCall(macroID); exists { - opt.SetMacroCall(remainingID, opt.fac.CopyExpr(call)) - } - - astExpr = opt.fac.NewComprehension(macroID, - opt.fac.NewList(opt.nextID(), []ast.Expr{}, []int32{}), - "#unused", - varName, - opt.fac.CopyExpr(varInit), - opt.fac.NewLiteral(opt.nextID(), types.False), - opt.fac.NewIdent(varID, varName), - remaining) - - macroExpr = opt.fac.NewMemberCall(0, "bind", - opt.fac.NewIdent(opt.nextID(), "cel"), - opt.fac.NewIdent(varID, varName), - opt.fac.CopyExpr(varInit), - opt.fac.CopyExpr(remaining)) - opt.sanitizeMacro(macroID, macroExpr) - return -} - -// NewCall creates a global function call invocation expression. -// -// Example: -// -// countByField(list, fieldName) -// - function: countByField -// - args: [list, fieldName] -func (opt *optimizerExprFactory) NewCall(function string, args ...ast.Expr) ast.Expr { - return opt.fac.NewCall(opt.nextID(), function, args...) -} - -// NewMemberCall creates a member function call invocation expression where 'target' is the receiver of the call. -// -// Example: -// -// list.countByField(fieldName) -// - function: countByField -// - target: list -// - args: [fieldName] -func (opt *optimizerExprFactory) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr { - return opt.fac.NewMemberCall(opt.nextID(), function, target, args...) -} - -// NewIdent creates a new identifier expression. -// -// Examples: -// -// - simple_var_name -// - qualified.subpackage.var_name -func (opt *optimizerExprFactory) NewIdent(name string) ast.Expr { - return opt.fac.NewIdent(opt.nextID(), name) -} - -// NewLiteral creates a new literal expression value. -// -// The range of valid values for a literal generated during optimization is different than for expressions -// generated via parsing / type-checking, as the ref.Val may be _any_ CEL value so long as the value can -// be converted back to a literal-like form. -func (opt *optimizerExprFactory) NewLiteral(value ref.Val) ast.Expr { - return opt.fac.NewLiteral(opt.nextID(), value) -} - -// NewList creates a list expression with a set of optional indices. -// -// Examples: -// -// [a, b] -// - elems: [a, b] -// - optIndices: [] -// -// [a, ?b, ?c] -// - elems: [a, b, c] -// - optIndices: [1, 2] -func (opt *optimizerExprFactory) NewList(elems []ast.Expr, optIndices []int32) ast.Expr { - return opt.fac.NewList(opt.nextID(), elems, optIndices) -} - -// NewMap creates a map from a set of entry expressions which contain a key and value expression. -func (opt *optimizerExprFactory) NewMap(entries []ast.EntryExpr) ast.Expr { - return opt.fac.NewMap(opt.nextID(), entries) -} - -// NewMapEntry creates a map entry with a key and value expression and a flag to indicate whether the -// entry is optional. -// -// Examples: -// -// {a: b} -// - key: a -// - value: b -// - optional: false -// -// {?a: ?b} -// - key: a -// - value: b -// - optional: true -func (opt *optimizerExprFactory) NewMapEntry(key, value ast.Expr, isOptional bool) ast.EntryExpr { - return opt.fac.NewMapEntry(opt.nextID(), key, value, isOptional) -} - -// NewHasMacro generates a test-only select expression to be included within an AST and an unexpanded -// has() macro call signature to be inserted into the source info macro call metadata. -func (opt *optimizerExprFactory) NewHasMacro(macroID int64, s ast.Expr) (astExpr, macroExpr ast.Expr) { - sel := s.AsSelect() - astExpr = opt.fac.NewPresenceTest(macroID, sel.Operand(), sel.FieldName()) - macroExpr = opt.fac.NewCall(0, "has", - opt.NewSelect(opt.fac.CopyExpr(sel.Operand()), sel.FieldName())) - opt.sanitizeMacro(macroID, macroExpr) - return -} - -// NewSelect creates a select expression where a field value is selected from an operand. -// -// Example: -// -// msg.field_name -// - operand: msg -// - field: field_name -func (opt *optimizerExprFactory) NewSelect(operand ast.Expr, field string) ast.Expr { - return opt.fac.NewSelect(opt.nextID(), operand, field) -} - -// NewStruct creates a new typed struct value with an set of field initializations. -// -// Example: -// -// pkg.TypeName{field: value} -// - typeName: pkg.TypeName -// - fields: [{field: value}] -func (opt *optimizerExprFactory) NewStruct(typeName string, fields []ast.EntryExpr) ast.Expr { - return opt.fac.NewStruct(opt.nextID(), typeName, fields) -} - -// NewStructField creates a struct field initialization. -// -// Examples: -// -// {count: 3u} -// - field: count -// - value: 3u -// - optional: false -// -// {?count: x} -// - field: count -// - value: x -// - optional: true -func (opt *optimizerExprFactory) NewStructField(field string, value ast.Expr, isOptional bool) ast.EntryExpr { - return opt.fac.NewStructField(opt.nextID(), field, value, isOptional) -} - -// UpdateExpr updates the target expression with the updated content while preserving macro metadata. -// -// There are four scenarios during the update to consider: -// 1. target is not macro, updated is not macro -// 2. target is macro, updated is not macro -// 3. target is macro, updated is macro -// 4. target is not macro, updated is macro -// -// When the target is a macro already, it may either be updated to a new macro function -// body if the update is also a macro, or it may be removed altogether if the update is -// a macro. -// -// When the update is a macro, then the target references within other macros must be -// updated to point to the new updated macro. Otherwise, other macros which pointed to -// the target body must be replaced with copies of the updated expression body. -func (opt *optimizerExprFactory) UpdateExpr(target, updated ast.Expr) { - // Update the expression - target.SetKindCase(updated) - - // Early return if there's no macros present sa the source info reflects the - // macro set from the target and updated expressions. - if len(opt.sourceInfo.MacroCalls()) == 0 { - return - } - // Determine whether the target expression was a macro. - _, targetIsMacro := opt.sourceInfo.GetMacroCall(target.ID()) - - // Determine whether the updated expression was a macro. - updatedMacro, updatedIsMacro := opt.sourceInfo.GetMacroCall(updated.ID()) - - if updatedIsMacro { - // If the updated call was a macro, then updated id maps to target id, - // and the updated macro moves into the target id slot. - opt.sourceInfo.ClearMacroCall(updated.ID()) - opt.sourceInfo.SetMacroCall(target.ID(), updatedMacro) - } else if targetIsMacro { - // Otherwise if the target expr was a macro, but is no longer, clear - // the macro reference. - opt.sourceInfo.ClearMacroCall(target.ID()) - } - - // Punch holes in the updated value where macros references exist. - macroExpr := opt.fac.CopyExpr(target) - macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) { - if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists { - e.SetKindCase(nil) - } - }) - ast.PostOrderVisit(macroExpr, macroRefVisitor) - - // Update any references to the expression within a macro - macroVisitor := ast.NewExprVisitor(func(call ast.Expr) { - // Update the target expression to point to the macro expression which - // will be empty if the updated expression was a macro. - if call.ID() == target.ID() { - call.SetKindCase(opt.fac.CopyExpr(macroExpr)) - } - // Update the macro call expression if it refers to the updated expression - // id which has since been remapped to the target id. - if call.ID() == updated.ID() { - // Either ensure the expression is a macro reference or a populated with - // the relevant sub-expression if the updated expr was not a macro. - if updatedIsMacro { - call.SetKindCase(nil) - } else { - call.SetKindCase(opt.fac.CopyExpr(macroExpr)) - } - // Since SetKindCase does not renumber the id, ensure the references to - // the old 'updated' id are mapped to the target id. - call.RenumberIDs(func(id int64) int64 { - if id == updated.ID() { - return target.ID() - } - return id - }) - } - }) - for _, call := range opt.sourceInfo.MacroCalls() { - ast.PostOrderVisit(call, macroVisitor) - } -} - -func (opt *optimizerExprFactory) sanitizeMacro(macroID int64, macroExpr ast.Expr) { - macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) { - if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists && e.ID() != macroID { - e.SetKindCase(nil) - } - }) - ast.PostOrderVisit(macroExpr, macroRefVisitor) -} diff --git a/vendor/github.com/google/cel-go/cel/options.go b/vendor/github.com/google/cel-go/cel/options.go deleted file mode 100644 index fee67323c..000000000 --- a/vendor/github.com/google/cel-go/cel/options.go +++ /dev/null @@ -1,886 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "errors" - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/dynamicpb" - - "github.com/google/cel-go/checker" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/env" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/pb" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/interpreter" - "github.com/google/cel-go/parser" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - descpb "google.golang.org/protobuf/types/descriptorpb" -) - -// These constants beginning with "Feature" enable optional behavior in -// the library. See the documentation for each constant to see its -// effects, compatibility restrictions, and standard conformance. -const ( - _ = iota - - // Enable the tracking of function call expressions replaced by macros. - featureEnableMacroCallTracking - - // Enable the use of cross-type numeric comparisons at the type-checker. - featureCrossTypeNumericComparisons - - // Enable eager validation of declarations to ensure that Env values created - // with `Extend` inherit a validated list of declarations from the parent Env. - featureEagerlyValidateDeclarations - - // Enable the use of the default UTC timezone when a timezone is not specified - // on a CEL timestamp operation. This fixes the scenario where the input time - // is not already in UTC. - featureDefaultUTCTimeZone - - // Enable the serialization of logical operator ASTs as variadic calls, thus - // compressing the logic graph to a single call when multiple like-operator - // expressions occur: e.g. a && b && c && d -> call(_&&_, [a, b, c, d]) - featureVariadicLogicalASTs - - // Enable error generation when a presence test or optional field selection is - // performed on a primitive type. - featureEnableErrorOnBadPresenceTest - - // Enable escape syntax for field identifiers (`). - featureIdentEscapeSyntax -) - -var featureIDsToNames = map[int]string{ - featureEnableMacroCallTracking: "cel.feature.macro_call_tracking", - featureCrossTypeNumericComparisons: "cel.feature.cross_type_numeric_comparisons", - featureIdentEscapeSyntax: "cel.feature.backtick_escape_syntax", -} - -func featureNameByID(id int) (string, bool) { - name, found := featureIDsToNames[id] - return name, found -} - -func featureIDByName(name string) (int, bool) { - for id, n := range featureIDsToNames { - if n == name { - return id, true - } - } - return 0, false -} - -// EnvOption is a functional interface for configuring the environment. -type EnvOption func(e *Env) (*Env, error) - -// ClearMacros options clears all parser macros. -// -// Clearing macros will ensure CEL expressions can only contain linear evaluation paths, as -// comprehensions such as `all` and `exists` are enabled only via macros. -func ClearMacros() EnvOption { - return func(e *Env) (*Env, error) { - e.macros = NoMacros - return e, nil - } -} - -// CustomTypeAdapter swaps the default types.Adapter implementation with a custom one. -// -// Note: This option must be specified before the Types and TypeDescs options when used together. -func CustomTypeAdapter(adapter types.Adapter) EnvOption { - return func(e *Env) (*Env, error) { - e.adapter = adapter - return e, nil - } -} - -// CustomTypeProvider replaces the types.Provider implementation with a custom one. -// -// The `provider` variable type may either be types.Provider or ref.TypeProvider (deprecated) -// -// Note: This option must be specified before the Types and TypeDescs options when used together. -func CustomTypeProvider(provider any) EnvOption { - return func(e *Env) (*Env, error) { - var err error - e.provider, err = maybeInteropProvider(provider) - return e, err - } -} - -// Declarations option extends the declaration set configured in the environment. -// -// Note: Declarations will by default be appended to the pre-existing declaration set configured -// for the environment. The NewEnv call builds on top of the standard CEL declarations. For a -// purely custom set of declarations use NewCustomEnv. -// -// Deprecated: use FunctionDecls and VariableDecls or FromConfig instead. -func Declarations(decls ...*exprpb.Decl) EnvOption { - declOpts := []EnvOption{} - var err error - var opt EnvOption - // Convert the declarations to `EnvOption` values ahead of time. - // Surface any errors in conversion when the options are applied. - for _, d := range decls { - opt, err = ExprDeclToDeclaration(d) - if err != nil { - break - } - declOpts = append(declOpts, opt) - } - return func(e *Env) (*Env, error) { - if err != nil { - return nil, err - } - for _, o := range declOpts { - e, err = o(e) - if err != nil { - return nil, err - } - } - return e, nil - } -} - -// EagerlyValidateDeclarations ensures that any collisions between configured declarations are caught -// at the time of the `NewEnv` call. -// -// Eagerly validating declarations is also useful for bootstrapping a base `cel.Env` value. -// Calls to base `Env.Extend()` will be significantly faster when declarations are eagerly validated -// as declarations will be collision-checked at most once and only incrementally by way of `Extend` -// -// Disabled by default as not all environments are used for type-checking. -func EagerlyValidateDeclarations(enabled bool) EnvOption { - return features(featureEagerlyValidateDeclarations, enabled) -} - -// HomogeneousAggregateLiterals disables mixed type list and map literal values. -// -// Note, it is still possible to have heterogeneous aggregates when provided as variables to the -// expression, as well as via conversion of well-known dynamic types, or with unchecked -// expressions. -func HomogeneousAggregateLiterals() EnvOption { - return ASTValidators(ValidateHomogeneousAggregateLiterals()) -} - -// variadicLogicalOperatorASTs flatten like-operator chained logical expressions into a single -// variadic call with N-terms. This behavior is useful when serializing to a protocol buffer as -// it will reduce the number of recursive calls needed to deserialize the AST later. -// -// For example, given the following expression the call graph will be rendered accordingly: -// -// expression: a && b && c && (d || e) -// ast: call(_&&_, [a, b, c, call(_||_, [d, e])]) -func variadicLogicalOperatorASTs() EnvOption { - return features(featureVariadicLogicalASTs, true) -} - -// Macros option extends the macro set configured in the environment. -// -// Note: This option must be specified after ClearMacros if used together. -func Macros(macros ...Macro) EnvOption { - return func(e *Env) (*Env, error) { - e.macros = append(e.macros, macros...) - return e, nil - } -} - -// Container sets the container for resolving variable names. Defaults to an empty container. -// -// If all references within an expression are relative to a protocol buffer package, then -// specifying a container of `google.type` would make it possible to write expressions such as -// `Expr{expression: 'a < b'}` instead of having to write `google.type.Expr{...}`. -func Container(name string) EnvOption { - return func(e *Env) (*Env, error) { - cont, err := e.Container.Extend(containers.Name(name)) - if err != nil { - return nil, err - } - e.Container = cont - return e, nil - } -} - -// Abbrevs configures a set of simple names as abbreviations for fully-qualified names. -// -// An abbreviation (abbrev for short) is a simple name that expands to a fully-qualified name. -// Abbreviations can be useful when working with variables, functions, and especially types from -// multiple namespaces: -// -// // CEL object construction -// qual.pkg.version.ObjTypeName{ -// field: alt.container.ver.FieldTypeName{value: ...} -// } -// -// Only one the qualified names above may be used as the CEL container, so at least one of these -// references must be a long qualified name within an otherwise short CEL program. Using the -// following abbreviations, the program becomes much simpler: -// -// // CEL Go option -// Abbrevs("qual.pkg.version.ObjTypeName", "alt.container.ver.FieldTypeName") -// // Simplified Object construction -// ObjTypeName{field: FieldTypeName{value: ...}} -// -// There are a few rules for the qualified names and the simple abbreviations generated from them: -// - Qualified names must be dot-delimited, e.g. `package.subpkg.name`. -// - The last element in the qualified name is the abbreviation. -// - Abbreviations must not collide with each other. -// - The abbreviation must not collide with unqualified names in use. -// -// Abbreviations are distinct from container-based references in the following important ways: -// - Abbreviations must expand to a fully-qualified name. -// - Expanded abbreviations do not participate in namespace resolution. -// - Abbreviation expansion is done instead of the container search for a matching identifier. -// - Containers follow C++ namespace resolution rules with searches from the most qualified name -// -// to the least qualified name. -// -// - Container references within the CEL program may be relative, and are resolved to fully -// -// qualified names at either type-check time or program plan time, whichever comes first. -// -// If there is ever a case where an identifier could be in both the container and as an -// abbreviation, the abbreviation wins as this will ensure that the meaning of a program is -// preserved between compilations even as the container evolves. -func Abbrevs(qualifiedNames ...string) EnvOption { - return func(e *Env) (*Env, error) { - cont, err := e.Container.Extend(containers.Abbrevs(qualifiedNames...)) - if err != nil { - return nil, err - } - e.Container = cont - return e, nil - } -} - -// customTypeRegistry is an internal-only interface containing the minimum methods required to support -// custom types. It is a subset of methods from ref.TypeRegistry. -type customTypeRegistry interface { - RegisterDescriptor(protoreflect.FileDescriptor) error - RegisterType(...ref.Type) error -} - -// Types adds one or more type declarations to the environment, allowing for construction of -// type-literals whose definitions are included in the common expression built-in set. -// -// The input types may either be instances of `proto.Message` or `ref.Type`. Any other type -// provided to this option will result in an error. -// -// Well-known protobuf types within the `google.protobuf.*` package are included in the standard -// environment by default. -// -// Note: This option must be specified after the CustomTypeProvider option when used together. -func Types(addTypes ...any) EnvOption { - return func(e *Env) (*Env, error) { - reg, isReg := e.provider.(customTypeRegistry) - if !isReg { - return nil, fmt.Errorf("custom types not supported by provider: %T", e.provider) - } - for _, t := range addTypes { - switch v := t.(type) { - case proto.Message: - fdMap := pb.CollectFileDescriptorSet(v) - for _, fd := range fdMap { - err := reg.RegisterDescriptor(fd) - if err != nil { - return nil, err - } - } - case ref.Type: - err := reg.RegisterType(v) - if err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("unsupported type: %T", t) - } - } - return e, nil - } -} - -// TypeDescs adds type declarations from any protoreflect.FileDescriptor, protoregistry.Files, -// google.protobuf.FileDescriptorProto or google.protobuf.FileDescriptorSet provided. -// -// Note that messages instantiated from these descriptors will be *dynamicpb.Message values -// rather than the concrete message type. -// -// TypeDescs are hermetic to a single Env object, but may be copied to other Env values via -// extension or by re-using the same EnvOption with another NewEnv() call. -func TypeDescs(descs ...any) EnvOption { - return func(e *Env) (*Env, error) { - reg, isReg := e.provider.(customTypeRegistry) - if !isReg { - return nil, fmt.Errorf("custom types not supported by provider: %T", e.provider) - } - // Scan the input descriptors for FileDescriptorProto messages and accumulate them into a - // synthetic FileDescriptorSet as the FileDescriptorProto messages may refer to each other - // and will not resolve properly unless they are part of the same set. - var fds *descpb.FileDescriptorSet - for _, d := range descs { - switch f := d.(type) { - case *descpb.FileDescriptorProto: - if fds == nil { - fds = &descpb.FileDescriptorSet{ - File: []*descpb.FileDescriptorProto{}, - } - } - fds.File = append(fds.File, f) - } - } - if fds != nil { - if err := registerFileSet(reg, fds); err != nil { - return nil, err - } - } - for _, d := range descs { - switch f := d.(type) { - case *protoregistry.Files: - if err := registerFiles(reg, f); err != nil { - return nil, err - } - case protoreflect.FileDescriptor: - if err := reg.RegisterDescriptor(f); err != nil { - return nil, err - } - case *descpb.FileDescriptorSet: - if err := registerFileSet(reg, f); err != nil { - return nil, err - } - case *descpb.FileDescriptorProto: - // skip, handled as a synthetic file descriptor set. - default: - return nil, fmt.Errorf("unsupported type descriptor: %T", d) - } - } - return e, nil - } -} - -func registerFileSet(reg customTypeRegistry, fileSet *descpb.FileDescriptorSet) error { - files, err := protodesc.NewFiles(fileSet) - if err != nil { - return fmt.Errorf("protodesc.NewFiles(%v) failed: %v", fileSet, err) - } - return registerFiles(reg, files) -} - -func registerFiles(reg customTypeRegistry, files *protoregistry.Files) error { - var err error - files.RangeFiles(func(fd protoreflect.FileDescriptor) bool { - err = reg.RegisterDescriptor(fd) - return err == nil - }) - return err -} - -// ProgramOption is a functional interface for configuring evaluation bindings and behaviors. -type ProgramOption func(p *prog) (*prog, error) - -// CustomDecorator appends an InterpreterDecorator to the program. -// -// InterpretableDecorators can be used to inspect, alter, or replace the Program plan. -func CustomDecorator(dec interpreter.InterpretableDecorator) ProgramOption { - return func(p *prog) (*prog, error) { - p.plannerOptions = append(p.plannerOptions, interpreter.CustomDecorator(dec)) - return p, nil - } -} - -// Functions adds function overloads that extend or override the set of CEL built-ins. -// -// Deprecated: use Function() instead to declare the function, its overload signatures, -// and the overload implementations. -func Functions(funcs ...*functions.Overload) ProgramOption { - return func(p *prog) (*prog, error) { - if err := p.dispatcher.Add(funcs...); err != nil { - return nil, err - } - return p, nil - } -} - -// Globals sets the global variable values for a given program. These values may be shadowed by -// variables with the same name provided to the Eval() call. If Globals is used in a Library with -// a Lib EnvOption, vars may shadow variables provided by previously added libraries. -// -// The vars value may either be an `cel.Activation` instance or a `map[string]any`. -func Globals(vars any) ProgramOption { - return func(p *prog) (*prog, error) { - defaultVars, err := NewActivation(vars) - if err != nil { - return nil, err - } - if p.defaultVars != nil { - defaultVars = interpreter.NewHierarchicalActivation(p.defaultVars, defaultVars) - } - p.defaultVars = defaultVars - return p, nil - } -} - -// OptimizeRegex provides a way to replace the InterpretableCall for regex functions. This can be used -// to compile regex string constants at program creation time and report any errors and then use the -// compiled regex for all regex function invocations. -func OptimizeRegex(regexOptimizations ...*interpreter.RegexOptimization) ProgramOption { - return func(p *prog) (*prog, error) { - p.regexOptimizations = append(p.regexOptimizations, regexOptimizations...) - return p, nil - } -} - -// ConfigOptionFactory declares a signature which accepts a configuration element, e.g. env.Extension -// and optionally produces an EnvOption in response. -// -// If there are multiple ConfigOptionFactory values which could apply to the same configuration node -// the first one that returns an EnvOption and a `true` response will be used, and the config node -// will not be passed along to any other option factory. -// -// Only the *env.Extension type is provided at this time, but validators, optimizers, and other tuning -// parameters may be supported in the future. -type ConfigOptionFactory func(any) (EnvOption, bool) - -// FromConfig produces and applies a set of EnvOption values derived from an env.Config object. -// -// For configuration elements which refer to features outside of the `cel` package, an optional set of -// ConfigOptionFactory values may be passed in to support the conversion from static configuration to -// configured cel.Env value. -// -// Note: disabling the standard library will clear the EnvOptions values previously set for the -// environment with the exception of propagating types and adapters over to the new environment. -// -// Note: to support custom types referenced in the configuration file, you must ensure that one of -// the following options appears before the FromConfig option: Types, TypeDescs, or CustomTypeProvider -// as the type provider configured at the time when the config is processed is the one used to derive -// type references from the configuration. -func FromConfig(config *env.Config, optFactories ...ConfigOptionFactory) EnvOption { - return func(e *Env) (*Env, error) { - if err := config.Validate(); err != nil { - return nil, err - } - opts, err := configToEnvOptions(config, e.CELTypeProvider(), optFactories) - if err != nil { - return nil, err - } - for _, o := range opts { - e, err = o(e) - if err != nil { - return nil, err - } - } - return e, nil - } -} - -// configToEnvOptions generates a set of EnvOption values (or error) based on a config, a type provider, -// and an optional set of environment options. -func configToEnvOptions(config *env.Config, provider types.Provider, optFactories []ConfigOptionFactory) ([]EnvOption, error) { - envOpts := []EnvOption{} - // Configure the standard lib subset. - if config.StdLib != nil { - envOpts = append(envOpts, func(e *Env) (*Env, error) { - if e.HasLibrary("cel.lib.std") { - return nil, errors.New("invalid subset of stdlib: create a custom env") - } - return e, nil - }) - if !config.StdLib.Disabled { - envOpts = append(envOpts, StdLib(StdLibSubset(config.StdLib))) - } - } else { - envOpts = append(envOpts, StdLib()) - } - - // Configure the container - if config.Container != "" { - envOpts = append(envOpts, Container(config.Container)) - } - - // Configure abbreviations - for _, imp := range config.Imports { - envOpts = append(envOpts, Abbrevs(imp.Name)) - } - - // Configure the context variable declaration - if config.ContextVariable != nil { - typeName := config.ContextVariable.TypeName - if _, found := provider.FindStructType(typeName); !found { - return nil, fmt.Errorf("invalid context proto type: %q", typeName) - } - // Attempt to instantiate the proto in order to reflect to its descriptor - msg := provider.NewValue(typeName, map[string]ref.Val{}) - pbMsg, ok := msg.Value().(proto.Message) - if !ok { - return nil, fmt.Errorf("unsupported context type: %T", msg.Value()) - } - envOpts = append(envOpts, DeclareContextProto(pbMsg.ProtoReflect().Descriptor())) - } - - // Configure variables - if len(config.Variables) != 0 { - vars := make([]*decls.VariableDecl, 0, len(config.Variables)) - for _, v := range config.Variables { - vDef, err := v.AsCELVariable(provider) - if err != nil { - return nil, err - } - vars = append(vars, vDef) - } - envOpts = append(envOpts, VariableDecls(vars...)) - } - - // Configure functions - if len(config.Functions) != 0 { - funcs := make([]*decls.FunctionDecl, 0, len(config.Functions)) - for _, f := range config.Functions { - fnDef, err := f.AsCELFunction(provider) - if err != nil { - return nil, err - } - funcs = append(funcs, fnDef) - } - envOpts = append(envOpts, FunctionDecls(funcs...)) - } - - // Configure features - for _, feat := range config.Features { - // Note, if a feature is not found, it is skipped as it is possible the feature - // is not intended to be supported publicly. In the future, a refinement of - // to this strategy to report unrecognized features and validators should probably - // be covered as a standard ConfigOptionFactory - if id, found := featureIDByName(feat.Name); found { - envOpts = append(envOpts, features(id, feat.Enabled)) - } - } - - // Configure validators - for _, val := range config.Validators { - if fac, found := astValidatorFactories[val.Name]; found { - envOpts = append(envOpts, func(e *Env) (*Env, error) { - validator, err := fac(val) - if err != nil { - return nil, fmt.Errorf("%w", err) - } - return ASTValidators(validator)(e) - }) - } else if opt, handled := handleExtendedConfigOption(val, optFactories); handled { - envOpts = append(envOpts, opt) - } - // we don't error when the validator isn't found as it may be part - // of an extension library and enabled implicitly. - } - - // Configure extensions - for _, ext := range config.Extensions { - // version number has been validated by the call to `Validate` - ver, _ := ext.VersionNumber() - if ext.Name == "optional" { - envOpts = append(envOpts, OptionalTypes(OptionalTypesVersion(ver))) - } else { - opt, handled := handleExtendedConfigOption(ext, optFactories) - if !handled { - return nil, fmt.Errorf("unrecognized extension: %s", ext.Name) - } - envOpts = append(envOpts, opt) - } - } - - return envOpts, nil -} - -func handleExtendedConfigOption(conf any, optFactories []ConfigOptionFactory) (EnvOption, bool) { - for _, optFac := range optFactories { - if opt, useOption := optFac(conf); useOption { - return opt, true - } - } - return nil, false -} - -// EvalOption indicates an evaluation option that may affect the evaluation behavior or information -// in the output result. -type EvalOption int - -const ( - // OptTrackState will cause the runtime to return an immutable EvalState value in the Result. - OptTrackState EvalOption = 1 << iota - - // OptExhaustiveEval causes the runtime to disable short-circuits and track state. - OptExhaustiveEval EvalOption = 1< 0 { - plannerOptions = append(plannerOptions, interpreter.InterruptableEval()) - } - // Enable constant folding first. - if p.evalOpts&OptOptimize == OptOptimize { - plannerOptions = append(plannerOptions, interpreter.Optimize()) - p.regexOptimizations = append(p.regexOptimizations, interpreter.MatchesRegexOptimization) - } - // Enable regex compilation of constants immediately after folding constants. - if len(p.regexOptimizations) > 0 { - plannerOptions = append(plannerOptions, interpreter.CompileRegexConstants(p.regexOptimizations...)) - } - - // Enable exhaustive eval, state tracking and cost tracking last since they require a factory. - if p.evalOpts&(OptExhaustiveEval|OptTrackState|OptTrackCost) != 0 { - costOptCount := len(p.costOptions) - if p.costLimit != nil { - costOptCount++ - } - costOpts := make([]interpreter.CostTrackerOption, 0, costOptCount) - costOpts = append(costOpts, p.costOptions...) - if p.costLimit != nil { - costOpts = append(costOpts, interpreter.CostTrackerLimit(*p.costLimit)) - } - trackerFactory := func() (*interpreter.CostTracker, error) { - return interpreter.NewCostTracker(p.callCostEstimator, costOpts...) - } - var observers []interpreter.PlannerOption - if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 { - // EvalStateObserver is required for OptExhaustiveEval. - observers = append(observers, interpreter.EvalStateObserver()) - } - if p.evalOpts&OptTrackCost == OptTrackCost { - observers = append(observers, interpreter.CostObserver(interpreter.CostTrackerFactory(trackerFactory))) - } - // Enable exhaustive eval over a basic observer since it offers a superset of features. - if p.evalOpts&OptExhaustiveEval == OptExhaustiveEval { - plannerOptions = append(plannerOptions, - append([]interpreter.PlannerOption{interpreter.ExhaustiveEval()}, observers...)...) - } else if len(observers) > 0 { - plannerOptions = append(plannerOptions, observers...) - } - } - return p.initInterpretable(a, plannerOptions) -} - -func (p *prog) initInterpretable(a *ast.AST, plannerOptions []interpreter.PlannerOption) (*prog, error) { - // When the AST has been exprAST it contains metadata that can be used to speed up program execution. - interpretable, err := p.interpreter.NewInterpretable(a, plannerOptions...) - if err != nil { - return nil, err - } - p.interpretable = interpretable - if oi, ok := interpretable.(*interpreter.ObservableInterpretable); ok { - p.observable = oi - } - return p, nil -} - -// Eval implements the Program interface method. -func (p *prog) Eval(input any) (out ref.Val, det *EvalDetails, err error) { - // Configure error recovery for unexpected panics during evaluation. Note, the use of named - // return values makes it possible to modify the error response during the recovery - // function. - defer func() { - if r := recover(); r != nil { - switch t := r.(type) { - case interpreter.EvalCancelledError: - err = t - default: - err = fmt.Errorf("internal error: %v", r) - } - } - }() - // Build a hierarchical activation if there are default vars set. - var vars Activation - switch v := input.(type) { - case Activation: - vars = v - case map[string]any: - vars = activationPool.Setup(v) - defer activationPool.Put(vars) - default: - return nil, nil, fmt.Errorf("invalid input, wanted Activation or map[string]any, got: (%T)%v", input, input) - } - if p.defaultVars != nil { - vars = interpreter.NewHierarchicalActivation(p.defaultVars, vars) - } - if p.observable != nil { - det = &EvalDetails{} - out = p.observable.ObserveEval(vars, func(observed any) { - switch o := observed.(type) { - case interpreter.EvalState: - det.state = o - case *interpreter.CostTracker: - det.costTracker = o - } - }) - } else { - out = p.interpretable.Eval(vars) - } - // The output of an internal Eval may have a value (`v`) that is a types.Err. This step - // translates the CEL value to a Go error response. This interface does not quite match the - // RPC signature which allows for multiple errors to be returned, but should be sufficient. - if types.IsError(out) { - err = out.(*types.Err) - } - return -} - -// ContextEval implements the Program interface. -func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetails, error) { - if ctx == nil { - return nil, nil, fmt.Errorf("context can not be nil") - } - // Configure the input, making sure to wrap Activation inputs in the special ctxActivation which - // exposes the #interrupted variable and manages rate-limited checks of the ctx.Done() state. - var vars Activation - switch v := input.(type) { - case Activation: - vars = ctxActivationPool.Setup(v, ctx.Done(), p.interruptCheckFrequency) - defer ctxActivationPool.Put(vars) - case map[string]any: - rawVars := activationPool.Setup(v) - defer activationPool.Put(rawVars) - vars = ctxActivationPool.Setup(rawVars, ctx.Done(), p.interruptCheckFrequency) - defer ctxActivationPool.Put(vars) - default: - return nil, nil, fmt.Errorf("invalid input, wanted Activation or map[string]any, got: (%T)%v", input, input) - } - return p.Eval(vars) -} - -type ctxEvalActivation struct { - parent Activation - interrupt <-chan struct{} - interruptCheckCount uint - interruptCheckFrequency uint -} - -// ResolveName implements the Activation interface method, but adds a special #interrupted variable -// which is capable of testing whether a 'done' signal is provided from a context.Context channel. -func (a *ctxEvalActivation) ResolveName(name string) (any, bool) { - if name == "#interrupted" { - a.interruptCheckCount++ - if a.interruptCheckCount%a.interruptCheckFrequency == 0 { - select { - case <-a.interrupt: - return true, true - default: - return nil, false - } - } - return nil, false - } - return a.parent.ResolveName(name) -} - -func (a *ctxEvalActivation) Parent() Activation { - return a.parent -} - -func (a *ctxEvalActivation) AsPartialActivation() (interpreter.PartialActivation, bool) { - pa, ok := a.parent.(interpreter.PartialActivation) - return pa, ok -} - -func newCtxEvalActivationPool() *ctxEvalActivationPool { - return &ctxEvalActivationPool{ - Pool: sync.Pool{ - New: func() any { - return &ctxEvalActivation{} - }, - }, - } -} - -type ctxEvalActivationPool struct { - sync.Pool -} - -// Setup initializes a pooled Activation with the ability check for context.Context cancellation -func (p *ctxEvalActivationPool) Setup(vars Activation, done <-chan struct{}, interruptCheckRate uint) *ctxEvalActivation { - a := p.Pool.Get().(*ctxEvalActivation) - a.parent = vars - a.interrupt = done - a.interruptCheckCount = 0 - a.interruptCheckFrequency = interruptCheckRate - return a -} - -type evalActivation struct { - vars map[string]any - lazyVars map[string]any -} - -// ResolveName looks up the value of the input variable name, if found. -// -// Lazy bindings may be supplied within the map-based input in either of the following forms: -// - func() any -// - func() ref.Val -// -// The lazy binding will only be invoked once per evaluation. -// -// Values which are not represented as ref.Val types on input may be adapted to a ref.Val using -// the types.Adapter configured in the environment. -func (a *evalActivation) ResolveName(name string) (any, bool) { - v, found := a.vars[name] - if !found { - return nil, false - } - switch obj := v.(type) { - case func() ref.Val: - if resolved, found := a.lazyVars[name]; found { - return resolved, true - } - lazy := obj() - a.lazyVars[name] = lazy - return lazy, true - case func() any: - if resolved, found := a.lazyVars[name]; found { - return resolved, true - } - lazy := obj() - a.lazyVars[name] = lazy - return lazy, true - default: - return obj, true - } -} - -// Parent implements the Activation interface -func (a *evalActivation) Parent() Activation { - return nil -} - -func newEvalActivationPool() *evalActivationPool { - return &evalActivationPool{ - Pool: sync.Pool{ - New: func() any { - return &evalActivation{lazyVars: make(map[string]any)} - }, - }, - } -} - -type evalActivationPool struct { - sync.Pool -} - -// Setup initializes a pooled Activation object with the map input. -func (p *evalActivationPool) Setup(vars map[string]any) *evalActivation { - a := p.Pool.Get().(*evalActivation) - a.vars = vars - return a -} - -func (p *evalActivationPool) Put(value any) { - a := value.(*evalActivation) - for k := range a.lazyVars { - delete(a.lazyVars, k) - } - p.Pool.Put(a) -} - -var ( - // activationPool is an internally managed pool of Activation values that wrap map[string]any inputs - activationPool = newEvalActivationPool() - - // ctxActivationPool is an internally managed pool of Activation values that expose a special #interrupted variable - ctxActivationPool = newCtxEvalActivationPool() -) diff --git a/vendor/github.com/google/cel-go/cel/prompt.go b/vendor/github.com/google/cel-go/cel/prompt.go deleted file mode 100644 index 929a26f91..000000000 --- a/vendor/github.com/google/cel-go/cel/prompt.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - _ "embed" - "sort" - "strings" - "text/template" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" -) - -//go:embed templates/authoring.tmpl -var authoringPrompt string - -// AuthoringPrompt creates a prompt template from a CEL environment for the purpose of AI-assisted authoring. -func AuthoringPrompt(env *Env) (*Prompt, error) { - funcMap := template.FuncMap{ - "split": func(str string) []string { return strings.Split(str, "\n") }, - } - tmpl := template.New("cel").Funcs(funcMap) - tmpl, err := tmpl.Parse(authoringPrompt) - if err != nil { - return nil, err - } - return &Prompt{ - Persona: defaultPersona, - FormatRules: defaultFormatRules, - GeneralUsage: defaultGeneralUsage, - tmpl: tmpl, - env: env, - }, nil -} - -// Prompt represents the core components of an LLM prompt based on a CEL environment. -// -// All fields of the prompt may be overwritten / modified with support for rendering the -// prompt to a human-readable string. -type Prompt struct { - // Persona indicates something about the kind of user making the request - Persona string - - // FormatRules indicate how the LLM should generate its output - FormatRules string - - // GeneralUsage specifies additional context on how CEL should be used. - GeneralUsage string - - // tmpl is the text template base-configuration for rendering text. - tmpl *template.Template - - // env reference used to collect variables, functions, and macros available to the prompt. - env *Env -} - -type promptInst struct { - *Prompt - - Variables []*common.Doc - Macros []*common.Doc - Functions []*common.Doc - UserPrompt string -} - -// Render renders the user prompt with the associated context from the prompt template -// for use with LLM generators. -func (p *Prompt) Render(userPrompt string) string { - var buffer strings.Builder - vars := make([]*common.Doc, len(p.env.Variables())) - for i, v := range p.env.Variables() { - vars[i] = v.Documentation() - } - sort.SliceStable(vars, func(i, j int) bool { - return vars[i].Name < vars[j].Name - }) - macs := make([]*common.Doc, len(p.env.Macros())) - for i, m := range p.env.Macros() { - macs[i] = m.(common.Documentor).Documentation() - } - funcs := make([]*common.Doc, 0, len(p.env.Functions())) - for _, f := range p.env.Functions() { - if _, hidden := hiddenFunctions[f.Name()]; hidden { - continue - } - funcs = append(funcs, f.Documentation()) - } - sort.SliceStable(funcs, func(i, j int) bool { - return funcs[i].Name < funcs[j].Name - }) - inst := &promptInst{ - Prompt: p, - Variables: vars, - Macros: macs, - Functions: funcs, - UserPrompt: userPrompt} - p.tmpl.Execute(&buffer, inst) - return buffer.String() -} - -const ( - defaultPersona = `You are a software engineer with expertise in networking and application security -authoring boolean Common Expression Language (CEL) expressions to ensure firewall, -networking, authentication, and data access is only permitted when all conditions -are satisfied.` - - defaultFormatRules = `Output your response as a CEL expression. - -Write the expression with the comment on the first line and the expression on the -subsequent lines. Format the expression using 80-character line limits commonly -found in C++ or Java code.` - - defaultGeneralUsage = `CEL supports Protocol Buffer and JSON types, as well as simple types and aggregate types. - -Simple types include bool, bytes, double, int, string, and uint: - -* double literals must always include a decimal point: 1.0, 3.5, -2.2 -* uint literals must be positive values suffixed with a 'u': 42u -* byte literals are strings prefixed with a 'b': b'1235' -* string literals can use either single quotes or double quotes: 'hello', "world" -* string literals can also be treated as raw strings that do not require any - escaping within the string by using the 'R' prefix: R"""quote: "hi" """ - -Aggregate types include list and map: - -* list literals consist of zero or more values between brackets: "['a', 'b', 'c']" -* map literal consist of colon-separated key-value pairs within braces: "{'key1': 1, 'key2': 2}" -* Only int, uint, string, and bool types are valid map keys. -* Maps containing HTTP headers must always use lower-cased string keys. - -Comments start with two-forward slashes followed by text and a newline.` -) - -var ( - hiddenFunctions = map[string]bool{ - overloads.DeprecatedIn: true, - operators.OldIn: true, - operators.OldNotStrictlyFalse: true, - operators.NotStrictlyFalse: true, - } -) diff --git a/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl b/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl deleted file mode 100644 index d6b3da5c6..000000000 --- a/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl +++ /dev/null @@ -1,56 +0,0 @@ -{{define "variable"}}{{.Name}} is a {{.Type}} -{{- end -}} - -{{define "macro" -}} -{{.Name}} macro{{if .Description}} - {{range split .Description}}{{.}} {{end}} -{{end}} -{{range .Children}}{{range split .Description}} {{.}} -{{end}} -{{- end -}} -{{- end -}} - -{{define "overload" -}} -{{if .Children}}{{range .Children}}{{range split .Description}} {{.}} -{{end}} -{{- end -}} -{{else}} {{.Signature}} -{{end}} -{{- end -}} - -{{define "function" -}} -{{.Name}}{{if .Description}} - {{range split .Description}}{{.}} {{end}} -{{end}} -{{range .Children}}{{template "overload" .}}{{end}} -{{- end -}} - -{{.Persona}} - -{{.FormatRules}} - -{{if or .Variables .Macros .Functions -}} -Only use the following variables, macros, and functions in expressions. -{{if .Variables}} -Variables: - -{{range .Variables}}* {{template "variable" .}} -{{end -}} - -{{end -}} -{{if .Macros}} -Macros: - -{{range .Macros}}* {{template "macro" .}} -{{end -}} - -{{end -}} -{{if .Functions}} -Functions: - -{{range .Functions}}* {{template "function" .}} -{{end -}} - -{{end -}} -{{- end -}} -{{.GeneralUsage}} - -{{.UserPrompt}} diff --git a/vendor/github.com/google/cel-go/cel/validator.go b/vendor/github.com/google/cel-go/cel/validator.go deleted file mode 100644 index 5f06b2dd5..000000000 --- a/vendor/github.com/google/cel-go/cel/validator.go +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cel - -import ( - "fmt" - "reflect" - "regexp" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/env" - "github.com/google/cel-go/common/overloads" -) - -const ( - durationValidatorName = "cel.validator.duration" - regexValidatorName = "cel.validator.matches" - timestampValidatorName = "cel.validator.timestamp" - homogeneousValidatorName = "cel.validator.homogeneous_literals" - nestingLimitValidatorName = "cel.validator.comprehension_nesting_limit" - - // HomogeneousAggregateLiteralExemptFunctions is the ValidatorConfig key used to configure - // the set of function names which are exempt from homogeneous type checks. The expected type - // is a string list of function names. - // - // As an example, the `.format([args])` call expects the input arguments list to be - // comprised of a variety of types which correspond to the types expected by the format control - // clauses; however, all other uses of a mixed element type list, would be unexpected. - HomogeneousAggregateLiteralExemptFunctions = homogeneousValidatorName + ".exempt" -) - -var ( - astValidatorFactories = map[string]ASTValidatorFactory{ - nestingLimitValidatorName: func(val *env.Validator) (ASTValidator, error) { - if limit, found := val.ConfigValue("limit"); found { - if val, isInt := limit.(int); isInt { - return ValidateComprehensionNestingLimit(val), nil - } - return nil, fmt.Errorf("invalid validator: %s unsupported limit type: %v", nestingLimitValidatorName, limit) - } - return nil, fmt.Errorf("invalid validator: %s missing limit", nestingLimitValidatorName) - }, - durationValidatorName: func(*env.Validator) (ASTValidator, error) { - return ValidateDurationLiterals(), nil - }, - regexValidatorName: func(*env.Validator) (ASTValidator, error) { - return ValidateRegexLiterals(), nil - }, - timestampValidatorName: func(*env.Validator) (ASTValidator, error) { - return ValidateTimestampLiterals(), nil - }, - homogeneousValidatorName: func(*env.Validator) (ASTValidator, error) { - return ValidateHomogeneousAggregateLiterals(), nil - }, - } -) - -// ASTValidatorFactory creates an ASTValidator as configured by the input map -type ASTValidatorFactory func(*env.Validator) (ASTValidator, error) - -// ASTValidators configures a set of ASTValidator instances into the target environment. -// -// Validators are applied in the order in which the are specified and are treated as singletons. -// The same ASTValidator with a given name will not be applied more than once. -func ASTValidators(validators ...ASTValidator) EnvOption { - return func(e *Env) (*Env, error) { - for _, v := range validators { - if !e.HasValidator(v.Name()) { - e.validators = append(e.validators, v) - } - } - return e, nil - } -} - -// ASTValidator defines a singleton interface for validating a type-checked Ast against an environment. -// -// Note: the Issues argument is mutable in the sense that it is intended to collect errors which will be -// reported to the caller. -type ASTValidator interface { - // Name returns the name of the validator. Names must be unique. - Name() string - - // Validate validates a given Ast within an Environment and collects a set of potential issues. - // - // The ValidatorConfig is generated from the set of ASTValidatorConfigurer instances prior to - // the invocation of the Validate call. The expectation is that the validator configuration - // is created in sequence and immutable once provided to the Validate call. - // - // See individual validators for more information on their configuration keys and configuration - // properties. - Validate(*Env, ValidatorConfig, *ast.AST, *Issues) -} - -// ConfigurableASTValidator supports conversion of an object to an `env.Validator` instance used for -// YAML serialization. -type ConfigurableASTValidator interface { - // ToConfig converts the internal configuration of an ASTValidator into an env.Validator instance - // which minimally must include the validator name, but may also include a map[string]any config - // object to be serialized to YAML. The string keys represent the configuration parameter name, - // and the any value must mirror the internally supported type associated with the config key. - // - // Note: only primitive CEL types are supported by CEL validators at this time. - ToConfig() *env.Validator -} - -// ValidatorConfig provides an accessor method for querying validator configuration state. -type ValidatorConfig interface { - GetOrDefault(name string, value any) any -} - -// MutableValidatorConfig provides mutation methods for querying and updating validator configuration -// settings. -type MutableValidatorConfig interface { - ValidatorConfig - Set(name string, value any) error -} - -// ASTValidatorConfigurer indicates that this object, currently expected to be an ASTValidator, -// participates in validator configuration settings. -// -// This interface may be split from the expectation of being an ASTValidator instance in the future. -type ASTValidatorConfigurer interface { - Configure(MutableValidatorConfig) error -} - -// validatorConfig implements the ValidatorConfig and MutableValidatorConfig interfaces. -type validatorConfig struct { - data map[string]any -} - -// newValidatorConfig initializes the validator config with default values for core CEL validators. -func newValidatorConfig() *validatorConfig { - return &validatorConfig{ - data: map[string]any{ - HomogeneousAggregateLiteralExemptFunctions: []string{}, - }, - } -} - -// GetOrDefault returns the configured value for the name, if present, else the input default value. -// -// Note, the type-agreement between the input default and configured value is not checked on read. -func (config *validatorConfig) GetOrDefault(name string, value any) any { - v, found := config.data[name] - if !found { - return value - } - return v -} - -// Set configures a validator option with the given name and value. -// -// If the value had previously been set, the new value must have the same reflection type as the old one, -// or the call will error. -func (config *validatorConfig) Set(name string, value any) error { - v, found := config.data[name] - if found && reflect.TypeOf(v) != reflect.TypeOf(value) { - return fmt.Errorf("incompatible configuration type for %s, got %T, wanted %T", name, value, v) - } - config.data[name] = value - return nil -} - -// ExtendedValidations collects a set of common AST validations which reduce the likelihood of runtime errors. -// -// - Validate duration and timestamp literals -// - Ensure regex strings are valid -// - Disable mixed type list and map literals -func ExtendedValidations() EnvOption { - return ASTValidators( - ValidateDurationLiterals(), - ValidateTimestampLiterals(), - ValidateRegexLiterals(), - ValidateHomogeneousAggregateLiterals(), - ) -} - -// ValidateDurationLiterals ensures that duration literal arguments are valid immediately after type-check. -func ValidateDurationLiterals() ASTValidator { - return newFormatValidator(overloads.TypeConvertDuration, 0, evalCall) -} - -// ValidateTimestampLiterals ensures that timestamp literal arguments are valid immediately after type-check. -func ValidateTimestampLiterals() ASTValidator { - return newFormatValidator(overloads.TypeConvertTimestamp, 0, evalCall) -} - -// ValidateRegexLiterals ensures that regex patterns are validated after type-check. -func ValidateRegexLiterals() ASTValidator { - return newFormatValidator(overloads.Matches, 0, compileRegex) -} - -// ValidateHomogeneousAggregateLiterals checks that all list and map literals entries have the same types, i.e. -// no mixed list element types or mixed map key or map value types. -// -// Note: the string format call relies on a mixed element type list for ease of use, so this check skips all -// literals which occur within string format calls. -func ValidateHomogeneousAggregateLiterals() ASTValidator { - return homogeneousAggregateLiteralValidator{} -} - -// ValidateComprehensionNestingLimit ensures that comprehension nesting does not exceed the specified limit. -// -// This validator can be useful for preventing arbitrarily nested comprehensions which can take high polynomial -// time to complete. -// -// Note, this limit does not apply to comprehensions with an empty iteration range, as these comprehensions have -// no actual looping cost. The cel.bind() utilizes the comprehension structure to perform local variable -// assignments and supplies an empty iteration range, so they won't count against the nesting limit either. -func ValidateComprehensionNestingLimit(limit int) ASTValidator { - return nestingLimitValidator{limit: limit} -} - -type argChecker func(env *Env, call, arg ast.Expr) error - -func newFormatValidator(funcName string, argNum int, check argChecker) formatValidator { - return formatValidator{ - funcName: funcName, - check: check, - argNum: argNum, - } -} - -type formatValidator struct { - funcName string - argNum int - check argChecker -} - -// Name returns the unique name of this function format validator. -func (v formatValidator) Name() string { - return fmt.Sprintf("cel.validator.%s", v.funcName) -} - -// ToConfig converts the ASTValidator to an env.Validator specifying the validator name. -func (v formatValidator) ToConfig() *env.Validator { - return env.NewValidator(v.Name()) -} - -// Validate searches the AST for uses of a given function name with a constant argument and performs a check -// on whether the argument is a valid literal value. -func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) { - root := ast.NavigateAST(a) - funcCalls := ast.MatchDescendants(root, ast.FunctionMatcher(v.funcName)) - for _, call := range funcCalls { - callArgs := call.AsCall().Args() - if len(callArgs) <= v.argNum { - continue - } - litArg := callArgs[v.argNum] - if litArg.Kind() != ast.LiteralKind { - continue - } - if err := v.check(e, call, litArg); err != nil { - iss.ReportErrorAtID(litArg.ID(), "invalid %s argument", v.funcName) - } - } -} - -func evalCall(env *Env, call, arg ast.Expr) error { - ast := &Ast{impl: ast.NewAST(call, ast.NewSourceInfo(nil))} - prg, err := env.Program(ast) - if err != nil { - return err - } - _, _, err = prg.Eval(NoVars()) - return err -} - -func compileRegex(_ *Env, _, arg ast.Expr) error { - pattern := arg.AsLiteral().Value().(string) - _, err := regexp.Compile(pattern) - return err -} - -type homogeneousAggregateLiteralValidator struct{} - -// Name returns the unique name of the homogeneous type validator. -func (homogeneousAggregateLiteralValidator) Name() string { - return homogeneousValidatorName -} - -// ToConfig converts the ASTValidator to an env.Validator specifying the validator name. -func (v homogeneousAggregateLiteralValidator) ToConfig() *env.Validator { - return env.NewValidator(v.Name()) -} - -// Validate validates that all lists and map literals have homogeneous types, i.e. don't contain dyn types. -// -// This validator makes an exception for list and map literals which occur at any level of nesting within -// string format calls. -func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.AST, iss *Issues) { - var exemptedFunctions []string - exemptedFunctions = c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, exemptedFunctions).([]string) - root := ast.NavigateAST(a) - listExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.ListKind)) - for _, listExpr := range listExprs { - if inExemptFunction(listExpr, exemptedFunctions) { - continue - } - l := listExpr.AsList() - elements := l.Elements() - optIndices := l.OptionalIndices() - var elemType *Type - for i, e := range elements { - et := a.GetType(e.ID()) - if isOptionalIndex(i, optIndices) { - et = et.Parameters()[0] - } - if elemType == nil { - elemType = et - continue - } - if !elemType.IsEquivalentType(et) { - v.typeMismatch(iss, e.ID(), elemType, et) - break - } - } - } - mapExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.MapKind)) - for _, mapExpr := range mapExprs { - if inExemptFunction(mapExpr, exemptedFunctions) { - continue - } - m := mapExpr.AsMap() - entries := m.Entries() - var keyType, valType *Type - for _, e := range entries { - mapEntry := e.AsMapEntry() - key, val := mapEntry.Key(), mapEntry.Value() - kt, vt := a.GetType(key.ID()), a.GetType(val.ID()) - if mapEntry.IsOptional() { - vt = vt.Parameters()[0] - } - if keyType == nil && valType == nil { - keyType, valType = kt, vt - continue - } - if !keyType.IsEquivalentType(kt) { - v.typeMismatch(iss, key.ID(), keyType, kt) - } - if !valType.IsEquivalentType(vt) { - v.typeMismatch(iss, val.ID(), valType, vt) - } - } - } -} - -func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool { - parent, found := e.Parent() - for found { - if parent.Kind() == ast.CallKind { - fnName := parent.AsCall().FunctionName() - for _, exempt := range exemptFunctions { - if exempt == fnName { - return true - } - } - } - parent, found = parent.Parent() - } - return false -} - -func isOptionalIndex(i int, optIndices []int32) bool { - for _, optInd := range optIndices { - if i == int(optInd) { - return true - } - } - return false -} - -func (homogeneousAggregateLiteralValidator) typeMismatch(iss *Issues, id int64, expected, actual *Type) { - iss.ReportErrorAtID(id, "expected type '%s' but found '%s'", FormatCELType(expected), FormatCELType(actual)) -} - -type nestingLimitValidator struct { - limit int -} - -// Name returns the name of the nesting limit validator. -func (v nestingLimitValidator) Name() string { - return nestingLimitValidatorName -} - -// ToConfig converts the ASTValidator to an env.Validator specifying the validator name and the nesting limit -// as an integer value: {"limit": int} -func (v nestingLimitValidator) ToConfig() *env.Validator { - return env.NewValidator(v.Name()).SetConfig(map[string]any{"limit": v.limit}) -} - -// Validate implements the ASTValidator interface method. -func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) { - root := ast.NavigateAST(a) - comprehensions := ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) - if len(comprehensions) <= v.limit { - return - } - for _, comp := range comprehensions { - count := 0 - e := comp - hasParent := true - for hasParent { - // When the expression is not a comprehension, continue to the next ancestor. - if e.Kind() != ast.ComprehensionKind { - e, hasParent = e.Parent() - continue - } - // When the comprehension has an empty range, continue to the next ancestor - // as this comprehension does not have any associated cost. - iterRange := e.AsComprehension().IterRange() - if iterRange.Kind() == ast.ListKind && iterRange.AsList().Size() == 0 { - e, hasParent = e.Parent() - continue - } - // Otherwise check the nesting limit. - count++ - if count > v.limit { - iss.ReportErrorAtID(comp.ID(), "comprehension exceeds nesting limit") - break - } - e, hasParent = e.Parent() - } - } -} diff --git a/vendor/github.com/google/cel-go/checker/BUILD.bazel b/vendor/github.com/google/cel-go/checker/BUILD.bazel deleted file mode 100644 index 678b412a9..000000000 --- a/vendor/github.com/google/cel-go/checker/BUILD.bazel +++ /dev/null @@ -1,64 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "checker.go", - "cost.go", - "env.go", - "errors.go", - "format.go", - "mapping.go", - "options.go", - "printer.go", - "scopes.go", - "types.go", - ], - importpath = "github.com/google/cel-go/checker", - visibility = ["//visibility:public"], - deps = [ - "//checker/decls:go_default_library", - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/containers:go_default_library", - "//common/debug:go_default_library", - "//common/decls:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/stdlib:go_default_library", - "//common/types:go_default_library", - "//common/types/pb:go_default_library", - "//common/types/ref:go_default_library", - "//parser:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/emptypb:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "checker_test.go", - "cost_test.go", - "env_test.go", - "format_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//common/types:go_default_library", - "//parser:go_default_library", - "//test:go_default_library", - "//test/proto2pb:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/checker/checker.go b/vendor/github.com/google/cel-go/checker/checker.go deleted file mode 100644 index 0057c16cc..000000000 --- a/vendor/github.com/google/cel-go/checker/checker.go +++ /dev/null @@ -1,728 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package checker defines functions to type-checked a parsed expression -// against a set of identifier and function declarations. -package checker - -import ( - "fmt" - "reflect" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -type checker struct { - *ast.AST - ast.ExprFactory - env *Env - errors *typeErrors - mappings *mapping - freeTypeVarCounter int -} - -// Check performs type checking, giving a typed AST. -// -// The input is a parsed AST and an env which encapsulates type binding of variables, -// declarations of built-in functions, descriptions of protocol buffers, and a registry for -// errors. -// -// Returns a type-checked AST, which might not be usable if there are errors in the error -// registry. -func Check(parsed *ast.AST, source common.Source, env *Env) (*ast.AST, *common.Errors) { - errs := common.NewErrors(source) - typeMap := make(map[int64]*types.Type) - refMap := make(map[int64]*ast.ReferenceInfo) - c := checker{ - AST: ast.NewCheckedAST(parsed, typeMap, refMap), - ExprFactory: ast.NewExprFactory(), - env: env, - errors: &typeErrors{errs: errs}, - mappings: newMapping(), - freeTypeVarCounter: 0, - } - c.check(c.Expr()) - - // Walk over the final type map substituting any type parameters either by their bound value - // or by DYN. - for id, t := range c.TypeMap() { - c.SetType(id, substitute(c.mappings, t, true)) - } - return c.AST, errs -} - -func (c *checker) check(e ast.Expr) { - if e == nil { - return - } - switch e.Kind() { - case ast.LiteralKind: - literal := ref.Val(e.AsLiteral()) - switch literal.Type() { - case types.BoolType, types.BytesType, types.DoubleType, types.IntType, - types.NullType, types.StringType, types.UintType: - c.setType(e, literal.Type().(*types.Type)) - default: - c.errors.unexpectedASTType(e.ID(), c.location(e), "literal", literal.Type().TypeName()) - } - case ast.IdentKind: - c.checkIdent(e) - case ast.SelectKind: - c.checkSelect(e) - case ast.CallKind: - c.checkCall(e) - case ast.ListKind: - c.checkCreateList(e) - case ast.MapKind: - c.checkCreateMap(e) - case ast.StructKind: - c.checkCreateStruct(e) - case ast.ComprehensionKind: - c.checkComprehension(e) - default: - c.errors.unexpectedASTType(e.ID(), c.location(e), "unspecified", reflect.TypeOf(e).Name()) - } -} - -func (c *checker) checkIdent(e ast.Expr) { - identName := e.AsIdent() - // Check to see if the identifier is declared. - if ident := c.env.LookupIdent(identName); ident != nil { - c.setType(e, ident.Type()) - c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value())) - // Overwrite the identifier with its fully qualified name. - e.SetKindCase(c.NewIdent(e.ID(), ident.Name())) - return - } - - c.setType(e, types.ErrorType) - c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), identName) -} - -func (c *checker) checkSelect(e ast.Expr) { - sel := e.AsSelect() - // Before traversing down the tree, try to interpret as qualified name. - qname, found := containers.ToQualifiedName(e) - if found { - ident := c.env.LookupIdent(qname) - if ident != nil { - // We don't check for a TestOnly expression here since the `found` result is - // always going to be false for TestOnly expressions. - - // Rewrite the node to be a variable reference to the resolved fully-qualified - // variable name. - c.setType(e, ident.Type()) - c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value())) - e.SetKindCase(c.NewIdent(e.ID(), ident.Name())) - return - } - } - - resultType := c.checkSelectField(e, sel.Operand(), sel.FieldName(), false) - if sel.IsTestOnly() { - resultType = types.BoolType - } - c.setType(e, substitute(c.mappings, resultType, false)) -} - -func (c *checker) checkOptSelect(e ast.Expr) { - // Collect metadata related to the opt select call packaged by the parser. - call := e.AsCall() - if len(call.Args()) != 2 || call.IsMemberFunction() { - t := "" - if call.IsMemberFunction() { - t = " member call with" - } - c.errors.notAnOptionalFieldSelectionCall(e.ID(), c.location(e), - fmt.Sprintf( - "incorrect signature.%s argument count: %d", t, len(call.Args()))) - return - } - - operand := call.Args()[0] - field := call.Args()[1] - fieldName, isString := maybeUnwrapString(field) - if !isString { - c.errors.notAnOptionalFieldSelection(field.ID(), c.location(field), field) - return - } - - // Perform type-checking using the field selection logic. - resultType := c.checkSelectField(e, operand, fieldName, true) - c.setType(e, substitute(c.mappings, resultType, false)) - c.setReference(e, ast.NewFunctionReference("select_optional_field")) -} - -func (c *checker) checkSelectField(e, operand ast.Expr, field string, optional bool) *types.Type { - // Interpret as field selection, first traversing down the operand. - c.check(operand) - operandType := substitute(c.mappings, c.getType(operand), false) - - // If the target type is 'optional', unwrap it for the sake of this check. - targetType, isOpt := maybeUnwrapOptional(operandType) - - // Assume error type by default as most types do not support field selection. - resultType := types.ErrorType - switch targetType.Kind() { - case types.MapKind: - // Maps yield their value type as the selection result type. - resultType = targetType.Parameters()[1] - case types.StructKind: - // Objects yield their field type declaration as the selection result type, but only if - // the field is defined. - messageType := targetType - if fieldType, found := c.lookupFieldType(e.ID(), messageType.TypeName(), field); found { - resultType = fieldType - } - case types.TypeParamKind: - // Set the operand type to DYN to prevent assignment to a potentially incorrect type - // at a later point in type-checking. The isAssignable call will update the type - // substitutions for the type param under the covers. - c.isAssignable(types.DynType, targetType) - // Also, set the result type to DYN. - resultType = types.DynType - default: - // Dynamic / error values are treated as DYN type. Errors are handled this way as well - // in order to allow forward progress on the check. - if !isDynOrError(targetType) { - c.errors.typeDoesNotSupportFieldSelection(e.ID(), c.location(e), targetType) - } - resultType = types.DynType - } - - // If the target type was optional coming in, then the result must be optional going out. - if isOpt || optional { - return types.NewOptionalType(resultType) - } - return resultType -} - -func (c *checker) checkCall(e ast.Expr) { - // Note: similar logic exists within the `interpreter/planner.go`. If making changes here - // please consider the impact on planner.go and consolidate implementations or mirror code - // as appropriate. - call := e.AsCall() - fnName := call.FunctionName() - if fnName == operators.OptSelect { - c.checkOptSelect(e) - return - } - - args := call.Args() - // Traverse arguments. - for _, arg := range args { - c.check(arg) - } - - // Regular static call with simple name. - if !call.IsMemberFunction() { - // Check for the existence of the function. - fn := c.env.LookupFunction(fnName) - if fn == nil { - c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName) - c.setType(e, types.ErrorType) - return - } - // Overwrite the function name with its fully qualified resolved name. - e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...)) - // Check to see whether the overload resolves. - c.resolveOverloadOrError(e, fn, nil, args) - return - } - - // If a receiver 'target' is present, it may either be a receiver function, or a namespaced - // function, but not both. Given a.b.c() either a.b.c is a function or c is a function with - // target a.b. - // - // Check whether the target is a namespaced function name. - target := call.Target() - qualifiedPrefix, maybeQualified := containers.ToQualifiedName(target) - if maybeQualified { - maybeQualifiedName := qualifiedPrefix + "." + fnName - fn := c.env.LookupFunction(maybeQualifiedName) - if fn != nil { - // The function name is namespaced and so preserving the target operand would - // be an inaccurate representation of the desired evaluation behavior. - // Overwrite with fully-qualified resolved function name sans receiver target. - e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...)) - c.resolveOverloadOrError(e, fn, nil, args) - return - } - } - - // Regular instance call. - c.check(target) - fn := c.env.LookupFunction(fnName) - // Function found, attempt overload resolution. - if fn != nil { - c.resolveOverloadOrError(e, fn, target, args) - return - } - // Function name not declared, record error. - c.setType(e, types.ErrorType) - c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName) -} - -func (c *checker) resolveOverloadOrError( - e ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) { - // Attempt to resolve the overload. - resolution := c.resolveOverload(e, fn, target, args) - // No such overload, error noted in the resolveOverload call, type recorded here. - if resolution == nil { - c.setType(e, types.ErrorType) - return - } - // Overload found. - c.setType(e, resolution.Type) - c.setReference(e, resolution.Reference) -} - -func (c *checker) resolveOverload( - call ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) *overloadResolution { - - var argTypes []*types.Type - if target != nil { - argTypes = append(argTypes, c.getType(target)) - } - for _, arg := range args { - argTypes = append(argTypes, c.getType(arg)) - } - - var resultType *types.Type - var checkedRef *ast.ReferenceInfo - for _, overload := range fn.OverloadDecls() { - // Determine whether the overload is currently considered. - if c.env.isOverloadDisabled(overload.ID()) { - continue - } - - // Ensure the call style for the overload matches. - if (target == nil && overload.IsMemberFunction()) || - (target != nil && !overload.IsMemberFunction()) { - // not a compatible call style. - continue - } - - // Alternative type-checking behavior when the logical operators are compacted into - // variadic AST representations. - if fn.Name() == operators.LogicalAnd || fn.Name() == operators.LogicalOr { - checkedRef = ast.NewFunctionReference(overload.ID()) - for i, argType := range argTypes { - if !c.isAssignable(argType, types.BoolType) { - c.errors.typeMismatch( - args[i].ID(), - c.locationByID(args[i].ID()), - types.BoolType, - argType) - resultType = types.ErrorType - } - } - if isError(resultType) { - return nil - } - return newResolution(checkedRef, types.BoolType) - } - - overloadType := newFunctionType(overload.ResultType(), overload.ArgTypes()...) - typeParams := overload.TypeParams() - if len(typeParams) != 0 { - // Instantiate overload's type with fresh type variables. - substitutions := newMapping() - for _, typePar := range typeParams { - substitutions.add(types.NewTypeParamType(typePar), c.newTypeVar()) - } - overloadType = substitute(substitutions, overloadType, false) - } - - candidateArgTypes := overloadType.Parameters()[1:] - if c.isAssignableList(argTypes, candidateArgTypes) { - if checkedRef == nil { - checkedRef = ast.NewFunctionReference(overload.ID()) - } else { - checkedRef.AddOverload(overload.ID()) - } - - // First matching overload, determines result type. - fnResultType := substitute(c.mappings, overloadType.Parameters()[0], false) - if resultType == nil { - resultType = fnResultType - } else if !isDyn(resultType) && !fnResultType.IsExactType(resultType) { - resultType = types.DynType - } - } - } - - if resultType == nil { - for i, argType := range argTypes { - argTypes[i] = substitute(c.mappings, argType, true) - } - c.errors.noMatchingOverload(call.ID(), c.location(call), fn.Name(), argTypes, target != nil) - return nil - } - - return newResolution(checkedRef, resultType) -} - -func (c *checker) checkCreateList(e ast.Expr) { - create := e.AsList() - var elemsType *types.Type - optionalIndices := create.OptionalIndices() - optionals := make(map[int32]bool, len(optionalIndices)) - for _, optInd := range optionalIndices { - optionals[optInd] = true - } - for i, e := range create.Elements() { - c.check(e) - elemType := c.getType(e) - if optionals[int32(i)] { - var isOptional bool - elemType, isOptional = maybeUnwrapOptional(elemType) - if !isOptional && !isDyn(elemType) { - c.errors.typeMismatch(e.ID(), c.location(e), types.NewOptionalType(elemType), elemType) - } - } - elemsType = c.joinTypes(e, elemsType, elemType) - } - if elemsType == nil { - // If the list is empty, assign free type var to elem type. - elemsType = c.newTypeVar() - } - c.setType(e, types.NewListType(elemsType)) -} - -func (c *checker) checkCreateMap(e ast.Expr) { - mapVal := e.AsMap() - var mapKeyType *types.Type - var mapValueType *types.Type - for _, e := range mapVal.Entries() { - entry := e.AsMapEntry() - key := entry.Key() - c.check(key) - mapKeyType = c.joinTypes(key, mapKeyType, c.getType(key)) - - val := entry.Value() - c.check(val) - valType := c.getType(val) - if entry.IsOptional() { - var isOptional bool - valType, isOptional = maybeUnwrapOptional(valType) - if !isOptional && !isDyn(valType) { - c.errors.typeMismatch(val.ID(), c.location(val), types.NewOptionalType(valType), valType) - } - } - mapValueType = c.joinTypes(val, mapValueType, valType) - } - if mapKeyType == nil { - // If the map is empty, assign free type variables to typeKey and value type. - mapKeyType = c.newTypeVar() - mapValueType = c.newTypeVar() - } - c.setType(e, types.NewMapType(mapKeyType, mapValueType)) -} - -func (c *checker) checkCreateStruct(e ast.Expr) { - msgVal := e.AsStruct() - // Determine the type of the message. - resultType := types.ErrorType - ident := c.env.LookupIdent(msgVal.TypeName()) - if ident == nil { - c.errors.undeclaredReference( - e.ID(), c.location(e), c.env.container.Name(), msgVal.TypeName()) - c.setType(e, types.ErrorType) - return - } - // Ensure the type name is fully qualified in the AST. - typeName := ident.Name() - if msgVal.TypeName() != typeName { - e.SetKindCase(c.NewStruct(e.ID(), typeName, msgVal.Fields())) - msgVal = e.AsStruct() - } - c.setReference(e, ast.NewIdentReference(typeName, nil)) - identKind := ident.Type().Kind() - if identKind != types.ErrorKind { - if identKind != types.TypeKind { - c.errors.notAType(e.ID(), c.location(e), ident.Type().DeclaredTypeName()) - } else { - resultType = ident.Type().Parameters()[0] - // Backwards compatibility test between well-known types and message types - // In this context, the type is being instantiated by its protobuf name which - // is not ideal or recommended, but some users expect this to work. - if isWellKnownType(resultType) { - typeName = getWellKnownTypeName(resultType) - } else if resultType.Kind() == types.StructKind { - typeName = resultType.DeclaredTypeName() - } else { - c.errors.notAMessageType(e.ID(), c.location(e), resultType.DeclaredTypeName()) - resultType = types.ErrorType - } - } - } - c.setType(e, resultType) - - // Check the field initializers. - for _, f := range msgVal.Fields() { - field := f.AsStructField() - fieldName := field.Name() - value := field.Value() - c.check(value) - - fieldType := types.ErrorType - ft, found := c.lookupFieldType(f.ID(), typeName, fieldName) - if found { - fieldType = ft - } - - valType := c.getType(value) - if field.IsOptional() { - var isOptional bool - valType, isOptional = maybeUnwrapOptional(valType) - if !isOptional && !isDyn(valType) { - c.errors.typeMismatch(value.ID(), c.location(value), types.NewOptionalType(valType), valType) - } - } - if !c.isAssignable(fieldType, valType) { - c.errors.fieldTypeMismatch(f.ID(), c.locationByID(f.ID()), fieldName, fieldType, valType) - } - } -} - -func (c *checker) checkComprehension(e ast.Expr) { - comp := e.AsComprehension() - c.check(comp.IterRange()) - c.check(comp.AccuInit()) - rangeType := substitute(c.mappings, c.getType(comp.IterRange()), false) - - // Create a scope for the comprehension since it has a local accumulation variable. - // This scope will contain the accumulation variable used to compute the result. - accuType := c.getType(comp.AccuInit()) - c.env = c.env.enterScope() - c.env.AddIdents(decls.NewVariable(comp.AccuVar(), accuType)) - - var varType, var2Type *types.Type - switch rangeType.Kind() { - case types.ListKind: - // varType represents the list element type for one-variable comprehensions. - varType = rangeType.Parameters()[0] - if comp.HasIterVar2() { - // varType represents the list index (int) for two-variable comprehensions, - // and var2Type represents the list element type. - var2Type = varType - varType = types.IntType - } - case types.MapKind: - // varType represents the map entry key for all comprehension types. - varType = rangeType.Parameters()[0] - if comp.HasIterVar2() { - // var2Type represents the map entry value for two-variable comprehensions. - var2Type = rangeType.Parameters()[1] - } - case types.DynKind, types.ErrorKind, types.TypeParamKind: - // Set the range type to DYN to prevent assignment to a potentially incorrect type - // at a later point in type-checking. The isAssignable call will update the type - // substitutions for the type param under the covers. - c.isAssignable(types.DynType, rangeType) - // Set the range iteration variable to type DYN as well. - varType = types.DynType - if comp.HasIterVar2() { - var2Type = types.DynType - } - default: - c.errors.notAComprehensionRange(comp.IterRange().ID(), c.location(comp.IterRange()), rangeType) - varType = types.ErrorType - if comp.HasIterVar2() { - var2Type = types.ErrorType - } - } - - // Create a block scope for the loop. - c.env = c.env.enterScope() - c.env.AddIdents(decls.NewVariable(comp.IterVar(), varType)) - if comp.HasIterVar2() { - c.env.AddIdents(decls.NewVariable(comp.IterVar2(), var2Type)) - } - // Check the variable references in the condition and step. - c.check(comp.LoopCondition()) - c.assertType(comp.LoopCondition(), types.BoolType) - c.check(comp.LoopStep()) - c.assertType(comp.LoopStep(), accuType) - // Exit the loop's block scope before checking the result. - c.env = c.env.exitScope() - c.check(comp.Result()) - // Exit the comprehension scope. - c.env = c.env.exitScope() - c.setType(e, substitute(c.mappings, c.getType(comp.Result()), false)) -} - -// Checks compatibility of joined types, and returns the most general common type. -func (c *checker) joinTypes(e ast.Expr, previous, current *types.Type) *types.Type { - if previous == nil { - return current - } - if c.isAssignable(previous, current) { - return mostGeneral(previous, current) - } - if c.dynAggregateLiteralElementTypesEnabled() { - return types.DynType - } - c.errors.typeMismatch(e.ID(), c.location(e), previous, current) - return types.ErrorType -} - -func (c *checker) dynAggregateLiteralElementTypesEnabled() bool { - return c.env.aggLitElemType == dynElementType -} - -func (c *checker) newTypeVar() *types.Type { - id := c.freeTypeVarCounter - c.freeTypeVarCounter++ - return types.NewTypeParamType(fmt.Sprintf("_var%d", id)) -} - -func (c *checker) isAssignable(t1, t2 *types.Type) bool { - subs := isAssignable(c.mappings, t1, t2) - if subs != nil { - c.mappings = subs - return true - } - - return false -} - -func (c *checker) isAssignableList(l1, l2 []*types.Type) bool { - subs := isAssignableList(c.mappings, l1, l2) - if subs != nil { - c.mappings = subs - return true - } - - return false -} - -func maybeUnwrapString(e ast.Expr) (string, bool) { - switch e.Kind() { - case ast.LiteralKind: - literal := e.AsLiteral() - switch v := literal.(type) { - case types.String: - return string(v), true - } - } - return "", false -} - -func (c *checker) setType(e ast.Expr, t *types.Type) { - if old, found := c.TypeMap()[e.ID()]; found && !old.IsExactType(t) { - c.errors.incompatibleType(e.ID(), c.location(e), e, old, t) - return - } - c.SetType(e.ID(), t) -} - -func (c *checker) getType(e ast.Expr) *types.Type { - return c.TypeMap()[e.ID()] -} - -func (c *checker) setReference(e ast.Expr, r *ast.ReferenceInfo) { - if old, found := c.ReferenceMap()[e.ID()]; found && !old.Equals(r) { - c.errors.referenceRedefinition(e.ID(), c.location(e), e, old, r) - return - } - c.SetReference(e.ID(), r) -} - -func (c *checker) assertType(e ast.Expr, t *types.Type) { - if !c.isAssignable(t, c.getType(e)) { - c.errors.typeMismatch(e.ID(), c.location(e), t, c.getType(e)) - } -} - -type overloadResolution struct { - Type *types.Type - Reference *ast.ReferenceInfo -} - -func newResolution(r *ast.ReferenceInfo, t *types.Type) *overloadResolution { - return &overloadResolution{ - Reference: r, - Type: t, - } -} - -func (c *checker) location(e ast.Expr) common.Location { - return c.locationByID(e.ID()) -} - -func (c *checker) locationByID(id int64) common.Location { - return c.SourceInfo().GetStartLocation(id) -} - -func (c *checker) lookupFieldType(exprID int64, structType, fieldName string) (*types.Type, bool) { - if _, found := c.env.provider.FindStructType(structType); !found { - // This should not happen, anyway, report an error. - c.errors.unexpectedFailedResolution(exprID, c.locationByID(exprID), structType) - return nil, false - } - - if ft, found := c.env.provider.FindStructFieldType(structType, fieldName); found { - return ft.Type, found - } - - c.errors.undefinedField(exprID, c.locationByID(exprID), fieldName) - return nil, false -} - -func isWellKnownType(t *types.Type) bool { - switch t.Kind() { - case types.AnyKind, types.TimestampKind, types.DurationKind, types.DynKind, types.NullTypeKind: - return true - case types.BoolKind, types.BytesKind, types.DoubleKind, types.IntKind, types.StringKind, types.UintKind: - return t.IsAssignableType(types.NullType) - case types.ListKind: - return t.Parameters()[0] == types.DynType - case types.MapKind: - return t.Parameters()[0] == types.StringType && t.Parameters()[1] == types.DynType - } - return false -} - -func getWellKnownTypeName(t *types.Type) string { - if name, found := wellKnownTypes[t.Kind()]; found { - return name - } - return "" -} - -var ( - wellKnownTypes = map[types.Kind]string{ - types.AnyKind: "google.protobuf.Any", - types.BoolKind: "google.protobuf.BoolValue", - types.BytesKind: "google.protobuf.BytesValue", - types.DoubleKind: "google.protobuf.DoubleValue", - types.DurationKind: "google.protobuf.Duration", - types.DynKind: "google.protobuf.Value", - types.IntKind: "google.protobuf.Int64Value", - types.ListKind: "google.protobuf.ListValue", - types.NullTypeKind: "google.protobuf.NullValue", - types.MapKind: "google.protobuf.Struct", - types.StringKind: "google.protobuf.StringValue", - types.TimestampKind: "google.protobuf.Timestamp", - types.UintKind: "google.protobuf.UInt64Value", - } -) diff --git a/vendor/github.com/google/cel-go/checker/cost.go b/vendor/github.com/google/cel-go/checker/cost.go deleted file mode 100644 index 5bc6318ed..000000000 --- a/vendor/github.com/google/cel-go/checker/cost.go +++ /dev/null @@ -1,1042 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "math" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/parser" -) - -// WARNING: Any changes to cost calculations in this file require a corresponding change in interpreter/runtimecost.go - -// CostEstimator estimates the sizes of variable length input data and the costs of functions. -type CostEstimator interface { - // EstimateSize returns a SizeEstimate for the given AstNode, or nil if the estimator has no - // estimate to provide. - // - // The size is equivalent to the result of the CEL `size()` function: - // * Number of unicode characters in a string - // * Number of bytes in a sequence - // * Number of map entries or number of list items. - // - // EstimateSize is only called for AstNodes where CEL does not know the size; EstimateSize is not - // called for values defined inline in CEL where the size is already obvious to CEL. - EstimateSize(element AstNode) *SizeEstimate - - // EstimateCallCost returns the estimated cost of an invocation, or nil if the estimator has no - // estimate to provide. - EstimateCallCost(function, overloadID string, target *AstNode, args []AstNode) *CallEstimate -} - -// CallEstimate includes a CostEstimate for the call, and an optional estimate of the result object size. -// The ResultSize should only be provided if the call results in a map, list, string or bytes. -type CallEstimate struct { - CostEstimate - - ResultSize *SizeEstimate -} - -// AstNode represents an AST node for the purpose of cost estimations. -type AstNode interface { - // Path returns a field path through the provided type declarations to the type of the AstNode, or nil if the AstNode does not - // represent type directly reachable from the provided type declarations. - // The first path element is a variable. All subsequent path elements are one of: field name, '@items', '@keys', '@values'. - Path() []string - - // Type returns the deduced type of the AstNode. - Type() *types.Type - - // Expr returns the expression of the AstNode. - Expr() ast.Expr - - // ComputedSize returns a size estimate of the AstNode derived from information available in the CEL expression. - // For constants and inline list and map declarations, the exact size is returned. For concatenated list, strings - // and bytes, the size is derived from the size estimates of the operands. nil is returned if there is no - // computed size available. - ComputedSize() *SizeEstimate -} - -type astNode struct { - path []string - t *types.Type - expr ast.Expr - derivedSize *SizeEstimate -} - -func (e astNode) Path() []string { - return e.path -} - -func (e astNode) Type() *types.Type { - return e.t -} - -func (e astNode) Expr() ast.Expr { - return e.expr -} - -func (e astNode) ComputedSize() *SizeEstimate { - return e.derivedSize -} - -// SizeEstimate represents an estimated size of a variable length string, bytes, map or list. -type SizeEstimate struct { - Min, Max uint64 -} - -// UnknownSizeEstimate returns a size between 0 and max uint -func UnknownSizeEstimate() SizeEstimate { - return unknownSizeEstimate -} - -// FixedSizeEstimate returns a size estimate with a fixed min and max range. -func FixedSizeEstimate(size uint64) SizeEstimate { - return SizeEstimate{Min: size, Max: size} -} - -// Add adds to another SizeEstimate and returns the sum. -// If add would result in an uint64 overflow, the result is math.MaxUint64. -func (se SizeEstimate) Add(sizeEstimate SizeEstimate) SizeEstimate { - return SizeEstimate{ - addUint64NoOverflow(se.Min, sizeEstimate.Min), - addUint64NoOverflow(se.Max, sizeEstimate.Max), - } -} - -// Multiply multiplies by another SizeEstimate and returns the product. -// If multiply would result in an uint64 overflow, the result is math.MaxUint64. -func (se SizeEstimate) Multiply(sizeEstimate SizeEstimate) SizeEstimate { - return SizeEstimate{ - multiplyUint64NoOverflow(se.Min, sizeEstimate.Min), - multiplyUint64NoOverflow(se.Max, sizeEstimate.Max), - } -} - -// MultiplyByCostFactor multiplies a SizeEstimate by a cost factor and returns the CostEstimate with the -// nearest integer of the result, rounded up. -func (se SizeEstimate) MultiplyByCostFactor(costPerUnit float64) CostEstimate { - return CostEstimate{ - multiplyByCostFactor(se.Min, costPerUnit), - multiplyByCostFactor(se.Max, costPerUnit), - } -} - -// MultiplyByCost multiplies by the cost and returns the product. -// If multiply would result in an uint64 overflow, the result is math.MaxUint64. -func (se SizeEstimate) MultiplyByCost(cost CostEstimate) CostEstimate { - return CostEstimate{ - multiplyUint64NoOverflow(se.Min, cost.Min), - multiplyUint64NoOverflow(se.Max, cost.Max), - } -} - -// Union returns a SizeEstimate that encompasses both input the SizeEstimate. -func (se SizeEstimate) Union(size SizeEstimate) SizeEstimate { - result := se - if size.Min < result.Min { - result.Min = size.Min - } - if size.Max > result.Max { - result.Max = size.Max - } - return result -} - -// CostEstimate represents an estimated cost range and provides add and multiply operations -// that do not overflow. -type CostEstimate struct { - Min, Max uint64 -} - -// UnknownCostEstimate returns a cost with an unknown impact. -func UnknownCostEstimate() CostEstimate { - return unknownCostEstimate -} - -// FixedCostEstimate returns a cost with a fixed min and max range. -func FixedCostEstimate(cost uint64) CostEstimate { - return CostEstimate{Min: cost, Max: cost} -} - -// Add adds the costs and returns the sum. -// If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64. -func (ce CostEstimate) Add(cost CostEstimate) CostEstimate { - return CostEstimate{ - Min: addUint64NoOverflow(ce.Min, cost.Min), - Max: addUint64NoOverflow(ce.Max, cost.Max), - } -} - -// Multiply multiplies by the cost and returns the product. -// If multiply would result in an uint64 overflow, the result is math.MaxUint64. -func (ce CostEstimate) Multiply(cost CostEstimate) CostEstimate { - return CostEstimate{ - Min: multiplyUint64NoOverflow(ce.Min, cost.Min), - Max: multiplyUint64NoOverflow(ce.Max, cost.Max), - } -} - -// MultiplyByCostFactor multiplies a CostEstimate by a cost factor and returns the CostEstimate with the -// nearest integer of the result, rounded up. -func (ce CostEstimate) MultiplyByCostFactor(costPerUnit float64) CostEstimate { - return CostEstimate{ - Min: multiplyByCostFactor(ce.Min, costPerUnit), - Max: multiplyByCostFactor(ce.Max, costPerUnit), - } -} - -// Union returns a CostEstimate that encompasses both input the CostEstimates. -func (ce CostEstimate) Union(size CostEstimate) CostEstimate { - result := ce - if size.Min < result.Min { - result.Min = size.Min - } - if size.Max > result.Max { - result.Max = size.Max - } - return result -} - -// addUint64NoOverflow adds non-negative ints. If the result is exceeds math.MaxUint64, math.MaxUint64 -// is returned. -func addUint64NoOverflow(x, y uint64) uint64 { - if y > 0 && x > math.MaxUint64-y { - return math.MaxUint64 - } - return x + y -} - -// multiplyUint64NoOverflow multiplies non-negative ints. If the result is exceeds math.MaxUint64, math.MaxUint64 -// is returned. -func multiplyUint64NoOverflow(x, y uint64) uint64 { - if y != 0 && x > math.MaxUint64/y { - return math.MaxUint64 - } - return x * y -} - -// multiplyByFactor multiplies an integer by a cost factor float and returns the nearest integer value, rounded up. -func multiplyByCostFactor(x uint64, y float64) uint64 { - xFloat := float64(x) - if xFloat > 0 && y > 0 && xFloat > math.MaxUint64/y { - return math.MaxUint64 - } - ceil := math.Ceil(xFloat * y) - if ceil >= doubleTwoTo64 { - return math.MaxUint64 - } - return uint64(ceil) -} - -// CostOption configures flags which affect cost computations. -type CostOption func(*coster) error - -// PresenceTestHasCost determines whether presence testing has a cost of one or zero. -// -// Defaults to presence test has a cost of one. -func PresenceTestHasCost(hasCost bool) CostOption { - return func(c *coster) error { - if hasCost { - c.presenceTestCost = selectAndIdentCost - return nil - } - c.presenceTestCost = FixedCostEstimate(0) - return nil - } -} - -// FunctionEstimator provides a CallEstimate given the target and arguments for a specific function, overload pair. -type FunctionEstimator func(estimator CostEstimator, target *AstNode, args []AstNode) *CallEstimate - -// OverloadCostEstimate binds a FunctionCoster to a specific function overload ID. -// -// When a OverloadCostEstimate is provided, it will override the cost calculation of the CostEstimator provided to -// the Cost() call. -func OverloadCostEstimate(overloadID string, functionCoster FunctionEstimator) CostOption { - return func(c *coster) error { - c.overloadEstimators[overloadID] = functionCoster - return nil - } -} - -// Cost estimates the cost of the parsed and type checked CEL expression. -func Cost(checked *ast.AST, estimator CostEstimator, opts ...CostOption) (CostEstimate, error) { - c := &coster{ - checkedAST: checked, - estimator: estimator, - overloadEstimators: map[string]FunctionEstimator{}, - exprPaths: map[int64][]string{}, - localVars: make(scopes), - computedSizes: map[int64]SizeEstimate{}, - computedEntrySizes: map[int64]entrySizeEstimate{}, - presenceTestCost: FixedCostEstimate(1), - } - for _, opt := range opts { - err := opt(c) - if err != nil { - return CostEstimate{}, err - } - } - return c.cost(checked.Expr()), nil -} - -type coster struct { - // exprPaths maps from Expr Id to field path. - exprPaths map[int64][]string - // localVars tracks the local and iteration variables assigned during evaluation. - localVars scopes - // computedSizes tracks the computed sizes of call results. - computedSizes map[int64]SizeEstimate - // computedEntrySizes tracks the size of list and map entries - computedEntrySizes map[int64]entrySizeEstimate - - checkedAST *ast.AST - estimator CostEstimator - overloadEstimators map[string]FunctionEstimator - // presenceTestCost will either be a zero or one based on whether has() macros count against cost computations. - presenceTestCost CostEstimate -} - -// entrySizeEstimate captures the container kind and associated key/index and value SizeEstimate values. -// -// An entrySizeEstimate only exists if both the key/index and the value have SizeEstimate values, otherwise -// a nil entrySizeEstimate should be used. -type entrySizeEstimate struct { - containerKind types.Kind - key SizeEstimate - val SizeEstimate -} - -// container returns the container kind (list or map) of the entry. -func (s *entrySizeEstimate) container() types.Kind { - if s == nil { - return types.UnknownKind - } - return s.containerKind -} - -// keySize returns the SizeEstimate for the key if one exists. -func (s *entrySizeEstimate) keySize() *SizeEstimate { - if s == nil { - return nil - } - return &s.key -} - -// valSize returns the SizeEstimate for the value if one exists. -func (s *entrySizeEstimate) valSize() *SizeEstimate { - if s == nil { - return nil - } - return &s.val -} - -func (s *entrySizeEstimate) union(other *entrySizeEstimate) *entrySizeEstimate { - if s == nil || other == nil { - return nil - } - sk := s.key.Union(other.key) - sv := s.val.Union(other.val) - return &entrySizeEstimate{ - containerKind: s.containerKind, - key: sk, - val: sv, - } -} - -// localVar captures the local variable size and entrySize estimates if they exist for variables -type localVar struct { - exprID int64 - path []string - size *SizeEstimate - entrySize *entrySizeEstimate -} - -// scopes is a stack of variable name to integer id stack to handle scopes created by cel.bind() like macros -type scopes map[string][]*localVar - -func (s scopes) push(varName string, expr ast.Expr, path []string, size *SizeEstimate, entrySize *entrySizeEstimate) { - s[varName] = append(s[varName], &localVar{ - exprID: expr.ID(), - path: path, - size: size, - entrySize: entrySize, - }) -} - -func (s scopes) pop(varName string) { - varStack := s[varName] - s[varName] = varStack[:len(varStack)-1] -} - -func (s scopes) peek(varName string) (*localVar, bool) { - varStack := s[varName] - if len(varStack) > 0 { - return varStack[len(varStack)-1], true - } - return nil, false -} - -func (c *coster) pushIterKey(varName string, rangeExpr ast.Expr) { - entrySize := c.computeEntrySize(rangeExpr) - size := entrySize.keySize() - path := c.getPath(rangeExpr) - container := entrySize.container() - if container == types.UnknownKind { - container = c.getType(rangeExpr).Kind() - } - subpath := "@keys" - if container == types.ListKind { - subpath = "@indices" - } - c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil) -} - -func (c *coster) pushIterValue(varName string, rangeExpr ast.Expr) { - entrySize := c.computeEntrySize(rangeExpr) - size := entrySize.valSize() - path := c.getPath(rangeExpr) - container := entrySize.container() - if container == types.UnknownKind { - container = c.getType(rangeExpr).Kind() - } - subpath := "@values" - if container == types.ListKind { - subpath = "@items" - } - c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil) -} - -func (c *coster) pushIterSingle(varName string, rangeExpr ast.Expr) { - entrySize := c.computeEntrySize(rangeExpr) - size := entrySize.keySize() - subpath := "@keys" - container := entrySize.container() - if container == types.UnknownKind { - container = c.getType(rangeExpr).Kind() - } - if container == types.ListKind { - size = entrySize.valSize() - subpath = "@items" - } - path := c.getPath(rangeExpr) - c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil) -} - -func (c *coster) pushLocalVar(varName string, e ast.Expr) { - path := c.getPath(e) - // note: retrieve the entry size for the local variable based on the size of the binding expression - // since the binding expression could be a list or map, the entry size should also be propagated - entrySize := c.computeEntrySize(e) - c.localVars.push(varName, e, path, c.computeSize(e), entrySize) -} - -func (c *coster) peekLocalVar(varName string) (*localVar, bool) { - return c.localVars.peek(varName) -} - -func (c *coster) popLocalVar(varName string) { - c.localVars.pop(varName) -} - -func (c *coster) cost(e ast.Expr) CostEstimate { - if e == nil { - return CostEstimate{} - } - var cost CostEstimate - switch e.Kind() { - case ast.LiteralKind: - cost = constCost - case ast.IdentKind: - cost = c.costIdent(e) - case ast.SelectKind: - cost = c.costSelect(e) - case ast.CallKind: - cost = c.costCall(e) - case ast.ListKind: - cost = c.costCreateList(e) - case ast.MapKind: - cost = c.costCreateMap(e) - case ast.StructKind: - cost = c.costCreateStruct(e) - case ast.ComprehensionKind: - if c.isBind(e) { - cost = c.costBind(e) - } else { - cost = c.costComprehension(e) - } - default: - return CostEstimate{} - } - return cost -} - -func (c *coster) costIdent(e ast.Expr) CostEstimate { - identName := e.AsIdent() - // build and track the field path - if v, ok := c.peekLocalVar(identName); ok { - c.addPath(e, v.path) - } else { - c.addPath(e, []string{identName}) - } - return selectAndIdentCost -} - -func (c *coster) costSelect(e ast.Expr) CostEstimate { - sel := e.AsSelect() - var sum CostEstimate - if sel.IsTestOnly() { - // recurse, but do not add any cost - // this is equivalent to how evalTestOnly increments the runtime cost counter - // but does not add any additional cost for the qualifier, except here we do - // the reverse (ident adds cost) - sum = sum.Add(c.presenceTestCost) - sum = sum.Add(c.cost(sel.Operand())) - return sum - } - sum = sum.Add(c.cost(sel.Operand())) - targetType := c.getType(sel.Operand()) - switch targetType.Kind() { - case types.MapKind, types.StructKind, types.TypeParamKind: - sum = sum.Add(selectAndIdentCost) - } - - // build and track the field path - c.addPath(e, append(c.getPath(sel.Operand()), sel.FieldName())) - return sum -} - -func (c *coster) costCall(e ast.Expr) CostEstimate { - // Dyn is just a way to disable type-checking, so return the cost of 1 with the cost of the argument - if dynEstimate := c.maybeUnwrapDynCall(e); dynEstimate != nil { - return *dynEstimate - } - - // Continue estimating the cost of all other calls. - call := e.AsCall() - args := call.Args() - var sum CostEstimate - - argTypes := make([]AstNode, len(args)) - argCosts := make([]CostEstimate, len(args)) - for i, arg := range args { - argCosts[i] = c.cost(arg) - argTypes[i] = c.newAstNode(arg) - } - - overloadIDs := c.checkedAST.GetOverloadIDs(e.ID()) - if len(overloadIDs) == 0 { - return CostEstimate{} - } - var targetType *AstNode - if call.IsMemberFunction() { - sum = sum.Add(c.cost(call.Target())) - var t AstNode = c.newAstNode(call.Target()) - targetType = &t - } - // Pick a cost estimate range that covers all the overload cost estimation ranges - fnCost := CostEstimate{Min: uint64(math.MaxUint64), Max: 0} - var resultSize *SizeEstimate - for _, overload := range overloadIDs { - overloadCost := c.functionCost(e, call.FunctionName(), overload, targetType, argTypes, argCosts) - fnCost = fnCost.Union(overloadCost.CostEstimate) - if overloadCost.ResultSize != nil { - if resultSize == nil { - resultSize = overloadCost.ResultSize - } else { - size := resultSize.Union(*overloadCost.ResultSize) - resultSize = &size - } - } - // build and track the field path for index operations - switch overload { - case overloads.IndexList: - if len(args) > 0 { - // note: assigning resultSize here could be redundant with the path-based lookup later - resultSize = c.computeEntrySize(args[0]).valSize() - c.addPath(e, append(c.getPath(args[0]), "@items")) - } - case overloads.IndexMap: - if len(args) > 0 { - resultSize = c.computeEntrySize(args[0]).valSize() - c.addPath(e, append(c.getPath(args[0]), "@values")) - } - } - if resultSize == nil { - resultSize = c.computeSize(e) - } - } - c.setSize(e, resultSize) - return sum.Add(fnCost) -} - -func (c *coster) maybeUnwrapDynCall(e ast.Expr) *CostEstimate { - call := e.AsCall() - if call.FunctionName() != "dyn" { - return nil - } - arg := call.Args()[0] - argCost := c.cost(arg) - c.copySizeEstimates(e, arg) - callCost := FixedCostEstimate(1).Add(argCost) - return &callCost -} - -func (c *coster) costCreateList(e ast.Expr) CostEstimate { - create := e.AsList() - var sum CostEstimate - itemSize := SizeEstimate{Min: math.MaxUint64, Max: 0} - if create.Size() == 0 { - itemSize.Min = 0 - } - for _, e := range create.Elements() { - sum = sum.Add(c.cost(e)) - is := c.sizeOrUnknown(e) - itemSize = itemSize.Union(is) - } - c.setEntrySize(e, &entrySizeEstimate{containerKind: types.ListKind, key: FixedSizeEstimate(1), val: itemSize}) - return sum.Add(createListBaseCost) -} - -func (c *coster) costCreateMap(e ast.Expr) CostEstimate { - mapVal := e.AsMap() - var sum CostEstimate - keySize := SizeEstimate{Min: math.MaxUint64, Max: 0} - valSize := SizeEstimate{Min: math.MaxUint64, Max: 0} - if mapVal.Size() == 0 { - valSize.Min = 0 - keySize.Min = 0 - } - for _, ent := range mapVal.Entries() { - entry := ent.AsMapEntry() - sum = sum.Add(c.cost(entry.Key())) - sum = sum.Add(c.cost(entry.Value())) - // Compute the key size range - ks := c.sizeOrUnknown(entry.Key()) - keySize = keySize.Union(ks) - // Compute the value size range - vs := c.sizeOrUnknown(entry.Value()) - valSize = valSize.Union(vs) - } - c.setEntrySize(e, &entrySizeEstimate{containerKind: types.MapKind, key: keySize, val: valSize}) - return sum.Add(createMapBaseCost) -} - -func (c *coster) costCreateStruct(e ast.Expr) CostEstimate { - msgVal := e.AsStruct() - var sum CostEstimate - for _, ent := range msgVal.Fields() { - field := ent.AsStructField() - sum = sum.Add(c.cost(field.Value())) - } - return sum.Add(createMessageBaseCost) -} - -func (c *coster) costComprehension(e ast.Expr) CostEstimate { - comp := e.AsComprehension() - var sum CostEstimate - sum = sum.Add(c.cost(comp.IterRange())) - sum = sum.Add(c.cost(comp.AccuInit())) - c.pushLocalVar(comp.AccuVar(), comp.AccuInit()) - - // Track the iterRange of each IterVar and AccuVar for field path construction - if comp.HasIterVar2() { - c.pushIterKey(comp.IterVar(), comp.IterRange()) - c.pushIterValue(comp.IterVar2(), comp.IterRange()) - } else { - c.pushIterSingle(comp.IterVar(), comp.IterRange()) - } - - // Determine the cost for each element in the loop - loopCost := c.cost(comp.LoopCondition()) - stepCost := c.cost(comp.LoopStep()) - - // Clear the intermediate variable tracking. - c.popLocalVar(comp.IterVar()) - if comp.HasIterVar2() { - c.popLocalVar(comp.IterVar2()) - } - - // Determine the result cost. - sum = sum.Add(c.cost(comp.Result())) - c.localVars.pop(comp.AccuVar()) - - // Estimate the cost of the loop. - rangeCnt := c.sizeOrUnknown(comp.IterRange()) - rangeCost := rangeCnt.MultiplyByCost(stepCost.Add(loopCost)) - sum = sum.Add(rangeCost) - - switch k := comp.AccuInit().Kind(); k { - case ast.LiteralKind: - c.setSize(e, c.computeSize(comp.AccuInit())) - case ast.ListKind, ast.MapKind: - c.setSize(e, &rangeCnt) - // For a step which produces a container value, it will have an entry size associated - // with its expression id. - if stepEntrySize := c.computeEntrySize(comp.LoopStep()); stepEntrySize != nil { - c.setEntrySize(e, stepEntrySize) - break - } - } - return sum -} - -func (c *coster) isBind(e ast.Expr) bool { - comp := e.AsComprehension() - iterRange := comp.IterRange() - loopCond := comp.LoopCondition() - return iterRange.Kind() == ast.ListKind && iterRange.AsList().Size() == 0 && - loopCond.Kind() == ast.LiteralKind && loopCond.AsLiteral() == types.False && - comp.AccuVar() != parser.AccumulatorName -} - -func (c *coster) costBind(e ast.Expr) CostEstimate { - comp := e.AsComprehension() - var sum CostEstimate - // Binds are lazily initialized, so we retain the cost of an empty iteration range. - sum = sum.Add(c.cost(comp.IterRange())) - sum = sum.Add(c.cost(comp.AccuInit())) - - c.pushLocalVar(comp.AccuVar(), comp.AccuInit()) - sum = sum.Add(c.cost(comp.Result())) - c.popLocalVar(comp.AccuVar()) - - // Associate the bind output size with the result size. - c.copySizeEstimates(e, comp.Result()) - return sum -} - -func (c *coster) functionCost(e ast.Expr, function, overloadID string, target *AstNode, args []AstNode, argCosts []CostEstimate) CallEstimate { - argCostSum := func() CostEstimate { - var sum CostEstimate - for _, a := range argCosts { - sum = sum.Add(a) - } - return sum - } - if len(c.overloadEstimators) != 0 { - if estimator, found := c.overloadEstimators[overloadID]; found { - if est := estimator(c.estimator, target, args); est != nil { - callEst := *est - return CallEstimate{CostEstimate: callEst.Add(argCostSum()), ResultSize: est.ResultSize} - } - } - } - if est := c.estimator.EstimateCallCost(function, overloadID, target, args); est != nil { - callEst := *est - return CallEstimate{CostEstimate: callEst.Add(argCostSum()), ResultSize: est.ResultSize} - } - switch overloadID { - // O(n) functions - case overloads.ExtFormatString: - if target != nil { - // ResultSize not calculated because we can't bound the max size. - return CallEstimate{ - CostEstimate: c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())} - } - case overloads.StringToBytes: - if len(args) == 1 { - sz := c.sizeOrUnknown(args[0]) - // ResultSize max is when each char converts to 4 bytes. - return CallEstimate{ - CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), - ResultSize: &SizeEstimate{Min: sz.Min, Max: sz.Max * 4}} - } - case overloads.BytesToString: - if len(args) == 1 { - sz := c.sizeOrUnknown(args[0]) - // ResultSize min is when 4 bytes convert to 1 char. - return CallEstimate{ - CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), - ResultSize: &SizeEstimate{Min: sz.Min / 4, Max: sz.Max}} - } - case overloads.ExtQuoteString: - if len(args) == 1 { - sz := c.sizeOrUnknown(args[0]) - // ResultSize max is when each char is escaped. 2 quote chars always added. - return CallEstimate{ - CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), - ResultSize: &SizeEstimate{Min: sz.Min + 2, Max: sz.Max*2 + 2}} - } - case overloads.StartsWithString, overloads.EndsWithString: - if len(args) == 1 { - return CallEstimate{CostEstimate: c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())} - } - case overloads.InList: - // If a list is composed entirely of constant values this is O(1), but we don't account for that here. - // We just assume all list containment checks are O(n). - if len(args) == 2 { - return CallEstimate{CostEstimate: c.sizeOrUnknown(args[1]).MultiplyByCostFactor(1).Add(argCostSum())} - } - // O(nm) functions - case overloads.MatchesString: - // https://swtch.com/~rsc/regexp/regexp1.html applies to RE2 implementation supported by CEL - if target != nil && len(args) == 1 { - // Add one to string length for purposes of cost calculation to prevent product of string and regex to be 0 - // in case where string is empty but regex is still expensive. - strCost := c.sizeOrUnknown(*target).Add(SizeEstimate{Min: 1, Max: 1}).MultiplyByCostFactor(common.StringTraversalCostFactor) - // We don't know how many expressions are in the regex, just the string length (a huge - // improvement here would be to somehow get a count the number of expressions in the regex or - // how many states are in the regex state machine and use that to measure regex cost). - // For now, we're making a guess that each expression in a regex is typically at least 4 chars - // in length. - regexCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.RegexStringLengthCostFactor) - return CallEstimate{CostEstimate: strCost.Multiply(regexCost).Add(argCostSum())} - } - case overloads.ContainsString: - if target != nil && len(args) == 1 { - strCost := c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor) - substrCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor) - return CallEstimate{CostEstimate: strCost.Multiply(substrCost).Add(argCostSum())} - } - case overloads.LogicalOr, overloads.LogicalAnd: - lhs := argCosts[0] - rhs := argCosts[1] - // min cost is min of LHS for short circuited && or || - argCost := CostEstimate{Min: lhs.Min, Max: lhs.Add(rhs).Max} - return CallEstimate{CostEstimate: argCost} - case overloads.Conditional: - size := c.sizeOrUnknown(args[1]).Union(c.sizeOrUnknown(args[2])) - resultEntrySize := c.computeEntrySize(args[1].Expr()).union(c.computeEntrySize(args[2].Expr())) - c.setEntrySize(e, resultEntrySize) - conditionalCost := argCosts[0] - ifTrueCost := argCosts[1] - ifFalseCost := argCosts[2] - argCost := conditionalCost.Add(ifTrueCost.Union(ifFalseCost)) - return CallEstimate{CostEstimate: argCost, ResultSize: &size} - case overloads.AddString, overloads.AddBytes, overloads.AddList: - if len(args) == 2 { - lhsSize := c.sizeOrUnknown(args[0]) - rhsSize := c.sizeOrUnknown(args[1]) - resultSize := lhsSize.Add(rhsSize) - rhsEntrySize := c.computeEntrySize(args[0].Expr()) - lhsEntrySize := c.computeEntrySize(args[1].Expr()) - resultEntrySize := rhsEntrySize.union(lhsEntrySize) - if resultEntrySize != nil { - c.setEntrySize(e, resultEntrySize) - } - switch overloadID { - case overloads.AddList: - // list concatenation is O(1), but we handle it here to track size - return CallEstimate{CostEstimate: FixedCostEstimate(1).Add(argCostSum()), ResultSize: &resultSize} - default: - return CallEstimate{CostEstimate: resultSize.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &resultSize} - } - } - case overloads.LessString, overloads.GreaterString, overloads.LessEqualsString, overloads.GreaterEqualsString, - overloads.LessBytes, overloads.GreaterBytes, overloads.LessEqualsBytes, overloads.GreaterEqualsBytes, - overloads.Equals, overloads.NotEquals: - lhsCost := c.sizeOrUnknown(args[0]) - rhsCost := c.sizeOrUnknown(args[1]) - min := uint64(0) - smallestMax := lhsCost.Max - if rhsCost.Max < smallestMax { - smallestMax = rhsCost.Max - } - if smallestMax > 0 { - min = 1 - } - // equality of 2 scalar values results in a cost of 1 - return CallEstimate{ - CostEstimate: CostEstimate{Min: min, Max: smallestMax}.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), - } - } - // O(1) functions - // See CostTracker.costCall for more details about O(1) cost calculations - - // Benchmarks suggest that most of the other operations take +/- 50% of a base cost unit - // which on an Intel xeon 2.20GHz CPU is 50ns. - return CallEstimate{CostEstimate: FixedCostEstimate(1).Add(argCostSum())} -} - -func (c *coster) getType(e ast.Expr) *types.Type { - return c.checkedAST.GetType(e.ID()) -} - -func (c *coster) getPath(e ast.Expr) []string { - if e.Kind() == ast.IdentKind { - if v, found := c.peekLocalVar(e.AsIdent()); found { - return v.path[:] - } - } - return c.exprPaths[e.ID()][:] -} - -func (c *coster) addPath(e ast.Expr, path []string) { - c.exprPaths[e.ID()] = path -} - -func isAccumulatorVar(name string) bool { - return name == parser.AccumulatorName || name == parser.HiddenAccumulatorName -} - -func (c *coster) newAstNode(e ast.Expr) *astNode { - path := c.getPath(e) - if len(path) > 0 && isAccumulatorVar(path[0]) { - // only provide paths to root vars; omit accumulator vars - path = nil - } - return &astNode{ - path: path, - t: c.getType(e), - expr: e, - derivedSize: c.computeSize(e)} -} - -func (c *coster) setSize(e ast.Expr, size *SizeEstimate) { - if size == nil { - return - } - // Store the computed size with the expression - c.computedSizes[e.ID()] = *size -} - -func (c *coster) sizeOrUnknown(node any) SizeEstimate { - switch v := node.(type) { - case ast.Expr: - if sz := c.computeSize(v); sz != nil { - return *sz - } - case AstNode: - if sz := v.ComputedSize(); sz != nil { - return *sz - } - } - return UnknownSizeEstimate() -} - -func (c *coster) copySizeEstimates(dst, src ast.Expr) { - c.setSize(dst, c.computeSize(src)) - c.setEntrySize(dst, c.computeEntrySize(src)) -} - -func (c *coster) computeSize(e ast.Expr) *SizeEstimate { - if size, ok := c.computedSizes[e.ID()]; ok { - return &size - } - if size := computeExprSize(e); size != nil { - return size - } - // Ensure size estimates are computed first as users may choose to override the costs that - // CEL would otherwise ascribe to the type. - node := astNode{expr: e, path: c.getPath(e), t: c.getType(e)} - if size := c.estimator.EstimateSize(node); size != nil { - // storing the computed size should reduce calls to EstimateSize() - c.computedSizes[e.ID()] = *size - return size - } - if size := computeTypeSize(c.getType(e)); size != nil { - return size - } - if e.Kind() == ast.IdentKind { - varName := e.AsIdent() - if v, ok := c.peekLocalVar(varName); ok && v.size != nil { - return v.size - } - } - return nil -} - -func (c *coster) setEntrySize(e ast.Expr, size *entrySizeEstimate) { - if size == nil { - return - } - c.computedEntrySizes[e.ID()] = *size -} - -func (c *coster) computeEntrySize(e ast.Expr) *entrySizeEstimate { - if sz, found := c.computedEntrySizes[e.ID()]; found { - return &sz - } - if e.Kind() == ast.IdentKind { - varName := e.AsIdent() - if v, ok := c.peekLocalVar(varName); ok && v.entrySize != nil { - return v.entrySize - } - } - return nil -} - -func computeExprSize(expr ast.Expr) *SizeEstimate { - var v uint64 - switch expr.Kind() { - case ast.LiteralKind: - switch ck := expr.AsLiteral().(type) { - case types.String: - // converting to runes here is an O(n) operation, but - // this is consistent with how size is computed at runtime, - // and how the language definition defines string size - v = uint64(len([]rune(ck))) - case types.Bytes: - v = uint64(len(ck)) - case types.Bool, types.Double, types.Duration, - types.Int, types.Timestamp, types.Uint, - types.Null: - v = uint64(1) - default: - return nil - } - case ast.ListKind: - v = uint64(expr.AsList().Size()) - case ast.MapKind: - v = uint64(expr.AsMap().Size()) - default: - return nil - } - cost := FixedSizeEstimate(v) - return &cost -} - -func computeTypeSize(t *types.Type) *SizeEstimate { - if isScalar(t) { - cost := FixedSizeEstimate(1) - return &cost - } - return nil -} - -// isScalar returns true if the given type is known to be of a constant size at -// compile time. isScalar will return false for strings (they are variable-width) -// in addition to protobuf.Any and protobuf.Value (their size is not knowable at compile time). -func isScalar(t *types.Type) bool { - switch t.Kind() { - case types.BoolKind, types.DoubleKind, types.DurationKind, types.IntKind, types.TimestampKind, types.UintKind: - return true - case types.OpaqueKind: - if t.TypeName() == "optional_type" { - return isScalar(t.Parameters()[0]) - } - } - return false -} - -var ( - doubleTwoTo64 = math.Ldexp(1.0, 64) - - unknownSizeEstimate = SizeEstimate{Min: 0, Max: math.MaxUint64} - unknownCostEstimate = unknownSizeEstimate.MultiplyByCostFactor(1) - - selectAndIdentCost = FixedCostEstimate(common.SelectAndIdentCost) - constCost = FixedCostEstimate(common.ConstCost) - - createListBaseCost = FixedCostEstimate(common.ListCreateBaseCost) - createMapBaseCost = FixedCostEstimate(common.MapCreateBaseCost) - createMessageBaseCost = FixedCostEstimate(common.StructCreateBaseCost) -) diff --git a/vendor/github.com/google/cel-go/checker/decls/BUILD.bazel b/vendor/github.com/google/cel-go/checker/decls/BUILD.bazel deleted file mode 100644 index a6b0be292..000000000 --- a/vendor/github.com/google/cel-go/checker/decls/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "decls.go", - ], - importpath = "github.com/google/cel-go/checker/decls", - deps = [ - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//types/known/emptypb:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/checker/decls/decls.go b/vendor/github.com/google/cel-go/checker/decls/decls.go deleted file mode 100644 index e013d2c2b..000000000 --- a/vendor/github.com/google/cel-go/checker/decls/decls.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package decls provides helpers for creating variable and function declarations. -package decls - -import ( - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -var ( - // Error type used to communicate issues during type-checking. - Error = &exprpb.Type{ - TypeKind: &exprpb.Type_Error{ - Error: &emptypb.Empty{}}} - - // Dyn is a top-type used to represent any value. - Dyn = &exprpb.Type{ - TypeKind: &exprpb.Type_Dyn{ - Dyn: &emptypb.Empty{}}} -) - -// Commonly used types. -var ( - Bool = NewPrimitiveType(exprpb.Type_BOOL) - Bytes = NewPrimitiveType(exprpb.Type_BYTES) - Double = NewPrimitiveType(exprpb.Type_DOUBLE) - Int = NewPrimitiveType(exprpb.Type_INT64) - Null = &exprpb.Type{ - TypeKind: &exprpb.Type_Null{ - Null: structpb.NullValue_NULL_VALUE}} - String = NewPrimitiveType(exprpb.Type_STRING) - Uint = NewPrimitiveType(exprpb.Type_UINT64) -) - -// Well-known types. -// TODO: Replace with an abstract type registry. -var ( - Any = NewWellKnownType(exprpb.Type_ANY) - Duration = NewWellKnownType(exprpb.Type_DURATION) - Timestamp = NewWellKnownType(exprpb.Type_TIMESTAMP) -) - -// NewAbstractType creates an abstract type declaration which references a proto -// message name and may also include type parameters. -func NewAbstractType(name string, paramTypes ...*exprpb.Type) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_AbstractType_{ - AbstractType: &exprpb.Type_AbstractType{ - Name: name, - ParameterTypes: paramTypes}}} -} - -// NewOptionalType constructs an abstract type indicating that the parameterized type -// may be contained within the object. -func NewOptionalType(paramType *exprpb.Type) *exprpb.Type { - return NewAbstractType("optional_type", paramType) -} - -// NewFunctionType creates a function invocation contract, typically only used -// by type-checking steps after overload resolution. -func NewFunctionType(resultType *exprpb.Type, - argTypes ...*exprpb.Type) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_Function{ - Function: &exprpb.Type_FunctionType{ - ResultType: resultType, - ArgTypes: argTypes}}} -} - -// NewFunction creates a named function declaration with one or more overloads. -func NewFunction(name string, - overloads ...*exprpb.Decl_FunctionDecl_Overload) *exprpb.Decl { - return &exprpb.Decl{ - Name: name, - DeclKind: &exprpb.Decl_Function{ - Function: &exprpb.Decl_FunctionDecl{ - Overloads: overloads}}} -} - -// NewFunctionWithDoc creates a named function declaration with a description and one or more overloads. -func NewFunctionWithDoc(name, doc string, - overloads ...*exprpb.Decl_FunctionDecl_Overload) *exprpb.Decl { - return &exprpb.Decl{ - Name: name, - DeclKind: &exprpb.Decl_Function{ - Function: &exprpb.Decl_FunctionDecl{ - // Doc: desc, - Overloads: overloads}}} -} - -// NewIdent creates a named identifier declaration with an optional literal -// value. -// -// Literal values are typically only associated with enum identifiers. -// -// Deprecated: Use NewVar or NewConst instead. -func NewIdent(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl { - return newIdent(name, t, v, "") -} - -func newIdent(name string, t *exprpb.Type, v *exprpb.Constant, desc string) *exprpb.Decl { - return &exprpb.Decl{ - Name: name, - DeclKind: &exprpb.Decl_Ident{ - Ident: &exprpb.Decl_IdentDecl{ - Type: t, - Value: v, - Doc: desc}}} -} - -// NewConst creates a constant identifier with a CEL constant literal value. -func NewConst(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl { - return newIdent(name, t, v, "") -} - -// NewVar creates a variable identifier. -func NewVar(name string, t *exprpb.Type) *exprpb.Decl { - return newIdent(name, t, nil, "") -} - -// NewVarWithDoc creates a variable identifier with a type and a description string. -func NewVarWithDoc(name string, t *exprpb.Type, desc string) *exprpb.Decl { - return newIdent(name, t, nil, desc) -} - -// NewInstanceOverload creates a instance function overload contract. -// First element of argTypes is instance. -func NewInstanceOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload { - return &exprpb.Decl_FunctionDecl_Overload{ - OverloadId: id, - ResultType: resultType, - Params: argTypes, - IsInstanceFunction: true} -} - -// NewListType generates a new list with elements of a certain type. -func NewListType(elem *exprpb.Type) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_ListType_{ - ListType: &exprpb.Type_ListType{ - ElemType: elem}}} -} - -// NewMapType generates a new map with typed keys and values. -func NewMapType(key *exprpb.Type, value *exprpb.Type) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_MapType_{ - MapType: &exprpb.Type_MapType{ - KeyType: key, - ValueType: value}}} -} - -// NewObjectType creates an object type for a qualified type name. -func NewObjectType(typeName string) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_MessageType{ - MessageType: typeName}} -} - -// NewOverload creates a function overload declaration which contains a unique -// overload id as well as the expected argument and result types. Overloads -// must be aggregated within a Function declaration. -func NewOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload { - return &exprpb.Decl_FunctionDecl_Overload{ - OverloadId: id, - ResultType: resultType, - Params: argTypes, - IsInstanceFunction: false} -} - -// NewParameterizedInstanceOverload creates a parametric function instance overload type. -func NewParameterizedInstanceOverload(id string, - argTypes []*exprpb.Type, - resultType *exprpb.Type, - typeParams []string) *exprpb.Decl_FunctionDecl_Overload { - return &exprpb.Decl_FunctionDecl_Overload{ - OverloadId: id, - ResultType: resultType, - Params: argTypes, - TypeParams: typeParams, - IsInstanceFunction: true} -} - -// NewParameterizedOverload creates a parametric function overload type. -func NewParameterizedOverload(id string, - argTypes []*exprpb.Type, - resultType *exprpb.Type, - typeParams []string) *exprpb.Decl_FunctionDecl_Overload { - return &exprpb.Decl_FunctionDecl_Overload{ - OverloadId: id, - ResultType: resultType, - Params: argTypes, - TypeParams: typeParams, - IsInstanceFunction: false} -} - -// NewPrimitiveType creates a type for a primitive value. See the var declarations -// for Int, Uint, etc. -func NewPrimitiveType(primitive exprpb.Type_PrimitiveType) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_Primitive{ - Primitive: primitive}} -} - -// NewTypeType creates a new type designating a type. -func NewTypeType(nested *exprpb.Type) *exprpb.Type { - if nested == nil { - // must set the nested field for a valid oneof option - nested = &exprpb.Type{} - } - return &exprpb.Type{ - TypeKind: &exprpb.Type_Type{ - Type: nested}} -} - -// NewTypeParamType creates a type corresponding to a named, contextual parameter. -func NewTypeParamType(name string) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_TypeParam{ - TypeParam: name}} -} - -// NewWellKnownType creates a type corresponding to a protobuf well-known type -// value. -func NewWellKnownType(wellKnown exprpb.Type_WellKnownType) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_WellKnown{ - WellKnown: wellKnown}} -} - -// NewWrapperType creates a wrapped primitive type instance. Wrapped types -// are roughly equivalent to a nullable, or optionally valued type. -func NewWrapperType(wrapped *exprpb.Type) *exprpb.Type { - primitive := wrapped.GetPrimitive() - if primitive == exprpb.Type_PRIMITIVE_TYPE_UNSPECIFIED { - // TODO: return an error - panic("Wrapped type must be a primitive") - } - return &exprpb.Type{TypeKind: &exprpb.Type_Wrapper{Wrapper: primitive}} -} diff --git a/vendor/github.com/google/cel-go/checker/env.go b/vendor/github.com/google/cel-go/checker/env.go deleted file mode 100644 index d5ac05014..000000000 --- a/vendor/github.com/google/cel-go/checker/env.go +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "fmt" - "strings" - - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/parser" -) - -type aggregateLiteralElementType int - -const ( - dynElementType aggregateLiteralElementType = iota - homogenousElementType aggregateLiteralElementType = 1 << iota -) - -var ( - crossTypeNumericComparisonOverloads = map[string]struct{}{ - // double <-> int | uint - overloads.LessDoubleInt64: {}, - overloads.LessDoubleUint64: {}, - overloads.LessEqualsDoubleInt64: {}, - overloads.LessEqualsDoubleUint64: {}, - overloads.GreaterDoubleInt64: {}, - overloads.GreaterDoubleUint64: {}, - overloads.GreaterEqualsDoubleInt64: {}, - overloads.GreaterEqualsDoubleUint64: {}, - // int <-> double | uint - overloads.LessInt64Double: {}, - overloads.LessInt64Uint64: {}, - overloads.LessEqualsInt64Double: {}, - overloads.LessEqualsInt64Uint64: {}, - overloads.GreaterInt64Double: {}, - overloads.GreaterInt64Uint64: {}, - overloads.GreaterEqualsInt64Double: {}, - overloads.GreaterEqualsInt64Uint64: {}, - // uint <-> double | int - overloads.LessUint64Double: {}, - overloads.LessUint64Int64: {}, - overloads.LessEqualsUint64Double: {}, - overloads.LessEqualsUint64Int64: {}, - overloads.GreaterUint64Double: {}, - overloads.GreaterUint64Int64: {}, - overloads.GreaterEqualsUint64Double: {}, - overloads.GreaterEqualsUint64Int64: {}, - } -) - -// Env is the environment for type checking. -// -// The Env is comprised of a container, type provider, declarations, and other related objects -// which can be used to assist with type-checking. -type Env struct { - container *containers.Container - provider types.Provider - declarations *Scopes - aggLitElemType aggregateLiteralElementType - filteredOverloadIDs map[string]struct{} -} - -// NewEnv returns a new *Env with the given parameters. -func NewEnv(container *containers.Container, provider types.Provider, opts ...Option) (*Env, error) { - declarations := newScopes() - declarations.Push() - - envOptions := &options{} - for _, opt := range opts { - if err := opt(envOptions); err != nil { - return nil, err - } - } - aggLitElemType := dynElementType - if envOptions.homogeneousAggregateLiterals { - aggLitElemType = homogenousElementType - } - filteredOverloadIDs := crossTypeNumericComparisonOverloads - if envOptions.crossTypeNumericComparisons { - filteredOverloadIDs = make(map[string]struct{}) - } - if envOptions.validatedDeclarations != nil { - declarations = envOptions.validatedDeclarations.Copy() - } - return &Env{ - container: container, - provider: provider, - declarations: declarations, - aggLitElemType: aggLitElemType, - filteredOverloadIDs: filteredOverloadIDs, - }, nil -} - -// AddIdents configures the checker with a list of variable declarations. -// -// If there are overlapping declarations, the method will error. -func (e *Env) AddIdents(declarations ...*decls.VariableDecl) error { - errMsgs := make([]errorMsg, 0) - for _, d := range declarations { - errMsgs = append(errMsgs, e.addIdent(d)) - } - return formatError(errMsgs) -} - -// AddFunctions configures the checker with a list of function declarations. -// -// If there are overlapping declarations, the method will error. -func (e *Env) AddFunctions(declarations ...*decls.FunctionDecl) error { - errMsgs := make([]errorMsg, 0) - for _, d := range declarations { - errMsgs = append(errMsgs, e.setFunction(d)...) - } - return formatError(errMsgs) -} - -// LookupIdent returns a Decl proto for typeName as an identifier in the Env. -// Returns nil if no such identifier is found in the Env. -func (e *Env) LookupIdent(name string) *decls.VariableDecl { - for _, candidate := range e.container.ResolveCandidateNames(name) { - if ident := e.declarations.FindIdent(candidate); ident != nil { - return ident - } - - // Next try to import the name as a reference to a message type. If found, - // the declaration is added to the outest (global) scope of the - // environment, so next time we can access it faster. - if t, found := e.provider.FindStructType(candidate); found { - decl := decls.NewVariable(candidate, t) - e.declarations.AddIdent(decl) - return decl - } - - if i, found := e.provider.FindIdent(candidate); found { - if t, ok := i.(*types.Type); ok { - decl := decls.NewVariable(candidate, types.NewTypeTypeWithParam(t)) - e.declarations.AddIdent(decl) - return decl - } - } - - // Next try to import this as an enum value by splitting the name in a type prefix and - // the enum inside. - if enumValue := e.provider.EnumValue(candidate); enumValue.Type() != types.ErrType { - decl := decls.NewConstant(candidate, types.IntType, enumValue) - e.declarations.AddIdent(decl) - return decl - } - } - return nil -} - -// LookupFunction returns a Decl proto for typeName as a function in env. -// Returns nil if no such function is found in env. -func (e *Env) LookupFunction(name string) *decls.FunctionDecl { - for _, candidate := range e.container.ResolveCandidateNames(name) { - if fn := e.declarations.FindFunction(candidate); fn != nil { - return fn - } - } - return nil -} - -// setFunction adds the function Decl to the Env. -// Adds a function decl if one doesn't already exist, then adds all overloads from the Decl. -// If overload overlaps with an existing overload, adds to the errors in the Env instead. -func (e *Env) setFunction(fn *decls.FunctionDecl) []errorMsg { - errMsgs := make([]errorMsg, 0) - current := e.declarations.FindFunction(fn.Name()) - if current != nil { - var err error - current, err = current.Merge(fn) - if err != nil { - return append(errMsgs, errorMsg(err.Error())) - } - } else { - current = fn - } - for _, overload := range current.OverloadDecls() { - for _, macro := range parser.AllMacros { - if macro.Function() == current.Name() && - macro.IsReceiverStyle() == overload.IsMemberFunction() && - macro.ArgCount() == len(overload.ArgTypes()) { - errMsgs = append(errMsgs, overlappingMacroError(current.Name(), macro.ArgCount())) - } - } - if len(errMsgs) > 0 { - return errMsgs - } - } - e.declarations.SetFunction(current) - return errMsgs -} - -// addIdent adds the Decl to the declarations in the Env. -// Returns a non-empty errorMsg if the identifier is already declared in the scope. -func (e *Env) addIdent(decl *decls.VariableDecl) errorMsg { - current := e.declarations.FindIdentInScope(decl.Name()) - if current != nil { - if current.DeclarationIsEquivalent(decl) { - return "" - } - return overlappingIdentifierError(decl.Name()) - } - e.declarations.AddIdent(decl) - return "" -} - -// isOverloadDisabled returns whether the overloadID is disabled in the current environment. -func (e *Env) isOverloadDisabled(overloadID string) bool { - _, found := e.filteredOverloadIDs[overloadID] - return found -} - -// validatedDeclarations returns a reference to the validated variable and function declaration scope stack. -// must be copied before use. -func (e *Env) validatedDeclarations() *Scopes { - return e.declarations -} - -// enterScope creates a new Env instance with a new innermost declaration scope. -func (e *Env) enterScope() *Env { - childDecls := e.declarations.Push() - return &Env{ - declarations: childDecls, - container: e.container, - provider: e.provider, - aggLitElemType: e.aggLitElemType, - } -} - -// exitScope creates a new Env instance with the nearest outer declaration scope. -func (e *Env) exitScope() *Env { - parentDecls := e.declarations.Pop() - return &Env{ - declarations: parentDecls, - container: e.container, - provider: e.provider, - aggLitElemType: e.aggLitElemType, - } -} - -// errorMsg is a type alias meant to represent error-based return values which -// may be accumulated into an error at a later point in execution. -type errorMsg string - -func overlappingIdentifierError(name string) errorMsg { - return errorMsg(fmt.Sprintf("overlapping identifier for name '%s'", name)) -} - -func overlappingMacroError(name string, argCount int) errorMsg { - return errorMsg(fmt.Sprintf( - "overlapping macro for name '%s' with %d args", name, argCount)) -} - -func formatError(errMsgs []errorMsg) error { - errStrs := make([]string, 0) - if len(errMsgs) > 0 { - for i := 0; i < len(errMsgs); i++ { - if errMsgs[i] != "" { - errStrs = append(errStrs, string(errMsgs[i])) - } - } - } - if len(errStrs) > 0 { - return fmt.Errorf("%s", strings.Join(errStrs, "\n")) - } - return nil -} diff --git a/vendor/github.com/google/cel-go/checker/errors.go b/vendor/github.com/google/cel-go/checker/errors.go deleted file mode 100644 index 3535440ba..000000000 --- a/vendor/github.com/google/cel-go/checker/errors.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" -) - -// typeErrors is a specialization of Errors. -type typeErrors struct { - errs *common.Errors -} - -func (e *typeErrors) fieldTypeMismatch(id int64, l common.Location, name string, field, value *types.Type) { - e.errs.ReportErrorAtID(id, l, "expected type of field '%s' is '%s' but provided type is '%s'", - name, FormatCELType(field), FormatCELType(value)) -} - -func (e *typeErrors) incompatibleType(id int64, l common.Location, ex ast.Expr, prev, next *types.Type) { - e.errs.ReportErrorAtID(id, l, - "incompatible type already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next) -} - -func (e *typeErrors) noMatchingOverload(id int64, l common.Location, name string, args []*types.Type, isInstance bool) { - signature := formatFunctionDeclType(nil, args, isInstance) - e.errs.ReportErrorAtID(id, l, "found no matching overload for '%s' applied to '%s'", name, signature) -} - -func (e *typeErrors) notAComprehensionRange(id int64, l common.Location, t *types.Type) { - e.errs.ReportErrorAtID(id, l, "expression of type '%s' cannot be range of a comprehension (must be list, map, or dynamic)", - FormatCELType(t)) -} - -func (e *typeErrors) notAnOptionalFieldSelectionCall(id int64, l common.Location, err string) { - e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %s", err) -} - -func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field ast.Expr) { - e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %v", field) -} - -func (e *typeErrors) notAType(id int64, l common.Location, typeName string) { - e.errs.ReportErrorAtID(id, l, "'%s' is not a type", typeName) -} - -func (e *typeErrors) notAMessageType(id int64, l common.Location, typeName string) { - e.errs.ReportErrorAtID(id, l, "'%s' is not a message type", typeName) -} - -func (e *typeErrors) referenceRedefinition(id int64, l common.Location, ex ast.Expr, prev, next *ast.ReferenceInfo) { - e.errs.ReportErrorAtID(id, l, - "reference already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next) -} - -func (e *typeErrors) typeDoesNotSupportFieldSelection(id int64, l common.Location, t *types.Type) { - e.errs.ReportErrorAtID(id, l, "type '%s' does not support field selection", FormatCELType(t)) -} - -func (e *typeErrors) typeMismatch(id int64, l common.Location, expected, actual *types.Type) { - e.errs.ReportErrorAtID(id, l, "expected type '%s' but found '%s'", - FormatCELType(expected), FormatCELType(actual)) -} - -func (e *typeErrors) undefinedField(id int64, l common.Location, field string) { - e.errs.ReportErrorAtID(id, l, "undefined field '%s'", field) -} - -func (e *typeErrors) undeclaredReference(id int64, l common.Location, container string, name string) { - e.errs.ReportErrorAtID(id, l, "undeclared reference to '%s' (in container '%s')", name, container) -} - -func (e *typeErrors) unexpectedFailedResolution(id int64, l common.Location, typeName string) { - e.errs.ReportErrorAtID(id, l, "unexpected failed resolution of '%s'", typeName) -} - -func (e *typeErrors) unexpectedASTType(id int64, l common.Location, kind, typeName string) { - e.errs.ReportErrorAtID(id, l, "unexpected %s type: %v", kind, typeName) -} diff --git a/vendor/github.com/google/cel-go/checker/format.go b/vendor/github.com/google/cel-go/checker/format.go deleted file mode 100644 index 95842905e..000000000 --- a/vendor/github.com/google/cel-go/checker/format.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "fmt" - "strings" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -const ( - kindUnknown = iota + 1 - kindError - kindFunction - kindDyn - kindPrimitive - kindWellKnown - kindWrapper - kindNull - kindAbstract - kindType - kindList - kindMap - kindObject - kindTypeParam -) - -// FormatCheckedType converts a type message into a string representation. -func FormatCheckedType(t *exprpb.Type) string { - switch kindOf(t) { - case kindDyn: - return "dyn" - case kindFunction: - return formatFunctionExprType(t.GetFunction().GetResultType(), - t.GetFunction().GetArgTypes(), - false) - case kindList: - return fmt.Sprintf("list(%s)", FormatCheckedType(t.GetListType().GetElemType())) - case kindObject: - return t.GetMessageType() - case kindMap: - return fmt.Sprintf("map(%s, %s)", - FormatCheckedType(t.GetMapType().GetKeyType()), - FormatCheckedType(t.GetMapType().GetValueType())) - case kindNull: - return "null" - case kindPrimitive: - switch t.GetPrimitive() { - case exprpb.Type_UINT64: - return "uint" - case exprpb.Type_INT64: - return "int" - } - return strings.Trim(strings.ToLower(t.GetPrimitive().String()), " ") - case kindType: - if t.GetType() == nil || t.GetType().GetTypeKind() == nil { - return "type" - } - return fmt.Sprintf("type(%s)", FormatCheckedType(t.GetType())) - case kindWellKnown: - switch t.GetWellKnown() { - case exprpb.Type_ANY: - return "any" - case exprpb.Type_DURATION: - return "duration" - case exprpb.Type_TIMESTAMP: - return "timestamp" - } - case kindWrapper: - return fmt.Sprintf("wrapper(%s)", - FormatCheckedType(chkdecls.NewPrimitiveType(t.GetWrapper()))) - case kindError: - return "!error!" - case kindTypeParam: - return t.GetTypeParam() - case kindAbstract: - at := t.GetAbstractType() - params := at.GetParameterTypes() - paramStrs := make([]string, len(params)) - for i, p := range params { - paramStrs[i] = FormatCheckedType(p) - } - return fmt.Sprintf("%s(%s)", at.GetName(), strings.Join(paramStrs, ", ")) - } - return t.String() -} - -type formatter func(any) string - -// FormatCELType formats a types.Type value to a string representation. -// -// The type formatting is identical to FormatCheckedType. -func FormatCELType(t any) string { - dt := t.(*types.Type) - switch dt.Kind() { - case types.AnyKind: - return "any" - case types.DurationKind: - return "duration" - case types.ErrorKind: - return "!error!" - case types.NullTypeKind: - return "null" - case types.TimestampKind: - return "timestamp" - case types.TypeParamKind: - return dt.TypeName() - case types.OpaqueKind: - if dt.TypeName() == "function" { - // There is no explicit function type in the new types representation, so information like - // whether the function is a member function is absent. - return formatFunctionDeclType(dt.Parameters()[0], dt.Parameters()[1:], false) - } - case types.UnspecifiedKind: - return "" - } - if len(dt.Parameters()) == 0 { - return dt.DeclaredTypeName() - } - paramTypeNames := make([]string, 0, len(dt.Parameters())) - for _, p := range dt.Parameters() { - paramTypeNames = append(paramTypeNames, FormatCELType(p)) - } - return fmt.Sprintf("%s(%s)", dt.TypeName(), strings.Join(paramTypeNames, ", ")) -} - -func formatExprType(t any) string { - if t == nil { - return "" - } - return FormatCheckedType(t.(*exprpb.Type)) -} - -func formatFunctionExprType(resultType *exprpb.Type, argTypes []*exprpb.Type, isInstance bool) string { - return formatFunctionInternal[*exprpb.Type](resultType, argTypes, isInstance, formatExprType) -} - -func formatFunctionDeclType(resultType *types.Type, argTypes []*types.Type, isInstance bool) string { - return formatFunctionInternal[*types.Type](resultType, argTypes, isInstance, FormatCELType) -} - -func formatFunctionInternal[T any](resultType T, argTypes []T, isInstance bool, format formatter) string { - result := "" - if isInstance { - target := argTypes[0] - argTypes = argTypes[1:] - result += format(target) - result += "." - } - result += "(" - for i, arg := range argTypes { - if i > 0 { - result += ", " - } - result += format(arg) - } - result += ")" - rt := format(resultType) - if rt != "" { - result += " -> " - result += rt - } - return result -} - -// kindOf returns the kind of the type as defined in the checked.proto. -func kindOf(t *exprpb.Type) int { - if t == nil || t.TypeKind == nil { - return kindUnknown - } - switch t.GetTypeKind().(type) { - case *exprpb.Type_Error: - return kindError - case *exprpb.Type_Function: - return kindFunction - case *exprpb.Type_Dyn: - return kindDyn - case *exprpb.Type_Primitive: - return kindPrimitive - case *exprpb.Type_WellKnown: - return kindWellKnown - case *exprpb.Type_Wrapper: - return kindWrapper - case *exprpb.Type_Null: - return kindNull - case *exprpb.Type_Type: - return kindType - case *exprpb.Type_ListType_: - return kindList - case *exprpb.Type_MapType_: - return kindMap - case *exprpb.Type_MessageType: - return kindObject - case *exprpb.Type_TypeParam: - return kindTypeParam - case *exprpb.Type_AbstractType_: - return kindAbstract - } - return kindUnknown -} diff --git a/vendor/github.com/google/cel-go/checker/mapping.go b/vendor/github.com/google/cel-go/checker/mapping.go deleted file mode 100644 index 8163a908a..000000000 --- a/vendor/github.com/google/cel-go/checker/mapping.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "github.com/google/cel-go/common/types" -) - -type mapping struct { - mapping map[string]*types.Type -} - -func newMapping() *mapping { - return &mapping{ - mapping: make(map[string]*types.Type), - } -} - -func (m *mapping) add(from, to *types.Type) { - m.mapping[FormatCELType(from)] = to -} - -func (m *mapping) find(from *types.Type) (*types.Type, bool) { - if r, found := m.mapping[FormatCELType(from)]; found { - return r, found - } - return nil, false -} - -func (m *mapping) copy() *mapping { - c := newMapping() - - for k, v := range m.mapping { - c.mapping[k] = v - } - return c -} diff --git a/vendor/github.com/google/cel-go/checker/options.go b/vendor/github.com/google/cel-go/checker/options.go deleted file mode 100644 index 0560c3813..000000000 --- a/vendor/github.com/google/cel-go/checker/options.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -type options struct { - crossTypeNumericComparisons bool - homogeneousAggregateLiterals bool - validatedDeclarations *Scopes -} - -// Option is a functional option for configuring the type-checker -type Option func(*options) error - -// CrossTypeNumericComparisons toggles type-checker support for numeric comparisons across type -// See https://github.com/google/cel-spec/wiki/proposal-210 for more details. -func CrossTypeNumericComparisons(enabled bool) Option { - return func(opts *options) error { - opts.crossTypeNumericComparisons = enabled - return nil - } -} - -// ValidatedDeclarations provides a references to validated declarations which will be copied -// into new checker instances. -func ValidatedDeclarations(env *Env) Option { - return func(opts *options) error { - opts.validatedDeclarations = env.validatedDeclarations() - return nil - } -} diff --git a/vendor/github.com/google/cel-go/checker/printer.go b/vendor/github.com/google/cel-go/checker/printer.go deleted file mode 100644 index 7a3984f02..000000000 --- a/vendor/github.com/google/cel-go/checker/printer.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "sort" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/debug" -) - -type semanticAdorner struct { - checked *ast.AST -} - -var _ debug.Adorner = &semanticAdorner{} - -func (a *semanticAdorner) GetMetadata(elem any) string { - result := "" - e, isExpr := elem.(ast.Expr) - if !isExpr { - return result - } - t := a.checked.TypeMap()[e.ID()] - if t != nil { - result += "~" - result += FormatCELType(t) - } - - switch e.Kind() { - case ast.IdentKind, - ast.CallKind, - ast.ListKind, - ast.StructKind, - ast.SelectKind: - if ref, found := a.checked.ReferenceMap()[e.ID()]; found { - if len(ref.OverloadIDs) == 0 { - result += "^" + ref.Name - } else { - sort.Strings(ref.OverloadIDs) - for i, overload := range ref.OverloadIDs { - if i == 0 { - result += "^" - } else { - result += "|" - } - result += overload - } - } - } - } - - return result -} - -// Print returns a string representation of the Expr message, -// annotated with types from the CheckedExpr. The Expr must -// be a sub-expression embedded in the CheckedExpr. -func Print(e ast.Expr, checked *ast.AST) string { - a := &semanticAdorner{checked: checked} - return debug.ToAdornedDebugString(e, a) -} diff --git a/vendor/github.com/google/cel-go/checker/scopes.go b/vendor/github.com/google/cel-go/checker/scopes.go deleted file mode 100644 index 8bb73ddb6..000000000 --- a/vendor/github.com/google/cel-go/checker/scopes.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "github.com/google/cel-go/common/decls" -) - -// Scopes represents nested Decl sets where the Scopes value contains a Groups containing all -// identifiers in scope and an optional parent representing outer scopes. -// Each Groups value is a mapping of names to Decls in the ident and function namespaces. -// Lookups are performed such that bindings in inner scopes shadow those in outer scopes. -type Scopes struct { - parent *Scopes - scopes *Group -} - -// newScopes creates a new, empty Scopes. -// Some operations can't be safely performed until a Group is added with Push. -func newScopes() *Scopes { - return &Scopes{ - scopes: newGroup(), - } -} - -// Copy creates a copy of the current Scopes values, including a copy of its parent if non-nil. -func (s *Scopes) Copy() *Scopes { - cpy := newScopes() - if s == nil { - return cpy - } - if s.parent != nil { - cpy.parent = s.parent.Copy() - } - cpy.scopes = s.scopes.copy() - return cpy -} - -// Push creates a new Scopes value which references the current Scope as its parent. -func (s *Scopes) Push() *Scopes { - return &Scopes{ - parent: s, - scopes: newGroup(), - } -} - -// Pop returns the parent Scopes value for the current scope, or the current scope if the parent -// is nil. -func (s *Scopes) Pop() *Scopes { - if s.parent != nil { - return s.parent - } - // TODO: Consider whether this should be an error / panic. - return s -} - -// AddIdent adds the ident Decl in the current scope. -// Note: If the name collides with an existing identifier in the scope, the Decl is overwritten. -func (s *Scopes) AddIdent(decl *decls.VariableDecl) { - s.scopes.idents[decl.Name()] = decl -} - -// FindIdent finds the first ident Decl with a matching name in Scopes, or nil if one cannot be -// found. -// Note: The search is performed from innermost to outermost. -func (s *Scopes) FindIdent(name string) *decls.VariableDecl { - if ident, found := s.scopes.idents[name]; found { - return ident - } - if s.parent != nil { - return s.parent.FindIdent(name) - } - return nil -} - -// FindIdentInScope finds the first ident Decl with a matching name in the current Scopes value, or -// nil if one does not exist. -// Note: The search is only performed on the current scope and does not search outer scopes. -func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl { - if ident, found := s.scopes.idents[name]; found { - return ident - } - return nil -} - -// SetFunction adds the function Decl to the current scope. -// Note: Any previous entry for a function in the current scope with the same name is overwritten. -func (s *Scopes) SetFunction(fn *decls.FunctionDecl) { - s.scopes.functions[fn.Name()] = fn -} - -// FindFunction finds the first function Decl with a matching name in Scopes. -// The search is performed from innermost to outermost. -// Returns nil if no such function in Scopes. -func (s *Scopes) FindFunction(name string) *decls.FunctionDecl { - if fn, found := s.scopes.functions[name]; found { - return fn - } - if s.parent != nil { - return s.parent.FindFunction(name) - } - return nil -} - -// Group is a set of Decls that is pushed on or popped off a Scopes as a unit. -// Contains separate namespaces for identifier and function Decls. -// (Should be named "Scope" perhaps?) -type Group struct { - idents map[string]*decls.VariableDecl - functions map[string]*decls.FunctionDecl -} - -// copy creates a new Group instance with a shallow copy of the variables and functions. -// If callers need to mutate the exprpb.Decl definitions for a Function, they should copy-on-write. -func (g *Group) copy() *Group { - cpy := &Group{ - idents: make(map[string]*decls.VariableDecl, len(g.idents)), - functions: make(map[string]*decls.FunctionDecl, len(g.functions)), - } - for n, id := range g.idents { - cpy.idents[n] = id - } - for n, fn := range g.functions { - cpy.functions[n] = fn - } - return cpy -} - -// newGroup creates a new Group with empty maps for identifiers and functions. -func newGroup() *Group { - return &Group{ - idents: make(map[string]*decls.VariableDecl), - functions: make(map[string]*decls.FunctionDecl), - } -} diff --git a/vendor/github.com/google/cel-go/checker/types.go b/vendor/github.com/google/cel-go/checker/types.go deleted file mode 100644 index 4c65b2737..000000000 --- a/vendor/github.com/google/cel-go/checker/types.go +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package checker - -import ( - "github.com/google/cel-go/common/types" -) - -// isDyn returns true if the input t is either type DYN or a well-known ANY message. -func isDyn(t *types.Type) bool { - // Note: object type values that are well-known and map to a DYN value in practice - // are sanitized prior to being added to the environment. - switch t.Kind() { - case types.DynKind, types.AnyKind: - return true - default: - return false - } -} - -// isDynOrError returns true if the input is either an Error, DYN, or well-known ANY message. -func isDynOrError(t *types.Type) bool { - return isError(t) || isDyn(t) -} - -func isError(t *types.Type) bool { - return t.Kind() == types.ErrorKind -} - -func isOptional(t *types.Type) bool { - if t.Kind() == types.OpaqueKind { - return t.TypeName() == "optional_type" - } - return false -} - -func maybeUnwrapOptional(t *types.Type) (*types.Type, bool) { - if isOptional(t) { - return t.Parameters()[0], true - } - return t, false -} - -// isEqualOrLessSpecific checks whether one type is equal or less specific than the other one. -// A type is less specific if it matches the other type using the DYN type. -func isEqualOrLessSpecific(t1, t2 *types.Type) bool { - kind1, kind2 := t1.Kind(), t2.Kind() - // The first type is less specific. - if isDyn(t1) || kind1 == types.TypeParamKind { - return true - } - // The first type is not less specific. - if isDyn(t2) || kind2 == types.TypeParamKind { - return false - } - // Types must be of the same kind to be equal. - if kind1 != kind2 { - return false - } - - // With limited exceptions for ANY and JSON values, the types must agree and be equivalent in - // order to return true. - switch kind1 { - case types.OpaqueKind: - if t1.TypeName() != t2.TypeName() || - len(t1.Parameters()) != len(t2.Parameters()) { - return false - } - for i, p1 := range t1.Parameters() { - if !isEqualOrLessSpecific(p1, t2.Parameters()[i]) { - return false - } - } - return true - case types.ListKind: - return isEqualOrLessSpecific(t1.Parameters()[0], t2.Parameters()[0]) - case types.MapKind: - return isEqualOrLessSpecific(t1.Parameters()[0], t2.Parameters()[0]) && - isEqualOrLessSpecific(t1.Parameters()[1], t2.Parameters()[1]) - case types.TypeKind: - return true - default: - return t1.IsExactType(t2) - } -} - -// / internalIsAssignable returns true if t1 is assignable to t2. -func internalIsAssignable(m *mapping, t1, t2 *types.Type) bool { - // Process type parameters. - kind1, kind2 := t1.Kind(), t2.Kind() - if kind2 == types.TypeParamKind { - // If t2 is a valid type substitution for t1, return true. - valid, t2HasSub := isValidTypeSubstitution(m, t1, t2) - if valid { - return true - } - // If t2 is not a valid type sub for t1, and already has a known substitution return false - // since it is not possible for t1 to be a substitution for t2. - if !valid && t2HasSub { - return false - } - // Otherwise, fall through to check whether t1 is a possible substitution for t2. - } - if kind1 == types.TypeParamKind { - // Return whether t1 is a valid substitution for t2. If not, do no additional checks as the - // possible type substitutions have been searched in both directions. - valid, _ := isValidTypeSubstitution(m, t2, t1) - return valid - } - - // Next check for wildcard types. - if isDynOrError(t1) || isDynOrError(t2) { - return true - } - // Preserve the nullness checks of the legacy type-checker. - if kind1 == types.NullTypeKind { - return internalIsAssignableNull(t2) - } - if kind2 == types.NullTypeKind { - return internalIsAssignableNull(t1) - } - - // Test for when the types do not need to agree, but are more specific than dyn. - switch kind1 { - case types.BoolKind, types.BytesKind, types.DoubleKind, types.IntKind, types.StringKind, types.UintKind, - types.AnyKind, types.DurationKind, types.TimestampKind, - types.StructKind: - // Test whether t2 is assignable from t1. The order of this check won't usually matter; - // however, there may be cases where type capabilities are expanded beyond what is supported - // in the current common/types package. For example, an interface designation for a group of - // Struct types. - return t2.IsAssignableType(t1) - case types.TypeKind: - return kind2 == types.TypeKind - case types.OpaqueKind, types.ListKind, types.MapKind: - return t1.Kind() == t2.Kind() && t1.TypeName() == t2.TypeName() && - internalIsAssignableList(m, t1.Parameters(), t2.Parameters()) - default: - return false - } -} - -// isValidTypeSubstitution returns whether t2 (or its type substitution) is a valid type -// substitution for t1, and whether t2 has a type substitution in mapping m. -// -// The type t2 is a valid substitution for t1 if any of the following statements is true -// - t2 has a type substitution (t2sub) equal to t1 -// - t2 has a type substitution (t2sub) assignable to t1 -// - t2 does not occur within t1. -func isValidTypeSubstitution(m *mapping, t1, t2 *types.Type) (valid, hasSub bool) { - // Early return if the t1 and t2 are the same instance. - kind1, kind2 := t1.Kind(), t2.Kind() - if kind1 == kind2 && t1.IsExactType(t2) { - return true, true - } - if t2Sub, found := m.find(t2); found { - // Early return if t1 and t2Sub are the same instance as otherwise the mapping - // might mark a type as being a subtitution for itself. - if kind1 == t2Sub.Kind() && t1.IsExactType(t2Sub) { - return true, true - } - // If the types are compatible, pick the more general type and return true - if internalIsAssignable(m, t1, t2Sub) { - t2New := mostGeneral(t1, t2Sub) - // only update the type reference map if the target type does not occur within it. - if notReferencedIn(m, t2, t2New) { - m.add(t2, t2New) - } - // acknowledge the type agreement, and that the substitution is already tracked. - return true, true - } - return false, true - } - if notReferencedIn(m, t2, t1) { - m.add(t2, t1) - return true, false - } - return false, false -} - -// internalIsAssignableList returns true if the element types at each index in the list are -// assignable from l1[i] to l2[i]. The list lengths must also agree for the lists to be -// assignable. -func internalIsAssignableList(m *mapping, l1, l2 []*types.Type) bool { - if len(l1) != len(l2) { - return false - } - for i, t1 := range l1 { - if !internalIsAssignable(m, t1, l2[i]) { - return false - } - } - return true -} - -// internalIsAssignableNull returns true if the type is nullable. -func internalIsAssignableNull(t *types.Type) bool { - return isLegacyNullable(t) || t.IsAssignableType(types.NullType) -} - -// isLegacyNullable preserves the null-ness compatibility of the original type-checker implementation. -func isLegacyNullable(t *types.Type) bool { - switch t.Kind() { - case types.OpaqueKind, types.StructKind, types.AnyKind, types.DurationKind, types.TimestampKind: - return true - } - return false -} - -// isAssignable returns an updated type substitution mapping if t1 is assignable to t2. -func isAssignable(m *mapping, t1, t2 *types.Type) *mapping { - mCopy := m.copy() - if internalIsAssignable(mCopy, t1, t2) { - return mCopy - } - return nil -} - -// isAssignableList returns an updated type substitution mapping if l1 is assignable to l2. -func isAssignableList(m *mapping, l1, l2 []*types.Type) *mapping { - mCopy := m.copy() - if internalIsAssignableList(mCopy, l1, l2) { - return mCopy - } - return nil -} - -// mostGeneral returns the more general of two types which are known to unify. -func mostGeneral(t1, t2 *types.Type) *types.Type { - if isEqualOrLessSpecific(t1, t2) { - return t1 - } - return t2 -} - -// notReferencedIn checks whether the type doesn't appear directly or transitively within the other -// type. This is a standard requirement for type unification, commonly referred to as the "occurs -// check". -func notReferencedIn(m *mapping, t, withinType *types.Type) bool { - if t.IsExactType(withinType) { - return false - } - withinKind := withinType.Kind() - switch withinKind { - case types.TypeParamKind: - wtSub, found := m.find(withinType) - if !found { - return true - } - return notReferencedIn(m, t, wtSub) - case types.OpaqueKind, types.ListKind, types.MapKind, types.TypeKind: - for _, pt := range withinType.Parameters() { - if !notReferencedIn(m, t, pt) { - return false - } - } - return true - default: - return true - } -} - -// substitute replaces all direct and indirect occurrences of bound type parameters. Unbound type -// parameters are replaced by DYN if typeParamToDyn is true. -func substitute(m *mapping, t *types.Type, typeParamToDyn bool) *types.Type { - if tSub, found := m.find(t); found { - return substitute(m, tSub, typeParamToDyn) - } - kind := t.Kind() - if typeParamToDyn && kind == types.TypeParamKind { - return types.DynType - } - switch kind { - case types.OpaqueKind: - return types.NewOpaqueType(t.TypeName(), substituteParams(m, t.Parameters(), typeParamToDyn)...) - case types.ListKind: - return types.NewListType(substitute(m, t.Parameters()[0], typeParamToDyn)) - case types.MapKind: - return types.NewMapType(substitute(m, t.Parameters()[0], typeParamToDyn), - substitute(m, t.Parameters()[1], typeParamToDyn)) - case types.TypeKind: - if len(t.Parameters()) > 0 { - tParam := t.Parameters()[0] - return types.NewTypeTypeWithParam(substitute(m, tParam, typeParamToDyn)) - } - return t - default: - return t - } -} - -func substituteParams(m *mapping, typeParams []*types.Type, typeParamToDyn bool) []*types.Type { - subParams := make([]*types.Type, len(typeParams)) - for i, tp := range typeParams { - subParams[i] = substitute(m, tp, typeParamToDyn) - } - return subParams -} - -func newFunctionType(resultType *types.Type, argTypes ...*types.Type) *types.Type { - return types.NewOpaqueType("function", append([]*types.Type{resultType}, argTypes...)...) -} diff --git a/vendor/github.com/google/cel-go/common/BUILD.bazel b/vendor/github.com/google/cel-go/common/BUILD.bazel deleted file mode 100644 index 1b1b7914d..000000000 --- a/vendor/github.com/google/cel-go/common/BUILD.bazel +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "cost.go", - "doc.go", - "error.go", - "errors.go", - "location.go", - "source.go", - ], - importpath = "github.com/google/cel-go/common", - deps = [ - "//common/runes:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "doc_test.go", - "errors_test.go", - "source_test.go", - ], - embed = [ - ":go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel b/vendor/github.com/google/cel-go/common/ast/BUILD.bazel deleted file mode 100644 index 9824f57a9..000000000 --- a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel +++ /dev/null @@ -1,57 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "ast.go", - "conversion.go", - "expr.go", - "factory.go", - "navigable.go", - ], - importpath = "github.com/google/cel-go/common/ast", - deps = [ - "//common:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "@dev_cel_expr//:expr", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "ast_test.go", - "conversion_test.go", - "expr_test.go", - "navigable_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//checker:go_default_library", - "//checker/decls:go_default_library", - "//common:go_default_library", - "//common/containers:go_default_library", - "//common/decls:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/stdlib:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//parser:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//encoding/prototext:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/ast/ast.go b/vendor/github.com/google/cel-go/common/ast/ast.go deleted file mode 100644 index 62c09cfc6..000000000 --- a/vendor/github.com/google/cel-go/common/ast/ast.go +++ /dev/null @@ -1,535 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ast declares data structures useful for parsed and checked abstract syntax trees -package ast - -import ( - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// AST contains a protobuf expression and source info along with CEL-native type and reference information. -type AST struct { - expr Expr - sourceInfo *SourceInfo - typeMap map[int64]*types.Type - refMap map[int64]*ReferenceInfo -} - -// Expr returns the root ast.Expr value in the AST. -func (a *AST) Expr() Expr { - if a == nil { - return nilExpr - } - return a.expr -} - -// SourceInfo returns the source metadata associated with the parse / type-check passes. -func (a *AST) SourceInfo() *SourceInfo { - if a == nil { - return nil - } - return a.sourceInfo -} - -// GetType returns the type for the expression at the given id, if one exists, else types.DynType. -func (a *AST) GetType(id int64) *types.Type { - if t, found := a.TypeMap()[id]; found { - return t - } - return types.DynType -} - -// SetType sets the type of the expression node at the given id. -func (a *AST) SetType(id int64, t *types.Type) { - if a == nil { - return - } - a.typeMap[id] = t -} - -// TypeMap returns the map of expression ids to type-checked types. -// -// If the AST is not type-checked, the map will be empty. -func (a *AST) TypeMap() map[int64]*types.Type { - if a == nil { - return map[int64]*types.Type{} - } - return a.typeMap -} - -// GetOverloadIDs returns the set of overload function names for a given expression id. -// -// If the expression id is not a function call, or the AST is not type-checked, the result will be empty. -func (a *AST) GetOverloadIDs(id int64) []string { - if ref, found := a.ReferenceMap()[id]; found { - return ref.OverloadIDs - } - return []string{} -} - -// ReferenceMap returns the map of expression id to identifier, constant, and function references. -func (a *AST) ReferenceMap() map[int64]*ReferenceInfo { - if a == nil { - return map[int64]*ReferenceInfo{} - } - return a.refMap -} - -// SetReference adds a reference to the checked AST type map. -func (a *AST) SetReference(id int64, r *ReferenceInfo) { - if a == nil { - return - } - a.refMap[id] = r -} - -// IsChecked returns whether the AST is type-checked. -func (a *AST) IsChecked() bool { - return a != nil && len(a.TypeMap()) > 0 -} - -// NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value. -func NewAST(e Expr, sourceInfo *SourceInfo) *AST { - if e == nil { - e = nilExpr - } - return &AST{ - expr: e, - sourceInfo: sourceInfo, - typeMap: make(map[int64]*types.Type), - refMap: make(map[int64]*ReferenceInfo), - } -} - -// NewCheckedAST wraps an parsed AST and augments it with type and reference metadata. -func NewCheckedAST(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo) *AST { - return &AST{ - expr: parsed.Expr(), - sourceInfo: parsed.SourceInfo(), - typeMap: typeMap, - refMap: refMap, - } -} - -// Copy creates a deep copy of the Expr and SourceInfo values in the input AST. -// -// Copies of the Expr value are generated using an internal default ExprFactory. -func Copy(a *AST) *AST { - if a == nil { - return nil - } - e := defaultFactory.CopyExpr(a.expr) - if !a.IsChecked() { - return NewAST(e, CopySourceInfo(a.SourceInfo())) - } - typesCopy := make(map[int64]*types.Type, len(a.typeMap)) - for id, t := range a.typeMap { - typesCopy[id] = t - } - refsCopy := make(map[int64]*ReferenceInfo, len(a.refMap)) - for id, r := range a.refMap { - refsCopy[id] = r - } - return NewCheckedAST(NewAST(e, CopySourceInfo(a.SourceInfo())), typesCopy, refsCopy) -} - -// MaxID returns the upper-bound, non-inclusive, of ids present within the AST's Expr value. -func MaxID(a *AST) int64 { - visitor := &maxIDVisitor{maxID: 1} - PostOrderVisit(a.Expr(), visitor) - for id, call := range a.SourceInfo().MacroCalls() { - PostOrderVisit(call, visitor) - if id > visitor.maxID { - visitor.maxID = id + 1 - } - } - return visitor.maxID + 1 -} - -// Heights computes the heights of all AST expressions and returns a map from expression id to height. -func Heights(a *AST) map[int64]int { - visitor := make(heightVisitor) - PostOrderVisit(a.Expr(), visitor) - return visitor -} - -// NewSourceInfo creates a simple SourceInfo object from an input common.Source value. -func NewSourceInfo(src common.Source) *SourceInfo { - var lineOffsets []int32 - var desc string - baseLine := int32(0) - baseCol := int32(0) - if src != nil { - desc = src.Description() - lineOffsets = src.LineOffsets() - // Determine whether the source metadata should be computed relative - // to a base line and column value. This can be determined by requesting - // the location for offset 0 from the source object. - if loc, found := src.OffsetLocation(0); found { - baseLine = int32(loc.Line()) - 1 - baseCol = int32(loc.Column()) - } - } - return &SourceInfo{ - desc: desc, - lines: lineOffsets, - baseLine: baseLine, - baseCol: baseCol, - offsetRanges: make(map[int64]OffsetRange), - macroCalls: make(map[int64]Expr), - } -} - -// CopySourceInfo creates a deep copy of the MacroCalls within the input SourceInfo. -// -// Copies of macro Expr values are generated using an internal default ExprFactory. -func CopySourceInfo(info *SourceInfo) *SourceInfo { - if info == nil { - return nil - } - rangesCopy := make(map[int64]OffsetRange, len(info.offsetRanges)) - for id, off := range info.offsetRanges { - rangesCopy[id] = off - } - callsCopy := make(map[int64]Expr, len(info.macroCalls)) - for id, call := range info.macroCalls { - callsCopy[id] = defaultFactory.CopyExpr(call) - } - return &SourceInfo{ - syntax: info.syntax, - desc: info.desc, - lines: info.lines, - baseLine: info.baseLine, - baseCol: info.baseCol, - offsetRanges: rangesCopy, - macroCalls: callsCopy, - } -} - -// SourceInfo records basic information about the expression as a textual input and -// as a parsed expression value. -type SourceInfo struct { - syntax string - desc string - lines []int32 - baseLine int32 - baseCol int32 - offsetRanges map[int64]OffsetRange - macroCalls map[int64]Expr -} - -// SyntaxVersion returns the syntax version associated with the text expression. -func (s *SourceInfo) SyntaxVersion() string { - if s == nil { - return "" - } - return s.syntax -} - -// Description provides information about where the expression came from. -func (s *SourceInfo) Description() string { - if s == nil { - return "" - } - return s.desc -} - -// LineOffsets returns a list of the 0-based character offsets in the input text where newlines appear. -func (s *SourceInfo) LineOffsets() []int32 { - if s == nil { - return []int32{} - } - return s.lines -} - -// MacroCalls returns a map of expression id to ast.Expr value where the id represents the expression -// node where the macro was inserted into the AST, and the ast.Expr value represents the original call -// signature which was replaced. -func (s *SourceInfo) MacroCalls() map[int64]Expr { - if s == nil { - return map[int64]Expr{} - } - return s.macroCalls -} - -// GetMacroCall returns the original ast.Expr value for the given expression if it was generated via -// a macro replacement. -// -// Note, parsing options must be enabled to track macro calls before this method will return a value. -func (s *SourceInfo) GetMacroCall(id int64) (Expr, bool) { - e, found := s.MacroCalls()[id] - return e, found -} - -// SetMacroCall records a macro call at a specific location. -func (s *SourceInfo) SetMacroCall(id int64, e Expr) { - if s != nil { - s.macroCalls[id] = e - } -} - -// ClearMacroCall removes the macro call at the given expression id. -func (s *SourceInfo) ClearMacroCall(id int64) { - if s != nil { - delete(s.macroCalls, id) - } -} - -// OffsetRanges returns a map of expression id to OffsetRange values where the range indicates either: -// the start and end position in the input stream where the expression occurs, or the start position -// only. If the range only captures start position, the stop position of the range will be equal to -// the start. -func (s *SourceInfo) OffsetRanges() map[int64]OffsetRange { - if s == nil { - return map[int64]OffsetRange{} - } - return s.offsetRanges -} - -// GetOffsetRange retrieves an OffsetRange for the given expression id if one exists. -func (s *SourceInfo) GetOffsetRange(id int64) (OffsetRange, bool) { - if s == nil { - return OffsetRange{}, false - } - o, found := s.offsetRanges[id] - return o, found -} - -// SetOffsetRange sets the OffsetRange for the given expression id. -func (s *SourceInfo) SetOffsetRange(id int64, o OffsetRange) { - if s == nil { - return - } - s.offsetRanges[id] = o -} - -// ClearOffsetRange removes the OffsetRange for the given expression id. -func (s *SourceInfo) ClearOffsetRange(id int64) { - if s != nil { - delete(s.offsetRanges, id) - } -} - -// GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character -// of the expression node at the id. -func (s *SourceInfo) GetStartLocation(id int64) common.Location { - if o, found := s.GetOffsetRange(id); found { - return s.GetLocationByOffset(o.Start) - } - return common.NoLocation -} - -// GetStopLocation calculates the human-readable 1-based line and 0-based column of the last character for -// the expression node at the given id. -// -// If the SourceInfo was generated from a serialized protobuf representation, the stop location will -// be identical to the start location for the expression. -func (s *SourceInfo) GetStopLocation(id int64) common.Location { - if o, found := s.GetOffsetRange(id); found { - return s.GetLocationByOffset(o.Stop) - } - return common.NoLocation -} - -// GetLocationByOffset returns the line and column information for a given character offset. -func (s *SourceInfo) GetLocationByOffset(offset int32) common.Location { - line := 1 - col := int(offset) - for _, lineOffset := range s.LineOffsets() { - if lineOffset > offset { - break - } - line++ - col = int(offset - lineOffset) - } - return common.NewLocation(line, col) -} - -// ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column. -func (s *SourceInfo) ComputeOffset(line, col int32) int32 { - if s != nil { - line = s.baseLine + line - col = s.baseCol + col - } - if line == 1 { - return col - } - if line < 1 || line > int32(len(s.LineOffsets())) { - return -1 - } - offset := s.LineOffsets()[line-2] - return offset + col -} - -// OffsetRange captures the start and stop positions of a section of text in the input expression. -type OffsetRange struct { - Start int32 - Stop int32 -} - -// ReferenceInfo contains a CEL native representation of an identifier reference which may refer to -// either a qualified identifier name, a set of overload ids, or a constant value from an enum. -type ReferenceInfo struct { - Name string - OverloadIDs []string - Value ref.Val -} - -// NewIdentReference creates a ReferenceInfo instance for an identifier with an optional constant value. -func NewIdentReference(name string, value ref.Val) *ReferenceInfo { - return &ReferenceInfo{Name: name, Value: value} -} - -// NewFunctionReference creates a ReferenceInfo instance for a set of function overloads. -func NewFunctionReference(overloads ...string) *ReferenceInfo { - info := &ReferenceInfo{} - for _, id := range overloads { - info.AddOverload(id) - } - return info -} - -// AddOverload appends a function overload ID to the ReferenceInfo. -func (r *ReferenceInfo) AddOverload(overloadID string) { - for _, id := range r.OverloadIDs { - if id == overloadID { - return - } - } - r.OverloadIDs = append(r.OverloadIDs, overloadID) -} - -// Equals returns whether two references are identical to each other. -func (r *ReferenceInfo) Equals(other *ReferenceInfo) bool { - if r.Name != other.Name { - return false - } - if len(r.OverloadIDs) != len(other.OverloadIDs) { - return false - } - if len(r.OverloadIDs) != 0 { - overloadMap := make(map[string]struct{}, len(r.OverloadIDs)) - for _, id := range r.OverloadIDs { - overloadMap[id] = struct{}{} - } - for _, id := range other.OverloadIDs { - _, found := overloadMap[id] - if !found { - return false - } - } - } - if r.Value == nil && other.Value == nil { - return true - } - if r.Value == nil && other.Value != nil || - r.Value != nil && other.Value == nil || - r.Value.Equal(other.Value) != types.True { - return false - } - return true -} - -type maxIDVisitor struct { - maxID int64 - *baseVisitor -} - -// VisitExpr updates the max identifier if the incoming expression id is greater than previously observed. -func (v *maxIDVisitor) VisitExpr(e Expr) { - if v.maxID < e.ID() { - v.maxID = e.ID() - } -} - -// VisitEntryExpr updates the max identifier if the incoming entry id is greater than previously observed. -func (v *maxIDVisitor) VisitEntryExpr(e EntryExpr) { - if v.maxID < e.ID() { - v.maxID = e.ID() - } -} - -type heightVisitor map[int64]int - -// VisitExpr computes the height of a given node as the max height of its children plus one. -// -// Identifiers and literals are treated as having a height of zero. -func (hv heightVisitor) VisitExpr(e Expr) { - // default includes IdentKind, LiteralKind - hv[e.ID()] = 0 - switch e.Kind() { - case SelectKind: - hv[e.ID()] = 1 + hv[e.AsSelect().Operand().ID()] - case CallKind: - c := e.AsCall() - height := hv.maxHeight(c.Args()...) - if c.IsMemberFunction() { - tHeight := hv[c.Target().ID()] - if tHeight > height { - height = tHeight - } - } - hv[e.ID()] = 1 + height - case ListKind: - l := e.AsList() - hv[e.ID()] = 1 + hv.maxHeight(l.Elements()...) - case MapKind: - m := e.AsMap() - hv[e.ID()] = 1 + hv.maxEntryHeight(m.Entries()...) - case StructKind: - s := e.AsStruct() - hv[e.ID()] = 1 + hv.maxEntryHeight(s.Fields()...) - case ComprehensionKind: - comp := e.AsComprehension() - hv[e.ID()] = 1 + hv.maxHeight(comp.IterRange(), comp.AccuInit(), comp.LoopCondition(), comp.LoopStep(), comp.Result()) - } -} - -// VisitEntryExpr computes the max height of a map or struct entry and associates the height with the entry id. -func (hv heightVisitor) VisitEntryExpr(e EntryExpr) { - hv[e.ID()] = 0 - switch e.Kind() { - case MapEntryKind: - me := e.AsMapEntry() - hv[e.ID()] = hv.maxHeight(me.Value(), me.Key()) - case StructFieldKind: - sf := e.AsStructField() - hv[e.ID()] = hv[sf.Value().ID()] - } -} - -func (hv heightVisitor) maxHeight(exprs ...Expr) int { - max := 0 - for _, e := range exprs { - h := hv[e.ID()] - if h > max { - max = h - } - } - return max -} - -func (hv heightVisitor) maxEntryHeight(entries ...EntryExpr) int { - max := 0 - for _, e := range entries { - h := hv[e.ID()] - if h > max { - max = h - } - } - return max -} diff --git a/vendor/github.com/google/cel-go/common/ast/conversion.go b/vendor/github.com/google/cel-go/common/ast/conversion.go deleted file mode 100644 index 435d8f654..000000000 --- a/vendor/github.com/google/cel-go/common/ast/conversion.go +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "fmt" - - "google.golang.org/protobuf/proto" - - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - celpb "cel.dev/expr" - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// ToProto converts an AST to a CheckedExpr protobouf. -func ToProto(ast *AST) (*exprpb.CheckedExpr, error) { - refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap())) - for id, ref := range ast.ReferenceMap() { - r, err := ReferenceInfoToProto(ref) - if err != nil { - return nil, err - } - refMap[id] = r - } - typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap())) - for id, typ := range ast.TypeMap() { - t, err := types.TypeToExprType(typ) - if err != nil { - return nil, err - } - typeMap[id] = t - } - e, err := ExprToProto(ast.Expr()) - if err != nil { - return nil, err - } - info, err := SourceInfoToProto(ast.SourceInfo()) - if err != nil { - return nil, err - } - return &exprpb.CheckedExpr{ - Expr: e, - SourceInfo: info, - ReferenceMap: refMap, - TypeMap: typeMap, - }, nil -} - -// ToAST converts a CheckedExpr protobuf to an AST instance. -func ToAST(checked *exprpb.CheckedExpr) (*AST, error) { - refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap())) - for id, ref := range checked.GetReferenceMap() { - r, err := ProtoToReferenceInfo(ref) - if err != nil { - return nil, err - } - refMap[id] = r - } - typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap())) - for id, typ := range checked.GetTypeMap() { - t, err := types.ExprTypeToType(typ) - if err != nil { - return nil, err - } - typeMap[id] = t - } - info, err := ProtoToSourceInfo(checked.GetSourceInfo()) - if err != nil { - return nil, err - } - root, err := ProtoToExpr(checked.GetExpr()) - if err != nil { - return nil, err - } - ast := NewCheckedAST(NewAST(root, info), typeMap, refMap) - return ast, nil -} - -// ProtoToExpr converts a protobuf Expr value to an ast.Expr value. -func ProtoToExpr(e *exprpb.Expr) (Expr, error) { - factory := NewExprFactory() - return exprInternal(factory, e) -} - -// ProtoToEntryExpr converts a protobuf struct/map entry to an ast.EntryExpr -func ProtoToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) { - factory := NewExprFactory() - switch e.GetKeyKind().(type) { - case *exprpb.Expr_CreateStruct_Entry_FieldKey: - return exprStructField(factory, e.GetId(), e) - case *exprpb.Expr_CreateStruct_Entry_MapKey: - return exprMapEntry(factory, e.GetId(), e) - } - return nil, fmt.Errorf("unsupported expr entry kind: %v", e) -} - -func exprInternal(factory ExprFactory, e *exprpb.Expr) (Expr, error) { - id := e.GetId() - switch e.GetExprKind().(type) { - case *exprpb.Expr_CallExpr: - return exprCall(factory, id, e.GetCallExpr()) - case *exprpb.Expr_ComprehensionExpr: - return exprComprehension(factory, id, e.GetComprehensionExpr()) - case *exprpb.Expr_ConstExpr: - return exprLiteral(factory, id, e.GetConstExpr()) - case *exprpb.Expr_IdentExpr: - return exprIdent(factory, id, e.GetIdentExpr()) - case *exprpb.Expr_ListExpr: - return exprList(factory, id, e.GetListExpr()) - case *exprpb.Expr_SelectExpr: - return exprSelect(factory, id, e.GetSelectExpr()) - case *exprpb.Expr_StructExpr: - s := e.GetStructExpr() - if s.GetMessageName() != "" { - return exprStruct(factory, id, s) - } - return exprMap(factory, id, s) - } - return factory.NewUnspecifiedExpr(id), nil -} - -func exprCall(factory ExprFactory, id int64, call *exprpb.Expr_Call) (Expr, error) { - var err error - args := make([]Expr, len(call.GetArgs())) - for i, a := range call.GetArgs() { - args[i], err = exprInternal(factory, a) - if err != nil { - return nil, err - } - } - if call.GetTarget() == nil { - return factory.NewCall(id, call.GetFunction(), args...), nil - } - - target, err := exprInternal(factory, call.GetTarget()) - if err != nil { - return nil, err - } - return factory.NewMemberCall(id, call.GetFunction(), target, args...), nil -} - -func exprComprehension(factory ExprFactory, id int64, comp *exprpb.Expr_Comprehension) (Expr, error) { - iterRange, err := exprInternal(factory, comp.GetIterRange()) - if err != nil { - return nil, err - } - accuInit, err := exprInternal(factory, comp.GetAccuInit()) - if err != nil { - return nil, err - } - loopCond, err := exprInternal(factory, comp.GetLoopCondition()) - if err != nil { - return nil, err - } - loopStep, err := exprInternal(factory, comp.GetLoopStep()) - if err != nil { - return nil, err - } - result, err := exprInternal(factory, comp.GetResult()) - if err != nil { - return nil, err - } - return factory.NewComprehensionTwoVar(id, - iterRange, - comp.GetIterVar(), - comp.GetIterVar2(), - comp.GetAccuVar(), - accuInit, - loopCond, - loopStep, - result), nil -} - -func exprLiteral(factory ExprFactory, id int64, c *exprpb.Constant) (Expr, error) { - val, err := ConstantToVal(c) - if err != nil { - return nil, err - } - return factory.NewLiteral(id, val), nil -} - -func exprIdent(factory ExprFactory, id int64, i *exprpb.Expr_Ident) (Expr, error) { - return factory.NewIdent(id, i.GetName()), nil -} - -func exprList(factory ExprFactory, id int64, l *exprpb.Expr_CreateList) (Expr, error) { - elems := make([]Expr, len(l.GetElements())) - for i, e := range l.GetElements() { - elem, err := exprInternal(factory, e) - if err != nil { - return nil, err - } - elems[i] = elem - } - return factory.NewList(id, elems, l.GetOptionalIndices()), nil -} - -func exprMap(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) { - entries := make([]EntryExpr, len(s.GetEntries())) - var err error - for i, entry := range s.GetEntries() { - entries[i], err = exprMapEntry(factory, entry.GetId(), entry) - if err != nil { - return nil, err - } - } - return factory.NewMap(id, entries), nil -} - -func exprMapEntry(factory ExprFactory, id int64, e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) { - k, err := exprInternal(factory, e.GetMapKey()) - if err != nil { - return nil, err - } - v, err := exprInternal(factory, e.GetValue()) - if err != nil { - return nil, err - } - return factory.NewMapEntry(id, k, v, e.GetOptionalEntry()), nil -} - -func exprSelect(factory ExprFactory, id int64, s *exprpb.Expr_Select) (Expr, error) { - op, err := exprInternal(factory, s.GetOperand()) - if err != nil { - return nil, err - } - if s.GetTestOnly() { - return factory.NewPresenceTest(id, op, s.GetField()), nil - } - return factory.NewSelect(id, op, s.GetField()), nil -} - -func exprStruct(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) { - fields := make([]EntryExpr, len(s.GetEntries())) - var err error - for i, field := range s.GetEntries() { - fields[i], err = exprStructField(factory, field.GetId(), field) - if err != nil { - return nil, err - } - } - return factory.NewStruct(id, s.GetMessageName(), fields), nil -} - -func exprStructField(factory ExprFactory, id int64, f *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) { - v, err := exprInternal(factory, f.GetValue()) - if err != nil { - return nil, err - } - return factory.NewStructField(id, f.GetFieldKey(), v, f.GetOptionalEntry()), nil -} - -// ExprToProto serializes an ast.Expr value to a protobuf Expr representation. -func ExprToProto(e Expr) (*exprpb.Expr, error) { - if e == nil { - return &exprpb.Expr{}, nil - } - switch e.Kind() { - case CallKind: - return protoCall(e.ID(), e.AsCall()) - case ComprehensionKind: - return protoComprehension(e.ID(), e.AsComprehension()) - case IdentKind: - return protoIdent(e.ID(), e.AsIdent()) - case ListKind: - return protoList(e.ID(), e.AsList()) - case LiteralKind: - return protoLiteral(e.ID(), e.AsLiteral()) - case MapKind: - return protoMap(e.ID(), e.AsMap()) - case SelectKind: - return protoSelect(e.ID(), e.AsSelect()) - case StructKind: - return protoStruct(e.ID(), e.AsStruct()) - case UnspecifiedExprKind: - // Handle the case where a macro reference may be getting translated. - // A nested macro 'pointer' is a non-zero expression id with no kind set. - if e.ID() != 0 { - return &exprpb.Expr{Id: e.ID()}, nil - } - return &exprpb.Expr{}, nil - } - return nil, fmt.Errorf("unsupported expr kind: %v", e) -} - -// EntryExprToProto converts an ast.EntryExpr to a protobuf CreateStruct entry -func EntryExprToProto(e EntryExpr) (*exprpb.Expr_CreateStruct_Entry, error) { - switch e.Kind() { - case MapEntryKind: - return protoMapEntry(e.ID(), e.AsMapEntry()) - case StructFieldKind: - return protoStructField(e.ID(), e.AsStructField()) - case UnspecifiedEntryExprKind: - return &exprpb.Expr_CreateStruct_Entry{}, nil - } - return nil, fmt.Errorf("unsupported expr entry kind: %v", e) -} - -func protoCall(id int64, call CallExpr) (*exprpb.Expr, error) { - var err error - var target *exprpb.Expr - if call.IsMemberFunction() { - target, err = ExprToProto(call.Target()) - if err != nil { - return nil, err - } - } - callArgs := call.Args() - args := make([]*exprpb.Expr, len(callArgs)) - for i, a := range callArgs { - args[i], err = ExprToProto(a) - if err != nil { - return nil, err - } - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_CallExpr{ - CallExpr: &exprpb.Expr_Call{ - Function: call.FunctionName(), - Target: target, - Args: args, - }, - }, - }, nil -} - -func protoComprehension(id int64, comp ComprehensionExpr) (*exprpb.Expr, error) { - iterRange, err := ExprToProto(comp.IterRange()) - if err != nil { - return nil, err - } - accuInit, err := ExprToProto(comp.AccuInit()) - if err != nil { - return nil, err - } - loopCond, err := ExprToProto(comp.LoopCondition()) - if err != nil { - return nil, err - } - loopStep, err := ExprToProto(comp.LoopStep()) - if err != nil { - return nil, err - } - result, err := ExprToProto(comp.Result()) - if err != nil { - return nil, err - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_ComprehensionExpr{ - ComprehensionExpr: &exprpb.Expr_Comprehension{ - IterVar: comp.IterVar(), - IterVar2: comp.IterVar2(), - IterRange: iterRange, - AccuVar: comp.AccuVar(), - AccuInit: accuInit, - LoopCondition: loopCond, - LoopStep: loopStep, - Result: result, - }, - }, - }, nil -} - -func protoIdent(id int64, name string) (*exprpb.Expr, error) { - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_IdentExpr{ - IdentExpr: &exprpb.Expr_Ident{ - Name: name, - }, - }, - }, nil -} - -func protoList(id int64, list ListExpr) (*exprpb.Expr, error) { - var err error - elems := make([]*exprpb.Expr, list.Size()) - for i, e := range list.Elements() { - elems[i], err = ExprToProto(e) - if err != nil { - return nil, err - } - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_ListExpr{ - ListExpr: &exprpb.Expr_CreateList{ - Elements: elems, - OptionalIndices: list.OptionalIndices(), - }, - }, - }, nil -} - -func protoLiteral(id int64, val ref.Val) (*exprpb.Expr, error) { - c, err := ValToConstant(val) - if err != nil { - return nil, err - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_ConstExpr{ - ConstExpr: c, - }, - }, nil -} - -func protoMap(id int64, m MapExpr) (*exprpb.Expr, error) { - entries := make([]*exprpb.Expr_CreateStruct_Entry, len(m.Entries())) - var err error - for i, e := range m.Entries() { - entries[i], err = EntryExprToProto(e) - if err != nil { - return nil, err - } - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_StructExpr{ - StructExpr: &exprpb.Expr_CreateStruct{ - Entries: entries, - }, - }, - }, nil -} - -func protoMapEntry(id int64, e MapEntry) (*exprpb.Expr_CreateStruct_Entry, error) { - k, err := ExprToProto(e.Key()) - if err != nil { - return nil, err - } - v, err := ExprToProto(e.Value()) - if err != nil { - return nil, err - } - return &exprpb.Expr_CreateStruct_Entry{ - Id: id, - KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{ - MapKey: k, - }, - Value: v, - OptionalEntry: e.IsOptional(), - }, nil -} - -func protoSelect(id int64, s SelectExpr) (*exprpb.Expr, error) { - op, err := ExprToProto(s.Operand()) - if err != nil { - return nil, err - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_SelectExpr{ - SelectExpr: &exprpb.Expr_Select{ - Operand: op, - Field: s.FieldName(), - TestOnly: s.IsTestOnly(), - }, - }, - }, nil -} - -func protoStruct(id int64, s StructExpr) (*exprpb.Expr, error) { - entries := make([]*exprpb.Expr_CreateStruct_Entry, len(s.Fields())) - var err error - for i, e := range s.Fields() { - entries[i], err = EntryExprToProto(e) - if err != nil { - return nil, err - } - } - return &exprpb.Expr{ - Id: id, - ExprKind: &exprpb.Expr_StructExpr{ - StructExpr: &exprpb.Expr_CreateStruct{ - MessageName: s.TypeName(), - Entries: entries, - }, - }, - }, nil -} - -func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) { - v, err := ExprToProto(f.Value()) - if err != nil { - return nil, err - } - return &exprpb.Expr_CreateStruct_Entry{ - Id: id, - KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{ - FieldKey: f.Name(), - }, - Value: v, - OptionalEntry: f.IsOptional(), - }, nil -} - -// SourceInfoToProto serializes an ast.SourceInfo value to a protobuf SourceInfo object. -func SourceInfoToProto(info *SourceInfo) (*exprpb.SourceInfo, error) { - if info == nil { - return &exprpb.SourceInfo{}, nil - } - sourceInfo := &exprpb.SourceInfo{ - SyntaxVersion: info.SyntaxVersion(), - Location: info.Description(), - LineOffsets: info.LineOffsets(), - Positions: make(map[int64]int32, len(info.OffsetRanges())), - MacroCalls: make(map[int64]*exprpb.Expr, len(info.MacroCalls())), - } - for id, offset := range info.OffsetRanges() { - sourceInfo.Positions[id] = offset.Start - } - for id, e := range info.MacroCalls() { - call, err := ExprToProto(e) - if err != nil { - return nil, err - } - sourceInfo.MacroCalls[id] = call - } - return sourceInfo, nil -} - -// ProtoToSourceInfo deserializes the protobuf into a native SourceInfo value. -func ProtoToSourceInfo(info *exprpb.SourceInfo) (*SourceInfo, error) { - sourceInfo := &SourceInfo{ - syntax: info.GetSyntaxVersion(), - desc: info.GetLocation(), - lines: info.GetLineOffsets(), - offsetRanges: make(map[int64]OffsetRange, len(info.GetPositions())), - macroCalls: make(map[int64]Expr, len(info.GetMacroCalls())), - } - for id, offset := range info.GetPositions() { - sourceInfo.SetOffsetRange(id, OffsetRange{Start: offset, Stop: offset}) - } - for id, e := range info.GetMacroCalls() { - call, err := ProtoToExpr(e) - if err != nil { - return nil, err - } - sourceInfo.SetMacroCall(id, call) - } - return sourceInfo, nil -} - -// ReferenceInfoToProto converts a ReferenceInfo instance to a protobuf Reference suitable for serialization. -func ReferenceInfoToProto(info *ReferenceInfo) (*exprpb.Reference, error) { - c, err := ValToConstant(info.Value) - if err != nil { - return nil, err - } - return &exprpb.Reference{ - Name: info.Name, - OverloadId: info.OverloadIDs, - Value: c, - }, nil -} - -// ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance. -func ProtoToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) { - v, err := ConstantToVal(ref.GetValue()) - if err != nil { - return nil, err - } - return &ReferenceInfo{ - Name: ref.GetName(), - OverloadIDs: ref.GetOverloadId(), - Value: v, - }, nil -} - -// ValToConstant converts a CEL-native ref.Val to a protobuf Constant. -// -// Only simple scalar types are supported by this method. -func ValToConstant(v ref.Val) (*exprpb.Constant, error) { - if v == nil { - return nil, nil - } - switch v.Type() { - case types.BoolType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil - case types.BytesType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil - case types.DoubleType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil - case types.IntType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil - case types.NullType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil - case types.StringType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil - case types.UintType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil - } - return nil, fmt.Errorf("unsupported constant kind: %v", v.Type()) -} - -// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val. -func ConstantToVal(c *exprpb.Constant) (ref.Val, error) { - return AlphaProtoConstantAsVal(c) -} - -// AlphaProtoConstantAsVal converts a v1alpha1.Constant protobuf to a CEL-native ref.Val. -func AlphaProtoConstantAsVal(c *exprpb.Constant) (ref.Val, error) { - if c == nil { - return nil, nil - } - canonical := &celpb.Constant{} - if err := convertProto(c, canonical); err != nil { - return nil, err - } - return ProtoConstantAsVal(canonical) -} - -// ProtoConstantAsVal converts a canonical celpb.Constant protobuf to a CEL-native ref.Val. -func ProtoConstantAsVal(c *celpb.Constant) (ref.Val, error) { - switch c.GetConstantKind().(type) { - case *celpb.Constant_BoolValue: - return types.Bool(c.GetBoolValue()), nil - case *celpb.Constant_BytesValue: - return types.Bytes(c.GetBytesValue()), nil - case *celpb.Constant_DoubleValue: - return types.Double(c.GetDoubleValue()), nil - case *celpb.Constant_Int64Value: - return types.Int(c.GetInt64Value()), nil - case *celpb.Constant_NullValue: - return types.NullValue, nil - case *celpb.Constant_StringValue: - return types.String(c.GetStringValue()), nil - case *celpb.Constant_Uint64Value: - return types.Uint(c.GetUint64Value()), nil - } - return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind()) -} - -func convertProto(src, dst proto.Message) error { - pb, err := proto.Marshal(src) - if err != nil { - return err - } - err = proto.Unmarshal(pb, dst) - return err -} diff --git a/vendor/github.com/google/cel-go/common/ast/expr.go b/vendor/github.com/google/cel-go/common/ast/expr.go deleted file mode 100644 index 9f55cb3b9..000000000 --- a/vendor/github.com/google/cel-go/common/ast/expr.go +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// ExprKind represents the expression node kind. -type ExprKind int - -const ( - // UnspecifiedExprKind represents an unset expression with no specified properties. - UnspecifiedExprKind ExprKind = iota - - // CallKind represents a function call. - CallKind - - // ComprehensionKind represents a comprehension expression generated by a macro. - ComprehensionKind - - // IdentKind represents a simple variable, constant, or type identifier. - IdentKind - - // ListKind represents a list literal expression. - ListKind - - // LiteralKind represents a primitive scalar literal. - LiteralKind - - // MapKind represents a map literal expression. - MapKind - - // SelectKind represents a field selection expression. - SelectKind - - // StructKind represents a struct literal expression. - StructKind -) - -// Expr represents the base expression node in a CEL abstract syntax tree. -// -// Depending on the `Kind()` value, the Expr may be converted to a concrete expression types -// as indicated by the `As` methods. -type Expr interface { - // ID of the expression as it appears in the AST - ID() int64 - - // Kind of the expression node. See ExprKind for the valid enum values. - Kind() ExprKind - - // AsCall adapts the expr into a CallExpr - // - // The Kind() must be equal to a CallKind for the conversion to be well-defined. - AsCall() CallExpr - - // AsComprehension adapts the expr into a ComprehensionExpr. - // - // The Kind() must be equal to a ComprehensionKind for the conversion to be well-defined. - AsComprehension() ComprehensionExpr - - // AsIdent adapts the expr into an identifier string. - // - // The Kind() must be equal to an IdentKind for the conversion to be well-defined. - AsIdent() string - - // AsLiteral adapts the expr into a constant ref.Val. - // - // The Kind() must be equal to a LiteralKind for the conversion to be well-defined. - AsLiteral() ref.Val - - // AsList adapts the expr into a ListExpr. - // - // The Kind() must be equal to a ListKind for the conversion to be well-defined. - AsList() ListExpr - - // AsMap adapts the expr into a MapExpr. - // - // The Kind() must be equal to a MapKind for the conversion to be well-defined. - AsMap() MapExpr - - // AsSelect adapts the expr into a SelectExpr. - // - // The Kind() must be equal to a SelectKind for the conversion to be well-defined. - AsSelect() SelectExpr - - // AsStruct adapts the expr into a StructExpr. - // - // The Kind() must be equal to a StructKind for the conversion to be well-defined. - AsStruct() StructExpr - - // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids. - RenumberIDs(IDGenerator) - - // SetKindCase replaces the contents of the current expression with the contents of the other. - // - // The SetKindCase takes ownership of any expression instances references within the input Expr. - // A shallow copy is made of the Expr value itself, but not a deep one. - // - // This method should only be used during AST rewrites using temporary Expr values. - SetKindCase(Expr) - - // isExpr is a marker interface. - isExpr() -} - -// EntryExprKind represents the possible EntryExpr kinds. -type EntryExprKind int - -const ( - // UnspecifiedEntryExprKind indicates that the entry expr is not set. - UnspecifiedEntryExprKind EntryExprKind = iota - - // MapEntryKind indicates that the entry is a MapEntry type with key and value expressions. - MapEntryKind - - // StructFieldKind indicates that the entry is a StructField with a field name and initializer - // expression. - StructFieldKind -) - -// EntryExpr represents the base entry expression in a CEL map or struct literal. -type EntryExpr interface { - // ID of the entry as it appears in the AST. - ID() int64 - - // Kind of the entry expression node. See EntryExprKind for valid enum values. - Kind() EntryExprKind - - // AsMapEntry casts the EntryExpr to a MapEntry. - // - // The Kind() must be equal to MapEntryKind for the conversion to be well-defined. - AsMapEntry() MapEntry - - // AsStructField casts the EntryExpr to a StructField - // - // The Kind() must be equal to StructFieldKind for the conversion to be well-defined. - AsStructField() StructField - - // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids. - RenumberIDs(IDGenerator) - - isEntryExpr() -} - -// IDGenerator produces unique ids suitable for tagging expression nodes -type IDGenerator func(originalID int64) int64 - -// CallExpr defines an interface for inspecting a function call and its arguments. -type CallExpr interface { - // FunctionName returns the name of the function. - FunctionName() string - - // IsMemberFunction returns whether the call has a non-nil target indicating it is a member function - IsMemberFunction() bool - - // Target returns the target of the expression if one is present. - Target() Expr - - // Args returns the list of call arguments, excluding the target. - Args() []Expr - - // marker interface method - isExpr() -} - -// ListExpr defines an interface for inspecting a list literal expression. -type ListExpr interface { - // Elements returns the list elements as navigable expressions. - Elements() []Expr - - // OptionalIndicies returns the list of optional indices in the list literal. - OptionalIndices() []int32 - - // IsOptional indicates whether the given element index is optional. - IsOptional(int32) bool - - // Size returns the number of elements in the list. - Size() int - - // marker interface method - isExpr() -} - -// SelectExpr defines an interface for inspecting a select expression. -type SelectExpr interface { - // Operand returns the selection operand expression. - Operand() Expr - - // FieldName returns the field name being selected from the operand. - FieldName() string - - // IsTestOnly indicates whether the select expression is a presence test generated by a macro. - IsTestOnly() bool - - // marker interface method - isExpr() -} - -// MapExpr defines an interface for inspecting a map expression. -type MapExpr interface { - // Entries returns the map key value pairs as EntryExpr values. - Entries() []EntryExpr - - // Size returns the number of entries in the map. - Size() int - - // marker interface method - isExpr() -} - -// MapEntry defines an interface for inspecting a map entry. -type MapEntry interface { - // Key returns the map entry key expression. - Key() Expr - - // Value returns the map entry value expression. - Value() Expr - - // IsOptional returns whether the entry is optional. - IsOptional() bool - - // marker interface method - isEntryExpr() -} - -// StructExpr defines an interfaces for inspecting a struct and its field initializers. -type StructExpr interface { - // TypeName returns the struct type name. - TypeName() string - - // Fields returns the set of field initializers in the struct expression as EntryExpr values. - Fields() []EntryExpr - - // marker interface method - isExpr() -} - -// StructField defines an interface for inspecting a struct field initialization. -type StructField interface { - // Name returns the name of the field. - Name() string - - // Value returns the field initialization expression. - Value() Expr - - // IsOptional returns whether the field is optional. - IsOptional() bool - - // marker interface method - isEntryExpr() -} - -// ComprehensionExpr defines an interface for inspecting a comprehension expression. -type ComprehensionExpr interface { - // IterRange returns the iteration range expression. - IterRange() Expr - - // IterVar returns the iteration variable name. - // - // For one-variable comprehensions, the iter var refers to the element value - // when iterating over a list, or the map key when iterating over a map. - // - // For two-variable comprehneions, the iter var refers to the list index or the - // map key. - IterVar() string - - // IterVar2 returns the second iteration variable name. - // - // When the value is non-empty, the comprehension is a two-variable comprehension. - IterVar2() string - - // HasIterVar2 returns true if the second iteration variable is non-empty. - HasIterVar2() bool - - // AccuVar returns the accumulation variable name. - AccuVar() string - - // AccuInit returns the accumulation variable initialization expression. - AccuInit() Expr - - // LoopCondition returns the loop condition expression. - LoopCondition() Expr - - // LoopStep returns the loop step expression. - LoopStep() Expr - - // Result returns the comprehension result expression. - Result() Expr - - // marker interface method - isExpr() -} - -var _ Expr = &expr{} - -type expr struct { - id int64 - exprKindCase -} - -type exprKindCase interface { - Kind() ExprKind - - renumberIDs(IDGenerator) - - isExpr() -} - -func (e *expr) ID() int64 { - if e == nil { - return 0 - } - return e.id -} - -func (e *expr) Kind() ExprKind { - if e == nil || e.exprKindCase == nil { - return UnspecifiedExprKind - } - return e.exprKindCase.Kind() -} - -func (e *expr) AsCall() CallExpr { - if e.Kind() != CallKind { - return nilCall - } - return e.exprKindCase.(CallExpr) -} - -func (e *expr) AsComprehension() ComprehensionExpr { - if e.Kind() != ComprehensionKind { - return nilCompre - } - return e.exprKindCase.(ComprehensionExpr) -} - -func (e *expr) AsIdent() string { - if e.Kind() != IdentKind { - return "" - } - return string(e.exprKindCase.(baseIdentExpr)) -} - -func (e *expr) AsLiteral() ref.Val { - if e.Kind() != LiteralKind { - return nil - } - return e.exprKindCase.(*baseLiteral).Val -} - -func (e *expr) AsList() ListExpr { - if e.Kind() != ListKind { - return nilList - } - return e.exprKindCase.(ListExpr) -} - -func (e *expr) AsMap() MapExpr { - if e.Kind() != MapKind { - return nilMap - } - return e.exprKindCase.(MapExpr) -} - -func (e *expr) AsSelect() SelectExpr { - if e.Kind() != SelectKind { - return nilSel - } - return e.exprKindCase.(SelectExpr) -} - -func (e *expr) AsStruct() StructExpr { - if e.Kind() != StructKind { - return nilStruct - } - return e.exprKindCase.(StructExpr) -} - -func (e *expr) SetKindCase(other Expr) { - if e == nil { - return - } - if other == nil { - e.exprKindCase = nil - return - } - switch other.Kind() { - case CallKind: - c := other.AsCall() - e.exprKindCase = &baseCallExpr{ - function: c.FunctionName(), - target: c.Target(), - args: c.Args(), - isMember: c.IsMemberFunction(), - } - case ComprehensionKind: - c := other.AsComprehension() - e.exprKindCase = &baseComprehensionExpr{ - iterRange: c.IterRange(), - iterVar: c.IterVar(), - iterVar2: c.IterVar2(), - accuVar: c.AccuVar(), - accuInit: c.AccuInit(), - loopCond: c.LoopCondition(), - loopStep: c.LoopStep(), - result: c.Result(), - } - case IdentKind: - e.exprKindCase = baseIdentExpr(other.AsIdent()) - case ListKind: - l := other.AsList() - optIndexMap := make(map[int32]struct{}, len(l.OptionalIndices())) - for _, idx := range l.OptionalIndices() { - optIndexMap[idx] = struct{}{} - } - e.exprKindCase = &baseListExpr{ - elements: l.Elements(), - optIndices: l.OptionalIndices(), - optIndexMap: optIndexMap, - } - case LiteralKind: - e.exprKindCase = &baseLiteral{Val: other.AsLiteral()} - case MapKind: - e.exprKindCase = &baseMapExpr{ - entries: other.AsMap().Entries(), - } - case SelectKind: - s := other.AsSelect() - e.exprKindCase = &baseSelectExpr{ - operand: s.Operand(), - field: s.FieldName(), - testOnly: s.IsTestOnly(), - } - case StructKind: - s := other.AsStruct() - e.exprKindCase = &baseStructExpr{ - typeName: s.TypeName(), - fields: s.Fields(), - } - case UnspecifiedExprKind: - e.exprKindCase = nil - } -} - -func (e *expr) RenumberIDs(idGen IDGenerator) { - if e == nil { - return - } - e.id = idGen(e.id) - if e.exprKindCase != nil { - e.exprKindCase.renumberIDs(idGen) - } -} - -type baseCallExpr struct { - function string - target Expr - args []Expr - isMember bool -} - -func (*baseCallExpr) Kind() ExprKind { - return CallKind -} - -func (e *baseCallExpr) FunctionName() string { - if e == nil { - return "" - } - return e.function -} - -func (e *baseCallExpr) IsMemberFunction() bool { - if e == nil { - return false - } - return e.isMember -} - -func (e *baseCallExpr) Target() Expr { - if e == nil || !e.IsMemberFunction() { - return nilExpr - } - return e.target -} - -func (e *baseCallExpr) Args() []Expr { - if e == nil { - return []Expr{} - } - return e.args -} - -func (e *baseCallExpr) renumberIDs(idGen IDGenerator) { - if e.IsMemberFunction() { - e.Target().RenumberIDs(idGen) - } - for _, arg := range e.Args() { - arg.RenumberIDs(idGen) - } -} - -func (*baseCallExpr) isExpr() {} - -var _ ComprehensionExpr = &baseComprehensionExpr{} - -type baseComprehensionExpr struct { - iterRange Expr - iterVar string - iterVar2 string - accuVar string - accuInit Expr - loopCond Expr - loopStep Expr - result Expr -} - -func (*baseComprehensionExpr) Kind() ExprKind { - return ComprehensionKind -} - -func (e *baseComprehensionExpr) IterRange() Expr { - if e == nil { - return nilExpr - } - return e.iterRange -} - -func (e *baseComprehensionExpr) IterVar() string { - return e.iterVar -} - -func (e *baseComprehensionExpr) IterVar2() string { - return e.iterVar2 -} - -func (e *baseComprehensionExpr) HasIterVar2() bool { - return e.iterVar2 != "" -} - -func (e *baseComprehensionExpr) AccuVar() string { - return e.accuVar -} - -func (e *baseComprehensionExpr) AccuInit() Expr { - if e == nil { - return nilExpr - } - return e.accuInit -} - -func (e *baseComprehensionExpr) LoopCondition() Expr { - if e == nil { - return nilExpr - } - return e.loopCond -} - -func (e *baseComprehensionExpr) LoopStep() Expr { - if e == nil { - return nilExpr - } - return e.loopStep -} - -func (e *baseComprehensionExpr) Result() Expr { - if e == nil { - return nilExpr - } - return e.result -} - -func (e *baseComprehensionExpr) renumberIDs(idGen IDGenerator) { - e.IterRange().RenumberIDs(idGen) - e.AccuInit().RenumberIDs(idGen) - e.LoopCondition().RenumberIDs(idGen) - e.LoopStep().RenumberIDs(idGen) - e.Result().RenumberIDs(idGen) -} - -func (*baseComprehensionExpr) isExpr() {} - -var _ exprKindCase = baseIdentExpr("") - -type baseIdentExpr string - -func (baseIdentExpr) Kind() ExprKind { - return IdentKind -} - -func (e baseIdentExpr) renumberIDs(IDGenerator) {} - -func (baseIdentExpr) isExpr() {} - -var _ exprKindCase = &baseLiteral{} -var _ ref.Val = &baseLiteral{} - -type baseLiteral struct { - ref.Val -} - -func (*baseLiteral) Kind() ExprKind { - return LiteralKind -} - -func (l *baseLiteral) renumberIDs(IDGenerator) {} - -func (*baseLiteral) isExpr() {} - -var _ ListExpr = &baseListExpr{} - -type baseListExpr struct { - elements []Expr - optIndices []int32 - optIndexMap map[int32]struct{} -} - -func (*baseListExpr) Kind() ExprKind { - return ListKind -} - -func (e *baseListExpr) Elements() []Expr { - if e == nil { - return []Expr{} - } - return e.elements -} - -func (e *baseListExpr) IsOptional(index int32) bool { - _, found := e.optIndexMap[index] - return found -} - -func (e *baseListExpr) OptionalIndices() []int32 { - if e == nil { - return []int32{} - } - return e.optIndices -} - -func (e *baseListExpr) Size() int { - return len(e.Elements()) -} - -func (e *baseListExpr) renumberIDs(idGen IDGenerator) { - for _, elem := range e.Elements() { - elem.RenumberIDs(idGen) - } -} - -func (*baseListExpr) isExpr() {} - -type baseMapExpr struct { - entries []EntryExpr -} - -func (*baseMapExpr) Kind() ExprKind { - return MapKind -} - -func (e *baseMapExpr) Entries() []EntryExpr { - if e == nil { - return []EntryExpr{} - } - return e.entries -} - -func (e *baseMapExpr) Size() int { - return len(e.Entries()) -} - -func (e *baseMapExpr) renumberIDs(idGen IDGenerator) { - for _, entry := range e.Entries() { - entry.RenumberIDs(idGen) - } -} - -func (*baseMapExpr) isExpr() {} - -type baseSelectExpr struct { - operand Expr - field string - testOnly bool -} - -func (*baseSelectExpr) Kind() ExprKind { - return SelectKind -} - -func (e *baseSelectExpr) Operand() Expr { - if e == nil || e.operand == nil { - return nilExpr - } - return e.operand -} - -func (e *baseSelectExpr) FieldName() string { - if e == nil { - return "" - } - return e.field -} - -func (e *baseSelectExpr) IsTestOnly() bool { - if e == nil { - return false - } - return e.testOnly -} - -func (e *baseSelectExpr) renumberIDs(idGen IDGenerator) { - e.Operand().RenumberIDs(idGen) -} - -func (*baseSelectExpr) isExpr() {} - -type baseStructExpr struct { - typeName string - fields []EntryExpr -} - -func (*baseStructExpr) Kind() ExprKind { - return StructKind -} - -func (e *baseStructExpr) TypeName() string { - if e == nil { - return "" - } - return e.typeName -} - -func (e *baseStructExpr) Fields() []EntryExpr { - if e == nil { - return []EntryExpr{} - } - return e.fields -} - -func (e *baseStructExpr) renumberIDs(idGen IDGenerator) { - for _, f := range e.Fields() { - f.RenumberIDs(idGen) - } -} - -func (*baseStructExpr) isExpr() {} - -type entryExprKindCase interface { - Kind() EntryExprKind - - renumberIDs(IDGenerator) - - isEntryExpr() -} - -var _ EntryExpr = &entryExpr{} - -type entryExpr struct { - id int64 - entryExprKindCase -} - -func (e *entryExpr) ID() int64 { - return e.id -} - -func (e *entryExpr) AsMapEntry() MapEntry { - if e.Kind() != MapEntryKind { - return nilMapEntry - } - return e.entryExprKindCase.(MapEntry) -} - -func (e *entryExpr) AsStructField() StructField { - if e.Kind() != StructFieldKind { - return nilStructField - } - return e.entryExprKindCase.(StructField) -} - -func (e *entryExpr) RenumberIDs(idGen IDGenerator) { - e.id = idGen(e.id) - e.entryExprKindCase.renumberIDs(idGen) -} - -type baseMapEntry struct { - key Expr - value Expr - isOptional bool -} - -func (e *baseMapEntry) Kind() EntryExprKind { - return MapEntryKind -} - -func (e *baseMapEntry) Key() Expr { - if e == nil { - return nilExpr - } - return e.key -} - -func (e *baseMapEntry) Value() Expr { - if e == nil { - return nilExpr - } - return e.value -} - -func (e *baseMapEntry) IsOptional() bool { - if e == nil { - return false - } - return e.isOptional -} - -func (e *baseMapEntry) renumberIDs(idGen IDGenerator) { - e.Key().RenumberIDs(idGen) - e.Value().RenumberIDs(idGen) -} - -func (*baseMapEntry) isEntryExpr() {} - -type baseStructField struct { - field string - value Expr - isOptional bool -} - -func (f *baseStructField) Kind() EntryExprKind { - return StructFieldKind -} - -func (f *baseStructField) Name() string { - if f == nil { - return "" - } - return f.field -} - -func (f *baseStructField) Value() Expr { - if f == nil { - return nilExpr - } - return f.value -} - -func (f *baseStructField) IsOptional() bool { - if f == nil { - return false - } - return f.isOptional -} - -func (f *baseStructField) renumberIDs(idGen IDGenerator) { - f.Value().RenumberIDs(idGen) -} - -func (*baseStructField) isEntryExpr() {} - -var ( - nilExpr *expr = nil - nilCall *baseCallExpr = nil - nilCompre *baseComprehensionExpr = nil - nilList *baseListExpr = nil - nilMap *baseMapExpr = nil - nilMapEntry *baseMapEntry = nil - nilSel *baseSelectExpr = nil - nilStruct *baseStructExpr = nil - nilStructField *baseStructField = nil -) diff --git a/vendor/github.com/google/cel-go/common/ast/factory.go b/vendor/github.com/google/cel-go/common/ast/factory.go deleted file mode 100644 index d4dcde4d9..000000000 --- a/vendor/github.com/google/cel-go/common/ast/factory.go +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "github.com/google/cel-go/common/types/ref" - -// ExprFactory interfaces defines a set of methods necessary for building native expression values. -type ExprFactory interface { - // CopyExpr creates a deep copy of the input Expr value. - CopyExpr(Expr) Expr - - // CopyEntryExpr creates a deep copy of the input EntryExpr value. - CopyEntryExpr(EntryExpr) EntryExpr - - // NewCall creates an Expr value representing a global function call. - NewCall(id int64, function string, args ...Expr) Expr - - // NewComprehension creates an Expr value representing a one-variable comprehension over a value range. - NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCondition, loopStep, result Expr) Expr - - // NewComprehensionTwoVar creates an Expr value representing a two-variable comprehension over a value range. - NewComprehensionTwoVar(id int64, iterRange Expr, iterVar, iterVar2, accuVar string, accuInit, loopCondition, loopStep, result Expr) Expr - - // NewMemberCall creates an Expr value representing a member function call. - NewMemberCall(id int64, function string, receiver Expr, args ...Expr) Expr - - // NewIdent creates an Expr value representing an identifier. - NewIdent(id int64, name string) Expr - - // NewAccuIdent creates an Expr value representing an accumulator identifier within a - // comprehension. - NewAccuIdent(id int64) Expr - - // AccuIdentName reports the name of the accumulator variable to be used within a comprehension. - AccuIdentName() string - - // NewLiteral creates an Expr value representing a literal value, such as a string or integer. - NewLiteral(id int64, value ref.Val) Expr - - // NewList creates an Expr value representing a list literal expression with optional indices. - // - // Optional indices will typically be empty unless the CEL optional types are enabled. - NewList(id int64, elems []Expr, optIndices []int32) Expr - - // NewMap creates an Expr value representing a map literal expression - NewMap(id int64, entries []EntryExpr) Expr - - // NewMapEntry creates a MapEntry with a given key, value, and a flag indicating whether - // the key is optionally set. - NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr - - // NewPresenceTest creates an Expr representing a field presence test on an operand expression. - NewPresenceTest(id int64, operand Expr, field string) Expr - - // NewSelect creates an Expr representing a field selection on an operand expression. - NewSelect(id int64, operand Expr, field string) Expr - - // NewStruct creates an Expr value representing a struct literal with a given type name and a - // set of field initializers. - NewStruct(id int64, typeName string, fields []EntryExpr) Expr - - // NewStructField creates a StructField with a given field name, value, and a flag indicating - // whether the field is optionally set. - NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr - - // NewUnspecifiedExpr creates an empty expression node. - NewUnspecifiedExpr(id int64) Expr - - isExprFactory() -} - -type baseExprFactory struct { - accumulatorName string -} - -// NewExprFactory creates an ExprFactory instance. -func NewExprFactory() ExprFactory { - return &baseExprFactory{ - "@result", - } -} - -// NewExprFactoryWithAccumulator creates an ExprFactory instance with a custom -// accumulator identifier name. -func NewExprFactoryWithAccumulator(id string) ExprFactory { - return &baseExprFactory{ - id, - } -} - -func (fac *baseExprFactory) NewCall(id int64, function string, args ...Expr) Expr { - if len(args) == 0 { - args = []Expr{} - } - return fac.newExpr( - id, - &baseCallExpr{ - function: function, - target: nilExpr, - args: args, - isMember: false, - }) -} - -func (fac *baseExprFactory) NewMemberCall(id int64, function string, target Expr, args ...Expr) Expr { - if len(args) == 0 { - args = []Expr{} - } - return fac.newExpr( - id, - &baseCallExpr{ - function: function, - target: target, - args: args, - isMember: true, - }) -} - -func (fac *baseExprFactory) NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCond, loopStep, result Expr) Expr { - // Set the iter_var2 to empty string to indicate the second variable is omitted - return fac.NewComprehensionTwoVar(id, iterRange, iterVar, "", accuVar, accuInit, loopCond, loopStep, result) -} - -func (fac *baseExprFactory) NewComprehensionTwoVar(id int64, iterRange Expr, iterVar, iterVar2, accuVar string, accuInit, loopCond, loopStep, result Expr) Expr { - return fac.newExpr( - id, - &baseComprehensionExpr{ - iterRange: iterRange, - iterVar: iterVar, - iterVar2: iterVar2, - accuVar: accuVar, - accuInit: accuInit, - loopCond: loopCond, - loopStep: loopStep, - result: result, - }) -} - -func (fac *baseExprFactory) NewIdent(id int64, name string) Expr { - return fac.newExpr(id, baseIdentExpr(name)) -} - -func (fac *baseExprFactory) NewAccuIdent(id int64) Expr { - return fac.NewIdent(id, fac.AccuIdentName()) -} - -func (fac *baseExprFactory) AccuIdentName() string { - return fac.accumulatorName -} - -func (fac *baseExprFactory) NewLiteral(id int64, value ref.Val) Expr { - return fac.newExpr(id, &baseLiteral{Val: value}) -} - -func (fac *baseExprFactory) NewList(id int64, elems []Expr, optIndices []int32) Expr { - optIndexMap := make(map[int32]struct{}, len(optIndices)) - for _, idx := range optIndices { - optIndexMap[idx] = struct{}{} - } - return fac.newExpr(id, - &baseListExpr{ - elements: elems, - optIndices: optIndices, - optIndexMap: optIndexMap, - }) -} - -func (fac *baseExprFactory) NewMap(id int64, entries []EntryExpr) Expr { - return fac.newExpr(id, &baseMapExpr{entries: entries}) -} - -func (fac *baseExprFactory) NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr { - return fac.newEntryExpr( - id, - &baseMapEntry{ - key: key, - value: value, - isOptional: isOptional, - }) -} - -func (fac *baseExprFactory) NewPresenceTest(id int64, operand Expr, field string) Expr { - return fac.newExpr( - id, - &baseSelectExpr{ - operand: operand, - field: field, - testOnly: true, - }) -} - -func (fac *baseExprFactory) NewSelect(id int64, operand Expr, field string) Expr { - return fac.newExpr( - id, - &baseSelectExpr{ - operand: operand, - field: field, - }) -} - -func (fac *baseExprFactory) NewStruct(id int64, typeName string, fields []EntryExpr) Expr { - return fac.newExpr( - id, - &baseStructExpr{ - typeName: typeName, - fields: fields, - }) -} - -func (fac *baseExprFactory) NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr { - return fac.newEntryExpr( - id, - &baseStructField{ - field: field, - value: value, - isOptional: isOptional, - }) -} - -func (fac *baseExprFactory) NewUnspecifiedExpr(id int64) Expr { - return fac.newExpr(id, nil) -} - -func (fac *baseExprFactory) CopyExpr(e Expr) Expr { - // unwrap navigable expressions to avoid unnecessary allocations during copying. - if nav, ok := e.(*navigableExprImpl); ok { - e = nav.Expr - } - switch e.Kind() { - case CallKind: - c := e.AsCall() - argsCopy := make([]Expr, len(c.Args())) - for i, arg := range c.Args() { - argsCopy[i] = fac.CopyExpr(arg) - } - if !c.IsMemberFunction() { - return fac.NewCall(e.ID(), c.FunctionName(), argsCopy...) - } - return fac.NewMemberCall(e.ID(), c.FunctionName(), fac.CopyExpr(c.Target()), argsCopy...) - case ComprehensionKind: - compre := e.AsComprehension() - return fac.NewComprehensionTwoVar(e.ID(), - fac.CopyExpr(compre.IterRange()), - compre.IterVar(), - compre.IterVar2(), - compre.AccuVar(), - fac.CopyExpr(compre.AccuInit()), - fac.CopyExpr(compre.LoopCondition()), - fac.CopyExpr(compre.LoopStep()), - fac.CopyExpr(compre.Result())) - case IdentKind: - return fac.NewIdent(e.ID(), e.AsIdent()) - case ListKind: - l := e.AsList() - elemsCopy := make([]Expr, l.Size()) - for i, elem := range l.Elements() { - elemsCopy[i] = fac.CopyExpr(elem) - } - return fac.NewList(e.ID(), elemsCopy, l.OptionalIndices()) - case LiteralKind: - return fac.NewLiteral(e.ID(), e.AsLiteral()) - case MapKind: - m := e.AsMap() - entriesCopy := make([]EntryExpr, m.Size()) - for i, entry := range m.Entries() { - entriesCopy[i] = fac.CopyEntryExpr(entry) - } - return fac.NewMap(e.ID(), entriesCopy) - case SelectKind: - s := e.AsSelect() - if s.IsTestOnly() { - return fac.NewPresenceTest(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName()) - } - return fac.NewSelect(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName()) - case StructKind: - s := e.AsStruct() - fieldsCopy := make([]EntryExpr, len(s.Fields())) - for i, field := range s.Fields() { - fieldsCopy[i] = fac.CopyEntryExpr(field) - } - return fac.NewStruct(e.ID(), s.TypeName(), fieldsCopy) - default: - return fac.NewUnspecifiedExpr(e.ID()) - } -} - -func (fac *baseExprFactory) CopyEntryExpr(e EntryExpr) EntryExpr { - switch e.Kind() { - case MapEntryKind: - entry := e.AsMapEntry() - return fac.NewMapEntry(e.ID(), - fac.CopyExpr(entry.Key()), fac.CopyExpr(entry.Value()), entry.IsOptional()) - case StructFieldKind: - field := e.AsStructField() - return fac.NewStructField(e.ID(), - field.Name(), fac.CopyExpr(field.Value()), field.IsOptional()) - default: - return fac.newEntryExpr(e.ID(), nil) - } -} - -func (*baseExprFactory) isExprFactory() {} - -func (fac *baseExprFactory) newExpr(id int64, e exprKindCase) Expr { - return &expr{ - id: id, - exprKindCase: e, - } -} - -func (fac *baseExprFactory) newEntryExpr(id int64, e entryExprKindCase) EntryExpr { - return &entryExpr{ - id: id, - entryExprKindCase: e, - } -} - -var ( - defaultFactory = &baseExprFactory{} -) diff --git a/vendor/github.com/google/cel-go/common/ast/navigable.go b/vendor/github.com/google/cel-go/common/ast/navigable.go deleted file mode 100644 index 13e5777b5..000000000 --- a/vendor/github.com/google/cel-go/common/ast/navigable.go +++ /dev/null @@ -1,665 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// NavigableExpr represents the base navigable expression value with methods to inspect the -// parent and child expressions. -type NavigableExpr interface { - Expr - - // Type of the expression. - // - // If the expression is type-checked, the type check metadata is returned. If the expression - // has not been type-checked, the types.DynType value is returned. - Type() *types.Type - - // Parent returns the parent expression node, if one exists. - Parent() (NavigableExpr, bool) - - // Children returns a list of child expression nodes. - Children() []NavigableExpr - - // Depth indicates the depth in the expression tree. - // - // The root expression has depth 0. - Depth() int -} - -// NavigateAST converts an AST to a NavigableExpr -func NavigateAST(ast *AST) NavigableExpr { - return NavigateExpr(ast, ast.Expr()) -} - -// NavigateExpr creates a NavigableExpr whose type information is backed by the input AST. -// -// If the expression is already a NavigableExpr, the parent and depth information will be -// propagated on the new NavigableExpr value; otherwise, the expr value will be treated -// as though it is the root of the expression graph with a depth of 0. -func NavigateExpr(ast *AST, expr Expr) NavigableExpr { - depth := 0 - var parent NavigableExpr = nil - if nav, ok := expr.(NavigableExpr); ok { - depth = nav.Depth() - parent, _ = nav.Parent() - } - return newNavigableExpr(ast, parent, expr, depth) -} - -// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match. -// -// This function type should be use with the `Match` and `MatchList` calls. -type ExprMatcher func(NavigableExpr) bool - -// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr -// is comprised of all constant values, such as a simple literal or even list and map literal. -func ConstantValueMatcher() ExprMatcher { - return matchIsConstantValue -} - -// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches -// the specified `kind`. -func KindMatcher(kind ExprKind) ExprMatcher { - return func(e NavigableExpr) bool { - return e.Kind() == kind - } -} - -// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose -// function name is equal to `funcName`. -func FunctionMatcher(funcName string) ExprMatcher { - return func(e NavigableExpr) bool { - if e.Kind() != CallKind { - return false - } - return e.AsCall().FunctionName() == funcName - } -} - -// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list. -// -// Such a result would work well with subsequent MatchList calls. -func AllMatcher() ExprMatcher { - return func(NavigableExpr) bool { - return true - } -} - -// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values -// matching the input criteria in post-order (bottom up). -func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr { - matches := []NavigableExpr{} - navVisitor := &baseVisitor{ - visitExpr: func(e Expr) { - nav := e.(NavigableExpr) - if matcher(nav) { - matches = append(matches, nav) - } - }, - } - visit(expr, navVisitor, postOrder, 0, 0) - return matches -} - -// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a -// subset of NavigableExpr values which match. -func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr { - matches := []NavigableExpr{} - navVisitor := &baseVisitor{ - visitExpr: func(e Expr) { - nav := e.(NavigableExpr) - if matcher(nav) { - matches = append(matches, nav) - } - }, - } - for _, expr := range exprs { - visit(expr, navVisitor, postOrder, 0, 1) - } - return matches -} - -// Visitor defines an object for visiting Expr and EntryExpr nodes within an expression graph. -type Visitor interface { - // VisitExpr visits the input expression. - VisitExpr(Expr) - - // VisitEntryExpr visits the input entry expression, i.e. a struct field or map entry. - VisitEntryExpr(EntryExpr) -} - -type baseVisitor struct { - visitExpr func(Expr) - visitEntryExpr func(EntryExpr) -} - -// VisitExpr visits the Expr if the internal expr visitor has been configured. -func (v *baseVisitor) VisitExpr(e Expr) { - if v.visitExpr != nil { - v.visitExpr(e) - } -} - -// VisitEntryExpr visits the entry if the internal expr entry visitor has been configured. -func (v *baseVisitor) VisitEntryExpr(e EntryExpr) { - if v.visitEntryExpr != nil { - v.visitEntryExpr(e) - } -} - -// NewExprVisitor creates a visitor which only visits expression nodes. -func NewExprVisitor(v func(Expr)) Visitor { - return &baseVisitor{ - visitExpr: v, - visitEntryExpr: nil, - } -} - -// PostOrderVisit walks the expression graph and calls the visitor in post-order (bottom-up). -func PostOrderVisit(expr Expr, visitor Visitor) { - visit(expr, visitor, postOrder, 0, 0) -} - -// PreOrderVisit walks the expression graph and calls the visitor in pre-order (top-down). -func PreOrderVisit(expr Expr, visitor Visitor) { - visit(expr, visitor, preOrder, 0, 0) -} - -type visitOrder int - -const ( - preOrder = iota + 1 - postOrder -) - -// TODO: consider exposing a way to configure a limit for the max visit depth. -// It's possible that we could want to configure this on the NewExprVisitor() -// and through MatchDescendents() / MaxID(). -func visit(expr Expr, visitor Visitor, order visitOrder, depth, maxDepth int) { - if maxDepth > 0 && depth == maxDepth { - return - } - if order == preOrder { - visitor.VisitExpr(expr) - } - switch expr.Kind() { - case CallKind: - c := expr.AsCall() - if c.IsMemberFunction() { - visit(c.Target(), visitor, order, depth+1, maxDepth) - } - for _, arg := range c.Args() { - visit(arg, visitor, order, depth+1, maxDepth) - } - case ComprehensionKind: - c := expr.AsComprehension() - visit(c.IterRange(), visitor, order, depth+1, maxDepth) - visit(c.AccuInit(), visitor, order, depth+1, maxDepth) - visit(c.LoopCondition(), visitor, order, depth+1, maxDepth) - visit(c.LoopStep(), visitor, order, depth+1, maxDepth) - visit(c.Result(), visitor, order, depth+1, maxDepth) - case ListKind: - l := expr.AsList() - for _, elem := range l.Elements() { - visit(elem, visitor, order, depth+1, maxDepth) - } - case MapKind: - m := expr.AsMap() - for _, e := range m.Entries() { - if order == preOrder { - visitor.VisitEntryExpr(e) - } - entry := e.AsMapEntry() - visit(entry.Key(), visitor, order, depth+1, maxDepth) - visit(entry.Value(), visitor, order, depth+1, maxDepth) - if order == postOrder { - visitor.VisitEntryExpr(e) - } - } - case SelectKind: - visit(expr.AsSelect().Operand(), visitor, order, depth+1, maxDepth) - case StructKind: - s := expr.AsStruct() - for _, f := range s.Fields() { - if order == preOrder { - visitor.VisitEntryExpr(f) - } - visit(f.AsStructField().Value(), visitor, order, depth+1, maxDepth) - if order == postOrder { - visitor.VisitEntryExpr(f) - } - } - } - if order == postOrder { - visitor.VisitExpr(expr) - } -} - -func matchIsConstantValue(e NavigableExpr) bool { - if e.Kind() == LiteralKind { - return true - } - if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind { - for _, child := range e.Children() { - if !matchIsConstantValue(child) { - return false - } - } - return true - } - return false -} - -func newNavigableExpr(ast *AST, parent NavigableExpr, expr Expr, depth int) NavigableExpr { - // Reduce navigable expression nesting by unwrapping the embedded Expr value. - if nav, ok := expr.(*navigableExprImpl); ok { - expr = nav.Expr - } - nav := &navigableExprImpl{ - Expr: expr, - depth: depth, - ast: ast, - parent: parent, - createChildren: getChildFactory(expr), - } - return nav -} - -type navigableExprImpl struct { - Expr - depth int - ast *AST - parent NavigableExpr - createChildren childFactory -} - -func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) { - if nav.parent != nil { - return nav.parent, true - } - return nil, false -} - -func (nav *navigableExprImpl) ID() int64 { - return nav.Expr.ID() -} - -func (nav *navigableExprImpl) Kind() ExprKind { - return nav.Expr.Kind() -} - -func (nav *navigableExprImpl) Type() *types.Type { - return nav.ast.GetType(nav.ID()) -} - -func (nav *navigableExprImpl) Children() []NavigableExpr { - return nav.createChildren(nav) -} - -func (nav *navigableExprImpl) Depth() int { - return nav.depth -} - -func (nav *navigableExprImpl) AsCall() CallExpr { - return navigableCallImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsComprehension() ComprehensionExpr { - return navigableComprehensionImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsIdent() string { - return nav.Expr.AsIdent() -} - -func (nav *navigableExprImpl) AsList() ListExpr { - return navigableListImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsLiteral() ref.Val { - return nav.Expr.AsLiteral() -} - -func (nav *navigableExprImpl) AsMap() MapExpr { - return navigableMapImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsSelect() SelectExpr { - return navigableSelectImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsStruct() StructExpr { - return navigableStructImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) createChild(e Expr) NavigableExpr { - return newNavigableExpr(nav.ast, nav, e, nav.depth+1) -} - -func (nav *navigableExprImpl) isExpr() {} - -type navigableCallImpl struct { - *navigableExprImpl -} - -func (call navigableCallImpl) FunctionName() string { - return call.Expr.AsCall().FunctionName() -} - -func (call navigableCallImpl) IsMemberFunction() bool { - return call.Expr.AsCall().IsMemberFunction() -} - -func (call navigableCallImpl) Target() Expr { - t := call.Expr.AsCall().Target() - if t != nil { - return call.createChild(t) - } - return nil -} - -func (call navigableCallImpl) Args() []Expr { - args := call.Expr.AsCall().Args() - navArgs := make([]Expr, len(args)) - for i, a := range args { - navArgs[i] = call.createChild(a) - } - return navArgs -} - -type navigableComprehensionImpl struct { - *navigableExprImpl -} - -func (comp navigableComprehensionImpl) IterRange() Expr { - return comp.createChild(comp.Expr.AsComprehension().IterRange()) -} - -func (comp navigableComprehensionImpl) IterVar() string { - return comp.Expr.AsComprehension().IterVar() -} - -func (comp navigableComprehensionImpl) IterVar2() string { - return comp.Expr.AsComprehension().IterVar2() -} - -func (comp navigableComprehensionImpl) HasIterVar2() bool { - return comp.Expr.AsComprehension().HasIterVar2() -} - -func (comp navigableComprehensionImpl) AccuVar() string { - return comp.Expr.AsComprehension().AccuVar() -} - -func (comp navigableComprehensionImpl) AccuInit() Expr { - return comp.createChild(comp.Expr.AsComprehension().AccuInit()) -} - -func (comp navigableComprehensionImpl) LoopCondition() Expr { - return comp.createChild(comp.Expr.AsComprehension().LoopCondition()) -} - -func (comp navigableComprehensionImpl) LoopStep() Expr { - return comp.createChild(comp.Expr.AsComprehension().LoopStep()) -} - -func (comp navigableComprehensionImpl) Result() Expr { - return comp.createChild(comp.Expr.AsComprehension().Result()) -} - -type navigableListImpl struct { - *navigableExprImpl -} - -func (l navigableListImpl) Elements() []Expr { - pbElems := l.Expr.AsList().Elements() - elems := make([]Expr, len(pbElems)) - for i := 0; i < len(pbElems); i++ { - elems[i] = l.createChild(pbElems[i]) - } - return elems -} - -func (l navigableListImpl) IsOptional(index int32) bool { - return l.Expr.AsList().IsOptional(index) -} - -func (l navigableListImpl) OptionalIndices() []int32 { - return l.Expr.AsList().OptionalIndices() -} - -func (l navigableListImpl) Size() int { - return l.Expr.AsList().Size() -} - -type navigableMapImpl struct { - *navigableExprImpl -} - -func (m navigableMapImpl) Entries() []EntryExpr { - mapExpr := m.Expr.AsMap() - entries := make([]EntryExpr, len(mapExpr.Entries())) - for i, e := range mapExpr.Entries() { - entry := e.AsMapEntry() - entries[i] = &entryExpr{ - id: e.ID(), - entryExprKindCase: navigableEntryImpl{ - key: m.createChild(entry.Key()), - val: m.createChild(entry.Value()), - isOpt: entry.IsOptional(), - }, - } - } - return entries -} - -func (m navigableMapImpl) Size() int { - return m.Expr.AsMap().Size() -} - -type navigableEntryImpl struct { - key NavigableExpr - val NavigableExpr - isOpt bool -} - -func (e navigableEntryImpl) Kind() EntryExprKind { - return MapEntryKind -} - -func (e navigableEntryImpl) Key() Expr { - return e.key -} - -func (e navigableEntryImpl) Value() Expr { - return e.val -} - -func (e navigableEntryImpl) IsOptional() bool { - return e.isOpt -} - -func (e navigableEntryImpl) renumberIDs(IDGenerator) {} - -func (e navigableEntryImpl) isEntryExpr() {} - -type navigableSelectImpl struct { - *navigableExprImpl -} - -func (sel navigableSelectImpl) FieldName() string { - return sel.Expr.AsSelect().FieldName() -} - -func (sel navigableSelectImpl) IsTestOnly() bool { - return sel.Expr.AsSelect().IsTestOnly() -} - -func (sel navigableSelectImpl) Operand() Expr { - return sel.createChild(sel.Expr.AsSelect().Operand()) -} - -type navigableStructImpl struct { - *navigableExprImpl -} - -func (s navigableStructImpl) TypeName() string { - return s.Expr.AsStruct().TypeName() -} - -func (s navigableStructImpl) Fields() []EntryExpr { - fieldInits := s.Expr.AsStruct().Fields() - fields := make([]EntryExpr, len(fieldInits)) - for i, f := range fieldInits { - field := f.AsStructField() - fields[i] = &entryExpr{ - id: f.ID(), - entryExprKindCase: navigableFieldImpl{ - name: field.Name(), - val: s.createChild(field.Value()), - isOpt: field.IsOptional(), - }, - } - } - return fields -} - -type navigableFieldImpl struct { - name string - val NavigableExpr - isOpt bool -} - -func (f navigableFieldImpl) Kind() EntryExprKind { - return StructFieldKind -} - -func (f navigableFieldImpl) Name() string { - return f.name -} - -func (f navigableFieldImpl) Value() Expr { - return f.val -} - -func (f navigableFieldImpl) IsOptional() bool { - return f.isOpt -} - -func (f navigableFieldImpl) renumberIDs(IDGenerator) {} - -func (f navigableFieldImpl) isEntryExpr() {} - -func getChildFactory(expr Expr) childFactory { - if expr == nil { - return noopFactory - } - switch expr.Kind() { - case LiteralKind: - return noopFactory - case IdentKind: - return noopFactory - case SelectKind: - return selectFactory - case CallKind: - return callArgFactory - case ListKind: - return listElemFactory - case MapKind: - return mapEntryFactory - case StructKind: - return structEntryFactory - case ComprehensionKind: - return comprehensionFactory - default: - return noopFactory - } -} - -type childFactory func(*navigableExprImpl) []NavigableExpr - -func noopFactory(*navigableExprImpl) []NavigableExpr { - return nil -} - -func selectFactory(nav *navigableExprImpl) []NavigableExpr { - return []NavigableExpr{nav.createChild(nav.AsSelect().Operand())} -} - -func callArgFactory(nav *navigableExprImpl) []NavigableExpr { - call := nav.Expr.AsCall() - argCount := len(call.Args()) - if call.IsMemberFunction() { - argCount++ - } - navExprs := make([]NavigableExpr, argCount) - i := 0 - if call.IsMemberFunction() { - navExprs[i] = nav.createChild(call.Target()) - i++ - } - for _, arg := range call.Args() { - navExprs[i] = nav.createChild(arg) - i++ - } - return navExprs -} - -func listElemFactory(nav *navigableExprImpl) []NavigableExpr { - l := nav.Expr.AsList() - navExprs := make([]NavigableExpr, len(l.Elements())) - for i, e := range l.Elements() { - navExprs[i] = nav.createChild(e) - } - return navExprs -} - -func structEntryFactory(nav *navigableExprImpl) []NavigableExpr { - s := nav.Expr.AsStruct() - entries := make([]NavigableExpr, len(s.Fields())) - for i, e := range s.Fields() { - f := e.AsStructField() - entries[i] = nav.createChild(f.Value()) - } - return entries -} - -func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr { - m := nav.Expr.AsMap() - entries := make([]NavigableExpr, len(m.Entries())*2) - j := 0 - for _, e := range m.Entries() { - mapEntry := e.AsMapEntry() - entries[j] = nav.createChild(mapEntry.Key()) - entries[j+1] = nav.createChild(mapEntry.Value()) - j += 2 - } - return entries -} - -func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr { - compre := nav.Expr.AsComprehension() - return []NavigableExpr{ - nav.createChild(compre.IterRange()), - nav.createChild(compre.AccuInit()), - nav.createChild(compre.LoopCondition()), - nav.createChild(compre.LoopStep()), - nav.createChild(compre.Result()), - } -} diff --git a/vendor/github.com/google/cel-go/common/containers/BUILD.bazel b/vendor/github.com/google/cel-go/common/containers/BUILD.bazel deleted file mode 100644 index 81197f064..000000000 --- a/vendor/github.com/google/cel-go/common/containers/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "container.go", - ], - importpath = "github.com/google/cel-go/common/containers", - deps = [ - "//common/ast:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "container_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//common/ast:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/containers/container.go b/vendor/github.com/google/cel-go/common/containers/container.go deleted file mode 100644 index fc146b6fc..000000000 --- a/vendor/github.com/google/cel-go/common/containers/container.go +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package containers defines types and functions for resolving qualified names within a namespace -// or type provided to CEL. -package containers - -import ( - "fmt" - "strings" - "unicode" - - "github.com/google/cel-go/common/ast" -) - -var ( - // DefaultContainer has an empty container name. - DefaultContainer *Container = nil - - // Empty map to search for aliases when needed. - noAliases = make(map[string]string) -) - -// NewContainer creates a new Container with the fully-qualified name. -func NewContainer(opts ...ContainerOption) (*Container, error) { - var c *Container - var err error - for _, opt := range opts { - c, err = opt(c) - if err != nil { - return nil, err - } - } - return c, nil -} - -// Container holds a reference to an optional qualified container name and set of aliases. -// -// The program container can be used to simplify variable, function, and type specification within -// CEL programs and behaves more or less like a C++ namespace. See ResolveCandidateNames for more -// details. -type Container struct { - name string - aliases map[string]string -} - -// Extend creates a new Container with the existing settings and applies a series of -// ContainerOptions to further configure the new container. -func (c *Container) Extend(opts ...ContainerOption) (*Container, error) { - if c == nil { - return NewContainer(opts...) - } - // Copy the name and aliases of the existing container. - ext := &Container{name: c.Name()} - if len(c.AliasSet()) > 0 { - aliasSet := make(map[string]string, len(c.AliasSet())) - for k, v := range c.AliasSet() { - aliasSet[k] = v - } - ext.aliases = aliasSet - } - // Apply the new options to the container. - var err error - for _, opt := range opts { - ext, err = opt(ext) - if err != nil { - return nil, err - } - } - return ext, nil -} - -// Name returns the fully-qualified name of the container. -// -// The name may conceptually be a namespace, package, or type. -func (c *Container) Name() string { - if c == nil { - return "" - } - return c.name -} - -// ResolveCandidateNames returns the candidates name of namespaced identifiers in C++ resolution -// order. -// -// Names which shadow other names are returned first. If a name includes a leading dot ('.'), -// the name is treated as an absolute identifier which cannot be shadowed. -// -// Given a container name a.b.c.M.N and a type name R.s, this will deliver in order: -// -// a.b.c.M.N.R.s -// a.b.c.M.R.s -// a.b.c.R.s -// a.b.R.s -// a.R.s -// R.s -// -// If aliases or abbreviations are configured for the container, then alias names will take -// precedence over containerized names. -func (c *Container) ResolveCandidateNames(name string) []string { - if strings.HasPrefix(name, ".") { - qn := name[1:] - alias, isAlias := c.findAlias(qn) - if isAlias { - return []string{alias} - } - return []string{qn} - } - alias, isAlias := c.findAlias(name) - if isAlias { - return []string{alias} - } - if c.Name() == "" { - return []string{name} - } - nextCont := c.Name() - candidates := []string{nextCont + "." + name} - for i := strings.LastIndex(nextCont, "."); i >= 0; i = strings.LastIndex(nextCont, ".") { - nextCont = nextCont[:i] - candidates = append(candidates, nextCont+"."+name) - } - return append(candidates, name) -} - -// AliasSet returns the alias to fully-qualified name mapping stored in the container. -func (c *Container) AliasSet() map[string]string { - if c == nil || c.aliases == nil { - return noAliases - } - return c.aliases -} - -// findAlias takes a name as input and returns an alias expansion if one exists. -// -// If the name is qualified, the first component of the qualified name is checked against known -// aliases. Any alias that is found in a qualified name is expanded in the result: -// -// alias: R -> my.alias.R -// name: R.S.T -// output: my.alias.R.S.T -// -// Note, the name must not have a leading dot. -func (c *Container) findAlias(name string) (string, bool) { - // If an alias exists for the name, ensure it is searched last. - simple := name - qualifier := "" - dot := strings.Index(name, ".") - if dot >= 0 { - simple = name[0:dot] - qualifier = name[dot:] - } - alias, found := c.AliasSet()[simple] - if !found { - return "", false - } - return alias + qualifier, true -} - -// ContainerOption specifies a functional configuration option for a Container. -// -// Note, ContainerOption implementations must be able to handle nil container inputs. -type ContainerOption func(*Container) (*Container, error) - -// Abbrevs configures a set of simple names as abbreviations for fully-qualified names. -// -// An abbreviation (abbrev for short) is a simple name that expands to a fully-qualified name. -// Abbreviations can be useful when working with variables, functions, and especially types from -// multiple namespaces: -// -// // CEL object construction -// qual.pkg.version.ObjTypeName{ -// field: alt.container.ver.FieldTypeName{value: ...} -// } -// -// Only one the qualified names above may be used as the CEL container, so at least one of these -// references must be a long qualified name within an otherwise short CEL program. Using the -// following abbreviations, the program becomes much simpler: -// -// // CEL Go option -// Abbrevs("qual.pkg.version.ObjTypeName", "alt.container.ver.FieldTypeName") -// // Simplified Object construction -// ObjTypeName{field: FieldTypeName{value: ...}} -// -// There are a few rules for the qualified names and the simple abbreviations generated from them: -// - Qualified names must be dot-delimited, e.g. `package.subpkg.name`. -// - The last element in the qualified name is the abbreviation. -// - Abbreviations must not collide with each other. -// - The abbreviation must not collide with unqualified names in use. -// -// Abbreviations are distinct from container-based references in the following important ways: -// - Abbreviations must expand to a fully-qualified name. -// - Expanded abbreviations do not participate in namespace resolution. -// - Abbreviation expansion is done instead of the container search for a matching identifier. -// - Containers follow C++ namespace resolution rules with searches from the most qualified name -// to the least qualified name. -// - Container references within the CEL program may be relative, and are resolved to fully -// qualified names at either type-check time or program plan time, whichever comes first. -// -// If there is ever a case where an identifier could be in both the container and as an -// abbreviation, the abbreviation wins as this will ensure that the meaning of a program is -// preserved between compilations even as the container evolves. -func Abbrevs(qualifiedNames ...string) ContainerOption { - return func(c *Container) (*Container, error) { - for _, qn := range qualifiedNames { - qn = strings.TrimSpace(qn) - for _, r := range qn { - if !isIdentifierChar(r) { - return nil, fmt.Errorf( - "invalid qualified name: %s, wanted name of the form 'qualified.name'", qn) - } - } - ind := strings.LastIndex(qn, ".") - if ind <= 0 || ind >= len(qn)-1 { - return nil, fmt.Errorf( - "invalid qualified name: %s, wanted name of the form 'qualified.name'", qn) - } - alias := qn[ind+1:] - var err error - c, err = aliasAs("abbreviation", qn, alias)(c) - if err != nil { - return nil, err - } - } - return c, nil - } -} - -// Alias associates a fully-qualified name with a user-defined alias. -// -// In general, Abbrevs is preferred to Alias since the names generated from the Abbrevs option -// are more easily traced back to source code. The Alias option is useful for propagating alias -// configuration from one Container instance to another, and may also be useful for remapping -// poorly chosen protobuf message / package names. -// -// Note: all of the rules that apply to Abbrevs also apply to Alias. -func Alias(qualifiedName, alias string) ContainerOption { - return aliasAs("alias", qualifiedName, alias) -} - -func aliasAs(kind, qualifiedName, alias string) ContainerOption { - return func(c *Container) (*Container, error) { - if len(alias) == 0 || strings.Contains(alias, ".") { - return nil, fmt.Errorf( - "%s must be non-empty and simple (not qualified): %s=%s", kind, kind, alias) - } - - if qualifiedName[0:1] == "." { - return nil, fmt.Errorf("qualified name must not begin with a leading '.': %s", - qualifiedName) - } - ind := strings.LastIndex(qualifiedName, ".") - if ind <= 0 || ind == len(qualifiedName)-1 { - return nil, fmt.Errorf("%s must refer to a valid qualified name: %s", - kind, qualifiedName) - } - aliasRef, found := c.AliasSet()[alias] - if found { - return nil, fmt.Errorf( - "%s collides with existing reference: name=%s, %s=%s, existing=%s", - kind, qualifiedName, kind, alias, aliasRef) - } - if strings.HasPrefix(c.Name(), alias+".") || c.Name() == alias { - return nil, fmt.Errorf( - "%s collides with container name: name=%s, %s=%s, container=%s", - kind, qualifiedName, kind, alias, c.Name()) - } - if c == nil { - c = &Container{} - } - if c.aliases == nil { - c.aliases = make(map[string]string) - } - c.aliases[alias] = qualifiedName - return c, nil - } -} - -func isIdentifierChar(r rune) bool { - return r <= unicode.MaxASCII && (r == '.' || r == '_' || unicode.IsLetter(r) || unicode.IsNumber(r)) -} - -// Name sets the fully-qualified name of the Container. -func Name(name string) ContainerOption { - return func(c *Container) (*Container, error) { - if len(name) > 0 && name[0:1] == "." { - return nil, fmt.Errorf("container name must not contain a leading '.': %s", name) - } - if c.Name() == name { - return c, nil - } - if c == nil { - return &Container{name: name}, nil - } - c.name = name - return c, nil - } -} - -// ToQualifiedName converts an expression AST into a qualified name if possible, with a boolean -// 'found' value that indicates if the conversion is successful. -func ToQualifiedName(e ast.Expr) (string, bool) { - switch e.Kind() { - case ast.IdentKind: - id := e.AsIdent() - return id, true - case ast.SelectKind: - sel := e.AsSelect() - // Test only expressions are not valid as qualified names. - if sel.IsTestOnly() { - return "", false - } - if qual, found := ToQualifiedName(sel.Operand()); found { - return qual + "." + sel.FieldName(), true - } - } - return "", false -} diff --git a/vendor/github.com/google/cel-go/common/cost.go b/vendor/github.com/google/cel-go/common/cost.go deleted file mode 100644 index 5e24bd0f4..000000000 --- a/vendor/github.com/google/cel-go/common/cost.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package common - -const ( - // SelectAndIdentCost is the cost of an operation that accesses an identifier or performs a select. - SelectAndIdentCost = 1 - - // ConstCost is the cost of an operation that accesses a constant. - ConstCost = 0 - - // ListCreateBaseCost is the base cost of any operation that creates a new list. - ListCreateBaseCost = 10 - - // MapCreateBaseCost is the base cost of any operation that creates a new map. - MapCreateBaseCost = 30 - - // StructCreateBaseCost is the base cost of any operation that creates a new struct. - StructCreateBaseCost = 40 - - // StringTraversalCostFactor is multiplied to a length of a string when computing the cost of traversing the entire - // string once. - StringTraversalCostFactor = 0.1 - - // RegexStringLengthCostFactor is multiplied ot the length of a regex string pattern when computing the cost of - // applying the regex to a string of unit cost. - RegexStringLengthCostFactor = 0.25 -) diff --git a/vendor/github.com/google/cel-go/common/debug/BUILD.bazel b/vendor/github.com/google/cel-go/common/debug/BUILD.bazel deleted file mode 100644 index 724ed3404..000000000 --- a/vendor/github.com/google/cel-go/common/debug/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "debug.go", - ], - importpath = "github.com/google/cel-go/common/debug", - deps = [ - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/debug/debug.go b/vendor/github.com/google/cel-go/common/debug/debug.go deleted file mode 100644 index 75f5f0d63..000000000 --- a/vendor/github.com/google/cel-go/common/debug/debug.go +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package debug provides tools to print a parsed expression graph and -// adorn each expression element with additional metadata. -package debug - -import ( - "bytes" - "fmt" - "strconv" - "strings" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// Adorner returns debug metadata that will be tacked on to the string -// representation of an expression. -type Adorner interface { - // GetMetadata for the input context. - GetMetadata(ctx any) string -} - -// Writer manages writing expressions to an internal string. -type Writer interface { - fmt.Stringer - - // Buffer pushes an expression into an internal queue of expressions to - // write to a string. - Buffer(e ast.Expr) -} - -type emptyDebugAdorner struct { -} - -var emptyAdorner Adorner = &emptyDebugAdorner{} - -func (a *emptyDebugAdorner) GetMetadata(e any) string { - return "" -} - -// ToDebugString gives the unadorned string representation of the Expr. -func ToDebugString(e ast.Expr) string { - return ToAdornedDebugString(e, emptyAdorner) -} - -// ToAdornedDebugString gives the adorned string representation of the Expr. -func ToAdornedDebugString(e ast.Expr, adorner Adorner) string { - w := newDebugWriter(adorner) - w.Buffer(e) - return w.String() -} - -// debugWriter is used to print out pretty-printed debug strings. -type debugWriter struct { - adorner Adorner - buffer bytes.Buffer - indent int - lineStart bool -} - -func newDebugWriter(a Adorner) *debugWriter { - return &debugWriter{ - adorner: a, - indent: 0, - lineStart: true, - } -} - -func (w *debugWriter) Buffer(e ast.Expr) { - if e == nil { - return - } - switch e.Kind() { - case ast.LiteralKind: - w.append(formatLiteral(e.AsLiteral())) - case ast.IdentKind: - w.append(e.AsIdent()) - case ast.SelectKind: - w.appendSelect(e.AsSelect()) - case ast.CallKind: - w.appendCall(e.AsCall()) - case ast.ListKind: - w.appendList(e.AsList()) - case ast.MapKind: - w.appendMap(e.AsMap()) - case ast.StructKind: - w.appendStruct(e.AsStruct()) - case ast.ComprehensionKind: - w.appendComprehension(e.AsComprehension()) - } - w.adorn(e) -} - -func (w *debugWriter) appendSelect(sel ast.SelectExpr) { - w.Buffer(sel.Operand()) - w.append(".") - w.append(sel.FieldName()) - if sel.IsTestOnly() { - w.append("~test-only~") - } -} - -func (w *debugWriter) appendCall(call ast.CallExpr) { - if call.IsMemberFunction() { - w.Buffer(call.Target()) - w.append(".") - } - w.append(call.FunctionName()) - w.append("(") - if len(call.Args()) > 0 { - w.addIndent() - w.appendLine() - for i, arg := range call.Args() { - if i > 0 { - w.append(",") - w.appendLine() - } - w.Buffer(arg) - } - w.removeIndent() - w.appendLine() - } - w.append(")") -} - -func (w *debugWriter) appendList(list ast.ListExpr) { - w.append("[") - if len(list.Elements()) > 0 { - w.appendLine() - w.addIndent() - for i, elem := range list.Elements() { - if i > 0 { - w.append(",") - w.appendLine() - } - w.Buffer(elem) - } - w.removeIndent() - w.appendLine() - } - w.append("]") -} - -func (w *debugWriter) appendStruct(obj ast.StructExpr) { - w.append(obj.TypeName()) - w.append("{") - if len(obj.Fields()) > 0 { - w.appendLine() - w.addIndent() - for i, f := range obj.Fields() { - field := f.AsStructField() - if i > 0 { - w.append(",") - w.appendLine() - } - if field.IsOptional() { - w.append("?") - } - w.append(field.Name()) - w.append(":") - w.Buffer(field.Value()) - w.adorn(f) - } - w.removeIndent() - w.appendLine() - } - w.append("}") -} - -func (w *debugWriter) appendMap(m ast.MapExpr) { - w.append("{") - if m.Size() > 0 { - w.appendLine() - w.addIndent() - for i, e := range m.Entries() { - entry := e.AsMapEntry() - if i > 0 { - w.append(",") - w.appendLine() - } - if entry.IsOptional() { - w.append("?") - } - w.Buffer(entry.Key()) - w.append(":") - w.Buffer(entry.Value()) - w.adorn(e) - } - w.removeIndent() - w.appendLine() - } - w.append("}") -} - -func (w *debugWriter) appendComprehension(comprehension ast.ComprehensionExpr) { - w.append("__comprehension__(") - w.addIndent() - w.appendLine() - w.append("// Variable") - w.appendLine() - w.append(comprehension.IterVar()) - w.append(",") - w.appendLine() - if comprehension.HasIterVar2() { - w.append(comprehension.IterVar2()) - w.append(",") - w.appendLine() - } - w.append("// Target") - w.appendLine() - w.Buffer(comprehension.IterRange()) - w.append(",") - w.appendLine() - w.append("// Accumulator") - w.appendLine() - w.append(comprehension.AccuVar()) - w.append(",") - w.appendLine() - w.append("// Init") - w.appendLine() - w.Buffer(comprehension.AccuInit()) - w.append(",") - w.appendLine() - w.append("// LoopCondition") - w.appendLine() - w.Buffer(comprehension.LoopCondition()) - w.append(",") - w.appendLine() - w.append("// LoopStep") - w.appendLine() - w.Buffer(comprehension.LoopStep()) - w.append(",") - w.appendLine() - w.append("// Result") - w.appendLine() - w.Buffer(comprehension.Result()) - w.append(")") - w.removeIndent() -} - -func formatLiteral(c ref.Val) string { - switch v := c.(type) { - case types.Bool: - return fmt.Sprintf("%t", v) - case types.Bytes: - return fmt.Sprintf("b%s", strconv.Quote(string(v))) - case types.Double: - return fmt.Sprintf("%v", float64(v)) - case types.Int: - return fmt.Sprintf("%d", int64(v)) - case types.String: - return strconv.Quote(string(v)) - case types.Uint: - return fmt.Sprintf("%du", uint64(v)) - case types.Null: - return "null" - default: - panic("Unknown constant type") - } -} - -func (w *debugWriter) append(s string) { - w.doIndent() - w.buffer.WriteString(s) -} - -func (w *debugWriter) appendFormat(f string, args ...any) { - w.append(fmt.Sprintf(f, args...)) -} - -func (w *debugWriter) doIndent() { - if w.lineStart { - w.lineStart = false - w.buffer.WriteString(strings.Repeat(" ", w.indent)) - } -} - -func (w *debugWriter) adorn(e any) { - w.append(w.adorner.GetMetadata(e)) -} - -func (w *debugWriter) appendLine() { - w.buffer.WriteString("\n") - w.lineStart = true -} - -func (w *debugWriter) addIndent() { - w.indent++ -} - -func (w *debugWriter) removeIndent() { - w.indent-- - if w.indent < 0 { - panic("negative indent") - } -} - -func (w *debugWriter) String() string { - return w.buffer.String() -} diff --git a/vendor/github.com/google/cel-go/common/decls/BUILD.bazel b/vendor/github.com/google/cel-go/common/decls/BUILD.bazel deleted file mode 100644 index bd3f9ae70..000000000 --- a/vendor/github.com/google/cel-go/common/decls/BUILD.bazel +++ /dev/null @@ -1,41 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "decls.go", - ], - importpath = "github.com/google/cel-go/common/decls", - deps = [ - "//checker/decls:go_default_library", - "//common:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "decls_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//checker/decls:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/decls/decls.go b/vendor/github.com/google/cel-go/common/decls/decls.go deleted file mode 100644 index a4a51c3f2..000000000 --- a/vendor/github.com/google/cel-go/common/decls/decls.go +++ /dev/null @@ -1,1129 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package decls contains function and variable declaration structs and helper methods. -package decls - -import ( - "fmt" - "strings" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// NewFunction creates a new function declaration with a set of function options to configure overloads -// and function definitions (implementations). -// -// Functions are checked for name collisions and singleton redefinition. -func NewFunction(name string, opts ...FunctionOpt) (*FunctionDecl, error) { - fn := &FunctionDecl{ - name: name, - overloads: map[string]*OverloadDecl{}, - overloadOrdinals: []string{}, - } - var err error - for _, opt := range opts { - fn, err = opt(fn) - if err != nil { - return nil, err - } - } - if len(fn.overloads) == 0 { - return nil, fmt.Errorf("function %s must have at least one overload", name) - } - return fn, nil -} - -// FunctionDecl defines a function name, overload set, and optionally a singleton definition for all -// overload instances. -type FunctionDecl struct { - name string - doc string - - // overloads associated with the function name. - overloads map[string]*OverloadDecl - - // singleton implementation of the function for all overloads. - // - // If this option is set, an error will occur if any overloads specify a per-overload implementation - // or if another function with the same name attempts to redefine the singleton. - singleton *functions.Overload - - // disableTypeGuards is a performance optimization to disable detailed runtime type checks which could - // add overhead on common operations. Setting this option true leaves error checks and argument checks - // intact. - disableTypeGuards bool - - // state indicates that the binding should be provided as a declaration, as a runtime binding, or both. - state declarationState - - // overloadOrdinals indicates the order in which the overload was declared. - overloadOrdinals []string -} - -type declarationState int - -const ( - declarationStateUnset declarationState = iota - declarationDisabled - declarationEnabled -) - -// Documentation generates documentation about the Function and its overloads as a common.Doc object. -func (f *FunctionDecl) Documentation() *common.Doc { - if f == nil { - return nil - } - children := make([]*common.Doc, len(f.OverloadDecls())) - for i, o := range f.OverloadDecls() { - var examples []*common.Doc - for _, ex := range o.Examples() { - examples = append(examples, common.NewExampleDoc(ex)) - } - od := common.NewOverloadDoc(o.ID(), formatSignature(f.Name(), o), examples...) - children[i] = od - } - return common.NewFunctionDoc( - f.Name(), - f.Description(), - children...) -} - -// Name returns the function name in human-readable terms, e.g. 'contains' of 'math.least' -func (f *FunctionDecl) Name() string { - if f == nil { - return "" - } - return f.name -} - -// Description provides an overview of the function's purpose. -// -// Usage examples should be included on specific overloads. -func (f *FunctionDecl) Description() string { - if f == nil { - return "" - } - return f.doc -} - -// IsDeclarationDisabled indicates that the function implementation should be added to the dispatcher, but the -// declaration should not be exposed for use in expressions. -func (f *FunctionDecl) IsDeclarationDisabled() bool { - if f == nil { - return true - } - return f.state == declarationDisabled -} - -// Merge combines an existing function declaration with another. -// -// If a function is extended, by say adding new overloads to an existing function, then it is merged with the -// prior definition of the function at which point its overloads must not collide with pre-existing overloads -// and its bindings (singleton, or per-overload) must not conflict with previous definitions either. -func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) { - if f == other { - return f, nil - } - if f == nil || other == nil || f.Name() != other.Name() { - return nil, fmt.Errorf("cannot merge unrelated functions. %q and %q", f.Name(), other.Name()) - } - merged := &FunctionDecl{ - name: f.Name(), - overloads: make(map[string]*OverloadDecl, len(f.overloads)), - singleton: f.singleton, - overloadOrdinals: make([]string, len(f.overloads)), - // if one function is expecting type-guards and the other is not, then they - // must not be disabled. - disableTypeGuards: f.disableTypeGuards && other.disableTypeGuards, - // default to the current functions declaration state. - state: f.state, - doc: f.doc, - } - // If the other state indicates that the declaration should be explicitly enabled or - // disabled, then update the merged state with the most recent value. - if other.state != declarationStateUnset { - merged.state = other.state - } - // Allow for non-empty overrides of documentation - if len(other.doc) != 0 && f.doc != other.doc { - merged.doc = other.doc - } - // baseline copy of the overloads and their ordinals - copy(merged.overloadOrdinals, f.overloadOrdinals) - for oID, o := range f.overloads { - merged.overloads[oID] = o - } - // overloads and their ordinals are added from the left - for _, oID := range other.overloadOrdinals { - o := other.overloads[oID] - err := merged.AddOverload(o) - if err != nil { - return nil, fmt.Errorf("function declaration merge failed: %v", err) - } - } - if other.singleton != nil { - if merged.singleton != nil && merged.singleton != other.singleton { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - merged.singleton = other.singleton - } - return merged, nil -} - -// FunctionSubsetter subsets a function declaration or returns nil and false if the function -// subset was empty. -type FunctionSubsetter func(fn *FunctionDecl) (*FunctionDecl, bool) - -// OverloadSelector selects an overload associated with a given function when it returns true. -// -// Used in combination with the Subset method. -type OverloadSelector func(overload *OverloadDecl) bool - -// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids. -func IncludeOverloads(overloadIDs ...string) OverloadSelector { - return func(overload *OverloadDecl) bool { - for _, oID := range overloadIDs { - if overload.id == oID { - return true - } - } - return false - } -} - -// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids. -func ExcludeOverloads(overloadIDs ...string) OverloadSelector { - return func(overload *OverloadDecl) bool { - for _, oID := range overloadIDs { - if overload.id == oID { - return false - } - } - return true - } -} - -// Subset returns a new function declaration which contains only the overloads with the specified IDs. -// If the subset function contains no overloads, then nil is returned to indicate the function is not -// functional. -func (f *FunctionDecl) Subset(selector OverloadSelector) *FunctionDecl { - if f == nil { - return nil - } - overloads := make(map[string]*OverloadDecl) - overloadOrdinals := make([]string, 0, len(f.overloadOrdinals)) - for _, oID := range f.overloadOrdinals { - overload := f.overloads[oID] - if selector(overload) { - overloads[oID] = overload - overloadOrdinals = append(overloadOrdinals, oID) - } - } - if len(overloads) == 0 { - return nil - } - subset := &FunctionDecl{ - name: f.Name(), - doc: f.doc, - overloads: overloads, - singleton: f.singleton, - disableTypeGuards: f.disableTypeGuards, - state: f.state, - overloadOrdinals: overloadOrdinals, - } - return subset -} - -// AddOverload ensures that the new overload does not collide with an existing overload signature; -// however, if the function signatures are identical, the implementation may be rewritten as its -// difficult to compare functions by object identity. -func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error { - if f == nil { - return fmt.Errorf("nil function cannot add overload: %s", overload.ID()) - } - if overload == nil { - return fmt.Errorf("cannot add nil overload to funciton: %s", f.Name()) - } - for oID, o := range f.overloads { - if oID != overload.ID() && o.SignatureOverlaps(overload) { - return fmt.Errorf("overload signature collision in function %s: %s collides with %s", f.Name(), oID, overload.ID()) - } - if oID == overload.ID() { - if o.SignatureEquals(overload) && o.IsNonStrict() == overload.IsNonStrict() { - // Allow redefinition of an overload implementation so long as the signatures match. - if overload.hasBinding() { - f.overloads[oID] = overload - } - // Allow redefinition of the doc string. - if len(overload.doc) != 0 && o.doc != overload.doc { - o.doc = overload.doc - } - return nil - } - return fmt.Errorf("overload redefinition in function. %s: %s has multiple definitions", f.Name(), oID) - } - if overload.HasLateBinding() != o.HasLateBinding() { - return fmt.Errorf("overload with late binding cannot be added to function %s: cannot mix late and non-late bindings", f.Name()) - } - } - f.overloadOrdinals = append(f.overloadOrdinals, overload.ID()) - f.overloads[overload.ID()] = overload - return nil -} - -// OverloadDecls returns the overload declarations in the order in which they were declared. -func (f *FunctionDecl) OverloadDecls() []*OverloadDecl { - var emptySet []*OverloadDecl - if f == nil { - return emptySet - } - overloads := make([]*OverloadDecl, 0, len(f.overloads)) - for _, oID := range f.overloadOrdinals { - overloads = append(overloads, f.overloads[oID]) - } - return overloads -} - -// HasLateBinding returns true if the function has late bindings. A function cannot mix late bindings with other bindings. -func (f *FunctionDecl) HasLateBinding() bool { - if f == nil { - return false - } - for _, oID := range f.overloadOrdinals { - if f.overloads[oID].HasLateBinding() { - return true - } - } - return false -} - -// Bindings produces a set of function bindings, if any are defined. -func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) { - var emptySet []*functions.Overload - if f == nil { - return emptySet, nil - } - overloads := []*functions.Overload{} - nonStrict := false - hasLateBinding := false - for _, oID := range f.overloadOrdinals { - o := f.overloads[oID] - hasLateBinding = hasLateBinding || o.HasLateBinding() - if o.hasBinding() { - overload := &functions.Overload{ - Operator: o.ID(), - Unary: o.guardedUnaryOp(f.Name(), f.disableTypeGuards), - Binary: o.guardedBinaryOp(f.Name(), f.disableTypeGuards), - Function: o.guardedFunctionOp(f.Name(), f.disableTypeGuards), - OperandTrait: o.OperandTrait(), - NonStrict: o.IsNonStrict(), - } - overloads = append(overloads, overload) - nonStrict = nonStrict || o.IsNonStrict() - } - } - if f.singleton != nil { - if len(overloads) != 0 { - return nil, fmt.Errorf("singleton function incompatible with specialized overloads: %s", f.Name()) - } - if hasLateBinding { - return nil, fmt.Errorf("singleton function incompatible with late bindings: %s", f.Name()) - } - overloads = []*functions.Overload{ - { - Operator: f.Name(), - Unary: f.singleton.Unary, - Binary: f.singleton.Binary, - Function: f.singleton.Function, - OperandTrait: f.singleton.OperandTrait, - }, - } - // fall-through to return single overload case. - } - if len(overloads) == 0 { - return overloads, nil - } - // Single overload. Replicate an entry for it using the function name as well. - if len(overloads) == 1 { - if overloads[0].Operator == f.Name() { - return overloads, nil - } - return append(overloads, &functions.Overload{ - Operator: f.Name(), - Unary: overloads[0].Unary, - Binary: overloads[0].Binary, - Function: overloads[0].Function, - NonStrict: overloads[0].NonStrict, - OperandTrait: overloads[0].OperandTrait, - }), nil - } - // All of the defined overloads are wrapped into a top-level function which - // performs dynamic dispatch to the proper overload based on the argument types. - bindings := append([]*functions.Overload{}, overloads...) - funcDispatch := func(args ...ref.Val) ref.Val { - for _, oID := range f.overloadOrdinals { - o := f.overloads[oID] - // During dynamic dispatch over multiple functions, signature agreement checks - // are preserved in order to assist with the function resolution step. - switch len(args) { - case 1: - if o.unaryOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) { - return o.unaryOp(args[0]) - } - case 2: - if o.binaryOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) { - return o.binaryOp(args[0], args[1]) - } - } - if o.functionOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) { - return o.functionOp(args...) - } - // eventually this will fall through to the noSuchOverload below. - } - return MaybeNoSuchOverload(f.Name(), args...) - } - function := &functions.Overload{ - Operator: f.Name(), - Function: funcDispatch, - NonStrict: nonStrict, - } - return append(bindings, function), nil -} - -// MaybeNoSuchOverload determines whether to propagate an error if one is provided as an argument, or -// to return an unknown set, or to produce a new error for a missing function signature. -func MaybeNoSuchOverload(funcName string, args ...ref.Val) ref.Val { - argTypes := make([]string, len(args)) - var unk *types.Unknown = nil - for i, arg := range args { - if types.IsError(arg) { - return arg - } - if types.IsUnknown(arg) { - unk = types.MergeUnknowns(arg.(*types.Unknown), unk) - } - argTypes[i] = arg.Type().TypeName() - } - if unk != nil { - return unk - } - signature := strings.Join(argTypes, ", ") - return types.NewErr("no such overload: %s(%s)", funcName, signature) -} - -// FunctionOpt defines a functional option for mutating a function declaration. -type FunctionOpt func(*FunctionDecl) (*FunctionDecl, error) - -// FunctionDocs configures documentation from a list of strings separated by newlines. -func FunctionDocs(docs ...string) FunctionOpt { - return func(fn *FunctionDecl) (*FunctionDecl, error) { - fn.doc = common.MultilineDescription(docs...) - return fn, nil - } -} - -// DisableTypeGuards disables automatically generated function invocation guards on direct overload calls. -// Type guards remain on during dynamic dispatch for parsed-only expressions. -func DisableTypeGuards(value bool) FunctionOpt { - return func(fn *FunctionDecl) (*FunctionDecl, error) { - fn.disableTypeGuards = value - return fn, nil - } -} - -// DisableDeclaration indicates that the function declaration should be disabled, but the runtime function -// binding should be provided. Marking a function as runtime-only is a safe way to manage deprecations -// of function declarations while still preserving the runtime behavior for previously compiled expressions. -func DisableDeclaration(value bool) FunctionOpt { - return func(fn *FunctionDecl) (*FunctionDecl, error) { - if value { - fn.state = declarationDisabled - } else { - fn.state = declarationEnabled - } - return fn, nil - } -} - -// SingletonUnaryBinding creates a singleton function definition to be used for all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonUnaryBinding(fn functions.UnaryOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Unary: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// SingletonBinaryBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonBinaryBinding(fn functions.BinaryOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Binary: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// SingletonFunctionBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonFunctionBinding(fn functions.FunctionOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Function: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// Overload defines a new global overload with an overload id, argument types, and result type. Through the -// use of OverloadOpt options, the overload may also be configured with a binding, an operand trait, and to -// be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func Overload(overloadID string, - args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return newOverload(overloadID, false, args, resultType, opts...) -} - -// MemberOverload defines a new receiver-style overload (or member function) with an overload id, argument types, -// and result type. Through the use of OverloadOpt options, the overload may also be configured with a binding, -// an operand trait, and to be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func MemberOverload(overloadID string, - args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return newOverload(overloadID, true, args, resultType, opts...) -} - -func newOverload(overloadID string, - memberFunction bool, args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return func(f *FunctionDecl) (*FunctionDecl, error) { - overload, err := newOverloadInternal(overloadID, memberFunction, args, resultType, opts...) - if err != nil { - return nil, err - } - err = f.AddOverload(overload) - if err != nil { - return nil, err - } - return f, nil - } -} - -func newOverloadInternal(overloadID string, - memberFunction bool, args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) (*OverloadDecl, error) { - overload := &OverloadDecl{ - id: overloadID, - argTypes: args, - resultType: resultType, - isMemberFunction: memberFunction, - } - var err error - for _, opt := range opts { - overload, err = opt(overload) - if err != nil { - return nil, err - } - } - return overload, nil -} - -// OverloadDecl contains the definition of a single overload id with a specific signature, and an optional -// implementation. -type OverloadDecl struct { - id string - doc string - argTypes []*types.Type - resultType *types.Type - isMemberFunction bool - // hasLateBinding indicates that the function has a binding which is not known at compile time. - // This is useful for functions which have side-effects or are not deterministically computable. - hasLateBinding bool - // nonStrict indicates that the function will accept error and unknown arguments as inputs. - nonStrict bool - // operandTrait indicates whether the member argument should have a specific type-trait. - // - // This is useful for creating overloads which operate on a type-interface rather than a concrete type. - operandTrait int - - // Function implementation options. Optional, but encouraged. - // unaryOp is a function binding that takes a single argument. - unaryOp functions.UnaryOp - // binaryOp is a function binding that takes two arguments. - binaryOp functions.BinaryOp - // functionOp is a catch-all for zero-arity and three-plus arity functions. - functionOp functions.FunctionOp -} - -// Examples returns a list of string examples for the overload. -func (o *OverloadDecl) Examples() []string { - var emptySet []string - if o == nil || len(o.doc) == 0 { - return emptySet - } - return common.ParseDescriptions(o.doc) -} - -// ID mirrors the overload signature and provides a unique id which may be referenced within the type-checker -// and interpreter to optimize performance. -// -// The ID format is usually one of two styles: -// global: __ -// member: ___ -func (o *OverloadDecl) ID() string { - if o == nil { - return "" - } - return o.id -} - -// ArgTypes contains the set of argument types expected by the overload. -// -// For member functions ArgTypes[0] represents the member operand type. -func (o *OverloadDecl) ArgTypes() []*types.Type { - if o == nil { - return emptyArgs - } - return o.argTypes -} - -// IsMemberFunction indicates whether the overload is a member function -func (o *OverloadDecl) IsMemberFunction() bool { - if o == nil { - return false - } - return o.isMemberFunction -} - -// IsNonStrict returns whether the overload accepts errors and unknown values as arguments. -func (o *OverloadDecl) IsNonStrict() bool { - if o == nil { - return false - } - return o.nonStrict -} - -// HasLateBinding returns whether the overload has a binding which is not known at compile time. -func (o *OverloadDecl) HasLateBinding() bool { - if o == nil { - return false - } - return o.hasLateBinding -} - -// OperandTrait returns the trait mask of the first operand to the overload call, e.g. -// `traits.Indexer` -func (o *OverloadDecl) OperandTrait() int { - if o == nil { - return 0 - } - return o.operandTrait -} - -// ResultType indicates the output type from calling the function. -func (o *OverloadDecl) ResultType() *types.Type { - if o == nil { - // *types.Type is nil-safe - return nil - } - return o.resultType -} - -// TypeParams returns the type parameter names associated with the overload. -func (o *OverloadDecl) TypeParams() []string { - typeParams := map[string]struct{}{} - collectParamNames(typeParams, o.ResultType()) - for _, arg := range o.ArgTypes() { - collectParamNames(typeParams, arg) - } - params := make([]string, 0, len(typeParams)) - for param := range typeParams { - params = append(params, param) - } - return params -} - -// SignatureEquals determines whether the incoming overload declaration signature is equal to the current signature. -// -// Result type, operand trait, and strict-ness are not considered as part of signature equality. -func (o *OverloadDecl) SignatureEquals(other *OverloadDecl) bool { - if o == other { - return true - } - if o.ID() != other.ID() || o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) { - return false - } - for i, at := range o.ArgTypes() { - oat := other.ArgTypes()[i] - if !at.IsEquivalentType(oat) { - return false - } - } - return o.ResultType().IsEquivalentType(other.ResultType()) -} - -// SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures. -// -// For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type. -func (o *OverloadDecl) SignatureOverlaps(other *OverloadDecl) bool { - if o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) { - return false - } - argsOverlap := true - for i, argType := range o.ArgTypes() { - otherArgType := other.ArgTypes()[i] - argsOverlap = argsOverlap && - (argType.IsAssignableType(otherArgType) || - otherArgType.IsAssignableType(argType)) - } - return argsOverlap -} - -// hasBinding indicates whether the overload already has a definition. -func (o *OverloadDecl) hasBinding() bool { - return o != nil && (o.unaryOp != nil || o.binaryOp != nil || o.functionOp != nil) -} - -// guardedUnaryOp creates an invocation guard around the provided unary operator, if one is defined. -func (o *OverloadDecl) guardedUnaryOp(funcName string, disableTypeGuards bool) functions.UnaryOp { - if o.unaryOp == nil { - return nil - } - return func(arg ref.Val) ref.Val { - if !o.matchesRuntimeUnarySignature(disableTypeGuards, arg) { - return MaybeNoSuchOverload(funcName, arg) - } - return o.unaryOp(arg) - } -} - -// guardedBinaryOp creates an invocation guard around the provided binary operator, if one is defined. -func (o *OverloadDecl) guardedBinaryOp(funcName string, disableTypeGuards bool) functions.BinaryOp { - if o.binaryOp == nil { - return nil - } - return func(arg1, arg2 ref.Val) ref.Val { - if !o.matchesRuntimeBinarySignature(disableTypeGuards, arg1, arg2) { - return MaybeNoSuchOverload(funcName, arg1, arg2) - } - return o.binaryOp(arg1, arg2) - } -} - -// guardedFunctionOp creates an invocation guard around the provided variadic function binding, if one is provided. -func (o *OverloadDecl) guardedFunctionOp(funcName string, disableTypeGuards bool) functions.FunctionOp { - if o.functionOp == nil { - return nil - } - return func(args ...ref.Val) ref.Val { - if !o.matchesRuntimeSignature(disableTypeGuards, args...) { - return MaybeNoSuchOverload(funcName, args...) - } - return o.functionOp(args...) - } -} - -// matchesRuntimeUnarySignature indicates whether the argument type is runtime assiganble to the overload's expected argument. -func (o *OverloadDecl) matchesRuntimeUnarySignature(disableTypeGuards bool, arg ref.Val) bool { - return matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[0], arg) && - matchOperandTrait(o.OperandTrait(), arg) -} - -// matchesRuntimeBinarySignature indicates whether the argument types are runtime assiganble to the overload's expected arguments. -func (o *OverloadDecl) matchesRuntimeBinarySignature(disableTypeGuards bool, arg1, arg2 ref.Val) bool { - return matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[0], arg1) && - matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[1], arg2) && - matchOperandTrait(o.OperandTrait(), arg1) -} - -// matchesRuntimeSignature indicates whether the argument types are runtime assiganble to the overload's expected arguments. -func (o *OverloadDecl) matchesRuntimeSignature(disableTypeGuards bool, args ...ref.Val) bool { - if len(args) != len(o.ArgTypes()) { - return false - } - if len(args) == 0 { - return true - } - for i, arg := range args { - if !matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[i], arg) { - return false - } - } - return matchOperandTrait(o.OperandTrait(), args[0]) -} - -func matchRuntimeArgType(nonStrict, disableTypeGuards bool, argType *types.Type, arg ref.Val) bool { - if nonStrict && (disableTypeGuards || types.IsUnknownOrError(arg)) { - return true - } - if types.IsUnknownOrError(arg) { - return false - } - return disableTypeGuards || argType.IsAssignableRuntimeType(arg) -} - -func matchOperandTrait(trait int, arg ref.Val) bool { - return trait == 0 || arg.Type().HasTrait(trait) || types.IsUnknownOrError(arg) -} - -// OverloadOpt is a functional option for configuring a function overload. -type OverloadOpt func(*OverloadDecl) (*OverloadDecl, error) - -// OverloadExamples configures example expressions for the overload. -func OverloadExamples(examples ...string) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - o.doc = common.MultilineDescription(examples...) - return o, nil - } -} - -// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func UnaryBinding(binding functions.UnaryOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - if len(o.ArgTypes()) != 1 { - return nil, fmt.Errorf("unary function bound to non-unary overload: %s", o.ID()) - } - if o.hasLateBinding { - return nil, fmt.Errorf("overload already has a late binding: %s", o.ID()) - } - o.unaryOp = binding - return o, nil - } -} - -// BinaryBinding provides the implementation of a binary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func BinaryBinding(binding functions.BinaryOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - if len(o.ArgTypes()) != 2 { - return nil, fmt.Errorf("binary function bound to non-binary overload: %s", o.ID()) - } - if o.hasLateBinding { - return nil, fmt.Errorf("overload already has a late binding: %s", o.ID()) - } - o.binaryOp = binding - return o, nil - } -} - -// FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func FunctionBinding(binding functions.FunctionOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - if o.hasLateBinding { - return nil, fmt.Errorf("overload already has a late binding: %s", o.ID()) - } - o.functionOp = binding - return o, nil - } -} - -// LateFunctionBinding indicates that the function has a binding which is not known at compile time. -// This is useful for functions which have side-effects or are not deterministically computable. -func LateFunctionBinding() OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - o.hasLateBinding = true - return o, nil - } -} - -// OverloadIsNonStrict enables the function to be called with error and unknown argument values. -// -// Note: do not use this option unless absoluately necessary as it should be an uncommon feature. -func OverloadIsNonStrict() OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - o.nonStrict = true - return o, nil - } -} - -// OverloadOperandTrait configures a set of traits which the first argument to the overload must implement in order to be -// successfully invoked. -func OverloadOperandTrait(trait int) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - o.operandTrait = trait - return o, nil - } -} - -// NewConstant creates a new constant declaration. -func NewConstant(name string, t *types.Type, v ref.Val) *VariableDecl { - return &VariableDecl{name: name, varType: t, value: v} -} - -// NewVariable creates a new variable declaration. -func NewVariable(name string, t *types.Type) *VariableDecl { - return &VariableDecl{name: name, varType: t} -} - -// NewVariableWithDoc creates a new variable declaration with usage documentation. -func NewVariableWithDoc(name string, t *types.Type, doc string) *VariableDecl { - return &VariableDecl{name: name, varType: t, doc: doc} -} - -// VariableDecl defines a variable declaration which may optionally have a constant value. -type VariableDecl struct { - name string - doc string - varType *types.Type - value ref.Val -} - -// Documentation returns name, type, and description for the variable. -func (v *VariableDecl) Documentation() *common.Doc { - if v == nil { - return nil - } - return common.NewVariableDoc(v.Name(), describeCELType(v.Type()), v.Description()) -} - -// Name returns the fully-qualified variable name -func (v *VariableDecl) Name() string { - if v == nil { - return "" - } - return v.name -} - -// Description returns the usage documentation for the variable, if set. -// -// Good usage instructions provide information about the valid formats, ranges, sizes for the variable type. -func (v *VariableDecl) Description() string { - if v == nil { - return "" - } - return v.doc -} - -// Type returns the types.Type value associated with the variable. -func (v *VariableDecl) Type() *types.Type { - if v == nil { - // types.Type is nil-safe - return nil - } - return v.varType -} - -// Value returns the constant value associated with the declaration. -func (v *VariableDecl) Value() ref.Val { - if v == nil { - return nil - } - return v.value -} - -// DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input. -func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool { - if v == other { - return true - } - return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type()) -} - -// TypeVariable creates a new type identifier for use within a types.Provider -func TypeVariable(t *types.Type) *VariableDecl { - return NewVariable(t.TypeName(), types.NewTypeTypeWithParam(t)) -} - -// VariableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. -func VariableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { - return variableDeclToExprDecl(v) -} - -// variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. -func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { - varType, err := types.TypeToExprType(v.Type()) - if err != nil { - return nil, err - } - return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil -} - -// FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. -func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { - return functionDeclToExprDecl(f) -} - -// functionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. -func functionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { - overloads := make([]*exprpb.Decl_FunctionDecl_Overload, len(f.overloads)) - for i, oID := range f.overloadOrdinals { - o := f.overloads[oID] - paramNames := map[string]struct{}{} - argTypes := make([]*exprpb.Type, len(o.ArgTypes())) - for j, a := range o.ArgTypes() { - collectParamNames(paramNames, a) - at, err := types.TypeToExprType(a) - if err != nil { - return nil, err - } - argTypes[j] = at - } - collectParamNames(paramNames, o.ResultType()) - resultType, err := types.TypeToExprType(o.ResultType()) - if err != nil { - return nil, err - } - if len(paramNames) == 0 { - if o.IsMemberFunction() { - overloads[i] = chkdecls.NewInstanceOverload(oID, argTypes, resultType) - } else { - overloads[i] = chkdecls.NewOverload(oID, argTypes, resultType) - } - } else { - params := []string{} - for pn := range paramNames { - params = append(params, pn) - } - if o.IsMemberFunction() { - overloads[i] = chkdecls.NewParameterizedInstanceOverload(oID, argTypes, resultType, params) - } else { - overloads[i] = chkdecls.NewParameterizedOverload(oID, argTypes, resultType, params) - } - } - doc := common.MultilineDescription(o.Examples()...) - overloads[i].Doc = doc - } - return chkdecls.NewFunctionWithDoc(f.Name(), f.Description(), overloads...), nil -} - -func collectParamNames(paramNames map[string]struct{}, arg *types.Type) { - if arg.Kind() == types.TypeParamKind { - paramNames[arg.TypeName()] = struct{}{} - } - for _, param := range arg.Parameters() { - collectParamNames(paramNames, param) - } -} - -func formatSignature(fnName string, o *OverloadDecl) string { - if opName, isOperator := operators.FindReverse(fnName); isOperator { - if opName == "" { - opName = fnName - } - return formatOperator(opName, o) - } - return formatCall(fnName, o) -} - -func formatOperator(opName string, o *OverloadDecl) string { - args := o.ArgTypes() - argTypes := make([]string, len(o.ArgTypes())) - for j, a := range args { - argTypes[j] = describeCELType(a) - } - ret := describeCELType(o.ResultType()) - switch len(args) { - case 1: - return fmt.Sprintf("%s%s -> %s", opName, argTypes[0], ret) - case 2: - if opName == operators.Index { - return fmt.Sprintf("%s[%s] -> %s", argTypes[0], argTypes[1], ret) - } - return fmt.Sprintf("%s %s %s -> %s", argTypes[0], opName, argTypes[1], ret) - default: - if opName == operators.Conditional { - return fmt.Sprint("bool ? : -> ") - } - return formatCall(opName, o) - } -} - -func formatCall(funcName string, o *OverloadDecl) string { - args := make([]string, len(o.ArgTypes())) - ret := describeCELType(o.ResultType()) - for j, a := range o.ArgTypes() { - args[j] = describeCELType(a) - } - if o.IsMemberFunction() { - target := args[0] - args = args[1:] - return fmt.Sprintf("%s.%s(%s) -> %s", target, funcName, strings.Join(args, ", "), ret) - } - return fmt.Sprintf("%s(%s) -> %s", funcName, strings.Join(args, ", "), ret) -} - -func describeCELType(t *types.Type) string { - if t.Kind() == types.TypeKind { - return "type" - } - return t.String() -} - -var ( - emptyArgs []*types.Type -) diff --git a/vendor/github.com/google/cel-go/common/doc.go b/vendor/github.com/google/cel-go/common/doc.go deleted file mode 100644 index 06eae3642..000000000 --- a/vendor/github.com/google/cel-go/common/doc.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package common defines types and utilities common to expression parsing, -// checking, and interpretation -package common - -import ( - "strings" - "unicode" -) - -// DocKind indicates the type of documentation element. -type DocKind int - -const ( - // DocEnv represents environment variable documentation. - DocEnv DocKind = iota + 1 - // DocFunction represents function documentation. - DocFunction - // DocOverload represents function overload documentation. - DocOverload - // DocVariable represents variable documentation. - DocVariable - // DocMacro represents macro documentation. - DocMacro - // DocExample represents example documentation. - DocExample -) - -// Doc holds the documentation details for a specific program element like -// a variable, function, macro, or example. -type Doc struct { - // Kind specifies the type of documentation element (e.g., Function, Variable). - Kind DocKind - - // Name is the identifier of the documented element (e.g., function name, variable name). - Name string - - // Type is the data type associated with the element, primarily used for variables. - Type string - - // Signature represents the function or overload signature. - Signature string - - // Description holds the textual description of the element, potentially spanning multiple lines. - Description string - - // Children holds nested documentation elements, such as overloads for a function - // or examples for a function/macro. - Children []*Doc -} - -// MultilineDescription combines multiple lines into a newline separated string. -func MultilineDescription(lines ...string) string { - return strings.Join(lines, "\n") -} - -// ParseDescription takes a single string containing newline characters and splits -// it into a multiline description. All empty lines will be skipped. -// -// Returns an empty string if the input string is empty. -func ParseDescription(doc string) string { - var lines []string - if len(doc) != 0 { - // Split the input string by newline characters. - for _, line := range strings.Split(doc, "\n") { - l := strings.TrimRightFunc(line, unicode.IsSpace) - if len(l) == 0 { - continue - } - lines = append(lines, l) - } - } - // Return an empty slice if the input is empty. - return MultilineDescription(lines...) -} - -// ParseDescriptions splits a documentation string into multiple multi-line description -// sections, using blank lines as delimiters. -func ParseDescriptions(doc string) []string { - var examples []string - if len(doc) != 0 { - lines := strings.Split(doc, "\n") - lineStart := 0 - for i, l := range lines { - // Trim trailing whitespace to identify effectively blank lines. - l = strings.TrimRightFunc(l, unicode.IsSpace) - // If a line is blank, it marks the end of the current section. - if len(l) == 0 { - // Start the next section after the blank line. - ex := lines[lineStart:i] - if len(ex) != 0 { - examples = append(examples, MultilineDescription(ex...)) - } - lineStart = i + 1 - } - } - // Append the last section if it wasn't terminated by a blank line. - if lineStart < len(lines) { - examples = append(examples, MultilineDescription(lines[lineStart:]...)) - } - } - return examples -} - -// NewVariableDoc creates a new Doc struct specifically for documenting a variable. -func NewVariableDoc(name, celType, description string) *Doc { - return &Doc{ - Kind: DocVariable, - Name: name, - Type: celType, - Description: ParseDescription(description), - } -} - -// NewFunctionDoc creates a new Doc struct for documenting a function. -func NewFunctionDoc(name, description string, overloads ...*Doc) *Doc { - return &Doc{ - Kind: DocFunction, - Name: name, - Description: ParseDescription(description), - Children: overloads, - } -} - -// NewOverloadDoc creates a new Doc struct for a function example. -func NewOverloadDoc(id, signature string, examples ...*Doc) *Doc { - return &Doc{ - Kind: DocOverload, - Name: id, - Signature: signature, - Children: examples, - } -} - -// NewMacroDoc creates a new Doc struct for documenting a macro. -func NewMacroDoc(name, description string, examples ...*Doc) *Doc { - return &Doc{ - Kind: DocMacro, - Name: name, - Description: ParseDescription(description), - Children: examples, - } -} - -// NewExampleDoc creates a new Doc struct specifically for holding an example. -func NewExampleDoc(ex string) *Doc { - return &Doc{ - Kind: DocExample, - Description: ex, - } -} - -// Documentor is an interface for types that can provide their own documentation. -type Documentor interface { - // Documentation returns the documentation coded by the DocKind to assist - // with text formatting. - Documentation() *Doc -} diff --git a/vendor/github.com/google/cel-go/common/env/BUILD.bazel b/vendor/github.com/google/cel-go/common/env/BUILD.bazel deleted file mode 100644 index aebe1e544..000000000 --- a/vendor/github.com/google/cel-go/common/env/BUILD.bazel +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "env.go", - ], - importpath = "github.com/google/cel-go/common/env", - deps = [ - "//common:go_default_library", - "//common/decls:go_default_library", - "//common/types:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "env_test.go", - ], - data = glob(["testdata/**"]), - embed = [":go_default_library"], - deps = [ - "//common/decls:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "@in_gopkg_yaml_v3//:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/env/env.go b/vendor/github.com/google/cel-go/common/env/env.go deleted file mode 100644 index d848860c2..000000000 --- a/vendor/github.com/google/cel-go/common/env/env.go +++ /dev/null @@ -1,887 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package env provides a representation of a CEL environment. -package env - -import ( - "errors" - "fmt" - "math" - "strconv" - "strings" - - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/types" -) - -// NewConfig creates an instance of a YAML serializable CEL environment configuration. -func NewConfig(name string) *Config { - return &Config{ - Name: name, - } -} - -// Config represents a serializable form of the CEL environment configuration. -// -// Note: custom validations, feature flags, and performance tuning parameters are not (yet) -// considered part of the core CEL environment configuration and should be managed separately -// until a common convention for such settings is developed. -type Config struct { - Name string `yaml:"name,omitempty"` - Description string `yaml:"description,omitempty"` - Container string `yaml:"container,omitempty"` - Imports []*Import `yaml:"imports,omitempty"` - StdLib *LibrarySubset `yaml:"stdlib,omitempty"` - Extensions []*Extension `yaml:"extensions,omitempty"` - ContextVariable *ContextVariable `yaml:"context_variable,omitempty"` - Variables []*Variable `yaml:"variables,omitempty"` - Functions []*Function `yaml:"functions,omitempty"` - Validators []*Validator `yaml:"validators,omitempty"` - Features []*Feature `yaml:"features,omitempty"` -} - -// Validate validates the whole configuration is well-formed. -func (c *Config) Validate() error { - if c == nil { - return nil - } - var errs []error - for _, imp := range c.Imports { - if err := imp.Validate(); err != nil { - errs = append(errs, err) - } - } - if err := c.StdLib.Validate(); err != nil { - errs = append(errs, err) - } - for _, ext := range c.Extensions { - if err := ext.Validate(); err != nil { - errs = append(errs, err) - } - } - if err := c.ContextVariable.Validate(); err != nil { - errs = append(errs, err) - } - if c.ContextVariable != nil && len(c.Variables) != 0 { - errs = append(errs, errors.New("invalid config: either context variable or variables may be set, but not both")) - } - for _, v := range c.Variables { - if err := v.Validate(); err != nil { - errs = append(errs, err) - } - } - for _, fn := range c.Functions { - if err := fn.Validate(); err != nil { - errs = append(errs, err) - } - } - for _, feat := range c.Features { - if err := feat.Validate(); err != nil { - errs = append(errs, err) - } - } - for _, val := range c.Validators { - if err := val.Validate(); err != nil { - errs = append(errs, err) - } - } - return errors.Join(errs...) -} - -// SetContainer configures the container name for this configuration. -func (c *Config) SetContainer(container string) *Config { - c.Container = container - return c -} - -// AddVariableDecls adds one or more variables to the config, converting them to serializable values first. -// -// VariableDecl inputs are expected to be well-formed. -func (c *Config) AddVariableDecls(vars ...*decls.VariableDecl) *Config { - convVars := make([]*Variable, len(vars)) - for i, v := range vars { - if v == nil { - continue - } - cv := NewVariable(v.Name(), SerializeTypeDesc(v.Type())) - cv.Description = v.Description() - convVars[i] = cv - } - return c.AddVariables(convVars...) -} - -// AddVariables adds one or more vairables to the config. -func (c *Config) AddVariables(vars ...*Variable) *Config { - c.Variables = append(c.Variables, vars...) - return c -} - -// SetContextVariable configures the ContextVariable for this configuration. -func (c *Config) SetContextVariable(ctx *ContextVariable) *Config { - c.ContextVariable = ctx - return c -} - -// AddFunctionDecls adds one or more functions to the config, converting them to serializable values first. -// -// FunctionDecl inputs are expected to be well-formed. -func (c *Config) AddFunctionDecls(funcs ...*decls.FunctionDecl) *Config { - convFuncs := make([]*Function, len(funcs)) - for i, fn := range funcs { - if fn == nil { - continue - } - overloads := make([]*Overload, 0, len(fn.OverloadDecls())) - for _, o := range fn.OverloadDecls() { - overloadID := o.ID() - args := make([]*TypeDesc, 0, len(o.ArgTypes())) - for _, a := range o.ArgTypes() { - args = append(args, SerializeTypeDesc(a)) - } - ret := SerializeTypeDesc(o.ResultType()) - var overload *Overload - if o.IsMemberFunction() { - overload = NewMemberOverload(overloadID, args[0], args[1:], ret) - } else { - overload = NewOverload(overloadID, args, ret) - } - exampleCount := len(o.Examples()) - if exampleCount > 0 { - overload.Examples = o.Examples() - } - overloads = append(overloads, overload) - } - cf := NewFunction(fn.Name(), overloads...) - cf.Description = fn.Description() - convFuncs[i] = cf - } - return c.AddFunctions(convFuncs...) -} - -// AddFunctions adds one or more functions to the config. -func (c *Config) AddFunctions(funcs ...*Function) *Config { - c.Functions = append(c.Functions, funcs...) - return c -} - -// SetStdLib configures the LibrarySubset for the standard library. -func (c *Config) SetStdLib(subset *LibrarySubset) *Config { - c.StdLib = subset - return c -} - -// AddImports appends a set of imports to the config. -func (c *Config) AddImports(imps ...*Import) *Config { - c.Imports = append(c.Imports, imps...) - return c -} - -// AddExtensions appends a set of extensions to the config. -func (c *Config) AddExtensions(exts ...*Extension) *Config { - c.Extensions = append(c.Extensions, exts...) - return c -} - -// AddValidators appends one or more validators to the config. -func (c *Config) AddValidators(vals ...*Validator) *Config { - c.Validators = append(c.Validators, vals...) - return c -} - -// AddFeatures appends one or more features to the config. -func (c *Config) AddFeatures(feats ...*Feature) *Config { - c.Features = append(c.Features, feats...) - return c -} - -// NewImport returns a serializable import value from the qualified type name. -func NewImport(name string) *Import { - return &Import{Name: name} -} - -// Import represents a type name that will be appreviated by its simple name using -// the cel.Abbrevs() option. -type Import struct { - Name string `yaml:"name"` -} - -// Validate validates the import configuration is well-formed. -func (imp *Import) Validate() error { - if imp == nil { - return errors.New("invalid import: nil") - } - if imp.Name == "" { - return errors.New("invalid import: missing type name") - } - return nil -} - -// NewVariable returns a serializable variable from a name and type definition -func NewVariable(name string, t *TypeDesc) *Variable { - return NewVariableWithDoc(name, t, "") -} - -// NewVariableWithDoc returns a serializable variable from a name, type definition, and doc string. -func NewVariableWithDoc(name string, t *TypeDesc, doc string) *Variable { - return &Variable{Name: name, TypeDesc: t, Description: doc} -} - -// Variable represents a typed variable declaration which will be published via the -// cel.VariableDecls() option. -type Variable struct { - Name string `yaml:"name"` - Description string `yaml:"description,omitempty"` - - // Type represents the type declaration for the variable. - // - // Deprecated: use the embedded *TypeDesc fields directly. - Type *TypeDesc `yaml:"type,omitempty"` - - // TypeDesc is an embedded set of fields allowing for the specification of the Variable type. - *TypeDesc `yaml:",inline"` -} - -// Validate validates the variable configuration is well-formed. -func (v *Variable) Validate() error { - if v == nil { - return errors.New("invalid variable: nil") - } - if v.Name == "" { - return errors.New("invalid variable: missing variable name") - } - if err := v.GetType().Validate(); err != nil { - return fmt.Errorf("invalid variable %q: %w", v.Name, err) - } - return nil -} - -// GetType returns the variable type description. -// -// Note, if both the embedded TypeDesc and the field Type are non-nil, the embedded TypeDesc will -// take precedence. -func (v *Variable) GetType() *TypeDesc { - if v == nil { - return nil - } - if v.TypeDesc != nil { - return v.TypeDesc - } - if v.Type != nil { - return v.Type - } - return nil -} - -// AsCELVariable converts the serializable form of the Variable into a CEL environment declaration. -func (v *Variable) AsCELVariable(tp types.Provider) (*decls.VariableDecl, error) { - if err := v.Validate(); err != nil { - return nil, err - } - t, err := v.GetType().AsCELType(tp) - if err != nil { - return nil, fmt.Errorf("invalid variable %q: %w", v.Name, err) - } - return decls.NewVariableWithDoc(v.Name, t, v.Description), nil -} - -// NewContextVariable returns a serializable context variable with a specific type name. -func NewContextVariable(typeName string) *ContextVariable { - return &ContextVariable{TypeName: typeName} -} - -// ContextVariable represents a structured message whose fields are to be treated as the top-level -// variable identifiers within CEL expressions. -type ContextVariable struct { - // TypeName represents the fully qualified typename of the context variable. - // Currently, only protobuf types are supported. - TypeName string `yaml:"type_name"` -} - -// Validate validates the context-variable configuration is well-formed. -func (ctx *ContextVariable) Validate() error { - if ctx == nil { - return nil - } - if ctx.TypeName == "" { - return errors.New("invalid context variable: missing type name") - } - return nil -} - -// NewFunction creates a serializable function and overload set. -func NewFunction(name string, overloads ...*Overload) *Function { - return &Function{Name: name, Overloads: overloads} -} - -// NewFunctionWithDoc creates a serializable function and overload set. -func NewFunctionWithDoc(name, doc string, overloads ...*Overload) *Function { - return &Function{Name: name, Description: doc, Overloads: overloads} -} - -// Function represents the serializable format of a function and its overloads. -type Function struct { - Name string `yaml:"name"` - Description string `yaml:"description,omitempty"` - Overloads []*Overload `yaml:"overloads,omitempty"` -} - -// Validate validates the function configuration is well-formed. -func (fn *Function) Validate() error { - if fn == nil { - return errors.New("invalid function: nil") - } - if fn.Name == "" { - return errors.New("invalid function: missing function name") - } - if len(fn.Overloads) == 0 { - return fmt.Errorf("invalid function %q: missing overloads", fn.Name) - } - var errs []error - for _, o := range fn.Overloads { - if err := o.Validate(); err != nil { - errs = append(errs, fmt.Errorf("invalid function %q: %w", fn.Name, err)) - } - } - return errors.Join(errs...) -} - -// AsCELFunction converts the serializable form of the Function into CEL environment declaration. -func (fn *Function) AsCELFunction(tp types.Provider) (*decls.FunctionDecl, error) { - if err := fn.Validate(); err != nil { - return nil, err - } - opts := make([]decls.FunctionOpt, 0, len(fn.Overloads)+1) - for _, o := range fn.Overloads { - opt, err := o.AsFunctionOption(tp) - opts = append(opts, opt) - if err != nil { - return nil, fmt.Errorf("invalid function %q: %w", fn.Name, err) - } - } - if len(fn.Description) != 0 { - opts = append(opts, decls.FunctionDocs(fn.Description)) - } - return decls.NewFunction(fn.Name, opts...) -} - -// NewOverload returns a new serializable representation of a global overload. -func NewOverload(id string, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload { - return &Overload{ID: id, Args: args, Return: ret, Examples: examples} -} - -// NewMemberOverload returns a new serializable representation of a member (receiver) overload. -func NewMemberOverload(id string, target *TypeDesc, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload { - return &Overload{ID: id, Target: target, Args: args, Return: ret, Examples: examples} -} - -// Overload represents the serializable format of a function overload. -type Overload struct { - ID string `yaml:"id"` - Examples []string `yaml:"examples,omitempty"` - Target *TypeDesc `yaml:"target,omitempty"` - Args []*TypeDesc `yaml:"args,omitempty"` - Return *TypeDesc `yaml:"return,omitempty"` -} - -// Validate validates the overload configuration is well-formed. -func (od *Overload) Validate() error { - if od == nil { - return errors.New("invalid overload: nil") - } - if od.ID == "" { - return errors.New("invalid overload: missing overload id") - } - var errs []error - if od.Target != nil { - if err := od.Target.Validate(); err != nil { - errs = append(errs, fmt.Errorf("invalid overload %q target: %w", od.ID, err)) - } - } - for i, arg := range od.Args { - if err := arg.Validate(); err != nil { - errs = append(errs, fmt.Errorf("invalid overload %q arg[%d]: %w", od.ID, i, err)) - } - } - if err := od.Return.Validate(); err != nil { - errs = append(errs, fmt.Errorf("invalid overload %q return: %w", od.ID, err)) - } - return errors.Join(errs...) -} - -// AsFunctionOption converts the serializable form of the Overload into a function declaration option. -func (od *Overload) AsFunctionOption(tp types.Provider) (decls.FunctionOpt, error) { - if err := od.Validate(); err != nil { - return nil, err - } - args := make([]*types.Type, len(od.Args)) - var err error - var errs []error - for i, a := range od.Args { - args[i], err = a.AsCELType(tp) - if err != nil { - errs = append(errs, err) - } - } - result, err := od.Return.AsCELType(tp) - if err != nil { - errs = append(errs, err) - } - if od.Target != nil { - t, err := od.Target.AsCELType(tp) - if err != nil { - return nil, errors.Join(append(errs, err)...) - } - args = append([]*types.Type{t}, args...) - return decls.MemberOverload(od.ID, args, result), nil - } - if len(errs) != 0 { - return nil, errors.Join(errs...) - } - return decls.Overload(od.ID, args, result, decls.OverloadExamples(od.Examples...)), nil -} - -// NewExtension creates a serializable Extension from a name and version string. -func NewExtension(name string, version uint32) *Extension { - versionString := "latest" - if version < math.MaxUint32 { - versionString = strconv.FormatUint(uint64(version), 10) - } - return &Extension{ - Name: name, - Version: versionString, - } -} - -// Extension represents a named and optionally versioned extension library configured in the environment. -type Extension struct { - // Name is either the LibraryName() or some short-hand simple identifier which is understood by the config-handler. - Name string `yaml:"name"` - - // Version may either be an unsigned long value or the string 'latest'. If empty, the value is treated as '0'. - Version string `yaml:"version,omitempty"` -} - -// Validate validates the extension configuration is well-formed. -func (e *Extension) Validate() error { - _, err := e.VersionNumber() - return err -} - -// VersionNumber returns the parsed version string, or an error if the version cannot be parsed. -func (e *Extension) VersionNumber() (uint32, error) { - if e == nil { - return 0, fmt.Errorf("invalid extension: nil") - } - if e.Name == "" { - return 0, fmt.Errorf("invalid extension: missing name") - } - if e.Version == "latest" { - return math.MaxUint32, nil - } - if e.Version == "" { - return 0, nil - } - ver, err := strconv.ParseUint(e.Version, 10, 32) - if err != nil { - return 0, fmt.Errorf("invalid extension %q version: %w", e.Name, err) - } - return uint32(ver), nil -} - -// NewLibrarySubset returns an empty library subsetting config which permits all library features. -func NewLibrarySubset() *LibrarySubset { - return &LibrarySubset{} -} - -// LibrarySubset indicates a subset of the macros and function supported by a subsettable library. -type LibrarySubset struct { - // Disabled indicates whether the library has been disabled, typically only used for - // default-enabled libraries like stdlib. - Disabled bool `yaml:"disabled,omitempty"` - - // DisableMacros disables macros for the given library. - DisableMacros bool `yaml:"disable_macros,omitempty"` - - // IncludeMacros specifies a set of macro function names to include in the subset. - IncludeMacros []string `yaml:"include_macros,omitempty"` - - // ExcludeMacros specifies a set of macro function names to exclude from the subset. - // Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored. - ExcludeMacros []string `yaml:"exclude_macros,omitempty"` - - // IncludeFunctions specifies a set of functions to include in the subset. - // - // Note: the overloads specified in the subset need only specify their ID. - // Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored. - IncludeFunctions []*Function `yaml:"include_functions,omitempty"` - - // ExcludeFunctions specifies the set of functions to exclude from the subset. - // - // Note: the overloads specified in the subset need only specify their ID. - ExcludeFunctions []*Function `yaml:"exclude_functions,omitempty"` -} - -// Validate validates the library configuration is well-formed. -// -// For example, setting both the IncludeMacros and ExcludeMacros together could be confusing -// and create a broken expectation, likewise for IncludeFunctions and ExcludeFunctions. -func (lib *LibrarySubset) Validate() error { - if lib == nil { - return nil - } - var errs []error - if len(lib.IncludeMacros) != 0 && len(lib.ExcludeMacros) != 0 { - errs = append(errs, errors.New("invalid subset: cannot both include and exclude macros")) - } - if len(lib.IncludeFunctions) != 0 && len(lib.ExcludeFunctions) != 0 { - errs = append(errs, errors.New("invalid subset: cannot both include and exclude functions")) - } - return errors.Join(errs...) -} - -// SubsetFunction produces a function declaration which matches the supported subset, or nil -// if the function is not supported by the LibrarySubset. -// -// For IncludeFunctions, if the function does not specify a set of overloads to include, the -// whole function definition is included. If overloads are set, then a new function which -// includes only the specified overloads is produced. -// -// For ExcludeFunctions, if the function does not specify a set of overloads to exclude, the -// whole function definition is excluded. If overloads are set, then a new function which -// includes only the permitted overloads is produced. -func (lib *LibrarySubset) SubsetFunction(fn *decls.FunctionDecl) (*decls.FunctionDecl, bool) { - // When lib is null, it should indicate that all values are included in the subset. - if lib == nil { - return fn, true - } - if lib.Disabled { - return nil, false - } - if len(lib.IncludeFunctions) != 0 { - for _, include := range lib.IncludeFunctions { - if include.Name != fn.Name() { - continue - } - if len(include.Overloads) == 0 { - return fn, true - } - overloadIDs := make([]string, len(include.Overloads)) - for i, o := range include.Overloads { - overloadIDs[i] = o.ID - } - return fn.Subset(decls.IncludeOverloads(overloadIDs...)), true - } - return nil, false - } - if len(lib.ExcludeFunctions) != 0 { - for _, exclude := range lib.ExcludeFunctions { - if exclude.Name != fn.Name() { - continue - } - if len(exclude.Overloads) == 0 { - return nil, false - } - overloadIDs := make([]string, len(exclude.Overloads)) - for i, o := range exclude.Overloads { - overloadIDs[i] = o.ID - } - return fn.Subset(decls.ExcludeOverloads(overloadIDs...)), true - } - return fn, true - } - return fn, true -} - -// SubsetMacro indicates whether the macro function should be included in the library subset. -func (lib *LibrarySubset) SubsetMacro(macroFunction string) bool { - // When lib is null, it should indicate that all values are included in the subset. - if lib == nil { - return true - } - if lib.Disabled || lib.DisableMacros { - return false - } - if len(lib.IncludeMacros) != 0 { - for _, name := range lib.IncludeMacros { - if name == macroFunction { - return true - } - } - return false - } - if len(lib.ExcludeMacros) != 0 { - for _, name := range lib.ExcludeMacros { - if name == macroFunction { - return false - } - } - return true - } - return true -} - -// SetDisabled disables or enables the library. -func (lib *LibrarySubset) SetDisabled(value bool) *LibrarySubset { - lib.Disabled = value - return lib -} - -// SetDisableMacros disables the macros for the library. -func (lib *LibrarySubset) SetDisableMacros(value bool) *LibrarySubset { - lib.DisableMacros = value - return lib -} - -// AddIncludedMacros allow-lists one or more macros by function name. -// -// Note, this option will override any excluded macros. -func (lib *LibrarySubset) AddIncludedMacros(macros ...string) *LibrarySubset { - lib.IncludeMacros = append(lib.IncludeMacros, macros...) - return lib -} - -// AddExcludedMacros deny-lists one or more macros by function name. -func (lib *LibrarySubset) AddExcludedMacros(macros ...string) *LibrarySubset { - lib.ExcludeMacros = append(lib.ExcludeMacros, macros...) - return lib -} - -// AddIncludedFunctions allow-lists one or more functions from the subset. -// -// Note, this option will override any excluded functions. -func (lib *LibrarySubset) AddIncludedFunctions(funcs ...*Function) *LibrarySubset { - lib.IncludeFunctions = append(lib.IncludeFunctions, funcs...) - return lib -} - -// AddExcludedFunctions deny-lists one or more functions from the subset. -func (lib *LibrarySubset) AddExcludedFunctions(funcs ...*Function) *LibrarySubset { - lib.ExcludeFunctions = append(lib.ExcludeFunctions, funcs...) - return lib -} - -// NewValidator returns a named Validator instance. -func NewValidator(name string) *Validator { - return &Validator{Name: name} -} - -// Validator represents a named validator with an optional map-based configuration object. -// -// Note: the map-keys must directly correspond to the internal representation of the original -// validator, and should only use primitive scalar types as values at this time. -type Validator struct { - Name string `yaml:"name"` - Config map[string]any `yaml:"config,omitempty"` -} - -// Validate validates the configuration of the validator object. -func (v *Validator) Validate() error { - if v == nil { - return errors.New("invalid validator: nil") - } - if v.Name == "" { - return errors.New("invalid validator: missing name") - } - return nil -} - -// SetConfig sets the set of map key-value pairs associated with this validator's configuration. -func (v *Validator) SetConfig(config map[string]any) *Validator { - v.Config = config - return v -} - -// ConfigValue retrieves the value associated with the config key name, if one exists. -func (v *Validator) ConfigValue(name string) (any, bool) { - if v == nil { - return nil, false - } - value, found := v.Config[name] - return value, found -} - -// NewFeature creates a new feature flag with a boolean enablement flag. -func NewFeature(name string, enabled bool) *Feature { - return &Feature{Name: name, Enabled: enabled} -} - -// Feature represents a named boolean feature flag supported by CEL. -type Feature struct { - Name string `yaml:"name"` - Enabled bool `yaml:"enabled"` -} - -// Validate validates whether the feature is well-configured. -func (feat *Feature) Validate() error { - if feat == nil { - return errors.New("invalid feature: nil") - } - if feat.Name == "" { - return errors.New("invalid feature: missing name") - } - return nil -} - -// NewTypeDesc describes a simple or complex type with parameters. -func NewTypeDesc(typeName string, params ...*TypeDesc) *TypeDesc { - return &TypeDesc{TypeName: typeName, Params: params} -} - -// NewTypeParam describe a type-param type. -func NewTypeParam(paramName string) *TypeDesc { - return &TypeDesc{TypeName: paramName, IsTypeParam: true} -} - -// TypeDesc represents the serializable format of a CEL *types.Type value. -type TypeDesc struct { - TypeName string `yaml:"type_name"` - Params []*TypeDesc `yaml:"params,omitempty"` - IsTypeParam bool `yaml:"is_type_param,omitempty"` -} - -// String implements the strings.Stringer interface method. -func (td *TypeDesc) String() string { - ps := make([]string, len(td.Params)) - for i, p := range td.Params { - ps[i] = p.String() - } - typeName := td.TypeName - if len(ps) != 0 { - typeName = fmt.Sprintf("%s(%s)", typeName, strings.Join(ps, ",")) - } - return typeName -} - -// Validate validates the type configuration is well-formed. -func (td *TypeDesc) Validate() error { - if td == nil { - return errors.New("invalid type: nil") - } - if td.TypeName == "" { - return errors.New("invalid type: missing type name") - } - if td.IsTypeParam && len(td.Params) != 0 { - return errors.New("invalid type: param type cannot have parameters") - } - switch td.TypeName { - case "list": - if len(td.Params) != 1 { - return fmt.Errorf("invalid type: list expects 1 parameter, got %d", len(td.Params)) - } - return td.Params[0].Validate() - case "map": - if len(td.Params) != 2 { - return fmt.Errorf("invalid type: map expects 2 parameters, got %d", len(td.Params)) - } - if err := td.Params[0].Validate(); err != nil { - return err - } - if err := td.Params[1].Validate(); err != nil { - return err - } - case "optional_type": - if len(td.Params) != 1 { - return fmt.Errorf("invalid type: optional_type expects 1 parameter, got %d", len(td.Params)) - } - return td.Params[0].Validate() - default: - } - return nil -} - -// AsCELType converts the serializable object to a *types.Type value. -func (td *TypeDesc) AsCELType(tp types.Provider) (*types.Type, error) { - err := td.Validate() - if err != nil { - return nil, err - } - switch td.TypeName { - case "dyn": - return types.DynType, nil - case "map": - kt, err := td.Params[0].AsCELType(tp) - if err != nil { - return nil, err - } - vt, err := td.Params[1].AsCELType(tp) - if err != nil { - return nil, err - } - return types.NewMapType(kt, vt), nil - case "list": - et, err := td.Params[0].AsCELType(tp) - if err != nil { - return nil, err - } - return types.NewListType(et), nil - case "optional_type": - et, err := td.Params[0].AsCELType(tp) - if err != nil { - return nil, err - } - return types.NewOptionalType(et), nil - default: - if td.IsTypeParam { - return types.NewTypeParamType(td.TypeName), nil - } - if msgType, found := tp.FindStructType(td.TypeName); found { - // First parameter is the type name. - return msgType.Parameters()[0], nil - } - t, found := tp.FindIdent(td.TypeName) - if !found { - return nil, fmt.Errorf("undefined type name: %q", td.TypeName) - } - _, ok := t.(*types.Type) - if ok && len(td.Params) == 0 { - return t.(*types.Type), nil - } - params := make([]*types.Type, len(td.Params)) - for i, p := range td.Params { - params[i], err = p.AsCELType(tp) - if err != nil { - return nil, err - } - } - return types.NewOpaqueType(td.TypeName, params...), nil - } -} - -// SerializeTypeDesc converts a CEL native *types.Type to a serializable TypeDesc. -func SerializeTypeDesc(t *types.Type) *TypeDesc { - typeName := t.TypeName() - if t.Kind() == types.TypeParamKind { - return NewTypeParam(typeName) - } - if t != types.NullType && t.IsAssignableType(types.NullType) { - if wrapperTypeName, found := wrapperTypes[t.Kind()]; found { - return NewTypeDesc(wrapperTypeName) - } - } - var params []*TypeDesc - for _, p := range t.Parameters() { - params = append(params, SerializeTypeDesc(p)) - } - return NewTypeDesc(typeName, params...) -} - -var wrapperTypes = map[types.Kind]string{ - types.BoolKind: "google.protobuf.BoolValue", - types.BytesKind: "google.protobuf.BytesValue", - types.DoubleKind: "google.protobuf.DoubleValue", - types.IntKind: "google.protobuf.Int64Value", - types.StringKind: "google.protobuf.StringValue", - types.UintKind: "google.protobuf.UInt64Value", -} diff --git a/vendor/github.com/google/cel-go/common/error.go b/vendor/github.com/google/cel-go/common/error.go deleted file mode 100644 index 0cf21345e..000000000 --- a/vendor/github.com/google/cel-go/common/error.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package common - -import ( - "fmt" - "strings" - "unicode/utf8" -) - -// NewError creates an error associated with an expression id with the given message at the given location. -func NewError(id int64, message string, location Location) *Error { - return &Error{Message: message, Location: location, ExprID: id} -} - -// Error type which references an expression id, a location within source, and a message. -type Error struct { - Location Location - Message string - ExprID int64 -} - -const ( - dot = "." - ind = "^" - wideDot = "\uff0e" - wideInd = "\uff3e" - - // maxSnippetLength is the largest number of characters which can be rendered in an error message snippet. - maxSnippetLength = 16384 -) - -// ToDisplayString decorates the error message with the source location. -func (e *Error) ToDisplayString(source Source) string { - var result = fmt.Sprintf("ERROR: %s:%d:%d: %s", - source.Description(), - e.Location.Line(), - e.Location.Column()+1, // add one to the 0-based column for display - e.Message) - if snippet, found := source.Snippet(e.Location.Line()); found && len(snippet) <= maxSnippetLength { - snippet := strings.Replace(snippet, "\t", " ", -1) - srcLine := "\n | " + snippet - var bytes = []byte(snippet) - var indLine = "\n | " - for i := 0; i < e.Location.Column() && len(bytes) > 0; i++ { - _, sz := utf8.DecodeRune(bytes) - bytes = bytes[sz:] - if sz > 1 { - indLine += wideDot - } else { - indLine += dot - } - } - if _, sz := utf8.DecodeRune(bytes); sz > 1 { - indLine += wideInd - } else { - indLine += ind - } - result += srcLine + indLine - } - return result -} diff --git a/vendor/github.com/google/cel-go/common/errors.go b/vendor/github.com/google/cel-go/common/errors.go deleted file mode 100644 index c8865df8c..000000000 --- a/vendor/github.com/google/cel-go/common/errors.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package common - -import ( - "fmt" - "sort" - "strings" -) - -// Errors type which contains a list of errors observed during parsing. -type Errors struct { - errors []*Error - source Source - numErrors int - maxErrorsToReport int -} - -// NewErrors creates a new instance of the Errors type. -func NewErrors(source Source) *Errors { - src := source - if src == nil { - src = NewTextSource("") - } - return &Errors{ - errors: []*Error{}, - source: src, - maxErrorsToReport: 100, - } -} - -// ReportError records an error at a source location. -func (e *Errors) ReportError(l Location, format string, args ...any) { - e.ReportErrorAtID(0, l, format, args...) -} - -// ReportErrorString records an error at a source location. -func (e *Errors) ReportErrorString(l Location, message string) { - e.ReportErrorAtID(0, l, "%s", message) -} - -// ReportErrorAtID records an error at a source location and expression id. -func (e *Errors) ReportErrorAtID(id int64, l Location, format string, args ...any) { - e.numErrors++ - if e.numErrors > e.maxErrorsToReport { - return - } - err := &Error{ - ExprID: id, - Location: l, - Message: fmt.Sprintf(format, args...), - } - e.errors = append(e.errors, err) -} - -// GetErrors returns the list of observed errors. -func (e *Errors) GetErrors() []*Error { - return e.errors[:] -} - -// Append creates a new Errors object with the current and input errors. -func (e *Errors) Append(errs []*Error) *Errors { - return &Errors{ - errors: append(e.errors[:], errs...), - source: e.source, - numErrors: e.numErrors + len(errs), - maxErrorsToReport: e.maxErrorsToReport, - } -} - -// ToDisplayString returns the error set to a newline delimited string. -func (e *Errors) ToDisplayString() string { - errorsInString := e.maxErrorsToReport - if e.numErrors > e.maxErrorsToReport { - // add one more error to indicate the number of errors truncated. - errorsInString++ - } else { - // otherwise the error set will just contain the number of errors. - errorsInString = e.numErrors - } - - result := make([]string, errorsInString) - sort.SliceStable(e.errors, func(i, j int) bool { - ei := e.errors[i].Location - ej := e.errors[j].Location - return ei.Line() < ej.Line() || - (ei.Line() == ej.Line() && ei.Column() < ej.Column()) - }) - for i, err := range e.errors { - // This can happen during the append of two errors objects - if i >= e.maxErrorsToReport { - break - } - result[i] = err.ToDisplayString(e.source) - } - if e.numErrors > e.maxErrorsToReport { - result[e.maxErrorsToReport] = fmt.Sprintf("%d more errors were truncated", e.numErrors-e.maxErrorsToReport) - } - return strings.Join(result, "\n") -} diff --git a/vendor/github.com/google/cel-go/common/functions/BUILD.bazel b/vendor/github.com/google/cel-go/common/functions/BUILD.bazel deleted file mode 100644 index 3cc27d60c..000000000 --- a/vendor/github.com/google/cel-go/common/functions/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "functions.go", - ], - importpath = "github.com/google/cel-go/common/functions", - deps = [ - "//common/types/ref:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/functions/functions.go b/vendor/github.com/google/cel-go/common/functions/functions.go deleted file mode 100644 index 67f4a5944..000000000 --- a/vendor/github.com/google/cel-go/common/functions/functions.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package functions defines the standard builtin functions supported by the interpreter -package functions - -import "github.com/google/cel-go/common/types/ref" - -// Overload defines a named overload of a function, indicating an operand trait -// which must be present on the first argument to the overload as well as one -// of either a unary, binary, or function implementation. -// -// The majority of operators within the expression language are unary or binary -// and the specializations simplify the call contract for implementers of -// types with operator overloads. Any added complexity is assumed to be handled -// by the generic FunctionOp. -type Overload struct { - // Operator name as written in an expression or defined within - // operators.go. - Operator string - - // Operand trait used to dispatch the call. The zero-value indicates a - // global function overload or that one of the Unary / Binary / Function - // definitions should be used to execute the call. - OperandTrait int - - // Unary defines the overload with a UnaryOp implementation. May be nil. - Unary UnaryOp - - // Binary defines the overload with a BinaryOp implementation. May be nil. - Binary BinaryOp - - // Function defines the overload with a FunctionOp implementation. May be - // nil. - Function FunctionOp - - // NonStrict specifies whether the Overload will tolerate arguments that - // are types.Err or types.Unknown. - NonStrict bool -} - -// UnaryOp is a function that takes a single value and produces an output. -type UnaryOp func(value ref.Val) ref.Val - -// BinaryOp is a function that takes two values and produces an output. -type BinaryOp func(lhs ref.Val, rhs ref.Val) ref.Val - -// FunctionOp is a function with accepts zero or more arguments and produces -// a value or error as a result. -type FunctionOp func(values ...ref.Val) ref.Val diff --git a/vendor/github.com/google/cel-go/common/location.go b/vendor/github.com/google/cel-go/common/location.go deleted file mode 100644 index ec3fa7cb5..000000000 --- a/vendor/github.com/google/cel-go/common/location.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package common - -// Location interface to represent a location within Source. -type Location interface { - Line() int // 1-based line number within source. - Column() int // 0-based column number within source. -} - -// SourceLocation helper type to manually construct a location. -type SourceLocation struct { - line int - column int -} - -var ( - // Location implements the SourceLocation interface. - _ Location = &SourceLocation{} - // NoLocation is a particular illegal location. - NoLocation = &SourceLocation{-1, -1} -) - -// NewLocation creates a new location. -func NewLocation(line, column int) Location { - return &SourceLocation{ - line: line, - column: column} -} - -// Line returns the 1-based line of the location. -func (l *SourceLocation) Line() int { - return l.line -} - -// Column returns the 0-based column number of the location. -func (l *SourceLocation) Column() int { - return l.column -} diff --git a/vendor/github.com/google/cel-go/common/operators/BUILD.bazel b/vendor/github.com/google/cel-go/common/operators/BUILD.bazel deleted file mode 100644 index b5b67f062..000000000 --- a/vendor/github.com/google/cel-go/common/operators/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "operators.go", - ], - importpath = "github.com/google/cel-go/common/operators", -) diff --git a/vendor/github.com/google/cel-go/common/operators/operators.go b/vendor/github.com/google/cel-go/common/operators/operators.go deleted file mode 100644 index f9b39bda3..000000000 --- a/vendor/github.com/google/cel-go/common/operators/operators.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package operators defines the internal function names of operators. -// -// All operators in the expression language are modelled as function calls. -package operators - -// String "names" for CEL operators. -const ( - // Symbolic operators. - Conditional = "_?_:_" - LogicalAnd = "_&&_" - LogicalOr = "_||_" - LogicalNot = "!_" - Equals = "_==_" - NotEquals = "_!=_" - Less = "_<_" - LessEquals = "_<=_" - Greater = "_>_" - GreaterEquals = "_>=_" - Add = "_+_" - Subtract = "_-_" - Multiply = "_*_" - Divide = "_/_" - Modulo = "_%_" - Negate = "-_" - Index = "_[_]" - OptIndex = "_[?_]" - OptSelect = "_?._" - - // Macros, must have a valid identifier. - Has = "has" - All = "all" - Exists = "exists" - ExistsOne = "exists_one" - Map = "map" - Filter = "filter" - - // Named operators, must not have be valid identifiers. - NotStrictlyFalse = "@not_strictly_false" - In = "@in" - - // Deprecated: named operators with valid identifiers. - OldNotStrictlyFalse = "__not_strictly_false__" - OldIn = "_in_" -) - -var ( - operators = map[string]string{ - "+": Add, - "/": Divide, - "==": Equals, - ">": Greater, - ">=": GreaterEquals, - "in": In, - "<": Less, - "<=": LessEquals, - "%": Modulo, - "*": Multiply, - "!=": NotEquals, - "-": Subtract, - } - // operatorMap of the operator symbol which refers to a struct containing the display name, - // if applicable, the operator precedence, and the arity. - // - // If the symbol does not have a display name listed in the map, it is only because it requires - // special casing to render properly as text. - operatorMap = map[string]struct { - displayName string - precedence int - arity int - }{ - Conditional: {displayName: "", precedence: 8, arity: 3}, - LogicalOr: {displayName: "||", precedence: 7, arity: 2}, - LogicalAnd: {displayName: "&&", precedence: 6, arity: 2}, - Equals: {displayName: "==", precedence: 5, arity: 2}, - Greater: {displayName: ">", precedence: 5, arity: 2}, - GreaterEquals: {displayName: ">=", precedence: 5, arity: 2}, - In: {displayName: "in", precedence: 5, arity: 2}, - Less: {displayName: "<", precedence: 5, arity: 2}, - LessEquals: {displayName: "<=", precedence: 5, arity: 2}, - NotEquals: {displayName: "!=", precedence: 5, arity: 2}, - OldIn: {displayName: "in", precedence: 5, arity: 2}, - Add: {displayName: "+", precedence: 4, arity: 2}, - Subtract: {displayName: "-", precedence: 4, arity: 2}, - Divide: {displayName: "/", precedence: 3, arity: 2}, - Modulo: {displayName: "%", precedence: 3, arity: 2}, - Multiply: {displayName: "*", precedence: 3, arity: 2}, - LogicalNot: {displayName: "!", precedence: 2, arity: 1}, - Negate: {displayName: "-", precedence: 2, arity: 1}, - Index: {displayName: "", precedence: 1, arity: 2}, - OptIndex: {displayName: "", precedence: 1, arity: 2}, - OptSelect: {displayName: "", precedence: 1, arity: 2}, - } -) - -// Find the internal function name for an operator, if the input text is one. -func Find(text string) (string, bool) { - op, found := operators[text] - return op, found -} - -// FindReverse returns the unmangled, text representation of the operator. -func FindReverse(symbol string) (string, bool) { - op, found := operatorMap[symbol] - if !found { - return "", false - } - return op.displayName, true -} - -// FindReverseBinaryOperator returns the unmangled, text representation of a binary operator. -// -// If the symbol does refer to an operator, but the operator does not have a display name the -// result is false. -func FindReverseBinaryOperator(symbol string) (string, bool) { - op, found := operatorMap[symbol] - if !found || op.arity != 2 { - return "", false - } - if op.displayName == "" { - return "", false - } - return op.displayName, true -} - -// Precedence returns the operator precedence, where the higher the number indicates -// higher precedence operations. -func Precedence(symbol string) int { - op, found := operatorMap[symbol] - if !found { - return 0 - } - return op.precedence -} - -// Arity returns the number of argument the operator takes -// -1 is returned if an undefined symbol is provided -func Arity(symbol string) int { - op, found := operatorMap[symbol] - if !found { - return -1 - } - return op.arity -} diff --git a/vendor/github.com/google/cel-go/common/overloads/BUILD.bazel b/vendor/github.com/google/cel-go/common/overloads/BUILD.bazel deleted file mode 100644 index e46e2f483..000000000 --- a/vendor/github.com/google/cel-go/common/overloads/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "overloads.go", - ], - importpath = "github.com/google/cel-go/common/overloads", -) diff --git a/vendor/github.com/google/cel-go/common/overloads/overloads.go b/vendor/github.com/google/cel-go/common/overloads/overloads.go deleted file mode 100644 index 9d50f4367..000000000 --- a/vendor/github.com/google/cel-go/common/overloads/overloads.go +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package overloads defines the internal overload identifiers for function and -// operator overloads. -package overloads - -// Boolean logic overloads -const ( - Conditional = "conditional" - LogicalAnd = "logical_and" - LogicalOr = "logical_or" - LogicalNot = "logical_not" - NotStrictlyFalse = "not_strictly_false" - Equals = "equals" - NotEquals = "not_equals" - LessBool = "less_bool" - LessInt64 = "less_int64" - LessInt64Double = "less_int64_double" - LessInt64Uint64 = "less_int64_uint64" - LessUint64 = "less_uint64" - LessUint64Double = "less_uint64_double" - LessUint64Int64 = "less_uint64_int64" - LessDouble = "less_double" - LessDoubleInt64 = "less_double_int64" - LessDoubleUint64 = "less_double_uint64" - LessString = "less_string" - LessBytes = "less_bytes" - LessTimestamp = "less_timestamp" - LessDuration = "less_duration" - LessEqualsBool = "less_equals_bool" - LessEqualsInt64 = "less_equals_int64" - LessEqualsInt64Double = "less_equals_int64_double" - LessEqualsInt64Uint64 = "less_equals_int64_uint64" - LessEqualsUint64 = "less_equals_uint64" - LessEqualsUint64Double = "less_equals_uint64_double" - LessEqualsUint64Int64 = "less_equals_uint64_int64" - LessEqualsDouble = "less_equals_double" - LessEqualsDoubleInt64 = "less_equals_double_int64" - LessEqualsDoubleUint64 = "less_equals_double_uint64" - LessEqualsString = "less_equals_string" - LessEqualsBytes = "less_equals_bytes" - LessEqualsTimestamp = "less_equals_timestamp" - LessEqualsDuration = "less_equals_duration" - GreaterBool = "greater_bool" - GreaterInt64 = "greater_int64" - GreaterInt64Double = "greater_int64_double" - GreaterInt64Uint64 = "greater_int64_uint64" - GreaterUint64 = "greater_uint64" - GreaterUint64Double = "greater_uint64_double" - GreaterUint64Int64 = "greater_uint64_int64" - GreaterDouble = "greater_double" - GreaterDoubleInt64 = "greater_double_int64" - GreaterDoubleUint64 = "greater_double_uint64" - GreaterString = "greater_string" - GreaterBytes = "greater_bytes" - GreaterTimestamp = "greater_timestamp" - GreaterDuration = "greater_duration" - GreaterEqualsBool = "greater_equals_bool" - GreaterEqualsInt64 = "greater_equals_int64" - GreaterEqualsInt64Double = "greater_equals_int64_double" - GreaterEqualsInt64Uint64 = "greater_equals_int64_uint64" - GreaterEqualsUint64 = "greater_equals_uint64" - GreaterEqualsUint64Double = "greater_equals_uint64_double" - GreaterEqualsUint64Int64 = "greater_equals_uint64_int64" - GreaterEqualsDouble = "greater_equals_double" - GreaterEqualsDoubleInt64 = "greater_equals_double_int64" - GreaterEqualsDoubleUint64 = "greater_equals_double_uint64" - GreaterEqualsString = "greater_equals_string" - GreaterEqualsBytes = "greater_equals_bytes" - GreaterEqualsTimestamp = "greater_equals_timestamp" - GreaterEqualsDuration = "greater_equals_duration" -) - -// Math overloads -const ( - AddInt64 = "add_int64" - AddUint64 = "add_uint64" - AddDouble = "add_double" - AddString = "add_string" - AddBytes = "add_bytes" - AddList = "add_list" - AddTimestampDuration = "add_timestamp_duration" - AddDurationTimestamp = "add_duration_timestamp" - AddDurationDuration = "add_duration_duration" - SubtractInt64 = "subtract_int64" - SubtractUint64 = "subtract_uint64" - SubtractDouble = "subtract_double" - SubtractTimestampTimestamp = "subtract_timestamp_timestamp" - SubtractTimestampDuration = "subtract_timestamp_duration" - SubtractDurationDuration = "subtract_duration_duration" - MultiplyInt64 = "multiply_int64" - MultiplyUint64 = "multiply_uint64" - MultiplyDouble = "multiply_double" - DivideInt64 = "divide_int64" - DivideUint64 = "divide_uint64" - DivideDouble = "divide_double" - ModuloInt64 = "modulo_int64" - ModuloUint64 = "modulo_uint64" - NegateInt64 = "negate_int64" - NegateDouble = "negate_double" -) - -// Index overloads -const ( - IndexList = "index_list" - IndexMap = "index_map" - IndexMessage = "index_message" // TODO: introduce concept of types.Message -) - -// In operators -const ( - DeprecatedIn = "in" - InList = "in_list" - InMap = "in_map" - InMessage = "in_message" // TODO: introduce concept of types.Message -) - -// Size overloads -const ( - Size = "size" - SizeString = "size_string" - SizeBytes = "size_bytes" - SizeList = "size_list" - SizeMap = "size_map" - SizeStringInst = "string_size" - SizeBytesInst = "bytes_size" - SizeListInst = "list_size" - SizeMapInst = "map_size" -) - -// String function names. -const ( - Contains = "contains" - EndsWith = "endsWith" - Matches = "matches" - StartsWith = "startsWith" -) - -// Extension function overloads with complex behaviors that need to be referenced in runtime and static analysis cost computations. -const ( - ExtQuoteString = "strings_quote" -) - -// String function overload names. -const ( - ContainsString = "contains_string" - EndsWithString = "ends_with_string" - MatchesString = "matches_string" - StartsWithString = "starts_with_string" -) - -// Extension function overloads with complex behaviors that need to be referenced in runtime and static analysis cost computations. -const ( - ExtFormatString = "string_format" -) - -// Time-based functions. -const ( - TimeGetFullYear = "getFullYear" - TimeGetMonth = "getMonth" - TimeGetDayOfYear = "getDayOfYear" - TimeGetDate = "getDate" - TimeGetDayOfMonth = "getDayOfMonth" - TimeGetDayOfWeek = "getDayOfWeek" - TimeGetHours = "getHours" - TimeGetMinutes = "getMinutes" - TimeGetSeconds = "getSeconds" - TimeGetMilliseconds = "getMilliseconds" -) - -// Timestamp overloads for time functions without timezones. -const ( - TimestampToYear = "timestamp_to_year" - TimestampToMonth = "timestamp_to_month" - TimestampToDayOfYear = "timestamp_to_day_of_year" - TimestampToDayOfMonthZeroBased = "timestamp_to_day_of_month" - TimestampToDayOfMonthOneBased = "timestamp_to_day_of_month_1_based" - TimestampToDayOfWeek = "timestamp_to_day_of_week" - TimestampToHours = "timestamp_to_hours" - TimestampToMinutes = "timestamp_to_minutes" - TimestampToSeconds = "timestamp_to_seconds" - TimestampToMilliseconds = "timestamp_to_milliseconds" -) - -// Timestamp overloads for time functions with timezones. -const ( - TimestampToYearWithTz = "timestamp_to_year_with_tz" - TimestampToMonthWithTz = "timestamp_to_month_with_tz" - TimestampToDayOfYearWithTz = "timestamp_to_day_of_year_with_tz" - TimestampToDayOfMonthZeroBasedWithTz = "timestamp_to_day_of_month_with_tz" - TimestampToDayOfMonthOneBasedWithTz = "timestamp_to_day_of_month_1_based_with_tz" - TimestampToDayOfWeekWithTz = "timestamp_to_day_of_week_with_tz" - TimestampToHoursWithTz = "timestamp_to_hours_with_tz" - TimestampToMinutesWithTz = "timestamp_to_minutes_with_tz" - TimestampToSecondsWithTz = "timestamp_to_seconds_tz" - TimestampToMillisecondsWithTz = "timestamp_to_milliseconds_with_tz" -) - -// Duration overloads for time functions. -const ( - DurationToHours = "duration_to_hours" - DurationToMinutes = "duration_to_minutes" - DurationToSeconds = "duration_to_seconds" - DurationToMilliseconds = "duration_to_milliseconds" -) - -// Type conversion methods and overloads -const ( - TypeConvertInt = "int" - TypeConvertUint = "uint" - TypeConvertDouble = "double" - TypeConvertBool = "bool" - TypeConvertString = "string" - TypeConvertBytes = "bytes" - TypeConvertTimestamp = "timestamp" - TypeConvertDuration = "duration" - TypeConvertType = "type" - TypeConvertDyn = "dyn" -) - -// Int conversion functions. -const ( - IntToInt = "int64_to_int64" - UintToInt = "uint64_to_int64" - DoubleToInt = "double_to_int64" - StringToInt = "string_to_int64" - TimestampToInt = "timestamp_to_int64" - DurationToInt = "duration_to_int64" -) - -// Uint conversion functions. -const ( - UintToUint = "uint64_to_uint64" - IntToUint = "int64_to_uint64" - DoubleToUint = "double_to_uint64" - StringToUint = "string_to_uint64" -) - -// Double conversion functions. -const ( - DoubleToDouble = "double_to_double" - IntToDouble = "int64_to_double" - UintToDouble = "uint64_to_double" - StringToDouble = "string_to_double" -) - -// Bool conversion functions. -const ( - BoolToBool = "bool_to_bool" - StringToBool = "string_to_bool" -) - -// Bytes conversion functions. -const ( - BytesToBytes = "bytes_to_bytes" - StringToBytes = "string_to_bytes" -) - -// String conversion functions. -const ( - StringToString = "string_to_string" - BoolToString = "bool_to_string" - IntToString = "int64_to_string" - UintToString = "uint64_to_string" - DoubleToString = "double_to_string" - BytesToString = "bytes_to_string" - TimestampToString = "timestamp_to_string" - DurationToString = "duration_to_string" -) - -// Timestamp conversion functions -const ( - TimestampToTimestamp = "timestamp_to_timestamp" - StringToTimestamp = "string_to_timestamp" - IntToTimestamp = "int64_to_timestamp" -) - -// Convert duration from string -const ( - DurationToDuration = "duration_to_duration" - StringToDuration = "string_to_duration" - IntToDuration = "int64_to_duration" -) - -// Convert to dyn -const ( - ToDyn = "to_dyn" -) - -// Comprehensions helper methods, not directly accessible via a developer. -const ( - Iterator = "@iterator" - HasNext = "@hasNext" - Next = "@next" -) - -// IsTypeConversionFunction returns whether the input function is a standard library type -// conversion function. -func IsTypeConversionFunction(function string) bool { - switch function { - case TypeConvertBool, - TypeConvertBytes, - TypeConvertDouble, - TypeConvertDuration, - TypeConvertDyn, - TypeConvertInt, - TypeConvertString, - TypeConvertTimestamp, - TypeConvertType, - TypeConvertUint: - return true - default: - return false - } -} diff --git a/vendor/github.com/google/cel-go/common/runes/BUILD.bazel b/vendor/github.com/google/cel-go/common/runes/BUILD.bazel deleted file mode 100644 index bb30242cf..000000000 --- a/vendor/github.com/google/cel-go/common/runes/BUILD.bazel +++ /dev/null @@ -1,25 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "buffer.go", - ], - importpath = "github.com/google/cel-go/common/runes", -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "buffer_test.go", - ], - embed = [ - ":go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/runes/buffer.go b/vendor/github.com/google/cel-go/common/runes/buffer.go deleted file mode 100644 index 021198224..000000000 --- a/vendor/github.com/google/cel-go/common/runes/buffer.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package runes provides interfaces and utilities for working with runes. -package runes - -import ( - "strings" - "unicode/utf8" -) - -// Buffer is an interface for accessing a contiguous array of code points. -type Buffer interface { - Get(i int) rune - Slice(i, j int) string - Len() int -} - -type emptyBuffer struct{} - -func (e *emptyBuffer) Get(i int) rune { - panic("slice index out of bounds") -} - -func (e *emptyBuffer) Slice(i, j int) string { - if i != 0 || i != j { - panic("slice index out of bounds") - } - return "" -} - -func (e *emptyBuffer) Len() int { - return 0 -} - -var _ Buffer = &emptyBuffer{} - -// asciiBuffer is an implementation for an array of code points that contain code points only from -// the ASCII character set. -type asciiBuffer struct { - arr []byte -} - -func (a *asciiBuffer) Get(i int) rune { - return rune(uint32(a.arr[i])) -} - -func (a *asciiBuffer) Slice(i, j int) string { - return string(a.arr[i:j]) -} - -func (a *asciiBuffer) Len() int { - return len(a.arr) -} - -var _ Buffer = &asciiBuffer{} - -// basicBuffer is an implementation for an array of code points that contain code points from both -// the Latin-1 character set and Basic Multilingual Plane. -type basicBuffer struct { - arr []uint16 -} - -func (b *basicBuffer) Get(i int) rune { - return rune(uint32(b.arr[i])) -} - -func (b *basicBuffer) Slice(i, j int) string { - var str strings.Builder - str.Grow((j - i) * 3) // Worst case encoding size for 0xffff is 3. - for ; i < j; i++ { - str.WriteRune(rune(uint32(b.arr[i]))) - } - return str.String() -} - -func (b *basicBuffer) Len() int { - return len(b.arr) -} - -var _ Buffer = &basicBuffer{} - -// supplementalBuffer is an implementation for an array of code points that contain code points from -// the Latin-1 character set, Basic Multilingual Plane, or the Supplemental Multilingual Plane. -type supplementalBuffer struct { - arr []rune -} - -func (s *supplementalBuffer) Get(i int) rune { - return rune(uint32(s.arr[i])) -} - -func (s *supplementalBuffer) Slice(i, j int) string { - return string(s.arr[i:j]) -} - -func (s *supplementalBuffer) Len() int { - return len(s.arr) -} - -var _ Buffer = &supplementalBuffer{} - -var nilBuffer = &emptyBuffer{} - -// NewBuffer returns an efficient implementation of Buffer for the given text based on the ranges of -// the encoded code points contained within. -// -// Code points are represented as an array of byte, uint16, or rune. This approach ensures that -// each index represents a code point by itself without needing to use an array of rune. At first -// we assume all code points are less than or equal to '\u007f'. If this holds true, the -// underlying storage is a byte array containing only ASCII characters. If we encountered a code -// point above this range but less than or equal to '\uffff' we allocate a uint16 array, copy the -// elements of previous byte array to the uint16 array, and continue. If this holds true, the -// underlying storage is a uint16 array containing only Unicode characters in the Basic Multilingual -// Plane. If we encounter a code point above '\uffff' we allocate an rune array, copy the previous -// elements of the byte or uint16 array, and continue. The underlying storage is an rune array -// containing any Unicode character. -func NewBuffer(data string) Buffer { - buf, _ := newBuffer(data, false) - return buf -} - -// NewBufferAndLineOffsets returns an efficient implementation of Buffer for the given text based on -// the ranges of the encoded code points contained within, as well as returning the line offsets. -// -// Code points are represented as an array of byte, uint16, or rune. This approach ensures that -// each index represents a code point by itself without needing to use an array of rune. At first -// we assume all code points are less than or equal to '\u007f'. If this holds true, the -// underlying storage is a byte array containing only ASCII characters. If we encountered a code -// point above this range but less than or equal to '\uffff' we allocate a uint16 array, copy the -// elements of previous byte array to the uint16 array, and continue. If this holds true, the -// underlying storage is a uint16 array containing only Unicode characters in the Basic Multilingual -// Plane. If we encounter a code point above '\uffff' we allocate an rune array, copy the previous -// elements of the byte or uint16 array, and continue. The underlying storage is an rune array -// containing any Unicode character. -func NewBufferAndLineOffsets(data string) (Buffer, []int32) { - return newBuffer(data, true) -} - -func newBuffer(data string, lines bool) (Buffer, []int32) { - if len(data) == 0 { - return nilBuffer, []int32{0} - } - var ( - idx = 0 - off int32 = 0 - buf8 = make([]byte, 0, len(data)) - buf16 []uint16 - buf32 []rune - offs []int32 - ) - for idx < len(data) { - r, s := utf8.DecodeRuneInString(data[idx:]) - idx += s - if lines && r == '\n' { - offs = append(offs, off+1) - } - if r < utf8.RuneSelf { - buf8 = append(buf8, byte(r)) - off++ - continue - } - if r <= 0xffff { - buf16 = make([]uint16, len(buf8), len(data)) - for i, v := range buf8 { - buf16[i] = uint16(v) - } - buf8 = nil - buf16 = append(buf16, uint16(r)) - off++ - goto copy16 - } - buf32 = make([]rune, len(buf8), len(data)) - for i, v := range buf8 { - buf32[i] = rune(uint32(v)) - } - buf8 = nil - buf32 = append(buf32, r) - off++ - goto copy32 - } - if lines { - offs = append(offs, off+1) - } - return &asciiBuffer{ - arr: buf8, - }, offs -copy16: - for idx < len(data) { - r, s := utf8.DecodeRuneInString(data[idx:]) - idx += s - if lines && r == '\n' { - offs = append(offs, off+1) - } - if r <= 0xffff { - buf16 = append(buf16, uint16(r)) - off++ - continue - } - buf32 = make([]rune, len(buf16), len(data)) - for i, v := range buf16 { - buf32[i] = rune(uint32(v)) - } - buf16 = nil - buf32 = append(buf32, r) - off++ - goto copy32 - } - if lines { - offs = append(offs, off+1) - } - return &basicBuffer{ - arr: buf16, - }, offs -copy32: - for idx < len(data) { - r, s := utf8.DecodeRuneInString(data[idx:]) - idx += s - if lines && r == '\n' { - offs = append(offs, off+1) - } - buf32 = append(buf32, r) - off++ - } - if lines { - offs = append(offs, off+1) - } - return &supplementalBuffer{ - arr: buf32, - }, offs -} diff --git a/vendor/github.com/google/cel-go/common/source.go b/vendor/github.com/google/cel-go/common/source.go deleted file mode 100644 index ec79cb545..000000000 --- a/vendor/github.com/google/cel-go/common/source.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package common - -import ( - "github.com/google/cel-go/common/runes" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Source interface for filter source contents. -type Source interface { - // Content returns the source content represented as a string. - // Examples contents are the single file contents, textbox field, - // or url parameter. - Content() string - - // Description gives a brief description of the source. - // Example descriptions are a file name or ui element. - Description() string - - // LineOffsets gives the character offsets at which lines occur. - // The zero-th entry should refer to the break between the first - // and second line, or EOF if there is only one line of source. - LineOffsets() []int32 - - // LocationOffset translates a Location to an offset. - // Given the line and column of the Location returns the - // Location's character offset in the Source, and a bool - // indicating whether the Location was found. - LocationOffset(location Location) (int32, bool) - - // OffsetLocation translates a character offset to a Location, or - // false if the conversion was not feasible. - OffsetLocation(offset int32) (Location, bool) - - // NewLocation takes an input line and column and produces a Location. - // The default behavior is to treat the line and column as absolute, - // but concrete derivations may use this method to convert a relative - // line and column position into an absolute location. - NewLocation(line, col int) Location - - // Snippet returns a line of content and whether the line was found. - Snippet(line int) (string, bool) -} - -// The sourceImpl type implementation of the Source interface. -type sourceImpl struct { - runes.Buffer - description string - lineOffsets []int32 -} - -var _ runes.Buffer = &sourceImpl{} - -// TODO(jimlarson) "Character offsets" should index the code points -// within the UTF-8 encoded string. It currently indexes bytes. -// Can be accomplished by using rune[] instead of string for contents. - -// NewTextSource creates a new Source from the input text string. -func NewTextSource(text string) Source { - return NewStringSource(text, "") -} - -// NewStringSource creates a new Source from the given contents and description. -func NewStringSource(contents string, description string) Source { - // Compute line offsets up front as they are referred to frequently. - buf, offs := runes.NewBufferAndLineOffsets(contents) - return &sourceImpl{ - Buffer: buf, - description: description, - lineOffsets: offs, - } -} - -// NewInfoSource creates a new Source from a SourceInfo. -func NewInfoSource(info *exprpb.SourceInfo) Source { - return &sourceImpl{ - Buffer: runes.NewBuffer(""), - description: info.GetLocation(), - lineOffsets: info.GetLineOffsets(), - } -} - -// Content implements the Source interface method. -func (s *sourceImpl) Content() string { - return s.Slice(0, s.Len()) -} - -// Description implements the Source interface method. -func (s *sourceImpl) Description() string { - return s.description -} - -// LineOffsets implements the Source interface method. -func (s *sourceImpl) LineOffsets() []int32 { - return s.lineOffsets -} - -// LocationOffset implements the Source interface method. -func (s *sourceImpl) LocationOffset(location Location) (int32, bool) { - if lineOffset, found := s.findLineOffset(location.Line()); found { - return lineOffset + int32(location.Column()), true - } - return -1, false -} - -// NewLocation implements the Source interface method. -func (s *sourceImpl) NewLocation(line, col int) Location { - return NewLocation(line, col) -} - -// OffsetLocation implements the Source interface method. -func (s *sourceImpl) OffsetLocation(offset int32) (Location, bool) { - line, lineOffset := s.findLine(offset) - return NewLocation(int(line), int(offset-lineOffset)), true -} - -// Snippet implements the Source interface method. -func (s *sourceImpl) Snippet(line int) (string, bool) { - charStart, found := s.findLineOffset(line) - if !found || s.Len() == 0 { - return "", false - } - charEnd, found := s.findLineOffset(line + 1) - if found { - return s.Slice(int(charStart), int(charEnd-1)), true - } - return s.Slice(int(charStart), s.Len()), true -} - -// findLineOffset returns the offset where the (1-indexed) line begins, -// or false if line doesn't exist. -func (s *sourceImpl) findLineOffset(line int) (int32, bool) { - if line == 1 { - return 0, true - } - if line > 1 && line <= int(len(s.lineOffsets)) { - offset := s.lineOffsets[line-2] - return offset, true - } - return -1, false -} - -// findLine finds the line that contains the given character offset and -// returns the line number and offset of the beginning of that line. -// Note that the last line is treated as if it contains all offsets -// beyond the end of the actual source. -func (s *sourceImpl) findLine(characterOffset int32) (int32, int32) { - var line int32 = 1 - for _, lineOffset := range s.lineOffsets { - if lineOffset > characterOffset { - break - } - line++ - } - if line == 1 { - return line, 0 - } - return line, s.lineOffsets[line-2] -} diff --git a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel b/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel deleted file mode 100644 index 124dbea81..000000000 --- a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "standard.go", - ], - importpath = "github.com/google/cel-go/common/stdlib", - deps = [ - "//common:go_default_library", - "//common/decls:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - ], -) \ No newline at end of file diff --git a/vendor/github.com/google/cel-go/common/stdlib/standard.go b/vendor/github.com/google/cel-go/common/stdlib/standard.go deleted file mode 100644 index 4040a4f5c..000000000 --- a/vendor/github.com/google/cel-go/common/stdlib/standard.go +++ /dev/null @@ -1,1058 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package stdlib contains all of the standard library function declarations and definitions for CEL. -package stdlib - -import ( - "strconv" - "strings" - "time" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -var ( - stdFunctions []*decls.FunctionDecl - stdTypes []*decls.VariableDecl - utcTZ = types.String("UTC") -) - -func init() { - paramA := types.NewTypeParamType("A") - paramB := types.NewTypeParamType("B") - listOfA := types.NewListType(paramA) - mapOfAB := types.NewMapType(paramA, paramB) - - stdTypes = []*decls.VariableDecl{ - decls.TypeVariable(types.BoolType), - decls.TypeVariable(types.BytesType), - decls.TypeVariable(types.DoubleType), - decls.TypeVariable(types.DurationType), - decls.TypeVariable(types.IntType), - decls.TypeVariable(listOfA), - decls.TypeVariable(mapOfAB), - decls.TypeVariable(types.NullType), - decls.TypeVariable(types.StringType), - decls.TypeVariable(types.TimestampType), - decls.TypeVariable(types.TypeType), - decls.TypeVariable(types.UintType), - } - - stdFunctions = []*decls.FunctionDecl{ - // Logical operators. Special-cased within the interpreter. - // Note, the singleton binding prevents extensions from overriding the operator behavior. - function(operators.Conditional, - decls.FunctionDocs( - `The ternary operator tests a boolean predicate and returns the left-hand side `+ - `(truthy) expression if true, or the right-hand side (falsy) expression if false`), - decls.Overload(overloads.Conditional, argTypes(types.BoolType, paramA, paramA), paramA, - decls.OverloadIsNonStrict(), - decls.OverloadExamples( - `'hello'.contains('lo') ? 'hi' : 'bye' // 'hi'`, - `32 % 3 == 0 ? 'divisible' : 'not divisible' // 'not divisible'`)), - decls.SingletonFunctionBinding(noFunctionOverrides)), - - function(operators.LogicalAnd, - decls.FunctionDocs( - `logically AND two boolean values. Errors and unknown values`, - `are valid inputs and will not halt evaluation.`), - decls.Overload(overloads.LogicalAnd, argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.OverloadExamples( - `true && true // true`, - `true && false // false`, - `error && true // error`, - `error && false // false`)), - decls.SingletonBinaryBinding(noBinaryOverrides)), - - function(operators.LogicalOr, - decls.FunctionDocs( - `logically OR two boolean values. Errors and unknown values`, - `are valid inputs and will not halt evaluation.`), - decls.Overload(overloads.LogicalOr, argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.OverloadExamples( - `true || false // true`, - `false || false // false`, - `error || true // true`, - `error || error // true`)), - decls.SingletonBinaryBinding(noBinaryOverrides)), - - function(operators.LogicalNot, - decls.FunctionDocs(`logically negate a boolean value.`), - decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType, - decls.OverloadExamples( - `!true // false`, - `!false // true`, - `!error // error`)), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - b, ok := val.(types.Bool) - if !ok { - return types.MaybeNoSuchOverloadErr(val) - } - return b.Negate() - })), - - // Comprehension short-circuiting related function - function(operators.NotStrictlyFalse, - decls.Overload(overloads.NotStrictlyFalse, argTypes(types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.UnaryBinding(notStrictlyFalse))), - // Deprecated: __not_strictly_false__ - function(operators.OldNotStrictlyFalse, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(operators.OldNotStrictlyFalse, argTypes(types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.UnaryBinding(notStrictlyFalse))), - - // Equality / inequality. Special-cased in the interpreter - function(operators.Equals, - decls.FunctionDocs(`compare two values of the same type for equality`), - decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType, - decls.OverloadExamples( - `1 == 1 // true`, - `'hello' == 'world' // false`, - `bytes('hello') == b'hello' // true`, - `duration('1h') == duration('60m') // true`, - `dyn(3.0) == 3 // true`)), - decls.SingletonBinaryBinding(noBinaryOverrides)), - function(operators.NotEquals, - decls.FunctionDocs(`compare two values of the same type for inequality`), - decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType, - decls.OverloadExamples( - `1 != 2 // true`, - `"a" != "a" // false`, - `3.0 != 3.1 // true`)), - decls.SingletonBinaryBinding(noBinaryOverrides)), - - // Mathematical operators - function(operators.Add, - decls.FunctionDocs( - `adds two numeric values or concatenates two strings, bytes,`, - `or lists.`), - decls.Overload(overloads.AddBytes, - argTypes(types.BytesType, types.BytesType), types.BytesType, - decls.OverloadExamples(`b'hi' + bytes('ya') // b'hiya'`)), - decls.Overload(overloads.AddDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType, - decls.OverloadExamples(`3.14 + 1.59 // 4.73`)), - decls.Overload(overloads.AddDurationDuration, - argTypes(types.DurationType, types.DurationType), types.DurationType, - decls.OverloadExamples(`duration('1m') + duration('1s') // duration('1m1s')`)), - decls.Overload(overloads.AddDurationTimestamp, - argTypes(types.DurationType, types.TimestampType), types.TimestampType, - decls.OverloadExamples(`duration('24h') + timestamp('2023-01-01T00:00:00Z') // timestamp('2023-01-02T00:00:00Z')`)), - decls.Overload(overloads.AddTimestampDuration, - argTypes(types.TimestampType, types.DurationType), types.TimestampType, - decls.OverloadExamples(`timestamp('2023-01-01T00:00:00Z') + duration('24h1m2s') // timestamp('2023-01-02T00:01:02Z')`)), - decls.Overload(overloads.AddInt64, - argTypes(types.IntType, types.IntType), types.IntType, - decls.OverloadExamples(`1 + 2 // 3`)), - decls.Overload(overloads.AddList, - argTypes(listOfA, listOfA), listOfA, - decls.OverloadExamples(`[1] + [2, 3] // [1, 2, 3]`)), - decls.Overload(overloads.AddString, - argTypes(types.StringType, types.StringType), types.StringType, - decls.OverloadExamples(`"Hello, " + "world!" // "Hello, world!"`)), - decls.Overload(overloads.AddUint64, - argTypes(types.UintType, types.UintType), types.UintType, - decls.OverloadExamples(`22u + 33u // 55u`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Adder).Add(rhs) - }, traits.AdderType)), - function(operators.Divide, - decls.FunctionDocs(`divide two numbers`), - decls.Overload(overloads.DivideDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType, - decls.OverloadExamples(`7.0 / 2.0 // 3.5`)), - decls.Overload(overloads.DivideInt64, - argTypes(types.IntType, types.IntType), types.IntType, - decls.OverloadExamples(`10 / 2 // 5`)), - decls.Overload(overloads.DivideUint64, - argTypes(types.UintType, types.UintType), types.UintType, - decls.OverloadExamples(`42u / 2u // 21u`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Divider).Divide(rhs) - }, traits.DividerType)), - function(operators.Modulo, - decls.FunctionDocs(`compute the modulus of one integer into another`), - decls.Overload(overloads.ModuloInt64, - argTypes(types.IntType, types.IntType), types.IntType, - decls.OverloadExamples(`3 % 2 // 1`)), - decls.Overload(overloads.ModuloUint64, - argTypes(types.UintType, types.UintType), types.UintType, - decls.OverloadExamples(`6u % 3u // 0u`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Modder).Modulo(rhs) - }, traits.ModderType)), - function(operators.Multiply, - decls.FunctionDocs(`multiply two numbers`), - decls.Overload(overloads.MultiplyDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType, - decls.OverloadExamples(`3.5 * 40.0 // 140.0`)), - decls.Overload(overloads.MultiplyInt64, - argTypes(types.IntType, types.IntType), types.IntType, - decls.OverloadExamples(`-2 * 6 // -12`)), - decls.Overload(overloads.MultiplyUint64, - argTypes(types.UintType, types.UintType), types.UintType, - decls.OverloadExamples(`13u * 3u // 39u`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Multiplier).Multiply(rhs) - }, traits.MultiplierType)), - function(operators.Negate, - decls.FunctionDocs(`negate a numeric value`), - decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType, - decls.OverloadExamples(`-(3.14) // -3.14`)), - decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType, - decls.OverloadExamples(`-(5) // -5`)), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - if types.IsBool(val) { - return types.MaybeNoSuchOverloadErr(val) - } - return val.(traits.Negater).Negate() - }, traits.NegatorType)), - function(operators.Subtract, - decls.FunctionDocs(`subtract two numbers, or two time-related values`), - decls.Overload(overloads.SubtractDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType, - decls.OverloadExamples(`10.5 - 2.0 // 8.5`)), - decls.Overload(overloads.SubtractDurationDuration, - argTypes(types.DurationType, types.DurationType), types.DurationType, - decls.OverloadExamples(`duration('1m') - duration('1s') // duration('59s')`)), - decls.Overload(overloads.SubtractInt64, - argTypes(types.IntType, types.IntType), types.IntType, - decls.OverloadExamples(`5 - 3 // 2`)), - decls.Overload(overloads.SubtractTimestampDuration, - argTypes(types.TimestampType, types.DurationType), types.TimestampType, - decls.OverloadExamples(common.MultilineDescription( - `timestamp('2023-01-10T12:00:00Z')`, - ` - duration('12h') // timestamp('2023-01-10T00:00:00Z')`))), - decls.Overload(overloads.SubtractTimestampTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.DurationType, - decls.OverloadExamples(common.MultilineDescription( - `timestamp('2023-01-10T12:00:00Z')`, - ` - timestamp('2023-01-10T00:00:00Z') // duration('12h')`))), - decls.Overload(overloads.SubtractUint64, - argTypes(types.UintType, types.UintType), types.UintType, - decls.OverloadExamples(common.MultilineDescription( - `// the subtraction result must be positive, otherwise an overflow`, - `// error is generated.`, - `42u - 3u // 39u`))), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Subtractor).Subtract(rhs) - }, traits.SubtractorType)), - - // Relations operators - - function(operators.Less, - decls.FunctionDocs( - `compare two values and return true if the first value is`, - `less than the second`), - decls.Overload(overloads.LessBool, - argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadExamples(`false < true // true`)), - decls.Overload(overloads.LessInt64, - argTypes(types.IntType, types.IntType), types.BoolType, - decls.OverloadExamples(`-2 < 3 // true`, `1 < 0 // false`)), - decls.Overload(overloads.LessInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`1 < 1.1 // true`)), - decls.Overload(overloads.LessInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType, - decls.OverloadExamples(`1 < 2u // true`)), - decls.Overload(overloads.LessUint64, - argTypes(types.UintType, types.UintType), types.BoolType, - decls.OverloadExamples(`1u < 2u // true`)), - decls.Overload(overloads.LessUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`1u < 0.9 // false`)), - decls.Overload(overloads.LessUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType, - decls.OverloadExamples(`1u < 23 // true`, `1u < -1 // false`)), - decls.Overload(overloads.LessDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2.0 < 2.4 // true`)), - decls.Overload(overloads.LessDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType, - decls.OverloadExamples(`2.1 < 3 // true`)), - decls.Overload(overloads.LessDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType, - decls.OverloadExamples(`2.3 < 2u // false`, `-1.0 < 1u // true`)), - decls.Overload(overloads.LessString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples(`'a' < 'b' // true`, `'cat' < 'cab' // false`)), - decls.Overload(overloads.LessBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType, - decls.OverloadExamples(`b'hello' < b'world' // true`)), - decls.Overload(overloads.LessTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType, - decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') < timestamp('2002-02-02T02:03:04Z') // true`)), - decls.Overload(overloads.LessDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType, - decls.OverloadExamples(`duration('1ms') < duration('1s') // true`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntNegOne { - return types.True - } - if cmp == types.IntOne || cmp == types.IntZero { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.LessEquals, - decls.FunctionDocs( - `compare two values and return true if the first value is`, - `less than or equal to the second`), - decls.Overload(overloads.LessEqualsBool, - argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadExamples(`false <= true // true`)), - decls.Overload(overloads.LessEqualsInt64, - argTypes(types.IntType, types.IntType), types.BoolType, - decls.OverloadExamples(`-2 <= 3 // true`)), - decls.Overload(overloads.LessEqualsInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`1 <= 1.1 // true`)), - decls.Overload(overloads.LessEqualsInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType, - decls.OverloadExamples(`1 <= 2u // true`, `-1 <= 0u // true`)), - decls.Overload(overloads.LessEqualsUint64, - argTypes(types.UintType, types.UintType), types.BoolType, - decls.OverloadExamples(`1u <= 2u // true`)), - decls.Overload(overloads.LessEqualsUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`1u <= 1.0 // true`, `1u <= 1.1 // true`)), - decls.Overload(overloads.LessEqualsUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType, - decls.OverloadExamples(`1u <= 23 // true`)), - decls.Overload(overloads.LessEqualsDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2.0 <= 2.4 // true`)), - decls.Overload(overloads.LessEqualsDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType, - decls.OverloadExamples(`2.1 <= 3 // true`)), - decls.Overload(overloads.LessEqualsDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType, - decls.OverloadExamples(`2.0 <= 2u // true`, `-1.0 <= 1u // true`)), - decls.Overload(overloads.LessEqualsString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples(`'a' <= 'b' // true`, `'a' <= 'a' // true`, `'cat' <= 'cab' // false`)), - decls.Overload(overloads.LessEqualsBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType, - decls.OverloadExamples(`b'hello' <= b'world' // true`)), - decls.Overload(overloads.LessEqualsTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType, - decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') <= timestamp('2002-02-02T02:03:04Z') // true`)), - decls.Overload(overloads.LessEqualsDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType, - decls.OverloadExamples(`duration('1ms') <= duration('1s') // true`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntNegOne || cmp == types.IntZero { - return types.True - } - if cmp == types.IntOne { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.Greater, - decls.FunctionDocs( - `compare two values and return true if the first value is`, - `greater than the second`), - decls.Overload(overloads.GreaterBool, - argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadExamples(`true > false // true`)), - decls.Overload(overloads.GreaterInt64, - argTypes(types.IntType, types.IntType), types.BoolType, - decls.OverloadExamples(`3 > -2 // true`)), - decls.Overload(overloads.GreaterInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2 > 1.1 // true`)), - decls.Overload(overloads.GreaterInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType, - decls.OverloadExamples(`3 > 2u // true`)), - decls.Overload(overloads.GreaterUint64, - argTypes(types.UintType, types.UintType), types.BoolType, - decls.OverloadExamples(`2u > 1u // true`)), - decls.Overload(overloads.GreaterUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2u > 1.9 // true`)), - decls.Overload(overloads.GreaterUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType, - decls.OverloadExamples(`23u > 1 // true`, `0u > -1 // true`)), - decls.Overload(overloads.GreaterDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2.4 > 2.0 // true`)), - decls.Overload(overloads.GreaterDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType, - decls.OverloadExamples(`3.1 > 3 // true`, `3.0 > 3 // false`)), - decls.Overload(overloads.GreaterDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType, - decls.OverloadExamples(`2.3 > 2u // true`)), - decls.Overload(overloads.GreaterString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples(`'b' > 'a' // true`)), - decls.Overload(overloads.GreaterBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType, - decls.OverloadExamples(`b'world' > b'hello' // true`)), - decls.Overload(overloads.GreaterTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType, - decls.OverloadExamples(`timestamp('2002-02-02T02:03:04Z') > timestamp('2001-01-01T02:03:04Z') // true`)), - decls.Overload(overloads.GreaterDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType, - decls.OverloadExamples(`duration('1ms') > duration('1us') // true`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntOne { - return types.True - } - if cmp == types.IntNegOne || cmp == types.IntZero { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.GreaterEquals, - decls.FunctionDocs( - `compare two values and return true if the first value is`, - `greater than or equal to the second`), - decls.Overload(overloads.GreaterEqualsBool, - argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadExamples(`true >= false // true`)), - decls.Overload(overloads.GreaterEqualsInt64, - argTypes(types.IntType, types.IntType), types.BoolType, - decls.OverloadExamples(`3 >= -2 // true`)), - decls.Overload(overloads.GreaterEqualsInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2 >= 1.1 // true`, `1 >= 1.0 // true`)), - decls.Overload(overloads.GreaterEqualsInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType, - decls.OverloadExamples(`3 >= 2u // true`)), - decls.Overload(overloads.GreaterEqualsUint64, - argTypes(types.UintType, types.UintType), types.BoolType, - decls.OverloadExamples(`2u >= 1u // true`)), - decls.Overload(overloads.GreaterEqualsUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2u >= 1.9 // true`)), - decls.Overload(overloads.GreaterEqualsUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType, - decls.OverloadExamples(`23u >= 1 // true`, `1u >= 1 // true`)), - decls.Overload(overloads.GreaterEqualsDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType, - decls.OverloadExamples(`2.4 >= 2.0 // true`)), - decls.Overload(overloads.GreaterEqualsDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType, - decls.OverloadExamples(`3.1 >= 3 // true`)), - decls.Overload(overloads.GreaterEqualsDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType, - decls.OverloadExamples(`2.3 >= 2u // true`)), - decls.Overload(overloads.GreaterEqualsString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples(`'b' >= 'a' // true`)), - decls.Overload(overloads.GreaterEqualsBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType, - decls.OverloadExamples(`b'world' >= b'hello' // true`)), - decls.Overload(overloads.GreaterEqualsTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType, - decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') >= timestamp('2001-01-01T02:03:04Z') // true`)), - decls.Overload(overloads.GreaterEqualsDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType, - decls.OverloadExamples(`duration('60s') >= duration('1m') // true`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntOne || cmp == types.IntZero { - return types.True - } - if cmp == types.IntNegOne { - return types.False - } - return cmp - }, traits.ComparerType)), - - // Indexing - function(operators.Index, - decls.FunctionDocs(`select a value from a list by index, or value from a map by key`), - decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA, - decls.OverloadExamples(`[1, 2, 3][1] // 2`)), - decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB, - decls.OverloadExamples( - `{'key': 'value'}['key'] // 'value'`, - `{'key': 'value'}['missing'] // error`)), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Indexer).Get(rhs) - }, traits.IndexerType)), - - // Collections operators - function(operators.In, - decls.FunctionDocs(`test whether a value exists in a list, or a key exists in a map`), - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType, - decls.OverloadExamples( - `2 in [1, 2, 3] // true`, - `"a" in ["b", "c"] // false`)), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType, - decls.OverloadExamples( - `'key1' in {'key1': 'value1', 'key2': 'value2'} // true`, - `3 in {1: "one", 2: "two"} // false`)), - decls.SingletonBinaryBinding(inAggregate)), - function(operators.OldIn, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType), - decls.SingletonBinaryBinding(inAggregate)), - function(overloads.DeprecatedIn, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType), - decls.SingletonBinaryBinding(inAggregate)), - function(overloads.Size, - decls.FunctionDocs( - `compute the size of a list or map, the number of characters in a string,`, - `or the number of bytes in a sequence`), - decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType, - decls.OverloadExamples(`size(b'123') // 3`)), - decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType, - decls.OverloadExamples(`b'123'.size() // 3`)), - decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType, - decls.OverloadExamples(`size([1, 2, 3]) // 3`)), - decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType, - decls.OverloadExamples(`[1, 2, 3].size() // 3`)), - decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType, - decls.OverloadExamples(`size({'a': 1, 'b': 2}) // 2`)), - decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType, - decls.OverloadExamples(`{'a': 1, 'b': 2}.size() // 2`)), - decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType, - decls.OverloadExamples(`size('hello') // 5`)), - decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType, - decls.OverloadExamples(`'hello'.size() // 5`)), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - return val.(traits.Sizer).Size() - }, traits.SizerType)), - - // Type conversions - function(overloads.TypeConvertType, - decls.FunctionDocs(`convert a value to its type identifier`), - decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA), - decls.OverloadExamples( - `type(1) // int`, - `type('hello') // string`, - `type(int) // type`, - `type(type) // type`)), - decls.SingletonUnaryBinding(convertToType(types.TypeType))), - - // Bool conversions - function(overloads.TypeConvertBool, - decls.FunctionDocs(`convert a value to a boolean`), - decls.Overload(overloads.BoolToBool, argTypes(types.BoolType), types.BoolType, - - decls.OverloadExamples(`bool(true) // true`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.StringToBool, argTypes(types.StringType), types.BoolType, - - decls.OverloadExamples(`bool('true') // true`, `bool('false') // false`), - decls.UnaryBinding(convertToType(types.BoolType)))), - - // Bytes conversions - function(overloads.TypeConvertBytes, - decls.FunctionDocs(`convert a value to bytes`), - decls.Overload(overloads.BytesToBytes, argTypes(types.BytesType), types.BytesType, - decls.OverloadExamples(`bytes(b'abc') // b'abc'`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.StringToBytes, argTypes(types.StringType), types.BytesType, - decls.OverloadExamples(`bytes('hello') // b'hello'`), - decls.UnaryBinding(convertToType(types.BytesType)))), - - // Double conversions - function(overloads.TypeConvertDouble, - decls.FunctionDocs(`convert a value to a double`), - decls.Overload(overloads.DoubleToDouble, argTypes(types.DoubleType), types.DoubleType, - decls.OverloadExamples(`double(1.23) // 1.23`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToDouble, argTypes(types.IntType), types.DoubleType, - decls.OverloadExamples(`double(123) // 123.0`), - decls.UnaryBinding(convertToType(types.DoubleType))), - decls.Overload(overloads.StringToDouble, argTypes(types.StringType), types.DoubleType, - decls.OverloadExamples(`double('1.23') // 1.23`), - decls.UnaryBinding(convertToType(types.DoubleType))), - decls.Overload(overloads.UintToDouble, argTypes(types.UintType), types.DoubleType, - decls.OverloadExamples(`double(123u) // 123.0`), - decls.UnaryBinding(convertToType(types.DoubleType)))), - - // Duration conversions - function(overloads.TypeConvertDuration, - decls.FunctionDocs(`convert a value to a google.protobuf.Duration`), - decls.Overload(overloads.DurationToDuration, argTypes(types.DurationType), types.DurationType, - decls.OverloadExamples(`duration(duration('1s')) // duration('1s')`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToDuration, argTypes(types.IntType), types.DurationType, - decls.UnaryBinding(convertToType(types.DurationType))), - decls.Overload(overloads.StringToDuration, argTypes(types.StringType), types.DurationType, - decls.OverloadExamples(`duration('1h2m3s') // duration('3723s')`), - decls.UnaryBinding(convertToType(types.DurationType)))), - - // Dyn conversions - function(overloads.TypeConvertDyn, - decls.FunctionDocs(`indicate that the type is dynamic for type-checking purposes`), - decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType, - decls.OverloadExamples(`dyn(1) // 1`)), - decls.SingletonUnaryBinding(identity)), - - // Int conversions - function(overloads.TypeConvertInt, - decls.FunctionDocs(`convert a value to an int`), - decls.Overload(overloads.IntToInt, argTypes(types.IntType), types.IntType, - decls.OverloadExamples(`int(123) // 123`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.DoubleToInt, argTypes(types.DoubleType), types.IntType, - decls.OverloadExamples(`int(123.45) // 123`), - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.DurationToInt, argTypes(types.DurationType), types.IntType, - decls.OverloadExamples(`int(duration('1s')) // 1000000000`), - decls.UnaryBinding(convertToType(types.IntType))), // Duration to nanoseconds - decls.Overload(overloads.StringToInt, argTypes(types.StringType), types.IntType, - decls.OverloadExamples(`int('123') // 123`, `int('-456') // -456`), - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.TimestampToInt, argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`int(timestamp('1970-01-01T00:00:01Z')) // 1`), - decls.UnaryBinding(convertToType(types.IntType))), // Timestamp to epoch seconds - decls.Overload(overloads.UintToInt, argTypes(types.UintType), types.IntType, - decls.OverloadExamples(`int(123u) // 123`), - decls.UnaryBinding(convertToType(types.IntType)))), - - // String conversions - function(overloads.TypeConvertString, - decls.FunctionDocs(`convert a value to a string`), - decls.Overload(overloads.StringToString, argTypes(types.StringType), types.StringType, - decls.OverloadExamples(`string('hello') // 'hello'`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.BoolToString, argTypes(types.BoolType), types.StringType, - decls.OverloadExamples(`string(true) // 'true'`), - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.BytesToString, argTypes(types.BytesType), types.StringType, - decls.OverloadExamples(`string(b'hello') // 'hello'`), - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.DoubleToString, argTypes(types.DoubleType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType)), - decls.OverloadExamples(`string(-1.23e4) // '-12300'`)), - decls.Overload(overloads.DurationToString, argTypes(types.DurationType), types.StringType, - decls.OverloadExamples(`string(duration('1h30m')) // '5400s'`), - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.IntToString, argTypes(types.IntType), types.StringType, - decls.OverloadExamples(`string(-123) // '-123'`), - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.TimestampToString, argTypes(types.TimestampType), types.StringType, - decls.OverloadExamples(`string(timestamp('1970-01-01T00:00:00Z')) // '1970-01-01T00:00:00Z'`), - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.UintToString, argTypes(types.UintType), types.StringType, - decls.OverloadExamples(`string(123u) // '123'`), - decls.UnaryBinding(convertToType(types.StringType)))), - - // Timestamp conversions - function(overloads.TypeConvertTimestamp, - decls.FunctionDocs(`convert a value to a google.protobuf.Timestamp`), - decls.Overload(overloads.TimestampToTimestamp, argTypes(types.TimestampType), types.TimestampType, - decls.OverloadExamples(`timestamp(timestamp('2023-01-01T00:00:00Z')) // timestamp('2023-01-01T00:00:00Z')`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToTimestamp, argTypes(types.IntType), types.TimestampType, - decls.OverloadExamples(`timestamp(1) // timestamp('1970-01-01T00:00:01Z')`), // Epoch seconds to Timestamp - decls.UnaryBinding(convertToType(types.TimestampType))), - decls.Overload(overloads.StringToTimestamp, argTypes(types.StringType), types.TimestampType, - decls.OverloadExamples(`timestamp('2025-01-01T12:34:56Z') // timestamp('2025-01-01T12:34:56Z')`), - decls.UnaryBinding(convertToType(types.TimestampType)))), - - // Uint conversions - function(overloads.TypeConvertUint, - decls.FunctionDocs(`convert a value to a uint`), - decls.Overload(overloads.UintToUint, argTypes(types.UintType), types.UintType, - decls.OverloadExamples(`uint(123u) // 123u`), - decls.UnaryBinding(identity)), - decls.Overload(overloads.DoubleToUint, argTypes(types.DoubleType), types.UintType, - decls.OverloadExamples(`uint(123.45) // 123u`), - decls.UnaryBinding(convertToType(types.UintType))), - decls.Overload(overloads.IntToUint, argTypes(types.IntType), types.UintType, - decls.OverloadExamples(`uint(123) // 123u`), - decls.UnaryBinding(convertToType(types.UintType))), - decls.Overload(overloads.StringToUint, argTypes(types.StringType), types.UintType, - decls.OverloadExamples(`uint('123') // 123u`), - decls.UnaryBinding(convertToType(types.UintType)))), - - // String functions - function(overloads.Contains, - decls.FunctionDocs(`test whether a string contains a substring`), - decls.MemberOverload(overloads.ContainsString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples( - `'hello world'.contains('o w') // true`, - `'hello world'.contains('goodbye') // false`), - decls.BinaryBinding(types.StringContains)), - decls.DisableTypeGuards(true)), - function(overloads.EndsWith, - decls.FunctionDocs(`test whether a string ends with a substring suffix`), - decls.MemberOverload(overloads.EndsWithString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples( - `'hello world'.endsWith('world') // true`, - `'hello world'.endsWith('hello') // false`), - decls.BinaryBinding(types.StringEndsWith)), - decls.DisableTypeGuards(true)), - function(overloads.StartsWith, - decls.FunctionDocs(`test whether a string starts with a substring prefix`), - decls.MemberOverload(overloads.StartsWithString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples( - `'hello world'.startsWith('hello') // true`, - `'hello world'.startsWith('world') // false`), - decls.BinaryBinding(types.StringStartsWith)), - decls.DisableTypeGuards(true)), - function(overloads.Matches, - decls.FunctionDocs(`test whether a string matches an RE2 regular expression`), - decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples( - `matches('123-456', '^[0-9]+(-[0-9]+)?$') // true`, - `matches('hello', '^h.*o$') // true`)), - decls.MemberOverload(overloads.MatchesString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.OverloadExamples( - `'123-456'.matches('^[0-9]+(-[0-9]+)?$') // true`, - `'hello'.matches('^h.*o$') // true`)), - decls.SingletonBinaryBinding(func(str, pat ref.Val) ref.Val { - return str.(traits.Matcher).Match(pat) - }, traits.MatcherType)), - - // Timestamp / duration functions - function(overloads.TimeGetFullYear, - decls.FunctionDocs(`get the 0-based full year from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToYear, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getFullYear() // 2023`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetFullYear(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToYearWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getFullYear('-08:00') // 2022`), - decls.BinaryBinding(timestampGetFullYear))), - - function(overloads.TimeGetMonth, - decls.FunctionDocs(`get the 0-based month from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToMonth, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMonth() // 6`), // July is month 6 - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetMonth(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToMonthWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getMonth('America/Los_Angeles') // 11`), // December is month 11 - decls.BinaryBinding(timestampGetMonth))), - - function(overloads.TimeGetDayOfYear, - decls.FunctionDocs(`get the 0-based day of the year from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToDayOfYear, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-01-02T00:00:00Z').getDayOfYear() // 1`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetDayOfYear(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToDayOfYearWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-01-01T05:00:00Z').getDayOfYear('America/Los_Angeles') // 364`), - decls.BinaryBinding(timestampGetDayOfYear))), - - function(overloads.TimeGetDayOfMonth, - decls.FunctionDocs(`get the 0-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBased, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfMonth() // 13`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetDayOfMonthZeroBased(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDayOfMonth('America/Los_Angeles') // 29`), - decls.BinaryBinding(timestampGetDayOfMonthZeroBased))), - - function(overloads.TimeGetDate, - decls.FunctionDocs(`get the 1-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToDayOfMonthOneBased, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDate() // 14`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetDayOfMonthOneBased(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDate('America/Los_Angeles') // 30`), - decls.BinaryBinding(timestampGetDayOfMonthOneBased))), - - function(overloads.TimeGetDayOfWeek, - decls.FunctionDocs(`get the 0-based day of the week from a timestamp, UTC unless an IANA timezone is specified.`), - decls.MemberOverload(overloads.TimestampToDayOfWeek, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfWeek() // 5`), // Friday is day 5 - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetDayOfWeek(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToDayOfWeekWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-16T05:00:00Z').getDayOfWeek('America/Los_Angeles') // 6`), // Saturday is day 6 - decls.BinaryBinding(timestampGetDayOfWeek))), - - function(overloads.TimeGetHours, - decls.FunctionDocs(`get the hours portion from a timestamp, or convert a duration to hours`), - decls.MemberOverload(overloads.TimestampToHours, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours() // 10`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetHours(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToHoursWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours('America/Los_Angeles') // 2`), - decls.BinaryBinding(timestampGetHours)), - decls.MemberOverload(overloads.DurationToHours, - argTypes(types.DurationType), types.IntType, - decls.OverloadExamples(`duration('3723s').getHours() // 1`), - decls.UnaryBinding(types.DurationGetHours))), - - function(overloads.TimeGetMinutes, - decls.FunctionDocs(`get the minutes portion from a timestamp, or convert a duration to minutes`), - decls.MemberOverload(overloads.TimestampToMinutes, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes() // 30`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetMinutes(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToMinutesWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes('America/Los_Angeles') // 30`), - decls.BinaryBinding(timestampGetMinutes)), - decls.MemberOverload(overloads.DurationToMinutes, - argTypes(types.DurationType), types.IntType, - decls.OverloadExamples(`duration('3723s').getMinutes() // 62`), - decls.UnaryBinding(types.DurationGetMinutes))), - - function(overloads.TimeGetSeconds, - decls.FunctionDocs(`get the seconds portion from a timestamp, or convert a duration to seconds`), - decls.MemberOverload(overloads.TimestampToSeconds, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds() // 45`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetSeconds(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToSecondsWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds('America/Los_Angeles') // 45`), - decls.BinaryBinding(timestampGetSeconds)), - decls.MemberOverload(overloads.DurationToSeconds, - argTypes(types.DurationType), types.IntType, - decls.OverloadExamples(`duration('3723.456s').getSeconds() // 3723`), - decls.UnaryBinding(types.DurationGetSeconds))), - - function(overloads.TimeGetMilliseconds, - decls.FunctionDocs(`get the milliseconds portion from a timestamp`), - decls.MemberOverload(overloads.TimestampToMilliseconds, - argTypes(types.TimestampType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds() // 123`), - decls.UnaryBinding(func(ts ref.Val) ref.Val { - return timestampGetMilliseconds(ts, utcTZ) - })), - decls.MemberOverload(overloads.TimestampToMillisecondsWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType, - decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds('America/Los_Angeles') // 123`), - decls.BinaryBinding(timestampGetMilliseconds)), - decls.MemberOverload(overloads.DurationToMilliseconds, - argTypes(types.DurationType), types.IntType, - decls.UnaryBinding(types.DurationGetMilliseconds))), - } -} - -// Functions returns the set of standard library function declarations and definitions for CEL. -func Functions() []*decls.FunctionDecl { - return stdFunctions -} - -// Types returns the set of standard library types for CEL. -func Types() []*decls.VariableDecl { - return stdTypes -} - -func notStrictlyFalse(value ref.Val) ref.Val { - if types.IsBool(value) { - return value - } - return types.True -} - -func inAggregate(lhs ref.Val, rhs ref.Val) ref.Val { - if rhs.Type().HasTrait(traits.ContainerType) { - return rhs.(traits.Container).Contains(lhs) - } - return types.ValOrErr(rhs, "no such overload") -} - -func function(name string, opts ...decls.FunctionOpt) *decls.FunctionDecl { - fn, err := decls.NewFunction(name, opts...) - if err != nil { - panic(err) - } - return fn -} - -func argTypes(args ...*types.Type) []*types.Type { - return args -} - -func noBinaryOverrides(rhs, lhs ref.Val) ref.Val { - return types.NoSuchOverloadErr() -} - -func noFunctionOverrides(args ...ref.Val) ref.Val { - return types.NoSuchOverloadErr() -} - -func identity(val ref.Val) ref.Val { - return val -} - -func convertToType(t ref.Type) functions.UnaryOp { - return func(val ref.Val) ref.Val { - return val.ConvertToType(t) - } -} - -func timestampGetFullYear(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Year()) -} - -func timestampGetMonth(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - // CEL spec indicates that the month should be 0-based, but the Time value - // for Month() is 1-based. - return types.Int(t.Month() - 1) -} - -func timestampGetDayOfYear(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.YearDay() - 1) -} - -func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Day() - 1) -} - -func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Day()) -} - -func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Weekday()) -} - -func timestampGetHours(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Hour()) -} - -func timestampGetMinutes(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Minute()) -} - -func timestampGetSeconds(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Second()) -} - -func timestampGetMilliseconds(ts, tz ref.Val) ref.Val { - t, err := inTimeZone(ts, tz) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(t.Nanosecond() / 1000000) -} - -func inTimeZone(ts, tz ref.Val) (time.Time, error) { - t := ts.(types.Timestamp) - val := string(tz.(types.String)) - ind := strings.Index(val, ":") - if ind == -1 { - loc, err := time.LoadLocation(val) - if err != nil { - return time.Time{}, err - } - return t.In(loc), nil - } - - // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC - // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes. - hr, err := strconv.Atoi(string(val[0:ind])) - if err != nil { - return time.Time{}, err - } - min, err := strconv.Atoi(string(val[ind+1:])) - if err != nil { - return time.Time{}, err - } - var offset int - if string(val[0]) == "-" { - offset = hr*60 - min - } else { - offset = hr*60 + min - } - secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds()) - timezone := time.FixedZone("", secondsEastOfUTC) - return t.In(timezone), nil -} diff --git a/vendor/github.com/google/cel-go/common/types/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/BUILD.bazel deleted file mode 100644 index 7082bc755..000000000 --- a/vendor/github.com/google/cel-go/common/types/BUILD.bazel +++ /dev/null @@ -1,93 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "any_value.go", - "bool.go", - "bytes.go", - "compare.go", - "double.go", - "duration.go", - "err.go", - "int.go", - "iterator.go", - "json_value.go", - "format.go", - "list.go", - "map.go", - "null.go", - "object.go", - "optional.go", - "overflow.go", - "provider.go", - "string.go", - "timestamp.go", - "types.go", - "uint.go", - "unknown.go", - "util.go", - ], - importpath = "github.com/google/cel-go/common/types", - deps = [ - "//checker/decls:go_default_library", - "//common/overloads:go_default_library", - "//common/types/pb:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@com_github_stoewer_go_strcase//:go_default_library", - "@dev_cel_expr//:expr", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - "@org_golang_google_protobuf//types/dynamicpb:go_default_library", - "@org_golang_google_protobuf//types/known/anypb:go_default_library", - "@org_golang_google_protobuf//types/known/durationpb:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", - "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "bool_test.go", - "bytes_test.go", - "double_test.go", - "duration_test.go", - "int_test.go", - "json_list_test.go", - "json_struct_test.go", - "list_test.go", - "map_test.go", - "null_test.go", - "object_test.go", - "optional_test.go", - "provider_test.go", - "string_test.go", - "timestamp_test.go", - "types_test.go", - "uint_test.go", - "unknown_test.go", - "util_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//common/types/ref:go_default_library", - "//test:go_default_library", - "//test/proto3pb:test_all_types_go_proto", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", - "@org_golang_google_protobuf//types/known/anypb:go_default_library", - "@org_golang_google_protobuf//types/known/durationpb:go_default_library", - "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/types/any_value.go b/vendor/github.com/google/cel-go/common/types/any_value.go deleted file mode 100644 index cda0f13ac..000000000 --- a/vendor/github.com/google/cel-go/common/types/any_value.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "reflect" - - anypb "google.golang.org/protobuf/types/known/anypb" -) - -// anyValueType constant representing the reflected type of google.protobuf.Any. -var anyValueType = reflect.TypeOf(&anypb.Any{}) diff --git a/vendor/github.com/google/cel-go/common/types/bool.go b/vendor/github.com/google/cel-go/common/types/bool.go deleted file mode 100644 index 1f9e10739..000000000 --- a/vendor/github.com/google/cel-go/common/types/bool.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Bool type that implements ref.Val and supports comparison and negation. -type Bool bool - -var ( - // boolWrapperType golang reflected type for protobuf bool wrapper type. - boolWrapperType = reflect.TypeOf(&wrapperspb.BoolValue{}) -) - -// Boolean constants -const ( - False = Bool(false) - True = Bool(true) -) - -// Compare implements the traits.Comparer interface method. -func (b Bool) Compare(other ref.Val) ref.Val { - otherBool, ok := other.(Bool) - if !ok { - return ValOrErr(other, "no such overload") - } - if b == otherBool { - return IntZero - } - if !b && otherBool { - return IntNegOne - } - return IntOne -} - -// ConvertToNative implements the ref.Val interface method. -func (b Bool) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Bool: - return reflect.ValueOf(b).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped to a wrapperspb.BoolValue before being packed into an Any. - return anypb.New(wrapperspb.Bool(bool(b))) - case boolWrapperType: - // Convert the bool to a wrapperspb.BoolValue. - return wrapperspb.Bool(bool(b)), nil - case jsonValueType: - // Return the bool as a new structpb.Value. - return structpb.NewBoolValue(bool(b)), nil - default: - if typeDesc.Elem().Kind() == reflect.Bool { - p := bool(b) - return &p, nil - } - } - case reflect.Interface: - bv := b.Value() - if reflect.TypeOf(bv).Implements(typeDesc) { - return bv, nil - } - if reflect.TypeOf(b).Implements(typeDesc) { - return b, nil - } - } - return nil, fmt.Errorf("type conversion error from bool to '%v'", typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (b Bool) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case StringType: - return String(strconv.FormatBool(bool(b))) - case BoolType: - return b - case TypeType: - return BoolType - } - return NewErr("type conversion error from '%v' to '%v'", BoolType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (b Bool) Equal(other ref.Val) ref.Val { - otherBool, ok := other.(Bool) - return Bool(ok && b == otherBool) -} - -// IsZeroValue returns true if the boolean value is false. -func (b Bool) IsZeroValue() bool { - return b == False -} - -// Negate implements the traits.Negater interface method. -func (b Bool) Negate() ref.Val { - return !b -} - -// Type implements the ref.Val interface method. -func (b Bool) Type() ref.Type { - return BoolType -} - -// Value implements the ref.Val interface method. -func (b Bool) Value() any { - return bool(b) -} - -func (b Bool) format(sb *strings.Builder) { - if b { - sb.WriteString("true") - } else { - sb.WriteString("false") - } -} - -// IsBool returns whether the input ref.Val or ref.Type is equal to BoolType. -func IsBool(elem ref.Val) bool { - switch v := elem.(type) { - case Bool: - return true - case ref.Val: - return v.Type() == BoolType - default: - return false - } -} diff --git a/vendor/github.com/google/cel-go/common/types/bytes.go b/vendor/github.com/google/cel-go/common/types/bytes.go deleted file mode 100644 index b59e1fc20..000000000 --- a/vendor/github.com/google/cel-go/common/types/bytes.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "bytes" - "encoding/base64" - "fmt" - "reflect" - "strings" - "unicode/utf8" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Bytes type that implements ref.Val and supports add, compare, and size -// operations. -type Bytes []byte - -var ( - // byteWrapperType golang reflected type for protobuf bytes wrapper type. - byteWrapperType = reflect.TypeOf(&wrapperspb.BytesValue{}) -) - -// Add implements traits.Adder interface method by concatenating byte sequences. -func (b Bytes) Add(other ref.Val) ref.Val { - otherBytes, ok := other.(Bytes) - if !ok { - return ValOrErr(other, "no such overload") - } - return append(b, otherBytes...) -} - -// Compare implements traits.Comparer interface method by lexicographic ordering. -func (b Bytes) Compare(other ref.Val) ref.Val { - otherBytes, ok := other.(Bytes) - if !ok { - return ValOrErr(other, "no such overload") - } - return Int(bytes.Compare(b, otherBytes)) -} - -// ConvertToNative implements the ref.Val interface method. -func (b Bytes) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Array: - if len(b) != typeDesc.Len() { - return nil, fmt.Errorf("[%d]byte not assignable to [%d]byte array", len(b), typeDesc.Len()) - } - refArrPtr := reflect.New(reflect.ArrayOf(len(b), typeDesc.Elem())) - refArr := refArrPtr.Elem() - for i, byt := range b { - refArr.Index(i).Set(reflect.ValueOf(byt).Convert(typeDesc.Elem())) - } - return refArr.Interface(), nil - case reflect.Slice: - return reflect.ValueOf(b).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped before being set on an Any field. - return anypb.New(wrapperspb.Bytes([]byte(b))) - case byteWrapperType: - // Convert the bytes to a wrapperspb.BytesValue. - return wrapperspb.Bytes([]byte(b)), nil - case jsonValueType: - // CEL follows the proto3 to JSON conversion by encoding bytes to a string via base64. - // The encoding below matches the golang 'encoding/json' behavior during marshaling, - // which uses base64.StdEncoding. - str := base64.StdEncoding.EncodeToString([]byte(b)) - return structpb.NewStringValue(str), nil - } - case reflect.Interface: - bv := b.Value() - if reflect.TypeOf(bv).Implements(typeDesc) { - return bv, nil - } - if reflect.TypeOf(b).Implements(typeDesc) { - return b, nil - } - } - return nil, fmt.Errorf("type conversion error from Bytes to '%v'", typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (b Bytes) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case StringType: - if !utf8.Valid(b) { - return NewErr("invalid UTF-8 in bytes, cannot convert to string") - } - return String(b) - case BytesType: - return b - case TypeType: - return BytesType - } - return NewErr("type conversion error from '%s' to '%s'", BytesType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (b Bytes) Equal(other ref.Val) ref.Val { - otherBytes, ok := other.(Bytes) - return Bool(ok && bytes.Equal(b, otherBytes)) -} - -// IsZeroValue returns true if the byte array is empty. -func (b Bytes) IsZeroValue() bool { - return len(b) == 0 -} - -// Size implements the traits.Sizer interface method. -func (b Bytes) Size() ref.Val { - return Int(len(b)) -} - -// Type implements the ref.Val interface method. -func (b Bytes) Type() ref.Type { - return BytesType -} - -// Value implements the ref.Val interface method. -func (b Bytes) Value() any { - return []byte(b) -} - -func (b Bytes) format(sb *strings.Builder) { - fmt.Fprintf(sb, "b\"%s\"", bytesToOctets([]byte(b))) -} - -// bytesToOctets converts byte sequences to a string using a three digit octal encoded value -// per byte. -func bytesToOctets(byteVal []byte) string { - var b strings.Builder - for _, c := range byteVal { - fmt.Fprintf(&b, "\\%03o", c) - } - return b.String() -} diff --git a/vendor/github.com/google/cel-go/common/types/compare.go b/vendor/github.com/google/cel-go/common/types/compare.go deleted file mode 100644 index e19682618..000000000 --- a/vendor/github.com/google/cel-go/common/types/compare.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "math" - - "github.com/google/cel-go/common/types/ref" -) - -func compareDoubleInt(d Double, i Int) Int { - if d < math.MinInt64 { - return IntNegOne - } - if d > math.MaxInt64 { - return IntOne - } - return compareDouble(d, Double(i)) -} - -func compareIntDouble(i Int, d Double) Int { - return -compareDoubleInt(d, i) -} - -func compareDoubleUint(d Double, u Uint) Int { - if d < 0 { - return IntNegOne - } - if d > math.MaxUint64 { - return IntOne - } - return compareDouble(d, Double(u)) -} - -func compareUintDouble(u Uint, d Double) Int { - return -compareDoubleUint(d, u) -} - -func compareIntUint(i Int, u Uint) Int { - if i < 0 || u > math.MaxInt64 { - return IntNegOne - } - cmp := i - Int(u) - if cmp < 0 { - return IntNegOne - } - if cmp > 0 { - return IntOne - } - return IntZero -} - -func compareUintInt(u Uint, i Int) Int { - return -compareIntUint(i, u) -} - -func compareDouble(a, b Double) Int { - if a < b { - return IntNegOne - } - if a > b { - return IntOne - } - return IntZero -} - -func compareInt(a, b Int) ref.Val { - if a < b { - return IntNegOne - } - if a > b { - return IntOne - } - return IntZero -} - -func compareUint(a, b Uint) ref.Val { - if a < b { - return IntNegOne - } - if a > b { - return IntOne - } - return IntZero -} diff --git a/vendor/github.com/google/cel-go/common/types/doc.go b/vendor/github.com/google/cel-go/common/types/doc.go deleted file mode 100644 index 5f641d704..000000000 --- a/vendor/github.com/google/cel-go/common/types/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package types contains the types, traits, and utilities common to all -// components of expression handling. -package types diff --git a/vendor/github.com/google/cel-go/common/types/double.go b/vendor/github.com/google/cel-go/common/types/double.go deleted file mode 100644 index 1e7de9d6e..000000000 --- a/vendor/github.com/google/cel-go/common/types/double.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "math" - "reflect" - "strconv" - "strings" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Double type that implements ref.Val, comparison, and mathematical -// operations. -type Double float64 - -var ( - // doubleWrapperType reflected type for protobuf double wrapper type. - doubleWrapperType = reflect.TypeOf(&wrapperspb.DoubleValue{}) - - // floatWrapperType reflected type for protobuf float wrapper type. - floatWrapperType = reflect.TypeOf(&wrapperspb.FloatValue{}) -) - -// Add implements traits.Adder.Add. -func (d Double) Add(other ref.Val) ref.Val { - otherDouble, ok := other.(Double) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - return d + otherDouble -} - -// Compare implements traits.Comparer.Compare. -func (d Double) Compare(other ref.Val) ref.Val { - if math.IsNaN(float64(d)) { - return NewErr("NaN values cannot be ordered") - } - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return NewErr("NaN values cannot be ordered") - } - return compareDouble(d, ov) - case Int: - return compareDoubleInt(d, ov) - case Uint: - return compareDoubleUint(d, ov) - default: - return MaybeNoSuchOverloadErr(other) - } -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (d Double) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Float32: - v := float32(d) - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Float64: - v := float64(d) - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped before being set on an Any field. - return anypb.New(wrapperspb.Double(float64(d))) - case doubleWrapperType: - // Convert to a wrapperspb.DoubleValue - return wrapperspb.Double(float64(d)), nil - case floatWrapperType: - // Convert to a wrapperspb.FloatValue (with truncation). - return wrapperspb.Float(float32(d)), nil - case jsonValueType: - // Note, there are special cases for proto3 to json conversion that - // expect the floating point value to be converted to a NaN, - // Infinity, or -Infinity string values, but the jsonpb string - // marshaling of the protobuf.Value will handle this conversion. - return structpb.NewNumberValue(float64(d)), nil - } - switch typeDesc.Elem().Kind() { - case reflect.Float32: - v := float32(d) - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - case reflect.Float64: - v := float64(d) - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - } - case reflect.Interface: - dv := d.Value() - if reflect.TypeOf(dv).Implements(typeDesc) { - return dv, nil - } - if reflect.TypeOf(d).Implements(typeDesc) { - return d, nil - } - } - return nil, fmt.Errorf("type conversion error from Double to '%v'", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (d Double) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case IntType: - i, err := doubleToInt64Checked(float64(d)) - if err != nil { - return WrapErr(err) - } - return Int(i) - case UintType: - i, err := doubleToUint64Checked(float64(d)) - if err != nil { - return WrapErr(err) - } - return Uint(i) - case DoubleType: - return d - case StringType: - return String(fmt.Sprintf("%g", float64(d))) - case TypeType: - return DoubleType - } - return NewErr("type conversion error from '%s' to '%s'", DoubleType, typeVal) -} - -// Divide implements traits.Divider.Divide. -func (d Double) Divide(other ref.Val) ref.Val { - otherDouble, ok := other.(Double) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - return d / otherDouble -} - -// Equal implements ref.Val.Equal. -func (d Double) Equal(other ref.Val) ref.Val { - if math.IsNaN(float64(d)) { - return False - } - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return False - } - return Bool(d == ov) - case Int: - return Bool(compareDoubleInt(d, ov) == 0) - case Uint: - return Bool(compareDoubleUint(d, ov) == 0) - default: - return False - } -} - -// IsZeroValue returns true if double value is 0.0 -func (d Double) IsZeroValue() bool { - return float64(d) == 0.0 -} - -// Multiply implements traits.Multiplier.Multiply. -func (d Double) Multiply(other ref.Val) ref.Val { - otherDouble, ok := other.(Double) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - return d * otherDouble -} - -// Negate implements traits.Negater.Negate. -func (d Double) Negate() ref.Val { - return -d -} - -// Subtract implements traits.Subtractor.Subtract. -func (d Double) Subtract(subtrahend ref.Val) ref.Val { - subtraDouble, ok := subtrahend.(Double) - if !ok { - return MaybeNoSuchOverloadErr(subtrahend) - } - return d - subtraDouble -} - -// Type implements ref.Val.Type. -func (d Double) Type() ref.Type { - return DoubleType -} - -// Value implements ref.Val.Value. -func (d Double) Value() any { - return float64(d) -} - -func (d Double) format(sb *strings.Builder) { - if math.IsNaN(float64(d)) { - sb.WriteString(`double("NaN")`) - return - } - if math.IsInf(float64(d), -1) { - sb.WriteString(`double("-Infinity")`) - return - } - if math.IsInf(float64(d), 1) { - sb.WriteString(`double("Infinity")`) - return - } - s := strconv.FormatFloat(float64(d), 'f', -1, 64) - sb.WriteString(s) - if !strings.ContainsRune(s, '.') { - sb.WriteString(".0") - } -} diff --git a/vendor/github.com/google/cel-go/common/types/duration.go b/vendor/github.com/google/cel-go/common/types/duration.go deleted file mode 100644 index be58d567e..000000000 --- a/vendor/github.com/google/cel-go/common/types/duration.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strconv" - "strings" - "time" - - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - dpb "google.golang.org/protobuf/types/known/durationpb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// Duration type that implements ref.Val and supports add, compare, negate, -// and subtract operators. This type is also a receiver which means it can -// participate in dispatch to receiver functions. -type Duration struct { - time.Duration -} - -func durationOf(d time.Duration) Duration { - return Duration{Duration: d} -} - -var ( - durationValueType = reflect.TypeOf(&dpb.Duration{}) - - durationZeroArgOverloads = map[string]func(ref.Val) ref.Val{ - overloads.TimeGetHours: DurationGetHours, - overloads.TimeGetMinutes: DurationGetMinutes, - overloads.TimeGetSeconds: DurationGetSeconds, - overloads.TimeGetMilliseconds: DurationGetMilliseconds, - } -) - -// Add implements traits.Adder.Add. -func (d Duration) Add(other ref.Val) ref.Val { - switch other.Type() { - case DurationType: - dur2 := other.(Duration) - val, err := addDurationChecked(d.Duration, dur2.Duration) - if err != nil { - return WrapErr(err) - } - return durationOf(val) - case TimestampType: - ts := other.(Timestamp).Time - val, err := addTimeDurationChecked(ts, d.Duration) - if err != nil { - return WrapErr(err) - } - return timestampOf(val) - } - return MaybeNoSuchOverloadErr(other) -} - -// Compare implements traits.Comparer.Compare. -func (d Duration) Compare(other ref.Val) ref.Val { - otherDur, ok := other.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - d1 := d.Duration - d2 := otherDur.Duration - switch { - case d1 < d2: - return IntNegOne - case d1 > d2: - return IntOne - default: - return IntZero - } -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (d Duration) ConvertToNative(typeDesc reflect.Type) (any, error) { - // If the duration is already assignable to the desired type return it. - if reflect.TypeOf(d.Duration).AssignableTo(typeDesc) { - return d.Duration, nil - } - if reflect.TypeOf(d).AssignableTo(typeDesc) { - return d, nil - } - switch typeDesc { - case anyValueType: - // Pack the duration as a dpb.Duration into an Any value. - return anypb.New(dpb.New(d.Duration)) - case durationValueType: - // Unwrap the CEL value to its underlying proto value. - return dpb.New(d.Duration), nil - case jsonValueType: - // CEL follows the proto3 to JSON conversion. - // Note, using jsonpb would wrap the result in extra double quotes. - v := d.ConvertToType(StringType) - if IsError(v) { - return nil, v.(*Err) - } - return structpb.NewStringValue(string(v.(String))), nil - } - return nil, fmt.Errorf("type conversion error from 'Duration' to '%v'", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (d Duration) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case StringType: - return String(strconv.FormatFloat(d.Seconds(), 'f', -1, 64) + "s") - case IntType: - return Int(d.Duration) - case DurationType: - return d - case TypeType: - return DurationType - } - return NewErr("type conversion error from '%s' to '%s'", DurationType, typeVal) -} - -// Equal implements ref.Val.Equal. -func (d Duration) Equal(other ref.Val) ref.Val { - otherDur, ok := other.(Duration) - return Bool(ok && d.Duration == otherDur.Duration) -} - -// IsZeroValue returns true if the duration value is zero -func (d Duration) IsZeroValue() bool { - return d.Duration == 0 -} - -// Negate implements traits.Negater.Negate. -func (d Duration) Negate() ref.Val { - val, err := negateDurationChecked(d.Duration) - if err != nil { - return WrapErr(err) - } - return durationOf(val) -} - -// Receive implements traits.Receiver.Receive. -func (d Duration) Receive(function string, overload string, args []ref.Val) ref.Val { - if len(args) == 0 { - if f, found := durationZeroArgOverloads[function]; found { - return f(d) - } - } - return NoSuchOverloadErr() -} - -// Subtract implements traits.Subtractor.Subtract. -func (d Duration) Subtract(subtrahend ref.Val) ref.Val { - subtraDur, ok := subtrahend.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(subtrahend) - } - val, err := subtractDurationChecked(d.Duration, subtraDur.Duration) - if err != nil { - return WrapErr(err) - } - return durationOf(val) -} - -// Type implements ref.Val.Type. -func (d Duration) Type() ref.Type { - return DurationType -} - -// Value implements ref.Val.Value. -func (d Duration) Value() any { - return d.Duration -} - -func (d Duration) format(sb *strings.Builder) { - fmt.Fprintf(sb, `duration("%ss")`, strconv.FormatFloat(d.Seconds(), 'f', -1, 64)) -} - -// DurationGetHours returns the duration in hours. -func DurationGetHours(val ref.Val) ref.Val { - dur, ok := val.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(val) - } - return Int(dur.Hours()) -} - -// DurationGetMinutes returns duration in minutes. -func DurationGetMinutes(val ref.Val) ref.Val { - dur, ok := val.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(val) - } - return Int(dur.Minutes()) -} - -// DurationGetSeconds returns duration in seconds. -func DurationGetSeconds(val ref.Val) ref.Val { - dur, ok := val.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(val) - } - return Int(dur.Seconds()) -} - -// DurationGetMilliseconds returns duration in milliseconds. -func DurationGetMilliseconds(val ref.Val) ref.Val { - dur, ok := val.(Duration) - if !ok { - return MaybeNoSuchOverloadErr(val) - } - return Int(dur.Milliseconds()) -} diff --git a/vendor/github.com/google/cel-go/common/types/err.go b/vendor/github.com/google/cel-go/common/types/err.go deleted file mode 100644 index 17ab1a95e..000000000 --- a/vendor/github.com/google/cel-go/common/types/err.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" - "fmt" - "reflect" - - "github.com/google/cel-go/common/types/ref" -) - -// Error interface which allows types types.Err values to be treated as error values. -type Error interface { - error - ref.Val -} - -// Err type which extends the built-in go error and implements ref.Val. -type Err struct { - error - id int64 -} - -var ( - // ErrType singleton. - ErrType = NewOpaqueType("error") - - // errDivideByZero is an error indicating a division by zero of an integer value. - errDivideByZero = errors.New("division by zero") - // errModulusByZero is an error indicating a modulus by zero of an integer value. - errModulusByZero = errors.New("modulus by zero") - // errIntOverflow is an error representing integer overflow. - errIntOverflow = errors.New("integer overflow") - // errUintOverflow is an error representing unsigned integer overflow. - errUintOverflow = errors.New("unsigned integer overflow") - // errDurationOverflow is an error representing duration overflow. - errDurationOverflow = errors.New("duration overflow") - // errTimestampOverflow is an error representing timestamp overflow. - errTimestampOverflow = errors.New("timestamp overflow") - celErrTimestampOverflow = &Err{error: errTimestampOverflow} - - // celErrNoSuchOverload indicates that the call arguments did not match a supported method signature. - celErrNoSuchOverload = NewErr("no such overload") -) - -// NewErr creates a new Err described by the format string and args. -// TODO: Audit the use of this function and standardize the error messages and codes. -func NewErr(format string, args ...any) ref.Val { - return &Err{error: fmt.Errorf(format, args...)} -} - -// NewErrFromString creates a new Err with the provided message. -// TODO: Audit the use of this function and standardize the error messages and codes. -func NewErrFromString(message string) ref.Val { - return &Err{error: errors.New(message)} -} - -// NewErrWithNodeID creates a new Err described by the format string and args. -// TODO: Audit the use of this function and standardize the error messages and codes. -func NewErrWithNodeID(id int64, format string, args ...any) ref.Val { - return &Err{error: fmt.Errorf(format, args...), id: id} -} - -// LabelErrNode returns val unaltered it is not an Err or if the error has a non-zero -// AST node ID already present. Otherwise the id is added to the error for -// recovery with the Err.NodeID method. -func LabelErrNode(id int64, val ref.Val) ref.Val { - if err, ok := val.(*Err); ok && err.id == 0 { - err.id = id - return err - } - return val -} - -// NoSuchOverloadErr returns a new types.Err instance with a no such overload message. -func NoSuchOverloadErr() ref.Val { - return celErrNoSuchOverload -} - -// UnsupportedRefValConversionErr returns a types.NewErr instance with a no such conversion -// message that indicates that the native value could not be converted to a CEL ref.Val. -func UnsupportedRefValConversionErr(val any) ref.Val { - return NewErr("unsupported conversion to ref.Val: (%T)%v", val, val) -} - -// MaybeNoSuchOverloadErr returns the error or unknown if the input ref.Val is one of these types, -// else a new no such overload error. -func MaybeNoSuchOverloadErr(val ref.Val) ref.Val { - return ValOrErr(val, "no such overload") -} - -// ValOrErr either returns the existing error or creates a new one. -// TODO: Audit the use of this function and standardize the error messages and codes. -func ValOrErr(val ref.Val, format string, args ...any) ref.Val { - if val == nil || !IsUnknownOrError(val) { - return NewErr(format, args...) - } - return val -} - -// WrapErr wraps an existing Go error value into a CEL Err value. -func WrapErr(err error) ref.Val { - return &Err{error: err} -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (e *Err) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, e.error -} - -// ConvertToType implements ref.Val.ConvertToType. -func (e *Err) ConvertToType(typeVal ref.Type) ref.Val { - // Errors are not convertible to other representations. - return e -} - -// Equal implements ref.Val.Equal. -func (e *Err) Equal(other ref.Val) ref.Val { - // An error cannot be equal to any other value, so it returns itself. - return e -} - -// String implements fmt.Stringer. -func (e *Err) String() string { - return e.error.Error() -} - -// Type implements ref.Val.Type. -func (e *Err) Type() ref.Type { - return ErrType -} - -// Value implements ref.Val.Value. -func (e *Err) Value() any { - return e.error -} - -// NodeID returns the AST node ID of the expression that returned the error. -func (e *Err) NodeID() int64 { - return e.id -} - -// Is implements errors.Is. -func (e *Err) Is(target error) bool { - return e.error.Error() == target.Error() -} - -// Unwrap implements errors.Unwrap. -func (e *Err) Unwrap() error { - return e.error -} - -// IsError returns whether the input element ref.Type or ref.Val is equal to -// the ErrType singleton. -func IsError(val ref.Val) bool { - switch val.(type) { - case *Err: - return true - default: - return false - } -} diff --git a/vendor/github.com/google/cel-go/common/types/format.go b/vendor/github.com/google/cel-go/common/types/format.go deleted file mode 100644 index 174a2bd04..000000000 --- a/vendor/github.com/google/cel-go/common/types/format.go +++ /dev/null @@ -1,42 +0,0 @@ -package types - -import ( - "fmt" - "strings" - - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -type formattable interface { - format(*strings.Builder) -} - -// Format formats the value as a string. The result is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. It may change at any time. -func Format(val ref.Val) string { - var sb strings.Builder - formatTo(&sb, val) - return sb.String() -} - -func formatTo(sb *strings.Builder, val ref.Val) { - if fmtable, ok := val.(formattable); ok { - fmtable.format(sb) - return - } - // All of the builtins implement formattable. Try to deal with traits. - if l, ok := val.(traits.Lister); ok { - formatList(l, sb) - return - } - if m, ok := val.(traits.Mapper); ok { - formatMap(m, sb) - return - } - // This could be an error, unknown, opaque or object. - // Unfortunately we have no consistent way of inspecting - // opaque and object. So we just fallback to fmt.Stringer - // and hope it is relavent. - fmt.Fprintf(sb, "%s", val) -} diff --git a/vendor/github.com/google/cel-go/common/types/int.go b/vendor/github.com/google/cel-go/common/types/int.go deleted file mode 100644 index 0ac1997b7..000000000 --- a/vendor/github.com/google/cel-go/common/types/int.go +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "math" - "reflect" - "strconv" - "strings" - "time" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Int type that implements ref.Val as well as comparison and math operators. -type Int int64 - -// Int constants used for comparison results. -const ( - // IntZero is the zero-value for Int - IntZero = Int(0) - IntOne = Int(1) - IntNegOne = Int(-1) -) - -var ( - // int32WrapperType reflected type for protobuf int32 wrapper type. - int32WrapperType = reflect.TypeOf(&wrapperspb.Int32Value{}) - - // int64WrapperType reflected type for protobuf int64 wrapper type. - int64WrapperType = reflect.TypeOf(&wrapperspb.Int64Value{}) -) - -// Add implements traits.Adder.Add. -func (i Int) Add(other ref.Val) ref.Val { - otherInt, ok := other.(Int) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := addInt64Checked(int64(i), int64(otherInt)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Compare implements traits.Comparer.Compare. -func (i Int) Compare(other ref.Val) ref.Val { - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return NewErr("NaN values cannot be ordered") - } - return compareIntDouble(i, ov) - case Int: - return compareInt(i, ov) - case Uint: - return compareIntUint(i, ov) - default: - return MaybeNoSuchOverloadErr(other) - } -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (i Int) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Int, reflect.Int32: - // Enums are also mapped as int32 derivations. - // Note, the code doesn't convert to the enum value directly since this is not known, but - // the net effect with respect to proto-assignment is handled correctly by the reflection - // Convert method. - v, err := int64ToInt32Checked(int64(i)) - if err != nil { - return nil, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Int8: - v, err := int64ToInt8Checked(int64(i)) - if err != nil { - return nil, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Int16: - v, err := int64ToInt16Checked(int64(i)) - if err != nil { - return nil, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Int64: - return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped before being set on an Any field. - return anypb.New(wrapperspb.Int64(int64(i))) - case int32WrapperType: - // Convert the value to a wrapperspb.Int32Value, error on overflow. - v, err := int64ToInt32Checked(int64(i)) - if err != nil { - return nil, err - } - return wrapperspb.Int32(v), nil - case int64WrapperType: - // Convert the value to a wrapperspb.Int64Value. - return wrapperspb.Int64(int64(i)), nil - case jsonValueType: - // The proto-to-JSON conversion rules would convert all 64-bit integer values to JSON - // decimal strings. Because CEL ints might come from the automatic widening of 32-bit - // values in protos, the JSON type is chosen dynamically based on the value. - // - // - Integers -2^53-1 < n < 2^53-1 are encoded as JSON numbers. - // - Integers outside this range are encoded as JSON strings. - // - // The integer to float range represents the largest interval where such a conversion - // can round-trip accurately. Thus, conversions from a 32-bit source can expect a JSON - // number as with protobuf. Those consuming JSON from a 64-bit source must be able to - // handle either a JSON number or a JSON decimal string. To handle these cases safely - // the string values must be explicitly converted to int() within a CEL expression; - // however, it is best to simply stay within the JSON number range when building JSON - // objects in CEL. - if i.isJSONSafe() { - return structpb.NewNumberValue(float64(i)), nil - } - // Proto3 to JSON conversion requires string-formatted int64 values - // since the conversion to floating point would result in truncation. - return structpb.NewStringValue(strconv.FormatInt(int64(i), 10)), nil - } - switch typeDesc.Elem().Kind() { - case reflect.Int32: - // Convert the value to a wrapperspb.Int32Value, error on overflow. - v, err := int64ToInt32Checked(int64(i)) - if err != nil { - return nil, err - } - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - case reflect.Int64: - v := int64(i) - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - } - case reflect.Interface: - iv := i.Value() - if reflect.TypeOf(iv).Implements(typeDesc) { - return iv, nil - } - if reflect.TypeOf(i).Implements(typeDesc) { - return i, nil - } - } - return nil, fmt.Errorf("unsupported type conversion from 'int' to %v", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (i Int) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case IntType: - return i - case UintType: - u, err := int64ToUint64Checked(int64(i)) - if err != nil { - return WrapErr(err) - } - return Uint(u) - case DoubleType: - return Double(i) - case StringType: - return String(fmt.Sprintf("%d", int64(i))) - case TimestampType: - // The maximum positive value that can be passed to time.Unix is math.MaxInt64 minus the number - // of seconds between year 1 and year 1970. See comments on unixToInternal. - if int64(i) < minUnixTime || int64(i) > maxUnixTime { - return celErrTimestampOverflow - } - return timestampOf(time.Unix(int64(i), 0).UTC()) - case TypeType: - return IntType - } - return NewErr("type conversion error from '%s' to '%s'", IntType, typeVal) -} - -// Divide implements traits.Divider.Divide. -func (i Int) Divide(other ref.Val) ref.Val { - otherInt, ok := other.(Int) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := divideInt64Checked(int64(i), int64(otherInt)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Equal implements ref.Val.Equal. -func (i Int) Equal(other ref.Val) ref.Val { - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return False - } - return Bool(compareIntDouble(i, ov) == 0) - case Int: - return Bool(i == ov) - case Uint: - return Bool(compareIntUint(i, ov) == 0) - default: - return False - } -} - -// IsZeroValue returns true if integer is equal to 0 -func (i Int) IsZeroValue() bool { - return i == IntZero -} - -// Modulo implements traits.Modder.Modulo. -func (i Int) Modulo(other ref.Val) ref.Val { - otherInt, ok := other.(Int) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := moduloInt64Checked(int64(i), int64(otherInt)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Multiply implements traits.Multiplier.Multiply. -func (i Int) Multiply(other ref.Val) ref.Val { - otherInt, ok := other.(Int) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := multiplyInt64Checked(int64(i), int64(otherInt)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Negate implements traits.Negater.Negate. -func (i Int) Negate() ref.Val { - val, err := negateInt64Checked(int64(i)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Subtract implements traits.Subtractor.Subtract. -func (i Int) Subtract(subtrahend ref.Val) ref.Val { - subtraInt, ok := subtrahend.(Int) - if !ok { - return MaybeNoSuchOverloadErr(subtrahend) - } - val, err := subtractInt64Checked(int64(i), int64(subtraInt)) - if err != nil { - return WrapErr(err) - } - return Int(val) -} - -// Type implements ref.Val.Type. -func (i Int) Type() ref.Type { - return IntType -} - -// Value implements ref.Val.Value. -func (i Int) Value() any { - return int64(i) -} - -func (i Int) format(sb *strings.Builder) { - sb.WriteString(strconv.FormatInt(int64(i), 10)) -} - -// isJSONSafe indicates whether the int is safely representable as a floating point value in JSON. -func (i Int) isJSONSafe() bool { - return i >= minIntJSON && i <= maxIntJSON -} - -const ( - // maxIntJSON is defined as the Number.MAX_SAFE_INTEGER value per EcmaScript 6. - maxIntJSON = 1<<53 - 1 - // minIntJSON is defined as the Number.MIN_SAFE_INTEGER value per EcmaScript 6. - minIntJSON = -maxIntJSON -) diff --git a/vendor/github.com/google/cel-go/common/types/iterator.go b/vendor/github.com/google/cel-go/common/types/iterator.go deleted file mode 100644 index 98e9147b6..000000000 --- a/vendor/github.com/google/cel-go/common/types/iterator.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -var ( - // IteratorType singleton. - IteratorType = NewObjectType("iterator", traits.IteratorType) -) - -// baseIterator is the basis for list, map, and object iterators. -// -// An iterator in and of itself should not be a valid value for comparison, but must implement the -// `ref.Val` methods in order to be well-supported within instruction arguments processed by the -// interpreter. -type baseIterator struct{} - -func (*baseIterator) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("type conversion on iterators not supported") -} - -func (*baseIterator) ConvertToType(typeVal ref.Type) ref.Val { - return NewErr("no such overload") -} - -func (*baseIterator) Equal(other ref.Val) ref.Val { - return NewErr("no such overload") -} - -func (*baseIterator) Type() ref.Type { - return IteratorType -} - -func (*baseIterator) Value() any { - return nil -} diff --git a/vendor/github.com/google/cel-go/common/types/json_value.go b/vendor/github.com/google/cel-go/common/types/json_value.go deleted file mode 100644 index 13a4efe7a..000000000 --- a/vendor/github.com/google/cel-go/common/types/json_value.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "reflect" - - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// JSON type constants representing the reflected types of protobuf JSON values. -var ( - jsonValueType = reflect.TypeOf(&structpb.Value{}) - jsonListValueType = reflect.TypeOf(&structpb.ListValue{}) - jsonStructType = reflect.TypeOf(&structpb.Struct{}) - jsonNullType = reflect.TypeOf(structpb.NullValue_NULL_VALUE) -) diff --git a/vendor/github.com/google/cel-go/common/types/list.go b/vendor/github.com/google/cel-go/common/types/list.go deleted file mode 100644 index 8c023f891..000000000 --- a/vendor/github.com/google/cel-go/common/types/list.go +++ /dev/null @@ -1,590 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// NewDynamicList returns a traits.Lister with heterogenous elements. -// value should be an array of "native" types, i.e. any type that -// NativeToValue() can convert to a ref.Val. -func NewDynamicList(adapter Adapter, value any) traits.Lister { - refValue := reflect.ValueOf(value) - return &baseList{ - Adapter: adapter, - value: value, - size: refValue.Len(), - get: func(i int) any { - return refValue.Index(i).Interface() - }, - } -} - -// NewStringList returns a traits.Lister containing only strings. -func NewStringList(adapter Adapter, elems []string) traits.Lister { - return &baseList{ - Adapter: adapter, - value: elems, - size: len(elems), - get: func(i int) any { return elems[i] }, - } -} - -// NewRefValList returns a traits.Lister with ref.Val elements. -// -// This type specialization is used with list literals within CEL expressions. -func NewRefValList(adapter Adapter, elems []ref.Val) traits.Lister { - return &baseList{ - Adapter: adapter, - value: elems, - size: len(elems), - get: func(i int) any { return elems[i] }, - } -} - -// NewProtoList returns a traits.Lister based on a pb.List instance. -func NewProtoList(adapter Adapter, list protoreflect.List) traits.Lister { - return &baseList{ - Adapter: adapter, - value: list, - size: list.Len(), - get: func(i int) any { return list.Get(i).Interface() }, - } -} - -// NewJSONList returns a traits.Lister based on structpb.ListValue instance. -func NewJSONList(adapter Adapter, l *structpb.ListValue) traits.Lister { - vals := l.GetValues() - return &baseList{ - Adapter: adapter, - value: l, - size: len(vals), - get: func(i int) any { return vals[i] }, - } -} - -// NewMutableList creates a new mutable list whose internal state can be modified. -func NewMutableList(adapter Adapter) traits.MutableLister { - var mutableValues []ref.Val - l := &mutableList{ - baseList: &baseList{ - Adapter: adapter, - value: mutableValues, - size: 0, - }, - mutableValues: mutableValues, - } - l.get = func(i int) any { - return l.mutableValues[i] - } - return l -} - -// baseList points to a list containing elements of any type. -// The `value` is an array of native values, and refValue is its reflection object. -// The `Adapter` enables native type to CEL type conversions. -type baseList struct { - Adapter - value any - - // size indicates the number of elements within the list. - // Since objects are immutable the size of a list is static. - size int - - // get returns a value at the specified integer index. - // The index is guaranteed to be checked against the list index range. - get func(int) any -} - -// Add implements the traits.Adder interface method. -func (l *baseList) Add(other ref.Val) ref.Val { - otherList, ok := other.(traits.Lister) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - if l.Size() == IntZero { - return other - } - if otherList.Size() == IntZero { - return l - } - return &concatList{ - Adapter: l.Adapter, - prevList: l, - nextList: otherList} -} - -// Contains implements the traits.Container interface method. -func (l *baseList) Contains(elem ref.Val) ref.Val { - for i := 0; i < l.size; i++ { - val := l.NativeToValue(l.get(i)) - cmp := elem.Equal(val) - b, ok := cmp.(Bool) - if ok && b == True { - return True - } - } - return False -} - -// ConvertToNative implements the ref.Val interface method. -func (l *baseList) ConvertToNative(typeDesc reflect.Type) (any, error) { - // If the underlying list value is assignable to the reflected type return it. - if reflect.TypeOf(l.value).AssignableTo(typeDesc) { - return l.value, nil - } - // If the list wrapper is assignable to the desired type return it. - if reflect.TypeOf(l).AssignableTo(typeDesc) { - return l, nil - } - // Attempt to convert the list to a set of well known protobuf types. - switch typeDesc { - case anyValueType: - json, err := l.ConvertToNative(jsonListValueType) - if err != nil { - return nil, err - } - return anypb.New(json.(proto.Message)) - case jsonValueType, jsonListValueType: - jsonValues, err := - l.ConvertToNative(reflect.TypeOf([]*structpb.Value{})) - if err != nil { - return nil, err - } - jsonList := &structpb.ListValue{Values: jsonValues.([]*structpb.Value)} - if typeDesc == jsonListValueType { - return jsonList, nil - } - return structpb.NewListValue(jsonList), nil - } - // Non-list conversion. - if typeDesc.Kind() != reflect.Slice && typeDesc.Kind() != reflect.Array { - return nil, fmt.Errorf("type conversion error from list to '%v'", typeDesc) - } - - // List conversion. - // Allow the element ConvertToNative() function to determine whether conversion is possible. - otherElemType := typeDesc.Elem() - elemCount := l.size - var nativeList reflect.Value - if typeDesc.Kind() == reflect.Array { - nativeList = reflect.New(reflect.ArrayOf(elemCount, typeDesc)).Elem().Index(0) - } else { - nativeList = reflect.MakeSlice(typeDesc, elemCount, elemCount) - - } - for i := 0; i < elemCount; i++ { - elem := l.NativeToValue(l.get(i)) - nativeElemVal, err := elem.ConvertToNative(otherElemType) - if err != nil { - return nil, err - } - nativeList.Index(i).Set(reflect.ValueOf(nativeElemVal)) - } - return nativeList.Interface(), nil -} - -// ConvertToType implements the ref.Val interface method. -func (l *baseList) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case ListType: - return l - case TypeType: - return ListType - } - return NewErr("type conversion error from '%s' to '%s'", ListType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (l *baseList) Equal(other ref.Val) ref.Val { - otherList, ok := other.(traits.Lister) - if !ok { - return False - } - if l.Size() != otherList.Size() { - return False - } - for i := IntZero; i < l.Size().(Int); i++ { - thisElem := l.Get(i) - otherElem := otherList.Get(i) - elemEq := Equal(thisElem, otherElem) - if elemEq == False { - return False - } - } - return True -} - -// Get implements the traits.Indexer interface method. -func (l *baseList) Get(index ref.Val) ref.Val { - ind, err := IndexOrError(index) - if err != nil { - return ValOrErr(index, "%v", err) - } - if ind < 0 || ind >= l.size { - return NewErr("index '%d' out of range in list size '%d'", ind, l.Size()) - } - return l.NativeToValue(l.get(ind)) -} - -// IsZeroValue returns true if the list is empty. -func (l *baseList) IsZeroValue() bool { - return l.size == 0 -} - -// Fold calls the FoldEntry method for each (index, value) pair in the list. -func (l *baseList) Fold(f traits.Folder) { - for i := 0; i < l.size; i++ { - if !f.FoldEntry(i, l.get(i)) { - break - } - } -} - -// Iterator implements the traits.Iterable interface method. -func (l *baseList) Iterator() traits.Iterator { - return newListIterator(l) -} - -// Size implements the traits.Sizer interface method. -func (l *baseList) Size() ref.Val { - return Int(l.size) -} - -// Type implements the ref.Val interface method. -func (l *baseList) Type() ref.Type { - return ListType -} - -// Value implements the ref.Val interface method. -func (l *baseList) Value() any { - return l.value -} - -// String converts the list to a human readable string form. -func (l *baseList) String() string { - var sb strings.Builder - sb.WriteString("[") - for i := 0; i < l.size; i++ { - sb.WriteString(fmt.Sprintf("%v", l.get(i))) - if i != l.size-1 { - sb.WriteString(", ") - } - } - sb.WriteString("]") - return sb.String() -} - -func formatList(l traits.Lister, sb *strings.Builder) { - sb.WriteString("[") - n, _ := l.Size().(Int) - for i := 0; i < int(n); i++ { - formatTo(sb, l.Get(Int(i))) - if i != int(n)-1 { - sb.WriteString(", ") - } - } - sb.WriteString("]") -} - -func (l *baseList) format(sb *strings.Builder) { - formatList(l, sb) -} - -// mutableList aggregates values into its internal storage. For use with internal CEL variables only. -type mutableList struct { - *baseList - mutableValues []ref.Val -} - -// Add copies elements from the other list into the internal storage of the mutable list. -// The ref.Val returned by Add is the receiver. -func (l *mutableList) Add(other ref.Val) ref.Val { - switch otherList := other.(type) { - case *mutableList: - l.mutableValues = append(l.mutableValues, otherList.mutableValues...) - l.size += len(otherList.mutableValues) - case traits.Lister: - for i := IntZero; i < otherList.Size().(Int); i++ { - l.size++ - l.mutableValues = append(l.mutableValues, otherList.Get(i)) - } - default: - return MaybeNoSuchOverloadErr(otherList) - } - return l -} - -// ToImmutableList returns an immutable list based on the internal storage of the mutable list. -func (l *mutableList) ToImmutableList() traits.Lister { - // The reference to internal state is guaranteed to be safe as this call is only performed - // when mutations have been completed. - return NewRefValList(l.Adapter, l.mutableValues) -} - -// concatList combines two list implementations together into a view. -// The `Adapter` enables native type to CEL type conversions. -type concatList struct { - Adapter - value any - prevList traits.Lister - nextList traits.Lister -} - -// Add implements the traits.Adder interface method. -func (l *concatList) Add(other ref.Val) ref.Val { - otherList, ok := other.(traits.Lister) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - if l.Size() == IntZero { - return other - } - if otherList.Size() == IntZero { - return l - } - return &concatList{ - Adapter: l.Adapter, - prevList: l, - nextList: otherList} -} - -// Contains implements the traits.Container interface method. -func (l *concatList) Contains(elem ref.Val) ref.Val { - // The concat list relies on the IsErrorOrUnknown checks against the input element to be - // performed by the `prevList` and/or `nextList`. - prev := l.prevList.Contains(elem) - // Short-circuit the return if the elem was found in the prev list. - if prev == True { - return prev - } - // Return if the elem was found in the next list. - next := l.nextList.Contains(elem) - if next == True { - return next - } - // Handle the case where an error or unknown was encountered before checking next. - if IsUnknownOrError(prev) { - return prev - } - // Otherwise, rely on the next value as the representative result. - return next -} - -// ConvertToNative implements the ref.Val interface method. -func (l *concatList) ConvertToNative(typeDesc reflect.Type) (any, error) { - combined := NewDynamicList(l.Adapter, l.Value().([]any)) - return combined.ConvertToNative(typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (l *concatList) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case ListType: - return l - case TypeType: - return ListType - } - return NewErr("type conversion error from '%s' to '%s'", ListType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (l *concatList) Equal(other ref.Val) ref.Val { - otherList, ok := other.(traits.Lister) - if !ok { - return False - } - if l.Size() != otherList.Size() { - return False - } - var maybeErr ref.Val - for i := IntZero; i < l.Size().(Int); i++ { - thisElem := l.Get(i) - otherElem := otherList.Get(i) - elemEq := Equal(thisElem, otherElem) - if elemEq == False { - return False - } - if maybeErr == nil && IsUnknownOrError(elemEq) { - maybeErr = elemEq - } - } - if maybeErr != nil { - return maybeErr - } - return True -} - -// Get implements the traits.Indexer interface method. -func (l *concatList) Get(index ref.Val) ref.Val { - ind, err := IndexOrError(index) - if err != nil { - return ValOrErr(index, "%v", err) - } - i := Int(ind) - if i < l.prevList.Size().(Int) { - return l.prevList.Get(i) - } - offset := i - l.prevList.Size().(Int) - return l.nextList.Get(offset) -} - -// IsZeroValue returns true if the list is empty. -func (l *concatList) IsZeroValue() bool { - return l.Size().(Int) == 0 -} - -// Fold calls the FoldEntry method for each (index, value) pair in the list. -func (l *concatList) Fold(f traits.Folder) { - for i := Int(0); i < l.Size().(Int); i++ { - if !f.FoldEntry(i, l.Get(i)) { - break - } - } -} - -// Iterator implements the traits.Iterable interface method. -func (l *concatList) Iterator() traits.Iterator { - return newListIterator(l) -} - -// Size implements the traits.Sizer interface method. -func (l *concatList) Size() ref.Val { - return l.prevList.Size().(Int).Add(l.nextList.Size()) -} - -// String converts the concatenated list to a human-readable string. -func (l *concatList) String() string { - var sb strings.Builder - sb.WriteString("[") - for i := Int(0); i < l.Size().(Int); i++ { - sb.WriteString(fmt.Sprintf("%v", l.Get(i))) - if i != l.Size().(Int)-1 { - sb.WriteString(", ") - } - } - sb.WriteString("]") - return sb.String() -} - -// Type implements the ref.Val interface method. -func (l *concatList) Type() ref.Type { - return ListType -} - -// Value implements the ref.Val interface method. -func (l *concatList) Value() any { - if l.value == nil { - merged := make([]any, l.Size().(Int)) - prevLen := l.prevList.Size().(Int) - for i := Int(0); i < prevLen; i++ { - merged[i] = l.prevList.Get(i).Value() - } - nextLen := l.nextList.Size().(Int) - for j := Int(0); j < nextLen; j++ { - merged[prevLen+j] = l.nextList.Get(j).Value() - } - l.value = merged - } - return l.value -} - -func newListIterator(listValue traits.Lister) traits.Iterator { - return &listIterator{ - listValue: listValue, - len: listValue.Size().(Int), - } -} - -type listIterator struct { - *baseIterator - listValue traits.Lister - cursor Int - len Int -} - -// HasNext implements the traits.Iterator interface method. -func (it *listIterator) HasNext() ref.Val { - return Bool(it.cursor < it.len) -} - -// Next implements the traits.Iterator interface method. -func (it *listIterator) Next() ref.Val { - if it.HasNext() == True { - index := it.cursor - it.cursor++ - return it.listValue.Get(index) - } - return nil -} - -// IndexOrError converts an input index value into either a lossless integer index or an error. -func IndexOrError(index ref.Val) (int, error) { - switch iv := index.(type) { - case Int: - return int(iv), nil - case Double: - if ik, ok := doubleToInt64Lossless(float64(iv)); ok { - return int(ik), nil - } - return -1, fmt.Errorf("unsupported index value %v in list", index) - case Uint: - if ik, ok := uint64ToInt64Lossless(uint64(iv)); ok { - return int(ik), nil - } - return -1, fmt.Errorf("unsupported index value %v in list", index) - default: - return -1, fmt.Errorf("unsupported index type '%s' in list", index.Type()) - } -} - -// ToFoldableList will create a Foldable version of a list suitable for key-value pair iteration. -// -// For values which are already Foldable, this call is a no-op. For all other values, the fold is -// driven via the Size() and Get() calls which means that the folding will function, but take a -// performance hit. -func ToFoldableList(l traits.Lister) traits.Foldable { - if f, ok := l.(traits.Foldable); ok { - return f - } - return interopFoldableList{Lister: l} -} - -type interopFoldableList struct { - traits.Lister -} - -// Fold implements the traits.Foldable interface method and performs an iteration over the -// range of elements of the list. -func (l interopFoldableList) Fold(f traits.Folder) { - sz := l.Size().(Int) - for i := Int(0); i < sz; i++ { - if !f.FoldEntry(i, l.Get(i)) { - break - } - } -} diff --git a/vendor/github.com/google/cel-go/common/types/map.go b/vendor/github.com/google/cel-go/common/types/map.go deleted file mode 100644 index b33096197..000000000 --- a/vendor/github.com/google/cel-go/common/types/map.go +++ /dev/null @@ -1,1038 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "sort" - "strings" - - "github.com/stoewer/go-strcase" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "github.com/google/cel-go/common/types/pb" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// NewDynamicMap returns a traits.Mapper value with dynamic key, value pairs. -func NewDynamicMap(adapter Adapter, value any) traits.Mapper { - refValue := reflect.ValueOf(value) - return &baseMap{ - Adapter: adapter, - mapAccessor: newReflectMapAccessor(adapter, refValue), - value: value, - size: refValue.Len(), - } -} - -// NewJSONStruct creates a traits.Mapper implementation backed by a JSON struct that has been -// encoded in protocol buffer form. -// -// The `adapter` argument provides type adaptation capabilities from proto to CEL. -func NewJSONStruct(adapter Adapter, value *structpb.Struct) traits.Mapper { - fields := value.GetFields() - return &baseMap{ - Adapter: adapter, - mapAccessor: newJSONStructAccessor(adapter, fields), - value: value, - size: len(fields), - } -} - -// NewRefValMap returns a specialized traits.Mapper with CEL valued keys and values. -func NewRefValMap(adapter Adapter, value map[ref.Val]ref.Val) traits.Mapper { - return &baseMap{ - Adapter: adapter, - mapAccessor: newRefValMapAccessor(value), - value: value, - size: len(value), - } -} - -// NewStringInterfaceMap returns a specialized traits.Mapper with string keys and interface values. -func NewStringInterfaceMap(adapter Adapter, value map[string]any) traits.Mapper { - return &baseMap{ - Adapter: adapter, - mapAccessor: newStringIfaceMapAccessor(adapter, value), - value: value, - size: len(value), - } -} - -// NewStringStringMap returns a specialized traits.Mapper with string keys and values. -func NewStringStringMap(adapter Adapter, value map[string]string) traits.Mapper { - return &baseMap{ - Adapter: adapter, - mapAccessor: newStringMapAccessor(value), - value: value, - size: len(value), - } -} - -// NewProtoMap returns a specialized traits.Mapper for handling protobuf map values. -func NewProtoMap(adapter Adapter, value *pb.Map) traits.Mapper { - return &protoMap{ - Adapter: adapter, - value: value, - } -} - -// NewMutableMap constructs a mutable map from an adapter and a set of map values. -func NewMutableMap(adapter Adapter, mutableValues map[ref.Val]ref.Val) traits.MutableMapper { - mutableCopy := make(map[ref.Val]ref.Val, len(mutableValues)) - for k, v := range mutableValues { - mutableCopy[k] = v - } - m := &mutableMap{ - baseMap: &baseMap{ - Adapter: adapter, - mapAccessor: newRefValMapAccessor(mutableCopy), - value: mutableCopy, - size: len(mutableCopy), - }, - mutableValues: mutableCopy, - } - return m -} - -// mapAccessor is a private interface for finding values within a map and iterating over the keys. -// This interface implements portions of the API surface area required by the traits.Mapper -// interface. -type mapAccessor interface { - // Find returns a value, if one exists, for the input key. - // - // If the key is not found the function returns (nil, false). - Find(ref.Val) (ref.Val, bool) - - // Iterator returns an Iterator over the map key set. - Iterator() traits.Iterator - - // Fold calls the FoldEntry method for each (key, value) pair in the map. - Fold(traits.Folder) -} - -// baseMap is a reflection based map implementation designed to handle a variety of map-like types. -// -// Since CEL is side-effect free, the base map represents an immutable object. -type baseMap struct { - // TypeAdapter used to convert keys and values accessed within the map. - Adapter - - // mapAccessor interface implementation used to find and iterate over map keys. - mapAccessor - - // value is the native Go value upon which the map type operators. - value any - - // size is the number of entries in the map. - size int -} - -// Contains implements the traits.Container interface method. -func (m *baseMap) Contains(index ref.Val) ref.Val { - _, found := m.Find(index) - return Bool(found) -} - -// ConvertToNative implements the ref.Val interface method. -func (m *baseMap) ConvertToNative(typeDesc reflect.Type) (any, error) { - // If the map is already assignable to the desired type return it, e.g. interfaces and - // maps with the same key value types. - if reflect.TypeOf(m.value).AssignableTo(typeDesc) { - return m.value, nil - } - if reflect.TypeOf(m).AssignableTo(typeDesc) { - return m, nil - } - switch typeDesc { - case anyValueType: - json, err := m.ConvertToNative(jsonStructType) - if err != nil { - return nil, err - } - return anypb.New(json.(proto.Message)) - case jsonValueType, jsonStructType: - jsonEntries, err := - m.ConvertToNative(reflect.TypeOf(map[string]*structpb.Value{})) - if err != nil { - return nil, err - } - jsonMap := &structpb.Struct{Fields: jsonEntries.(map[string]*structpb.Value)} - if typeDesc == jsonStructType { - return jsonMap, nil - } - return structpb.NewStructValue(jsonMap), nil - } - - // Unwrap pointers, but track their use. - isPtr := false - if typeDesc.Kind() == reflect.Ptr { - tk := typeDesc - typeDesc = typeDesc.Elem() - if typeDesc.Kind() == reflect.Ptr { - return nil, fmt.Errorf("unsupported type conversion to '%v'", tk) - } - isPtr = true - } - switch typeDesc.Kind() { - // Map conversion. - case reflect.Map: - otherKey := typeDesc.Key() - otherElem := typeDesc.Elem() - nativeMap := reflect.MakeMapWithSize(typeDesc, m.size) - it := m.Iterator() - for it.HasNext() == True { - key := it.Next() - refKeyValue, err := key.ConvertToNative(otherKey) - if err != nil { - return nil, err - } - refElemValue, err := m.Get(key).ConvertToNative(otherElem) - if err != nil { - return nil, err - } - nativeMap.SetMapIndex(reflect.ValueOf(refKeyValue), reflect.ValueOf(refElemValue)) - } - return nativeMap.Interface(), nil - case reflect.Struct: - nativeStructPtr := reflect.New(typeDesc) - nativeStruct := nativeStructPtr.Elem() - it := m.Iterator() - for it.HasNext() == True { - key := it.Next() - // Ensure the field name being referenced is exported. - // Only exported (public) field names can be set by reflection, where the name - // must be at least one character in length and start with an upper-case letter. - fieldName := key.ConvertToType(StringType) - if IsError(fieldName) { - return nil, fieldName.(*Err) - } - name := string(fieldName.(String)) - name = strcase.UpperCamelCase(name) - fieldRef := nativeStruct.FieldByName(name) - if !fieldRef.IsValid() { - return nil, fmt.Errorf("type conversion error, no such field '%s' in type '%v'", name, typeDesc) - } - fieldValue, err := m.Get(key).ConvertToNative(fieldRef.Type()) - if err != nil { - return nil, err - } - fieldRef.Set(reflect.ValueOf(fieldValue)) - } - if isPtr { - return nativeStructPtr.Interface(), nil - } - return nativeStruct.Interface(), nil - } - return nil, fmt.Errorf("type conversion error from map to '%v'", typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (m *baseMap) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case MapType: - return m - case TypeType: - return MapType - } - return NewErr("type conversion error from '%s' to '%s'", MapType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (m *baseMap) Equal(other ref.Val) ref.Val { - otherMap, ok := other.(traits.Mapper) - if !ok { - return False - } - if m.Size() != otherMap.Size() { - return False - } - it := m.Iterator() - for it.HasNext() == True { - key := it.Next() - thisVal, _ := m.Find(key) - otherVal, found := otherMap.Find(key) - if !found { - return False - } - valEq := Equal(thisVal, otherVal) - if valEq == False { - return False - } - } - return True -} - -// Get implements the traits.Indexer interface method. -func (m *baseMap) Get(key ref.Val) ref.Val { - v, found := m.Find(key) - if !found { - return ValOrErr(v, "no such key: %v", key) - } - return v -} - -// IsZeroValue returns true if the map is empty. -func (m *baseMap) IsZeroValue() bool { - return m.size == 0 -} - -// Size implements the traits.Sizer interface method. -func (m *baseMap) Size() ref.Val { - return Int(m.size) -} - -// String converts the map into a human-readable string. -func (m *baseMap) String() string { - var sb strings.Builder - sb.WriteString("{") - it := m.Iterator() - i := 0 - for it.HasNext() == True { - k := it.Next() - v, _ := m.Find(k) - sb.WriteString(fmt.Sprintf("%v: %v", k, v)) - if i != m.size-1 { - sb.WriteString(", ") - } - i++ - } - sb.WriteString("}") - return sb.String() -} - -type baseMapEntry struct { - key string - val string -} - -func formatMap(m traits.Mapper, sb *strings.Builder) { - it := m.Iterator() - var ents []baseMapEntry - if s, ok := m.Size().(Int); ok { - ents = make([]baseMapEntry, 0, int(s)) - } - for it.HasNext() == True { - k := it.Next() - v, _ := m.Find(k) - ents = append(ents, baseMapEntry{Format(k), Format(v)}) - } - sort.SliceStable(ents, func(i, j int) bool { - return ents[i].key < ents[j].key - }) - sb.WriteString("{") - for i, ent := range ents { - if i > 0 { - sb.WriteString(", ") - } - sb.WriteString(ent.key) - sb.WriteString(": ") - sb.WriteString(ent.val) - } - sb.WriteString("}") -} - -func (m *baseMap) format(sb *strings.Builder) { - formatMap(m, sb) -} - -// Type implements the ref.Val interface method. -func (m *baseMap) Type() ref.Type { - return MapType -} - -// Value implements the ref.Val interface method. -func (m *baseMap) Value() any { - return m.value -} - -// mutableMap holds onto a set of mutable values which are used for intermediate computations. -type mutableMap struct { - *baseMap - mutableValues map[ref.Val]ref.Val -} - -// Insert implements the traits.MutableMapper interface method, returning true if the key insertion -// succeeds. -func (m *mutableMap) Insert(k, v ref.Val) ref.Val { - if _, found := m.Find(k); found { - return NewErr("insert failed: key %v already exists", k) - } - m.mutableValues[k] = v - return m -} - -// ToImmutableMap implements the traits.MutableMapper interface method, converting a mutable map -// an immutable map implementation. -func (m *mutableMap) ToImmutableMap() traits.Mapper { - return NewRefValMap(m.Adapter, m.mutableValues) -} - -func newJSONStructAccessor(adapter Adapter, st map[string]*structpb.Value) mapAccessor { - return &jsonStructAccessor{ - Adapter: adapter, - st: st, - } -} - -type jsonStructAccessor struct { - Adapter - st map[string]*structpb.Value -} - -// Find searches the json struct field map for the input key value and returns (value, true) if -// found. -// -// If the key is not found the function returns (nil, false). -func (a *jsonStructAccessor) Find(key ref.Val) (ref.Val, bool) { - strKey, ok := key.(String) - if !ok { - return nil, false - } - keyVal, found := a.st[string(strKey)] - if !found { - return nil, false - } - return a.NativeToValue(keyVal), true -} - -// Iterator creates a new traits.Iterator from the set of JSON struct field names. -func (a *jsonStructAccessor) Iterator() traits.Iterator { - // Copy the keys to make their order stable. - mapKeys := make([]string, len(a.st)) - i := 0 - for k := range a.st { - mapKeys[i] = k - i++ - } - return &stringKeyIterator{ - mapKeys: mapKeys, - len: len(mapKeys), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (a *jsonStructAccessor) Fold(f traits.Folder) { - for k, v := range a.st { - if !f.FoldEntry(k, v) { - break - } - } -} - -func newReflectMapAccessor(adapter Adapter, value reflect.Value) mapAccessor { - keyType := value.Type().Key() - return &reflectMapAccessor{ - Adapter: adapter, - refValue: value, - keyType: keyType, - } -} - -type reflectMapAccessor struct { - Adapter - refValue reflect.Value - keyType reflect.Type -} - -// Find converts the input key to a native Golang type and then uses reflection to find the key, -// returning (value, true) if present. -// -// If the key is not found the function returns (nil, false). -func (m *reflectMapAccessor) Find(key ref.Val) (ref.Val, bool) { - if m.refValue.Len() == 0 { - return nil, false - } - if keyVal, found := m.findInternal(key); found { - return keyVal, true - } - switch k := key.(type) { - // Double is not a valid proto map key type, so check for the key as an int or uint. - case Double: - if ik, ok := doubleToInt64Lossless(float64(k)); ok { - if keyVal, found := m.findInternal(Int(ik)); found { - return keyVal, true - } - } - if uk, ok := doubleToUint64Lossless(float64(k)); ok { - return m.findInternal(Uint(uk)) - } - // map keys of type double are not supported. - case Int: - if uk, ok := int64ToUint64Lossless(int64(k)); ok { - return m.findInternal(Uint(uk)) - } - case Uint: - if ik, ok := uint64ToInt64Lossless(uint64(k)); ok { - return m.findInternal(Int(ik)) - } - } - return nil, false -} - -// findInternal attempts to convert the incoming key to the map's internal native type -// and then returns the value, if found. -func (m *reflectMapAccessor) findInternal(key ref.Val) (ref.Val, bool) { - k, err := key.ConvertToNative(m.keyType) - if err != nil { - return nil, false - } - refKey := reflect.ValueOf(k) - val := m.refValue.MapIndex(refKey) - if val.IsValid() { - return m.NativeToValue(val.Interface()), true - } - return nil, false -} - -// Iterator creates a Golang reflection based traits.Iterator. -func (m *reflectMapAccessor) Iterator() traits.Iterator { - return &mapIterator{ - Adapter: m.Adapter, - mapKeys: m.refValue.MapRange(), - len: m.refValue.Len(), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (m *reflectMapAccessor) Fold(f traits.Folder) { - mapRange := m.refValue.MapRange() - for mapRange.Next() { - if !f.FoldEntry(mapRange.Key().Interface(), mapRange.Value().Interface()) { - break - } - } -} - -func newRefValMapAccessor(mapVal map[ref.Val]ref.Val) mapAccessor { - return &refValMapAccessor{mapVal: mapVal} -} - -type refValMapAccessor struct { - mapVal map[ref.Val]ref.Val -} - -// Find uses native map accesses to find the key, returning (value, true) if present. -// -// If the key is not found the function returns (nil, false). -func (a *refValMapAccessor) Find(key ref.Val) (ref.Val, bool) { - if len(a.mapVal) == 0 { - return nil, false - } - if keyVal, found := a.mapVal[key]; found { - return keyVal, true - } - switch k := key.(type) { - case Double: - if ik, ok := doubleToInt64Lossless(float64(k)); ok { - if keyVal, found := a.mapVal[Int(ik)]; found { - return keyVal, found - } - } - if uk, ok := doubleToUint64Lossless(float64(k)); ok { - keyVal, found := a.mapVal[Uint(uk)] - return keyVal, found - } - // map keys of type double are not supported. - case Int: - if uk, ok := int64ToUint64Lossless(int64(k)); ok { - keyVal, found := a.mapVal[Uint(uk)] - return keyVal, found - } - case Uint: - if ik, ok := uint64ToInt64Lossless(uint64(k)); ok { - keyVal, found := a.mapVal[Int(ik)] - return keyVal, found - } - } - return nil, false -} - -// Iterator produces a new traits.Iterator which iterates over the map keys via Golang reflection. -func (a *refValMapAccessor) Iterator() traits.Iterator { - return &mapIterator{ - Adapter: DefaultTypeAdapter, - mapKeys: reflect.ValueOf(a.mapVal).MapRange(), - len: len(a.mapVal), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (a *refValMapAccessor) Fold(f traits.Folder) { - for k, v := range a.mapVal { - if !f.FoldEntry(k, v) { - break - } - } -} - -func newStringMapAccessor(strMap map[string]string) mapAccessor { - return &stringMapAccessor{mapVal: strMap} -} - -type stringMapAccessor struct { - mapVal map[string]string -} - -// Find uses native map accesses to find the key, returning (value, true) if present. -// -// If the key is not found the function returns (nil, false). -func (a *stringMapAccessor) Find(key ref.Val) (ref.Val, bool) { - strKey, ok := key.(String) - if !ok { - return nil, false - } - keyVal, found := a.mapVal[string(strKey)] - if !found { - return nil, false - } - return String(keyVal), true -} - -// Iterator creates a new traits.Iterator from the string key set of the map. -func (a *stringMapAccessor) Iterator() traits.Iterator { - // Copy the keys to make their order stable. - mapKeys := make([]string, len(a.mapVal)) - i := 0 - for k := range a.mapVal { - mapKeys[i] = k - i++ - } - return &stringKeyIterator{ - mapKeys: mapKeys, - len: len(mapKeys), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (a *stringMapAccessor) Fold(f traits.Folder) { - for k, v := range a.mapVal { - if !f.FoldEntry(k, v) { - break - } - } -} - -func newStringIfaceMapAccessor(adapter Adapter, mapVal map[string]any) mapAccessor { - return &stringIfaceMapAccessor{ - Adapter: adapter, - mapVal: mapVal, - } -} - -type stringIfaceMapAccessor struct { - Adapter - mapVal map[string]any -} - -// Find uses native map accesses to find the key, returning (value, true) if present. -// -// If the key is not found the function returns (nil, false). -func (a *stringIfaceMapAccessor) Find(key ref.Val) (ref.Val, bool) { - strKey, ok := key.(String) - if !ok { - return nil, false - } - keyVal, found := a.mapVal[string(strKey)] - if !found { - return nil, false - } - return a.NativeToValue(keyVal), true -} - -// Iterator creates a new traits.Iterator from the string key set of the map. -func (a *stringIfaceMapAccessor) Iterator() traits.Iterator { - // Copy the keys to make their order stable. - mapKeys := make([]string, len(a.mapVal)) - i := 0 - for k := range a.mapVal { - mapKeys[i] = k - i++ - } - return &stringKeyIterator{ - mapKeys: mapKeys, - len: len(mapKeys), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (a *stringIfaceMapAccessor) Fold(f traits.Folder) { - for k, v := range a.mapVal { - if !f.FoldEntry(k, v) { - break - } - } -} - -// protoMap is a specialized, separate implementation of the traits.Mapper interfaces tailored to -// accessing protoreflect.Map values. -type protoMap struct { - Adapter - value *pb.Map -} - -// Contains returns whether the map contains the given key. -func (m *protoMap) Contains(key ref.Val) ref.Val { - _, found := m.Find(key) - return Bool(found) -} - -// ConvertToNative implements the ref.Val interface method. -// -// Note, assignment to Golang struct types is not yet supported. -func (m *protoMap) ConvertToNative(typeDesc reflect.Type) (any, error) { - // If the map is already assignable to the desired type return it, e.g. interfaces and - // maps with the same key value types. - switch typeDesc { - case anyValueType: - json, err := m.ConvertToNative(jsonStructType) - if err != nil { - return nil, err - } - return anypb.New(json.(proto.Message)) - case jsonValueType, jsonStructType: - jsonEntries, err := - m.ConvertToNative(reflect.TypeOf(map[string]*structpb.Value{})) - if err != nil { - return nil, err - } - jsonMap := &structpb.Struct{ - Fields: jsonEntries.(map[string]*structpb.Value)} - if typeDesc == jsonStructType { - return jsonMap, nil - } - return structpb.NewStructValue(jsonMap), nil - } - switch typeDesc.Kind() { - case reflect.Struct, reflect.Ptr: - if reflect.TypeOf(m.value).AssignableTo(typeDesc) { - return m.value, nil - } - if reflect.TypeOf(m).AssignableTo(typeDesc) { - return m, nil - } - } - if typeDesc.Kind() != reflect.Map { - return nil, fmt.Errorf("unsupported type conversion: %v to map", typeDesc) - } - - keyType := m.value.KeyType.ReflectType() - valType := m.value.ValueType.ReflectType() - otherKeyType := typeDesc.Key() - otherValType := typeDesc.Elem() - mapVal := reflect.MakeMapWithSize(typeDesc, m.value.Len()) - var err error - m.value.Range(func(key protoreflect.MapKey, val protoreflect.Value) bool { - ntvKey := key.Interface() - ntvVal := val.Interface() - switch pv := ntvVal.(type) { - case protoreflect.Message: - ntvVal = pv.Interface() - } - if keyType == otherKeyType && valType == otherValType { - mapVal.SetMapIndex(reflect.ValueOf(ntvKey), reflect.ValueOf(ntvVal)) - return true - } - celKey := m.NativeToValue(ntvKey) - celVal := m.NativeToValue(ntvVal) - ntvKey, err = celKey.ConvertToNative(otherKeyType) - if err != nil { - // early terminate the range loop. - return false - } - ntvVal, err = celVal.ConvertToNative(otherValType) - if err != nil { - // early terminate the range loop. - return false - } - mapVal.SetMapIndex(reflect.ValueOf(ntvKey), reflect.ValueOf(ntvVal)) - return true - }) - if err != nil { - return nil, err - } - return mapVal.Interface(), nil -} - -// ConvertToType implements the ref.Val interface method. -func (m *protoMap) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case MapType: - return m - case TypeType: - return MapType - } - return NewErr("type conversion error from '%s' to '%s'", MapType, typeVal) -} - -// Equal implements the ref.Val interface method. -func (m *protoMap) Equal(other ref.Val) ref.Val { - otherMap, ok := other.(traits.Mapper) - if !ok { - return False - } - if m.value.Map.Len() != int(otherMap.Size().(Int)) { - return False - } - var retVal ref.Val = True - m.value.Range(func(key protoreflect.MapKey, val protoreflect.Value) bool { - keyVal := m.NativeToValue(key.Interface()) - valVal := m.NativeToValue(val) - otherVal, found := otherMap.Find(keyVal) - if !found { - retVal = False - return false - } - valEq := Equal(valVal, otherVal) - if valEq != True { - retVal = valEq - return false - } - return true - }) - return retVal -} - -// Find returns whether the protoreflect.Map contains the input key. -// -// If the key is not found the function returns (nil, false). -func (m *protoMap) Find(key ref.Val) (ref.Val, bool) { - if keyVal, found := m.findInternal(key); found { - return keyVal, true - } - switch k := key.(type) { - // Double is not a valid proto map key type, so check for the key as an int or uint. - case Double: - if ik, ok := doubleToInt64Lossless(float64(k)); ok { - if keyVal, found := m.findInternal(Int(ik)); found { - return keyVal, true - } - } - if uk, ok := doubleToUint64Lossless(float64(k)); ok { - return m.findInternal(Uint(uk)) - } - // map keys of type double are not supported. - case Int: - if uk, ok := int64ToUint64Lossless(int64(k)); ok { - return m.findInternal(Uint(uk)) - } - case Uint: - if ik, ok := uint64ToInt64Lossless(uint64(k)); ok { - return m.findInternal(Int(ik)) - } - } - return nil, false -} - -// findInternal attempts to convert the incoming key to the map's internal native type -// and then returns the value, if found. -func (m *protoMap) findInternal(key ref.Val) (ref.Val, bool) { - // Convert the input key to the expected protobuf key type. - ntvKey, err := key.ConvertToNative(m.value.KeyType.ReflectType()) - if err != nil { - return nil, false - } - // Use protoreflection to get the key value. - val := m.value.Get(protoreflect.ValueOf(ntvKey).MapKey()) - if !val.IsValid() { - return nil, false - } - // Perform nominal type unwrapping from the input value. - switch v := val.Interface().(type) { - case protoreflect.List, protoreflect.Map: - // Maps do not support list or map values - return nil, false - default: - return m.NativeToValue(v), true - } -} - -// Get implements the traits.Indexer interface method. -func (m *protoMap) Get(key ref.Val) ref.Val { - v, found := m.Find(key) - if !found { - return ValOrErr(v, "no such key: %v", key) - } - return v -} - -// IsZeroValue returns true if the map is empty. -func (m *protoMap) IsZeroValue() bool { - return m.value.Len() == 0 -} - -// Iterator implements the traits.Iterable interface method. -func (m *protoMap) Iterator() traits.Iterator { - // Copy the keys to make their order stable. - mapKeys := make([]protoreflect.MapKey, 0, m.value.Len()) - m.value.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - mapKeys = append(mapKeys, k) - return true - }) - return &protoMapIterator{ - Adapter: m.Adapter, - mapKeys: mapKeys, - len: m.value.Len(), - } -} - -// Fold calls the FoldEntry method for each (key, value) pair in the map. -func (m *protoMap) Fold(f traits.Folder) { - m.value.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - return f.FoldEntry(k.Interface(), v.Interface()) - }) -} - -// Size returns the number of entries in the protoreflect.Map. -func (m *protoMap) Size() ref.Val { - return Int(m.value.Len()) -} - -// Type implements the ref.Val interface method. -func (m *protoMap) Type() ref.Type { - return MapType -} - -// Value implements the ref.Val interface method. -func (m *protoMap) Value() any { - return m.value -} - -type mapIterator struct { - *baseIterator - Adapter - mapKeys *reflect.MapIter - cursor int - len int -} - -// HasNext implements the traits.Iterator interface method. -func (it *mapIterator) HasNext() ref.Val { - return Bool(it.cursor < it.len) -} - -// Next implements the traits.Iterator interface method. -func (it *mapIterator) Next() ref.Val { - if it.HasNext() == True && it.mapKeys.Next() { - it.cursor++ - refKey := it.mapKeys.Key() - return it.NativeToValue(refKey.Interface()) - } - return nil -} - -type protoMapIterator struct { - *baseIterator - Adapter - mapKeys []protoreflect.MapKey - cursor int - len int -} - -// HasNext implements the traits.Iterator interface method. -func (it *protoMapIterator) HasNext() ref.Val { - return Bool(it.cursor < it.len) -} - -// Next implements the traits.Iterator interface method. -func (it *protoMapIterator) Next() ref.Val { - if it.HasNext() == True { - index := it.cursor - it.cursor++ - refKey := it.mapKeys[index] - return it.NativeToValue(refKey.Interface()) - } - return nil -} - -type stringKeyIterator struct { - *baseIterator - mapKeys []string - cursor int - len int -} - -// HasNext implements the traits.Iterator interface method. -func (it *stringKeyIterator) HasNext() ref.Val { - return Bool(it.cursor < it.len) -} - -// Next implements the traits.Iterator interface method. -func (it *stringKeyIterator) Next() ref.Val { - if it.HasNext() == True { - index := it.cursor - it.cursor++ - return String(it.mapKeys[index]) - } - return nil -} - -// ToFoldableMap will create a Foldable version of a map suitable for key-value pair iteration. -// -// For values which are already Foldable, this call is a no-op. For all other values, the fold -// is driven via the Iterator HasNext() and Next() calls as well as the map's Get() method -// which means that the folding will function, but take a performance hit. -func ToFoldableMap(m traits.Mapper) traits.Foldable { - if f, ok := m.(traits.Foldable); ok { - return f - } - return interopFoldableMap{Mapper: m} -} - -type interopFoldableMap struct { - traits.Mapper -} - -func (m interopFoldableMap) Fold(f traits.Folder) { - it := m.Iterator() - for it.HasNext() == True { - k := it.Next() - if !f.FoldEntry(k, m.Get(k)) { - break - } - } -} - -// InsertMapKeyValue inserts a key, value pair into the target map if the target map does not -// already contain the given key. -// -// If the map is mutable, it is modified in-place per the MutableMapper contract. -// If the map is not mutable, a copy containing the new key, value pair is made. -func InsertMapKeyValue(m traits.Mapper, k, v ref.Val) ref.Val { - if mutable, ok := m.(traits.MutableMapper); ok { - return mutable.Insert(k, v) - } - - // Otherwise perform the slow version of the insertion which makes a copy of the incoming map. - if _, found := m.Find(k); !found { - size := m.Size().(Int) - copy := make(map[ref.Val]ref.Val, size+1) - copy[k] = v - it := m.Iterator() - for it.HasNext() == True { - nextK := it.Next() - nextV := m.Get(nextK) - copy[nextK] = nextV - } - return DefaultTypeAdapter.NativeToValue(copy) - } - return NewErr("insert failed: key %v already exists", k) -} diff --git a/vendor/github.com/google/cel-go/common/types/null.go b/vendor/github.com/google/cel-go/common/types/null.go deleted file mode 100644 index 2c0297fe6..000000000 --- a/vendor/github.com/google/cel-go/common/types/null.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strings" - - "google.golang.org/protobuf/proto" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -// Null type implementation. -type Null structpb.NullValue - -var ( - // NullValue singleton. - NullValue = Null(structpb.NullValue_NULL_VALUE) - - // golang reflect type for Null values. - nullReflectType = reflect.TypeOf(NullValue) - - protoIfaceType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// ConvertToNative implements ref.Val.ConvertToNative. -func (n Null) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Int32: - switch typeDesc { - case jsonNullType: - return structpb.NullValue_NULL_VALUE, nil - case nullReflectType: - return n, nil - } - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Convert to a JSON-null before packing to an Any field since the enum value for JSON - // null cannot be packed directly. - pb, err := n.ConvertToNative(jsonValueType) - if err != nil { - return nil, err - } - return anypb.New(pb.(proto.Message)) - case jsonValueType: - return structpb.NewNullValue(), nil - case boolWrapperType, byteWrapperType, doubleWrapperType, floatWrapperType, - int32WrapperType, int64WrapperType, stringWrapperType, uint32WrapperType, - uint64WrapperType, durationValueType, timestampValueType, protoIfaceType: - return nil, nil - case jsonListValueType, jsonStructType: - // skip handling - default: - if typeDesc.Implements(protoIfaceType) { - return nil, nil - } - } - case reflect.Interface: - nv := n.Value() - if reflect.TypeOf(nv).Implements(typeDesc) { - return nv, nil - } - if reflect.TypeOf(n).Implements(typeDesc) { - return n, nil - } - } - // If the type conversion isn't supported return an error. - return nil, fmt.Errorf("type conversion error from '%v' to '%v'", NullType, typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (n Null) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case StringType: - return String("null") - case NullType: - return n - case TypeType: - return NullType - } - return NewErr("type conversion error from '%s' to '%s'", NullType, typeVal) -} - -// Equal implements ref.Val.Equal. -func (n Null) Equal(other ref.Val) ref.Val { - return Bool(NullType == other.Type()) -} - -// IsZeroValue returns true as null always represents an absent value. -func (n Null) IsZeroValue() bool { - return true -} - -// Type implements ref.Val.Type. -func (n Null) Type() ref.Type { - return NullType -} - -// Value implements ref.Val.Value. -func (n Null) Value() any { - return structpb.NullValue_NULL_VALUE -} - -func (n Null) format(sb *strings.Builder) { - sb.WriteString("null") -} diff --git a/vendor/github.com/google/cel-go/common/types/object.go b/vendor/github.com/google/cel-go/common/types/object.go deleted file mode 100644 index 776f6954a..000000000 --- a/vendor/github.com/google/cel-go/common/types/object.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "sort" - "strings" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "github.com/google/cel-go/common/types/pb" - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -type protoObj struct { - Adapter - value proto.Message - typeDesc *pb.TypeDescription - typeValue ref.Val -} - -// NewObject returns an object based on a proto.Message value which handles -// conversion between protobuf type values and expression type values. -// Objects support indexing and iteration. -// -// Note: the type value is pulled from the list of registered types within the -// type provider. If the proto type is not registered within the type provider, -// then this will result in an error within the type adapter / provider. -func NewObject(adapter Adapter, - typeDesc *pb.TypeDescription, - typeValue ref.Val, - value proto.Message) ref.Val { - return &protoObj{ - Adapter: adapter, - value: value, - typeDesc: typeDesc, - typeValue: typeValue} -} - -func (o *protoObj) ConvertToNative(typeDesc reflect.Type) (any, error) { - srcPB := o.value - if reflect.TypeOf(srcPB).AssignableTo(typeDesc) { - return srcPB, nil - } - if reflect.TypeOf(o).AssignableTo(typeDesc) { - return o, nil - } - switch typeDesc { - case anyValueType: - _, isAny := srcPB.(*anypb.Any) - if isAny { - return srcPB, nil - } - return anypb.New(srcPB) - case jsonValueType: - // Marshal the proto to JSON first, and then rehydrate as protobuf.Value as there is no - // support for direct conversion from proto.Message to protobuf.Value. - bytes, err := protojson.Marshal(srcPB) - if err != nil { - return nil, err - } - json := &structpb.Value{} - err = protojson.Unmarshal(bytes, json) - if err != nil { - return nil, err - } - return json, nil - default: - if typeDesc == o.typeDesc.ReflectType() { - return o.value, nil - } - if typeDesc.Kind() == reflect.Ptr { - val := reflect.New(typeDesc.Elem()).Interface() - dstPB, ok := val.(proto.Message) - if ok { - err := pb.Merge(dstPB, srcPB) - if err != nil { - return nil, fmt.Errorf("type conversion error: %v", err) - } - return dstPB, nil - } - } - } - return nil, fmt.Errorf("type conversion error from '%T' to '%v'", o.value, typeDesc) -} - -func (o *protoObj) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - default: - if o.Type().TypeName() == typeVal.TypeName() { - return o - } - case TypeType: - return o.typeValue - } - return NewErr("type conversion error from '%s' to '%s'", o.typeDesc.Name(), typeVal) -} - -func (o *protoObj) Equal(other ref.Val) ref.Val { - otherPB, ok := other.Value().(proto.Message) - return Bool(ok && pb.Equal(o.value, otherPB)) -} - -// IsSet tests whether a field which is defined is set to a non-default value. -func (o *protoObj) IsSet(field ref.Val) ref.Val { - protoFieldName, ok := field.(String) - if !ok { - return MaybeNoSuchOverloadErr(field) - } - protoFieldStr := string(protoFieldName) - fd, found := o.typeDesc.FieldByName(protoFieldStr) - if !found { - return NewErr("no such field '%s'", field) - } - if fd.IsSet(o.value) { - return True - } - return False -} - -// IsZeroValue returns true if the protobuf object is empty. -func (o *protoObj) IsZeroValue() bool { - return proto.Equal(o.value, o.typeDesc.Zero()) -} - -func (o *protoObj) Get(index ref.Val) ref.Val { - protoFieldName, ok := index.(String) - if !ok { - return MaybeNoSuchOverloadErr(index) - } - protoFieldStr := string(protoFieldName) - fd, found := o.typeDesc.FieldByName(protoFieldStr) - if !found { - return NewErr("no such field '%s'", index) - } - fv, err := fd.GetFrom(o.value) - if err != nil { - return NewErrFromString(err.Error()) - } - return o.NativeToValue(fv) -} - -func (o *protoObj) Type() ref.Type { - return o.typeValue.(ref.Type) -} - -func (o *protoObj) Value() any { - return o.value -} - -type protoObjField struct { - fd protoreflect.FieldDescriptor - v protoreflect.Value -} - -func (o *protoObj) format(sb *strings.Builder) { - var fields []protoreflect.FieldDescriptor - o.value.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - fields = append(fields, fd) - return true - }) - sort.SliceStable(fields, func(i, j int) bool { - return fields[i].Number() < fields[j].Number() - }) - sb.WriteString(o.Type().TypeName()) - sb.WriteString("{") - for i, field := range fields { - if i > 0 { - sb.WriteString(", ") - } - sb.WriteString(fmt.Sprintf("%s: ", field.Name())) - formatTo(sb, o.Get(String(field.Name()))) - } - sb.WriteString("}") -} diff --git a/vendor/github.com/google/cel-go/common/types/optional.go b/vendor/github.com/google/cel-go/common/types/optional.go deleted file mode 100644 index b8685ebf5..000000000 --- a/vendor/github.com/google/cel-go/common/types/optional.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" - "fmt" - "reflect" - "strings" - - "github.com/google/cel-go/common/types/ref" -) - -var ( - // OptionalType indicates the runtime type of an optional value. - OptionalType = NewOpaqueType("optional_type") - - // OptionalNone is a sentinel value which is used to indicate an empty optional value. - OptionalNone = &Optional{} -) - -// OptionalOf returns an optional value which wraps a concrete CEL value. -func OptionalOf(value ref.Val) *Optional { - return &Optional{value: value} -} - -// Optional value which points to a value if non-empty. -type Optional struct { - value ref.Val -} - -// HasValue returns true if the optional has a value. -func (o *Optional) HasValue() bool { - return o.value != nil -} - -// GetValue returns the wrapped value contained in the optional. -func (o *Optional) GetValue() ref.Val { - if !o.HasValue() { - return NewErr("optional.none() dereference") - } - return o.value -} - -// ConvertToNative implements the ref.Val interface method. -func (o *Optional) ConvertToNative(typeDesc reflect.Type) (any, error) { - if !o.HasValue() { - return nil, errors.New("optional.none() dereference") - } - return o.value.ConvertToNative(typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (o *Optional) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case OptionalType: - return o - case TypeType: - return OptionalType - } - return NewErr("type conversion error from '%s' to '%s'", OptionalType, typeVal) -} - -// Equal determines whether the values contained by two optional values are equal. -func (o *Optional) Equal(other ref.Val) ref.Val { - otherOpt, isOpt := other.(*Optional) - if !isOpt { - return False - } - if !o.HasValue() { - return Bool(!otherOpt.HasValue()) - } - if !otherOpt.HasValue() { - return False - } - return o.value.Equal(otherOpt.value) -} - -func (o *Optional) String() string { - if o.HasValue() { - return fmt.Sprintf("optional(%v)", o.GetValue()) - } - return "optional.none()" -} - -func (o *Optional) format(sb *strings.Builder) { - if o.HasValue() { - sb.WriteString(`optional.of(`) - formatTo(sb, o.GetValue()) - sb.WriteString(`)`) - } else { - sb.WriteString("optional.none()") - } -} - -// Type implements the ref.Val interface method. -func (o *Optional) Type() ref.Type { - return OptionalType -} - -// Value returns the underlying 'Value()' of the wrapped value, if present. -func (o *Optional) Value() any { - if o.value == nil { - return nil - } - return o.value.Value() -} diff --git a/vendor/github.com/google/cel-go/common/types/overflow.go b/vendor/github.com/google/cel-go/common/types/overflow.go deleted file mode 100644 index dcb66ef59..000000000 --- a/vendor/github.com/google/cel-go/common/types/overflow.go +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "math" - "time" -) - -var ( - doubleTwoTo64 = math.Ldexp(1.0, 64) -) - -// addInt64Checked performs addition with overflow detection of two int64 values. -// -// If the operation fails the error return value will be non-nil. -func addInt64Checked(x, y int64) (int64, error) { - if (y > 0 && x > math.MaxInt64-y) || (y < 0 && x < math.MinInt64-y) { - return 0, errIntOverflow - } - return x + y, nil -} - -// subtractInt64Checked performs subtraction with overflow detection of two int64 values. -// -// If the operation fails the error return value will be non-nil. -func subtractInt64Checked(x, y int64) (int64, error) { - if (y < 0 && x > math.MaxInt64+y) || (y > 0 && x < math.MinInt64+y) { - return 0, errIntOverflow - } - return x - y, nil -} - -// negateInt64Checked performs negation with overflow detection of an int64. -// -// If the operation fails the error return value will be non-nil. -func negateInt64Checked(x int64) (int64, error) { - // In twos complement, negating MinInt64 would result in a valid of MaxInt64+1. - if x == math.MinInt64 { - return 0, errIntOverflow - } - return -x, nil -} - -// multiplyInt64Checked performs multiplication with overflow detection of two int64 value. -// -// If the operation fails the error return value will be non-nil. -func multiplyInt64Checked(x, y int64) (int64, error) { - // Detecting multiplication overflow is more complicated than the others. The first two detect - // attempting to negate MinInt64, which would result in MaxInt64+1. The other four detect normal - // overflow conditions. - if (x == -1 && y == math.MinInt64) || (y == -1 && x == math.MinInt64) || - // x is positive, y is positive - (x > 0 && y > 0 && x > math.MaxInt64/y) || - // x is positive, y is negative - (x > 0 && y < 0 && y < math.MinInt64/x) || - // x is negative, y is positive - (x < 0 && y > 0 && x < math.MinInt64/y) || - // x is negative, y is negative - (x < 0 && y < 0 && y < math.MaxInt64/x) { - return 0, errIntOverflow - } - return x * y, nil -} - -// divideInt64Checked performs division with overflow detection of two int64 values, -// as well as a division by zero check. -// -// If the operation fails the error return value will be non-nil. -func divideInt64Checked(x, y int64) (int64, error) { - // Division by zero. - if y == 0 { - return 0, errDivideByZero - } - // In twos complement, negating MinInt64 would result in a valid of MaxInt64+1. - if x == math.MinInt64 && y == -1 { - return 0, errIntOverflow - } - return x / y, nil -} - -// moduloInt64Checked performs modulo with overflow detection of two int64 values -// as well as a modulus by zero check. -// -// If the operation fails the error return value will be non-nil. -func moduloInt64Checked(x, y int64) (int64, error) { - // Modulus by zero. - if y == 0 { - return 0, errModulusByZero - } - // In twos complement, negating MinInt64 would result in a valid of MaxInt64+1. - if x == math.MinInt64 && y == -1 { - return 0, errIntOverflow - } - return x % y, nil -} - -// addUint64Checked performs addition with overflow detection of two uint64 values. -// -// If the operation fails due to overflow the error return value will be non-nil. -func addUint64Checked(x, y uint64) (uint64, error) { - if y > 0 && x > math.MaxUint64-y { - return 0, errUintOverflow - } - return x + y, nil -} - -// subtractUint64Checked performs subtraction with overflow detection of two uint64 values. -// -// If the operation fails due to overflow the error return value will be non-nil. -func subtractUint64Checked(x, y uint64) (uint64, error) { - if y > x { - return 0, errUintOverflow - } - return x - y, nil -} - -// multiplyUint64Checked performs multiplication with overflow detection of two uint64 values. -// -// If the operation fails due to overflow the error return value will be non-nil. -func multiplyUint64Checked(x, y uint64) (uint64, error) { - if y != 0 && x > math.MaxUint64/y { - return 0, errUintOverflow - } - return x * y, nil -} - -// divideUint64Checked performs division with a test for division by zero. -// -// If the operation fails the error return value will be non-nil. -func divideUint64Checked(x, y uint64) (uint64, error) { - if y == 0 { - return 0, errDivideByZero - } - return x / y, nil -} - -// moduloUint64Checked performs modulo with a test for modulus by zero. -// -// If the operation fails the error return value will be non-nil. -func moduloUint64Checked(x, y uint64) (uint64, error) { - if y == 0 { - return 0, errModulusByZero - } - return x % y, nil -} - -// addDurationChecked performs addition with overflow detection of two time.Durations. -// -// If the operation fails due to overflow the error return value will be non-nil. -func addDurationChecked(x, y time.Duration) (time.Duration, error) { - val, err := addInt64Checked(int64(x), int64(y)) - if err != nil { - return time.Duration(0), err - } - return time.Duration(val), nil -} - -// subtractDurationChecked performs subtraction with overflow detection of two time.Durations. -// -// If the operation fails due to overflow the error return value will be non-nil. -func subtractDurationChecked(x, y time.Duration) (time.Duration, error) { - val, err := subtractInt64Checked(int64(x), int64(y)) - if err != nil { - return time.Duration(0), err - } - return time.Duration(val), nil -} - -// negateDurationChecked performs negation with overflow detection of a time.Duration. -// -// If the operation fails due to overflow the error return value will be non-nil. -func negateDurationChecked(x time.Duration) (time.Duration, error) { - val, err := negateInt64Checked(int64(x)) - if err != nil { - return time.Duration(0), err - } - return time.Duration(val), nil -} - -// addDurationChecked performs addition with overflow detection of a time.Time and time.Duration. -// -// If the operation fails due to overflow the error return value will be non-nil. -func addTimeDurationChecked(x time.Time, y time.Duration) (time.Time, error) { - // This is tricky. A time is represented as (int64, int32) where the first is seconds and second - // is nanoseconds. A duration is int64 representing nanoseconds. We cannot normalize time to int64 - // as it could potentially overflow. The only way to proceed is to break time and duration into - // second and nanosecond components. - - // First we break time into its components by truncating and subtracting. - sec1 := x.Truncate(time.Second).Unix() // Truncate to seconds. - nsec1 := x.Sub(x.Truncate(time.Second)).Nanoseconds() // Get nanoseconds by truncating and subtracting. - - // Second we break duration into its components by dividing and modulo. - sec2 := int64(y) / int64(time.Second) // Truncate to seconds. - nsec2 := int64(y) % int64(time.Second) // Get remainder. - - // Add seconds first, detecting any overflow. - sec, err := addInt64Checked(sec1, sec2) - if err != nil { - return time.Time{}, err - } - // Nanoseconds cannot overflow as time.Time normalizes them to [0, 999999999]. - nsec := nsec1 + nsec2 - - // We need to normalize nanoseconds to be positive and carry extra nanoseconds to seconds. - // Adapted from time.Unix(int64, int64). - if nsec < 0 || nsec >= int64(time.Second) { - // Add seconds. - sec, err = addInt64Checked(sec, nsec/int64(time.Second)) - if err != nil { - return time.Time{}, err - } - - nsec -= (nsec / int64(time.Second)) * int64(time.Second) - if nsec < 0 { - // Subtract an extra second - sec, err = addInt64Checked(sec, -1) - if err != nil { - return time.Time{}, err - } - nsec += int64(time.Second) - } - } - - // Check if the the number of seconds from Unix epoch is within our acceptable range. - if sec < minUnixTime || sec > maxUnixTime { - return time.Time{}, errTimestampOverflow - } - - // Return resulting time and propagate time zone. - return time.Unix(sec, nsec).In(x.Location()), nil -} - -// subtractTimeChecked performs subtraction with overflow detection of two time.Time. -// -// If the operation fails due to overflow the error return value will be non-nil. -func subtractTimeChecked(x, y time.Time) (time.Duration, error) { - // Similar to addTimeDurationOverflow() above. - - // First we break time into its components by truncating and subtracting. - sec1 := x.Truncate(time.Second).Unix() // Truncate to seconds. - nsec1 := x.Sub(x.Truncate(time.Second)).Nanoseconds() // Get nanoseconds by truncating and subtracting. - - // Second we break duration into its components by truncating and subtracting. - sec2 := y.Truncate(time.Second).Unix() // Truncate to seconds. - nsec2 := y.Sub(y.Truncate(time.Second)).Nanoseconds() // Get nanoseconds by truncating and subtracting. - - // Subtract seconds first, detecting any overflow. - sec, err := subtractInt64Checked(sec1, sec2) - if err != nil { - return time.Duration(0), err - } - - // Nanoseconds cannot overflow as time.Time normalizes them to [0, 999999999]. - nsec := nsec1 - nsec2 - - // Scale seconds to nanoseconds detecting overflow. - tsec, err := multiplyInt64Checked(sec, int64(time.Second)) - if err != nil { - return time.Duration(0), err - } - - // Lastly we need to add the two nanoseconds together. - val, err := addInt64Checked(tsec, nsec) - if err != nil { - return time.Duration(0), err - } - - return time.Duration(val), nil -} - -// subtractTimeDurationChecked performs subtraction with overflow detection of a time.Time and -// time.Duration. -// -// If the operation fails due to overflow the error return value will be non-nil. -func subtractTimeDurationChecked(x time.Time, y time.Duration) (time.Time, error) { - // The easiest way to implement this is to negate y and add them. - // x - y = x + -y - val, err := negateDurationChecked(y) - if err != nil { - return time.Time{}, err - } - return addTimeDurationChecked(x, val) -} - -// doubleToInt64Checked converts a double to an int64 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func doubleToInt64Checked(v float64) (int64, error) { - if math.IsInf(v, 0) || math.IsNaN(v) || v <= float64(math.MinInt64) || v >= float64(math.MaxInt64) { - return 0, errIntOverflow - } - return int64(v), nil -} - -// doubleToInt64Checked converts a double to a uint64 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func doubleToUint64Checked(v float64) (uint64, error) { - if math.IsInf(v, 0) || math.IsNaN(v) || v < 0 || v >= doubleTwoTo64 { - return 0, errUintOverflow - } - return uint64(v), nil -} - -// int64ToUint64Checked converts an int64 to a uint64 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func int64ToUint64Checked(v int64) (uint64, error) { - if v < 0 { - return 0, errUintOverflow - } - return uint64(v), nil -} - -// int64ToInt8Checked converts an int64 to an int8 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func int64ToInt8Checked(v int64) (int8, error) { - if v < math.MinInt8 || v > math.MaxInt8 { - return 0, errIntOverflow - } - return int8(v), nil -} - -// int64ToInt16Checked converts an int64 to an int16 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func int64ToInt16Checked(v int64) (int16, error) { - if v < math.MinInt16 || v > math.MaxInt16 { - return 0, errIntOverflow - } - return int16(v), nil -} - -// int64ToInt32Checked converts an int64 to an int32 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func int64ToInt32Checked(v int64) (int32, error) { - if v < math.MinInt32 || v > math.MaxInt32 { - return 0, errIntOverflow - } - return int32(v), nil -} - -// uint64ToUint8Checked converts a uint64 to a uint8 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func uint64ToUint8Checked(v uint64) (uint8, error) { - if v > math.MaxUint8 { - return 0, errUintOverflow - } - return uint8(v), nil -} - -// uint64ToUint16Checked converts a uint64 to a uint16 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func uint64ToUint16Checked(v uint64) (uint16, error) { - if v > math.MaxUint16 { - return 0, errUintOverflow - } - return uint16(v), nil -} - -// uint64ToUint32Checked converts a uint64 to a uint32 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func uint64ToUint32Checked(v uint64) (uint32, error) { - if v > math.MaxUint32 { - return 0, errUintOverflow - } - return uint32(v), nil -} - -// uint64ToInt64Checked converts a uint64 to an int64 value. -// -// If the conversion fails due to overflow the error return value will be non-nil. -func uint64ToInt64Checked(v uint64) (int64, error) { - if v > math.MaxInt64 { - return 0, errIntOverflow - } - return int64(v), nil -} - -func doubleToUint64Lossless(v float64) (uint64, bool) { - u, err := doubleToUint64Checked(v) - if err != nil { - return 0, false - } - if float64(u) != v { - return 0, false - } - return u, true -} - -func doubleToInt64Lossless(v float64) (int64, bool) { - i, err := doubleToInt64Checked(v) - if err != nil { - return 0, false - } - if float64(i) != v { - return 0, false - } - return i, true -} - -func int64ToUint64Lossless(v int64) (uint64, bool) { - u, err := int64ToUint64Checked(v) - return u, err == nil -} - -func uint64ToInt64Lossless(v uint64) (int64, bool) { - i, err := uint64ToInt64Checked(v) - return i, err == nil -} diff --git a/vendor/github.com/google/cel-go/common/types/pb/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/pb/BUILD.bazel deleted file mode 100644 index e2b9d37b5..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/BUILD.bazel +++ /dev/null @@ -1,53 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "checked.go", - "enum.go", - "equal.go", - "file.go", - "pb.go", - "type.go", - ], - importpath = "github.com/google/cel-go/common/types/pb", - deps = [ - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//encoding/protowire:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - "@org_golang_google_protobuf//reflect/protoregistry:go_default_library", - "@org_golang_google_protobuf//types/dynamicpb:go_default_library", - "@org_golang_google_protobuf//types/known/anypb:go_default_library", - "@org_golang_google_protobuf//types/known/durationpb:go_default_library", - "@org_golang_google_protobuf//types/known/emptypb:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", - "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "equal_test.go", - "file_test.go", - "pb_test.go", - "type_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//checker/decls:go_default_library", - "//test/proto2pb:test_all_types_go_proto", - "//test/proto3pb:test_all_types_go_proto", - "@org_golang_google_protobuf//reflect/protodesc:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - "@org_golang_google_protobuf//types/descriptorpb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/types/pb/checked.go b/vendor/github.com/google/cel-go/common/types/pb/checked.go deleted file mode 100644 index 312a6a072..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/checked.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pb - -import ( - "google.golang.org/protobuf/reflect/protoreflect" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -var ( - // CheckedPrimitives map from proto field descriptor type to expr.Type. - CheckedPrimitives = map[protoreflect.Kind]*exprpb.Type{ - protoreflect.BoolKind: checkedBool, - protoreflect.BytesKind: checkedBytes, - protoreflect.DoubleKind: checkedDouble, - protoreflect.FloatKind: checkedDouble, - protoreflect.Int32Kind: checkedInt, - protoreflect.Int64Kind: checkedInt, - protoreflect.Sint32Kind: checkedInt, - protoreflect.Sint64Kind: checkedInt, - protoreflect.Uint32Kind: checkedUint, - protoreflect.Uint64Kind: checkedUint, - protoreflect.Fixed32Kind: checkedUint, - protoreflect.Fixed64Kind: checkedUint, - protoreflect.Sfixed32Kind: checkedInt, - protoreflect.Sfixed64Kind: checkedInt, - protoreflect.StringKind: checkedString} - - // CheckedWellKnowns map from qualified proto type name to expr.Type for - // well-known proto types. - CheckedWellKnowns = map[string]*exprpb.Type{ - // Wrapper types. - "google.protobuf.BoolValue": checkedWrap(checkedBool), - "google.protobuf.BytesValue": checkedWrap(checkedBytes), - "google.protobuf.DoubleValue": checkedWrap(checkedDouble), - "google.protobuf.FloatValue": checkedWrap(checkedDouble), - "google.protobuf.Int64Value": checkedWrap(checkedInt), - "google.protobuf.Int32Value": checkedWrap(checkedInt), - "google.protobuf.UInt64Value": checkedWrap(checkedUint), - "google.protobuf.UInt32Value": checkedWrap(checkedUint), - "google.protobuf.StringValue": checkedWrap(checkedString), - // Well-known types. - "google.protobuf.Any": checkedAny, - "google.protobuf.Duration": checkedDuration, - "google.protobuf.Timestamp": checkedTimestamp, - // Json types. - "google.protobuf.ListValue": checkedListDyn, - "google.protobuf.NullValue": checkedNull, - "google.protobuf.Struct": checkedMapStringDyn, - "google.protobuf.Value": checkedDyn, - } - - // common types - checkedDyn = &exprpb.Type{TypeKind: &exprpb.Type_Dyn{Dyn: &emptypb.Empty{}}} - // Wrapper and primitive types. - checkedBool = checkedPrimitive(exprpb.Type_BOOL) - checkedBytes = checkedPrimitive(exprpb.Type_BYTES) - checkedDouble = checkedPrimitive(exprpb.Type_DOUBLE) - checkedInt = checkedPrimitive(exprpb.Type_INT64) - checkedString = checkedPrimitive(exprpb.Type_STRING) - checkedUint = checkedPrimitive(exprpb.Type_UINT64) - // Well-known type equivalents. - checkedAny = checkedWellKnown(exprpb.Type_ANY) - checkedDuration = checkedWellKnown(exprpb.Type_DURATION) - checkedTimestamp = checkedWellKnown(exprpb.Type_TIMESTAMP) - // Json-based type equivalents. - checkedNull = &exprpb.Type{ - TypeKind: &exprpb.Type_Null{ - Null: structpb.NullValue_NULL_VALUE}} - checkedListDyn = &exprpb.Type{ - TypeKind: &exprpb.Type_ListType_{ - ListType: &exprpb.Type_ListType{ElemType: checkedDyn}}} - checkedMapStringDyn = &exprpb.Type{ - TypeKind: &exprpb.Type_MapType_{ - MapType: &exprpb.Type_MapType{ - KeyType: checkedString, - ValueType: checkedDyn}}} -) diff --git a/vendor/github.com/google/cel-go/common/types/pb/enum.go b/vendor/github.com/google/cel-go/common/types/pb/enum.go deleted file mode 100644 index 09a154630..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/enum.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pb - -import ( - "google.golang.org/protobuf/reflect/protoreflect" -) - -// newEnumValueDescription produces an enum value description with the fully qualified enum value -// name and the enum value descriptor. -func newEnumValueDescription(name string, desc protoreflect.EnumValueDescriptor) *EnumValueDescription { - return &EnumValueDescription{ - enumValueName: name, - desc: desc, - } -} - -// EnumValueDescription maps a fully-qualified enum value name to its numeric value. -type EnumValueDescription struct { - enumValueName string - desc protoreflect.EnumValueDescriptor -} - -// Name returns the fully-qualified identifier name for the enum value. -func (ed *EnumValueDescription) Name() string { - return ed.enumValueName -} - -// Value returns the (numeric) value of the enum. -func (ed *EnumValueDescription) Value() int32 { - return int32(ed.desc.Number()) -} diff --git a/vendor/github.com/google/cel-go/common/types/pb/equal.go b/vendor/github.com/google/cel-go/common/types/pb/equal.go deleted file mode 100644 index 76893d85e..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/equal.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pb - -import ( - "bytes" - "reflect" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - anypb "google.golang.org/protobuf/types/known/anypb" -) - -// Equal returns whether two proto.Message instances are equal using the following criteria: -// -// - Messages must share the same instance of the type descriptor -// - Known set fields are compared using semantics equality -// - Bytes are compared using bytes.Equal -// - Scalar values are compared with operator == -// - List and map types are equal if they have the same length and all elements are equal -// - Messages are equal if they share the same descriptor and all set fields are equal -// - Unknown fields are compared using byte equality -// - NaN values are not equal to each other -// - google.protobuf.Any values are unpacked before comparison -// - If the type descriptor for a protobuf.Any cannot be found, byte equality is used rather than -// semantic equality. -// -// This method of proto equality mirrors the behavior of the C++ protobuf MessageDifferencer -// whereas the golang proto.Equal implementation mirrors the Java protobuf equals() methods -// behaviors which needed to treat NaN values as equal due to Java semantics. -func Equal(x, y proto.Message) bool { - if x == nil || y == nil { - return x == nil && y == nil - } - xRef := x.ProtoReflect() - yRef := y.ProtoReflect() - return equalMessage(xRef, yRef) -} - -func equalMessage(mx, my protoreflect.Message) bool { - // Note, the original proto.Equal upon which this implementation is based does not specifically handle the - // case when both messages are invalid. It is assumed that the descriptors will be equal and that byte-wise - // comparison will be used, though the semantics of validity are neither clear, nor promised within the - // proto.Equal implementation. - if mx.IsValid() != my.IsValid() || mx.Descriptor() != my.Descriptor() { - return false - } - - // This is an innovation on the default proto.Equal where protobuf.Any values are unpacked before comparison - // as otherwise the Any values are compared by bytes rather than structurally. - if isAny(mx) && isAny(my) { - ax := mx.Interface().(*anypb.Any) - ay := my.Interface().(*anypb.Any) - // If the values are not the same type url, return false. - if ax.GetTypeUrl() != ay.GetTypeUrl() { - return false - } - // If the values are byte equal, then return true. - if bytes.Equal(ax.GetValue(), ay.GetValue()) { - return true - } - // Otherwise fall through to the semantic comparison of the any values. - x, err := ax.UnmarshalNew() - if err != nil { - return false - } - y, err := ay.UnmarshalNew() - if err != nil { - return false - } - // Recursively compare the unwrapped messages to ensure nested Any values are unwrapped accordingly. - return equalMessage(x.ProtoReflect(), y.ProtoReflect()) - } - - // Walk the set fields to determine field-wise equality - nx := 0 - equal := true - mx.Range(func(fd protoreflect.FieldDescriptor, vx protoreflect.Value) bool { - nx++ - equal = my.Has(fd) && equalField(fd, vx, my.Get(fd)) - return equal - }) - if !equal { - return false - } - // Establish the count of set fields on message y - ny := 0 - my.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool { - ny++ - return true - }) - // If the number of set fields is not equal return false. - if nx != ny { - return false - } - - return equalUnknown(mx.GetUnknown(), my.GetUnknown()) -} - -func equalField(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool { - switch { - case fd.IsMap(): - return equalMap(fd, x.Map(), y.Map()) - case fd.IsList(): - return equalList(fd, x.List(), y.List()) - default: - return equalValue(fd, x, y) - } -} - -func equalMap(fd protoreflect.FieldDescriptor, x, y protoreflect.Map) bool { - if x.Len() != y.Len() { - return false - } - equal := true - x.Range(func(k protoreflect.MapKey, vx protoreflect.Value) bool { - vy := y.Get(k) - equal = y.Has(k) && equalValue(fd.MapValue(), vx, vy) - return equal - }) - return equal -} - -func equalList(fd protoreflect.FieldDescriptor, x, y protoreflect.List) bool { - if x.Len() != y.Len() { - return false - } - for i := x.Len() - 1; i >= 0; i-- { - if !equalValue(fd, x.Get(i), y.Get(i)) { - return false - } - } - return true -} - -func equalValue(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool { - switch fd.Kind() { - case protoreflect.BoolKind: - return x.Bool() == y.Bool() - case protoreflect.EnumKind: - return x.Enum() == y.Enum() - case protoreflect.Int32Kind, protoreflect.Sint32Kind, - protoreflect.Int64Kind, protoreflect.Sint64Kind, - protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind: - return x.Int() == y.Int() - case protoreflect.Uint32Kind, protoreflect.Uint64Kind, - protoreflect.Fixed32Kind, protoreflect.Fixed64Kind: - return x.Uint() == y.Uint() - case protoreflect.FloatKind, protoreflect.DoubleKind: - return x.Float() == y.Float() - case protoreflect.StringKind: - return x.String() == y.String() - case protoreflect.BytesKind: - return bytes.Equal(x.Bytes(), y.Bytes()) - case protoreflect.MessageKind, protoreflect.GroupKind: - return equalMessage(x.Message(), y.Message()) - default: - return x.Interface() == y.Interface() - } -} - -func equalUnknown(x, y protoreflect.RawFields) bool { - lenX := len(x) - lenY := len(y) - if lenX != lenY { - return false - } - if lenX == 0 { - return true - } - if bytes.Equal([]byte(x), []byte(y)) { - return true - } - - mx := make(map[protoreflect.FieldNumber]protoreflect.RawFields) - my := make(map[protoreflect.FieldNumber]protoreflect.RawFields) - for len(x) > 0 { - fnum, _, n := protowire.ConsumeField(x) - mx[fnum] = append(mx[fnum], x[:n]...) - x = x[n:] - } - for len(y) > 0 { - fnum, _, n := protowire.ConsumeField(y) - my[fnum] = append(my[fnum], y[:n]...) - y = y[n:] - } - return reflect.DeepEqual(mx, my) -} - -func isAny(m protoreflect.Message) bool { - return string(m.Descriptor().FullName()) == "google.protobuf.Any" -} diff --git a/vendor/github.com/google/cel-go/common/types/pb/file.go b/vendor/github.com/google/cel-go/common/types/pb/file.go deleted file mode 100644 index e323afb1d..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/file.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pb - -import ( - "fmt" - - "google.golang.org/protobuf/reflect/protoreflect" - - dynamicpb "google.golang.org/protobuf/types/dynamicpb" -) - -// newFileDescription returns a FileDescription instance with a complete listing of all the message -// types and enum values, as well as a map of extensions declared within any scope in the file. -func newFileDescription(fileDesc protoreflect.FileDescriptor, pbdb *Db) (*FileDescription, extensionMap) { - metadata := collectFileMetadata(fileDesc) - enums := make(map[string]*EnumValueDescription) - for name, enumVal := range metadata.enumValues { - enums[name] = newEnumValueDescription(name, enumVal) - } - types := make(map[string]*TypeDescription) - for name, msgType := range metadata.msgTypes { - types[name] = newTypeDescription(name, msgType, pbdb.extensions) - } - fileExtMap := make(extensionMap) - for typeName, extensions := range metadata.msgExtensionMap { - messageExtMap, found := fileExtMap[typeName] - if !found { - messageExtMap = make(map[string]*FieldDescription) - } - for _, ext := range extensions { - extDesc := dynamicpb.NewExtensionType(ext).TypeDescriptor() - messageExtMap[string(ext.FullName())] = newFieldDescription(extDesc) - } - fileExtMap[typeName] = messageExtMap - } - return &FileDescription{ - name: fileDesc.Path(), - types: types, - enums: enums, - }, fileExtMap -} - -// FileDescription holds a map of all types and enum values declared within a proto file. -type FileDescription struct { - name string - types map[string]*TypeDescription - enums map[string]*EnumValueDescription -} - -// Copy creates a copy of the FileDescription with updated Db references within its types. -func (fd *FileDescription) Copy(pbdb *Db) *FileDescription { - typesCopy := make(map[string]*TypeDescription, len(fd.types)) - for k, v := range fd.types { - typesCopy[k] = v.Copy(pbdb) - } - return &FileDescription{ - name: fd.name, - types: typesCopy, - enums: fd.enums, - } -} - -// GetName returns the fully qualified file path for the file. -func (fd *FileDescription) GetName() string { - return fd.name -} - -// GetEnumDescription returns an EnumDescription for a qualified enum value -// name declared within the .proto file. -func (fd *FileDescription) GetEnumDescription(enumName string) (*EnumValueDescription, bool) { - ed, found := fd.enums[sanitizeProtoName(enumName)] - return ed, found -} - -// GetEnumNames returns the string names of all enum values in the file. -func (fd *FileDescription) GetEnumNames() []string { - enumNames := make([]string, len(fd.enums)) - i := 0 - for _, e := range fd.enums { - enumNames[i] = e.Name() - i++ - } - return enumNames -} - -// GetTypeDescription returns a TypeDescription for a qualified protobuf message type name -// declared within the .proto file. -func (fd *FileDescription) GetTypeDescription(typeName string) (*TypeDescription, bool) { - td, found := fd.types[sanitizeProtoName(typeName)] - return td, found -} - -// GetTypeNames returns the list of all type names contained within the file. -func (fd *FileDescription) GetTypeNames() []string { - typeNames := make([]string, len(fd.types)) - i := 0 - for _, t := range fd.types { - typeNames[i] = t.Name() - i++ - } - return typeNames -} - -// sanitizeProtoName strips the leading '.' from the proto message name. -func sanitizeProtoName(name string) string { - if name != "" && name[0] == '.' { - return name[1:] - } - return name -} - -// fileMetadata is a flattened view of message types and enum values within a file descriptor. -type fileMetadata struct { - // msgTypes maps from fully-qualified message name to descriptor. - msgTypes map[string]protoreflect.MessageDescriptor - // enumValues maps from fully-qualified enum value to enum value descriptor. - enumValues map[string]protoreflect.EnumValueDescriptor - // msgExtensionMap maps from the protobuf message name being extended to a set of extensions - // for the type. - msgExtensionMap map[string][]protoreflect.ExtensionDescriptor - - // TODO: support enum type definitions for use in future type-check enhancements. -} - -// collectFileMetadata traverses the proto file object graph to collect message types and enum -// values and index them by their fully qualified names. -func collectFileMetadata(fileDesc protoreflect.FileDescriptor) *fileMetadata { - msgTypes := make(map[string]protoreflect.MessageDescriptor) - enumValues := make(map[string]protoreflect.EnumValueDescriptor) - msgExtensionMap := make(map[string][]protoreflect.ExtensionDescriptor) - collectMsgTypes(fileDesc.Messages(), msgTypes, enumValues, msgExtensionMap) - collectEnumValues(fileDesc.Enums(), enumValues) - collectExtensions(fileDesc.Extensions(), msgExtensionMap) - return &fileMetadata{ - msgTypes: msgTypes, - enumValues: enumValues, - msgExtensionMap: msgExtensionMap, - } -} - -// collectMsgTypes recursively collects messages, nested messages, and nested enums into a map of -// fully qualified protobuf names to descriptors. -func collectMsgTypes(msgTypes protoreflect.MessageDescriptors, - msgTypeMap map[string]protoreflect.MessageDescriptor, - enumValueMap map[string]protoreflect.EnumValueDescriptor, - msgExtensionMap map[string][]protoreflect.ExtensionDescriptor) { - for i := 0; i < msgTypes.Len(); i++ { - msgType := msgTypes.Get(i) - msgTypeMap[string(msgType.FullName())] = msgType - nestedMsgTypes := msgType.Messages() - if nestedMsgTypes.Len() != 0 { - collectMsgTypes(nestedMsgTypes, msgTypeMap, enumValueMap, msgExtensionMap) - } - nestedEnumTypes := msgType.Enums() - if nestedEnumTypes.Len() != 0 { - collectEnumValues(nestedEnumTypes, enumValueMap) - } - nestedExtensions := msgType.Extensions() - if nestedExtensions.Len() != 0 { - collectExtensions(nestedExtensions, msgExtensionMap) - } - } -} - -// collectEnumValues accumulates the enum values within an enum declaration. -func collectEnumValues(enumTypes protoreflect.EnumDescriptors, enumValueMap map[string]protoreflect.EnumValueDescriptor) { - for i := 0; i < enumTypes.Len(); i++ { - enumType := enumTypes.Get(i) - enumTypeValues := enumType.Values() - for j := 0; j < enumTypeValues.Len(); j++ { - enumValue := enumTypeValues.Get(j) - enumValueName := fmt.Sprintf("%s.%s", string(enumType.FullName()), string(enumValue.Name())) - enumValueMap[enumValueName] = enumValue - } - } -} - -func collectExtensions(extensions protoreflect.ExtensionDescriptors, msgExtensionMap map[string][]protoreflect.ExtensionDescriptor) { - for i := 0; i < extensions.Len(); i++ { - ext := extensions.Get(i) - extendsMsg := string(ext.ContainingMessage().FullName()) - msgExts, found := msgExtensionMap[extendsMsg] - if !found { - msgExts = []protoreflect.ExtensionDescriptor{} - } - msgExts = append(msgExts, ext) - msgExtensionMap[extendsMsg] = msgExts - } -} diff --git a/vendor/github.com/google/cel-go/common/types/pb/pb.go b/vendor/github.com/google/cel-go/common/types/pb/pb.go deleted file mode 100644 index eadebcb04..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/pb.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package pb reflects over protocol buffer descriptors to generate objects -// that simplify type, enum, and field lookup. -package pb - -import ( - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - anypb "google.golang.org/protobuf/types/known/anypb" - durpb "google.golang.org/protobuf/types/known/durationpb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" - tspb "google.golang.org/protobuf/types/known/timestamppb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Db maps from file / message / enum name to file description. -// -// Each Db is isolated from each other, and while information about protobuf descriptors may be -// fetched from the global protobuf registry, no descriptors are added to this registry, else -// the isolation guarantees of the Db object would be violated. -type Db struct { - revFileDescriptorMap map[string]*FileDescription - // files contains the deduped set of FileDescriptions whose types are contained in the pb.Db. - files []*FileDescription - // extensions contains the mapping between a given type name, extension name and its FieldDescription - extensions map[string]map[string]*FieldDescription -} - -// extensionsMap is a type alias to a map[typeName]map[extensionName]*FieldDescription -type extensionMap = map[string]map[string]*FieldDescription - -var ( - // DefaultDb used at evaluation time or unless overridden at check time. - DefaultDb = &Db{ - revFileDescriptorMap: make(map[string]*FileDescription), - files: []*FileDescription{}, - extensions: make(extensionMap), - } -) - -// Merge will copy the source proto message into the destination, or error if the merge cannot be completed. -// -// Unlike the proto.Merge, this method will fallback to proto.Marshal/Unmarshal of the two proto messages do not -// share the same instance of their type descriptor. -func Merge(dstPB, srcPB proto.Message) error { - src, dst := srcPB.ProtoReflect(), dstPB.ProtoReflect() - if src.Descriptor() == dst.Descriptor() { - proto.Merge(dstPB, srcPB) - return nil - } - if src.Descriptor().FullName() != dst.Descriptor().FullName() { - return fmt.Errorf("pb.Merge() arguments must be the same type. got: %v, %v", - dst.Descriptor().FullName(), src.Descriptor().FullName()) - } - bytes, err := proto.Marshal(srcPB) - if err != nil { - return fmt.Errorf("pb.Merge(dstPB, srcPB) failed to marshal source proto: %v", err) - } - err = proto.Unmarshal(bytes, dstPB) - if err != nil { - return fmt.Errorf("pb.Merge(dstPB, srcPB) failed to unmarshal to dest proto: %v", err) - } - return nil -} - -// NewDb creates a new `pb.Db` with an empty type name to file description map. -func NewDb() *Db { - pbdb := &Db{ - revFileDescriptorMap: make(map[string]*FileDescription), - files: []*FileDescription{}, - extensions: make(extensionMap), - } - // The FileDescription objects in the default db contain lazily initialized TypeDescription - // values which may point to the state contained in the DefaultDb irrespective of this shallow - // copy; however, the type graph for a field is idempotently computed, and is guaranteed to - // only be initialized once thanks to atomic values within the TypeDescription objects, so it - // is safe to share these values across instances. - for k, v := range DefaultDb.revFileDescriptorMap { - pbdb.revFileDescriptorMap[k] = v - } - pbdb.files = append(pbdb.files, DefaultDb.files...) - return pbdb -} - -// Copy creates a copy of the current database with its own internal descriptor mapping. -func (pbdb *Db) Copy() *Db { - copy := NewDb() - for _, fd := range pbdb.files { - hasFile := false - for _, fd2 := range copy.files { - if fd2 == fd { - hasFile = true - } - } - if !hasFile { - fd = fd.Copy(copy) - copy.files = append(copy.files, fd) - } - for _, enumValName := range fd.GetEnumNames() { - copy.revFileDescriptorMap[enumValName] = fd - } - for _, msgTypeName := range fd.GetTypeNames() { - copy.revFileDescriptorMap[msgTypeName] = fd - } - copy.revFileDescriptorMap[fd.GetName()] = fd - } - for typeName, extFieldMap := range pbdb.extensions { - copyExtFieldMap, found := copy.extensions[typeName] - if !found { - copyExtFieldMap = make(map[string]*FieldDescription, len(extFieldMap)) - } - for extFieldName, fd := range extFieldMap { - copyExtFieldMap[extFieldName] = fd - } - copy.extensions[typeName] = copyExtFieldMap - } - return copy -} - -// FileDescriptions returns the set of file descriptions associated with this db. -func (pbdb *Db) FileDescriptions() []*FileDescription { - return pbdb.files -} - -// RegisterDescriptor produces a `FileDescription` from a `FileDescriptor` and registers the -// message and enum types into the `pb.Db`. -func (pbdb *Db) RegisterDescriptor(fileDesc protoreflect.FileDescriptor) (*FileDescription, error) { - fd, found := pbdb.revFileDescriptorMap[fileDesc.Path()] - if found { - return fd, nil - } - // Make sure to search the global registry to see if a protoreflect.FileDescriptor for - // the file specified has been linked into the binary. If so, use the copy of the descriptor - // from the global cache. - // - // Note: Proto reflection relies on descriptor values being object equal rather than object - // equivalence. This choice means that a FieldDescriptor generated from a FileDescriptorProto - // will be incompatible with the FieldDescriptor in the global registry and any message created - // from that global registry. - globalFD, err := protoregistry.GlobalFiles.FindFileByPath(fileDesc.Path()) - if err == nil { - fileDesc = globalFD - } - var fileExtMap extensionMap - fd, fileExtMap = newFileDescription(fileDesc, pbdb) - for _, enumValName := range fd.GetEnumNames() { - pbdb.revFileDescriptorMap[enumValName] = fd - } - for _, msgTypeName := range fd.GetTypeNames() { - pbdb.revFileDescriptorMap[msgTypeName] = fd - } - pbdb.revFileDescriptorMap[fd.GetName()] = fd - - // Return the specific file descriptor registered. - pbdb.files = append(pbdb.files, fd) - - // Index the protobuf message extensions from the file into the pbdb - for typeName, extMap := range fileExtMap { - typeExtMap, found := pbdb.extensions[typeName] - if !found { - pbdb.extensions[typeName] = extMap - continue - } - for extName, field := range extMap { - typeExtMap[extName] = field - } - } - return fd, nil -} - -// RegisterMessage produces a `FileDescription` from a `message` and registers the message and all -// other definitions within the message file into the `pb.Db`. -func (pbdb *Db) RegisterMessage(message proto.Message) (*FileDescription, error) { - msgDesc := message.ProtoReflect().Descriptor() - msgName := msgDesc.FullName() - typeName := sanitizeProtoName(string(msgName)) - if fd, found := pbdb.revFileDescriptorMap[typeName]; found { - return fd, nil - } - return pbdb.RegisterDescriptor(msgDesc.ParentFile()) -} - -// DescribeEnum takes a qualified enum name and returns an `EnumDescription` if it exists in the -// `pb.Db`. -func (pbdb *Db) DescribeEnum(enumName string) (*EnumValueDescription, bool) { - enumName = sanitizeProtoName(enumName) - if fd, found := pbdb.revFileDescriptorMap[enumName]; found { - return fd.GetEnumDescription(enumName) - } - return nil, false -} - -// DescribeType returns a `TypeDescription` for the `typeName` if it exists in the `pb.Db`. -func (pbdb *Db) DescribeType(typeName string) (*TypeDescription, bool) { - typeName = sanitizeProtoName(typeName) - if fd, found := pbdb.revFileDescriptorMap[typeName]; found { - return fd.GetTypeDescription(typeName) - } - return nil, false -} - -// CollectFileDescriptorSet builds a file descriptor set associated with the file where the input -// message is declared. -func CollectFileDescriptorSet(message proto.Message) map[string]protoreflect.FileDescriptor { - fdMap := map[string]protoreflect.FileDescriptor{} - parentFile := message.ProtoReflect().Descriptor().ParentFile() - fdMap[parentFile.Path()] = parentFile - // Initialize list of dependencies - deps := make([]protoreflect.FileImport, parentFile.Imports().Len()) - for i := 0; i < parentFile.Imports().Len(); i++ { - deps[i] = parentFile.Imports().Get(i) - } - // Expand list for new dependencies - for i := 0; i < len(deps); i++ { - dep := deps[i] - if _, found := fdMap[dep.Path()]; found { - continue - } - fdMap[dep.Path()] = dep.FileDescriptor - for j := 0; j < dep.FileDescriptor.Imports().Len(); j++ { - deps = append(deps, dep.FileDescriptor.Imports().Get(j)) - } - } - return fdMap -} - -func init() { - // Describe well-known types to ensure they can always be resolved by the check and interpret - // execution phases. - // - // The following subset of message types is enough to ensure that all well-known types can - // resolved in the runtime, since describing the value results in describing the whole file - // where the message is declared. - DefaultDb.RegisterMessage(&anypb.Any{}) - DefaultDb.RegisterMessage(&durpb.Duration{}) - DefaultDb.RegisterMessage(&emptypb.Empty{}) - DefaultDb.RegisterMessage(&tspb.Timestamp{}) - DefaultDb.RegisterMessage(&structpb.Value{}) - DefaultDb.RegisterMessage(&wrapperspb.BoolValue{}) -} diff --git a/vendor/github.com/google/cel-go/common/types/pb/type.go b/vendor/github.com/google/cel-go/common/types/pb/type.go deleted file mode 100644 index bdd474c95..000000000 --- a/vendor/github.com/google/cel-go/common/types/pb/type.go +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pb - -import ( - "fmt" - "reflect" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - dynamicpb "google.golang.org/protobuf/types/dynamicpb" - anypb "google.golang.org/protobuf/types/known/anypb" - dpb "google.golang.org/protobuf/types/known/durationpb" - structpb "google.golang.org/protobuf/types/known/structpb" - tpb "google.golang.org/protobuf/types/known/timestamppb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// description is a private interface used to make it convenient to perform type unwrapping at -// the TypeDescription or FieldDescription level. -type description interface { - // Zero returns an empty immutable protobuf message when the description is a protobuf message - // type. - Zero() proto.Message -} - -// newTypeDescription produces a TypeDescription value for the fully-qualified proto type name -// with a given descriptor. -func newTypeDescription(typeName string, desc protoreflect.MessageDescriptor, extensions extensionMap) *TypeDescription { - msgType := dynamicpb.NewMessageType(desc) - msgZero := dynamicpb.NewMessage(desc) - fieldMap := map[string]*FieldDescription{} - fields := desc.Fields() - for i := 0; i < fields.Len(); i++ { - f := fields.Get(i) - fieldMap[string(f.Name())] = newFieldDescription(f) - } - return &TypeDescription{ - typeName: typeName, - desc: desc, - msgType: msgType, - fieldMap: fieldMap, - extensions: extensions, - reflectType: reflectTypeOf(msgZero), - zeroMsg: zeroValueOf(msgZero), - } -} - -// TypeDescription is a collection of type metadata relevant to expression -// checking and evaluation. -type TypeDescription struct { - typeName string - desc protoreflect.MessageDescriptor - msgType protoreflect.MessageType - fieldMap map[string]*FieldDescription - extensions extensionMap - reflectType reflect.Type - zeroMsg proto.Message -} - -// Copy copies the type description with updated references to the Db. -func (td *TypeDescription) Copy(pbdb *Db) *TypeDescription { - return &TypeDescription{ - typeName: td.typeName, - desc: td.desc, - msgType: td.msgType, - fieldMap: td.fieldMap, - extensions: pbdb.extensions, - reflectType: td.reflectType, - zeroMsg: td.zeroMsg, - } -} - -// FieldMap returns a string field name to FieldDescription map. -func (td *TypeDescription) FieldMap() map[string]*FieldDescription { - return td.fieldMap -} - -// FieldByName returns (FieldDescription, true) if the field name is declared within the type. -func (td *TypeDescription) FieldByName(name string) (*FieldDescription, bool) { - fd, found := td.fieldMap[name] - if found { - return fd, true - } - extFieldMap, found := td.extensions[td.typeName] - if !found { - return nil, false - } - fd, found = extFieldMap[name] - return fd, found -} - -// MaybeUnwrap accepts a proto message as input and unwraps it to a primitive CEL type if possible. -// -// This method returns the unwrapped value and 'true', else the original value and 'false'. -func (td *TypeDescription) MaybeUnwrap(msg proto.Message) (any, bool, error) { - return unwrap(td, msg) -} - -// Name returns the fully-qualified name of the type. -func (td *TypeDescription) Name() string { - return string(td.desc.FullName()) -} - -// New returns a mutable proto message -func (td *TypeDescription) New() protoreflect.Message { - return td.msgType.New() -} - -// ReflectType returns the Golang reflect.Type for this type. -func (td *TypeDescription) ReflectType() reflect.Type { - return td.reflectType -} - -// Zero returns the zero proto.Message value for this type. -func (td *TypeDescription) Zero() proto.Message { - return td.zeroMsg -} - -// newFieldDescription creates a new field description from a protoreflect.FieldDescriptor. -func newFieldDescription(fieldDesc protoreflect.FieldDescriptor) *FieldDescription { - var reflectType reflect.Type - var zeroMsg proto.Message - switch fieldDesc.Kind() { - case protoreflect.EnumKind: - reflectType = reflectTypeOf(protoreflect.EnumNumber(0)) - case protoreflect.GroupKind, protoreflect.MessageKind: - zeroMsg = dynamicpb.NewMessage(fieldDesc.Message()) - reflectType = reflectTypeOf(zeroMsg) - default: - reflectType = reflectTypeOf(fieldDesc.Default().Interface()) - if fieldDesc.IsList() { - var elemValue protoreflect.Value - if fieldDesc.IsExtension() { - et := dynamicpb.NewExtensionType(fieldDesc) - elemValue = et.New().List().NewElement() - } else { - parentMsgType := fieldDesc.ContainingMessage() - parentMsg := dynamicpb.NewMessage(parentMsgType) - listField := parentMsg.NewField(fieldDesc).List() - elemValue = listField.NewElement() - } - elem := elemValue.Interface() - switch elemType := elem.(type) { - case protoreflect.Message: - elem = elemType.Interface() - } - reflectType = reflectTypeOf(elem) - } - } - // Ensure the list type is appropriately reflected as a Go-native list. - if fieldDesc.IsList() { - reflectType = reflect.SliceOf(reflectType) - } - var keyType, valType *FieldDescription - if fieldDesc.IsMap() { - keyType = newFieldDescription(fieldDesc.MapKey()) - valType = newFieldDescription(fieldDesc.MapValue()) - } - return &FieldDescription{ - desc: fieldDesc, - KeyType: keyType, - ValueType: valType, - reflectType: reflectType, - zeroMsg: zeroValueOf(zeroMsg), - } -} - -// FieldDescription holds metadata related to fields declared within a type. -type FieldDescription struct { - // KeyType holds the key FieldDescription for map fields. - KeyType *FieldDescription - // ValueType holds the value FieldDescription for map fields. - ValueType *FieldDescription - - desc protoreflect.FieldDescriptor - reflectType reflect.Type - zeroMsg proto.Message -} - -// CheckedType returns the type-definition used at type-check time. -func (fd *FieldDescription) CheckedType() *exprpb.Type { - if fd.desc.IsMap() { - return &exprpb.Type{ - TypeKind: &exprpb.Type_MapType_{ - MapType: &exprpb.Type_MapType{ - KeyType: fd.KeyType.typeDefToType(), - ValueType: fd.ValueType.typeDefToType(), - }, - }, - } - } - if fd.desc.IsList() { - return &exprpb.Type{ - TypeKind: &exprpb.Type_ListType_{ - ListType: &exprpb.Type_ListType{ - ElemType: fd.typeDefToType()}}} - } - return fd.typeDefToType() -} - -// Descriptor returns the protoreflect.FieldDescriptor for this type. -func (fd *FieldDescription) Descriptor() protoreflect.FieldDescriptor { - return fd.desc -} - -// IsSet returns whether the field is set on the target value, per the proto presence conventions -// of proto2 or proto3 accordingly. -// -// This function implements the FieldType.IsSet function contract which can be used to operate on -// more than just protobuf field accesses; however, the target here must be a protobuf.Message. -func (fd *FieldDescription) IsSet(target any) bool { - switch v := target.(type) { - case proto.Message: - pbRef := v.ProtoReflect() - pbDesc := pbRef.Descriptor() - if pbDesc == fd.desc.ContainingMessage() { - // When the target protobuf shares the same message descriptor instance as the field - // descriptor, use the cached field descriptor value. - return pbRef.Has(fd.desc) - } - // Otherwise, fallback to a dynamic lookup of the field descriptor from the target - // instance as an attempt to use the cached field descriptor will result in a panic. - return pbRef.Has(pbDesc.Fields().ByName(protoreflect.Name(fd.Name()))) - default: - return false - } -} - -// GetFrom returns the accessor method associated with the field on the proto generated struct. -// -// If the field is not set, the proto default value is returned instead. -// -// This function implements the FieldType.GetFrom function contract which can be used to operate -// on more than just protobuf field accesses; however, the target here must be a protobuf.Message. -func (fd *FieldDescription) GetFrom(target any) (any, error) { - v, ok := target.(proto.Message) - if !ok { - return nil, fmt.Errorf("unsupported field selection target: (%T)%v", target, target) - } - pbRef := v.ProtoReflect() - pbDesc := pbRef.Descriptor() - var fieldVal any - if pbDesc == fd.desc.ContainingMessage() { - // When the target protobuf shares the same message descriptor instance as the field - // descriptor, use the cached field descriptor value. - fieldVal = pbRef.Get(fd.desc).Interface() - } else { - // Otherwise, fallback to a dynamic lookup of the field descriptor from the target - // instance as an attempt to use the cached field descriptor will result in a panic. - fieldVal = pbRef.Get(pbDesc.Fields().ByName(protoreflect.Name(fd.Name()))).Interface() - } - switch fv := fieldVal.(type) { - // Fast-path return for primitive types. - case bool, []byte, float32, float64, int32, int64, string, uint32, uint64, protoreflect.List: - return fv, nil - case protoreflect.EnumNumber: - return int64(fv), nil - case protoreflect.Map: - // Return a wrapper around the protobuf-reflected Map types which carries additional - // information about the key and value definitions of the map. - return &Map{Map: fv, KeyType: fd.KeyType, ValueType: fd.ValueType}, nil - case protoreflect.Message: - // Make sure to unwrap well-known protobuf types before returning. - unwrapped, _, err := fd.MaybeUnwrapDynamic(fv) - return unwrapped, err - default: - return fv, nil - } -} - -// IsEnum returns true if the field type refers to an enum value. -func (fd *FieldDescription) IsEnum() bool { - return fd.ProtoKind() == protoreflect.EnumKind -} - -// IsMap returns true if the field is of map type. -func (fd *FieldDescription) IsMap() bool { - return fd.desc.IsMap() -} - -// IsMessage returns true if the field is of message type. -func (fd *FieldDescription) IsMessage() bool { - kind := fd.ProtoKind() - return kind == protoreflect.MessageKind || kind == protoreflect.GroupKind -} - -// IsOneof returns true if the field is declared within a oneof block. -func (fd *FieldDescription) IsOneof() bool { - return fd.desc.ContainingOneof() != nil -} - -// IsList returns true if the field is a repeated value. -// -// This method will also return true for map values, so check whether the -// field is also a map. -func (fd *FieldDescription) IsList() bool { - return fd.desc.IsList() -} - -// MaybeUnwrapDynamic takes the reflected protoreflect.Message and determines whether the -// value can be unwrapped to a more primitive CEL type. -// -// This function returns the unwrapped value and 'true' on success, or the original value -// and 'false' otherwise. -func (fd *FieldDescription) MaybeUnwrapDynamic(msg protoreflect.Message) (any, bool, error) { - return unwrapDynamic(fd, msg) -} - -// Name returns the CamelCase name of the field within the proto-based struct. -func (fd *FieldDescription) Name() string { - return string(fd.desc.Name()) -} - -// ProtoKind returns the protobuf reflected kind of the field. -func (fd *FieldDescription) ProtoKind() protoreflect.Kind { - return fd.desc.Kind() -} - -// ReflectType returns the Golang reflect.Type for this field. -func (fd *FieldDescription) ReflectType() reflect.Type { - return fd.reflectType -} - -// String returns the fully qualified name of the field within its type as well as whether the -// field occurs within a oneof. -func (fd *FieldDescription) String() string { - return fmt.Sprintf("%v.%s `oneof=%t`", fd.desc.ContainingMessage().FullName(), fd.Name(), fd.IsOneof()) -} - -// Zero returns the zero value for the protobuf message represented by this field. -// -// If the field is not a proto.Message type, the zero value is nil. -func (fd *FieldDescription) Zero() proto.Message { - return fd.zeroMsg -} - -func (fd *FieldDescription) typeDefToType() *exprpb.Type { - if fd.IsMessage() { - msgType := string(fd.desc.Message().FullName()) - if wk, found := CheckedWellKnowns[msgType]; found { - return wk - } - return checkedMessageType(msgType) - } - if fd.IsEnum() { - return checkedInt - } - return CheckedPrimitives[fd.ProtoKind()] -} - -// Map wraps the protoreflect.Map object with a key and value FieldDescription for use in -// retrieving individual elements within CEL value data types. -type Map struct { - protoreflect.Map - KeyType *FieldDescription - ValueType *FieldDescription -} - -func checkedMessageType(name string) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_MessageType{MessageType: name}} -} - -func checkedPrimitive(primitive exprpb.Type_PrimitiveType) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_Primitive{Primitive: primitive}} -} - -func checkedWellKnown(wellKnown exprpb.Type_WellKnownType) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_WellKnown{WellKnown: wellKnown}} -} - -func checkedWrap(t *exprpb.Type) *exprpb.Type { - return &exprpb.Type{ - TypeKind: &exprpb.Type_Wrapper{Wrapper: t.GetPrimitive()}} -} - -// unwrap unwraps the provided proto.Message value, potentially based on the description if the -// input message is a *dynamicpb.Message which obscures the typing information from Go. -// -// Returns the unwrapped value and 'true' if unwrapped, otherwise the input value and 'false'. -func unwrap(desc description, msg proto.Message) (any, bool, error) { - switch v := msg.(type) { - case *anypb.Any: - dynMsg, err := v.UnmarshalNew() - if err != nil { - return v, false, err - } - return unwrapDynamic(desc, dynMsg.ProtoReflect()) - case *dynamicpb.Message: - return unwrapDynamic(desc, v) - case *dpb.Duration: - return v.AsDuration(), true, nil - case *tpb.Timestamp: - return v.AsTime(), true, nil - case *structpb.Value: - switch v.GetKind().(type) { - case *structpb.Value_BoolValue: - return v.GetBoolValue(), true, nil - case *structpb.Value_ListValue: - return v.GetListValue(), true, nil - case *structpb.Value_NullValue: - return structpb.NullValue_NULL_VALUE, true, nil - case *structpb.Value_NumberValue: - return v.GetNumberValue(), true, nil - case *structpb.Value_StringValue: - return v.GetStringValue(), true, nil - case *structpb.Value_StructValue: - return v.GetStructValue(), true, nil - default: - return structpb.NullValue_NULL_VALUE, true, nil - } - case *wrapperspb.BoolValue: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - case *wrapperspb.BytesValue: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - case *wrapperspb.DoubleValue: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - case *wrapperspb.FloatValue: - if v == nil { - return nil, true, nil - } - return float64(v.GetValue()), true, nil - case *wrapperspb.Int32Value: - if v == nil { - return nil, true, nil - } - return int64(v.GetValue()), true, nil - case *wrapperspb.Int64Value: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - case *wrapperspb.StringValue: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - case *wrapperspb.UInt32Value: - if v == nil { - return nil, true, nil - } - return uint64(v.GetValue()), true, nil - case *wrapperspb.UInt64Value: - if v == nil { - return nil, true, nil - } - return v.GetValue(), true, nil - } - return msg, false, nil -} - -// unwrapDynamic unwraps a reflected protobuf Message value. -// -// Returns the unwrapped value and 'true' if unwrapped, otherwise the input value and 'false'. -func unwrapDynamic(desc description, refMsg protoreflect.Message) (any, bool, error) { - msg := refMsg.Interface() - if !refMsg.IsValid() { - msg = desc.Zero() - } - // In order to ensure that these wrapped types match the expectations of the CEL type system - // the dynamicpb.Message must be merged with an protobuf instance of the well-known type value. - typeName := string(refMsg.Descriptor().FullName()) - switch typeName { - case "google.protobuf.Any": - // Note, Any values require further unwrapping; however, this unwrapping may or may not - // be to a well-known type. If the unwrapped value is a well-known type it will be further - // unwrapped before being returned to the caller. Otherwise, the dynamic protobuf object - // represented by the Any will be returned. - unwrappedAny := &anypb.Any{} - err := Merge(unwrappedAny, msg) - if err != nil { - return nil, false, fmt.Errorf("unwrap dynamic field failed: %v", err) - } - dynMsg, err := unwrappedAny.UnmarshalNew() - if err != nil { - // Allow the error to move further up the stack as it should result in an type - // conversion error if the caller does not recover it somehow. - return nil, false, fmt.Errorf("unmarshal dynamic any failed: %v", err) - } - // Attempt to unwrap the dynamic type, otherwise return the dynamic message. - unwrapped, nested, err := unwrapDynamic(desc, dynMsg.ProtoReflect()) - if err == nil && nested { - return unwrapped, true, nil - } - return dynMsg, true, err - case "google.protobuf.BoolValue", - "google.protobuf.BytesValue", - "google.protobuf.DoubleValue", - "google.protobuf.FloatValue", - "google.protobuf.Int32Value", - "google.protobuf.Int64Value", - "google.protobuf.StringValue", - "google.protobuf.UInt32Value", - "google.protobuf.UInt64Value": - // The msg value is ignored when dealing with wrapper types as they have a null or value - // behavior, rather than the standard zero value behavior of other proto message types. - if !refMsg.IsValid() { - return structpb.NullValue_NULL_VALUE, true, nil - } - valueField := refMsg.Descriptor().Fields().ByName("value") - return refMsg.Get(valueField).Interface(), true, nil - case "google.protobuf.Duration": - unwrapped := &dpb.Duration{} - err := Merge(unwrapped, msg) - if err != nil { - return nil, false, err - } - return unwrapped.AsDuration(), true, nil - case "google.protobuf.ListValue": - unwrapped := &structpb.ListValue{} - err := Merge(unwrapped, msg) - if err != nil { - return nil, false, err - } - return unwrapped, true, nil - case "google.protobuf.NullValue": - return structpb.NullValue_NULL_VALUE, true, nil - case "google.protobuf.Struct": - unwrapped := &structpb.Struct{} - err := Merge(unwrapped, msg) - if err != nil { - return nil, false, err - } - return unwrapped, true, nil - case "google.protobuf.Timestamp": - unwrapped := &tpb.Timestamp{} - err := Merge(unwrapped, msg) - if err != nil { - return nil, false, err - } - return unwrapped.AsTime(), true, nil - case "google.protobuf.Value": - unwrapped := &structpb.Value{} - err := Merge(unwrapped, msg) - if err != nil { - return nil, false, err - } - return unwrap(desc, unwrapped) - } - return msg, false, nil -} - -// reflectTypeOf intercepts the reflect.Type call to ensure that dynamicpb.Message types preserve -// well-known protobuf reflected types expected by the CEL type system. -func reflectTypeOf(val any) reflect.Type { - switch v := val.(type) { - case proto.Message: - return reflect.TypeOf(zeroValueOf(v)) - default: - return reflect.TypeOf(v) - } -} - -// zeroValueOf will return the strongest possible proto.Message representing the default protobuf -// message value of the input msg type. -func zeroValueOf(msg proto.Message) proto.Message { - if msg == nil { - return nil - } - typeName := string(msg.ProtoReflect().Descriptor().FullName()) - zeroVal, found := zeroValueMap[typeName] - if found { - return zeroVal - } - return msg -} - -var ( - jsonValueTypeURL = "types.googleapis.com/google.protobuf.Value" - - zeroValueMap = map[string]proto.Message{ - "google.protobuf.Any": &anypb.Any{TypeUrl: jsonValueTypeURL}, - "google.protobuf.Duration": &dpb.Duration{}, - "google.protobuf.ListValue": &structpb.ListValue{}, - "google.protobuf.Struct": &structpb.Struct{}, - "google.protobuf.Timestamp": &tpb.Timestamp{}, - "google.protobuf.Value": &structpb.Value{}, - "google.protobuf.BoolValue": wrapperspb.Bool(false), - "google.protobuf.BytesValue": wrapperspb.Bytes([]byte{}), - "google.protobuf.DoubleValue": wrapperspb.Double(0.0), - "google.protobuf.FloatValue": wrapperspb.Float(0.0), - "google.protobuf.Int32Value": wrapperspb.Int32(0), - "google.protobuf.Int64Value": wrapperspb.Int64(0), - "google.protobuf.StringValue": wrapperspb.String(""), - "google.protobuf.UInt32Value": wrapperspb.UInt32(0), - "google.protobuf.UInt64Value": wrapperspb.UInt64(0), - } -) diff --git a/vendor/github.com/google/cel-go/common/types/provider.go b/vendor/github.com/google/cel-go/common/types/provider.go deleted file mode 100644 index 936a4e28b..000000000 --- a/vendor/github.com/google/cel-go/common/types/provider.go +++ /dev/null @@ -1,766 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "time" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "github.com/google/cel-go/common/types/pb" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" - anypb "google.golang.org/protobuf/types/known/anypb" - dpb "google.golang.org/protobuf/types/known/durationpb" - structpb "google.golang.org/protobuf/types/known/structpb" - tpb "google.golang.org/protobuf/types/known/timestamppb" -) - -// Adapter converts native Go values of varying type and complexity to equivalent CEL values. -type Adapter = ref.TypeAdapter - -// Provider specifies functions for creating new object instances and for resolving -// enum values by name. -type Provider interface { - // EnumValue returns the numeric value of the given enum value name. - EnumValue(enumName string) ref.Val - - // FindIdent takes a qualified identifier name and returns a ref.Val if one exists. - FindIdent(identName string) (ref.Val, bool) - - // FindStructType returns the Type give a qualified type name. - // - // For historical reasons, only struct types are expected to be returned through this - // method, and the type values are expected to be wrapped in a TypeType instance using - // TypeTypeWithParam(). - // - // Returns false if not found. - FindStructType(structType string) (*Type, bool) - - // FindStructFieldNames returns thet field names associated with the type, if the type - // is found. - FindStructFieldNames(structType string) ([]string, bool) - - // FieldStructFieldType returns the field type for a checked type value. Returns - // false if the field could not be found. - FindStructFieldType(structType, fieldName string) (*FieldType, bool) - - // NewValue creates a new type value from a qualified name and map of field - // name to value. - // - // Note, for each value, the Val.ConvertToNative function will be invoked - // to convert the Val to the field's native type. If an error occurs during - // conversion, the NewValue will be a types.Err. - NewValue(structType string, fields map[string]ref.Val) ref.Val -} - -// FieldType represents a field's type value and whether that field supports presence detection. -type FieldType struct { - // Type of the field as a CEL native type value. - Type *Type - - // IsSet indicates whether the field is set on an input object. - IsSet ref.FieldTester - - // GetFrom retrieves the field value on the input object, if set. - GetFrom ref.FieldGetter -} - -// Registry provides type information for a set of registered types. -type Registry struct { - revTypeMap map[string]*Type - pbdb *pb.Db -} - -// NewRegistry accepts a list of proto message instances and returns a type -// provider which can create new instances of the provided message or any -// message that proto depends upon in its FileDescriptor. -func NewRegistry(types ...proto.Message) (*Registry, error) { - p := &Registry{ - revTypeMap: make(map[string]*Type), - pbdb: pb.NewDb(), - } - err := p.RegisterType( - BoolType, - BytesType, - DoubleType, - DurationType, - IntType, - ListType, - MapType, - NullType, - StringType, - TimestampType, - TypeType, - UintType) - if err != nil { - return nil, err - } - // This block ensures that the well-known protobuf types are registered by default. - for _, fd := range p.pbdb.FileDescriptions() { - err = p.registerAllTypes(fd) - if err != nil { - return nil, err - } - } - for _, msgType := range types { - err = p.RegisterMessage(msgType) - if err != nil { - return nil, err - } - } - return p, nil -} - -// NewEmptyRegistry returns a registry which is completely unconfigured. -func NewEmptyRegistry() *Registry { - return &Registry{ - revTypeMap: make(map[string]*Type), - pbdb: pb.NewDb(), - } -} - -// Copy copies the current state of the registry into its own memory space. -func (p *Registry) Copy() *Registry { - copy := &Registry{ - revTypeMap: make(map[string]*Type), - pbdb: p.pbdb.Copy(), - } - for k, v := range p.revTypeMap { - copy.revTypeMap[k] = v - } - return copy -} - -// EnumValue returns the numeric value of the given enum value name. -func (p *Registry) EnumValue(enumName string) ref.Val { - enumVal, found := p.pbdb.DescribeEnum(enumName) - if !found { - return NewErr("unknown enum name '%s'", enumName) - } - return Int(enumVal.Value()) -} - -// FindFieldType returns the field type for a checked type value. Returns false if -// the field could not be found. -// -// Deprecated: use FindStructFieldType -func (p *Registry) FindFieldType(structType, fieldName string) (*ref.FieldType, bool) { - msgType, found := p.pbdb.DescribeType(structType) - if !found { - return nil, false - } - field, found := msgType.FieldByName(fieldName) - if !found { - return nil, false - } - return &ref.FieldType{ - Type: field.CheckedType(), - IsSet: field.IsSet, - GetFrom: field.GetFrom}, true -} - -// FindStructFieldNames returns the set of field names for the given struct type, -// if the type exists in the registry. -func (p *Registry) FindStructFieldNames(structType string) ([]string, bool) { - msgType, found := p.pbdb.DescribeType(structType) - if !found { - return []string{}, false - } - fieldMap := msgType.FieldMap() - fields := make([]string, len(fieldMap)) - idx := 0 - for f := range fieldMap { - fields[idx] = f - idx++ - } - return fields, true -} - -// FindStructFieldType returns the field type for a checked type value. Returns -// false if the field could not be found. -func (p *Registry) FindStructFieldType(structType, fieldName string) (*FieldType, bool) { - msgType, found := p.pbdb.DescribeType(structType) - if !found { - return nil, false - } - field, found := msgType.FieldByName(fieldName) - if !found { - return nil, false - } - return &FieldType{ - Type: fieldDescToCELType(field), - IsSet: field.IsSet, - GetFrom: field.GetFrom}, true -} - -// FindIdent takes a qualified identifier name and returns a ref.Val if one exists. -func (p *Registry) FindIdent(identName string) (ref.Val, bool) { - if t, found := p.revTypeMap[identName]; found { - return t, true - } - if enumVal, found := p.pbdb.DescribeEnum(identName); found { - return Int(enumVal.Value()), true - } - return nil, false -} - -// FindType looks up the Type given a qualified typeName. Returns false if not found. -// -// Deprecated: use FindStructType -func (p *Registry) FindType(structType string) (*exprpb.Type, bool) { - if _, found := p.pbdb.DescribeType(structType); !found { - return nil, false - } - if structType != "" && structType[0] == '.' { - structType = structType[1:] - } - return &exprpb.Type{ - TypeKind: &exprpb.Type_Type{ - Type: &exprpb.Type{ - TypeKind: &exprpb.Type_MessageType{ - MessageType: structType}}}}, true -} - -// FindStructType returns the Type give a qualified type name. -// -// For historical reasons, only struct types are expected to be returned through this -// method, and the type values are expected to be wrapped in a TypeType instance using -// TypeTypeWithParam(). -// -// Returns false if not found. -func (p *Registry) FindStructType(structType string) (*Type, bool) { - if _, found := p.pbdb.DescribeType(structType); !found { - return nil, false - } - if structType != "" && structType[0] == '.' { - structType = structType[1:] - } - return NewTypeTypeWithParam(NewObjectType(structType)), true -} - -// NewValue creates a new type value from a qualified name and map of field -// name to value. -// -// Note, for each value, the Val.ConvertToNative function will be invoked -// to convert the Val to the field's native type. If an error occurs during -// conversion, the NewValue will be a types.Err. -func (p *Registry) NewValue(structType string, fields map[string]ref.Val) ref.Val { - td, found := p.pbdb.DescribeType(structType) - if !found { - return NewErr("unknown type '%s'", structType) - } - msg := td.New() - fieldMap := td.FieldMap() - for name, value := range fields { - field, found := fieldMap[name] - if !found { - return NewErr("no such field: %s", name) - } - err := msgSetField(msg, field, value) - if err != nil { - return &Err{error: err} - } - } - return p.NativeToValue(msg.Interface()) -} - -// RegisterDescriptor registers the contents of a protocol buffer `FileDescriptor`. -func (p *Registry) RegisterDescriptor(fileDesc protoreflect.FileDescriptor) error { - fd, err := p.pbdb.RegisterDescriptor(fileDesc) - if err != nil { - return err - } - return p.registerAllTypes(fd) -} - -// RegisterMessage registers a protocol buffer message and its dependencies. -func (p *Registry) RegisterMessage(message proto.Message) error { - fd, err := p.pbdb.RegisterMessage(message) - if err != nil { - return err - } - return p.registerAllTypes(fd) -} - -// RegisterType registers a type value with the provider which ensures the provider is aware of how to -// map the type to an identifier. -// -// If the `ref.Type` value is a `*types.Type` it will be registered directly by its runtime type name. -// If the `ref.Type` value is not a `*types.Type` instance, a `*types.Type` instance which reflects the -// traits present on the input and the runtime type name. By default this foreign type will be treated -// as a types.StructKind. To avoid potential issues where the `ref.Type` values does not match the -// generated `*types.Type` instance, consider always using the `*types.Type` to represent type extensions -// to CEL, even when they're not based on protobuf types. -func (p *Registry) RegisterType(types ...ref.Type) error { - for _, t := range types { - celType := maybeForeignType(t) - existing, found := p.revTypeMap[t.TypeName()] - if !found { - p.revTypeMap[t.TypeName()] = celType - continue - } - if !existing.IsEquivalentType(celType) { - return fmt.Errorf("type registration conflict. found: %v, input: %v", existing, celType) - } - if existing.traitMask != celType.traitMask { - return fmt.Errorf( - "type registered with conflicting traits: %v with traits %v, input: %v", - existing.TypeName(), existing.traitMask, celType.traitMask) - } - } - return nil -} - -// NativeToValue converts various "native" types to ref.Val with this specific implementation -// providing support for custom proto-based types. -// -// This method should be the inverse of ref.Val.ConvertToNative. -func (p *Registry) NativeToValue(value any) ref.Val { - if val, found := nativeToValue(p, value); found { - return val - } - switch v := value.(type) { - case proto.Message: - typeName := string(v.ProtoReflect().Descriptor().FullName()) - td, found := p.pbdb.DescribeType(typeName) - if !found { - return NewErr("unknown type: '%s'", typeName) - } - unwrapped, isUnwrapped, err := td.MaybeUnwrap(v) - if err != nil { - return UnsupportedRefValConversionErr(v) - } - if isUnwrapped { - return p.NativeToValue(unwrapped) - } - typeVal, found := p.FindIdent(typeName) - if !found { - return NewErr("unknown type: '%s'", typeName) - } - return NewObject(p, td, typeVal, v) - case *pb.Map: - return NewProtoMap(p, v) - case protoreflect.List: - return NewProtoList(p, v) - case protoreflect.Message: - return p.NativeToValue(v.Interface()) - case protoreflect.Value: - return p.NativeToValue(v.Interface()) - } - return UnsupportedRefValConversionErr(value) -} - -func (p *Registry) registerAllTypes(fd *pb.FileDescription) error { - for _, typeName := range fd.GetTypeNames() { - // skip well-known type names since they're automatically sanitized - // during NewObjectType() calls. - if _, found := checkedWellKnowns[typeName]; found { - continue - } - err := p.RegisterType(NewObjectTypeValue(typeName)) - if err != nil { - return err - } - } - return nil -} - -func fieldDescToCELType(field *pb.FieldDescription) *Type { - if field.IsMap() { - return NewMapType( - singularFieldDescToCELType(field.KeyType), - singularFieldDescToCELType(field.ValueType)) - } - if field.IsList() { - return NewListType(singularFieldDescToCELType(field)) - } - return singularFieldDescToCELType(field) -} - -func singularFieldDescToCELType(field *pb.FieldDescription) *Type { - if field.IsMessage() { - return NewObjectType(string(field.Descriptor().Message().FullName())) - } - if field.IsEnum() { - return IntType - } - return ProtoCELPrimitives[field.ProtoKind()] -} - -// defaultTypeAdapter converts go native types to CEL values. -type defaultTypeAdapter struct{} - -var ( - // DefaultTypeAdapter adapts canonical CEL types from their equivalent Go values. - DefaultTypeAdapter = &defaultTypeAdapter{} -) - -// NativeToValue implements the ref.TypeAdapter interface. -func (a *defaultTypeAdapter) NativeToValue(value any) ref.Val { - if val, found := nativeToValue(a, value); found { - return val - } - return UnsupportedRefValConversionErr(value) -} - -// nativeToValue returns the converted (ref.Val, true) of a conversion is found, -// otherwise (nil, false) -func nativeToValue(a Adapter, value any) (ref.Val, bool) { - switch v := value.(type) { - case nil: - return NullValue, true - case *Bool: - if v != nil { - return *v, true - } - case *Bytes: - if v != nil { - return *v, true - } - case *Double: - if v != nil { - return *v, true - } - case *Int: - if v != nil { - return *v, true - } - case *String: - if v != nil { - return *v, true - } - case *Uint: - if v != nil { - return *v, true - } - case bool: - return Bool(v), true - case int: - return Int(v), true - case int32: - return Int(v), true - case int64: - return Int(v), true - case uint: - return Uint(v), true - case uint32: - return Uint(v), true - case uint64: - return Uint(v), true - case float32: - return Double(v), true - case float64: - return Double(v), true - case string: - return String(v), true - case *dpb.Duration: - return Duration{Duration: v.AsDuration()}, true - case time.Duration: - return Duration{Duration: v}, true - case *tpb.Timestamp: - return Timestamp{Time: v.AsTime()}, true - case time.Time: - return Timestamp{Time: v}, true - case *bool: - if v != nil { - return Bool(*v), true - } - case *float32: - if v != nil { - return Double(*v), true - } - case *float64: - if v != nil { - return Double(*v), true - } - case *int: - if v != nil { - return Int(*v), true - } - case *int32: - if v != nil { - return Int(*v), true - } - case *int64: - if v != nil { - return Int(*v), true - } - case *string: - if v != nil { - return String(*v), true - } - case *uint: - if v != nil { - return Uint(*v), true - } - case *uint32: - if v != nil { - return Uint(*v), true - } - case *uint64: - if v != nil { - return Uint(*v), true - } - case []byte: - return Bytes(v), true - // specializations for common lists types. - case []string: - return NewStringList(a, v), true - case []ref.Val: - return NewRefValList(a, v), true - // specializations for common map types. - case map[string]string: - return NewStringStringMap(a, v), true - case map[string]any: - return NewStringInterfaceMap(a, v), true - case map[ref.Val]ref.Val: - return NewRefValMap(a, v), true - // additional specializations may be added upon request / need. - case *anypb.Any: - if v == nil { - return UnsupportedRefValConversionErr(v), true - } - unpackedAny, err := v.UnmarshalNew() - if err != nil { - return NewErr("anypb.UnmarshalNew() failed for type %q: %v", v.GetTypeUrl(), err), true - } - return a.NativeToValue(unpackedAny), true - case *structpb.NullValue, structpb.NullValue: - return NullValue, true - case *structpb.ListValue: - return NewJSONList(a, v), true - case *structpb.Struct: - return NewJSONStruct(a, v), true - case ref.Val: - return v, true - case protoreflect.EnumNumber: - return Int(v), true - case proto.Message: - if v == nil { - return UnsupportedRefValConversionErr(v), true - } - typeName := string(v.ProtoReflect().Descriptor().FullName()) - td, found := pb.DefaultDb.DescribeType(typeName) - if !found { - return nil, false - } - val, unwrapped, err := td.MaybeUnwrap(v) - if err != nil { - return UnsupportedRefValConversionErr(v), true - } - if !unwrapped { - return nil, false - } - return a.NativeToValue(val), true - // Note: dynamicpb.Message implements the proto.Message _and_ protoreflect.Message interfaces - // which means that this case must appear after handling a proto.Message type. - case protoreflect.Message: - return a.NativeToValue(v.Interface()), true - default: - refValue := reflect.ValueOf(v) - if refValue.Kind() == reflect.Ptr { - if refValue.IsNil() { - return UnsupportedRefValConversionErr(v), true - } - refValue = refValue.Elem() - } - refKind := refValue.Kind() - switch refKind { - case reflect.Array, reflect.Slice: - if refValue.Type().Elem() == reflect.TypeOf(byte(0)) { - if refValue.CanAddr() { - return Bytes(refValue.Bytes()), true - } - tmp := reflect.New(refValue.Type()) - tmp.Elem().Set(refValue) - return Bytes(tmp.Elem().Bytes()), true - } - return NewDynamicList(a, v), true - case reflect.Map: - return NewDynamicMap(a, v), true - // type aliases of primitive types cannot be asserted as that type, but rather need - // to be downcast to int32 before being converted to a CEL representation. - case reflect.Bool: - boolTupe := reflect.TypeOf(false) - return Bool(refValue.Convert(boolTupe).Interface().(bool)), true - case reflect.Int: - intType := reflect.TypeOf(int(0)) - return Int(refValue.Convert(intType).Interface().(int)), true - case reflect.Int8: - intType := reflect.TypeOf(int8(0)) - return Int(refValue.Convert(intType).Interface().(int8)), true - case reflect.Int16: - intType := reflect.TypeOf(int16(0)) - return Int(refValue.Convert(intType).Interface().(int16)), true - case reflect.Int32: - intType := reflect.TypeOf(int32(0)) - return Int(refValue.Convert(intType).Interface().(int32)), true - case reflect.Int64: - intType := reflect.TypeOf(int64(0)) - return Int(refValue.Convert(intType).Interface().(int64)), true - case reflect.Uint: - uintType := reflect.TypeOf(uint(0)) - return Uint(refValue.Convert(uintType).Interface().(uint)), true - case reflect.Uint8: - uintType := reflect.TypeOf(uint8(0)) - return Uint(refValue.Convert(uintType).Interface().(uint8)), true - case reflect.Uint16: - uintType := reflect.TypeOf(uint16(0)) - return Uint(refValue.Convert(uintType).Interface().(uint16)), true - case reflect.Uint32: - uintType := reflect.TypeOf(uint32(0)) - return Uint(refValue.Convert(uintType).Interface().(uint32)), true - case reflect.Uint64: - uintType := reflect.TypeOf(uint64(0)) - return Uint(refValue.Convert(uintType).Interface().(uint64)), true - case reflect.Float32: - doubleType := reflect.TypeOf(float32(0)) - return Double(refValue.Convert(doubleType).Interface().(float32)), true - case reflect.Float64: - doubleType := reflect.TypeOf(float64(0)) - return Double(refValue.Convert(doubleType).Interface().(float64)), true - case reflect.String: - stringType := reflect.TypeOf("") - return String(refValue.Convert(stringType).Interface().(string)), true - } - } - return nil, false -} - -func msgSetField(target protoreflect.Message, field *pb.FieldDescription, val ref.Val) error { - if field.IsList() { - lv := target.NewField(field.Descriptor()) - list, ok := val.(traits.Lister) - if !ok { - return unsupportedTypeConversionError(field, val) - } - err := msgSetListField(lv.List(), field, list) - if err != nil { - return err - } - target.Set(field.Descriptor(), lv) - return nil - } - if field.IsMap() { - mv := target.NewField(field.Descriptor()) - mp, ok := val.(traits.Mapper) - if !ok { - return unsupportedTypeConversionError(field, val) - } - err := msgSetMapField(mv.Map(), field, mp) - if err != nil { - return err - } - target.Set(field.Descriptor(), mv) - return nil - } - v, err := val.ConvertToNative(field.ReflectType()) - if err != nil { - return fieldTypeConversionError(field, err) - } - if v == nil { - return nil - } - switch pv := v.(type) { - case proto.Message: - v = pv.ProtoReflect() - } - target.Set(field.Descriptor(), protoreflect.ValueOf(v)) - return nil -} - -func msgSetListField(target protoreflect.List, listField *pb.FieldDescription, listVal traits.Lister) error { - elemReflectType := listField.ReflectType().Elem() - for i := Int(0); i < listVal.Size().(Int); i++ { - elem := listVal.Get(i) - elemVal, err := elem.ConvertToNative(elemReflectType) - if err != nil { - return fieldTypeConversionError(listField, err) - } - if elemVal == nil { - continue - } - switch ev := elemVal.(type) { - case proto.Message: - elemVal = ev.ProtoReflect() - } - target.Append(protoreflect.ValueOf(elemVal)) - } - return nil -} - -func msgSetMapField(target protoreflect.Map, mapField *pb.FieldDescription, mapVal traits.Mapper) error { - targetKeyType := mapField.KeyType.ReflectType() - targetValType := mapField.ValueType.ReflectType() - it := mapVal.Iterator() - for it.HasNext() == True { - key := it.Next() - val := mapVal.Get(key) - k, err := key.ConvertToNative(targetKeyType) - if err != nil { - return fieldTypeConversionError(mapField, err) - } - v, err := val.ConvertToNative(targetValType) - if err != nil { - return fieldTypeConversionError(mapField, err) - } - if v == nil { - continue - } - switch pv := v.(type) { - case proto.Message: - v = pv.ProtoReflect() - } - target.Set(protoreflect.ValueOf(k).MapKey(), protoreflect.ValueOf(v)) - } - return nil -} - -func unsupportedTypeConversionError(field *pb.FieldDescription, val ref.Val) error { - msgName := field.Descriptor().ContainingMessage().FullName() - return fmt.Errorf("unsupported field type for %v.%v: %v", msgName, field.Name(), val.Type()) -} - -func fieldTypeConversionError(field *pb.FieldDescription, err error) error { - msgName := field.Descriptor().ContainingMessage().FullName() - return fmt.Errorf("field type conversion error for %v.%v value type: %v", msgName, field.Name(), err) -} - -var ( - // ProtoCELPrimitives provides a map from the protoreflect Kind to the equivalent CEL type. - ProtoCELPrimitives = map[protoreflect.Kind]*Type{ - protoreflect.BoolKind: BoolType, - protoreflect.BytesKind: BytesType, - protoreflect.DoubleKind: DoubleType, - protoreflect.FloatKind: DoubleType, - protoreflect.Int32Kind: IntType, - protoreflect.Int64Kind: IntType, - protoreflect.Sint32Kind: IntType, - protoreflect.Sint64Kind: IntType, - protoreflect.Uint32Kind: UintType, - protoreflect.Uint64Kind: UintType, - protoreflect.Fixed32Kind: UintType, - protoreflect.Fixed64Kind: UintType, - protoreflect.Sfixed32Kind: IntType, - protoreflect.Sfixed64Kind: IntType, - protoreflect.StringKind: StringType, - } -) diff --git a/vendor/github.com/google/cel-go/common/types/ref/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/ref/BUILD.bazel deleted file mode 100644 index 79330c332..000000000 --- a/vendor/github.com/google/cel-go/common/types/ref/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "provider.go", - "reference.go", - ], - importpath = "github.com/google/cel-go/common/types/ref", - deps = [ - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/types/ref/provider.go b/vendor/github.com/google/cel-go/common/types/ref/provider.go deleted file mode 100644 index b9820023d..000000000 --- a/vendor/github.com/google/cel-go/common/types/ref/provider.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ref - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// TypeProvider specifies functions for creating new object instances and for -// resolving enum values by name. -// -// Deprecated: use types.Provider -type TypeProvider interface { - // EnumValue returns the numeric value of the given enum value name. - EnumValue(enumName string) Val - - // FindIdent takes a qualified identifier name and returns a Value if one exists. - FindIdent(identName string) (Val, bool) - - // FindType looks up the Type given a qualified typeName. Returns false if not found. - FindType(typeName string) (*exprpb.Type, bool) - - // FieldFieldType returns the field type for a checked type value. Returns false if - // the field could not be found. - FindFieldType(messageType, fieldName string) (*FieldType, bool) - - // NewValue creates a new type value from a qualified name and map of field name - // to value. - // - // Note, for each value, the Val.ConvertToNative function will be invoked to convert - // the Val to the field's native type. If an error occurs during conversion, the - // NewValue will be a types.Err. - NewValue(typeName string, fields map[string]Val) Val -} - -// TypeAdapter converts native Go values of varying type and complexity to equivalent CEL values. -// -// Deprecated: use types.Adapter -type TypeAdapter interface { - // NativeToValue converts the input `value` to a CEL `ref.Val`. - NativeToValue(value any) Val -} - -// TypeRegistry allows third-parties to add custom types to CEL. Not all `TypeProvider` -// implementations support type-customization, so these features are optional. However, a -// `TypeRegistry` should be a `TypeProvider` and a `TypeAdapter` to ensure that types -// which are registered can be converted to CEL representations. -// -// Deprecated: use types.Registry -type TypeRegistry interface { - TypeAdapter - TypeProvider - - // RegisterDescriptor registers the contents of a protocol buffer `FileDescriptor`. - RegisterDescriptor(fileDesc protoreflect.FileDescriptor) error - - // RegisterMessage registers a protocol buffer message and its dependencies. - RegisterMessage(message proto.Message) error - - // RegisterType registers a type value with the provider which ensures the - // provider is aware of how to map the type to an identifier. - // - // If a type is provided more than once with an alternative definition, the - // call will result in an error. - RegisterType(types ...Type) error -} - -// FieldType represents a field's type value and whether that field supports -// presence detection. -// -// Deprecated: use types.FieldType -type FieldType struct { - // Type of the field as a protobuf type value. - Type *exprpb.Type - - // IsSet indicates whether the field is set on an input object. - IsSet FieldTester - - // GetFrom retrieves the field value on the input object, if set. - GetFrom FieldGetter -} - -// FieldTester is used to test field presence on an input object. -type FieldTester func(target any) bool - -// FieldGetter is used to get the field value from an input object, if set. -type FieldGetter func(target any) (any, error) diff --git a/vendor/github.com/google/cel-go/common/types/ref/reference.go b/vendor/github.com/google/cel-go/common/types/ref/reference.go deleted file mode 100644 index e0d58145c..000000000 --- a/vendor/github.com/google/cel-go/common/types/ref/reference.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ref contains the reference interfaces used throughout the types components. -package ref - -import ( - "reflect" -) - -// Type interface indicate the name of a given type. -type Type interface { - // HasTrait returns whether the type has a given trait associated with it. - // - // See common/types/traits/traits.go for a list of supported traits. - HasTrait(trait int) bool - - // TypeName returns the qualified type name of the type. - // - // The type name is also used as the type's identifier name at type-check and interpretation time. - TypeName() string -} - -// Val interface defines the functions supported by all expression values. -// Val implementations may specialize the behavior of the value through the addition of traits. -type Val interface { - // ConvertToNative converts the Value to a native Go struct according to the - // reflected type description, or error if the conversion is not feasible. - // - // The ConvertToNative method is intended to be used to support conversion between CEL types - // and native types during object creation expressions or by clients who need to adapt the, - // returned CEL value into an equivalent Go value instance. - // - // When implementing or using ConvertToNative, the following guidelines apply: - // - Use ConvertToNative when marshalling CEL evaluation results to native types. - // - Do not use ConvertToNative within CEL extension functions. - // - Document whether your implementation supports non-CEL field types, such as Go or Protobuf. - ConvertToNative(typeDesc reflect.Type) (any, error) - - // ConvertToType supports type conversions between CEL value types supported by the expression language. - ConvertToType(typeValue Type) Val - - // Equal returns true if the `other` value has the same type and content as the implementing struct. - Equal(other Val) Val - - // Type returns the TypeValue of the value. - Type() Type - - // Value returns the raw value of the instance which may not be directly compatible with the expression - // language types. - Value() any -} diff --git a/vendor/github.com/google/cel-go/common/types/string.go b/vendor/github.com/google/cel-go/common/types/string.go deleted file mode 100644 index 8aad4701c..000000000 --- a/vendor/github.com/google/cel-go/common/types/string.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "regexp" - "strconv" - "strings" - "time" - - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// String type implementation which supports addition, comparison, matching, -// and size functions. -type String string - -var ( - stringOneArgOverloads = map[string]func(ref.Val, ref.Val) ref.Val{ - overloads.Contains: StringContains, - overloads.EndsWith: StringEndsWith, - overloads.StartsWith: StringStartsWith, - } - - stringWrapperType = reflect.TypeOf(&wrapperspb.StringValue{}) -) - -// Add implements traits.Adder.Add. -func (s String) Add(other ref.Val) ref.Val { - otherString, ok := other.(String) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - return s + otherString -} - -// Compare implements traits.Comparer.Compare. -func (s String) Compare(other ref.Val) ref.Val { - otherString, ok := other.(String) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - return Int(strings.Compare(s.Value().(string), otherString.Value().(string))) -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (s String) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.String: - return reflect.ValueOf(s).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped before being set on an Any field. - return anypb.New(wrapperspb.String(string(s))) - case jsonValueType: - // Convert to a protobuf representation of a JSON String. - return structpb.NewStringValue(string(s)), nil - case stringWrapperType: - // Convert to a wrapperspb.StringValue. - return wrapperspb.String(string(s)), nil - } - if typeDesc.Elem().Kind() == reflect.String { - p := s.Value().(string) - return &p, nil - } - case reflect.Interface: - sv := s.Value() - if reflect.TypeOf(sv).Implements(typeDesc) { - return sv, nil - } - if reflect.TypeOf(s).Implements(typeDesc) { - return s, nil - } - } - return nil, fmt.Errorf( - "unsupported native conversion from string to '%v'", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (s String) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case IntType: - if n, err := strconv.ParseInt(s.Value().(string), 10, 64); err == nil { - return Int(n) - } - case UintType: - if n, err := strconv.ParseUint(s.Value().(string), 10, 64); err == nil { - return Uint(n) - } - case DoubleType: - if n, err := strconv.ParseFloat(s.Value().(string), 64); err == nil { - return Double(n) - } - case BoolType: - if b, err := strconv.ParseBool(s.Value().(string)); err == nil { - return Bool(b) - } - case BytesType: - return Bytes(s) - case DurationType: - if d, err := time.ParseDuration(s.Value().(string)); err == nil { - return durationOf(d) - } - case TimestampType: - if t, err := time.Parse(time.RFC3339, s.Value().(string)); err == nil { - if t.Unix() < minUnixTime || t.Unix() > maxUnixTime { - return celErrTimestampOverflow - } - return timestampOf(t) - } - case StringType: - return s - case TypeType: - return StringType - } - return NewErr("type conversion error from '%s' to '%s'", StringType, typeVal) -} - -// Equal implements ref.Val.Equal. -func (s String) Equal(other ref.Val) ref.Val { - otherString, ok := other.(String) - return Bool(ok && s == otherString) -} - -// IsZeroValue returns true if the string is empty. -func (s String) IsZeroValue() bool { - return len(s) == 0 -} - -// Match implements traits.Matcher.Match. -func (s String) Match(pattern ref.Val) ref.Val { - pat, ok := pattern.(String) - if !ok { - return MaybeNoSuchOverloadErr(pattern) - } - matched, err := regexp.MatchString(pat.Value().(string), s.Value().(string)) - if err != nil { - return &Err{error: err} - } - return Bool(matched) -} - -// Receive implements traits.Receiver.Receive. -func (s String) Receive(function string, overload string, args []ref.Val) ref.Val { - switch len(args) { - case 1: - if f, found := stringOneArgOverloads[function]; found { - return f(s, args[0]) - } - } - return NoSuchOverloadErr() -} - -// Size implements traits.Sizer.Size. -func (s String) Size() ref.Val { - return Int(len([]rune(s.Value().(string)))) -} - -// Type implements ref.Val.Type. -func (s String) Type() ref.Type { - return StringType -} - -// Value implements ref.Val.Value. -func (s String) Value() any { - return string(s) -} - -func (s String) format(sb *strings.Builder) { - sb.WriteString(strconv.Quote(string(s))) -} - -// StringContains returns whether the string contains a substring. -func StringContains(s, sub ref.Val) ref.Val { - str, ok := s.(String) - if !ok { - return MaybeNoSuchOverloadErr(s) - } - subStr, ok := sub.(String) - if !ok { - return MaybeNoSuchOverloadErr(sub) - } - return Bool(strings.Contains(string(str), string(subStr))) -} - -// StringEndsWith returns whether the target string contains the input suffix. -func StringEndsWith(s, suf ref.Val) ref.Val { - str, ok := s.(String) - if !ok { - return MaybeNoSuchOverloadErr(s) - } - sufStr, ok := suf.(String) - if !ok { - return MaybeNoSuchOverloadErr(suf) - } - return Bool(strings.HasSuffix(string(str), string(sufStr))) -} - -// StringStartsWith returns whether the target string contains the input prefix. -func StringStartsWith(s, pre ref.Val) ref.Val { - str, ok := s.(String) - if !ok { - return MaybeNoSuchOverloadErr(s) - } - preStr, ok := pre.(String) - if !ok { - return MaybeNoSuchOverloadErr(pre) - } - return Bool(strings.HasPrefix(string(str), string(preStr))) -} diff --git a/vendor/github.com/google/cel-go/common/types/timestamp.go b/vendor/github.com/google/cel-go/common/types/timestamp.go deleted file mode 100644 index f7be58591..000000000 --- a/vendor/github.com/google/cel-go/common/types/timestamp.go +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strconv" - "strings" - "time" - - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - tpb "google.golang.org/protobuf/types/known/timestamppb" -) - -// Timestamp type implementation which supports add, compare, and subtract -// operations. Timestamps are also capable of participating in dynamic -// function dispatch to instance methods. -type Timestamp struct { - time.Time -} - -func timestampOf(t time.Time) Timestamp { - // Note that this function does not validate that time.Time is in our supported range. - return Timestamp{Time: t} -} - -const ( - // The number of seconds between year 1 and year 1970. This is borrowed from - // https://golang.org/src/time/time.go. - unixToInternal int64 = (1969*365 + 1969/4 - 1969/100 + 1969/400) * (60 * 60 * 24) - - // Number of seconds between `0001-01-01T00:00:00Z` and the Unix epoch. - minUnixTime int64 = -62135596800 - // Number of seconds between `9999-12-31T23:59:59.999999999Z` and the Unix epoch. - maxUnixTime int64 = 253402300799 -) - -// Add implements traits.Adder.Add. -func (t Timestamp) Add(other ref.Val) ref.Val { - switch other.Type() { - case DurationType: - return other.(Duration).Add(t) - } - return MaybeNoSuchOverloadErr(other) -} - -// Compare implements traits.Comparer.Compare. -func (t Timestamp) Compare(other ref.Val) ref.Val { - if TimestampType != other.Type() { - return MaybeNoSuchOverloadErr(other) - } - ts1 := t.Time - ts2 := other.(Timestamp).Time - switch { - case ts1.Before(ts2): - return IntNegOne - case ts1.After(ts2): - return IntOne - default: - return IntZero - } -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (t Timestamp) ConvertToNative(typeDesc reflect.Type) (any, error) { - // If the timestamp is already assignable to the desired type return it. - if reflect.TypeOf(t.Time).AssignableTo(typeDesc) { - return t.Time, nil - } - if reflect.TypeOf(t).AssignableTo(typeDesc) { - return t, nil - } - switch typeDesc { - case anyValueType: - // Pack the underlying time as a tpb.Timestamp into an Any value. - return anypb.New(tpb.New(t.Time)) - case jsonValueType: - // CEL follows the proto3 to JSON conversion which formats as an RFC 3339 encoded JSON - // string. - v := t.ConvertToType(StringType) - if IsError(v) { - return nil, v.(*Err) - } - return structpb.NewStringValue(string(v.(String))), nil - case timestampValueType: - // Unwrap the underlying tpb.Timestamp. - return tpb.New(t.Time), nil - } - return nil, fmt.Errorf("type conversion error from 'Timestamp' to '%v'", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (t Timestamp) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case StringType: - return String(t.Format(time.RFC3339Nano)) - case IntType: - // Return the Unix time in seconds since 1970 - return Int(t.Unix()) - case TimestampType: - return t - case TypeType: - return TimestampType - } - return NewErr("type conversion error from '%s' to '%s'", TimestampType, typeVal) -} - -// Equal implements ref.Val.Equal. -func (t Timestamp) Equal(other ref.Val) ref.Val { - otherTime, ok := other.(Timestamp) - return Bool(ok && t.Time.Equal(otherTime.Time)) -} - -// IsZeroValue returns true if the timestamp is epoch 0. -func (t Timestamp) IsZeroValue() bool { - return t.IsZero() -} - -// Receive implements traits.Receiver.Receive. -func (t Timestamp) Receive(function string, overload string, args []ref.Val) ref.Val { - switch len(args) { - case 0: - if f, found := timestampZeroArgOverloads[function]; found { - return f(t.Time) - } - case 1: - if f, found := timestampOneArgOverloads[function]; found { - return f(t.Time, args[0]) - } - } - return NoSuchOverloadErr() -} - -// Subtract implements traits.Subtractor.Subtract. -func (t Timestamp) Subtract(subtrahend ref.Val) ref.Val { - switch subtrahend.Type() { - case DurationType: - dur := subtrahend.(Duration) - val, err := subtractTimeDurationChecked(t.Time, dur.Duration) - if err != nil { - return WrapErr(err) - } - return timestampOf(val) - case TimestampType: - t2 := subtrahend.(Timestamp).Time - val, err := subtractTimeChecked(t.Time, t2) - if err != nil { - return WrapErr(err) - } - return durationOf(val) - } - return MaybeNoSuchOverloadErr(subtrahend) -} - -// Type implements ref.Val.Type. -func (t Timestamp) Type() ref.Type { - return TimestampType -} - -// Value implements ref.Val.Value. -func (t Timestamp) Value() any { - return t.Time -} - -func (t Timestamp) format(sb *strings.Builder) { - fmt.Fprintf(sb, `timestamp("%s")`, t.Time.UTC().Format(time.RFC3339Nano)) -} - -var ( - timestampValueType = reflect.TypeOf(&tpb.Timestamp{}) - - timestampZeroArgOverloads = map[string]func(time.Time) ref.Val{ - overloads.TimeGetFullYear: timestampGetFullYear, - overloads.TimeGetMonth: timestampGetMonth, - overloads.TimeGetDayOfYear: timestampGetDayOfYear, - overloads.TimeGetDate: timestampGetDayOfMonthOneBased, - overloads.TimeGetDayOfMonth: timestampGetDayOfMonthZeroBased, - overloads.TimeGetDayOfWeek: timestampGetDayOfWeek, - overloads.TimeGetHours: timestampGetHours, - overloads.TimeGetMinutes: timestampGetMinutes, - overloads.TimeGetSeconds: timestampGetSeconds, - overloads.TimeGetMilliseconds: timestampGetMilliseconds} - - timestampOneArgOverloads = map[string]func(time.Time, ref.Val) ref.Val{ - overloads.TimeGetFullYear: timestampGetFullYearWithTz, - overloads.TimeGetMonth: timestampGetMonthWithTz, - overloads.TimeGetDayOfYear: timestampGetDayOfYearWithTz, - overloads.TimeGetDate: timestampGetDayOfMonthOneBasedWithTz, - overloads.TimeGetDayOfMonth: timestampGetDayOfMonthZeroBasedWithTz, - overloads.TimeGetDayOfWeek: timestampGetDayOfWeekWithTz, - overloads.TimeGetHours: timestampGetHoursWithTz, - overloads.TimeGetMinutes: timestampGetMinutesWithTz, - overloads.TimeGetSeconds: timestampGetSecondsWithTz, - overloads.TimeGetMilliseconds: timestampGetMillisecondsWithTz} -) - -type timestampVisitor func(time.Time) ref.Val - -func timestampGetFullYear(t time.Time) ref.Val { - return Int(t.Year()) -} -func timestampGetMonth(t time.Time) ref.Val { - // CEL spec indicates that the month should be 0-based, but the Time value - // for Month() is 1-based. - return Int(t.Month() - 1) -} -func timestampGetDayOfYear(t time.Time) ref.Val { - return Int(t.YearDay() - 1) -} -func timestampGetDayOfMonthZeroBased(t time.Time) ref.Val { - return Int(t.Day() - 1) -} -func timestampGetDayOfMonthOneBased(t time.Time) ref.Val { - return Int(t.Day()) -} -func timestampGetDayOfWeek(t time.Time) ref.Val { - return Int(t.Weekday()) -} -func timestampGetHours(t time.Time) ref.Val { - return Int(t.Hour()) -} -func timestampGetMinutes(t time.Time) ref.Val { - return Int(t.Minute()) -} -func timestampGetSeconds(t time.Time) ref.Val { - return Int(t.Second()) -} -func timestampGetMilliseconds(t time.Time) ref.Val { - return Int(t.Nanosecond() / 1000000) -} - -func timestampGetFullYearWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetFullYear)(t) -} -func timestampGetMonthWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetMonth)(t) -} -func timestampGetDayOfYearWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetDayOfYear)(t) -} -func timestampGetDayOfMonthZeroBasedWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetDayOfMonthZeroBased)(t) -} -func timestampGetDayOfMonthOneBasedWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetDayOfMonthOneBased)(t) -} -func timestampGetDayOfWeekWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetDayOfWeek)(t) -} -func timestampGetHoursWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetHours)(t) -} -func timestampGetMinutesWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetMinutes)(t) -} -func timestampGetSecondsWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetSeconds)(t) -} -func timestampGetMillisecondsWithTz(t time.Time, tz ref.Val) ref.Val { - return timeZone(tz, timestampGetMilliseconds)(t) -} - -func timeZone(tz ref.Val, visitor timestampVisitor) timestampVisitor { - return func(t time.Time) ref.Val { - if StringType != tz.Type() { - return MaybeNoSuchOverloadErr(tz) - } - val := string(tz.(String)) - ind := strings.Index(val, ":") - if ind == -1 { - loc, err := time.LoadLocation(val) - if err != nil { - return WrapErr(err) - } - return visitor(t.In(loc)) - } - - // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC - // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes. - hr, err := strconv.Atoi(string(val[0:ind])) - if err != nil { - return WrapErr(err) - } - min, err := strconv.Atoi(string(val[ind+1:])) - if err != nil { - return WrapErr(err) - } - var offset int - if string(val[0]) == "-" { - offset = hr*60 - min - } else { - offset = hr*60 + min - } - secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds()) - timezone := time.FixedZone("", secondsEastOfUTC) - return visitor(t.In(timezone)) - } -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/traits/BUILD.bazel deleted file mode 100644 index b19eb8301..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/BUILD.bazel +++ /dev/null @@ -1,29 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "comparer.go", - "container.go", - "field_tester.go", - "indexer.go", - "iterator.go", - "lister.go", - "mapper.go", - "matcher.go", - "math.go", - "receiver.go", - "sizer.go", - "traits.go", - "zeroer.go", - ], - importpath = "github.com/google/cel-go/common/types/traits", - deps = [ - "//common/types/ref:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/common/types/traits/comparer.go b/vendor/github.com/google/cel-go/common/types/traits/comparer.go deleted file mode 100644 index b531d9ae2..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/comparer.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// Comparer interface for ordering comparisons between values in order to -// support '<', '<=', '>=', '>' overloads. -type Comparer interface { - // Compare this value to the input other value, returning an Int: - // - // this < other -> Int(-1) - // this == other -> Int(0) - // this > other -> Int(1) - // - // If the comparison cannot be made or is not supported, an error should - // be returned. - Compare(other ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/container.go b/vendor/github.com/google/cel-go/common/types/traits/container.go deleted file mode 100644 index cf5c621ae..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/container.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Container interface which permits containment tests such as 'a in b'. -type Container interface { - // Contains returns true if the value exists within the object. - Contains(value ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/field_tester.go b/vendor/github.com/google/cel-go/common/types/traits/field_tester.go deleted file mode 100644 index 816a95652..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/field_tester.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// FieldTester indicates if a defined field on an object type is set to a -// non-default value. -// -// For use with the `has()` macro. -type FieldTester interface { - // IsSet returns true if the field is defined and set to a non-default - // value. The method will return false if defined and not set, and an error - // if the field is not defined. - IsSet(field ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/indexer.go b/vendor/github.com/google/cel-go/common/types/traits/indexer.go deleted file mode 100644 index 662c6836c..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/indexer.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// Indexer permits random access of elements by index 'a[b()]'. -type Indexer interface { - // Get the value at the specified index or error. - Get(index ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/iterator.go b/vendor/github.com/google/cel-go/common/types/traits/iterator.go deleted file mode 100644 index 91c10f08f..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/iterator.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// Iterable aggregate types permit traversal over their elements. -type Iterable interface { - // Iterator returns a new iterator view of the struct. - Iterator() Iterator -} - -// Iterator permits safe traversal over the contents of an aggregate type. -type Iterator interface { - ref.Val - - // HasNext returns true if there are unvisited elements in the Iterator. - HasNext() ref.Val - - // Next returns the next element. - Next() ref.Val -} - -// Foldable aggregate types support iteration over (key, value) or (index, value) pairs. -type Foldable interface { - // Fold invokes the Folder.FoldEntry for all entries in the type - Fold(Folder) -} - -// Folder performs a fold on a given entry and indicates whether to continue folding. -type Folder interface { - // FoldEntry indicates the key, value pair associated with the entry. - // If the output is true, continue folding. Otherwise, terminate the fold. - FoldEntry(key, val any) bool -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/lister.go b/vendor/github.com/google/cel-go/common/types/traits/lister.go deleted file mode 100644 index e54781a60..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/lister.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Lister interface which aggregates the traits of a list. -type Lister interface { - ref.Val - Adder - Container - Indexer - Iterable - Sizer -} - -// MutableLister interface which emits an immutable result after an intermediate computation. -// -// Note, this interface is intended only to be used within Comprehensions where the mutable -// value is not directly observable within the user-authored CEL expression. -type MutableLister interface { - Lister - ToImmutableList() Lister -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/mapper.go b/vendor/github.com/google/cel-go/common/types/traits/mapper.go deleted file mode 100644 index d13333f3f..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/mapper.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Mapper interface which aggregates the traits of a maps. -type Mapper interface { - ref.Val - Container - Indexer - Iterable - Sizer - - // Find returns a value, if one exists, for the input key. - // - // If the key is not found the function returns (nil, false). - // If the input key is not valid for the map, or is Err or Unknown the function returns - // (Unknown|Err, false). - Find(key ref.Val) (ref.Val, bool) -} - -// MutableMapper interface which emits an immutable result after an intermediate computation. -// -// Note, this interface is intended only to be used within Comprehensions where the mutable -// value is not directly observable within the user-authored CEL expression. -type MutableMapper interface { - Mapper - - // Insert a key, value pair into the map, returning the map if the insert is successful - // and an error if key already exists in the mutable map. - Insert(k, v ref.Val) ref.Val - - // ToImmutableMap converts a mutable map into an immutable map. - ToImmutableMap() Mapper -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/matcher.go b/vendor/github.com/google/cel-go/common/types/traits/matcher.go deleted file mode 100644 index 085dc94ff..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/matcher.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Matcher interface for supporting 'matches()' overloads. -type Matcher interface { - // Match returns true if the pattern matches the current value. - Match(pattern ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/math.go b/vendor/github.com/google/cel-go/common/types/traits/math.go deleted file mode 100644 index 86d5b9137..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/math.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Adder interface to support '+' operator overloads. -type Adder interface { - // Add returns a combination of the current value and other value. - // - // If the other value is an unsupported type, an error is returned. - Add(other ref.Val) ref.Val -} - -// Divider interface to support '/' operator overloads. -type Divider interface { - // Divide returns the result of dividing the current value by the input - // denominator. - // - // A denominator value of zero results in an error. - Divide(denominator ref.Val) ref.Val -} - -// Modder interface to support '%' operator overloads. -type Modder interface { - // Modulo returns the result of taking the modulus of the current value - // by the denominator. - // - // A denominator value of zero results in an error. - Modulo(denominator ref.Val) ref.Val -} - -// Multiplier interface to support '*' operator overloads. -type Multiplier interface { - // Multiply returns the result of multiplying the current and input value. - Multiply(other ref.Val) ref.Val -} - -// Negater interface to support unary '-' and '!' operator overloads. -type Negater interface { - // Negate returns the complement of the current value. - Negate() ref.Val -} - -// Subtractor interface to support binary '-' operator overloads. -type Subtractor interface { - // Subtract returns the result of subtracting the input from the current - // value. - Subtract(subtrahend ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/receiver.go b/vendor/github.com/google/cel-go/common/types/traits/receiver.go deleted file mode 100644 index 8f41db45e..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/receiver.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import "github.com/google/cel-go/common/types/ref" - -// Receiver interface for routing instance method calls within a value. -type Receiver interface { - // Receive accepts a function name, overload id, and arguments and returns - // a value. - Receive(function string, overload string, args []ref.Val) ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/sizer.go b/vendor/github.com/google/cel-go/common/types/traits/sizer.go deleted file mode 100644 index b80d25137..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/sizer.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// Sizer interface for supporting 'size()' overloads. -type Sizer interface { - // Size returns the number of elements or length of the value. - Size() ref.Val -} diff --git a/vendor/github.com/google/cel-go/common/types/traits/traits.go b/vendor/github.com/google/cel-go/common/types/traits/traits.go deleted file mode 100644 index 51a09df56..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/traits.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package traits defines interfaces that a type may implement to participate -// in operator overloads and function dispatch. -package traits - -const ( - // AdderType types provide a '+' operator overload. - AdderType = 1 << iota - - // ComparerType types support ordering comparisons '<', '<=', '>', '>='. - ComparerType - - // ContainerType types support 'in' operations. - ContainerType - - // DividerType types support '/' operations. - DividerType - - // FieldTesterType types support the detection of field value presence. - FieldTesterType - - // IndexerType types support index access with dynamic values. - IndexerType - - // IterableType types can be iterated over in comprehensions. - IterableType - - // IteratorType types support iterator semantics. - IteratorType - - // MatcherType types support pattern matching via 'matches' method. - MatcherType - - // ModderType types support modulus operations '%' - ModderType - - // MultiplierType types support '*' operations. - MultiplierType - - // NegatorType types support either negation via '!' or '-' - NegatorType - - // ReceiverType types support dynamic dispatch to instance methods. - ReceiverType - - // SizerType types support the size() method. - SizerType - - // SubtractorType types support '-' operations. - SubtractorType - - // FoldableType types support comprehensions v2 macros which iterate over (key, value) pairs. - FoldableType -) - -const ( - // ListerType supports a set of traits necessary for list operations. - // - // The ListerType is syntactic sugar and not intended to be a perfect reflection of all List operators. - ListerType = AdderType | ContainerType | IndexerType | IterableType | SizerType - - // MapperType supports a set of traits necessary for map operations. - // - // The MapperType is syntactic sugar and not intended to be a perfect reflection of all Map operators. - MapperType = ContainerType | IndexerType | IterableType | SizerType -) diff --git a/vendor/github.com/google/cel-go/common/types/traits/zeroer.go b/vendor/github.com/google/cel-go/common/types/traits/zeroer.go deleted file mode 100644 index 0b7c830a2..000000000 --- a/vendor/github.com/google/cel-go/common/types/traits/zeroer.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package traits - -// Zeroer interface for testing whether a CEL value is a zero value for its type. -type Zeroer interface { - // IsZeroValue indicates whether the object is the zero value for the type. - IsZeroValue() bool -} diff --git a/vendor/github.com/google/cel-go/common/types/types.go b/vendor/github.com/google/cel-go/common/types/types.go deleted file mode 100644 index 78c77a9b5..000000000 --- a/vendor/github.com/google/cel-go/common/types/types.go +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "reflect" - "strings" - - "google.golang.org/protobuf/proto" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - celpb "cel.dev/expr" - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Kind indicates a CEL type's kind which is used to differentiate quickly between simple -// and complex types. -type Kind uint - -const ( - // UnspecifiedKind is returned when the type is nil or its kind is not specified. - UnspecifiedKind Kind = iota - - // DynKind represents a dynamic type. This kind only exists at type-check time. - DynKind - - // AnyKind represents a google.protobuf.Any type. This kind only exists at type-check time. - // Prefer DynKind to AnyKind as AnyKind has a specific meaning which is based on protobuf - // well-known types. - AnyKind - - // BoolKind represents a boolean type. - BoolKind - - // BytesKind represents a bytes type. - BytesKind - - // DoubleKind represents a double type. - DoubleKind - - // DurationKind represents a CEL duration type. - DurationKind - - // ErrorKind represents a CEL error type. - ErrorKind - - // IntKind represents an integer type. - IntKind - - // ListKind represents a list type. - ListKind - - // MapKind represents a map type. - MapKind - - // NullTypeKind represents a null type. - NullTypeKind - - // OpaqueKind represents an abstract type which has no accessible fields. - OpaqueKind - - // StringKind represents a string type. - StringKind - - // StructKind represents a structured object with typed fields. - StructKind - - // TimestampKind represents a a CEL time type. - TimestampKind - - // TypeKind represents the CEL type. - TypeKind - - // TypeParamKind represents a parameterized type whose type name will be resolved at type-check time, if possible. - TypeParamKind - - // UintKind represents a uint type. - UintKind - - // UnknownKind represents an unknown value type. - UnknownKind -) - -var ( - // AnyType represents the google.protobuf.Any type. - AnyType = &Type{ - kind: AnyKind, - runtimeTypeName: "google.protobuf.Any", - traitMask: traits.FieldTesterType | - traits.IndexerType, - } - // BoolType represents the bool type. - BoolType = &Type{ - kind: BoolKind, - runtimeTypeName: "bool", - traitMask: traits.ComparerType | - traits.NegatorType, - } - // BytesType represents the bytes type. - BytesType = &Type{ - kind: BytesKind, - runtimeTypeName: "bytes", - traitMask: traits.AdderType | - traits.ComparerType | - traits.SizerType, - } - // DoubleType represents the double type. - DoubleType = &Type{ - kind: DoubleKind, - runtimeTypeName: "double", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.MultiplierType | - traits.NegatorType | - traits.SubtractorType, - } - // DurationType represents the CEL duration type. - DurationType = &Type{ - kind: DurationKind, - runtimeTypeName: "google.protobuf.Duration", - traitMask: traits.AdderType | - traits.ComparerType | - traits.NegatorType | - traits.ReceiverType | - traits.SubtractorType, - } - // DynType represents a dynamic CEL type whose type will be determined at runtime from context. - DynType = &Type{ - kind: DynKind, - runtimeTypeName: "dyn", - } - // ErrorType represents a CEL error value. - ErrorType = &Type{ - kind: ErrorKind, - runtimeTypeName: "error", - } - // IntType represents the int type. - IntType = &Type{ - kind: IntKind, - runtimeTypeName: "int", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.ModderType | - traits.MultiplierType | - traits.NegatorType | - traits.SubtractorType, - } - // ListType represents the runtime list type. - ListType = NewListType(DynType) - // MapType represents the runtime map type. - MapType = NewMapType(DynType, DynType) - // NullType represents the type of a null value. - NullType = &Type{ - kind: NullTypeKind, - runtimeTypeName: "null_type", - } - // StringType represents the string type. - StringType = &Type{ - kind: StringKind, - runtimeTypeName: "string", - traitMask: traits.AdderType | - traits.ComparerType | - traits.MatcherType | - traits.ReceiverType | - traits.SizerType, - } - // TimestampType represents the time type. - TimestampType = &Type{ - kind: TimestampKind, - runtimeTypeName: "google.protobuf.Timestamp", - traitMask: traits.AdderType | - traits.ComparerType | - traits.ReceiverType | - traits.SubtractorType, - } - // TypeType represents a CEL type - TypeType = &Type{ - kind: TypeKind, - runtimeTypeName: "type", - } - // UintType represents a uint type. - UintType = &Type{ - kind: UintKind, - runtimeTypeName: "uint", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.ModderType | - traits.MultiplierType | - traits.SubtractorType, - } - // UnknownType represents an unknown value type. - UnknownType = &Type{ - kind: UnknownKind, - runtimeTypeName: "unknown", - } -) - -var _ ref.Type = &Type{} -var _ ref.Val = &Type{} - -// Type holds a reference to a runtime type with an optional type-checked set of type parameters. -type Type struct { - // kind indicates general category of the type. - kind Kind - - // parameters holds the optional type-checked set of type Parameters that are used during static analysis. - parameters []*Type - - // runtimeTypeName indicates the runtime type name of the type. - runtimeTypeName string - - // isAssignableType function determines whether one type is assignable to this type. - // A nil value for the isAssignableType function falls back to equality of kind, runtimeType, and parameters. - isAssignableType func(other *Type) bool - - // isAssignableRuntimeType function determines whether the runtime type (with erasure) is assignable to this type. - // A nil value for the isAssignableRuntimeType function falls back to the equality of the type or type name. - isAssignableRuntimeType func(other ref.Val) bool - - // traitMask is a mask of flags which indicate the capabilities of the type. - traitMask int -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (t *Type) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("type conversion not supported for 'type'") -} - -// ConvertToType implements ref.Val.ConvertToType. -func (t *Type) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case TypeType: - return TypeType - case StringType: - return String(t.TypeName()) - } - return NewErr("type conversion error from '%s' to '%s'", TypeType, typeVal) -} - -// Equal indicates whether two types have the same runtime type name. -// -// The name Equal is a bit of a misnomer, but for historical reasons, this is the -// runtime behavior. For a more accurate definition see IsType(). -func (t *Type) Equal(other ref.Val) ref.Val { - otherType, ok := other.(ref.Type) - return Bool(ok && t.TypeName() == otherType.TypeName()) -} - -// HasTrait implements the ref.Type interface method. -func (t *Type) HasTrait(trait int) bool { - return trait&t.traitMask == trait -} - -// IsExactType indicates whether the two types are exactly the same. This check also verifies type parameter type names. -func (t *Type) IsExactType(other *Type) bool { - return t.isTypeInternal(other, true) -} - -// IsEquivalentType indicates whether two types are equivalent. This check ignores type parameter type names. -func (t *Type) IsEquivalentType(other *Type) bool { - return t.isTypeInternal(other, false) -} - -// Kind indicates general category of the type. -func (t *Type) Kind() Kind { - if t == nil { - return UnspecifiedKind - } - return t.kind -} - -// isTypeInternal checks whether the two types are equivalent or exactly the same based on the checkTypeParamName flag. -func (t *Type) isTypeInternal(other *Type, checkTypeParamName bool) bool { - if t == nil { - return false - } - if t == other { - return true - } - if t.Kind() != other.Kind() || len(t.Parameters()) != len(other.Parameters()) { - return false - } - if (checkTypeParamName || t.Kind() != TypeParamKind) && t.TypeName() != other.TypeName() { - return false - } - for i, p := range t.Parameters() { - if !p.isTypeInternal(other.Parameters()[i], checkTypeParamName) { - return false - } - } - return true -} - -// IsAssignableType determines whether the current type is type-check assignable from the input fromType. -func (t *Type) IsAssignableType(fromType *Type) bool { - if t == nil { - return false - } - if t.isAssignableType != nil { - return t.isAssignableType(fromType) - } - return t.defaultIsAssignableType(fromType) -} - -// IsAssignableRuntimeType determines whether the current type is runtime assignable from the input runtimeType. -// -// At runtime, parameterized types are erased and so a function which type-checks to support a map(string, string) -// will have a runtime assignable type of a map. -func (t *Type) IsAssignableRuntimeType(val ref.Val) bool { - if t == nil { - return false - } - if t.isAssignableRuntimeType != nil { - return t.isAssignableRuntimeType(val) - } - return t.defaultIsAssignableRuntimeType(val) -} - -// Parameters returns the list of type parameters if set. -// -// For ListKind, Parameters()[0] represents the list element type -// For MapKind, Parameters()[0] represents the map key type, and Parameters()[1] represents the map -// value type. -func (t *Type) Parameters() []*Type { - if t == nil { - return emptyParams - } - return t.parameters -} - -// DeclaredTypeName indicates the fully qualified and parameterized type-check type name. -func (t *Type) DeclaredTypeName() string { - // if the type itself is neither null, nor dyn, but is assignable to null, then it's a wrapper type. - if t.Kind() != NullTypeKind && !t.isDyn() && t.IsAssignableType(NullType) { - return fmt.Sprintf("wrapper(%s)", t.TypeName()) - } - return t.TypeName() -} - -// Type implements the ref.Val interface method. -func (t *Type) Type() ref.Type { - return TypeType -} - -// Value implements the ref.Val interface method. -func (t *Type) Value() any { - return t.TypeName() -} - -// TypeName returns the type-erased fully qualified runtime type name. -// -// TypeName implements the ref.Type interface method. -func (t *Type) TypeName() string { - if t == nil { - return "" - } - return t.runtimeTypeName -} - -func (t *Type) format(sb *strings.Builder) { - sb.WriteString(t.TypeName()) -} - -// WithTraits creates a copy of the current Type and sets the trait mask to the traits parameter. -// -// This method should be used with Opaque types where the type acts like a container, e.g. vector. -func (t *Type) WithTraits(traits int) *Type { - if t == nil { - return nil - } - return &Type{ - kind: t.kind, - parameters: t.parameters, - runtimeTypeName: t.runtimeTypeName, - isAssignableType: t.isAssignableType, - isAssignableRuntimeType: t.isAssignableRuntimeType, - traitMask: traits, - } -} - -// String returns a human-readable definition of the type name. -func (t *Type) String() string { - if t.Kind() == TypeParamKind { - return fmt.Sprintf("<%s>", t.DeclaredTypeName()) - } - if len(t.Parameters()) == 0 { - return t.DeclaredTypeName() - } - params := make([]string, len(t.Parameters())) - for i, p := range t.Parameters() { - params[i] = p.String() - } - return fmt.Sprintf("%s(%s)", t.DeclaredTypeName(), strings.Join(params, ", ")) -} - -// isDyn indicates whether the type is dynamic in any way. -func (t *Type) isDyn() bool { - k := t.Kind() - return k == DynKind || k == AnyKind || k == TypeParamKind -} - -// defaultIsAssignableType provides the standard definition of what it means for one type to be assignable to another -// where any of the following may return a true result: -// - The from types are the same instance -// - The target type is dynamic -// - The fromType has the same kind and type name as the target type, and all parameters of the target type -// -// are IsAssignableType() from the parameters of the fromType. -func (t *Type) defaultIsAssignableType(fromType *Type) bool { - if t == fromType || t.isDyn() { - return true - } - if t.Kind() != fromType.Kind() || - t.TypeName() != fromType.TypeName() || - len(t.Parameters()) != len(fromType.Parameters()) { - return false - } - for i, tp := range t.Parameters() { - fp := fromType.Parameters()[i] - if !tp.IsAssignableType(fp) { - return false - } - } - return true -} - -// defaultIsAssignableRuntimeType inspects the type and in the case of list and map elements, the key and element types -// to determine whether a ref.Val is assignable to the declared type for a function signature. -func (t *Type) defaultIsAssignableRuntimeType(val ref.Val) bool { - valType := val.Type() - // If the current type and value type don't agree, then return - if !(t.isDyn() || t.TypeName() == valType.TypeName()) { - return false - } - switch t.Kind() { - case ListKind: - elemType := t.Parameters()[0] - l := val.(traits.Lister) - if l.Size() == IntZero { - return true - } - it := l.Iterator() - elemVal := it.Next() - return elemType.IsAssignableRuntimeType(elemVal) - case MapKind: - keyType := t.Parameters()[0] - elemType := t.Parameters()[1] - m := val.(traits.Mapper) - if m.Size() == IntZero { - return true - } - it := m.Iterator() - keyVal := it.Next() - elemVal := m.Get(keyVal) - return keyType.IsAssignableRuntimeType(keyVal) && elemType.IsAssignableRuntimeType(elemVal) - } - return true -} - -// NewListType creates an instances of a list type value with the provided element type. -func NewListType(elemType *Type) *Type { - return &Type{ - kind: ListKind, - parameters: []*Type{elemType}, - runtimeTypeName: "list", - traitMask: traits.AdderType | - traits.ContainerType | - traits.IndexerType | - traits.IterableType | - traits.SizerType, - } -} - -// NewMapType creates an instance of a map type value with the provided key and value types. -func NewMapType(keyType, valueType *Type) *Type { - return &Type{ - kind: MapKind, - parameters: []*Type{keyType, valueType}, - runtimeTypeName: "map", - traitMask: traits.ContainerType | - traits.IndexerType | - traits.IterableType | - traits.SizerType, - } -} - -// NewNullableType creates an instance of a nullable type with the provided wrapped type. -// -// Note: only primitive types are supported as wrapped types. -func NewNullableType(wrapped *Type) *Type { - return &Type{ - kind: wrapped.Kind(), - parameters: wrapped.Parameters(), - runtimeTypeName: wrapped.TypeName(), - traitMask: wrapped.traitMask, - isAssignableType: func(other *Type) bool { - return NullType.IsAssignableType(other) || wrapped.IsAssignableType(other) - }, - isAssignableRuntimeType: func(other ref.Val) bool { - return NullType.IsAssignableRuntimeType(other) || wrapped.IsAssignableRuntimeType(other) - }, - } -} - -// NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional. -func NewOptionalType(param *Type) *Type { - return NewOpaqueType("optional_type", param) -} - -// NewOpaqueType creates an abstract parameterized type with a given name. -func NewOpaqueType(name string, params ...*Type) *Type { - return &Type{ - kind: OpaqueKind, - parameters: params, - runtimeTypeName: name, - } -} - -// NewObjectType creates a type reference to an externally defined type, e.g. a protobuf message type. -// -// An object type is assumed to support field presence testing and field indexing. Additionally, the -// type may also indicate additional traits through the use of the optional traits vararg argument. -func NewObjectType(typeName string, traits ...int) *Type { - // Function sanitizes object types on the fly - if wkt, found := checkedWellKnowns[typeName]; found { - return wkt - } - traitMask := 0 - for _, trait := range traits { - traitMask |= trait - } - return &Type{ - kind: StructKind, - parameters: emptyParams, - runtimeTypeName: typeName, - traitMask: structTypeTraitMask | traitMask, - } -} - -// NewObjectTypeValue creates a type reference to an externally defined type. -// -// Deprecated: use cel.ObjectType(typeName) -func NewObjectTypeValue(typeName string) *Type { - return NewObjectType(typeName) -} - -// NewTypeValue creates an opaque type which has a set of optional type traits as defined in -// the common/types/traits package. -// -// Deprecated: use cel.ObjectType(typeName, traits) -func NewTypeValue(typeName string, traits ...int) *Type { - traitMask := 0 - for _, trait := range traits { - traitMask |= trait - } - return &Type{ - kind: StructKind, - parameters: emptyParams, - runtimeTypeName: typeName, - traitMask: traitMask, - } -} - -// NewTypeParamType creates a parameterized type instance. -func NewTypeParamType(paramName string) *Type { - return &Type{ - kind: TypeParamKind, - runtimeTypeName: paramName, - } -} - -// NewTypeTypeWithParam creates a type with a type parameter. -// Used for type-checking purposes, but equivalent to TypeType otherwise. -func NewTypeTypeWithParam(param *Type) *Type { - return &Type{ - kind: TypeKind, - runtimeTypeName: "type", - parameters: []*Type{param}, - } -} - -// TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation. -func TypeToExprType(t *Type) (*exprpb.Type, error) { - switch t.Kind() { - case AnyKind: - return chkdecls.Any, nil - case BoolKind: - return maybeWrapper(t, chkdecls.Bool), nil - case BytesKind: - return maybeWrapper(t, chkdecls.Bytes), nil - case DoubleKind: - return maybeWrapper(t, chkdecls.Double), nil - case DurationKind: - return chkdecls.Duration, nil - case DynKind: - return chkdecls.Dyn, nil - case ErrorKind: - return chkdecls.Error, nil - case IntKind: - return maybeWrapper(t, chkdecls.Int), nil - case ListKind: - if len(t.Parameters()) != 1 { - return nil, fmt.Errorf("invalid list, got %d parameters, wanted one", len(t.Parameters())) - } - et, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - return chkdecls.NewListType(et), nil - case MapKind: - if len(t.Parameters()) != 2 { - return nil, fmt.Errorf("invalid map, got %d parameters, wanted two", len(t.Parameters())) - } - kt, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - vt, err := TypeToExprType(t.Parameters()[1]) - if err != nil { - return nil, err - } - return chkdecls.NewMapType(kt, vt), nil - case NullTypeKind: - return chkdecls.Null, nil - case OpaqueKind: - params := make([]*exprpb.Type, len(t.Parameters())) - for i, p := range t.Parameters() { - pt, err := TypeToExprType(p) - if err != nil { - return nil, err - } - params[i] = pt - } - return chkdecls.NewAbstractType(t.TypeName(), params...), nil - case StringKind: - return maybeWrapper(t, chkdecls.String), nil - case StructKind: - return chkdecls.NewObjectType(t.TypeName()), nil - case TimestampKind: - return chkdecls.Timestamp, nil - case TypeParamKind: - return chkdecls.NewTypeParamType(t.TypeName()), nil - case TypeKind: - if len(t.Parameters()) == 1 { - p, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - return chkdecls.NewTypeType(p), nil - } - return chkdecls.NewTypeType(nil), nil - case UintKind: - return maybeWrapper(t, chkdecls.Uint), nil - } - return nil, fmt.Errorf("missing type conversion to proto: %v", t) -} - -// ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation. -func ExprTypeToType(t *exprpb.Type) (*Type, error) { - return AlphaProtoAsType(t) -} - -// AlphaProtoAsType converts a CEL v1alpha1.Type protobuf type to a CEL-native type representation. -func AlphaProtoAsType(t *exprpb.Type) (*Type, error) { - canonical := &celpb.Type{} - if err := convertProto(t, canonical); err != nil { - return nil, err - } - return ProtoAsType(canonical) -} - -// ProtoAsType converts a canonical CEL celpb.Type protobuf type to a CEL-native type representation. -func ProtoAsType(t *celpb.Type) (*Type, error) { - switch t.GetTypeKind().(type) { - case *celpb.Type_Dyn: - return DynType, nil - case *celpb.Type_AbstractType_: - paramTypes := make([]*Type, len(t.GetAbstractType().GetParameterTypes())) - for i, p := range t.GetAbstractType().GetParameterTypes() { - pt, err := ProtoAsType(p) - if err != nil { - return nil, err - } - paramTypes[i] = pt - } - return NewOpaqueType(t.GetAbstractType().GetName(), paramTypes...), nil - case *celpb.Type_ListType_: - et, err := ProtoAsType(t.GetListType().GetElemType()) - if err != nil { - return nil, err - } - return NewListType(et), nil - case *celpb.Type_MapType_: - kt, err := ProtoAsType(t.GetMapType().GetKeyType()) - if err != nil { - return nil, err - } - vt, err := ProtoAsType(t.GetMapType().GetValueType()) - if err != nil { - return nil, err - } - return NewMapType(kt, vt), nil - case *celpb.Type_MessageType: - return NewObjectType(t.GetMessageType()), nil - case *celpb.Type_Null: - return NullType, nil - case *celpb.Type_Primitive: - switch t.GetPrimitive() { - case celpb.Type_BOOL: - return BoolType, nil - case celpb.Type_BYTES: - return BytesType, nil - case celpb.Type_DOUBLE: - return DoubleType, nil - case celpb.Type_INT64: - return IntType, nil - case celpb.Type_STRING: - return StringType, nil - case celpb.Type_UINT64: - return UintType, nil - default: - return nil, fmt.Errorf("unsupported primitive type: %v", t) - } - case *celpb.Type_TypeParam: - return NewTypeParamType(t.GetTypeParam()), nil - case *celpb.Type_Type: - if t.GetType().GetTypeKind() != nil { - p, err := ProtoAsType(t.GetType()) - if err != nil { - return nil, err - } - return NewTypeTypeWithParam(p), nil - } - return TypeType, nil - case *celpb.Type_WellKnown: - switch t.GetWellKnown() { - case celpb.Type_ANY: - return AnyType, nil - case celpb.Type_DURATION: - return DurationType, nil - case celpb.Type_TIMESTAMP: - return TimestampType, nil - default: - return nil, fmt.Errorf("unsupported well-known type: %v", t) - } - case *celpb.Type_Wrapper: - t, err := ProtoAsType(&celpb.Type{TypeKind: &celpb.Type_Primitive{Primitive: t.GetWrapper()}}) - if err != nil { - return nil, err - } - return NewNullableType(t), nil - case *celpb.Type_Error: - return ErrorType, nil - default: - return nil, fmt.Errorf("unsupported type: %v", t) - } -} - -// TypeToProto converts from a CEL-native type representation to canonical CEL celpb.Type protobuf type. -func TypeToProto(t *Type) (*celpb.Type, error) { - exprType, err := TypeToExprType(t) - if err != nil { - return nil, err - } - var pbtype celpb.Type - if err = convertProto(exprType, &pbtype); err != nil { - return nil, err - } - return &pbtype, nil -} - -func maybeWrapper(t *Type, pbType *exprpb.Type) *exprpb.Type { - if t.IsAssignableType(NullType) { - return chkdecls.NewWrapperType(pbType) - } - return pbType -} - -func maybeForeignType(t ref.Type) *Type { - if celType, ok := t.(*Type); ok { - return celType - } - // Inspect the incoming type to determine its traits. The assumption will be that the incoming - // type does not have any field values; however, if the trait mask indicates that field testing - // and indexing are supported, the foreign type is marked as a struct. - traitMask := 0 - for _, trait := range allTraits { - if t.HasTrait(trait) { - traitMask |= trait - } - } - // Treat the value like a struct. If it has no fields, this is harmless to denote the type - // as such since it basically becomes an opaque type by convention. - return NewObjectType(t.TypeName(), traitMask) -} - -func convertProto(src, dst proto.Message) error { - pb, err := proto.Marshal(src) - if err != nil { - return err - } - err = proto.Unmarshal(pb, dst) - return err -} - -func primitiveType(primitive celpb.Type_PrimitiveType) *celpb.Type { - return &celpb.Type{ - TypeKind: &celpb.Type_Primitive{ - Primitive: primitive, - }, - } -} - -var ( - checkedWellKnowns = map[string]*Type{ - // Wrapper types. - "google.protobuf.BoolValue": NewNullableType(BoolType), - "google.protobuf.BytesValue": NewNullableType(BytesType), - "google.protobuf.DoubleValue": NewNullableType(DoubleType), - "google.protobuf.FloatValue": NewNullableType(DoubleType), - "google.protobuf.Int64Value": NewNullableType(IntType), - "google.protobuf.Int32Value": NewNullableType(IntType), - "google.protobuf.UInt64Value": NewNullableType(UintType), - "google.protobuf.UInt32Value": NewNullableType(UintType), - "google.protobuf.StringValue": NewNullableType(StringType), - // Well-known types. - "google.protobuf.Any": AnyType, - "google.protobuf.Duration": DurationType, - "google.protobuf.Timestamp": TimestampType, - // Json types. - "google.protobuf.ListValue": NewListType(DynType), - "google.protobuf.NullValue": NullType, - "google.protobuf.Struct": NewMapType(StringType, DynType), - "google.protobuf.Value": DynType, - } - - emptyParams = []*Type{} - - allTraits = []int{ - traits.AdderType, - traits.ComparerType, - traits.ContainerType, - traits.DividerType, - traits.FieldTesterType, - traits.IndexerType, - traits.IterableType, - traits.IteratorType, - traits.MatcherType, - traits.ModderType, - traits.MultiplierType, - traits.NegatorType, - traits.ReceiverType, - traits.SizerType, - traits.SubtractorType, - } - - structTypeTraitMask = traits.FieldTesterType | traits.IndexerType - - boolType = primitiveType(celpb.Type_BOOL) - bytesType = primitiveType(celpb.Type_BYTES) - doubleType = primitiveType(celpb.Type_DOUBLE) - intType = primitiveType(celpb.Type_INT64) - stringType = primitiveType(celpb.Type_STRING) - uintType = primitiveType(celpb.Type_UINT64) -) diff --git a/vendor/github.com/google/cel-go/common/types/uint.go b/vendor/github.com/google/cel-go/common/types/uint.go deleted file mode 100644 index a93405a13..000000000 --- a/vendor/github.com/google/cel-go/common/types/uint.go +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "math" - "reflect" - "strconv" - "strings" - - "github.com/google/cel-go/common/types/ref" - - anypb "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Uint type implementation which supports comparison and math operators. -type Uint uint64 - -var ( - uint32WrapperType = reflect.TypeOf(&wrapperspb.UInt32Value{}) - - uint64WrapperType = reflect.TypeOf(&wrapperspb.UInt64Value{}) -) - -// Uint constants -const ( - uintZero = Uint(0) -) - -// Add implements traits.Adder.Add. -func (i Uint) Add(other ref.Val) ref.Val { - otherUint, ok := other.(Uint) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := addUint64Checked(uint64(i), uint64(otherUint)) - if err != nil { - return WrapErr(err) - } - return Uint(val) -} - -// Compare implements traits.Comparer.Compare. -func (i Uint) Compare(other ref.Val) ref.Val { - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return NewErr("NaN values cannot be ordered") - } - return compareUintDouble(i, ov) - case Int: - return compareUintInt(i, ov) - case Uint: - return compareUint(i, ov) - default: - return MaybeNoSuchOverloadErr(other) - } -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (i Uint) ConvertToNative(typeDesc reflect.Type) (any, error) { - switch typeDesc.Kind() { - case reflect.Uint, reflect.Uint32: - v, err := uint64ToUint32Checked(uint64(i)) - if err != nil { - return 0, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Uint8: - v, err := uint64ToUint8Checked(uint64(i)) - if err != nil { - return 0, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Uint16: - v, err := uint64ToUint16Checked(uint64(i)) - if err != nil { - return 0, err - } - return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil - case reflect.Uint64: - return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil - case reflect.Ptr: - switch typeDesc { - case anyValueType: - // Primitives must be wrapped before being set on an Any field. - return anypb.New(wrapperspb.UInt64(uint64(i))) - case jsonValueType: - // JSON can accurately represent 32-bit uints as floating point values. - if i.isJSONSafe() { - return structpb.NewNumberValue(float64(i)), nil - } - // Proto3 to JSON conversion requires string-formatted uint64 values - // since the conversion to floating point would result in truncation. - return structpb.NewStringValue(strconv.FormatUint(uint64(i), 10)), nil - case uint32WrapperType: - // Convert the value to a wrapperspb.UInt32Value, error on overflow. - v, err := uint64ToUint32Checked(uint64(i)) - if err != nil { - return 0, err - } - return wrapperspb.UInt32(v), nil - case uint64WrapperType: - // Convert the value to a wrapperspb.UInt64Value. - return wrapperspb.UInt64(uint64(i)), nil - } - switch typeDesc.Elem().Kind() { - case reflect.Uint32: - v, err := uint64ToUint32Checked(uint64(i)) - if err != nil { - return 0, err - } - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - case reflect.Uint64: - v := uint64(i) - p := reflect.New(typeDesc.Elem()) - p.Elem().Set(reflect.ValueOf(v).Convert(typeDesc.Elem())) - return p.Interface(), nil - } - case reflect.Interface: - iv := i.Value() - if reflect.TypeOf(iv).Implements(typeDesc) { - return iv, nil - } - if reflect.TypeOf(i).Implements(typeDesc) { - return i, nil - } - } - return nil, fmt.Errorf("unsupported type conversion from 'uint' to %v", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (i Uint) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case IntType: - v, err := uint64ToInt64Checked(uint64(i)) - if err != nil { - return WrapErr(err) - } - return Int(v) - case UintType: - return i - case DoubleType: - return Double(i) - case StringType: - return String(fmt.Sprintf("%d", uint64(i))) - case TypeType: - return UintType - } - return NewErr("type conversion error from '%s' to '%s'", UintType, typeVal) -} - -// Divide implements traits.Divider.Divide. -func (i Uint) Divide(other ref.Val) ref.Val { - otherUint, ok := other.(Uint) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - div, err := divideUint64Checked(uint64(i), uint64(otherUint)) - if err != nil { - return WrapErr(err) - } - return Uint(div) -} - -// Equal implements ref.Val.Equal. -func (i Uint) Equal(other ref.Val) ref.Val { - switch ov := other.(type) { - case Double: - if math.IsNaN(float64(ov)) { - return False - } - return Bool(compareUintDouble(i, ov) == 0) - case Int: - return Bool(compareUintInt(i, ov) == 0) - case Uint: - return Bool(i == ov) - default: - return False - } -} - -// IsZeroValue returns true if the uint is zero. -func (i Uint) IsZeroValue() bool { - return i == 0 -} - -// Modulo implements traits.Modder.Modulo. -func (i Uint) Modulo(other ref.Val) ref.Val { - otherUint, ok := other.(Uint) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - mod, err := moduloUint64Checked(uint64(i), uint64(otherUint)) - if err != nil { - return WrapErr(err) - } - return Uint(mod) -} - -// Multiply implements traits.Multiplier.Multiply. -func (i Uint) Multiply(other ref.Val) ref.Val { - otherUint, ok := other.(Uint) - if !ok { - return MaybeNoSuchOverloadErr(other) - } - val, err := multiplyUint64Checked(uint64(i), uint64(otherUint)) - if err != nil { - return WrapErr(err) - } - return Uint(val) -} - -// Subtract implements traits.Subtractor.Subtract. -func (i Uint) Subtract(subtrahend ref.Val) ref.Val { - subtraUint, ok := subtrahend.(Uint) - if !ok { - return MaybeNoSuchOverloadErr(subtrahend) - } - val, err := subtractUint64Checked(uint64(i), uint64(subtraUint)) - if err != nil { - return WrapErr(err) - } - return Uint(val) -} - -// Type implements ref.Val.Type. -func (i Uint) Type() ref.Type { - return UintType -} - -// Value implements ref.Val.Value. -func (i Uint) Value() any { - return uint64(i) -} - -func (i Uint) format(sb *strings.Builder) { - sb.WriteString(strconv.FormatUint(uint64(i), 10)) - sb.WriteString("u") -} - -// isJSONSafe indicates whether the uint is safely representable as a floating point value in JSON. -func (i Uint) isJSONSafe() bool { - return i <= maxIntJSON -} diff --git a/vendor/github.com/google/cel-go/common/types/unknown.go b/vendor/github.com/google/cel-go/common/types/unknown.go deleted file mode 100644 index 9dd2b2579..000000000 --- a/vendor/github.com/google/cel-go/common/types/unknown.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "math" - "reflect" - "sort" - "strings" - "unicode" - - "github.com/google/cel-go/common/types/ref" -) - -var ( - unspecifiedAttribute = &AttributeTrail{qualifierPath: []any{}} -) - -// NewAttributeTrail creates a new simple attribute from a variable name. -func NewAttributeTrail(variable string) *AttributeTrail { - if variable == "" { - return unspecifiedAttribute - } - return &AttributeTrail{variable: variable} -} - -// AttributeTrail specifies a variable with an optional qualifier path. An attribute value is expected to -// correspond to an AbsoluteAttribute, meaning a field selection which starts with a top-level variable. -// -// The qualifer path elements adhere to the AttributeQualifier type constraint. -type AttributeTrail struct { - variable string - qualifierPath []any -} - -// Equal returns whether two attribute values have the same variable name and qualifier paths. -func (a *AttributeTrail) Equal(other *AttributeTrail) bool { - if a.Variable() != other.Variable() || len(a.QualifierPath()) != len(other.QualifierPath()) { - return false - } - for i, q := range a.QualifierPath() { - qual := other.QualifierPath()[i] - if !qualifiersEqual(q, qual) { - return false - } - } - return true -} - -func qualifiersEqual(a, b any) bool { - if a == b { - return true - } - switch numA := a.(type) { - case int64: - numB, ok := b.(uint64) - if !ok { - return false - } - return intUintEqual(numA, numB) - case uint64: - numB, ok := b.(int64) - if !ok { - return false - } - return intUintEqual(numB, numA) - default: - return false - } -} - -func intUintEqual(i int64, u uint64) bool { - if i < 0 || u > math.MaxInt64 { - return false - } - return i == int64(u) -} - -// Variable returns the variable name associated with the attribute. -func (a *AttributeTrail) Variable() string { - return a.variable -} - -// QualifierPath returns the optional set of qualifying fields or indices applied to the variable. -func (a *AttributeTrail) QualifierPath() []any { - return a.qualifierPath -} - -// String returns the string representation of the Attribute. -func (a *AttributeTrail) String() string { - if a.variable == "" { - return "" - } - var str strings.Builder - str.WriteString(a.variable) - for _, q := range a.qualifierPath { - switch q := q.(type) { - case bool, int64: - str.WriteString(fmt.Sprintf("[%v]", q)) - case uint64: - str.WriteString(fmt.Sprintf("[%vu]", q)) - case string: - if isIdentifierCharacter(q) { - str.WriteString(fmt.Sprintf(".%v", q)) - } else { - str.WriteString(fmt.Sprintf("[%q]", q)) - } - } - } - return str.String() -} - -func isIdentifierCharacter(str string) bool { - for _, c := range str { - if unicode.IsLetter(c) || unicode.IsDigit(c) || string(c) == "_" { - continue - } - return false - } - return true -} - -// AttributeQualifier constrains the possible types which may be used to qualify an attribute. -type AttributeQualifier interface { - bool | int64 | uint64 | string -} - -// QualifyAttribute qualifies an attribute using a valid AttributeQualifier type. -func QualifyAttribute[T AttributeQualifier](attr *AttributeTrail, qualifier T) *AttributeTrail { - attr.qualifierPath = append(attr.qualifierPath, qualifier) - return attr -} - -// Unknown type which collects expression ids which caused the current value to become unknown. -type Unknown struct { - attributeTrails map[int64][]*AttributeTrail -} - -// NewUnknown creates a new unknown at a given expression id for an attribute. -// -// If the attribute is nil, the attribute value will be the `unspecifiedAttribute`. -func NewUnknown(id int64, attr *AttributeTrail) *Unknown { - if attr == nil { - attr = unspecifiedAttribute - } - return &Unknown{ - attributeTrails: map[int64][]*AttributeTrail{id: {attr}}, - } -} - -// IDs returns the set of unknown expression ids contained by this value. -// -// Numeric identifiers are guaranteed to be in sorted order. -func (u *Unknown) IDs() []int64 { - ids := make(int64Slice, len(u.attributeTrails)) - i := 0 - for id := range u.attributeTrails { - ids[i] = id - i++ - } - ids.Sort() - return ids -} - -// GetAttributeTrails returns the attribute trails, if present, missing for a given expression id. -func (u *Unknown) GetAttributeTrails(id int64) ([]*AttributeTrail, bool) { - trails, found := u.attributeTrails[id] - return trails, found -} - -// Contains returns true if the input unknown is a subset of the current unknown. -func (u *Unknown) Contains(other *Unknown) bool { - for id, otherTrails := range other.attributeTrails { - trails, found := u.attributeTrails[id] - if !found || len(otherTrails) != len(trails) { - return false - } - for _, ot := range otherTrails { - found := false - for _, t := range trails { - if t.Equal(ot) { - found = true - break - } - } - if !found { - return false - } - } - } - return true -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (u *Unknown) ConvertToNative(typeDesc reflect.Type) (any, error) { - return u.Value(), nil -} - -// ConvertToType is an identity function since unknown values cannot be modified. -func (u *Unknown) ConvertToType(typeVal ref.Type) ref.Val { - return u -} - -// Equal is an identity function since unknown values cannot be modified. -func (u *Unknown) Equal(other ref.Val) ref.Val { - return u -} - -// String implements the Stringer interface -func (u *Unknown) String() string { - var str strings.Builder - for id, attrs := range u.attributeTrails { - if str.Len() != 0 { - str.WriteString(", ") - } - if len(attrs) == 1 { - str.WriteString(fmt.Sprintf("%v (%d)", attrs[0], id)) - } else { - str.WriteString(fmt.Sprintf("%v (%d)", attrs, id)) - } - } - return str.String() -} - -// Type implements ref.Val.Type. -func (u *Unknown) Type() ref.Type { - return UnknownType -} - -// Value implements ref.Val.Value. -func (u *Unknown) Value() any { - return u -} - -// IsUnknown returns whether the element ref.Val is in instance of *types.Unknown -func IsUnknown(val ref.Val) bool { - switch val.(type) { - case *Unknown: - return true - default: - return false - } -} - -// MaybeMergeUnknowns determines whether an input value and another, possibly nil, unknown will produce -// an unknown result. -// -// If the input `val` is another Unknown, then the result will be the merge of the `val` and the input -// `unk`. If the `val` is not unknown, then the result will depend on whether the input `unk` is nil. -// If both values are non-nil and unknown, then the return value will be a merge of both unknowns. -func MaybeMergeUnknowns(val ref.Val, unk *Unknown) (*Unknown, bool) { - src, isUnk := val.(*Unknown) - if !isUnk { - if unk != nil { - return unk, true - } - return unk, false - } - return MergeUnknowns(src, unk), true -} - -// MergeUnknowns combines two unknown values into a new unknown value. -func MergeUnknowns(unk1, unk2 *Unknown) *Unknown { - if unk1 == nil { - return unk2 - } - if unk2 == nil { - return unk1 - } - out := &Unknown{ - attributeTrails: make(map[int64][]*AttributeTrail, len(unk1.attributeTrails)+len(unk2.attributeTrails)), - } - for id, ats := range unk1.attributeTrails { - out.attributeTrails[id] = ats - } - for id, ats := range unk2.attributeTrails { - existing, found := out.attributeTrails[id] - if !found { - out.attributeTrails[id] = ats - continue - } - - for _, at := range ats { - found := false - for _, et := range existing { - if at.Equal(et) { - found = true - break - } - } - if !found { - existing = append(existing, at) - } - } - out.attributeTrails[id] = existing - } - return out -} - -// int64Slice is an implementation of the sort.Interface -type int64Slice []int64 - -// Len returns the number of elements in the slice. -func (x int64Slice) Len() int { return len(x) } - -// Less indicates whether the value at index i is less than the value at index j. -func (x int64Slice) Less(i, j int) bool { return x[i] < x[j] } - -// Swap swaps the values at indices i and j in place. -func (x int64Slice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -// Sort is a convenience method: x.Sort() calls Sort(x). -func (x int64Slice) Sort() { sort.Sort(x) } diff --git a/vendor/github.com/google/cel-go/common/types/util.go b/vendor/github.com/google/cel-go/common/types/util.go deleted file mode 100644 index 71662eee3..000000000 --- a/vendor/github.com/google/cel-go/common/types/util.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// IsUnknownOrError returns whether the input element ref.Val is an ErrType or UnknownType. -func IsUnknownOrError(val ref.Val) bool { - switch val.(type) { - case *Unknown, *Err: - return true - } - return false -} - -// IsPrimitiveType returns whether the input element ref.Val is a primitive type. -// Note, primitive types do not include well-known types such as Duration and Timestamp. -func IsPrimitiveType(val ref.Val) bool { - switch val.Type() { - case BoolType, BytesType, DoubleType, IntType, StringType, UintType: - return true - } - return false -} - -// Equal returns whether the two ref.Value are heterogeneously equivalent. -func Equal(lhs ref.Val, rhs ref.Val) ref.Val { - lNull := lhs == NullValue - rNull := rhs == NullValue - if lNull || rNull { - return Bool(lNull == rNull) - } - return lhs.Equal(rhs) -} diff --git a/vendor/github.com/google/cel-go/ext/BUILD.bazel b/vendor/github.com/google/cel-go/ext/BUILD.bazel deleted file mode 100644 index ef4f4ec3d..000000000 --- a/vendor/github.com/google/cel-go/ext/BUILD.bazel +++ /dev/null @@ -1,86 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "bindings.go", - "comprehensions.go", - "encoders.go", - "extension_option_factory.go", - "formatting.go", - "formatting_v2.go", - "guards.go", - "lists.go", - "math.go", - "native.go", - "protos.go", - "regex.go", - "sets.go", - "strings.go", - ], - importpath = "github.com/google/cel-go/ext", - visibility = ["//visibility:public"], - deps = [ - "//cel:go_default_library", - "//checker:go_default_library", - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/decls:go_default_library", - "//common/env:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/pb:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "//interpreter:go_default_library", - "//parser:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_x_text//language:go_default_library", - "@org_golang_x_text//message:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "bindings_test.go", - "comprehensions_test.go", - "encoders_test.go", - "extension_option_factory_test.go", - "formatting_test.go", - "formatting_v2_test.go", - "lists_test.go", - "math_test.go", - "native_test.go", - "protos_test.go", - "regex_test.go", - "sets_test.go", - "strings_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//cel:go_default_library", - "//checker:go_default_library", - "//common:go_default_library", - "//common/env:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "//test:go_default_library", - "//test/proto2pb:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/ext/README.md b/vendor/github.com/google/cel-go/ext/README.md deleted file mode 100644 index 41ae6a314..000000000 --- a/vendor/github.com/google/cel-go/ext/README.md +++ /dev/null @@ -1,947 +0,0 @@ -# Extensions - -CEL extensions are a related set of constants, functions, macros, or other -features which may not be covered by the core CEL spec. - -## Bindings - -Returns a cel.EnvOption to configure support for local variable bindings -in expressions. - -### Cel.Bind - -Binds a simple identifier to an initialization expression which may be used -in a subsequent result expression. Bindings may also be nested within each -other. - - cel.bind(, , ) - -Examples: - - cel.bind(a, 'hello', - cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello" - - // Avoid a list allocation within the exists comprehension. - cel.bind(valid_values, [a, b, c], - [d, e, f].exists(elem, elem in valid_values)) - -Local bindings are not guaranteed to be evaluated before use. - -## Encoders - -Encoding utilities for marshalling data into standardized representations. - -### Base64.Decode - -Decodes base64-encoded string to bytes. - -This function will return an error if the string input is not -base64-encoded. - - base64.decode() -> - -Examples: - - base64.decode('aGVsbG8=') // return b'hello' - base64.decode('aGVsbG8') // error - -### Base64.Encode - -Encodes bytes to a base64-encoded string. - - base64.encode() -> - -Example: - - base64.encode(b'hello') // return 'aGVsbG8=' - -## Math - -Math helper macros and functions. - -Note, all macros use the 'math' namespace; however, at the time of macro -expansion the namespace looks just like any other identifier. If you are -currently using a variable named 'math', the macro will likely work just as -intended; however, there is some chance for collision. - -### Math.Greatest - -Returns the greatest valued number present in the arguments to the macro. - -Greatest is a variable argument count macro which must take at least one -argument. Simple numeric and list literals are supported as valid argument -types; however, other literals will be flagged as errors during macro -expansion. If the argument expression does not resolve to a numeric or -list(numeric) type during type-checking, or during runtime then an error -will be produced. If a list argument is empty, this too will produce an -error. - - math.greatest(, ...) -> - -Examples: - - math.greatest(1) // 1 - math.greatest(1u, 2u) // 2u - math.greatest(-42.0, -21.5, -100.0) // -21.5 - math.greatest([-42.0, -21.5, -100.0]) // -21.5 - math.greatest(numbers) // numbers must be list(numeric) - - math.greatest() // parse error - math.greatest('string') // parse error - math.greatest(a, b) // check-time error if a or b is non-numeric - math.greatest(dyn('string')) // runtime error - -### Math.Least - -Returns the least valued number present in the arguments to the macro. - -Least is a variable argument count macro which must take at least one -argument. Simple numeric and list literals are supported as valid argument -types; however, other literals will be flagged as errors during macro -expansion. If the argument expression does not resolve to a numeric or -list(numeric) type during type-checking, or during runtime then an error -will be produced. If a list argument is empty, this too will produce an -error. - - math.least(, ...) -> - -Examples: - - math.least(1) // 1 - math.least(1u, 2u) // 1u - math.least(-42.0, -21.5, -100.0) // -100.0 - math.least([-42.0, -21.5, -100.0]) // -100.0 - math.least(numbers) // numbers must be list(numeric) - - math.least() // parse error - math.least('string') // parse error - math.least(a, b) // check-time error if a or b is non-numeric - math.least(dyn('string')) // runtime error - -### Math.BitOr - -Introduced at version: 1 - -Performs a bitwise-OR operation over two int or uint values. - - math.bitOr(, ) -> - math.bitOr(, ) -> - -Examples: - - math.bitOr(1u, 2u) // returns 3u - math.bitOr(-2, -4) // returns -2 - -### Math.BitAnd - -Introduced at version: 1 - -Performs a bitwise-AND operation over two int or uint values. - - math.bitAnd(, ) -> - math.bitAnd(, ) -> - -Examples: - - math.bitAnd(3u, 2u) // return 2u - math.bitAnd(3, 5) // returns 3 - math.bitAnd(-3, -5) // returns -7 - -### Math.BitXor - -Introduced at version: 1 - - math.bitXor(, ) -> - math.bitXor(, ) -> - -Performs a bitwise-XOR operation over two int or uint values. - -Examples: - - math.bitXor(3u, 5u) // returns 6u - math.bitXor(1, 3) // returns 2 - -### Math.BitNot - -Introduced at version: 1 - -Function which accepts a single int or uint and performs a bitwise-NOT -ones-complement of the given binary value. - - math.bitNot() -> - math.bitNot() -> - -Examples - - math.bitNot(1) // returns -1 - math.bitNot(-1) // return 0 - math.bitNot(0u) // returns 18446744073709551615u - -### Math.BitShiftLeft - -Introduced at version: 1 - -Perform a left shift of bits on the first parameter, by the amount of bits -specified in the second parameter. The first parameter is either a uint or -an int. The second parameter must be an int. - -When the second parameter is 64 or greater, 0 will be always be returned -since the number of bits shifted is greater than or equal to the total bit -length of the number being shifted. Negative valued bit shifts will result -in a runtime error. - - math.bitShiftLeft(, ) -> - math.bitShiftLeft(, ) -> - -Examples - - math.bitShiftLeft(1, 2) // returns 4 - math.bitShiftLeft(-1, 2) // returns -4 - math.bitShiftLeft(1u, 2) // return 4u - math.bitShiftLeft(1u, 200) // returns 0u - -### Math.BitShiftRight - -Introduced at version: 1 - -Perform a right shift of bits on the first parameter, by the amount of bits -specified in the second parameter. The first parameter is either a uint or -an int. The second parameter must be an int. - -When the second parameter is 64 or greater, 0 will always be returned since -the number of bits shifted is greater than or equal to the total bit length -of the number being shifted. Negative valued bit shifts will result in a -runtime error. - -The sign bit extension will not be preserved for this operation: vacant bits -on the left are filled with 0. - - math.bitShiftRight(, ) -> - math.bitShiftRight(, ) -> - -Examples - - math.bitShiftRight(1024, 2) // returns 256 - math.bitShiftRight(1024u, 2) // returns 256u - math.bitShiftRight(1024u, 64) // returns 0u - -### Math.Ceil - -Introduced at version: 1 - -Compute the ceiling of a double value. - - math.ceil() -> - -Examples: - - math.ceil(1.2) // returns 2.0 - math.ceil(-1.2) // returns -1.0 - -### Math.Floor - -Introduced at version: 1 - -Compute the floor of a double value. - - math.floor() -> - -Examples: - - math.floor(1.2) // returns 1.0 - math.floor(-1.2) // returns -2.0 - -### Math.Round - -Introduced at version: 1 - -Rounds the double value to the nearest whole number with ties rounding away -from zero, e.g. 1.5 -> 2.0, -1.5 -> -2.0. - - math.round() -> - -Examples: - - math.round(1.2) // returns 1.0 - math.round(1.5) // returns 2.0 - math.round(-1.5) // returns -2.0 - -### Math.Trunc - -Introduced at version: 1 - -Truncates the fractional portion of the double value. - - math.trunc() -> - -Examples: - - math.trunc(-1.3) // returns -1.0 - math.trunc(1.3) // returns 1.0 - -### Math.Abs - -Introduced at version: 1 - -Returns the absolute value of the numeric type provided as input. If the -value is NaN, the output is NaN. If the input is int64 min, the function -will result in an overflow error. - - math.abs() -> - math.abs() -> - math.abs() -> - -Examples: - - math.abs(-1) // returns 1 - math.abs(1) // returns 1 - math.abs(-9223372036854775808) // overlflow error - -### Math.Sign - -Introduced at version: 1 - -Returns the sign of the numeric type, either -1, 0, 1 as an int, double, or -uint depending on the overload. For floating point values, if NaN is -provided as input, the output is also NaN. The implementation does not -differentiate between positive and negative zero. - - math.sign() -> - math.sign() -> - math.sign() -> - -Examples: - - math.sign(-42) // returns -1 - math.sign(0) // returns 0 - math.sign(42) // returns 1 - -### Math.IsInf - -Introduced at version: 1 - -Returns true if the input double value is -Inf or +Inf. - - math.isInf() -> - -Examples: - - math.isInf(1.0/0.0) // returns true - math.isInf(1.2) // returns false - -### Math.IsNaN - -Introduced at version: 1 - -Returns true if the input double value is NaN, false otherwise. - - math.isNaN() -> - -Examples: - - math.isNaN(0.0/0.0) // returns true - math.isNaN(1.2) // returns false - -### Math.IsFinite - -Introduced at version: 1 - -Returns true if the value is a finite number. Equivalent in behavior to: -!math.isNaN(double) && !math.isInf(double) - - math.isFinite() -> - -Examples: - - math.isFinite(0.0/0.0) // returns false - math.isFinite(1.2) // returns true - -### Math.Sqrt - -Introduced at version: 2 - -Returns the square root of the given input as double -Throws error for negative or non-numeric inputs - - math.sqrt() -> - math.sqrt() -> - math.sqrt() -> - -Examples: - - math.sqrt(81) // returns 9.0 - math.sqrt(985.25) // returns 31.388692231439016 - math.sqrt(-15) // returns NaN - -## Protos - -Protos configure extended macros and functions for proto manipulation. - -Note, all macros use the 'proto' namespace; however, at the time of macro -expansion the namespace looks just like any other identifier. If you are -currently using a variable named 'proto', the macro will likely work just as -you intend; however, there is some chance for collision. - -### Protos.GetExt - -Macro which generates a select expression that retrieves an extension field -from the input proto2 syntax message. If the field is not set, the default -value forthe extension field is returned according to safe-traversal semantics. - - proto.getExt(, ) -> - -Example: - - proto.getExt(msg, google.expr.proto2.test.int32_ext) // returns int value - -### Protos.HasExt - -Macro which generates a test-only select expression that determines whether -an extension field is set on a proto2 syntax message. - - proto.hasExt(, ) -> - -Example: - - proto.hasExt(msg, google.expr.proto2.test.int32_ext) // returns true || false - -## Lists - -Extended functions for list manipulation. As a general note, all indices are -zero-based. - -### Distinct - -**Introduced in version 2 (cost support in version 3)** - -Returns the distinct elements of a list. - - .distinct() -> - -Examples: - - [1, 2, 2, 3, 3, 3].distinct() // return [1, 2, 3] - ["b", "b", "c", "a", "c"].distinct() // return ["b", "c", "a"] - [1, "b", 2, "b"].distinct() // return [1, "b", 2] - -### Flatten - -**Introduced in version 1 (cost support in version 3)** - -Flattens a list recursively. -If an optional depth is provided, the list is flattened to a the specificied level. -A negative depth value will result in an error. - - .flatten() -> - .flatten(, ) -> - -Examples: - - [1,[2,3],[4]].flatten() // return [1, 2, 3, 4] - [1,[2,[3,4]]].flatten() // return [1, 2, [3, 4]] - [1,2,[],[],[3,4]].flatten() // return [1, 2, 3, 4] - [1,[2,[3,[4]]]].flatten(2) // return [1, 2, 3, [4]] - [1,[2,[3,[4]]]].flatten(-1) // error - -### Range - -**Introduced in version 2 (cost support in version 3)** - -Returns a list of integers from 0 to n-1. - - lists.range() -> - -Examples: - - lists.range(5) -> [0, 1, 2, 3, 4] - - -### Reverse - -**Introduced in version 2 (cost support in version 3)** - -Returns the elements of a list in reverse order. - - .reverse() -> - -Examples: - - [5, 3, 1, 2].reverse() // return [2, 1, 3, 5] - - -### Slice - -**Introduced in version 0 (cost support in version 3)** - -Returns a new sub-list using the indexes provided. - - .slice(, ) -> - -Examples: - - [1,2,3,4].slice(1, 3) // return [2, 3] - [1,2,3,4].slice(2, 4) // return [3, 4] - -### Sort - -**Introduced in version 2 (cost support in version 3)** - -Sorts a list with comparable elements. If the element type is not comparable -or the element types are not the same, the function will produce an error. - - .sort() -> - T in {int, uint, double, bool, duration, timestamp, string, bytes} - -Examples: - - [3, 2, 1].sort() // return [1, 2, 3] - ["b", "c", "a"].sort() // return ["a", "b", "c"] - [1, "b"].sort() // error - [[1, 2, 3]].sort() // error - -### SortBy - -**Introduced in version 2 (cost support in version 3)** - -Sorts a list by a key value, i.e., the order is determined by the result of -an expression applied to each element of the list. - - .sortBy(, ) -> - keyExpr returns a value in {int, uint, double, bool, duration, timestamp, string, bytes} - -Examples: - - [ - Player { name: "foo", score: 0 }, - Player { name: "bar", score: -10 }, - Player { name: "baz", score: 1000 }, - ].sortBy(e, e.score).map(e, e.name) - == ["bar", "foo", "baz"] - -### Last - -**Introduced in the OptionalTypes library version 2** - -Returns an optional with the last value from the list or `optional.None` if the -list is empty. - - .last() -> - -Examples: - - [1, 2, 3].last().value() == 3 - [].last().orValue('test') == 'test' - -This is syntactic sugar for list[list.size()-1]. - -### First - -**Introduced in the OptionalTypes library version 2** - -Returns an optional with the first value from the list or `optional.None` if the -list is empty. - - .first() -> - -Examples: - - [1, 2, 3].first().value() == 1 - [].first().orValue('test') == 'test' - -## Sets - -Sets provides set relationship tests. - -There is no set type within CEL, and while one may be introduced in the -future, there are cases where a `list` type is known to behave like a set. -For such cases, this library provides some basic functionality for -determining set containment, equivalence, and intersection. - -### Sets.Contains - -Returns whether the first list argument contains all elements in the second -list argument. The list may contain elements of any type and standard CEL -equality is used to determine whether a value exists in both lists. If the -second list is empty, the result will always return true. - - sets.contains(list(T), list(T)) -> bool - -Examples: - - sets.contains([], []) // true - sets.contains([], [1]) // false - sets.contains([1, 2, 3, 4], [2, 3]) // true - sets.contains([1, 2.0, 3u], [1.0, 2u, 3]) // true - -### Sets.Equivalent - -Returns whether the first and second list are set equivalent. Lists are set -equivalent if for every item in the first list, there is an element in the -second which is equal. The lists may not be of the same size as they do not -guarantee the elements within them are unique, so size does not factor into -the computation. - - sets.equivalent(list(T), list(T)) -> bool - -Examples: - - sets.equivalent([], []) // true - sets.equivalent([1], [1, 1]) // true - sets.equivalent([1], [1u, 1.0]) // true - sets.equivalent([1, 2, 3], [3u, 2.0, 1]) // true - -### Sets.Intersects - -Returns whether the first list has at least one element whose value is equal -to an element in the second list. If either list is empty, the result will -be false. - - sets.intersects(list(T), list(T)) -> bool - -Examples: - - sets.intersects([1], []) // false - sets.intersects([1], [1, 2]) // true - sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true - -## Strings - -Extended functions for string manipulation. As a general note, all indices are -zero-based. - -### CharAt - -Returns the character at the given position. If the position is negative, or -greater than the length of the string, the function will produce an error: - - .charAt() -> - -Examples: - - 'hello'.charAt(4) // return 'o' - 'hello'.charAt(5) // return '' - 'hello'.charAt(-1) // error - -### IndexOf - -Returns the integer index of the first occurrence of the search string. If the -search string is not found the function returns -1. - -The function also accepts an optional position from which to begin the -substring search. If the substring is the empty string, the index where the -search starts is returned (zero or custom). - - .indexOf() -> - .indexOf(, ) -> - -Examples: - - 'hello mellow'.indexOf('') // returns 0 - 'hello mellow'.indexOf('ello') // returns 1 - 'hello mellow'.indexOf('jello') // returns -1 - 'hello mellow'.indexOf('', 2) // returns 2 - 'hello mellow'.indexOf('ello', 2) // returns 7 - 'hello mellow'.indexOf('ello', 20) // returns -1 - 'hello mellow'.indexOf('ello', -1) // error - -### Join - -Returns a new string where the elements of string list are concatenated. - -The function also accepts an optional separator which is placed between -elements in the resulting string. - - >.join() -> - >.join() -> - -Examples: - - ['hello', 'mellow'].join() // returns 'hellomellow' - ['hello', 'mellow'].join(' ') // returns 'hello mellow' - [].join() // returns '' - [].join('/') // returns '' - -### LastIndexOf - -Returns the integer index of the last occurrence of the search string. If the -search string is not found the function returns -1. - -The function also accepts an optional position which represents the last index -to be considered as the beginning of the substring match. If the substring is -the empty string, the index where the search starts is returned (string length -or custom). - - .lastIndexOf() -> - .lastIndexOf(, ) -> - -Examples: - - 'hello mellow'.lastIndexOf('') // returns 12 - 'hello mellow'.lastIndexOf('ello') // returns 7 - 'hello mellow'.lastIndexOf('jello') // returns -1 - 'hello mellow'.lastIndexOf('ello', 6) // returns 1 - 'hello mellow'.lastIndexOf('ello', 20) // returns -1 - 'hello mellow'.lastIndexOf('ello', -1) // error - -### LowerAscii - -Returns a new string where all ASCII characters are lower-cased. - -This function does not perform Unicode case-mapping for characters outside the -ASCII range. - - .lowerAscii() -> - -Examples: - - 'TacoCat'.lowerAscii() // returns 'tacocat' - 'TacoCÆt Xii'.lowerAscii() // returns 'tacocÆt xii' - -### Quote - -**Introduced in version 1** - -Takes the given string and makes it safe to print (without any formatting due to escape sequences). -If any invalid UTF-8 characters are encountered, they are replaced with \uFFFD. - - strings.quote() - -Examples: - - strings.quote('single-quote with "double quote"') // returns '"single-quote with \"double quote\""' - strings.quote("two escape sequences \a\n") // returns '"two escape sequences \\a\\n"' - -### Replace - -Returns a new string based on the target, which replaces the occurrences of a -search string with a replacement string if present. The function accepts an -optional limit on the number of substring replacements to be made. - -When the replacement limit is 0, the result is the original string. When the -limit is a negative number, the function behaves the same as replace all. - - .replace(, ) -> - .replace(, , ) -> - -Examples: - - 'hello hello'.replace('he', 'we') // returns 'wello wello' - 'hello hello'.replace('he', 'we', -1) // returns 'wello wello' - 'hello hello'.replace('he', 'we', 1) // returns 'wello hello' - 'hello hello'.replace('he', 'we', 0) // returns 'hello hello' - -### Split - -Returns a list of strings split from the input by the given separator. The -function accepts an optional argument specifying a limit on the number of -substrings produced by the split. - -When the split limit is 0, the result is an empty list. When the limit is 1, -the result is the target string to split. When the limit is a negative -number, the function behaves the same as split all. - - .split() -> > - .split(, ) -> > - -Examples: - - 'hello hello hello'.split(' ') // returns ['hello', 'hello', 'hello'] - 'hello hello hello'.split(' ', 0) // returns [] - 'hello hello hello'.split(' ', 1) // returns ['hello hello hello'] - 'hello hello hello'.split(' ', 2) // returns ['hello', 'hello hello'] - 'hello hello hello'.split(' ', -1) // returns ['hello', 'hello', 'hello'] - -### Substring - -Returns the substring given a numeric range corresponding to character -positions. Optionally may omit the trailing range for a substring from a given -character position until the end of a string. - -Character offsets are 0-based with an inclusive start range and exclusive end -range. It is an error to specify an end range that is lower than the start -range, or for either the start or end index to be negative or exceed the string -length. - - .substring() -> - .substring(, ) -> - -Examples: - - 'tacocat'.substring(4) // returns 'cat' - 'tacocat'.substring(0, 4) // returns 'taco' - 'tacocat'.substring(-1) // error - 'tacocat'.substring(2, 1) // error - -### Trim - -Returns a new string which removes the leading and trailing whitespace in the -target string. The trim function uses the Unicode definition of whitespace -which does not include the zero-width spaces. See: -https://en.wikipedia.org/wiki/Whitespace_character#Unicode - - .trim() -> - -Examples: - - ' \ttrim\n '.trim() // returns 'trim' - -### UpperAscii - -Returns a new string where all ASCII characters are upper-cased. - -This function does not perform Unicode case-mapping for characters outside the -ASCII range. - - .upperAscii() -> - -Examples: - - 'TacoCat'.upperAscii() // returns 'TACOCAT' - 'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII' - -### Reverse - -Returns a new string whose characters are the same as the target string, only formatted in -reverse order. -This function relies on converting strings to rune arrays in order to reverse. -It can be located in Version 3 of strings. - - .reverse() -> - -Examples: - - 'gums'.reverse() // returns 'smug' - 'John Smith'.reverse() // returns 'htimS nhoJ' - -## TwoVarComprehensions - -TwoVarComprehensions introduces support for two-variable comprehensions. - -The two-variable form of comprehensions looks similar to the one-variable -counterparts. Where possible, the same macro names were used and additional -macro signatures added. The notable distinction for two-variable comprehensions -is the introduction of `transformList`, `transformMap`, and `transformMapEntry` -support for list and map types rather than the more traditional `map` and -`filter` macros. - -### All - -Comprehension which tests whether all elements in the list or map satisfy a -given predicate. The `all` macro evaluates in a manner consistent with logical -AND and will short-circuit when encountering a `false` value. - - .all(indexVar, valueVar, ) -> bool - .all(keyVar, valueVar, ) -> bool - -Examples: - - [1, 2, 3].all(i, j, i < j) // returns true - {'hello': 'world', 'taco': 'taco'}.all(k, v, k != v) // returns false - - // Combines two-variable comprehension with single variable - {'h': ['hello', 'hi'], 'j': ['joke', 'jog']} - .all(k, vals, vals.all(v, v.startsWith(k))) // returns true - -### Exists - -Comprehension which tests whether any element in a list or map exists which -satisfies a given predicate. The `exists` macro evaluates in a manner consistent -with logical OR and will short-circuit when encountering a `true` value. - - .exists(indexVar, valueVar, ) -> bool - .exists(keyVar, valueVar, ) -> bool - -Examples: - - {'greeting': 'hello', 'farewell': 'goodbye'} - .exists(k, v, k.startsWith('good') || v.endsWith('bye')) // returns true - [1, 2, 4, 8, 16].exists(i, v, v == 1024 && i == 10) // returns false - -### ExistsOne - -Comprehension which tests whether exactly one element in a list or map exists -which satisfies a given predicate expression. This comprehension does not -short-circuit in keeping with the one-variable exists one macro semantics. - - .existsOne(indexVar, valueVar, ) - .existsOne(keyVar, valueVar, ) - -This macro may also be used with the `exists_one` function name, for -compatibility with the one-variable macro of the same name. - -Examples: - - [1, 2, 1, 3, 1, 4].existsOne(i, v, i == 1 || v == 1) // returns false - [1, 1, 2, 2, 3, 3].existsOne(i, v, i == 2 && v == 2) // returns true - {'i': 0, 'j': 1, 'k': 2}.existsOne(i, v, i == 'l' || v == 1) // returns true - -### TransformList - -Comprehension which converts a map or a list into a list value. The output -expression of the comprehension determines the contents of the output list. -Elements in the list may optionally be filtered according to a predicate -expression, where elements that satisfy the predicate are transformed. - - .transformList(indexVar, valueVar, ) - .transformList(indexVar, valueVar, , ) - .transformList(keyVar, valueVar, ) - .transformList(keyVar, valueVar, , ) - -Examples: - - [1, 2, 3].transformList(indexVar, valueVar, - (indexVar * valueVar) + valueVar) // returns [1, 4, 9] - [1, 2, 3].transformList(indexVar, valueVar, indexVar % 2 == 0 - (indexVar * valueVar) + valueVar) // returns [1, 9] - {'greeting': 'hello', 'farewell': 'goodbye'} - .transformList(k, _, k) // returns ['greeting', 'farewell'] - {'greeting': 'hello', 'farewell': 'goodbye'} - .transformList(_, v, v) // returns ['hello', 'goodbye'] - -### TransformMap - -Comprehension which converts a map or a list into a map value. The output -expression of the comprehension determines the value of the output map entry; -however, the key remains fixed. Elements in the map may optionally be filtered -according to a predicate expression, where elements that satisfy the predicate -are transformed. - - .transformMap(indexVar, valueVar, ) - .transformMap(indexVar, valueVar, , ) - .transformMap(keyVar, valueVar, ) - .transformMap(keyVar, valueVar, , ) - -Examples: - - [1, 2, 3].transformMap(indexVar, valueVar, - (indexVar * valueVar) + valueVar) // returns {0: 1, 1: 4, 2: 9} - [1, 2, 3].transformMap(indexVar, valueVar, indexVar % 2 == 0 - (indexVar * valueVar) + valueVar) // returns {0: 1, 2: 9} - {'greeting': 'hello'}.transformMap(k, v, v + '!') // returns {'greeting': 'hello!'} - -### TransformMapEntry - -Comprehension which converts a map or a list into a map value; however, this -transform expects the entry expression be a map literal. If the transform -produces an entry which duplicates a key in the target map, the comprehension -will error. Note, that key equality is determined using CEL equality which -asserts that numeric values which are equal, even if they don't have the same -type will cause a key collision. - -Elements in the map may optionally be filtered according to a predicate -expression, where elements that satisfy the predicate are transformed. - - .transformMap(indexVar, valueVar, ) - .transformMap(indexVar, valueVar, , ) - .transformMap(keyVar, valueVar, ) - .transformMap(keyVar, valueVar, , ) - -Examples: - - // returns {'hello': 'greeting'} - {'greeting': 'hello'}.transformMapEntry(keyVar, valueVar, {valueVar: keyVar}) - // reverse lookup, require all values in list be unique - [1, 2, 3].transformMapEntry(indexVar, valueVar, {valueVar: indexVar}) - - {'greeting': 'aloha', 'farewell': 'aloha'} - .transformMapEntry(keyVar, valueVar, {valueVar: keyVar}) // error, duplicate key diff --git a/vendor/github.com/google/cel-go/ext/bindings.go b/vendor/github.com/google/cel-go/ext/bindings.go deleted file mode 100644 index 63942b85c..000000000 --- a/vendor/github.com/google/cel-go/ext/bindings.go +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "errors" - "fmt" - "math" - "strconv" - "strings" - "sync" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/interpreter" -) - -// Bindings returns a cel.EnvOption to configure support for local variable -// bindings in expressions. -// -// # Cel.Bind -// -// Binds a simple identifier to an initialization expression which may be used -// in a subsequenct result expression. Bindings may also be nested within each -// other. -// -// cel.bind(, , ) -// -// Examples: -// -// cel.bind(a, 'hello', -// cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello" -// -// // Avoid a list allocation within the exists comprehension. -// cel.bind(valid_values, [a, b, c], -// [d, e, f].exists(elem, elem in valid_values)) -// -// Local bindings are not guaranteed to be evaluated before use. -func Bindings(options ...BindingsOption) cel.EnvOption { - b := &celBindings{version: math.MaxUint32} - for _, o := range options { - b = o(b) - } - return cel.Lib(b) -} - -const ( - celNamespace = "cel" - bindMacro = "bind" - blockFunc = "@block" - unusedIterVar = "#unused" -) - -// BindingsOption declares a functional operator for configuring the Bindings library behavior. -type BindingsOption func(*celBindings) *celBindings - -// BindingsVersion sets the version of the bindings library to an explicit version. -func BindingsVersion(version uint32) BindingsOption { - return func(lib *celBindings) *celBindings { - lib.version = version - return lib - } -} - -type celBindings struct { - version uint32 -} - -func (*celBindings) LibraryName() string { - return "cel.lib.ext.cel.bindings" -} - -func (lib *celBindings) CompileOptions() []cel.EnvOption { - opts := []cel.EnvOption{ - cel.Macros( - // cel.bind(var, , ) - cel.ReceiverMacro(bindMacro, 3, celBind), - ), - } - if lib.version >= 1 { - // The cel.@block signature takes a list of subexpressions and a typed expression which is - // used as the output type. - paramType := cel.TypeParamType("T") - opts = append(opts, - cel.Function("cel.@block", - cel.Overload("cel_block_list", - []*cel.Type{cel.ListType(cel.DynType), paramType}, paramType)), - ) - opts = append(opts, cel.ASTValidators(blockValidationExemption{})) - } - return opts -} - -func (lib *celBindings) ProgramOptions() []cel.ProgramOption { - if lib.version >= 1 { - celBlockPlan := func(i interpreter.Interpretable) (interpreter.Interpretable, error) { - call, ok := i.(interpreter.InterpretableCall) - if !ok { - return i, nil - } - switch call.Function() { - case "cel.@block": - args := call.Args() - if len(args) != 2 { - return nil, fmt.Errorf("cel.@block expects two arguments, but got %d", len(args)) - } - expr := args[1] - // Non-empty block - if block, ok := args[0].(interpreter.InterpretableConstructor); ok { - slotExprs := block.InitVals() - return newDynamicBlock(slotExprs, expr), nil - } - // Constant valued block which can happen during runtime optimization. - if cons, ok := args[0].(interpreter.InterpretableConst); ok { - if cons.Value().Type() == types.ListType { - l := cons.Value().(traits.Lister) - if l.Size().Equal(types.IntZero) == types.True { - return args[1], nil - } - return newConstantBlock(l, expr), nil - } - } - return nil, errors.New("cel.@block expects a list constructor as the first argument") - default: - return i, nil - } - } - return []cel.ProgramOption{cel.CustomDecorator(celBlockPlan)} - } - return []cel.ProgramOption{} -} - -type blockValidationExemption struct{} - -// Name returns the name of the validator. -func (blockValidationExemption) Name() string { - return "cel.validator.cel_block" -} - -// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip -// during homogeneous aggregate literal type-checks. -func (blockValidationExemption) Configure(config cel.MutableValidatorConfig) error { - functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string) - functions = append(functions, "cel.@block") - return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions) -} - -// Validate is a no-op as the intent is to simply disable strong type-checks for list literals during -// when they occur within cel.@block calls as the arg types have already been validated. -func (blockValidationExemption) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) { -} - -func celBind(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(celNamespace, target) { - return nil, nil - } - varIdent := args[0] - varName := "" - switch varIdent.Kind() { - case ast.IdentKind: - varName = varIdent.AsIdent() - default: - return nil, mef.NewError(varIdent.ID(), "cel.bind() variable names must be simple identifiers") - } - varInit := args[1] - resultExpr := args[2] - return mef.NewComprehension( - mef.NewList(), - unusedIterVar, - varName, - varInit, - mef.NewLiteral(types.False), - mef.NewIdent(varName), - resultExpr, - ), nil -} - -func newDynamicBlock(slotExprs []interpreter.Interpretable, expr interpreter.Interpretable) interpreter.Interpretable { - bs := &dynamicBlock{ - slotExprs: slotExprs, - expr: expr, - } - bs.slotActivationPool = &sync.Pool{ - New: func() any { - slotCount := len(slotExprs) - sa := &dynamicSlotActivation{ - slotExprs: slotExprs, - slotCount: slotCount, - slotVals: make([]*slotVal, slotCount), - } - for i := 0; i < slotCount; i++ { - sa.slotVals[i] = &slotVal{} - } - return sa - }, - } - return bs -} - -type dynamicBlock struct { - slotExprs []interpreter.Interpretable - expr interpreter.Interpretable - slotActivationPool *sync.Pool -} - -// ID implements the Interpretable interface method. -func (b *dynamicBlock) ID() int64 { - return b.expr.ID() -} - -// Eval implements the Interpretable interface method. -func (b *dynamicBlock) Eval(activation cel.Activation) ref.Val { - sa := b.slotActivationPool.Get().(*dynamicSlotActivation) - sa.Activation = activation - defer b.clearSlots(sa) - return b.expr.Eval(sa) -} - -func (b *dynamicBlock) clearSlots(sa *dynamicSlotActivation) { - sa.reset() - b.slotActivationPool.Put(sa) -} - -type slotVal struct { - value *ref.Val - visited bool -} - -type dynamicSlotActivation struct { - cel.Activation - slotExprs []interpreter.Interpretable - slotCount int - slotVals []*slotVal -} - -// ResolveName implements the Activation interface method but handles variables prefixed with `@index` -// as special variables which exist within the slot-based memory of the cel.@block() where each slot -// refers to an expression which must be computed only once. -func (sa *dynamicSlotActivation) ResolveName(name string) (any, bool) { - if idx, found := matchSlot(name, sa.slotCount); found { - v := sa.slotVals[idx] - if v.visited { - // Return not found if the index expression refers to itself - if v.value == nil { - return nil, false - } - return *v.value, true - } - v.visited = true - val := sa.slotExprs[idx].Eval(sa) - v.value = &val - return val, true - } - return sa.Activation.ResolveName(name) -} - -func (sa *dynamicSlotActivation) reset() { - sa.Activation = nil - for _, sv := range sa.slotVals { - sv.visited = false - sv.value = nil - } -} - -func newConstantBlock(slots traits.Lister, expr interpreter.Interpretable) interpreter.Interpretable { - count := slots.Size().(types.Int) - return &constantBlock{slots: slots, slotCount: int(count), expr: expr} -} - -type constantBlock struct { - slots traits.Lister - slotCount int - expr interpreter.Interpretable -} - -// ID implements the interpreter.Interpretable interface method. -func (b *constantBlock) ID() int64 { - return b.expr.ID() -} - -// Eval implements the interpreter.Interpretable interface method, and will proxy @index prefixed variable -// lookups into a set of constant slots determined from the plan step. -func (b *constantBlock) Eval(activation cel.Activation) ref.Val { - vars := constantSlotActivation{Activation: activation, slots: b.slots, slotCount: b.slotCount} - return b.expr.Eval(vars) -} - -type constantSlotActivation struct { - cel.Activation - slots traits.Lister - slotCount int -} - -// ResolveName implements Activation interface method and proxies @index prefixed lookups into the slot -// activation associated with the block scope. -func (sa constantSlotActivation) ResolveName(name string) (any, bool) { - if idx, found := matchSlot(name, sa.slotCount); found { - return sa.slots.Get(types.Int(idx)), true - } - return sa.Activation.ResolveName(name) -} - -func matchSlot(name string, slotCount int) (int, bool) { - if idx, found := strings.CutPrefix(name, indexPrefix); found { - idx, err := strconv.Atoi(idx) - // Return not found if the index is not numeric - if err != nil { - return -1, false - } - // Return not found if the index is not a valid slot - if idx < 0 || idx >= slotCount { - return -1, false - } - return idx, true - } - return -1, false -} - -var ( - indexPrefix = "@index" -) diff --git a/vendor/github.com/google/cel-go/ext/comprehensions.go b/vendor/github.com/google/cel-go/ext/comprehensions.go deleted file mode 100644 index f08d8f9da..000000000 --- a/vendor/github.com/google/cel-go/ext/comprehensions.go +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "fmt" - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/parser" -) - -const ( - mapInsert = "cel.@mapInsert" - mapInsertOverloadMap = "@mapInsert_map_map" - mapInsertOverloadKeyValue = "@mapInsert_map_key_value" -) - -// TwoVarComprehensions introduces support for two-variable comprehensions. -// -// The two-variable form of comprehensions looks similar to the one-variable counterparts. -// Where possible, the same macro names were used and additional macro signatures added. -// The notable distinction for two-variable comprehensions is the introduction of -// `transformList`, `transformMap`, and `transformMapEntry` support for list and map types -// rather than the more traditional `map` and `filter` macros. -// -// # All -// -// Comprehension which tests whether all elements in the list or map satisfy a given -// predicate. The `all` macro evaluates in a manner consistent with logical AND and will -// short-circuit when encountering a `false` value. -// -// .all(indexVar, valueVar, ) -> bool -// .all(keyVar, valueVar, ) -> bool -// -// Examples: -// -// [1, 2, 3].all(i, j, i < j) // returns true -// {'hello': 'world', 'taco': 'taco'}.all(k, v, k != v) // returns false -// -// // Combines two-variable comprehension with single variable -// {'h': ['hello', 'hi'], 'j': ['joke', 'jog']} -// .all(k, vals, vals.all(v, v.startsWith(k))) // returns true -// -// # Exists -// -// Comprehension which tests whether any element in a list or map exists which satisfies -// a given predicate. The `exists` macro evaluates in a manner consistent with logical OR -// and will short-circuit when encountering a `true` value. -// -// .exists(indexVar, valueVar, ) -> bool -// .exists(keyVar, valueVar, ) -> bool -// -// Examples: -// -// {'greeting': 'hello', 'farewell': 'goodbye'} -// .exists(k, v, k.startsWith('good') || v.endsWith('bye')) // returns true -// [1, 2, 4, 8, 16].exists(i, v, v == 1024 && i == 10) // returns false -// -// # ExistsOne -// -// Comprehension which tests whether exactly one element in a list or map exists which -// satisfies a given predicate expression. This comprehension does not short-circuit in -// keeping with the one-variable exists one macro semantics. -// -// .existsOne(indexVar, valueVar, ) -// .existsOne(keyVar, valueVar, ) -// -// This macro may also be used with the `exists_one` function name, for compatibility -// with the one-variable macro of the same name. -// -// Examples: -// -// [1, 2, 1, 3, 1, 4].existsOne(i, v, i == 1 || v == 1) // returns false -// [1, 1, 2, 2, 3, 3].existsOne(i, v, i == 2 && v == 2) // returns true -// {'i': 0, 'j': 1, 'k': 2}.existsOne(i, v, i == 'l' || v == 1) // returns true -// -// # TransformList -// -// Comprehension which converts a map or a list into a list value. The output expression -// of the comprehension determines the contents of the output list. Elements in the list -// may optionally be filtered according to a predicate expression, where elements that -// satisfy the predicate are transformed. -// -// .transformList(indexVar, valueVar, ) -// .transformList(indexVar, valueVar, , ) -// .transformList(keyVar, valueVar, ) -// .transformList(keyVar, valueVar, , ) -// -// Examples: -// -// [1, 2, 3].transformList(indexVar, valueVar, -// (indexVar * valueVar) + valueVar) // returns [1, 4, 9] -// [1, 2, 3].transformList(indexVar, valueVar, indexVar % 2 == 0 -// (indexVar * valueVar) + valueVar) // returns [1, 9] -// {'greeting': 'hello', 'farewell': 'goodbye'} -// .transformList(k, _, k) // returns ['greeting', 'farewell'] -// {'greeting': 'hello', 'farewell': 'goodbye'} -// .transformList(_, v, v) // returns ['hello', 'goodbye'] -// -// # TransformMap -// -// Comprehension which converts a map or a list into a map value. The output expression -// of the comprehension determines the value of the output map entry; however, the key -// remains fixed. Elements in the map may optionally be filtered according to a predicate -// expression, where elements that satisfy the predicate are transformed. -// -// .transformMap(indexVar, valueVar, ) -// .transformMap(indexVar, valueVar, , ) -// .transformMap(keyVar, valueVar, ) -// .transformMap(keyVar, valueVar, , ) -// -// Examples: -// -// [1, 2, 3].transformMap(indexVar, valueVar, -// (indexVar * valueVar) + valueVar) // returns {0: 1, 1: 4, 2: 9} -// [1, 2, 3].transformMap(indexVar, valueVar, indexVar % 2 == 0 -// (indexVar * valueVar) + valueVar) // returns {0: 1, 2: 9} -// {'greeting': 'hello'}.transformMap(k, v, v + '!') // returns {'greeting': 'hello!'} -// -// # TransformMapEntry -// -// Comprehension which converts a map or a list into a map value; however, this transform -// expects the entry expression be a map literal. If the tranform produces an entry which -// duplicates a key in the target map, the comprehension will error. Note, that key -// equality is determined using CEL equality which asserts that numeric values which are -// equal, even if they don't have the same type will cause a key collision. -// -// Elements in the map may optionally be filtered according to a predicate expression, where -// elements that satisfy the predicate are transformed. -// -// .transformMap(indexVar, valueVar, ) -// .transformMap(indexVar, valueVar, , ) -// .transformMap(keyVar, valueVar, ) -// .transformMap(keyVar, valueVar, , ) -// -// Examples: -// -// // returns {'hello': 'greeting'} -// {'greeting': 'hello'}.transformMapEntry(keyVar, valueVar, {valueVar: keyVar}) -// // reverse lookup, require all values in list be unique -// [1, 2, 3].transformMapEntry(indexVar, valueVar, {valueVar: indexVar}) -// -// {'greeting': 'aloha', 'farewell': 'aloha'} -// .transformMapEntry(keyVar, valueVar, {valueVar: keyVar}) // error, duplicate key -func TwoVarComprehensions(options ...TwoVarComprehensionsOption) cel.EnvOption { - l := &compreV2Lib{version: math.MaxUint32} - for _, o := range options { - l = o(l) - } - return cel.Lib(l) -} - -// TwoVarComprehensionsOption declares a functional operator for configuring two-variable comprehensions. -type TwoVarComprehensionsOption func(*compreV2Lib) *compreV2Lib - -// TwoVarComprehensionsVersion sets the library version for two-variable comprehensions. -func TwoVarComprehensionsVersion(version uint32) TwoVarComprehensionsOption { - return func(lib *compreV2Lib) *compreV2Lib { - lib.version = version - return lib - } -} - -type compreV2Lib struct { - version uint32 -} - -// LibraryName implements that SingletonLibrary interface method. -func (*compreV2Lib) LibraryName() string { - return "cel.lib.ext.comprev2" -} - -// CompileOptions implements the cel.Library interface method. -func (*compreV2Lib) CompileOptions() []cel.EnvOption { - kType := cel.TypeParamType("K") - vType := cel.TypeParamType("V") - mapKVType := cel.MapType(kType, vType) - opts := []cel.EnvOption{ - cel.Macros( - cel.ReceiverMacro("all", 3, quantifierAll), - cel.ReceiverMacro("exists", 3, quantifierExists), - cel.ReceiverMacro("existsOne", 3, quantifierExistsOne), - cel.ReceiverMacro("exists_one", 3, quantifierExistsOne), - cel.ReceiverMacro("transformList", 3, transformList), - cel.ReceiverMacro("transformList", 4, transformList), - cel.ReceiverMacro("transformMap", 3, transformMap), - cel.ReceiverMacro("transformMap", 4, transformMap), - cel.ReceiverMacro("transformMapEntry", 3, transformMapEntry), - cel.ReceiverMacro("transformMapEntry", 4, transformMapEntry), - ), - cel.Function(mapInsert, - cel.Overload(mapInsertOverloadKeyValue, []*cel.Type{mapKVType, kType, vType}, mapKVType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - m := args[0].(traits.Mapper) - k := args[1] - v := args[2] - return types.InsertMapKeyValue(m, k, v) - })), - cel.Overload(mapInsertOverloadMap, []*cel.Type{mapKVType, mapKVType}, mapKVType, - cel.BinaryBinding(func(targetMap, updateMap ref.Val) ref.Val { - tm := targetMap.(traits.Mapper) - um := updateMap.(traits.Mapper) - umIt := um.Iterator() - for umIt.HasNext() == types.True { - k := umIt.Next() - updateOrErr := types.InsertMapKeyValue(tm, k, um.Get(k)) - if types.IsError(updateOrErr) { - return updateOrErr - } - tm = updateOrErr.(traits.Mapper) - } - return tm - })), - ), - } - return opts -} - -// ProgramOptions implements the cel.Library interface method -func (*compreV2Lib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func quantifierAll(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewLiteral(types.True), - /*condition=*/ mef.NewCall(operators.NotStrictlyFalse, mef.NewAccuIdent()), - /*step=*/ mef.NewCall(operators.LogicalAnd, mef.NewAccuIdent(), args[2]), - /*result=*/ mef.NewAccuIdent(), - ), nil -} - -func quantifierExists(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewLiteral(types.False), - /*condition=*/ mef.NewCall(operators.NotStrictlyFalse, mef.NewCall(operators.LogicalNot, mef.NewAccuIdent())), - /*step=*/ mef.NewCall(operators.LogicalOr, mef.NewAccuIdent(), args[2]), - /*result=*/ mef.NewAccuIdent(), - ), nil -} - -func quantifierExistsOne(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewLiteral(types.Int(0)), - /*condition=*/ mef.NewLiteral(types.True), - /*step=*/ mef.NewCall(operators.Conditional, args[2], - mef.NewCall(operators.Add, mef.NewAccuIdent(), mef.NewLiteral(types.Int(1))), - mef.NewAccuIdent()), - /*result=*/ mef.NewCall(operators.Equals, mef.NewAccuIdent(), mef.NewLiteral(types.Int(1))), - ), nil -} - -func transformList(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - var transform ast.Expr - var filter ast.Expr - if len(args) == 4 { - filter = args[2] - transform = args[3] - } else { - filter = nil - transform = args[2] - } - - // accumulator = accumulator + [transform] - step := mef.NewCall(operators.Add, mef.NewAccuIdent(), mef.NewList(transform)) - if filter != nil { - // accumulator = (filter) ? accumulator + [transform] : accumulator - step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent()) - } - - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewList(), - /*condition=*/ mef.NewLiteral(types.True), - step, - /*result=*/ mef.NewAccuIdent(), - ), nil -} - -func transformMap(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - var transform ast.Expr - var filter ast.Expr - if len(args) == 4 { - filter = args[2] - transform = args[3] - } else { - filter = nil - transform = args[2] - } - - // accumulator = cel.@mapInsert(accumulator, iterVar1, transform) - step := mef.NewCall(mapInsert, mef.NewAccuIdent(), mef.NewIdent(iterVar1), transform) - if filter != nil { - // accumulator = (filter) ? cel.@mapInsert(accumulator, iterVar1, transform) : accumulator - step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent()) - } - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewMap(), - /*condition=*/ mef.NewLiteral(types.True), - step, - /*result=*/ mef.NewAccuIdent(), - ), nil -} - -func transformMapEntry(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1]) - if err != nil { - return nil, err - } - - var transform ast.Expr - var filter ast.Expr - if len(args) == 4 { - filter = args[2] - transform = args[3] - } else { - filter = nil - transform = args[2] - } - - // accumulator = cel.@mapInsert(accumulator, transform) - step := mef.NewCall(mapInsert, mef.NewAccuIdent(), transform) - if filter != nil { - // accumulator = (filter) ? cel.@mapInsert(accumulator, transform) : accumulator - step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent()) - } - return mef.NewComprehensionTwoVar( - target, - iterVar1, - iterVar2, - mef.AccuIdentName(), - /*accuInit=*/ mef.NewMap(), - /*condition=*/ mef.NewLiteral(types.True), - step, - /*result=*/ mef.NewAccuIdent(), - ), nil -} - -func extractIterVars(mef cel.MacroExprFactory, arg0, arg1 ast.Expr) (string, string, *cel.Error) { - iterVar1, err := extractIterVar(mef, arg0) - if err != nil { - return "", "", err - } - iterVar2, err := extractIterVar(mef, arg1) - if err != nil { - return "", "", err - } - if iterVar1 == iterVar2 { - return "", "", mef.NewError(arg1.ID(), fmt.Sprintf("duplicate variable name: %s", iterVar1)) - } - if iterVar1 == mef.AccuIdentName() || iterVar1 == parser.AccumulatorName { - return "", "", mef.NewError(arg0.ID(), "iteration variable overwrites accumulator variable") - } - if iterVar2 == mef.AccuIdentName() || iterVar2 == parser.AccumulatorName { - return "", "", mef.NewError(arg1.ID(), "iteration variable overwrites accumulator variable") - } - return iterVar1, iterVar2, nil -} - -func extractIterVar(mef cel.MacroExprFactory, target ast.Expr) (string, *cel.Error) { - iterVar, found := extractIdent(target) - if !found { - return "", mef.NewError(target.ID(), "argument must be a simple name") - } - return iterVar, nil -} diff --git a/vendor/github.com/google/cel-go/ext/encoders.go b/vendor/github.com/google/cel-go/ext/encoders.go deleted file mode 100644 index 731c3d095..000000000 --- a/vendor/github.com/google/cel-go/ext/encoders.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "encoding/base64" - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// Encoders returns a cel.EnvOption to configure extended functions for string, byte, and object -// encodings. -// -// # Base64.Decode -// -// Decodes base64-encoded string to bytes. -// -// This function will return an error if the string input is not base64-encoded. -// -// base64.decode() -> -// -// Examples: -// -// base64.decode('aGVsbG8=') // return b'hello' -// base64.decode('aGVsbG8') // return b'hello' -// -// # Base64.Encode -// -// Encodes bytes to a base64-encoded string. -// -// base64.encode() -> -// -// Examples: -// -// base64.encode(b'hello') // return b'aGVsbG8=' -func Encoders(options ...EncodersOption) cel.EnvOption { - l := &encoderLib{version: math.MaxUint32} - for _, o := range options { - l = o(l) - } - return cel.Lib(l) -} - -// EncodersOption declares a functional operator for configuring encoder extensions. -type EncodersOption func(*encoderLib) *encoderLib - -// EncodersVersion sets the library version for encoder extensions. -func EncodersVersion(version uint32) EncodersOption { - return func(lib *encoderLib) *encoderLib { - lib.version = version - return lib - } -} - -type encoderLib struct { - version uint32 -} - -func (*encoderLib) LibraryName() string { - return "cel.lib.ext.encoders" -} - -func (*encoderLib) CompileOptions() []cel.EnvOption { - return []cel.EnvOption{ - cel.Function("base64.decode", - cel.Overload("base64_decode_string", []*cel.Type{cel.StringType}, cel.BytesType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return bytesOrError(base64DecodeString(string(s))) - }))), - cel.Function("base64.encode", - cel.Overload("base64_encode_bytes", []*cel.Type{cel.BytesType}, cel.StringType, - cel.UnaryBinding(func(bytes ref.Val) ref.Val { - b := bytes.(types.Bytes) - return stringOrError(base64EncodeBytes([]byte(b))) - }))), - } -} - -func (*encoderLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func base64DecodeString(str string) ([]byte, error) { - b, err := base64.StdEncoding.DecodeString(str) - if err == nil { - return b, nil - } - if _, tryAltEncoding := err.(base64.CorruptInputError); tryAltEncoding { - return base64.RawStdEncoding.DecodeString(str) - } - return nil, err -} - -func base64EncodeBytes(bytes []byte) (string, error) { - return base64.StdEncoding.EncodeToString(bytes), nil -} diff --git a/vendor/github.com/google/cel-go/ext/extension_option_factory.go b/vendor/github.com/google/cel-go/ext/extension_option_factory.go deleted file mode 100644 index cebf0d760..000000000 --- a/vendor/github.com/google/cel-go/ext/extension_option_factory.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "fmt" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/env" -) - -// ExtensionOptionFactory converts an ExtensionConfig value to a CEL environment option. -func ExtensionOptionFactory(configElement any) (cel.EnvOption, bool) { - ext, isExtension := configElement.(*env.Extension) - if !isExtension { - return nil, false - } - fac, found := extFactories[ext.Name] - if !found { - return nil, false - } - // If the version is 'latest', set the version value to the max uint. - ver, err := ext.VersionNumber() - if err != nil { - return func(*cel.Env) (*cel.Env, error) { - return nil, fmt.Errorf("invalid extension version: %s - %s", ext.Name, ext.Version) - }, true - } - return fac(ver), true -} - -// extensionFactory accepts a version and produces a CEL environment associated with the versioned extension. -type extensionFactory func(uint32) cel.EnvOption - -var extFactories = map[string]extensionFactory{ - "bindings": func(version uint32) cel.EnvOption { - return Bindings(BindingsVersion(version)) - }, - "encoders": func(version uint32) cel.EnvOption { - return Encoders(EncodersVersion(version)) - }, - "lists": func(version uint32) cel.EnvOption { - return Lists(ListsVersion(version)) - }, - "math": func(version uint32) cel.EnvOption { - return Math(MathVersion(version)) - }, - "protos": func(version uint32) cel.EnvOption { - return Protos(ProtosVersion(version)) - }, - "sets": func(version uint32) cel.EnvOption { - return Sets(SetsVersion(version)) - }, - "strings": func(version uint32) cel.EnvOption { - return Strings(StringsVersion(version)) - }, - "two-var-comprehensions": func(version uint32) cel.EnvOption { - return TwoVarComprehensions(TwoVarComprehensionsVersion(version)) - }, - "regex": func(version uint32) cel.EnvOption { - return Regex(RegexVersion(version)) - }, -} diff --git a/vendor/github.com/google/cel-go/ext/formatting.go b/vendor/github.com/google/cel-go/ext/formatting.go deleted file mode 100644 index 111184b73..000000000 --- a/vendor/github.com/google/cel-go/ext/formatting.go +++ /dev/null @@ -1,927 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "errors" - "fmt" - "math" - "sort" - "strconv" - "strings" - "unicode" - - "golang.org/x/text/language" - "golang.org/x/text/message" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -type clauseImpl func(ref.Val, string) (string, error) - -func clauseForType(argType ref.Type) (clauseImpl, error) { - switch argType { - case types.IntType, types.UintType: - return formatDecimal, nil - case types.StringType, types.BytesType, types.BoolType, types.NullType, types.TypeType: - return FormatString, nil - case types.TimestampType, types.DurationType: - // special case to ensure timestamps/durations get printed as CEL literals - return func(arg ref.Val, locale string) (string, error) { - argStrVal := arg.ConvertToType(types.StringType) - argStr := argStrVal.Value().(string) - if arg.Type() == types.TimestampType { - return fmt.Sprintf("timestamp(%q)", argStr), nil - } - if arg.Type() == types.DurationType { - return fmt.Sprintf("duration(%q)", argStr), nil - } - return "", fmt.Errorf("cannot convert argument of type %s to timestamp/duration", arg.Type().TypeName()) - }, nil - case types.ListType: - return formatList, nil - case types.MapType: - return formatMap, nil - case types.DoubleType: - // avoid formatFixed so we can output a period as the decimal separator in order - // to always be a valid CEL literal - return func(arg ref.Val, locale string) (string, error) { - argDouble, ok := arg.Value().(float64) - if !ok { - return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName()) - } - fmtStr := fmt.Sprintf("%%.%df", defaultPrecision) - return fmt.Sprintf(fmtStr, argDouble), nil - }, nil - case types.TypeType: - return func(arg ref.Val, locale string) (string, error) { - return fmt.Sprintf("type(%s)", arg.Value().(string)), nil - }, nil - default: - return nil, fmt.Errorf("no formatting function for %s", argType.TypeName()) - } -} - -func formatList(arg ref.Val, locale string) (string, error) { - argList := arg.(traits.Lister) - argIterator := argList.Iterator() - var listStrBuilder strings.Builder - _, err := listStrBuilder.WriteRune('[') - if err != nil { - return "", fmt.Errorf("error writing to list string: %w", err) - } - for argIterator.HasNext() == types.True { - member := argIterator.Next() - memberFormat, err := clauseForType(member.Type()) - if err != nil { - return "", err - } - unquotedStr, err := memberFormat(member, locale) - if err != nil { - return "", err - } - str := quoteForCEL(member, unquotedStr) - _, err = listStrBuilder.WriteString(str) - if err != nil { - return "", fmt.Errorf("error writing to list string: %w", err) - } - if argIterator.HasNext() == types.True { - _, err = listStrBuilder.WriteString(", ") - if err != nil { - return "", fmt.Errorf("error writing to list string: %w", err) - } - } - } - _, err = listStrBuilder.WriteRune(']') - if err != nil { - return "", fmt.Errorf("error writing to list string: %w", err) - } - return listStrBuilder.String(), nil -} - -func formatMap(arg ref.Val, locale string) (string, error) { - argMap := arg.(traits.Mapper) - argIterator := argMap.Iterator() - type mapPair struct { - key string - value string - } - argPairs := make([]mapPair, argMap.Size().Value().(int64)) - i := 0 - for argIterator.HasNext() == types.True { - key := argIterator.Next() - var keyFormat clauseImpl - switch key.Type() { - case types.StringType, types.BoolType: - keyFormat = FormatString - case types.IntType, types.UintType: - keyFormat = formatDecimal - default: - return "", fmt.Errorf("no formatting function for map key of type %s", key.Type().TypeName()) - } - unquotedKeyStr, err := keyFormat(key, locale) - if err != nil { - return "", err - } - keyStr := quoteForCEL(key, unquotedKeyStr) - value, found := argMap.Find(key) - if !found { - return "", fmt.Errorf("could not find key: %q", key) - } - valueFormat, err := clauseForType(value.Type()) - if err != nil { - return "", err - } - unquotedValueStr, err := valueFormat(value, locale) - if err != nil { - return "", err - } - valueStr := quoteForCEL(value, unquotedValueStr) - argPairs[i] = mapPair{keyStr, valueStr} - i++ - } - sort.SliceStable(argPairs, func(x, y int) bool { - return argPairs[x].key < argPairs[y].key - }) - var mapStrBuilder strings.Builder - _, err := mapStrBuilder.WriteRune('{') - if err != nil { - return "", fmt.Errorf("error writing to map string: %w", err) - } - for i, entry := range argPairs { - _, err = mapStrBuilder.WriteString(fmt.Sprintf("%s:%s", entry.key, entry.value)) - if err != nil { - return "", fmt.Errorf("error writing to map string: %w", err) - } - if i < len(argPairs)-1 { - _, err = mapStrBuilder.WriteString(", ") - if err != nil { - return "", fmt.Errorf("error writing to map string: %w", err) - } - } - } - _, err = mapStrBuilder.WriteRune('}') - if err != nil { - return "", fmt.Errorf("error writing to map string: %w", err) - } - return mapStrBuilder.String(), nil -} - -// quoteForCEL takes a formatted, unquoted value and quotes it in a manner suitable -// for embedding directly in CEL. -func quoteForCEL(refVal ref.Val, unquotedValue string) string { - switch refVal.Type() { - case types.StringType: - return fmt.Sprintf("%q", unquotedValue) - case types.BytesType: - return fmt.Sprintf("b%q", unquotedValue) - case types.DoubleType: - // special case to handle infinity/NaN - num := refVal.Value().(float64) - if math.IsInf(num, 1) || math.IsInf(num, -1) || math.IsNaN(num) { - return fmt.Sprintf("%q", unquotedValue) - } - return unquotedValue - default: - return unquotedValue - } -} - -// FormatString returns the string representation of a CEL value. -// -// It is used to implement the %s specifier in the (string).format() extension function. -func FormatString(arg ref.Val, locale string) (string, error) { - switch arg.Type() { - case types.ListType: - return formatList(arg, locale) - case types.MapType: - return formatMap(arg, locale) - case types.IntType, types.UintType, types.DoubleType, - types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType: - argStrVal := arg.ConvertToType(types.StringType) - argStr, ok := argStrVal.Value().(string) - if !ok { - return "", fmt.Errorf("could not convert argument %q to string", argStrVal) - } - return argStr, nil - case types.NullType: - return "null", nil - default: - return "", stringFormatError(runtimeID, arg.Type().TypeName()) - } -} - -func formatDecimal(arg ref.Val, locale string) (string, error) { - switch arg.Type() { - case types.IntType: - argInt, ok := arg.ConvertToType(types.IntType).Value().(int64) - if !ok { - return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value()) - } - return fmt.Sprintf("%d", argInt), nil - case types.UintType: - argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64) - if !ok { - return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value()) - } - return fmt.Sprintf("%d", argInt), nil - default: - return "", decimalFormatError(runtimeID, arg.Type().TypeName()) - } -} - -func matchLanguage(locale string) (language.Tag, error) { - matcher, err := makeMatcher(locale) - if err != nil { - return language.Und, err - } - tag, _ := language.MatchStrings(matcher, locale) - return tag, nil -} - -func makeMatcher(locale string) (language.Matcher, error) { - tags := make([]language.Tag, 0) - tag, err := language.Parse(locale) - if err != nil { - return nil, err - } - tags = append(tags, tag) - return language.NewMatcher(tags), nil -} - -type stringFormatter struct{} - -// String implements formatStringInterpolator.String. -func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) { - return FormatString(arg, locale) -} - -// Decimal implements formatStringInterpolator.Decimal. -func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) { - return formatDecimal(arg, locale) -} - -// Fixed implements formatStringInterpolator.Fixed. -func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) { - if precision == nil { - precision = new(int) - *precision = defaultPrecision - } - return func(arg ref.Val, locale string) (string, error) { - strException := false - if arg.Type() == types.StringType { - argStr := arg.Value().(string) - if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" { - strException = true - } - } - if arg.Type() != types.DoubleType && !strException { - return "", fixedPointFormatError(runtimeID, arg.Type().TypeName()) - } - argFloatVal := arg.ConvertToType(types.DoubleType) - argFloat, ok := argFloatVal.Value().(float64) - if !ok { - return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value()) - } - fmtStr := fmt.Sprintf("%%.%df", *precision) - - matchedLocale, err := matchLanguage(locale) - if err != nil { - return "", fmt.Errorf("error matching locale: %w", err) - } - return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil - } -} - -// Scientific implements formatStringInterpolator.Scientific. -func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) { - if precision == nil { - precision = new(int) - *precision = defaultPrecision - } - return func(arg ref.Val, locale string) (string, error) { - strException := false - if arg.Type() == types.StringType { - argStr := arg.Value().(string) - if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" { - strException = true - } - } - if arg.Type() != types.DoubleType && !strException { - return "", scientificFormatError(runtimeID, arg.Type().TypeName()) - } - argFloatVal := arg.ConvertToType(types.DoubleType) - argFloat, ok := argFloatVal.Value().(float64) - if !ok { - return "", fmt.Errorf("could not convert \"%v\" to float64", argFloatVal.Value()) - } - matchedLocale, err := matchLanguage(locale) - if err != nil { - return "", fmt.Errorf("error matching locale: %w", err) - } - fmtStr := fmt.Sprintf("%%%de", *precision) - return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil - } -} - -// Binary implements formatStringInterpolator.Binary. -func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) { - switch arg.Type() { - case types.IntType: - argInt := arg.Value().(int64) - // locale is intentionally unused as integers formatted as binary - // strings are locale-independent - return fmt.Sprintf("%b", argInt), nil - case types.UintType: - argInt := arg.Value().(uint64) - return fmt.Sprintf("%b", argInt), nil - case types.BoolType: - argBool := arg.Value().(bool) - if argBool { - return "1", nil - } - return "0", nil - default: - return "", binaryFormatError(runtimeID, arg.Type().TypeName()) - } -} - -// Hex implements formatStringInterpolator.Hex. -func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) { - return func(arg ref.Val, locale string) (string, error) { - fmtStr := "%x" - if useUpper { - fmtStr = "%X" - } - switch arg.Type() { - case types.StringType, types.BytesType: - if arg.Type() == types.BytesType { - return fmt.Sprintf(fmtStr, arg.Value().([]byte)), nil - } - return fmt.Sprintf(fmtStr, arg.Value().(string)), nil - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value()) - } - return fmt.Sprintf(fmtStr, argInt), nil - case types.UintType: - argInt, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value()) - } - return fmt.Sprintf(fmtStr, argInt), nil - default: - return "", hexFormatError(runtimeID, arg.Type().TypeName()) - } - } -} - -// Octal implements formatStringInterpolator.Octal. -func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) { - switch arg.Type() { - case types.IntType: - argInt := arg.Value().(int64) - return fmt.Sprintf("%o", argInt), nil - case types.UintType: - argInt := arg.Value().(uint64) - return fmt.Sprintf("%o", argInt), nil - default: - return "", octalFormatError(runtimeID, arg.Type().TypeName()) - } -} - -// stringFormatValidator implements the cel.ASTValidator interface allowing for static validation -// of string.format calls. -type stringFormatValidator struct{} - -// Name returns the name of the validator. -func (stringFormatValidator) Name() string { - return "cel.validator.string_format" -} - -// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip -// during homogeneous aggregate literal type-checks. -func (stringFormatValidator) Configure(config cel.MutableValidatorConfig) error { - functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string) - functions = append(functions, "format") - return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions) -} - -// Validate parses all literal format strings and type checks the format clause against the argument -// at the corresponding ordinal within the list literal argument to the function, if one is specified. -func (stringFormatValidator) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) { - root := ast.NavigateAST(a) - formatCallExprs := ast.MatchDescendants(root, matchConstantFormatStringWithListLiteralArgs(a)) - for _, e := range formatCallExprs { - call := e.AsCall() - formatStr := call.Target().AsLiteral().Value().(string) - args := call.Args()[0].AsList().Elements() - formatCheck := &stringFormatChecker{ - args: args, - ast: a, - } - // use a placeholder locale, since locale doesn't affect syntax - _, err := parseFormatString(formatStr, formatCheck, formatCheck, "en_US") - if err != nil { - iss.ReportErrorAtID(getErrorExprID(e.ID(), err), "%v", err) - continue - } - seenArgs := formatCheck.argsRequested - if len(args) > seenArgs { - iss.ReportErrorAtID(e.ID(), - "too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(args)) - } - } -} - -// getErrorExprID determines which list literal argument triggered a type-disagreement for the -// purposes of more accurate error message reports. -func getErrorExprID(id int64, err error) int64 { - fmtErr, ok := err.(formatError) - if ok { - return fmtErr.id - } - wrapped := errors.Unwrap(err) - if wrapped != nil { - return getErrorExprID(id, wrapped) - } - return id -} - -// matchConstantFormatStringWithListLiteralArgs matches all valid expression nodes for string -// format checking. -func matchConstantFormatStringWithListLiteralArgs(a *ast.AST) ast.ExprMatcher { - return func(e ast.NavigableExpr) bool { - if e.Kind() != ast.CallKind { - return false - } - call := e.AsCall() - if !call.IsMemberFunction() || call.FunctionName() != "format" { - return false - } - overloadIDs := a.GetOverloadIDs(e.ID()) - if len(overloadIDs) != 0 { - found := false - for _, overload := range overloadIDs { - if overload == overloads.ExtFormatString { - found = true - break - } - } - if !found { - return false - } - } - formatString := call.Target() - if formatString.Kind() != ast.LiteralKind || formatString.AsLiteral().Type() != cel.StringType { - return false - } - args := call.Args() - if len(args) != 1 { - return false - } - formatArgs := args[0] - return formatArgs.Kind() == ast.ListKind - } -} - -// stringFormatChecker implements the formatStringInterpolater interface -type stringFormatChecker struct { - args []ast.Expr - argsRequested int - currArgIndex int64 - ast *ast.AST -} - -// String implements formatStringInterpolator.String. -func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error) { - formatArg := c.args[c.currArgIndex] - valid, badID := c.verifyString(formatArg) - if !valid { - return "", stringFormatError(badID, c.typeOf(badID).TypeName()) - } - return "", nil -} - -// Decimal implements formatStringInterpolator.Decimal. -func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType) - if !valid { - return "", decimalFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Fixed implements formatStringInterpolator.Fixed. -func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) { - return func(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values - valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType) - if !valid { - return "", fixedPointFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Scientific implements formatStringInterpolator.Scientific. -func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) { - return func(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType) - if !valid { - return "", scientificFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Binary implements formatStringInterpolator.Binary. -func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.BoolType) - if !valid { - return "", binaryFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Hex implements formatStringInterpolator.Hex. -func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) { - return func(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType) - if !valid { - return "", hexFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Octal implements formatStringInterpolator.Octal. -func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType) - if !valid { - return "", octalFormatError(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Arg implements formatListArgs.Arg. -func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) { - c.argsRequested++ - c.currArgIndex = index - // return a dummy value - this is immediately passed to back to us - // through one of the FormatCallback functions, so anything will do - return types.Int(0), nil -} - -// Size implements formatListArgs.Size. -func (c *stringFormatChecker) Size() int64 { - return int64(len(c.args)) -} - -func (c *stringFormatChecker) typeOf(id int64) *cel.Type { - return c.ast.GetType(id) -} - -func (c *stringFormatChecker) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool { - t := c.typeOf(id) - if t == cel.DynType { - return true - } - for _, vt := range validTypes { - // Only check runtime type compatibility without delving deeper into parameterized types - if t.Kind() == vt.Kind() { - return true - } - } - return false -} - -func (c *stringFormatChecker) verifyString(sub ast.Expr) (bool, int64) { - paramA := cel.TypeParamType("A") - paramB := cel.TypeParamType("B") - subVerified := c.verifyTypeOneOf(sub.ID(), - cel.ListType(paramA), cel.MapType(paramA, paramB), - cel.IntType, cel.UintType, cel.DoubleType, cel.BoolType, cel.StringType, - cel.TimestampType, cel.BytesType, cel.DurationType, cel.TypeType, cel.NullType) - if !subVerified { - return false, sub.ID() - } - switch sub.Kind() { - case ast.ListKind: - for _, e := range sub.AsList().Elements() { - // recursively verify if we're dealing with a list/map - verified, id := c.verifyString(e) - if !verified { - return false, id - } - } - return true, sub.ID() - case ast.MapKind: - for _, e := range sub.AsMap().Entries() { - // recursively verify if we're dealing with a list/map - entry := e.AsMapEntry() - verified, id := c.verifyString(entry.Key()) - if !verified { - return false, id - } - verified, id = c.verifyString(entry.Value()) - if !verified { - return false, id - } - } - return true, sub.ID() - default: - return true, sub.ID() - } -} - -// helper routines for reporting common errors during string formatting static validation and -// runtime execution. - -func binaryFormatError(id int64, badType string) error { - return newFormatError(id, "only integers and bools can be formatted as binary, was given %s", badType) -} - -func decimalFormatError(id int64, badType string) error { - return newFormatError(id, "decimal clause can only be used on integers, was given %s", badType) -} - -func fixedPointFormatError(id int64, badType string) error { - return newFormatError(id, "fixed-point clause can only be used on doubles, was given %s", badType) -} - -func hexFormatError(id int64, badType string) error { - return newFormatError(id, "only integers, byte buffers, and strings can be formatted as hex, was given %s", badType) -} - -func octalFormatError(id int64, badType string) error { - return newFormatError(id, "octal clause can only be used on integers, was given %s", badType) -} - -func scientificFormatError(id int64, badType string) error { - return newFormatError(id, "scientific clause can only be used on doubles, was given %s", badType) -} - -func stringFormatError(id int64, badType string) error { - return newFormatError(id, "string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", badType) -} - -type formatError struct { - id int64 - msg string -} - -func newFormatError(id int64, msg string, args ...any) error { - return formatError{ - id: id, - msg: fmt.Sprintf(msg, args...), - } -} - -// Error implements error. -func (e formatError) Error() string { - return e.msg -} - -// Is implements errors.Is. -func (e formatError) Is(target error) bool { - return e.msg == target.Error() -} - -// stringArgList implements the formatListArgs interface. -type stringArgList struct { - args traits.Lister -} - -// Arg implements formatListArgs.Arg. -func (c *stringArgList) Arg(index int64) (ref.Val, error) { - if index >= c.args.Size().Value().(int64) { - return nil, fmt.Errorf("index %d out of range", index) - } - return c.args.Get(types.Int(index)), nil -} - -// Size implements formatListArgs.Size. -func (c *stringArgList) Size() int64 { - return c.args.Size().Value().(int64) -} - -// formatStringInterpolator is an interface that allows user-defined behavior -// for formatting clause implementations, as well as argument retrieval. -// Each function is expected to support the appropriate types as laid out in -// the string.format documentation, and to return an error if given an inappropriate type. -type formatStringInterpolator interface { - // String takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a string, or an error if one occurred. - String(ref.Val, string) (string, error) - - // Decimal takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a decimal integer, or an error if one occurred. - Decimal(ref.Val, string) (string, error) - - // Fixed takes an int pointer representing precision (or nil if none was given) and - // returns a function operating in a similar manner to String and Decimal, taking a - // ref.Val and locale and returning the appropriate string. A closure is returned - // so precision can be set without needing an additional function call/configuration. - Fixed(*int) func(ref.Val, string) (string, error) - - // Scientific functions identically to Fixed, except the string returned from the closure - // is expected to be in scientific notation. - Scientific(*int) func(ref.Val, string) (string, error) - - // Binary takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a binary integer, or an error if one occurred. - Binary(ref.Val, string) (string, error) - - // Hex takes a boolean that, if true, indicates the hex string output by the returned - // closure should use uppercase letters for A-F. - Hex(bool) func(ref.Val, string) (string, error) - - // Octal takes a ref.Val and a string representing the current locale identifier and - // returns the Val formatted in octal, or an error if one occurred. - Octal(ref.Val, string) (string, error) -} - -// formatListArgs is an interface that allows user-defined list-like datatypes to be used -// for formatting clause implementations. -type formatListArgs interface { - // Arg returns the ref.Val at the given index, or an error if one occurred. - Arg(int64) (ref.Val, error) - - // Size returns the length of the argument list. - Size() int64 -} - -// parseFormatString formats a string according to the string.format syntax, taking the clause implementations -// from the provided FormatCallback and the args from the given FormatList. -func parseFormatString(formatStr string, callback formatStringInterpolator, list formatListArgs, locale string) (string, error) { - i := 0 - argIndex := 0 - var builtStr strings.Builder - for i < len(formatStr) { - if formatStr[i] == '%' { - if i+1 < len(formatStr) && formatStr[i+1] == '%' { - err := builtStr.WriteByte('%') - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i += 2 - continue - } else { - argAny, err := list.Arg(int64(argIndex)) - if err != nil { - return "", err - } - if i+1 >= len(formatStr) { - return "", errors.New("unexpected end of string") - } - if int64(argIndex) >= list.Size() { - return "", fmt.Errorf("index %d out of range", argIndex) - } - numRead, val, refErr := parseAndFormatClause(formatStr[i:], argAny, callback, list, locale) - if refErr != nil { - return "", refErr - } - _, err = builtStr.WriteString(val) - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i += numRead - argIndex++ - } - } else { - err := builtStr.WriteByte(formatStr[i]) - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i++ - } - } - return builtStr.String(), nil -} - -// parseAndFormatClause parses the format clause at the start of the given string with val, and returns -// how many characters were consumed and the substituted string form of val, or an error if one occurred. -func parseAndFormatClause(formatStr string, val ref.Val, callback formatStringInterpolator, list formatListArgs, locale string) (int, string, error) { - i := 1 - read, formatter, err := parseFormattingClause(formatStr[i:], callback) - i += read - if err != nil { - return -1, "", newParseFormatError("could not parse formatting clause", err) - } - - valStr, err := formatter(val, locale) - if err != nil { - return -1, "", newParseFormatError("error during formatting", err) - } - return i, valStr, nil -} - -func parseFormattingClause(formatStr string, callback formatStringInterpolator) (int, clauseImpl, error) { - i := 0 - read, precision, err := parsePrecision(formatStr[i:]) - i += read - if err != nil { - return -1, nil, fmt.Errorf("error while parsing precision: %w", err) - } - r := rune(formatStr[i]) - i++ - switch r { - case 's': - return i, callback.String, nil - case 'd': - return i, callback.Decimal, nil - case 'f': - return i, callback.Fixed(precision), nil - case 'e': - return i, callback.Scientific(precision), nil - case 'b': - return i, callback.Binary, nil - case 'x', 'X': - return i, callback.Hex(unicode.IsUpper(r)), nil - case 'o': - return i, callback.Octal, nil - default: - return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r) - } -} - -func parsePrecision(formatStr string) (int, *int, error) { - i := 0 - if formatStr[i] != '.' { - return i, nil, nil - } - i++ - var buffer strings.Builder - for { - if i >= len(formatStr) { - return -1, nil, errors.New("could not find end of precision specifier") - } - if !isASCIIDigit(rune(formatStr[i])) { - break - } - buffer.WriteByte(formatStr[i]) - i++ - } - precision, err := strconv.Atoi(buffer.String()) - if err != nil { - return -1, nil, fmt.Errorf("error while converting precision to integer: %w", err) - } - return i, &precision, nil -} - -func isASCIIDigit(r rune) bool { - return r <= unicode.MaxASCII && unicode.IsDigit(r) -} - -type parseFormatError struct { - msg string - wrapped error -} - -func newParseFormatError(msg string, wrapped error) error { - return parseFormatError{msg: msg, wrapped: wrapped} -} - -// Error implements error. -func (e parseFormatError) Error() string { - return fmt.Sprintf("%s: %s", e.msg, e.wrapped.Error()) -} - -// Is implements errors.Is. -func (e parseFormatError) Is(target error) bool { - return e.Error() == target.Error() -} - -// Is implements errors.Unwrap. -func (e parseFormatError) Unwrap() error { - return e.wrapped -} - -const ( - runtimeID = int64(-1) -) diff --git a/vendor/github.com/google/cel-go/ext/formatting_v2.go b/vendor/github.com/google/cel-go/ext/formatting_v2.go deleted file mode 100644 index ca8efbc4e..000000000 --- a/vendor/github.com/google/cel-go/ext/formatting_v2.go +++ /dev/null @@ -1,788 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "errors" - "fmt" - "math" - "sort" - "strconv" - "strings" - "time" - "unicode" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -type clauseImplV2 func(ref.Val) (string, error) - -type appendingFormatterV2 struct { - buf []byte -} - -type formattedMapEntryV2 struct { - key string - val string -} - -func (af *appendingFormatterV2) format(arg ref.Val) error { - switch arg.Type() { - case types.BoolType: - argBool, ok := arg.Value().(bool) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BoolType) - } - af.buf = strconv.AppendBool(af.buf, argBool) - return nil - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - af.buf = strconv.AppendInt(af.buf, argInt, 10) - return nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - af.buf = strconv.AppendUint(af.buf, argUint, 10) - return nil - case types.DoubleType: - argDbl, ok := arg.Value().(float64) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType) - } - if math.IsNaN(argDbl) { - af.buf = append(af.buf, "NaN"...) - return nil - } - if math.IsInf(argDbl, -1) { - af.buf = append(af.buf, "-Infinity"...) - return nil - } - if math.IsInf(argDbl, 1) { - af.buf = append(af.buf, "Infinity"...) - return nil - } - af.buf = strconv.AppendFloat(af.buf, argDbl, 'f', -1, 64) - return nil - case types.BytesType: - argBytes, ok := arg.Value().([]byte) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BytesType) - } - af.buf = append(af.buf, argBytes...) - return nil - case types.StringType: - argStr, ok := arg.Value().(string) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.StringType) - } - af.buf = append(af.buf, argStr...) - return nil - case types.DurationType: - argDur, ok := arg.Value().(time.Duration) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DurationType) - } - af.buf = strconv.AppendFloat(af.buf, argDur.Seconds(), 'f', -1, 64) - af.buf = append(af.buf, "s"...) - return nil - case types.TimestampType: - argTime, ok := arg.Value().(time.Time) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.TimestampType) - } - af.buf = argTime.UTC().AppendFormat(af.buf, time.RFC3339Nano) - return nil - case types.NullType: - af.buf = append(af.buf, "null"...) - return nil - case types.TypeType: - argType, ok := arg.Value().(string) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.TypeType) - } - af.buf = append(af.buf, argType...) - return nil - case types.ListType: - argList, ok := arg.(traits.Lister) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.ListType) - } - argIter := argList.Iterator() - af.buf = append(af.buf, "["...) - if argIter.HasNext() == types.True { - if err := af.format(argIter.Next()); err != nil { - return err - } - for argIter.HasNext() == types.True { - af.buf = append(af.buf, ", "...) - if err := af.format(argIter.Next()); err != nil { - return err - } - } - } - af.buf = append(af.buf, "]"...) - return nil - case types.MapType: - argMap, ok := arg.(traits.Mapper) - if !ok { - return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.MapType) - } - argIter := argMap.Iterator() - ents := []formattedMapEntryV2{} - for argIter.HasNext() == types.True { - key := argIter.Next() - val, ok := argMap.Find(key) - if !ok { - return fmt.Errorf("key missing from map: '%s'", key) - } - keyStr, err := formatStringV2(key) - if err != nil { - return err - } - valStr, err := formatStringV2(val) - if err != nil { - return err - } - ents = append(ents, formattedMapEntryV2{keyStr, valStr}) - } - sort.SliceStable(ents, func(x, y int) bool { - return ents[x].key < ents[y].key - }) - af.buf = append(af.buf, "{"...) - for i, e := range ents { - if i > 0 { - af.buf = append(af.buf, ", "...) - } - af.buf = append(af.buf, e.key...) - af.buf = append(af.buf, ": "...) - af.buf = append(af.buf, e.val...) - } - af.buf = append(af.buf, "}"...) - return nil - default: - return stringFormatErrorV2(runtimeID, arg.Type().TypeName()) - } -} - -func formatStringV2(arg ref.Val) (string, error) { - var fmter appendingFormatterV2 - if err := fmter.format(arg); err != nil { - return "", err - } - return string(fmter.buf), nil -} - -type stringFormatterV2 struct{} - -// String implements formatStringInterpolatorV2.String. -func (c *stringFormatterV2) String(arg ref.Val) (string, error) { - return formatStringV2(arg) -} - -// Decimal implements formatStringInterpolatorV2.Decimal. -func (c *stringFormatterV2) Decimal(arg ref.Val) (string, error) { - switch arg.Type() { - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return strconv.FormatInt(argInt, 10), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return strconv.FormatUint(argUint, 10), nil - case types.DoubleType: - argDbl, ok := arg.Value().(float64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType) - } - if math.IsNaN(argDbl) { - return "NaN", nil - } - if math.IsInf(argDbl, -1) { - return "-Infinity", nil - } - if math.IsInf(argDbl, 1) { - return "Infinity", nil - } - return strconv.FormatFloat(argDbl, 'f', -1, 64), nil - default: - return "", decimalFormatErrorV2(runtimeID, arg.Type().TypeName()) - } -} - -// Fixed implements formatStringInterpolatorV2.Fixed. -func (c *stringFormatterV2) Fixed(precision int) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - fmtStr := fmt.Sprintf("%%.%df", precision) - switch arg.Type() { - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return fmt.Sprintf(fmtStr, argInt), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return fmt.Sprintf(fmtStr, argUint), nil - case types.DoubleType: - argDbl, ok := arg.Value().(float64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType) - } - if math.IsNaN(argDbl) { - return "NaN", nil - } - if math.IsInf(argDbl, -1) { - return "-Infinity", nil - } - if math.IsInf(argDbl, 1) { - return "Infinity", nil - } - return fmt.Sprintf(fmtStr, argDbl), nil - default: - return "", fixedPointFormatErrorV2(runtimeID, arg.Type().TypeName()) - } - } -} - -// Scientific implements formatStringInterpolatorV2.Scientific. -func (c *stringFormatterV2) Scientific(precision int) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - fmtStr := fmt.Sprintf("%%1.%de", precision) - switch arg.Type() { - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return fmt.Sprintf(fmtStr, argInt), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return fmt.Sprintf(fmtStr, argUint), nil - case types.DoubleType: - argDbl, ok := arg.Value().(float64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType) - } - if math.IsNaN(argDbl) { - return "NaN", nil - } - if math.IsInf(argDbl, -1) { - return "-Infinity", nil - } - if math.IsInf(argDbl, 1) { - return "Infinity", nil - } - return fmt.Sprintf(fmtStr, argDbl), nil - default: - return "", scientificFormatErrorV2(runtimeID, arg.Type().TypeName()) - } - } -} - -// Binary implements formatStringInterpolatorV2.Binary. -func (c *stringFormatterV2) Binary(arg ref.Val) (string, error) { - switch arg.Type() { - case types.BoolType: - argBool, ok := arg.Value().(bool) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BoolType) - } - if argBool { - return "1", nil - } - return "0", nil - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return strconv.FormatInt(argInt, 2), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return strconv.FormatUint(argUint, 2), nil - default: - return "", binaryFormatErrorV2(runtimeID, arg.Type().TypeName()) - } -} - -// Hex implements formatStringInterpolatorV2.Hex. -func (c *stringFormatterV2) Hex(useUpper bool) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - var fmtStr string - if useUpper { - fmtStr = "%X" - } else { - fmtStr = "%x" - } - switch arg.Type() { - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return fmt.Sprintf(fmtStr, argInt), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return fmt.Sprintf(fmtStr, argUint), nil - case types.StringType: - argStr, ok := arg.Value().(string) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.StringType) - } - return fmt.Sprintf(fmtStr, argStr), nil - case types.BytesType: - argBytes, ok := arg.Value().([]byte) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BytesType) - } - return fmt.Sprintf(fmtStr, argBytes), nil - default: - return "", hexFormatErrorV2(runtimeID, arg.Type().TypeName()) - } - } -} - -// Octal implements formatStringInterpolatorV2.Octal. -func (c *stringFormatterV2) Octal(arg ref.Val) (string, error) { - switch arg.Type() { - case types.IntType: - argInt, ok := arg.Value().(int64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType) - } - return strconv.FormatInt(argInt, 8), nil - case types.UintType: - argUint, ok := arg.Value().(uint64) - if !ok { - return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType) - } - return strconv.FormatUint(argUint, 8), nil - default: - return "", octalFormatErrorV2(runtimeID, arg.Type().TypeName()) - } -} - -// stringFormatValidatorV2 implements the cel.ASTValidator interface allowing for static validation -// of string.format calls. -type stringFormatValidatorV2 struct{} - -// Name returns the name of the validator. -func (stringFormatValidatorV2) Name() string { - return "cel.validator.string_format" -} - -// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip -// during homogeneous aggregate literal type-checks. -func (stringFormatValidatorV2) Configure(config cel.MutableValidatorConfig) error { - functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string) - functions = append(functions, "format") - return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions) -} - -// Validate parses all literal format strings and type checks the format clause against the argument -// at the corresponding ordinal within the list literal argument to the function, if one is specified. -func (stringFormatValidatorV2) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) { - root := ast.NavigateAST(a) - formatCallExprs := ast.MatchDescendants(root, matchConstantFormatStringWithListLiteralArgs(a)) - for _, e := range formatCallExprs { - call := e.AsCall() - formatStr := call.Target().AsLiteral().Value().(string) - args := call.Args()[0].AsList().Elements() - formatCheck := &stringFormatCheckerV2{ - args: args, - ast: a, - } - // use a placeholder locale, since locale doesn't affect syntax - _, err := parseFormatStringV2(formatStr, formatCheck, formatCheck) - if err != nil { - iss.ReportErrorAtID(getErrorExprID(e.ID(), err), "%v", err) - continue - } - seenArgs := formatCheck.argsRequested - if len(args) > seenArgs { - iss.ReportErrorAtID(e.ID(), - "too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(args)) - } - } -} - -// stringFormatCheckerV2 implements the formatStringInterpolater interface -type stringFormatCheckerV2 struct { - args []ast.Expr - argsRequested int - currArgIndex int64 - ast *ast.AST -} - -// String implements formatStringInterpolatorV2.String. -func (c *stringFormatCheckerV2) String(arg ref.Val) (string, error) { - formatArg := c.args[c.currArgIndex] - valid, badID := c.verifyString(formatArg) - if !valid { - return "", stringFormatErrorV2(badID, c.typeOf(badID).TypeName()) - } - return "", nil -} - -// Decimal implements formatStringInterpolatorV2.Decimal. -func (c *stringFormatCheckerV2) Decimal(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType) - if !valid { - return "", decimalFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Fixed implements formatStringInterpolatorV2.Fixed. -func (c *stringFormatCheckerV2) Fixed(precision int) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType) - if !valid { - return "", fixedPointFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Scientific implements formatStringInterpolatorV2.Scientific. -func (c *stringFormatCheckerV2) Scientific(precision int) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType) - if !valid { - return "", scientificFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Binary implements formatStringInterpolatorV2.Binary. -func (c *stringFormatCheckerV2) Binary(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.BoolType, types.IntType, types.UintType) - if !valid { - return "", binaryFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Hex implements formatStringInterpolatorV2.Hex. -func (c *stringFormatCheckerV2) Hex(useUpper bool) func(ref.Val) (string, error) { - return func(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType) - if !valid { - return "", hexFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil - } -} - -// Octal implements formatStringInterpolatorV2.Octal. -func (c *stringFormatCheckerV2) Octal(arg ref.Val) (string, error) { - id := c.args[c.currArgIndex].ID() - valid := c.verifyTypeOneOf(id, types.IntType, types.UintType) - if !valid { - return "", octalFormatErrorV2(id, c.typeOf(id).TypeName()) - } - return "", nil -} - -// Arg implements formatListArgs.Arg. -func (c *stringFormatCheckerV2) Arg(index int64) (ref.Val, error) { - c.argsRequested++ - c.currArgIndex = index - // return a dummy value - this is immediately passed to back to us - // through one of the FormatCallback functions, so anything will do - return types.Int(0), nil -} - -// Size implements formatListArgs.Size. -func (c *stringFormatCheckerV2) Size() int64 { - return int64(len(c.args)) -} - -func (c *stringFormatCheckerV2) typeOf(id int64) *cel.Type { - return c.ast.GetType(id) -} - -func (c *stringFormatCheckerV2) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool { - t := c.typeOf(id) - if t == cel.DynType { - return true - } - for _, vt := range validTypes { - // Only check runtime type compatibility without delving deeper into parameterized types - if t.Kind() == vt.Kind() { - return true - } - } - return false -} - -func (c *stringFormatCheckerV2) verifyString(sub ast.Expr) (bool, int64) { - paramA := cel.TypeParamType("A") - paramB := cel.TypeParamType("B") - subVerified := c.verifyTypeOneOf(sub.ID(), - cel.ListType(paramA), cel.MapType(paramA, paramB), - cel.IntType, cel.UintType, cel.DoubleType, cel.BoolType, cel.StringType, - cel.TimestampType, cel.BytesType, cel.DurationType, cel.TypeType, cel.NullType) - if !subVerified { - return false, sub.ID() - } - switch sub.Kind() { - case ast.ListKind: - for _, e := range sub.AsList().Elements() { - // recursively verify if we're dealing with a list/map - verified, id := c.verifyString(e) - if !verified { - return false, id - } - } - return true, sub.ID() - case ast.MapKind: - for _, e := range sub.AsMap().Entries() { - // recursively verify if we're dealing with a list/map - entry := e.AsMapEntry() - verified, id := c.verifyString(entry.Key()) - if !verified { - return false, id - } - verified, id = c.verifyString(entry.Value()) - if !verified { - return false, id - } - } - return true, sub.ID() - default: - return true, sub.ID() - } -} - -// helper routines for reporting common errors during string formatting static validation and -// runtime execution. - -func binaryFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "only ints, uints, and bools can be formatted as binary, was given %s", badType) -} - -func decimalFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "decimal clause can only be used on ints, uints, and doubles, was given %s", badType) -} - -func fixedPointFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "fixed-point clause can only be used on ints, uints, and doubles, was given %s", badType) -} - -func hexFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "only ints, uints, bytes, and strings can be formatted as hex, was given %s", badType) -} - -func octalFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "octal clause can only be used on ints and uints, was given %s", badType) -} - -func scientificFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "scientific clause can only be used on ints, uints, and doubles, was given %s", badType) -} - -func stringFormatErrorV2(id int64, badType string) error { - return newFormatError(id, "string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", badType) -} - -// formatStringInterpolatorV2 is an interface that allows user-defined behavior -// for formatting clause implementations, as well as argument retrieval. -// Each function is expected to support the appropriate types as laid out in -// the string.format documentation, and to return an error if given an inappropriate type. -type formatStringInterpolatorV2 interface { - // String takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a string, or an error if one occurred. - String(ref.Val) (string, error) - - // Decimal takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a decimal integer, or an error if one occurred. - Decimal(ref.Val) (string, error) - - // Fixed takes an int pointer representing precision (or nil if none was given) and - // returns a function operating in a similar manner to String and Decimal, taking a - // ref.Val and locale and returning the appropriate string. A closure is returned - // so precision can be set without needing an additional function call/configuration. - Fixed(int) func(ref.Val) (string, error) - - // Scientific functions identically to Fixed, except the string returned from the closure - // is expected to be in scientific notation. - Scientific(int) func(ref.Val) (string, error) - - // Binary takes a ref.Val and a string representing the current locale identifier - // and returns the Val formatted as a binary integer, or an error if one occurred. - Binary(ref.Val) (string, error) - - // Hex takes a boolean that, if true, indicates the hex string output by the returned - // closure should use uppercase letters for A-F. - Hex(bool) func(ref.Val) (string, error) - - // Octal takes a ref.Val and a string representing the current locale identifier and - // returns the Val formatted in octal, or an error if one occurred. - Octal(ref.Val) (string, error) -} - -// parseFormatString formats a string according to the string.format syntax, taking the clause implementations -// from the provided FormatCallback and the args from the given FormatList. -func parseFormatStringV2(formatStr string, callback formatStringInterpolatorV2, list formatListArgs) (string, error) { - i := 0 - argIndex := 0 - var builtStr strings.Builder - for i < len(formatStr) { - if formatStr[i] == '%' { - if i+1 < len(formatStr) && formatStr[i+1] == '%' { - err := builtStr.WriteByte('%') - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i += 2 - continue - } else { - argAny, err := list.Arg(int64(argIndex)) - if err != nil { - return "", err - } - if i+1 >= len(formatStr) { - return "", errors.New("unexpected end of string") - } - if int64(argIndex) >= list.Size() { - return "", fmt.Errorf("index %d out of range", argIndex) - } - numRead, val, refErr := parseAndFormatClauseV2(formatStr[i:], argAny, callback, list) - if refErr != nil { - return "", refErr - } - _, err = builtStr.WriteString(val) - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i += numRead - argIndex++ - } - } else { - err := builtStr.WriteByte(formatStr[i]) - if err != nil { - return "", fmt.Errorf("error writing format string: %w", err) - } - i++ - } - } - return builtStr.String(), nil -} - -// parseAndFormatClause parses the format clause at the start of the given string with val, and returns -// how many characters were consumed and the substituted string form of val, or an error if one occurred. -func parseAndFormatClauseV2(formatStr string, val ref.Val, callback formatStringInterpolatorV2, list formatListArgs) (int, string, error) { - i := 1 - read, formatter, err := parseFormattingClauseV2(formatStr[i:], callback) - i += read - if err != nil { - return -1, "", newParseFormatError("could not parse formatting clause", err) - } - - valStr, err := formatter(val) - if err != nil { - return -1, "", newParseFormatError("error during formatting", err) - } - return i, valStr, nil -} - -func parseFormattingClauseV2(formatStr string, callback formatStringInterpolatorV2) (int, clauseImplV2, error) { - i := 0 - read, precision, err := parsePrecisionV2(formatStr[i:]) - i += read - if err != nil { - return -1, nil, fmt.Errorf("error while parsing precision: %w", err) - } - r := rune(formatStr[i]) - i++ - switch r { - case 's': - return i, callback.String, nil - case 'd': - return i, callback.Decimal, nil - case 'f': - return i, callback.Fixed(precision), nil - case 'e': - return i, callback.Scientific(precision), nil - case 'b': - return i, callback.Binary, nil - case 'x', 'X': - return i, callback.Hex(unicode.IsUpper(r)), nil - case 'o': - return i, callback.Octal, nil - default: - return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r) - } -} - -func parsePrecisionV2(formatStr string) (int, int, error) { - i := 0 - if formatStr[i] != '.' { - return i, defaultPrecision, nil - } - i++ - var buffer strings.Builder - for { - if i >= len(formatStr) { - return -1, -1, errors.New("could not find end of precision specifier") - } - if !isASCIIDigit(rune(formatStr[i])) { - break - } - buffer.WriteByte(formatStr[i]) - i++ - } - precision, err := strconv.Atoi(buffer.String()) - if err != nil { - return -1, -1, fmt.Errorf("error while converting precision to integer: %w", err) - } - if precision < 0 { - return -1, -1, fmt.Errorf("negative precision: %d", precision) - } - return i, precision, nil -} diff --git a/vendor/github.com/google/cel-go/ext/guards.go b/vendor/github.com/google/cel-go/ext/guards.go deleted file mode 100644 index 1461c0416..000000000 --- a/vendor/github.com/google/cel-go/ext/guards.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// function invocation guards for common call signatures within extension functions. - -func intOrError(i int64, err error) ref.Val { - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Int(i) -} - -func bytesOrError(bytes []byte, err error) ref.Val { - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.Bytes(bytes) -} - -func stringOrError(str string, err error) ref.Val { - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.String(str) -} - -func listStringOrError(strs []string, err error) ref.Val { - if err != nil { - return types.NewErrFromString(err.Error()) - } - return types.DefaultTypeAdapter.NativeToValue(strs) -} - -func extractIdent(target ast.Expr) (string, bool) { - switch target.Kind() { - case ast.IdentKind: - return target.AsIdent(), true - default: - return "", false - } -} - -func macroTargetMatchesNamespace(ns string, target ast.Expr) bool { - if id, found := extractIdent(target); found { - return id == ns - } - return false -} diff --git a/vendor/github.com/google/cel-go/ext/lists.go b/vendor/github.com/google/cel-go/ext/lists.go deleted file mode 100644 index b27ddf22f..000000000 --- a/vendor/github.com/google/cel-go/ext/lists.go +++ /dev/null @@ -1,779 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "fmt" - "math" - "sort" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker" - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/interpreter" - "github.com/google/cel-go/parser" -) - -var comparableTypes = []*cel.Type{ - cel.IntType, - cel.UintType, - cel.DoubleType, - cel.BoolType, - cel.DurationType, - cel.TimestampType, - cel.StringType, - cel.BytesType, -} - -// Lists returns a cel.EnvOption to configure extended functions for list manipulation. -// As a general note, all indices are zero-based. -// -// # Distinct -// -// Introduced in version: 2 (cost support in version 3) -// -// Returns the distinct elements of a list. -// -// .distinct() -> -// -// Examples: -// -// [1, 2, 2, 3, 3, 3].distinct() // return [1, 2, 3] -// ["b", "b", "c", "a", "c"].distinct() // return ["b", "c", "a"] -// [1, "b", 2, "b"].distinct() // return [1, "b", 2] -// -// # Range -// -// Introduced in version: 2 (cost support in version 3) -// -// Returns a list of integers from 0 to n-1. -// -// lists.range() -> -// -// Examples: -// -// lists.range(5) -> [0, 1, 2, 3, 4] -// -// # Reverse -// -// Introduced in version: 2 (cost support in version 3) -// -// Returns the elements of a list in reverse order. -// -// .reverse() -> -// -// Examples: -// -// [5, 3, 1, 2].reverse() // return [2, 1, 3, 5] -// -// # Slice -// -// Introduced in version: 0 (cost support in version 3) -// -// Returns a new sub-list using the indexes provided. -// -// .slice(, ) -> -// -// Examples: -// -// [1,2,3,4].slice(1, 3) // return [2, 3] -// [1,2,3,4].slice(2, 4) // return [3 ,4] -// -// # Flatten -// -// Introduced in version: 1 (cost support in version 3) -// -// Flattens a list recursively. -// If an optional depth is provided, the list is flattened to a the specified level. -// A negative depth value will result in an error. -// -// .flatten() -> -// .flatten() -> -// -// Examples: -// -// [1,[2,3],[4]].flatten() // return [1, 2, 3, 4] -// [1,[2,[3,4]]].flatten() // return [1, 2, [3, 4]] -// [1,2,[],[],[3,4]].flatten() // return [1, 2, 3, 4] -// [1,[2,[3,[4]]]].flatten(2) // return [1, 2, 3, [4]] -// [1,[2,[3,[4]]]].flatten(-1) // error -// -// # Sort -// -// Introduced in version: 2 (cost support in version 3) -// -// Sorts a list with comparable elements. If the element type is not comparable -// or the element types are not the same, the function will produce an error. -// -// .sort() -> -// T in {int, uint, double, bool, duration, timestamp, string, bytes} -// -// Examples: -// -// [3, 2, 1].sort() // return [1, 2, 3] -// ["b", "c", "a"].sort() // return ["a", "b", "c"] -// [1, "b"].sort() // error -// [[1, 2, 3]].sort() // error -// -// # SortBy -// -// Introduced in version: 2 (cost support in version 3) -// -// Sorts a list by a key value, i.e., the order is determined by the result of -// an expression applied to each element of the list. -// The output of the key expression must be a comparable type, otherwise the -// function will return an error. -// -// .sortBy(, ) -> -// keyExpr returns a value in {int, uint, double, bool, duration, timestamp, string, bytes} -// -// Examples: -// -// [ -// Player { name: "foo", score: 0 }, -// Player { name: "bar", score: -10 }, -// Player { name: "baz", score: 1000 }, -// ].sortBy(e, e.score).map(e, e.name) -// == ["bar", "foo", "baz"] -func Lists(options ...ListsOption) cel.EnvOption { - l := &listsLib{version: math.MaxUint32} - for _, o := range options { - l = o(l) - } - return cel.Lib(l) -} - -type listsLib struct { - version uint32 -} - -// LibraryName implements the SingletonLibrary interface method. -func (listsLib) LibraryName() string { - return "cel.lib.ext.lists" -} - -// ListsOption is a functional interface for configuring the strings library. -type ListsOption func(*listsLib) *listsLib - -// ListsVersion configures the version of the string library. -// -// The version limits which functions are available. Only functions introduced -// below or equal to the given version included in the library. If this option -// is not set, all functions are available. -// -// See the library documentation to determine which version a function was introduced. -// If the documentation does not state which version a function was introduced, it can -// be assumed to be introduced at version 0, when the library was first created. -func ListsVersion(version uint32) ListsOption { - return func(lib *listsLib) *listsLib { - lib.version = version - return lib - } -} - -// CompileOptions implements the Library interface method. -func (lib listsLib) CompileOptions() []cel.EnvOption { - listType := cel.ListType(cel.TypeParamType("T")) - listListType := cel.ListType(listType) - listDyn := cel.ListType(cel.DynType) - opts := []cel.EnvOption{ - cel.Function("slice", - cel.MemberOverload("list_slice", - []*cel.Type{listType, cel.IntType, cel.IntType}, listType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - list := args[0].(traits.Lister) - start := args[1].(types.Int) - end := args[2].(types.Int) - result, err := slice(list, start, end) - if err != nil { - return types.WrapErr(err) - } - return result - }), - ), - ), - } - if lib.version >= 1 { - opts = append(opts, - cel.Function("flatten", - cel.MemberOverload("list_flatten", - []*cel.Type{listListType}, listType, - cel.UnaryBinding(func(arg ref.Val) ref.Val { - // double-check as type-guards disabled - list, ok := arg.(traits.Lister) - if !ok { - return types.ValOrErr(arg, "no such overload: %v.flatten()", arg.Type()) - } - flatList, err := flatten(list, 1) - if err != nil { - return types.WrapErr(err) - } - - return types.DefaultTypeAdapter.NativeToValue(flatList) - }), - ), - cel.MemberOverload("list_flatten_int", - []*cel.Type{listDyn, types.IntType}, listDyn, - cel.BinaryBinding(func(arg1, arg2 ref.Val) ref.Val { - // double-check as type-guards disabled - list, ok := arg1.(traits.Lister) - if !ok { - return types.ValOrErr(arg1, "no such overload: %v.flatten(%v)", arg1.Type(), arg2.Type()) - } - depth, ok := arg2.(types.Int) - if !ok { - return types.ValOrErr(arg1, "no such overload: %v.flatten(%v)", arg1.Type(), arg2.Type()) - } - flatList, err := flatten(list, int64(depth)) - if err != nil { - return types.WrapErr(err) - } - - return types.DefaultTypeAdapter.NativeToValue(flatList) - }), - ), - // To handle the case where a variable of just `list(T)` is provided at runtime - // with a graceful failure more, disable the type guards since the implementation - // can handle lists which are already flat. - decls.DisableTypeGuards(true), - ), - ) - } - if lib.version >= 2 { - sortDecl := cel.Function("sort", - append( - templatedOverloads(comparableTypes, func(t *cel.Type) cel.FunctionOpt { - return cel.MemberOverload( - fmt.Sprintf("list_%s_sort", t.TypeName()), - []*cel.Type{cel.ListType(t)}, cel.ListType(t), - ) - }), - cel.SingletonUnaryBinding( - func(arg ref.Val) ref.Val { - // validated by type-guards - list := arg.(traits.Lister) - sorted, err := sortList(list) - if err != nil { - return types.WrapErr(err) - } - - return sorted - }, - // List traits - traits.ListerType, - ), - )..., - ) - opts = append(opts, sortDecl) - opts = append(opts, cel.Macros(cel.ReceiverMacro("sortBy", 2, sortByMacro))) - opts = append(opts, cel.Function("@sortByAssociatedKeys", - append( - templatedOverloads(comparableTypes, func(u *cel.Type) cel.FunctionOpt { - return cel.MemberOverload( - fmt.Sprintf("list_%s_sortByAssociatedKeys", u.TypeName()), - []*cel.Type{listType, cel.ListType(u)}, listType, - ) - }), - cel.SingletonBinaryBinding( - func(arg1, arg2 ref.Val) ref.Val { - // validated by type-guards - list := arg1.(traits.Lister) - keys := arg2.(traits.Lister) - sorted, err := sortListByAssociatedKeys(list, keys) - if err != nil { - return types.WrapErr(err) - } - - return sorted - }, - // List traits - traits.ListerType, - ), - )..., - )) - - opts = append(opts, cel.Function("lists.range", - cel.Overload("lists_range", - []*cel.Type{cel.IntType}, cel.ListType(cel.IntType), - cel.UnaryBinding(func(n ref.Val) ref.Val { - result, err := genRange(n.(types.Int)) - if err != nil { - return types.WrapErr(err) - } - return result - }), - ), - )) - opts = append(opts, cel.Function("reverse", - cel.MemberOverload("list_reverse", - []*cel.Type{listType}, listType, - cel.UnaryBinding(func(list ref.Val) ref.Val { - result, err := reverseList(list.(traits.Lister)) - if err != nil { - return types.WrapErr(err) - } - return result - }), - ), - )) - opts = append(opts, cel.Function("distinct", - cel.MemberOverload("list_distinct", - []*cel.Type{listType}, listType, - cel.UnaryBinding(func(list ref.Val) ref.Val { - result, err := distinctList(list.(traits.Lister)) - if err != nil { - return types.WrapErr(err) - } - return result - }), - ), - )) - } - if lib.version >= 3 { - estimators := []checker.CostOption{ - checker.OverloadCostEstimate("list_slice", estimateListSlice), - checker.OverloadCostEstimate("list_flatten", estimateListFlatten), - checker.OverloadCostEstimate("list_flatten_int", estimateListFlatten), - checker.OverloadCostEstimate("lists_range", estimateListsRange), - checker.OverloadCostEstimate("list_reverse", estimateListReverse), - checker.OverloadCostEstimate("list_distinct", estimateListDistinct), - } - for _, t := range comparableTypes { - estimators = append(estimators, - checker.OverloadCostEstimate( - fmt.Sprintf("list_%s_sort", t.TypeName()), - estimateListSort(t), - ), - checker.OverloadCostEstimate( - fmt.Sprintf("list_%s_sortByAssociatedKeys", t.TypeName()), - estimateListSortBy(t), - ), - ) - } - opts = append(opts, cel.CostEstimatorOptions(estimators...)) - } - - return opts -} - -// ProgramOptions implements the Library interface method. -func (lib *listsLib) ProgramOptions() []cel.ProgramOption { - var opts []cel.ProgramOption - if lib.version >= 3 { - // TODO: Add cost trackers for list operations - trackers := []interpreter.CostTrackerOption{ - interpreter.OverloadCostTracker("list_slice", trackListOutputSize), - interpreter.OverloadCostTracker("list_flatten", trackListFlatten), - interpreter.OverloadCostTracker("list_flatten_int", trackListFlatten), - interpreter.OverloadCostTracker("lists_range", trackListOutputSize), - interpreter.OverloadCostTracker("list_reverse", trackListOutputSize), - interpreter.OverloadCostTracker("list_distinct", trackListDistinct), - } - for _, t := range comparableTypes { - trackers = append(trackers, - interpreter.OverloadCostTracker( - fmt.Sprintf("list_%s_sort", t.TypeName()), - trackListSort, - ), - interpreter.OverloadCostTracker( - fmt.Sprintf("list_%s_sortByAssociatedKeys", t.TypeName()), - trackListSortBy, - ), - ) - } - opts = append(opts, cel.CostTrackerOptions(trackers...)) - } - return opts -} - -func genRange(n types.Int) (ref.Val, error) { - var newList []ref.Val - for i := types.Int(0); i < n; i++ { - newList = append(newList, i) - } - return types.DefaultTypeAdapter.NativeToValue(newList), nil -} - -func reverseList(list traits.Lister) (ref.Val, error) { - var newList []ref.Val - listLength := list.Size().(types.Int) - for i := types.Int(0); i < listLength; i++ { - val := list.Get(listLength - i - 1) - newList = append(newList, val) - } - return types.DefaultTypeAdapter.NativeToValue(newList), nil -} - -func slice(list traits.Lister, start, end types.Int) (ref.Val, error) { - listLength := list.Size().(types.Int) - if start < 0 || end < 0 { - return nil, fmt.Errorf("cannot slice(%d, %d), negative indexes not supported", start, end) - } - if start > end { - return nil, fmt.Errorf("cannot slice(%d, %d), start index must be less than or equal to end index", start, end) - } - if listLength < end { - return nil, fmt.Errorf("cannot slice(%d, %d), list is length %d", start, end, listLength) - } - - var newList []ref.Val - for i := types.Int(start); i < end; i++ { - val := list.Get(i) - newList = append(newList, val) - } - return types.DefaultTypeAdapter.NativeToValue(newList), nil -} - -func flatten(list traits.Lister, depth int64) ([]ref.Val, error) { - if depth < 0 { - return nil, fmt.Errorf("level must be non-negative") - } - - var newList []ref.Val - iter := list.Iterator() - - for iter.HasNext() == types.True { - val := iter.Next() - nestedList, isList := val.(traits.Lister) - - if !isList || depth == 0 { - newList = append(newList, val) - continue - } else { - flattenedList, err := flatten(nestedList, depth-1) - if err != nil { - return nil, err - } - - newList = append(newList, flattenedList...) - } - } - - return newList, nil -} - -func sortList(list traits.Lister) (ref.Val, error) { - return sortListByAssociatedKeys(list, list) -} - -// Internal function used for the implementation of sort() and sortBy(). -// -// Sorts a list of arbitrary elements, according to the order produced by sorting -// another list of comparable elements. If the element type of the keys is not -// comparable or the element types are not the same, the function will produce an error. -// -// .@sortByAssociatedKeys() -> -// U in {int, uint, double, bool, duration, timestamp, string, bytes} -// -// Example: -// -// ["foo", "bar", "baz"].@sortByAssociatedKeys([3, 1, 2]) // return ["bar", "baz", "foo"] -func sortListByAssociatedKeys(list, keys traits.Lister) (ref.Val, error) { - listLength := list.Size().(types.Int) - keysLength := keys.Size().(types.Int) - if listLength != keysLength { - return nil, fmt.Errorf( - "@sortByAssociatedKeys() expected a list of the same size as the associated keys list, but got %d and %d elements respectively", - listLength, - keysLength, - ) - } - if listLength == 0 { - return list, nil - } - elem := keys.Get(types.IntZero) - if _, ok := elem.(traits.Comparer); !ok { - return nil, fmt.Errorf("list elements must be comparable") - } - - sortedIndices := make([]ref.Val, 0, listLength) - for i := types.IntZero; i < listLength; i++ { - sortedIndices = append(sortedIndices, i) - } - - var err error - sort.Slice(sortedIndices, func(i, j int) bool { - iKey := keys.Get(sortedIndices[i]) - jKey := keys.Get(sortedIndices[j]) - if iKey.Type() != elem.Type() || jKey.Type() != elem.Type() { - err = fmt.Errorf("list elements must have the same type") - return false - } - return iKey.(traits.Comparer).Compare(jKey) == types.IntNegOne - }) - if err != nil { - return nil, err - } - - sorted := make([]ref.Val, 0, listLength) - for _, sortedIdx := range sortedIndices { - sorted = append(sorted, list.Get(sortedIdx)) - } - return types.DefaultTypeAdapter.NativeToValue(sorted), nil -} - -// sortByMacro transforms an expression like: -// -// mylistExpr.sortBy(e, -math.abs(e)) -// -// into something equivalent to: -// -// cel.bind( -// __sortBy_input__, -// myListExpr, -// __sortBy_input__.@sortByAssociatedKeys(__sortBy_input__.map(e, -math.abs(e)) -// ) -func sortByMacro(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - varIdent := meh.NewIdent("@__sortBy_input__") - varName := varIdent.AsIdent() - - targetKind := target.Kind() - if targetKind != ast.ListKind && - targetKind != ast.SelectKind && - targetKind != ast.IdentKind && - targetKind != ast.ComprehensionKind && - targetKind != ast.CallKind { - return nil, meh.NewError(target.ID(), "sortBy can only be applied to a list, identifier, comprehension, call or select expression") - } - - mapCompr, err := parser.MakeMap(meh, meh.Copy(varIdent), args) - if err != nil { - return nil, err - } - callExpr := meh.NewMemberCall("@sortByAssociatedKeys", - meh.Copy(varIdent), - mapCompr, - ) - - bindExpr := meh.NewComprehension( - meh.NewList(), - "#unused", - varName, - target, - meh.NewLiteral(types.False), - varIdent, - callExpr, - ) - - return bindExpr, nil -} - -func distinctList(list traits.Lister) (ref.Val, error) { - listLength := list.Size().(types.Int) - if listLength == 0 { - return list, nil - } - uniqueList := make([]ref.Val, 0, listLength) - for i := types.IntZero; i < listLength; i++ { - val := list.Get(i) - seen := false - for j := types.IntZero; j < types.Int(len(uniqueList)); j++ { - if i == j { - continue - } - other := uniqueList[j] - if val.Equal(other) == types.True { - seen = true - break - } - } - if !seen { - uniqueList = append(uniqueList, val) - } - } - - return types.DefaultTypeAdapter.NativeToValue(uniqueList), nil -} - -func templatedOverloads(types []*cel.Type, template func(t *cel.Type) cel.FunctionOpt) []cel.FunctionOpt { - overloads := make([]cel.FunctionOpt, len(types)) - for i, t := range types { - overloads[i] = template(t) - } - return overloads -} - -// estimateListSlice computes an O(n) slice operation with a cost factor of 1. -func estimateListSlice(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) != 2 { - return nil - } - sz := estimateSize(estimator, *target) - start := nodeAsIntValue(args[0], 0) - end := nodeAsIntValue(args[1], sz.Max) - return estimateAllocatingListCall(1, checker.FixedSizeEstimate(end-start)) -} - -// estimateListsRange computes an O(n) range operation with a cost factor of 1. -func estimateListsRange(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target != nil || len(args) != 1 { - return nil - } - return estimateAllocatingListCall(1, checker.FixedSizeEstimate(nodeAsIntValue(args[0], math.MaxUint))) -} - -// estimateListReverse computes an O(n) reverse operation with a cost factor of 1. -func estimateListReverse(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) != 0 { - return nil - } - return estimateAllocatingListCall(1, estimateSize(estimator, *target)) -} - -// estimateListFlatten computes an O(n) flatten operation with a cost factor proportional to the flatten depth. -func estimateListFlatten(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) > 1 { - return nil - } - depth := uint64(1) - if len(args) == 1 { - depth = nodeAsIntValue(args[0], math.MaxUint) - } - return estimateAllocatingListCall(float64(depth), estimateSize(estimator, *target)) -} - -// Compute an O(n^2) with a cost factor of 2, equivalent to sets.contains with a result list -// which can vary in size from 1 element to the original list size. -func estimateListDistinct(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) != 0 { - return nil - } - sz := estimateSize(estimator, *target) - costFactor := 2.0 - return estimateAllocatingListCall(costFactor, sz.Multiply(sz)) -} - -// estimateListSort computes an O(n^2) sort operation with a cost factor of 2 for the equality -// operations against the elements in the list against themselves which occur during the sort computation. -func estimateListSort(t *types.Type) checker.FunctionEstimator { - return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) != 0 { - return nil - } - return estimateListSortCost(estimator, *target, t) - } -} - -// estimateListSortBy computes an O(n^2) sort operation with a cost factor of 2 for the equality -// operations against the sort index list which occur during the sort computation. -func estimateListSortBy(u *types.Type) checker.FunctionEstimator { - return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if target == nil || len(args) != 1 { - return nil - } - // Estimate the size of the list used as the sort index - return estimateListSortCost(estimator, args[0], u) - } -} - -// estimateListSortCost estimates an O(n^2) sort operation with a cost factor of 2 for the equality -// operations which occur during the sort computation. -func estimateListSortCost(estimator checker.CostEstimator, node checker.AstNode, elemType *types.Type) *checker.CallEstimate { - sz := estimateSize(estimator, node) - costFactor := 2.0 - switch elemType { - case types.StringType, types.BytesType: - costFactor += common.StringTraversalCostFactor - } - return estimateAllocatingListCall(costFactor, sz.Multiply(sz)) -} - -// estimateAllocatingListCall computes cost as a function of the size of the result list with a -// baseline cost for the call dispatch and the associated list allocation. -func estimateAllocatingListCall(costFactor float64, listSize checker.SizeEstimate) *checker.CallEstimate { - return estimateListCall(costFactor, listSize, true) -} - -// estimateListCall computes cost as a function of the size of the target list and whether the -// call allocates memory. -func estimateListCall(costFactor float64, listSize checker.SizeEstimate, allocates bool) *checker.CallEstimate { - cost := listSize.MultiplyByCostFactor(costFactor).Add(callCostEstimate) - if allocates { - cost = cost.Add(checker.FixedCostEstimate(common.ListCreateBaseCost)) - } - return &checker.CallEstimate{CostEstimate: cost, ResultSize: &listSize} -} - -// trackListOutputSize computes cost as a function of the size of the result list. -func trackListOutputSize(_ []ref.Val, result ref.Val) *uint64 { - return trackAllocatingListCall(1, actualSize(result)) -} - -// trackListFlatten computes cost as a function of the size of the result list and the depth of -// the flatten operation. -func trackListFlatten(args []ref.Val, _ ref.Val) *uint64 { - depth := 1.0 - if len(args) == 2 { - depth = float64(args[1].(types.Int)) - } - inputSize := actualSize(args[0]) - return trackAllocatingListCall(depth, inputSize) -} - -// trackListDistinct computes costs as a worst-case O(n^2) operation over the input list. -func trackListDistinct(args []ref.Val, _ ref.Val) *uint64 { - return trackListSelfCompare(args[0].(traits.Lister)) -} - -// trackListSort computes costs as a worst-case O(n^2) operation over the input list. -func trackListSort(args []ref.Val, result ref.Val) *uint64 { - return trackListSelfCompare(args[0].(traits.Lister)) -} - -// trackListSortBy computes costs as a worst-case O(n^2) operation over the sort index list. -func trackListSortBy(args []ref.Val, result ref.Val) *uint64 { - return trackListSelfCompare(args[1].(traits.Lister)) -} - -// trackListSelfCompare computes costs as a worst-case O(n^2) operation over the input list. -func trackListSelfCompare(l traits.Lister) *uint64 { - sz := actualSize(l) - costFactor := 2.0 - if sz == 0 { - return trackAllocatingListCall(costFactor, 0) - } - elem := l.Get(types.IntZero) - if elem.Type() == types.StringType || elem.Type() == types.BytesType { - costFactor += common.StringTraversalCostFactor - } - return trackAllocatingListCall(costFactor, sz*sz) -} - -// trackAllocatingListCall computes costs as a function of the size of the result list with a baseline cost -// for the call dispatch and the associated list allocation. -func trackAllocatingListCall(costFactor float64, size uint64) *uint64 { - cost := uint64(float64(size)*costFactor) + callCost + common.ListCreateBaseCost - return &cost -} - -func nodeAsIntValue(node checker.AstNode, defaultVal uint64) uint64 { - if node.Expr().Kind() != ast.LiteralKind { - return defaultVal - } - lit := node.Expr().AsLiteral() - if lit.Type() != types.IntType { - return defaultVal - } - val := lit.(types.Int) - if val < types.IntZero { - return 0 - } - return uint64(lit.(types.Int)) -} diff --git a/vendor/github.com/google/cel-go/ext/math.go b/vendor/github.com/google/cel-go/ext/math.go deleted file mode 100644 index 6df8e3773..000000000 --- a/vendor/github.com/google/cel-go/ext/math.go +++ /dev/null @@ -1,948 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "fmt" - "math" - "strings" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// Math returns a cel.EnvOption to configure namespaced math helper macros and -// functions. -// -// Note, all macros use the 'math' namespace; however, at the time of macro -// expansion the namespace looks just like any other identifier. If you are -// currently using a variable named 'math', the macro will likely work just as -// intended; however, there is some chance for collision. -// -// # Math.Greatest -// -// Returns the greatest valued number present in the arguments to the macro. -// -// Greatest is a variable argument count macro which must take at least one -// argument. Simple numeric and list literals are supported as valid argument -// types; however, other literals will be flagged as errors during macro -// expansion. If the argument expression does not resolve to a numeric or -// list(numeric) type during type-checking, or during runtime then an error -// will be produced. If a list argument is empty, this too will produce an -// error. -// -// math.greatest(, ...) -> -// -// Examples: -// -// math.greatest(1) // 1 -// math.greatest(1u, 2u) // 2u -// math.greatest(-42.0, -21.5, -100.0) // -21.5 -// math.greatest([-42.0, -21.5, -100.0]) // -21.5 -// math.greatest(numbers) // numbers must be list(numeric) -// -// math.greatest() // parse error -// math.greatest('string') // parse error -// math.greatest(a, b) // check-time error if a or b is non-numeric -// math.greatest(dyn('string')) // runtime error -// -// # Math.Least -// -// Returns the least valued number present in the arguments to the macro. -// -// Least is a variable argument count macro which must take at least one -// argument. Simple numeric and list literals are supported as valid argument -// types; however, other literals will be flagged as errors during macro -// expansion. If the argument expression does not resolve to a numeric or -// list(numeric) type during type-checking, or during runtime then an error -// will be produced. If a list argument is empty, this too will produce an -// error. -// -// math.least(, ...) -> -// -// Examples: -// -// math.least(1) // 1 -// math.least(1u, 2u) // 1u -// math.least(-42.0, -21.5, -100.0) // -100.0 -// math.least([-42.0, -21.5, -100.0]) // -100.0 -// math.least(numbers) // numbers must be list(numeric) -// -// math.least() // parse error -// math.least('string') // parse error -// math.least(a, b) // check-time error if a or b is non-numeric -// math.least(dyn('string')) // runtime error -// -// # Math.BitOr -// -// Introduced at version: 1 -// -// Performs a bitwise-OR operation over two int or uint values. -// -// math.bitOr(, ) -> -// math.bitOr(, ) -> -// -// Examples: -// -// math.bitOr(1u, 2u) // returns 3u -// math.bitOr(-2, -4) // returns -2 -// -// # Math.BitAnd -// -// Introduced at version: 1 -// -// Performs a bitwise-AND operation over two int or uint values. -// -// math.bitAnd(, ) -> -// math.bitAnd(, ) -> -// -// Examples: -// -// math.bitAnd(3u, 2u) // return 2u -// math.bitAnd(3, 5) // returns 3 -// math.bitAnd(-3, -5) // returns -7 -// -// # Math.BitXor -// -// Introduced at version: 1 -// -// math.bitXor(, ) -> -// math.bitXor(, ) -> -// -// Performs a bitwise-XOR operation over two int or uint values. -// -// Examples: -// -// math.bitXor(3u, 5u) // returns 6u -// math.bitXor(1, 3) // returns 2 -// -// # Math.BitNot -// -// Introduced at version: 1 -// -// Function which accepts a single int or uint and performs a bitwise-NOT -// ones-complement of the given binary value. -// -// math.bitNot() -> -// math.bitNot() -> -// -// Examples -// -// math.bitNot(1) // returns -1 -// math.bitNot(-1) // return 0 -// math.bitNot(0u) // returns 18446744073709551615u -// -// # Math.BitShiftLeft -// -// Introduced at version: 1 -// -// Perform a left shift of bits on the first parameter, by the amount of bits -// specified in the second parameter. The first parameter is either a uint or -// an int. The second parameter must be an int. -// -// When the second parameter is 64 or greater, 0 will be always be returned -// since the number of bits shifted is greater than or equal to the total bit -// length of the number being shifted. Negative valued bit shifts will result -// in a runtime error. -// -// math.bitShiftLeft(, ) -> -// math.bitShiftLeft(, ) -> -// -// Examples -// -// math.bitShiftLeft(1, 2) // returns 4 -// math.bitShiftLeft(-1, 2) // returns -4 -// math.bitShiftLeft(1u, 2) // return 4u -// math.bitShiftLeft(1u, 200) // returns 0u -// -// # Math.BitShiftRight -// -// Introduced at version: 1 -// -// Perform a right shift of bits on the first parameter, by the amount of bits -// specified in the second parameter. The first parameter is either a uint or -// an int. The second parameter must be an int. -// -// When the second parameter is 64 or greater, 0 will always be returned since -// the number of bits shifted is greater than or equal to the total bit length -// of the number being shifted. Negative valued bit shifts will result in a -// runtime error. -// -// The sign bit extension will not be preserved for this operation: vacant bits -// on the left are filled with 0. -// -// math.bitShiftRight(, ) -> -// math.bitShiftRight(, ) -> -// -// Examples -// -// math.bitShiftRight(1024, 2) // returns 256 -// math.bitShiftRight(1024u, 2) // returns 256u -// math.bitShiftRight(1024u, 64) // returns 0u -// -// # Math.Ceil -// -// Introduced at version: 1 -// -// Compute the ceiling of a double value. -// -// math.ceil() -> -// -// Examples: -// -// math.ceil(1.2) // returns 2.0 -// math.ceil(-1.2) // returns -1.0 -// -// # Math.Floor -// -// Introduced at version: 1 -// -// Compute the floor of a double value. -// -// math.floor() -> -// -// Examples: -// -// math.floor(1.2) // returns 1.0 -// math.floor(-1.2) // returns -2.0 -// -// # Math.Round -// -// Introduced at version: 1 -// -// Rounds the double value to the nearest whole number with ties rounding away -// from zero, e.g. 1.5 -> 2.0, -1.5 -> -2.0. -// -// math.round() -> -// -// Examples: -// -// math.round(1.2) // returns 1.0 -// math.round(1.5) // returns 2.0 -// math.round(-1.5) // returns -2.0 -// -// # Math.Trunc -// -// Introduced at version: 1 -// -// Truncates the fractional portion of the double value. -// -// math.trunc() -> -// -// Examples: -// -// math.trunc(-1.3) // returns -1.0 -// math.trunc(1.3) // returns 1.0 -// -// # Math.Abs -// -// Introduced at version: 1 -// -// Returns the absolute value of the numeric type provided as input. If the -// value is NaN, the output is NaN. If the input is int64 min, the function -// will result in an overflow error. -// -// math.abs() -> -// math.abs() -> -// math.abs() -> -// -// Examples: -// -// math.abs(-1) // returns 1 -// math.abs(1) // returns 1 -// math.abs(-9223372036854775808) // overflow error -// -// # Math.Sign -// -// Introduced at version: 1 -// -// Returns the sign of the numeric type, either -1, 0, 1 as an int, double, or -// uint depending on the overload. For floating point values, if NaN is -// provided as input, the output is also NaN. The implementation does not -// differentiate between positive and negative zero. -// -// math.sign() -> -// math.sign() -> -// math.sign() -> -// -// Examples: -// -// math.sign(-42) // returns -1 -// math.sign(0) // returns 0 -// math.sign(42) // returns 1 -// -// # Math.IsInf -// -// Introduced at version: 1 -// -// Returns true if the input double value is -Inf or +Inf. -// -// math.isInf() -> -// -// Examples: -// -// math.isInf(1.0/0.0) // returns true -// math.isInf(1.2) // returns false -// -// # Math.IsNaN -// -// Introduced at version: 1 -// -// Returns true if the input double value is NaN, false otherwise. -// -// math.isNaN() -> -// -// Examples: -// -// math.isNaN(0.0/0.0) // returns true -// math.isNaN(1.2) // returns false -// -// # Math.IsFinite -// -// Introduced at version: 1 -// -// Returns true if the value is a finite number. Equivalent in behavior to: -// !math.isNaN(double) && !math.isInf(double) -// -// math.isFinite() -> -// -// Examples: -// -// math.isFinite(0.0/0.0) // returns false -// math.isFinite(1.2) // returns true -// -// # Math.Sqrt -// -// Introduced at version: 2 -// -// Returns the square root of the given input as double -// Throws error for negative or non-numeric inputs -// -// math.sqrt() -> -// math.sqrt() -> -// math.sqrt() -> -// -// Examples: -// -// math.sqrt(81) // returns 9.0 -// math.sqrt(985.25) // returns 31.388692231439016 -// math.sqrt(-15) // returns NaN -func Math(options ...MathOption) cel.EnvOption { - m := &mathLib{version: math.MaxUint32} - for _, o := range options { - m = o(m) - } - return cel.Lib(m) -} - -const ( - mathNamespace = "math" - leastMacro = "least" - greatestMacro = "greatest" - - // Min-max functions - minFunc = "math.@min" - maxFunc = "math.@max" - - // Rounding functions - ceilFunc = "math.ceil" - floorFunc = "math.floor" - roundFunc = "math.round" - truncFunc = "math.trunc" - - // Floating point helper functions - isInfFunc = "math.isInf" - isNanFunc = "math.isNaN" - isFiniteFunc = "math.isFinite" - - // Signedness functions - absFunc = "math.abs" - signFunc = "math.sign" - - // SquareRoot function - sqrtFunc = "math.sqrt" - - // Bitwise functions - bitAndFunc = "math.bitAnd" - bitOrFunc = "math.bitOr" - bitXorFunc = "math.bitXor" - bitNotFunc = "math.bitNot" - bitShiftLeftFunc = "math.bitShiftLeft" - bitShiftRightFunc = "math.bitShiftRight" -) - -var ( - errIntOverflow = types.NewErr("integer overflow") -) - -// MathOption declares a functional operator for configuring math extensions. -type MathOption func(*mathLib) *mathLib - -// MathVersion sets the library version for math extensions. -func MathVersion(version uint32) MathOption { - return func(lib *mathLib) *mathLib { - lib.version = version - return lib - } -} - -type mathLib struct { - version uint32 -} - -// LibraryName implements the SingletonLibrary interface method. -func (*mathLib) LibraryName() string { - return "cel.lib.ext.math" -} - -// CompileOptions implements the Library interface method. -func (lib *mathLib) CompileOptions() []cel.EnvOption { - opts := []cel.EnvOption{ - cel.Macros( - // math.least(num, ...) - cel.ReceiverVarArgMacro(leastMacro, mathLeast), - // math.greatest(num, ...) - cel.ReceiverVarArgMacro(greatestMacro, mathGreatest), - ), - cel.Function(minFunc, - cel.Overload("math_@min_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(identity)), - cel.Overload("math_@min_int", []*cel.Type{cel.IntType}, cel.IntType, - cel.UnaryBinding(identity)), - cel.Overload("math_@min_uint", []*cel.Type{cel.UintType}, cel.UintType, - cel.UnaryBinding(identity)), - cel.Overload("math_@min_double_double", []*cel.Type{cel.DoubleType, cel.DoubleType}, cel.DoubleType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_uint_uint", []*cel.Type{cel.UintType, cel.UintType}, cel.UintType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_int_uint", []*cel.Type{cel.IntType, cel.UintType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_int_double", []*cel.Type{cel.IntType, cel.DoubleType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_double_int", []*cel.Type{cel.DoubleType, cel.IntType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_double_uint", []*cel.Type{cel.DoubleType, cel.UintType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_uint_int", []*cel.Type{cel.UintType, cel.IntType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_uint_double", []*cel.Type{cel.UintType, cel.DoubleType}, cel.DynType, - cel.BinaryBinding(minPair)), - cel.Overload("math_@min_list_double", []*cel.Type{cel.ListType(cel.DoubleType)}, cel.DoubleType, - cel.UnaryBinding(minList)), - cel.Overload("math_@min_list_int", []*cel.Type{cel.ListType(cel.IntType)}, cel.IntType, - cel.UnaryBinding(minList)), - cel.Overload("math_@min_list_uint", []*cel.Type{cel.ListType(cel.UintType)}, cel.UintType, - cel.UnaryBinding(minList)), - ), - cel.Function(maxFunc, - cel.Overload("math_@max_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(identity)), - cel.Overload("math_@max_int", []*cel.Type{cel.IntType}, cel.IntType, - cel.UnaryBinding(identity)), - cel.Overload("math_@max_uint", []*cel.Type{cel.UintType}, cel.UintType, - cel.UnaryBinding(identity)), - cel.Overload("math_@max_double_double", []*cel.Type{cel.DoubleType, cel.DoubleType}, cel.DoubleType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_uint_uint", []*cel.Type{cel.UintType, cel.UintType}, cel.UintType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_int_uint", []*cel.Type{cel.IntType, cel.UintType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_int_double", []*cel.Type{cel.IntType, cel.DoubleType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_double_int", []*cel.Type{cel.DoubleType, cel.IntType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_double_uint", []*cel.Type{cel.DoubleType, cel.UintType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_uint_int", []*cel.Type{cel.UintType, cel.IntType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_uint_double", []*cel.Type{cel.UintType, cel.DoubleType}, cel.DynType, - cel.BinaryBinding(maxPair)), - cel.Overload("math_@max_list_double", []*cel.Type{cel.ListType(cel.DoubleType)}, cel.DoubleType, - cel.UnaryBinding(maxList)), - cel.Overload("math_@max_list_int", []*cel.Type{cel.ListType(cel.IntType)}, cel.IntType, - cel.UnaryBinding(maxList)), - cel.Overload("math_@max_list_uint", []*cel.Type{cel.ListType(cel.UintType)}, cel.UintType, - cel.UnaryBinding(maxList)), - ), - } - if lib.version >= 1 { - opts = append(opts, - // Rounding function declarations - cel.Function(ceilFunc, - cel.Overload("math_ceil_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(ceil))), - cel.Function(floorFunc, - cel.Overload("math_floor_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(floor))), - cel.Function(roundFunc, - cel.Overload("math_round_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(round))), - cel.Function(truncFunc, - cel.Overload("math_trunc_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(trunc))), - - // Floating point helpers - cel.Function(isInfFunc, - cel.Overload("math_isInf_double", []*cel.Type{cel.DoubleType}, cel.BoolType, - cel.UnaryBinding(isInf))), - cel.Function(isNanFunc, - cel.Overload("math_isNaN_double", []*cel.Type{cel.DoubleType}, cel.BoolType, - cel.UnaryBinding(isNaN))), - cel.Function(isFiniteFunc, - cel.Overload("math_isFinite_double", []*cel.Type{cel.DoubleType}, cel.BoolType, - cel.UnaryBinding(isFinite))), - - // Signedness functions - cel.Function(absFunc, - cel.Overload("math_abs_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(absDouble)), - cel.Overload("math_abs_int", []*cel.Type{cel.IntType}, cel.IntType, - cel.UnaryBinding(absInt)), - cel.Overload("math_abs_uint", []*cel.Type{cel.UintType}, cel.UintType, - cel.UnaryBinding(identity)), - ), - cel.Function(signFunc, - cel.Overload("math_sign_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(sign)), - cel.Overload("math_sign_int", []*cel.Type{cel.IntType}, cel.IntType, - cel.UnaryBinding(sign)), - cel.Overload("math_sign_uint", []*cel.Type{cel.UintType}, cel.UintType, - cel.UnaryBinding(sign)), - ), - - // Bitwise operator declarations - cel.Function(bitAndFunc, - cel.Overload("math_bitAnd_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(bitAndPairInt)), - cel.Overload("math_bitAnd_uint_uint", []*cel.Type{cel.UintType, cel.UintType}, cel.UintType, - cel.BinaryBinding(bitAndPairUint)), - ), - cel.Function(bitOrFunc, - cel.Overload("math_bitOr_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(bitOrPairInt)), - cel.Overload("math_bitOr_uint_uint", []*cel.Type{cel.UintType, cel.UintType}, cel.UintType, - cel.BinaryBinding(bitOrPairUint)), - ), - cel.Function(bitXorFunc, - cel.Overload("math_bitXor_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(bitXorPairInt)), - cel.Overload("math_bitXor_uint_uint", []*cel.Type{cel.UintType, cel.UintType}, cel.UintType, - cel.BinaryBinding(bitXorPairUint)), - ), - cel.Function(bitNotFunc, - cel.Overload("math_bitNot_int_int", []*cel.Type{cel.IntType}, cel.IntType, - cel.UnaryBinding(bitNotInt)), - cel.Overload("math_bitNot_uint_uint", []*cel.Type{cel.UintType}, cel.UintType, - cel.UnaryBinding(bitNotUint)), - ), - cel.Function(bitShiftLeftFunc, - cel.Overload("math_bitShiftLeft_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(bitShiftLeftIntInt)), - cel.Overload("math_bitShiftLeft_uint_int", []*cel.Type{cel.UintType, cel.IntType}, cel.UintType, - cel.BinaryBinding(bitShiftLeftUintInt)), - ), - cel.Function(bitShiftRightFunc, - cel.Overload("math_bitShiftRight_int_int", []*cel.Type{cel.IntType, cel.IntType}, cel.IntType, - cel.BinaryBinding(bitShiftRightIntInt)), - cel.Overload("math_bitShiftRight_uint_int", []*cel.Type{cel.UintType, cel.IntType}, cel.UintType, - cel.BinaryBinding(bitShiftRightUintInt)), - ), - ) - } - if lib.version >= 2 { - opts = append(opts, - cel.Function(sqrtFunc, - cel.Overload("math_sqrt_double", []*cel.Type{cel.DoubleType}, cel.DoubleType, - cel.UnaryBinding(sqrt)), - cel.Overload("math_sqrt_int", []*cel.Type{cel.IntType}, cel.DoubleType, - cel.UnaryBinding(sqrt)), - cel.Overload("math_sqrt_uint", []*cel.Type{cel.UintType}, cel.DoubleType, - cel.UnaryBinding(sqrt)), - ), - ) - } - return opts -} - -// ProgramOptions implements the Library interface method. -func (*mathLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func mathLeast(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(mathNamespace, target) { - return nil, nil - } - switch len(args) { - case 0: - return nil, meh.NewError(target.ID(), "math.least() requires at least one argument") - case 1: - if isListLiteralWithNumericArgs(args[0]) || isNumericArgType(args[0]) { - return meh.NewCall(minFunc, args[0]), nil - } - return nil, meh.NewError(args[0].ID(), "math.least() invalid single argument value") - case 2: - err := checkInvalidArgs(meh, "math.least()", args) - if err != nil { - return nil, err - } - return meh.NewCall(minFunc, args...), nil - default: - err := checkInvalidArgs(meh, "math.least()", args) - if err != nil { - return nil, err - } - return meh.NewCall(minFunc, meh.NewList(args...)), nil - } -} - -func mathGreatest(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(mathNamespace, target) { - return nil, nil - } - switch len(args) { - case 0: - return nil, mef.NewError(target.ID(), "math.greatest() requires at least one argument") - case 1: - if isListLiteralWithNumericArgs(args[0]) || isNumericArgType(args[0]) { - return mef.NewCall(maxFunc, args[0]), nil - } - return nil, mef.NewError(args[0].ID(), "math.greatest() invalid single argument value") - case 2: - err := checkInvalidArgs(mef, "math.greatest()", args) - if err != nil { - return nil, err - } - return mef.NewCall(maxFunc, args...), nil - default: - err := checkInvalidArgs(mef, "math.greatest()", args) - if err != nil { - return nil, err - } - return mef.NewCall(maxFunc, mef.NewList(args...)), nil - } -} - -func identity(val ref.Val) ref.Val { - return val -} - -func ceil(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Double(math.Ceil(float64(v))) -} - -func floor(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Double(math.Floor(float64(v))) -} - -func round(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Double(math.Round(float64(v))) -} - -func trunc(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Double(math.Trunc(float64(v))) -} - -func isInf(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Bool(math.IsInf(float64(v), 0)) -} - -func isFinite(val ref.Val) ref.Val { - v := float64(val.(types.Double)) - return types.Bool(!math.IsInf(v, 0) && !math.IsNaN(v)) -} - -func isNaN(val ref.Val) ref.Val { - v := val.(types.Double) - return types.Bool(math.IsNaN(float64(v))) -} - -func absDouble(val ref.Val) ref.Val { - v := float64(val.(types.Double)) - return types.Double(math.Abs(v)) -} - -func absInt(val ref.Val) ref.Val { - v := int64(val.(types.Int)) - if v == math.MinInt64 { - return errIntOverflow - } - if v >= 0 { - return val - } - return -types.Int(v) -} - -func sign(val ref.Val) ref.Val { - switch v := val.(type) { - case types.Double: - if isNaN(v) == types.True { - return v - } - zero := types.Double(0) - if v > zero { - return types.Double(1) - } - if v < zero { - return types.Double(-1) - } - return zero - case types.Int: - return v.Compare(types.IntZero) - case types.Uint: - if v == types.Uint(0) { - return types.Uint(0) - } - return types.Uint(1) - default: - return maybeSuffixError(val, "math.sign") - } -} - - -func sqrt(val ref.Val) ref.Val { - switch v := val.(type) { - case types.Double: - return types.Double(math.Sqrt(float64(v))) - case types.Int: - return types.Double(math.Sqrt(float64(v))) - case types.Uint: - return types.Double(math.Sqrt(float64(v))) - default: - return types.NewErr("no such overload: sqrt") - } -} - - -func bitAndPairInt(first, second ref.Val) ref.Val { - l := first.(types.Int) - r := second.(types.Int) - return l & r -} - -func bitAndPairUint(first, second ref.Val) ref.Val { - l := first.(types.Uint) - r := second.(types.Uint) - return l & r -} - -func bitOrPairInt(first, second ref.Val) ref.Val { - l := first.(types.Int) - r := second.(types.Int) - return l | r -} - -func bitOrPairUint(first, second ref.Val) ref.Val { - l := first.(types.Uint) - r := second.(types.Uint) - return l | r -} - -func bitXorPairInt(first, second ref.Val) ref.Val { - l := first.(types.Int) - r := second.(types.Int) - return l ^ r -} - -func bitXorPairUint(first, second ref.Val) ref.Val { - l := first.(types.Uint) - r := second.(types.Uint) - return l ^ r -} - -func bitNotInt(value ref.Val) ref.Val { - v := value.(types.Int) - return ^v -} - -func bitNotUint(value ref.Val) ref.Val { - v := value.(types.Uint) - return ^v -} - -func bitShiftLeftIntInt(value, bits ref.Val) ref.Val { - v := value.(types.Int) - bs := bits.(types.Int) - if bs < types.IntZero { - return types.NewErr("math.bitShiftLeft() negative offset: %d", bs) - } - return v << bs -} - -func bitShiftLeftUintInt(value, bits ref.Val) ref.Val { - v := value.(types.Uint) - bs := bits.(types.Int) - if bs < types.IntZero { - return types.NewErr("math.bitShiftLeft() negative offset: %d", bs) - } - return v << bs -} - -func bitShiftRightIntInt(value, bits ref.Val) ref.Val { - v := value.(types.Int) - bs := bits.(types.Int) - if bs < types.IntZero { - return types.NewErr("math.bitShiftRight() negative offset: %d", bs) - } - return types.Int(types.Uint(v) >> bs) -} - -func bitShiftRightUintInt(value, bits ref.Val) ref.Val { - v := value.(types.Uint) - bs := bits.(types.Int) - if bs < types.IntZero { - return types.NewErr("math.bitShiftRight() negative offset: %d", bs) - } - return v >> bs -} - -func minPair(first, second ref.Val) ref.Val { - cmp, ok := first.(traits.Comparer) - if !ok { - return types.MaybeNoSuchOverloadErr(first) - } - out := cmp.Compare(second) - if types.IsUnknownOrError(out) { - return maybeSuffixError(out, "math.@min") - } - if out == types.IntOne { - return second - } - return first -} - -func minList(numList ref.Val) ref.Val { - l := numList.(traits.Lister) - size := l.Size().(types.Int) - if size == types.IntZero { - return types.NewErr("math.@min(list) argument must not be empty") - } - min := l.Get(types.IntZero) - for i := types.IntOne; i < size; i++ { - min = minPair(min, l.Get(i)) - } - switch min.Type() { - case types.IntType, types.DoubleType, types.UintType, types.UnknownType: - return min - default: - return types.NewErr("no such overload: math.@min") - } -} - -func maxPair(first, second ref.Val) ref.Val { - cmp, ok := first.(traits.Comparer) - if !ok { - return types.MaybeNoSuchOverloadErr(first) - } - out := cmp.Compare(second) - if types.IsUnknownOrError(out) { - return maybeSuffixError(out, "math.@max") - } - if out == types.IntNegOne { - return second - } - return first -} - -func maxList(numList ref.Val) ref.Val { - l := numList.(traits.Lister) - size := l.Size().(types.Int) - if size == types.IntZero { - return types.NewErr("math.@max(list) argument must not be empty") - } - max := l.Get(types.IntZero) - for i := types.IntOne; i < size; i++ { - max = maxPair(max, l.Get(i)) - } - switch max.Type() { - case types.IntType, types.DoubleType, types.UintType, types.UnknownType: - return max - default: - return types.NewErr("no such overload: math.@max") - } -} - -func checkInvalidArgs(meh cel.MacroExprFactory, funcName string, args []ast.Expr) *cel.Error { - for _, arg := range args { - err := checkInvalidArgLiteral(funcName, arg) - if err != nil { - return meh.NewError(arg.ID(), err.Error()) - } - } - return nil -} - -func checkInvalidArgLiteral(funcName string, arg ast.Expr) error { - if !isNumericArgType(arg) { - return fmt.Errorf("%s simple literal arguments must be numeric", funcName) - } - return nil -} - -func isNumericArgType(arg ast.Expr) bool { - switch arg.Kind() { - case ast.LiteralKind: - c := ref.Val(arg.AsLiteral()) - switch c.(type) { - case types.Double, types.Int, types.Uint: - return true - default: - return false - } - case ast.ListKind, ast.MapKind, ast.StructKind: - return false - default: - return true - } -} - -func isListLiteralWithNumericArgs(arg ast.Expr) bool { - switch arg.Kind() { - case ast.ListKind: - list := arg.AsList() - if list.Size() == 0 { - return false - } - for _, e := range list.Elements() { - if !isNumericArgType(e) { - return false - } - } - return true - } - return false -} - -func maybeSuffixError(val ref.Val, suffix string) ref.Val { - if types.IsError(val) { - msg := val.(*types.Err).String() - if !strings.Contains(msg, suffix) { - return types.NewErr("%s: %s", msg, suffix) - } - } - return val -} diff --git a/vendor/github.com/google/cel-go/ext/native.go b/vendor/github.com/google/cel-go/ext/native.go deleted file mode 100644 index 661984cbb..000000000 --- a/vendor/github.com/google/cel-go/ext/native.go +++ /dev/null @@ -1,796 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "errors" - "fmt" - "math" - "reflect" - "strings" - "time" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/pb" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - structpb "google.golang.org/protobuf/types/known/structpb" -) - -var ( - nativeObjTraitMask = traits.FieldTesterType | traits.IndexerType - jsonValueType = reflect.TypeOf(&structpb.Value{}) - jsonStructType = reflect.TypeOf(&structpb.Struct{}) -) - -// NativeTypes creates a type provider which uses reflect.Type and reflect.Value instances -// to produce type definitions that can be used within CEL. -// -// All struct types in Go are exposed to CEL via their simple package name and struct type name: -// -// ```go -// package identity -// -// type Account struct { -// ID int -// } -// -// ``` -// -// The type `identity.Account` would be exported to CEL using the same qualified name, e.g. -// `identity.Account{ID: 1234}` would create a new `Account` instance with the `ID` field -// populated. -// -// Only exported fields are exposed via NativeTypes, and the type-mapping between Go and CEL -// is as follows: -// -// | Go type | CEL type | -// |-------------------------------------|-----------| -// | bool | bool | -// | []byte | bytes | -// | float32, float64 | double | -// | int, int8, int16, int32, int64 | int | -// | string | string | -// | uint, uint8, uint16, uint32, uint64 | uint | -// | time.Duration | duration | -// | time.Time | timestamp | -// | array, slice | list | -// | map | map | -// -// Please note, if you intend to configure support for proto messages in addition to native -// types, you will need to provide the protobuf types before the golang native types. The -// same advice holds if you are using custom type adapters and type providers. The native type -// provider composes over whichever type adapter and provider is configured in the cel.Env at -// the time that it is invoked. -// -// There is also the possibility to rename the fields of native structs by setting the `cel` tag -// for fields you want to override. In order to enable this feature, pass in the `ParseStructTags(true)` -// option. Here is an example to see it in action: -// -// ```go -// package identity -// -// type Account struct { -// ID int -// OwnerName string `cel:"owner"` -// } -// -// ``` -// -// The `OwnerName` field is now accessible in CEL via `owner`, e.g. `identity.Account{owner: 'bob'}`. -// In case there are duplicated field names in the struct, an error will be returned. -func NativeTypes(args ...any) cel.EnvOption { - return func(env *cel.Env) (*cel.Env, error) { - nativeTypes := make([]any, 0, len(args)) - tpOptions := nativeTypeOptions{ - version: math.MaxUint32, - } - - for _, v := range args { - switch v := v.(type) { - case NativeTypesOption: - err := v(&tpOptions) - if err != nil { - return nil, err - } - default: - nativeTypes = append(nativeTypes, v) - } - } - - tp, err := newNativeTypeProvider(tpOptions, env.CELTypeAdapter(), env.CELTypeProvider(), nativeTypes...) - if err != nil { - return nil, err - } - - env, err = cel.CustomTypeAdapter(tp)(env) - if err != nil { - return nil, err - } - return cel.CustomTypeProvider(tp)(env) - } -} - -// NativeTypesOption is a functional interface for configuring handling of native types. -type NativeTypesOption func(*nativeTypeOptions) error - -// NativeTypesVersion sets the native types version support for native extensions functions. -func NativeTypesVersion(version uint32) NativeTypesOption { - return func(opts *nativeTypeOptions) error { - opts.version = version - return nil - } -} - -// NativeTypesFieldNameHandler is a handler for mapping a reflect.StructField to a CEL field name. -// This can be used to override the default Go struct field to CEL field name mapping. -type NativeTypesFieldNameHandler = func(field reflect.StructField) string - -func fieldNameByTag(structTagToParse string) func(field reflect.StructField) string { - return func(field reflect.StructField) string { - tag, found := field.Tag.Lookup(structTagToParse) - if found { - splits := strings.Split(tag, ",") - if len(splits) > 0 { - // We make the assumption that the leftmost entry in the tag is the name. - // This seems to be true for most tags that have the concept of a name/key, such as: - // https://pkg.go.dev/encoding/xml#Marshal - // https://pkg.go.dev/encoding/json#Marshal - // https://pkg.go.dev/go.mongodb.org/mongo-driver/bson#hdr-Structs - // https://pkg.go.dev/gopkg.in/yaml.v2#Marshal - name := splits[0] - return name - } - } - - return field.Name - } -} - -type nativeTypeOptions struct { - // fieldNameHandler controls how CEL should perform struct field renames. - // This is most commonly used for switching to parsing based off the struct field tag, - // such as "cel" or "json". - fieldNameHandler NativeTypesFieldNameHandler - - // version is the native types library version. - version uint32 -} - -// ParseStructTags configures if native types field names should be overridable by CEL struct tags. -// This is equivalent to ParseStructTag("cel") -func ParseStructTags(enabled bool) NativeTypesOption { - return func(ntp *nativeTypeOptions) error { - if enabled { - ntp.fieldNameHandler = fieldNameByTag("cel") - } else { - ntp.fieldNameHandler = nil - } - return nil - } -} - -// ParseStructTag configures the struct tag to parse. The 0th item in the tag is used as the name of the CEL field. -// For example: -// If the tag to parse is "cel" and the struct field has tag cel:"foo", the CEL struct field will be "foo". -// If the tag to parse is "json" and the struct field has tag json:"foo,omitempty", the CEL struct field will be "foo". -func ParseStructTag(tag string) NativeTypesOption { - return func(ntp *nativeTypeOptions) error { - ntp.fieldNameHandler = fieldNameByTag(tag) - return nil - } -} - -// ParseStructField configures how to parse Go struct fields. It can be used to customize struct field parsing. -func ParseStructField(handler NativeTypesFieldNameHandler) NativeTypesOption { - return func(ntp *nativeTypeOptions) error { - ntp.fieldNameHandler = handler - return nil - } -} - -func newNativeTypeProvider(tpOptions nativeTypeOptions, adapter types.Adapter, provider types.Provider, refTypes ...any) (*nativeTypeProvider, error) { - nativeTypes := make(map[string]*nativeType, len(refTypes)) - for _, refType := range refTypes { - switch rt := refType.(type) { - case reflect.Type: - result, err := newNativeTypes(tpOptions.fieldNameHandler, rt) - if err != nil { - return nil, err - } - for idx := range result { - nativeTypes[result[idx].TypeName()] = result[idx] - } - case reflect.Value: - result, err := newNativeTypes(tpOptions.fieldNameHandler, rt.Type()) - if err != nil { - return nil, err - } - for idx := range result { - nativeTypes[result[idx].TypeName()] = result[idx] - } - default: - return nil, fmt.Errorf("unsupported native type: %v (%T) must be reflect.Type or reflect.Value", rt, rt) - } - } - return &nativeTypeProvider{ - nativeTypes: nativeTypes, - baseAdapter: adapter, - baseProvider: provider, - options: tpOptions, - }, nil -} - -type nativeTypeProvider struct { - nativeTypes map[string]*nativeType - baseAdapter types.Adapter - baseProvider types.Provider - options nativeTypeOptions -} - -// EnumValue proxies to the types.Provider configured at the times the NativeTypes -// option was configured. -func (tp *nativeTypeProvider) EnumValue(enumName string) ref.Val { - return tp.baseProvider.EnumValue(enumName) -} - -// FindIdent looks up natives type instances by qualified identifier, and if not found -// proxies to the composed types.Provider. -func (tp *nativeTypeProvider) FindIdent(typeName string) (ref.Val, bool) { - if t, found := tp.nativeTypes[typeName]; found { - return t, true - } - return tp.baseProvider.FindIdent(typeName) -} - -// FindStructType looks up the CEL type definition by qualified identifier, and if not found -// proxies to the composed types.Provider. -func (tp *nativeTypeProvider) FindStructType(typeName string) (*types.Type, bool) { - if _, found := tp.nativeTypes[typeName]; found { - return types.NewTypeTypeWithParam(types.NewObjectType(typeName)), true - } - if celType, found := tp.baseProvider.FindStructType(typeName); found { - return celType, true - } - return tp.baseProvider.FindStructType(typeName) -} - -func toFieldName(fieldNameHandler NativeTypesFieldNameHandler, f reflect.StructField) string { - if fieldNameHandler == nil { - return f.Name - } - - return fieldNameHandler(f) -} - -// FindStructFieldNames looks up the type definition first from the native types, then from -// the backing provider type set. If found, a set of field names corresponding to the type -// will be returned. -func (tp *nativeTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) { - if t, found := tp.nativeTypes[typeName]; found { - fieldCount := t.refType.NumField() - fields := make([]string, fieldCount) - for i := 0; i < fieldCount; i++ { - fields[i] = toFieldName(tp.options.fieldNameHandler, t.refType.Field(i)) - } - return fields, true - } - if celTypeFields, found := tp.baseProvider.FindStructFieldNames(typeName); found { - return celTypeFields, true - } - return tp.baseProvider.FindStructFieldNames(typeName) -} - -// FindStructFieldType looks up a native type's field definition, and if the type name is not a native -// type then proxies to the composed types.Provider -func (tp *nativeTypeProvider) FindStructFieldType(typeName, fieldName string) (*types.FieldType, bool) { - t, found := tp.nativeTypes[typeName] - if !found { - return tp.baseProvider.FindStructFieldType(typeName, fieldName) - } - refField, isDefined := t.hasField(fieldName) - if !found || !isDefined { - return nil, false - } - celType, ok := convertToCelType(refField.Type) - if !ok { - return nil, false - } - return &types.FieldType{ - Type: celType, - IsSet: func(obj any) bool { - refVal := reflect.Indirect(reflect.ValueOf(obj)) - refField := refVal.FieldByName(refField.Name) - return !refField.IsZero() - }, - GetFrom: func(obj any) (any, error) { - refVal := reflect.Indirect(reflect.ValueOf(obj)) - refField := refVal.FieldByName(refField.Name) - return getFieldValue(refField), nil - }, - }, true -} - -// NewValue implements the ref.TypeProvider interface method. -func (tp *nativeTypeProvider) NewValue(typeName string, fields map[string]ref.Val) ref.Val { - t, found := tp.nativeTypes[typeName] - if !found { - return tp.baseProvider.NewValue(typeName, fields) - } - refPtr := reflect.New(t.refType) - refVal := refPtr.Elem() - for fieldName, val := range fields { - refFieldDef, isDefined := t.hasField(fieldName) - if !isDefined { - return types.NewErr("no such field: %s", fieldName) - } - fieldVal, err := val.ConvertToNative(refFieldDef.Type) - if err != nil { - return types.NewErrFromString(err.Error()) - } - refField := refVal.FieldByIndex(refFieldDef.Index) - refFieldVal := reflect.ValueOf(fieldVal) - refField.Set(refFieldVal) - } - return tp.NativeToValue(refPtr.Interface()) -} - -// NewValue adapts native values to CEL values and will proxy to the composed type adapter -// for non-native types. -func (tp *nativeTypeProvider) NativeToValue(val any) ref.Val { - if val == nil { - return types.NullValue - } - if v, ok := val.(ref.Val); ok { - return v - } - rawVal := reflect.ValueOf(val) - refVal := rawVal - if refVal.Kind() == reflect.Ptr { - refVal = reflect.Indirect(refVal) - } - // This isn't quite right if you're also supporting proto, - // but maybe an acceptable limitation. - switch refVal.Kind() { - case reflect.Array, reflect.Slice: - switch val := val.(type) { - case []byte: - return tp.baseAdapter.NativeToValue(val) - default: - if refVal.Type().Elem() == reflect.TypeOf(byte(0)) { - return tp.baseAdapter.NativeToValue(val) - } - return types.NewDynamicList(tp, val) - } - case reflect.Map: - return types.NewDynamicMap(tp, val) - case reflect.Struct: - switch val := val.(type) { - case proto.Message, *pb.Map, protoreflect.List, protoreflect.Message, protoreflect.Value, - time.Time: - return tp.baseAdapter.NativeToValue(val) - default: - return tp.newNativeObject(val, rawVal) - } - default: - return tp.baseAdapter.NativeToValue(val) - } -} - -func convertToCelType(refType reflect.Type) (*cel.Type, bool) { - switch refType.Kind() { - case reflect.Bool: - return cel.BoolType, true - case reflect.Float32, reflect.Float64: - return cel.DoubleType, true - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if refType == durationType { - return cel.DurationType, true - } - return cel.IntType, true - case reflect.String: - return cel.StringType, true - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return cel.UintType, true - case reflect.Array, reflect.Slice: - refElem := refType.Elem() - if refElem == reflect.TypeOf(byte(0)) { - return cel.BytesType, true - } - elemType, ok := convertToCelType(refElem) - if !ok { - return nil, false - } - return cel.ListType(elemType), true - case reflect.Map: - keyType, ok := convertToCelType(refType.Key()) - if !ok { - return nil, false - } - // Ensure the key type is a int, bool, uint, string - elemType, ok := convertToCelType(refType.Elem()) - if !ok { - return nil, false - } - return cel.MapType(keyType, elemType), true - case reflect.Struct: - if refType == timestampType { - return cel.TimestampType, true - } - return cel.ObjectType( - fmt.Sprintf("%s.%s", simplePkgAlias(refType.PkgPath()), refType.Name()), - ), true - case reflect.Pointer: - if refType.Implements(pbMsgInterfaceType) { - pbMsg := reflect.New(refType.Elem()).Interface().(protoreflect.ProtoMessage) - return cel.ObjectType(string(pbMsg.ProtoReflect().Descriptor().FullName())), true - } - return convertToCelType(refType.Elem()) - } - return nil, false -} - -func (tp *nativeTypeProvider) newNativeObject(val any, refValue reflect.Value) ref.Val { - valType, err := newNativeType(tp.options.fieldNameHandler, refValue.Type()) - if err != nil { - return types.NewErrFromString(err.Error()) - } - return &nativeObj{ - Adapter: tp, - val: val, - valType: valType, - refValue: refValue, - } -} - -type nativeObj struct { - types.Adapter - val any - valType *nativeType - refValue reflect.Value -} - -// ConvertToNative implements the ref.Val interface method. -// -// CEL does not have a notion of pointers, so whether a field is a pointer or value -// is handled as part of this conversion step. -func (o *nativeObj) ConvertToNative(typeDesc reflect.Type) (any, error) { - if o.refValue.Type() == typeDesc { - return o.val, nil - } - if o.refValue.Kind() == reflect.Pointer && o.refValue.Type().Elem() == typeDesc { - return o.refValue.Elem().Interface(), nil - } - if typeDesc.Kind() == reflect.Pointer && o.refValue.Type() == typeDesc.Elem() { - ptr := reflect.New(typeDesc.Elem()) - ptr.Elem().Set(o.refValue) - return ptr.Interface(), nil - } - switch typeDesc { - case jsonValueType: - jsonStruct, err := o.ConvertToNative(jsonStructType) - if err != nil { - return nil, err - } - return structpb.NewStructValue(jsonStruct.(*structpb.Struct)), nil - case jsonStructType: - refVal := reflect.Indirect(o.refValue) - refType := refVal.Type() - fields := make(map[string]*structpb.Value, refVal.NumField()) - for i := 0; i < refVal.NumField(); i++ { - fieldType := refType.Field(i) - fieldValue := refVal.Field(i) - if !fieldValue.IsValid() || fieldValue.IsZero() { - continue - } - fieldName := toFieldName(o.valType.fieldNameHandler, fieldType) - fieldCELVal := o.NativeToValue(fieldValue.Interface()) - fieldJSONVal, err := fieldCELVal.ConvertToNative(jsonValueType) - if err != nil { - return nil, err - } - fields[fieldName] = fieldJSONVal.(*structpb.Value) - } - return &structpb.Struct{Fields: fields}, nil - } - return nil, fmt.Errorf("type conversion error from '%v' to '%v'", o.Type(), typeDesc) -} - -// ConvertToType implements the ref.Val interface method. -func (o *nativeObj) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case types.TypeType: - return o.valType - default: - if typeVal.TypeName() == o.valType.typeName { - return o - } - } - return types.NewErr("type conversion error from '%s' to '%s'", o.Type(), typeVal) -} - -// Equal implements the ref.Val interface method. -// -// Note, that in Golang a pointer to a value is not equal to the value it contains. -// In CEL pointers and values to which they point are equal. -func (o *nativeObj) Equal(other ref.Val) ref.Val { - otherNtv, ok := other.(*nativeObj) - if !ok { - return types.False - } - val := o.val - otherVal := otherNtv.val - refVal := o.refValue - otherRefVal := otherNtv.refValue - if refVal.Kind() != otherRefVal.Kind() { - if refVal.Kind() == reflect.Pointer { - val = refVal.Elem().Interface() - } else if otherRefVal.Kind() == reflect.Pointer { - otherVal = otherRefVal.Elem().Interface() - } - } - return types.Bool(reflect.DeepEqual(val, otherVal)) -} - -// IsZeroValue indicates whether the contained Golang value is a zero value. -// -// Golang largely follows proto3 semantics for zero values. -func (o *nativeObj) IsZeroValue() bool { - return reflect.Indirect(o.refValue).IsZero() -} - -// IsSet tests whether a field which is defined is set to a non-default value. -func (o *nativeObj) IsSet(field ref.Val) ref.Val { - refField, refErr := o.getReflectedField(field) - if refErr != nil { - return refErr - } - return types.Bool(!refField.IsZero()) -} - -// Get returns the value fo a field name. -func (o *nativeObj) Get(field ref.Val) ref.Val { - refField, refErr := o.getReflectedField(field) - if refErr != nil { - return refErr - } - return adaptFieldValue(o, refField) -} - -func (o *nativeObj) getReflectedField(field ref.Val) (reflect.Value, ref.Val) { - fieldName, ok := field.(types.String) - if !ok { - return reflect.Value{}, types.MaybeNoSuchOverloadErr(field) - } - fieldNameStr := string(fieldName) - refField, isDefined := o.valType.hasField(fieldNameStr) - if !isDefined { - return reflect.Value{}, types.NewErr("no such field: %s", fieldName) - } - refVal := reflect.Indirect(o.refValue) - return refVal.FieldByIndex(refField.Index), nil -} - -// Type implements the ref.Val interface method. -func (o *nativeObj) Type() ref.Type { - return o.valType -} - -// Value implements the ref.Val interface method. -func (o *nativeObj) Value() any { - return o.val -} - -func newNativeTypes(fieldNameHandler NativeTypesFieldNameHandler, rawType reflect.Type) ([]*nativeType, error) { - nt, err := newNativeType(fieldNameHandler, rawType) - if err != nil { - return nil, err - } - result := []*nativeType{nt} - - alreadySeen := make(map[string]struct{}) - var iterateStructMembers func(reflect.Type) - iterateStructMembers = func(t reflect.Type) { - if k := t.Kind(); k == reflect.Pointer || k == reflect.Slice || k == reflect.Array || k == reflect.Map { - t = t.Elem() - } - if t.Kind() != reflect.Struct { - return - } - if _, seen := alreadySeen[t.String()]; seen { - return - } - alreadySeen[t.String()] = struct{}{} - nt, ntErr := newNativeType(fieldNameHandler, t) - if ntErr != nil { - err = ntErr - return - } - result = append(result, nt) - - for idx := 0; idx < t.NumField(); idx++ { - iterateStructMembers(t.Field(idx).Type) - } - } - iterateStructMembers(rawType) - - return result, err -} - -var ( - errDuplicatedFieldName = errors.New("field name already exists in struct") -) - -func newNativeType(fieldNameHandler NativeTypesFieldNameHandler, rawType reflect.Type) (*nativeType, error) { - refType := rawType - if refType.Kind() == reflect.Pointer { - refType = refType.Elem() - } - if !isValidObjectType(refType) { - return nil, fmt.Errorf("unsupported reflect.Type %v, must be reflect.Struct", rawType) - } - - // Since naming collisions can only happen with struct tag parsing, we only check for them if it is enabled. - if fieldNameHandler != nil { - fieldNames := make(map[string]struct{}) - - for idx := 0; idx < refType.NumField(); idx++ { - field := refType.Field(idx) - fieldName := toFieldName(fieldNameHandler, field) - - if _, found := fieldNames[fieldName]; found { - return nil, fmt.Errorf("invalid field name `%s` in struct `%s`: %w", fieldName, refType.Name(), errDuplicatedFieldName) - } else { - fieldNames[fieldName] = struct{}{} - } - } - } - - return &nativeType{ - typeName: fmt.Sprintf("%s.%s", simplePkgAlias(refType.PkgPath()), refType.Name()), - refType: refType, - fieldNameHandler: fieldNameHandler, - }, nil -} - -type nativeType struct { - typeName string - refType reflect.Type - fieldNameHandler NativeTypesFieldNameHandler -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (t *nativeType) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("type conversion error for type to '%v'", typeDesc) -} - -// ConvertToType implements ref.Val.ConvertToType. -func (t *nativeType) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case types.TypeType: - return types.TypeType - } - return types.NewErr("type conversion error from '%s' to '%s'", types.TypeType, typeVal) -} - -// Equal returns true of both type names are equal to each other. -func (t *nativeType) Equal(other ref.Val) ref.Val { - otherType, ok := other.(ref.Type) - return types.Bool(ok && t.TypeName() == otherType.TypeName()) -} - -// HasTrait implements the ref.Type interface method. -func (t *nativeType) HasTrait(trait int) bool { - return nativeObjTraitMask&trait == trait -} - -// String implements the strings.Stringer interface method. -func (t *nativeType) String() string { - return t.typeName -} - -// Type implements the ref.Val interface method. -func (t *nativeType) Type() ref.Type { - return types.TypeType -} - -// TypeName implements the ref.Type interface method. -func (t *nativeType) TypeName() string { - return t.typeName -} - -// Value implements the ref.Val interface method. -func (t *nativeType) Value() any { - return t.typeName -} - -// fieldByName returns the corresponding reflect.StructField for the give name either by matching -// field tag or field name. -func (t *nativeType) fieldByName(fieldName string) (reflect.StructField, bool) { - if t.fieldNameHandler == nil { - return t.refType.FieldByName(fieldName) - } - - for i := 0; i < t.refType.NumField(); i++ { - f := t.refType.Field(i) - if toFieldName(t.fieldNameHandler, f) == fieldName { - return f, true - } - } - - return reflect.StructField{}, false -} - -// hasField returns whether a field name has a corresponding Golang reflect.StructField -func (t *nativeType) hasField(fieldName string) (reflect.StructField, bool) { - f, found := t.fieldByName(fieldName) - if !found || !f.IsExported() || !isSupportedType(f.Type) { - return reflect.StructField{}, false - } - return f, true -} - -func adaptFieldValue(adapter types.Adapter, refField reflect.Value) ref.Val { - return adapter.NativeToValue(getFieldValue(refField)) -} - -func getFieldValue(refField reflect.Value) any { - if refField.IsZero() { - switch refField.Kind() { - case reflect.Struct: - if refField.Type() == timestampType { - return time.Unix(0, 0) - } - case reflect.Pointer: - return reflect.New(refField.Type().Elem()).Interface() - } - } - return refField.Interface() -} - -func simplePkgAlias(pkgPath string) string { - paths := strings.Split(pkgPath, "/") - if len(paths) == 0 { - return "" - } - return paths[len(paths)-1] -} - -func isValidObjectType(refType reflect.Type) bool { - return refType.Kind() == reflect.Struct -} - -func isSupportedType(refType reflect.Type) bool { - switch refType.Kind() { - case reflect.Chan, reflect.Complex64, reflect.Complex128, reflect.Func, reflect.UnsafePointer, reflect.Uintptr: - return false - case reflect.Array, reflect.Slice: - return isSupportedType(refType.Elem()) - case reflect.Map: - return isSupportedType(refType.Key()) && isSupportedType(refType.Elem()) - } - return true -} - -var ( - pbMsgInterfaceType = reflect.TypeOf((*protoreflect.ProtoMessage)(nil)).Elem() - timestampType = reflect.TypeOf(time.Now()) - durationType = reflect.TypeOf(time.Nanosecond) -) diff --git a/vendor/github.com/google/cel-go/ext/protos.go b/vendor/github.com/google/cel-go/ext/protos.go deleted file mode 100644 index b09db25b0..000000000 --- a/vendor/github.com/google/cel-go/ext/protos.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/ast" -) - -// Protos returns a cel.EnvOption to configure extended macros and functions for -// proto manipulation. -// -// Note, all macros use the 'proto' namespace; however, at the time of macro -// expansion the namespace looks just like any other identifier. If you are -// currently using a variable named 'proto', the macro will likely work just as -// intended; however, there is some chance for collision. -// -// # Protos.GetExt -// -// Macro which generates a select expression that retrieves an extension field -// from the input proto2 syntax message. If the field is not set, the default -// value forthe extension field is returned according to safe-traversal semantics. -// -// proto.getExt(, ) -> -// -// Examples: -// -// proto.getExt(msg, google.expr.proto2.test.int32_ext) // returns int value -// -// # Protos.HasExt -// -// Macro which generates a test-only select expression that determines whether -// an extension field is set on a proto2 syntax message. -// -// proto.hasExt(, ) -> -// -// Examples: -// -// proto.hasExt(msg, google.expr.proto2.test.int32_ext) // returns true || false -func Protos(options ...ProtosOption) cel.EnvOption { - l := &protoLib{version: math.MaxUint32} - for _, o := range options { - l = o(l) - } - return cel.Lib(l) -} - -// ProtosOption declares a functional operator for configuring protobuf utilities. -type ProtosOption func(*protoLib) *protoLib - -// ProtosVersion sets the library version for extensions for protobuf utilities. -func ProtosVersion(version uint32) ProtosOption { - return func(lib *protoLib) *protoLib { - lib.version = version - return lib - } -} - -var ( - protoNamespace = "proto" - hasExtension = "hasExt" - getExtension = "getExt" -) - -type protoLib struct { - version uint32 -} - -// LibraryName implements the SingletonLibrary interface method. -func (protoLib) LibraryName() string { - return "cel.lib.ext.protos" -} - -// CompileOptions implements the Library interface method. -func (protoLib) CompileOptions() []cel.EnvOption { - return []cel.EnvOption{ - cel.Macros( - // proto.getExt(msg, select_expression) - cel.ReceiverMacro(getExtension, 2, getProtoExt), - // proto.hasExt(msg, select_expression) - cel.ReceiverMacro(hasExtension, 2, hasProtoExt), - ), - } -} - -// ProgramOptions implements the Library interface method. -func (protoLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -// hasProtoExt generates a test-only select expression for a fully-qualified extension name on a protobuf message. -func hasProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(protoNamespace, target) { - return nil, nil - } - extensionField, err := getExtFieldName(mef, args[1]) - if err != nil { - return nil, err - } - return mef.NewPresenceTest(args[0], extensionField), nil -} - -// getProtoExt generates a select expression for a fully-qualified extension name on a protobuf message. -func getProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(protoNamespace, target) { - return nil, nil - } - extFieldName, err := getExtFieldName(mef, args[1]) - if err != nil { - return nil, err - } - return mef.NewSelect(args[0], extFieldName), nil -} - -func getExtFieldName(mef cel.MacroExprFactory, expr ast.Expr) (string, *cel.Error) { - isValid := false - extensionField := "" - switch expr.Kind() { - case ast.SelectKind: - extensionField, isValid = validateIdentifier(expr) - } - if !isValid { - return "", mef.NewError(expr.ID(), "invalid extension field") - } - return extensionField, nil -} - -func validateIdentifier(expr ast.Expr) (string, bool) { - switch expr.Kind() { - case ast.IdentKind: - return expr.AsIdent(), true - case ast.SelectKind: - sel := expr.AsSelect() - if sel.IsTestOnly() { - return "", false - } - opStr, isIdent := validateIdentifier(sel.Operand()) - if !isIdent { - return "", false - } - return opStr + "." + sel.FieldName(), true - default: - return "", false - } -} diff --git a/vendor/github.com/google/cel-go/ext/regex.go b/vendor/github.com/google/cel-go/ext/regex.go deleted file mode 100644 index 1a66f65d0..000000000 --- a/vendor/github.com/google/cel-go/ext/regex.go +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "errors" - "fmt" - "math" - "regexp" - "strconv" - "strings" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -const ( - regexReplace = "regex.replace" - regexExtract = "regex.extract" - regexExtractAll = "regex.extractAll" -) - -// Regex returns a cel.EnvOption to configure extended functions for regular -// expression operations. -// -// Note: all functions use the 'regex' namespace. If you are -// currently using a variable named 'regex', the functions will likely work as -// intended, however there is some chance for collision. -// -// This library depends on the CEL optional type. Please ensure that the -// cel.OptionalTypes() is enabled when using regex extensions. -// -// # Replace -// -// The `regex.replace` function replaces all non-overlapping substring of a regex -// pattern in the target string with a replacement string. Optionally, you can -// limit the number of replacements by providing a count argument. When the count -// is a negative number, the function acts as replace all. Only numeric (\N) -// capture group references are supported in the replacement string, with -// validation for correctness. Backslashed-escaped digits (\1 to \9) within the -// replacement argument can be used to insert text matching the corresponding -// parenthesized group in the regexp pattern. An error will be thrown for invalid -// regex or replace string. -// -// regex.replace(target: string, pattern: string, replacement: string) -> string -// regex.replace(target: string, pattern: string, replacement: string, count: int) -> string -// -// Examples: -// -// regex.replace('hello world hello', 'hello', 'hi') == 'hi world hi' -// regex.replace('banana', 'a', 'x', 0) == 'banana' -// regex.replace('banana', 'a', 'x', 1) == 'bxnana' -// regex.replace('banana', 'a', 'x', 2) == 'bxnxna' -// regex.replace('banana', 'a', 'x', -12) == 'bxnxnx' -// regex.replace('foo bar', '(fo)o (ba)r', r'\2 \1') == 'ba fo' -// regex.replace('test', '(.)', r'\2') \\ Runtime Error invalid replace string -// regex.replace('foo bar', '(', '$2 $1') \\ Runtime Error invalid regex string -// regex.replace('id=123', r'id=(?P\d+)', r'value: \values') \\ Runtime Error invalid replace string -// -// # Extract -// -// The `regex.extract` function returns the first match of a regex pattern in a -// string. If no match is found, it returns an optional none value. An error will -// be thrown for invalid regex or for multiple capture groups. -// -// regex.extract(target: string, pattern: string) -> optional -// -// Examples: -// -// regex.extract('hello world', 'hello(.*)') == optional.of(' world') -// regex.extract('item-A, item-B', 'item-(\\w+)') == optional.of('A') -// regex.extract('HELLO', 'hello') == optional.empty() -// regex.extract('testuser@testdomain', '(.*)@([^.]*)') // Runtime Error multiple capture group -// -// # Extract All -// -// The `regex.extractAll` function returns a list of all matches of a regex -// pattern in a target string. If no matches are found, it returns an empty list. An error will -// be thrown for invalid regex or for multiple capture groups. -// -// regex.extractAll(target: string, pattern: string) -> list -// -// Examples: -// -// regex.extractAll('id:123, id:456', 'id:\\d+') == ['id:123', 'id:456'] -// regex.extractAll('id:123, id:456', 'assa') == [] -// regex.extractAll('testuser@testdomain', '(.*)@([^.]*)') // Runtime Error multiple capture group -func Regex(options ...RegexOptions) cel.EnvOption { - s := ®exLib{ - version: math.MaxUint32, - } - for _, o := range options { - s = o(s) - } - return cel.Lib(s) -} - -// RegexOptions declares a functional operator for configuring regex extension. -type RegexOptions func(*regexLib) *regexLib - -// RegexVersion configures the version of the Regex library definitions to use. See [Regex] for supported values. -func RegexVersion(version uint32) RegexOptions { - return func(lib *regexLib) *regexLib { - lib.version = version - return lib - } -} - -type regexLib struct { - version uint32 -} - -// LibraryName implements that SingletonLibrary interface method. -func (r *regexLib) LibraryName() string { - return "cel.lib.ext.regex" -} - -// CompileOptions implements the cel.Library interface method. -func (r *regexLib) CompileOptions() []cel.EnvOption { - optionalTypesEnabled := func(env *cel.Env) (*cel.Env, error) { - if !env.HasLibrary("cel.lib.optional") { - return nil, errors.New("regex library requires the optional library") - } - return env, nil - } - opts := []cel.EnvOption{ - cel.Function(regexExtract, - cel.Overload("regex_extract_string_string", []*cel.Type{cel.StringType, cel.StringType}, cel.OptionalType(cel.StringType), - cel.BinaryBinding(extract))), - - cel.Function(regexExtractAll, - cel.Overload("regex_extractAll_string_string", []*cel.Type{cel.StringType, cel.StringType}, cel.ListType(cel.StringType), - cel.BinaryBinding(extractAll))), - - cel.Function(regexReplace, - cel.Overload("regex_replace_string_string_string", []*cel.Type{cel.StringType, cel.StringType, cel.StringType}, cel.StringType, - cel.FunctionBinding(regReplace)), - cel.Overload("regex_replace_string_string_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.StringType, cel.IntType}, cel.StringType, - cel.FunctionBinding((regReplaceN))), - ), - cel.EnvOption(optionalTypesEnabled), - } - return opts -} - -// ProgramOptions implements the cel.Library interface method -func (r *regexLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func compileRegex(regexStr string) (*regexp.Regexp, error) { - re, err := regexp.Compile(regexStr) - if err != nil { - return nil, fmt.Errorf("given regex is invalid: %w", err) - } - return re, nil -} - -func regReplace(args ...ref.Val) ref.Val { - target := args[0].(types.String) - regexStr := args[1].(types.String) - replaceStr := args[2].(types.String) - - return regReplaceN(target, regexStr, replaceStr, types.Int(-1)) -} - -func regReplaceN(args ...ref.Val) ref.Val { - target := string(args[0].(types.String)) - regexStr := string(args[1].(types.String)) - replaceStr := string(args[2].(types.String)) - replaceCount := int64(args[3].(types.Int)) - - if replaceCount == 0 { - return types.String(target) - } - - if replaceCount > math.MaxInt32 { - return types.NewErr("integer overflow") - } - - // If replaceCount is negative, just do a replaceAll. - if replaceCount < 0 { - replaceCount = -1 - } - - re, err := regexp.Compile(regexStr) - if err != nil { - return types.WrapErr(err) - } - - var resultBuilder strings.Builder - var lastIndex int - counter := int64(0) - - matches := re.FindAllStringSubmatchIndex(target, -1) - - for _, match := range matches { - if replaceCount != -1 && counter >= replaceCount { - break - } - - processedReplacement, err := replaceStrValidator(target, re, match, replaceStr) - if err != nil { - return types.WrapErr(err) - } - - resultBuilder.WriteString(target[lastIndex:match[0]]) - resultBuilder.WriteString(processedReplacement) - lastIndex = match[1] - counter++ - } - - resultBuilder.WriteString(target[lastIndex:]) - return types.String(resultBuilder.String()) -} - -func replaceStrValidator(target string, re *regexp.Regexp, match []int, replacement string) (string, error) { - groupCount := re.NumSubexp() - var sb strings.Builder - runes := []rune(replacement) - - for i := 0; i < len(runes); i++ { - c := runes[i] - - if c != '\\' { - sb.WriteRune(c) - continue - } - - if i+1 >= len(runes) { - return "", fmt.Errorf("invalid replacement string: '%s' \\ not allowed at end", replacement) - } - - i++ - nextChar := runes[i] - - if nextChar == '\\' { - sb.WriteRune('\\') - continue - } - - groupNum, err := strconv.Atoi(string(nextChar)) - if err != nil { - return "", fmt.Errorf("invalid replacement string: '%s' \\ must be followed by a digit or \\", replacement) - } - - if groupNum > groupCount { - return "", fmt.Errorf("replacement string references group %d but regex has only %d group(s)", groupNum, groupCount) - } - - if match[2*groupNum] != -1 { - sb.WriteString(target[match[2*groupNum]:match[2*groupNum+1]]) - } - } - return sb.String(), nil -} - -func extract(target, regexStr ref.Val) ref.Val { - t := string(target.(types.String)) - r := string(regexStr.(types.String)) - re, err := compileRegex(r) - if err != nil { - return types.WrapErr(err) - } - - if len(re.SubexpNames())-1 > 1 { - return types.WrapErr(fmt.Errorf("regular expression has more than one capturing group: %q", r)) - } - - matches := re.FindStringSubmatch(t) - if len(matches) == 0 { - return types.OptionalNone - } - - // If there is a capturing group, return the first match; otherwise, return the whole match. - if len(matches) > 1 { - capturedGroup := matches[1] - // If optional group is empty, return OptionalNone. - if capturedGroup == "" { - return types.OptionalNone - } - return types.OptionalOf(types.String(capturedGroup)) - } - return types.OptionalOf(types.String(matches[0])) -} - -func extractAll(target, regexStr ref.Val) ref.Val { - t := string(target.(types.String)) - r := string(regexStr.(types.String)) - re, err := compileRegex(r) - if err != nil { - return types.WrapErr(err) - } - - groupCount := len(re.SubexpNames()) - 1 - if groupCount > 1 { - return types.WrapErr(fmt.Errorf("regular expression has more than one capturing group: %q", r)) - } - - matches := re.FindAllStringSubmatch(t, -1) - result := make([]string, 0, len(matches)) - if len(matches) == 0 { - return types.NewStringList(types.DefaultTypeAdapter, result) - } - - if groupCount != 1 { - for _, match := range matches { - result = append(result, match[0]) - } - return types.NewStringList(types.DefaultTypeAdapter, result) - } - - for _, match := range matches { - if match[1] != "" { - result = append(result, match[1]) - } - } - return types.NewStringList(types.DefaultTypeAdapter, result) -} diff --git a/vendor/github.com/google/cel-go/ext/sets.go b/vendor/github.com/google/cel-go/ext/sets.go deleted file mode 100644 index ecac4bf9d..000000000 --- a/vendor/github.com/google/cel-go/ext/sets.go +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ext - -import ( - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/interpreter" -) - -// Sets returns a cel.EnvOption to configure namespaced set relationship -// functions. -// -// There is no set type within CEL, and while one may be introduced in the -// future, there are cases where a `list` type is known to behave like a set. -// For such cases, this library provides some basic functionality for -// determining set containment, equivalence, and intersection. -// -// # Sets.Contains -// -// Returns whether the first list argument contains all elements in the second -// list argument. The list may contain elements of any type and standard CEL -// equality is used to determine whether a value exists in both lists. If the -// second list is empty, the result will always return true. -// -// sets.contains(list(T), list(T)) -> bool -// -// Examples: -// -// sets.contains([], []) // true -// sets.contains([], [1]) // false -// sets.contains([1, 2, 3, 4], [2, 3]) // true -// sets.contains([1, 2.0, 3u], [1.0, 2u, 3]) // true -// -// # Sets.Equivalent -// -// Returns whether the first and second list are set equivalent. Lists are set -// equivalent if for every item in the first list, there is an element in the -// second which is equal. The lists may not be of the same size as they do not -// guarantee the elements within them are unique, so size does not factor into -// the computation. -// -// Examples: -// -// sets.equivalent([], []) // true -// sets.equivalent([1], [1, 1]) // true -// sets.equivalent([1], [1u, 1.0]) // true -// sets.equivalent([1, 2, 3], [3u, 2.0, 1]) // true -// -// # Sets.Intersects -// -// Returns whether the first list has at least one element whose value is equal -// to an element in the second list. If either list is empty, the result will -// be false. -// -// Examples: -// -// sets.intersects([1], []) // false -// sets.intersects([1], [1, 2]) // true -// sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true -func Sets(options ...SetsOption) cel.EnvOption { - l := &setsLib{} - for _, o := range options { - l = o(l) - } - return cel.Lib(l) -} - -// SetsOption declares a functional operator for configuring set extensions. -type SetsOption func(*setsLib) *setsLib - -// SetsVersion sets the library version for set extensions. -func SetsVersion(version uint32) SetsOption { - return func(lib *setsLib) *setsLib { - lib.version = version - return lib - } -} - -type setsLib struct { - version uint32 -} - -// LibraryName implements the SingletonLibrary interface method. -func (setsLib) LibraryName() string { - return "cel.lib.ext.sets" -} - -// CompileOptions implements the Library interface method. -func (setsLib) CompileOptions() []cel.EnvOption { - listType := cel.ListType(cel.TypeParamType("T")) - return []cel.EnvOption{ - cel.Function("sets.contains", - cel.Overload("list_sets_contains_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsContains))), - cel.Function("sets.equivalent", - cel.Overload("list_sets_equivalent_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsEquivalent))), - cel.Function("sets.intersects", - cel.Overload("list_sets_intersects_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsIntersects))), - cel.CostEstimatorOptions( - checker.OverloadCostEstimate("list_sets_contains_list", estimateSetsCost(1)), - checker.OverloadCostEstimate("list_sets_intersects_list", estimateSetsCost(1)), - // equivalence requires potentially two m*n comparisons to ensure each list is contained by the other - checker.OverloadCostEstimate("list_sets_equivalent_list", estimateSetsCost(2)), - ), - } -} - -// ProgramOptions implements the Library interface method. -func (setsLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{ - cel.CostTrackerOptions( - interpreter.OverloadCostTracker("list_sets_contains_list", trackSetsCost(1)), - interpreter.OverloadCostTracker("list_sets_intersects_list", trackSetsCost(1)), - interpreter.OverloadCostTracker("list_sets_equivalent_list", trackSetsCost(2)), - ), - } -} - -// NewSetMembershipOptimizer rewrites set membership tests using the `in` operator against a list -// of constant values of enum, int, uint, string, or boolean type into a set membership test against -// a map where the map keys are the elements of the list. -func NewSetMembershipOptimizer() (cel.ASTOptimizer, error) { - return setsLib{}, nil -} - -func (setsLib) Optimize(ctx *cel.OptimizerContext, a *ast.AST) *ast.AST { - root := ast.NavigateAST(a) - matches := ast.MatchDescendants(root, matchInConstantList(a)) - for _, match := range matches { - call := match.AsCall() - listArg := call.Args()[1] - entries := make([]ast.EntryExpr, len(listArg.AsList().Elements())) - for i, elem := range listArg.AsList().Elements() { - var entry ast.EntryExpr - if r, found := a.ReferenceMap()[elem.ID()]; found && r.Value != nil { - entry = ctx.NewMapEntry(ctx.NewLiteral(r.Value), ctx.NewLiteral(types.True), false) - } else { - entry = ctx.NewMapEntry(elem, ctx.NewLiteral(types.True), false) - } - entries[i] = entry - } - mapArg := ctx.NewMap(entries) - ctx.UpdateExpr(listArg, mapArg) - } - return a -} - -func matchInConstantList(a *ast.AST) ast.ExprMatcher { - return func(e ast.NavigableExpr) bool { - if e.Kind() != ast.CallKind { - return false - } - call := e.AsCall() - if call.FunctionName() != operators.In { - return false - } - aggregateVal := call.Args()[1] - if aggregateVal.Kind() != ast.ListKind { - return false - } - listVal := aggregateVal.AsList() - for _, elem := range listVal.Elements() { - if r, found := a.ReferenceMap()[elem.ID()]; found { - if r.Value != nil { - continue - } - } - if elem.Kind() != ast.LiteralKind { - return false - } - lit := elem.AsLiteral() - if !(lit.Type() == cel.StringType || lit.Type() == cel.IntType || - lit.Type() == cel.UintType || lit.Type() == cel.BoolType) { - return false - } - } - return true - } -} - -func setsIntersects(listA, listB ref.Val) ref.Val { - lA := listA.(traits.Lister) - lB := listB.(traits.Lister) - it := lA.Iterator() - for it.HasNext() == types.True { - exists := lB.Contains(it.Next()) - if exists == types.True { - return types.True - } - } - return types.False -} - -func setsContains(list, sublist ref.Val) ref.Val { - l := list.(traits.Lister) - sub := sublist.(traits.Lister) - it := sub.Iterator() - for it.HasNext() == types.True { - exists := l.Contains(it.Next()) - if exists != types.True { - return exists - } - } - return types.True -} - -func setsEquivalent(listA, listB ref.Val) ref.Val { - aContainsB := setsContains(listA, listB) - if aContainsB != types.True { - return aContainsB - } - return setsContains(listB, listA) -} - -func estimateSetsCost(costFactor float64) checker.FunctionEstimator { - return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if len(args) != 2 { - return nil - } - arg0Size := estimateSize(estimator, args[0]) - arg1Size := estimateSize(estimator, args[1]) - costEstimate := arg0Size.Multiply(arg1Size).MultiplyByCostFactor(costFactor).Add(callCostEstimate) - return &checker.CallEstimate{CostEstimate: costEstimate} - } -} - -func estimateSize(estimator checker.CostEstimator, node checker.AstNode) checker.SizeEstimate { - if l := node.ComputedSize(); l != nil { - return *l - } - if l := estimator.EstimateSize(node); l != nil { - return *l - } - return checker.SizeEstimate{Min: 0, Max: math.MaxUint64} -} - -func trackSetsCost(costFactor float64) interpreter.FunctionTracker { - return func(args []ref.Val, _ ref.Val) *uint64 { - lhsSize := actualSize(args[0]) - rhsSize := actualSize(args[1]) - cost := callCost + uint64(float64(lhsSize*rhsSize)*costFactor) - return &cost - } -} - -func actualSize(value ref.Val) uint64 { - if sz, ok := value.(traits.Sizer); ok { - return uint64(sz.Size().(types.Int)) - } - return 1 -} - -var ( - callCostEstimate = checker.FixedCostEstimate(1) - callCost = uint64(1) -) diff --git a/vendor/github.com/google/cel-go/ext/strings.go b/vendor/github.com/google/cel-go/ext/strings.go deleted file mode 100644 index de65421f6..000000000 --- a/vendor/github.com/google/cel-go/ext/strings.go +++ /dev/null @@ -1,796 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ext contains CEL extension libraries where each library defines a related set of -// constants, functions, macros, or other configuration settings which may not be covered by -// the core CEL spec. -package ext - -import ( - "fmt" - "math" - "reflect" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/text/language" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -const ( - defaultLocale = "en-US" - defaultPrecision = 6 -) - -// Strings returns a cel.EnvOption to configure extended functions for string manipulation. -// As a general note, all indices are zero-based. -// -// # CharAt -// -// Returns the character at the given position. If the position is negative, or greater than -// the length of the string, the function will produce an error: -// -// .charAt() -> -// -// Examples: -// -// 'hello'.charAt(4) // return 'o' -// 'hello'.charAt(5) // return '' -// 'hello'.charAt(-1) // error -// -// # Format -// -// Introduced at version: 1 -// -// Returns a new string with substitutions being performed, printf-style. -// The valid formatting clauses are: -// -// `%s` - substitutes a string. This can also be used on bools, lists, maps, bytes, -// Duration and Timestamp, in addition to all numerical types (int, uint, and double). -// Note that the dot/period decimal separator will always be used when printing a list -// or map that contains a double, and that null can be passed (which results in the -// string "null") in addition to types. -// `%d` - substitutes an integer. -// `%f` - substitutes a double with fixed-point precision. The default precision is 6, but -// this can be adjusted. The strings `Infinity`, `-Infinity`, and `NaN` are also valid input -// for this clause. -// `%e` - substitutes a double in scientific notation. The default precision is 6, but this -// can be adjusted. -// `%b` - substitutes an integer with its equivalent binary string. Can also be used on bools. -// `%x` - substitutes an integer with its equivalent in hexadecimal, or if given a string or -// bytes, will output each character's equivalent in hexadecimal. -// `%X` - same as above, but with A-F capitalized. -// `%o` - substitutes an integer with its equivalent in octal. -// -// .format() -> -// -// Examples: -// -// "this is a string: %s\nand an integer: %d".format(["str", 42]) // returns "this is a string: str\nand an integer: 42" -// "a double substituted with %%s: %s".format([64.2]) // returns "a double substituted with %s: 64.2" -// "string type: %s".format([type(string)]) // returns "string type: string" -// "timestamp: %s".format([timestamp("2023-02-03T23:31:20+00:00")]) // returns "timestamp: 2023-02-03T23:31:20Z" -// "duration: %s".format([duration("1h45m47s")]) // returns "duration: 6347s" -// "%f".format([3.14]) // returns "3.140000" -// "scientific notation: %e".format([2.71828]) // returns "scientific notation: 2.718280\u202f\u00d7\u202f10\u2070\u2070" -// "5 in binary: %b".format([5]), // returns "5 in binary; 101" -// "26 in hex: %x".format([26]), // returns "26 in hex: 1a" -// "26 in hex (uppercase): %X".format([26]) // returns "26 in hex (uppercase): 1A" -// "30 in octal: %o".format([30]) // returns "30 in octal: 36" -// "a map inside a list: %s".format([[1, 2, 3, {"a": "x", "b": "y", "c": "z"}]]) // returns "a map inside a list: [1, 2, 3, {"a":"x", "b":"y", "c":"d"}]" -// "true bool: %s - false bool: %s\nbinary bool: %b".format([true, false, true]) // returns "true bool: true - false bool: false\nbinary bool: 1" -// -// Passing an incorrect type (a string to `%b`) is considered an error, as well as attempting -// to use more formatting clauses than there are arguments (`%d %d %d` while passing two ints, for instance). -// If compile-time checking is enabled, and the formatting string is a constant, and the argument list is a literal, -// then letting any arguments go unused/unformatted is also considered an error. -// -// # IndexOf -// -// Returns the integer index of the first occurrence of the search string. If the search string is -// not found the function returns -1. -// -// The function also accepts an optional position from which to begin the substring search. If the -// substring is the empty string, the index where the search starts is returned (zero or custom). -// -// .indexOf() -> -// .indexOf(, ) -> -// -// Examples: -// -// 'hello mellow'.indexOf('') // returns 0 -// 'hello mellow'.indexOf('ello') // returns 1 -// 'hello mellow'.indexOf('jello') // returns -1 -// 'hello mellow'.indexOf('', 2) // returns 2 -// 'hello mellow'.indexOf('ello', 2) // returns 7 -// 'hello mellow'.indexOf('ello', 20) // returns -1 -// 'hello mellow'.indexOf('ello', -1) // error -// -// # Join -// -// Returns a new string where the elements of string list are concatenated. -// -// The function also accepts an optional separator which is placed between elements in the resulting string. -// -// >.join() -> -// >.join() -> -// -// Examples: -// -// ['hello', 'mellow'].join() // returns 'hellomellow' -// ['hello', 'mellow'].join(' ') // returns 'hello mellow' -// [].join() // returns '' -// [].join('/') // returns '' -// -// # LastIndexOf -// -// Returns the integer index at the start of the last occurrence of the search string. If the -// search string is not found the function returns -1. -// -// The function also accepts an optional position which represents the last index to be -// considered as the beginning of the substring match. If the substring is the empty string, -// the index where the search starts is returned (string length or custom). -// -// .lastIndexOf() -> -// .lastIndexOf(, ) -> -// -// Examples: -// -// 'hello mellow'.lastIndexOf('') // returns 12 -// 'hello mellow'.lastIndexOf('ello') // returns 7 -// 'hello mellow'.lastIndexOf('jello') // returns -1 -// 'hello mellow'.lastIndexOf('ello', 6) // returns 1 -// 'hello mellow'.lastIndexOf('ello', 20) // returns -1 -// 'hello mellow'.lastIndexOf('ello', -1) // error -// -// # LowerAscii -// -// Returns a new string where all ASCII characters are lower-cased. -// -// This function does not perform Unicode case-mapping for characters outside the ASCII range. -// -// .lowerAscii() -> -// -// Examples: -// -// 'TacoCat'.lowerAscii() // returns 'tacocat' -// 'TacoCÆt Xii'.lowerAscii() // returns 'tacocÆt xii' -// -// # Strings.Quote -// -// Introduced in version: 1 -// -// Takes the given string and makes it safe to print (without any formatting due to escape sequences). -// If any invalid UTF-8 characters are encountered, they are replaced with \uFFFD. -// -// strings.quote() -// -// Examples: -// -// strings.quote('single-quote with "double quote"') // returns '"single-quote with \"double quote\""' -// strings.quote("two escape sequences \a\n") // returns '"two escape sequences \\a\\n"' -// -// # Replace -// -// Returns a new string based on the target, which replaces the occurrences of a search string -// with a replacement string if present. The function accepts an optional limit on the number of -// substring replacements to be made. -// -// When the replacement limit is 0, the result is the original string. When the limit is a negative -// number, the function behaves the same as replace all. -// -// .replace(, ) -> -// .replace(, , ) -> -// -// Examples: -// -// 'hello hello'.replace('he', 'we') // returns 'wello wello' -// 'hello hello'.replace('he', 'we', -1) // returns 'wello wello' -// 'hello hello'.replace('he', 'we', 1) // returns 'wello hello' -// 'hello hello'.replace('he', 'we', 0) // returns 'hello hello' -// 'hello hello'.replace('', '_') // returns '_h_e_l_l_o_ _h_e_l_l_o_' -// 'hello hello'.replace('h', '') // returns 'ello ello' -// -// # Split -// -// Returns a list of strings split from the input by the given separator. The function accepts -// an optional argument specifying a limit on the number of substrings produced by the split. -// -// When the split limit is 0, the result is an empty list. When the limit is 1, the result is the -// target string to split. When the limit is a negative number, the function behaves the same as -// split all. -// -// .split() -> > -// .split(, ) -> > -// -// Examples: -// -// 'hello hello hello'.split(' ') // returns ['hello', 'hello', 'hello'] -// 'hello hello hello'.split(' ', 0) // returns [] -// 'hello hello hello'.split(' ', 1) // returns ['hello hello hello'] -// 'hello hello hello'.split(' ', 2) // returns ['hello', 'hello hello'] -// 'hello hello hello'.split(' ', -1) // returns ['hello', 'hello', 'hello'] -// -// # Substring -// -// Returns the substring given a numeric range corresponding to character positions. Optionally -// may omit the trailing range for a substring from a given character position until the end of -// a string. -// -// Character offsets are 0-based with an inclusive start range and exclusive end range. It is an -// error to specify an end range that is lower than the start range, or for either the start or end -// index to be negative or exceed the string length. -// -// .substring() -> -// .substring(, ) -> -// -// Examples: -// -// 'tacocat'.substring(4) // returns 'cat' -// 'tacocat'.substring(0, 4) // returns 'taco' -// 'tacocat'.substring(-1) // error -// 'tacocat'.substring(2, 1) // error -// -// # Trim -// -// Returns a new string which removes the leading and trailing whitespace in the target string. -// The trim function uses the Unicode definition of whitespace which does not include the -// zero-width spaces. See: https://en.wikipedia.org/wiki/Whitespace_character#Unicode -// -// .trim() -> -// -// Examples: -// -// ' \ttrim\n '.trim() // returns 'trim' -// -// # UpperAscii -// -// Returns a new string where all ASCII characters are upper-cased. -// -// This function does not perform Unicode case-mapping for characters outside the ASCII range. -// -// .upperAscii() -> -// -// Examples: -// -// 'TacoCat'.upperAscii() // returns 'TACOCAT' -// 'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII' -// -// # Reverse -// -// Introduced at version: 3 -// -// Returns a new string whose characters are the same as the target string, only formatted in -// reverse order. -// This function relies on converting strings to rune arrays in order to reverse -// -// .reverse() -> -// -// Examples: -// -// 'gums'.reverse() // returns 'smug' -// 'John Smith'.reverse() // returns 'htimS nhoJ' -// -// Introduced at version: 4 -// -// Formatting updated to adhere to https://github.com/google/cel-spec/blob/master/doc/extensions/strings.md. -// -// .format() -> -func Strings(options ...StringsOption) cel.EnvOption { - s := &stringLib{ - version: math.MaxUint32, - } - for _, o := range options { - s = o(s) - } - return cel.Lib(s) -} - -type stringLib struct { - locale string - version uint32 -} - -// LibraryName implements the SingletonLibrary interface method. -func (*stringLib) LibraryName() string { - return "cel.lib.ext.strings" -} - -// StringsOption is a functional interface for configuring the strings library. -type StringsOption func(*stringLib) *stringLib - -// StringsLocale configures the library with the given locale. The locale tag will -// be checked for validity at the time that EnvOptions are configured. If this option -// is not passed, string.format will behave as if en_US was passed as the locale. -// -// If StringsVersion is greater than or equal to 4, this option is ignored. -func StringsLocale(locale string) StringsOption { - return func(sl *stringLib) *stringLib { - sl.locale = locale - return sl - } -} - -// StringsVersion configures the version of the string library. -// -// The version limits which functions are available. Only functions introduced -// below or equal to the given version included in the library. If this option -// is not set, all functions are available. -// -// See the library documentation to determine which version a function was introduced. -// If the documentation does not state which version a function was introduced, it can -// be assumed to be introduced at version 0, when the library was first created. -func StringsVersion(version uint32) StringsOption { - return func(lib *stringLib) *stringLib { - lib.version = version - return lib - } -} - -// StringsValidateFormatCalls validates type-checked ASTs to ensure that string.format() calls have -// valid formatting clauses and valid argument types for each clause. -// -// Deprecated -func StringsValidateFormatCalls(value bool) StringsOption { - return func(s *stringLib) *stringLib { - return s - } -} - -// CompileOptions implements the Library interface method. -func (lib *stringLib) CompileOptions() []cel.EnvOption { - formatLocale := "en_US" - if lib.version < 4 && lib.locale != "" { - // ensure locale is properly-formed if set - _, err := language.Parse(lib.locale) - if err != nil { - return []cel.EnvOption{ - func(e *cel.Env) (*cel.Env, error) { - return nil, fmt.Errorf("failed to parse locale: %w", err) - }, - } - } - formatLocale = lib.locale - } - - opts := []cel.EnvOption{ - cel.Function("charAt", - cel.MemberOverload("string_char_at_int", []*cel.Type{cel.StringType, cel.IntType}, cel.StringType, - cel.BinaryBinding(func(str, ind ref.Val) ref.Val { - s := str.(types.String) - i := ind.(types.Int) - return stringOrError(charAt(string(s), int64(i))) - }))), - cel.Function("indexOf", - cel.MemberOverload("string_index_of_string", []*cel.Type{cel.StringType, cel.StringType}, cel.IntType, - cel.BinaryBinding(func(str, substr ref.Val) ref.Val { - s := str.(types.String) - sub := substr.(types.String) - return intOrError(indexOf(string(s), string(sub))) - })), - cel.MemberOverload("string_index_of_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.IntType}, cel.IntType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := args[0].(types.String) - sub := args[1].(types.String) - offset := args[2].(types.Int) - return intOrError(indexOfOffset(string(s), string(sub), int64(offset))) - }))), - cel.Function("lastIndexOf", - cel.MemberOverload("string_last_index_of_string", []*cel.Type{cel.StringType, cel.StringType}, cel.IntType, - cel.BinaryBinding(func(str, substr ref.Val) ref.Val { - s := str.(types.String) - sub := substr.(types.String) - return intOrError(lastIndexOf(string(s), string(sub))) - })), - cel.MemberOverload("string_last_index_of_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.IntType}, cel.IntType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := args[0].(types.String) - sub := args[1].(types.String) - offset := args[2].(types.Int) - return intOrError(lastIndexOfOffset(string(s), string(sub), int64(offset))) - }))), - cel.Function("lowerAscii", - cel.MemberOverload("string_lower_ascii", []*cel.Type{cel.StringType}, cel.StringType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return stringOrError(lowerASCII(string(s))) - }))), - cel.Function("replace", - cel.MemberOverload( - "string_replace_string_string", []*cel.Type{cel.StringType, cel.StringType, cel.StringType}, cel.StringType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - str := args[0].(types.String) - old := args[1].(types.String) - new := args[2].(types.String) - return stringOrError(replace(string(str), string(old), string(new))) - })), - cel.MemberOverload( - "string_replace_string_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.StringType, cel.IntType}, cel.StringType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - str := args[0].(types.String) - old := args[1].(types.String) - new := args[2].(types.String) - n := args[3].(types.Int) - return stringOrError(replaceN(string(str), string(old), string(new), int64(n))) - }))), - cel.Function("split", - cel.MemberOverload("string_split_string", []*cel.Type{cel.StringType, cel.StringType}, cel.ListType(cel.StringType), - cel.BinaryBinding(func(str, separator ref.Val) ref.Val { - s := str.(types.String) - sep := separator.(types.String) - return listStringOrError(split(string(s), string(sep))) - })), - cel.MemberOverload("string_split_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.IntType}, cel.ListType(cel.StringType), - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := args[0].(types.String) - sep := args[1].(types.String) - n := args[2].(types.Int) - return listStringOrError(splitN(string(s), string(sep), int64(n))) - }))), - cel.Function("substring", - cel.MemberOverload("string_substring_int", []*cel.Type{cel.StringType, cel.IntType}, cel.StringType, - cel.BinaryBinding(func(str, offset ref.Val) ref.Val { - s := str.(types.String) - off := offset.(types.Int) - return stringOrError(substr(string(s), int64(off))) - })), - cel.MemberOverload("string_substring_int_int", []*cel.Type{cel.StringType, cel.IntType, cel.IntType}, cel.StringType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := args[0].(types.String) - start := args[1].(types.Int) - end := args[2].(types.Int) - return stringOrError(substrRange(string(s), int64(start), int64(end))) - }))), - cel.Function("trim", - cel.MemberOverload("string_trim", []*cel.Type{cel.StringType}, cel.StringType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return stringOrError(trimSpace(string(s))) - }))), - cel.Function("upperAscii", - cel.MemberOverload("string_upper_ascii", []*cel.Type{cel.StringType}, cel.StringType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return stringOrError(upperASCII(string(s))) - }))), - } - if lib.version >= 1 { - if lib.version >= 4 { - opts = append(opts, cel.Function("format", - cel.MemberOverload("string_format", []*cel.Type{cel.StringType, cel.ListType(cel.DynType)}, cel.StringType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := string(args[0].(types.String)) - formatArgs := args[1].(traits.Lister) - return stringOrError(parseFormatStringV2(s, &stringFormatterV2{}, &stringArgList{formatArgs})) - })))) - } else { - opts = append(opts, cel.Function("format", - cel.MemberOverload("string_format", []*cel.Type{cel.StringType, cel.ListType(cel.DynType)}, cel.StringType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - s := string(args[0].(types.String)) - formatArgs := args[1].(traits.Lister) - return stringOrError(parseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale)) - })))) - } - opts = append(opts, - cel.Function("strings.quote", cel.Overload("strings_quote", []*cel.Type{cel.StringType}, cel.StringType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return stringOrError(quote(string(s))) - })))) - } - if lib.version >= 2 { - opts = append(opts, - cel.Function("join", - cel.MemberOverload("list_join", []*cel.Type{cel.ListType(cel.StringType)}, cel.StringType, - cel.UnaryBinding(func(list ref.Val) ref.Val { - l := list.(traits.Lister) - return stringOrError(joinValSeparator(l, "")) - })), - cel.MemberOverload("list_join_string", []*cel.Type{cel.ListType(cel.StringType), cel.StringType}, cel.StringType, - cel.BinaryBinding(func(list, delim ref.Val) ref.Val { - l := list.(traits.Lister) - d := delim.(types.String) - return stringOrError(joinValSeparator(l, string(d))) - }))), - ) - } else { - opts = append(opts, - cel.Function("join", - cel.MemberOverload("list_join", []*cel.Type{cel.ListType(cel.StringType)}, cel.StringType, - cel.UnaryBinding(func(list ref.Val) ref.Val { - l, err := list.ConvertToNative(stringListType) - if err != nil { - return types.WrapErr(err) - } - return stringOrError(join(l.([]string))) - })), - cel.MemberOverload("list_join_string", []*cel.Type{cel.ListType(cel.StringType), cel.StringType}, cel.StringType, - cel.BinaryBinding(func(list, delim ref.Val) ref.Val { - l, err := list.ConvertToNative(stringListType) - if err != nil { - return types.WrapErr(err) - } - d := delim.(types.String) - return stringOrError(joinSeparator(l.([]string), string(d))) - }))), - ) - } - if lib.version >= 3 { - opts = append(opts, - cel.Function("reverse", - cel.MemberOverload("string_reverse", []*cel.Type{cel.StringType}, cel.StringType, - cel.UnaryBinding(func(str ref.Val) ref.Val { - s := str.(types.String) - return stringOrError(reverse(string(s))) - }))), - ) - } - if lib.version >= 1 { - if lib.version >= 4 { - opts = append(opts, cel.ASTValidators(stringFormatValidatorV2{})) - } else { - opts = append(opts, cel.ASTValidators(stringFormatValidator{})) - } - } - return opts -} - -// ProgramOptions implements the Library interface method. -func (*stringLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func charAt(str string, ind int64) (string, error) { - i := int(ind) - runes := []rune(str) - if i < 0 || i > len(runes) { - return "", fmt.Errorf("index out of range: %d", ind) - } - if i == len(runes) { - return "", nil - } - return string(runes[i]), nil -} - -func indexOf(str, substr string) (int64, error) { - return indexOfOffset(str, substr, int64(0)) -} - -func indexOfOffset(str, substr string, offset int64) (int64, error) { - if substr == "" { - return offset, nil - } - off := int(offset) - runes := []rune(str) - subrunes := []rune(substr) - if off < 0 { - return -1, fmt.Errorf("index out of range: %d", off) - } - // If the offset exceeds the length, return -1 rather than error. - if off >= len(runes) { - return -1, nil - } - for i := off; i < len(runes)-(len(subrunes)-1); i++ { - found := true - for j := 0; j < len(subrunes); j++ { - if runes[i+j] != subrunes[j] { - found = false - break - } - } - if found { - return int64(i), nil - } - } - return -1, nil -} - -func lastIndexOf(str, substr string) (int64, error) { - runes := []rune(str) - if substr == "" { - return int64(len(runes)), nil - } - - if len(str) < len(substr) { - return -1, nil - } - return lastIndexOfOffset(str, substr, int64(len(runes)-1)) -} - -func lastIndexOfOffset(str, substr string, offset int64) (int64, error) { - if substr == "" { - return offset, nil - } - off := int(offset) - runes := []rune(str) - subrunes := []rune(substr) - if off < 0 { - return -1, fmt.Errorf("index out of range: %d", off) - } - // If the offset is far greater than the length return -1 - if off >= len(runes) { - return -1, nil - } - if off > len(runes)-len(subrunes) { - off = len(runes) - len(subrunes) - } - for i := off; i >= 0; i-- { - found := true - for j := 0; j < len(subrunes); j++ { - if runes[i+j] != subrunes[j] { - found = false - break - } - } - if found { - return int64(i), nil - } - } - return -1, nil -} - -func lowerASCII(str string) (string, error) { - runes := []rune(str) - for i, r := range runes { - if r <= unicode.MaxASCII { - r = unicode.ToLower(r) - runes[i] = r - } - } - return string(runes), nil -} - -func replace(str, old, new string) (string, error) { - return strings.ReplaceAll(str, old, new), nil -} - -func replaceN(str, old, new string, n int64) (string, error) { - return strings.Replace(str, old, new, int(n)), nil -} - -func split(str, sep string) ([]string, error) { - return strings.Split(str, sep), nil -} - -func splitN(str, sep string, n int64) ([]string, error) { - return strings.SplitN(str, sep, int(n)), nil -} - -func substr(str string, start int64) (string, error) { - runes := []rune(str) - if int(start) < 0 || int(start) > len(runes) { - return "", fmt.Errorf("index out of range: %d", start) - } - return string(runes[start:]), nil -} - -func substrRange(str string, start, end int64) (string, error) { - runes := []rune(str) - l := len(runes) - if start > end { - return "", fmt.Errorf("invalid substring range. start: %d, end: %d", start, end) - } - if int(start) < 0 || int(start) > l { - return "", fmt.Errorf("index out of range: %d", start) - } - if int(end) < 0 || int(end) > l { - return "", fmt.Errorf("index out of range: %d", end) - } - return string(runes[int(start):int(end)]), nil -} - -func trimSpace(str string) (string, error) { - return strings.TrimSpace(str), nil -} - -func upperASCII(str string) (string, error) { - runes := []rune(str) - for i, r := range runes { - if r <= unicode.MaxASCII { - r = unicode.ToUpper(r) - runes[i] = r - } - } - return string(runes), nil -} - -func reverse(str string) (string, error) { - chars := []rune(str) - for i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 { - chars[i], chars[j] = chars[j], chars[i] - } - return string(chars), nil -} - -func joinSeparator(strs []string, separator string) (string, error) { - return strings.Join(strs, separator), nil -} - -func join(strs []string) (string, error) { - return strings.Join(strs, ""), nil -} - -func joinValSeparator(strs traits.Lister, separator string) (string, error) { - sz := strs.Size().(types.Int) - var sb strings.Builder - for i := types.Int(0); i < sz; i++ { - if i != 0 { - sb.WriteString(separator) - } - elem := strs.Get(i) - str, ok := elem.(types.String) - if !ok { - return "", fmt.Errorf("join: invalid input: %v", elem) - } - sb.WriteString(string(str)) - } - return sb.String(), nil -} - -// quote implements a string quoting function. The string will be wrapped in -// double quotes, and all valid CEL escape sequences will be escaped to show up -// literally if printed. If the input contains any invalid UTF-8, the invalid runes -// will be replaced with utf8.RuneError. -func quote(s string) (string, error) { - var quotedStrBuilder strings.Builder - for _, c := range sanitize(s) { - switch c { - case '\a': - quotedStrBuilder.WriteString("\\a") - case '\b': - quotedStrBuilder.WriteString("\\b") - case '\f': - quotedStrBuilder.WriteString("\\f") - case '\n': - quotedStrBuilder.WriteString("\\n") - case '\r': - quotedStrBuilder.WriteString("\\r") - case '\t': - quotedStrBuilder.WriteString("\\t") - case '\v': - quotedStrBuilder.WriteString("\\v") - case '\\': - quotedStrBuilder.WriteString("\\\\") - case '"': - quotedStrBuilder.WriteString("\\\"") - default: - quotedStrBuilder.WriteRune(c) - } - } - escapedStr := quotedStrBuilder.String() - return "\"" + escapedStr + "\"", nil -} - -// sanitize replaces all invalid runes in the given string with utf8.RuneError. -func sanitize(s string) string { - var sanitizedStringBuilder strings.Builder - for _, r := range s { - if !utf8.ValidRune(r) { - sanitizedStringBuilder.WriteRune(utf8.RuneError) - } else { - sanitizedStringBuilder.WriteRune(r) - } - } - return sanitizedStringBuilder.String() -} - -var ( - stringListType = reflect.TypeOf([]string{}) -) diff --git a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel b/vendor/github.com/google/cel-go/interpreter/BUILD.bazel deleted file mode 100644 index 220e23d47..000000000 --- a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel +++ /dev/null @@ -1,74 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "activation.go", - "attribute_patterns.go", - "attributes.go", - "decorators.go", - "dispatcher.go", - "evalstate.go", - "interpretable.go", - "interpreter.go", - "optimizations.go", - "planner.go", - "prune.go", - "runtimecost.go", - ], - importpath = "github.com/google/cel-go/interpreter", - deps = [ - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/containers:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/durationpb:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", - "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "activation_test.go", - "attribute_patterns_test.go", - "attributes_test.go", - "interpreter_test.go", - "prune_test.go", - "runtimecost_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//checker:go_default_library", - "//common/containers:go_default_library", - "//common/debug:go_default_library", - "//common/decls:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/stdlib:go_default_library", - "//common/types:go_default_library", - "//parser:go_default_library", - "//test:go_default_library", - "//test/proto2pb:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/anypb:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/interpreter/activation.go b/vendor/github.com/google/cel-go/interpreter/activation.go deleted file mode 100644 index dd40619ee..000000000 --- a/vendor/github.com/google/cel-go/interpreter/activation.go +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "errors" - "fmt" - - "github.com/google/cel-go/common/types/ref" -) - -// Activation used to resolve identifiers by name and references by id. -// -// An Activation is the primary mechanism by which a caller supplies input into a CEL program. -type Activation interface { - // ResolveName returns a value from the activation by qualified name, or false if the name - // could not be found. - ResolveName(name string) (any, bool) - - // Parent returns the parent of the current activation, may be nil. - // If non-nil, the parent will be searched during resolve calls. - Parent() Activation -} - -// EmptyActivation returns a variable-free activation. -func EmptyActivation() Activation { - return emptyActivation{} -} - -// emptyActivation is a variable-free activation. -type emptyActivation struct{} - -func (emptyActivation) ResolveName(string) (any, bool) { return nil, false } -func (emptyActivation) Parent() Activation { return nil } - -// NewActivation returns an activation based on a map-based binding where the map keys are -// expected to be qualified names used with ResolveName calls. -// -// The input `bindings` may either be of type `Activation` or `map[string]any`. -// -// Lazy bindings may be supplied within the map-based input in either of the following forms: -// - func() any -// - func() ref.Val -// -// The output of the lazy binding will overwrite the variable reference in the internal map. -// -// Values which are not represented as ref.Val types on input may be adapted to a ref.Val using -// the types.Adapter configured in the environment. -func NewActivation(bindings any) (Activation, error) { - if bindings == nil { - return nil, errors.New("bindings must be non-nil") - } - a, isActivation := bindings.(Activation) - if isActivation { - return a, nil - } - m, isMap := bindings.(map[string]any) - if !isMap { - return nil, fmt.Errorf( - "activation input must be an activation or map[string]interface: got %T", - bindings) - } - return &mapActivation{bindings: m}, nil -} - -// mapActivation which implements Activation and maps of named values. -// -// Named bindings may lazily supply values by providing a function which accepts no arguments and -// produces an interface value. -type mapActivation struct { - bindings map[string]any -} - -// Parent implements the Activation interface method. -func (a *mapActivation) Parent() Activation { - return nil -} - -// ResolveName implements the Activation interface method. -func (a *mapActivation) ResolveName(name string) (any, bool) { - obj, found := a.bindings[name] - if !found { - return nil, false - } - fn, isLazy := obj.(func() ref.Val) - if isLazy { - obj = fn() - a.bindings[name] = obj - } - fnRaw, isLazy := obj.(func() any) - if isLazy { - obj = fnRaw() - a.bindings[name] = obj - } - return obj, found -} - -// hierarchicalActivation which implements Activation and contains a parent and -// child activation. -type hierarchicalActivation struct { - parent Activation - child Activation -} - -// Parent implements the Activation interface method. -func (a *hierarchicalActivation) Parent() Activation { - return a.parent -} - -// ResolveName implements the Activation interface method. -func (a *hierarchicalActivation) ResolveName(name string) (any, bool) { - if object, found := a.child.ResolveName(name); found { - return object, found - } - return a.parent.ResolveName(name) -} - -// NewHierarchicalActivation takes two activations and produces a new one which prioritizes -// resolution in the child first and parent(s) second. -func NewHierarchicalActivation(parent Activation, child Activation) Activation { - return &hierarchicalActivation{parent, child} -} - -// NewPartialActivation returns an Activation which contains a list of AttributePattern values -// representing field and index operations that should result in a 'types.Unknown' result. -// -// The `bindings` value may be any value type supported by the interpreter.NewActivation call, -// but is typically either an existing Activation or map[string]any. -func NewPartialActivation(bindings any, - unknowns ...*AttributePattern) (PartialActivation, error) { - a, err := NewActivation(bindings) - if err != nil { - return nil, err - } - return &partActivation{Activation: a, unknowns: unknowns}, nil -} - -// PartialActivation extends the Activation interface with a set of UnknownAttributePatterns. -type PartialActivation interface { - Activation - - // UnknownAttributePaths returns a set of AttributePattern values which match Attribute - // expressions for data accesses whose values are not yet known. - UnknownAttributePatterns() []*AttributePattern -} - -// partialActivationConverter indicates whether an Activation implementation supports conversion to a PartialActivation -type partialActivationConverter interface { - // AsPartialActivation converts the current activation to a PartialActivation - AsPartialActivation() (PartialActivation, bool) -} - -// partActivation is the default implementations of the PartialActivation interface. -type partActivation struct { - Activation - unknowns []*AttributePattern -} - -// UnknownAttributePatterns implements the PartialActivation interface method. -func (a *partActivation) UnknownAttributePatterns() []*AttributePattern { - return a.unknowns -} - -// AsPartialActivation returns the partActivation as a PartialActivation interface. -func (a *partActivation) AsPartialActivation() (PartialActivation, bool) { - return a, true -} - -// AsPartialActivation walks the activation hierarchy and returns the first PartialActivation, if found. -func AsPartialActivation(vars Activation) (PartialActivation, bool) { - // Only internal activation instances may implement this interface - if pv, ok := vars.(partialActivationConverter); ok { - return pv.AsPartialActivation() - } - // Since Activations may be hierarchical, test whether a parent converts to a PartialActivation - if vars.Parent() != nil { - return AsPartialActivation(vars.Parent()) - } - return nil, false -} diff --git a/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go b/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go deleted file mode 100644 index 7d0759e37..000000000 --- a/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "fmt" - - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// AttributePattern represents a top-level variable with an optional set of qualifier patterns. -// -// When using a CEL expression within a container, e.g. a package or namespace, the variable name -// in the pattern must match the qualified name produced during the variable namespace resolution. -// For example, if variable `c` appears in an expression whose container is `a.b`, the variable -// name supplied to the pattern must be `a.b.c` -// -// The qualifier patterns for attribute matching must be one of the following: -// -// - valid map key type: string, int, uint, bool -// - wildcard (*) -// -// Examples: -// -// 1. ns.myvar["complex-value"] -// 2. ns.myvar["complex-value"][0] -// 3. ns.myvar["complex-value"].*.name -// -// The first example is simple: match an attribute where the variable is 'ns.myvar' with a -// field access on 'complex-value'. The second example expands the match to indicate that only -// a specific index `0` should match. And lastly, the third example matches any indexed access -// that later selects the 'name' field. -type AttributePattern struct { - variable string - qualifierPatterns []*AttributeQualifierPattern -} - -// NewAttributePattern produces a new mutable AttributePattern based on a variable name. -func NewAttributePattern(variable string) *AttributePattern { - return &AttributePattern{ - variable: variable, - qualifierPatterns: []*AttributeQualifierPattern{}, - } -} - -// QualString adds a string qualifier pattern to the AttributePattern. The string may be a valid -// identifier, or string map key including empty string. -func (apat *AttributePattern) QualString(pattern string) *AttributePattern { - apat.qualifierPatterns = append(apat.qualifierPatterns, - &AttributeQualifierPattern{value: pattern}) - return apat -} - -// QualInt adds an int qualifier pattern to the AttributePattern. The index may be either a map or -// list index. -func (apat *AttributePattern) QualInt(pattern int64) *AttributePattern { - apat.qualifierPatterns = append(apat.qualifierPatterns, - &AttributeQualifierPattern{value: pattern}) - return apat -} - -// QualUint adds an uint qualifier pattern for a map index operation to the AttributePattern. -func (apat *AttributePattern) QualUint(pattern uint64) *AttributePattern { - apat.qualifierPatterns = append(apat.qualifierPatterns, - &AttributeQualifierPattern{value: pattern}) - return apat -} - -// QualBool adds a bool qualifier pattern for a map index operation to the AttributePattern. -func (apat *AttributePattern) QualBool(pattern bool) *AttributePattern { - apat.qualifierPatterns = append(apat.qualifierPatterns, - &AttributeQualifierPattern{value: pattern}) - return apat -} - -// Wildcard adds a special sentinel qualifier pattern that will match any single qualifier. -func (apat *AttributePattern) Wildcard() *AttributePattern { - apat.qualifierPatterns = append(apat.qualifierPatterns, - &AttributeQualifierPattern{wildcard: true}) - return apat -} - -// VariableMatches returns true if the fully qualified variable matches the AttributePattern -// fully qualified variable name. -func (apat *AttributePattern) VariableMatches(variable string) bool { - return apat.variable == variable -} - -// QualifierPatterns returns the set of AttributeQualifierPattern values on the AttributePattern. -func (apat *AttributePattern) QualifierPatterns() []*AttributeQualifierPattern { - return apat.qualifierPatterns -} - -// AttributeQualifierPattern holds a wildcard or valued qualifier pattern. -type AttributeQualifierPattern struct { - wildcard bool - value any -} - -// Matches returns true if the qualifier pattern is a wildcard, or the Qualifier implements the -// qualifierValueEquator interface and its IsValueEqualTo returns true for the qualifier pattern. -func (qpat *AttributeQualifierPattern) Matches(q Qualifier) bool { - if qpat.wildcard { - return true - } - qve, ok := q.(qualifierValueEquator) - return ok && qve.QualifierValueEquals(qpat.value) -} - -// qualifierValueEquator defines an interface for determining if an input value, of valid map key -// type, is equal to the value held in the Qualifier. This interface is used by the -// AttributeQualifierPattern to determine pattern matches for non-wildcard qualifier patterns. -// -// Note: Attribute values are also Qualifier values; however, Attributes are resolved before -// qualification happens. This is an implementation detail, but one relevant to why the Attribute -// types do not surface in the list of implementations. -// -// See: partialAttributeFactory.matchesUnknownPatterns for more details on how this interface is -// used. -type qualifierValueEquator interface { - // QualifierValueEquals returns true if the input value is equal to the value held in the - // Qualifier. - QualifierValueEquals(value any) bool -} - -// QualifierValueEquals implementation for boolean qualifiers. -func (q *boolQualifier) QualifierValueEquals(value any) bool { - bval, ok := value.(bool) - return ok && q.value == bval -} - -// QualifierValueEquals implementation for field qualifiers. -func (q *fieldQualifier) QualifierValueEquals(value any) bool { - sval, ok := value.(string) - return ok && q.Name == sval -} - -// QualifierValueEquals implementation for string qualifiers. -func (q *stringQualifier) QualifierValueEquals(value any) bool { - sval, ok := value.(string) - return ok && q.value == sval -} - -// QualifierValueEquals implementation for int qualifiers. -func (q *intQualifier) QualifierValueEquals(value any) bool { - return numericValueEquals(value, q.celValue) -} - -// QualifierValueEquals implementation for uint qualifiers. -func (q *uintQualifier) QualifierValueEquals(value any) bool { - return numericValueEquals(value, q.celValue) -} - -// QualifierValueEquals implementation for double qualifiers. -func (q *doubleQualifier) QualifierValueEquals(value any) bool { - return numericValueEquals(value, q.celValue) -} - -// numericValueEquals uses CEL equality to determine whether two number values are -func numericValueEquals(value any, celValue ref.Val) bool { - val := types.DefaultTypeAdapter.NativeToValue(value) - return celValue.Equal(val) == types.True -} - -// NewPartialAttributeFactory returns an AttributeFactory implementation capable of performing -// AttributePattern matches with PartialActivation inputs. -func NewPartialAttributeFactory(container *containers.Container, adapter types.Adapter, provider types.Provider, opts ...AttrFactoryOption) AttributeFactory { - fac := NewAttributeFactory(container, adapter, provider, opts...) - return &partialAttributeFactory{ - AttributeFactory: fac, - container: container, - adapter: adapter, - provider: provider, - } -} - -type partialAttributeFactory struct { - AttributeFactory - container *containers.Container - adapter types.Adapter - provider types.Provider -} - -// AbsoluteAttribute implementation of the AttributeFactory interface which wraps the -// NamespacedAttribute resolution in an internal attributeMatcher object to dynamically match -// unknown patterns from PartialActivation inputs if given. -func (fac *partialAttributeFactory) AbsoluteAttribute(id int64, names ...string) NamespacedAttribute { - attr := fac.AttributeFactory.AbsoluteAttribute(id, names...) - return &attributeMatcher{fac: fac, NamespacedAttribute: attr} -} - -// MaybeAttribute implementation of the AttributeFactory interface which ensure that the set of -// 'maybe' NamespacedAttribute values are produced using the partialAttributeFactory rather than -// the base AttributeFactory implementation. -func (fac *partialAttributeFactory) MaybeAttribute(id int64, name string) Attribute { - return &maybeAttribute{ - id: id, - attrs: []NamespacedAttribute{ - fac.AbsoluteAttribute(id, fac.container.ResolveCandidateNames(name)...), - }, - adapter: fac.adapter, - provider: fac.provider, - fac: fac, - } -} - -// matchesUnknownPatterns returns true if the variable names and qualifiers for a given -// Attribute value match any of the ActivationPattern objects in the set of unknown activation -// patterns on the given PartialActivation. -// -// For example, in the expression `a.b`, the Attribute is composed of variable `a`, with string -// qualifier `b`. When a PartialActivation is supplied, it indicates that some or all of the data -// provided in the input is unknown by specifying unknown AttributePatterns. An AttributePattern -// that refers to variable `a` with a string qualifier of `c` will not match `a.b`; however, any -// of the following patterns will match Attribute `a.b`: -// -// - `AttributePattern("a")` -// - `AttributePattern("a").Wildcard()` -// - `AttributePattern("a").QualString("b")` -// - `AttributePattern("a").QualString("b").QualInt(0)` -// -// Any AttributePattern which overlaps an Attribute or vice-versa will produce an Unknown result -// for the last pattern matched variable or qualifier in the Attribute. In the first matching -// example, the expression id representing variable `a` would be listed in the Unknown result, -// whereas in the other pattern examples, the qualifier `b` would be returned as the Unknown. -func (fac *partialAttributeFactory) matchesUnknownPatterns( - vars PartialActivation, - attrID int64, - variableNames []string, - qualifiers []Qualifier) (*types.Unknown, error) { - patterns := vars.UnknownAttributePatterns() - candidateIndices := map[int]struct{}{} - for _, variable := range variableNames { - for i, pat := range patterns { - if pat.VariableMatches(variable) { - if len(qualifiers) == 0 { - return types.NewUnknown(attrID, types.NewAttributeTrail(variable)), nil - } - candidateIndices[i] = struct{}{} - } - } - } - // Determine whether to return early if there are no candidate unknown patterns. - if len(candidateIndices) == 0 { - return nil, nil - } - // Resolve the attribute qualifiers into a static set. This prevents more dynamic - // Attribute resolutions than necessary when there are multiple unknown patterns - // that traverse the same Attribute-based qualifier field. - newQuals := make([]Qualifier, len(qualifiers)) - for i, qual := range qualifiers { - attr, isAttr := qual.(Attribute) - if isAttr { - val, err := attr.Resolve(vars) - if err != nil { - return nil, err - } - // If this resolution behavior ever changes, new implementations of the - // qualifierValueEquator may be required to handle proper resolution. - qual, err = fac.NewQualifier(nil, qual.ID(), val, attr.IsOptional()) - if err != nil { - return nil, err - } - } - newQuals[i] = qual - } - // Determine whether any of the unknown patterns match. - for patIdx := range candidateIndices { - pat := patterns[patIdx] - isUnk := true - matchExprID := attrID - qualPats := pat.QualifierPatterns() - for i, qual := range newQuals { - if i >= len(qualPats) { - break - } - matchExprID = qual.ID() - qualPat := qualPats[i] - // Note, the AttributeQualifierPattern relies on the input Qualifier not being an - // Attribute, since there is no way to resolve the Attribute with the information - // provided to the Matches call. - if !qualPat.Matches(qual) { - isUnk = false - break - } - } - if isUnk { - attr := types.NewAttributeTrail(pat.variable) - for i := 0; i < len(qualPats) && i < len(newQuals); i++ { - if qual, ok := newQuals[i].(ConstantQualifier); ok { - switch v := qual.Value().Value().(type) { - case bool: - types.QualifyAttribute[bool](attr, v) - case float64: - types.QualifyAttribute[int64](attr, int64(v)) - case int64: - types.QualifyAttribute[int64](attr, v) - case string: - types.QualifyAttribute[string](attr, v) - case uint64: - types.QualifyAttribute[uint64](attr, v) - default: - types.QualifyAttribute[string](attr, fmt.Sprintf("%v", v)) - } - } else { - types.QualifyAttribute[string](attr, "*") - } - } - return types.NewUnknown(matchExprID, attr), nil - } - } - return nil, nil -} - -// attributeMatcher embeds the NamespacedAttribute interface which allows it to participate in -// AttributePattern matching against Attribute values without having to modify the code paths that -// identify Attributes in expressions. -type attributeMatcher struct { - NamespacedAttribute - qualifiers []Qualifier - fac *partialAttributeFactory -} - -// AddQualifier implements the Attribute interface method. -func (m *attributeMatcher) AddQualifier(qual Qualifier) (Attribute, error) { - // Add the qualifier to the embedded NamespacedAttribute. If the input to the Resolve - // method is not a PartialActivation, or does not match an unknown attribute pattern, the - // Resolve method is directly invoked on the underlying NamespacedAttribute. - _, err := m.NamespacedAttribute.AddQualifier(qual) - if err != nil { - return nil, err - } - // The attributeMatcher overloads TryResolve and will attempt to match unknown patterns against - // the variable name and qualifier set contained within the Attribute. These values are not - // directly inspectable on the top-level NamespacedAttribute interface and so are tracked within - // the attributeMatcher. - m.qualifiers = append(m.qualifiers, qual) - return m, nil -} - -// Resolve is an implementation of the NamespacedAttribute interface method which tests -// for matching unknown attribute patterns and returns types.Unknown if present. Otherwise, -// the standard Resolve logic applies. -func (m *attributeMatcher) Resolve(vars Activation) (any, error) { - id := m.NamespacedAttribute.ID() - // Bug in how partial activation is resolved, should search parents as well. - partial, isPartial := AsPartialActivation(vars) - if isPartial { - unk, err := m.fac.matchesUnknownPatterns( - partial, - id, - m.CandidateVariableNames(), - m.qualifiers) - if err != nil { - return nil, err - } - if unk != nil { - return unk, nil - } - } - return m.NamespacedAttribute.Resolve(vars) -} - -// Qualify is an implementation of the Qualifier interface method. -func (m *attributeMatcher) Qualify(vars Activation, obj any) (any, error) { - return attrQualify(m.fac, vars, obj, m) -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (m *attributeMatcher) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return attrQualifyIfPresent(m.fac, vars, obj, m, presenceOnly) -} diff --git a/vendor/github.com/google/cel-go/interpreter/attributes.go b/vendor/github.com/google/cel-go/interpreter/attributes.go deleted file mode 100644 index b1b3aacc8..000000000 --- a/vendor/github.com/google/cel-go/interpreter/attributes.go +++ /dev/null @@ -1,1436 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "fmt" - "strings" - - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// AttributeFactory provides methods creating Attribute and Qualifier values. -type AttributeFactory interface { - // AbsoluteAttribute creates an attribute that refers to a top-level variable name. - // - // Checked expressions generate absolute attribute with a single name. - // Parse-only expressions may have more than one possible absolute identifier when the - // expression is created within a container, e.g. package or namespace. - // - // When there is more than one name supplied to the AbsoluteAttribute call, the names - // must be in CEL's namespace resolution order. The name arguments provided here are - // returned in the same order as they were provided by the NamespacedAttribute - // CandidateVariableNames method. - AbsoluteAttribute(id int64, names ...string) NamespacedAttribute - - // ConditionalAttribute creates an attribute with two Attribute branches, where the Attribute - // that is resolved depends on the boolean evaluation of the input 'expr'. - ConditionalAttribute(id int64, expr Interpretable, t, f Attribute) Attribute - - // MaybeAttribute creates an attribute that refers to either a field selection or a namespaced - // variable name. - // - // Only expressions which have not been type-checked may generate oneof attributes. - MaybeAttribute(id int64, name string) Attribute - - // RelativeAttribute creates an attribute whose value is a qualification of a dynamic - // computation rather than a static variable reference. - RelativeAttribute(id int64, operand Interpretable) Attribute - - // NewQualifier creates a qualifier on the target object with a given value. - // - // The 'val' may be an Attribute or any proto-supported map key type: bool, int, string, uint. - // - // The qualifier may consider the object type being qualified, if present. If absent, the - // qualification should be considered dynamic and the qualification should still work, though - // it may be sub-optimal. - NewQualifier(objType *types.Type, qualID int64, val any, opt bool) (Qualifier, error) -} - -// Qualifier marker interface for designating different qualifier values and where they appear -// within field selections and index call expressions (`_[_]`). -type Qualifier interface { - // ID where the qualifier appears within an expression. - ID() int64 - - // IsOptional specifies whether the qualifier is optional. - // Instead of a direct qualification, an optional qualifier will be resolved via QualifyIfPresent - // rather than Qualify. A non-optional qualifier may also be resolved through QualifyIfPresent if - // the object to qualify is itself optional. - IsOptional() bool - - // Qualify performs a qualification, e.g. field selection, on the input object and returns - // the value of the access and whether the value was set. A non-nil value with a false presence - // test result indicates that the value being returned is the default value. - Qualify(vars Activation, obj any) (any, error) - - // QualifyIfPresent qualifies the object if the qualifier is declared or defined on the object. - // The 'presenceOnly' flag indicates that the value is not necessary, just a boolean status as - // to whether the qualifier is present. - QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) -} - -// ConstantQualifier interface embeds the Qualifier interface and provides an option to inspect the -// qualifier's constant value. -// -// Non-constant qualifiers are of Attribute type. -type ConstantQualifier interface { - Qualifier - - // Value returns the constant value associated with the qualifier. - Value() ref.Val -} - -// Attribute values are a variable or value with an optional set of qualifiers, such as field, key, -// or index accesses. -type Attribute interface { - Qualifier - - // AddQualifier adds a qualifier on the Attribute or error if the qualification is not a valid qualifier type. - AddQualifier(Qualifier) (Attribute, error) - - // Resolve returns the value of the Attribute and whether it was present given an Activation. - // For objects which support safe traversal, the value may be non-nil and the presence flag be false. - // - // If an error is encountered during attribute resolution, it will be returned immediately. - // If the attribute cannot be resolved within the Activation, the result must be: `nil`, `error` - // with the error indicating which variable was missing. - Resolve(Activation) (any, error) -} - -// NamespacedAttribute values are a variable within a namespace, and an optional set of qualifiers -// such as field, key, or index accesses. -type NamespacedAttribute interface { - Attribute - - // CandidateVariableNames returns the possible namespaced variable names for this Attribute in - // the CEL namespace resolution order. - CandidateVariableNames() []string - - // Qualifiers returns the list of qualifiers associated with the Attribute. - Qualifiers() []Qualifier -} - -// AttrFactoryOption specifies a functional option for configuring an attribute factory. -type AttrFactoryOption func(*attrFactory) *attrFactory - -// EnableErrorOnBadPresenceTest error generation when a presence test or optional field selection -// is performed on a primitive type. -func EnableErrorOnBadPresenceTest(value bool) AttrFactoryOption { - return func(fac *attrFactory) *attrFactory { - fac.errorOnBadPresenceTest = value - return fac - } -} - -// NewAttributeFactory returns a default AttributeFactory which is produces Attribute values -// capable of resolving types by simple names and qualify the values using the supported qualifier -// types: bool, int, string, and uint. -func NewAttributeFactory(cont *containers.Container, a types.Adapter, p types.Provider, opts ...AttrFactoryOption) AttributeFactory { - fac := &attrFactory{ - container: cont, - adapter: a, - provider: p, - } - for _, o := range opts { - fac = o(fac) - } - return fac -} - -type attrFactory struct { - container *containers.Container - adapter types.Adapter - provider types.Provider - - errorOnBadPresenceTest bool -} - -// AbsoluteAttribute refers to a variable value and an optional qualifier path. -// -// The namespaceNames represent the names the variable could have based on namespace -// resolution rules. -func (r *attrFactory) AbsoluteAttribute(id int64, names ...string) NamespacedAttribute { - return &absoluteAttribute{ - id: id, - namespaceNames: names, - qualifiers: []Qualifier{}, - adapter: r.adapter, - provider: r.provider, - fac: r, - errorOnBadPresenceTest: r.errorOnBadPresenceTest, - } -} - -// ConditionalAttribute supports the case where an attribute selection may occur on a conditional -// expression, e.g. (cond ? a : b).c -func (r *attrFactory) ConditionalAttribute(id int64, expr Interpretable, t, f Attribute) Attribute { - return &conditionalAttribute{ - id: id, - expr: expr, - truthy: t, - falsy: f, - adapter: r.adapter, - fac: r, - } -} - -// MaybeAttribute collects variants of unchecked AbsoluteAttribute values which could either be -// direct variable accesses or some combination of variable access with qualification. -func (r *attrFactory) MaybeAttribute(id int64, name string) Attribute { - return &maybeAttribute{ - id: id, - attrs: []NamespacedAttribute{ - r.AbsoluteAttribute(id, r.container.ResolveCandidateNames(name)...), - }, - adapter: r.adapter, - provider: r.provider, - fac: r, - } -} - -// RelativeAttribute refers to an expression and an optional qualifier path. -func (r *attrFactory) RelativeAttribute(id int64, operand Interpretable) Attribute { - return &relativeAttribute{ - id: id, - operand: operand, - qualifiers: []Qualifier{}, - adapter: r.adapter, - fac: r, - errorOnBadPresenceTest: r.errorOnBadPresenceTest, - } -} - -// NewQualifier is an implementation of the AttributeFactory interface. -func (r *attrFactory) NewQualifier(objType *types.Type, qualID int64, val any, opt bool) (Qualifier, error) { - // Before creating a new qualifier check to see if this is a protobuf message field access. - // If so, use the precomputed GetFrom qualification method rather than the standard - // stringQualifier. - str, isStr := val.(string) - if isStr && objType != nil && objType.Kind() == types.StructKind { - ft, found := r.provider.FindStructFieldType(objType.TypeName(), str) - if found && ft.IsSet != nil && ft.GetFrom != nil { - return &fieldQualifier{ - id: qualID, - Name: str, - FieldType: ft, - adapter: r.adapter, - optional: opt, - }, nil - } - } - return newQualifier(r.adapter, qualID, val, opt, r.errorOnBadPresenceTest) -} - -type absoluteAttribute struct { - id int64 - // namespaceNames represent the names the variable could have based on declared container - // (package) of the expression. - namespaceNames []string - qualifiers []Qualifier - adapter types.Adapter - provider types.Provider - fac AttributeFactory - - errorOnBadPresenceTest bool -} - -// ID implements the Attribute interface method. -func (a *absoluteAttribute) ID() int64 { - qualCount := len(a.qualifiers) - if qualCount == 0 { - return a.id - } - return a.qualifiers[qualCount-1].ID() -} - -// IsOptional returns trivially false for an attribute as the attribute represents a fully -// qualified variable name. If the attribute is used in an optional manner, then an attrQualifier -// is created and marks the attribute as optional. -func (a *absoluteAttribute) IsOptional() bool { - return false -} - -// AddQualifier implements the Attribute interface method. -func (a *absoluteAttribute) AddQualifier(qual Qualifier) (Attribute, error) { - a.qualifiers = append(a.qualifiers, qual) - return a, nil -} - -// CandidateVariableNames implements the NamespaceAttribute interface method. -func (a *absoluteAttribute) CandidateVariableNames() []string { - return a.namespaceNames -} - -// Qualifiers returns the list of Qualifier instances associated with the namespaced attribute. -func (a *absoluteAttribute) Qualifiers() []Qualifier { - return a.qualifiers -} - -// Qualify is an implementation of the Qualifier interface method. -func (a *absoluteAttribute) Qualify(vars Activation, obj any) (any, error) { - return attrQualify(a.fac, vars, obj, a) -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (a *absoluteAttribute) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return attrQualifyIfPresent(a.fac, vars, obj, a, presenceOnly) -} - -// String implements the Stringer interface method. -func (a *absoluteAttribute) String() string { - return fmt.Sprintf("id: %v, names: %v", a.id, a.namespaceNames) -} - -// Resolve returns the resolved Attribute value given the Activation, or error if the Attribute -// variable is not found, or if its Qualifiers cannot be applied successfully. -// -// If the variable name cannot be found as an Activation variable or in the TypeProvider as -// a type, then the result is `nil`, `error` with the error indicating the name of the first -// variable searched as missing. -func (a *absoluteAttribute) Resolve(vars Activation) (any, error) { - for _, nm := range a.namespaceNames { - // If the variable is found, process it. Otherwise, wait until the checks to - // determine whether the type is unknown before returning. - obj, found := vars.ResolveName(nm) - if found { - if celErr, ok := obj.(*types.Err); ok { - return nil, celErr.Unwrap() - } - obj, isOpt, err := applyQualifiers(vars, obj, a.qualifiers) - if err != nil { - return nil, err - } - if isOpt { - val := a.adapter.NativeToValue(obj) - if types.IsUnknown(val) { - return val, nil - } - return types.OptionalOf(val), nil - } - return obj, nil - } - // Attempt to resolve the qualified type name if the name is not a variable identifier. - typ, found := a.provider.FindIdent(nm) - if found { - if len(a.qualifiers) == 0 { - return typ, nil - } - } - } - var attrNames strings.Builder - for i, nm := range a.namespaceNames { - if i != 0 { - attrNames.WriteString(", ") - } - attrNames.WriteString(nm) - } - return nil, missingAttribute(attrNames.String()) -} - -type conditionalAttribute struct { - id int64 - expr Interpretable - truthy Attribute - falsy Attribute - adapter types.Adapter - fac AttributeFactory -} - -// ID is an implementation of the Attribute interface method. -func (a *conditionalAttribute) ID() int64 { - // There's a field access after the conditional. - if a.truthy.ID() == a.falsy.ID() { - return a.truthy.ID() - } - // Otherwise return the conditional id as the consistent id being tracked. - return a.id -} - -// IsOptional returns trivially false for an attribute as the attribute represents a fully -// qualified variable name. If the attribute is used in an optional manner, then an attrQualifier -// is created and marks the attribute as optional. -func (a *conditionalAttribute) IsOptional() bool { - return false -} - -// AddQualifier appends the same qualifier to both sides of the conditional, in effect managing -// the qualification of alternate attributes. -func (a *conditionalAttribute) AddQualifier(qual Qualifier) (Attribute, error) { - _, err := a.truthy.AddQualifier(qual) - if err != nil { - return nil, err - } - _, err = a.falsy.AddQualifier(qual) - if err != nil { - return nil, err - } - return a, nil -} - -// Qualify is an implementation of the Qualifier interface method. -func (a *conditionalAttribute) Qualify(vars Activation, obj any) (any, error) { - return attrQualify(a.fac, vars, obj, a) -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (a *conditionalAttribute) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return attrQualifyIfPresent(a.fac, vars, obj, a, presenceOnly) -} - -// Resolve evaluates the condition, and then resolves the truthy or falsy branch accordingly. -func (a *conditionalAttribute) Resolve(vars Activation) (any, error) { - val := a.expr.Eval(vars) - if val == types.True { - return a.truthy.Resolve(vars) - } - if val == types.False { - return a.falsy.Resolve(vars) - } - if types.IsUnknown(val) { - return val, nil - } - return nil, types.MaybeNoSuchOverloadErr(val).(*types.Err) -} - -// String is an implementation of the Stringer interface method. -func (a *conditionalAttribute) String() string { - return fmt.Sprintf("id: %v, truthy attribute: %v, falsy attribute: %v", a.id, a.truthy, a.falsy) -} - -type maybeAttribute struct { - id int64 - attrs []NamespacedAttribute - adapter types.Adapter - provider types.Provider - fac AttributeFactory -} - -// ID is an implementation of the Attribute interface method. -func (a *maybeAttribute) ID() int64 { - return a.attrs[0].ID() -} - -// IsOptional returns trivially false for an attribute as the attribute represents a fully -// qualified variable name. If the attribute is used in an optional manner, then an attrQualifier -// is created and marks the attribute as optional. -func (a *maybeAttribute) IsOptional() bool { - return false -} - -// AddQualifier adds a qualifier to each possible attribute variant, and also creates -// a new namespaced variable from the qualified value. -// -// The algorithm for building the maybe attribute is as follows: -// -// 1. Create a maybe attribute from a simple identifier when it occurs in a parsed-only expression -// -// mb = MaybeAttribute(, "a") -// -// Initializing the maybe attribute creates an absolute attribute internally which includes the -// possible namespaced names of the attribute. In this example, let's assume we are in namespace -// 'ns', then the maybe is either one of the following variable names: -// -// possible variables names -- ns.a, a -// -// 2. Adding a qualifier to the maybe means that the variable name could be a longer qualified -// name, or a field selection on one of the possible variable names produced earlier: -// -// mb.AddQualifier("b") -// -// possible variables names -- ns.a.b, a.b -// possible field selection -- ns.a['b'], a['b'] -// -// If none of the attributes within the maybe resolves a value, the result is an error. -func (a *maybeAttribute) AddQualifier(qual Qualifier) (Attribute, error) { - str := "" - isStr := false - cq, isConst := qual.(ConstantQualifier) - if isConst { - str, isStr = cq.Value().Value().(string) - } - var augmentedNames []string - // First add the qualifier to all existing attributes in the oneof. - for _, attr := range a.attrs { - if isStr && len(attr.Qualifiers()) == 0 { - candidateVars := attr.CandidateVariableNames() - augmentedNames = make([]string, len(candidateVars)) - for i, name := range candidateVars { - augmentedNames[i] = fmt.Sprintf("%s.%s", name, str) - } - } - _, err := attr.AddQualifier(qual) - if err != nil { - return nil, err - } - } - // Next, ensure the most specific variable / type reference is searched first. - if len(augmentedNames) != 0 { - a.attrs = append([]NamespacedAttribute{a.fac.AbsoluteAttribute(qual.ID(), augmentedNames...)}, a.attrs...) - } - return a, nil -} - -// Qualify is an implementation of the Qualifier interface method. -func (a *maybeAttribute) Qualify(vars Activation, obj any) (any, error) { - return attrQualify(a.fac, vars, obj, a) -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (a *maybeAttribute) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return attrQualifyIfPresent(a.fac, vars, obj, a, presenceOnly) -} - -// Resolve follows the variable resolution rules to determine whether the attribute is a variable -// or a field selection. -func (a *maybeAttribute) Resolve(vars Activation) (any, error) { - var maybeErr error - for _, attr := range a.attrs { - obj, err := attr.Resolve(vars) - // Return an error if one is encountered. - if err != nil { - resErr, ok := err.(*resolutionError) - if !ok { - return nil, err - } - // If this was not a missing variable error, return it. - if !resErr.isMissingAttribute() { - return nil, err - } - // When the variable is missing in a maybe attribute we defer erroring. - if maybeErr == nil { - maybeErr = resErr - } - // Continue attempting to resolve possible variables. - continue - } - return obj, nil - } - // Else, produce a no such attribute error. - return nil, maybeErr -} - -// String is an implementation of the Stringer interface method. -func (a *maybeAttribute) String() string { - return fmt.Sprintf("id: %v, attributes: %v", a.id, a.attrs) -} - -type relativeAttribute struct { - id int64 - operand Interpretable - qualifiers []Qualifier - adapter types.Adapter - fac AttributeFactory - - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Attribute interface method. -func (a *relativeAttribute) ID() int64 { - qualCount := len(a.qualifiers) - if qualCount == 0 { - return a.id - } - return a.qualifiers[qualCount-1].ID() -} - -// IsOptional returns trivially false for an attribute as the attribute represents a fully -// qualified variable name. If the attribute is used in an optional manner, then an attrQualifier -// is created and marks the attribute as optional. -func (a *relativeAttribute) IsOptional() bool { - return false -} - -// AddQualifier implements the Attribute interface method. -func (a *relativeAttribute) AddQualifier(qual Qualifier) (Attribute, error) { - a.qualifiers = append(a.qualifiers, qual) - return a, nil -} - -// Qualify is an implementation of the Qualifier interface method. -func (a *relativeAttribute) Qualify(vars Activation, obj any) (any, error) { - return attrQualify(a.fac, vars, obj, a) -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (a *relativeAttribute) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return attrQualifyIfPresent(a.fac, vars, obj, a, presenceOnly) -} - -// Resolve expression value and qualifier relative to the expression result. -func (a *relativeAttribute) Resolve(vars Activation) (any, error) { - // First, evaluate the operand. - v := a.operand.Eval(vars) - if types.IsError(v) { - return nil, v.(*types.Err) - } - if types.IsUnknown(v) { - return v, nil - } - obj, isOpt, err := applyQualifiers(vars, v, a.qualifiers) - if err != nil { - return nil, err - } - if isOpt { - val := a.adapter.NativeToValue(obj) - if types.IsUnknown(val) { - return val, nil - } - return types.OptionalOf(val), nil - } - return obj, nil -} - -// String is an implementation of the Stringer interface method. -func (a *relativeAttribute) String() string { - return fmt.Sprintf("id: %v, operand: %v", a.id, a.operand) -} - -func newQualifier(adapter types.Adapter, id int64, v any, opt, errorOnBadPresenceTest bool) (Qualifier, error) { - var qual Qualifier - switch val := v.(type) { - case Attribute: - // Note, attributes are initially identified as non-optional since they represent a top-level - // field access; however, when used as a relative qualifier, e.g. a[?b.c], then an attrQualifier - // is created which intercepts the IsOptional check for the attribute in order to return the - // correct result. - return &attrQualifier{ - id: id, - Attribute: val, - optional: opt, - }, nil - case string: - qual = &stringQualifier{ - id: id, - value: val, - celValue: types.String(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case int: - qual = &intQualifier{ - id: id, - value: int64(val), - celValue: types.Int(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case int32: - qual = &intQualifier{ - id: id, - value: int64(val), - celValue: types.Int(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case int64: - qual = &intQualifier{ - id: id, - value: val, - celValue: types.Int(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case uint: - qual = &uintQualifier{ - id: id, - value: uint64(val), - celValue: types.Uint(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case uint32: - qual = &uintQualifier{ - id: id, - value: uint64(val), - celValue: types.Uint(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case uint64: - qual = &uintQualifier{ - id: id, - value: val, - celValue: types.Uint(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case bool: - qual = &boolQualifier{ - id: id, - value: val, - celValue: types.Bool(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case float32: - qual = &doubleQualifier{ - id: id, - value: float64(val), - celValue: types.Double(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case float64: - qual = &doubleQualifier{ - id: id, - value: val, - celValue: types.Double(val), - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case types.String: - qual = &stringQualifier{ - id: id, - value: string(val), - celValue: val, - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case types.Int: - qual = &intQualifier{ - id: id, - value: int64(val), - celValue: val, - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case types.Uint: - qual = &uintQualifier{ - id: id, - value: uint64(val), - celValue: val, - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case types.Bool: - qual = &boolQualifier{ - id: id, - value: bool(val), - celValue: val, - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case types.Double: - qual = &doubleQualifier{ - id: id, - value: float64(val), - celValue: val, - adapter: adapter, - optional: opt, - errorOnBadPresenceTest: errorOnBadPresenceTest, - } - case *types.Unknown: - qual = &unknownQualifier{id: id, value: val} - default: - if q, ok := v.(Qualifier); ok { - return q, nil - } - return nil, fmt.Errorf("invalid qualifier type: %T", v) - } - return qual, nil -} - -type attrQualifier struct { - id int64 - Attribute - optional bool -} - -// ID implements the Qualifier interface method and returns the qualification instruction id -// rather than the attribute id. -func (q *attrQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *attrQualifier) IsOptional() bool { - return q.optional -} - -type stringQualifier struct { - id int64 - value string - celValue ref.Val - adapter types.Adapter - optional bool - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *stringQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *stringQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *stringQualifier) Qualify(vars Activation, obj any) (any, error) { - val, _, err := q.qualifyInternal(vars, obj, false, false) - return val, err -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *stringQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.qualifyInternal(vars, obj, true, presenceOnly) -} - -func (q *stringQualifier) qualifyInternal(vars Activation, obj any, presenceTest, presenceOnly bool) (any, bool, error) { - s := q.value - switch o := obj.(type) { - case map[string]any: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]string: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]int: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]int32: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]int64: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]uint: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]uint32: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]uint64: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]float32: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]float64: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - case map[string]bool: - obj, isKey := o[s] - if isKey { - return obj, true, nil - } - default: - return refQualify(q.adapter, obj, q.celValue, presenceTest, presenceOnly, q.errorOnBadPresenceTest) - } - if presenceTest { - return nil, false, nil - } - return nil, false, missingKey(q.celValue) -} - -// Value implements the ConstantQualifier interface -func (q *stringQualifier) Value() ref.Val { - return q.celValue -} - -type intQualifier struct { - id int64 - value int64 - celValue ref.Val - adapter types.Adapter - optional bool - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *intQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *intQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *intQualifier) Qualify(vars Activation, obj any) (any, error) { - val, _, err := q.qualifyInternal(vars, obj, false, false) - return val, err -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *intQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.qualifyInternal(vars, obj, true, presenceOnly) -} - -func (q *intQualifier) qualifyInternal(vars Activation, obj any, presenceTest, presenceOnly bool) (any, bool, error) { - i := q.value - var isMap bool - switch o := obj.(type) { - // The specialized map types supported by an int qualifier are considerably fewer than the set - // of specialized map types supported by string qualifiers since they are less frequently used - // than string-based map keys. Additional specializations may be added in the future if - // desired. - case map[int]any: - isMap = true - obj, isKey := o[int(i)] - if isKey { - return obj, true, nil - } - case map[int32]any: - isMap = true - obj, isKey := o[int32(i)] - if isKey { - return obj, true, nil - } - case map[int64]any: - isMap = true - obj, isKey := o[i] - if isKey { - return obj, true, nil - } - case []any: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []string: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []int: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []int32: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []int64: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []uint: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []uint32: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []uint64: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []float32: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []float64: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - case []bool: - isIndex := i >= 0 && i < int64(len(o)) - if isIndex { - return o[i], true, nil - } - default: - return refQualify(q.adapter, obj, q.celValue, presenceTest, presenceOnly, q.errorOnBadPresenceTest) - } - if presenceTest { - return nil, false, nil - } - if isMap { - return nil, false, missingKey(q.celValue) - } - return nil, false, missingIndex(q.celValue) -} - -// Value implements the ConstantQualifier interface -func (q *intQualifier) Value() ref.Val { - return q.celValue -} - -type uintQualifier struct { - id int64 - value uint64 - celValue ref.Val - adapter types.Adapter - optional bool - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *uintQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *uintQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *uintQualifier) Qualify(vars Activation, obj any) (any, error) { - val, _, err := q.qualifyInternal(vars, obj, false, false) - return val, err -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *uintQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.qualifyInternal(vars, obj, true, presenceOnly) -} - -func (q *uintQualifier) qualifyInternal(vars Activation, obj any, presenceTest, presenceOnly bool) (any, bool, error) { - u := q.value - switch o := obj.(type) { - // The specialized map types supported by a uint qualifier are considerably fewer than the set - // of specialized map types supported by string qualifiers since they are less frequently used - // than string-based map keys. Additional specializations may be added in the future if - // desired. - case map[uint]any: - obj, isKey := o[uint(u)] - if isKey { - return obj, true, nil - } - case map[uint32]any: - obj, isKey := o[uint32(u)] - if isKey { - return obj, true, nil - } - case map[uint64]any: - obj, isKey := o[u] - if isKey { - return obj, true, nil - } - default: - return refQualify(q.adapter, obj, q.celValue, presenceTest, presenceOnly, q.errorOnBadPresenceTest) - } - if presenceTest { - return nil, false, nil - } - return nil, false, missingKey(q.celValue) -} - -// Value implements the ConstantQualifier interface -func (q *uintQualifier) Value() ref.Val { - return q.celValue -} - -type boolQualifier struct { - id int64 - value bool - celValue ref.Val - adapter types.Adapter - optional bool - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *boolQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *boolQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *boolQualifier) Qualify(vars Activation, obj any) (any, error) { - val, _, err := q.qualifyInternal(vars, obj, false, false) - return val, err -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *boolQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.qualifyInternal(vars, obj, true, presenceOnly) -} - -func (q *boolQualifier) qualifyInternal(vars Activation, obj any, presenceTest, presenceOnly bool) (any, bool, error) { - b := q.value - switch o := obj.(type) { - case map[bool]any: - obj, isKey := o[b] - if isKey { - return obj, true, nil - } - default: - return refQualify(q.adapter, obj, q.celValue, presenceTest, presenceOnly, q.errorOnBadPresenceTest) - } - if presenceTest { - return nil, false, nil - } - return nil, false, missingKey(q.celValue) -} - -// Value implements the ConstantQualifier interface -func (q *boolQualifier) Value() ref.Val { - return q.celValue -} - -// fieldQualifier indicates that the qualification is a well-defined field with a known -// field type. When the field type is known this can be used to improve the speed and -// efficiency of field resolution. -type fieldQualifier struct { - id int64 - Name string - FieldType *types.FieldType - adapter types.Adapter - optional bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *fieldQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *fieldQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *fieldQualifier) Qualify(vars Activation, obj any) (any, error) { - if rv, ok := obj.(ref.Val); ok { - obj = rv.Value() - } - val, err := q.FieldType.GetFrom(obj) - if err != nil { - return nil, err - } - return val, nil -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *fieldQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - if rv, ok := obj.(ref.Val); ok { - obj = rv.Value() - } - if !q.FieldType.IsSet(obj) { - return nil, false, nil - } - if presenceOnly { - return nil, true, nil - } - val, err := q.FieldType.GetFrom(obj) - if err != nil { - return nil, false, err - } - return val, true, nil -} - -// Value implements the ConstantQualifier interface -func (q *fieldQualifier) Value() ref.Val { - return types.String(q.Name) -} - -// doubleQualifier qualifies a CEL object, map, or list using a double value. -// -// This qualifier is used for working with dynamic data like JSON or protobuf.Any where the value -// type may not be known ahead of time and may not conform to the standard types supported as valid -// protobuf map key types. -type doubleQualifier struct { - id int64 - value float64 - celValue ref.Val - adapter types.Adapter - optional bool - errorOnBadPresenceTest bool -} - -// ID is an implementation of the Qualifier interface method. -func (q *doubleQualifier) ID() int64 { - return q.id -} - -// IsOptional implements the Qualifier interface method. -func (q *doubleQualifier) IsOptional() bool { - return q.optional -} - -// Qualify implements the Qualifier interface method. -func (q *doubleQualifier) Qualify(vars Activation, obj any) (any, error) { - val, _, err := q.qualifyInternal(vars, obj, false, false) - return val, err -} - -func (q *doubleQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.qualifyInternal(vars, obj, true, presenceOnly) -} - -func (q *doubleQualifier) qualifyInternal(vars Activation, obj any, presenceTest, presenceOnly bool) (any, bool, error) { - return refQualify(q.adapter, obj, q.celValue, presenceTest, presenceOnly, q.errorOnBadPresenceTest) -} - -// Value implements the ConstantQualifier interface -func (q *doubleQualifier) Value() ref.Val { - return q.celValue -} - -// unknownQualifier is a simple qualifier which always returns a preconfigured set of unknown values -// for any value subject to qualification. This is consistent with CEL's unknown handling elsewhere. -type unknownQualifier struct { - id int64 - value *types.Unknown -} - -// ID is an implementation of the Qualifier interface method. -func (q *unknownQualifier) ID() int64 { - return q.id -} - -// IsOptional returns trivially false as an the unknown value is always returned. -func (q *unknownQualifier) IsOptional() bool { - return false -} - -// Qualify returns the unknown value associated with this qualifier. -func (q *unknownQualifier) Qualify(vars Activation, obj any) (any, error) { - return q.value, nil -} - -// QualifyIfPresent is an implementation of the Qualifier interface method. -func (q *unknownQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return q.value, true, nil -} - -// Value implements the ConstantQualifier interface -func (q *unknownQualifier) Value() ref.Val { - return q.value -} - -func applyQualifiers(vars Activation, obj any, qualifiers []Qualifier) (any, bool, error) { - optObj, isOpt := obj.(*types.Optional) - if isOpt { - if !optObj.HasValue() { - return optObj, false, nil - } - obj = optObj.GetValue().Value() - } - - var err error - for _, qual := range qualifiers { - var qualObj any - isOpt = isOpt || qual.IsOptional() - if isOpt { - var present bool - qualObj, present, err = qual.QualifyIfPresent(vars, obj, false) - if err != nil { - return nil, false, err - } - if !present { - // We return optional none here with a presence of 'false' as the layers - // above will attempt to call types.OptionalOf() on a present value if any - // of the qualifiers is optional. - return types.OptionalNone, false, nil - } - } else { - qualObj, err = qual.Qualify(vars, obj) - if err != nil { - return nil, false, err - } - } - obj = qualObj - } - return obj, isOpt, nil -} - -// attrQualify performs a qualification using the result of an attribute evaluation. -func attrQualify(fac AttributeFactory, vars Activation, obj any, qualAttr Attribute) (any, error) { - val, err := qualAttr.Resolve(vars) - if err != nil { - return nil, err - } - qual, err := fac.NewQualifier(nil, qualAttr.ID(), val, qualAttr.IsOptional()) - if err != nil { - return nil, err - } - return qual.Qualify(vars, obj) -} - -// attrQualifyIfPresent conditionally performs the qualification of the result of attribute is present -// on the target object. -func attrQualifyIfPresent(fac AttributeFactory, vars Activation, obj any, qualAttr Attribute, - presenceOnly bool) (any, bool, error) { - val, err := qualAttr.Resolve(vars) - if err != nil { - return nil, false, err - } - qual, err := fac.NewQualifier(nil, qualAttr.ID(), val, qualAttr.IsOptional()) - if err != nil { - return nil, false, err - } - return qual.QualifyIfPresent(vars, obj, presenceOnly) -} - -// refQualify attempts to convert the value to a CEL value and then uses reflection methods to try and -// apply the qualifier with the option to presence test field accesses before retrieving field values. -func refQualify(adapter types.Adapter, obj any, idx ref.Val, presenceTest, presenceOnly, errorOnBadPresenceTest bool) (ref.Val, bool, error) { - celVal := adapter.NativeToValue(obj) - switch v := celVal.(type) { - case *types.Unknown: - return v, true, nil - case *types.Err: - return nil, false, v - case traits.Mapper: - val, found := v.Find(idx) - // If the index is of the wrong type for the map, then it is possible - // for the Find call to produce an error. - if types.IsError(val) { - return nil, false, val.(*types.Err) - } - if found { - return val, true, nil - } - if presenceTest { - return nil, false, nil - } - return nil, false, missingKey(idx) - case traits.Lister: - // If the index argument is not a valid numeric type, then it is possible - // for the index operation to produce an error. - i, err := types.IndexOrError(idx) - if err != nil { - return nil, false, err - } - celIndex := types.Int(i) - if i >= 0 && celIndex < v.Size().(types.Int) { - return v.Get(idx), true, nil - } - if presenceTest { - return nil, false, nil - } - return nil, false, missingIndex(idx) - case traits.Indexer: - if presenceTest { - ft, ok := v.(traits.FieldTester) - if ok { - presence := ft.IsSet(idx) - if types.IsError(presence) { - return nil, false, presence.(*types.Err) - } - // If not found or presence only test, then return. - // Otherwise, if found, obtain the value later on. - if presenceOnly || presence == types.False { - return nil, presence == types.True, nil - } - } - } - val := v.Get(idx) - if types.IsError(val) { - return nil, false, val.(*types.Err) - } - return val, true, nil - default: - if presenceTest && !errorOnBadPresenceTest { - return nil, false, nil - } - return nil, false, missingKey(idx) - } -} - -// resolutionError is a custom error type which encodes the different error states which may -// occur during attribute resolution. -type resolutionError struct { - missingAttribute string - missingIndex ref.Val - missingKey ref.Val -} - -func (e *resolutionError) isMissingAttribute() bool { - return e.missingAttribute != "" -} - -func missingIndex(missing ref.Val) *resolutionError { - return &resolutionError{ - missingIndex: missing, - } -} - -func missingKey(missing ref.Val) *resolutionError { - return &resolutionError{ - missingKey: missing, - } -} - -func missingAttribute(attr string) *resolutionError { - return &resolutionError{ - missingAttribute: attr, - } -} - -// Error implements the error interface method. -func (e *resolutionError) Error() string { - if e.missingKey != nil { - return fmt.Sprintf("no such key: %v", e.missingKey) - } - if e.missingIndex != nil { - return fmt.Sprintf("index out of bounds: %v", e.missingIndex) - } - if e.missingAttribute != "" { - return fmt.Sprintf("no such attribute(s): %s", e.missingAttribute) - } - return "invalid attribute" -} - -// Is implements the errors.Is() method used by more recent versions of Go. -func (e *resolutionError) Is(err error) bool { - return err.Error() == e.Error() -} diff --git a/vendor/github.com/google/cel-go/interpreter/decorators.go b/vendor/github.com/google/cel-go/interpreter/decorators.go deleted file mode 100644 index 502db35fc..000000000 --- a/vendor/github.com/google/cel-go/interpreter/decorators.go +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// InterpretableDecorator is a functional interface for decorating or replacing -// Interpretable expression nodes at construction time. -type InterpretableDecorator func(Interpretable) (Interpretable, error) - -// decObserveEval records evaluation state into an EvalState object. -func decObserveEval(observer EvalObserver) InterpretableDecorator { - return func(i Interpretable) (Interpretable, error) { - switch inst := i.(type) { - case *evalWatch, *evalWatchAttr, *evalWatchConst, *evalWatchConstructor: - // these instruction are already watching, return straight-away. - return i, nil - case InterpretableAttribute: - return &evalWatchAttr{ - InterpretableAttribute: inst, - observer: observer, - }, nil - case InterpretableConst: - return &evalWatchConst{ - InterpretableConst: inst, - observer: observer, - }, nil - case InterpretableConstructor: - return &evalWatchConstructor{ - constructor: inst, - observer: observer, - }, nil - default: - return &evalWatch{ - Interpretable: i, - observer: observer, - }, nil - } - } -} - -// decInterruptFolds creates an intepretable decorator which marks comprehensions as interruptable -// where the interrupt state is communicated via a hidden variable on the Activation. -func decInterruptFolds() InterpretableDecorator { - return func(i Interpretable) (Interpretable, error) { - fold, ok := i.(*evalFold) - if !ok { - return i, nil - } - fold.interruptable = true - return fold, nil - } -} - -// decDisableShortcircuits ensures that all branches of an expression will be evaluated, no short-circuiting. -func decDisableShortcircuits() InterpretableDecorator { - return func(i Interpretable) (Interpretable, error) { - switch expr := i.(type) { - case *evalOr: - return &evalExhaustiveOr{ - id: expr.id, - terms: expr.terms, - }, nil - case *evalAnd: - return &evalExhaustiveAnd{ - id: expr.id, - terms: expr.terms, - }, nil - case *evalFold: - expr.exhaustive = true - return expr, nil - case InterpretableAttribute: - cond, isCond := expr.Attr().(*conditionalAttribute) - if isCond { - return &evalExhaustiveConditional{ - id: cond.id, - attr: cond, - adapter: expr.Adapter(), - }, nil - } - } - return i, nil - } -} - -// decOptimize optimizes the program plan by looking for common evaluation patterns and -// conditionally precomputing the result. -// - build list and map values with constant elements. -// - convert 'in' operations to set membership tests if possible. -func decOptimize() InterpretableDecorator { - return func(i Interpretable) (Interpretable, error) { - switch inst := i.(type) { - case *evalList: - return maybeBuildListLiteral(i, inst) - case *evalMap: - return maybeBuildMapLiteral(i, inst) - case InterpretableCall: - if inst.OverloadID() == overloads.InList { - return maybeOptimizeSetMembership(i, inst) - } - if overloads.IsTypeConversionFunction(inst.Function()) { - return maybeOptimizeConstUnary(i, inst) - } - } - return i, nil - } -} - -// decRegexOptimizer compiles regex pattern string constants. -func decRegexOptimizer(regexOptimizations ...*RegexOptimization) InterpretableDecorator { - functionMatchMap := make(map[string]*RegexOptimization) - overloadMatchMap := make(map[string]*RegexOptimization) - for _, m := range regexOptimizations { - functionMatchMap[m.Function] = m - if m.OverloadID != "" { - overloadMatchMap[m.OverloadID] = m - } - } - - return func(i Interpretable) (Interpretable, error) { - call, ok := i.(InterpretableCall) - if !ok { - return i, nil - } - - var matcher *RegexOptimization - var found bool - if call.OverloadID() != "" { - matcher, found = overloadMatchMap[call.OverloadID()] - } - if !found { - matcher, found = functionMatchMap[call.Function()] - } - if !found || matcher.RegexIndex >= len(call.Args()) { - return i, nil - } - args := call.Args() - regexArg := args[matcher.RegexIndex] - regexStr, isConst := regexArg.(InterpretableConst) - if !isConst { - return i, nil - } - pattern, ok := regexStr.Value().(types.String) - if !ok { - return i, nil - } - return matcher.Factory(call, string(pattern)) - } -} - -func maybeOptimizeConstUnary(i Interpretable, call InterpretableCall) (Interpretable, error) { - args := call.Args() - if len(args) != 1 { - return i, nil - } - _, isConst := args[0].(InterpretableConst) - if !isConst { - return i, nil - } - val := call.Eval(EmptyActivation()) - if types.IsError(val) { - return nil, val.(*types.Err) - } - return NewConstValue(call.ID(), val), nil -} - -func maybeBuildListLiteral(i Interpretable, l *evalList) (Interpretable, error) { - for _, elem := range l.elems { - _, isConst := elem.(InterpretableConst) - if !isConst { - return i, nil - } - } - return NewConstValue(l.ID(), l.Eval(EmptyActivation())), nil -} - -func maybeBuildMapLiteral(i Interpretable, mp *evalMap) (Interpretable, error) { - for idx, key := range mp.keys { - _, isConst := key.(InterpretableConst) - if !isConst { - return i, nil - } - _, isConst = mp.vals[idx].(InterpretableConst) - if !isConst { - return i, nil - } - } - return NewConstValue(mp.ID(), mp.Eval(EmptyActivation())), nil -} - -// maybeOptimizeSetMembership may convert an 'in' operation against a list to map key membership -// test if the following conditions are true: -// - the list is a constant with homogeneous element types. -// - the elements are all of primitive type. -func maybeOptimizeSetMembership(i Interpretable, inlist InterpretableCall) (Interpretable, error) { - args := inlist.Args() - lhs := args[0] - rhs := args[1] - l, isConst := rhs.(InterpretableConst) - if !isConst { - return i, nil - } - // When the incoming binary call is flagged with as the InList overload, the value will - // always be convertible to a `traits.Lister` type. - list := l.Value().(traits.Lister) - if list.Size() == types.IntZero { - return NewConstValue(inlist.ID(), types.False), nil - } - it := list.Iterator() - valueSet := make(map[ref.Val]ref.Val) - for it.HasNext() == types.True { - elem := it.Next() - if !types.IsPrimitiveType(elem) || elem.Type() == types.BytesType { - // Note, non-primitive type are not yet supported, and []byte isn't hashable. - return i, nil - } - valueSet[elem] = types.True - switch ev := elem.(type) { - case types.Double: - iv := ev.ConvertToType(types.IntType) - // Ensure that only lossless conversions are added to the set - if !types.IsError(iv) && iv.Equal(ev) == types.True { - valueSet[iv] = types.True - } - // Ensure that only lossless conversions are added to the set - uv := ev.ConvertToType(types.UintType) - if !types.IsError(uv) && uv.Equal(ev) == types.True { - valueSet[uv] = types.True - } - case types.Int: - dv := ev.ConvertToType(types.DoubleType) - if !types.IsError(dv) { - valueSet[dv] = types.True - } - uv := ev.ConvertToType(types.UintType) - if !types.IsError(uv) { - valueSet[uv] = types.True - } - case types.Uint: - dv := ev.ConvertToType(types.DoubleType) - if !types.IsError(dv) { - valueSet[dv] = types.True - } - iv := ev.ConvertToType(types.IntType) - if !types.IsError(iv) { - valueSet[iv] = types.True - } - } - } - return &evalSetMembership{ - inst: inlist, - arg: lhs, - valueSet: valueSet, - }, nil -} diff --git a/vendor/github.com/google/cel-go/interpreter/dispatcher.go b/vendor/github.com/google/cel-go/interpreter/dispatcher.go deleted file mode 100644 index 8f0bdb7b8..000000000 --- a/vendor/github.com/google/cel-go/interpreter/dispatcher.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "fmt" - - "github.com/google/cel-go/common/functions" -) - -// Dispatcher resolves function calls to their appropriate overload. -type Dispatcher interface { - // Add one or more overloads, returning an error if any Overload has the same Overload#Name. - Add(overloads ...*functions.Overload) error - - // FindOverload returns an Overload definition matching the provided name. - FindOverload(overload string) (*functions.Overload, bool) - - // OverloadIds returns the set of all overload identifiers configured for dispatch. - OverloadIds() []string -} - -// NewDispatcher returns an empty Dispatcher instance. -func NewDispatcher() Dispatcher { - return &defaultDispatcher{ - overloads: make(map[string]*functions.Overload)} -} - -// ExtendDispatcher returns a Dispatcher which inherits the overloads of its parent, and -// provides an isolation layer between built-ins and extension functions which is useful -// for forward compatibility. -func ExtendDispatcher(parent Dispatcher) Dispatcher { - return &defaultDispatcher{ - parent: parent, - overloads: make(map[string]*functions.Overload)} -} - -// overloadMap helper type for indexing overloads by function name. -type overloadMap map[string]*functions.Overload - -// defaultDispatcher struct which contains an overload map. -type defaultDispatcher struct { - parent Dispatcher - overloads overloadMap -} - -// Add implements the Dispatcher.Add interface method. -func (d *defaultDispatcher) Add(overloads ...*functions.Overload) error { - for _, o := range overloads { - // add the overload unless an overload of the same name has already been provided. - if _, found := d.overloads[o.Operator]; found { - return fmt.Errorf("overload already exists '%s'", o.Operator) - } - // index the overload by function name. - d.overloads[o.Operator] = o - } - return nil -} - -// FindOverload implements the Dispatcher.FindOverload interface method. -func (d *defaultDispatcher) FindOverload(overload string) (*functions.Overload, bool) { - o, found := d.overloads[overload] - // Attempt to dispatch to an overload defined in the parent. - if !found && d.parent != nil { - return d.parent.FindOverload(overload) - } - return o, found -} - -// OverloadIds implements the Dispatcher interface method. -func (d *defaultDispatcher) OverloadIds() []string { - i := 0 - overloads := make([]string, len(d.overloads)) - for name := range d.overloads { - overloads[i] = name - i++ - } - if d.parent == nil { - return overloads - } - parentOverloads := d.parent.OverloadIds() - for _, pName := range parentOverloads { - if _, found := d.overloads[pName]; !found { - overloads = append(overloads, pName) - } - } - return overloads -} diff --git a/vendor/github.com/google/cel-go/interpreter/evalstate.go b/vendor/github.com/google/cel-go/interpreter/evalstate.go deleted file mode 100644 index 4bdd1fdc7..000000000 --- a/vendor/github.com/google/cel-go/interpreter/evalstate.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "github.com/google/cel-go/common/types/ref" -) - -// EvalState tracks the values associated with expression ids during execution. -type EvalState interface { - // IDs returns the list of ids with recorded values. - IDs() []int64 - - // Value returns the observed value of the given expression id if found, and a nil false - // result if not. - Value(int64) (ref.Val, bool) - - // SetValue sets the observed value of the expression id. - SetValue(int64, ref.Val) - - // Reset clears the previously recorded expression values. - Reset() -} - -// evalState permits the mutation of evaluation state for a given expression id. -type evalState struct { - values map[int64]ref.Val -} - -// NewEvalState returns an EvalState instanced used to observe the intermediate -// evaluations of an expression. -func NewEvalState() EvalState { - return &evalState{ - values: make(map[int64]ref.Val), - } -} - -// IDs implements the EvalState interface method. -func (s *evalState) IDs() []int64 { - var ids []int64 - for k, v := range s.values { - if v != nil { - ids = append(ids, k) - } - } - return ids -} - -// Value is an implementation of the EvalState interface method. -func (s *evalState) Value(exprID int64) (ref.Val, bool) { - val, found := s.values[exprID] - return val, found -} - -// SetValue is an implementation of the EvalState interface method. -func (s *evalState) SetValue(exprID int64, val ref.Val) { - if val == nil { - delete(s.values, exprID) - } else { - s.values[exprID] = val - } -} - -// Reset implements the EvalState interface method. -func (s *evalState) Reset() { - s.values = map[int64]ref.Val{} -} diff --git a/vendor/github.com/google/cel-go/interpreter/functions/BUILD.bazel b/vendor/github.com/google/cel-go/interpreter/functions/BUILD.bazel deleted file mode 100644 index 4a80c3ea0..000000000 --- a/vendor/github.com/google/cel-go/interpreter/functions/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "functions.go", - ], - importpath = "github.com/google/cel-go/interpreter/functions", - deps = [ - "//common/functions:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/interpreter/functions/functions.go b/vendor/github.com/google/cel-go/interpreter/functions/functions.go deleted file mode 100644 index 21ffb6924..000000000 --- a/vendor/github.com/google/cel-go/interpreter/functions/functions.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package functions defines the standard builtin functions supported by the -// interpreter and as declared within the checker#StandardDeclarations. -package functions - -import fn "github.com/google/cel-go/common/functions" - -// Overload defines a named overload of a function, indicating an operand trait -// which must be present on the first argument to the overload as well as one -// of either a unary, binary, or function implementation. -// -// The majority of operators within the expression language are unary or binary -// and the specializations simplify the call contract for implementers of -// types with operator overloads. Any added complexity is assumed to be handled -// by the generic FunctionOp. -type Overload = fn.Overload - -// UnaryOp is a function that takes a single value and produces an output. -type UnaryOp = fn.UnaryOp - -// BinaryOp is a function that takes two values and produces an output. -type BinaryOp = fn.BinaryOp - -// FunctionOp is a function with accepts zero or more arguments and produces -// a value or error as a result. -type FunctionOp = fn.FunctionOp diff --git a/vendor/github.com/google/cel-go/interpreter/interpretable.go b/vendor/github.com/google/cel-go/interpreter/interpretable.go deleted file mode 100644 index 96b5a8ffc..000000000 --- a/vendor/github.com/google/cel-go/interpreter/interpretable.go +++ /dev/null @@ -1,1473 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "fmt" - "sync" - - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// Interpretable can accept a given Activation and produce a value along with -// an accompanying EvalState which can be used to inspect whether additional -// data might be necessary to complete the evaluation. -type Interpretable interface { - // ID value corresponding to the expression node. - ID() int64 - - // Eval an Activation to produce an output. - Eval(activation Activation) ref.Val -} - -// InterpretableConst interface for tracking whether the Interpretable is a constant value. -type InterpretableConst interface { - Interpretable - - // Value returns the constant value of the instruction. - Value() ref.Val -} - -// InterpretableAttribute interface for tracking whether the Interpretable is an attribute. -type InterpretableAttribute interface { - Interpretable - - // Attr returns the Attribute value. - Attr() Attribute - - // Adapter returns the type adapter to be used for adapting resolved Attribute values. - Adapter() types.Adapter - - // AddQualifier proxies the Attribute.AddQualifier method. - // - // Note, this method may mutate the current attribute state. If the desire is to clone the - // Attribute, the Attribute should first be copied before adding the qualifier. Attributes - // are not copyable by default, so this is a capable that would need to be added to the - // AttributeFactory or specifically to the underlying Attribute implementation. - AddQualifier(Qualifier) (Attribute, error) - - // Qualify replicates the Attribute.Qualify method to permit extension and interception - // of object qualification. - Qualify(vars Activation, obj any) (any, error) - - // QualifyIfPresent qualifies the object if the qualifier is declared or defined on the object. - // The 'presenceOnly' flag indicates that the value is not necessary, just a boolean status as - // to whether the qualifier is present. - QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) - - // IsOptional indicates whether the resulting value is an optional type. - IsOptional() bool - - // Resolve returns the value of the Attribute given the current Activation. - Resolve(Activation) (any, error) -} - -// InterpretableCall interface for inspecting Interpretable instructions related to function calls. -type InterpretableCall interface { - Interpretable - - // Function returns the function name as it appears in text or mangled operator name as it - // appears in the operators.go file. - Function() string - - // OverloadID returns the overload id associated with the function specialization. - // Overload ids are stable across language boundaries and can be treated as synonymous with a - // unique function signature. - OverloadID() string - - // Args returns the normalized arguments to the function overload. - // For receiver-style functions, the receiver target is arg 0. - Args() []Interpretable -} - -// InterpretableConstructor interface for inspecting Interpretable instructions that initialize a list, map -// or struct. -type InterpretableConstructor interface { - Interpretable - - // InitVals returns all the list elements, map key and values or struct field values. - InitVals() []Interpretable - - // Type returns the type constructed. - Type() ref.Type -} - -// ObservableInterpretable is an Interpretable which supports stateful observation, such as tracing -// or cost-tracking. -type ObservableInterpretable struct { - Interpretable - observers []StatefulObserver -} - -// ID implements the Interpretable method to get the expression id associated with the step. -func (oi *ObservableInterpretable) ID() int64 { - return oi.Interpretable.ID() -} - -// Eval proxies to the ObserveEval method while invoking a no-op callback to report the observations. -func (oi *ObservableInterpretable) Eval(vars Activation) ref.Val { - return oi.ObserveEval(vars, func(any) {}) -} - -// ObserveEval evaluates an interpretable and performs per-evaluation state-tracking. -// -// This method is concurrency safe and the expectation is that the observer function will use -// a switch statement to determine the type of the state which has been reported back from the call. -func (oi *ObservableInterpretable) ObserveEval(vars Activation, observer func(any)) ref.Val { - var err error - // Initialize the state needed for the observers to function. - for _, obs := range oi.observers { - vars, err = obs.InitState(vars) - if err != nil { - return types.WrapErr(err) - } - // Provide an initial reference to the state to ensure state is available - // even in cases of interrupting errors generated during evaluation. - observer(obs.GetState(vars)) - } - result := oi.Interpretable.Eval(vars) - // Get the state which needs to be reported back as having been observed. - for _, obs := range oi.observers { - observer(obs.GetState(vars)) - } - return result -} - -// Core Interpretable implementations used during the program planning phase. - -type evalTestOnly struct { - id int64 - InterpretableAttribute -} - -// ID implements the Interpretable interface method. -func (test *evalTestOnly) ID() int64 { - return test.id -} - -// Eval implements the Interpretable interface method. -func (test *evalTestOnly) Eval(ctx Activation) ref.Val { - val, err := test.Resolve(ctx) - // Return an error if the resolve step fails - if err != nil { - return types.LabelErrNode(test.id, types.WrapErr(err)) - } - if optVal, isOpt := val.(*types.Optional); isOpt { - return types.Bool(optVal.HasValue()) - } - return test.Adapter().NativeToValue(val) -} - -// AddQualifier appends a qualifier that will always and only perform a presence test. -func (test *evalTestOnly) AddQualifier(q Qualifier) (Attribute, error) { - cq, ok := q.(ConstantQualifier) - if !ok { - return nil, fmt.Errorf("test only expressions must have constant qualifiers: %v", q) - } - return test.InterpretableAttribute.AddQualifier(&testOnlyQualifier{ConstantQualifier: cq}) -} - -type testOnlyQualifier struct { - ConstantQualifier -} - -// Qualify determines whether the test-only qualifier is present on the input object. -func (q *testOnlyQualifier) Qualify(vars Activation, obj any) (any, error) { - out, present, err := q.ConstantQualifier.QualifyIfPresent(vars, obj, true) - if err != nil { - return nil, err - } - if unk, isUnk := out.(types.Unknown); isUnk { - return unk, nil - } - return present, nil -} - -// QualifyIfPresent returns whether the target field in the test-only expression is present. -func (q *testOnlyQualifier) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - // Only ever test for presence. - return q.ConstantQualifier.QualifyIfPresent(vars, obj, true) -} - -// QualifierValueEquals determines whether the test-only constant qualifier equals the input value. -func (q *testOnlyQualifier) QualifierValueEquals(value any) bool { - // The input qualifier will always be of type string - return q.ConstantQualifier.Value().Value() == value -} - -// NewConstValue creates a new constant valued Interpretable. -func NewConstValue(id int64, val ref.Val) InterpretableConst { - return &evalConst{ - id: id, - val: val, - } -} - -type evalConst struct { - id int64 - val ref.Val -} - -// ID implements the Interpretable interface method. -func (cons *evalConst) ID() int64 { - return cons.id -} - -// Eval implements the Interpretable interface method. -func (cons *evalConst) Eval(ctx Activation) ref.Val { - return cons.val -} - -// Value implements the InterpretableConst interface method. -func (cons *evalConst) Value() ref.Val { - return cons.val -} - -type evalOr struct { - id int64 - terms []Interpretable -} - -// ID implements the Interpretable interface method. -func (or *evalOr) ID() int64 { - return or.id -} - -// Eval implements the Interpretable interface method. -func (or *evalOr) Eval(ctx Activation) ref.Val { - var err ref.Val = nil - var unk *types.Unknown - for _, term := range or.terms { - val := term.Eval(ctx) - boolVal, ok := val.(types.Bool) - // short-circuit on true. - if ok && boolVal == types.True { - return types.True - } - if !ok { - isUnk := false - unk, isUnk = types.MaybeMergeUnknowns(val, unk) - if !isUnk && err == nil { - if types.IsError(val) { - err = val - } else { - err = types.MaybeNoSuchOverloadErr(val) - } - err = types.LabelErrNode(or.id, err) - } - } - } - if unk != nil { - return unk - } - if err != nil { - return err - } - return types.False -} - -type evalAnd struct { - id int64 - terms []Interpretable -} - -// ID implements the Interpretable interface method. -func (and *evalAnd) ID() int64 { - return and.id -} - -// Eval implements the Interpretable interface method. -func (and *evalAnd) Eval(ctx Activation) ref.Val { - var err ref.Val = nil - var unk *types.Unknown - for _, term := range and.terms { - val := term.Eval(ctx) - boolVal, ok := val.(types.Bool) - // short-circuit on false. - if ok && boolVal == types.False { - return types.False - } - if !ok { - isUnk := false - unk, isUnk = types.MaybeMergeUnknowns(val, unk) - if !isUnk && err == nil { - if types.IsError(val) { - err = val - } else { - err = types.MaybeNoSuchOverloadErr(val) - } - err = types.LabelErrNode(and.id, err) - } - } - } - if unk != nil { - return unk - } - if err != nil { - return err - } - return types.True -} - -type evalEq struct { - id int64 - lhs Interpretable - rhs Interpretable -} - -// ID implements the Interpretable interface method. -func (eq *evalEq) ID() int64 { - return eq.id -} - -// Eval implements the Interpretable interface method. -func (eq *evalEq) Eval(ctx Activation) ref.Val { - lVal := eq.lhs.Eval(ctx) - rVal := eq.rhs.Eval(ctx) - if types.IsUnknownOrError(lVal) { - return lVal - } - if types.IsUnknownOrError(rVal) { - return rVal - } - return types.Equal(lVal, rVal) -} - -// Function implements the InterpretableCall interface method. -func (*evalEq) Function() string { - return operators.Equals -} - -// OverloadID implements the InterpretableCall interface method. -func (*evalEq) OverloadID() string { - return overloads.Equals -} - -// Args implements the InterpretableCall interface method. -func (eq *evalEq) Args() []Interpretable { - return []Interpretable{eq.lhs, eq.rhs} -} - -type evalNe struct { - id int64 - lhs Interpretable - rhs Interpretable -} - -// ID implements the Interpretable interface method. -func (ne *evalNe) ID() int64 { - return ne.id -} - -// Eval implements the Interpretable interface method. -func (ne *evalNe) Eval(ctx Activation) ref.Val { - lVal := ne.lhs.Eval(ctx) - rVal := ne.rhs.Eval(ctx) - if types.IsUnknownOrError(lVal) { - return lVal - } - if types.IsUnknownOrError(rVal) { - return rVal - } - return types.Bool(types.Equal(lVal, rVal) != types.True) -} - -// Function implements the InterpretableCall interface method. -func (*evalNe) Function() string { - return operators.NotEquals -} - -// OverloadID implements the InterpretableCall interface method. -func (*evalNe) OverloadID() string { - return overloads.NotEquals -} - -// Args implements the InterpretableCall interface method. -func (ne *evalNe) Args() []Interpretable { - return []Interpretable{ne.lhs, ne.rhs} -} - -type evalZeroArity struct { - id int64 - function string - overload string - impl functions.FunctionOp -} - -// ID implements the Interpretable interface method. -func (zero *evalZeroArity) ID() int64 { - return zero.id -} - -// Eval implements the Interpretable interface method. -func (zero *evalZeroArity) Eval(ctx Activation) ref.Val { - return types.LabelErrNode(zero.id, zero.impl()) -} - -// Function implements the InterpretableCall interface method. -func (zero *evalZeroArity) Function() string { - return zero.function -} - -// OverloadID implements the InterpretableCall interface method. -func (zero *evalZeroArity) OverloadID() string { - return zero.overload -} - -// Args returns the argument to the unary function. -func (zero *evalZeroArity) Args() []Interpretable { - return []Interpretable{} -} - -type evalUnary struct { - id int64 - function string - overload string - arg Interpretable - trait int - impl functions.UnaryOp - nonStrict bool -} - -// ID implements the Interpretable interface method. -func (un *evalUnary) ID() int64 { - return un.id -} - -// Eval implements the Interpretable interface method. -func (un *evalUnary) Eval(ctx Activation) ref.Val { - argVal := un.arg.Eval(ctx) - // Early return if the argument to the function is unknown or error. - strict := !un.nonStrict - if strict && types.IsUnknownOrError(argVal) { - return argVal - } - // If the implementation is bound and the argument value has the right traits required to - // invoke it, then call the implementation. - if un.impl != nil && (un.trait == 0 || (!strict && types.IsUnknownOrError(argVal)) || argVal.Type().HasTrait(un.trait)) { - return types.LabelErrNode(un.id, un.impl(argVal)) - } - // Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the - // operand (arg0). - if argVal.Type().HasTrait(traits.ReceiverType) { - return types.LabelErrNode(un.id, argVal.(traits.Receiver).Receive(un.function, un.overload, []ref.Val{})) - } - return types.NewErrWithNodeID(un.id, "no such overload: %s", un.function) -} - -// Function implements the InterpretableCall interface method. -func (un *evalUnary) Function() string { - return un.function -} - -// OverloadID implements the InterpretableCall interface method. -func (un *evalUnary) OverloadID() string { - return un.overload -} - -// Args returns the argument to the unary function. -func (un *evalUnary) Args() []Interpretable { - return []Interpretable{un.arg} -} - -type evalBinary struct { - id int64 - function string - overload string - lhs Interpretable - rhs Interpretable - trait int - impl functions.BinaryOp - nonStrict bool -} - -// ID implements the Interpretable interface method. -func (bin *evalBinary) ID() int64 { - return bin.id -} - -// Eval implements the Interpretable interface method. -func (bin *evalBinary) Eval(ctx Activation) ref.Val { - lVal := bin.lhs.Eval(ctx) - rVal := bin.rhs.Eval(ctx) - // Early return if any argument to the function is unknown or error. - strict := !bin.nonStrict - if strict { - if types.IsUnknownOrError(lVal) { - return lVal - } - if types.IsUnknownOrError(rVal) { - return rVal - } - } - // If the implementation is bound and the argument value has the right traits required to - // invoke it, then call the implementation. - if bin.impl != nil && (bin.trait == 0 || (!strict && types.IsUnknownOrError(lVal)) || lVal.Type().HasTrait(bin.trait)) { - return types.LabelErrNode(bin.id, bin.impl(lVal, rVal)) - } - // Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the - // operand (arg0). - if lVal.Type().HasTrait(traits.ReceiverType) { - return types.LabelErrNode(bin.id, lVal.(traits.Receiver).Receive(bin.function, bin.overload, []ref.Val{rVal})) - } - return types.NewErrWithNodeID(bin.id, "no such overload: %s", bin.function) -} - -// Function implements the InterpretableCall interface method. -func (bin *evalBinary) Function() string { - return bin.function -} - -// OverloadID implements the InterpretableCall interface method. -func (bin *evalBinary) OverloadID() string { - return bin.overload -} - -// Args returns the argument to the unary function. -func (bin *evalBinary) Args() []Interpretable { - return []Interpretable{bin.lhs, bin.rhs} -} - -type evalVarArgs struct { - id int64 - function string - overload string - args []Interpretable - trait int - impl functions.FunctionOp - nonStrict bool -} - -// NewCall creates a new call Interpretable. -func NewCall(id int64, function, overload string, args []Interpretable, impl functions.FunctionOp) InterpretableCall { - return &evalVarArgs{ - id: id, - function: function, - overload: overload, - args: args, - impl: impl, - } -} - -// ID implements the Interpretable interface method. -func (fn *evalVarArgs) ID() int64 { - return fn.id -} - -// Eval implements the Interpretable interface method. -func (fn *evalVarArgs) Eval(ctx Activation) ref.Val { - argVals := make([]ref.Val, len(fn.args)) - // Early return if any argument to the function is unknown or error. - strict := !fn.nonStrict - for i, arg := range fn.args { - argVals[i] = arg.Eval(ctx) - if strict && types.IsUnknownOrError(argVals[i]) { - return argVals[i] - } - } - // If the implementation is bound and the argument value has the right traits required to - // invoke it, then call the implementation. - arg0 := argVals[0] - if fn.impl != nil && (fn.trait == 0 || (!strict && types.IsUnknownOrError(arg0)) || arg0.Type().HasTrait(fn.trait)) { - return types.LabelErrNode(fn.id, fn.impl(argVals...)) - } - // Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the - // operand (arg0). - if arg0.Type().HasTrait(traits.ReceiverType) { - return types.LabelErrNode(fn.id, arg0.(traits.Receiver).Receive(fn.function, fn.overload, argVals[1:])) - } - return types.NewErrWithNodeID(fn.id, "no such overload: %s %d", fn.function, fn.id) -} - -// Function implements the InterpretableCall interface method. -func (fn *evalVarArgs) Function() string { - return fn.function -} - -// OverloadID implements the InterpretableCall interface method. -func (fn *evalVarArgs) OverloadID() string { - return fn.overload -} - -// Args returns the argument to the unary function. -func (fn *evalVarArgs) Args() []Interpretable { - return fn.args -} - -type evalList struct { - id int64 - elems []Interpretable - optionals []bool - hasOptionals bool - adapter types.Adapter -} - -// ID implements the Interpretable interface method. -func (l *evalList) ID() int64 { - return l.id -} - -// Eval implements the Interpretable interface method. -func (l *evalList) Eval(ctx Activation) ref.Val { - elemVals := make([]ref.Val, 0, len(l.elems)) - // If any argument is unknown or error early terminate. - for i, elem := range l.elems { - elemVal := elem.Eval(ctx) - if types.IsUnknownOrError(elemVal) { - return elemVal - } - if l.hasOptionals && l.optionals[i] { - optVal, ok := elemVal.(*types.Optional) - if !ok { - return types.LabelErrNode(l.id, invalidOptionalElementInit(elemVal)) - } - if !optVal.HasValue() { - continue - } - elemVal = optVal.GetValue() - } - elemVals = append(elemVals, elemVal) - } - return l.adapter.NativeToValue(elemVals) -} - -func (l *evalList) InitVals() []Interpretable { - return l.elems -} - -func (l *evalList) Type() ref.Type { - return types.ListType -} - -type evalMap struct { - id int64 - keys []Interpretable - vals []Interpretable - optionals []bool - hasOptionals bool - adapter types.Adapter -} - -// ID implements the Interpretable interface method. -func (m *evalMap) ID() int64 { - return m.id -} - -// Eval implements the Interpretable interface method. -func (m *evalMap) Eval(ctx Activation) ref.Val { - entries := make(map[ref.Val]ref.Val) - // If any argument is unknown or error early terminate. - for i, key := range m.keys { - keyVal := key.Eval(ctx) - if types.IsUnknownOrError(keyVal) { - return keyVal - } - valVal := m.vals[i].Eval(ctx) - if types.IsUnknownOrError(valVal) { - return valVal - } - if m.hasOptionals && m.optionals[i] { - optVal, ok := valVal.(*types.Optional) - if !ok { - return types.LabelErrNode(m.id, invalidOptionalEntryInit(keyVal, valVal)) - } - if !optVal.HasValue() { - delete(entries, keyVal) - continue - } - valVal = optVal.GetValue() - } - entries[keyVal] = valVal - } - return m.adapter.NativeToValue(entries) -} - -func (m *evalMap) InitVals() []Interpretable { - if len(m.keys) != len(m.vals) { - return nil - } - result := make([]Interpretable, len(m.keys)+len(m.vals)) - idx := 0 - for i, k := range m.keys { - v := m.vals[i] - result[idx] = k - idx++ - result[idx] = v - idx++ - } - return result -} - -func (m *evalMap) Type() ref.Type { - return types.MapType -} - -type evalObj struct { - id int64 - typeName string - fields []string - vals []Interpretable - optionals []bool - hasOptionals bool - provider types.Provider -} - -// ID implements the Interpretable interface method. -func (o *evalObj) ID() int64 { - return o.id -} - -// Eval implements the Interpretable interface method. -func (o *evalObj) Eval(ctx Activation) ref.Val { - fieldVals := make(map[string]ref.Val) - // If any argument is unknown or error early terminate. - for i, field := range o.fields { - val := o.vals[i].Eval(ctx) - if types.IsUnknownOrError(val) { - return val - } - if o.hasOptionals && o.optionals[i] { - optVal, ok := val.(*types.Optional) - if !ok { - return types.LabelErrNode(o.id, invalidOptionalEntryInit(field, val)) - } - if !optVal.HasValue() { - delete(fieldVals, field) - continue - } - val = optVal.GetValue() - } - fieldVals[field] = val - } - return types.LabelErrNode(o.id, o.provider.NewValue(o.typeName, fieldVals)) -} - -// InitVals implements the InterpretableConstructor interface method. -func (o *evalObj) InitVals() []Interpretable { - return o.vals -} - -// Type implements the InterpretableConstructor interface method. -func (o *evalObj) Type() ref.Type { - return types.NewObjectType(o.typeName) -} - -type evalFold struct { - id int64 - accuVar string - iterVar string - iterVar2 string - iterRange Interpretable - accu Interpretable - cond Interpretable - step Interpretable - result Interpretable - adapter types.Adapter - - // note an exhaustive fold will ensure that all branches are evaluated - // when using mutable values, these branches will mutate the final result - // rather than make a throw-away computation. - exhaustive bool - interruptable bool -} - -// ID implements the Interpretable interface method. -func (fold *evalFold) ID() int64 { - return fold.id -} - -// Eval implements the Interpretable interface method. -func (fold *evalFold) Eval(ctx Activation) ref.Val { - // Initialize the folder interface - f := newFolder(fold, ctx) - defer releaseFolder(f) - - foldRange := fold.iterRange.Eval(ctx) - if types.IsUnknownOrError(foldRange) { - return foldRange - } - if fold.iterVar2 != "" { - var foldable traits.Foldable - switch r := foldRange.(type) { - case traits.Mapper: - foldable = types.ToFoldableMap(r) - case traits.Lister: - foldable = types.ToFoldableList(r) - default: - return types.NewErrWithNodeID(fold.ID(), "unsupported comprehension range type: %T", foldRange) - } - foldable.Fold(f) - return f.evalResult() - } - - if !foldRange.Type().HasTrait(traits.IterableType) { - return types.ValOrErr(foldRange, "got '%T', expected iterable type", foldRange) - } - iterable := foldRange.(traits.Iterable) - return f.foldIterable(iterable) -} - -// Optional Interpretable implementations that specialize, subsume, or extend the core evaluation -// plan via decorators. - -// evalSetMembership is an Interpretable implementation which tests whether an input value -// exists within the set of map keys used to model a set. -type evalSetMembership struct { - inst Interpretable - arg Interpretable - valueSet map[ref.Val]ref.Val -} - -// ID implements the Interpretable interface method. -func (e *evalSetMembership) ID() int64 { - return e.inst.ID() -} - -// Eval implements the Interpretable interface method. -func (e *evalSetMembership) Eval(ctx Activation) ref.Val { - val := e.arg.Eval(ctx) - if types.IsUnknownOrError(val) { - return val - } - if ret, found := e.valueSet[val]; found { - return ret - } - return types.False -} - -// evalWatch is an Interpretable implementation that wraps the execution of a given -// expression so that it may observe the computed value and send it to an observer. -type evalWatch struct { - Interpretable - observer EvalObserver -} - -// Eval implements the Interpretable interface method. -func (e *evalWatch) Eval(vars Activation) ref.Val { - val := e.Interpretable.Eval(vars) - e.observer(vars, e.ID(), e.Interpretable, val) - return val -} - -// evalWatchAttr describes a watcher of an InterpretableAttribute Interpretable. -// -// Since the watcher may be selected against at a later stage in program planning, the watcher -// must implement the InterpretableAttribute interface by proxy. -type evalWatchAttr struct { - InterpretableAttribute - observer EvalObserver -} - -// AddQualifier creates a wrapper over the incoming qualifier which observes the qualification -// result. -func (e *evalWatchAttr) AddQualifier(q Qualifier) (Attribute, error) { - switch qual := q.(type) { - // By default, the qualifier is either a constant or an attribute - // There may be some custom cases where the attribute is neither. - case ConstantQualifier: - // Expose a method to test whether the qualifier matches the input pattern. - q = &evalWatchConstQual{ - ConstantQualifier: qual, - observer: e.observer, - adapter: e.Adapter(), - } - case *evalWatchAttr: - // Unwrap the evalWatchAttr since the observation will be applied during Qualify or - // QualifyIfPresent rather than Eval. - q = &evalWatchAttrQual{ - Attribute: qual.InterpretableAttribute, - observer: e.observer, - adapter: e.Adapter(), - } - case Attribute: - // Expose methods which intercept the qualification prior to being applied as a qualifier. - // Using this interface ensures that the qualifier is converted to a constant value one - // time during attribute pattern matching as the method embeds the Attribute interface - // needed to trip the conversion to a constant. - q = &evalWatchAttrQual{ - Attribute: qual, - observer: e.observer, - adapter: e.Adapter(), - } - default: - // This is likely a custom qualifier type. - q = &evalWatchQual{ - Qualifier: qual, - observer: e.observer, - adapter: e.Adapter(), - } - } - _, err := e.InterpretableAttribute.AddQualifier(q) - return e, err -} - -// Eval implements the Interpretable interface method. -func (e *evalWatchAttr) Eval(vars Activation) ref.Val { - val := e.InterpretableAttribute.Eval(vars) - e.observer(vars, e.ID(), e.InterpretableAttribute, val) - return val -} - -// evalWatchConstQual observes the qualification of an object using a constant boolean, int, -// string, or uint. -type evalWatchConstQual struct { - ConstantQualifier - observer EvalObserver - adapter types.Adapter -} - -// Qualify observes the qualification of a object via a constant boolean, int, string, or uint. -func (e *evalWatchConstQual) Qualify(vars Activation, obj any) (any, error) { - out, err := e.ConstantQualifier.Qualify(vars, obj) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else { - val = e.adapter.NativeToValue(out) - } - e.observer(vars, e.ID(), e.ConstantQualifier, val) - return out, err -} - -// QualifyIfPresent conditionally qualifies the variable and only records a value if one is present. -func (e *evalWatchConstQual) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - out, present, err := e.ConstantQualifier.QualifyIfPresent(vars, obj, presenceOnly) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else if out != nil { - val = e.adapter.NativeToValue(out) - } else if presenceOnly { - val = types.Bool(present) - } - if present || presenceOnly { - e.observer(vars, e.ID(), e.ConstantQualifier, val) - } - return out, present, err -} - -// QualifierValueEquals tests whether the incoming value is equal to the qualifying constant. -func (e *evalWatchConstQual) QualifierValueEquals(value any) bool { - qve, ok := e.ConstantQualifier.(qualifierValueEquator) - return ok && qve.QualifierValueEquals(value) -} - -// evalWatchAttrQual observes the qualification of an object by a value computed at runtime. -type evalWatchAttrQual struct { - Attribute - observer EvalObserver - adapter ref.TypeAdapter -} - -// Qualify observes the qualification of a object via a value computed at runtime. -func (e *evalWatchAttrQual) Qualify(vars Activation, obj any) (any, error) { - out, err := e.Attribute.Qualify(vars, obj) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else { - val = e.adapter.NativeToValue(out) - } - e.observer(vars, e.ID(), e.Attribute, val) - return out, err -} - -// QualifyIfPresent conditionally qualifies the variable and only records a value if one is present. -func (e *evalWatchAttrQual) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - out, present, err := e.Attribute.QualifyIfPresent(vars, obj, presenceOnly) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else if out != nil { - val = e.adapter.NativeToValue(out) - } else if presenceOnly { - val = types.Bool(present) - } - if present || presenceOnly { - e.observer(vars, e.ID(), e.Attribute, val) - } - return out, present, err -} - -// evalWatchQual observes the qualification of an object by a value computed at runtime. -type evalWatchQual struct { - Qualifier - observer EvalObserver - adapter types.Adapter -} - -// Qualify observes the qualification of a object via a value computed at runtime. -func (e *evalWatchQual) Qualify(vars Activation, obj any) (any, error) { - out, err := e.Qualifier.Qualify(vars, obj) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else { - val = e.adapter.NativeToValue(out) - } - e.observer(vars, e.ID(), e.Qualifier, val) - return out, err -} - -// QualifyIfPresent conditionally qualifies the variable and only records a value if one is present. -func (e *evalWatchQual) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - out, present, err := e.Qualifier.QualifyIfPresent(vars, obj, presenceOnly) - var val ref.Val - if err != nil { - val = types.LabelErrNode(e.ID(), types.WrapErr(err)) - } else if out != nil { - val = e.adapter.NativeToValue(out) - } else if presenceOnly { - val = types.Bool(present) - } - if present || presenceOnly { - e.observer(vars, e.ID(), e.Qualifier, val) - } - return out, present, err -} - -// evalWatchConst describes a watcher of an instConst Interpretable. -type evalWatchConst struct { - InterpretableConst - observer EvalObserver -} - -// Eval implements the Interpretable interface method. -func (e *evalWatchConst) Eval(vars Activation) ref.Val { - val := e.Value() - e.observer(vars, e.ID(), e.InterpretableConst, val) - return val -} - -// evalExhaustiveOr is just like evalOr, but does not short-circuit argument evaluation. -type evalExhaustiveOr struct { - id int64 - terms []Interpretable -} - -// ID implements the Interpretable interface method. -func (or *evalExhaustiveOr) ID() int64 { - return or.id -} - -// Eval implements the Interpretable interface method. -func (or *evalExhaustiveOr) Eval(ctx Activation) ref.Val { - var err ref.Val = nil - var unk *types.Unknown - isTrue := false - for _, term := range or.terms { - val := term.Eval(ctx) - boolVal, ok := val.(types.Bool) - // flag the result as true - if ok && boolVal == types.True { - isTrue = true - } - if !ok && !isTrue { - isUnk := false - unk, isUnk = types.MaybeMergeUnknowns(val, unk) - if !isUnk && err == nil { - if types.IsError(val) { - err = val - } else { - err = types.MaybeNoSuchOverloadErr(val) - } - } - } - } - if isTrue { - return types.True - } - if unk != nil { - return unk - } - if err != nil { - return err - } - return types.False -} - -// evalExhaustiveAnd is just like evalAnd, but does not short-circuit argument evaluation. -type evalExhaustiveAnd struct { - id int64 - terms []Interpretable -} - -// ID implements the Interpretable interface method. -func (and *evalExhaustiveAnd) ID() int64 { - return and.id -} - -// Eval implements the Interpretable interface method. -func (and *evalExhaustiveAnd) Eval(ctx Activation) ref.Val { - var err ref.Val = nil - var unk *types.Unknown - isFalse := false - for _, term := range and.terms { - val := term.Eval(ctx) - boolVal, ok := val.(types.Bool) - // short-circuit on false. - if ok && boolVal == types.False { - isFalse = true - } - if !ok && !isFalse { - isUnk := false - unk, isUnk = types.MaybeMergeUnknowns(val, unk) - if !isUnk && err == nil { - if types.IsError(val) { - err = val - } else { - err = types.MaybeNoSuchOverloadErr(val) - } - } - } - } - if isFalse { - return types.False - } - if unk != nil { - return unk - } - if err != nil { - return err - } - return types.True -} - -// evalExhaustiveConditional is like evalConditional, but does not short-circuit argument -// evaluation. -type evalExhaustiveConditional struct { - id int64 - adapter types.Adapter - attr *conditionalAttribute -} - -// ID implements the Interpretable interface method. -func (cond *evalExhaustiveConditional) ID() int64 { - return cond.id -} - -// Eval implements the Interpretable interface method. -func (cond *evalExhaustiveConditional) Eval(ctx Activation) ref.Val { - cVal := cond.attr.expr.Eval(ctx) - tVal, tErr := cond.attr.truthy.Resolve(ctx) - fVal, fErr := cond.attr.falsy.Resolve(ctx) - cBool, ok := cVal.(types.Bool) - if !ok { - return types.ValOrErr(cVal, "no such overload") - } - if cBool { - if tErr != nil { - return types.LabelErrNode(cond.id, types.WrapErr(tErr)) - } - return cond.adapter.NativeToValue(tVal) - } - if fErr != nil { - return types.LabelErrNode(cond.id, types.WrapErr(fErr)) - } - return cond.adapter.NativeToValue(fVal) -} - -// evalAttr evaluates an Attribute value. -type evalAttr struct { - adapter types.Adapter - attr Attribute - optional bool -} - -var _ InterpretableAttribute = &evalAttr{} - -// ID of the attribute instruction. -func (a *evalAttr) ID() int64 { - return a.attr.ID() -} - -// AddQualifier implements the InterpretableAttribute interface method. -func (a *evalAttr) AddQualifier(qual Qualifier) (Attribute, error) { - attr, err := a.attr.AddQualifier(qual) - a.attr = attr - return attr, err -} - -// Attr implements the InterpretableAttribute interface method. -func (a *evalAttr) Attr() Attribute { - return a.attr -} - -// Adapter implements the InterpretableAttribute interface method. -func (a *evalAttr) Adapter() types.Adapter { - return a.adapter -} - -// Eval implements the Interpretable interface method. -func (a *evalAttr) Eval(ctx Activation) ref.Val { - v, err := a.attr.Resolve(ctx) - if err != nil { - return types.LabelErrNode(a.ID(), types.WrapErr(err)) - } - return a.adapter.NativeToValue(v) -} - -// Qualify proxies to the Attribute's Qualify method. -func (a *evalAttr) Qualify(vars Activation, obj any) (any, error) { - return a.attr.Qualify(vars, obj) -} - -// QualifyIfPresent proxies to the Attribute's QualifyIfPresent method. -func (a *evalAttr) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) { - return a.attr.QualifyIfPresent(vars, obj, presenceOnly) -} - -func (a *evalAttr) IsOptional() bool { - return a.optional -} - -// Resolve proxies to the Attribute's Resolve method. -func (a *evalAttr) Resolve(ctx Activation) (any, error) { - return a.attr.Resolve(ctx) -} - -type evalWatchConstructor struct { - constructor InterpretableConstructor - observer EvalObserver -} - -// InitVals implements the InterpretableConstructor InitVals function. -func (c *evalWatchConstructor) InitVals() []Interpretable { - return c.constructor.InitVals() -} - -// Type implements the InterpretableConstructor Type function. -func (c *evalWatchConstructor) Type() ref.Type { - return c.constructor.Type() -} - -// ID implements the Interpretable ID function. -func (c *evalWatchConstructor) ID() int64 { - return c.constructor.ID() -} - -// Eval implements the Interpretable Eval function. -func (c *evalWatchConstructor) Eval(vars Activation) ref.Val { - val := c.constructor.Eval(vars) - c.observer(vars, c.ID(), c.constructor, val) - return val -} - -func invalidOptionalEntryInit(field any, value ref.Val) ref.Val { - return types.NewErr("cannot initialize optional entry '%v' from non-optional value %v", field, value) -} - -func invalidOptionalElementInit(value ref.Val) ref.Val { - return types.NewErr("cannot initialize optional list element from non-optional value %v", value) -} - -// newFolder creates or initializes a pooled folder instance. -func newFolder(eval *evalFold, ctx Activation) *folder { - f := folderPool.Get().(*folder) - f.evalFold = eval - f.activation = ctx - return f -} - -// releaseFolder resets and releases a pooled folder instance. -func releaseFolder(f *folder) { - f.reset() - folderPool.Put(f) -} - -// folder tracks the state associated with folding a list or map with a comprehension v2 style macro. -// -// The folder embeds an interpreter.Activation and Interpretable evalFold value as well as implements -// the traits.Folder interface methods. -// -// Instances of a folder are intended to be pooled to minimize allocation overhead with this temporary -// bookkeeping object which supports lazy evaluation of the accumulator init expression which is useful -// in preserving evaluation order semantics which might otherwise be disrupted through the use of -// cel.bind or cel.@block. -type folder struct { - *evalFold - activation Activation - - // fold state objects. - accuVal ref.Val - iterVar1Val any - iterVar2Val any - - // bookkeeping flags to modify Activation and fold behaviors. - initialized bool - mutableValue bool - interrupted bool - computeResult bool -} - -func (f *folder) foldIterable(iterable traits.Iterable) ref.Val { - it := iterable.Iterator() - for it.HasNext() == types.True { - f.iterVar1Val = it.Next() - - cond := f.cond.Eval(f) - condBool, ok := cond.(types.Bool) - if f.interrupted || (!f.exhaustive && ok && condBool != types.True) { - return f.evalResult() - } - - // Update the accumulation value and check for eval interuption. - f.accuVal = f.step.Eval(f) - f.initialized = true - if f.interruptable && checkInterrupt(f.activation) { - f.interrupted = true - return f.evalResult() - } - } - return f.evalResult() -} - -// FoldEntry will either fold comprehension v1 style macros if iterVar2 is unset, or comprehension v2 style -// macros if both the iterVar and iterVar2 are set to non-empty strings. -func (f *folder) FoldEntry(key, val any) bool { - // Default to referencing both values. - f.iterVar1Val = key - f.iterVar2Val = val - - // Terminate evaluation if evaluation is interrupted or the condition is not true and exhaustive - // eval is not enabled. - cond := f.cond.Eval(f) - condBool, ok := cond.(types.Bool) - if f.interrupted || (!f.exhaustive && ok && condBool != types.True) { - return false - } - - // Update the accumulation value and check for eval interuption. - f.accuVal = f.step.Eval(f) - f.initialized = true - if f.interruptable && checkInterrupt(f.activation) { - f.interrupted = true - return false - } - return true -} - -// ResolveName overrides the default Activation lookup to perform lazy initialization of the accumulator -// and specialized lookups of iteration values with consideration for whether the final result is being -// computed and the iteration variables should be ignored. -func (f *folder) ResolveName(name string) (any, bool) { - if name == f.accuVar { - if !f.initialized { - f.initialized = true - initVal := f.accu.Eval(f.activation) - if !f.exhaustive { - if l, isList := initVal.(traits.Lister); isList && l.Size() == types.IntZero { - initVal = types.NewMutableList(f.adapter) - f.mutableValue = true - } - if m, isMap := initVal.(traits.Mapper); isMap && m.Size() == types.IntZero { - initVal = types.NewMutableMap(f.adapter, map[ref.Val]ref.Val{}) - f.mutableValue = true - } - } - f.accuVal = initVal - } - return f.accuVal, true - } - if !f.computeResult { - if name == f.iterVar { - f.iterVar1Val = f.adapter.NativeToValue(f.iterVar1Val) - return f.iterVar1Val, true - } - if name == f.iterVar2 { - f.iterVar2Val = f.adapter.NativeToValue(f.iterVar2Val) - return f.iterVar2Val, true - } - } - return f.activation.ResolveName(name) -} - -// Parent returns the activation embedded into the folder. -func (f *folder) Parent() Activation { - return f.activation -} - -// UnknownAttributePatterns implements the PartialActivation interface returning the unknown patterns -// if they were provided to the input activation, or an empty set if the proxied activation is not partial. -func (f *folder) UnknownAttributePatterns() []*AttributePattern { - if pv, ok := f.activation.(partialActivationConverter); ok { - if partial, isPartial := pv.AsPartialActivation(); isPartial { - return partial.UnknownAttributePatterns() - } - } - return []*AttributePattern{} -} - -func (f *folder) AsPartialActivation() (PartialActivation, bool) { - if pv, ok := f.activation.(partialActivationConverter); ok { - if _, isPartial := pv.AsPartialActivation(); isPartial { - return f, true - } - } - return nil, false -} - -// evalResult computes the final result of the fold after all entries have been folded and accumulated. -func (f *folder) evalResult() ref.Val { - f.computeResult = true - if f.interrupted { - return types.NewErr("operation interrupted") - } - res := f.result.Eval(f) - // Convert a mutable list or map to an immutable one if the comprehension has generated a list or - // map as a result. - if !types.IsUnknownOrError(res) && f.mutableValue { - if _, ok := res.(traits.MutableLister); ok { - res = res.(traits.MutableLister).ToImmutableList() - } - if _, ok := res.(traits.MutableMapper); ok { - res = res.(traits.MutableMapper).ToImmutableMap() - } - } - return res -} - -// reset clears any state associated with folder evaluation. -func (f *folder) reset() { - f.evalFold = nil - f.activation = nil - f.accuVal = nil - f.iterVar1Val = nil - f.iterVar2Val = nil - - f.initialized = false - f.mutableValue = false - f.interrupted = false - f.computeResult = false -} - -func checkInterrupt(a Activation) bool { - stop, found := a.ResolveName("#interrupted") - return found && stop == true -} - -var ( - // pool of var folders to reduce allocations during folds. - folderPool = &sync.Pool{ - New: func() any { - return &folder{} - }, - } -) diff --git a/vendor/github.com/google/cel-go/interpreter/interpreter.go b/vendor/github.com/google/cel-go/interpreter/interpreter.go deleted file mode 100644 index be57e7439..000000000 --- a/vendor/github.com/google/cel-go/interpreter/interpreter.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package interpreter provides functions to evaluate parsed expressions with -// the option to augment the evaluation with inputs and functions supplied at -// evaluation time. -package interpreter - -import ( - "errors" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// PlannerOption configures the program plan options during interpretable setup. -type PlannerOption func(*planner) (*planner, error) - -// Interpreter generates a new Interpretable from a checked or unchecked expression. -type Interpreter interface { - // NewInterpretable creates an Interpretable from a checked expression and an - // optional list of PlannerOption values. - NewInterpretable(exprAST *ast.AST, opts ...PlannerOption) (Interpretable, error) -} - -// EvalObserver is a functional interface that accepts an expression id and an observed value. -// The id identifies the expression that was evaluated, the programStep is the Interpretable or Qualifier that -// was evaluated and value is the result of the evaluation. -type EvalObserver func(vars Activation, id int64, programStep any, value ref.Val) - -// StatefulObserver observes evaluation while tracking or utilizing stateful behavior. -type StatefulObserver interface { - // InitState configures stateful metadata on the activation. - InitState(Activation) (Activation, error) - - // GetState retrieves the stateful metadata from the activation. - GetState(Activation) any - - // Observe passes the activation and relevant evaluation metadata to the observer. - // The observe method is expected to do the equivalent of GetState(vars) in order - // to find the metadata that needs to be updated upon invocation. - Observe(vars Activation, id int64, programStep any, value ref.Val) -} - -// EvalCancelledError represents a cancelled program evaluation operation. -type EvalCancelledError struct { - Message string - // Type identifies the cause of the cancellation. - Cause CancellationCause -} - -func (e EvalCancelledError) Error() string { - return e.Message -} - -// CancellationCause enumerates the ways a program evaluation operation can be cancelled. -type CancellationCause int - -const ( - // ContextCancelled indicates that the operation was cancelled in response to a Golang context cancellation. - ContextCancelled CancellationCause = iota - - // CostLimitExceeded indicates that the operation was cancelled in response to the actual cost limit being - // exceeded. - CostLimitExceeded -) - -// evalStateOption configures the evalStateFactory behavior. -type evalStateOption func(*evalStateFactory) *evalStateFactory - -// EvalStateFactory configures the EvalState generator to be used by the EvalStateObserver. -func EvalStateFactory(factory func() EvalState) evalStateOption { - return func(fac *evalStateFactory) *evalStateFactory { - fac.factory = factory - return fac - } -} - -// EvalStateObserver provides an observer which records the value associated with the given expression id. -// EvalState must be provided to the observer. -func EvalStateObserver(opts ...evalStateOption) PlannerOption { - et := &evalStateFactory{factory: NewEvalState} - for _, o := range opts { - et = o(et) - } - return func(p *planner) (*planner, error) { - if et.factory == nil { - return nil, errors.New("eval state factory not configured") - } - p.observers = append(p.observers, et) - p.decorators = append(p.decorators, decObserveEval(et.Observe)) - return p, nil - } -} - -// evalStateConverter identifies an object which is convertible to an EvalState instance. -type evalStateConverter interface { - asEvalState() EvalState -} - -// evalStateActivation hides state in the Activation in a manner not accessible to expressions. -type evalStateActivation struct { - vars Activation - state EvalState -} - -// ResolveName proxies variable lookups to the backing activation. -func (esa evalStateActivation) ResolveName(name string) (any, bool) { - return esa.vars.ResolveName(name) -} - -// Parent proxies parent lookups to the backing activation. -func (esa evalStateActivation) Parent() Activation { - return esa.vars -} - -// AsPartialActivation supports conversion to a partial activation in order to detect unknown attributes. -func (esa evalStateActivation) AsPartialActivation() (PartialActivation, bool) { - return AsPartialActivation(esa.vars) -} - -// asEvalState implements the evalStateConverter method. -func (esa evalStateActivation) asEvalState() EvalState { - return esa.state -} - -// asEvalState walks the Activation hierarchy and returns the first EvalState found, if present. -func asEvalState(vars Activation) (EvalState, bool) { - if conv, ok := vars.(evalStateConverter); ok { - return conv.asEvalState(), true - } - if vars.Parent() != nil { - return asEvalState(vars.Parent()) - } - return nil, false -} - -// evalStateFactory holds a reference to a factory function that produces an EvalState instance. -type evalStateFactory struct { - factory func() EvalState -} - -// InitState produces an EvalState instance and bundles it into the Activation in a way which is -// not visible to expression evaluation. -func (et *evalStateFactory) InitState(vars Activation) (Activation, error) { - state := et.factory() - return evalStateActivation{vars: vars, state: state}, nil -} - -// GetState extracts the EvalState from the Activation. -func (et *evalStateFactory) GetState(vars Activation) any { - if state, found := asEvalState(vars); found { - return state - } - return nil -} - -// Observe records the evaluation state for a given expression node and program step. -func (et *evalStateFactory) Observe(vars Activation, id int64, programStep any, val ref.Val) { - state, found := asEvalState(vars) - if !found { - return - } - state.SetValue(id, val) -} - -// CustomDecorator configures a custom interpretable decorator for the program. -func CustomDecorator(dec InterpretableDecorator) PlannerOption { - return func(p *planner) (*planner, error) { - p.decorators = append(p.decorators, dec) - return p, nil - } -} - -// ExhaustiveEval replaces operations that short-circuit with versions that evaluate -// expressions and couples this behavior with the TrackState() decorator to provide -// insight into the evaluation state of the entire expression. EvalState must be -// provided to the decorator. This decorator is not thread-safe, and the EvalState -// must be reset between Eval() calls. -func ExhaustiveEval() PlannerOption { - return CustomDecorator(decDisableShortcircuits()) -} - -// InterruptableEval annotates comprehension loops with information that indicates they -// should check the `#interrupted` state within a custom Activation. -// -// The custom activation is currently managed higher up in the stack within the 'cel' package -// and should not require any custom support on behalf of callers. -func InterruptableEval() PlannerOption { - return CustomDecorator(decInterruptFolds()) -} - -// Optimize will pre-compute operations such as list and map construction and optimize -// call arguments to set membership tests. The set of optimizations will increase over time. -func Optimize() PlannerOption { - return CustomDecorator(decOptimize()) -} - -// RegexOptimization provides a way to replace an InterpretableCall for a regex function when the -// RegexIndex argument is a string constant. Typically, the Factory would compile the regex pattern at -// RegexIndex and report any errors (at program creation time) and then use the compiled regex for -// all regex function invocations. -type RegexOptimization struct { - // Function is the name of the function to optimize. - Function string - // OverloadID is the ID of the overload to optimize. - OverloadID string - // RegexIndex is the index position of the regex pattern argument. Only calls to the function where this argument is - // a string constant will be delegated to this optimizer. - RegexIndex int - // Factory constructs a replacement InterpretableCall node that optimizes the regex function call. Factory is - // provided with the unoptimized regex call and the string constant at the RegexIndex argument. - // The Factory may compile the regex for use across all invocations of the call, return any errors and - // return an interpreter.NewCall with the desired regex optimized function impl. - Factory func(call InterpretableCall, regexPattern string) (InterpretableCall, error) -} - -// CompileRegexConstants compiles regex pattern string constants at program creation time and reports any regex pattern -// compile errors. -func CompileRegexConstants(regexOptimizations ...*RegexOptimization) PlannerOption { - return CustomDecorator(decRegexOptimizer(regexOptimizations...)) -} - -type exprInterpreter struct { - dispatcher Dispatcher - container *containers.Container - provider types.Provider - adapter types.Adapter - attrFactory AttributeFactory -} - -// NewInterpreter builds an Interpreter from a Dispatcher and TypeProvider which will be used -// throughout the Eval of all Interpretable instances generated from it. -func NewInterpreter(dispatcher Dispatcher, - container *containers.Container, - provider types.Provider, - adapter types.Adapter, - attrFactory AttributeFactory) Interpreter { - return &exprInterpreter{ - dispatcher: dispatcher, - container: container, - provider: provider, - adapter: adapter, - attrFactory: attrFactory} -} - -// NewIntepretable implements the Interpreter interface method. -func (i *exprInterpreter) NewInterpretable( - checked *ast.AST, - opts ...PlannerOption) (Interpretable, error) { - p := newPlanner(i.dispatcher, i.provider, i.adapter, i.attrFactory, i.container, checked) - var err error - for _, o := range opts { - p, err = o(p) - if err != nil { - return nil, err - } - } - return p.Plan(checked.Expr()) -} diff --git a/vendor/github.com/google/cel-go/interpreter/optimizations.go b/vendor/github.com/google/cel-go/interpreter/optimizations.go deleted file mode 100644 index 2fc87e693..000000000 --- a/vendor/github.com/google/cel-go/interpreter/optimizations.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "regexp" - - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// MatchesRegexOptimization optimizes the 'matches' standard library function by compiling the regex pattern and -// reporting any compilation errors at program creation time, and using the compiled regex pattern for all function -// call invocations. -var MatchesRegexOptimization = &RegexOptimization{ - Function: "matches", - RegexIndex: 1, - Factory: func(call InterpretableCall, regexPattern string) (InterpretableCall, error) { - compiledRegex, err := regexp.Compile(regexPattern) - if err != nil { - return nil, err - } - return NewCall(call.ID(), call.Function(), call.OverloadID(), call.Args(), func(values ...ref.Val) ref.Val { - if len(values) != 2 { - return types.NoSuchOverloadErr() - } - in, ok := values[0].Value().(string) - if !ok { - return types.NoSuchOverloadErr() - } - return types.Bool(compiledRegex.MatchString(in)) - }), nil - }, -} diff --git a/vendor/github.com/google/cel-go/interpreter/planner.go b/vendor/github.com/google/cel-go/interpreter/planner.go deleted file mode 100644 index f0e0d4305..000000000 --- a/vendor/github.com/google/cel-go/interpreter/planner.go +++ /dev/null @@ -1,767 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "fmt" - "strings" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/containers" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" -) - -// newPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider, -// TypeAdapter, Container, and CheckedExpr value. These pieces of data are used to resolve -// functions, types, and namespaced identifiers at plan time rather than at runtime since -// it only needs to be done once and may be semi-expensive to compute. -func newPlanner(disp Dispatcher, - provider types.Provider, - adapter types.Adapter, - attrFactory AttributeFactory, - cont *containers.Container, - exprAST *ast.AST) *planner { - return &planner{ - disp: disp, - provider: provider, - adapter: adapter, - attrFactory: attrFactory, - container: cont, - refMap: exprAST.ReferenceMap(), - typeMap: exprAST.TypeMap(), - decorators: make([]InterpretableDecorator, 0), - observers: make([]StatefulObserver, 0), - } -} - -// planner is an implementation of the interpretablePlanner interface. -type planner struct { - disp Dispatcher - provider types.Provider - adapter types.Adapter - attrFactory AttributeFactory - container *containers.Container - refMap map[int64]*ast.ReferenceInfo - typeMap map[int64]*types.Type - decorators []InterpretableDecorator - observers []StatefulObserver -} - -// Plan implements the interpretablePlanner interface. This implementation of the Plan method also -// applies decorators to each Interpretable generated as part of the overall plan. Decorators are -// useful for layering functionality into the evaluation that is not natively understood by CEL, -// such as state-tracking, expression re-write, and possibly efficient thread-safe memoization of -// repeated expressions. -func (p *planner) Plan(expr ast.Expr) (Interpretable, error) { - i, err := p.plan(expr) - if err != nil { - return nil, err - } - if len(p.observers) == 0 { - return i, nil - } - return &ObservableInterpretable{Interpretable: i, observers: p.observers}, nil -} - -func (p *planner) plan(expr ast.Expr) (Interpretable, error) { - switch expr.Kind() { - case ast.CallKind: - return p.decorate(p.planCall(expr)) - case ast.IdentKind: - return p.decorate(p.planIdent(expr)) - case ast.LiteralKind: - return p.decorate(p.planConst(expr)) - case ast.SelectKind: - return p.decorate(p.planSelect(expr)) - case ast.ListKind: - return p.decorate(p.planCreateList(expr)) - case ast.MapKind: - return p.decorate(p.planCreateMap(expr)) - case ast.StructKind: - return p.decorate(p.planCreateStruct(expr)) - case ast.ComprehensionKind: - return p.decorate(p.planComprehension(expr)) - } - return nil, fmt.Errorf("unsupported expr: %v", expr) -} - -// decorate applies the InterpretableDecorator functions to the given Interpretable. -// Both the Interpretable and error generated by a Plan step are accepted as arguments -// for convenience. -func (p *planner) decorate(i Interpretable, err error) (Interpretable, error) { - if err != nil { - return nil, err - } - for _, dec := range p.decorators { - i, err = dec(i) - if err != nil { - return nil, err - } - } - return i, nil -} - -// planIdent creates an Interpretable that resolves an identifier from an Activation. -func (p *planner) planIdent(expr ast.Expr) (Interpretable, error) { - // Establish whether the identifier is in the reference map. - if identRef, found := p.refMap[expr.ID()]; found { - return p.planCheckedIdent(expr.ID(), identRef) - } - // Create the possible attribute list for the unresolved reference. - ident := expr.AsIdent() - return &evalAttr{ - adapter: p.adapter, - attr: p.attrFactory.MaybeAttribute(expr.ID(), ident), - }, nil -} - -func (p *planner) planCheckedIdent(id int64, identRef *ast.ReferenceInfo) (Interpretable, error) { - // Plan a constant reference if this is the case for this simple identifier. - if identRef.Value != nil { - return NewConstValue(id, identRef.Value), nil - } - - // Check to see whether the type map indicates this is a type name. All types should be - // registered with the provider. - cType := p.typeMap[id] - if cType.Kind() == types.TypeKind { - cVal, found := p.provider.FindIdent(identRef.Name) - if !found { - return nil, fmt.Errorf("reference to undefined type: %s", identRef.Name) - } - return NewConstValue(id, cVal), nil - } - - // Otherwise, return the attribute for the resolved identifier name. - return &evalAttr{ - adapter: p.adapter, - attr: p.attrFactory.AbsoluteAttribute(id, identRef.Name), - }, nil -} - -// planSelect creates an Interpretable with either: -// -// a) selects a field from a map or proto. -// b) creates a field presence test for a select within a has() macro. -// c) resolves the select expression to a namespaced identifier. -func (p *planner) planSelect(expr ast.Expr) (Interpretable, error) { - // If the Select id appears in the reference map from the CheckedExpr proto then it is either - // a namespaced identifier or enum value. - if identRef, found := p.refMap[expr.ID()]; found { - return p.planCheckedIdent(expr.ID(), identRef) - } - - sel := expr.AsSelect() - // Plan the operand evaluation. - op, err := p.plan(sel.Operand()) - if err != nil { - return nil, err - } - opType := p.typeMap[sel.Operand().ID()] - - // If the Select was marked TestOnly, this is a presence test. - // - // Note: presence tests are defined for structured (e.g. proto) and dynamic values (map, json) - // as follows: - // - True if the object field has a non-default value, e.g. obj.str != "" - // - True if the dynamic value has the field defined, e.g. key in map - // - // However, presence tests are not defined for qualified identifier names with primitive types. - // If a string named 'a.b.c' is declared in the environment and referenced within `has(a.b.c)`, - // it is not clear whether has should error or follow the convention defined for structured - // values. - - // Establish the attribute reference. - attr, isAttr := op.(InterpretableAttribute) - if !isAttr { - attr, err = p.relativeAttr(op.ID(), op, false) - if err != nil { - return nil, err - } - } - - // Build a qualifier for the attribute. - qual, err := p.attrFactory.NewQualifier(opType, expr.ID(), sel.FieldName(), false) - if err != nil { - return nil, err - } - // Modify the attribute to be test-only. - if sel.IsTestOnly() { - attr = &evalTestOnly{ - id: expr.ID(), - InterpretableAttribute: attr, - } - } - // Append the qualifier on the attribute. - _, err = attr.AddQualifier(qual) - return attr, err -} - -// planCall creates a callable Interpretable while specializing for common functions and invocation -// patterns. Specifically, conditional operators &&, ||, ?:, and (in)equality functions result in -// optimized Interpretable values. -func (p *planner) planCall(expr ast.Expr) (Interpretable, error) { - call := expr.AsCall() - target, fnName, oName := p.resolveFunction(expr) - argCount := len(call.Args()) - var offset int - if target != nil { - argCount++ - offset++ - } - - args := make([]Interpretable, argCount) - if target != nil { - arg, err := p.plan(target) - if err != nil { - return nil, err - } - args[0] = arg - } - for i, argExpr := range call.Args() { - arg, err := p.plan(argExpr) - if err != nil { - return nil, err - } - args[i+offset] = arg - } - - // Generate specialized Interpretable operators by function name if possible. - switch fnName { - case operators.LogicalAnd: - return p.planCallLogicalAnd(expr, args) - case operators.LogicalOr: - return p.planCallLogicalOr(expr, args) - case operators.Conditional: - return p.planCallConditional(expr, args) - case operators.Equals: - return p.planCallEqual(expr, args) - case operators.NotEquals: - return p.planCallNotEqual(expr, args) - case operators.Index: - return p.planCallIndex(expr, args, false) - case operators.OptSelect, operators.OptIndex: - return p.planCallIndex(expr, args, true) - } - - // Otherwise, generate Interpretable calls specialized by argument count. - // Try to find the specific function by overload id. - var fnDef *functions.Overload - if oName != "" { - fnDef, _ = p.disp.FindOverload(oName) - } - // If the overload id couldn't resolve the function, try the simple function name. - if fnDef == nil { - fnDef, _ = p.disp.FindOverload(fnName) - } - switch argCount { - case 0: - return p.planCallZero(expr, fnName, oName, fnDef) - case 1: - // If the FunctionOp has been used, then use it as it may exist for the purposes - // of dynamic dispatch within a singleton function implementation. - if fnDef != nil && fnDef.Unary == nil && fnDef.Function != nil { - return p.planCallVarArgs(expr, fnName, oName, fnDef, args) - } - return p.planCallUnary(expr, fnName, oName, fnDef, args) - case 2: - // If the FunctionOp has been used, then use it as it may exist for the purposes - // of dynamic dispatch within a singleton function implementation. - if fnDef != nil && fnDef.Binary == nil && fnDef.Function != nil { - return p.planCallVarArgs(expr, fnName, oName, fnDef, args) - } - return p.planCallBinary(expr, fnName, oName, fnDef, args) - default: - return p.planCallVarArgs(expr, fnName, oName, fnDef, args) - } -} - -// planCallZero generates a zero-arity callable Interpretable. -func (p *planner) planCallZero(expr ast.Expr, - function string, - overload string, - impl *functions.Overload) (Interpretable, error) { - if impl == nil || impl.Function == nil { - return nil, fmt.Errorf("no such overload: %s()", function) - } - return &evalZeroArity{ - id: expr.ID(), - function: function, - overload: overload, - impl: impl.Function, - }, nil -} - -// planCallUnary generates a unary callable Interpretable. -func (p *planner) planCallUnary(expr ast.Expr, - function string, - overload string, - impl *functions.Overload, - args []Interpretable) (Interpretable, error) { - var fn functions.UnaryOp - var trait int - var nonStrict bool - if impl != nil { - if impl.Unary == nil { - return nil, fmt.Errorf("no such overload: %s(arg)", function) - } - fn = impl.Unary - trait = impl.OperandTrait - nonStrict = impl.NonStrict - } - return &evalUnary{ - id: expr.ID(), - function: function, - overload: overload, - arg: args[0], - trait: trait, - impl: fn, - nonStrict: nonStrict, - }, nil -} - -// planCallBinary generates a binary callable Interpretable. -func (p *planner) planCallBinary(expr ast.Expr, - function string, - overload string, - impl *functions.Overload, - args []Interpretable) (Interpretable, error) { - var fn functions.BinaryOp - var trait int - var nonStrict bool - if impl != nil { - if impl.Binary == nil { - return nil, fmt.Errorf("no such overload: %s(lhs, rhs)", function) - } - fn = impl.Binary - trait = impl.OperandTrait - nonStrict = impl.NonStrict - } - return &evalBinary{ - id: expr.ID(), - function: function, - overload: overload, - lhs: args[0], - rhs: args[1], - trait: trait, - impl: fn, - nonStrict: nonStrict, - }, nil -} - -// planCallVarArgs generates a variable argument callable Interpretable. -func (p *planner) planCallVarArgs(expr ast.Expr, - function string, - overload string, - impl *functions.Overload, - args []Interpretable) (Interpretable, error) { - var fn functions.FunctionOp - var trait int - var nonStrict bool - if impl != nil { - if impl.Function == nil { - return nil, fmt.Errorf("no such overload: %s(...)", function) - } - fn = impl.Function - trait = impl.OperandTrait - nonStrict = impl.NonStrict - } - return &evalVarArgs{ - id: expr.ID(), - function: function, - overload: overload, - args: args, - trait: trait, - impl: fn, - nonStrict: nonStrict, - }, nil -} - -// planCallEqual generates an equals (==) Interpretable. -func (p *planner) planCallEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) { - return &evalEq{ - id: expr.ID(), - lhs: args[0], - rhs: args[1], - }, nil -} - -// planCallNotEqual generates a not equals (!=) Interpretable. -func (p *planner) planCallNotEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) { - return &evalNe{ - id: expr.ID(), - lhs: args[0], - rhs: args[1], - }, nil -} - -// planCallLogicalAnd generates a logical and (&&) Interpretable. -func (p *planner) planCallLogicalAnd(expr ast.Expr, args []Interpretable) (Interpretable, error) { - return &evalAnd{ - id: expr.ID(), - terms: args, - }, nil -} - -// planCallLogicalOr generates a logical or (||) Interpretable. -func (p *planner) planCallLogicalOr(expr ast.Expr, args []Interpretable) (Interpretable, error) { - return &evalOr{ - id: expr.ID(), - terms: args, - }, nil -} - -// planCallConditional generates a conditional / ternary (c ? t : f) Interpretable. -func (p *planner) planCallConditional(expr ast.Expr, args []Interpretable) (Interpretable, error) { - cond := args[0] - t := args[1] - var tAttr Attribute - truthyAttr, isTruthyAttr := t.(InterpretableAttribute) - if isTruthyAttr { - tAttr = truthyAttr.Attr() - } else { - tAttr = p.attrFactory.RelativeAttribute(t.ID(), t) - } - - f := args[2] - var fAttr Attribute - falsyAttr, isFalsyAttr := f.(InterpretableAttribute) - if isFalsyAttr { - fAttr = falsyAttr.Attr() - } else { - fAttr = p.attrFactory.RelativeAttribute(f.ID(), f) - } - - return &evalAttr{ - adapter: p.adapter, - attr: p.attrFactory.ConditionalAttribute(expr.ID(), cond, tAttr, fAttr), - }, nil -} - -// planCallIndex either extends an attribute with the argument to the index operation, or creates -// a relative attribute based on the return of a function call or operation. -func (p *planner) planCallIndex(expr ast.Expr, args []Interpretable, optional bool) (Interpretable, error) { - op := args[0] - ind := args[1] - opType := p.typeMap[op.ID()] - - // Establish the attribute reference. - var err error - attr, isAttr := op.(InterpretableAttribute) - if !isAttr { - attr, err = p.relativeAttr(op.ID(), op, false) - if err != nil { - return nil, err - } - } - - // Construct the qualifier type. - var qual Qualifier - switch ind := ind.(type) { - case InterpretableConst: - qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind.Value(), optional) - case InterpretableAttribute: - qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind, optional) - default: - qual, err = p.relativeAttr(expr.ID(), ind, optional) - } - if err != nil { - return nil, err - } - - // Add the qualifier to the attribute - _, err = attr.AddQualifier(qual) - return attr, err -} - -// planCreateList generates a list construction Interpretable. -func (p *planner) planCreateList(expr ast.Expr) (Interpretable, error) { - list := expr.AsList() - optionalIndices := list.OptionalIndices() - elements := list.Elements() - optionals := make([]bool, len(elements)) - for _, index := range optionalIndices { - if index < 0 || index >= int32(len(elements)) { - return nil, fmt.Errorf("optional index %d out of element bounds [0, %d]", index, len(elements)) - } - optionals[index] = true - } - elems := make([]Interpretable, len(elements)) - for i, elem := range elements { - elemVal, err := p.plan(elem) - if err != nil { - return nil, err - } - elems[i] = elemVal - } - return &evalList{ - id: expr.ID(), - elems: elems, - optionals: optionals, - hasOptionals: len(optionalIndices) != 0, - adapter: p.adapter, - }, nil -} - -// planCreateStruct generates a map or object construction Interpretable. -func (p *planner) planCreateMap(expr ast.Expr) (Interpretable, error) { - m := expr.AsMap() - entries := m.Entries() - optionals := make([]bool, len(entries)) - keys := make([]Interpretable, len(entries)) - vals := make([]Interpretable, len(entries)) - hasOptionals := false - for i, e := range entries { - entry := e.AsMapEntry() - keyVal, err := p.plan(entry.Key()) - if err != nil { - return nil, err - } - keys[i] = keyVal - - valVal, err := p.plan(entry.Value()) - if err != nil { - return nil, err - } - vals[i] = valVal - optionals[i] = entry.IsOptional() - hasOptionals = hasOptionals || entry.IsOptional() - } - return &evalMap{ - id: expr.ID(), - keys: keys, - vals: vals, - optionals: optionals, - hasOptionals: hasOptionals, - adapter: p.adapter, - }, nil -} - -// planCreateObj generates an object construction Interpretable. -func (p *planner) planCreateStruct(expr ast.Expr) (Interpretable, error) { - obj := expr.AsStruct() - typeName, defined := p.resolveTypeName(obj.TypeName()) - if !defined { - return nil, fmt.Errorf("unknown type: %s", obj.TypeName()) - } - objFields := obj.Fields() - optionals := make([]bool, len(objFields)) - fields := make([]string, len(objFields)) - vals := make([]Interpretable, len(objFields)) - hasOptionals := false - for i, f := range objFields { - field := f.AsStructField() - fields[i] = field.Name() - val, err := p.plan(field.Value()) - if err != nil { - return nil, err - } - vals[i] = val - optionals[i] = field.IsOptional() - hasOptionals = hasOptionals || field.IsOptional() - } - return &evalObj{ - id: expr.ID(), - typeName: typeName, - fields: fields, - vals: vals, - optionals: optionals, - hasOptionals: hasOptionals, - provider: p.provider, - }, nil -} - -// planComprehension generates an Interpretable fold operation. -func (p *planner) planComprehension(expr ast.Expr) (Interpretable, error) { - fold := expr.AsComprehension() - accu, err := p.plan(fold.AccuInit()) - if err != nil { - return nil, err - } - iterRange, err := p.plan(fold.IterRange()) - if err != nil { - return nil, err - } - cond, err := p.plan(fold.LoopCondition()) - if err != nil { - return nil, err - } - step, err := p.plan(fold.LoopStep()) - if err != nil { - return nil, err - } - result, err := p.plan(fold.Result()) - if err != nil { - return nil, err - } - return &evalFold{ - id: expr.ID(), - accuVar: fold.AccuVar(), - accu: accu, - iterVar: fold.IterVar(), - iterVar2: fold.IterVar2(), - iterRange: iterRange, - cond: cond, - step: step, - result: result, - adapter: p.adapter, - }, nil -} - -// planConst generates a constant valued Interpretable. -func (p *planner) planConst(expr ast.Expr) (Interpretable, error) { - return NewConstValue(expr.ID(), expr.AsLiteral()), nil -} - -// resolveTypeName takes a qualified string constructed at parse time, applies the proto -// namespace resolution rules to it in a scan over possible matching types in the TypeProvider. -func (p *planner) resolveTypeName(typeName string) (string, bool) { - for _, qualifiedTypeName := range p.container.ResolveCandidateNames(typeName) { - if _, found := p.provider.FindStructType(qualifiedTypeName); found { - return qualifiedTypeName, true - } - } - return "", false -} - -// resolveFunction determines the call target, function name, and overload name from a given Expr -// value. -// -// The resolveFunction resolves ambiguities where a function may either be a receiver-style -// invocation or a qualified global function name. -// - The target expression may only consist of ident and select expressions. -// - The function is declared in the environment using its fully-qualified name. -// - The fully-qualified function name matches the string serialized target value. -func (p *planner) resolveFunction(expr ast.Expr) (ast.Expr, string, string) { - // Note: similar logic exists within the `checker/checker.go`. If making changes here - // please consider the impact on checker.go and consolidate implementations or mirror code - // as appropriate. - call := expr.AsCall() - var target ast.Expr = nil - if call.IsMemberFunction() { - target = call.Target() - } - fnName := call.FunctionName() - - // Checked expressions always have a reference map entry, and _should_ have the fully qualified - // function name as the fnName value. - oRef, hasOverload := p.refMap[expr.ID()] - if hasOverload { - if len(oRef.OverloadIDs) == 1 { - return target, fnName, oRef.OverloadIDs[0] - } - // Note, this namespaced function name will not appear as a fully qualified name in ASTs - // built and stored before cel-go v0.5.0; however, this functionality did not work at all - // before the v0.5.0 release. - return target, fnName, "" - } - - // Parse-only expressions need to handle the same logic as is normally performed at check time, - // but with potentially much less information. The only reliable source of information about - // which functions are configured is the dispatcher. - if target == nil { - // If the user has a parse-only expression, then it should have been configured as such in - // the interpreter dispatcher as it may have been omitted from the checker environment. - for _, qualifiedName := range p.container.ResolveCandidateNames(fnName) { - _, found := p.disp.FindOverload(qualifiedName) - if found { - return nil, qualifiedName, "" - } - } - // It's possible that the overload was not found, but this situation is accounted for in - // the planCall phase; however, the leading dot used for denoting fully-qualified - // namespaced identifiers must be stripped, as all declarations already use fully-qualified - // names. This stripping behavior is handled automatically by the ResolveCandidateNames - // call. - return target, stripLeadingDot(fnName), "" - } - - // Handle the situation where the function target actually indicates a qualified function name. - qualifiedPrefix, maybeQualified := p.toQualifiedName(target) - if maybeQualified { - maybeQualifiedName := qualifiedPrefix + "." + fnName - for _, qualifiedName := range p.container.ResolveCandidateNames(maybeQualifiedName) { - _, found := p.disp.FindOverload(qualifiedName) - if found { - // Clear the target to ensure the proper arity is used for finding the - // implementation. - return nil, qualifiedName, "" - } - } - } - // In the default case, the function is exactly as it was advertised: a receiver call on with - // an expression-based target with the given simple function name. - return target, fnName, "" -} - -// relativeAttr indicates that the attribute in this case acts as a qualifier and as such needs to -// be observed to ensure that it's evaluation value is properly recorded for state tracking. -func (p *planner) relativeAttr(id int64, eval Interpretable, opt bool) (InterpretableAttribute, error) { - eAttr, ok := eval.(InterpretableAttribute) - if !ok { - eAttr = &evalAttr{ - adapter: p.adapter, - attr: p.attrFactory.RelativeAttribute(id, eval), - optional: opt, - } - } - // This looks like it should either decorate the new evalAttr node, or early return the InterpretableAttribute - decAttr, err := p.decorate(eAttr, nil) - if err != nil { - return nil, err - } - eAttr, ok = decAttr.(InterpretableAttribute) - if !ok { - return nil, fmt.Errorf("invalid attribute decoration: %v(%T)", decAttr, decAttr) - } - return eAttr, nil -} - -// toQualifiedName converts an expression AST into a qualified name if possible, with a boolean -// 'found' value that indicates if the conversion is successful. -func (p *planner) toQualifiedName(operand ast.Expr) (string, bool) { - // If the checker identified the expression as an attribute by the type-checker, then it can't - // possibly be part of qualified name in a namespace. - _, isAttr := p.refMap[operand.ID()] - if isAttr { - return "", false - } - // Since functions cannot be both namespaced and receiver functions, if the operand is not an - // qualified variable name, return the (possibly) qualified name given the expressions. - switch operand.Kind() { - case ast.IdentKind: - id := operand.AsIdent() - return id, true - case ast.SelectKind: - sel := operand.AsSelect() - // Test only expressions are not valid as qualified names. - if sel.IsTestOnly() { - return "", false - } - if qual, found := p.toQualifiedName(sel.Operand()); found { - return qual + "." + sel.FieldName(), true - } - } - return "", false -} - -func stripLeadingDot(name string) string { - if strings.HasPrefix(name, ".") { - return name[1:] - } - return name -} diff --git a/vendor/github.com/google/cel-go/interpreter/prune.go b/vendor/github.com/google/cel-go/interpreter/prune.go deleted file mode 100644 index 1662c1c1b..000000000 --- a/vendor/github.com/google/cel-go/interpreter/prune.go +++ /dev/null @@ -1,574 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -type astPruner struct { - ast.ExprFactory - expr ast.Expr - macroCalls map[int64]ast.Expr - state EvalState - nextExprID int64 -} - -// TODO Consider having a separate walk of the AST that finds common -// subexpressions. This can be called before or after constant folding to find -// common subexpressions. - -// PruneAst prunes the given AST based on the given EvalState and generates a new AST. -// Given AST is copied on write and a new AST is returned. -// Couple of typical use cases this interface would be: -// -// A) -// 1) Evaluate expr with some unknowns, -// 2) If result is unknown: -// -// a) PruneAst -// b) Goto 1 -// -// Functional call results which are known would be effectively cached across -// iterations. -// -// B) -// 1) Compile the expression (maybe via a service and maybe after checking a -// -// compiled expression does not exists in local cache) -// -// 2) Prepare the environment and the interpreter. Activation might be empty. -// 3) Eval the expression. This might return unknown or error or a concrete -// -// value. -// -// 4) PruneAst -// 4) Maybe cache the expression -// This is effectively constant folding the expression. How the environment is -// prepared in step 2 is flexible. For example, If the caller caches the -// compiled and constant folded expressions, but is not willing to constant -// fold(and thus cache results of) some external calls, then they can prepare -// the overloads accordingly. -func PruneAst(expr ast.Expr, macroCalls map[int64]ast.Expr, state EvalState) *ast.AST { - pruneState := NewEvalState() - for _, id := range state.IDs() { - v, _ := state.Value(id) - pruneState.SetValue(id, v) - } - pruner := &astPruner{ - ExprFactory: ast.NewExprFactory(), - expr: expr, - macroCalls: macroCalls, - state: pruneState, - nextExprID: getMaxID(expr)} - newExpr, _ := pruner.maybePrune(expr) - newInfo := ast.NewSourceInfo(nil) - for id, call := range pruner.macroCalls { - newInfo.SetMacroCall(id, call) - } - return ast.NewAST(newExpr, newInfo) -} - -func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (ast.Expr, bool) { - switch v := val.(type) { - case types.Bool, types.Bytes, types.Double, types.Int, types.Null, types.String, types.Uint, *types.Optional: - p.state.SetValue(id, val) - return p.NewLiteral(id, val), true - case types.Duration: - p.state.SetValue(id, val) - durationString := v.ConvertToType(types.StringType).(types.String) - return p.NewCall(id, overloads.TypeConvertDuration, p.NewLiteral(p.nextID(), durationString)), true - case types.Timestamp: - timestampString := v.ConvertToType(types.StringType).(types.String) - return p.NewCall(id, overloads.TypeConvertTimestamp, p.NewLiteral(p.nextID(), timestampString)), true - } - - // Attempt to build a list literal. - if list, isList := val.(traits.Lister); isList { - sz := list.Size().(types.Int) - elemExprs := make([]ast.Expr, sz) - for i := types.Int(0); i < sz; i++ { - elem := list.Get(i) - if types.IsUnknownOrError(elem) { - return nil, false - } - elemExpr, ok := p.maybeCreateLiteral(p.nextID(), elem) - if !ok { - return nil, false - } - elemExprs[i] = elemExpr - } - p.state.SetValue(id, val) - return p.NewList(id, elemExprs, []int32{}), true - } - - // Create a map literal if possible. - if mp, isMap := val.(traits.Mapper); isMap { - it := mp.Iterator() - entries := make([]ast.EntryExpr, mp.Size().(types.Int)) - i := 0 - for it.HasNext() != types.False { - key := it.Next() - val := mp.Get(key) - if types.IsUnknownOrError(key) || types.IsUnknownOrError(val) { - return nil, false - } - keyExpr, ok := p.maybeCreateLiteral(p.nextID(), key) - if !ok { - return nil, false - } - valExpr, ok := p.maybeCreateLiteral(p.nextID(), val) - if !ok { - return nil, false - } - entry := p.NewMapEntry(p.nextID(), keyExpr, valExpr, false) - entries[i] = entry - i++ - } - p.state.SetValue(id, val) - return p.NewMap(id, entries), true - } - - // TODO(issues/377) To construct message literals, the type provider will need to support - // the enumeration the fields for a given message. - return nil, false -} - -func (p *astPruner) maybePruneOptional(elem ast.Expr) (ast.Expr, bool) { - elemVal, found := p.value(elem.ID()) - if found && elemVal.Type() == types.OptionalType { - opt := elemVal.(*types.Optional) - if !opt.HasValue() { - return nil, true - } - if newElem, pruned := p.maybeCreateLiteral(elem.ID(), opt.GetValue()); pruned { - return newElem, true - } - } - return elem, false -} - -func (p *astPruner) maybePruneIn(node ast.Expr) (ast.Expr, bool) { - // elem in list - call := node.AsCall() - val, exists := p.maybeValue(call.Args()[1].ID()) - if !exists { - return nil, false - } - if sz, ok := val.(traits.Sizer); ok && sz.Size() == types.IntZero { - return p.maybeCreateLiteral(node.ID(), types.False) - } - return nil, false -} - -func (p *astPruner) maybePruneLogicalNot(node ast.Expr) (ast.Expr, bool) { - call := node.AsCall() - arg := call.Args()[0] - val, exists := p.maybeValue(arg.ID()) - if !exists { - return nil, false - } - if b, ok := val.(types.Bool); ok { - return p.maybeCreateLiteral(node.ID(), !b) - } - return nil, false -} - -func (p *astPruner) maybePruneOr(node ast.Expr) (ast.Expr, bool) { - call := node.AsCall() - // We know result is unknown, so we have at least one unknown arg - // and if one side is a known value, we know we can ignore it. - if v, exists := p.maybeValue(call.Args()[0].ID()); exists { - if v == types.True { - return p.maybeCreateLiteral(node.ID(), types.True) - } - return call.Args()[1], true - } - if v, exists := p.maybeValue(call.Args()[1].ID()); exists { - if v == types.True { - return p.maybeCreateLiteral(node.ID(), types.True) - } - return call.Args()[0], true - } - return nil, false -} - -func (p *astPruner) maybePruneAnd(node ast.Expr) (ast.Expr, bool) { - call := node.AsCall() - // We know result is unknown, so we have at least one unknown arg - // and if one side is a known value, we know we can ignore it. - if v, exists := p.maybeValue(call.Args()[0].ID()); exists { - if v == types.False { - return p.maybeCreateLiteral(node.ID(), types.False) - } - return call.Args()[1], true - } - if v, exists := p.maybeValue(call.Args()[1].ID()); exists { - if v == types.False { - return p.maybeCreateLiteral(node.ID(), types.False) - } - return call.Args()[0], true - } - return nil, false -} - -func (p *astPruner) maybePruneConditional(node ast.Expr) (ast.Expr, bool) { - call := node.AsCall() - cond, exists := p.maybeValue(call.Args()[0].ID()) - if !exists { - return nil, false - } - if cond.Value().(bool) { - return call.Args()[1], true - } - return call.Args()[2], true -} - -func (p *astPruner) maybePruneFunction(node ast.Expr) (ast.Expr, bool) { - if _, exists := p.value(node.ID()); !exists { - return nil, false - } - call := node.AsCall() - if call.FunctionName() == operators.LogicalOr { - return p.maybePruneOr(node) - } - if call.FunctionName() == operators.LogicalAnd { - return p.maybePruneAnd(node) - } - if call.FunctionName() == operators.Conditional { - return p.maybePruneConditional(node) - } - if call.FunctionName() == operators.In { - return p.maybePruneIn(node) - } - if call.FunctionName() == operators.LogicalNot { - return p.maybePruneLogicalNot(node) - } - return nil, false -} - -func (p *astPruner) maybePrune(node ast.Expr) (ast.Expr, bool) { - return p.prune(node) -} - -func (p *astPruner) prune(node ast.Expr) (ast.Expr, bool) { - if node == nil { - return node, false - } - val, valueExists := p.maybeValue(node.ID()) - if valueExists { - if newNode, ok := p.maybeCreateLiteral(node.ID(), val); ok { - delete(p.macroCalls, node.ID()) - return newNode, true - } - } - if macro, found := p.macroCalls[node.ID()]; found { - // Ensure that intermediate values for the comprehension are cleared during pruning - pruneMacroCall := node.Kind() != ast.UnspecifiedExprKind - if node.Kind() == ast.ComprehensionKind { - // Only prune cel.bind() calls since the variables of the comprehension are all - // visible to the user, so there's no chance of an incorrect value being observed - // as a result of looking at intermediate computations within a comprehension. - pruneMacroCall = isCelBindMacro(macro) - } - if pruneMacroCall { - // prune the expression in terms of the macro call instead of the expanded form when - // dealing with macro call tracking references. - if newMacro, pruned := p.prune(macro); pruned { - p.macroCalls[node.ID()] = newMacro - } - } else { - // Otherwise just prune the macro target in keeping with the pruning behavior of the - // comprehensions later in the call graph. - macroCall := macro.AsCall() - if macroCall.Target() != nil { - if newTarget, pruned := p.prune(macroCall.Target()); pruned { - macro = p.NewMemberCall(macro.ID(), macroCall.FunctionName(), newTarget, macroCall.Args()...) - p.macroCalls[node.ID()] = macro - } - } - } - } - - // We have either an unknown/error value, or something we don't want to - // transform, or expression was not evaluated. If possible, drill down - // more. - switch node.Kind() { - case ast.SelectKind: - sel := node.AsSelect() - if operand, isPruned := p.maybePrune(sel.Operand()); isPruned { - if sel.IsTestOnly() { - return p.NewPresenceTest(node.ID(), operand, sel.FieldName()), true - } - return p.NewSelect(node.ID(), operand, sel.FieldName()), true - } - case ast.CallKind: - argsPruned := false - call := node.AsCall() - args := call.Args() - newArgs := make([]ast.Expr, len(args)) - for i, a := range args { - newArgs[i] = a - if arg, isPruned := p.maybePrune(a); isPruned { - argsPruned = true - newArgs[i] = arg - } - } - if !call.IsMemberFunction() { - newCall := p.NewCall(node.ID(), call.FunctionName(), newArgs...) - if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned { - return prunedCall, true - } - return newCall, argsPruned - } - newTarget := call.Target() - targetPruned := false - if prunedTarget, isPruned := p.maybePrune(call.Target()); isPruned { - targetPruned = true - newTarget = prunedTarget - } - newCall := p.NewMemberCall(node.ID(), call.FunctionName(), newTarget, newArgs...) - if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned { - return prunedCall, true - } - return newCall, targetPruned || argsPruned - case ast.ListKind: - l := node.AsList() - elems := l.Elements() - optIndices := l.OptionalIndices() - optIndexMap := map[int32]bool{} - for _, i := range optIndices { - optIndexMap[i] = true - } - newOptIndexMap := make(map[int32]bool, len(optIndexMap)) - newElems := make([]ast.Expr, 0, len(elems)) - var listPruned bool - prunedIdx := 0 - for i, elem := range elems { - _, isOpt := optIndexMap[int32(i)] - if isOpt { - newElem, pruned := p.maybePruneOptional(elem) - if pruned { - listPruned = true - if newElem != nil { - newElems = append(newElems, newElem) - prunedIdx++ - } - continue - } - newOptIndexMap[int32(prunedIdx)] = true - } - if newElem, prunedElem := p.maybePrune(elem); prunedElem { - newElems = append(newElems, newElem) - listPruned = true - } else { - newElems = append(newElems, elem) - } - prunedIdx++ - } - optIndices = make([]int32, len(newOptIndexMap)) - idx := 0 - for i := range newOptIndexMap { - optIndices[idx] = i - idx++ - } - if listPruned { - return p.NewList(node.ID(), newElems, optIndices), true - } - case ast.MapKind: - var mapPruned bool - m := node.AsMap() - entries := m.Entries() - newEntries := make([]ast.EntryExpr, len(entries)) - for i, entry := range entries { - newEntries[i] = entry - e := entry.AsMapEntry() - newKey, keyPruned := p.maybePrune(e.Key()) - newValue, valuePruned := p.maybePrune(e.Value()) - if !keyPruned && !valuePruned { - continue - } - mapPruned = true - newEntry := p.NewMapEntry(entry.ID(), newKey, newValue, e.IsOptional()) - newEntries[i] = newEntry - } - if mapPruned { - return p.NewMap(node.ID(), newEntries), true - } - case ast.StructKind: - var structPruned bool - obj := node.AsStruct() - fields := obj.Fields() - newFields := make([]ast.EntryExpr, len(fields)) - for i, field := range fields { - newFields[i] = field - f := field.AsStructField() - newValue, prunedValue := p.maybePrune(f.Value()) - if !prunedValue { - continue - } - structPruned = true - newEntry := p.NewStructField(field.ID(), f.Name(), newValue, f.IsOptional()) - newFields[i] = newEntry - } - if structPruned { - return p.NewStruct(node.ID(), obj.TypeName(), newFields), true - } - case ast.ComprehensionKind: - compre := node.AsComprehension() - // Only the range of the comprehension is pruned since the state tracking only records - // the last iteration of the comprehension and not each step in the evaluation which - // means that the any residuals computed in between might be inaccurate. - if newRange, pruned := p.maybePrune(compre.IterRange()); pruned { - if compre.HasIterVar2() { - return p.NewComprehensionTwoVar( - node.ID(), - newRange, - compre.IterVar(), - compre.IterVar2(), - compre.AccuVar(), - compre.AccuInit(), - compre.LoopCondition(), - compre.LoopStep(), - compre.Result(), - ), true - } - return p.NewComprehension( - node.ID(), - newRange, - compre.IterVar(), - compre.AccuVar(), - compre.AccuInit(), - compre.LoopCondition(), - compre.LoopStep(), - compre.Result(), - ), true - } - } - return node, false -} - -func (p *astPruner) value(id int64) (ref.Val, bool) { - val, found := p.state.Value(id) - return val, (found && val != nil) -} - -func (p *astPruner) maybeValue(id int64) (ref.Val, bool) { - val, found := p.value(id) - if !found || types.IsUnknownOrError(val) { - return nil, false - } - return val, true -} - -func (p *astPruner) nextID() int64 { - next := p.nextExprID - p.nextExprID++ - return next -} - -type astVisitor struct { - // visitEntry is called on every expr node, including those within a map/struct entry. - visitExpr func(expr ast.Expr) - // visitEntry is called before entering the key, value of a map/struct entry. - visitEntry func(entry ast.EntryExpr) -} - -func getMaxID(expr ast.Expr) int64 { - maxID := int64(1) - visit(expr, maxIDVisitor(&maxID)) - return maxID -} - -func maxIDVisitor(maxID *int64) astVisitor { - return astVisitor{ - visitExpr: func(e ast.Expr) { - if e.ID() >= *maxID { - *maxID = e.ID() + 1 - } - }, - visitEntry: func(e ast.EntryExpr) { - if e.ID() >= *maxID { - *maxID = e.ID() + 1 - } - }, - } -} - -func visit(expr ast.Expr, visitor astVisitor) { - exprs := []ast.Expr{expr} - for len(exprs) != 0 { - e := exprs[0] - if visitor.visitExpr != nil { - visitor.visitExpr(e) - } - exprs = exprs[1:] - switch e.Kind() { - case ast.SelectKind: - exprs = append(exprs, e.AsSelect().Operand()) - case ast.CallKind: - call := e.AsCall() - if call.Target() != nil { - exprs = append(exprs, call.Target()) - } - exprs = append(exprs, call.Args()...) - case ast.ComprehensionKind: - compre := e.AsComprehension() - exprs = append(exprs, - compre.IterRange(), - compre.AccuInit(), - compre.LoopCondition(), - compre.LoopStep(), - compre.Result()) - case ast.ListKind: - list := e.AsList() - exprs = append(exprs, list.Elements()...) - case ast.MapKind: - for _, entry := range e.AsMap().Entries() { - e := entry.AsMapEntry() - if visitor.visitEntry != nil { - visitor.visitEntry(entry) - } - exprs = append(exprs, e.Key()) - exprs = append(exprs, e.Value()) - } - case ast.StructKind: - for _, entry := range e.AsStruct().Fields() { - f := entry.AsStructField() - if visitor.visitEntry != nil { - visitor.visitEntry(entry) - } - exprs = append(exprs, f.Value()) - } - } - } -} - -func isCelBindMacro(macro ast.Expr) bool { - if macro.Kind() != ast.CallKind { - return false - } - macroCall := macro.AsCall() - target := macroCall.Target() - return macroCall.FunctionName() == "bind" && - macroCall.IsMemberFunction() && - target.Kind() == ast.IdentKind && - target.AsIdent() == "cel" -} diff --git a/vendor/github.com/google/cel-go/interpreter/runtimecost.go b/vendor/github.com/google/cel-go/interpreter/runtimecost.go deleted file mode 100644 index 6c44cd798..000000000 --- a/vendor/github.com/google/cel-go/interpreter/runtimecost.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interpreter - -import ( - "errors" - "math" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// WARNING: Any changes to cost calculations in this file require a corresponding change in checker/cost.go - -// ActualCostEstimator provides function call cost estimations at runtime -// CallCost returns an estimated cost for the function overload invocation with the given args, or nil if it has no -// estimate to provide. CEL attempts to provide reasonable estimates for its standard function library, so CallCost -// should typically not need to provide an estimate for CELs standard function. -type ActualCostEstimator interface { - CallCost(function, overloadID string, args []ref.Val, result ref.Val) *uint64 -} - -// costTrackPlanOption modifies the cost tracking factory associatied with the CostObserver -type costTrackPlanOption func(*costTrackerFactory) *costTrackerFactory - -// CostTrackerFactory configures the factory method to generate a new cost-tracker per-evaluation. -func CostTrackerFactory(factory func() (*CostTracker, error)) costTrackPlanOption { - return func(fac *costTrackerFactory) *costTrackerFactory { - fac.factory = factory - return fac - } -} - -// CostObserver provides an observer that tracks runtime cost. -func CostObserver(opts ...costTrackPlanOption) PlannerOption { - ct := &costTrackerFactory{} - for _, o := range opts { - ct = o(ct) - } - return func(p *planner) (*planner, error) { - if ct.factory == nil { - return nil, errors.New("cost tracker factory not configured") - } - p.observers = append(p.observers, ct) - p.decorators = append(p.decorators, decObserveEval(ct.Observe)) - return p, nil - } -} - -// costTrackerConverter identifies an object which is convertible to a CostTracker instance. -type costTrackerConverter interface { - asCostTracker() *CostTracker -} - -// costTrackActivation hides state in the Activation in a manner not accessible to expressions. -type costTrackActivation struct { - vars Activation - costTracker *CostTracker -} - -// ResolveName proxies variable lookups to the backing activation. -func (cta costTrackActivation) ResolveName(name string) (any, bool) { - return cta.vars.ResolveName(name) -} - -// Parent proxies parent lookups to the backing activation. -func (cta costTrackActivation) Parent() Activation { - return cta.vars -} - -// AsPartialActivation supports conversion to a partial activation in order to detect unknown attributes. -func (cta costTrackActivation) AsPartialActivation() (PartialActivation, bool) { - return AsPartialActivation(cta.vars) -} - -// asCostTracker implements the costTrackerConverter method. -func (cta costTrackActivation) asCostTracker() *CostTracker { - return cta.costTracker -} - -// asCostTracker walks the Activation hierarchy and returns the first cost tracker found, if present. -func asCostTracker(vars Activation) (*CostTracker, bool) { - if conv, ok := vars.(costTrackerConverter); ok { - return conv.asCostTracker(), true - } - if vars.Parent() != nil { - return asCostTracker(vars.Parent()) - } - return nil, false -} - -// costTrackerFactory holds a factory for producing new CostTracker instances on each Eval call. -type costTrackerFactory struct { - factory func() (*CostTracker, error) -} - -// InitState produces a CostTracker and bundles it into an Activation in a way which is not visible -// to expression evaluation. -func (ct *costTrackerFactory) InitState(vars Activation) (Activation, error) { - tracker, err := ct.factory() - if err != nil { - return nil, err - } - return costTrackActivation{vars: vars, costTracker: tracker}, nil -} - -// GetState extracts the CostTracker from the Activation. -func (ct *costTrackerFactory) GetState(vars Activation) any { - if tracker, found := asCostTracker(vars); found { - return tracker - } - return nil -} - -// Observe computes the incremental cost of each step and records it into the CostTracker associated -// with the evaluation. -func (ct *costTrackerFactory) Observe(vars Activation, id int64, programStep any, val ref.Val) { - tracker, found := asCostTracker(vars) - if !found { - return - } - switch t := programStep.(type) { - case ConstantQualifier: - // TODO: Push identifiers on to the stack before observing constant qualifiers that apply to them - // and enable the below pop. Once enabled this can case can be collapsed into the Qualifier case. - tracker.cost++ - case InterpretableConst: - // zero cost - case InterpretableAttribute: - switch a := t.Attr().(type) { - case *conditionalAttribute: - // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions. - tracker.stack.drop(a.falsy.ID(), a.truthy.ID(), a.expr.ID()) - default: - tracker.stack.drop(t.Attr().ID()) - tracker.cost += common.SelectAndIdentCost - } - if !tracker.presenceTestHasCost { - if _, isTestOnly := programStep.(*evalTestOnly); isTestOnly { - tracker.cost -= common.SelectAndIdentCost - } - } - case *evalExhaustiveConditional: - // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions. - tracker.stack.drop(t.attr.falsy.ID(), t.attr.truthy.ID(), t.attr.expr.ID()) - - // While the field names are identical, the boolean operation eval structs do not share an interface and so - // must be handled individually. - case *evalOr: - for _, term := range t.terms { - tracker.stack.drop(term.ID()) - } - case *evalAnd: - for _, term := range t.terms { - tracker.stack.drop(term.ID()) - } - case *evalExhaustiveOr: - for _, term := range t.terms { - tracker.stack.drop(term.ID()) - } - case *evalExhaustiveAnd: - for _, term := range t.terms { - tracker.stack.drop(term.ID()) - } - case *evalFold: - tracker.stack.drop(t.iterRange.ID()) - case Qualifier: - tracker.cost++ - case InterpretableCall: - if argVals, ok := tracker.stack.dropArgs(t.Args()); ok { - tracker.cost += tracker.costCall(t, argVals, val) - } - case InterpretableConstructor: - tracker.stack.dropArgs(t.InitVals()) - switch t.Type() { - case types.ListType: - tracker.cost += common.ListCreateBaseCost - case types.MapType: - tracker.cost += common.MapCreateBaseCost - default: - tracker.cost += common.StructCreateBaseCost - } - } - tracker.stack.push(val, id) - - if tracker.Limit != nil && tracker.cost > *tracker.Limit { - panic(EvalCancelledError{Cause: CostLimitExceeded, Message: "operation cancelled: actual cost limit exceeded"}) - } -} - -// CostTrackerOption configures the behavior of CostTracker objects. -type CostTrackerOption func(*CostTracker) error - -// CostTrackerLimit sets the runtime limit on the evaluation cost during execution and will terminate the expression -// evaluation if the limit is exceeded. -func CostTrackerLimit(limit uint64) CostTrackerOption { - return func(tracker *CostTracker) error { - tracker.Limit = &limit - return nil - } -} - -// PresenceTestHasCost determines whether presence testing has a cost of one or zero. -// Defaults to presence test has a cost of one. -func PresenceTestHasCost(hasCost bool) CostTrackerOption { - return func(tracker *CostTracker) error { - tracker.presenceTestHasCost = hasCost - return nil - } -} - -// NewCostTracker creates a new CostTracker with a given estimator and a set of functional CostTrackerOption values. -func NewCostTracker(estimator ActualCostEstimator, opts ...CostTrackerOption) (*CostTracker, error) { - tracker := &CostTracker{ - Estimator: estimator, - overloadTrackers: map[string]FunctionTracker{}, - presenceTestHasCost: true, - } - for _, opt := range opts { - err := opt(tracker) - if err != nil { - return nil, err - } - } - return tracker, nil -} - -// OverloadCostTracker binds an overload ID to a runtime FunctionTracker implementation. -// -// OverloadCostTracker instances augment or override ActualCostEstimator decisions, allowing for versioned and/or -// optional cost tracking changes. -func OverloadCostTracker(overloadID string, fnTracker FunctionTracker) CostTrackerOption { - return func(tracker *CostTracker) error { - tracker.overloadTrackers[overloadID] = fnTracker - return nil - } -} - -// FunctionTracker computes the actual cost of evaluating the functions with the given arguments and result. -type FunctionTracker func(args []ref.Val, result ref.Val) *uint64 - -// CostTracker represents the information needed for tracking runtime cost. -type CostTracker struct { - Estimator ActualCostEstimator - overloadTrackers map[string]FunctionTracker - Limit *uint64 - presenceTestHasCost bool - - cost uint64 - stack refValStack -} - -// ActualCost returns the runtime cost -func (c *CostTracker) ActualCost() uint64 { - return c.cost -} - -func (c *CostTracker) costCall(call InterpretableCall, args []ref.Val, result ref.Val) uint64 { - var cost uint64 - if len(c.overloadTrackers) != 0 { - if tracker, found := c.overloadTrackers[call.OverloadID()]; found { - callCost := tracker(args, result) - if callCost != nil { - cost += *callCost - return cost - } - } - } - if c.Estimator != nil { - callCost := c.Estimator.CallCost(call.Function(), call.OverloadID(), args, result) - if callCost != nil { - cost += *callCost - return cost - } - } - // if user didn't specify, the default way of calculating runtime cost would be used. - // if user has their own implementation of ActualCostEstimator, make sure to cover the mapping between overloadId and cost calculation - switch call.OverloadID() { - // O(n) functions - case overloads.StartsWithString, overloads.EndsWithString, overloads.StringToBytes, overloads.BytesToString, overloads.ExtQuoteString, overloads.ExtFormatString: - cost += uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor)) - case overloads.InList: - // If a list is composed entirely of constant values this is O(1), but we don't account for that here. - // We just assume all list containment checks are O(n). - cost += actualSize(args[1]) - // O(min(m, n)) functions - case overloads.LessString, overloads.GreaterString, overloads.LessEqualsString, overloads.GreaterEqualsString, - overloads.LessBytes, overloads.GreaterBytes, overloads.LessEqualsBytes, overloads.GreaterEqualsBytes, - overloads.Equals, overloads.NotEquals: - // When we check the equality of 2 scalar values (e.g. 2 integers, 2 floating-point numbers, 2 booleans etc.), - // the CostTracker.ActualSize() function by definition returns 1 for each operand, resulting in an overall cost - // of 1. - lhsSize := actualSize(args[0]) - rhsSize := actualSize(args[1]) - minSize := lhsSize - if rhsSize < minSize { - minSize = rhsSize - } - cost += uint64(math.Ceil(float64(minSize) * common.StringTraversalCostFactor)) - // O(m+n) functions - case overloads.AddString, overloads.AddBytes: - // In the worst case scenario, we would need to reallocate a new backing store and copy both operands over. - cost += uint64(math.Ceil(float64(actualSize(args[0])+actualSize(args[1])) * common.StringTraversalCostFactor)) - // O(nm) functions - case overloads.MatchesString: - // https://swtch.com/~rsc/regexp/regexp1.html applies to RE2 implementation supported by CEL - // Add one to string length for purposes of cost calculation to prevent product of string and regex to be 0 - // in case where string is empty but regex is still expensive. - strCost := uint64(math.Ceil((1.0 + float64(actualSize(args[0]))) * common.StringTraversalCostFactor)) - // We don't know how many expressions are in the regex, just the string length (a huge - // improvement here would be to somehow get a count the number of expressions in the regex or - // how many states are in the regex state machine and use that to measure regex cost). - // For now, we're making a guess that each expression in a regex is typically at least 4 chars - // in length. - regexCost := uint64(math.Ceil(float64(actualSize(args[1])) * common.RegexStringLengthCostFactor)) - cost += strCost * regexCost - case overloads.ContainsString: - strCost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor)) - substrCost := uint64(math.Ceil(float64(actualSize(args[1])) * common.StringTraversalCostFactor)) - cost += strCost * substrCost - - default: - // The following operations are assumed to have O(1) complexity. - // - AddList due to the implementation. Index lookup can be O(c) the - // number of concatenated lists, but we don't track that is cost calculations. - // - Conversions, since none perform a traversal of a type of unbound length. - // - Computing the size of strings, byte sequences, lists and maps. - // - Logical operations and all operators on fixed width scalars (comparisons, equality) - // - Any functions that don't have a declared cost either here or in provided ActualCostEstimator. - cost++ - - } - return cost -} - -// actualSize returns the size of the value for all traits.Sizer values, a fixed size for all proto-based -// objects, and a size of 1 for all other value types. -func actualSize(value ref.Val) uint64 { - if sz, ok := value.(traits.Sizer); ok { - return uint64(sz.Size().(types.Int)) - } - if opt, ok := value.(*types.Optional); ok && opt.HasValue() { - return actualSize(opt.GetValue()) - } - return 1 -} - -type stackVal struct { - Val ref.Val - ID int64 -} - -// refValStack keeps track of values of the stack for cost calculation purposes -type refValStack []stackVal - -func (s *refValStack) push(val ref.Val, id int64) { - value := stackVal{Val: val, ID: id} - *s = append(*s, value) -} - -// TODO: Allowing drop and dropArgs to remove stack items above the IDs they are provided is a workaround. drop and dropArgs -// should find and remove only the stack items matching the provided IDs once all attributes are properly pushed and popped from stack. - -// drop searches the stack for each ID and removes the ID and all stack items above it. -// If none of the IDs are found, the stack is not modified. -// WARNING: It is possible for multiple expressions with the same ID to exist (due to how macros are implemented) so it's -// possible that a dropped ID will remain on the stack. They should be removed when IDs on the stack are popped. -func (s *refValStack) drop(ids ...int64) { - for _, id := range ids { - for idx := len(*s) - 1; idx >= 0; idx-- { - if (*s)[idx].ID == id { - *s = (*s)[:idx] - break - } - } - } -} - -// dropArgs searches the stack for all the args by their IDs, accumulates their associated ref.Vals and drops any -// stack items above any of the arg IDs. If any of the IDs are not found the stack, false is returned. -// Args are assumed to be found in the stack in reverse order, i.e. the last arg is expected to be found highest in -// the stack. -// WARNING: It is possible for multiple expressions with the same ID to exist (due to how macros are implemented) so it's -// possible that a dropped ID will remain on the stack. They should be removed when IDs on the stack are popped. -func (s *refValStack) dropArgs(args []Interpretable) ([]ref.Val, bool) { - result := make([]ref.Val, len(args)) -argloop: - for nIdx := len(args) - 1; nIdx >= 0; nIdx-- { - for idx := len(*s) - 1; idx >= 0; idx-- { - if (*s)[idx].ID == args[nIdx].ID() { - el := (*s)[idx] - *s = (*s)[:idx] - result[nIdx] = el.Val - continue argloop - } - } - return nil, false - } - return result, true -} diff --git a/vendor/github.com/google/cel-go/parser/BUILD.bazel b/vendor/github.com/google/cel-go/parser/BUILD.bazel deleted file mode 100644 index 97bc9bd43..000000000 --- a/vendor/github.com/google/cel-go/parser/BUILD.bazel +++ /dev/null @@ -1,58 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "errors.go", - "helper.go", - "input.go", - "macro.go", - "options.go", - "parser.go", - "unescape.go", - "unparser.go", - ], - importpath = "github.com/google/cel-go/parser", - visibility = ["//visibility:public"], - deps = [ - "//common:go_default_library", - "//common/ast:go_default_library", - "//common/operators:go_default_library", - "//common/runes:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//parser/gen:go_default_library", - "@com_github_antlr4_go_antlr_v4//:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "helper_test.go", - "parser_test.go", - "unescape_test.go", - "unparser_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//common/ast:go_default_library", - "//common/debug:go_default_library", - "//common/types:go_default_library", - "//parser/gen:go_default_library", - "//test:go_default_library", - "@com_github_antlr4_go_antlr_v4//:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/parser/errors.go b/vendor/github.com/google/cel-go/parser/errors.go deleted file mode 100644 index c3cec01a8..000000000 --- a/vendor/github.com/google/cel-go/parser/errors.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "github.com/google/cel-go/common" -) - -// parseErrors is a specialization of Errors. -type parseErrors struct { - errs *common.Errors -} - -// errorCount indicates the number of errors reported. -func (e *parseErrors) errorCount() int { - return len(e.errs.GetErrors()) -} - -func (e *parseErrors) internalError(message string) { - e.errs.ReportErrorAtID(0, common.NoLocation, "%s", message) -} - -func (e *parseErrors) syntaxError(l common.Location, message string) { - e.errs.ReportErrorAtID(0, l, "Syntax error: %s", message) -} - -func (e *parseErrors) reportErrorAtID(id int64, l common.Location, message string, args ...any) { - e.errs.ReportErrorAtID(id, l, message, args...) -} diff --git a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel b/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel deleted file mode 100644 index 3efed87b7..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//:__subpackages__"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "cel_base_listener.go", - "cel_base_visitor.go", - "cel_lexer.go", - "cel_listener.go", - "cel_parser.go", - "cel_visitor.go", - ], - data = [ - "CEL.tokens", - "CELLexer.tokens", - ], - importpath = "github.com/google/cel-go/parser/gen", - deps = [ - "@com_github_antlr4_go_antlr_v4//:go_default_library", - ], -) diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.g4 b/vendor/github.com/google/cel-go/parser/gen/CEL.g4 deleted file mode 100644 index ee53a844b..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/CEL.g4 +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -grammar CEL; - -// Grammar Rules -// ============= - -start - : e=expr EOF - ; - -expr - : e=conditionalOr (op='?' e1=conditionalOr ':' e2=expr)? - ; - -conditionalOr - : e=conditionalAnd (ops+='||' e1+=conditionalAnd)* - ; - -conditionalAnd - : e=relation (ops+='&&' e1+=relation)* - ; - -relation - : calc - | relation op=('<'|'<='|'>='|'>'|'=='|'!='|'in') relation - ; - -calc - : unary - | calc op=('*'|'/'|'%') calc - | calc op=('+'|'-') calc - ; - -unary - : member # MemberExpr - | (ops+='!')+ member # LogicalNot - | (ops+='-')+ member # Negate - ; - -member - : primary # PrimaryExpr - | member op='.' (opt='?')? id=escapeIdent # Select - | member op='.' id=IDENTIFIER open='(' args=exprList? ')' # MemberCall - | member op='[' (opt='?')? index=expr ']' # Index - ; - -primary - : leadingDot='.'? id=IDENTIFIER # Ident - | leadingDot='.'? id=IDENTIFIER (op='(' args=exprList? ')') # GlobalCall - | '(' e=expr ')' # Nested - | op='[' elems=listInit? ','? ']' # CreateList - | op='{' entries=mapInitializerList? ','? '}' # CreateStruct - | leadingDot='.'? ids+=IDENTIFIER (ops+='.' ids+=IDENTIFIER)* - op='{' entries=fieldInitializerList? ','? '}' # CreateMessage - | literal # ConstantLiteral - ; - -exprList - : e+=expr (',' e+=expr)* - ; - -listInit - : elems+=optExpr (',' elems+=optExpr)* - ; - -fieldInitializerList - : fields+=optField cols+=':' values+=expr (',' fields+=optField cols+=':' values+=expr)* - ; - -optField - : (opt='?')? escapeIdent - ; - -mapInitializerList - : keys+=optExpr cols+=':' values+=expr (',' keys+=optExpr cols+=':' values+=expr)* - ; - -escapeIdent - : id=IDENTIFIER # SimpleIdentifier - | id=ESC_IDENTIFIER # EscapedIdentifier -; - -optExpr - : (opt='?')? e=expr - ; - -literal - : sign=MINUS? tok=NUM_INT # Int - | tok=NUM_UINT # Uint - | sign=MINUS? tok=NUM_FLOAT # Double - | tok=STRING # String - | tok=BYTES # Bytes - | tok=CEL_TRUE # BoolTrue - | tok=CEL_FALSE # BoolFalse - | tok=NUL # Null - ; - -// Lexer Rules -// =========== - -EQUALS : '=='; -NOT_EQUALS : '!='; -IN: 'in'; -LESS : '<'; -LESS_EQUALS : '<='; -GREATER_EQUALS : '>='; -GREATER : '>'; -LOGICAL_AND : '&&'; -LOGICAL_OR : '||'; - -LBRACKET : '['; -RPRACKET : ']'; -LBRACE : '{'; -RBRACE : '}'; -LPAREN : '('; -RPAREN : ')'; -DOT : '.'; -COMMA : ','; -MINUS : '-'; -EXCLAM : '!'; -QUESTIONMARK : '?'; -COLON : ':'; -PLUS : '+'; -STAR : '*'; -SLASH : '/'; -PERCENT : '%'; -CEL_TRUE : 'true'; -CEL_FALSE : 'false'; -NUL : 'null'; - -fragment BACKSLASH : '\\'; -fragment LETTER : 'A'..'Z' | 'a'..'z' ; -fragment DIGIT : '0'..'9' ; -fragment EXPONENT : ('e' | 'E') ( '+' | '-' )? DIGIT+ ; -fragment HEXDIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ; -fragment RAW : 'r' | 'R'; - -fragment ESC_SEQ - : ESC_CHAR_SEQ - | ESC_BYTE_SEQ - | ESC_UNI_SEQ - | ESC_OCT_SEQ - ; - -fragment ESC_CHAR_SEQ - : BACKSLASH ('a'|'b'|'f'|'n'|'r'|'t'|'v'|'"'|'\''|'\\'|'?'|'`') - ; - -fragment ESC_OCT_SEQ - : BACKSLASH ('0'..'3') ('0'..'7') ('0'..'7') - ; - -fragment ESC_BYTE_SEQ - : BACKSLASH ( 'x' | 'X' ) HEXDIGIT HEXDIGIT - ; - -fragment ESC_UNI_SEQ - : BACKSLASH 'u' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT - | BACKSLASH 'U' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT - ; - -WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ -> channel(HIDDEN) ; -COMMENT : '//' (~'\n')* -> channel(HIDDEN) ; - -NUM_FLOAT - : ( DIGIT+ ('.' DIGIT+) EXPONENT? - | DIGIT+ EXPONENT - | '.' DIGIT+ EXPONENT? - ) - ; - -NUM_INT - : ( DIGIT+ | '0x' HEXDIGIT+ ); - -NUM_UINT - : DIGIT+ ( 'u' | 'U' ) - | '0x' HEXDIGIT+ ( 'u' | 'U' ) - ; - -STRING - : '"' (ESC_SEQ | ~('\\'|'"'|'\n'|'\r'))* '"' - | '\'' (ESC_SEQ | ~('\\'|'\''|'\n'|'\r'))* '\'' - | '"""' (ESC_SEQ | ~('\\'))*? '"""' - | '\'\'\'' (ESC_SEQ | ~('\\'))*? '\'\'\'' - | RAW '"' ~('"'|'\n'|'\r')* '"' - | RAW '\'' ~('\''|'\n'|'\r')* '\'' - | RAW '"""' .*? '"""' - | RAW '\'\'\'' .*? '\'\'\'' - ; - -BYTES : ('b' | 'B') STRING; - -IDENTIFIER : (LETTER | '_') ( LETTER | DIGIT | '_')*; -ESC_IDENTIFIER : '`' (LETTER | DIGIT | '_' | '.' | '-' | '/' | ' ')+ '`'; \ No newline at end of file diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.interp b/vendor/github.com/google/cel-go/parser/gen/CEL.interp deleted file mode 100644 index e085bab57..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/CEL.interp +++ /dev/null @@ -1,102 +0,0 @@ -token literal names: -null -'==' -'!=' -'in' -'<' -'<=' -'>=' -'>' -'&&' -'||' -'[' -']' -'{' -'}' -'(' -')' -'.' -',' -'-' -'!' -'?' -':' -'+' -'*' -'/' -'%' -'true' -'false' -'null' -null -null -null -null -null -null -null -null -null - -token symbolic names: -null -EQUALS -NOT_EQUALS -IN -LESS -LESS_EQUALS -GREATER_EQUALS -GREATER -LOGICAL_AND -LOGICAL_OR -LBRACKET -RPRACKET -LBRACE -RBRACE -LPAREN -RPAREN -DOT -COMMA -MINUS -EXCLAM -QUESTIONMARK -COLON -PLUS -STAR -SLASH -PERCENT -CEL_TRUE -CEL_FALSE -NUL -WHITESPACE -COMMENT -NUM_FLOAT -NUM_INT -NUM_UINT -STRING -BYTES -IDENTIFIER -ESC_IDENTIFIER - -rule names: -start -expr -conditionalOr -conditionalAnd -relation -calc -unary -member -primary -exprList -listInit -fieldInitializerList -optField -mapInitializerList -escapeIdent -optExpr -literal - - -atn: -[4, 1, 37, 259, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 44, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 49, 8, 2, 10, 2, 12, 2, 52, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 57, 8, 3, 10, 3, 12, 3, 60, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 68, 8, 4, 10, 4, 12, 4, 71, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 82, 8, 5, 10, 5, 12, 5, 85, 9, 5, 1, 6, 1, 6, 4, 6, 89, 8, 6, 11, 6, 12, 6, 90, 1, 6, 1, 6, 4, 6, 95, 8, 6, 11, 6, 12, 6, 96, 1, 6, 3, 6, 100, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 108, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 116, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 122, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 127, 8, 7, 10, 7, 12, 7, 130, 9, 7, 1, 8, 3, 8, 133, 8, 8, 1, 8, 1, 8, 3, 8, 137, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 142, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 151, 8, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 159, 8, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 3, 8, 166, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 171, 8, 8, 10, 8, 12, 8, 174, 9, 8, 1, 8, 1, 8, 3, 8, 178, 8, 8, 1, 8, 3, 8, 181, 8, 8, 1, 8, 1, 8, 3, 8, 185, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 190, 8, 9, 10, 9, 12, 9, 193, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 198, 8, 10, 10, 10, 12, 10, 201, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 211, 8, 11, 10, 11, 12, 11, 214, 9, 11, 1, 12, 3, 12, 217, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 229, 8, 13, 10, 13, 12, 13, 232, 9, 13, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 3, 15, 239, 8, 15, 1, 15, 1, 15, 1, 16, 3, 16, 244, 8, 16, 1, 16, 1, 16, 1, 16, 3, 16, 249, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 257, 8, 16, 1, 16, 0, 3, 8, 10, 14, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22, 290, 0, 34, 1, 0, 0, 0, 2, 37, 1, 0, 0, 0, 4, 45, 1, 0, 0, 0, 6, 53, 1, 0, 0, 0, 8, 61, 1, 0, 0, 0, 10, 72, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 101, 1, 0, 0, 0, 16, 184, 1, 0, 0, 0, 18, 186, 1, 0, 0, 0, 20, 194, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 238, 1, 0, 0, 0, 32, 256, 1, 0, 0, 0, 34, 35, 3, 2, 1, 0, 35, 36, 5, 0, 0, 1, 36, 1, 1, 0, 0, 0, 37, 43, 3, 4, 2, 0, 38, 39, 5, 20, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 5, 21, 0, 0, 41, 42, 3, 2, 1, 0, 42, 44, 1, 0, 0, 0, 43, 38, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 3, 1, 0, 0, 0, 45, 50, 3, 6, 3, 0, 46, 47, 5, 9, 0, 0, 47, 49, 3, 6, 3, 0, 48, 46, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 5, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 58, 3, 8, 4, 0, 54, 55, 5, 8, 0, 0, 55, 57, 3, 8, 4, 0, 56, 54, 1, 0, 0, 0, 57, 60, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 7, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 62, 6, 4, -1, 0, 62, 63, 3, 10, 5, 0, 63, 69, 1, 0, 0, 0, 64, 65, 10, 1, 0, 0, 65, 66, 7, 0, 0, 0, 66, 68, 3, 8, 4, 2, 67, 64, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 9, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 6, 5, -1, 0, 73, 74, 3, 12, 6, 0, 74, 83, 1, 0, 0, 0, 75, 76, 10, 2, 0, 0, 76, 77, 7, 1, 0, 0, 77, 82, 3, 10, 5, 3, 78, 79, 10, 1, 0, 0, 79, 80, 7, 2, 0, 0, 80, 82, 3, 10, 5, 2, 81, 75, 1, 0, 0, 0, 81, 78, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 100, 3, 14, 7, 0, 87, 89, 5, 19, 0, 0, 88, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 100, 3, 14, 7, 0, 93, 95, 5, 18, 0, 0, 94, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 86, 1, 0, 0, 0, 99, 88, 1, 0, 0, 0, 99, 94, 1, 0, 0, 0, 100, 13, 1, 0, 0, 0, 101, 102, 6, 7, -1, 0, 102, 103, 3, 16, 8, 0, 103, 128, 1, 0, 0, 0, 104, 105, 10, 3, 0, 0, 105, 107, 5, 16, 0, 0, 106, 108, 5, 20, 0, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 127, 3, 28, 14, 0, 110, 111, 10, 2, 0, 0, 111, 112, 5, 16, 0, 0, 112, 113, 5, 36, 0, 0, 113, 115, 5, 14, 0, 0, 114, 116, 3, 18, 9, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 127, 5, 15, 0, 0, 118, 119, 10, 1, 0, 0, 119, 121, 5, 10, 0, 0, 120, 122, 5, 20, 0, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 3, 2, 1, 0, 124, 125, 5, 11, 0, 0, 125, 127, 1, 0, 0, 0, 126, 104, 1, 0, 0, 0, 126, 110, 1, 0, 0, 0, 126, 118, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 15, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 133, 5, 16, 0, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 185, 5, 36, 0, 0, 135, 137, 5, 16, 0, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 36, 0, 0, 139, 141, 5, 14, 0, 0, 140, 142, 3, 18, 9, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 185, 5, 15, 0, 0, 144, 145, 5, 14, 0, 0, 145, 146, 3, 2, 1, 0, 146, 147, 5, 15, 0, 0, 147, 185, 1, 0, 0, 0, 148, 150, 5, 10, 0, 0, 149, 151, 3, 20, 10, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 5, 17, 0, 0, 153, 152, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 185, 5, 11, 0, 0, 156, 158, 5, 12, 0, 0, 157, 159, 3, 26, 13, 0, 158, 157, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 162, 5, 17, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 185, 5, 13, 0, 0, 164, 166, 5, 16, 0, 0, 165, 164, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 172, 5, 36, 0, 0, 168, 169, 5, 16, 0, 0, 169, 171, 5, 36, 0, 0, 170, 168, 1, 0, 0, 0, 171, 174, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 177, 5, 12, 0, 0, 176, 178, 3, 22, 11, 0, 177, 176, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 181, 5, 17, 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, 5, 13, 0, 0, 183, 185, 3, 32, 16, 0, 184, 132, 1, 0, 0, 0, 184, 136, 1, 0, 0, 0, 184, 144, 1, 0, 0, 0, 184, 148, 1, 0, 0, 0, 184, 156, 1, 0, 0, 0, 184, 165, 1, 0, 0, 0, 184, 183, 1, 0, 0, 0, 185, 17, 1, 0, 0, 0, 186, 191, 3, 2, 1, 0, 187, 188, 5, 17, 0, 0, 188, 190, 3, 2, 1, 0, 189, 187, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 19, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 199, 3, 30, 15, 0, 195, 196, 5, 17, 0, 0, 196, 198, 3, 30, 15, 0, 197, 195, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 21, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 212, 3, 2, 1, 0, 205, 206, 5, 17, 0, 0, 206, 207, 3, 24, 12, 0, 207, 208, 5, 21, 0, 0, 208, 209, 3, 2, 1, 0, 209, 211, 1, 0, 0, 0, 210, 205, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 23, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 217, 5, 20, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 3, 28, 14, 0, 219, 25, 1, 0, 0, 0, 220, 221, 3, 30, 15, 0, 221, 222, 5, 21, 0, 0, 222, 230, 3, 2, 1, 0, 223, 224, 5, 17, 0, 0, 224, 225, 3, 30, 15, 0, 225, 226, 5, 21, 0, 0, 226, 227, 3, 2, 1, 0, 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 27, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 236, 5, 36, 0, 0, 234, 236, 5, 37, 0, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 20, 0, 0, 238, 237, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 3, 2, 1, 0, 241, 31, 1, 0, 0, 0, 242, 244, 5, 18, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 257, 5, 32, 0, 0, 246, 257, 5, 33, 0, 0, 247, 249, 5, 18, 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 257, 5, 31, 0, 0, 251, 257, 5, 34, 0, 0, 252, 257, 5, 35, 0, 0, 253, 257, 5, 26, 0, 0, 254, 257, 5, 27, 0, 0, 255, 257, 5, 28, 0, 0, 256, 243, 1, 0, 0, 0, 256, 246, 1, 0, 0, 0, 256, 248, 1, 0, 0, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 33, 1, 0, 0, 0, 36, 43, 50, 58, 69, 81, 83, 90, 96, 99, 107, 115, 121, 126, 128, 132, 136, 141, 150, 153, 158, 161, 165, 172, 177, 180, 184, 191, 199, 212, 216, 230, 235, 238, 243, 248, 256] \ No newline at end of file diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.tokens b/vendor/github.com/google/cel-go/parser/gen/CEL.tokens deleted file mode 100644 index aa1f5eee6..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/CEL.tokens +++ /dev/null @@ -1,65 +0,0 @@ -EQUALS=1 -NOT_EQUALS=2 -IN=3 -LESS=4 -LESS_EQUALS=5 -GREATER_EQUALS=6 -GREATER=7 -LOGICAL_AND=8 -LOGICAL_OR=9 -LBRACKET=10 -RPRACKET=11 -LBRACE=12 -RBRACE=13 -LPAREN=14 -RPAREN=15 -DOT=16 -COMMA=17 -MINUS=18 -EXCLAM=19 -QUESTIONMARK=20 -COLON=21 -PLUS=22 -STAR=23 -SLASH=24 -PERCENT=25 -CEL_TRUE=26 -CEL_FALSE=27 -NUL=28 -WHITESPACE=29 -COMMENT=30 -NUM_FLOAT=31 -NUM_INT=32 -NUM_UINT=33 -STRING=34 -BYTES=35 -IDENTIFIER=36 -ESC_IDENTIFIER=37 -'=='=1 -'!='=2 -'in'=3 -'<'=4 -'<='=5 -'>='=6 -'>'=7 -'&&'=8 -'||'=9 -'['=10 -']'=11 -'{'=12 -'}'=13 -'('=14 -')'=15 -'.'=16 -','=17 -'-'=18 -'!'=19 -'?'=20 -':'=21 -'+'=22 -'*'=23 -'/'=24 -'%'=25 -'true'=26 -'false'=27 -'null'=28 diff --git a/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp b/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp deleted file mode 100644 index 162d52188..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp +++ /dev/null @@ -1,139 +0,0 @@ -token literal names: -null -'==' -'!=' -'in' -'<' -'<=' -'>=' -'>' -'&&' -'||' -'[' -']' -'{' -'}' -'(' -')' -'.' -',' -'-' -'!' -'?' -':' -'+' -'*' -'/' -'%' -'true' -'false' -'null' -null -null -null -null -null -null -null -null -null - -token symbolic names: -null -EQUALS -NOT_EQUALS -IN -LESS -LESS_EQUALS -GREATER_EQUALS -GREATER -LOGICAL_AND -LOGICAL_OR -LBRACKET -RPRACKET -LBRACE -RBRACE -LPAREN -RPAREN -DOT -COMMA -MINUS -EXCLAM -QUESTIONMARK -COLON -PLUS -STAR -SLASH -PERCENT -CEL_TRUE -CEL_FALSE -NUL -WHITESPACE -COMMENT -NUM_FLOAT -NUM_INT -NUM_UINT -STRING -BYTES -IDENTIFIER -ESC_IDENTIFIER - -rule names: -EQUALS -NOT_EQUALS -IN -LESS -LESS_EQUALS -GREATER_EQUALS -GREATER -LOGICAL_AND -LOGICAL_OR -LBRACKET -RPRACKET -LBRACE -RBRACE -LPAREN -RPAREN -DOT -COMMA -MINUS -EXCLAM -QUESTIONMARK -COLON -PLUS -STAR -SLASH -PERCENT -CEL_TRUE -CEL_FALSE -NUL -BACKSLASH -LETTER -DIGIT -EXPONENT -HEXDIGIT -RAW -ESC_SEQ -ESC_CHAR_SEQ -ESC_OCT_SEQ -ESC_BYTE_SEQ -ESC_UNI_SEQ -WHITESPACE -COMMENT -NUM_FLOAT -NUM_INT -NUM_UINT -STRING -BYTES -IDENTIFIER -ESC_IDENTIFIER - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[4, 0, 37, 435, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 179, 8, 31, 1, 31, 4, 31, 182, 8, 31, 11, 31, 12, 31, 183, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 194, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 227, 8, 38, 1, 39, 4, 39, 230, 8, 39, 11, 39, 12, 39, 231, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 240, 8, 40, 10, 40, 12, 40, 243, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 248, 8, 41, 11, 41, 12, 41, 249, 1, 41, 1, 41, 4, 41, 254, 8, 41, 11, 41, 12, 41, 255, 1, 41, 3, 41, 259, 8, 41, 1, 41, 4, 41, 262, 8, 41, 11, 41, 12, 41, 263, 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 270, 8, 41, 11, 41, 12, 41, 271, 1, 41, 3, 41, 275, 8, 41, 3, 41, 277, 8, 41, 1, 42, 4, 42, 280, 8, 42, 11, 42, 12, 42, 281, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 288, 8, 42, 11, 42, 12, 42, 289, 3, 42, 292, 8, 42, 1, 43, 4, 43, 295, 8, 43, 11, 43, 12, 43, 296, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 305, 8, 43, 11, 43, 12, 43, 306, 1, 43, 1, 43, 3, 43, 311, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 325, 8, 44, 10, 44, 12, 44, 328, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 337, 8, 44, 10, 44, 12, 44, 340, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 351, 8, 44, 10, 44, 12, 44, 354, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 362, 8, 44, 10, 44, 12, 44, 365, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 372, 8, 44, 10, 44, 12, 44, 375, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 385, 8, 44, 10, 44, 12, 44, 388, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 400, 8, 44, 10, 44, 12, 44, 403, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 409, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 416, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 421, 8, 46, 10, 46, 12, 46, 424, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 430, 8, 47, 11, 47, 12, 47, 431, 1, 47, 1, 47, 4, 338, 352, 386, 401, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31, 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 95, 37, 1, 0, 17, 2, 0, 65, 90, 97, 122, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96, 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120, 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 66, 66, 98, 98, 3, 0, 32, 32, 45, 47, 95, 95, 471, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 3, 100, 1, 0, 0, 0, 5, 103, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 9, 108, 1, 0, 0, 0, 11, 111, 1, 0, 0, 0, 13, 114, 1, 0, 0, 0, 15, 116, 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 122, 1, 0, 0, 0, 21, 124, 1, 0, 0, 0, 23, 126, 1, 0, 0, 0, 25, 128, 1, 0, 0, 0, 27, 130, 1, 0, 0, 0, 29, 132, 1, 0, 0, 0, 31, 134, 1, 0, 0, 0, 33, 136, 1, 0, 0, 0, 35, 138, 1, 0, 0, 0, 37, 140, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 144, 1, 0, 0, 0, 43, 146, 1, 0, 0, 0, 45, 148, 1, 0, 0, 0, 47, 150, 1, 0, 0, 0, 49, 152, 1, 0, 0, 0, 51, 154, 1, 0, 0, 0, 53, 159, 1, 0, 0, 0, 55, 165, 1, 0, 0, 0, 57, 170, 1, 0, 0, 0, 59, 172, 1, 0, 0, 0, 61, 174, 1, 0, 0, 0, 63, 176, 1, 0, 0, 0, 65, 185, 1, 0, 0, 0, 67, 187, 1, 0, 0, 0, 69, 193, 1, 0, 0, 0, 71, 195, 1, 0, 0, 0, 73, 198, 1, 0, 0, 0, 75, 203, 1, 0, 0, 0, 77, 226, 1, 0, 0, 0, 79, 229, 1, 0, 0, 0, 81, 235, 1, 0, 0, 0, 83, 276, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 310, 1, 0, 0, 0, 89, 408, 1, 0, 0, 0, 91, 410, 1, 0, 0, 0, 93, 415, 1, 0, 0, 0, 95, 425, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 2, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61, 0, 0, 102, 4, 1, 0, 0, 0, 103, 104, 5, 105, 0, 0, 104, 105, 5, 110, 0, 0, 105, 6, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 8, 1, 0, 0, 0, 108, 109, 5, 60, 0, 0, 109, 110, 5, 61, 0, 0, 110, 10, 1, 0, 0, 0, 111, 112, 5, 62, 0, 0, 112, 113, 5, 61, 0, 0, 113, 12, 1, 0, 0, 0, 114, 115, 5, 62, 0, 0, 115, 14, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0, 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 121, 5, 124, 0, 0, 121, 18, 1, 0, 0, 0, 122, 123, 5, 91, 0, 0, 123, 20, 1, 0, 0, 0, 124, 125, 5, 93, 0, 0, 125, 22, 1, 0, 0, 0, 126, 127, 5, 123, 0, 0, 127, 24, 1, 0, 0, 0, 128, 129, 5, 125, 0, 0, 129, 26, 1, 0, 0, 0, 130, 131, 5, 40, 0, 0, 131, 28, 1, 0, 0, 0, 132, 133, 5, 41, 0, 0, 133, 30, 1, 0, 0, 0, 134, 135, 5, 46, 0, 0, 135, 32, 1, 0, 0, 0, 136, 137, 5, 44, 0, 0, 137, 34, 1, 0, 0, 0, 138, 139, 5, 45, 0, 0, 139, 36, 1, 0, 0, 0, 140, 141, 5, 33, 0, 0, 141, 38, 1, 0, 0, 0, 142, 143, 5, 63, 0, 0, 143, 40, 1, 0, 0, 0, 144, 145, 5, 58, 0, 0, 145, 42, 1, 0, 0, 0, 146, 147, 5, 43, 0, 0, 147, 44, 1, 0, 0, 0, 148, 149, 5, 42, 0, 0, 149, 46, 1, 0, 0, 0, 150, 151, 5, 47, 0, 0, 151, 48, 1, 0, 0, 0, 152, 153, 5, 37, 0, 0, 153, 50, 1, 0, 0, 0, 154, 155, 5, 116, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 117, 0, 0, 157, 158, 5, 101, 0, 0, 158, 52, 1, 0, 0, 0, 159, 160, 5, 102, 0, 0, 160, 161, 5, 97, 0, 0, 161, 162, 5, 108, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 101, 0, 0, 164, 54, 1, 0, 0, 0, 165, 166, 5, 110, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 108, 0, 0, 169, 56, 1, 0, 0, 0, 170, 171, 5, 92, 0, 0, 171, 58, 1, 0, 0, 0, 172, 173, 7, 0, 0, 0, 173, 60, 1, 0, 0, 0, 174, 175, 2, 48, 57, 0, 175, 62, 1, 0, 0, 0, 176, 178, 7, 1, 0, 0, 177, 179, 7, 2, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 181, 1, 0, 0, 0, 180, 182, 3, 61, 30, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 64, 1, 0, 0, 0, 185, 186, 7, 3, 0, 0, 186, 66, 1, 0, 0, 0, 187, 188, 7, 4, 0, 0, 188, 68, 1, 0, 0, 0, 189, 194, 3, 71, 35, 0, 190, 194, 3, 75, 37, 0, 191, 194, 3, 77, 38, 0, 192, 194, 3, 73, 36, 0, 193, 189, 1, 0, 0, 0, 193, 190, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 70, 1, 0, 0, 0, 195, 196, 3, 57, 28, 0, 196, 197, 7, 5, 0, 0, 197, 72, 1, 0, 0, 0, 198, 199, 3, 57, 28, 0, 199, 200, 2, 48, 51, 0, 200, 201, 2, 48, 55, 0, 201, 202, 2, 48, 55, 0, 202, 74, 1, 0, 0, 0, 203, 204, 3, 57, 28, 0, 204, 205, 7, 6, 0, 0, 205, 206, 3, 65, 32, 0, 206, 207, 3, 65, 32, 0, 207, 76, 1, 0, 0, 0, 208, 209, 3, 57, 28, 0, 209, 210, 5, 117, 0, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 213, 3, 65, 32, 0, 213, 214, 3, 65, 32, 0, 214, 227, 1, 0, 0, 0, 215, 216, 3, 57, 28, 0, 216, 217, 5, 85, 0, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3, 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3, 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 224, 3, 65, 32, 0, 224, 225, 3, 65, 32, 0, 225, 227, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 215, 1, 0, 0, 0, 227, 78, 1, 0, 0, 0, 228, 230, 7, 7, 0, 0, 229, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 234, 6, 39, 0, 0, 234, 80, 1, 0, 0, 0, 235, 236, 5, 47, 0, 0, 236, 237, 5, 47, 0, 0, 237, 241, 1, 0, 0, 0, 238, 240, 8, 8, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 6, 40, 0, 0, 245, 82, 1, 0, 0, 0, 246, 248, 3, 61, 30, 0, 247, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 253, 5, 46, 0, 0, 252, 254, 3, 61, 30, 0, 253, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 258, 1, 0, 0, 0, 257, 259, 3, 63, 31, 0, 258, 257, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 277, 1, 0, 0, 0, 260, 262, 3, 61, 30, 0, 261, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 3, 63, 31, 0, 266, 277, 1, 0, 0, 0, 267, 269, 5, 46, 0, 0, 268, 270, 3, 61, 30, 0, 269, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 275, 3, 63, 31, 0, 274, 273, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 247, 1, 0, 0, 0, 276, 261, 1, 0, 0, 0, 276, 267, 1, 0, 0, 0, 277, 84, 1, 0, 0, 0, 278, 280, 3, 61, 30, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 292, 1, 0, 0, 0, 283, 284, 5, 48, 0, 0, 284, 285, 5, 120, 0, 0, 285, 287, 1, 0, 0, 0, 286, 288, 3, 65, 32, 0, 287, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 292, 1, 0, 0, 0, 291, 279, 1, 0, 0, 0, 291, 283, 1, 0, 0, 0, 292, 86, 1, 0, 0, 0, 293, 295, 3, 61, 30, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 7, 9, 0, 0, 299, 311, 1, 0, 0, 0, 300, 301, 5, 48, 0, 0, 301, 302, 5, 120, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 3, 65, 32, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 7, 9, 0, 0, 309, 311, 1, 0, 0, 0, 310, 294, 1, 0, 0, 0, 310, 300, 1, 0, 0, 0, 311, 88, 1, 0, 0, 0, 312, 317, 5, 34, 0, 0, 313, 316, 3, 69, 34, 0, 314, 316, 8, 10, 0, 0, 315, 313, 1, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 409, 5, 34, 0, 0, 321, 326, 5, 39, 0, 0, 322, 325, 3, 69, 34, 0, 323, 325, 8, 11, 0, 0, 324, 322, 1, 0, 0, 0, 324, 323, 1, 0, 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 329, 409, 5, 39, 0, 0, 330, 331, 5, 34, 0, 0, 331, 332, 5, 34, 0, 0, 332, 333, 5, 34, 0, 0, 333, 338, 1, 0, 0, 0, 334, 337, 3, 69, 34, 0, 335, 337, 8, 12, 0, 0, 336, 334, 1, 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 342, 5, 34, 0, 0, 342, 343, 5, 34, 0, 0, 343, 409, 5, 34, 0, 0, 344, 345, 5, 39, 0, 0, 345, 346, 5, 39, 0, 0, 346, 347, 5, 39, 0, 0, 347, 352, 1, 0, 0, 0, 348, 351, 3, 69, 34, 0, 349, 351, 8, 12, 0, 0, 350, 348, 1, 0, 0, 0, 350, 349, 1, 0, 0, 0, 351, 354, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 355, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 355, 356, 5, 39, 0, 0, 356, 357, 5, 39, 0, 0, 357, 409, 5, 39, 0, 0, 358, 359, 3, 67, 33, 0, 359, 363, 5, 34, 0, 0, 360, 362, 8, 13, 0, 0, 361, 360, 1, 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 366, 367, 5, 34, 0, 0, 367, 409, 1, 0, 0, 0, 368, 369, 3, 67, 33, 0, 369, 373, 5, 39, 0, 0, 370, 372, 8, 14, 0, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 377, 5, 39, 0, 0, 377, 409, 1, 0, 0, 0, 378, 379, 3, 67, 33, 0, 379, 380, 5, 34, 0, 0, 380, 381, 5, 34, 0, 0, 381, 382, 5, 34, 0, 0, 382, 386, 1, 0, 0, 0, 383, 385, 9, 0, 0, 0, 384, 383, 1, 0, 0, 0, 385, 388, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 389, 390, 5, 34, 0, 0, 390, 391, 5, 34, 0, 0, 391, 392, 5, 34, 0, 0, 392, 409, 1, 0, 0, 0, 393, 394, 3, 67, 33, 0, 394, 395, 5, 39, 0, 0, 395, 396, 5, 39, 0, 0, 396, 397, 5, 39, 0, 0, 397, 401, 1, 0, 0, 0, 398, 400, 9, 0, 0, 0, 399, 398, 1, 0, 0, 0, 400, 403, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 404, 405, 5, 39, 0, 0, 405, 406, 5, 39, 0, 0, 406, 407, 5, 39, 0, 0, 407, 409, 1, 0, 0, 0, 408, 312, 1, 0, 0, 0, 408, 321, 1, 0, 0, 0, 408, 330, 1, 0, 0, 0, 408, 344, 1, 0, 0, 0, 408, 358, 1, 0, 0, 0, 408, 368, 1, 0, 0, 0, 408, 378, 1, 0, 0, 0, 408, 393, 1, 0, 0, 0, 409, 90, 1, 0, 0, 0, 410, 411, 7, 15, 0, 0, 411, 412, 3, 89, 44, 0, 412, 92, 1, 0, 0, 0, 413, 416, 3, 59, 29, 0, 414, 416, 5, 95, 0, 0, 415, 413, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 422, 1, 0, 0, 0, 417, 421, 3, 59, 29, 0, 418, 421, 3, 61, 30, 0, 419, 421, 5, 95, 0, 0, 420, 417, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 94, 1, 0, 0, 0, 424, 422, 1, 0, 0, 0, 425, 429, 5, 96, 0, 0, 426, 430, 3, 59, 29, 0, 427, 430, 3, 61, 30, 0, 428, 430, 7, 16, 0, 0, 429, 426, 1, 0, 0, 0, 429, 427, 1, 0, 0, 0, 429, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 431, 432, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 434, 5, 96, 0, 0, 434, 96, 1, 0, 0, 0, 38, 0, 178, 183, 193, 226, 231, 241, 249, 255, 258, 263, 271, 274, 276, 281, 289, 291, 296, 306, 310, 315, 317, 324, 326, 336, 338, 350, 352, 363, 373, 386, 401, 408, 415, 420, 422, 429, 431, 1, 0, 1, 0] \ No newline at end of file diff --git a/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens b/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens deleted file mode 100644 index aa1f5eee6..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens +++ /dev/null @@ -1,65 +0,0 @@ -EQUALS=1 -NOT_EQUALS=2 -IN=3 -LESS=4 -LESS_EQUALS=5 -GREATER_EQUALS=6 -GREATER=7 -LOGICAL_AND=8 -LOGICAL_OR=9 -LBRACKET=10 -RPRACKET=11 -LBRACE=12 -RBRACE=13 -LPAREN=14 -RPAREN=15 -DOT=16 -COMMA=17 -MINUS=18 -EXCLAM=19 -QUESTIONMARK=20 -COLON=21 -PLUS=22 -STAR=23 -SLASH=24 -PERCENT=25 -CEL_TRUE=26 -CEL_FALSE=27 -NUL=28 -WHITESPACE=29 -COMMENT=30 -NUM_FLOAT=31 -NUM_INT=32 -NUM_UINT=33 -STRING=34 -BYTES=35 -IDENTIFIER=36 -ESC_IDENTIFIER=37 -'=='=1 -'!='=2 -'in'=3 -'<'=4 -'<='=5 -'>='=6 -'>'=7 -'&&'=8 -'||'=9 -'['=10 -']'=11 -'{'=12 -'}'=13 -'('=14 -')'=15 -'.'=16 -','=17 -'-'=18 -'!'=19 -'?'=20 -':'=21 -'+'=22 -'*'=23 -'/'=24 -'%'=25 -'true'=26 -'false'=27 -'null'=28 diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go deleted file mode 100644 index 514f2082f..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen // CEL -import "github.com/antlr4-go/antlr/v4" - -// BaseCELListener is a complete listener for a parse tree produced by CELParser. -type BaseCELListener struct{} - -var _ CELListener = &BaseCELListener{} - -// VisitTerminal is called when a terminal node is visited. -func (s *BaseCELListener) VisitTerminal(node antlr.TerminalNode) {} - -// VisitErrorNode is called when an error node is visited. -func (s *BaseCELListener) VisitErrorNode(node antlr.ErrorNode) {} - -// EnterEveryRule is called when any rule is entered. -func (s *BaseCELListener) EnterEveryRule(ctx antlr.ParserRuleContext) {} - -// ExitEveryRule is called when any rule is exited. -func (s *BaseCELListener) ExitEveryRule(ctx antlr.ParserRuleContext) {} - -// EnterStart is called when production start is entered. -func (s *BaseCELListener) EnterStart(ctx *StartContext) {} - -// ExitStart is called when production start is exited. -func (s *BaseCELListener) ExitStart(ctx *StartContext) {} - -// EnterExpr is called when production expr is entered. -func (s *BaseCELListener) EnterExpr(ctx *ExprContext) {} - -// ExitExpr is called when production expr is exited. -func (s *BaseCELListener) ExitExpr(ctx *ExprContext) {} - -// EnterConditionalOr is called when production conditionalOr is entered. -func (s *BaseCELListener) EnterConditionalOr(ctx *ConditionalOrContext) {} - -// ExitConditionalOr is called when production conditionalOr is exited. -func (s *BaseCELListener) ExitConditionalOr(ctx *ConditionalOrContext) {} - -// EnterConditionalAnd is called when production conditionalAnd is entered. -func (s *BaseCELListener) EnterConditionalAnd(ctx *ConditionalAndContext) {} - -// ExitConditionalAnd is called when production conditionalAnd is exited. -func (s *BaseCELListener) ExitConditionalAnd(ctx *ConditionalAndContext) {} - -// EnterRelation is called when production relation is entered. -func (s *BaseCELListener) EnterRelation(ctx *RelationContext) {} - -// ExitRelation is called when production relation is exited. -func (s *BaseCELListener) ExitRelation(ctx *RelationContext) {} - -// EnterCalc is called when production calc is entered. -func (s *BaseCELListener) EnterCalc(ctx *CalcContext) {} - -// ExitCalc is called when production calc is exited. -func (s *BaseCELListener) ExitCalc(ctx *CalcContext) {} - -// EnterMemberExpr is called when production MemberExpr is entered. -func (s *BaseCELListener) EnterMemberExpr(ctx *MemberExprContext) {} - -// ExitMemberExpr is called when production MemberExpr is exited. -func (s *BaseCELListener) ExitMemberExpr(ctx *MemberExprContext) {} - -// EnterLogicalNot is called when production LogicalNot is entered. -func (s *BaseCELListener) EnterLogicalNot(ctx *LogicalNotContext) {} - -// ExitLogicalNot is called when production LogicalNot is exited. -func (s *BaseCELListener) ExitLogicalNot(ctx *LogicalNotContext) {} - -// EnterNegate is called when production Negate is entered. -func (s *BaseCELListener) EnterNegate(ctx *NegateContext) {} - -// ExitNegate is called when production Negate is exited. -func (s *BaseCELListener) ExitNegate(ctx *NegateContext) {} - -// EnterMemberCall is called when production MemberCall is entered. -func (s *BaseCELListener) EnterMemberCall(ctx *MemberCallContext) {} - -// ExitMemberCall is called when production MemberCall is exited. -func (s *BaseCELListener) ExitMemberCall(ctx *MemberCallContext) {} - -// EnterSelect is called when production Select is entered. -func (s *BaseCELListener) EnterSelect(ctx *SelectContext) {} - -// ExitSelect is called when production Select is exited. -func (s *BaseCELListener) ExitSelect(ctx *SelectContext) {} - -// EnterPrimaryExpr is called when production PrimaryExpr is entered. -func (s *BaseCELListener) EnterPrimaryExpr(ctx *PrimaryExprContext) {} - -// ExitPrimaryExpr is called when production PrimaryExpr is exited. -func (s *BaseCELListener) ExitPrimaryExpr(ctx *PrimaryExprContext) {} - -// EnterIndex is called when production Index is entered. -func (s *BaseCELListener) EnterIndex(ctx *IndexContext) {} - -// ExitIndex is called when production Index is exited. -func (s *BaseCELListener) ExitIndex(ctx *IndexContext) {} - -// EnterIdent is called when production Ident is entered. -func (s *BaseCELListener) EnterIdent(ctx *IdentContext) {} - -// ExitIdent is called when production Ident is exited. -func (s *BaseCELListener) ExitIdent(ctx *IdentContext) {} - -// EnterGlobalCall is called when production GlobalCall is entered. -func (s *BaseCELListener) EnterGlobalCall(ctx *GlobalCallContext) {} - -// ExitGlobalCall is called when production GlobalCall is exited. -func (s *BaseCELListener) ExitGlobalCall(ctx *GlobalCallContext) {} - -// EnterNested is called when production Nested is entered. -func (s *BaseCELListener) EnterNested(ctx *NestedContext) {} - -// ExitNested is called when production Nested is exited. -func (s *BaseCELListener) ExitNested(ctx *NestedContext) {} - -// EnterCreateList is called when production CreateList is entered. -func (s *BaseCELListener) EnterCreateList(ctx *CreateListContext) {} - -// ExitCreateList is called when production CreateList is exited. -func (s *BaseCELListener) ExitCreateList(ctx *CreateListContext) {} - -// EnterCreateStruct is called when production CreateStruct is entered. -func (s *BaseCELListener) EnterCreateStruct(ctx *CreateStructContext) {} - -// ExitCreateStruct is called when production CreateStruct is exited. -func (s *BaseCELListener) ExitCreateStruct(ctx *CreateStructContext) {} - -// EnterCreateMessage is called when production CreateMessage is entered. -func (s *BaseCELListener) EnterCreateMessage(ctx *CreateMessageContext) {} - -// ExitCreateMessage is called when production CreateMessage is exited. -func (s *BaseCELListener) ExitCreateMessage(ctx *CreateMessageContext) {} - -// EnterConstantLiteral is called when production ConstantLiteral is entered. -func (s *BaseCELListener) EnterConstantLiteral(ctx *ConstantLiteralContext) {} - -// ExitConstantLiteral is called when production ConstantLiteral is exited. -func (s *BaseCELListener) ExitConstantLiteral(ctx *ConstantLiteralContext) {} - -// EnterExprList is called when production exprList is entered. -func (s *BaseCELListener) EnterExprList(ctx *ExprListContext) {} - -// ExitExprList is called when production exprList is exited. -func (s *BaseCELListener) ExitExprList(ctx *ExprListContext) {} - -// EnterListInit is called when production listInit is entered. -func (s *BaseCELListener) EnterListInit(ctx *ListInitContext) {} - -// ExitListInit is called when production listInit is exited. -func (s *BaseCELListener) ExitListInit(ctx *ListInitContext) {} - -// EnterFieldInitializerList is called when production fieldInitializerList is entered. -func (s *BaseCELListener) EnterFieldInitializerList(ctx *FieldInitializerListContext) {} - -// ExitFieldInitializerList is called when production fieldInitializerList is exited. -func (s *BaseCELListener) ExitFieldInitializerList(ctx *FieldInitializerListContext) {} - -// EnterOptField is called when production optField is entered. -func (s *BaseCELListener) EnterOptField(ctx *OptFieldContext) {} - -// ExitOptField is called when production optField is exited. -func (s *BaseCELListener) ExitOptField(ctx *OptFieldContext) {} - -// EnterMapInitializerList is called when production mapInitializerList is entered. -func (s *BaseCELListener) EnterMapInitializerList(ctx *MapInitializerListContext) {} - -// ExitMapInitializerList is called when production mapInitializerList is exited. -func (s *BaseCELListener) ExitMapInitializerList(ctx *MapInitializerListContext) {} - -// EnterSimpleIdentifier is called when production SimpleIdentifier is entered. -func (s *BaseCELListener) EnterSimpleIdentifier(ctx *SimpleIdentifierContext) {} - -// ExitSimpleIdentifier is called when production SimpleIdentifier is exited. -func (s *BaseCELListener) ExitSimpleIdentifier(ctx *SimpleIdentifierContext) {} - -// EnterEscapedIdentifier is called when production EscapedIdentifier is entered. -func (s *BaseCELListener) EnterEscapedIdentifier(ctx *EscapedIdentifierContext) {} - -// ExitEscapedIdentifier is called when production EscapedIdentifier is exited. -func (s *BaseCELListener) ExitEscapedIdentifier(ctx *EscapedIdentifierContext) {} - -// EnterOptExpr is called when production optExpr is entered. -func (s *BaseCELListener) EnterOptExpr(ctx *OptExprContext) {} - -// ExitOptExpr is called when production optExpr is exited. -func (s *BaseCELListener) ExitOptExpr(ctx *OptExprContext) {} - -// EnterInt is called when production Int is entered. -func (s *BaseCELListener) EnterInt(ctx *IntContext) {} - -// ExitInt is called when production Int is exited. -func (s *BaseCELListener) ExitInt(ctx *IntContext) {} - -// EnterUint is called when production Uint is entered. -func (s *BaseCELListener) EnterUint(ctx *UintContext) {} - -// ExitUint is called when production Uint is exited. -func (s *BaseCELListener) ExitUint(ctx *UintContext) {} - -// EnterDouble is called when production Double is entered. -func (s *BaseCELListener) EnterDouble(ctx *DoubleContext) {} - -// ExitDouble is called when production Double is exited. -func (s *BaseCELListener) ExitDouble(ctx *DoubleContext) {} - -// EnterString is called when production String is entered. -func (s *BaseCELListener) EnterString(ctx *StringContext) {} - -// ExitString is called when production String is exited. -func (s *BaseCELListener) ExitString(ctx *StringContext) {} - -// EnterBytes is called when production Bytes is entered. -func (s *BaseCELListener) EnterBytes(ctx *BytesContext) {} - -// ExitBytes is called when production Bytes is exited. -func (s *BaseCELListener) ExitBytes(ctx *BytesContext) {} - -// EnterBoolTrue is called when production BoolTrue is entered. -func (s *BaseCELListener) EnterBoolTrue(ctx *BoolTrueContext) {} - -// ExitBoolTrue is called when production BoolTrue is exited. -func (s *BaseCELListener) ExitBoolTrue(ctx *BoolTrueContext) {} - -// EnterBoolFalse is called when production BoolFalse is entered. -func (s *BaseCELListener) EnterBoolFalse(ctx *BoolFalseContext) {} - -// ExitBoolFalse is called when production BoolFalse is exited. -func (s *BaseCELListener) ExitBoolFalse(ctx *BoolFalseContext) {} - -// EnterNull is called when production Null is entered. -func (s *BaseCELListener) EnterNull(ctx *NullContext) {} - -// ExitNull is called when production Null is exited. -func (s *BaseCELListener) ExitNull(ctx *NullContext) {} diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go deleted file mode 100644 index 8a12cb65e..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen // CEL -import "github.com/antlr4-go/antlr/v4" - -type BaseCELVisitor struct { - *antlr.BaseParseTreeVisitor -} - -func (v *BaseCELVisitor) VisitStart(ctx *StartContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitExpr(ctx *ExprContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitConditionalOr(ctx *ConditionalOrContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitConditionalAnd(ctx *ConditionalAndContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitRelation(ctx *RelationContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitCalc(ctx *CalcContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitMemberExpr(ctx *MemberExprContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitLogicalNot(ctx *LogicalNotContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitNegate(ctx *NegateContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitMemberCall(ctx *MemberCallContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitSelect(ctx *SelectContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitPrimaryExpr(ctx *PrimaryExprContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitIndex(ctx *IndexContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitIdent(ctx *IdentContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitGlobalCall(ctx *GlobalCallContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitNested(ctx *NestedContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitCreateList(ctx *CreateListContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitCreateStruct(ctx *CreateStructContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitCreateMessage(ctx *CreateMessageContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitConstantLiteral(ctx *ConstantLiteralContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitExprList(ctx *ExprListContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitListInit(ctx *ListInitContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitFieldInitializerList(ctx *FieldInitializerListContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitOptField(ctx *OptFieldContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitMapInitializerList(ctx *MapInitializerListContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitSimpleIdentifier(ctx *SimpleIdentifierContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitEscapedIdentifier(ctx *EscapedIdentifierContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitOptExpr(ctx *OptExprContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitInt(ctx *IntContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitUint(ctx *UintContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitDouble(ctx *DoubleContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitString(ctx *StringContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitBytes(ctx *BytesContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitBoolTrue(ctx *BoolTrueContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitBoolFalse(ctx *BoolFalseContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCELVisitor) VisitNull(ctx *NullContext) interface{} { - return v.VisitChildren(ctx) -} diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go deleted file mode 100644 index 896562f5f..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen - -import ( - "fmt" - "github.com/antlr4-go/antlr/v4" - "sync" - "unicode" -) - -// Suppress unused import error -var _ = fmt.Printf -var _ = sync.Once{} -var _ = unicode.IsLetter - -type CELLexer struct { - *antlr.BaseLexer - channelNames []string - modeNames []string - // TODO: EOF string -} - -var CELLexerLexerStaticData struct { - once sync.Once - serializedATN []int32 - ChannelNames []string - ModeNames []string - LiteralNames []string - SymbolicNames []string - RuleNames []string - PredictionContextCache *antlr.PredictionContextCache - atn *antlr.ATN - decisionToDFA []*antlr.DFA -} - -func cellexerLexerInit() { - staticData := &CELLexerLexerStaticData - staticData.ChannelNames = []string{ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", - } - staticData.ModeNames = []string{ - "DEFAULT_MODE", - } - staticData.LiteralNames = []string{ - "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'", - "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'", - "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'", - } - staticData.SymbolicNames = []string{ - "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS", - "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE", - "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK", - "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE", - "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", - "STRING", "BYTES", "IDENTIFIER", "ESC_IDENTIFIER", - } - staticData.RuleNames = []string{ - "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS", - "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE", - "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK", - "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE", - "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW", - "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ", - "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING", - "BYTES", "IDENTIFIER", "ESC_IDENTIFIER", - } - staticData.PredictionContextCache = antlr.NewPredictionContextCache() - staticData.serializedATN = []int32{ - 4, 0, 37, 435, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, - 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, - 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, - 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, - 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, - 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, - 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, - 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, - 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, - 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, - 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, - 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, - 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, - 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, - 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, - 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 179, 8, 31, 1, 31, - 4, 31, 182, 8, 31, 11, 31, 12, 31, 183, 1, 32, 1, 32, 1, 33, 1, 33, 1, - 34, 1, 34, 1, 34, 1, 34, 3, 34, 194, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, - 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, - 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, - 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 227, 8, 38, 1, 39, 4, - 39, 230, 8, 39, 11, 39, 12, 39, 231, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, - 1, 40, 5, 40, 240, 8, 40, 10, 40, 12, 40, 243, 9, 40, 1, 40, 1, 40, 1, - 41, 4, 41, 248, 8, 41, 11, 41, 12, 41, 249, 1, 41, 1, 41, 4, 41, 254, 8, - 41, 11, 41, 12, 41, 255, 1, 41, 3, 41, 259, 8, 41, 1, 41, 4, 41, 262, 8, - 41, 11, 41, 12, 41, 263, 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 270, 8, 41, - 11, 41, 12, 41, 271, 1, 41, 3, 41, 275, 8, 41, 3, 41, 277, 8, 41, 1, 42, - 4, 42, 280, 8, 42, 11, 42, 12, 42, 281, 1, 42, 1, 42, 1, 42, 1, 42, 4, - 42, 288, 8, 42, 11, 42, 12, 42, 289, 3, 42, 292, 8, 42, 1, 43, 4, 43, 295, - 8, 43, 11, 43, 12, 43, 296, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, - 43, 305, 8, 43, 11, 43, 12, 43, 306, 1, 43, 1, 43, 3, 43, 311, 8, 43, 1, - 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44, - 1, 44, 1, 44, 1, 44, 5, 44, 325, 8, 44, 10, 44, 12, 44, 328, 9, 44, 1, - 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 337, 8, 44, 10, 44, - 12, 44, 340, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, - 44, 1, 44, 5, 44, 351, 8, 44, 10, 44, 12, 44, 354, 9, 44, 1, 44, 1, 44, - 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 362, 8, 44, 10, 44, 12, 44, 365, 9, - 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 372, 8, 44, 10, 44, 12, 44, - 375, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, - 44, 385, 8, 44, 10, 44, 12, 44, 388, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, - 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 400, 8, 44, 10, 44, 12, - 44, 403, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 409, 8, 44, 1, 45, 1, - 45, 1, 45, 1, 46, 1, 46, 3, 46, 416, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, - 421, 8, 46, 10, 46, 12, 46, 424, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 4, - 47, 430, 8, 47, 11, 47, 12, 47, 431, 1, 47, 1, 47, 4, 338, 352, 386, 401, - 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, - 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, - 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, - 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, - 0, 79, 29, 81, 30, 83, 31, 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 95, - 37, 1, 0, 17, 2, 0, 65, 90, 97, 122, 2, 0, 69, 69, 101, 101, 2, 0, 43, - 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 82, 82, 114, 114, 10, - 0, 34, 34, 39, 39, 63, 63, 92, 92, 96, 98, 102, 102, 110, 110, 114, 114, - 116, 116, 118, 118, 2, 0, 88, 88, 120, 120, 3, 0, 9, 10, 12, 13, 32, 32, - 1, 0, 10, 10, 2, 0, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92, - 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, - 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 66, 66, 98, 98, 3, 0, 32, - 32, 45, 47, 95, 95, 471, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, - 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, - 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, - 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, - 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, - 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, - 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, - 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, - 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, - 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 1, - 97, 1, 0, 0, 0, 3, 100, 1, 0, 0, 0, 5, 103, 1, 0, 0, 0, 7, 106, 1, 0, 0, - 0, 9, 108, 1, 0, 0, 0, 11, 111, 1, 0, 0, 0, 13, 114, 1, 0, 0, 0, 15, 116, - 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 122, 1, 0, 0, 0, 21, 124, 1, 0, 0, - 0, 23, 126, 1, 0, 0, 0, 25, 128, 1, 0, 0, 0, 27, 130, 1, 0, 0, 0, 29, 132, - 1, 0, 0, 0, 31, 134, 1, 0, 0, 0, 33, 136, 1, 0, 0, 0, 35, 138, 1, 0, 0, - 0, 37, 140, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 144, 1, 0, 0, 0, 43, 146, - 1, 0, 0, 0, 45, 148, 1, 0, 0, 0, 47, 150, 1, 0, 0, 0, 49, 152, 1, 0, 0, - 0, 51, 154, 1, 0, 0, 0, 53, 159, 1, 0, 0, 0, 55, 165, 1, 0, 0, 0, 57, 170, - 1, 0, 0, 0, 59, 172, 1, 0, 0, 0, 61, 174, 1, 0, 0, 0, 63, 176, 1, 0, 0, - 0, 65, 185, 1, 0, 0, 0, 67, 187, 1, 0, 0, 0, 69, 193, 1, 0, 0, 0, 71, 195, - 1, 0, 0, 0, 73, 198, 1, 0, 0, 0, 75, 203, 1, 0, 0, 0, 77, 226, 1, 0, 0, - 0, 79, 229, 1, 0, 0, 0, 81, 235, 1, 0, 0, 0, 83, 276, 1, 0, 0, 0, 85, 291, - 1, 0, 0, 0, 87, 310, 1, 0, 0, 0, 89, 408, 1, 0, 0, 0, 91, 410, 1, 0, 0, - 0, 93, 415, 1, 0, 0, 0, 95, 425, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99, - 5, 61, 0, 0, 99, 2, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61, - 0, 0, 102, 4, 1, 0, 0, 0, 103, 104, 5, 105, 0, 0, 104, 105, 5, 110, 0, - 0, 105, 6, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 8, 1, 0, 0, 0, 108, - 109, 5, 60, 0, 0, 109, 110, 5, 61, 0, 0, 110, 10, 1, 0, 0, 0, 111, 112, - 5, 62, 0, 0, 112, 113, 5, 61, 0, 0, 113, 12, 1, 0, 0, 0, 114, 115, 5, 62, - 0, 0, 115, 14, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0, - 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 121, 5, 124, 0, 0, 121, - 18, 1, 0, 0, 0, 122, 123, 5, 91, 0, 0, 123, 20, 1, 0, 0, 0, 124, 125, 5, - 93, 0, 0, 125, 22, 1, 0, 0, 0, 126, 127, 5, 123, 0, 0, 127, 24, 1, 0, 0, - 0, 128, 129, 5, 125, 0, 0, 129, 26, 1, 0, 0, 0, 130, 131, 5, 40, 0, 0, - 131, 28, 1, 0, 0, 0, 132, 133, 5, 41, 0, 0, 133, 30, 1, 0, 0, 0, 134, 135, - 5, 46, 0, 0, 135, 32, 1, 0, 0, 0, 136, 137, 5, 44, 0, 0, 137, 34, 1, 0, - 0, 0, 138, 139, 5, 45, 0, 0, 139, 36, 1, 0, 0, 0, 140, 141, 5, 33, 0, 0, - 141, 38, 1, 0, 0, 0, 142, 143, 5, 63, 0, 0, 143, 40, 1, 0, 0, 0, 144, 145, - 5, 58, 0, 0, 145, 42, 1, 0, 0, 0, 146, 147, 5, 43, 0, 0, 147, 44, 1, 0, - 0, 0, 148, 149, 5, 42, 0, 0, 149, 46, 1, 0, 0, 0, 150, 151, 5, 47, 0, 0, - 151, 48, 1, 0, 0, 0, 152, 153, 5, 37, 0, 0, 153, 50, 1, 0, 0, 0, 154, 155, - 5, 116, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 117, 0, 0, 157, 158, - 5, 101, 0, 0, 158, 52, 1, 0, 0, 0, 159, 160, 5, 102, 0, 0, 160, 161, 5, - 97, 0, 0, 161, 162, 5, 108, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, - 101, 0, 0, 164, 54, 1, 0, 0, 0, 165, 166, 5, 110, 0, 0, 166, 167, 5, 117, - 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 108, 0, 0, 169, 56, 1, 0, 0, - 0, 170, 171, 5, 92, 0, 0, 171, 58, 1, 0, 0, 0, 172, 173, 7, 0, 0, 0, 173, - 60, 1, 0, 0, 0, 174, 175, 2, 48, 57, 0, 175, 62, 1, 0, 0, 0, 176, 178, - 7, 1, 0, 0, 177, 179, 7, 2, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, - 0, 0, 179, 181, 1, 0, 0, 0, 180, 182, 3, 61, 30, 0, 181, 180, 1, 0, 0, - 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, - 64, 1, 0, 0, 0, 185, 186, 7, 3, 0, 0, 186, 66, 1, 0, 0, 0, 187, 188, 7, - 4, 0, 0, 188, 68, 1, 0, 0, 0, 189, 194, 3, 71, 35, 0, 190, 194, 3, 75, - 37, 0, 191, 194, 3, 77, 38, 0, 192, 194, 3, 73, 36, 0, 193, 189, 1, 0, - 0, 0, 193, 190, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, - 194, 70, 1, 0, 0, 0, 195, 196, 3, 57, 28, 0, 196, 197, 7, 5, 0, 0, 197, - 72, 1, 0, 0, 0, 198, 199, 3, 57, 28, 0, 199, 200, 2, 48, 51, 0, 200, 201, - 2, 48, 55, 0, 201, 202, 2, 48, 55, 0, 202, 74, 1, 0, 0, 0, 203, 204, 3, - 57, 28, 0, 204, 205, 7, 6, 0, 0, 205, 206, 3, 65, 32, 0, 206, 207, 3, 65, - 32, 0, 207, 76, 1, 0, 0, 0, 208, 209, 3, 57, 28, 0, 209, 210, 5, 117, 0, - 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 213, 3, 65, 32, - 0, 213, 214, 3, 65, 32, 0, 214, 227, 1, 0, 0, 0, 215, 216, 3, 57, 28, 0, - 216, 217, 5, 85, 0, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3, 65, 32, 0, - 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3, 65, 32, 0, - 222, 223, 3, 65, 32, 0, 223, 224, 3, 65, 32, 0, 224, 225, 3, 65, 32, 0, - 225, 227, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 215, 1, 0, 0, 0, 227, - 78, 1, 0, 0, 0, 228, 230, 7, 7, 0, 0, 229, 228, 1, 0, 0, 0, 230, 231, 1, - 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 1, 0, 0, - 0, 233, 234, 6, 39, 0, 0, 234, 80, 1, 0, 0, 0, 235, 236, 5, 47, 0, 0, 236, - 237, 5, 47, 0, 0, 237, 241, 1, 0, 0, 0, 238, 240, 8, 8, 0, 0, 239, 238, - 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, - 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 6, 40, 0, 0, - 245, 82, 1, 0, 0, 0, 246, 248, 3, 61, 30, 0, 247, 246, 1, 0, 0, 0, 248, - 249, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, - 1, 0, 0, 0, 251, 253, 5, 46, 0, 0, 252, 254, 3, 61, 30, 0, 253, 252, 1, - 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, - 0, 256, 258, 1, 0, 0, 0, 257, 259, 3, 63, 31, 0, 258, 257, 1, 0, 0, 0, - 258, 259, 1, 0, 0, 0, 259, 277, 1, 0, 0, 0, 260, 262, 3, 61, 30, 0, 261, - 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, - 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 3, 63, 31, 0, 266, 277, 1, - 0, 0, 0, 267, 269, 5, 46, 0, 0, 268, 270, 3, 61, 30, 0, 269, 268, 1, 0, - 0, 0, 270, 271, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, - 272, 274, 1, 0, 0, 0, 273, 275, 3, 63, 31, 0, 274, 273, 1, 0, 0, 0, 274, - 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 247, 1, 0, 0, 0, 276, 261, - 1, 0, 0, 0, 276, 267, 1, 0, 0, 0, 277, 84, 1, 0, 0, 0, 278, 280, 3, 61, - 30, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, - 281, 282, 1, 0, 0, 0, 282, 292, 1, 0, 0, 0, 283, 284, 5, 48, 0, 0, 284, - 285, 5, 120, 0, 0, 285, 287, 1, 0, 0, 0, 286, 288, 3, 65, 32, 0, 287, 286, - 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, - 0, 0, 290, 292, 1, 0, 0, 0, 291, 279, 1, 0, 0, 0, 291, 283, 1, 0, 0, 0, - 292, 86, 1, 0, 0, 0, 293, 295, 3, 61, 30, 0, 294, 293, 1, 0, 0, 0, 295, - 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 298, - 1, 0, 0, 0, 298, 299, 7, 9, 0, 0, 299, 311, 1, 0, 0, 0, 300, 301, 5, 48, - 0, 0, 301, 302, 5, 120, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 3, 65, 32, - 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, - 307, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 7, 9, 0, 0, 309, 311, - 1, 0, 0, 0, 310, 294, 1, 0, 0, 0, 310, 300, 1, 0, 0, 0, 311, 88, 1, 0, - 0, 0, 312, 317, 5, 34, 0, 0, 313, 316, 3, 69, 34, 0, 314, 316, 8, 10, 0, - 0, 315, 313, 1, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, - 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, - 1, 0, 0, 0, 320, 409, 5, 34, 0, 0, 321, 326, 5, 39, 0, 0, 322, 325, 3, - 69, 34, 0, 323, 325, 8, 11, 0, 0, 324, 322, 1, 0, 0, 0, 324, 323, 1, 0, - 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, - 327, 329, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 329, 409, 5, 39, 0, 0, 330, - 331, 5, 34, 0, 0, 331, 332, 5, 34, 0, 0, 332, 333, 5, 34, 0, 0, 333, 338, - 1, 0, 0, 0, 334, 337, 3, 69, 34, 0, 335, 337, 8, 12, 0, 0, 336, 334, 1, - 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 339, 1, 0, 0, - 0, 338, 336, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, - 342, 5, 34, 0, 0, 342, 343, 5, 34, 0, 0, 343, 409, 5, 34, 0, 0, 344, 345, - 5, 39, 0, 0, 345, 346, 5, 39, 0, 0, 346, 347, 5, 39, 0, 0, 347, 352, 1, - 0, 0, 0, 348, 351, 3, 69, 34, 0, 349, 351, 8, 12, 0, 0, 350, 348, 1, 0, - 0, 0, 350, 349, 1, 0, 0, 0, 351, 354, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, - 352, 350, 1, 0, 0, 0, 353, 355, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 355, - 356, 5, 39, 0, 0, 356, 357, 5, 39, 0, 0, 357, 409, 5, 39, 0, 0, 358, 359, - 3, 67, 33, 0, 359, 363, 5, 34, 0, 0, 360, 362, 8, 13, 0, 0, 361, 360, 1, - 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, - 0, 364, 366, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 366, 367, 5, 34, 0, 0, 367, - 409, 1, 0, 0, 0, 368, 369, 3, 67, 33, 0, 369, 373, 5, 39, 0, 0, 370, 372, - 8, 14, 0, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, - 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, - 376, 377, 5, 39, 0, 0, 377, 409, 1, 0, 0, 0, 378, 379, 3, 67, 33, 0, 379, - 380, 5, 34, 0, 0, 380, 381, 5, 34, 0, 0, 381, 382, 5, 34, 0, 0, 382, 386, - 1, 0, 0, 0, 383, 385, 9, 0, 0, 0, 384, 383, 1, 0, 0, 0, 385, 388, 1, 0, - 0, 0, 386, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, - 388, 386, 1, 0, 0, 0, 389, 390, 5, 34, 0, 0, 390, 391, 5, 34, 0, 0, 391, - 392, 5, 34, 0, 0, 392, 409, 1, 0, 0, 0, 393, 394, 3, 67, 33, 0, 394, 395, - 5, 39, 0, 0, 395, 396, 5, 39, 0, 0, 396, 397, 5, 39, 0, 0, 397, 401, 1, - 0, 0, 0, 398, 400, 9, 0, 0, 0, 399, 398, 1, 0, 0, 0, 400, 403, 1, 0, 0, - 0, 401, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, - 401, 1, 0, 0, 0, 404, 405, 5, 39, 0, 0, 405, 406, 5, 39, 0, 0, 406, 407, - 5, 39, 0, 0, 407, 409, 1, 0, 0, 0, 408, 312, 1, 0, 0, 0, 408, 321, 1, 0, - 0, 0, 408, 330, 1, 0, 0, 0, 408, 344, 1, 0, 0, 0, 408, 358, 1, 0, 0, 0, - 408, 368, 1, 0, 0, 0, 408, 378, 1, 0, 0, 0, 408, 393, 1, 0, 0, 0, 409, - 90, 1, 0, 0, 0, 410, 411, 7, 15, 0, 0, 411, 412, 3, 89, 44, 0, 412, 92, - 1, 0, 0, 0, 413, 416, 3, 59, 29, 0, 414, 416, 5, 95, 0, 0, 415, 413, 1, - 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 422, 1, 0, 0, 0, 417, 421, 3, 59, 29, - 0, 418, 421, 3, 61, 30, 0, 419, 421, 5, 95, 0, 0, 420, 417, 1, 0, 0, 0, - 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, - 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 94, 1, 0, 0, 0, 424, 422, 1, - 0, 0, 0, 425, 429, 5, 96, 0, 0, 426, 430, 3, 59, 29, 0, 427, 430, 3, 61, - 30, 0, 428, 430, 7, 16, 0, 0, 429, 426, 1, 0, 0, 0, 429, 427, 1, 0, 0, - 0, 429, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 431, - 432, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 434, 5, 96, 0, 0, 434, 96, - 1, 0, 0, 0, 38, 0, 178, 183, 193, 226, 231, 241, 249, 255, 258, 263, 271, - 274, 276, 281, 289, 291, 296, 306, 310, 315, 317, 324, 326, 336, 338, 350, - 352, 363, 373, 386, 401, 408, 415, 420, 422, 429, 431, 1, 0, 1, 0, - } - deserializer := antlr.NewATNDeserializer(nil) - staticData.atn = deserializer.Deserialize(staticData.serializedATN) - atn := staticData.atn - staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) - decisionToDFA := staticData.decisionToDFA - for index, state := range atn.DecisionToState { - decisionToDFA[index] = antlr.NewDFA(state, index) - } -} - -// CELLexerInit initializes any static state used to implement CELLexer. By default the -// static state used to implement the lexer is lazily initialized during the first call to -// NewCELLexer(). You can call this function if you wish to initialize the static state ahead -// of time. -func CELLexerInit() { - staticData := &CELLexerLexerStaticData - staticData.once.Do(cellexerLexerInit) -} - -// NewCELLexer produces a new lexer instance for the optional input antlr.CharStream. -func NewCELLexer(input antlr.CharStream) *CELLexer { - CELLexerInit() - l := new(CELLexer) - l.BaseLexer = antlr.NewBaseLexer(input) - staticData := &CELLexerLexerStaticData - l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) - l.channelNames = staticData.ChannelNames - l.modeNames = staticData.ModeNames - l.RuleNames = staticData.RuleNames - l.LiteralNames = staticData.LiteralNames - l.SymbolicNames = staticData.SymbolicNames - l.GrammarFileName = "CEL.g4" - // TODO: l.EOF = antlr.TokenEOF - - return l -} - -// CELLexer tokens. -const ( - CELLexerEQUALS = 1 - CELLexerNOT_EQUALS = 2 - CELLexerIN = 3 - CELLexerLESS = 4 - CELLexerLESS_EQUALS = 5 - CELLexerGREATER_EQUALS = 6 - CELLexerGREATER = 7 - CELLexerLOGICAL_AND = 8 - CELLexerLOGICAL_OR = 9 - CELLexerLBRACKET = 10 - CELLexerRPRACKET = 11 - CELLexerLBRACE = 12 - CELLexerRBRACE = 13 - CELLexerLPAREN = 14 - CELLexerRPAREN = 15 - CELLexerDOT = 16 - CELLexerCOMMA = 17 - CELLexerMINUS = 18 - CELLexerEXCLAM = 19 - CELLexerQUESTIONMARK = 20 - CELLexerCOLON = 21 - CELLexerPLUS = 22 - CELLexerSTAR = 23 - CELLexerSLASH = 24 - CELLexerPERCENT = 25 - CELLexerCEL_TRUE = 26 - CELLexerCEL_FALSE = 27 - CELLexerNUL = 28 - CELLexerWHITESPACE = 29 - CELLexerCOMMENT = 30 - CELLexerNUM_FLOAT = 31 - CELLexerNUM_INT = 32 - CELLexerNUM_UINT = 33 - CELLexerSTRING = 34 - CELLexerBYTES = 35 - CELLexerIDENTIFIER = 36 - CELLexerESC_IDENTIFIER = 37 -) diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go deleted file mode 100644 index da477c4b7..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen // CEL -import "github.com/antlr4-go/antlr/v4" - -// CELListener is a complete listener for a parse tree produced by CELParser. -type CELListener interface { - antlr.ParseTreeListener - - // EnterStart is called when entering the start production. - EnterStart(c *StartContext) - - // EnterExpr is called when entering the expr production. - EnterExpr(c *ExprContext) - - // EnterConditionalOr is called when entering the conditionalOr production. - EnterConditionalOr(c *ConditionalOrContext) - - // EnterConditionalAnd is called when entering the conditionalAnd production. - EnterConditionalAnd(c *ConditionalAndContext) - - // EnterRelation is called when entering the relation production. - EnterRelation(c *RelationContext) - - // EnterCalc is called when entering the calc production. - EnterCalc(c *CalcContext) - - // EnterMemberExpr is called when entering the MemberExpr production. - EnterMemberExpr(c *MemberExprContext) - - // EnterLogicalNot is called when entering the LogicalNot production. - EnterLogicalNot(c *LogicalNotContext) - - // EnterNegate is called when entering the Negate production. - EnterNegate(c *NegateContext) - - // EnterMemberCall is called when entering the MemberCall production. - EnterMemberCall(c *MemberCallContext) - - // EnterSelect is called when entering the Select production. - EnterSelect(c *SelectContext) - - // EnterPrimaryExpr is called when entering the PrimaryExpr production. - EnterPrimaryExpr(c *PrimaryExprContext) - - // EnterIndex is called when entering the Index production. - EnterIndex(c *IndexContext) - - // EnterIdent is called when entering the Ident production. - EnterIdent(c *IdentContext) - - // EnterGlobalCall is called when entering the GlobalCall production. - EnterGlobalCall(c *GlobalCallContext) - - // EnterNested is called when entering the Nested production. - EnterNested(c *NestedContext) - - // EnterCreateList is called when entering the CreateList production. - EnterCreateList(c *CreateListContext) - - // EnterCreateStruct is called when entering the CreateStruct production. - EnterCreateStruct(c *CreateStructContext) - - // EnterCreateMessage is called when entering the CreateMessage production. - EnterCreateMessage(c *CreateMessageContext) - - // EnterConstantLiteral is called when entering the ConstantLiteral production. - EnterConstantLiteral(c *ConstantLiteralContext) - - // EnterExprList is called when entering the exprList production. - EnterExprList(c *ExprListContext) - - // EnterListInit is called when entering the listInit production. - EnterListInit(c *ListInitContext) - - // EnterFieldInitializerList is called when entering the fieldInitializerList production. - EnterFieldInitializerList(c *FieldInitializerListContext) - - // EnterOptField is called when entering the optField production. - EnterOptField(c *OptFieldContext) - - // EnterMapInitializerList is called when entering the mapInitializerList production. - EnterMapInitializerList(c *MapInitializerListContext) - - // EnterSimpleIdentifier is called when entering the SimpleIdentifier production. - EnterSimpleIdentifier(c *SimpleIdentifierContext) - - // EnterEscapedIdentifier is called when entering the EscapedIdentifier production. - EnterEscapedIdentifier(c *EscapedIdentifierContext) - - // EnterOptExpr is called when entering the optExpr production. - EnterOptExpr(c *OptExprContext) - - // EnterInt is called when entering the Int production. - EnterInt(c *IntContext) - - // EnterUint is called when entering the Uint production. - EnterUint(c *UintContext) - - // EnterDouble is called when entering the Double production. - EnterDouble(c *DoubleContext) - - // EnterString is called when entering the String production. - EnterString(c *StringContext) - - // EnterBytes is called when entering the Bytes production. - EnterBytes(c *BytesContext) - - // EnterBoolTrue is called when entering the BoolTrue production. - EnterBoolTrue(c *BoolTrueContext) - - // EnterBoolFalse is called when entering the BoolFalse production. - EnterBoolFalse(c *BoolFalseContext) - - // EnterNull is called when entering the Null production. - EnterNull(c *NullContext) - - // ExitStart is called when exiting the start production. - ExitStart(c *StartContext) - - // ExitExpr is called when exiting the expr production. - ExitExpr(c *ExprContext) - - // ExitConditionalOr is called when exiting the conditionalOr production. - ExitConditionalOr(c *ConditionalOrContext) - - // ExitConditionalAnd is called when exiting the conditionalAnd production. - ExitConditionalAnd(c *ConditionalAndContext) - - // ExitRelation is called when exiting the relation production. - ExitRelation(c *RelationContext) - - // ExitCalc is called when exiting the calc production. - ExitCalc(c *CalcContext) - - // ExitMemberExpr is called when exiting the MemberExpr production. - ExitMemberExpr(c *MemberExprContext) - - // ExitLogicalNot is called when exiting the LogicalNot production. - ExitLogicalNot(c *LogicalNotContext) - - // ExitNegate is called when exiting the Negate production. - ExitNegate(c *NegateContext) - - // ExitMemberCall is called when exiting the MemberCall production. - ExitMemberCall(c *MemberCallContext) - - // ExitSelect is called when exiting the Select production. - ExitSelect(c *SelectContext) - - // ExitPrimaryExpr is called when exiting the PrimaryExpr production. - ExitPrimaryExpr(c *PrimaryExprContext) - - // ExitIndex is called when exiting the Index production. - ExitIndex(c *IndexContext) - - // ExitIdent is called when exiting the Ident production. - ExitIdent(c *IdentContext) - - // ExitGlobalCall is called when exiting the GlobalCall production. - ExitGlobalCall(c *GlobalCallContext) - - // ExitNested is called when exiting the Nested production. - ExitNested(c *NestedContext) - - // ExitCreateList is called when exiting the CreateList production. - ExitCreateList(c *CreateListContext) - - // ExitCreateStruct is called when exiting the CreateStruct production. - ExitCreateStruct(c *CreateStructContext) - - // ExitCreateMessage is called when exiting the CreateMessage production. - ExitCreateMessage(c *CreateMessageContext) - - // ExitConstantLiteral is called when exiting the ConstantLiteral production. - ExitConstantLiteral(c *ConstantLiteralContext) - - // ExitExprList is called when exiting the exprList production. - ExitExprList(c *ExprListContext) - - // ExitListInit is called when exiting the listInit production. - ExitListInit(c *ListInitContext) - - // ExitFieldInitializerList is called when exiting the fieldInitializerList production. - ExitFieldInitializerList(c *FieldInitializerListContext) - - // ExitOptField is called when exiting the optField production. - ExitOptField(c *OptFieldContext) - - // ExitMapInitializerList is called when exiting the mapInitializerList production. - ExitMapInitializerList(c *MapInitializerListContext) - - // ExitSimpleIdentifier is called when exiting the SimpleIdentifier production. - ExitSimpleIdentifier(c *SimpleIdentifierContext) - - // ExitEscapedIdentifier is called when exiting the EscapedIdentifier production. - ExitEscapedIdentifier(c *EscapedIdentifierContext) - - // ExitOptExpr is called when exiting the optExpr production. - ExitOptExpr(c *OptExprContext) - - // ExitInt is called when exiting the Int production. - ExitInt(c *IntContext) - - // ExitUint is called when exiting the Uint production. - ExitUint(c *UintContext) - - // ExitDouble is called when exiting the Double production. - ExitDouble(c *DoubleContext) - - // ExitString is called when exiting the String production. - ExitString(c *StringContext) - - // ExitBytes is called when exiting the Bytes production. - ExitBytes(c *BytesContext) - - // ExitBoolTrue is called when exiting the BoolTrue production. - ExitBoolTrue(c *BoolTrueContext) - - // ExitBoolFalse is called when exiting the BoolFalse production. - ExitBoolFalse(c *BoolFalseContext) - - // ExitNull is called when exiting the Null production. - ExitNull(c *NullContext) -} diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go deleted file mode 100644 index 38693df58..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go +++ /dev/null @@ -1,6197 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen // CEL -import ( - "fmt" - "strconv" - "sync" - - "github.com/antlr4-go/antlr/v4" -) - -// Suppress unused import errors -var _ = fmt.Printf -var _ = strconv.Itoa -var _ = sync.Once{} - -type CELParser struct { - *antlr.BaseParser -} - -var CELParserStaticData struct { - once sync.Once - serializedATN []int32 - LiteralNames []string - SymbolicNames []string - RuleNames []string - PredictionContextCache *antlr.PredictionContextCache - atn *antlr.ATN - decisionToDFA []*antlr.DFA -} - -func celParserInit() { - staticData := &CELParserStaticData - staticData.LiteralNames = []string{ - "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'", - "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'", - "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'", - } - staticData.SymbolicNames = []string{ - "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS", - "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE", - "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK", - "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE", - "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", - "STRING", "BYTES", "IDENTIFIER", "ESC_IDENTIFIER", - } - staticData.RuleNames = []string{ - "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc", - "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList", - "optField", "mapInitializerList", "escapeIdent", "optExpr", "literal", - } - staticData.PredictionContextCache = antlr.NewPredictionContextCache() - staticData.serializedATN = []int32{ - 4, 1, 37, 259, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, - 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, - 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, - 2, 16, 7, 16, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 44, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 49, 8, 2, 10, 2, 12, 2, 52, 9, 2, - 1, 3, 1, 3, 1, 3, 5, 3, 57, 8, 3, 10, 3, 12, 3, 60, 9, 3, 1, 4, 1, 4, 1, - 4, 1, 4, 1, 4, 1, 4, 5, 4, 68, 8, 4, 10, 4, 12, 4, 71, 9, 4, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 82, 8, 5, 10, 5, 12, 5, - 85, 9, 5, 1, 6, 1, 6, 4, 6, 89, 8, 6, 11, 6, 12, 6, 90, 1, 6, 1, 6, 4, - 6, 95, 8, 6, 11, 6, 12, 6, 96, 1, 6, 3, 6, 100, 8, 6, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 3, 7, 108, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, - 3, 7, 116, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 122, 8, 7, 1, 7, 1, 7, 1, - 7, 5, 7, 127, 8, 7, 10, 7, 12, 7, 130, 9, 7, 1, 8, 3, 8, 133, 8, 8, 1, - 8, 1, 8, 3, 8, 137, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 142, 8, 8, 1, 8, 1, 8, - 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 151, 8, 8, 1, 8, 3, 8, 154, 8, 8, 1, - 8, 1, 8, 1, 8, 3, 8, 159, 8, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 3, 8, - 166, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 171, 8, 8, 10, 8, 12, 8, 174, 9, 8, - 1, 8, 1, 8, 3, 8, 178, 8, 8, 1, 8, 3, 8, 181, 8, 8, 1, 8, 1, 8, 3, 8, 185, - 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 190, 8, 9, 10, 9, 12, 9, 193, 9, 9, 1, 10, - 1, 10, 1, 10, 5, 10, 198, 8, 10, 10, 10, 12, 10, 201, 9, 10, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 211, 8, 11, 10, 11, - 12, 11, 214, 9, 11, 1, 12, 3, 12, 217, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 229, 8, 13, 10, 13, 12, - 13, 232, 9, 13, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 3, 15, 239, 8, - 15, 1, 15, 1, 15, 1, 16, 3, 16, 244, 8, 16, 1, 16, 1, 16, 1, 16, 3, 16, - 249, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 257, 8, 16, - 1, 16, 0, 3, 8, 10, 14, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, - 24, 26, 28, 30, 32, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22, - 290, 0, 34, 1, 0, 0, 0, 2, 37, 1, 0, 0, 0, 4, 45, 1, 0, 0, 0, 6, 53, 1, - 0, 0, 0, 8, 61, 1, 0, 0, 0, 10, 72, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, - 101, 1, 0, 0, 0, 16, 184, 1, 0, 0, 0, 18, 186, 1, 0, 0, 0, 20, 194, 1, - 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, - 28, 235, 1, 0, 0, 0, 30, 238, 1, 0, 0, 0, 32, 256, 1, 0, 0, 0, 34, 35, - 3, 2, 1, 0, 35, 36, 5, 0, 0, 1, 36, 1, 1, 0, 0, 0, 37, 43, 3, 4, 2, 0, - 38, 39, 5, 20, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 5, 21, 0, 0, 41, 42, 3, - 2, 1, 0, 42, 44, 1, 0, 0, 0, 43, 38, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, - 3, 1, 0, 0, 0, 45, 50, 3, 6, 3, 0, 46, 47, 5, 9, 0, 0, 47, 49, 3, 6, 3, - 0, 48, 46, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, - 1, 0, 0, 0, 51, 5, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 58, 3, 8, 4, 0, - 54, 55, 5, 8, 0, 0, 55, 57, 3, 8, 4, 0, 56, 54, 1, 0, 0, 0, 57, 60, 1, - 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 7, 1, 0, 0, 0, 60, - 58, 1, 0, 0, 0, 61, 62, 6, 4, -1, 0, 62, 63, 3, 10, 5, 0, 63, 69, 1, 0, - 0, 0, 64, 65, 10, 1, 0, 0, 65, 66, 7, 0, 0, 0, 66, 68, 3, 8, 4, 2, 67, - 64, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, - 0, 70, 9, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 6, 5, -1, 0, 73, 74, - 3, 12, 6, 0, 74, 83, 1, 0, 0, 0, 75, 76, 10, 2, 0, 0, 76, 77, 7, 1, 0, - 0, 77, 82, 3, 10, 5, 3, 78, 79, 10, 1, 0, 0, 79, 80, 7, 2, 0, 0, 80, 82, - 3, 10, 5, 2, 81, 75, 1, 0, 0, 0, 81, 78, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, - 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 83, 1, - 0, 0, 0, 86, 100, 3, 14, 7, 0, 87, 89, 5, 19, 0, 0, 88, 87, 1, 0, 0, 0, - 89, 90, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, - 0, 0, 0, 92, 100, 3, 14, 7, 0, 93, 95, 5, 18, 0, 0, 94, 93, 1, 0, 0, 0, - 95, 96, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, - 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 86, 1, 0, 0, 0, 99, 88, 1, 0, 0, 0, - 99, 94, 1, 0, 0, 0, 100, 13, 1, 0, 0, 0, 101, 102, 6, 7, -1, 0, 102, 103, - 3, 16, 8, 0, 103, 128, 1, 0, 0, 0, 104, 105, 10, 3, 0, 0, 105, 107, 5, - 16, 0, 0, 106, 108, 5, 20, 0, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0, - 0, 0, 108, 109, 1, 0, 0, 0, 109, 127, 3, 28, 14, 0, 110, 111, 10, 2, 0, - 0, 111, 112, 5, 16, 0, 0, 112, 113, 5, 36, 0, 0, 113, 115, 5, 14, 0, 0, - 114, 116, 3, 18, 9, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, - 117, 1, 0, 0, 0, 117, 127, 5, 15, 0, 0, 118, 119, 10, 1, 0, 0, 119, 121, - 5, 10, 0, 0, 120, 122, 5, 20, 0, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1, - 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 3, 2, 1, 0, 124, 125, 5, 11, 0, - 0, 125, 127, 1, 0, 0, 0, 126, 104, 1, 0, 0, 0, 126, 110, 1, 0, 0, 0, 126, - 118, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, - 1, 0, 0, 0, 129, 15, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 133, 5, 16, - 0, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, - 134, 185, 5, 36, 0, 0, 135, 137, 5, 16, 0, 0, 136, 135, 1, 0, 0, 0, 136, - 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 36, 0, 0, 139, 141, - 5, 14, 0, 0, 140, 142, 3, 18, 9, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, - 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 185, 5, 15, 0, 0, 144, 145, 5, 14, - 0, 0, 145, 146, 3, 2, 1, 0, 146, 147, 5, 15, 0, 0, 147, 185, 1, 0, 0, 0, - 148, 150, 5, 10, 0, 0, 149, 151, 3, 20, 10, 0, 150, 149, 1, 0, 0, 0, 150, - 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 5, 17, 0, 0, 153, 152, - 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 185, 5, 11, - 0, 0, 156, 158, 5, 12, 0, 0, 157, 159, 3, 26, 13, 0, 158, 157, 1, 0, 0, - 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 162, 5, 17, 0, 0, 161, - 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 185, - 5, 13, 0, 0, 164, 166, 5, 16, 0, 0, 165, 164, 1, 0, 0, 0, 165, 166, 1, - 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 172, 5, 36, 0, 0, 168, 169, 5, 16, - 0, 0, 169, 171, 5, 36, 0, 0, 170, 168, 1, 0, 0, 0, 171, 174, 1, 0, 0, 0, - 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174, - 172, 1, 0, 0, 0, 175, 177, 5, 12, 0, 0, 176, 178, 3, 22, 11, 0, 177, 176, - 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 181, 5, 17, - 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, - 182, 185, 5, 13, 0, 0, 183, 185, 3, 32, 16, 0, 184, 132, 1, 0, 0, 0, 184, - 136, 1, 0, 0, 0, 184, 144, 1, 0, 0, 0, 184, 148, 1, 0, 0, 0, 184, 156, - 1, 0, 0, 0, 184, 165, 1, 0, 0, 0, 184, 183, 1, 0, 0, 0, 185, 17, 1, 0, - 0, 0, 186, 191, 3, 2, 1, 0, 187, 188, 5, 17, 0, 0, 188, 190, 3, 2, 1, 0, - 189, 187, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, - 192, 1, 0, 0, 0, 192, 19, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 199, 3, - 30, 15, 0, 195, 196, 5, 17, 0, 0, 196, 198, 3, 30, 15, 0, 197, 195, 1, - 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, - 0, 200, 21, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 24, 12, 0, 203, - 204, 5, 21, 0, 0, 204, 212, 3, 2, 1, 0, 205, 206, 5, 17, 0, 0, 206, 207, - 3, 24, 12, 0, 207, 208, 5, 21, 0, 0, 208, 209, 3, 2, 1, 0, 209, 211, 1, - 0, 0, 0, 210, 205, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, - 0, 212, 213, 1, 0, 0, 0, 213, 23, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, - 217, 5, 20, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218, - 1, 0, 0, 0, 218, 219, 3, 28, 14, 0, 219, 25, 1, 0, 0, 0, 220, 221, 3, 30, - 15, 0, 221, 222, 5, 21, 0, 0, 222, 230, 3, 2, 1, 0, 223, 224, 5, 17, 0, - 0, 224, 225, 3, 30, 15, 0, 225, 226, 5, 21, 0, 0, 226, 227, 3, 2, 1, 0, - 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, - 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 27, 1, 0, 0, 0, 232, 230, 1, - 0, 0, 0, 233, 236, 5, 36, 0, 0, 234, 236, 5, 37, 0, 0, 235, 233, 1, 0, - 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 20, 0, 0, - 238, 237, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, - 241, 3, 2, 1, 0, 241, 31, 1, 0, 0, 0, 242, 244, 5, 18, 0, 0, 243, 242, - 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 257, 5, 32, - 0, 0, 246, 257, 5, 33, 0, 0, 247, 249, 5, 18, 0, 0, 248, 247, 1, 0, 0, - 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 257, 5, 31, 0, 0, 251, - 257, 5, 34, 0, 0, 252, 257, 5, 35, 0, 0, 253, 257, 5, 26, 0, 0, 254, 257, - 5, 27, 0, 0, 255, 257, 5, 28, 0, 0, 256, 243, 1, 0, 0, 0, 256, 246, 1, - 0, 0, 0, 256, 248, 1, 0, 0, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0, - 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, - 33, 1, 0, 0, 0, 36, 43, 50, 58, 69, 81, 83, 90, 96, 99, 107, 115, 121, - 126, 128, 132, 136, 141, 150, 153, 158, 161, 165, 172, 177, 180, 184, 191, - 199, 212, 216, 230, 235, 238, 243, 248, 256, - } - deserializer := antlr.NewATNDeserializer(nil) - staticData.atn = deserializer.Deserialize(staticData.serializedATN) - atn := staticData.atn - staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) - decisionToDFA := staticData.decisionToDFA - for index, state := range atn.DecisionToState { - decisionToDFA[index] = antlr.NewDFA(state, index) - } -} - -// CELParserInit initializes any static state used to implement CELParser. By default the -// static state used to implement the parser is lazily initialized during the first call to -// NewCELParser(). You can call this function if you wish to initialize the static state ahead -// of time. -func CELParserInit() { - staticData := &CELParserStaticData - staticData.once.Do(celParserInit) -} - -// NewCELParser produces a new parser instance for the optional input antlr.TokenStream. -func NewCELParser(input antlr.TokenStream) *CELParser { - CELParserInit() - this := new(CELParser) - this.BaseParser = antlr.NewBaseParser(input) - staticData := &CELParserStaticData - this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) - this.RuleNames = staticData.RuleNames - this.LiteralNames = staticData.LiteralNames - this.SymbolicNames = staticData.SymbolicNames - this.GrammarFileName = "CEL.g4" - - return this -} - -// CELParser tokens. -const ( - CELParserEOF = antlr.TokenEOF - CELParserEQUALS = 1 - CELParserNOT_EQUALS = 2 - CELParserIN = 3 - CELParserLESS = 4 - CELParserLESS_EQUALS = 5 - CELParserGREATER_EQUALS = 6 - CELParserGREATER = 7 - CELParserLOGICAL_AND = 8 - CELParserLOGICAL_OR = 9 - CELParserLBRACKET = 10 - CELParserRPRACKET = 11 - CELParserLBRACE = 12 - CELParserRBRACE = 13 - CELParserLPAREN = 14 - CELParserRPAREN = 15 - CELParserDOT = 16 - CELParserCOMMA = 17 - CELParserMINUS = 18 - CELParserEXCLAM = 19 - CELParserQUESTIONMARK = 20 - CELParserCOLON = 21 - CELParserPLUS = 22 - CELParserSTAR = 23 - CELParserSLASH = 24 - CELParserPERCENT = 25 - CELParserCEL_TRUE = 26 - CELParserCEL_FALSE = 27 - CELParserNUL = 28 - CELParserWHITESPACE = 29 - CELParserCOMMENT = 30 - CELParserNUM_FLOAT = 31 - CELParserNUM_INT = 32 - CELParserNUM_UINT = 33 - CELParserSTRING = 34 - CELParserBYTES = 35 - CELParserIDENTIFIER = 36 - CELParserESC_IDENTIFIER = 37 -) - -// CELParser rules. -const ( - CELParserRULE_start = 0 - CELParserRULE_expr = 1 - CELParserRULE_conditionalOr = 2 - CELParserRULE_conditionalAnd = 3 - CELParserRULE_relation = 4 - CELParserRULE_calc = 5 - CELParserRULE_unary = 6 - CELParserRULE_member = 7 - CELParserRULE_primary = 8 - CELParserRULE_exprList = 9 - CELParserRULE_listInit = 10 - CELParserRULE_fieldInitializerList = 11 - CELParserRULE_optField = 12 - CELParserRULE_mapInitializerList = 13 - CELParserRULE_escapeIdent = 14 - CELParserRULE_optExpr = 15 - CELParserRULE_literal = 16 -) - -// IStartContext is an interface to support dynamic dispatch. -type IStartContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetE returns the e rule contexts. - GetE() IExprContext - - // SetE sets the e rule contexts. - SetE(IExprContext) - - // Getter signatures - EOF() antlr.TerminalNode - Expr() IExprContext - - // IsStartContext differentiates from other interfaces. - IsStartContext() -} - -type StartContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - e IExprContext -} - -func NewEmptyStartContext() *StartContext { - var p = new(StartContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_start - return p -} - -func InitEmptyStartContext(p *StartContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_start -} - -func (*StartContext) IsStartContext() {} - -func NewStartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartContext { - var p = new(StartContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_start - - return p -} - -func (s *StartContext) GetParser() antlr.Parser { return s.parser } - -func (s *StartContext) GetE() IExprContext { return s.e } - -func (s *StartContext) SetE(v IExprContext) { s.e = v } - -func (s *StartContext) EOF() antlr.TerminalNode { - return s.GetToken(CELParserEOF, 0) -} - -func (s *StartContext) Expr() IExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *StartContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *StartContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterStart(s) - } -} - -func (s *StartContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitStart(s) - } -} - -func (s *StartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitStart(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Start_() (localctx IStartContext) { - localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 0, CELParserRULE_start) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(34) - - var _x = p.Expr() - - localctx.(*StartContext).e = _x - } - { - p.SetState(35) - p.Match(CELParserEOF) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IExprContext is an interface to support dynamic dispatch. -type IExprContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetOp returns the op token. - GetOp() antlr.Token - - // SetOp sets the op token. - SetOp(antlr.Token) - - // GetE returns the e rule contexts. - GetE() IConditionalOrContext - - // GetE1 returns the e1 rule contexts. - GetE1() IConditionalOrContext - - // GetE2 returns the e2 rule contexts. - GetE2() IExprContext - - // SetE sets the e rule contexts. - SetE(IConditionalOrContext) - - // SetE1 sets the e1 rule contexts. - SetE1(IConditionalOrContext) - - // SetE2 sets the e2 rule contexts. - SetE2(IExprContext) - - // Getter signatures - AllConditionalOr() []IConditionalOrContext - ConditionalOr(i int) IConditionalOrContext - COLON() antlr.TerminalNode - QUESTIONMARK() antlr.TerminalNode - Expr() IExprContext - - // IsExprContext differentiates from other interfaces. - IsExprContext() -} - -type ExprContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - e IConditionalOrContext - op antlr.Token - e1 IConditionalOrContext - e2 IExprContext -} - -func NewEmptyExprContext() *ExprContext { - var p = new(ExprContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_expr - return p -} - -func InitEmptyExprContext(p *ExprContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_expr -} - -func (*ExprContext) IsExprContext() {} - -func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { - var p = new(ExprContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_expr - - return p -} - -func (s *ExprContext) GetParser() antlr.Parser { return s.parser } - -func (s *ExprContext) GetOp() antlr.Token { return s.op } - -func (s *ExprContext) SetOp(v antlr.Token) { s.op = v } - -func (s *ExprContext) GetE() IConditionalOrContext { return s.e } - -func (s *ExprContext) GetE1() IConditionalOrContext { return s.e1 } - -func (s *ExprContext) GetE2() IExprContext { return s.e2 } - -func (s *ExprContext) SetE(v IConditionalOrContext) { s.e = v } - -func (s *ExprContext) SetE1(v IConditionalOrContext) { s.e1 = v } - -func (s *ExprContext) SetE2(v IExprContext) { s.e2 = v } - -func (s *ExprContext) AllConditionalOr() []IConditionalOrContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IConditionalOrContext); ok { - len++ - } - } - - tst := make([]IConditionalOrContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IConditionalOrContext); ok { - tst[i] = t.(IConditionalOrContext) - i++ - } - } - - return tst -} - -func (s *ExprContext) ConditionalOr(i int) IConditionalOrContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConditionalOrContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IConditionalOrContext) -} - -func (s *ExprContext) COLON() antlr.TerminalNode { - return s.GetToken(CELParserCOLON, 0) -} - -func (s *ExprContext) QUESTIONMARK() antlr.TerminalNode { - return s.GetToken(CELParserQUESTIONMARK, 0) -} - -func (s *ExprContext) Expr() IExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *ExprContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterExpr(s) - } -} - -func (s *ExprContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitExpr(s) - } -} - -func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitExpr(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Expr() (localctx IExprContext) { - localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 2, CELParserRULE_expr) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(37) - - var _x = p.ConditionalOr() - - localctx.(*ExprContext).e = _x - } - p.SetState(43) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserQUESTIONMARK { - { - p.SetState(38) - - var _m = p.Match(CELParserQUESTIONMARK) - - localctx.(*ExprContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(39) - - var _x = p.ConditionalOr() - - localctx.(*ExprContext).e1 = _x - } - { - p.SetState(40) - p.Match(CELParserCOLON) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(41) - - var _x = p.Expr() - - localctx.(*ExprContext).e2 = _x - } - - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IConditionalOrContext is an interface to support dynamic dispatch. -type IConditionalOrContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetS9 returns the s9 token. - GetS9() antlr.Token - - // SetS9 sets the s9 token. - SetS9(antlr.Token) - - // GetOps returns the ops token list. - GetOps() []antlr.Token - - // SetOps sets the ops token list. - SetOps([]antlr.Token) - - // GetE returns the e rule contexts. - GetE() IConditionalAndContext - - // Get_conditionalAnd returns the _conditionalAnd rule contexts. - Get_conditionalAnd() IConditionalAndContext - - // SetE sets the e rule contexts. - SetE(IConditionalAndContext) - - // Set_conditionalAnd sets the _conditionalAnd rule contexts. - Set_conditionalAnd(IConditionalAndContext) - - // GetE1 returns the e1 rule context list. - GetE1() []IConditionalAndContext - - // SetE1 sets the e1 rule context list. - SetE1([]IConditionalAndContext) - - // Getter signatures - AllConditionalAnd() []IConditionalAndContext - ConditionalAnd(i int) IConditionalAndContext - AllLOGICAL_OR() []antlr.TerminalNode - LOGICAL_OR(i int) antlr.TerminalNode - - // IsConditionalOrContext differentiates from other interfaces. - IsConditionalOrContext() -} - -type ConditionalOrContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - e IConditionalAndContext - s9 antlr.Token - ops []antlr.Token - _conditionalAnd IConditionalAndContext - e1 []IConditionalAndContext -} - -func NewEmptyConditionalOrContext() *ConditionalOrContext { - var p = new(ConditionalOrContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_conditionalOr - return p -} - -func InitEmptyConditionalOrContext(p *ConditionalOrContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_conditionalOr -} - -func (*ConditionalOrContext) IsConditionalOrContext() {} - -func NewConditionalOrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalOrContext { - var p = new(ConditionalOrContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_conditionalOr - - return p -} - -func (s *ConditionalOrContext) GetParser() antlr.Parser { return s.parser } - -func (s *ConditionalOrContext) GetS9() antlr.Token { return s.s9 } - -func (s *ConditionalOrContext) SetS9(v antlr.Token) { s.s9 = v } - -func (s *ConditionalOrContext) GetOps() []antlr.Token { return s.ops } - -func (s *ConditionalOrContext) SetOps(v []antlr.Token) { s.ops = v } - -func (s *ConditionalOrContext) GetE() IConditionalAndContext { return s.e } - -func (s *ConditionalOrContext) Get_conditionalAnd() IConditionalAndContext { return s._conditionalAnd } - -func (s *ConditionalOrContext) SetE(v IConditionalAndContext) { s.e = v } - -func (s *ConditionalOrContext) Set_conditionalAnd(v IConditionalAndContext) { s._conditionalAnd = v } - -func (s *ConditionalOrContext) GetE1() []IConditionalAndContext { return s.e1 } - -func (s *ConditionalOrContext) SetE1(v []IConditionalAndContext) { s.e1 = v } - -func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IConditionalAndContext); ok { - len++ - } - } - - tst := make([]IConditionalAndContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IConditionalAndContext); ok { - tst[i] = t.(IConditionalAndContext) - i++ - } - } - - return tst -} - -func (s *ConditionalOrContext) ConditionalAnd(i int) IConditionalAndContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConditionalAndContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IConditionalAndContext) -} - -func (s *ConditionalOrContext) AllLOGICAL_OR() []antlr.TerminalNode { - return s.GetTokens(CELParserLOGICAL_OR) -} - -func (s *ConditionalOrContext) LOGICAL_OR(i int) antlr.TerminalNode { - return s.GetToken(CELParserLOGICAL_OR, i) -} - -func (s *ConditionalOrContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ConditionalOrContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ConditionalOrContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterConditionalOr(s) - } -} - -func (s *ConditionalOrContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitConditionalOr(s) - } -} - -func (s *ConditionalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitConditionalOr(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) { - localctx = NewConditionalOrContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 4, CELParserRULE_conditionalOr) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(45) - - var _x = p.ConditionalAnd() - - localctx.(*ConditionalOrContext).e = _x - } - p.SetState(50) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CELParserLOGICAL_OR { - { - p.SetState(46) - - var _m = p.Match(CELParserLOGICAL_OR) - - localctx.(*ConditionalOrContext).s9 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*ConditionalOrContext).ops = append(localctx.(*ConditionalOrContext).ops, localctx.(*ConditionalOrContext).s9) - { - p.SetState(47) - - var _x = p.ConditionalAnd() - - localctx.(*ConditionalOrContext)._conditionalAnd = _x - } - localctx.(*ConditionalOrContext).e1 = append(localctx.(*ConditionalOrContext).e1, localctx.(*ConditionalOrContext)._conditionalAnd) - - p.SetState(52) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IConditionalAndContext is an interface to support dynamic dispatch. -type IConditionalAndContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetS8 returns the s8 token. - GetS8() antlr.Token - - // SetS8 sets the s8 token. - SetS8(antlr.Token) - - // GetOps returns the ops token list. - GetOps() []antlr.Token - - // SetOps sets the ops token list. - SetOps([]antlr.Token) - - // GetE returns the e rule contexts. - GetE() IRelationContext - - // Get_relation returns the _relation rule contexts. - Get_relation() IRelationContext - - // SetE sets the e rule contexts. - SetE(IRelationContext) - - // Set_relation sets the _relation rule contexts. - Set_relation(IRelationContext) - - // GetE1 returns the e1 rule context list. - GetE1() []IRelationContext - - // SetE1 sets the e1 rule context list. - SetE1([]IRelationContext) - - // Getter signatures - AllRelation() []IRelationContext - Relation(i int) IRelationContext - AllLOGICAL_AND() []antlr.TerminalNode - LOGICAL_AND(i int) antlr.TerminalNode - - // IsConditionalAndContext differentiates from other interfaces. - IsConditionalAndContext() -} - -type ConditionalAndContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - e IRelationContext - s8 antlr.Token - ops []antlr.Token - _relation IRelationContext - e1 []IRelationContext -} - -func NewEmptyConditionalAndContext() *ConditionalAndContext { - var p = new(ConditionalAndContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_conditionalAnd - return p -} - -func InitEmptyConditionalAndContext(p *ConditionalAndContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_conditionalAnd -} - -func (*ConditionalAndContext) IsConditionalAndContext() {} - -func NewConditionalAndContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalAndContext { - var p = new(ConditionalAndContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_conditionalAnd - - return p -} - -func (s *ConditionalAndContext) GetParser() antlr.Parser { return s.parser } - -func (s *ConditionalAndContext) GetS8() antlr.Token { return s.s8 } - -func (s *ConditionalAndContext) SetS8(v antlr.Token) { s.s8 = v } - -func (s *ConditionalAndContext) GetOps() []antlr.Token { return s.ops } - -func (s *ConditionalAndContext) SetOps(v []antlr.Token) { s.ops = v } - -func (s *ConditionalAndContext) GetE() IRelationContext { return s.e } - -func (s *ConditionalAndContext) Get_relation() IRelationContext { return s._relation } - -func (s *ConditionalAndContext) SetE(v IRelationContext) { s.e = v } - -func (s *ConditionalAndContext) Set_relation(v IRelationContext) { s._relation = v } - -func (s *ConditionalAndContext) GetE1() []IRelationContext { return s.e1 } - -func (s *ConditionalAndContext) SetE1(v []IRelationContext) { s.e1 = v } - -func (s *ConditionalAndContext) AllRelation() []IRelationContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IRelationContext); ok { - len++ - } - } - - tst := make([]IRelationContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IRelationContext); ok { - tst[i] = t.(IRelationContext) - i++ - } - } - - return tst -} - -func (s *ConditionalAndContext) Relation(i int) IRelationContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IRelationContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IRelationContext) -} - -func (s *ConditionalAndContext) AllLOGICAL_AND() []antlr.TerminalNode { - return s.GetTokens(CELParserLOGICAL_AND) -} - -func (s *ConditionalAndContext) LOGICAL_AND(i int) antlr.TerminalNode { - return s.GetToken(CELParserLOGICAL_AND, i) -} - -func (s *ConditionalAndContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ConditionalAndContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ConditionalAndContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterConditionalAnd(s) - } -} - -func (s *ConditionalAndContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitConditionalAnd(s) - } -} - -func (s *ConditionalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitConditionalAnd(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) { - localctx = NewConditionalAndContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, CELParserRULE_conditionalAnd) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(53) - - var _x = p.relation(0) - - localctx.(*ConditionalAndContext).e = _x - } - p.SetState(58) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CELParserLOGICAL_AND { - { - p.SetState(54) - - var _m = p.Match(CELParserLOGICAL_AND) - - localctx.(*ConditionalAndContext).s8 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*ConditionalAndContext).ops = append(localctx.(*ConditionalAndContext).ops, localctx.(*ConditionalAndContext).s8) - { - p.SetState(55) - - var _x = p.relation(0) - - localctx.(*ConditionalAndContext)._relation = _x - } - localctx.(*ConditionalAndContext).e1 = append(localctx.(*ConditionalAndContext).e1, localctx.(*ConditionalAndContext)._relation) - - p.SetState(60) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IRelationContext is an interface to support dynamic dispatch. -type IRelationContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetOp returns the op token. - GetOp() antlr.Token - - // SetOp sets the op token. - SetOp(antlr.Token) - - // Getter signatures - Calc() ICalcContext - AllRelation() []IRelationContext - Relation(i int) IRelationContext - LESS() antlr.TerminalNode - LESS_EQUALS() antlr.TerminalNode - GREATER_EQUALS() antlr.TerminalNode - GREATER() antlr.TerminalNode - EQUALS() antlr.TerminalNode - NOT_EQUALS() antlr.TerminalNode - IN() antlr.TerminalNode - - // IsRelationContext differentiates from other interfaces. - IsRelationContext() -} - -type RelationContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - op antlr.Token -} - -func NewEmptyRelationContext() *RelationContext { - var p = new(RelationContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_relation - return p -} - -func InitEmptyRelationContext(p *RelationContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_relation -} - -func (*RelationContext) IsRelationContext() {} - -func NewRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationContext { - var p = new(RelationContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_relation - - return p -} - -func (s *RelationContext) GetParser() antlr.Parser { return s.parser } - -func (s *RelationContext) GetOp() antlr.Token { return s.op } - -func (s *RelationContext) SetOp(v antlr.Token) { s.op = v } - -func (s *RelationContext) Calc() ICalcContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICalcContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ICalcContext) -} - -func (s *RelationContext) AllRelation() []IRelationContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IRelationContext); ok { - len++ - } - } - - tst := make([]IRelationContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IRelationContext); ok { - tst[i] = t.(IRelationContext) - i++ - } - } - - return tst -} - -func (s *RelationContext) Relation(i int) IRelationContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IRelationContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IRelationContext) -} - -func (s *RelationContext) LESS() antlr.TerminalNode { - return s.GetToken(CELParserLESS, 0) -} - -func (s *RelationContext) LESS_EQUALS() antlr.TerminalNode { - return s.GetToken(CELParserLESS_EQUALS, 0) -} - -func (s *RelationContext) GREATER_EQUALS() antlr.TerminalNode { - return s.GetToken(CELParserGREATER_EQUALS, 0) -} - -func (s *RelationContext) GREATER() antlr.TerminalNode { - return s.GetToken(CELParserGREATER, 0) -} - -func (s *RelationContext) EQUALS() antlr.TerminalNode { - return s.GetToken(CELParserEQUALS, 0) -} - -func (s *RelationContext) NOT_EQUALS() antlr.TerminalNode { - return s.GetToken(CELParserNOT_EQUALS, 0) -} - -func (s *RelationContext) IN() antlr.TerminalNode { - return s.GetToken(CELParserIN, 0) -} - -func (s *RelationContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *RelationContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterRelation(s) - } -} - -func (s *RelationContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitRelation(s) - } -} - -func (s *RelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitRelation(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Relation() (localctx IRelationContext) { - return p.relation(0) -} - -func (p *CELParser) relation(_p int) (localctx IRelationContext) { - var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() - - _parentState := p.GetState() - localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState) - var _prevctx IRelationContext = localctx - var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 8 - p.EnterRecursionRule(localctx, 8, CELParserRULE_relation, _p) - var _la int - - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(62) - p.calc(0) - } - - p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(69) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - if p.GetParseListeners() != nil { - p.TriggerExitRuleEvent() - } - _prevctx = localctx - localctx = NewRelationContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_relation) - p.SetState(64) - - if !(p.Precpred(p.GetParserRuleContext(), 1)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) - goto errorExit - } - { - p.SetState(65) - - var _lt = p.GetTokenStream().LT(1) - - localctx.(*RelationContext).op = _lt - - _la = p.GetTokenStream().LA(1) - - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&254) != 0) { - var _ri = p.GetErrorHandler().RecoverInline(p) - - localctx.(*RelationContext).op = _ri - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() - } - } - { - p.SetState(66) - p.relation(2) - } - - } - p.SetState(71) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.UnrollRecursionContexts(_parentctx) - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// ICalcContext is an interface to support dynamic dispatch. -type ICalcContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetOp returns the op token. - GetOp() antlr.Token - - // SetOp sets the op token. - SetOp(antlr.Token) - - // Getter signatures - Unary() IUnaryContext - AllCalc() []ICalcContext - Calc(i int) ICalcContext - STAR() antlr.TerminalNode - SLASH() antlr.TerminalNode - PERCENT() antlr.TerminalNode - PLUS() antlr.TerminalNode - MINUS() antlr.TerminalNode - - // IsCalcContext differentiates from other interfaces. - IsCalcContext() -} - -type CalcContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - op antlr.Token -} - -func NewEmptyCalcContext() *CalcContext { - var p = new(CalcContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_calc - return p -} - -func InitEmptyCalcContext(p *CalcContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_calc -} - -func (*CalcContext) IsCalcContext() {} - -func NewCalcContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CalcContext { - var p = new(CalcContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_calc - - return p -} - -func (s *CalcContext) GetParser() antlr.Parser { return s.parser } - -func (s *CalcContext) GetOp() antlr.Token { return s.op } - -func (s *CalcContext) SetOp(v antlr.Token) { s.op = v } - -func (s *CalcContext) Unary() IUnaryContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUnaryContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IUnaryContext) -} - -func (s *CalcContext) AllCalc() []ICalcContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(ICalcContext); ok { - len++ - } - } - - tst := make([]ICalcContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(ICalcContext); ok { - tst[i] = t.(ICalcContext) - i++ - } - } - - return tst -} - -func (s *CalcContext) Calc(i int) ICalcContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICalcContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(ICalcContext) -} - -func (s *CalcContext) STAR() antlr.TerminalNode { - return s.GetToken(CELParserSTAR, 0) -} - -func (s *CalcContext) SLASH() antlr.TerminalNode { - return s.GetToken(CELParserSLASH, 0) -} - -func (s *CalcContext) PERCENT() antlr.TerminalNode { - return s.GetToken(CELParserPERCENT, 0) -} - -func (s *CalcContext) PLUS() antlr.TerminalNode { - return s.GetToken(CELParserPLUS, 0) -} - -func (s *CalcContext) MINUS() antlr.TerminalNode { - return s.GetToken(CELParserMINUS, 0) -} - -func (s *CalcContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *CalcContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *CalcContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterCalc(s) - } -} - -func (s *CalcContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitCalc(s) - } -} - -func (s *CalcContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitCalc(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Calc() (localctx ICalcContext) { - return p.calc(0) -} - -func (p *CELParser) calc(_p int) (localctx ICalcContext) { - var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() - - _parentState := p.GetState() - localctx = NewCalcContext(p, p.GetParserRuleContext(), _parentState) - var _prevctx ICalcContext = localctx - var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 10 - p.EnterRecursionRule(localctx, 10, CELParserRULE_calc, _p) - var _la int - - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(73) - p.Unary() - } - - p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(83) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - if p.GetParseListeners() != nil { - p.TriggerExitRuleEvent() - } - _prevctx = localctx - p.SetState(81) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) { - case 1: - localctx = NewCalcContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc) - p.SetState(75) - - if !(p.Precpred(p.GetParserRuleContext(), 2)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) - goto errorExit - } - { - p.SetState(76) - - var _lt = p.GetTokenStream().LT(1) - - localctx.(*CalcContext).op = _lt - - _la = p.GetTokenStream().LA(1) - - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&58720256) != 0) { - var _ri = p.GetErrorHandler().RecoverInline(p) - - localctx.(*CalcContext).op = _ri - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() - } - } - { - p.SetState(77) - p.calc(3) - } - - case 2: - localctx = NewCalcContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc) - p.SetState(78) - - if !(p.Precpred(p.GetParserRuleContext(), 1)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) - goto errorExit - } - { - p.SetState(79) - - var _lt = p.GetTokenStream().LT(1) - - localctx.(*CalcContext).op = _lt - - _la = p.GetTokenStream().LA(1) - - if !(_la == CELParserMINUS || _la == CELParserPLUS) { - var _ri = p.GetErrorHandler().RecoverInline(p) - - localctx.(*CalcContext).op = _ri - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() - } - } - { - p.SetState(80) - p.calc(2) - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - - } - p.SetState(85) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.UnrollRecursionContexts(_parentctx) - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IUnaryContext is an interface to support dynamic dispatch. -type IUnaryContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsUnaryContext differentiates from other interfaces. - IsUnaryContext() -} - -type UnaryContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyUnaryContext() *UnaryContext { - var p = new(UnaryContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_unary - return p -} - -func InitEmptyUnaryContext(p *UnaryContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_unary -} - -func (*UnaryContext) IsUnaryContext() {} - -func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UnaryContext { - var p = new(UnaryContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_unary - - return p -} - -func (s *UnaryContext) GetParser() antlr.Parser { return s.parser } - -func (s *UnaryContext) CopyAll(ctx *UnaryContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *UnaryContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *UnaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type LogicalNotContext struct { - UnaryContext - s19 antlr.Token - ops []antlr.Token -} - -func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalNotContext { - var p = new(LogicalNotContext) - - InitEmptyUnaryContext(&p.UnaryContext) - p.parser = parser - p.CopyAll(ctx.(*UnaryContext)) - - return p -} - -func (s *LogicalNotContext) GetS19() antlr.Token { return s.s19 } - -func (s *LogicalNotContext) SetS19(v antlr.Token) { s.s19 = v } - -func (s *LogicalNotContext) GetOps() []antlr.Token { return s.ops } - -func (s *LogicalNotContext) SetOps(v []antlr.Token) { s.ops = v } - -func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *LogicalNotContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *LogicalNotContext) AllEXCLAM() []antlr.TerminalNode { - return s.GetTokens(CELParserEXCLAM) -} - -func (s *LogicalNotContext) EXCLAM(i int) antlr.TerminalNode { - return s.GetToken(CELParserEXCLAM, i) -} - -func (s *LogicalNotContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterLogicalNot(s) - } -} - -func (s *LogicalNotContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitLogicalNot(s) - } -} - -func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitLogicalNot(s) - - default: - return t.VisitChildren(s) - } -} - -type MemberExprContext struct { - UnaryContext -} - -func NewMemberExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberExprContext { - var p = new(MemberExprContext) - - InitEmptyUnaryContext(&p.UnaryContext) - p.parser = parser - p.CopyAll(ctx.(*UnaryContext)) - - return p -} - -func (s *MemberExprContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *MemberExprContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *MemberExprContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterMemberExpr(s) - } -} - -func (s *MemberExprContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitMemberExpr(s) - } -} - -func (s *MemberExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitMemberExpr(s) - - default: - return t.VisitChildren(s) - } -} - -type NegateContext struct { - UnaryContext - s18 antlr.Token - ops []antlr.Token -} - -func NewNegateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NegateContext { - var p = new(NegateContext) - - InitEmptyUnaryContext(&p.UnaryContext) - p.parser = parser - p.CopyAll(ctx.(*UnaryContext)) - - return p -} - -func (s *NegateContext) GetS18() antlr.Token { return s.s18 } - -func (s *NegateContext) SetS18(v antlr.Token) { s.s18 = v } - -func (s *NegateContext) GetOps() []antlr.Token { return s.ops } - -func (s *NegateContext) SetOps(v []antlr.Token) { s.ops = v } - -func (s *NegateContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *NegateContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *NegateContext) AllMINUS() []antlr.TerminalNode { - return s.GetTokens(CELParserMINUS) -} - -func (s *NegateContext) MINUS(i int) antlr.TerminalNode { - return s.GetToken(CELParserMINUS, i) -} - -func (s *NegateContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterNegate(s) - } -} - -func (s *NegateContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitNegate(s) - } -} - -func (s *NegateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitNegate(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Unary() (localctx IUnaryContext) { - localctx = NewUnaryContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, CELParserRULE_unary) - var _la int - - var _alt int - - p.SetState(99) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) { - case 1: - localctx = NewMemberExprContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(86) - p.member(0) - } - - case 2: - localctx = NewLogicalNotContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - p.SetState(88) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for ok := true; ok; ok = _la == CELParserEXCLAM { - { - p.SetState(87) - - var _m = p.Match(CELParserEXCLAM) - - localctx.(*LogicalNotContext).s19 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*LogicalNotContext).ops = append(localctx.(*LogicalNotContext).ops, localctx.(*LogicalNotContext).s19) - - p.SetState(90) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(92) - p.member(0) - } - - case 3: - localctx = NewNegateContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - p.SetState(94) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = 1 - for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - switch _alt { - case 1: - { - p.SetState(93) - - var _m = p.Match(CELParserMINUS) - - localctx.(*NegateContext).s18 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18) - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - - p.SetState(96) - p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - { - p.SetState(98) - p.member(0) - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IMemberContext is an interface to support dynamic dispatch. -type IMemberContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsMemberContext differentiates from other interfaces. - IsMemberContext() -} - -type MemberContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyMemberContext() *MemberContext { - var p = new(MemberContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_member - return p -} - -func InitEmptyMemberContext(p *MemberContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_member -} - -func (*MemberContext) IsMemberContext() {} - -func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MemberContext { - var p = new(MemberContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_member - - return p -} - -func (s *MemberContext) GetParser() antlr.Parser { return s.parser } - -func (s *MemberContext) CopyAll(ctx *MemberContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *MemberContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *MemberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type MemberCallContext struct { - MemberContext - op antlr.Token - id antlr.Token - open antlr.Token - args IExprListContext -} - -func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberCallContext { - var p = new(MemberCallContext) - - InitEmptyMemberContext(&p.MemberContext) - p.parser = parser - p.CopyAll(ctx.(*MemberContext)) - - return p -} - -func (s *MemberCallContext) GetOp() antlr.Token { return s.op } - -func (s *MemberCallContext) GetId() antlr.Token { return s.id } - -func (s *MemberCallContext) GetOpen() antlr.Token { return s.open } - -func (s *MemberCallContext) SetOp(v antlr.Token) { s.op = v } - -func (s *MemberCallContext) SetId(v antlr.Token) { s.id = v } - -func (s *MemberCallContext) SetOpen(v antlr.Token) { s.open = v } - -func (s *MemberCallContext) GetArgs() IExprListContext { return s.args } - -func (s *MemberCallContext) SetArgs(v IExprListContext) { s.args = v } - -func (s *MemberCallContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *MemberCallContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *MemberCallContext) RPAREN() antlr.TerminalNode { - return s.GetToken(CELParserRPAREN, 0) -} - -func (s *MemberCallContext) DOT() antlr.TerminalNode { - return s.GetToken(CELParserDOT, 0) -} - -func (s *MemberCallContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CELParserIDENTIFIER, 0) -} - -func (s *MemberCallContext) LPAREN() antlr.TerminalNode { - return s.GetToken(CELParserLPAREN, 0) -} - -func (s *MemberCallContext) ExprList() IExprListContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprListContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprListContext) -} - -func (s *MemberCallContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterMemberCall(s) - } -} - -func (s *MemberCallContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitMemberCall(s) - } -} - -func (s *MemberCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitMemberCall(s) - - default: - return t.VisitChildren(s) - } -} - -type SelectContext struct { - MemberContext - op antlr.Token - opt antlr.Token - id IEscapeIdentContext -} - -func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectContext { - var p = new(SelectContext) - - InitEmptyMemberContext(&p.MemberContext) - p.parser = parser - p.CopyAll(ctx.(*MemberContext)) - - return p -} - -func (s *SelectContext) GetOp() antlr.Token { return s.op } - -func (s *SelectContext) GetOpt() antlr.Token { return s.opt } - -func (s *SelectContext) SetOp(v antlr.Token) { s.op = v } - -func (s *SelectContext) SetOpt(v antlr.Token) { s.opt = v } - -func (s *SelectContext) GetId() IEscapeIdentContext { return s.id } - -func (s *SelectContext) SetId(v IEscapeIdentContext) { s.id = v } - -func (s *SelectContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *SelectContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *SelectContext) DOT() antlr.TerminalNode { - return s.GetToken(CELParserDOT, 0) -} - -func (s *SelectContext) EscapeIdent() IEscapeIdentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IEscapeIdentContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IEscapeIdentContext) -} - -func (s *SelectContext) QUESTIONMARK() antlr.TerminalNode { - return s.GetToken(CELParserQUESTIONMARK, 0) -} - -func (s *SelectContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterSelect(s) - } -} - -func (s *SelectContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitSelect(s) - } -} - -func (s *SelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitSelect(s) - - default: - return t.VisitChildren(s) - } -} - -type PrimaryExprContext struct { - MemberContext -} - -func NewPrimaryExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PrimaryExprContext { - var p = new(PrimaryExprContext) - - InitEmptyMemberContext(&p.MemberContext) - p.parser = parser - p.CopyAll(ctx.(*MemberContext)) - - return p -} - -func (s *PrimaryExprContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PrimaryExprContext) Primary() IPrimaryContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPrimaryContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IPrimaryContext) -} - -func (s *PrimaryExprContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterPrimaryExpr(s) - } -} - -func (s *PrimaryExprContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitPrimaryExpr(s) - } -} - -func (s *PrimaryExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitPrimaryExpr(s) - - default: - return t.VisitChildren(s) - } -} - -type IndexContext struct { - MemberContext - op antlr.Token - opt antlr.Token - index IExprContext -} - -func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexContext { - var p = new(IndexContext) - - InitEmptyMemberContext(&p.MemberContext) - p.parser = parser - p.CopyAll(ctx.(*MemberContext)) - - return p -} - -func (s *IndexContext) GetOp() antlr.Token { return s.op } - -func (s *IndexContext) GetOpt() antlr.Token { return s.opt } - -func (s *IndexContext) SetOp(v antlr.Token) { s.op = v } - -func (s *IndexContext) SetOpt(v antlr.Token) { s.opt = v } - -func (s *IndexContext) GetIndex() IExprContext { return s.index } - -func (s *IndexContext) SetIndex(v IExprContext) { s.index = v } - -func (s *IndexContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *IndexContext) Member() IMemberContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMemberContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMemberContext) -} - -func (s *IndexContext) RPRACKET() antlr.TerminalNode { - return s.GetToken(CELParserRPRACKET, 0) -} - -func (s *IndexContext) LBRACKET() antlr.TerminalNode { - return s.GetToken(CELParserLBRACKET, 0) -} - -func (s *IndexContext) Expr() IExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *IndexContext) QUESTIONMARK() antlr.TerminalNode { - return s.GetToken(CELParserQUESTIONMARK, 0) -} - -func (s *IndexContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterIndex(s) - } -} - -func (s *IndexContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitIndex(s) - } -} - -func (s *IndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitIndex(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Member() (localctx IMemberContext) { - return p.member(0) -} - -func (p *CELParser) member(_p int) (localctx IMemberContext) { - var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() - - _parentState := p.GetState() - localctx = NewMemberContext(p, p.GetParserRuleContext(), _parentState) - var _prevctx IMemberContext = localctx - var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 14 - p.EnterRecursionRule(localctx, 14, CELParserRULE_member, _p) - var _la int - - var _alt int - - p.EnterOuterAlt(localctx, 1) - localctx = NewPrimaryExprContext(p, localctx) - p.SetParserRuleContext(localctx) - _prevctx = localctx - - { - p.SetState(102) - p.Primary() - } - - p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(128) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - if p.GetParseListeners() != nil { - p.TriggerExitRuleEvent() - } - _prevctx = localctx - p.SetState(126) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { - case 1: - localctx = NewSelectContext(p, NewMemberContext(p, _parentctx, _parentState)) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member) - p.SetState(104) - - if !(p.Precpred(p.GetParserRuleContext(), 3)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) - goto errorExit - } - { - p.SetState(105) - - var _m = p.Match(CELParserDOT) - - localctx.(*SelectContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(107) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserQUESTIONMARK { - { - p.SetState(106) - - var _m = p.Match(CELParserQUESTIONMARK) - - localctx.(*SelectContext).opt = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(109) - - var _x = p.EscapeIdent() - - localctx.(*SelectContext).id = _x - } - - case 2: - localctx = NewMemberCallContext(p, NewMemberContext(p, _parentctx, _parentState)) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member) - p.SetState(110) - - if !(p.Precpred(p.GetParserRuleContext(), 2)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) - goto errorExit - } - { - p.SetState(111) - - var _m = p.Match(CELParserDOT) - - localctx.(*MemberCallContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(112) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*MemberCallContext).id = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(113) - - var _m = p.Match(CELParserLPAREN) - - localctx.(*MemberCallContext).open = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(115) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 { - { - p.SetState(114) - - var _x = p.ExprList() - - localctx.(*MemberCallContext).args = _x - } - - } - { - p.SetState(117) - p.Match(CELParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 3: - localctx = NewIndexContext(p, NewMemberContext(p, _parentctx, _parentState)) - p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member) - p.SetState(118) - - if !(p.Precpred(p.GetParserRuleContext(), 1)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) - goto errorExit - } - { - p.SetState(119) - - var _m = p.Match(CELParserLBRACKET) - - localctx.(*IndexContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(121) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserQUESTIONMARK { - { - p.SetState(120) - - var _m = p.Match(CELParserQUESTIONMARK) - - localctx.(*IndexContext).opt = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(123) - - var _x = p.Expr() - - localctx.(*IndexContext).index = _x - } - { - p.SetState(124) - p.Match(CELParserRPRACKET) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - - } - p.SetState(130) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.UnrollRecursionContexts(_parentctx) - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IPrimaryContext is an interface to support dynamic dispatch. -type IPrimaryContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsPrimaryContext differentiates from other interfaces. - IsPrimaryContext() -} - -type PrimaryContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyPrimaryContext() *PrimaryContext { - var p = new(PrimaryContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_primary - return p -} - -func InitEmptyPrimaryContext(p *PrimaryContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_primary -} - -func (*PrimaryContext) IsPrimaryContext() {} - -func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryContext { - var p = new(PrimaryContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_primary - - return p -} - -func (s *PrimaryContext) GetParser() antlr.Parser { return s.parser } - -func (s *PrimaryContext) CopyAll(ctx *PrimaryContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *PrimaryContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type CreateListContext struct { - PrimaryContext - op antlr.Token - elems IListInitContext -} - -func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateListContext { - var p = new(CreateListContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *CreateListContext) GetOp() antlr.Token { return s.op } - -func (s *CreateListContext) SetOp(v antlr.Token) { s.op = v } - -func (s *CreateListContext) GetElems() IListInitContext { return s.elems } - -func (s *CreateListContext) SetElems(v IListInitContext) { s.elems = v } - -func (s *CreateListContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *CreateListContext) RPRACKET() antlr.TerminalNode { - return s.GetToken(CELParserRPRACKET, 0) -} - -func (s *CreateListContext) LBRACKET() antlr.TerminalNode { - return s.GetToken(CELParserLBRACKET, 0) -} - -func (s *CreateListContext) COMMA() antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, 0) -} - -func (s *CreateListContext) ListInit() IListInitContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IListInitContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IListInitContext) -} - -func (s *CreateListContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterCreateList(s) - } -} - -func (s *CreateListContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitCreateList(s) - } -} - -func (s *CreateListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitCreateList(s) - - default: - return t.VisitChildren(s) - } -} - -type IdentContext struct { - PrimaryContext - leadingDot antlr.Token - id antlr.Token -} - -func NewIdentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentContext { - var p = new(IdentContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *IdentContext) GetLeadingDot() antlr.Token { return s.leadingDot } - -func (s *IdentContext) GetId() antlr.Token { return s.id } - -func (s *IdentContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } - -func (s *IdentContext) SetId(v antlr.Token) { s.id = v } - -func (s *IdentContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *IdentContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CELParserIDENTIFIER, 0) -} - -func (s *IdentContext) DOT() antlr.TerminalNode { - return s.GetToken(CELParserDOT, 0) -} - -func (s *IdentContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterIdent(s) - } -} - -func (s *IdentContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitIdent(s) - } -} - -func (s *IdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitIdent(s) - - default: - return t.VisitChildren(s) - } -} - -type CreateStructContext struct { - PrimaryContext - op antlr.Token - entries IMapInitializerListContext -} - -func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateStructContext { - var p = new(CreateStructContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *CreateStructContext) GetOp() antlr.Token { return s.op } - -func (s *CreateStructContext) SetOp(v antlr.Token) { s.op = v } - -func (s *CreateStructContext) GetEntries() IMapInitializerListContext { return s.entries } - -func (s *CreateStructContext) SetEntries(v IMapInitializerListContext) { s.entries = v } - -func (s *CreateStructContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *CreateStructContext) RBRACE() antlr.TerminalNode { - return s.GetToken(CELParserRBRACE, 0) -} - -func (s *CreateStructContext) LBRACE() antlr.TerminalNode { - return s.GetToken(CELParserLBRACE, 0) -} - -func (s *CreateStructContext) COMMA() antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, 0) -} - -func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMapInitializerListContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IMapInitializerListContext) -} - -func (s *CreateStructContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterCreateStruct(s) - } -} - -func (s *CreateStructContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitCreateStruct(s) - } -} - -func (s *CreateStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitCreateStruct(s) - - default: - return t.VisitChildren(s) - } -} - -type ConstantLiteralContext struct { - PrimaryContext -} - -func NewConstantLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConstantLiteralContext { - var p = new(ConstantLiteralContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *ConstantLiteralContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ConstantLiteralContext) Literal() ILiteralContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ILiteralContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ILiteralContext) -} - -func (s *ConstantLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterConstantLiteral(s) - } -} - -func (s *ConstantLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitConstantLiteral(s) - } -} - -func (s *ConstantLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitConstantLiteral(s) - - default: - return t.VisitChildren(s) - } -} - -type NestedContext struct { - PrimaryContext - e IExprContext -} - -func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedContext { - var p = new(NestedContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *NestedContext) GetE() IExprContext { return s.e } - -func (s *NestedContext) SetE(v IExprContext) { s.e = v } - -func (s *NestedContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *NestedContext) LPAREN() antlr.TerminalNode { - return s.GetToken(CELParserLPAREN, 0) -} - -func (s *NestedContext) RPAREN() antlr.TerminalNode { - return s.GetToken(CELParserRPAREN, 0) -} - -func (s *NestedContext) Expr() IExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *NestedContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterNested(s) - } -} - -func (s *NestedContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitNested(s) - } -} - -func (s *NestedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitNested(s) - - default: - return t.VisitChildren(s) - } -} - -type CreateMessageContext struct { - PrimaryContext - leadingDot antlr.Token - _IDENTIFIER antlr.Token - ids []antlr.Token - s16 antlr.Token - ops []antlr.Token - op antlr.Token - entries IFieldInitializerListContext -} - -func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateMessageContext { - var p = new(CreateMessageContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *CreateMessageContext) GetLeadingDot() antlr.Token { return s.leadingDot } - -func (s *CreateMessageContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER } - -func (s *CreateMessageContext) GetS16() antlr.Token { return s.s16 } - -func (s *CreateMessageContext) GetOp() antlr.Token { return s.op } - -func (s *CreateMessageContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } - -func (s *CreateMessageContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v } - -func (s *CreateMessageContext) SetS16(v antlr.Token) { s.s16 = v } - -func (s *CreateMessageContext) SetOp(v antlr.Token) { s.op = v } - -func (s *CreateMessageContext) GetIds() []antlr.Token { return s.ids } - -func (s *CreateMessageContext) GetOps() []antlr.Token { return s.ops } - -func (s *CreateMessageContext) SetIds(v []antlr.Token) { s.ids = v } - -func (s *CreateMessageContext) SetOps(v []antlr.Token) { s.ops = v } - -func (s *CreateMessageContext) GetEntries() IFieldInitializerListContext { return s.entries } - -func (s *CreateMessageContext) SetEntries(v IFieldInitializerListContext) { s.entries = v } - -func (s *CreateMessageContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *CreateMessageContext) RBRACE() antlr.TerminalNode { - return s.GetToken(CELParserRBRACE, 0) -} - -func (s *CreateMessageContext) AllIDENTIFIER() []antlr.TerminalNode { - return s.GetTokens(CELParserIDENTIFIER) -} - -func (s *CreateMessageContext) IDENTIFIER(i int) antlr.TerminalNode { - return s.GetToken(CELParserIDENTIFIER, i) -} - -func (s *CreateMessageContext) LBRACE() antlr.TerminalNode { - return s.GetToken(CELParserLBRACE, 0) -} - -func (s *CreateMessageContext) COMMA() antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, 0) -} - -func (s *CreateMessageContext) AllDOT() []antlr.TerminalNode { - return s.GetTokens(CELParserDOT) -} - -func (s *CreateMessageContext) DOT(i int) antlr.TerminalNode { - return s.GetToken(CELParserDOT, i) -} - -func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IFieldInitializerListContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IFieldInitializerListContext) -} - -func (s *CreateMessageContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterCreateMessage(s) - } -} - -func (s *CreateMessageContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitCreateMessage(s) - } -} - -func (s *CreateMessageContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitCreateMessage(s) - - default: - return t.VisitChildren(s) - } -} - -type GlobalCallContext struct { - PrimaryContext - leadingDot antlr.Token - id antlr.Token - op antlr.Token - args IExprListContext -} - -func NewGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GlobalCallContext { - var p = new(GlobalCallContext) - - InitEmptyPrimaryContext(&p.PrimaryContext) - p.parser = parser - p.CopyAll(ctx.(*PrimaryContext)) - - return p -} - -func (s *GlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot } - -func (s *GlobalCallContext) GetId() antlr.Token { return s.id } - -func (s *GlobalCallContext) GetOp() antlr.Token { return s.op } - -func (s *GlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } - -func (s *GlobalCallContext) SetId(v antlr.Token) { s.id = v } - -func (s *GlobalCallContext) SetOp(v antlr.Token) { s.op = v } - -func (s *GlobalCallContext) GetArgs() IExprListContext { return s.args } - -func (s *GlobalCallContext) SetArgs(v IExprListContext) { s.args = v } - -func (s *GlobalCallContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *GlobalCallContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CELParserIDENTIFIER, 0) -} - -func (s *GlobalCallContext) RPAREN() antlr.TerminalNode { - return s.GetToken(CELParserRPAREN, 0) -} - -func (s *GlobalCallContext) LPAREN() antlr.TerminalNode { - return s.GetToken(CELParserLPAREN, 0) -} - -func (s *GlobalCallContext) DOT() antlr.TerminalNode { - return s.GetToken(CELParserDOT, 0) -} - -func (s *GlobalCallContext) ExprList() IExprListContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprListContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprListContext) -} - -func (s *GlobalCallContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterGlobalCall(s) - } -} - -func (s *GlobalCallContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitGlobalCall(s) - } -} - -func (s *GlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitGlobalCall(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Primary() (localctx IPrimaryContext) { - localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, CELParserRULE_primary) - var _la int - - p.SetState(184) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { - case 1: - localctx = NewIdentContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - p.SetState(132) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserDOT { - { - p.SetState(131) - - var _m = p.Match(CELParserDOT) - - localctx.(*IdentContext).leadingDot = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(134) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*IdentContext).id = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 2: - localctx = NewGlobalCallContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - p.SetState(136) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserDOT { - { - p.SetState(135) - - var _m = p.Match(CELParserDOT) - - localctx.(*GlobalCallContext).leadingDot = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(138) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*GlobalCallContext).id = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - { - p.SetState(139) - - var _m = p.Match(CELParserLPAREN) - - localctx.(*GlobalCallContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(141) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 { - { - p.SetState(140) - - var _x = p.ExprList() - - localctx.(*GlobalCallContext).args = _x - } - - } - { - p.SetState(143) - p.Match(CELParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 3: - localctx = NewNestedContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - { - p.SetState(144) - p.Match(CELParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(145) - - var _x = p.Expr() - - localctx.(*NestedContext).e = _x - } - { - p.SetState(146) - p.Match(CELParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 4: - localctx = NewCreateListContext(p, localctx) - p.EnterOuterAlt(localctx, 4) - { - p.SetState(148) - - var _m = p.Match(CELParserLBRACKET) - - localctx.(*CreateListContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(150) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 { - { - p.SetState(149) - - var _x = p.ListInit() - - localctx.(*CreateListContext).elems = _x - } - - } - p.SetState(153) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserCOMMA { - { - p.SetState(152) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(155) - p.Match(CELParserRPRACKET) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 5: - localctx = NewCreateStructContext(p, localctx) - p.EnterOuterAlt(localctx, 5) - { - p.SetState(156) - - var _m = p.Match(CELParserLBRACE) - - localctx.(*CreateStructContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(158) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 { - { - p.SetState(157) - - var _x = p.MapInitializerList() - - localctx.(*CreateStructContext).entries = _x - } - - } - p.SetState(161) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserCOMMA { - { - p.SetState(160) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(163) - p.Match(CELParserRBRACE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 6: - localctx = NewCreateMessageContext(p, localctx) - p.EnterOuterAlt(localctx, 6) - p.SetState(165) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserDOT { - { - p.SetState(164) - - var _m = p.Match(CELParserDOT) - - localctx.(*CreateMessageContext).leadingDot = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(167) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*CreateMessageContext)._IDENTIFIER = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER) - p.SetState(172) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CELParserDOT { - { - p.SetState(168) - - var _m = p.Match(CELParserDOT) - - localctx.(*CreateMessageContext).s16 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*CreateMessageContext).ops = append(localctx.(*CreateMessageContext).ops, localctx.(*CreateMessageContext).s16) - { - p.SetState(169) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*CreateMessageContext)._IDENTIFIER = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER) - - p.SetState(174) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(175) - - var _m = p.Match(CELParserLBRACE) - - localctx.(*CreateMessageContext).op = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(177) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&206159478784) != 0 { - { - p.SetState(176) - - var _x = p.FieldInitializerList() - - localctx.(*CreateMessageContext).entries = _x - } - - } - p.SetState(180) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserCOMMA { - { - p.SetState(179) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(182) - p.Match(CELParserRBRACE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 7: - localctx = NewConstantLiteralContext(p, localctx) - p.EnterOuterAlt(localctx, 7) - { - p.SetState(183) - p.Literal() - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IExprListContext is an interface to support dynamic dispatch. -type IExprListContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // Get_expr returns the _expr rule contexts. - Get_expr() IExprContext - - // Set_expr sets the _expr rule contexts. - Set_expr(IExprContext) - - // GetE returns the e rule context list. - GetE() []IExprContext - - // SetE sets the e rule context list. - SetE([]IExprContext) - - // Getter signatures - AllExpr() []IExprContext - Expr(i int) IExprContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode - - // IsExprListContext differentiates from other interfaces. - IsExprListContext() -} - -type ExprListContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - _expr IExprContext - e []IExprContext -} - -func NewEmptyExprListContext() *ExprListContext { - var p = new(ExprListContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_exprList - return p -} - -func InitEmptyExprListContext(p *ExprListContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_exprList -} - -func (*ExprListContext) IsExprListContext() {} - -func NewExprListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprListContext { - var p = new(ExprListContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_exprList - - return p -} - -func (s *ExprListContext) GetParser() antlr.Parser { return s.parser } - -func (s *ExprListContext) Get_expr() IExprContext { return s._expr } - -func (s *ExprListContext) Set_expr(v IExprContext) { s._expr = v } - -func (s *ExprListContext) GetE() []IExprContext { return s.e } - -func (s *ExprListContext) SetE(v []IExprContext) { s.e = v } - -func (s *ExprListContext) AllExpr() []IExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IExprContext); ok { - len++ - } - } - - tst := make([]IExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IExprContext); ok { - tst[i] = t.(IExprContext) - i++ - } - } - - return tst -} - -func (s *ExprListContext) Expr(i int) IExprContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *ExprListContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(CELParserCOMMA) -} - -func (s *ExprListContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, i) -} - -func (s *ExprListContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ExprListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ExprListContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterExprList(s) - } -} - -func (s *ExprListContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitExprList(s) - } -} - -func (s *ExprListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitExprList(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) ExprList() (localctx IExprListContext) { - localctx = NewExprListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, CELParserRULE_exprList) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(186) - - var _x = p.Expr() - - localctx.(*ExprListContext)._expr = _x - } - localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr) - p.SetState(191) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CELParserCOMMA { - { - p.SetState(187) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(188) - - var _x = p.Expr() - - localctx.(*ExprListContext)._expr = _x - } - localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr) - - p.SetState(193) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IListInitContext is an interface to support dynamic dispatch. -type IListInitContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // Get_optExpr returns the _optExpr rule contexts. - Get_optExpr() IOptExprContext - - // Set_optExpr sets the _optExpr rule contexts. - Set_optExpr(IOptExprContext) - - // GetElems returns the elems rule context list. - GetElems() []IOptExprContext - - // SetElems sets the elems rule context list. - SetElems([]IOptExprContext) - - // Getter signatures - AllOptExpr() []IOptExprContext - OptExpr(i int) IOptExprContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode - - // IsListInitContext differentiates from other interfaces. - IsListInitContext() -} - -type ListInitContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - _optExpr IOptExprContext - elems []IOptExprContext -} - -func NewEmptyListInitContext() *ListInitContext { - var p = new(ListInitContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_listInit - return p -} - -func InitEmptyListInitContext(p *ListInitContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_listInit -} - -func (*ListInitContext) IsListInitContext() {} - -func NewListInitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListInitContext { - var p = new(ListInitContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_listInit - - return p -} - -func (s *ListInitContext) GetParser() antlr.Parser { return s.parser } - -func (s *ListInitContext) Get_optExpr() IOptExprContext { return s._optExpr } - -func (s *ListInitContext) Set_optExpr(v IOptExprContext) { s._optExpr = v } - -func (s *ListInitContext) GetElems() []IOptExprContext { return s.elems } - -func (s *ListInitContext) SetElems(v []IOptExprContext) { s.elems = v } - -func (s *ListInitContext) AllOptExpr() []IOptExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IOptExprContext); ok { - len++ - } - } - - tst := make([]IOptExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IOptExprContext); ok { - tst[i] = t.(IOptExprContext) - i++ - } - } - - return tst -} - -func (s *ListInitContext) OptExpr(i int) IOptExprContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IOptExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IOptExprContext) -} - -func (s *ListInitContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(CELParserCOMMA) -} - -func (s *ListInitContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, i) -} - -func (s *ListInitContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ListInitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ListInitContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterListInit(s) - } -} - -func (s *ListInitContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitListInit(s) - } -} - -func (s *ListInitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitListInit(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) ListInit() (localctx IListInitContext) { - localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, CELParserRULE_listInit) - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(194) - - var _x = p.OptExpr() - - localctx.(*ListInitContext)._optExpr = _x - } - localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr) - p.SetState(199) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(195) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(196) - - var _x = p.OptExpr() - - localctx.(*ListInitContext)._optExpr = _x - } - localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr) - - } - p.SetState(201) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IFieldInitializerListContext is an interface to support dynamic dispatch. -type IFieldInitializerListContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetS21 returns the s21 token. - GetS21() antlr.Token - - // SetS21 sets the s21 token. - SetS21(antlr.Token) - - // GetCols returns the cols token list. - GetCols() []antlr.Token - - // SetCols sets the cols token list. - SetCols([]antlr.Token) - - // Get_optField returns the _optField rule contexts. - Get_optField() IOptFieldContext - - // Get_expr returns the _expr rule contexts. - Get_expr() IExprContext - - // Set_optField sets the _optField rule contexts. - Set_optField(IOptFieldContext) - - // Set_expr sets the _expr rule contexts. - Set_expr(IExprContext) - - // GetFields returns the fields rule context list. - GetFields() []IOptFieldContext - - // GetValues returns the values rule context list. - GetValues() []IExprContext - - // SetFields sets the fields rule context list. - SetFields([]IOptFieldContext) - - // SetValues sets the values rule context list. - SetValues([]IExprContext) - - // Getter signatures - AllOptField() []IOptFieldContext - OptField(i int) IOptFieldContext - AllCOLON() []antlr.TerminalNode - COLON(i int) antlr.TerminalNode - AllExpr() []IExprContext - Expr(i int) IExprContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode - - // IsFieldInitializerListContext differentiates from other interfaces. - IsFieldInitializerListContext() -} - -type FieldInitializerListContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - _optField IOptFieldContext - fields []IOptFieldContext - s21 antlr.Token - cols []antlr.Token - _expr IExprContext - values []IExprContext -} - -func NewEmptyFieldInitializerListContext() *FieldInitializerListContext { - var p = new(FieldInitializerListContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_fieldInitializerList - return p -} - -func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_fieldInitializerList -} - -func (*FieldInitializerListContext) IsFieldInitializerListContext() {} - -func NewFieldInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldInitializerListContext { - var p = new(FieldInitializerListContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_fieldInitializerList - - return p -} - -func (s *FieldInitializerListContext) GetParser() antlr.Parser { return s.parser } - -func (s *FieldInitializerListContext) GetS21() antlr.Token { return s.s21 } - -func (s *FieldInitializerListContext) SetS21(v antlr.Token) { s.s21 = v } - -func (s *FieldInitializerListContext) GetCols() []antlr.Token { return s.cols } - -func (s *FieldInitializerListContext) SetCols(v []antlr.Token) { s.cols = v } - -func (s *FieldInitializerListContext) Get_optField() IOptFieldContext { return s._optField } - -func (s *FieldInitializerListContext) Get_expr() IExprContext { return s._expr } - -func (s *FieldInitializerListContext) Set_optField(v IOptFieldContext) { s._optField = v } - -func (s *FieldInitializerListContext) Set_expr(v IExprContext) { s._expr = v } - -func (s *FieldInitializerListContext) GetFields() []IOptFieldContext { return s.fields } - -func (s *FieldInitializerListContext) GetValues() []IExprContext { return s.values } - -func (s *FieldInitializerListContext) SetFields(v []IOptFieldContext) { s.fields = v } - -func (s *FieldInitializerListContext) SetValues(v []IExprContext) { s.values = v } - -func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IOptFieldContext); ok { - len++ - } - } - - tst := make([]IOptFieldContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IOptFieldContext); ok { - tst[i] = t.(IOptFieldContext) - i++ - } - } - - return tst -} - -func (s *FieldInitializerListContext) OptField(i int) IOptFieldContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IOptFieldContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IOptFieldContext) -} - -func (s *FieldInitializerListContext) AllCOLON() []antlr.TerminalNode { - return s.GetTokens(CELParserCOLON) -} - -func (s *FieldInitializerListContext) COLON(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOLON, i) -} - -func (s *FieldInitializerListContext) AllExpr() []IExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IExprContext); ok { - len++ - } - } - - tst := make([]IExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IExprContext); ok { - tst[i] = t.(IExprContext) - i++ - } - } - - return tst -} - -func (s *FieldInitializerListContext) Expr(i int) IExprContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *FieldInitializerListContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(CELParserCOMMA) -} - -func (s *FieldInitializerListContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, i) -} - -func (s *FieldInitializerListContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *FieldInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *FieldInitializerListContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterFieldInitializerList(s) - } -} - -func (s *FieldInitializerListContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitFieldInitializerList(s) - } -} - -func (s *FieldInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitFieldInitializerList(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) { - localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList) - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(202) - - var _x = p.OptField() - - localctx.(*FieldInitializerListContext)._optField = _x - } - localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField) - { - p.SetState(203) - - var _m = p.Match(CELParserCOLON) - - localctx.(*FieldInitializerListContext).s21 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21) - { - p.SetState(204) - - var _x = p.Expr() - - localctx.(*FieldInitializerListContext)._expr = _x - } - localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr) - p.SetState(212) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(205) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(206) - - var _x = p.OptField() - - localctx.(*FieldInitializerListContext)._optField = _x - } - localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField) - { - p.SetState(207) - - var _m = p.Match(CELParserCOLON) - - localctx.(*FieldInitializerListContext).s21 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21) - { - p.SetState(208) - - var _x = p.Expr() - - localctx.(*FieldInitializerListContext)._expr = _x - } - localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr) - - } - p.SetState(214) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IOptFieldContext is an interface to support dynamic dispatch. -type IOptFieldContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetOpt returns the opt token. - GetOpt() antlr.Token - - // SetOpt sets the opt token. - SetOpt(antlr.Token) - - // Getter signatures - EscapeIdent() IEscapeIdentContext - QUESTIONMARK() antlr.TerminalNode - - // IsOptFieldContext differentiates from other interfaces. - IsOptFieldContext() -} - -type OptFieldContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - opt antlr.Token -} - -func NewEmptyOptFieldContext() *OptFieldContext { - var p = new(OptFieldContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_optField - return p -} - -func InitEmptyOptFieldContext(p *OptFieldContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_optField -} - -func (*OptFieldContext) IsOptFieldContext() {} - -func NewOptFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptFieldContext { - var p = new(OptFieldContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_optField - - return p -} - -func (s *OptFieldContext) GetParser() antlr.Parser { return s.parser } - -func (s *OptFieldContext) GetOpt() antlr.Token { return s.opt } - -func (s *OptFieldContext) SetOpt(v antlr.Token) { s.opt = v } - -func (s *OptFieldContext) EscapeIdent() IEscapeIdentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IEscapeIdentContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IEscapeIdentContext) -} - -func (s *OptFieldContext) QUESTIONMARK() antlr.TerminalNode { - return s.GetToken(CELParserQUESTIONMARK, 0) -} - -func (s *OptFieldContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *OptFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *OptFieldContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterOptField(s) - } -} - -func (s *OptFieldContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitOptField(s) - } -} - -func (s *OptFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitOptField(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) OptField() (localctx IOptFieldContext) { - localctx = NewOptFieldContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, CELParserRULE_optField) - var _la int - - p.EnterOuterAlt(localctx, 1) - p.SetState(216) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserQUESTIONMARK { - { - p.SetState(215) - - var _m = p.Match(CELParserQUESTIONMARK) - - localctx.(*OptFieldContext).opt = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(218) - p.EscapeIdent() - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IMapInitializerListContext is an interface to support dynamic dispatch. -type IMapInitializerListContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetS21 returns the s21 token. - GetS21() antlr.Token - - // SetS21 sets the s21 token. - SetS21(antlr.Token) - - // GetCols returns the cols token list. - GetCols() []antlr.Token - - // SetCols sets the cols token list. - SetCols([]antlr.Token) - - // Get_optExpr returns the _optExpr rule contexts. - Get_optExpr() IOptExprContext - - // Get_expr returns the _expr rule contexts. - Get_expr() IExprContext - - // Set_optExpr sets the _optExpr rule contexts. - Set_optExpr(IOptExprContext) - - // Set_expr sets the _expr rule contexts. - Set_expr(IExprContext) - - // GetKeys returns the keys rule context list. - GetKeys() []IOptExprContext - - // GetValues returns the values rule context list. - GetValues() []IExprContext - - // SetKeys sets the keys rule context list. - SetKeys([]IOptExprContext) - - // SetValues sets the values rule context list. - SetValues([]IExprContext) - - // Getter signatures - AllOptExpr() []IOptExprContext - OptExpr(i int) IOptExprContext - AllCOLON() []antlr.TerminalNode - COLON(i int) antlr.TerminalNode - AllExpr() []IExprContext - Expr(i int) IExprContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode - - // IsMapInitializerListContext differentiates from other interfaces. - IsMapInitializerListContext() -} - -type MapInitializerListContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - _optExpr IOptExprContext - keys []IOptExprContext - s21 antlr.Token - cols []antlr.Token - _expr IExprContext - values []IExprContext -} - -func NewEmptyMapInitializerListContext() *MapInitializerListContext { - var p = new(MapInitializerListContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_mapInitializerList - return p -} - -func InitEmptyMapInitializerListContext(p *MapInitializerListContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_mapInitializerList -} - -func (*MapInitializerListContext) IsMapInitializerListContext() {} - -func NewMapInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapInitializerListContext { - var p = new(MapInitializerListContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_mapInitializerList - - return p -} - -func (s *MapInitializerListContext) GetParser() antlr.Parser { return s.parser } - -func (s *MapInitializerListContext) GetS21() antlr.Token { return s.s21 } - -func (s *MapInitializerListContext) SetS21(v antlr.Token) { s.s21 = v } - -func (s *MapInitializerListContext) GetCols() []antlr.Token { return s.cols } - -func (s *MapInitializerListContext) SetCols(v []antlr.Token) { s.cols = v } - -func (s *MapInitializerListContext) Get_optExpr() IOptExprContext { return s._optExpr } - -func (s *MapInitializerListContext) Get_expr() IExprContext { return s._expr } - -func (s *MapInitializerListContext) Set_optExpr(v IOptExprContext) { s._optExpr = v } - -func (s *MapInitializerListContext) Set_expr(v IExprContext) { s._expr = v } - -func (s *MapInitializerListContext) GetKeys() []IOptExprContext { return s.keys } - -func (s *MapInitializerListContext) GetValues() []IExprContext { return s.values } - -func (s *MapInitializerListContext) SetKeys(v []IOptExprContext) { s.keys = v } - -func (s *MapInitializerListContext) SetValues(v []IExprContext) { s.values = v } - -func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IOptExprContext); ok { - len++ - } - } - - tst := make([]IOptExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IOptExprContext); ok { - tst[i] = t.(IOptExprContext) - i++ - } - } - - return tst -} - -func (s *MapInitializerListContext) OptExpr(i int) IOptExprContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IOptExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IOptExprContext) -} - -func (s *MapInitializerListContext) AllCOLON() []antlr.TerminalNode { - return s.GetTokens(CELParserCOLON) -} - -func (s *MapInitializerListContext) COLON(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOLON, i) -} - -func (s *MapInitializerListContext) AllExpr() []IExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IExprContext); ok { - len++ - } - } - - tst := make([]IExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IExprContext); ok { - tst[i] = t.(IExprContext) - i++ - } - } - - return tst -} - -func (s *MapInitializerListContext) Expr(i int) IExprContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *MapInitializerListContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(CELParserCOMMA) -} - -func (s *MapInitializerListContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(CELParserCOMMA, i) -} - -func (s *MapInitializerListContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterMapInitializerList(s) - } -} - -func (s *MapInitializerListContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitMapInitializerList(s) - } -} - -func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitMapInitializerList(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) { - localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList) - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(220) - - var _x = p.OptExpr() - - localctx.(*MapInitializerListContext)._optExpr = _x - } - localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr) - { - p.SetState(221) - - var _m = p.Match(CELParserCOLON) - - localctx.(*MapInitializerListContext).s21 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21) - { - p.SetState(222) - - var _x = p.Expr() - - localctx.(*MapInitializerListContext)._expr = _x - } - localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr) - p.SetState(230) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(223) - p.Match(CELParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(224) - - var _x = p.OptExpr() - - localctx.(*MapInitializerListContext)._optExpr = _x - } - localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr) - { - p.SetState(225) - - var _m = p.Match(CELParserCOLON) - - localctx.(*MapInitializerListContext).s21 = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21) - { - p.SetState(226) - - var _x = p.Expr() - - localctx.(*MapInitializerListContext)._expr = _x - } - localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr) - - } - p.SetState(232) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IEscapeIdentContext is an interface to support dynamic dispatch. -type IEscapeIdentContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsEscapeIdentContext differentiates from other interfaces. - IsEscapeIdentContext() -} - -type EscapeIdentContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyEscapeIdentContext() *EscapeIdentContext { - var p = new(EscapeIdentContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_escapeIdent - return p -} - -func InitEmptyEscapeIdentContext(p *EscapeIdentContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_escapeIdent -} - -func (*EscapeIdentContext) IsEscapeIdentContext() {} - -func NewEscapeIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EscapeIdentContext { - var p = new(EscapeIdentContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_escapeIdent - - return p -} - -func (s *EscapeIdentContext) GetParser() antlr.Parser { return s.parser } - -func (s *EscapeIdentContext) CopyAll(ctx *EscapeIdentContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *EscapeIdentContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *EscapeIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type EscapedIdentifierContext struct { - EscapeIdentContext - id antlr.Token -} - -func NewEscapedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EscapedIdentifierContext { - var p = new(EscapedIdentifierContext) - - InitEmptyEscapeIdentContext(&p.EscapeIdentContext) - p.parser = parser - p.CopyAll(ctx.(*EscapeIdentContext)) - - return p -} - -func (s *EscapedIdentifierContext) GetId() antlr.Token { return s.id } - -func (s *EscapedIdentifierContext) SetId(v antlr.Token) { s.id = v } - -func (s *EscapedIdentifierContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *EscapedIdentifierContext) ESC_IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CELParserESC_IDENTIFIER, 0) -} - -func (s *EscapedIdentifierContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterEscapedIdentifier(s) - } -} - -func (s *EscapedIdentifierContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitEscapedIdentifier(s) - } -} - -func (s *EscapedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitEscapedIdentifier(s) - - default: - return t.VisitChildren(s) - } -} - -type SimpleIdentifierContext struct { - EscapeIdentContext - id antlr.Token -} - -func NewSimpleIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SimpleIdentifierContext { - var p = new(SimpleIdentifierContext) - - InitEmptyEscapeIdentContext(&p.EscapeIdentContext) - p.parser = parser - p.CopyAll(ctx.(*EscapeIdentContext)) - - return p -} - -func (s *SimpleIdentifierContext) GetId() antlr.Token { return s.id } - -func (s *SimpleIdentifierContext) SetId(v antlr.Token) { s.id = v } - -func (s *SimpleIdentifierContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *SimpleIdentifierContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CELParserIDENTIFIER, 0) -} - -func (s *SimpleIdentifierContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterSimpleIdentifier(s) - } -} - -func (s *SimpleIdentifierContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitSimpleIdentifier(s) - } -} - -func (s *SimpleIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitSimpleIdentifier(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) EscapeIdent() (localctx IEscapeIdentContext) { - localctx = NewEscapeIdentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, CELParserRULE_escapeIdent) - p.SetState(235) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case CELParserIDENTIFIER: - localctx = NewSimpleIdentifierContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(233) - - var _m = p.Match(CELParserIDENTIFIER) - - localctx.(*SimpleIdentifierContext).id = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case CELParserESC_IDENTIFIER: - localctx = NewEscapedIdentifierContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(234) - - var _m = p.Match(CELParserESC_IDENTIFIER) - - localctx.(*EscapedIdentifierContext).id = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IOptExprContext is an interface to support dynamic dispatch. -type IOptExprContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetOpt returns the opt token. - GetOpt() antlr.Token - - // SetOpt sets the opt token. - SetOpt(antlr.Token) - - // GetE returns the e rule contexts. - GetE() IExprContext - - // SetE sets the e rule contexts. - SetE(IExprContext) - - // Getter signatures - Expr() IExprContext - QUESTIONMARK() antlr.TerminalNode - - // IsOptExprContext differentiates from other interfaces. - IsOptExprContext() -} - -type OptExprContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - opt antlr.Token - e IExprContext -} - -func NewEmptyOptExprContext() *OptExprContext { - var p = new(OptExprContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_optExpr - return p -} - -func InitEmptyOptExprContext(p *OptExprContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_optExpr -} - -func (*OptExprContext) IsOptExprContext() {} - -func NewOptExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptExprContext { - var p = new(OptExprContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_optExpr - - return p -} - -func (s *OptExprContext) GetParser() antlr.Parser { return s.parser } - -func (s *OptExprContext) GetOpt() antlr.Token { return s.opt } - -func (s *OptExprContext) SetOpt(v antlr.Token) { s.opt = v } - -func (s *OptExprContext) GetE() IExprContext { return s.e } - -func (s *OptExprContext) SetE(v IExprContext) { s.e = v } - -func (s *OptExprContext) Expr() IExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IExprContext) -} - -func (s *OptExprContext) QUESTIONMARK() antlr.TerminalNode { - return s.GetToken(CELParserQUESTIONMARK, 0) -} - -func (s *OptExprContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *OptExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *OptExprContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterOptExpr(s) - } -} - -func (s *OptExprContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitOptExpr(s) - } -} - -func (s *OptExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitOptExpr(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) OptExpr() (localctx IOptExprContext) { - localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, CELParserRULE_optExpr) - var _la int - - p.EnterOuterAlt(localctx, 1) - p.SetState(238) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserQUESTIONMARK { - { - p.SetState(237) - - var _m = p.Match(CELParserQUESTIONMARK) - - localctx.(*OptExprContext).opt = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(240) - - var _x = p.Expr() - - localctx.(*OptExprContext).e = _x - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// ILiteralContext is an interface to support dynamic dispatch. -type ILiteralContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsLiteralContext differentiates from other interfaces. - IsLiteralContext() -} - -type LiteralContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyLiteralContext() *LiteralContext { - var p = new(LiteralContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_literal - return p -} - -func InitEmptyLiteralContext(p *LiteralContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CELParserRULE_literal -} - -func (*LiteralContext) IsLiteralContext() {} - -func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { - var p = new(LiteralContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CELParserRULE_literal - - return p -} - -func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } - -func (s *LiteralContext) CopyAll(ctx *LiteralContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *LiteralContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type BytesContext struct { - LiteralContext - tok antlr.Token -} - -func NewBytesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BytesContext { - var p = new(BytesContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *BytesContext) GetTok() antlr.Token { return s.tok } - -func (s *BytesContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *BytesContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *BytesContext) BYTES() antlr.TerminalNode { - return s.GetToken(CELParserBYTES, 0) -} - -func (s *BytesContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterBytes(s) - } -} - -func (s *BytesContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitBytes(s) - } -} - -func (s *BytesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitBytes(s) - - default: - return t.VisitChildren(s) - } -} - -type UintContext struct { - LiteralContext - tok antlr.Token -} - -func NewUintContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UintContext { - var p = new(UintContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *UintContext) GetTok() antlr.Token { return s.tok } - -func (s *UintContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *UintContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *UintContext) NUM_UINT() antlr.TerminalNode { - return s.GetToken(CELParserNUM_UINT, 0) -} - -func (s *UintContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterUint(s) - } -} - -func (s *UintContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitUint(s) - } -} - -func (s *UintContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitUint(s) - - default: - return t.VisitChildren(s) - } -} - -type NullContext struct { - LiteralContext - tok antlr.Token -} - -func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullContext { - var p = new(NullContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *NullContext) GetTok() antlr.Token { return s.tok } - -func (s *NullContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *NullContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *NullContext) NUL() antlr.TerminalNode { - return s.GetToken(CELParserNUL, 0) -} - -func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterNull(s) - } -} - -func (s *NullContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitNull(s) - } -} - -func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitNull(s) - - default: - return t.VisitChildren(s) - } -} - -type BoolFalseContext struct { - LiteralContext - tok antlr.Token -} - -func NewBoolFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolFalseContext { - var p = new(BoolFalseContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *BoolFalseContext) GetTok() antlr.Token { return s.tok } - -func (s *BoolFalseContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *BoolFalseContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *BoolFalseContext) CEL_FALSE() antlr.TerminalNode { - return s.GetToken(CELParserCEL_FALSE, 0) -} - -func (s *BoolFalseContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterBoolFalse(s) - } -} - -func (s *BoolFalseContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitBoolFalse(s) - } -} - -func (s *BoolFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitBoolFalse(s) - - default: - return t.VisitChildren(s) - } -} - -type StringContext struct { - LiteralContext - tok antlr.Token -} - -func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringContext { - var p = new(StringContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *StringContext) GetTok() antlr.Token { return s.tok } - -func (s *StringContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *StringContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *StringContext) STRING() antlr.TerminalNode { - return s.GetToken(CELParserSTRING, 0) -} - -func (s *StringContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterString(s) - } -} - -func (s *StringContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitString(s) - } -} - -func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitString(s) - - default: - return t.VisitChildren(s) - } -} - -type DoubleContext struct { - LiteralContext - sign antlr.Token - tok antlr.Token -} - -func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleContext { - var p = new(DoubleContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *DoubleContext) GetSign() antlr.Token { return s.sign } - -func (s *DoubleContext) GetTok() antlr.Token { return s.tok } - -func (s *DoubleContext) SetSign(v antlr.Token) { s.sign = v } - -func (s *DoubleContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *DoubleContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *DoubleContext) NUM_FLOAT() antlr.TerminalNode { - return s.GetToken(CELParserNUM_FLOAT, 0) -} - -func (s *DoubleContext) MINUS() antlr.TerminalNode { - return s.GetToken(CELParserMINUS, 0) -} - -func (s *DoubleContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterDouble(s) - } -} - -func (s *DoubleContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitDouble(s) - } -} - -func (s *DoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitDouble(s) - - default: - return t.VisitChildren(s) - } -} - -type BoolTrueContext struct { - LiteralContext - tok antlr.Token -} - -func NewBoolTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolTrueContext { - var p = new(BoolTrueContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *BoolTrueContext) GetTok() antlr.Token { return s.tok } - -func (s *BoolTrueContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *BoolTrueContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *BoolTrueContext) CEL_TRUE() antlr.TerminalNode { - return s.GetToken(CELParserCEL_TRUE, 0) -} - -func (s *BoolTrueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterBoolTrue(s) - } -} - -func (s *BoolTrueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitBoolTrue(s) - } -} - -func (s *BoolTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitBoolTrue(s) - - default: - return t.VisitChildren(s) - } -} - -type IntContext struct { - LiteralContext - sign antlr.Token - tok antlr.Token -} - -func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext { - var p = new(IntContext) - - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) - - return p -} - -func (s *IntContext) GetSign() antlr.Token { return s.sign } - -func (s *IntContext) GetTok() antlr.Token { return s.tok } - -func (s *IntContext) SetSign(v antlr.Token) { s.sign = v } - -func (s *IntContext) SetTok(v antlr.Token) { s.tok = v } - -func (s *IntContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *IntContext) NUM_INT() antlr.TerminalNode { - return s.GetToken(CELParserNUM_INT, 0) -} - -func (s *IntContext) MINUS() antlr.TerminalNode { - return s.GetToken(CELParserMINUS, 0) -} - -func (s *IntContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.EnterInt(s) - } -} - -func (s *IntContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CELListener); ok { - listenerT.ExitInt(s) - } -} - -func (s *IntContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CELVisitor: - return t.VisitInt(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *CELParser) Literal() (localctx ILiteralContext) { - localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, CELParserRULE_literal) - var _la int - - p.SetState(256) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) { - case 1: - localctx = NewIntContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - p.SetState(243) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserMINUS { - { - p.SetState(242) - - var _m = p.Match(CELParserMINUS) - - localctx.(*IntContext).sign = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(245) - - var _m = p.Match(CELParserNUM_INT) - - localctx.(*IntContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 2: - localctx = NewUintContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(246) - - var _m = p.Match(CELParserNUM_UINT) - - localctx.(*UintContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 3: - localctx = NewDoubleContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - p.SetState(248) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CELParserMINUS { - { - p.SetState(247) - - var _m = p.Match(CELParserMINUS) - - localctx.(*DoubleContext).sign = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(250) - - var _m = p.Match(CELParserNUM_FLOAT) - - localctx.(*DoubleContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 4: - localctx = NewStringContext(p, localctx) - p.EnterOuterAlt(localctx, 4) - { - p.SetState(251) - - var _m = p.Match(CELParserSTRING) - - localctx.(*StringContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 5: - localctx = NewBytesContext(p, localctx) - p.EnterOuterAlt(localctx, 5) - { - p.SetState(252) - - var _m = p.Match(CELParserBYTES) - - localctx.(*BytesContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 6: - localctx = NewBoolTrueContext(p, localctx) - p.EnterOuterAlt(localctx, 6) - { - p.SetState(253) - - var _m = p.Match(CELParserCEL_TRUE) - - localctx.(*BoolTrueContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 7: - localctx = NewBoolFalseContext(p, localctx) - p.EnterOuterAlt(localctx, 7) - { - p.SetState(254) - - var _m = p.Match(CELParserCEL_FALSE) - - localctx.(*BoolFalseContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case 8: - localctx = NewNullContext(p, localctx) - p.EnterOuterAlt(localctx, 8) - { - p.SetState(255) - - var _m = p.Match(CELParserNUL) - - localctx.(*NullContext).tok = _m - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { - switch ruleIndex { - case 4: - var t *RelationContext = nil - if localctx != nil { - t = localctx.(*RelationContext) - } - return p.Relation_Sempred(t, predIndex) - - case 5: - var t *CalcContext = nil - if localctx != nil { - t = localctx.(*CalcContext) - } - return p.Calc_Sempred(t, predIndex) - - case 7: - var t *MemberContext = nil - if localctx != nil { - t = localctx.(*MemberContext) - } - return p.Member_Sempred(t, predIndex) - - default: - panic("No predicate with index: " + fmt.Sprint(ruleIndex)) - } -} - -func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool { - switch predIndex { - case 0: - return p.Precpred(p.GetParserRuleContext(), 1) - - default: - panic("No predicate with index: " + fmt.Sprint(predIndex)) - } -} - -func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool { - switch predIndex { - case 1: - return p.Precpred(p.GetParserRuleContext(), 2) - - case 2: - return p.Precpred(p.GetParserRuleContext(), 1) - - default: - panic("No predicate with index: " + fmt.Sprint(predIndex)) - } -} - -func (p *CELParser) Member_Sempred(localctx antlr.RuleContext, predIndex int) bool { - switch predIndex { - case 3: - return p.Precpred(p.GetParserRuleContext(), 3) - - case 4: - return p.Precpred(p.GetParserRuleContext(), 2) - - case 5: - return p.Precpred(p.GetParserRuleContext(), 1) - - default: - panic("No predicate with index: " + fmt.Sprint(predIndex)) - } -} diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go deleted file mode 100644 index 7cefe5c57..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package gen // CEL -import "github.com/antlr4-go/antlr/v4" - -// A complete Visitor for a parse tree produced by CELParser. -type CELVisitor interface { - antlr.ParseTreeVisitor - - // Visit a parse tree produced by CELParser#start. - VisitStart(ctx *StartContext) interface{} - - // Visit a parse tree produced by CELParser#expr. - VisitExpr(ctx *ExprContext) interface{} - - // Visit a parse tree produced by CELParser#conditionalOr. - VisitConditionalOr(ctx *ConditionalOrContext) interface{} - - // Visit a parse tree produced by CELParser#conditionalAnd. - VisitConditionalAnd(ctx *ConditionalAndContext) interface{} - - // Visit a parse tree produced by CELParser#relation. - VisitRelation(ctx *RelationContext) interface{} - - // Visit a parse tree produced by CELParser#calc. - VisitCalc(ctx *CalcContext) interface{} - - // Visit a parse tree produced by CELParser#MemberExpr. - VisitMemberExpr(ctx *MemberExprContext) interface{} - - // Visit a parse tree produced by CELParser#LogicalNot. - VisitLogicalNot(ctx *LogicalNotContext) interface{} - - // Visit a parse tree produced by CELParser#Negate. - VisitNegate(ctx *NegateContext) interface{} - - // Visit a parse tree produced by CELParser#MemberCall. - VisitMemberCall(ctx *MemberCallContext) interface{} - - // Visit a parse tree produced by CELParser#Select. - VisitSelect(ctx *SelectContext) interface{} - - // Visit a parse tree produced by CELParser#PrimaryExpr. - VisitPrimaryExpr(ctx *PrimaryExprContext) interface{} - - // Visit a parse tree produced by CELParser#Index. - VisitIndex(ctx *IndexContext) interface{} - - // Visit a parse tree produced by CELParser#Ident. - VisitIdent(ctx *IdentContext) interface{} - - // Visit a parse tree produced by CELParser#GlobalCall. - VisitGlobalCall(ctx *GlobalCallContext) interface{} - - // Visit a parse tree produced by CELParser#Nested. - VisitNested(ctx *NestedContext) interface{} - - // Visit a parse tree produced by CELParser#CreateList. - VisitCreateList(ctx *CreateListContext) interface{} - - // Visit a parse tree produced by CELParser#CreateStruct. - VisitCreateStruct(ctx *CreateStructContext) interface{} - - // Visit a parse tree produced by CELParser#CreateMessage. - VisitCreateMessage(ctx *CreateMessageContext) interface{} - - // Visit a parse tree produced by CELParser#ConstantLiteral. - VisitConstantLiteral(ctx *ConstantLiteralContext) interface{} - - // Visit a parse tree produced by CELParser#exprList. - VisitExprList(ctx *ExprListContext) interface{} - - // Visit a parse tree produced by CELParser#listInit. - VisitListInit(ctx *ListInitContext) interface{} - - // Visit a parse tree produced by CELParser#fieldInitializerList. - VisitFieldInitializerList(ctx *FieldInitializerListContext) interface{} - - // Visit a parse tree produced by CELParser#optField. - VisitOptField(ctx *OptFieldContext) interface{} - - // Visit a parse tree produced by CELParser#mapInitializerList. - VisitMapInitializerList(ctx *MapInitializerListContext) interface{} - - // Visit a parse tree produced by CELParser#SimpleIdentifier. - VisitSimpleIdentifier(ctx *SimpleIdentifierContext) interface{} - - // Visit a parse tree produced by CELParser#EscapedIdentifier. - VisitEscapedIdentifier(ctx *EscapedIdentifierContext) interface{} - - // Visit a parse tree produced by CELParser#optExpr. - VisitOptExpr(ctx *OptExprContext) interface{} - - // Visit a parse tree produced by CELParser#Int. - VisitInt(ctx *IntContext) interface{} - - // Visit a parse tree produced by CELParser#Uint. - VisitUint(ctx *UintContext) interface{} - - // Visit a parse tree produced by CELParser#Double. - VisitDouble(ctx *DoubleContext) interface{} - - // Visit a parse tree produced by CELParser#String. - VisitString(ctx *StringContext) interface{} - - // Visit a parse tree produced by CELParser#Bytes. - VisitBytes(ctx *BytesContext) interface{} - - // Visit a parse tree produced by CELParser#BoolTrue. - VisitBoolTrue(ctx *BoolTrueContext) interface{} - - // Visit a parse tree produced by CELParser#BoolFalse. - VisitBoolFalse(ctx *BoolFalseContext) interface{} - - // Visit a parse tree produced by CELParser#Null. - VisitNull(ctx *NullContext) interface{} -} diff --git a/vendor/github.com/google/cel-go/parser/gen/doc.go b/vendor/github.com/google/cel-go/parser/gen/doc.go deleted file mode 100644 index 57edd4434..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package gen contains all of the ANTLR-generated sources used by the cel-go parser. -package gen diff --git a/vendor/github.com/google/cel-go/parser/gen/generate.sh b/vendor/github.com/google/cel-go/parser/gen/generate.sh deleted file mode 100644 index 27a9559f7..000000000 --- a/vendor/github.com/google/cel-go/parser/gen/generate.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# To regenerate the CEL lexer/parser statically do the following: -# 1. Download the latest anltr tool from https://www.antlr.org/download.html -# 2. Copy the downloaded jar to the gen directory. It will have a name -# like antlr--complete.jar. -# 3. Modify the script below to refer to the current ANTLR version. -# 4. Execute the generation script from the gen directory. -# 5. Delete the jar and commit the regenerated sources. - -#!/bin/sh - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Generate AntLR artifacts. -java -Xmx500M -cp ${DIR}/antlr-4.13.1-complete.jar org.antlr.v4.Tool \ - -Dlanguage=Go \ - -package gen \ - -o ${DIR} \ - -visitor ${DIR}/CEL.g4 - diff --git a/vendor/github.com/google/cel-go/parser/helper.go b/vendor/github.com/google/cel-go/parser/helper.go deleted file mode 100644 index c13296dd5..000000000 --- a/vendor/github.com/google/cel-go/parser/helper.go +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "sync" - - antlr "github.com/antlr4-go/antlr/v4" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -type parserHelper struct { - exprFactory ast.ExprFactory - source common.Source - sourceInfo *ast.SourceInfo - nextID int64 -} - -func newParserHelper(source common.Source, fac ast.ExprFactory) *parserHelper { - return &parserHelper{ - exprFactory: fac, - source: source, - sourceInfo: ast.NewSourceInfo(source), - nextID: 1, - } -} - -func (p *parserHelper) getSourceInfo() *ast.SourceInfo { - return p.sourceInfo -} - -func (p *parserHelper) newLiteral(ctx any, value ref.Val) ast.Expr { - return p.exprFactory.NewLiteral(p.newID(ctx), value) -} - -func (p *parserHelper) newLiteralBool(ctx any, value bool) ast.Expr { - return p.newLiteral(ctx, types.Bool(value)) -} - -func (p *parserHelper) newLiteralString(ctx any, value string) ast.Expr { - return p.newLiteral(ctx, types.String(value)) -} - -func (p *parserHelper) newLiteralBytes(ctx any, value []byte) ast.Expr { - return p.newLiteral(ctx, types.Bytes(value)) -} - -func (p *parserHelper) newLiteralInt(ctx any, value int64) ast.Expr { - return p.newLiteral(ctx, types.Int(value)) -} - -func (p *parserHelper) newLiteralUint(ctx any, value uint64) ast.Expr { - return p.newLiteral(ctx, types.Uint(value)) -} - -func (p *parserHelper) newLiteralDouble(ctx any, value float64) ast.Expr { - return p.newLiteral(ctx, types.Double(value)) -} - -func (p *parserHelper) newIdent(ctx any, name string) ast.Expr { - return p.exprFactory.NewIdent(p.newID(ctx), name) -} - -func (p *parserHelper) newSelect(ctx any, operand ast.Expr, field string) ast.Expr { - return p.exprFactory.NewSelect(p.newID(ctx), operand, field) -} - -func (p *parserHelper) newPresenceTest(ctx any, operand ast.Expr, field string) ast.Expr { - return p.exprFactory.NewPresenceTest(p.newID(ctx), operand, field) -} - -func (p *parserHelper) newGlobalCall(ctx any, function string, args ...ast.Expr) ast.Expr { - return p.exprFactory.NewCall(p.newID(ctx), function, args...) -} - -func (p *parserHelper) newReceiverCall(ctx any, function string, target ast.Expr, args ...ast.Expr) ast.Expr { - return p.exprFactory.NewMemberCall(p.newID(ctx), function, target, args...) -} - -func (p *parserHelper) newList(ctx any, elements []ast.Expr, optionals ...int32) ast.Expr { - return p.exprFactory.NewList(p.newID(ctx), elements, optionals) -} - -func (p *parserHelper) newMap(ctx any, entries ...ast.EntryExpr) ast.Expr { - return p.exprFactory.NewMap(p.newID(ctx), entries) -} - -func (p *parserHelper) newMapEntry(entryID int64, key ast.Expr, value ast.Expr, optional bool) ast.EntryExpr { - return p.exprFactory.NewMapEntry(entryID, key, value, optional) -} - -func (p *parserHelper) newObject(ctx any, typeName string, fields ...ast.EntryExpr) ast.Expr { - return p.exprFactory.NewStruct(p.newID(ctx), typeName, fields) -} - -func (p *parserHelper) newObjectField(fieldID int64, field string, value ast.Expr, optional bool) ast.EntryExpr { - return p.exprFactory.NewStructField(fieldID, field, value, optional) -} - -func (p *parserHelper) newComprehension(ctx any, - iterRange ast.Expr, - iterVar, - accuVar string, - accuInit ast.Expr, - condition ast.Expr, - step ast.Expr, - result ast.Expr) ast.Expr { - return p.exprFactory.NewComprehension( - p.newID(ctx), iterRange, iterVar, accuVar, accuInit, condition, step, result) -} - -func (p *parserHelper) newComprehensionTwoVar(ctx any, - iterRange ast.Expr, - iterVar, iterVar2, - accuVar string, - accuInit ast.Expr, - condition ast.Expr, - step ast.Expr, - result ast.Expr) ast.Expr { - return p.exprFactory.NewComprehensionTwoVar( - p.newID(ctx), iterRange, iterVar, iterVar2, accuVar, accuInit, condition, step, result) -} - -func (p *parserHelper) newID(ctx any) int64 { - if id, isID := ctx.(int64); isID { - return id - } - return p.id(ctx) -} - -func (p *parserHelper) newExpr(ctx any) ast.Expr { - return p.exprFactory.NewUnspecifiedExpr(p.newID(ctx)) -} - -func (p *parserHelper) id(ctx any) int64 { - var offset ast.OffsetRange - switch c := ctx.(type) { - case antlr.ParserRuleContext: - start := c.GetStart() - offset.Start = p.sourceInfo.ComputeOffset(int32(start.GetLine()), int32(start.GetColumn())) - offset.Stop = offset.Start + int32(len(c.GetText())) - case antlr.Token: - offset.Start = p.sourceInfo.ComputeOffset(int32(c.GetLine()), int32(c.GetColumn())) - offset.Stop = offset.Start + int32(len(c.GetText())) - case common.Location: - offset.Start = p.sourceInfo.ComputeOffset(int32(c.Line()), int32(c.Column())) - offset.Stop = offset.Start - case ast.OffsetRange: - offset = c - default: - // This should only happen if the ctx is nil - return -1 - } - id := p.nextID - p.sourceInfo.SetOffsetRange(id, offset) - p.nextID++ - return id -} - -func (p *parserHelper) deleteID(id int64) { - p.sourceInfo.ClearOffsetRange(id) - if id == p.nextID-1 { - p.nextID-- - } -} - -func (p *parserHelper) getLocation(id int64) common.Location { - return p.sourceInfo.GetStartLocation(id) -} - -func (p *parserHelper) getLocationByOffset(offset int32) common.Location { - return p.getSourceInfo().GetLocationByOffset(offset) -} - -// buildMacroCallArg iterates the expression and returns a new expression -// where all macros have been replaced by their IDs in MacroCalls -func (p *parserHelper) buildMacroCallArg(expr ast.Expr) ast.Expr { - if _, found := p.sourceInfo.GetMacroCall(expr.ID()); found { - return p.exprFactory.NewUnspecifiedExpr(expr.ID()) - } - - switch expr.Kind() { - case ast.CallKind: - // Iterate the AST from `expr` recursively looking for macros. Because we are at most - // starting from the top level macro, this recursion is bounded by the size of the AST. This - // means that the depth check on the AST during parsing will catch recursion overflows - // before we get to here. - call := expr.AsCall() - macroArgs := make([]ast.Expr, len(call.Args())) - for index, arg := range call.Args() { - macroArgs[index] = p.buildMacroCallArg(arg) - } - if !call.IsMemberFunction() { - return p.exprFactory.NewCall(expr.ID(), call.FunctionName(), macroArgs...) - } - macroTarget := p.buildMacroCallArg(call.Target()) - return p.exprFactory.NewMemberCall(expr.ID(), call.FunctionName(), macroTarget, macroArgs...) - case ast.ListKind: - list := expr.AsList() - macroListArgs := make([]ast.Expr, list.Size()) - for i, elem := range list.Elements() { - macroListArgs[i] = p.buildMacroCallArg(elem) - } - return p.exprFactory.NewList(expr.ID(), macroListArgs, list.OptionalIndices()) - } - return expr -} - -// addMacroCall adds the macro the the MacroCalls map in source info. If a macro has args/subargs/target -// that are macros, their ID will be stored instead for later self-lookups. -func (p *parserHelper) addMacroCall(exprID int64, function string, target ast.Expr, args ...ast.Expr) { - macroArgs := make([]ast.Expr, len(args)) - for index, arg := range args { - macroArgs[index] = p.buildMacroCallArg(arg) - } - if target == nil { - p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewCall(0, function, macroArgs...)) - return - } - macroTarget := target - if _, found := p.sourceInfo.GetMacroCall(target.ID()); found { - macroTarget = p.exprFactory.NewUnspecifiedExpr(target.ID()) - } else { - macroTarget = p.buildMacroCallArg(target) - } - p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewMemberCall(0, function, macroTarget, macroArgs...)) -} - -// logicManager compacts logical trees into a more efficient structure which is semantically -// equivalent with how the logic graph is constructed by the ANTLR parser. -// -// The purpose of the logicManager is to ensure a compact serialization format for the logical &&, || -// operators which have a tendency to create long DAGs which are skewed in one direction. Since the -// operators are commutative re-ordering the terms *must not* affect the evaluation result. -// -// The logic manager will either render the terms to N-chained && / || operators as a single logical -// call with N-terms, or will rebalance the tree. Rebalancing the terms is a safe, if somewhat -// controversial choice as it alters the traditional order of execution assumptions present in most -// expressions. -type logicManager struct { - exprFactory ast.ExprFactory - function string - terms []ast.Expr - ops []int64 - variadicASTs bool -} - -// newVariadicLogicManager creates a logic manager instance bound to a specific function and its first term. -func newVariadicLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager { - return &logicManager{ - exprFactory: fac, - function: function, - terms: []ast.Expr{term}, - ops: []int64{}, - variadicASTs: true, - } -} - -// newBalancingLogicManager creates a logic manager instance bound to a specific function and its first term. -func newBalancingLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager { - return &logicManager{ - exprFactory: fac, - function: function, - terms: []ast.Expr{term}, - ops: []int64{}, - variadicASTs: false, - } -} - -// addTerm adds an operation identifier and term to the set of terms to be balanced. -func (l *logicManager) addTerm(op int64, term ast.Expr) { - l.terms = append(l.terms, term) - l.ops = append(l.ops, op) -} - -// toExpr renders the logic graph into an Expr value, either balancing a tree of logical -// operations or creating a variadic representation of the logical operator. -func (l *logicManager) toExpr() ast.Expr { - if len(l.terms) == 1 { - return l.terms[0] - } - if l.variadicASTs { - return l.exprFactory.NewCall(l.ops[0], l.function, l.terms...) - } - return l.balancedTree(0, len(l.ops)-1) -} - -// balancedTree recursively balances the terms provided to a commutative operator. -func (l *logicManager) balancedTree(lo, hi int) ast.Expr { - mid := (lo + hi + 1) / 2 - - var left ast.Expr - if mid == lo { - left = l.terms[mid] - } else { - left = l.balancedTree(lo, mid-1) - } - - var right ast.Expr - if mid == hi { - right = l.terms[mid+1] - } else { - right = l.balancedTree(mid+1, hi) - } - return l.exprFactory.NewCall(l.ops[mid], l.function, left, right) -} - -type exprHelper struct { - *parserHelper - id int64 -} - -func (e *exprHelper) nextMacroID() int64 { - return e.parserHelper.id(e.parserHelper.getLocation(e.id)) -} - -// Copy implements the ExprHelper interface method by producing a copy of the input Expr value -// with a fresh set of numeric identifiers the Expr and all its descendants. -func (e *exprHelper) Copy(expr ast.Expr) ast.Expr { - offsetRange, _ := e.parserHelper.sourceInfo.GetOffsetRange(expr.ID()) - copyID := e.parserHelper.newID(offsetRange) - switch expr.Kind() { - case ast.LiteralKind: - return e.exprFactory.NewLiteral(copyID, expr.AsLiteral()) - case ast.IdentKind: - return e.exprFactory.NewIdent(copyID, expr.AsIdent()) - case ast.SelectKind: - sel := expr.AsSelect() - op := e.Copy(sel.Operand()) - if sel.IsTestOnly() { - return e.exprFactory.NewPresenceTest(copyID, op, sel.FieldName()) - } - return e.exprFactory.NewSelect(copyID, op, sel.FieldName()) - case ast.CallKind: - call := expr.AsCall() - args := call.Args() - argsCopy := make([]ast.Expr, len(args)) - for i, arg := range args { - argsCopy[i] = e.Copy(arg) - } - if !call.IsMemberFunction() { - return e.exprFactory.NewCall(copyID, call.FunctionName(), argsCopy...) - } - return e.exprFactory.NewMemberCall(copyID, call.FunctionName(), e.Copy(call.Target()), argsCopy...) - case ast.ListKind: - list := expr.AsList() - elems := list.Elements() - elemsCopy := make([]ast.Expr, len(elems)) - for i, elem := range elems { - elemsCopy[i] = e.Copy(elem) - } - return e.exprFactory.NewList(copyID, elemsCopy, list.OptionalIndices()) - case ast.MapKind: - m := expr.AsMap() - entries := m.Entries() - entriesCopy := make([]ast.EntryExpr, len(entries)) - for i, en := range entries { - entry := en.AsMapEntry() - entryID := e.nextMacroID() - entriesCopy[i] = e.exprFactory.NewMapEntry(entryID, - e.Copy(entry.Key()), e.Copy(entry.Value()), entry.IsOptional()) - } - return e.exprFactory.NewMap(copyID, entriesCopy) - case ast.StructKind: - s := expr.AsStruct() - fields := s.Fields() - fieldsCopy := make([]ast.EntryExpr, len(fields)) - for i, f := range fields { - field := f.AsStructField() - fieldID := e.nextMacroID() - fieldsCopy[i] = e.exprFactory.NewStructField(fieldID, - field.Name(), e.Copy(field.Value()), field.IsOptional()) - } - return e.exprFactory.NewStruct(copyID, s.TypeName(), fieldsCopy) - case ast.ComprehensionKind: - compre := expr.AsComprehension() - iterRange := e.Copy(compre.IterRange()) - accuInit := e.Copy(compre.AccuInit()) - cond := e.Copy(compre.LoopCondition()) - step := e.Copy(compre.LoopStep()) - result := e.Copy(compre.Result()) - // All comprehensions can be represented by the two-variable comprehension since the - // differentiation between one and two-variable is whether the iterVar2 value is non-empty. - return e.exprFactory.NewComprehensionTwoVar(copyID, - iterRange, compre.IterVar(), compre.IterVar2(), compre.AccuVar(), accuInit, cond, step, result) - } - return e.exprFactory.NewUnspecifiedExpr(copyID) -} - -// NewLiteral implements the ExprHelper interface method. -func (e *exprHelper) NewLiteral(value ref.Val) ast.Expr { - return e.exprFactory.NewLiteral(e.nextMacroID(), value) -} - -// NewList implements the ExprHelper interface method. -func (e *exprHelper) NewList(elems ...ast.Expr) ast.Expr { - return e.exprFactory.NewList(e.nextMacroID(), elems, []int32{}) -} - -// NewMap implements the ExprHelper interface method. -func (e *exprHelper) NewMap(entries ...ast.EntryExpr) ast.Expr { - return e.exprFactory.NewMap(e.nextMacroID(), entries) -} - -// NewMapEntry implements the ExprHelper interface method. -func (e *exprHelper) NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr { - return e.exprFactory.NewMapEntry(e.nextMacroID(), key, val, optional) -} - -// NewStruct implements the ExprHelper interface method. -func (e *exprHelper) NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr { - return e.exprFactory.NewStruct(e.nextMacroID(), typeName, fieldInits) -} - -// NewStructField implements the ExprHelper interface method. -func (e *exprHelper) NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr { - return e.exprFactory.NewStructField(e.nextMacroID(), field, init, optional) -} - -// NewComprehension implements the ExprHelper interface method. -func (e *exprHelper) NewComprehension( - iterRange ast.Expr, - iterVar string, - accuVar string, - accuInit ast.Expr, - condition ast.Expr, - step ast.Expr, - result ast.Expr) ast.Expr { - return e.exprFactory.NewComprehension( - e.nextMacroID(), iterRange, iterVar, accuVar, accuInit, condition, step, result) -} - -// NewComprehensionTwoVar implements the ExprHelper interface method. -func (e *exprHelper) NewComprehensionTwoVar( - iterRange ast.Expr, - iterVar, - iterVar2, - accuVar string, - accuInit, - condition, - step, - result ast.Expr) ast.Expr { - return e.exprFactory.NewComprehensionTwoVar( - e.nextMacroID(), iterRange, iterVar, iterVar2, accuVar, accuInit, condition, step, result) -} - -// NewIdent implements the ExprHelper interface method. -func (e *exprHelper) NewIdent(name string) ast.Expr { - return e.exprFactory.NewIdent(e.nextMacroID(), name) -} - -// NewAccuIdent implements the ExprHelper interface method. -func (e *exprHelper) NewAccuIdent() ast.Expr { - return e.exprFactory.NewAccuIdent(e.nextMacroID()) -} - -// AccuIdentName implements the ExprHelper interface method. -func (e *exprHelper) AccuIdentName() string { - return e.exprFactory.AccuIdentName() -} - -// NewGlobalCall implements the ExprHelper interface method. -func (e *exprHelper) NewCall(function string, args ...ast.Expr) ast.Expr { - return e.exprFactory.NewCall(e.nextMacroID(), function, args...) -} - -// NewMemberCall implements the ExprHelper interface method. -func (e *exprHelper) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr { - return e.exprFactory.NewMemberCall(e.nextMacroID(), function, target, args...) -} - -// NewPresenceTest implements the ExprHelper interface method. -func (e *exprHelper) NewPresenceTest(operand ast.Expr, field string) ast.Expr { - return e.exprFactory.NewPresenceTest(e.nextMacroID(), operand, field) -} - -// NewSelect implements the ExprHelper interface method. -func (e *exprHelper) NewSelect(operand ast.Expr, field string) ast.Expr { - return e.exprFactory.NewSelect(e.nextMacroID(), operand, field) -} - -// OffsetLocation implements the ExprHelper interface method. -func (e *exprHelper) OffsetLocation(exprID int64) common.Location { - return e.parserHelper.sourceInfo.GetStartLocation(exprID) -} - -// NewError associates an error message with a given expression id, populating the source offset location of the error if possible. -func (e *exprHelper) NewError(exprID int64, message string) *common.Error { - return common.NewError(exprID, message, e.OffsetLocation(exprID)) -} - -var ( - // Thread-safe pool of ExprHelper values to minimize alloc overhead of ExprHelper creations. - exprHelperPool = &sync.Pool{ - New: func() any { - return &exprHelper{} - }, - } -) diff --git a/vendor/github.com/google/cel-go/parser/input.go b/vendor/github.com/google/cel-go/parser/input.go deleted file mode 100644 index 44792455d..000000000 --- a/vendor/github.com/google/cel-go/parser/input.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - antlr "github.com/antlr4-go/antlr/v4" - - "github.com/google/cel-go/common/runes" -) - -type charStream struct { - buf runes.Buffer - pos int - src string -} - -// Consume implements (antlr.CharStream).Consume. -func (c *charStream) Consume() { - if c.pos >= c.buf.Len() { - panic("cannot consume EOF") - } - c.pos++ -} - -// LA implements (antlr.CharStream).LA. -func (c *charStream) LA(offset int) int { - if offset == 0 { - return 0 - } - if offset < 0 { - offset++ - } - pos := c.pos + offset - 1 - if pos < 0 || pos >= c.buf.Len() { - return antlr.TokenEOF - } - return int(c.buf.Get(pos)) -} - -// LT mimics (*antlr.InputStream).LT. -func (c *charStream) LT(offset int) int { - return c.LA(offset) -} - -// Mark implements (antlr.CharStream).Mark. -func (c *charStream) Mark() int { - return -1 -} - -// Release implements (antlr.CharStream).Release. -func (c *charStream) Release(marker int) {} - -// Index implements (antlr.CharStream).Index. -func (c *charStream) Index() int { - return c.pos -} - -// Seek implements (antlr.CharStream).Seek. -func (c *charStream) Seek(index int) { - if index <= c.pos { - c.pos = index - return - } - if index < c.buf.Len() { - c.pos = index - } else { - c.pos = c.buf.Len() - } -} - -// Size implements (antlr.CharStream).Size. -func (c *charStream) Size() int { - return c.buf.Len() -} - -// GetSourceName implements (antlr.CharStream).GetSourceName. -func (c *charStream) GetSourceName() string { - return c.src -} - -// GetText implements (antlr.CharStream).GetText. -func (c *charStream) GetText(start, stop int) string { - if stop >= c.buf.Len() { - stop = c.buf.Len() - 1 - } - if start >= c.buf.Len() { - return "" - } - return c.buf.Slice(start, stop+1) -} - -// GetTextFromTokens implements (antlr.CharStream).GetTextFromTokens. -func (c *charStream) GetTextFromTokens(start, stop antlr.Token) string { - if start != nil && stop != nil { - return c.GetText(start.GetTokenIndex(), stop.GetTokenIndex()) - } - return "" -} - -// GetTextFromInterval implements (antlr.CharStream).GetTextFromInterval. -func (c *charStream) GetTextFromInterval(i antlr.Interval) string { - return c.GetText(i.Start, i.Stop) -} - -// String mimics (*antlr.InputStream).String. -func (c *charStream) String() string { - return c.buf.Slice(0, c.buf.Len()) -} - -var _ antlr.CharStream = &charStream{} - -func newCharStream(buf runes.Buffer, desc string) antlr.CharStream { - return &charStream{ - buf: buf, - src: desc, - } -} diff --git a/vendor/github.com/google/cel-go/parser/macro.go b/vendor/github.com/google/cel-go/parser/macro.go deleted file mode 100644 index 1ef43c4b5..000000000 --- a/vendor/github.com/google/cel-go/parser/macro.go +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "fmt" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// MacroOpt defines a functional option for configuring macro behavior. -type MacroOpt func(*macro) *macro - -// MacroDocs configures a list of strings into a multiline description for the macro. -func MacroDocs(docs ...string) MacroOpt { - return func(m *macro) *macro { - m.doc = common.MultilineDescription(docs...) - return m - } -} - -// MacroExamples configures a list of examples, either as a string or common.MultilineString, -// into an example set to be provided with the macro Documentation() call. -func MacroExamples(examples ...string) MacroOpt { - return func(m *macro) *macro { - m.examples = examples - return m - } -} - -// NewGlobalMacro creates a Macro for a global function with the specified arg count. -func NewGlobalMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro { - m := ¯o{ - function: function, - argCount: argCount, - expander: expander} - for _, opt := range opts { - m = opt(m) - } - return m -} - -// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count. -func NewReceiverMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro { - m := ¯o{ - function: function, - argCount: argCount, - expander: expander, - receiverStyle: true} - for _, opt := range opts { - m = opt(m) - } - return m -} - -// NewGlobalVarArgMacro creates a Macro for a global function with a variable arg count. -func NewGlobalVarArgMacro(function string, expander MacroExpander, opts ...MacroOpt) Macro { - m := ¯o{ - function: function, - expander: expander, - varArgStyle: true} - for _, opt := range opts { - m = opt(m) - } - return m -} - -// NewReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count. -func NewReceiverVarArgMacro(function string, expander MacroExpander, opts ...MacroOpt) Macro { - m := ¯o{ - function: function, - expander: expander, - receiverStyle: true, - varArgStyle: true} - for _, opt := range opts { - m = opt(m) - } - return m -} - -// Macro interface for describing the function signature to match and the MacroExpander to apply. -// -// Note: when a Macro should apply to multiple overloads (based on arg count) of a given function, -// a Macro should be created per arg-count. -type Macro interface { - // Function name to match. - Function() string - - // ArgCount for the function call. - // - // When the macro is a var-arg style macro, the return value will be zero, but the MacroKey - // will contain a `*` where the arg count would have been. - ArgCount() int - - // IsReceiverStyle returns true if the macro matches a receiver style call. - IsReceiverStyle() bool - - // MacroKey returns the macro signatures accepted by this macro. - // - // Format: `::`. - // - // When the macros is a var-arg style macro, the `arg-count` value is represented as a `*`. - MacroKey() string - - // Expander returns the MacroExpander to apply when the macro key matches the parsed call - // signature. - Expander() MacroExpander -} - -// Macro type which declares the function name and arg count expected for the -// macro, as well as a macro expansion function. -type macro struct { - function string - receiverStyle bool - varArgStyle bool - argCount int - expander MacroExpander - doc string - examples []string -} - -// Function returns the macro's function name (i.e. the function whose syntax it mimics). -func (m *macro) Function() string { - return m.function -} - -// ArgCount returns the number of arguments the macro expects. -func (m *macro) ArgCount() int { - return m.argCount -} - -// IsReceiverStyle returns whether the macro is receiver style. -func (m *macro) IsReceiverStyle() bool { - return m.receiverStyle -} - -// Expander implements the Macro interface method. -func (m *macro) Expander() MacroExpander { - return m.expander -} - -// MacroKey implements the Macro interface method. -func (m *macro) MacroKey() string { - if m.varArgStyle { - return makeVarArgMacroKey(m.function, m.receiverStyle) - } - return makeMacroKey(m.function, m.argCount, m.receiverStyle) -} - -// Documentation generates documentation and examples for the macro. -func (m *macro) Documentation() *common.Doc { - examples := make([]*common.Doc, len(m.examples)) - for i, ex := range m.examples { - examples[i] = common.NewExampleDoc(ex) - } - return common.NewMacroDoc(m.Function(), m.doc, examples...) -} - -func makeMacroKey(name string, args int, receiverStyle bool) string { - return fmt.Sprintf("%s:%d:%v", name, args, receiverStyle) -} - -func makeVarArgMacroKey(name string, receiverStyle bool) string { - return fmt.Sprintf("%s:*:%v", name, receiverStyle) -} - -// MacroExpander converts a call and its associated arguments into a new CEL abstract syntax tree. -// -// If the MacroExpander determines within the implementation that an expansion is not needed it may return -// a nil Expr value to indicate a non-match. However, if an expansion is to be performed, but the arguments -// are not well-formed, the result of the expansion will be an error. -// -// The MacroExpander accepts as arguments a MacroExprHelper as well as the arguments used in the function call -// and produces as output an Expr ast node. -// -// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil. -type MacroExpander func(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) - -// ExprHelper assists with the creation of Expr values in a manner which is consistent -// the internal semantics and id generation behaviors of the parser and checker libraries. -type ExprHelper interface { - // Copy the input expression with a brand new set of identifiers. - Copy(ast.Expr) ast.Expr - - // Literal creates an Expr value for a scalar literal value. - NewLiteral(value ref.Val) ast.Expr - - // NewList creates a list literal instruction with an optional set of elements. - NewList(elems ...ast.Expr) ast.Expr - - // NewMap creates a CreateStruct instruction for a map where the map is comprised of the - // optional set of key, value entries. - NewMap(entries ...ast.EntryExpr) ast.Expr - - // NewMapEntry creates a Map Entry for the key, value pair. - NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr - - // NewStruct creates a struct literal expression with an optional set of field initializers. - NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr - - // NewStructField creates a new struct field initializer from the field name and value. - NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr - - // NewComprehension creates a new one-variable comprehension instruction. - // - // - iterRange represents the expression that resolves to a list or map where the elements or - // keys (respectively) will be iterated over. - // - iterVar is the variable name for the list element value, or the map key, depending on the - // range type. - // - accuVar is the accumulation variable name, typically parser.AccumulatorName. - // - accuInit is the initial expression whose value will be set for the accuVar prior to - // folding. - // - condition is the expression to test to determine whether to continue folding. - // - step is the expression to evaluation at the conclusion of a single fold iteration. - // - result is the computation to evaluate at the conclusion of the fold. - // - // The accuVar should not shadow variable names that you would like to reference within the - // environment in the step and condition expressions. Presently, the name __result__ is commonly - // used by built-in macros but this may change in the future. - NewComprehension(iterRange ast.Expr, - iterVar, - accuVar string, - accuInit, - condition, - step, - result ast.Expr) ast.Expr - - // NewComprehensionTwoVar creates a new two-variable comprehension instruction. - // - // - iterRange represents the expression that resolves to a list or map where the elements or - // keys (respectively) will be iterated over. - // - iterVar is the iteration variable assigned to the list index or the map key. - // - iterVar2 is the iteration variable assigned to the list element value or the map key value. - // - accuVar is the accumulation variable name, typically parser.AccumulatorName. - // - accuInit is the initial expression whose value will be set for the accuVar prior to - // folding. - // - condition is the expression to test to determine whether to continue folding. - // - step is the expression to evaluation at the conclusion of a single fold iteration. - // - result is the computation to evaluate at the conclusion of the fold. - // - // The accuVar should not shadow variable names that you would like to reference within the - // environment in the step and condition expressions. Presently, the name __result__ is commonly - // used by built-in macros but this may change in the future. - NewComprehensionTwoVar(iterRange ast.Expr, - iterVar, - iterVar2, - accuVar string, - accuInit, - condition, - step, - result ast.Expr) ast.Expr - - // NewIdent creates an identifier Expr value. - NewIdent(name string) ast.Expr - - // NewAccuIdent returns an accumulator identifier for use with comprehension results. - NewAccuIdent() ast.Expr - - // AccuIdentName returns the name of the accumulator identifier. - AccuIdentName() string - - // NewCall creates a function call Expr value for a global (free) function. - NewCall(function string, args ...ast.Expr) ast.Expr - - // NewMemberCall creates a function call Expr value for a receiver-style function. - NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr - - // NewPresenceTest creates a Select TestOnly Expr value for modelling has() semantics. - NewPresenceTest(operand ast.Expr, field string) ast.Expr - - // NewSelect create a field traversal Expr value. - NewSelect(operand ast.Expr, field string) ast.Expr - - // OffsetLocation returns the Location of the expression identifier. - OffsetLocation(exprID int64) common.Location - - // NewError associates an error message with a given expression id. - NewError(exprID int64, message string) *common.Error -} - -var ( - // HasMacro expands "has(m.f)" which tests the presence of a field, avoiding the need to - // specify the field as a string. - HasMacro = NewGlobalMacro(operators.Has, 1, MakeHas, - MacroDocs( - `check a protocol buffer message for the presence of a field, or check a map`, - `for the presence of a string key.`, - `Only map accesses using the select notation are supported.`), - MacroExamples( - common.MultilineDescription( - `// true if the 'address' field exists in the 'user' message`, - `has(user.address)`), - common.MultilineDescription( - `// test whether the 'key_name' is set on the map which defines it`, - `has({'key_name': 'value'}.key_name) // true`), - common.MultilineDescription( - `// test whether the 'id' field is set to a non-default value on the Expr{} message literal`, - `has(Expr{}.id) // false`), - )) - - // AllMacro expands "range.all(var, predicate)" into a comprehension which ensures that all - // elements in the range satisfy the predicate. - AllMacro = NewReceiverMacro(operators.All, 2, MakeAll, - MacroDocs(`tests whether all elements in the input list or all keys in a map`, - `satisfy the given predicate. The all macro behaves in a manner consistent with`, - `the Logical AND operator including in how it absorbs errors and short-circuits.`), - MacroExamples( - `[1, 2, 3].all(x, x > 0) // true`, - `[1, 2, 0].all(x, x > 0) // false`, - `['apple', 'banana', 'cherry'].all(fruit, fruit.size() > 3) // true`, - `[3.14, 2.71, 1.61].all(num, num < 3.0) // false`, - `{'a': 1, 'b': 2, 'c': 3}.all(key, key != 'b') // false`, - common.MultilineDescription( - `// an empty list or map as the range will result in a trivially true result`, - `[].all(x, x > 0) // true`), - )) - - // ExistsMacro expands "range.exists(var, predicate)" into a comprehension which ensures that - // some element in the range satisfies the predicate. - ExistsMacro = NewReceiverMacro(operators.Exists, 2, MakeExists, - MacroDocs(`tests whether any value in the list or any key in the map`, - `satisfies the predicate expression. The exists macro behaves in a manner`, - `consistent with the Logical OR operator including in how it absorbs errors and`, - `short-circuits.`), - MacroExamples( - `[1, 2, 3].exists(i, i % 2 != 0) // true`, - `[0, -1, 5].exists(num, num < 0) // true`, - `{'x': 'foo', 'y': 'bar'}.exists(key, key.startsWith('z')) // false`, - common.MultilineDescription( - `// an empty list or map as the range will result in a trivially false result`, - `[].exists(i, i > 0) // false`), - common.MultilineDescription( - `// test whether a key name equalling 'iss' exists in the map and the`, - `// value contains the substring 'cel.dev'`, - `// tokens = {'sub': 'me', 'iss': 'https://issuer.cel.dev'}`, - `tokens.exists(k, k == 'iss' && tokens[k].contains('cel.dev'))`), - )) - - // ExistsOneMacro expands "range.exists_one(var, predicate)", which is true if for exactly one - // element in range the predicate holds. - // Deprecated: Use ExistsOneMacroNew - ExistsOneMacro = NewReceiverMacro(operators.ExistsOne, 2, MakeExistsOne, - MacroDocs(`tests whether exactly one list element or map key satisfies`, - `the predicate expression. This macro does not short-circuit in order to remain`, - `consistent with logical operators being the only operators which can absorb`, - `errors within CEL.`), - MacroExamples( - `[1, 2, 2].exists_one(i, i < 2) // true`, - `{'a': 'hello', 'aa': 'hellohello'}.exists_one(k, k.startsWith('a')) // false`, - `[1, 2, 3, 4].exists_one(num, num % 2 == 0) // false`, - common.MultilineDescription( - `// ensure exactly one key in the map ends in @acme.co`, - `{'wiley@acme.co': 'coyote', 'aa@milne.co': 'bear'}.exists_one(k, k.endsWith('@acme.co')) // true`), - )) - - // ExistsOneMacroNew expands "range.existsOne(var, predicate)", which is true if for exactly one - // element in range the predicate holds. - ExistsOneMacroNew = NewReceiverMacro("existsOne", 2, MakeExistsOne, - MacroDocs( - `tests whether exactly one list element or map key satisfies the predicate`, - `expression. This macro does not short-circuit in order to remain consistent`, - `with logical operators being the only operators which can absorb errors`, - `within CEL.`), - MacroExamples( - `[1, 2, 2].existsOne(i, i < 2) // true`, - `{'a': 'hello', 'aa': 'hellohello'}.existsOne(k, k.startsWith('a')) // false`, - `[1, 2, 3, 4].existsOne(num, num % 2 == 0) // false`, - common.MultilineDescription( - `// ensure exactly one key in the map ends in @acme.co`, - `{'wiley@acme.co': 'coyote', 'aa@milne.co': 'bear'}.existsOne(k, k.endsWith('@acme.co')) // true`), - )) - - // MapMacro expands "range.map(var, function)" into a comprehension which applies the function - // to each element in the range to produce a new list. - MapMacro = NewReceiverMacro(operators.Map, 2, MakeMap, - MacroDocs("the three-argument form of map transforms all elements in the input range."), - MacroExamples( - `[1, 2, 3].map(x, x * 2) // [2, 4, 6]`, - `[5, 10, 15].map(x, x / 5) // [1, 2, 3]`, - `['apple', 'banana'].map(fruit, fruit.upperAscii()) // ['APPLE', 'BANANA']`, - common.MultilineDescription( - `// Combine all map key-value pairs into a list`, - `{'hi': 'you', 'howzit': 'bruv'}.map(k,`, - ` k + ":" + {'hi': 'you', 'howzit': 'bruv'}[k]) // ['hi:you', 'howzit:bruv']`), - )) - - // MapFilterMacro expands "range.map(var, predicate, function)" into a comprehension which - // first filters the elements in the range by the predicate, then applies the transform function - // to produce a new list. - MapFilterMacro = NewReceiverMacro(operators.Map, 3, MakeMap, - MacroDocs(`the four-argument form of the map transforms only elements which satisfy`, - `the predicate which is equivalent to chaining the filter and three-argument`, - `map macros together.`), - MacroExamples( - common.MultilineDescription( - `// multiply only numbers divisible two, by 2`, - `[1, 2, 3, 4].map(num, num % 2 == 0, num * 2) // [4, 8]`), - )) - - // FilterMacro expands "range.filter(var, predicate)" into a comprehension which filters - // elements in the range, producing a new list from the elements that satisfy the predicate. - FilterMacro = NewReceiverMacro(operators.Filter, 2, MakeFilter, - MacroDocs(`returns a list containing only the elements from the input list`, - `that satisfy the given predicate`), - MacroExamples( - `[1, 2, 3].filter(x, x > 1) // [2, 3]`, - `['cat', 'dog', 'bird', 'fish'].filter(pet, pet.size() == 3) // ['cat', 'dog']`, - `[{'a': 10, 'b': 5, 'c': 20}].map(m, m.filter(key, m[key] > 10)) // [['c']]`, - common.MultilineDescription( - `// filter a list to select only emails with the @cel.dev suffix`, - `['alice@buf.io', 'tristan@cel.dev'].filter(v, v.endsWith('@cel.dev')) // ['tristan@cel.dev']`), - common.MultilineDescription( - `// filter a map into a list, selecting only the values for keys that start with 'http-auth'`, - `{'http-auth-agent': 'secret', 'user-agent': 'mozilla'}.filter(k,`, - ` k.startsWith('http-auth')) // ['secret']`), - )) - - // AllMacros includes the list of all spec-supported macros. - AllMacros = []Macro{ - HasMacro, - AllMacro, - ExistsMacro, - ExistsOneMacro, - ExistsOneMacroNew, - MapMacro, - MapFilterMacro, - FilterMacro, - } - - // NoMacros list. - NoMacros = []Macro{} -) - -// AccumulatorName is the traditional variable name assigned to the fold accumulator variable. -const AccumulatorName = "__result__" - -// HiddenAccumulatorName is a proposed update to the default fold accumlator variable. -// @result is not normally accessible from source, preventing accidental or intentional collisions -// in user expressions. -const HiddenAccumulatorName = "@result" - -type quantifierKind int - -const ( - quantifierAll quantifierKind = iota - quantifierExists - quantifierExistsOne -) - -// MakeAll expands the input call arguments into a comprehension that returns true if all of the -// elements in the range match the predicate expressions: -// .all(, ) -func MakeAll(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - return makeQuantifier(quantifierAll, eh, target, args) -} - -// MakeExists expands the input call arguments into a comprehension that returns true if any of the -// elements in the range match the predicate expressions: -// .exists(, ) -func MakeExists(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - return makeQuantifier(quantifierExists, eh, target, args) -} - -// MakeExistsOne expands the input call arguments into a comprehension that returns true if exactly -// one of the elements in the range match the predicate expressions: -// .exists_one(, ) -func MakeExistsOne(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - return makeQuantifier(quantifierExistsOne, eh, target, args) -} - -// MakeMap expands the input call arguments into a comprehension that transforms each element in the -// input to produce an output list. -// -// There are two call patterns supported by map: -// -// .map(, ) -// .map(, , ) -// -// In the second form only iterVar values which return true when provided to the predicate expression -// are transformed. -func MakeMap(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - v, found := extractIdent(args[0]) - if !found { - return nil, eh.NewError(args[0].ID(), "argument is not an identifier") - } - accu := eh.AccuIdentName() - if v == accu || v == AccumulatorName { - return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable") - } - - var fn ast.Expr - var filter ast.Expr - - if len(args) == 3 { - filter = args[1] - fn = args[2] - } else { - filter = nil - fn = args[1] - } - - init := eh.NewList() - condition := eh.NewLiteral(types.True) - step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(fn)) - - if filter != nil { - step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent()) - } - return eh.NewComprehension(target, v, accu, init, condition, step, eh.NewAccuIdent()), nil -} - -// MakeFilter expands the input call arguments into a comprehension which produces a list which contains -// only elements which match the provided predicate expression: -// .filter(, ) -func MakeFilter(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - v, found := extractIdent(args[0]) - if !found { - return nil, eh.NewError(args[0].ID(), "argument is not an identifier") - } - accu := eh.AccuIdentName() - if v == accu || v == AccumulatorName { - return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable") - } - - filter := args[1] - init := eh.NewList() - condition := eh.NewLiteral(types.True) - step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(args[0])) - step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent()) - return eh.NewComprehension(target, v, accu, init, condition, step, eh.NewAccuIdent()), nil -} - -// MakeHas expands the input call arguments into a presence test, e.g. has(.field) -func MakeHas(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - if args[0].Kind() == ast.SelectKind { - s := args[0].AsSelect() - return eh.NewPresenceTest(s.Operand(), s.FieldName()), nil - } - return nil, eh.NewError(args[0].ID(), "invalid argument to has() macro") -} - -func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { - v, found := extractIdent(args[0]) - if !found { - return nil, eh.NewError(args[0].ID(), "argument must be a simple name") - } - accu := eh.AccuIdentName() - if v == accu || v == AccumulatorName { - return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable") - } - - var init ast.Expr - var condition ast.Expr - var step ast.Expr - var result ast.Expr - switch kind { - case quantifierAll: - init = eh.NewLiteral(types.True) - condition = eh.NewCall(operators.NotStrictlyFalse, eh.NewAccuIdent()) - step = eh.NewCall(operators.LogicalAnd, eh.NewAccuIdent(), args[1]) - result = eh.NewAccuIdent() - case quantifierExists: - init = eh.NewLiteral(types.False) - condition = eh.NewCall( - operators.NotStrictlyFalse, - eh.NewCall(operators.LogicalNot, eh.NewAccuIdent())) - step = eh.NewCall(operators.LogicalOr, eh.NewAccuIdent(), args[1]) - result = eh.NewAccuIdent() - case quantifierExistsOne: - init = eh.NewLiteral(types.Int(0)) - condition = eh.NewLiteral(types.True) - step = eh.NewCall(operators.Conditional, args[1], - eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewLiteral(types.Int(1))), eh.NewAccuIdent()) - result = eh.NewCall(operators.Equals, eh.NewAccuIdent(), eh.NewLiteral(types.Int(1))) - default: - return nil, eh.NewError(args[0].ID(), fmt.Sprintf("unrecognized quantifier '%v'", kind)) - } - return eh.NewComprehension(target, v, accu, init, condition, step, result), nil -} - -func extractIdent(e ast.Expr) (string, bool) { - switch e.Kind() { - case ast.IdentKind: - return e.AsIdent(), true - } - return "", false -} diff --git a/vendor/github.com/google/cel-go/parser/options.go b/vendor/github.com/google/cel-go/parser/options.go deleted file mode 100644 index 4eb30f83e..000000000 --- a/vendor/github.com/google/cel-go/parser/options.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import "fmt" - -type options struct { - maxRecursionDepth int - errorReportingLimit int - errorRecoveryTokenLookaheadLimit int - errorRecoveryLimit int - expressionSizeCodePointLimit int - macros map[string]Macro - populateMacroCalls bool - enableOptionalSyntax bool - enableVariadicOperatorASTs bool - enableIdentEscapeSyntax bool - enableHiddenAccumulatorName bool -} - -// Option configures the behavior of the parser. -type Option func(*options) error - -// MaxRecursionDepth limits the maximum depth the parser will attempt to parse the expression before giving up. -func MaxRecursionDepth(limit int) Option { - return func(opts *options) error { - if limit < -1 { - return fmt.Errorf("max recursion depth must be greater than or equal to -1: %d", limit) - } - opts.maxRecursionDepth = limit - return nil - } -} - -// ErrorRecoveryLookaheadTokenLimit limits the number of lexer tokens that may be considered during error recovery. -// -// Error recovery often involves looking ahead in the input to determine if there's a point at which parsing may -// successfully resume. In some pathological cases, the parser can look through quite a large set of input which -// in turn generates a lot of back-tracking and performance degredation. -// -// The limit must be >= 1, and is recommended to be less than the default of 256. -func ErrorRecoveryLookaheadTokenLimit(limit int) Option { - return func(opts *options) error { - if limit < 1 { - return fmt.Errorf("error recovery lookahead token limit must be at least 1: %d", limit) - } - opts.errorRecoveryTokenLookaheadLimit = limit - return nil - } -} - -// ErrorRecoveryLimit limits the number of attempts the parser will perform to recover from an error. -func ErrorRecoveryLimit(limit int) Option { - return func(opts *options) error { - if limit < -1 { - return fmt.Errorf("error recovery limit must be greater than or equal to -1: %d", limit) - } - opts.errorRecoveryLimit = limit - return nil - } -} - -// ErrorReportingLimit limits the number of syntax error reports before terminating parsing. -// -// The limit must be at least 1. If unset, the limit will be 100. -func ErrorReportingLimit(limit int) Option { - return func(opts *options) error { - if limit < 1 { - return fmt.Errorf("error reporting limit must be at least 1: %d", limit) - } - opts.errorReportingLimit = limit - return nil - } -} - -// ExpressionSizeCodePointLimit is an option which limits the maximum code point count of an -// expression. -func ExpressionSizeCodePointLimit(expressionSizeCodePointLimit int) Option { - return func(opts *options) error { - if expressionSizeCodePointLimit < -1 { - return fmt.Errorf("expression size code point limit must be greater than or equal to -1: %d", expressionSizeCodePointLimit) - } - opts.expressionSizeCodePointLimit = expressionSizeCodePointLimit - return nil - } -} - -// Macros adds the given macros to the parser. -func Macros(macros ...Macro) Option { - return func(opts *options) error { - for _, m := range macros { - if m != nil { - if opts.macros == nil { - opts.macros = make(map[string]Macro) - } - opts.macros[m.MacroKey()] = m - } - } - return nil - } -} - -// PopulateMacroCalls ensures that the original call signatures replaced by expanded macros -// are preserved in the `SourceInfo` of parse result. -func PopulateMacroCalls(populateMacroCalls bool) Option { - return func(opts *options) error { - opts.populateMacroCalls = populateMacroCalls - return nil - } -} - -// EnableOptionalSyntax enables syntax for optional field and index selection. -func EnableOptionalSyntax(optionalSyntax bool) Option { - return func(opts *options) error { - opts.enableOptionalSyntax = optionalSyntax - return nil - } -} - -// EnableIdentEscapeSyntax enables backtick (`) escaped field identifiers. This -// supports extended types of characters in identifiers, e.g. foo.`baz-bar`. -func EnableIdentEscapeSyntax(enableIdentEscapeSyntax bool) Option { - return func(opts *options) error { - opts.enableIdentEscapeSyntax = enableIdentEscapeSyntax - return nil - } -} - -// EnableHiddenAccumulatorName uses an accumulator variable name that is not a -// normally accessible identifier in source for comprehension macros. Compatibility notes: -// with this option enabled, a parsed AST would be semantically the same as if disabled, but would -// have different internal identifiers in any of the built-in comprehension sub-expressions. When -// disabled, it is possible but almost certainly a logic error to access the accumulator variable. -func EnableHiddenAccumulatorName(enabled bool) Option { - return func(opts *options) error { - opts.enableHiddenAccumulatorName = enabled - return nil - } -} - -// EnableVariadicOperatorASTs enables a compact representation of chained like-kind commutative -// operators. e.g. `a || b || c || d` -> `call(op='||', args=[a, b, c, d])` -// -// The benefit of enabling variadic operators ASTs is a more compact representation deeply nested -// logic graphs. -func EnableVariadicOperatorASTs(varArgASTs bool) Option { - return func(opts *options) error { - opts.enableVariadicOperatorASTs = varArgASTs - return nil - } -} diff --git a/vendor/github.com/google/cel-go/parser/parser.go b/vendor/github.com/google/cel-go/parser/parser.go deleted file mode 100644 index b5ec73ec6..000000000 --- a/vendor/github.com/google/cel-go/parser/parser.go +++ /dev/null @@ -1,1065 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package parser declares an expression parser with support for macro -// expansion. -package parser - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" - - antlr "github.com/antlr4-go/antlr/v4" - - "github.com/google/cel-go/common" - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/runes" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/parser/gen" -) - -// Parser encapsulates the context necessary to perform parsing for different expressions. -type Parser struct { - options -} - -// NewParser builds and returns a new Parser using the provided options. -func NewParser(opts ...Option) (*Parser, error) { - p := &Parser{} - p.enableHiddenAccumulatorName = true - for _, opt := range opts { - if err := opt(&p.options); err != nil { - return nil, err - } - } - if p.errorReportingLimit == 0 { - p.errorReportingLimit = 100 - } - if p.maxRecursionDepth == 0 { - p.maxRecursionDepth = 250 - } - if p.maxRecursionDepth == -1 { - p.maxRecursionDepth = int((^uint(0)) >> 1) - } - if p.errorRecoveryTokenLookaheadLimit == 0 { - p.errorRecoveryTokenLookaheadLimit = 256 - } - if p.errorRecoveryLimit == 0 { - p.errorRecoveryLimit = 30 - } - if p.errorRecoveryLimit == -1 { - p.errorRecoveryLimit = int((^uint(0)) >> 1) - } - if p.expressionSizeCodePointLimit == 0 { - p.expressionSizeCodePointLimit = 100_000 - } - if p.expressionSizeCodePointLimit == -1 { - p.expressionSizeCodePointLimit = int((^uint(0)) >> 1) - } - // Bool is false by default, so populateMacroCalls will be false by default - return p, nil -} - -// mustNewParser does the work of NewParser and panics if an error occurs. -// -// This function is only intended for internal use and is for backwards compatibility in Parse and -// ParseWithMacros, where we know the options will result in an error. -func mustNewParser(opts ...Option) *Parser { - p, err := NewParser(opts...) - if err != nil { - panic(err) - } - return p -} - -// Parse parses the expression represented by source and returns the result. -func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) { - errs := common.NewErrors(source) - accu := AccumulatorName - if p.enableHiddenAccumulatorName { - accu = HiddenAccumulatorName - } - fac := ast.NewExprFactoryWithAccumulator(accu) - impl := parser{ - errors: &parseErrors{errs}, - exprFactory: fac, - helper: newParserHelper(source, fac), - macros: p.macros, - maxRecursionDepth: p.maxRecursionDepth, - errorReportingLimit: p.errorReportingLimit, - errorRecoveryLimit: p.errorRecoveryLimit, - errorRecoveryLookaheadTokenLimit: p.errorRecoveryTokenLookaheadLimit, - populateMacroCalls: p.populateMacroCalls, - enableOptionalSyntax: p.enableOptionalSyntax, - enableVariadicOperatorASTs: p.enableVariadicOperatorASTs, - enableIdentEscapeSyntax: p.enableIdentEscapeSyntax, - } - buf, ok := source.(runes.Buffer) - if !ok { - buf = runes.NewBuffer(source.Content()) - } - var out ast.Expr - if buf.Len() > p.expressionSizeCodePointLimit { - out = impl.reportError(common.NoLocation, - "expression code point size exceeds limit: size: %d, limit %d", - buf.Len(), p.expressionSizeCodePointLimit) - } else { - out = impl.parse(buf, source.Description()) - } - return ast.NewAST(out, impl.helper.getSourceInfo()), errs -} - -// reservedIds are not legal to use as variables. We exclude them post-parse, as they *are* valid -// field names for protos, and it would complicate the grammar to distinguish the cases. -var reservedIds = map[string]struct{}{ - "as": {}, - "break": {}, - "const": {}, - "continue": {}, - "else": {}, - "false": {}, - "for": {}, - "function": {}, - "if": {}, - "import": {}, - "in": {}, - "let": {}, - "loop": {}, - "package": {}, - "namespace": {}, - "null": {}, - "return": {}, - "true": {}, - "var": {}, - "void": {}, - "while": {}, -} - -func unescapeIdent(in string) (string, error) { - if len(in) <= 2 { - return "", errors.New("invalid escaped identifier: underflow") - } - return in[1 : len(in)-1], nil -} - -// normalizeIdent returns the interpreted identifier. -func (p *parser) normalizeIdent(ctx gen.IEscapeIdentContext) (string, error) { - switch ident := ctx.(type) { - case *gen.SimpleIdentifierContext: - return ident.GetId().GetText(), nil - case *gen.EscapedIdentifierContext: - if !p.enableIdentEscapeSyntax { - return "", errors.New("unsupported syntax: '`'") - } - return unescapeIdent(ident.GetId().GetText()) - } - return "", errors.New("unsupported ident kind") -} - -// Parse converts a source input a parsed expression. -// This function calls ParseWithMacros with AllMacros. -// -// Deprecated: Use NewParser().Parse() instead. -func Parse(source common.Source) (*ast.AST, *common.Errors) { - return mustNewParser(Macros(AllMacros...)).Parse(source) -} - -type recursionError struct { - message string -} - -// Error implements error. -func (re *recursionError) Error() string { - return re.message -} - -var _ error = &recursionError{} - -type recursionListener struct { - maxDepth int - ruleTypeDepth map[int]*int -} - -func (rl *recursionListener) VisitTerminal(node antlr.TerminalNode) {} - -func (rl *recursionListener) VisitErrorNode(node antlr.ErrorNode) {} - -func (rl *recursionListener) EnterEveryRule(ctx antlr.ParserRuleContext) { - if ctx == nil { - return - } - ruleIndex := ctx.GetRuleIndex() - depth, found := rl.ruleTypeDepth[ruleIndex] - if !found { - var counter = 1 - rl.ruleTypeDepth[ruleIndex] = &counter - depth = &counter - } else { - *depth++ - } - if *depth > rl.maxDepth { - panic(&recursionError{ - message: fmt.Sprintf("expression recursion limit exceeded: %d", rl.maxDepth), - }) - } -} - -func (rl *recursionListener) ExitEveryRule(ctx antlr.ParserRuleContext) { - if ctx == nil { - return - } - ruleIndex := ctx.GetRuleIndex() - if depth, found := rl.ruleTypeDepth[ruleIndex]; found && *depth > 0 { - *depth-- - } -} - -var _ antlr.ParseTreeListener = &recursionListener{} - -type tooManyErrors struct { - errorReportingLimit int -} - -func (t *tooManyErrors) Error() string { - return fmt.Sprintf("More than %d syntax errors", t.errorReportingLimit) -} - -var _ error = &tooManyErrors{} - -type recoveryLimitError struct { - message string -} - -// Error implements error. -func (rl *recoveryLimitError) Error() string { - return rl.message -} - -type lookaheadLimitError struct { - message string -} - -func (ll *lookaheadLimitError) Error() string { - return ll.message -} - -var _ error = &recoveryLimitError{} - -type recoveryLimitErrorStrategy struct { - *antlr.DefaultErrorStrategy - errorRecoveryLimit int - errorRecoveryTokenLookaheadLimit int - recoveryAttempts int -} - -type lookaheadConsumer struct { - antlr.Parser - errorRecoveryTokenLookaheadLimit int - lookaheadAttempts int -} - -func (lc *lookaheadConsumer) Consume() antlr.Token { - if lc.lookaheadAttempts >= lc.errorRecoveryTokenLookaheadLimit { - panic(&lookaheadLimitError{ - message: fmt.Sprintf("error recovery token lookahead limit exceeded: %d", lc.errorRecoveryTokenLookaheadLimit), - }) - } - lc.lookaheadAttempts++ - return lc.Parser.Consume() -} - -func (rl *recoveryLimitErrorStrategy) Recover(recognizer antlr.Parser, e antlr.RecognitionException) { - rl.checkAttempts(recognizer) - lc := &lookaheadConsumer{Parser: recognizer, errorRecoveryTokenLookaheadLimit: rl.errorRecoveryTokenLookaheadLimit} - rl.DefaultErrorStrategy.Recover(lc, e) -} - -func (rl *recoveryLimitErrorStrategy) RecoverInline(recognizer antlr.Parser) antlr.Token { - rl.checkAttempts(recognizer) - lc := &lookaheadConsumer{Parser: recognizer, errorRecoveryTokenLookaheadLimit: rl.errorRecoveryTokenLookaheadLimit} - return rl.DefaultErrorStrategy.RecoverInline(lc) -} - -func (rl *recoveryLimitErrorStrategy) checkAttempts(recognizer antlr.Parser) { - if rl.recoveryAttempts == rl.errorRecoveryLimit { - rl.recoveryAttempts++ - msg := fmt.Sprintf("error recovery attempt limit exceeded: %d", rl.errorRecoveryLimit) - recognizer.NotifyErrorListeners(msg, nil, nil) - panic(&recoveryLimitError{ - message: msg, - }) - } - rl.recoveryAttempts++ -} - -var _ antlr.ErrorStrategy = &recoveryLimitErrorStrategy{} - -type parser struct { - gen.BaseCELVisitor - errors *parseErrors - exprFactory ast.ExprFactory - helper *parserHelper - macros map[string]Macro - recursionDepth int - errorReports int - maxRecursionDepth int - errorReportingLimit int - errorRecoveryLimit int - errorRecoveryLookaheadTokenLimit int - populateMacroCalls bool - enableOptionalSyntax bool - enableVariadicOperatorASTs bool - enableIdentEscapeSyntax bool -} - -var _ gen.CELVisitor = (*parser)(nil) - -func (p *parser) parse(expr runes.Buffer, desc string) ast.Expr { - lexer := gen.NewCELLexer(newCharStream(expr, desc)) - lexer.RemoveErrorListeners() - lexer.AddErrorListener(p) - - prsr := gen.NewCELParser(antlr.NewCommonTokenStream(lexer, 0)) - prsr.RemoveErrorListeners() - - prsrListener := &recursionListener{ - maxDepth: p.maxRecursionDepth, - ruleTypeDepth: map[int]*int{}, - } - - prsr.AddErrorListener(p) - prsr.AddParseListener(prsrListener) - - prsr.SetErrorHandler(&recoveryLimitErrorStrategy{ - DefaultErrorStrategy: antlr.NewDefaultErrorStrategy(), - errorRecoveryLimit: p.errorRecoveryLimit, - errorRecoveryTokenLookaheadLimit: p.errorRecoveryLookaheadTokenLimit, - }) - - defer func() { - if val := recover(); val != nil { - switch err := val.(type) { - case *lookaheadLimitError: - p.errors.internalError(err.Error()) - case *recursionError: - p.errors.internalError(err.Error()) - case *tooManyErrors: - // do nothing - case *recoveryLimitError: - // do nothing, listeners already notified and error reported. - default: - panic(val) - } - } - }() - - return p.Visit(prsr.Start_()).(ast.Expr) -} - -// Visitor implementations. -func (p *parser) Visit(tree antlr.ParseTree) any { - t := unnest(tree) - switch tree := t.(type) { - case *gen.StartContext: - return p.VisitStart(tree) - case *gen.ExprContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitExpr(tree) - p.decrementRecursionDepth() - return out - case *gen.ConditionalAndContext: - return p.VisitConditionalAnd(tree) - case *gen.ConditionalOrContext: - return p.VisitConditionalOr(tree) - case *gen.RelationContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitRelation(tree) - p.decrementRecursionDepth() - return out - case *gen.CalcContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitCalc(tree) - p.decrementRecursionDepth() - return out - case *gen.LogicalNotContext: - return p.VisitLogicalNot(tree) - case *gen.IdentContext: - return p.VisitIdent(tree) - case *gen.GlobalCallContext: - return p.VisitGlobalCall(tree) - case *gen.SelectContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitSelect(tree) - p.decrementRecursionDepth() - return out - case *gen.MemberCallContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitMemberCall(tree) - p.decrementRecursionDepth() - return out - case *gen.MapInitializerListContext: - return p.VisitMapInitializerList(tree) - case *gen.NegateContext: - return p.VisitNegate(tree) - case *gen.IndexContext: - p.checkAndIncrementRecursionDepth() - out := p.VisitIndex(tree) - p.decrementRecursionDepth() - return out - case *gen.UnaryContext: - return p.VisitUnary(tree) - case *gen.CreateListContext: - return p.VisitCreateList(tree) - case *gen.CreateMessageContext: - return p.VisitCreateMessage(tree) - case *gen.CreateStructContext: - return p.VisitCreateStruct(tree) - case *gen.IntContext: - return p.VisitInt(tree) - case *gen.UintContext: - return p.VisitUint(tree) - case *gen.DoubleContext: - return p.VisitDouble(tree) - case *gen.StringContext: - return p.VisitString(tree) - case *gen.BytesContext: - return p.VisitBytes(tree) - case *gen.BoolFalseContext: - return p.VisitBoolFalse(tree) - case *gen.BoolTrueContext: - return p.VisitBoolTrue(tree) - case *gen.NullContext: - return p.VisitNull(tree) - } - - // Report at least one error if the parser reaches an unknown parse element. - // Typically, this happens if the parser has already encountered a syntax error elsewhere. - if p.errors.errorCount() == 0 { - txt := "<>" - if t != nil { - txt = fmt.Sprintf("<<%T>>", t) - } - return p.reportError(common.NoLocation, "unknown parse element encountered: %s", txt) - } - return p.helper.newExpr(common.NoLocation) - -} - -// Visit a parse tree produced by CELParser#start. -func (p *parser) VisitStart(ctx *gen.StartContext) any { - return p.Visit(ctx.Expr()) -} - -// Visit a parse tree produced by CELParser#expr. -func (p *parser) VisitExpr(ctx *gen.ExprContext) any { - result := p.Visit(ctx.GetE()).(ast.Expr) - if ctx.GetOp() == nil { - return result - } - opID := p.helper.id(ctx.GetOp()) - ifTrue := p.Visit(ctx.GetE1()).(ast.Expr) - ifFalse := p.Visit(ctx.GetE2()).(ast.Expr) - return p.globalCallOrMacro(opID, operators.Conditional, result, ifTrue, ifFalse) -} - -// Visit a parse tree produced by CELParser#conditionalOr. -func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any { - result := p.Visit(ctx.GetE()).(ast.Expr) - l := p.newLogicManager(operators.LogicalOr, result) - rest := ctx.GetE1() - for i, op := range ctx.GetOps() { - if i >= len(rest) { - return p.reportError(ctx, "unexpected character, wanted '||'") - } - next := p.Visit(rest[i]).(ast.Expr) - opID := p.helper.id(op) - l.addTerm(opID, next) - } - return l.toExpr() -} - -// Visit a parse tree produced by CELParser#conditionalAnd. -func (p *parser) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any { - result := p.Visit(ctx.GetE()).(ast.Expr) - l := p.newLogicManager(operators.LogicalAnd, result) - rest := ctx.GetE1() - for i, op := range ctx.GetOps() { - if i >= len(rest) { - return p.reportError(ctx, "unexpected character, wanted '&&'") - } - next := p.Visit(rest[i]).(ast.Expr) - opID := p.helper.id(op) - l.addTerm(opID, next) - } - return l.toExpr() -} - -// Visit a parse tree produced by CELParser#relation. -func (p *parser) VisitRelation(ctx *gen.RelationContext) any { - opText := "" - if ctx.GetOp() != nil { - opText = ctx.GetOp().GetText() - } - if op, found := operators.Find(opText); found { - lhs := p.Visit(ctx.Relation(0)).(ast.Expr) - opID := p.helper.id(ctx.GetOp()) - rhs := p.Visit(ctx.Relation(1)).(ast.Expr) - return p.globalCallOrMacro(opID, op, lhs, rhs) - } - return p.reportError(ctx, "operator not found") -} - -// Visit a parse tree produced by CELParser#calc. -func (p *parser) VisitCalc(ctx *gen.CalcContext) any { - opText := "" - if ctx.GetOp() != nil { - opText = ctx.GetOp().GetText() - } - if op, found := operators.Find(opText); found { - lhs := p.Visit(ctx.Calc(0)).(ast.Expr) - opID := p.helper.id(ctx.GetOp()) - rhs := p.Visit(ctx.Calc(1)).(ast.Expr) - return p.globalCallOrMacro(opID, op, lhs, rhs) - } - return p.reportError(ctx, "operator not found") -} - -func (p *parser) VisitUnary(ctx *gen.UnaryContext) any { - return p.helper.newLiteralString(ctx, "<>") -} - -// Visit a parse tree produced by CELParser#LogicalNot. -func (p *parser) VisitLogicalNot(ctx *gen.LogicalNotContext) any { - if len(ctx.GetOps())%2 == 0 { - return p.Visit(ctx.Member()) - } - opID := p.helper.id(ctx.GetOps()[0]) - target := p.Visit(ctx.Member()).(ast.Expr) - return p.globalCallOrMacro(opID, operators.LogicalNot, target) -} - -func (p *parser) VisitNegate(ctx *gen.NegateContext) any { - if len(ctx.GetOps())%2 == 0 { - return p.Visit(ctx.Member()) - } - opID := p.helper.id(ctx.GetOps()[0]) - target := p.Visit(ctx.Member()).(ast.Expr) - return p.globalCallOrMacro(opID, operators.Negate, target) -} - -// VisitSelect visits a parse tree produced by CELParser#Select. -func (p *parser) VisitSelect(ctx *gen.SelectContext) any { - operand := p.Visit(ctx.Member()).(ast.Expr) - // Handle the error case where no valid identifier is specified. - if ctx.GetId() == nil || ctx.GetOp() == nil { - return p.helper.newExpr(ctx) - } - id, err := p.normalizeIdent(ctx.GetId()) - if err != nil { - p.reportError(ctx.GetId(), "%v", err) - } - if ctx.GetOpt() != nil { - if !p.enableOptionalSyntax { - return p.reportError(ctx.GetOp(), "unsupported syntax '.?'") - } - return p.helper.newGlobalCall( - ctx.GetOp(), - operators.OptSelect, - operand, - p.helper.newLiteralString(ctx.GetId(), id)) - } - return p.helper.newSelect(ctx.GetOp(), operand, id) -} - -// VisitMemberCall visits a parse tree produced by CELParser#MemberCall. -func (p *parser) VisitMemberCall(ctx *gen.MemberCallContext) any { - operand := p.Visit(ctx.Member()).(ast.Expr) - // Handle the error case where no valid identifier is specified. - if ctx.GetId() == nil { - return p.helper.newExpr(ctx) - } - id := ctx.GetId().GetText() - opID := p.helper.id(ctx.GetOpen()) - return p.receiverCallOrMacro(opID, id, operand, p.visitExprList(ctx.GetArgs())...) -} - -// Visit a parse tree produced by CELParser#Index. -func (p *parser) VisitIndex(ctx *gen.IndexContext) any { - target := p.Visit(ctx.Member()).(ast.Expr) - // Handle the error case where no valid identifier is specified. - if ctx.GetOp() == nil { - return p.helper.newExpr(ctx) - } - opID := p.helper.id(ctx.GetOp()) - index := p.Visit(ctx.GetIndex()).(ast.Expr) - operator := operators.Index - if ctx.GetOpt() != nil { - if !p.enableOptionalSyntax { - return p.reportError(ctx.GetOp(), "unsupported syntax '[?'") - } - operator = operators.OptIndex - } - return p.globalCallOrMacro(opID, operator, target, index) -} - -// Visit a parse tree produced by CELParser#CreateMessage. -func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any { - messageName := "" - for _, id := range ctx.GetIds() { - if len(messageName) != 0 { - messageName += "." - } - messageName += id.GetText() - } - if ctx.GetLeadingDot() != nil { - messageName = "." + messageName - } - objID := p.helper.id(ctx.GetOp()) - entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]ast.EntryExpr) - return p.helper.newObject(objID, messageName, entries...) -} - -// Visit a parse tree of field initializers. -func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext) any { - if ctx == nil || ctx.GetFields() == nil { - // This is the result of a syntax error handled elswhere, return empty. - return []ast.EntryExpr{} - } - - result := make([]ast.EntryExpr, len(ctx.GetFields())) - cols := ctx.GetCols() - vals := ctx.GetValues() - for i, f := range ctx.GetFields() { - if i >= len(cols) || i >= len(vals) { - // This is the result of a syntax error detected elsewhere. - return []ast.EntryExpr{} - } - initID := p.helper.id(cols[i]) - optField := f.(*gen.OptFieldContext) - optional := optField.GetOpt() != nil - if !p.enableOptionalSyntax && optional { - p.reportError(optField, "unsupported syntax '?'") - continue - } - - // The field may be empty due to a prior error. - fieldName, err := p.normalizeIdent(optField.EscapeIdent()) - if err != nil { - p.reportError(ctx, "%v", err) - continue - } - - value := p.Visit(vals[i]).(ast.Expr) - field := p.helper.newObjectField(initID, fieldName, value, optional) - result[i] = field - } - return result -} - -// Visit a parse tree produced by CELParser#Ident. -func (p *parser) VisitIdent(ctx *gen.IdentContext) any { - identName := "" - if ctx.GetLeadingDot() != nil { - identName = "." - } - // Handle the error case where no valid identifier is specified. - if ctx.GetId() == nil { - return p.helper.newExpr(ctx) - } - // Handle reserved identifiers. - id := ctx.GetId().GetText() - if _, ok := reservedIds[id]; ok { - return p.reportError(ctx, "reserved identifier: %s", id) - } - identName += id - return p.helper.newIdent(ctx.GetId(), identName) -} - -// Visit a parse tree produced by CELParser#GlobalCallContext. -func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any { - identName := "" - if ctx.GetLeadingDot() != nil { - identName = "." - } - // Handle the error case where no valid identifier is specified. - if ctx.GetId() == nil { - return p.helper.newExpr(ctx) - } - // Handle reserved identifiers. - id := ctx.GetId().GetText() - if _, ok := reservedIds[id]; ok { - return p.reportError(ctx, "reserved identifier: %s", id) - } - identName += id - opID := p.helper.id(ctx.GetOp()) - return p.globalCallOrMacro(opID, identName, p.visitExprList(ctx.GetArgs())...) - -} - -// Visit a parse tree produced by CELParser#CreateList. -func (p *parser) VisitCreateList(ctx *gen.CreateListContext) any { - listID := p.helper.id(ctx.GetOp()) - elems, optionals := p.visitListInit(ctx.GetElems()) - return p.helper.newList(listID, elems, optionals...) -} - -// Visit a parse tree produced by CELParser#CreateStruct. -func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any { - structID := p.helper.id(ctx.GetOp()) - entries := []ast.EntryExpr{} - if ctx.GetEntries() != nil { - entries = p.Visit(ctx.GetEntries()).([]ast.EntryExpr) - } - return p.helper.newMap(structID, entries...) -} - -// Visit a parse tree produced by CELParser#mapInitializerList. -func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any { - if ctx == nil || ctx.GetKeys() == nil { - // This is the result of a syntax error handled elswhere, return empty. - return []ast.EntryExpr{} - } - - result := make([]ast.EntryExpr, len(ctx.GetCols())) - keys := ctx.GetKeys() - vals := ctx.GetValues() - for i, col := range ctx.GetCols() { - colID := p.helper.id(col) - if i >= len(keys) || i >= len(vals) { - // This is the result of a syntax error detected elsewhere. - return []ast.EntryExpr{} - } - optKey := keys[i] - optional := optKey.GetOpt() != nil - if !p.enableOptionalSyntax && optional { - p.reportError(optKey, "unsupported syntax '?'") - continue - } - key := p.Visit(optKey.GetE()).(ast.Expr) - value := p.Visit(vals[i]).(ast.Expr) - entry := p.helper.newMapEntry(colID, key, value, optional) - result[i] = entry - } - return result -} - -// Visit a parse tree produced by CELParser#Int. -func (p *parser) VisitInt(ctx *gen.IntContext) any { - text := ctx.GetTok().GetText() - base := 10 - if strings.HasPrefix(text, "0x") { - base = 16 - text = text[2:] - } - if ctx.GetSign() != nil { - text = ctx.GetSign().GetText() + text - } - i, err := strconv.ParseInt(text, base, 64) - if err != nil { - return p.reportError(ctx, "invalid int literal") - } - return p.helper.newLiteralInt(ctx, i) -} - -// Visit a parse tree produced by CELParser#Uint. -func (p *parser) VisitUint(ctx *gen.UintContext) any { - text := ctx.GetTok().GetText() - // trim the 'u' designator included in the uint literal. - text = text[:len(text)-1] - base := 10 - if strings.HasPrefix(text, "0x") { - base = 16 - text = text[2:] - } - i, err := strconv.ParseUint(text, base, 64) - if err != nil { - return p.reportError(ctx, "invalid uint literal") - } - return p.helper.newLiteralUint(ctx, i) -} - -// Visit a parse tree produced by CELParser#Double. -func (p *parser) VisitDouble(ctx *gen.DoubleContext) any { - txt := ctx.GetTok().GetText() - if ctx.GetSign() != nil { - txt = ctx.GetSign().GetText() + txt - } - f, err := strconv.ParseFloat(txt, 64) - if err != nil { - return p.reportError(ctx, "invalid double literal") - } - return p.helper.newLiteralDouble(ctx, f) - -} - -// Visit a parse tree produced by CELParser#String. -func (p *parser) VisitString(ctx *gen.StringContext) any { - s := p.unquote(ctx, ctx.GetTok().GetText(), false) - return p.helper.newLiteralString(ctx, s) -} - -// Visit a parse tree produced by CELParser#Bytes. -func (p *parser) VisitBytes(ctx *gen.BytesContext) any { - b := []byte(p.unquote(ctx, ctx.GetTok().GetText()[1:], true)) - return p.helper.newLiteralBytes(ctx, b) -} - -// Visit a parse tree produced by CELParser#BoolTrue. -func (p *parser) VisitBoolTrue(ctx *gen.BoolTrueContext) any { - return p.helper.newLiteralBool(ctx, true) -} - -// Visit a parse tree produced by CELParser#BoolFalse. -func (p *parser) VisitBoolFalse(ctx *gen.BoolFalseContext) any { - return p.helper.newLiteralBool(ctx, false) -} - -// Visit a parse tree produced by CELParser#Null. -func (p *parser) VisitNull(ctx *gen.NullContext) any { - return p.helper.exprFactory.NewLiteral(p.helper.newID(ctx), types.NullValue) -} - -func (p *parser) visitExprList(ctx gen.IExprListContext) []ast.Expr { - if ctx == nil { - return []ast.Expr{} - } - return p.visitSlice(ctx.GetE()) -} - -func (p *parser) visitListInit(ctx gen.IListInitContext) ([]ast.Expr, []int32) { - if ctx == nil { - return []ast.Expr{}, []int32{} - } - elements := ctx.GetElems() - result := make([]ast.Expr, len(elements)) - optionals := []int32{} - for i, e := range elements { - ex := p.Visit(e.GetE()).(ast.Expr) - if ex == nil { - return []ast.Expr{}, []int32{} - } - result[i] = ex - if e.GetOpt() != nil { - if !p.enableOptionalSyntax { - p.reportError(e.GetOpt(), "unsupported syntax '?'") - continue - } - optionals = append(optionals, int32(i)) - } - } - return result, optionals -} - -func (p *parser) visitSlice(expressions []gen.IExprContext) []ast.Expr { - if expressions == nil { - return []ast.Expr{} - } - result := make([]ast.Expr, len(expressions)) - for i, e := range expressions { - ex := p.Visit(e).(ast.Expr) - result[i] = ex - } - return result -} - -func (p *parser) unquote(ctx any, value string, isBytes bool) string { - text, err := unescape(value, isBytes) - if err != nil { - p.reportError(ctx, "%s", err.Error()) - return value - } - return text -} - -func (p *parser) newLogicManager(function string, term ast.Expr) *logicManager { - if p.enableVariadicOperatorASTs { - return newVariadicLogicManager(p.exprFactory, function, term) - } - return newBalancingLogicManager(p.exprFactory, function, term) -} - -func (p *parser) reportError(ctx any, format string, args ...any) ast.Expr { - var location common.Location - err := p.helper.newExpr(ctx) - switch c := ctx.(type) { - case common.Location: - location = c - case antlr.Token, antlr.ParserRuleContext: - location = p.helper.getLocation(err.ID()) - } - // Provide arguments to the report error. - p.errors.reportErrorAtID(err.ID(), location, format, args...) - return err -} - -// ANTLR Parse listener implementations -func (p *parser) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, line, column int, msg string, e antlr.RecognitionException) { - offset := p.helper.sourceInfo.ComputeOffset(int32(line), int32(column)) - l := p.helper.getLocationByOffset(offset) - // Hack to keep existing error messages consistent with previous versions of CEL when a reserved word - // is used as an identifier. This behavior needs to be overhauled to provide consistent, normalized error - // messages out of ANTLR to prevent future breaking changes related to error message content. - if strings.Contains(msg, "no viable alternative") { - msg = reservedIdentifier.ReplaceAllString(msg, mismatchedReservedIdentifier) - } - // Ensure that no more than 100 syntax errors are reported as this will halt attempts to recover from a - // seriously broken expression. - if p.errorReports < p.errorReportingLimit { - p.errorReports++ - p.errors.syntaxError(l, msg) - } else { - tme := &tooManyErrors{errorReportingLimit: p.errorReportingLimit} - p.errors.syntaxError(l, tme.Error()) - panic(tme) - } -} - -func (p *parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { - // Intentional -} - -func (p *parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { - // Intentional -} - -func (p *parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet) { - // Intentional -} - -func (p *parser) globalCallOrMacro(exprID int64, function string, args ...ast.Expr) ast.Expr { - if expr, found := p.expandMacro(exprID, function, nil, args...); found { - return expr - } - return p.helper.newGlobalCall(exprID, function, args...) -} - -func (p *parser) receiverCallOrMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) ast.Expr { - if expr, found := p.expandMacro(exprID, function, target, args...); found { - return expr - } - return p.helper.newReceiverCall(exprID, function, target, args...) -} - -func (p *parser) expandMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) (ast.Expr, bool) { - macro, found := p.macros[makeMacroKey(function, len(args), target != nil)] - if !found { - macro, found = p.macros[makeVarArgMacroKey(function, target != nil)] - if !found { - return nil, false - } - } - eh := exprHelperPool.Get().(*exprHelper) - defer exprHelperPool.Put(eh) - eh.parserHelper = p.helper - eh.id = exprID - expr, err := macro.Expander()(eh, target, args) - // An error indicates that the macro was matched, but the arguments were not well-formed. - if err != nil { - loc := err.Location - if loc == nil { - loc = p.helper.getLocation(exprID) - } - p.helper.deleteID(exprID) - return p.reportError(loc, "%s", err.Message), true - } - // A nil value from the macro indicates that the macro implementation decided that - // an expansion should not be performed. - if expr == nil { - return nil, false - } - if p.populateMacroCalls { - p.helper.addMacroCall(expr.ID(), function, target, args...) - } - p.helper.deleteID(exprID) - return expr, true -} - -func (p *parser) checkAndIncrementRecursionDepth() { - p.recursionDepth++ - if p.recursionDepth > p.maxRecursionDepth { - panic(&recursionError{message: "max recursion depth exceeded"}) - } -} - -func (p *parser) decrementRecursionDepth() { - p.recursionDepth-- -} - -// unnest traverses down the left-hand side of the parse graph until it encounters the first compound -// parse node or the first leaf in the parse graph. -func unnest(tree antlr.ParseTree) antlr.ParseTree { - for tree != nil { - switch t := tree.(type) { - case *gen.ExprContext: - // conditionalOr op='?' conditionalOr : expr - if t.GetOp() != nil { - return t - } - // conditionalOr - tree = t.GetE() - case *gen.ConditionalOrContext: - // conditionalAnd (ops=|| conditionalAnd)* - if t.GetOps() != nil && len(t.GetOps()) > 0 { - return t - } - // conditionalAnd - tree = t.GetE() - case *gen.ConditionalAndContext: - // relation (ops=&& relation)* - if t.GetOps() != nil && len(t.GetOps()) > 0 { - return t - } - // relation - tree = t.GetE() - case *gen.RelationContext: - // relation op relation - if t.GetOp() != nil { - return t - } - // calc - tree = t.Calc() - case *gen.CalcContext: - // calc op calc - if t.GetOp() != nil { - return t - } - // unary - tree = t.Unary() - case *gen.MemberExprContext: - // member expands to one of: primary, select, index, or create message - tree = t.Member() - case *gen.PrimaryExprContext: - // primary expands to one of identifier, nested, create list, create struct, literal - tree = t.Primary() - case *gen.NestedContext: - // contains a nested 'expr' - tree = t.GetE() - case *gen.ConstantLiteralContext: - // expands to a primitive literal - tree = t.Literal() - default: - return t - } - } - return tree -} - -var ( - reservedIdentifier = regexp.MustCompile("no viable alternative at input '.(true|false|null)'") - mismatchedReservedIdentifier = "mismatched input '$1' expecting IDENTIFIER" -) diff --git a/vendor/github.com/google/cel-go/parser/unescape.go b/vendor/github.com/google/cel-go/parser/unescape.go deleted file mode 100644 index 43cc9b901..000000000 --- a/vendor/github.com/google/cel-go/parser/unescape.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "errors" - "strings" - "unicode/utf8" -) - -// Unescape takes a quoted string, unquotes, and unescapes it. -// -// This function performs escaping compatible with GoogleSQL. -func unescape(value string, isBytes bool) (string, error) { - // All strings normalize newlines to the \n representation. - value = newlineNormalizer.Replace(value) - n := len(value) - - // Nothing to unescape / decode. - if n < 2 { - return value, errors.New("unable to unescape string") - } - - // Raw string preceded by the 'r|R' prefix. - isRawLiteral := false - if value[0] == 'r' || value[0] == 'R' { - value = value[1:] - n = len(value) - isRawLiteral = true - } - - // Quoted string of some form, must have same first and last char. - if value[0] != value[n-1] || (value[0] != '"' && value[0] != '\'') { - return value, errors.New("unable to unescape string") - } - - // Normalize the multi-line CEL string representation to a standard - // Go quoted string. - if n >= 6 { - if strings.HasPrefix(value, "'''") { - if !strings.HasSuffix(value, "'''") { - return value, errors.New("unable to unescape string") - } - value = "\"" + value[3:n-3] + "\"" - } else if strings.HasPrefix(value, `"""`) { - if !strings.HasSuffix(value, `"""`) { - return value, errors.New("unable to unescape string") - } - value = "\"" + value[3:n-3] + "\"" - } - n = len(value) - } - value = value[1 : n-1] - // If there is nothing to escape, then return. - if isRawLiteral || !strings.ContainsRune(value, '\\') { - return value, nil - } - - // Otherwise the string contains escape characters. - // The following logic is adapted from `strconv/quote.go` - var runeTmp [utf8.UTFMax]byte - buf := make([]byte, 0, 3*n/2) - for len(value) > 0 { - c, encode, rest, err := unescapeChar(value, isBytes) - if err != nil { - return "", err - } - value = rest - if c < utf8.RuneSelf || !encode { - buf = append(buf, byte(c)) - } else { - n := utf8.EncodeRune(runeTmp[:], c) - buf = append(buf, runeTmp[:n]...) - } - } - return string(buf), nil -} - -// unescapeChar takes a string input and returns the following info: -// -// value - the escaped unicode rune at the front of the string. -// encode - the value should be unicode-encoded -// tail - the remainder of the input string. -// err - error value, if the character could not be unescaped. -// -// When encode is true the return value may still fit within a single byte, -// but unicode encoding is attempted which is more expensive than when the -// value is known to self-represent as a single byte. -// -// If isBytes is set, unescape as a bytes literal so octal and hex escapes -// represent byte values, not unicode code points. -func unescapeChar(s string, isBytes bool) (value rune, encode bool, tail string, err error) { - // 1. Character is not an escape sequence. - switch c := s[0]; { - case c >= utf8.RuneSelf: - r, size := utf8.DecodeRuneInString(s) - return r, true, s[size:], nil - case c != '\\': - return rune(s[0]), false, s[1:], nil - } - - // 2. Last character is the start of an escape sequence. - if len(s) <= 1 { - err = errors.New("unable to unescape string, found '\\' as last character") - return - } - - c := s[1] - s = s[2:] - // 3. Common escape sequences shared with Google SQL - switch c { - case 'a': - value = '\a' - case 'b': - value = '\b' - case 'f': - value = '\f' - case 'n': - value = '\n' - case 'r': - value = '\r' - case 't': - value = '\t' - case 'v': - value = '\v' - case '\\': - value = '\\' - case '\'': - value = '\'' - case '"': - value = '"' - case '`': - value = '`' - case '?': - value = '?' - - // 4. Unicode escape sequences, reproduced from `strconv/quote.go` - case 'x', 'X', 'u', 'U': - n := 0 - encode = true - switch c { - case 'x', 'X': - n = 2 - encode = !isBytes - case 'u': - n = 4 - if isBytes { - err = errors.New("unable to unescape string") - return - } - case 'U': - n = 8 - if isBytes { - err = errors.New("unable to unescape string") - return - } - } - var v rune - if len(s) < n { - err = errors.New("unable to unescape string") - return - } - for j := 0; j < n; j++ { - x, ok := unhex(s[j]) - if !ok { - err = errors.New("unable to unescape string") - return - } - v = v<<4 | x - } - s = s[n:] - if !isBytes && !utf8.ValidRune(v) { - err = errors.New("invalid unicode code point") - return - } - value = v - - // 5. Octal escape sequences, must be three digits \[0-3][0-7][0-7] - case '0', '1', '2', '3': - if len(s) < 2 { - err = errors.New("unable to unescape octal sequence in string") - return - } - v := rune(c - '0') - for j := 0; j < 2; j++ { - x := s[j] - if x < '0' || x > '7' { - err = errors.New("unable to unescape octal sequence in string") - return - } - v = v*8 + rune(x-'0') - } - if !isBytes && !utf8.ValidRune(v) { - err = errors.New("invalid unicode code point") - return - } - value = v - s = s[2:] - encode = !isBytes - - // Unknown escape sequence. - default: - err = errors.New("unable to unescape string") - } - - tail = s - return -} - -func unhex(b byte) (rune, bool) { - c := rune(b) - switch { - case '0' <= c && c <= '9': - return c - '0', true - case 'a' <= c && c <= 'f': - return c - 'a' + 10, true - case 'A' <= c && c <= 'F': - return c - 'A' + 10, true - } - return 0, false -} - -var ( - newlineNormalizer = strings.NewReplacer("\r\n", "\n", "\r", "\n") -) diff --git a/vendor/github.com/google/cel-go/parser/unparser.go b/vendor/github.com/google/cel-go/parser/unparser.go deleted file mode 100644 index ffd5b18e4..000000000 --- a/vendor/github.com/google/cel-go/parser/unparser.go +++ /dev/null @@ -1,663 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// Unparse takes an input expression and source position information and generates a human-readable -// expression. -// -// Note, unparsing an AST will often generate the same expression as was originally parsed, but some -// formatting may be lost in translation, notably: -// -// - All quoted literals are doubled quoted. -// - Byte literals are represented as octal escapes (same as Google SQL). -// - Floating point values are converted to the small number of digits needed to represent the value. -// - Spacing around punctuation marks may be lost. -// - Parentheses will only be applied when they affect operator precedence. -// -// This function optionally takes in one or more UnparserOption to alter the unparsing behavior, such as -// performing word wrapping on expressions. -func Unparse(expr ast.Expr, info *ast.SourceInfo, opts ...UnparserOption) (string, error) { - unparserOpts := &unparserOption{ - wrapOnColumn: defaultWrapOnColumn, - wrapAfterColumnLimit: defaultWrapAfterColumnLimit, - operatorsToWrapOn: defaultOperatorsToWrapOn, - } - - var err error - for _, opt := range opts { - unparserOpts, err = opt(unparserOpts) - if err != nil { - return "", err - } - } - - un := &unparser{ - info: info, - options: unparserOpts, - } - err = un.visit(expr) - if err != nil { - return "", err - } - return un.str.String(), nil -} - -var identifierPartPattern *regexp.Regexp = regexp.MustCompile(`^[A-Za-z_][0-9A-Za-z_]*$`) - -func maybeQuoteField(field string) string { - if !identifierPartPattern.MatchString(field) || field == "in" { - return "`" + field + "`" - } - return field -} - -// unparser visits an expression to reconstruct a human-readable string from an AST. -type unparser struct { - str strings.Builder - info *ast.SourceInfo - options *unparserOption - lastWrappedIndex int -} - -func (un *unparser) visit(expr ast.Expr) error { - if expr == nil { - return errors.New("unsupported expression") - } - visited, err := un.visitMaybeMacroCall(expr) - if visited || err != nil { - return err - } - switch expr.Kind() { - case ast.CallKind: - return un.visitCall(expr) - case ast.LiteralKind: - return un.visitConst(expr) - case ast.IdentKind: - return un.visitIdent(expr) - case ast.ListKind: - return un.visitList(expr) - case ast.MapKind: - return un.visitStructMap(expr) - case ast.SelectKind: - return un.visitSelect(expr) - case ast.StructKind: - return un.visitStructMsg(expr) - default: - return fmt.Errorf("unsupported expression: %v", expr) - } -} - -func (un *unparser) visitCall(expr ast.Expr) error { - c := expr.AsCall() - fun := c.FunctionName() - switch fun { - // ternary operator - case operators.Conditional: - return un.visitCallConditional(expr) - // optional select operator - case operators.OptSelect: - return un.visitOptSelect(expr) - // index operator - case operators.Index: - return un.visitCallIndex(expr) - // optional index operator - case operators.OptIndex: - return un.visitCallOptIndex(expr) - // unary operators - case operators.LogicalNot, operators.Negate: - return un.visitCallUnary(expr) - // binary operators - case operators.Add, - operators.Divide, - operators.Equals, - operators.Greater, - operators.GreaterEquals, - operators.In, - operators.Less, - operators.LessEquals, - operators.LogicalAnd, - operators.LogicalOr, - operators.Modulo, - operators.Multiply, - operators.NotEquals, - operators.OldIn, - operators.Subtract: - return un.visitCallBinary(expr) - // standard function calls. - default: - return un.visitCallFunc(expr) - } -} - -func (un *unparser) visitCallBinary(expr ast.Expr) error { - c := expr.AsCall() - fun := c.FunctionName() - args := c.Args() - lhs := args[0] - // add parens if the current operator is lower precedence than the lhs expr operator. - lhsParen := isComplexOperatorWithRespectTo(fun, lhs) - rhs := args[1] - // add parens if the current operator is lower precedence than the rhs expr operator, - // or the same precedence and the operator is left recursive. - rhsParen := isComplexOperatorWithRespectTo(fun, rhs) - if !rhsParen && isLeftRecursive(fun) { - rhsParen = isSamePrecedence(fun, rhs) - } - err := un.visitMaybeNested(lhs, lhsParen) - if err != nil { - return err - } - unmangled, found := operators.FindReverseBinaryOperator(fun) - if !found { - return fmt.Errorf("cannot unmangle operator: %s", fun) - } - - un.writeOperatorWithWrapping(fun, unmangled) - return un.visitMaybeNested(rhs, rhsParen) -} - -func (un *unparser) visitCallConditional(expr ast.Expr) error { - c := expr.AsCall() - args := c.Args() - // add parens if operand is a conditional itself. - nested := isSamePrecedence(operators.Conditional, args[0]) || - isComplexOperator(args[0]) - err := un.visitMaybeNested(args[0], nested) - if err != nil { - return err - } - un.writeOperatorWithWrapping(operators.Conditional, "?") - - // add parens if operand is a conditional itself. - nested = isSamePrecedence(operators.Conditional, args[1]) || - isComplexOperator(args[1]) - err = un.visitMaybeNested(args[1], nested) - if err != nil { - return err - } - - un.str.WriteString(" : ") - // add parens if operand is a conditional itself. - nested = isSamePrecedence(operators.Conditional, args[2]) || - isComplexOperator(args[2]) - - return un.visitMaybeNested(args[2], nested) -} - -func (un *unparser) visitCallFunc(expr ast.Expr) error { - c := expr.AsCall() - fun := c.FunctionName() - args := c.Args() - if c.IsMemberFunction() { - nested := isBinaryOrTernaryOperator(c.Target()) - err := un.visitMaybeNested(c.Target(), nested) - if err != nil { - return err - } - un.str.WriteString(".") - } - un.str.WriteString(fun) - un.str.WriteString("(") - for i, arg := range args { - err := un.visit(arg) - if err != nil { - return err - } - if i < len(args)-1 { - un.str.WriteString(", ") - } - } - un.str.WriteString(")") - return nil -} - -func (un *unparser) visitCallIndex(expr ast.Expr) error { - return un.visitCallIndexInternal(expr, "[") -} - -func (un *unparser) visitCallOptIndex(expr ast.Expr) error { - return un.visitCallIndexInternal(expr, "[?") -} - -func (un *unparser) visitCallIndexInternal(expr ast.Expr, op string) error { - c := expr.AsCall() - args := c.Args() - nested := isBinaryOrTernaryOperator(args[0]) - err := un.visitMaybeNested(args[0], nested) - if err != nil { - return err - } - un.str.WriteString(op) - err = un.visit(args[1]) - if err != nil { - return err - } - un.str.WriteString("]") - return nil -} - -func (un *unparser) visitCallUnary(expr ast.Expr) error { - c := expr.AsCall() - fun := c.FunctionName() - args := c.Args() - unmangled, found := operators.FindReverse(fun) - if !found { - return fmt.Errorf("cannot unmangle operator: %s", fun) - } - un.str.WriteString(unmangled) - nested := isComplexOperator(args[0]) - return un.visitMaybeNested(args[0], nested) -} - -func (un *unparser) visitConstVal(val ref.Val) error { - optional := false - if optVal, ok := val.(*types.Optional); ok { - if !optVal.HasValue() { - un.str.WriteString("optional.none()") - return nil - } - optional = true - un.str.WriteString("optional.of(") - val = optVal.GetValue() - } - switch val := val.(type) { - case types.Bool: - un.str.WriteString(strconv.FormatBool(bool(val))) - case types.Bytes: - // bytes constants are surrounded with b"" - un.str.WriteString(`b"`) - un.str.WriteString(bytesToOctets([]byte(val))) - un.str.WriteString(`"`) - case types.Double: - // represent the float using the minimum required digits - d := strconv.FormatFloat(float64(val), 'g', -1, 64) - un.str.WriteString(d) - if !strings.Contains(d, ".") { - un.str.WriteString(".0") - } - case types.Int: - i := strconv.FormatInt(int64(val), 10) - un.str.WriteString(i) - case types.Null: - un.str.WriteString("null") - case types.String: - // strings will be double quoted with quotes escaped. - un.str.WriteString(strconv.Quote(string(val))) - case types.Uint: - // uint literals have a 'u' suffix. - ui := strconv.FormatUint(uint64(val), 10) - un.str.WriteString(ui) - un.str.WriteString("u") - case *types.Optional: - if err := un.visitConstVal(val); err != nil { - return err - } - default: - return errors.New("unsupported constant") - } - if optional { - un.str.WriteString(")") - } - return nil -} -func (un *unparser) visitConst(expr ast.Expr) error { - val := expr.AsLiteral() - if err := un.visitConstVal(val); err != nil { - return fmt.Errorf("unsupported constant: %v", expr) - } - return nil -} - -func (un *unparser) visitIdent(expr ast.Expr) error { - un.str.WriteString(expr.AsIdent()) - return nil -} - -func (un *unparser) visitList(expr ast.Expr) error { - l := expr.AsList() - elems := l.Elements() - optIndices := make(map[int]bool, len(elems)) - for _, idx := range l.OptionalIndices() { - optIndices[int(idx)] = true - } - un.str.WriteString("[") - for i, elem := range elems { - if optIndices[i] { - un.str.WriteString("?") - } - err := un.visit(elem) - if err != nil { - return err - } - if i < len(elems)-1 { - un.str.WriteString(", ") - } - } - un.str.WriteString("]") - return nil -} - -func (un *unparser) visitOptSelect(expr ast.Expr) error { - c := expr.AsCall() - args := c.Args() - operand := args[0] - field := args[1].AsLiteral().(types.String) - return un.visitSelectInternal(operand, false, ".?", string(field)) -} - -func (un *unparser) visitSelect(expr ast.Expr) error { - sel := expr.AsSelect() - return un.visitSelectInternal(sel.Operand(), sel.IsTestOnly(), ".", sel.FieldName()) -} - -func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error { - // handle the case when the select expression was generated by the has() macro. - if testOnly { - un.str.WriteString("has(") - } - nested := !testOnly && isBinaryOrTernaryOperator(operand) - err := un.visitMaybeNested(operand, nested) - if err != nil { - return err - } - un.str.WriteString(op) - un.str.WriteString(maybeQuoteField(field)) - if testOnly { - un.str.WriteString(")") - } - return nil -} - -func (un *unparser) visitStructMsg(expr ast.Expr) error { - m := expr.AsStruct() - fields := m.Fields() - un.str.WriteString(m.TypeName()) - un.str.WriteString("{") - for i, f := range fields { - field := f.AsStructField() - f := field.Name() - if field.IsOptional() { - un.str.WriteString("?") - } - un.str.WriteString(maybeQuoteField(f)) - un.str.WriteString(": ") - v := field.Value() - err := un.visit(v) - if err != nil { - return err - } - if i < len(fields)-1 { - un.str.WriteString(", ") - } - } - un.str.WriteString("}") - return nil -} - -func (un *unparser) visitStructMap(expr ast.Expr) error { - m := expr.AsMap() - entries := m.Entries() - un.str.WriteString("{") - for i, e := range entries { - entry := e.AsMapEntry() - k := entry.Key() - if entry.IsOptional() { - un.str.WriteString("?") - } - err := un.visit(k) - if err != nil { - return err - } - un.str.WriteString(": ") - v := entry.Value() - err = un.visit(v) - if err != nil { - return err - } - if i < len(entries)-1 { - un.str.WriteString(", ") - } - } - un.str.WriteString("}") - return nil -} - -func (un *unparser) visitMaybeMacroCall(expr ast.Expr) (bool, error) { - call, found := un.info.GetMacroCall(expr.ID()) - if !found { - return false, nil - } - return true, un.visit(call) -} - -func (un *unparser) visitMaybeNested(expr ast.Expr, nested bool) error { - if nested { - un.str.WriteString("(") - } - err := un.visit(expr) - if err != nil { - return err - } - if nested { - un.str.WriteString(")") - } - return nil -} - -// isLeftRecursive indicates whether the parser resolves the call in a left-recursive manner as -// this can have an effect of how parentheses affect the order of operations in the AST. -func isLeftRecursive(op string) bool { - return op != operators.LogicalAnd && op != operators.LogicalOr -} - -// isSamePrecedence indicates whether the precedence of the input operator is the same as the -// precedence of the (possible) operation represented in the input Expr. -// -// If the expr is not a Call, the result is false. -func isSamePrecedence(op string, expr ast.Expr) bool { - if expr.Kind() != ast.CallKind { - return false - } - c := expr.AsCall() - other := c.FunctionName() - return operators.Precedence(op) == operators.Precedence(other) -} - -// isLowerPrecedence indicates whether the precedence of the input operator is lower precedence -// than the (possible) operation represented in the input Expr. -// -// If the expr is not a Call, the result is false. -func isLowerPrecedence(op string, expr ast.Expr) bool { - c := expr.AsCall() - other := c.FunctionName() - return operators.Precedence(op) < operators.Precedence(other) -} - -// Indicates whether the expr is a complex operator, i.e., a call expression -// with 2 or more arguments. -func isComplexOperator(expr ast.Expr) bool { - if expr.Kind() == ast.CallKind && len(expr.AsCall().Args()) >= 2 { - return true - } - return false -} - -// Indicates whether it is a complex operation compared to another. -// expr is *not* considered complex if it is not a call expression or has -// less than two arguments, or if it has a higher precedence than op. -func isComplexOperatorWithRespectTo(op string, expr ast.Expr) bool { - if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 { - return false - } - return isLowerPrecedence(op, expr) -} - -// Indicate whether this is a binary or ternary operator. -func isBinaryOrTernaryOperator(expr ast.Expr) bool { - if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 { - return false - } - _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName()) - return isBinaryOp || isSamePrecedence(operators.Conditional, expr) -} - -// bytesToOctets converts byte sequences to a string using a three digit octal encoded value -// per byte. -func bytesToOctets(byteVal []byte) string { - var b strings.Builder - for _, c := range byteVal { - fmt.Fprintf(&b, "\\%03o", c) - } - return b.String() -} - -// writeOperatorWithWrapping outputs the operator and inserts a newline for operators configured -// in the unparser options. -func (un *unparser) writeOperatorWithWrapping(fun string, unmangled string) bool { - _, wrapOperatorExists := un.options.operatorsToWrapOn[fun] - lineLength := un.str.Len() - un.lastWrappedIndex + len(fun) - - if wrapOperatorExists && lineLength >= un.options.wrapOnColumn { - un.lastWrappedIndex = un.str.Len() - // wrapAfterColumnLimit flag dictates whether the newline is placed - // before or after the operator - if un.options.wrapAfterColumnLimit { - // Input: a && b - // Output: a &&\nb - un.str.WriteString(" ") - un.str.WriteString(unmangled) - un.str.WriteString("\n") - } else { - // Input: a && b - // Output: a\n&& b - un.str.WriteString("\n") - un.str.WriteString(unmangled) - un.str.WriteString(" ") - } - return true - } - un.str.WriteString(" ") - un.str.WriteString(unmangled) - un.str.WriteString(" ") - return false -} - -// Defined defaults for the unparser options -var ( - defaultWrapOnColumn = 80 - defaultWrapAfterColumnLimit = true - defaultOperatorsToWrapOn = map[string]bool{ - operators.LogicalAnd: true, - operators.LogicalOr: true, - } -) - -// UnparserOption is a functional option for configuring the output formatting -// of the Unparse function. -type UnparserOption func(*unparserOption) (*unparserOption, error) - -// Internal representation of the UnparserOption type -type unparserOption struct { - wrapOnColumn int - operatorsToWrapOn map[string]bool - wrapAfterColumnLimit bool -} - -// WrapOnColumn wraps the output expression when its string length exceeds a specified limit -// for operators set by WrapOnOperators function or by default, "&&" and "||" will be wrapped. -// -// Example usage: -// -// Unparse(expr, sourceInfo, WrapOnColumn(40), WrapOnOperators(Operators.LogicalAnd)) -// -// This will insert a newline immediately after the logical AND operator for the below example input: -// -// Input: -// 'my-principal-group' in request.auth.claims && request.auth.claims.iat > now - duration('5m') -// -// Output: -// 'my-principal-group' in request.auth.claims && -// request.auth.claims.iat > now - duration('5m') -func WrapOnColumn(col int) UnparserOption { - return func(opt *unparserOption) (*unparserOption, error) { - if col < 1 { - return nil, fmt.Errorf("Invalid unparser option. Wrap column value must be greater than or equal to 1. Got %v instead", col) - } - opt.wrapOnColumn = col - return opt, nil - } -} - -// WrapOnOperators specifies which operators to perform word wrapping on an output expression when its string length -// exceeds the column limit set by WrapOnColumn function. -// -// Word wrapping is supported on non-unary symbolic operators. Refer to operators.go for the full list -// -// This will replace any previously supplied operators instead of merging them. -func WrapOnOperators(symbols ...string) UnparserOption { - return func(opt *unparserOption) (*unparserOption, error) { - opt.operatorsToWrapOn = make(map[string]bool) - for _, symbol := range symbols { - _, found := operators.FindReverse(symbol) - if !found { - return nil, fmt.Errorf("Invalid unparser option. Unsupported operator: %s", symbol) - } - arity := operators.Arity(symbol) - if arity < 2 { - return nil, fmt.Errorf("Invalid unparser option. Unary operators are unsupported: %s", symbol) - } - - opt.operatorsToWrapOn[symbol] = true - } - - return opt, nil - } -} - -// WrapAfterColumnLimit dictates whether to insert a newline before or after the specified operator -// when word wrapping is performed. -// -// Example usage: -// -// Unparse(expr, sourceInfo, WrapOnColumn(40), WrapOnOperators(Operators.LogicalAnd), WrapAfterColumnLimit(false)) -// -// This will insert a newline immediately before the logical AND operator for the below example input, ensuring -// that the length of a line never exceeds the specified column limit: -// -// Input: -// 'my-principal-group' in request.auth.claims && request.auth.claims.iat > now - duration('5m') -// -// Output: -// 'my-principal-group' in request.auth.claims -// && request.auth.claims.iat > now - duration('5m') -func WrapAfterColumnLimit(wrapAfter bool) UnparserOption { - return func(opt *unparserOption) (*unparserOption, error) { - opt.wrapAfterColumnLimit = wrapAfter - return opt, nil - } -} diff --git a/vendor/github.com/gorilla/websocket/.gitignore b/vendor/github.com/gorilla/websocket/.gitignore deleted file mode 100644 index cd3fcd1ef..000000000 --- a/vendor/github.com/gorilla/websocket/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -.idea/ -*.iml diff --git a/vendor/github.com/gorilla/websocket/AUTHORS b/vendor/github.com/gorilla/websocket/AUTHORS deleted file mode 100644 index 1931f4006..000000000 --- a/vendor/github.com/gorilla/websocket/AUTHORS +++ /dev/null @@ -1,9 +0,0 @@ -# This is the official list of Gorilla WebSocket authors for copyright -# purposes. -# -# Please keep the list sorted. - -Gary Burd -Google LLC (https://opensource.google.com/) -Joachim Bauch - diff --git a/vendor/github.com/gorilla/websocket/LICENSE b/vendor/github.com/gorilla/websocket/LICENSE deleted file mode 100644 index 9171c9722..000000000 --- a/vendor/github.com/gorilla/websocket/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gorilla/websocket/README.md b/vendor/github.com/gorilla/websocket/README.md deleted file mode 100644 index ff8bfab0b..000000000 --- a/vendor/github.com/gorilla/websocket/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Gorilla WebSocket - -[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) -[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket) - -Gorilla WebSocket is a [Go](http://golang.org/) implementation of the -[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. - - -### Documentation - -* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc) -* [Chat example](https://github.com/gorilla/websocket/tree/main/examples/chat) -* [Command example](https://github.com/gorilla/websocket/tree/main/examples/command) -* [Client and server example](https://github.com/gorilla/websocket/tree/main/examples/echo) -* [File watch example](https://github.com/gorilla/websocket/tree/main/examples/filewatch) - -### Status - -The Gorilla WebSocket package provides a complete and tested implementation of -the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The -package API is stable. - -### Installation - - go get github.com/gorilla/websocket - -### Protocol Compliance - -The Gorilla WebSocket package passes the server tests in the [Autobahn Test -Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn -subdirectory](https://github.com/gorilla/websocket/tree/main/examples/autobahn). diff --git a/vendor/github.com/gorilla/websocket/client.go b/vendor/github.com/gorilla/websocket/client.go deleted file mode 100644 index 00917ea34..000000000 --- a/vendor/github.com/gorilla/websocket/client.go +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bytes" - "context" - "crypto/tls" - "errors" - "fmt" - "io" - "net" - "net/http" - "net/http/httptrace" - "net/url" - "strings" - "time" -) - -// ErrBadHandshake is returned when the server response to opening handshake is -// invalid. -var ErrBadHandshake = errors.New("websocket: bad handshake") - -var errInvalidCompression = errors.New("websocket: invalid compression negotiation") - -// NewClient creates a new client connection using the given net connection. -// The URL u specifies the host and request URI. Use requestHeader to specify -// the origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies -// (Cookie). Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etc. -// -// Deprecated: Use Dialer instead. -func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufSize, writeBufSize int) (c *Conn, response *http.Response, err error) { - d := Dialer{ - ReadBufferSize: readBufSize, - WriteBufferSize: writeBufSize, - NetDial: func(net, addr string) (net.Conn, error) { - return netConn, nil - }, - } - return d.Dial(u.String(), requestHeader) -} - -// A Dialer contains options for connecting to WebSocket server. -// -// It is safe to call Dialer's methods concurrently. -type Dialer struct { - // The following custom dial functions can be set to establish - // connections to either the backend server or the proxy (if it - // exists). The scheme of the dialed entity (either backend or - // proxy) determines which custom dial function is selected: - // either NetDialTLSContext for HTTPS or NetDialContext/NetDial - // for HTTP. Since the "Proxy" function can determine the scheme - // dynamically, it can make sense to set multiple custom dial - // functions simultaneously. - // - // NetDial specifies the dial function for creating TCP connections. If - // NetDial is nil, net.Dialer DialContext is used. - // If "Proxy" field is also set, this function dials the proxy--not - // the backend server. - NetDial func(network, addr string) (net.Conn, error) - - // NetDialContext specifies the dial function for creating TCP connections. If - // NetDialContext is nil, NetDial is used. - // If "Proxy" field is also set, this function dials the proxy--not - // the backend server. - NetDialContext func(ctx context.Context, network, addr string) (net.Conn, error) - - // NetDialTLSContext specifies the dial function for creating TLS/TCP connections. If - // NetDialTLSContext is nil, NetDialContext is used. - // If NetDialTLSContext is set, Dial assumes the TLS handshake is done there and - // TLSClientConfig is ignored. - // If "Proxy" field is also set, this function dials the proxy (and performs - // the TLS handshake with the proxy, ignoring TLSClientConfig). In this TLS proxy - // dialing case the TLSClientConfig could still be necessary for TLS to the backend server. - NetDialTLSContext func(ctx context.Context, network, addr string) (net.Conn, error) - - // Proxy specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxy func(*http.Request) (*url.URL, error) - - // TLSClientConfig specifies the TLS configuration to use with tls.Client. - // If nil, the default configuration is used. - // If NetDialTLSContext is set, Dial assumes the TLS handshake - // is done there and TLSClientConfig is ignored. - TLSClientConfig *tls.Config - - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer - // size is zero, then a useful default size is used. The I/O buffer sizes - // do not limit the size of the messages that can be sent or received. - ReadBufferSize, WriteBufferSize int - - // WriteBufferPool is a pool of buffers for write operations. If the value - // is not set, then write buffers are allocated to the connection for the - // lifetime of the connection. - // - // A pool is most useful when the application has a modest volume of writes - // across a large number of connections. - // - // Applications should use a single pool for each unique value of - // WriteBufferSize. - WriteBufferPool BufferPool - - // Subprotocols specifies the client's requested subprotocols. - Subprotocols []string - - // EnableCompression specifies if the client should attempt to negotiate - // per message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool - - // Jar specifies the cookie jar. - // If Jar is nil, cookies are not sent in requests and ignored - // in responses. - Jar http.CookieJar -} - -// Dial creates a new client connection by calling DialContext with a background context. -func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) { - return d.DialContext(context.Background(), urlStr, requestHeader) -} - -var errMalformedURL = errors.New("malformed ws or wss URL") - -func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) { - hostPort = u.Host - hostNoPort = u.Host - if i := strings.LastIndex(u.Host, ":"); i > strings.LastIndex(u.Host, "]") { - hostNoPort = hostNoPort[:i] - } else { - switch u.Scheme { - case "wss": - hostPort += ":443" - case "https": - hostPort += ":443" - default: - hostPort += ":80" - } - } - return hostPort, hostNoPort -} - -// DefaultDialer is a dialer with all fields set to the default values. -var DefaultDialer = &Dialer{ - Proxy: http.ProxyFromEnvironment, - HandshakeTimeout: 45 * time.Second, -} - -// nilDialer is dialer to use when receiver is nil. -var nilDialer = *DefaultDialer - -// DialContext creates a new client connection. Use requestHeader to specify the -// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie). -// Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// The context will be used in the request and in the Dialer. -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etcetera. The response body may not contain the entire response and does not -// need to be closed by the application. -func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) { - if d == nil { - d = &nilDialer - } - - challengeKey, err := generateChallengeKey() - if err != nil { - return nil, nil, err - } - - u, err := url.Parse(urlStr) - if err != nil { - return nil, nil, err - } - - switch u.Scheme { - case "ws": - u.Scheme = "http" - case "wss": - u.Scheme = "https" - default: - return nil, nil, errMalformedURL - } - - if u.User != nil { - // User name and password are not allowed in websocket URIs. - return nil, nil, errMalformedURL - } - - req := &http.Request{ - Method: http.MethodGet, - URL: u, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - Host: u.Host, - } - req = req.WithContext(ctx) - - // Set the cookies present in the cookie jar of the dialer - if d.Jar != nil { - for _, cookie := range d.Jar.Cookies(u) { - req.AddCookie(cookie) - } - } - - // Set the request headers using the capitalization for names and values in - // RFC examples. Although the capitalization shouldn't matter, there are - // servers that depend on it. The Header.Set method is not used because the - // method canonicalizes the header names. - req.Header["Upgrade"] = []string{"websocket"} - req.Header["Connection"] = []string{"Upgrade"} - req.Header["Sec-WebSocket-Key"] = []string{challengeKey} - req.Header["Sec-WebSocket-Version"] = []string{"13"} - if len(d.Subprotocols) > 0 { - req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(d.Subprotocols, ", ")} - } - for k, vs := range requestHeader { - switch { - case k == "Host": - if len(vs) > 0 { - req.Host = vs[0] - } - case k == "Upgrade" || - k == "Connection" || - k == "Sec-Websocket-Key" || - k == "Sec-Websocket-Version" || - k == "Sec-Websocket-Extensions" || - (k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0): - return nil, nil, errors.New("websocket: duplicate header not allowed: " + k) - case k == "Sec-Websocket-Protocol": - req.Header["Sec-WebSocket-Protocol"] = vs - default: - req.Header[k] = vs - } - } - - if d.EnableCompression { - req.Header["Sec-WebSocket-Extensions"] = []string{"permessage-deflate; server_no_context_takeover; client_no_context_takeover"} - } - - if d.HandshakeTimeout != 0 { - var cancel func() - ctx, cancel = context.WithTimeout(ctx, d.HandshakeTimeout) - defer cancel() - } - - var proxyURL *url.URL - if d.Proxy != nil { - proxyURL, err = d.Proxy(req) - if err != nil { - return nil, nil, err - } - } - netDial, err := d.netDialFn(ctx, proxyURL, u) - if err != nil { - return nil, nil, err - } - - hostPort, hostNoPort := hostPortNoPort(u) - trace := httptrace.ContextClientTrace(ctx) - if trace != nil && trace.GetConn != nil { - trace.GetConn(hostPort) - } - - netConn, err := netDial(ctx, "tcp", hostPort) - if err != nil { - return nil, nil, err - } - if trace != nil && trace.GotConn != nil { - trace.GotConn(httptrace.GotConnInfo{ - Conn: netConn, - }) - } - - // Close the network connection when returning an error. The variable - // netConn is set to nil before the success return at the end of the - // function. - defer func() { - if netConn != nil { - // It's safe to ignore the error from Close() because this code is - // only executed when returning a more important error to the - // application. - _ = netConn.Close() - } - }() - - // Do TLS handshake over established connection if a proxy exists. - if proxyURL != nil && u.Scheme == "https" { - - cfg := cloneTLSConfig(d.TLSClientConfig) - if cfg.ServerName == "" { - cfg.ServerName = hostNoPort - } - tlsConn := tls.Client(netConn, cfg) - netConn = tlsConn - - if trace != nil && trace.TLSHandshakeStart != nil { - trace.TLSHandshakeStart() - } - err := doHandshake(ctx, tlsConn, cfg) - if trace != nil && trace.TLSHandshakeDone != nil { - trace.TLSHandshakeDone(tlsConn.ConnectionState(), err) - } - - if err != nil { - return nil, nil, err - } - } - - conn := newConn(netConn, false, d.ReadBufferSize, d.WriteBufferSize, d.WriteBufferPool, nil, nil) - - if err := req.Write(netConn); err != nil { - return nil, nil, err - } - - if trace != nil && trace.GotFirstResponseByte != nil { - if peek, err := conn.br.Peek(1); err == nil && len(peek) == 1 { - trace.GotFirstResponseByte() - } - } - - resp, err := http.ReadResponse(conn.br, req) - if err != nil { - if d.TLSClientConfig != nil { - for _, proto := range d.TLSClientConfig.NextProtos { - if proto != "http/1.1" { - return nil, nil, fmt.Errorf( - "websocket: protocol %q was given but is not supported;"+ - "sharing tls.Config with net/http Transport can cause this error: %w", - proto, err, - ) - } - } - } - return nil, nil, err - } - - if d.Jar != nil { - if rc := resp.Cookies(); len(rc) > 0 { - d.Jar.SetCookies(u, rc) - } - } - - if resp.StatusCode != 101 || - !tokenListContainsValue(resp.Header, "Upgrade", "websocket") || - !tokenListContainsValue(resp.Header, "Connection", "upgrade") || - resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) { - // Before closing the network connection on return from this - // function, slurp up some of the response to aid application - // debugging. - buf := make([]byte, 1024) - n, _ := io.ReadFull(resp.Body, buf) - resp.Body = io.NopCloser(bytes.NewReader(buf[:n])) - return nil, resp, ErrBadHandshake - } - - for _, ext := range parseExtensions(resp.Header) { - if ext[""] != "permessage-deflate" { - continue - } - _, snct := ext["server_no_context_takeover"] - _, cnct := ext["client_no_context_takeover"] - if !snct || !cnct { - return nil, resp, errInvalidCompression - } - conn.newCompressionWriter = compressNoContextTakeover - conn.newDecompressionReader = decompressNoContextTakeover - break - } - - resp.Body = io.NopCloser(bytes.NewReader([]byte{})) - conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol") - - if err := netConn.SetDeadline(time.Time{}); err != nil { - return nil, resp, err - } - - // Success! Set netConn to nil to stop the deferred function above from - // closing the network connection. - netConn = nil - - return conn, resp, nil -} - -// Returns the dial function to establish the connection to either the backend -// server or the proxy (if it exists). If the dialed entity is HTTPS, then the -// returned dial function *also* performs the TLS handshake to the dialed entity. -// NOTE: If a proxy exists, it is possible for a second TLS handshake to be -// necessary over the established connection. -func (d *Dialer) netDialFn(ctx context.Context, proxyURL *url.URL, backendURL *url.URL) (netDialerFunc, error) { - var netDial netDialerFunc - if proxyURL != nil { - netDial = d.netDialFromURL(proxyURL) - } else { - netDial = d.netDialFromURL(backendURL) - } - // If needed, wrap the dial function to set the connection deadline. - if deadline, ok := ctx.Deadline(); ok { - netDial = netDialWithDeadline(netDial, deadline) - } - // Proxy dialing is wrapped to implement CONNECT method and possibly proxy auth. - if proxyURL != nil { - return proxyFromURL(proxyURL, netDial) - } - return netDial, nil -} - -// Returns function to create the connection depending on the Dialer's -// custom dialing functions and the passed URL of entity connecting to. -func (d *Dialer) netDialFromURL(u *url.URL) netDialerFunc { - var netDial netDialerFunc - switch { - case d.NetDialContext != nil: - netDial = d.NetDialContext - case d.NetDial != nil: - netDial = func(ctx context.Context, net, addr string) (net.Conn, error) { - return d.NetDial(net, addr) - } - default: - netDial = (&net.Dialer{}).DialContext - } - // If dialed entity is HTTPS, then either use custom TLS dialing function (if exists) - // or wrap the previously computed "netDial" to use TLS config for handshake. - if u.Scheme == "https" { - if d.NetDialTLSContext != nil { - netDial = d.NetDialTLSContext - } else { - netDial = netDialWithTLSHandshake(netDial, d.TLSClientConfig, u) - } - } - return netDial -} - -// Returns wrapped "netDial" function, performing TLS handshake after connecting. -func netDialWithTLSHandshake(netDial netDialerFunc, tlsConfig *tls.Config, u *url.URL) netDialerFunc { - return func(ctx context.Context, unused, addr string) (net.Conn, error) { - hostPort, hostNoPort := hostPortNoPort(u) - trace := httptrace.ContextClientTrace(ctx) - if trace != nil && trace.GetConn != nil { - trace.GetConn(hostPort) - } - // Creates TCP connection to addr using passed "netDial" function. - conn, err := netDial(ctx, "tcp", addr) - if err != nil { - return nil, err - } - cfg := cloneTLSConfig(tlsConfig) - if cfg.ServerName == "" { - cfg.ServerName = hostNoPort - } - tlsConn := tls.Client(conn, cfg) - // Do the TLS handshake using TLSConfig over the wrapped connection. - if trace != nil && trace.TLSHandshakeStart != nil { - trace.TLSHandshakeStart() - } - err = doHandshake(ctx, tlsConn, cfg) - if trace != nil && trace.TLSHandshakeDone != nil { - trace.TLSHandshakeDone(tlsConn.ConnectionState(), err) - } - if err != nil { - tlsConn.Close() - return nil, err - } - return tlsConn, nil - } -} - -// Returns wrapped "netDial" function, setting passed deadline. -func netDialWithDeadline(netDial netDialerFunc, deadline time.Time) netDialerFunc { - return func(ctx context.Context, network, addr string) (net.Conn, error) { - c, err := netDial(ctx, network, addr) - if err != nil { - return nil, err - } - err = c.SetDeadline(deadline) - if err != nil { - c.Close() - return nil, err - } - return c, nil - } -} - -func cloneTLSConfig(cfg *tls.Config) *tls.Config { - if cfg == nil { - return &tls.Config{} - } - return cfg.Clone() -} - -func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error { - if err := tlsConn.HandshakeContext(ctx); err != nil { - return err - } - if !cfg.InsecureSkipVerify { - if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/gorilla/websocket/compression.go b/vendor/github.com/gorilla/websocket/compression.go deleted file mode 100644 index fe1079edb..000000000 --- a/vendor/github.com/gorilla/websocket/compression.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "compress/flate" - "errors" - "io" - "strings" - "sync" -) - -const ( - minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6 - maxCompressionLevel = flate.BestCompression - defaultCompressionLevel = 1 -) - -var ( - flateWriterPools [maxCompressionLevel - minCompressionLevel + 1]sync.Pool - flateReaderPool = sync.Pool{New: func() interface{} { - return flate.NewReader(nil) - }} -) - -func decompressNoContextTakeover(r io.Reader) io.ReadCloser { - const tail = - // Add four bytes as specified in RFC - "\x00\x00\xff\xff" + - // Add final block to squelch unexpected EOF error from flate reader. - "\x01\x00\x00\xff\xff" - - fr, _ := flateReaderPool.Get().(io.ReadCloser) - mr := io.MultiReader(r, strings.NewReader(tail)) - if err := fr.(flate.Resetter).Reset(mr, nil); err != nil { - // Reset never fails, but handle error in case that changes. - fr = flate.NewReader(mr) - } - return &flateReadWrapper{fr} -} - -func isValidCompressionLevel(level int) bool { - return minCompressionLevel <= level && level <= maxCompressionLevel -} - -func compressNoContextTakeover(w io.WriteCloser, level int) io.WriteCloser { - p := &flateWriterPools[level-minCompressionLevel] - tw := &truncWriter{w: w} - fw, _ := p.Get().(*flate.Writer) - if fw == nil { - fw, _ = flate.NewWriter(tw, level) - } else { - fw.Reset(tw) - } - return &flateWriteWrapper{fw: fw, tw: tw, p: p} -} - -// truncWriter is an io.Writer that writes all but the last four bytes of the -// stream to another io.Writer. -type truncWriter struct { - w io.WriteCloser - n int - p [4]byte -} - -func (w *truncWriter) Write(p []byte) (int, error) { - n := 0 - - // fill buffer first for simplicity. - if w.n < len(w.p) { - n = copy(w.p[w.n:], p) - p = p[n:] - w.n += n - if len(p) == 0 { - return n, nil - } - } - - m := len(p) - if m > len(w.p) { - m = len(w.p) - } - - if nn, err := w.w.Write(w.p[:m]); err != nil { - return n + nn, err - } - - copy(w.p[:], w.p[m:]) - copy(w.p[len(w.p)-m:], p[len(p)-m:]) - nn, err := w.w.Write(p[:len(p)-m]) - return n + nn, err -} - -type flateWriteWrapper struct { - fw *flate.Writer - tw *truncWriter - p *sync.Pool -} - -func (w *flateWriteWrapper) Write(p []byte) (int, error) { - if w.fw == nil { - return 0, errWriteClosed - } - return w.fw.Write(p) -} - -func (w *flateWriteWrapper) Close() error { - if w.fw == nil { - return errWriteClosed - } - err1 := w.fw.Flush() - w.p.Put(w.fw) - w.fw = nil - if w.tw.p != [4]byte{0, 0, 0xff, 0xff} { - return errors.New("websocket: internal error, unexpected bytes at end of flate stream") - } - err2 := w.tw.w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -type flateReadWrapper struct { - fr io.ReadCloser -} - -func (r *flateReadWrapper) Read(p []byte) (int, error) { - if r.fr == nil { - return 0, io.ErrClosedPipe - } - n, err := r.fr.Read(p) - if err == io.EOF { - // Preemptively place the reader back in the pool. This helps with - // scenarios where the application does not call NextReader() soon after - // this final read. - r.Close() - } - return n, err -} - -func (r *flateReadWrapper) Close() error { - if r.fr == nil { - return io.ErrClosedPipe - } - err := r.fr.Close() - flateReaderPool.Put(r.fr) - r.fr = nil - return err -} diff --git a/vendor/github.com/gorilla/websocket/conn.go b/vendor/github.com/gorilla/websocket/conn.go deleted file mode 100644 index 9562ffd49..000000000 --- a/vendor/github.com/gorilla/websocket/conn.go +++ /dev/null @@ -1,1246 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "crypto/rand" - "encoding/binary" - "errors" - "io" - "net" - "strconv" - "strings" - "sync" - "time" - "unicode/utf8" -) - -const ( - // Frame header byte 0 bits from Section 5.2 of RFC 6455 - finalBit = 1 << 7 - rsv1Bit = 1 << 6 - rsv2Bit = 1 << 5 - rsv3Bit = 1 << 4 - - // Frame header byte 1 bits from Section 5.2 of RFC 6455 - maskBit = 1 << 7 - - maxFrameHeaderSize = 2 + 8 + 4 // Fixed header + length + mask - maxControlFramePayloadSize = 125 - - writeWait = time.Second - - defaultReadBufferSize = 4096 - defaultWriteBufferSize = 4096 - - continuationFrame = 0 - noFrame = -1 -) - -// Close codes defined in RFC 6455, section 11.7. -const ( - CloseNormalClosure = 1000 - CloseGoingAway = 1001 - CloseProtocolError = 1002 - CloseUnsupportedData = 1003 - CloseNoStatusReceived = 1005 - CloseAbnormalClosure = 1006 - CloseInvalidFramePayloadData = 1007 - ClosePolicyViolation = 1008 - CloseMessageTooBig = 1009 - CloseMandatoryExtension = 1010 - CloseInternalServerErr = 1011 - CloseServiceRestart = 1012 - CloseTryAgainLater = 1013 - CloseTLSHandshake = 1015 -) - -// The message types are defined in RFC 6455, section 11.8. -const ( - // TextMessage denotes a text data message. The text message payload is - // interpreted as UTF-8 encoded text data. - TextMessage = 1 - - // BinaryMessage denotes a binary data message. - BinaryMessage = 2 - - // CloseMessage denotes a close control message. The optional message - // payload contains a numeric code and text. Use the FormatCloseMessage - // function to format a close message payload. - CloseMessage = 8 - - // PingMessage denotes a ping control message. The optional message payload - // is UTF-8 encoded text. - PingMessage = 9 - - // PongMessage denotes a pong control message. The optional message payload - // is UTF-8 encoded text. - PongMessage = 10 -) - -// ErrCloseSent is returned when the application writes a message to the -// connection after sending a close message. -var ErrCloseSent = errors.New("websocket: close sent") - -// ErrReadLimit is returned when reading a message that is larger than the -// read limit set for the connection. -var ErrReadLimit = errors.New("websocket: read limit exceeded") - -// netError satisfies the net Error interface. -type netError struct { - msg string - temporary bool - timeout bool -} - -func (e *netError) Error() string { return e.msg } -func (e *netError) Temporary() bool { return e.temporary } -func (e *netError) Timeout() bool { return e.timeout } - -// CloseError represents a close message. -type CloseError struct { - // Code is defined in RFC 6455, section 11.7. - Code int - - // Text is the optional text payload. - Text string -} - -func (e *CloseError) Error() string { - s := []byte("websocket: close ") - s = strconv.AppendInt(s, int64(e.Code), 10) - switch e.Code { - case CloseNormalClosure: - s = append(s, " (normal)"...) - case CloseGoingAway: - s = append(s, " (going away)"...) - case CloseProtocolError: - s = append(s, " (protocol error)"...) - case CloseUnsupportedData: - s = append(s, " (unsupported data)"...) - case CloseNoStatusReceived: - s = append(s, " (no status)"...) - case CloseAbnormalClosure: - s = append(s, " (abnormal closure)"...) - case CloseInvalidFramePayloadData: - s = append(s, " (invalid payload data)"...) - case ClosePolicyViolation: - s = append(s, " (policy violation)"...) - case CloseMessageTooBig: - s = append(s, " (message too big)"...) - case CloseMandatoryExtension: - s = append(s, " (mandatory extension missing)"...) - case CloseInternalServerErr: - s = append(s, " (internal server error)"...) - case CloseTLSHandshake: - s = append(s, " (TLS handshake error)"...) - } - if e.Text != "" { - s = append(s, ": "...) - s = append(s, e.Text...) - } - return string(s) -} - -// IsCloseError returns boolean indicating whether the error is a *CloseError -// with one of the specified codes. -func IsCloseError(err error, codes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range codes { - if e.Code == code { - return true - } - } - } - return false -} - -// IsUnexpectedCloseError returns boolean indicating whether the error is a -// *CloseError with a code not in the list of expected codes. -func IsUnexpectedCloseError(err error, expectedCodes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range expectedCodes { - if e.Code == code { - return false - } - } - return true - } - return false -} - -var ( - errWriteTimeout = &netError{msg: "websocket: write timeout", timeout: true, temporary: true} - errUnexpectedEOF = &CloseError{Code: CloseAbnormalClosure, Text: io.ErrUnexpectedEOF.Error()} - errBadWriteOpCode = errors.New("websocket: bad write message type") - errWriteClosed = errors.New("websocket: write closed") - errInvalidControlFrame = errors.New("websocket: invalid control frame") -) - -// maskRand is an io.Reader for generating mask bytes. The reader is initialized -// to crypto/rand Reader. Tests swap the reader to a math/rand reader for -// reproducible results. -var maskRand = rand.Reader - -// newMaskKey returns a new 32 bit value for masking client frames. -func newMaskKey() [4]byte { - var k [4]byte - _, _ = io.ReadFull(maskRand, k[:]) - return k -} - -func isControl(frameType int) bool { - return frameType == CloseMessage || frameType == PingMessage || frameType == PongMessage -} - -func isData(frameType int) bool { - return frameType == TextMessage || frameType == BinaryMessage -} - -var validReceivedCloseCodes = map[int]bool{ - // see http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number - - CloseNormalClosure: true, - CloseGoingAway: true, - CloseProtocolError: true, - CloseUnsupportedData: true, - CloseNoStatusReceived: false, - CloseAbnormalClosure: false, - CloseInvalidFramePayloadData: true, - ClosePolicyViolation: true, - CloseMessageTooBig: true, - CloseMandatoryExtension: true, - CloseInternalServerErr: true, - CloseServiceRestart: true, - CloseTryAgainLater: true, - CloseTLSHandshake: false, -} - -func isValidReceivedCloseCode(code int) bool { - return validReceivedCloseCodes[code] || (code >= 3000 && code <= 4999) -} - -// BufferPool represents a pool of buffers. The *sync.Pool type satisfies this -// interface. The type of the value stored in a pool is not specified. -type BufferPool interface { - // Get gets a value from the pool or returns nil if the pool is empty. - Get() interface{} - // Put adds a value to the pool. - Put(interface{}) -} - -// writePoolData is the type added to the write buffer pool. This wrapper is -// used to prevent applications from peeking at and depending on the values -// added to the pool. -type writePoolData struct{ buf []byte } - -// The Conn type represents a WebSocket connection. -type Conn struct { - conn net.Conn - isServer bool - subprotocol string - - // Write fields - mu chan struct{} // used as mutex to protect write to conn - writeBuf []byte // frame is constructed in this buffer. - writePool BufferPool - writeBufSize int - writeDeadline time.Time - writer io.WriteCloser // the current writer returned to the application - isWriting bool // for best-effort concurrent write detection - - writeErrMu sync.Mutex - writeErr error - - enableWriteCompression bool - compressionLevel int - newCompressionWriter func(io.WriteCloser, int) io.WriteCloser - - // Read fields - reader io.ReadCloser // the current reader returned to the application - readErr error - br *bufio.Reader - // bytes remaining in current frame. - // set setReadRemaining to safely update this value and prevent overflow - readRemaining int64 - readFinal bool // true the current message has more frames. - readLength int64 // Message size. - readLimit int64 // Maximum message size. - readMaskPos int - readMaskKey [4]byte - handlePong func(string) error - handlePing func(string) error - handleClose func(int, string) error - readErrCount int - messageReader *messageReader // the current low-level reader - - readDecompress bool // whether last read frame had RSV1 set - newDecompressionReader func(io.Reader) io.ReadCloser -} - -func newConn(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int, writeBufferPool BufferPool, br *bufio.Reader, writeBuf []byte) *Conn { - - if br == nil { - if readBufferSize == 0 { - readBufferSize = defaultReadBufferSize - } else if readBufferSize < maxControlFramePayloadSize { - // must be large enough for control frame - readBufferSize = maxControlFramePayloadSize - } - br = bufio.NewReaderSize(conn, readBufferSize) - } - - if writeBufferSize <= 0 { - writeBufferSize = defaultWriteBufferSize - } - writeBufferSize += maxFrameHeaderSize - - if writeBuf == nil && writeBufferPool == nil { - writeBuf = make([]byte, writeBufferSize) - } - - mu := make(chan struct{}, 1) - mu <- struct{}{} - c := &Conn{ - isServer: isServer, - br: br, - conn: conn, - mu: mu, - readFinal: true, - writeBuf: writeBuf, - writePool: writeBufferPool, - writeBufSize: writeBufferSize, - enableWriteCompression: true, - compressionLevel: defaultCompressionLevel, - } - c.SetCloseHandler(nil) - c.SetPingHandler(nil) - c.SetPongHandler(nil) - return c -} - -// setReadRemaining tracks the number of bytes remaining on the connection. If n -// overflows, an ErrReadLimit is returned. -func (c *Conn) setReadRemaining(n int64) error { - if n < 0 { - return ErrReadLimit - } - - c.readRemaining = n - return nil -} - -// Subprotocol returns the negotiated protocol for the connection. -func (c *Conn) Subprotocol() string { - return c.subprotocol -} - -// Close closes the underlying network connection without sending or waiting -// for a close message. -func (c *Conn) Close() error { - return c.conn.Close() -} - -// LocalAddr returns the local network address. -func (c *Conn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -// RemoteAddr returns the remote network address. -func (c *Conn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -// Write methods - -func (c *Conn) writeFatal(err error) error { - c.writeErrMu.Lock() - if c.writeErr == nil { - c.writeErr = err - } - c.writeErrMu.Unlock() - return err -} - -func (c *Conn) read(n int) ([]byte, error) { - p, err := c.br.Peek(n) - if err == io.EOF { - err = errUnexpectedEOF - } - // Discard is guaranteed to succeed because the number of bytes to discard - // is less than or equal to the number of bytes buffered. - _, _ = c.br.Discard(len(p)) - return p, err -} - -func (c *Conn) write(frameType int, deadline time.Time, buf0, buf1 []byte) error { - <-c.mu - defer func() { c.mu <- struct{}{} }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - if err := c.conn.SetWriteDeadline(deadline); err != nil { - return c.writeFatal(err) - } - if len(buf1) == 0 { - _, err = c.conn.Write(buf0) - } else { - err = c.writeBufs(buf0, buf1) - } - if err != nil { - return c.writeFatal(err) - } - if frameType == CloseMessage { - _ = c.writeFatal(ErrCloseSent) - } - return nil -} - -func (c *Conn) writeBufs(bufs ...[]byte) error { - b := net.Buffers(bufs) - _, err := b.WriteTo(c.conn) - return err -} - -// WriteControl writes a control message with the given deadline. The allowed -// message types are CloseMessage, PingMessage and PongMessage. -func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error { - if !isControl(messageType) { - return errBadWriteOpCode - } - if len(data) > maxControlFramePayloadSize { - return errInvalidControlFrame - } - - b0 := byte(messageType) | finalBit - b1 := byte(len(data)) - if !c.isServer { - b1 |= maskBit - } - - buf := make([]byte, 0, maxFrameHeaderSize+maxControlFramePayloadSize) - buf = append(buf, b0, b1) - - if c.isServer { - buf = append(buf, data...) - } else { - key := newMaskKey() - buf = append(buf, key[:]...) - buf = append(buf, data...) - maskBytes(key, 0, buf[6:]) - } - - if deadline.IsZero() { - // No timeout for zero time. - <-c.mu - } else { - d := time.Until(deadline) - if d < 0 { - return errWriteTimeout - } - select { - case <-c.mu: - default: - timer := time.NewTimer(d) - select { - case <-c.mu: - timer.Stop() - case <-timer.C: - return errWriteTimeout - } - } - } - - defer func() { c.mu <- struct{}{} }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - if err := c.conn.SetWriteDeadline(deadline); err != nil { - return c.writeFatal(err) - } - if _, err = c.conn.Write(buf); err != nil { - return c.writeFatal(err) - } - if messageType == CloseMessage { - _ = c.writeFatal(ErrCloseSent) - } - return err -} - -// beginMessage prepares a connection and message writer for a new message. -func (c *Conn) beginMessage(mw *messageWriter, messageType int) error { - // Close previous writer if not already closed by the application. It's - // probably better to return an error in this situation, but we cannot - // change this without breaking existing applications. - if c.writer != nil { - c.writer.Close() - c.writer = nil - } - - if !isControl(messageType) && !isData(messageType) { - return errBadWriteOpCode - } - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - mw.c = c - mw.frameType = messageType - mw.pos = maxFrameHeaderSize - - if c.writeBuf == nil { - wpd, ok := c.writePool.Get().(writePoolData) - if ok { - c.writeBuf = wpd.buf - } else { - c.writeBuf = make([]byte, c.writeBufSize) - } - } - return nil -} - -// NextWriter returns a writer for the next message to send. The writer's Close -// method flushes the complete message to the network. -// -// There can be at most one open writer on a connection. NextWriter closes the -// previous writer if the application has not already done so. -// -// All message types (TextMessage, BinaryMessage, CloseMessage, PingMessage and -// PongMessage) are supported. -func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) { - var mw messageWriter - if err := c.beginMessage(&mw, messageType); err != nil { - return nil, err - } - c.writer = &mw - if c.newCompressionWriter != nil && c.enableWriteCompression && isData(messageType) { - w := c.newCompressionWriter(c.writer, c.compressionLevel) - mw.compress = true - c.writer = w - } - return c.writer, nil -} - -type messageWriter struct { - c *Conn - compress bool // whether next call to flushFrame should set RSV1 - pos int // end of data in writeBuf. - frameType int // type of the current frame. - err error -} - -func (w *messageWriter) endMessage(err error) error { - if w.err != nil { - return err - } - c := w.c - w.err = err - c.writer = nil - if c.writePool != nil { - c.writePool.Put(writePoolData{buf: c.writeBuf}) - c.writeBuf = nil - } - return err -} - -// flushFrame writes buffered data and extra as a frame to the network. The -// final argument indicates that this is the last frame in the message. -func (w *messageWriter) flushFrame(final bool, extra []byte) error { - c := w.c - length := w.pos - maxFrameHeaderSize + len(extra) - - // Check for invalid control frames. - if isControl(w.frameType) && - (!final || length > maxControlFramePayloadSize) { - return w.endMessage(errInvalidControlFrame) - } - - b0 := byte(w.frameType) - if final { - b0 |= finalBit - } - if w.compress { - b0 |= rsv1Bit - } - w.compress = false - - b1 := byte(0) - if !c.isServer { - b1 |= maskBit - } - - // Assume that the frame starts at beginning of c.writeBuf. - framePos := 0 - if c.isServer { - // Adjust up if mask not included in the header. - framePos = 4 - } - - switch { - case length >= 65536: - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 127 - binary.BigEndian.PutUint64(c.writeBuf[framePos+2:], uint64(length)) - case length > 125: - framePos += 6 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 126 - binary.BigEndian.PutUint16(c.writeBuf[framePos+2:], uint16(length)) - default: - framePos += 8 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | byte(length) - } - - if !c.isServer { - key := newMaskKey() - copy(c.writeBuf[maxFrameHeaderSize-4:], key[:]) - maskBytes(key, 0, c.writeBuf[maxFrameHeaderSize:w.pos]) - if len(extra) > 0 { - return w.endMessage(c.writeFatal(errors.New("websocket: internal error, extra used in client mode"))) - } - } - - // Write the buffers to the connection with best-effort detection of - // concurrent writes. See the concurrency section in the package - // documentation for more info. - - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - - err := c.write(w.frameType, c.writeDeadline, c.writeBuf[framePos:w.pos], extra) - - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - - if err != nil { - return w.endMessage(err) - } - - if final { - _ = w.endMessage(errWriteClosed) - return nil - } - - // Setup for next frame. - w.pos = maxFrameHeaderSize - w.frameType = continuationFrame - return nil -} - -func (w *messageWriter) ncopy(max int) (int, error) { - n := len(w.c.writeBuf) - w.pos - if n <= 0 { - if err := w.flushFrame(false, nil); err != nil { - return 0, err - } - n = len(w.c.writeBuf) - w.pos - } - if n > max { - n = max - } - return n, nil -} - -func (w *messageWriter) Write(p []byte) (int, error) { - if w.err != nil { - return 0, w.err - } - - if len(p) > 2*len(w.c.writeBuf) && w.c.isServer { - // Don't buffer large messages. - err := w.flushFrame(false, p) - if err != nil { - return 0, err - } - return len(p), nil - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) WriteString(p string) (int, error) { - if w.err != nil { - return 0, w.err - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) ReadFrom(r io.Reader) (nn int64, err error) { - if w.err != nil { - return 0, w.err - } - for { - if w.pos == len(w.c.writeBuf) { - err = w.flushFrame(false, nil) - if err != nil { - break - } - } - var n int - n, err = r.Read(w.c.writeBuf[w.pos:]) - w.pos += n - nn += int64(n) - if err != nil { - if err == io.EOF { - err = nil - } - break - } - } - return nn, err -} - -func (w *messageWriter) Close() error { - if w.err != nil { - return w.err - } - return w.flushFrame(true, nil) -} - -// WritePreparedMessage writes prepared message into connection. -func (c *Conn) WritePreparedMessage(pm *PreparedMessage) error { - frameType, frameData, err := pm.frame(prepareKey{ - isServer: c.isServer, - compress: c.newCompressionWriter != nil && c.enableWriteCompression && isData(pm.messageType), - compressionLevel: c.compressionLevel, - }) - if err != nil { - return err - } - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - err = c.write(frameType, c.writeDeadline, frameData, nil) - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - return err -} - -// WriteMessage is a helper method for getting a writer using NextWriter, -// writing the message and closing the writer. -func (c *Conn) WriteMessage(messageType int, data []byte) error { - - if c.isServer && (c.newCompressionWriter == nil || !c.enableWriteCompression) { - // Fast path with no allocations and single frame. - - var mw messageWriter - if err := c.beginMessage(&mw, messageType); err != nil { - return err - } - n := copy(c.writeBuf[mw.pos:], data) - mw.pos += n - data = data[n:] - return mw.flushFrame(true, data) - } - - w, err := c.NextWriter(messageType) - if err != nil { - return err - } - if _, err = w.Write(data); err != nil { - return err - } - return w.Close() -} - -// SetWriteDeadline sets the write deadline on the underlying network -// connection. After a write has timed out, the websocket state is corrupt and -// all future writes will return an error. A zero value for t means writes will -// not time out. -func (c *Conn) SetWriteDeadline(t time.Time) error { - c.writeDeadline = t - return nil -} - -// Read methods - -func (c *Conn) advanceFrame() (int, error) { - // 1. Skip remainder of previous frame. - - if c.readRemaining > 0 { - if _, err := io.CopyN(io.Discard, c.br, c.readRemaining); err != nil { - return noFrame, err - } - } - - // 2. Read and parse first two bytes of frame header. - // To aid debugging, collect and report all errors in the first two bytes - // of the header. - - var errors []string - - p, err := c.read(2) - if err != nil { - return noFrame, err - } - - frameType := int(p[0] & 0xf) - final := p[0]&finalBit != 0 - rsv1 := p[0]&rsv1Bit != 0 - rsv2 := p[0]&rsv2Bit != 0 - rsv3 := p[0]&rsv3Bit != 0 - mask := p[1]&maskBit != 0 - _ = c.setReadRemaining(int64(p[1] & 0x7f)) // will not fail because argument is >= 0 - - c.readDecompress = false - if rsv1 { - if c.newDecompressionReader != nil { - c.readDecompress = true - } else { - errors = append(errors, "RSV1 set") - } - } - - if rsv2 { - errors = append(errors, "RSV2 set") - } - - if rsv3 { - errors = append(errors, "RSV3 set") - } - - switch frameType { - case CloseMessage, PingMessage, PongMessage: - if c.readRemaining > maxControlFramePayloadSize { - errors = append(errors, "len > 125 for control") - } - if !final { - errors = append(errors, "FIN not set on control") - } - case TextMessage, BinaryMessage: - if !c.readFinal { - errors = append(errors, "data before FIN") - } - c.readFinal = final - case continuationFrame: - if c.readFinal { - errors = append(errors, "continuation after FIN") - } - c.readFinal = final - default: - errors = append(errors, "bad opcode "+strconv.Itoa(frameType)) - } - - if mask != c.isServer { - errors = append(errors, "bad MASK") - } - - if len(errors) > 0 { - return noFrame, c.handleProtocolError(strings.Join(errors, ", ")) - } - - // 3. Read and parse frame length as per - // https://tools.ietf.org/html/rfc6455#section-5.2 - // - // The length of the "Payload data", in bytes: if 0-125, that is the payload - // length. - // - If 126, the following 2 bytes interpreted as a 16-bit unsigned - // integer are the payload length. - // - If 127, the following 8 bytes interpreted as - // a 64-bit unsigned integer (the most significant bit MUST be 0) are the - // payload length. Multibyte length quantities are expressed in network byte - // order. - - switch c.readRemaining { - case 126: - p, err := c.read(2) - if err != nil { - return noFrame, err - } - - if err := c.setReadRemaining(int64(binary.BigEndian.Uint16(p))); err != nil { - return noFrame, err - } - case 127: - p, err := c.read(8) - if err != nil { - return noFrame, err - } - - if err := c.setReadRemaining(int64(binary.BigEndian.Uint64(p))); err != nil { - return noFrame, err - } - } - - // 4. Handle frame masking. - - if mask { - c.readMaskPos = 0 - p, err := c.read(len(c.readMaskKey)) - if err != nil { - return noFrame, err - } - copy(c.readMaskKey[:], p) - } - - // 5. For text and binary messages, enforce read limit and return. - - if frameType == continuationFrame || frameType == TextMessage || frameType == BinaryMessage { - - c.readLength += c.readRemaining - // Don't allow readLength to overflow in the presence of a large readRemaining - // counter. - if c.readLength < 0 { - return noFrame, ErrReadLimit - } - - if c.readLimit > 0 && c.readLength > c.readLimit { - // Make a best effort to send a close message describing the problem. - _ = c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait)) - return noFrame, ErrReadLimit - } - - return frameType, nil - } - - // 6. Read control frame payload. - - var payload []byte - if c.readRemaining > 0 { - payload, err = c.read(int(c.readRemaining)) - _ = c.setReadRemaining(0) // will not fail because argument is >= 0 - if err != nil { - return noFrame, err - } - if c.isServer { - maskBytes(c.readMaskKey, 0, payload) - } - } - - // 7. Process control frame payload. - - switch frameType { - case PongMessage: - if err := c.handlePong(string(payload)); err != nil { - return noFrame, err - } - case PingMessage: - if err := c.handlePing(string(payload)); err != nil { - return noFrame, err - } - case CloseMessage: - closeCode := CloseNoStatusReceived - closeText := "" - if len(payload) >= 2 { - closeCode = int(binary.BigEndian.Uint16(payload)) - if !isValidReceivedCloseCode(closeCode) { - return noFrame, c.handleProtocolError("bad close code " + strconv.Itoa(closeCode)) - } - closeText = string(payload[2:]) - if !utf8.ValidString(closeText) { - return noFrame, c.handleProtocolError("invalid utf8 payload in close frame") - } - } - if err := c.handleClose(closeCode, closeText); err != nil { - return noFrame, err - } - return noFrame, &CloseError{Code: closeCode, Text: closeText} - } - - return frameType, nil -} - -func (c *Conn) handleProtocolError(message string) error { - data := FormatCloseMessage(CloseProtocolError, message) - if len(data) > maxControlFramePayloadSize { - data = data[:maxControlFramePayloadSize] - } - // Make a best effor to send a close message describing the problem. - _ = c.WriteControl(CloseMessage, data, time.Now().Add(writeWait)) - return errors.New("websocket: " + message) -} - -// NextReader returns the next data message received from the peer. The -// returned messageType is either TextMessage or BinaryMessage. -// -// There can be at most one open reader on a connection. NextReader discards -// the previous message if the application has not already consumed it. -// -// Applications must break out of the application's read loop when this method -// returns a non-nil error value. Errors returned from this method are -// permanent. Once this method returns a non-nil error, all subsequent calls to -// this method return the same error. -func (c *Conn) NextReader() (messageType int, r io.Reader, err error) { - // Close previous reader, only relevant for decompression. - if c.reader != nil { - c.reader.Close() - c.reader = nil - } - - c.messageReader = nil - c.readLength = 0 - - for c.readErr == nil { - frameType, err := c.advanceFrame() - if err != nil { - c.readErr = err - break - } - - if frameType == TextMessage || frameType == BinaryMessage { - c.messageReader = &messageReader{c} - c.reader = c.messageReader - if c.readDecompress { - c.reader = c.newDecompressionReader(c.reader) - } - return frameType, c.reader, nil - } - } - - // Applications that do handle the error returned from this method spin in - // tight loop on connection failure. To help application developers detect - // this error, panic on repeated reads to the failed connection. - c.readErrCount++ - if c.readErrCount >= 1000 { - panic("repeated read on failed websocket connection") - } - - return noFrame, nil, c.readErr -} - -type messageReader struct{ c *Conn } - -func (r *messageReader) Read(b []byte) (int, error) { - c := r.c - if c.messageReader != r { - return 0, io.EOF - } - - for c.readErr == nil { - - if c.readRemaining > 0 { - if int64(len(b)) > c.readRemaining { - b = b[:c.readRemaining] - } - n, err := c.br.Read(b) - c.readErr = err - if c.isServer { - c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n]) - } - rem := c.readRemaining - rem -= int64(n) - _ = c.setReadRemaining(rem) // rem is guaranteed to be >= 0 - if c.readRemaining > 0 && c.readErr == io.EOF { - c.readErr = errUnexpectedEOF - } - return n, c.readErr - } - - if c.readFinal { - c.messageReader = nil - return 0, io.EOF - } - - frameType, err := c.advanceFrame() - switch { - case err != nil: - c.readErr = err - case frameType == TextMessage || frameType == BinaryMessage: - c.readErr = errors.New("websocket: internal error, unexpected text or binary in Reader") - } - } - - err := c.readErr - if err == io.EOF && c.messageReader == r { - err = errUnexpectedEOF - } - return 0, err -} - -func (r *messageReader) Close() error { - return nil -} - -// ReadMessage is a helper method for getting a reader using NextReader and -// reading from that reader to a buffer. -func (c *Conn) ReadMessage() (messageType int, p []byte, err error) { - var r io.Reader - messageType, r, err = c.NextReader() - if err != nil { - return messageType, nil, err - } - p, err = io.ReadAll(r) - return messageType, p, err -} - -// SetReadDeadline sets the read deadline on the underlying network connection. -// After a read has timed out, the websocket connection state is corrupt and -// all future reads will return an error. A zero value for t means reads will -// not time out. -func (c *Conn) SetReadDeadline(t time.Time) error { - return c.conn.SetReadDeadline(t) -} - -// SetReadLimit sets the maximum size in bytes for a message read from the peer. If a -// message exceeds the limit, the connection sends a close message to the peer -// and returns ErrReadLimit to the application. -func (c *Conn) SetReadLimit(limit int64) { - c.readLimit = limit -} - -// CloseHandler returns the current close handler -func (c *Conn) CloseHandler() func(code int, text string) error { - return c.handleClose -} - -// SetCloseHandler sets the handler for close messages received from the peer. -// The code argument to h is the received close code or CloseNoStatusReceived -// if the close message is empty. The default close handler sends a close -// message back to the peer. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// close messages as described in the section on Control Messages above. -// -// The connection read methods return a CloseError when a close message is -// received. Most applications should handle close messages as part of their -// normal error handling. Applications should only set a close handler when the -// application must perform some action before sending a close message back to -// the peer. -func (c *Conn) SetCloseHandler(h func(code int, text string) error) { - if h == nil { - h = func(code int, text string) error { - message := FormatCloseMessage(code, "") - // Make a best effor to send the close message. - _ = c.WriteControl(CloseMessage, message, time.Now().Add(writeWait)) - return nil - } - } - c.handleClose = h -} - -// PingHandler returns the current ping handler -func (c *Conn) PingHandler() func(appData string) error { - return c.handlePing -} - -// SetPingHandler sets the handler for ping messages received from the peer. -// The appData argument to h is the PING message application data. The default -// ping handler sends a pong to the peer. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// ping messages as described in the section on Control Messages above. -func (c *Conn) SetPingHandler(h func(appData string) error) { - if h == nil { - h = func(message string) error { - // Make a best effort to send the pong message. - _ = c.WriteControl(PongMessage, []byte(message), time.Now().Add(writeWait)) - return nil - } - } - c.handlePing = h -} - -// PongHandler returns the current pong handler -func (c *Conn) PongHandler() func(appData string) error { - return c.handlePong -} - -// SetPongHandler sets the handler for pong messages received from the peer. -// The appData argument to h is the PONG message application data. The default -// pong handler does nothing. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// pong messages as described in the section on Control Messages above. -func (c *Conn) SetPongHandler(h func(appData string) error) { - if h == nil { - h = func(string) error { return nil } - } - c.handlePong = h -} - -// NetConn returns the underlying connection that is wrapped by c. -// Note that writing to or reading from this connection directly will corrupt the -// WebSocket connection. -func (c *Conn) NetConn() net.Conn { - return c.conn -} - -// UnderlyingConn returns the internal net.Conn. This can be used to further -// modifications to connection specific flags. -// Deprecated: Use the NetConn method. -func (c *Conn) UnderlyingConn() net.Conn { - return c.conn -} - -// EnableWriteCompression enables and disables write compression of -// subsequent text and binary messages. This function is a noop if -// compression was not negotiated with the peer. -func (c *Conn) EnableWriteCompression(enable bool) { - c.enableWriteCompression = enable -} - -// SetCompressionLevel sets the flate compression level for subsequent text and -// binary messages. This function is a noop if compression was not negotiated -// with the peer. See the compress/flate package for a description of -// compression levels. -func (c *Conn) SetCompressionLevel(level int) error { - if !isValidCompressionLevel(level) { - return errors.New("websocket: invalid compression level") - } - c.compressionLevel = level - return nil -} - -// FormatCloseMessage formats closeCode and text as a WebSocket close message. -// An empty message is returned for code CloseNoStatusReceived. -func FormatCloseMessage(closeCode int, text string) []byte { - if closeCode == CloseNoStatusReceived { - // Return empty message because it's illegal to send - // CloseNoStatusReceived. Return non-nil value in case application - // checks for nil. - return []byte{} - } - buf := make([]byte, 2+len(text)) - binary.BigEndian.PutUint16(buf, uint16(closeCode)) - copy(buf[2:], text) - return buf -} diff --git a/vendor/github.com/gorilla/websocket/doc.go b/vendor/github.com/gorilla/websocket/doc.go deleted file mode 100644 index 8db0cef95..000000000 --- a/vendor/github.com/gorilla/websocket/doc.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package websocket implements the WebSocket protocol defined in RFC 6455. -// -// Overview -// -// The Conn type represents a WebSocket connection. A server application calls -// the Upgrader.Upgrade method from an HTTP request handler to get a *Conn: -// -// var upgrader = websocket.Upgrader{ -// ReadBufferSize: 1024, -// WriteBufferSize: 1024, -// } -// -// func handler(w http.ResponseWriter, r *http.Request) { -// conn, err := upgrader.Upgrade(w, r, nil) -// if err != nil { -// log.Println(err) -// return -// } -// ... Use conn to send and receive messages. -// } -// -// Call the connection's WriteMessage and ReadMessage methods to send and -// receive messages as a slice of bytes. This snippet of code shows how to echo -// messages using these methods: -// -// for { -// messageType, p, err := conn.ReadMessage() -// if err != nil { -// log.Println(err) -// return -// } -// if err := conn.WriteMessage(messageType, p); err != nil { -// log.Println(err) -// return -// } -// } -// -// In above snippet of code, p is a []byte and messageType is an int with value -// websocket.BinaryMessage or websocket.TextMessage. -// -// An application can also send and receive messages using the io.WriteCloser -// and io.Reader interfaces. To send a message, call the connection NextWriter -// method to get an io.WriteCloser, write the message to the writer and close -// the writer when done. To receive a message, call the connection NextReader -// method to get an io.Reader and read until io.EOF is returned. This snippet -// shows how to echo messages using the NextWriter and NextReader methods: -// -// for { -// messageType, r, err := conn.NextReader() -// if err != nil { -// return -// } -// w, err := conn.NextWriter(messageType) -// if err != nil { -// return err -// } -// if _, err := io.Copy(w, r); err != nil { -// return err -// } -// if err := w.Close(); err != nil { -// return err -// } -// } -// -// Data Messages -// -// The WebSocket protocol distinguishes between text and binary data messages. -// Text messages are interpreted as UTF-8 encoded text. The interpretation of -// binary messages is left to the application. -// -// This package uses the TextMessage and BinaryMessage integer constants to -// identify the two data message types. The ReadMessage and NextReader methods -// return the type of the received message. The messageType argument to the -// WriteMessage and NextWriter methods specifies the type of a sent message. -// -// It is the application's responsibility to ensure that text messages are -// valid UTF-8 encoded text. -// -// Control Messages -// -// The WebSocket protocol defines three types of control messages: close, ping -// and pong. Call the connection WriteControl, WriteMessage or NextWriter -// methods to send a control message to the peer. -// -// Connections handle received close messages by calling the handler function -// set with the SetCloseHandler method and by returning a *CloseError from the -// NextReader, ReadMessage or the message Read method. The default close -// handler sends a close message to the peer. -// -// Connections handle received ping messages by calling the handler function -// set with the SetPingHandler method. The default ping handler sends a pong -// message to the peer. -// -// Connections handle received pong messages by calling the handler function -// set with the SetPongHandler method. The default pong handler does nothing. -// If an application sends ping messages, then the application should set a -// pong handler to receive the corresponding pong. -// -// The control message handler functions are called from the NextReader, -// ReadMessage and message reader Read methods. The default close and ping -// handlers can block these methods for a short time when the handler writes to -// the connection. -// -// The application must read the connection to process close, ping and pong -// messages sent from the peer. If the application is not otherwise interested -// in messages from the peer, then the application should start a goroutine to -// read and discard messages from the peer. A simple example is: -// -// func readLoop(c *websocket.Conn) { -// for { -// if _, _, err := c.NextReader(); err != nil { -// c.Close() -// break -// } -// } -// } -// -// Concurrency -// -// Connections support one concurrent reader and one concurrent writer. -// -// Applications are responsible for ensuring that no more than one goroutine -// calls the write methods (NextWriter, SetWriteDeadline, WriteMessage, -// WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and -// that no more than one goroutine calls the read methods (NextReader, -// SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler) -// concurrently. -// -// The Close and WriteControl methods can be called concurrently with all other -// methods. -// -// Origin Considerations -// -// Web browsers allow Javascript applications to open a WebSocket connection to -// any host. It's up to the server to enforce an origin policy using the Origin -// request header sent by the browser. -// -// The Upgrader calls the function specified in the CheckOrigin field to check -// the origin. If the CheckOrigin function returns false, then the Upgrade -// method fails the WebSocket handshake with HTTP status 403. -// -// If the CheckOrigin field is nil, then the Upgrader uses a safe default: fail -// the handshake if the Origin request header is present and the Origin host is -// not equal to the Host request header. -// -// The deprecated package-level Upgrade function does not perform origin -// checking. The application is responsible for checking the Origin header -// before calling the Upgrade function. -// -// Buffers -// -// Connections buffer network input and output to reduce the number -// of system calls when reading or writing messages. -// -// Write buffers are also used for constructing WebSocket frames. See RFC 6455, -// Section 5 for a discussion of message framing. A WebSocket frame header is -// written to the network each time a write buffer is flushed to the network. -// Decreasing the size of the write buffer can increase the amount of framing -// overhead on the connection. -// -// The buffer sizes in bytes are specified by the ReadBufferSize and -// WriteBufferSize fields in the Dialer and Upgrader. The Dialer uses a default -// size of 4096 when a buffer size field is set to zero. The Upgrader reuses -// buffers created by the HTTP server when a buffer size field is set to zero. -// The HTTP server buffers have a size of 4096 at the time of this writing. -// -// The buffer sizes do not limit the size of a message that can be read or -// written by a connection. -// -// Buffers are held for the lifetime of the connection by default. If the -// Dialer or Upgrader WriteBufferPool field is set, then a connection holds the -// write buffer only when writing a message. -// -// Applications should tune the buffer sizes to balance memory use and -// performance. Increasing the buffer size uses more memory, but can reduce the -// number of system calls to read or write the network. In the case of writing, -// increasing the buffer size can reduce the number of frame headers written to -// the network. -// -// Some guidelines for setting buffer parameters are: -// -// Limit the buffer sizes to the maximum expected message size. Buffers larger -// than the largest message do not provide any benefit. -// -// Depending on the distribution of message sizes, setting the buffer size to -// a value less than the maximum expected message size can greatly reduce memory -// use with a small impact on performance. Here's an example: If 99% of the -// messages are smaller than 256 bytes and the maximum message size is 512 -// bytes, then a buffer size of 256 bytes will result in 1.01 more system calls -// than a buffer size of 512 bytes. The memory savings is 50%. -// -// A write buffer pool is useful when the application has a modest number -// writes over a large number of connections. when buffers are pooled, a larger -// buffer size has a reduced impact on total memory use and has the benefit of -// reducing system calls and frame overhead. -// -// Compression EXPERIMENTAL -// -// Per message compression extensions (RFC 7692) are experimentally supported -// by this package in a limited capacity. Setting the EnableCompression option -// to true in Dialer or Upgrader will attempt to negotiate per message deflate -// support. -// -// var upgrader = websocket.Upgrader{ -// EnableCompression: true, -// } -// -// If compression was successfully negotiated with the connection's peer, any -// message received in compressed form will be automatically decompressed. -// All Read methods will return uncompressed bytes. -// -// Per message compression of messages written to a connection can be enabled -// or disabled by calling the corresponding Conn method: -// -// conn.EnableWriteCompression(false) -// -// Currently this package does not support compression with "context takeover". -// This means that messages must be compressed and decompressed in isolation, -// without retaining sliding window or dictionary state across messages. For -// more details refer to RFC 7692. -// -// Use of compression is experimental and may result in decreased performance. -package websocket diff --git a/vendor/github.com/gorilla/websocket/join.go b/vendor/github.com/gorilla/websocket/join.go deleted file mode 100644 index c64f8c829..000000000 --- a/vendor/github.com/gorilla/websocket/join.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "io" - "strings" -) - -// JoinMessages concatenates received messages to create a single io.Reader. -// The string term is appended to each message. The returned reader does not -// support concurrent calls to the Read method. -func JoinMessages(c *Conn, term string) io.Reader { - return &joinReader{c: c, term: term} -} - -type joinReader struct { - c *Conn - term string - r io.Reader -} - -func (r *joinReader) Read(p []byte) (int, error) { - if r.r == nil { - var err error - _, r.r, err = r.c.NextReader() - if err != nil { - return 0, err - } - if r.term != "" { - r.r = io.MultiReader(r.r, strings.NewReader(r.term)) - } - } - n, err := r.r.Read(p) - if err == io.EOF { - err = nil - r.r = nil - } - return n, err -} diff --git a/vendor/github.com/gorilla/websocket/json.go b/vendor/github.com/gorilla/websocket/json.go deleted file mode 100644 index dc2c1f641..000000000 --- a/vendor/github.com/gorilla/websocket/json.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "encoding/json" - "io" -) - -// WriteJSON writes the JSON encoding of v as a message. -// -// Deprecated: Use c.WriteJSON instead. -func WriteJSON(c *Conn, v interface{}) error { - return c.WriteJSON(v) -} - -// WriteJSON writes the JSON encoding of v as a message. -// -// See the documentation for encoding/json Marshal for details about the -// conversion of Go values to JSON. -func (c *Conn) WriteJSON(v interface{}) error { - w, err := c.NextWriter(TextMessage) - if err != nil { - return err - } - err1 := json.NewEncoder(w).Encode(v) - err2 := w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// Deprecated: Use c.ReadJSON instead. -func ReadJSON(c *Conn, v interface{}) error { - return c.ReadJSON(v) -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// See the documentation for the encoding/json Unmarshal function for details -// about the conversion of JSON to a Go value. -func (c *Conn) ReadJSON(v interface{}) error { - _, r, err := c.NextReader() - if err != nil { - return err - } - err = json.NewDecoder(r).Decode(v) - if err == io.EOF { - // One value is expected in the message. - err = io.ErrUnexpectedEOF - } - return err -} diff --git a/vendor/github.com/gorilla/websocket/mask.go b/vendor/github.com/gorilla/websocket/mask.go deleted file mode 100644 index d0742bf2a..000000000 --- a/vendor/github.com/gorilla/websocket/mask.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -//go:build !appengine -// +build !appengine - -package websocket - -import "unsafe" - -const wordSize = int(unsafe.Sizeof(uintptr(0))) - -func maskBytes(key [4]byte, pos int, b []byte) int { - // Mask one byte at a time for small buffers. - if len(b) < 2*wordSize { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 - } - - // Mask one byte at a time to word boundary. - if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { - n = wordSize - n - for i := range b[:n] { - b[i] ^= key[pos&3] - pos++ - } - b = b[n:] - } - - // Create aligned word size key. - var k [wordSize]byte - for i := range k { - k[i] = key[(pos+i)&3] - } - kw := *(*uintptr)(unsafe.Pointer(&k)) - - // Mask one word at a time. - n := (len(b) / wordSize) * wordSize - for i := 0; i < n; i += wordSize { - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw - } - - // Mask one byte at a time for remaining bytes. - b = b[n:] - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - - return pos & 3 -} diff --git a/vendor/github.com/gorilla/websocket/mask_safe.go b/vendor/github.com/gorilla/websocket/mask_safe.go deleted file mode 100644 index 36250ca7c..000000000 --- a/vendor/github.com/gorilla/websocket/mask_safe.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -//go:build appengine -// +build appengine - -package websocket - -func maskBytes(key [4]byte, pos int, b []byte) int { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 -} diff --git a/vendor/github.com/gorilla/websocket/prepared.go b/vendor/github.com/gorilla/websocket/prepared.go deleted file mode 100644 index c854225e9..000000000 --- a/vendor/github.com/gorilla/websocket/prepared.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bytes" - "net" - "sync" - "time" -) - -// PreparedMessage caches on the wire representations of a message payload. -// Use PreparedMessage to efficiently send a message payload to multiple -// connections. PreparedMessage is especially useful when compression is used -// because the CPU and memory expensive compression operation can be executed -// once for a given set of compression options. -type PreparedMessage struct { - messageType int - data []byte - mu sync.Mutex - frames map[prepareKey]*preparedFrame -} - -// prepareKey defines a unique set of options to cache prepared frames in PreparedMessage. -type prepareKey struct { - isServer bool - compress bool - compressionLevel int -} - -// preparedFrame contains data in wire representation. -type preparedFrame struct { - once sync.Once - data []byte -} - -// NewPreparedMessage returns an initialized PreparedMessage. You can then send -// it to connection using WritePreparedMessage method. Valid wire -// representation will be calculated lazily only once for a set of current -// connection options. -func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error) { - pm := &PreparedMessage{ - messageType: messageType, - frames: make(map[prepareKey]*preparedFrame), - data: data, - } - - // Prepare a plain server frame. - _, frameData, err := pm.frame(prepareKey{isServer: true, compress: false}) - if err != nil { - return nil, err - } - - // To protect against caller modifying the data argument, remember the data - // copied to the plain server frame. - pm.data = frameData[len(frameData)-len(data):] - return pm, nil -} - -func (pm *PreparedMessage) frame(key prepareKey) (int, []byte, error) { - pm.mu.Lock() - frame, ok := pm.frames[key] - if !ok { - frame = &preparedFrame{} - pm.frames[key] = frame - } - pm.mu.Unlock() - - var err error - frame.once.Do(func() { - // Prepare a frame using a 'fake' connection. - // TODO: Refactor code in conn.go to allow more direct construction of - // the frame. - mu := make(chan struct{}, 1) - mu <- struct{}{} - var nc prepareConn - c := &Conn{ - conn: &nc, - mu: mu, - isServer: key.isServer, - compressionLevel: key.compressionLevel, - enableWriteCompression: true, - writeBuf: make([]byte, defaultWriteBufferSize+maxFrameHeaderSize), - } - if key.compress { - c.newCompressionWriter = compressNoContextTakeover - } - err = c.WriteMessage(pm.messageType, pm.data) - frame.data = nc.buf.Bytes() - }) - return pm.messageType, frame.data, err -} - -type prepareConn struct { - buf bytes.Buffer - net.Conn -} - -func (pc *prepareConn) Write(p []byte) (int, error) { return pc.buf.Write(p) } -func (pc *prepareConn) SetWriteDeadline(t time.Time) error { return nil } diff --git a/vendor/github.com/gorilla/websocket/proxy.go b/vendor/github.com/gorilla/websocket/proxy.go deleted file mode 100644 index d716a0588..000000000 --- a/vendor/github.com/gorilla/websocket/proxy.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "bytes" - "context" - "encoding/base64" - "errors" - "net" - "net/http" - "net/url" - "strings" - - "golang.org/x/net/proxy" -) - -type netDialerFunc func(ctx context.Context, network, addr string) (net.Conn, error) - -func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) { - return fn(context.Background(), network, addr) -} - -func (fn netDialerFunc) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { - return fn(ctx, network, addr) -} - -func proxyFromURL(proxyURL *url.URL, forwardDial netDialerFunc) (netDialerFunc, error) { - if proxyURL.Scheme == "http" || proxyURL.Scheme == "https" { - return (&httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDial}).DialContext, nil - } - dialer, err := proxy.FromURL(proxyURL, forwardDial) - if err != nil { - return nil, err - } - if d, ok := dialer.(proxy.ContextDialer); ok { - return d.DialContext, nil - } - return func(ctx context.Context, net, addr string) (net.Conn, error) { - return dialer.Dial(net, addr) - }, nil -} - -type httpProxyDialer struct { - proxyURL *url.URL - forwardDial netDialerFunc -} - -func (hpd *httpProxyDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) { - hostPort, _ := hostPortNoPort(hpd.proxyURL) - conn, err := hpd.forwardDial(ctx, network, hostPort) - if err != nil { - return nil, err - } - - connectHeader := make(http.Header) - if user := hpd.proxyURL.User; user != nil { - proxyUser := user.Username() - if proxyPassword, passwordSet := user.Password(); passwordSet { - credential := base64.StdEncoding.EncodeToString([]byte(proxyUser + ":" + proxyPassword)) - connectHeader.Set("Proxy-Authorization", "Basic "+credential) - } - } - connectReq := &http.Request{ - Method: http.MethodConnect, - URL: &url.URL{Opaque: addr}, - Host: addr, - Header: connectHeader, - } - - if err := connectReq.Write(conn); err != nil { - conn.Close() - return nil, err - } - - // Read response. It's OK to use and discard buffered reader here because - // the remote server does not speak until spoken to. - br := bufio.NewReader(conn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - conn.Close() - return nil, err - } - - // Close the response body to silence false positives from linters. Reset - // the buffered reader first to ensure that Close() does not read from - // conn. - // Note: Applications must call resp.Body.Close() on a response returned - // http.ReadResponse to inspect trailers or read another response from the - // buffered reader. The call to resp.Body.Close() does not release - // resources. - br.Reset(bytes.NewReader(nil)) - _ = resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - _ = conn.Close() - f := strings.SplitN(resp.Status, " ", 2) - return nil, errors.New(f[1]) - } - return conn, nil -} diff --git a/vendor/github.com/gorilla/websocket/server.go b/vendor/github.com/gorilla/websocket/server.go deleted file mode 100644 index 02ea01fdc..000000000 --- a/vendor/github.com/gorilla/websocket/server.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "net" - "net/http" - "net/url" - "strings" - "time" -) - -// HandshakeError describes an error with the handshake from the peer. -type HandshakeError struct { - message string -} - -func (e HandshakeError) Error() string { return e.message } - -// Upgrader specifies parameters for upgrading an HTTP connection to a -// WebSocket connection. -// -// It is safe to call Upgrader's methods concurrently. -type Upgrader struct { - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer - // size is zero, then buffers allocated by the HTTP server are used. The - // I/O buffer sizes do not limit the size of the messages that can be sent - // or received. - ReadBufferSize, WriteBufferSize int - - // WriteBufferPool is a pool of buffers for write operations. If the value - // is not set, then write buffers are allocated to the connection for the - // lifetime of the connection. - // - // A pool is most useful when the application has a modest volume of writes - // across a large number of connections. - // - // Applications should use a single pool for each unique value of - // WriteBufferSize. - WriteBufferPool BufferPool - - // Subprotocols specifies the server's supported protocols in order of - // preference. If this field is not nil, then the Upgrade method negotiates a - // subprotocol by selecting the first match in this list with a protocol - // requested by the client. If there's no match, then no protocol is - // negotiated (the Sec-Websocket-Protocol header is not included in the - // handshake response). - Subprotocols []string - - // Error specifies the function for generating HTTP error responses. If Error - // is nil, then http.Error is used to generate the HTTP response. - Error func(w http.ResponseWriter, r *http.Request, status int, reason error) - - // CheckOrigin returns true if the request Origin header is acceptable. If - // CheckOrigin is nil, then a safe default is used: return false if the - // Origin request header is present and the origin host is not equal to - // request Host header. - // - // A CheckOrigin function should carefully validate the request origin to - // prevent cross-site request forgery. - CheckOrigin func(r *http.Request) bool - - // EnableCompression specify if the server should attempt to negotiate per - // message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool -} - -func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status int, reason string) (*Conn, error) { - err := HandshakeError{reason} - if u.Error != nil { - u.Error(w, r, status, err) - } else { - w.Header().Set("Sec-Websocket-Version", "13") - http.Error(w, http.StatusText(status), status) - } - return nil, err -} - -// checkSameOrigin returns true if the origin is not set or is equal to the request host. -func checkSameOrigin(r *http.Request) bool { - origin := r.Header["Origin"] - if len(origin) == 0 { - return true - } - u, err := url.Parse(origin[0]) - if err != nil { - return false - } - return equalASCIIFold(u.Host, r.Host) -} - -func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string { - if u.Subprotocols != nil { - clientProtocols := Subprotocols(r) - for _, clientProtocol := range clientProtocols { - for _, serverProtocol := range u.Subprotocols { - if clientProtocol == serverProtocol { - return clientProtocol - } - } - } - } else if responseHeader != nil { - return responseHeader.Get("Sec-Websocket-Protocol") - } - return "" -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie). To specify -// subprotocols supported by the server, set Upgrader.Subprotocols directly. -// -// If the upgrade fails, then Upgrade replies to the client with an HTTP error -// response. -func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) { - const badHandshake = "websocket: the client is not using the websocket protocol: " - - if !tokenListContainsValue(r.Header, "Connection", "upgrade") { - return u.returnError(w, r, http.StatusBadRequest, badHandshake+"'upgrade' token not found in 'Connection' header") - } - - if !tokenListContainsValue(r.Header, "Upgrade", "websocket") { - w.Header().Set("Upgrade", "websocket") - return u.returnError(w, r, http.StatusUpgradeRequired, badHandshake+"'websocket' token not found in 'Upgrade' header") - } - - if r.Method != http.MethodGet { - return u.returnError(w, r, http.StatusMethodNotAllowed, badHandshake+"request method is not GET") - } - - if !tokenListContainsValue(r.Header, "Sec-Websocket-Version", "13") { - return u.returnError(w, r, http.StatusBadRequest, "websocket: unsupported version: 13 not found in 'Sec-Websocket-Version' header") - } - - if _, ok := responseHeader["Sec-Websocket-Extensions"]; ok { - return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-WebSocket-Extensions' headers are unsupported") - } - - checkOrigin := u.CheckOrigin - if checkOrigin == nil { - checkOrigin = checkSameOrigin - } - if !checkOrigin(r) { - return u.returnError(w, r, http.StatusForbidden, "websocket: request origin not allowed by Upgrader.CheckOrigin") - } - - challengeKey := r.Header.Get("Sec-Websocket-Key") - if !isValidChallengeKey(challengeKey) { - return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'Sec-WebSocket-Key' header must be Base64 encoded value of 16-byte in length") - } - - subprotocol := u.selectSubprotocol(r, responseHeader) - - // Negotiate PMCE - var compress bool - if u.EnableCompression { - for _, ext := range parseExtensions(r.Header) { - if ext[""] != "permessage-deflate" { - continue - } - compress = true - break - } - } - - netConn, brw, err := http.NewResponseController(w).Hijack() - if err != nil { - return u.returnError(w, r, http.StatusInternalServerError, - "websocket: hijack: "+err.Error()) - } - - // Close the network connection when returning an error. The variable - // netConn is set to nil before the success return at the end of the - // function. - defer func() { - if netConn != nil { - // It's safe to ignore the error from Close() because this code is - // only executed when returning a more important error to the - // application. - _ = netConn.Close() - } - }() - - var br *bufio.Reader - if u.ReadBufferSize == 0 && brw.Reader.Size() > 256 { - // Use hijacked buffered reader as the connection reader. - br = brw.Reader - } else if brw.Reader.Buffered() > 0 { - // Wrap the network connection to read buffered data in brw.Reader - // before reading from the network connection. This should be rare - // because a client must not send message data before receiving the - // handshake response. - netConn = &brNetConn{br: brw.Reader, Conn: netConn} - } - - buf := brw.Writer.AvailableBuffer() - - var writeBuf []byte - if u.WriteBufferPool == nil && u.WriteBufferSize == 0 && len(buf) >= maxFrameHeaderSize+256 { - // Reuse hijacked write buffer as connection buffer. - writeBuf = buf - } - - c := newConn(netConn, true, u.ReadBufferSize, u.WriteBufferSize, u.WriteBufferPool, br, writeBuf) - c.subprotocol = subprotocol - - if compress { - c.newCompressionWriter = compressNoContextTakeover - c.newDecompressionReader = decompressNoContextTakeover - } - - // Use larger of hijacked buffer and connection write buffer for header. - p := buf - if len(c.writeBuf) > len(p) { - p = c.writeBuf - } - p = p[:0] - - p = append(p, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: "...) - p = append(p, computeAcceptKey(challengeKey)...) - p = append(p, "\r\n"...) - if c.subprotocol != "" { - p = append(p, "Sec-WebSocket-Protocol: "...) - p = append(p, c.subprotocol...) - p = append(p, "\r\n"...) - } - if compress { - p = append(p, "Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...) - } - for k, vs := range responseHeader { - if k == "Sec-Websocket-Protocol" { - continue - } - for _, v := range vs { - p = append(p, k...) - p = append(p, ": "...) - for i := 0; i < len(v); i++ { - b := v[i] - if b <= 31 { - // prevent response splitting. - b = ' ' - } - p = append(p, b) - } - p = append(p, "\r\n"...) - } - } - p = append(p, "\r\n"...) - - if u.HandshakeTimeout > 0 { - if err := netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout)); err != nil { - return nil, err - } - } else { - // Clear deadlines set by HTTP server. - if err := netConn.SetDeadline(time.Time{}); err != nil { - return nil, err - } - } - - if _, err = netConn.Write(p); err != nil { - return nil, err - } - if u.HandshakeTimeout > 0 { - if err := netConn.SetWriteDeadline(time.Time{}); err != nil { - return nil, err - } - } - - // Success! Set netConn to nil to stop the deferred function above from - // closing the network connection. - netConn = nil - - return c, nil -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// Deprecated: Use websocket.Upgrader instead. -// -// Upgrade does not perform origin checking. The application is responsible for -// checking the Origin header before calling Upgrade. An example implementation -// of the same origin policy check is: -// -// if req.Header.Get("Origin") != "http://"+req.Host { -// http.Error(w, "Origin not allowed", http.StatusForbidden) -// return -// } -// -// If the endpoint supports subprotocols, then the application is responsible -// for negotiating the protocol used on the connection. Use the Subprotocols() -// function to get the subprotocols requested by the client. Use the -// Sec-Websocket-Protocol response header to specify the subprotocol selected -// by the application. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie) and the -// negotiated subprotocol (Sec-Websocket-Protocol). -// -// The connection buffers IO to the underlying network connection. The -// readBufSize and writeBufSize parameters specify the size of the buffers to -// use. Messages can be larger than the buffers. -// -// If the request is not a valid WebSocket handshake, then Upgrade returns an -// error of type HandshakeError. Applications should handle this error by -// replying to the client with an HTTP error response. -func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, readBufSize, writeBufSize int) (*Conn, error) { - u := Upgrader{ReadBufferSize: readBufSize, WriteBufferSize: writeBufSize} - u.Error = func(w http.ResponseWriter, r *http.Request, status int, reason error) { - // don't return errors to maintain backwards compatibility - } - u.CheckOrigin = func(r *http.Request) bool { - // allow all connections by default - return true - } - return u.Upgrade(w, r, responseHeader) -} - -// Subprotocols returns the subprotocols requested by the client in the -// Sec-Websocket-Protocol header. -func Subprotocols(r *http.Request) []string { - h := strings.TrimSpace(r.Header.Get("Sec-Websocket-Protocol")) - if h == "" { - return nil - } - protocols := strings.Split(h, ",") - for i := range protocols { - protocols[i] = strings.TrimSpace(protocols[i]) - } - return protocols -} - -// IsWebSocketUpgrade returns true if the client requested upgrade to the -// WebSocket protocol. -func IsWebSocketUpgrade(r *http.Request) bool { - return tokenListContainsValue(r.Header, "Connection", "upgrade") && - tokenListContainsValue(r.Header, "Upgrade", "websocket") -} - -type brNetConn struct { - br *bufio.Reader - net.Conn -} - -func (b *brNetConn) Read(p []byte) (n int, err error) { - if b.br != nil { - // Limit read to buferred data. - if n := b.br.Buffered(); len(p) > n { - p = p[:n] - } - n, err = b.br.Read(p) - if b.br.Buffered() == 0 { - b.br = nil - } - return n, err - } - return b.Conn.Read(p) -} - -// NetConn returns the underlying connection that is wrapped by b. -func (b *brNetConn) NetConn() net.Conn { - return b.Conn -} - diff --git a/vendor/github.com/gorilla/websocket/util.go b/vendor/github.com/gorilla/websocket/util.go deleted file mode 100644 index 31a5dee64..000000000 --- a/vendor/github.com/gorilla/websocket/util.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "crypto/rand" - "crypto/sha1" - "encoding/base64" - "io" - "net/http" - "strings" - "unicode/utf8" -) - -var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11") - -func computeAcceptKey(challengeKey string) string { - h := sha1.New() - h.Write([]byte(challengeKey)) - h.Write(keyGUID) - return base64.StdEncoding.EncodeToString(h.Sum(nil)) -} - -func generateChallengeKey() (string, error) { - p := make([]byte, 16) - if _, err := io.ReadFull(rand.Reader, p); err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(p), nil -} - -// Token octets per RFC 2616. -var isTokenOctet = [256]bool{ - '!': true, - '#': true, - '$': true, - '%': true, - '&': true, - '\'': true, - '*': true, - '+': true, - '-': true, - '.': true, - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - 'A': true, - 'B': true, - 'C': true, - 'D': true, - 'E': true, - 'F': true, - 'G': true, - 'H': true, - 'I': true, - 'J': true, - 'K': true, - 'L': true, - 'M': true, - 'N': true, - 'O': true, - 'P': true, - 'Q': true, - 'R': true, - 'S': true, - 'T': true, - 'U': true, - 'W': true, - 'V': true, - 'X': true, - 'Y': true, - 'Z': true, - '^': true, - '_': true, - '`': true, - 'a': true, - 'b': true, - 'c': true, - 'd': true, - 'e': true, - 'f': true, - 'g': true, - 'h': true, - 'i': true, - 'j': true, - 'k': true, - 'l': true, - 'm': true, - 'n': true, - 'o': true, - 'p': true, - 'q': true, - 'r': true, - 's': true, - 't': true, - 'u': true, - 'v': true, - 'w': true, - 'x': true, - 'y': true, - 'z': true, - '|': true, - '~': true, -} - -// skipSpace returns a slice of the string s with all leading RFC 2616 linear -// whitespace removed. -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if b := s[i]; b != ' ' && b != '\t' { - break - } - } - return s[i:] -} - -// nextToken returns the leading RFC 2616 token of s and the string following -// the token. -func nextToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if !isTokenOctet[s[i]] { - break - } - } - return s[:i], s[i:] -} - -// nextTokenOrQuoted returns the leading token or quoted string per RFC 2616 -// and the string following the token or quoted string. -func nextTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return nextToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} - -// equalASCIIFold returns true if s is equal to t with ASCII case folding as -// defined in RFC 4790. -func equalASCIIFold(s, t string) bool { - for s != "" && t != "" { - sr, size := utf8.DecodeRuneInString(s) - s = s[size:] - tr, size := utf8.DecodeRuneInString(t) - t = t[size:] - if sr == tr { - continue - } - if 'A' <= sr && sr <= 'Z' { - sr = sr + 'a' - 'A' - } - if 'A' <= tr && tr <= 'Z' { - tr = tr + 'a' - 'A' - } - if sr != tr { - return false - } - } - return s == t -} - -// tokenListContainsValue returns true if the 1#token header with the given -// name contains a token equal to value with ASCII case folding. -func tokenListContainsValue(header http.Header, name string, value string) bool { -headers: - for _, s := range header[name] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - s = skipSpace(s) - if s != "" && s[0] != ',' { - continue headers - } - if equalASCIIFold(t, value) { - return true - } - if s == "" { - continue headers - } - s = s[1:] - } - } - return false -} - -// parseExtensions parses WebSocket extensions from a header. -func parseExtensions(header http.Header) []map[string]string { - // From RFC 6455: - // - // Sec-WebSocket-Extensions = extension-list - // extension-list = 1#extension - // extension = extension-token *( ";" extension-param ) - // extension-token = registered-token - // registered-token = token - // extension-param = token [ "=" (token | quoted-string) ] - // ;When using the quoted-string syntax variant, the value - // ;after quoted-string unescaping MUST conform to the - // ;'token' ABNF. - - var result []map[string]string -headers: - for _, s := range header["Sec-Websocket-Extensions"] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - ext := map[string]string{"": t} - for { - s = skipSpace(s) - if !strings.HasPrefix(s, ";") { - break - } - var k string - k, s = nextToken(skipSpace(s[1:])) - if k == "" { - continue headers - } - s = skipSpace(s) - var v string - if strings.HasPrefix(s, "=") { - v, s = nextTokenOrQuoted(skipSpace(s[1:])) - s = skipSpace(s) - } - if s != "" && s[0] != ',' && s[0] != ';' { - continue headers - } - ext[k] = v - } - if s != "" && s[0] != ',' { - continue headers - } - result = append(result, ext) - if s == "" { - continue headers - } - s = s[1:] - } - } - return result -} - -// isValidChallengeKey checks if the argument meets RFC6455 specification. -func isValidChallengeKey(s string) bool { - // From RFC6455: - // - // A |Sec-WebSocket-Key| header field with a base64-encoded (see - // Section 4 of [RFC4648]) value that, when decoded, is 16 bytes in - // length. - - if s == "" { - return false - } - decoded, err := base64.StdEncoding.DecodeString(s) - return err == nil && len(decoded) == 16 -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE deleted file mode 100644 index 364516251..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2015, Gengo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of Gengo, Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel deleted file mode 100644 index b8fbb2b77..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "httprule", - srcs = [ - "compile.go", - "parse.go", - "types.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule", - deps = ["//utilities"], -) - -go_test( - name = "httprule_test", - size = "small", - srcs = [ - "compile_test.go", - "parse_test.go", - "types_test.go", - ], - embed = [":httprule"], - deps = [ - "//utilities", - "@org_golang_google_grpc//grpclog", - ], -) - -alias( - name = "go_default_library", - actual = ":httprule", - visibility = ["//:__subpackages__"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/compile.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/compile.go deleted file mode 100644 index 3cd937295..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/compile.go +++ /dev/null @@ -1,121 +0,0 @@ -package httprule - -import ( - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" -) - -const ( - opcodeVersion = 1 -) - -// Template is a compiled representation of path templates. -type Template struct { - // Version is the version number of the format. - Version int - // OpCodes is a sequence of operations. - OpCodes []int - // Pool is a constant pool - Pool []string - // Verb is a VERB part in the template. - Verb string - // Fields is a list of field paths bound in this template. - Fields []string - // Original template (example: /v1/a_bit_of_everything) - Template string -} - -// Compiler compiles utilities representation of path templates into marshallable operations. -// They can be unmarshalled by runtime.NewPattern. -type Compiler interface { - Compile() Template -} - -type op struct { - // code is the opcode of the operation - code utilities.OpCode - - // str is a string operand of the code. - // num is ignored if str is not empty. - str string - - // num is a numeric operand of the code. - num int -} - -func (w wildcard) compile() []op { - return []op{ - {code: utilities.OpPush}, - } -} - -func (w deepWildcard) compile() []op { - return []op{ - {code: utilities.OpPushM}, - } -} - -func (l literal) compile() []op { - return []op{ - { - code: utilities.OpLitPush, - str: string(l), - }, - } -} - -func (v variable) compile() []op { - var ops []op - for _, s := range v.segments { - ops = append(ops, s.compile()...) - } - ops = append(ops, op{ - code: utilities.OpConcatN, - num: len(v.segments), - }, op{ - code: utilities.OpCapture, - str: v.path, - }) - - return ops -} - -func (t template) Compile() Template { - var rawOps []op - for _, s := range t.segments { - rawOps = append(rawOps, s.compile()...) - } - - var ( - ops []int - pool []string - fields []string - ) - consts := make(map[string]int) - for _, op := range rawOps { - ops = append(ops, int(op.code)) - if op.str == "" { - ops = append(ops, op.num) - } else { - // eof segment literal represents the "/" path pattern - if op.str == eof { - op.str = "" - } - if _, ok := consts[op.str]; !ok { - consts[op.str] = len(pool) - pool = append(pool, op.str) - } - ops = append(ops, consts[op.str]) - } - if op.code == utilities.OpCapture { - fields = append(fields, op.str) - } - } - return Template{ - Version: opcodeVersion, - OpCodes: ops, - Pool: pool, - Verb: t.verb, - Fields: fields, - Template: t.template, - } -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/fuzz.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/fuzz.go deleted file mode 100644 index c056bd305..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/fuzz.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -package httprule - -func Fuzz(data []byte) int { - if _, err := Parse(string(data)); err != nil { - return 0 - } - return 0 -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/parse.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/parse.go deleted file mode 100644 index 65ffcf5cf..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/parse.go +++ /dev/null @@ -1,368 +0,0 @@ -package httprule - -import ( - "errors" - "fmt" - "strings" -) - -// InvalidTemplateError indicates that the path template is not valid. -type InvalidTemplateError struct { - tmpl string - msg string -} - -func (e InvalidTemplateError) Error() string { - return fmt.Sprintf("%s: %s", e.msg, e.tmpl) -} - -// Parse parses the string representation of path template -func Parse(tmpl string) (Compiler, error) { - if !strings.HasPrefix(tmpl, "/") { - return template{}, InvalidTemplateError{tmpl: tmpl, msg: "no leading /"} - } - tokens, verb := tokenize(tmpl[1:]) - - p := parser{tokens: tokens} - segs, err := p.topLevelSegments() - if err != nil { - return template{}, InvalidTemplateError{tmpl: tmpl, msg: err.Error()} - } - - return template{ - segments: segs, - verb: verb, - template: tmpl, - }, nil -} - -func tokenize(path string) (tokens []string, verb string) { - if path == "" { - return []string{eof}, "" - } - - const ( - init = iota - field - nested - ) - st := init - for path != "" { - var idx int - switch st { - case init: - idx = strings.IndexAny(path, "/{") - case field: - idx = strings.IndexAny(path, ".=}") - case nested: - idx = strings.IndexAny(path, "/}") - } - if idx < 0 { - tokens = append(tokens, path) - break - } - switch r := path[idx]; r { - case '/', '.': - case '{': - st = field - case '=': - st = nested - case '}': - st = init - } - if idx == 0 { - tokens = append(tokens, path[idx:idx+1]) - } else { - tokens = append(tokens, path[:idx], path[idx:idx+1]) - } - path = path[idx+1:] - } - - l := len(tokens) - // See - // https://github.com/grpc-ecosystem/grpc-gateway/pull/1947#issuecomment-774523693 ; - // although normal and backwards-compat logic here is to use the last index - // of a colon, if the final segment is a variable followed by a colon, the - // part following the colon must be a verb. Hence if the previous token is - // an end var marker, we switch the index we're looking for to Index instead - // of LastIndex, so that we correctly grab the remaining part of the path as - // the verb. - var penultimateTokenIsEndVar bool - switch l { - case 0, 1: - // Not enough to be variable so skip this logic and don't result in an - // invalid index - default: - penultimateTokenIsEndVar = tokens[l-2] == "}" - } - t := tokens[l-1] - var idx int - if penultimateTokenIsEndVar { - idx = strings.Index(t, ":") - } else { - idx = strings.LastIndex(t, ":") - } - if idx == 0 { - tokens, verb = tokens[:l-1], t[1:] - } else if idx > 0 { - tokens[l-1], verb = t[:idx], t[idx+1:] - } - tokens = append(tokens, eof) - return tokens, verb -} - -// parser is a parser of the template syntax defined in github.com/googleapis/googleapis/google/api/http.proto. -type parser struct { - tokens []string - accepted []string -} - -// topLevelSegments is the target of this parser. -func (p *parser) topLevelSegments() ([]segment, error) { - if _, err := p.accept(typeEOF); err == nil { - p.tokens = p.tokens[:0] - return []segment{literal(eof)}, nil - } - segs, err := p.segments() - if err != nil { - return nil, err - } - if _, err := p.accept(typeEOF); err != nil { - return nil, fmt.Errorf("unexpected token %q after segments %q", p.tokens[0], strings.Join(p.accepted, "")) - } - return segs, nil -} - -func (p *parser) segments() ([]segment, error) { - s, err := p.segment() - if err != nil { - return nil, err - } - - segs := []segment{s} - for { - if _, err := p.accept("/"); err != nil { - return segs, nil - } - s, err := p.segment() - if err != nil { - return segs, err - } - segs = append(segs, s) - } -} - -func (p *parser) segment() (segment, error) { - if _, err := p.accept("*"); err == nil { - return wildcard{}, nil - } - if _, err := p.accept("**"); err == nil { - return deepWildcard{}, nil - } - if l, err := p.literal(); err == nil { - return l, nil - } - - v, err := p.variable() - if err != nil { - return nil, fmt.Errorf("segment neither wildcards, literal or variable: %w", err) - } - return v, nil -} - -func (p *parser) literal() (segment, error) { - lit, err := p.accept(typeLiteral) - if err != nil { - return nil, err - } - return literal(lit), nil -} - -func (p *parser) variable() (segment, error) { - if _, err := p.accept("{"); err != nil { - return nil, err - } - - path, err := p.fieldPath() - if err != nil { - return nil, err - } - - var segs []segment - if _, err := p.accept("="); err == nil { - segs, err = p.segments() - if err != nil { - return nil, fmt.Errorf("invalid segment in variable %q: %w", path, err) - } - } else { - segs = []segment{wildcard{}} - } - - if _, err := p.accept("}"); err != nil { - return nil, fmt.Errorf("unterminated variable segment: %s", path) - } - return variable{ - path: path, - segments: segs, - }, nil -} - -func (p *parser) fieldPath() (string, error) { - c, err := p.accept(typeIdent) - if err != nil { - return "", err - } - components := []string{c} - for { - if _, err := p.accept("."); err != nil { - return strings.Join(components, "."), nil - } - c, err := p.accept(typeIdent) - if err != nil { - return "", fmt.Errorf("invalid field path component: %w", err) - } - components = append(components, c) - } -} - -// A termType is a type of terminal symbols. -type termType string - -// These constants define some of valid values of termType. -// They improve readability of parse functions. -// -// You can also use "/", "*", "**", "." or "=" as valid values. -const ( - typeIdent = termType("ident") - typeLiteral = termType("literal") - typeEOF = termType("$") -) - -// eof is the terminal symbol which always appears at the end of token sequence. -const eof = "\u0000" - -// accept tries to accept a token in "p". -// This function consumes a token and returns it if it matches to the specified "term". -// If it doesn't match, the function does not consume any tokens and return an error. -func (p *parser) accept(term termType) (string, error) { - t := p.tokens[0] - switch term { - case "/", "*", "**", ".", "=", "{", "}": - if t != string(term) && t != "/" { - return "", fmt.Errorf("expected %q but got %q", term, t) - } - case typeEOF: - if t != eof { - return "", fmt.Errorf("expected EOF but got %q", t) - } - case typeIdent: - if err := expectIdent(t); err != nil { - return "", err - } - case typeLiteral: - if err := expectPChars(t); err != nil { - return "", err - } - default: - return "", fmt.Errorf("unknown termType %q", term) - } - p.tokens = p.tokens[1:] - p.accepted = append(p.accepted, t) - return t, nil -} - -// expectPChars determines if "t" consists of only pchars defined in RFC3986. -// -// https://www.ietf.org/rfc/rfc3986.txt, P.49 -// -// pchar = unreserved / pct-encoded / sub-delims / ":" / "@" -// unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" -// sub-delims = "!" / "$" / "&" / "'" / "(" / ")" -// / "*" / "+" / "," / ";" / "=" -// pct-encoded = "%" HEXDIG HEXDIG -func expectPChars(t string) error { - const ( - init = iota - pct1 - pct2 - ) - st := init - for _, r := range t { - if st != init { - if !isHexDigit(r) { - return fmt.Errorf("invalid hexdigit: %c(%U)", r, r) - } - switch st { - case pct1: - st = pct2 - case pct2: - st = init - } - continue - } - - // unreserved - switch { - case 'A' <= r && r <= 'Z': - continue - case 'a' <= r && r <= 'z': - continue - case '0' <= r && r <= '9': - continue - } - switch r { - case '-', '.', '_', '~': - // unreserved - case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': - // sub-delims - case ':', '@': - // rest of pchar - case '%': - // pct-encoded - st = pct1 - default: - return fmt.Errorf("invalid character in path segment: %q(%U)", r, r) - } - } - if st != init { - return fmt.Errorf("invalid percent-encoding in %q", t) - } - return nil -} - -// expectIdent determines if "ident" is a valid identifier in .proto schema ([[:alpha:]_][[:alphanum:]_]*). -func expectIdent(ident string) error { - if ident == "" { - return errors.New("empty identifier") - } - for pos, r := range ident { - switch { - case '0' <= r && r <= '9': - if pos == 0 { - return fmt.Errorf("identifier starting with digit: %s", ident) - } - continue - case 'A' <= r && r <= 'Z': - continue - case 'a' <= r && r <= 'z': - continue - case r == '_': - continue - default: - return fmt.Errorf("invalid character %q(%U) in identifier: %s", r, r, ident) - } - } - return nil -} - -func isHexDigit(r rune) bool { - switch { - case '0' <= r && r <= '9': - return true - case 'A' <= r && r <= 'F': - return true - case 'a' <= r && r <= 'f': - return true - } - return false -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/types.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/types.go deleted file mode 100644 index 5a814a000..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/types.go +++ /dev/null @@ -1,60 +0,0 @@ -package httprule - -import ( - "fmt" - "strings" -) - -type template struct { - segments []segment - verb string - template string -} - -type segment interface { - fmt.Stringer - compile() (ops []op) -} - -type wildcard struct{} - -type deepWildcard struct{} - -type literal string - -type variable struct { - path string - segments []segment -} - -func (wildcard) String() string { - return "*" -} - -func (deepWildcard) String() string { - return "**" -} - -func (l literal) String() string { - return string(l) -} - -func (v variable) String() string { - var segs []string - for _, s := range v.segments { - segs = append(segs, s.String()) - } - return fmt.Sprintf("{%s=%s}", v.path, strings.Join(segs, "/")) -} - -func (t template) String() string { - var segs []string - for _, s := range t.segments { - segs = append(segs, s.String()) - } - str := strings.Join(segs, "/") - if t.verb != "" { - str = fmt.Sprintf("%s:%s", str, t.verb) - } - return "/" + str -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel deleted file mode 100644 index a65d88eb8..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel +++ /dev/null @@ -1,97 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "runtime", - srcs = [ - "context.go", - "convert.go", - "doc.go", - "errors.go", - "fieldmask.go", - "handler.go", - "marshal_httpbodyproto.go", - "marshal_json.go", - "marshal_jsonpb.go", - "marshal_proto.go", - "marshaler.go", - "marshaler_registry.go", - "mux.go", - "pattern.go", - "proto2_convert.go", - "query.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/runtime", - deps = [ - "//internal/httprule", - "//utilities", - "@org_golang_google_genproto_googleapis_api//httpbody", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//grpclog", - "@org_golang_google_grpc//health/grpc_health_v1", - "@org_golang_google_grpc//metadata", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//encoding/protojson", - "@org_golang_google_protobuf//proto", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//reflect/protoregistry", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/fieldmaskpb", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_google_protobuf//types/known/wrapperspb", - ], -) - -go_test( - name = "runtime_test", - size = "small", - srcs = [ - "context_test.go", - "convert_test.go", - "errors_test.go", - "fieldmask_test.go", - "handler_test.go", - "marshal_httpbodyproto_test.go", - "marshal_json_test.go", - "marshal_jsonpb_test.go", - "marshal_proto_test.go", - "marshaler_registry_test.go", - "mux_internal_test.go", - "mux_test.go", - "pattern_test.go", - "query_fuzz_test.go", - "query_test.go", - ], - embed = [":runtime"], - deps = [ - "//runtime/internal/examplepb", - "//utilities", - "@com_github_google_go_cmp//cmp", - "@com_github_google_go_cmp//cmp/cmpopts", - "@org_golang_google_genproto_googleapis_api//httpbody", - "@org_golang_google_genproto_googleapis_rpc//errdetails", - "@org_golang_google_genproto_googleapis_rpc//status", - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//health/grpc_health_v1", - "@org_golang_google_grpc//metadata", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//encoding/protojson", - "@org_golang_google_protobuf//proto", - "@org_golang_google_protobuf//testing/protocmp", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/emptypb", - "@org_golang_google_protobuf//types/known/fieldmaskpb", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_google_protobuf//types/known/wrapperspb", - ], -) - -alias( - name = "go_default_library", - actual = ":runtime", - visibility = ["//visibility:public"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go deleted file mode 100644 index 2f2b34243..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go +++ /dev/null @@ -1,417 +0,0 @@ -package runtime - -import ( - "context" - "encoding/base64" - "fmt" - "net" - "net/http" - "net/textproto" - "strconv" - "strings" - "sync" - "time" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// MetadataHeaderPrefix is the http prefix that represents custom metadata -// parameters to or from a gRPC call. -const MetadataHeaderPrefix = "Grpc-Metadata-" - -// MetadataPrefix is prepended to permanent HTTP header keys (as specified -// by the IANA) when added to the gRPC context. -const MetadataPrefix = "grpcgateway-" - -// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to -// HTTP headers in a response handled by grpc-gateway -const MetadataTrailerPrefix = "Grpc-Trailer-" - -const metadataGrpcTimeout = "Grpc-Timeout" -const metadataHeaderBinarySuffix = "-Bin" - -const xForwardedFor = "X-Forwarded-For" -const xForwardedHost = "X-Forwarded-Host" - -// DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound -// header isn't present. If the value is 0 the sent `context` will not have a timeout. -var DefaultContextTimeout = 0 * time.Second - -// malformedHTTPHeaders lists the headers that the gRPC server may reject outright as malformed. -// See https://github.com/grpc/grpc-go/pull/4803#issuecomment-986093310 for more context. -var malformedHTTPHeaders = map[string]struct{}{ - "connection": {}, -} - -type ( - rpcMethodKey struct{} - httpPathPatternKey struct{} - httpPatternKey struct{} - - AnnotateContextOption func(ctx context.Context) context.Context -) - -func WithHTTPPathPattern(pattern string) AnnotateContextOption { - return func(ctx context.Context) context.Context { - return withHTTPPathPattern(ctx, pattern) - } -} - -func decodeBinHeader(v string) ([]byte, error) { - if len(v)%4 == 0 { - // Input was padded, or padding was not necessary. - return base64.StdEncoding.DecodeString(v) - } - return base64.RawStdEncoding.DecodeString(v) -} - -/* -AnnotateContext adds context information such as metadata from the request. - -At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For", -except that the forwarded destination is not another HTTP service but rather -a gRPC service. -*/ -func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, error) { - ctx, md, err := annotateContext(ctx, mux, req, rpcMethodName, options...) - if err != nil { - return nil, err - } - if md == nil { - return ctx, nil - } - - return metadata.NewOutgoingContext(ctx, md), nil -} - -// AnnotateIncomingContext adds context information such as metadata from the request. -// Attach metadata as incoming context. -func AnnotateIncomingContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, error) { - ctx, md, err := annotateContext(ctx, mux, req, rpcMethodName, options...) - if err != nil { - return nil, err - } - if md == nil { - return ctx, nil - } - - return metadata.NewIncomingContext(ctx, md), nil -} - -func isValidGRPCMetadataKey(key string) bool { - // Must be a valid gRPC "Header-Name" as defined here: - // https://github.com/grpc/grpc/blob/4b05dc88b724214d0c725c8e7442cbc7a61b1374/doc/PROTOCOL-HTTP2.md - // This means 0-9 a-z _ - . - // Only lowercase letters are valid in the wire protocol, but the client library will normalize - // uppercase ASCII to lowercase, so uppercase ASCII is also acceptable. - bytes := []byte(key) // gRPC validates strings on the byte level, not Unicode. - for _, ch := range bytes { - validLowercaseLetter := ch >= 'a' && ch <= 'z' - validUppercaseLetter := ch >= 'A' && ch <= 'Z' - validDigit := ch >= '0' && ch <= '9' - validOther := ch == '.' || ch == '-' || ch == '_' - if !validLowercaseLetter && !validUppercaseLetter && !validDigit && !validOther { - return false - } - } - return true -} - -func isValidGRPCMetadataTextValue(textValue string) bool { - // Must be a valid gRPC "ASCII-Value" as defined here: - // https://github.com/grpc/grpc/blob/4b05dc88b724214d0c725c8e7442cbc7a61b1374/doc/PROTOCOL-HTTP2.md - // This means printable ASCII (including/plus spaces); 0x20 to 0x7E inclusive. - bytes := []byte(textValue) // gRPC validates strings on the byte level, not Unicode. - for _, ch := range bytes { - if ch < 0x20 || ch > 0x7E { - return false - } - } - return true -} - -func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, metadata.MD, error) { - ctx = withRPCMethod(ctx, rpcMethodName) - for _, o := range options { - ctx = o(ctx) - } - timeout := DefaultContextTimeout - if tm := req.Header.Get(metadataGrpcTimeout); tm != "" { - var err error - timeout, err = timeoutDecode(tm) - if err != nil { - return nil, nil, status.Errorf(codes.InvalidArgument, "invalid grpc-timeout: %s", tm) - } - } - var pairs []string - for key, vals := range req.Header { - key = textproto.CanonicalMIMEHeaderKey(key) - switch key { - case xForwardedFor, xForwardedHost: - // Handled separately below - continue - } - - for _, val := range vals { - // For backwards-compatibility, pass through 'authorization' header with no prefix. - if key == "Authorization" { - pairs = append(pairs, "authorization", val) - } - if h, ok := mux.incomingHeaderMatcher(key); ok { - if !isValidGRPCMetadataKey(h) { - grpclog.Errorf("HTTP header name %q is not valid as gRPC metadata key; skipping", h) - continue - } - // Handles "-bin" metadata in grpc, since grpc will do another base64 - // encode before sending to server, we need to decode it first. - if strings.HasSuffix(key, metadataHeaderBinarySuffix) { - b, err := decodeBinHeader(val) - if err != nil { - return nil, nil, status.Errorf(codes.InvalidArgument, "invalid binary header %s: %s", key, err) - } - - val = string(b) - } else if !isValidGRPCMetadataTextValue(val) { - grpclog.Errorf("Value of HTTP header %q contains non-ASCII value (not valid as gRPC metadata): skipping", h) - continue - } - pairs = append(pairs, h, val) - } - } - } - if host := req.Header.Get(xForwardedHost); host != "" { - pairs = append(pairs, strings.ToLower(xForwardedHost), host) - } else if req.Host != "" { - pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host) - } - - xff := req.Header.Values(xForwardedFor) - if addr := req.RemoteAddr; addr != "" { - if remoteIP, _, err := net.SplitHostPort(addr); err == nil { - xff = append(xff, remoteIP) - } - } - if len(xff) > 0 { - pairs = append(pairs, strings.ToLower(xForwardedFor), strings.Join(xff, ", ")) - } - - if timeout != 0 { - ctx, _ = context.WithTimeout(ctx, timeout) - } - if len(pairs) == 0 { - return ctx, nil, nil - } - md := metadata.Pairs(pairs...) - for _, mda := range mux.metadataAnnotators { - md = metadata.Join(md, mda(ctx, req)) - } - return ctx, md, nil -} - -// ServerMetadata consists of metadata sent from gRPC server. -type ServerMetadata struct { - HeaderMD metadata.MD - TrailerMD metadata.MD -} - -type serverMetadataKey struct{} - -// NewServerMetadataContext creates a new context with ServerMetadata -func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context { - if ctx == nil { - ctx = context.Background() - } - return context.WithValue(ctx, serverMetadataKey{}, md) -} - -// ServerMetadataFromContext returns the ServerMetadata in ctx -func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) { - if ctx == nil { - return md, false - } - md, ok = ctx.Value(serverMetadataKey{}).(ServerMetadata) - return -} - -// ServerTransportStream implements grpc.ServerTransportStream. -// It should only be used by the generated files to support grpc.SendHeader -// outside of gRPC server use. -type ServerTransportStream struct { - mu sync.Mutex - header metadata.MD - trailer metadata.MD -} - -// Method returns the method for the stream. -func (s *ServerTransportStream) Method() string { - return "" -} - -// Header returns the header metadata of the stream. -func (s *ServerTransportStream) Header() metadata.MD { - s.mu.Lock() - defer s.mu.Unlock() - return s.header.Copy() -} - -// SetHeader sets the header metadata. -func (s *ServerTransportStream) SetHeader(md metadata.MD) error { - if md.Len() == 0 { - return nil - } - - s.mu.Lock() - s.header = metadata.Join(s.header, md) - s.mu.Unlock() - return nil -} - -// SendHeader sets the header metadata. -func (s *ServerTransportStream) SendHeader(md metadata.MD) error { - return s.SetHeader(md) -} - -// Trailer returns the cached trailer metadata. -func (s *ServerTransportStream) Trailer() metadata.MD { - s.mu.Lock() - defer s.mu.Unlock() - return s.trailer.Copy() -} - -// SetTrailer sets the trailer metadata. -func (s *ServerTransportStream) SetTrailer(md metadata.MD) error { - if md.Len() == 0 { - return nil - } - - s.mu.Lock() - s.trailer = metadata.Join(s.trailer, md) - s.mu.Unlock() - return nil -} - -func timeoutDecode(s string) (time.Duration, error) { - size := len(s) - if size < 2 { - return 0, fmt.Errorf("timeout string is too short: %q", s) - } - d, ok := timeoutUnitToDuration(s[size-1]) - if !ok { - return 0, fmt.Errorf("timeout unit is not recognized: %q", s) - } - t, err := strconv.ParseInt(s[:size-1], 10, 64) - if err != nil { - return 0, err - } - return d * time.Duration(t), nil -} - -func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) { - switch u { - case 'H': - return time.Hour, true - case 'M': - return time.Minute, true - case 'S': - return time.Second, true - case 'm': - return time.Millisecond, true - case 'u': - return time.Microsecond, true - case 'n': - return time.Nanosecond, true - default: - return - } -} - -// isPermanentHTTPHeader checks whether hdr belongs to the list of -// permanent request headers maintained by IANA. -// http://www.iana.org/assignments/message-headers/message-headers.xml -func isPermanentHTTPHeader(hdr string) bool { - switch hdr { - case - "Accept", - "Accept-Charset", - "Accept-Language", - "Accept-Ranges", - "Authorization", - "Cache-Control", - "Content-Type", - "Cookie", - "Date", - "Expect", - "From", - "Host", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Schedule-Tag-Match", - "If-Unmodified-Since", - "Max-Forwards", - "Origin", - "Pragma", - "Referer", - "User-Agent", - "Via", - "Warning": - return true - } - return false -} - -// isMalformedHTTPHeader checks whether header belongs to the list of -// "malformed headers" and would be rejected by the gRPC server. -func isMalformedHTTPHeader(header string) bool { - _, isMalformed := malformedHTTPHeaders[strings.ToLower(header)] - return isMalformed -} - -// RPCMethod returns the method string for the server context. The returned -// string is in the format of "/package.service/method". -func RPCMethod(ctx context.Context) (string, bool) { - m := ctx.Value(rpcMethodKey{}) - if m == nil { - return "", false - } - ms, ok := m.(string) - if !ok { - return "", false - } - return ms, true -} - -func withRPCMethod(ctx context.Context, rpcMethodName string) context.Context { - return context.WithValue(ctx, rpcMethodKey{}, rpcMethodName) -} - -// HTTPPathPattern returns the HTTP path pattern string relating to the HTTP handler, if one exists. -// The format of the returned string is defined by the google.api.http path template type. -func HTTPPathPattern(ctx context.Context) (string, bool) { - m := ctx.Value(httpPathPatternKey{}) - if m == nil { - return "", false - } - ms, ok := m.(string) - if !ok { - return "", false - } - return ms, true -} - -func withHTTPPathPattern(ctx context.Context, httpPathPattern string) context.Context { - return context.WithValue(ctx, httpPathPatternKey{}, httpPathPattern) -} - -// HTTPPattern returns the HTTP path pattern struct relating to the HTTP handler, if one exists. -func HTTPPattern(ctx context.Context) (Pattern, bool) { - v, ok := ctx.Value(httpPatternKey{}).(Pattern) - return v, ok -} - -func withHTTPPattern(ctx context.Context, httpPattern Pattern) context.Context { - return context.WithValue(ctx, httpPatternKey{}, httpPattern) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go deleted file mode 100644 index 2e50082ad..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go +++ /dev/null @@ -1,318 +0,0 @@ -package runtime - -import ( - "encoding/base64" - "fmt" - "strconv" - "strings" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - "google.golang.org/protobuf/types/known/wrapperspb" -) - -// String just returns the given string. -// It is just for compatibility to other types. -func String(val string) (string, error) { - return val, nil -} - -// StringSlice converts 'val' where individual strings are separated by -// 'sep' into a string slice. -func StringSlice(val, sep string) ([]string, error) { - return strings.Split(val, sep), nil -} - -// Bool converts the given string representation of a boolean value into bool. -func Bool(val string) (bool, error) { - return strconv.ParseBool(val) -} - -// BoolSlice converts 'val' where individual booleans are separated by -// 'sep' into a bool slice. -func BoolSlice(val, sep string) ([]bool, error) { - s := strings.Split(val, sep) - values := make([]bool, len(s)) - for i, v := range s { - value, err := Bool(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Float64 converts the given string representation into representation of a floating point number into float64. -func Float64(val string) (float64, error) { - return strconv.ParseFloat(val, 64) -} - -// Float64Slice converts 'val' where individual floating point numbers are separated by -// 'sep' into a float64 slice. -func Float64Slice(val, sep string) ([]float64, error) { - s := strings.Split(val, sep) - values := make([]float64, len(s)) - for i, v := range s { - value, err := Float64(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Float32 converts the given string representation of a floating point number into float32. -func Float32(val string) (float32, error) { - f, err := strconv.ParseFloat(val, 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -// Float32Slice converts 'val' where individual floating point numbers are separated by -// 'sep' into a float32 slice. -func Float32Slice(val, sep string) ([]float32, error) { - s := strings.Split(val, sep) - values := make([]float32, len(s)) - for i, v := range s { - value, err := Float32(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Int64 converts the given string representation of an integer into int64. -func Int64(val string) (int64, error) { - return strconv.ParseInt(val, 0, 64) -} - -// Int64Slice converts 'val' where individual integers are separated by -// 'sep' into an int64 slice. -func Int64Slice(val, sep string) ([]int64, error) { - s := strings.Split(val, sep) - values := make([]int64, len(s)) - for i, v := range s { - value, err := Int64(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Int32 converts the given string representation of an integer into int32. -func Int32(val string) (int32, error) { - i, err := strconv.ParseInt(val, 0, 32) - if err != nil { - return 0, err - } - return int32(i), nil -} - -// Int32Slice converts 'val' where individual integers are separated by -// 'sep' into an int32 slice. -func Int32Slice(val, sep string) ([]int32, error) { - s := strings.Split(val, sep) - values := make([]int32, len(s)) - for i, v := range s { - value, err := Int32(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Uint64 converts the given string representation of an integer into uint64. -func Uint64(val string) (uint64, error) { - return strconv.ParseUint(val, 0, 64) -} - -// Uint64Slice converts 'val' where individual integers are separated by -// 'sep' into a uint64 slice. -func Uint64Slice(val, sep string) ([]uint64, error) { - s := strings.Split(val, sep) - values := make([]uint64, len(s)) - for i, v := range s { - value, err := Uint64(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Uint32 converts the given string representation of an integer into uint32. -func Uint32(val string) (uint32, error) { - i, err := strconv.ParseUint(val, 0, 32) - if err != nil { - return 0, err - } - return uint32(i), nil -} - -// Uint32Slice converts 'val' where individual integers are separated by -// 'sep' into a uint32 slice. -func Uint32Slice(val, sep string) ([]uint32, error) { - s := strings.Split(val, sep) - values := make([]uint32, len(s)) - for i, v := range s { - value, err := Uint32(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Bytes converts the given string representation of a byte sequence into a slice of bytes -// A bytes sequence is encoded in URL-safe base64 without padding -func Bytes(val string) ([]byte, error) { - b, err := base64.StdEncoding.DecodeString(val) - if err != nil { - b, err = base64.URLEncoding.DecodeString(val) - if err != nil { - return nil, err - } - } - return b, nil -} - -// BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe -// base64 without padding, are separated by 'sep' into a slice of byte slices. -func BytesSlice(val, sep string) ([][]byte, error) { - s := strings.Split(val, sep) - values := make([][]byte, len(s)) - for i, v := range s { - value, err := Bytes(v) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp. -func Timestamp(val string) (*timestamppb.Timestamp, error) { - var r timestamppb.Timestamp - val = strconv.Quote(strings.Trim(val, `"`)) - unmarshaler := &protojson.UnmarshalOptions{} - if err := unmarshaler.Unmarshal([]byte(val), &r); err != nil { - return nil, err - } - return &r, nil -} - -// Duration converts the given string into a timestamp.Duration. -func Duration(val string) (*durationpb.Duration, error) { - var r durationpb.Duration - val = strconv.Quote(strings.Trim(val, `"`)) - unmarshaler := &protojson.UnmarshalOptions{} - if err := unmarshaler.Unmarshal([]byte(val), &r); err != nil { - return nil, err - } - return &r, nil -} - -// Enum converts the given string into an int32 that should be type casted into the -// correct enum proto type. -func Enum(val string, enumValMap map[string]int32) (int32, error) { - e, ok := enumValMap[val] - if ok { - return e, nil - } - - i, err := Int32(val) - if err != nil { - return 0, fmt.Errorf("%s is not valid", val) - } - for _, v := range enumValMap { - if v == i { - return i, nil - } - } - return 0, fmt.Errorf("%s is not valid", val) -} - -// EnumSlice converts 'val' where individual enums are separated by 'sep' -// into a int32 slice. Each individual int32 should be type casted into the -// correct enum proto type. -func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error) { - s := strings.Split(val, sep) - values := make([]int32, len(s)) - for i, v := range s { - value, err := Enum(v, enumValMap) - if err != nil { - return nil, err - } - values[i] = value - } - return values, nil -} - -// Support for google.protobuf.wrappers on top of primitive types - -// StringValue well-known type support as wrapper around string type -func StringValue(val string) (*wrapperspb.StringValue, error) { - return wrapperspb.String(val), nil -} - -// FloatValue well-known type support as wrapper around float32 type -func FloatValue(val string) (*wrapperspb.FloatValue, error) { - parsedVal, err := Float32(val) - return wrapperspb.Float(parsedVal), err -} - -// DoubleValue well-known type support as wrapper around float64 type -func DoubleValue(val string) (*wrapperspb.DoubleValue, error) { - parsedVal, err := Float64(val) - return wrapperspb.Double(parsedVal), err -} - -// BoolValue well-known type support as wrapper around bool type -func BoolValue(val string) (*wrapperspb.BoolValue, error) { - parsedVal, err := Bool(val) - return wrapperspb.Bool(parsedVal), err -} - -// Int32Value well-known type support as wrapper around int32 type -func Int32Value(val string) (*wrapperspb.Int32Value, error) { - parsedVal, err := Int32(val) - return wrapperspb.Int32(parsedVal), err -} - -// UInt32Value well-known type support as wrapper around uint32 type -func UInt32Value(val string) (*wrapperspb.UInt32Value, error) { - parsedVal, err := Uint32(val) - return wrapperspb.UInt32(parsedVal), err -} - -// Int64Value well-known type support as wrapper around int64 type -func Int64Value(val string) (*wrapperspb.Int64Value, error) { - parsedVal, err := Int64(val) - return wrapperspb.Int64(parsedVal), err -} - -// UInt64Value well-known type support as wrapper around uint64 type -func UInt64Value(val string) (*wrapperspb.UInt64Value, error) { - parsedVal, err := Uint64(val) - return wrapperspb.UInt64(parsedVal), err -} - -// BytesValue well-known type support as wrapper around bytes[] type -func BytesValue(val string) (*wrapperspb.BytesValue, error) { - parsedVal, err := Bytes(val) - return wrapperspb.Bytes(parsedVal), err -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/doc.go deleted file mode 100644 index b6e5ddf7a..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* -Package runtime contains runtime helper functions used by -servers which protoc-gen-grpc-gateway generates. -*/ -package runtime diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go deleted file mode 100644 index bbe7decf0..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go +++ /dev/null @@ -1,204 +0,0 @@ -package runtime - -import ( - "context" - "errors" - "io" - "net/http" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// ErrorHandlerFunc is the signature used to configure error handling. -type ErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, error) - -// StreamErrorHandlerFunc is the signature used to configure stream error handling. -type StreamErrorHandlerFunc func(context.Context, error) *status.Status - -// RoutingErrorHandlerFunc is the signature used to configure error handling for routing errors. -type RoutingErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, int) - -// HTTPStatusError is the error to use when needing to provide a different HTTP status code for an error -// passed to the DefaultRoutingErrorHandler. -type HTTPStatusError struct { - HTTPStatus int - Err error -} - -func (e *HTTPStatusError) Error() string { - return e.Err.Error() -} - -// HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. -// See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto -func HTTPStatusFromCode(code codes.Code) int { - switch code { - case codes.OK: - return http.StatusOK - case codes.Canceled: - return 499 - case codes.Unknown: - return http.StatusInternalServerError - case codes.InvalidArgument: - return http.StatusBadRequest - case codes.DeadlineExceeded: - return http.StatusGatewayTimeout - case codes.NotFound: - return http.StatusNotFound - case codes.AlreadyExists: - return http.StatusConflict - case codes.PermissionDenied: - return http.StatusForbidden - case codes.Unauthenticated: - return http.StatusUnauthorized - case codes.ResourceExhausted: - return http.StatusTooManyRequests - case codes.FailedPrecondition: - // Note, this deliberately doesn't translate to the similarly named '412 Precondition Failed' HTTP response status. - return http.StatusBadRequest - case codes.Aborted: - return http.StatusConflict - case codes.OutOfRange: - return http.StatusBadRequest - case codes.Unimplemented: - return http.StatusNotImplemented - case codes.Internal: - return http.StatusInternalServerError - case codes.Unavailable: - return http.StatusServiceUnavailable - case codes.DataLoss: - return http.StatusInternalServerError - default: - grpclog.Warningf("Unknown gRPC error code: %v", code) - return http.StatusInternalServerError - } -} - -// HTTPError uses the mux-configured error handler. -func HTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { - mux.errorHandler(ctx, mux, marshaler, w, r, err) -} - -// HTTPStreamError uses the mux-configured stream error handler to notify error to the client without closing the connection. -func HTTPStreamError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { - st := mux.streamErrorHandler(ctx, err) - msg := errorChunk(st) - buf, err := marshaler.Marshal(msg) - if err != nil { - grpclog.Errorf("Failed to marshal an error: %v", err) - return - } - if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to notify error to client: %v", err) - return - } -} - -// DefaultHTTPErrorHandler is the default error handler. -// If "err" is a gRPC Status, the function replies with the status code mapped by HTTPStatusFromCode. -// If "err" is a HTTPStatusError, the function replies with the status code provide by that struct. This is -// intended to allow passing through of specific statuses via the function set via WithRoutingErrorHandler -// for the ServeMux constructor to handle edge cases which the standard mappings in HTTPStatusFromCode -// are insufficient for. -// If otherwise, it replies with http.StatusInternalServerError. -// -// The response body written by this function is a Status message marshaled by the Marshaler. -func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { - // return Internal when Marshal failed - const fallback = `{"code": 13, "message": "failed to marshal error message"}` - const fallbackRewriter = `{"code": 13, "message": "failed to rewrite error message"}` - - var customStatus *HTTPStatusError - if errors.As(err, &customStatus) { - err = customStatus.Err - } - - s := status.Convert(err) - - w.Header().Del("Trailer") - w.Header().Del("Transfer-Encoding") - - respRw, err := mux.forwardResponseRewriter(ctx, s.Proto()) - if err != nil { - grpclog.Errorf("Failed to rewrite error message %q: %v", s, err) - w.WriteHeader(http.StatusInternalServerError) - if _, err := io.WriteString(w, fallbackRewriter); err != nil { - grpclog.Errorf("Failed to write response: %v", err) - } - return - } - - contentType := marshaler.ContentType(respRw) - w.Header().Set("Content-Type", contentType) - - if s.Code() == codes.Unauthenticated { - w.Header().Set("WWW-Authenticate", s.Message()) - } - - buf, merr := marshaler.Marshal(respRw) - if merr != nil { - grpclog.Errorf("Failed to marshal error message %q: %v", s, merr) - w.WriteHeader(http.StatusInternalServerError) - if _, err := io.WriteString(w, fallback); err != nil { - grpclog.Errorf("Failed to write response: %v", err) - } - return - } - - md, ok := ServerMetadataFromContext(ctx) - if ok { - handleForwardResponseServerMetadata(w, mux, md) - - // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 - // Unless the request includes a TE header field indicating "trailers" - // is acceptable, as described in Section 4.3, a server SHOULD NOT - // generate trailer fields that it believes are necessary for the user - // agent to receive. - doForwardTrailers := requestAcceptsTrailers(r) - - if doForwardTrailers { - handleForwardResponseTrailerHeader(w, mux, md) - w.Header().Set("Transfer-Encoding", "chunked") - } - } - - st := HTTPStatusFromCode(s.Code()) - if customStatus != nil { - st = customStatus.HTTPStatus - } - - w.WriteHeader(st) - if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to write response: %v", err) - } - - if ok && requestAcceptsTrailers(r) { - handleForwardResponseTrailer(w, mux, md) - } -} - -func DefaultStreamErrorHandler(_ context.Context, err error) *status.Status { - return status.Convert(err) -} - -// DefaultRoutingErrorHandler is our default handler for routing errors. -// By default http error codes mapped on the following error codes: -// -// NotFound -> grpc.NotFound -// StatusBadRequest -> grpc.InvalidArgument -// MethodNotAllowed -> grpc.Unimplemented -// Other -> grpc.Internal, method is not expecting to be called for anything else -func DefaultRoutingErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, httpStatus int) { - sterr := status.Error(codes.Internal, "Unexpected routing error") - switch httpStatus { - case http.StatusBadRequest: - sterr = status.Error(codes.InvalidArgument, http.StatusText(httpStatus)) - case http.StatusMethodNotAllowed: - sterr = status.Error(codes.Unimplemented, http.StatusText(httpStatus)) - case http.StatusNotFound: - sterr = status.Error(codes.NotFound, http.StatusText(httpStatus)) - } - mux.errorHandler(ctx, mux, marshaler, w, r, sterr) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go deleted file mode 100644 index 2fcd7af3c..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go +++ /dev/null @@ -1,168 +0,0 @@ -package runtime - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "sort" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - field_mask "google.golang.org/protobuf/types/known/fieldmaskpb" -) - -func getFieldByName(fields protoreflect.FieldDescriptors, name string) protoreflect.FieldDescriptor { - fd := fields.ByName(protoreflect.Name(name)) - if fd != nil { - return fd - } - - return fields.ByJSONName(name) -} - -// FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body. -func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.FieldMask, error) { - fm := &field_mask.FieldMask{} - var root interface{} - - if err := json.NewDecoder(r).Decode(&root); err != nil { - if errors.Is(err, io.EOF) { - return fm, nil - } - return nil, err - } - - queue := []fieldMaskPathItem{{node: root, msg: msg.ProtoReflect()}} - for len(queue) > 0 { - // dequeue an item - item := queue[0] - queue = queue[1:] - - m, ok := item.node.(map[string]interface{}) - switch { - case ok && len(m) > 0: - // if the item is an object, then enqueue all of its children - for k, v := range m { - if item.msg == nil { - return nil, errors.New("JSON structure did not match request type") - } - - fd := getFieldByName(item.msg.Descriptor().Fields(), k) - if fd == nil { - return nil, fmt.Errorf("could not find field %q in %q", k, item.msg.Descriptor().FullName()) - } - - if isDynamicProtoMessage(fd.Message()) { - for _, p := range buildPathsBlindly(string(fd.FullName().Name()), v) { - newPath := p - if item.path != "" { - newPath = item.path + "." + newPath - } - queue = append(queue, fieldMaskPathItem{path: newPath}) - } - continue - } - - if isProtobufAnyMessage(fd.Message()) && !fd.IsList() { - _, hasTypeField := v.(map[string]interface{})["@type"] - if hasTypeField { - queue = append(queue, fieldMaskPathItem{path: k}) - continue - } else { - return nil, fmt.Errorf("could not find field @type in %q in message %q", k, item.msg.Descriptor().FullName()) - } - - } - - child := fieldMaskPathItem{ - node: v, - } - if item.path == "" { - child.path = string(fd.FullName().Name()) - } else { - child.path = item.path + "." + string(fd.FullName().Name()) - } - - switch { - case fd.IsList(), fd.IsMap(): - // As per: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto#L85-L86 - // Do not recurse into repeated fields. The repeated field goes on the end of the path and we stop. - fm.Paths = append(fm.Paths, child.path) - case fd.Message() != nil: - child.msg = item.msg.Get(fd).Message() - fallthrough - default: - queue = append(queue, child) - } - } - case ok && len(m) == 0: - fallthrough - case len(item.path) > 0: - // otherwise, it's a leaf node so print its path - fm.Paths = append(fm.Paths, item.path) - } - } - - // Sort for deterministic output in the presence - // of repeated fields. - sort.Strings(fm.Paths) - - return fm, nil -} - -func isProtobufAnyMessage(md protoreflect.MessageDescriptor) bool { - return md != nil && (md.FullName() == "google.protobuf.Any") -} - -func isDynamicProtoMessage(md protoreflect.MessageDescriptor) bool { - return md != nil && (md.FullName() == "google.protobuf.Struct" || md.FullName() == "google.protobuf.Value") -} - -// buildPathsBlindly does not attempt to match proto field names to the -// json value keys. Instead it relies completely on the structure of -// the unmarshalled json contained within in. -// Returns a slice containing all subpaths with the root at the -// passed in name and json value. -func buildPathsBlindly(name string, in interface{}) []string { - m, ok := in.(map[string]interface{}) - if !ok { - return []string{name} - } - - var paths []string - queue := []fieldMaskPathItem{{path: name, node: m}} - for len(queue) > 0 { - cur := queue[0] - queue = queue[1:] - - m, ok := cur.node.(map[string]interface{}) - if !ok { - // This should never happen since we should always check that we only add - // nodes of type map[string]interface{} to the queue. - continue - } - for k, v := range m { - if mi, ok := v.(map[string]interface{}); ok { - queue = append(queue, fieldMaskPathItem{path: cur.path + "." + k, node: mi}) - } else { - // This is not a struct, so there are no more levels to descend. - curPath := cur.path + "." + k - paths = append(paths, curPath) - } - } - } - return paths -} - -// fieldMaskPathItem stores an in-progress deconstruction of a path for a fieldmask -type fieldMaskPathItem struct { - // the list of prior fields leading up to node connected by dots - path string - - // a generic decoded json object the current item to inspect for further path extraction - node interface{} - - // parent message - msg protoreflect.Message -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go deleted file mode 100644 index 2f0b9e9e0..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ /dev/null @@ -1,251 +0,0 @@ -package runtime - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/textproto" - "strconv" - "strings" - - "google.golang.org/genproto/googleapis/api/httpbody" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// ForwardResponseStream forwards the stream from gRPC server to REST client. -func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { - rc := http.NewResponseController(w) - md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Error("Failed to extract ServerMetadata from context") - http.Error(w, "unexpected error", http.StatusInternalServerError) - return - } - handleForwardResponseServerMetadata(w, mux, md) - - w.Header().Set("Transfer-Encoding", "chunked") - if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil { - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - - var delimiter []byte - if d, ok := marshaler.(Delimited); ok { - delimiter = d.Delimiter() - } else { - delimiter = []byte("\n") - } - - var wroteHeader bool - for { - resp, err := recv() - if errors.Is(err, io.EOF) { - return - } - if err != nil { - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err, delimiter) - return - } - if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err, delimiter) - return - } - - respRw, err := mux.forwardResponseRewriter(ctx, resp) - if err != nil { - grpclog.Errorf("Rewrite error: %v", err) - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err, delimiter) - return - } - - if !wroteHeader { - var contentType string - if sct, ok := marshaler.(StreamContentType); ok { - contentType = sct.StreamContentType(respRw) - } else { - contentType = marshaler.ContentType(respRw) - } - w.Header().Set("Content-Type", contentType) - } - - var buf []byte - httpBody, isHTTPBody := respRw.(*httpbody.HttpBody) - switch { - case respRw == nil: - buf, err = marshaler.Marshal(errorChunk(status.New(codes.Internal, "empty response"))) - case isHTTPBody: - buf = httpBody.GetData() - default: - result := map[string]interface{}{"result": respRw} - if rb, ok := respRw.(responseBody); ok { - result["result"] = rb.XXX_ResponseBody() - } - - buf, err = marshaler.Marshal(result) - } - - if err != nil { - grpclog.Errorf("Failed to marshal response chunk: %v", err) - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err, delimiter) - return - } - if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to send response chunk: %v", err) - return - } - wroteHeader = true - if _, err := w.Write(delimiter); err != nil { - grpclog.Errorf("Failed to send delimiter chunk: %v", err) - return - } - err = rc.Flush() - if err != nil { - if errors.Is(err, http.ErrNotSupported) { - grpclog.Errorf("Flush not supported in %T", w) - http.Error(w, "unexpected type of web server", http.StatusInternalServerError) - return - } - grpclog.Errorf("Failed to flush response to client: %v", err) - return - } - } -} - -func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { - for k, vs := range md.HeaderMD { - if h, ok := mux.outgoingHeaderMatcher(k); ok { - for _, v := range vs { - w.Header().Add(h, v) - } - } - } -} - -func handleForwardResponseTrailerHeader(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { - for k := range md.TrailerMD { - if h, ok := mux.outgoingTrailerMatcher(k); ok { - w.Header().Add("Trailer", textproto.CanonicalMIMEHeaderKey(h)) - } - } -} - -func handleForwardResponseTrailer(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { - for k, vs := range md.TrailerMD { - if h, ok := mux.outgoingTrailerMatcher(k); ok { - for _, v := range vs { - w.Header().Add(h, v) - } - } - } -} - -// responseBody interface contains method for getting field for marshaling to the response body -// this method is generated for response struct from the value of `response_body` in the `google.api.HttpRule` -type responseBody interface { - XXX_ResponseBody() interface{} -} - -// ForwardResponseMessage forwards the message "resp" from gRPC server to REST client. -func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { - md, ok := ServerMetadataFromContext(ctx) - if ok { - handleForwardResponseServerMetadata(w, mux, md) - } - - // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 - // Unless the request includes a TE header field indicating "trailers" - // is acceptable, as described in Section 4.3, a server SHOULD NOT - // generate trailer fields that it believes are necessary for the user - // agent to receive. - doForwardTrailers := requestAcceptsTrailers(req) - - if ok && doForwardTrailers { - handleForwardResponseTrailerHeader(w, mux, md) - w.Header().Set("Transfer-Encoding", "chunked") - } - - contentType := marshaler.ContentType(resp) - w.Header().Set("Content-Type", contentType) - - if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - respRw, err := mux.forwardResponseRewriter(ctx, resp) - if err != nil { - grpclog.Errorf("Rewrite error: %v", err) - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - var buf []byte - if rb, ok := respRw.(responseBody); ok { - buf, err = marshaler.Marshal(rb.XXX_ResponseBody()) - } else { - buf, err = marshaler.Marshal(respRw) - } - if err != nil { - grpclog.Errorf("Marshal error: %v", err) - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - - if !doForwardTrailers && mux.writeContentLength { - w.Header().Set("Content-Length", strconv.Itoa(len(buf))) - } - - if _, err = w.Write(buf); err != nil && !errors.Is(err, http.ErrBodyNotAllowed) { - grpclog.Errorf("Failed to write response: %v", err) - } - - if ok && doForwardTrailers { - handleForwardResponseTrailer(w, mux, md) - } -} - -func requestAcceptsTrailers(req *http.Request) bool { - te := req.Header.Get("TE") - return strings.Contains(strings.ToLower(te), "trailers") -} - -func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, resp proto.Message, opts []func(context.Context, http.ResponseWriter, proto.Message) error) error { - if len(opts) == 0 { - return nil - } - for _, opt := range opts { - if err := opt(ctx, w, resp); err != nil { - return fmt.Errorf("error handling ForwardResponseOptions: %w", err) - } - } - return nil -} - -func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, marshaler Marshaler, w http.ResponseWriter, req *http.Request, mux *ServeMux, err error, delimiter []byte) { - st := mux.streamErrorHandler(ctx, err) - msg := errorChunk(st) - if !wroteHeader { - w.Header().Set("Content-Type", marshaler.ContentType(msg)) - w.WriteHeader(HTTPStatusFromCode(st.Code())) - } - buf, err := marshaler.Marshal(msg) - if err != nil { - grpclog.Errorf("Failed to marshal an error: %v", err) - return - } - if _, err := w.Write(buf); err != nil { - grpclog.Errorf("Failed to notify error to client: %v", err) - return - } - if _, err := w.Write(delimiter); err != nil { - grpclog.Errorf("Failed to send delimiter chunk: %v", err) - return - } -} - -func errorChunk(st *status.Status) map[string]proto.Message { - return map[string]proto.Message{"error": st.Proto()} -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go deleted file mode 100644 index 6de2e220c..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go +++ /dev/null @@ -1,32 +0,0 @@ -package runtime - -import ( - "google.golang.org/genproto/googleapis/api/httpbody" -) - -// HTTPBodyMarshaler is a Marshaler which supports marshaling of a -// google.api.HttpBody message as the full response body if it is -// the actual message used as the response. If not, then this will -// simply fallback to the Marshaler specified as its default Marshaler. -type HTTPBodyMarshaler struct { - Marshaler -} - -// ContentType returns its specified content type in case v is a -// google.api.HttpBody message, otherwise it will fall back to the default Marshalers -// content type. -func (h *HTTPBodyMarshaler) ContentType(v interface{}) string { - if httpBody, ok := v.(*httpbody.HttpBody); ok { - return httpBody.GetContentType() - } - return h.Marshaler.ContentType(v) -} - -// Marshal marshals "v" by returning the body bytes if v is a -// google.api.HttpBody message, otherwise it falls back to the default Marshaler. -func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) { - if httpBody, ok := v.(*httpbody.HttpBody); ok { - return httpBody.GetData(), nil - } - return h.Marshaler.Marshal(v) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go deleted file mode 100644 index fe52081ab..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go +++ /dev/null @@ -1,50 +0,0 @@ -package runtime - -import ( - "encoding/json" - "io" -) - -// JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON -// with the standard "encoding/json" package of Golang. -// Although it is generally faster for simple proto messages than JSONPb, -// it does not support advanced features of protobuf, e.g. map, oneof, .... -// -// The NewEncoder and NewDecoder types return *json.Encoder and -// *json.Decoder respectively. -type JSONBuiltin struct{} - -// ContentType always Returns "application/json". -func (*JSONBuiltin) ContentType(_ interface{}) string { - return "application/json" -} - -// Marshal marshals "v" into JSON -func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) { - return json.Marshal(v) -} - -// MarshalIndent is like Marshal but applies Indent to format the output -func (j *JSONBuiltin) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { - return json.MarshalIndent(v, prefix, indent) -} - -// Unmarshal unmarshals JSON data into "v". -func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error { - return json.Unmarshal(data, v) -} - -// NewDecoder returns a Decoder which reads JSON stream from "r". -func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder { - return json.NewDecoder(r) -} - -// NewEncoder returns an Encoder which writes JSON stream into "w". -func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder { - return json.NewEncoder(w) -} - -// Delimiter for newline encoded JSON streams. -func (j *JSONBuiltin) Delimiter() []byte { - return []byte("\n") -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go deleted file mode 100644 index 8376d1e0e..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go +++ /dev/null @@ -1,349 +0,0 @@ -package runtime - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "reflect" - "strconv" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -// JSONPb is a Marshaler which marshals/unmarshals into/from JSON -// with the "google.golang.org/protobuf/encoding/protojson" marshaler. -// It supports the full functionality of protobuf unlike JSONBuiltin. -// -// The NewDecoder method returns a DecoderWrapper, so the underlying -// *json.Decoder methods can be used. -type JSONPb struct { - protojson.MarshalOptions - protojson.UnmarshalOptions -} - -// ContentType always returns "application/json". -func (*JSONPb) ContentType(_ interface{}) string { - return "application/json" -} - -// Marshal marshals "v" into JSON. -func (j *JSONPb) Marshal(v interface{}) ([]byte, error) { - var buf bytes.Buffer - if err := j.marshalTo(&buf, v); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -func (j *JSONPb) marshalTo(w io.Writer, v interface{}) error { - p, ok := v.(proto.Message) - if !ok { - buf, err := j.marshalNonProtoField(v) - if err != nil { - return err - } - if j.Indent != "" { - b := &bytes.Buffer{} - if err := json.Indent(b, buf, "", j.Indent); err != nil { - return err - } - buf = b.Bytes() - } - _, err = w.Write(buf) - return err - } - - b, err := j.MarshalOptions.Marshal(p) - if err != nil { - return err - } - - _, err = w.Write(b) - return err -} - -var ( - // protoMessageType is stored to prevent constant lookup of the same type at runtime. - protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// marshalNonProto marshals a non-message field of a protobuf message. -// This function does not correctly marshal arbitrary data structures into JSON, -// it is only capable of marshaling non-message field values of protobuf, -// i.e. primitive types, enums; pointers to primitives or enums; maps from -// integer/string types to primitives/enums/pointers to messages. -func (j *JSONPb) marshalNonProtoField(v interface{}) ([]byte, error) { - if v == nil { - return []byte("null"), nil - } - rv := reflect.ValueOf(v) - for rv.Kind() == reflect.Ptr { - if rv.IsNil() { - return []byte("null"), nil - } - rv = rv.Elem() - } - - if rv.Kind() == reflect.Slice { - if rv.IsNil() { - if j.EmitUnpopulated { - return []byte("[]"), nil - } - return []byte("null"), nil - } - - if rv.Type().Elem().Implements(protoMessageType) { - var buf bytes.Buffer - if err := buf.WriteByte('['); err != nil { - return nil, err - } - for i := 0; i < rv.Len(); i++ { - if i != 0 { - if err := buf.WriteByte(','); err != nil { - return nil, err - } - } - if err := j.marshalTo(&buf, rv.Index(i).Interface().(proto.Message)); err != nil { - return nil, err - } - } - if err := buf.WriteByte(']'); err != nil { - return nil, err - } - - return buf.Bytes(), nil - } - - if rv.Type().Elem().Implements(typeProtoEnum) { - var buf bytes.Buffer - if err := buf.WriteByte('['); err != nil { - return nil, err - } - for i := 0; i < rv.Len(); i++ { - if i != 0 { - if err := buf.WriteByte(','); err != nil { - return nil, err - } - } - var err error - if j.UseEnumNumbers { - _, err = buf.WriteString(strconv.FormatInt(rv.Index(i).Int(), 10)) - } else { - _, err = buf.WriteString("\"" + rv.Index(i).Interface().(protoEnum).String() + "\"") - } - if err != nil { - return nil, err - } - } - if err := buf.WriteByte(']'); err != nil { - return nil, err - } - - return buf.Bytes(), nil - } - } - - if rv.Kind() == reflect.Map { - m := make(map[string]*json.RawMessage) - for _, k := range rv.MapKeys() { - buf, err := j.Marshal(rv.MapIndex(k).Interface()) - if err != nil { - return nil, err - } - m[fmt.Sprintf("%v", k.Interface())] = (*json.RawMessage)(&buf) - } - return json.Marshal(m) - } - if enum, ok := rv.Interface().(protoEnum); ok && !j.UseEnumNumbers { - return json.Marshal(enum.String()) - } - return json.Marshal(rv.Interface()) -} - -// Unmarshal unmarshals JSON "data" into "v" -func (j *JSONPb) Unmarshal(data []byte, v interface{}) error { - return unmarshalJSONPb(data, j.UnmarshalOptions, v) -} - -// NewDecoder returns a Decoder which reads JSON stream from "r". -func (j *JSONPb) NewDecoder(r io.Reader) Decoder { - d := json.NewDecoder(r) - return DecoderWrapper{ - Decoder: d, - UnmarshalOptions: j.UnmarshalOptions, - } -} - -// DecoderWrapper is a wrapper around a *json.Decoder that adds -// support for protos to the Decode method. -type DecoderWrapper struct { - *json.Decoder - protojson.UnmarshalOptions -} - -// Decode wraps the embedded decoder's Decode method to support -// protos using a jsonpb.Unmarshaler. -func (d DecoderWrapper) Decode(v interface{}) error { - return decodeJSONPb(d.Decoder, d.UnmarshalOptions, v) -} - -// NewEncoder returns an Encoder which writes JSON stream into "w". -func (j *JSONPb) NewEncoder(w io.Writer) Encoder { - return EncoderFunc(func(v interface{}) error { - if err := j.marshalTo(w, v); err != nil { - return err - } - // mimic json.Encoder by adding a newline (makes output - // easier to read when it contains multiple encoded items) - _, err := w.Write(j.Delimiter()) - return err - }) -} - -func unmarshalJSONPb(data []byte, unmarshaler protojson.UnmarshalOptions, v interface{}) error { - d := json.NewDecoder(bytes.NewReader(data)) - return decodeJSONPb(d, unmarshaler, v) -} - -func decodeJSONPb(d *json.Decoder, unmarshaler protojson.UnmarshalOptions, v interface{}) error { - p, ok := v.(proto.Message) - if !ok { - return decodeNonProtoField(d, unmarshaler, v) - } - - // Decode into bytes for marshalling - var b json.RawMessage - if err := d.Decode(&b); err != nil { - return err - } - - return unmarshaler.Unmarshal([]byte(b), p) -} - -func decodeNonProtoField(d *json.Decoder, unmarshaler protojson.UnmarshalOptions, v interface{}) error { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr { - return fmt.Errorf("%T is not a pointer", v) - } - for rv.Kind() == reflect.Ptr { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - if rv.Type().ConvertibleTo(typeProtoMessage) { - // Decode into bytes for marshalling - var b json.RawMessage - if err := d.Decode(&b); err != nil { - return err - } - - return unmarshaler.Unmarshal([]byte(b), rv.Interface().(proto.Message)) - } - rv = rv.Elem() - } - if rv.Kind() == reflect.Map { - if rv.IsNil() { - rv.Set(reflect.MakeMap(rv.Type())) - } - conv, ok := convFromType[rv.Type().Key().Kind()] - if !ok { - return fmt.Errorf("unsupported type of map field key: %v", rv.Type().Key()) - } - - m := make(map[string]*json.RawMessage) - if err := d.Decode(&m); err != nil { - return err - } - for k, v := range m { - result := conv.Call([]reflect.Value{reflect.ValueOf(k)}) - if err := result[1].Interface(); err != nil { - return err.(error) - } - bk := result[0] - bv := reflect.New(rv.Type().Elem()) - if v == nil { - null := json.RawMessage("null") - v = &null - } - if err := unmarshalJSONPb([]byte(*v), unmarshaler, bv.Interface()); err != nil { - return err - } - rv.SetMapIndex(bk, bv.Elem()) - } - return nil - } - if rv.Kind() == reflect.Slice { - if rv.Type().Elem().Kind() == reflect.Uint8 { - var sl []byte - if err := d.Decode(&sl); err != nil { - return err - } - if sl != nil { - rv.SetBytes(sl) - } - return nil - } - - var sl []json.RawMessage - if err := d.Decode(&sl); err != nil { - return err - } - if sl != nil { - rv.Set(reflect.MakeSlice(rv.Type(), 0, 0)) - } - for _, item := range sl { - bv := reflect.New(rv.Type().Elem()) - if err := unmarshalJSONPb([]byte(item), unmarshaler, bv.Interface()); err != nil { - return err - } - rv.Set(reflect.Append(rv, bv.Elem())) - } - return nil - } - if _, ok := rv.Interface().(protoEnum); ok { - var repr interface{} - if err := d.Decode(&repr); err != nil { - return err - } - switch v := repr.(type) { - case string: - // TODO(yugui) Should use proto.StructProperties? - return fmt.Errorf("unmarshaling of symbolic enum %q not supported: %T", repr, rv.Interface()) - case float64: - rv.Set(reflect.ValueOf(int32(v)).Convert(rv.Type())) - return nil - default: - return fmt.Errorf("cannot assign %#v into Go type %T", repr, rv.Interface()) - } - } - return d.Decode(v) -} - -type protoEnum interface { - fmt.Stringer - EnumDescriptor() ([]byte, []int) -} - -var typeProtoEnum = reflect.TypeOf((*protoEnum)(nil)).Elem() - -var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem() - -// Delimiter for newline encoded JSON streams. -func (j *JSONPb) Delimiter() []byte { - return []byte("\n") -} - -var ( - convFromType = map[reflect.Kind]reflect.Value{ - reflect.String: reflect.ValueOf(String), - reflect.Bool: reflect.ValueOf(Bool), - reflect.Float64: reflect.ValueOf(Float64), - reflect.Float32: reflect.ValueOf(Float32), - reflect.Int64: reflect.ValueOf(Int64), - reflect.Int32: reflect.ValueOf(Int32), - reflect.Uint64: reflect.ValueOf(Uint64), - reflect.Uint32: reflect.ValueOf(Uint32), - reflect.Slice: reflect.ValueOf(Bytes), - } -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_proto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_proto.go deleted file mode 100644 index 398c780dc..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_proto.go +++ /dev/null @@ -1,60 +0,0 @@ -package runtime - -import ( - "errors" - "io" - - "google.golang.org/protobuf/proto" -) - -// ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes -type ProtoMarshaller struct{} - -// ContentType always returns "application/octet-stream". -func (*ProtoMarshaller) ContentType(_ interface{}) string { - return "application/octet-stream" -} - -// Marshal marshals "value" into Proto -func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) { - message, ok := value.(proto.Message) - if !ok { - return nil, errors.New("unable to marshal non proto field") - } - return proto.Marshal(message) -} - -// Unmarshal unmarshals proto "data" into "value" -func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { - message, ok := value.(proto.Message) - if !ok { - return errors.New("unable to unmarshal non proto field") - } - return proto.Unmarshal(data, message) -} - -// NewDecoder returns a Decoder which reads proto stream from "reader". -func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder { - return DecoderFunc(func(value interface{}) error { - buffer, err := io.ReadAll(reader) - if err != nil { - return err - } - return marshaller.Unmarshal(buffer, value) - }) -} - -// NewEncoder returns an Encoder which writes proto stream into "writer". -func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder { - return EncoderFunc(func(value interface{}) error { - buffer, err := marshaller.Marshal(value) - if err != nil { - return err - } - if _, err := writer.Write(buffer); err != nil { - return err - } - - return nil - }) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler.go deleted file mode 100644 index b1dfc37af..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler.go +++ /dev/null @@ -1,58 +0,0 @@ -package runtime - -import ( - "io" -) - -// Marshaler defines a conversion between byte sequence and gRPC payloads / fields. -type Marshaler interface { - // Marshal marshals "v" into byte sequence. - Marshal(v interface{}) ([]byte, error) - // Unmarshal unmarshals "data" into "v". - // "v" must be a pointer value. - Unmarshal(data []byte, v interface{}) error - // NewDecoder returns a Decoder which reads byte sequence from "r". - NewDecoder(r io.Reader) Decoder - // NewEncoder returns an Encoder which writes bytes sequence into "w". - NewEncoder(w io.Writer) Encoder - // ContentType returns the Content-Type which this marshaler is responsible for. - // The parameter describes the type which is being marshalled, which can sometimes - // affect the content type returned. - ContentType(v interface{}) string -} - -// Decoder decodes a byte sequence -type Decoder interface { - Decode(v interface{}) error -} - -// Encoder encodes gRPC payloads / fields into byte sequence. -type Encoder interface { - Encode(v interface{}) error -} - -// DecoderFunc adapts an decoder function into Decoder. -type DecoderFunc func(v interface{}) error - -// Decode delegates invocations to the underlying function itself. -func (f DecoderFunc) Decode(v interface{}) error { return f(v) } - -// EncoderFunc adapts an encoder function into Encoder -type EncoderFunc func(v interface{}) error - -// Encode delegates invocations to the underlying function itself. -func (f EncoderFunc) Encode(v interface{}) error { return f(v) } - -// Delimited defines the streaming delimiter. -type Delimited interface { - // Delimiter returns the record separator for the stream. - Delimiter() []byte -} - -// StreamContentType defines the streaming content type. -type StreamContentType interface { - // StreamContentType returns the content type for a stream. This shares the - // same behaviour as for `Marshaler.ContentType`, but is called, if present, - // in the case of a streamed response. - StreamContentType(v interface{}) string -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go deleted file mode 100644 index 07c28112c..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go +++ /dev/null @@ -1,109 +0,0 @@ -package runtime - -import ( - "errors" - "mime" - "net/http" - - "google.golang.org/grpc/grpclog" - "google.golang.org/protobuf/encoding/protojson" -) - -// MIMEWildcard is the fallback MIME type used for requests which do not match -// a registered MIME type. -const MIMEWildcard = "*" - -var ( - acceptHeader = http.CanonicalHeaderKey("Accept") - contentTypeHeader = http.CanonicalHeaderKey("Content-Type") - - defaultMarshaler = &HTTPBodyMarshaler{ - Marshaler: &JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - } -) - -// MarshalerForRequest returns the inbound/outbound marshalers for this request. -// It checks the registry on the ServeMux for the MIME type set by the Content-Type header. -// If it isn't set (or the request Content-Type is empty), checks for "*". -// If there are multiple Content-Type headers set, choose the first one that it can -// exactly match in the registry. -// Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler. -func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) { - for _, acceptVal := range r.Header[acceptHeader] { - if m, ok := mux.marshalers.mimeMap[acceptVal]; ok { - outbound = m - break - } - } - - for _, contentTypeVal := range r.Header[contentTypeHeader] { - contentType, _, err := mime.ParseMediaType(contentTypeVal) - if err != nil { - grpclog.Errorf("Failed to parse Content-Type %s: %v", contentTypeVal, err) - continue - } - if m, ok := mux.marshalers.mimeMap[contentType]; ok { - inbound = m - break - } - } - - if inbound == nil { - inbound = mux.marshalers.mimeMap[MIMEWildcard] - } - if outbound == nil { - outbound = inbound - } - - return inbound, outbound -} - -// marshalerRegistry is a mapping from MIME types to Marshalers. -type marshalerRegistry struct { - mimeMap map[string]Marshaler -} - -// add adds a marshaler for a case-sensitive MIME type string ("*" to match any -// MIME type). -func (m marshalerRegistry) add(mime string, marshaler Marshaler) error { - if len(mime) == 0 { - return errors.New("empty MIME type") - } - - m.mimeMap[mime] = marshaler - - return nil -} - -// makeMarshalerMIMERegistry returns a new registry of marshalers. -// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces. -// -// For example, you could allow the client to specify the use of the runtime.JSONPb marshaler -// with an "application/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler -// with an "application/json" Content-Type. -// "*" can be used to match any Content-Type. -// This can be attached to a ServerMux with the marshaler option. -func makeMarshalerMIMERegistry() marshalerRegistry { - return marshalerRegistry{ - mimeMap: map[string]Marshaler{ - MIMEWildcard: defaultMarshaler, - }, - } -} - -// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound -// Marshalers to a MIME type in mux. -func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption { - return func(mux *ServeMux) { - if err := mux.marshalers.add(mime, marshaler); err != nil { - panic(err) - } - } -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go deleted file mode 100644 index 19255ec44..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go +++ /dev/null @@ -1,545 +0,0 @@ -package runtime - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/textproto" - "regexp" - "strings" - - "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/health/grpc_health_v1" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// UnescapingMode defines the behavior of ServeMux when unescaping path parameters. -type UnescapingMode int - -const ( - // UnescapingModeLegacy is the default V2 behavior, which escapes the entire - // path string before doing any routing. - UnescapingModeLegacy UnescapingMode = iota - - // UnescapingModeAllExceptReserved unescapes all path parameters except RFC 6570 - // reserved characters. - UnescapingModeAllExceptReserved - - // UnescapingModeAllExceptSlash unescapes URL path parameters except path - // separators, which will be left as "%2F". - UnescapingModeAllExceptSlash - - // UnescapingModeAllCharacters unescapes all URL path parameters. - UnescapingModeAllCharacters - - // UnescapingModeDefault is the default escaping type. - // TODO(v3): default this to UnescapingModeAllExceptReserved per grpc-httpjson-transcoding's - // reference implementation - UnescapingModeDefault = UnescapingModeLegacy -) - -var encodedPathSplitter = regexp.MustCompile("(/|%2F)") - -// A HandlerFunc handles a specific pair of path pattern and HTTP method. -type HandlerFunc func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) - -// A Middleware handler wraps another HandlerFunc to do some pre- and/or post-processing of the request. This is used as an alternative to gRPC interceptors when using the direct-to-implementation -// registration methods. It is generally recommended to use gRPC client or server interceptors instead -// where possible. -type Middleware func(HandlerFunc) HandlerFunc - -// ServeMux is a request multiplexer for grpc-gateway. -// It matches http requests to patterns and invokes the corresponding handler. -type ServeMux struct { - // handlers maps HTTP method to a list of handlers. - handlers map[string][]handler - middlewares []Middleware - forwardResponseOptions []func(context.Context, http.ResponseWriter, proto.Message) error - forwardResponseRewriter ForwardResponseRewriter - marshalers marshalerRegistry - incomingHeaderMatcher HeaderMatcherFunc - outgoingHeaderMatcher HeaderMatcherFunc - outgoingTrailerMatcher HeaderMatcherFunc - metadataAnnotators []func(context.Context, *http.Request) metadata.MD - errorHandler ErrorHandlerFunc - streamErrorHandler StreamErrorHandlerFunc - routingErrorHandler RoutingErrorHandlerFunc - disablePathLengthFallback bool - unescapingMode UnescapingMode - writeContentLength bool -} - -// ServeMuxOption is an option that can be given to a ServeMux on construction. -type ServeMuxOption func(*ServeMux) - -// ForwardResponseRewriter is the signature of a function that is capable of rewriting messages -// before they are forwarded in a unary, stream, or error response. -type ForwardResponseRewriter func(ctx context.Context, response proto.Message) (any, error) - -// WithForwardResponseRewriter returns a ServeMuxOption that allows for implementers to insert logic -// that can rewrite the final response before it is forwarded. -// -// The response rewriter function is called during unary message forwarding, stream message -// forwarding and when errors are being forwarded. -// -// NOTE: Using this option will likely make what is generated by `protoc-gen-openapiv2` incorrect. -// Since this option involves making runtime changes to the response shape or type. -func WithForwardResponseRewriter(fwdResponseRewriter ForwardResponseRewriter) ServeMuxOption { - return func(sm *ServeMux) { - sm.forwardResponseRewriter = fwdResponseRewriter - } -} - -// WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption. -// -// forwardResponseOption is an option that will be called on the relevant context.Context, -// http.ResponseWriter, and proto.Message before every forwarded response. -// -// The message may be nil in the case where just a header is being sent. -func WithForwardResponseOption(forwardResponseOption func(context.Context, http.ResponseWriter, proto.Message) error) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.forwardResponseOptions = append(serveMux.forwardResponseOptions, forwardResponseOption) - } -} - -// WithUnescapingMode sets the escaping type. See the definitions of UnescapingMode -// for more information. -func WithUnescapingMode(mode UnescapingMode) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.unescapingMode = mode - } -} - -// WithMiddlewares sets server middleware for all handlers. This is useful as an alternative to gRPC -// interceptors when using the direct-to-implementation registration methods and cannot rely -// on gRPC interceptors. It's recommended to use gRPC interceptors instead if possible. -func WithMiddlewares(middlewares ...Middleware) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.middlewares = append(serveMux.middlewares, middlewares...) - } -} - -// SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters. -// Configuring this will mean the generated OpenAPI output is no longer correct, and it should be -// done with careful consideration. -func SetQueryParameterParser(queryParameterParser QueryParameterParser) ServeMuxOption { - return func(serveMux *ServeMux) { - currentQueryParser = queryParameterParser - } -} - -// HeaderMatcherFunc checks whether a header key should be forwarded to/from gRPC context. -type HeaderMatcherFunc func(string) (string, bool) - -// DefaultHeaderMatcher is used to pass http request headers to/from gRPC context. This adds permanent HTTP header -// keys (as specified by the IANA, e.g: Accept, Cookie, Host) to the gRPC metadata with the grpcgateway- prefix. If you want to know which headers are considered permanent, you can view the isPermanentHTTPHeader function. -// HTTP headers that start with 'Grpc-Metadata-' are mapped to gRPC metadata after removing the prefix 'Grpc-Metadata-'. -// Other headers are not added to the gRPC metadata. -func DefaultHeaderMatcher(key string) (string, bool) { - switch key = textproto.CanonicalMIMEHeaderKey(key); { - case isPermanentHTTPHeader(key): - return MetadataPrefix + key, true - case strings.HasPrefix(key, MetadataHeaderPrefix): - return key[len(MetadataHeaderPrefix):], true - } - return "", false -} - -func defaultOutgoingHeaderMatcher(key string) (string, bool) { - return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true -} - -func defaultOutgoingTrailerMatcher(key string) (string, bool) { - return fmt.Sprintf("%s%s", MetadataTrailerPrefix, key), true -} - -// WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway. -// -// This matcher will be called with each header in http.Request. If matcher returns true, that header will be -// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return the modified header. -func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { - for _, header := range fn.matchedMalformedHeaders() { - grpclog.Warningf("The configured forwarding filter would allow %q to be sent to the gRPC server, which will likely cause errors. See https://github.com/grpc/grpc-go/pull/4803#issuecomment-986093310 for more information.", header) - } - - return func(mux *ServeMux) { - mux.incomingHeaderMatcher = fn - } -} - -// matchedMalformedHeaders returns the malformed headers that would be forwarded to gRPC server. -func (fn HeaderMatcherFunc) matchedMalformedHeaders() []string { - if fn == nil { - return nil - } - headers := make([]string, 0) - for header := range malformedHTTPHeaders { - out, accept := fn(header) - if accept && isMalformedHTTPHeader(out) { - headers = append(headers, out) - } - } - return headers -} - -// WithOutgoingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway. -// -// This matcher will be called with each header in response header metadata. If matcher returns true, that header will be -// passed to http response returned from gateway. To transform the header before passing to response, -// matcher should return the modified header. -func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { - return func(mux *ServeMux) { - mux.outgoingHeaderMatcher = fn - } -} - -// WithOutgoingTrailerMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway. -// -// This matcher will be called with each header in response trailer metadata. If matcher returns true, that header will be -// passed to http response returned from gateway. To transform the header before passing to response, -// matcher should return the modified header. -func WithOutgoingTrailerMatcher(fn HeaderMatcherFunc) ServeMuxOption { - return func(mux *ServeMux) { - mux.outgoingTrailerMatcher = fn - } -} - -// WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context. -// -// This can be used by services that need to read from http.Request and modify gRPC context. A common use case -// is reading token from cookie and adding it in gRPC context. -func WithMetadata(annotator func(context.Context, *http.Request) metadata.MD) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.metadataAnnotators = append(serveMux.metadataAnnotators, annotator) - } -} - -// WithErrorHandler returns a ServeMuxOption for configuring a custom error handler. -// -// This can be used to configure a custom error response. -func WithErrorHandler(fn ErrorHandlerFunc) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.errorHandler = fn - } -} - -// WithStreamErrorHandler returns a ServeMuxOption that will use the given custom stream -// error handler, which allows for customizing the error trailer for server-streaming -// calls. -// -// For stream errors that occur before any response has been written, the mux's -// ErrorHandler will be invoked. However, once data has been written, the errors must -// be handled differently: they must be included in the response body. The response body's -// final message will include the error details returned by the stream error handler. -func WithStreamErrorHandler(fn StreamErrorHandlerFunc) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.streamErrorHandler = fn - } -} - -// WithRoutingErrorHandler returns a ServeMuxOption for configuring a custom error handler to handle http routing errors. -// -// Method called for errors which can happen before gRPC route selected or executed. -// The following error codes: StatusMethodNotAllowed StatusNotFound StatusBadRequest -func WithRoutingErrorHandler(fn RoutingErrorHandlerFunc) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.routingErrorHandler = fn - } -} - -// WithDisablePathLengthFallback returns a ServeMuxOption for disable path length fallback. -func WithDisablePathLengthFallback() ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.disablePathLengthFallback = true - } -} - -// WithWriteContentLength returns a ServeMuxOption to enable writing content length on non-streaming responses -func WithWriteContentLength() ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.writeContentLength = true - } -} - -// WithHealthEndpointAt returns a ServeMuxOption that will add an endpoint to the created ServeMux at the path specified by endpointPath. -// When called the handler will forward the request to the upstream grpc service health check (defined in the -// gRPC Health Checking Protocol). -// -// See here https://grpc-ecosystem.github.io/grpc-gateway/docs/operations/health_check/ for more information on how -// to setup the protocol in the grpc server. -// -// If you define a service as query parameter, this will also be forwarded as service in the HealthCheckRequest. -func WithHealthEndpointAt(healthCheckClient grpc_health_v1.HealthClient, endpointPath string) ServeMuxOption { - return func(s *ServeMux) { - // error can be ignored since pattern is definitely valid - _ = s.HandlePath( - http.MethodGet, endpointPath, func(w http.ResponseWriter, r *http.Request, _ map[string]string, - ) { - _, outboundMarshaler := MarshalerForRequest(s, r) - - resp, err := healthCheckClient.Check(r.Context(), &grpc_health_v1.HealthCheckRequest{ - Service: r.URL.Query().Get("service"), - }) - if err != nil { - s.errorHandler(r.Context(), s, outboundMarshaler, w, r, err) - return - } - - w.Header().Set("Content-Type", "application/json") - - if resp.GetStatus() != grpc_health_v1.HealthCheckResponse_SERVING { - switch resp.GetStatus() { - case grpc_health_v1.HealthCheckResponse_NOT_SERVING, grpc_health_v1.HealthCheckResponse_UNKNOWN: - err = status.Error(codes.Unavailable, resp.String()) - case grpc_health_v1.HealthCheckResponse_SERVICE_UNKNOWN: - err = status.Error(codes.NotFound, resp.String()) - } - - s.errorHandler(r.Context(), s, outboundMarshaler, w, r, err) - return - } - - _ = outboundMarshaler.NewEncoder(w).Encode(resp) - }) - } -} - -// WithHealthzEndpoint returns a ServeMuxOption that will add a /healthz endpoint to the created ServeMux. -// -// See WithHealthEndpointAt for the general implementation. -func WithHealthzEndpoint(healthCheckClient grpc_health_v1.HealthClient) ServeMuxOption { - return WithHealthEndpointAt(healthCheckClient, "/healthz") -} - -// NewServeMux returns a new ServeMux whose internal mapping is empty. -func NewServeMux(opts ...ServeMuxOption) *ServeMux { - serveMux := &ServeMux{ - handlers: make(map[string][]handler), - forwardResponseOptions: make([]func(context.Context, http.ResponseWriter, proto.Message) error, 0), - forwardResponseRewriter: func(ctx context.Context, response proto.Message) (any, error) { return response, nil }, - marshalers: makeMarshalerMIMERegistry(), - errorHandler: DefaultHTTPErrorHandler, - streamErrorHandler: DefaultStreamErrorHandler, - routingErrorHandler: DefaultRoutingErrorHandler, - unescapingMode: UnescapingModeDefault, - } - - for _, opt := range opts { - opt(serveMux) - } - - if serveMux.incomingHeaderMatcher == nil { - serveMux.incomingHeaderMatcher = DefaultHeaderMatcher - } - if serveMux.outgoingHeaderMatcher == nil { - serveMux.outgoingHeaderMatcher = defaultOutgoingHeaderMatcher - } - if serveMux.outgoingTrailerMatcher == nil { - serveMux.outgoingTrailerMatcher = defaultOutgoingTrailerMatcher - } - - return serveMux -} - -// Handle associates "h" to the pair of HTTP method and path pattern. -func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) { - if len(s.middlewares) > 0 { - h = chainMiddlewares(s.middlewares)(h) - } - s.handlers[meth] = append([]handler{{pat: pat, h: h}}, s.handlers[meth]...) -} - -// HandlePath allows users to configure custom path handlers. -// refer: https://grpc-ecosystem.github.io/grpc-gateway/docs/operations/inject_router/ -func (s *ServeMux) HandlePath(meth string, pathPattern string, h HandlerFunc) error { - compiler, err := httprule.Parse(pathPattern) - if err != nil { - return fmt.Errorf("parsing path pattern: %w", err) - } - tp := compiler.Compile() - pattern, err := NewPattern(tp.Version, tp.OpCodes, tp.Pool, tp.Verb) - if err != nil { - return fmt.Errorf("creating new pattern: %w", err) - } - s.Handle(meth, pattern, h) - return nil -} - -// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.URL.Path. -func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - path := r.URL.Path - if !strings.HasPrefix(path, "/") { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.routingErrorHandler(ctx, s, outboundMarshaler, w, r, http.StatusBadRequest) - return - } - - // TODO(v3): remove UnescapingModeLegacy - if s.unescapingMode != UnescapingModeLegacy && r.URL.RawPath != "" { - path = r.URL.RawPath - } - - if override := r.Header.Get("X-HTTP-Method-Override"); override != "" && s.isPathLengthFallback(r) { - if err := r.ParseForm(); err != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - sterr := status.Error(codes.InvalidArgument, err.Error()) - s.errorHandler(ctx, s, outboundMarshaler, w, r, sterr) - return - } - r.Method = strings.ToUpper(override) - } - - var pathComponents []string - // since in UnescapeModeLegacy, the URL will already have been fully unescaped, if we also split on "%2F" - // in this escaping mode we would be double unescaping but in UnescapingModeAllCharacters, we still do as the - // path is the RawPath (i.e. unescaped). That does mean that the behavior of this function will change its default - // behavior when the UnescapingModeDefault gets changed from UnescapingModeLegacy to UnescapingModeAllExceptReserved - if s.unescapingMode == UnescapingModeAllCharacters { - pathComponents = encodedPathSplitter.Split(path[1:], -1) - } else { - pathComponents = strings.Split(path[1:], "/") - } - - lastPathComponent := pathComponents[len(pathComponents)-1] - - for _, h := range s.handlers[r.Method] { - // If the pattern has a verb, explicitly look for a suffix in the last - // component that matches a colon plus the verb. This allows us to - // handle some cases that otherwise can't be correctly handled by the - // former LastIndex case, such as when the verb literal itself contains - // a colon. This should work for all cases that have run through the - // parser because we know what verb we're looking for, however, there - // are still some cases that the parser itself cannot disambiguate. See - // the comment there if interested. - - var verb string - patVerb := h.pat.Verb() - - idx := -1 - if patVerb != "" && strings.HasSuffix(lastPathComponent, ":"+patVerb) { - idx = len(lastPathComponent) - len(patVerb) - 1 - } - if idx == 0 { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.routingErrorHandler(ctx, s, outboundMarshaler, w, r, http.StatusNotFound) - return - } - - comps := make([]string, len(pathComponents)) - copy(comps, pathComponents) - - if idx > 0 { - comps[len(comps)-1], verb = lastPathComponent[:idx], lastPathComponent[idx+1:] - } - - pathParams, err := h.pat.MatchAndEscape(comps, verb, s.unescapingMode) - if err != nil { - var mse MalformedSequenceError - if ok := errors.As(err, &mse); ok { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.errorHandler(ctx, s, outboundMarshaler, w, r, &HTTPStatusError{ - HTTPStatus: http.StatusBadRequest, - Err: mse, - }) - } - continue - } - s.handleHandler(h, w, r, pathParams) - return - } - - // if no handler has found for the request, lookup for other methods - // to handle POST -> GET fallback if the request is subject to path - // length fallback. - // Note we are not eagerly checking the request here as we want to return the - // right HTTP status code, and we need to process the fallback candidates in - // order to do that. - for m, handlers := range s.handlers { - if m == r.Method { - continue - } - for _, h := range handlers { - var verb string - patVerb := h.pat.Verb() - - idx := -1 - if patVerb != "" && strings.HasSuffix(lastPathComponent, ":"+patVerb) { - idx = len(lastPathComponent) - len(patVerb) - 1 - } - - comps := make([]string, len(pathComponents)) - copy(comps, pathComponents) - - if idx > 0 { - comps[len(comps)-1], verb = lastPathComponent[:idx], lastPathComponent[idx+1:] - } - - pathParams, err := h.pat.MatchAndEscape(comps, verb, s.unescapingMode) - if err != nil { - var mse MalformedSequenceError - if ok := errors.As(err, &mse); ok { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.errorHandler(ctx, s, outboundMarshaler, w, r, &HTTPStatusError{ - HTTPStatus: http.StatusBadRequest, - Err: mse, - }) - } - continue - } - - // X-HTTP-Method-Override is optional. Always allow fallback to POST. - // Also, only consider POST -> GET fallbacks, and avoid falling back to - // potentially dangerous operations like DELETE. - if s.isPathLengthFallback(r) && m == http.MethodGet { - if err := r.ParseForm(); err != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - sterr := status.Error(codes.InvalidArgument, err.Error()) - s.errorHandler(ctx, s, outboundMarshaler, w, r, sterr) - return - } - s.handleHandler(h, w, r, pathParams) - return - } - _, outboundMarshaler := MarshalerForRequest(s, r) - s.routingErrorHandler(ctx, s, outboundMarshaler, w, r, http.StatusMethodNotAllowed) - return - } - } - - _, outboundMarshaler := MarshalerForRequest(s, r) - s.routingErrorHandler(ctx, s, outboundMarshaler, w, r, http.StatusNotFound) -} - -// GetForwardResponseOptions returns the ForwardResponseOptions associated with this ServeMux. -func (s *ServeMux) GetForwardResponseOptions() []func(context.Context, http.ResponseWriter, proto.Message) error { - return s.forwardResponseOptions -} - -func (s *ServeMux) isPathLengthFallback(r *http.Request) bool { - return !s.disablePathLengthFallback && r.Method == "POST" && r.Header.Get("Content-Type") == "application/x-www-form-urlencoded" -} - -type handler struct { - pat Pattern - h HandlerFunc -} - -func (s *ServeMux) handleHandler(h handler, w http.ResponseWriter, r *http.Request, pathParams map[string]string) { - h.h(w, r.WithContext(withHTTPPattern(r.Context(), h.pat)), pathParams) -} - -func chainMiddlewares(mws []Middleware) Middleware { - return func(next HandlerFunc) HandlerFunc { - for i := len(mws); i > 0; i-- { - next = mws[i-1](next) - } - return next - } -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go deleted file mode 100644 index e54507145..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go +++ /dev/null @@ -1,381 +0,0 @@ -package runtime - -import ( - "errors" - "fmt" - "strconv" - "strings" - - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc/grpclog" -) - -var ( - // ErrNotMatch indicates that the given HTTP request path does not match to the pattern. - ErrNotMatch = errors.New("not match to the path pattern") - // ErrInvalidPattern indicates that the given definition of Pattern is not valid. - ErrInvalidPattern = errors.New("invalid pattern") -) - -type MalformedSequenceError string - -func (e MalformedSequenceError) Error() string { - return "malformed path escape " + strconv.Quote(string(e)) -} - -type op struct { - code utilities.OpCode - operand int -} - -// Pattern is a template pattern of http request paths defined in -// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto -type Pattern struct { - // ops is a list of operations - ops []op - // pool is a constant pool indexed by the operands or vars. - pool []string - // vars is a list of variables names to be bound by this pattern - vars []string - // stacksize is the max depth of the stack - stacksize int - // tailLen is the length of the fixed-size segments after a deep wildcard - tailLen int - // verb is the VERB part of the path pattern. It is empty if the pattern does not have VERB part. - verb string -} - -// NewPattern returns a new Pattern from the given definition values. -// "ops" is a sequence of op codes. "pool" is a constant pool. -// "verb" is the verb part of the pattern. It is empty if the pattern does not have the part. -// "version" must be 1 for now. -// It returns an error if the given definition is invalid. -func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, error) { - if version != 1 { - grpclog.Errorf("unsupported version: %d", version) - return Pattern{}, ErrInvalidPattern - } - - l := len(ops) - if l%2 != 0 { - grpclog.Errorf("odd number of ops codes: %d", l) - return Pattern{}, ErrInvalidPattern - } - - var ( - typedOps []op - stack, maxstack int - tailLen int - pushMSeen bool - vars []string - ) - for i := 0; i < l; i += 2 { - op := op{code: utilities.OpCode(ops[i]), operand: ops[i+1]} - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush: - if pushMSeen { - tailLen++ - } - stack++ - case utilities.OpPushM: - if pushMSeen { - grpclog.Error("pushM appears twice") - return Pattern{}, ErrInvalidPattern - } - pushMSeen = true - stack++ - case utilities.OpLitPush: - if op.operand < 0 || len(pool) <= op.operand { - grpclog.Errorf("negative literal index: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - if pushMSeen { - tailLen++ - } - stack++ - case utilities.OpConcatN: - if op.operand <= 0 { - grpclog.Errorf("negative concat size: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - stack -= op.operand - if stack < 0 { - grpclog.Error("stack underflow") - return Pattern{}, ErrInvalidPattern - } - stack++ - case utilities.OpCapture: - if op.operand < 0 || len(pool) <= op.operand { - grpclog.Errorf("variable name index out of bound: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - v := pool[op.operand] - op.operand = len(vars) - vars = append(vars, v) - stack-- - if stack < 0 { - grpclog.Error("stack underflow") - return Pattern{}, ErrInvalidPattern - } - default: - grpclog.Errorf("invalid opcode: %d", op.code) - return Pattern{}, ErrInvalidPattern - } - - if maxstack < stack { - maxstack = stack - } - typedOps = append(typedOps, op) - } - return Pattern{ - ops: typedOps, - pool: pool, - vars: vars, - stacksize: maxstack, - tailLen: tailLen, - verb: verb, - }, nil -} - -// MustPattern is a helper function which makes it easier to call NewPattern in variable initialization. -func MustPattern(p Pattern, err error) Pattern { - if err != nil { - grpclog.Fatalf("Pattern initialization failed: %v", err) - } - return p -} - -// MatchAndEscape examines components to determine if they match to a Pattern. -// MatchAndEscape will return an error if no Patterns matched or if a pattern -// matched but contained malformed escape sequences. If successful, the function -// returns a mapping from field paths to their captured values. -func (p Pattern) MatchAndEscape(components []string, verb string, unescapingMode UnescapingMode) (map[string]string, error) { - if p.verb != verb { - if p.verb != "" { - return nil, ErrNotMatch - } - if len(components) == 0 { - components = []string{":" + verb} - } else { - components = append([]string{}, components...) - components[len(components)-1] += ":" + verb - } - } - - var pos int - stack := make([]string, 0, p.stacksize) - captured := make([]string, len(p.vars)) - l := len(components) - for _, op := range p.ops { - var err error - - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush, utilities.OpLitPush: - if pos >= l { - return nil, ErrNotMatch - } - c := components[pos] - if op.code == utilities.OpLitPush { - if lit := p.pool[op.operand]; c != lit { - return nil, ErrNotMatch - } - } else if op.code == utilities.OpPush { - if c, err = unescape(c, unescapingMode, false); err != nil { - return nil, err - } - } - stack = append(stack, c) - pos++ - case utilities.OpPushM: - end := len(components) - if end < pos+p.tailLen { - return nil, ErrNotMatch - } - end -= p.tailLen - c := strings.Join(components[pos:end], "/") - if c, err = unescape(c, unescapingMode, true); err != nil { - return nil, err - } - stack = append(stack, c) - pos = end - case utilities.OpConcatN: - n := op.operand - l := len(stack) - n - stack = append(stack[:l], strings.Join(stack[l:], "/")) - case utilities.OpCapture: - n := len(stack) - 1 - captured[op.operand] = stack[n] - stack = stack[:n] - } - } - if pos < l { - return nil, ErrNotMatch - } - bindings := make(map[string]string) - for i, val := range captured { - bindings[p.vars[i]] = val - } - return bindings, nil -} - -// MatchAndEscape examines components to determine if they match to a Pattern. -// It will never perform per-component unescaping (see: UnescapingModeLegacy). -// MatchAndEscape will return an error if no Patterns matched. If successful, -// the function returns a mapping from field paths to their captured values. -// -// Deprecated: Use MatchAndEscape. -func (p Pattern) Match(components []string, verb string) (map[string]string, error) { - return p.MatchAndEscape(components, verb, UnescapingModeDefault) -} - -// Verb returns the verb part of the Pattern. -func (p Pattern) Verb() string { return p.verb } - -func (p Pattern) String() string { - var stack []string - for _, op := range p.ops { - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush: - stack = append(stack, "*") - case utilities.OpLitPush: - stack = append(stack, p.pool[op.operand]) - case utilities.OpPushM: - stack = append(stack, "**") - case utilities.OpConcatN: - n := op.operand - l := len(stack) - n - stack = append(stack[:l], strings.Join(stack[l:], "/")) - case utilities.OpCapture: - n := len(stack) - 1 - stack[n] = fmt.Sprintf("{%s=%s}", p.vars[op.operand], stack[n]) - } - } - segs := strings.Join(stack, "/") - if p.verb != "" { - return fmt.Sprintf("/%s:%s", segs, p.verb) - } - return "/" + segs -} - -/* - * The following code is adopted and modified from Go's standard library - * and carries the attached license. - * - * Copyright 2009 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ - -// ishex returns whether or not the given byte is a valid hex character -func ishex(c byte) bool { - switch { - case '0' <= c && c <= '9': - return true - case 'a' <= c && c <= 'f': - return true - case 'A' <= c && c <= 'F': - return true - } - return false -} - -func isRFC6570Reserved(c byte) bool { - switch c { - case '!', '#', '$', '&', '\'', '(', ')', '*', - '+', ',', '/', ':', ';', '=', '?', '@', '[', ']': - return true - default: - return false - } -} - -// unhex converts a hex point to the bit representation -func unhex(c byte) byte { - switch { - case '0' <= c && c <= '9': - return c - '0' - case 'a' <= c && c <= 'f': - return c - 'a' + 10 - case 'A' <= c && c <= 'F': - return c - 'A' + 10 - } - return 0 -} - -// shouldUnescapeWithMode returns true if the character is escapable with the -// given mode -func shouldUnescapeWithMode(c byte, mode UnescapingMode) bool { - switch mode { - case UnescapingModeAllExceptReserved: - if isRFC6570Reserved(c) { - return false - } - case UnescapingModeAllExceptSlash: - if c == '/' { - return false - } - case UnescapingModeAllCharacters: - return true - } - return true -} - -// unescape unescapes a path string using the provided mode -func unescape(s string, mode UnescapingMode, multisegment bool) (string, error) { - // TODO(v3): remove UnescapingModeLegacy - if mode == UnescapingModeLegacy { - return s, nil - } - - if !multisegment { - mode = UnescapingModeAllCharacters - } - - // Count %, check that they're well-formed. - n := 0 - for i := 0; i < len(s); { - if s[i] == '%' { - n++ - if i+2 >= len(s) || !ishex(s[i+1]) || !ishex(s[i+2]) { - s = s[i:] - if len(s) > 3 { - s = s[:3] - } - - return "", MalformedSequenceError(s) - } - i += 3 - } else { - i++ - } - } - - if n == 0 { - return s, nil - } - - var t strings.Builder - t.Grow(len(s)) - for i := 0; i < len(s); i++ { - switch s[i] { - case '%': - c := unhex(s[i+1])<<4 | unhex(s[i+2]) - if shouldUnescapeWithMode(c, mode) { - t.WriteByte(c) - i += 2 - continue - } - fallthrough - default: - t.WriteByte(s[i]) - } - } - - return t.String(), nil -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/proto2_convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/proto2_convert.go deleted file mode 100644 index f710036b3..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/proto2_convert.go +++ /dev/null @@ -1,80 +0,0 @@ -package runtime - -import ( - "google.golang.org/protobuf/proto" -) - -// StringP returns a pointer to a string whose pointee is same as the given string value. -func StringP(val string) (*string, error) { - return proto.String(val), nil -} - -// BoolP parses the given string representation of a boolean value, -// and returns a pointer to a bool whose value is same as the parsed value. -func BoolP(val string) (*bool, error) { - b, err := Bool(val) - if err != nil { - return nil, err - } - return proto.Bool(b), nil -} - -// Float64P parses the given string representation of a floating point number, -// and returns a pointer to a float64 whose value is same as the parsed number. -func Float64P(val string) (*float64, error) { - f, err := Float64(val) - if err != nil { - return nil, err - } - return proto.Float64(f), nil -} - -// Float32P parses the given string representation of a floating point number, -// and returns a pointer to a float32 whose value is same as the parsed number. -func Float32P(val string) (*float32, error) { - f, err := Float32(val) - if err != nil { - return nil, err - } - return proto.Float32(f), nil -} - -// Int64P parses the given string representation of an integer -// and returns a pointer to an int64 whose value is same as the parsed integer. -func Int64P(val string) (*int64, error) { - i, err := Int64(val) - if err != nil { - return nil, err - } - return proto.Int64(i), nil -} - -// Int32P parses the given string representation of an integer -// and returns a pointer to an int32 whose value is same as the parsed integer. -func Int32P(val string) (*int32, error) { - i, err := Int32(val) - if err != nil { - return nil, err - } - return proto.Int32(i), err -} - -// Uint64P parses the given string representation of an integer -// and returns a pointer to a uint64 whose value is same as the parsed integer. -func Uint64P(val string) (*uint64, error) { - i, err := Uint64(val) - if err != nil { - return nil, err - } - return proto.Uint64(i), err -} - -// Uint32P parses the given string representation of an integer -// and returns a pointer to a uint32 whose value is same as the parsed integer. -func Uint32P(val string) (*uint32, error) { - i, err := Uint32(val) - if err != nil { - return nil, err - } - return proto.Uint32(i), err -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go deleted file mode 100644 index 8549dfb97..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go +++ /dev/null @@ -1,378 +0,0 @@ -package runtime - -import ( - "errors" - "fmt" - "net/url" - "regexp" - "strconv" - "strings" - "time" - - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc/grpclog" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/known/durationpb" - field_mask "google.golang.org/protobuf/types/known/fieldmaskpb" - "google.golang.org/protobuf/types/known/structpb" - "google.golang.org/protobuf/types/known/timestamppb" - "google.golang.org/protobuf/types/known/wrapperspb" -) - -var valuesKeyRegexp = regexp.MustCompile(`^(.*)\[(.*)\]$`) - -var currentQueryParser QueryParameterParser = &DefaultQueryParser{} - -// QueryParameterParser defines interface for all query parameter parsers -type QueryParameterParser interface { - Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error -} - -// PopulateQueryParameters parses query parameters -// into "msg" using current query parser -func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { - return currentQueryParser.Parse(msg, values, filter) -} - -// DefaultQueryParser is a QueryParameterParser which implements the default -// query parameters parsing behavior. -// -// See https://github.com/grpc-ecosystem/grpc-gateway/issues/2632 for more context. -type DefaultQueryParser struct{} - -// Parse populates "values" into "msg". -// A value is ignored if its key starts with one of the elements in "filter". -func (*DefaultQueryParser) Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { - for key, values := range values { - if match := valuesKeyRegexp.FindStringSubmatch(key); len(match) == 3 { - key = match[1] - values = append([]string{match[2]}, values...) - } - - msgValue := msg.ProtoReflect() - fieldPath := normalizeFieldPath(msgValue, strings.Split(key, ".")) - if filter.HasCommonPrefix(fieldPath) { - continue - } - if err := populateFieldValueFromPath(msgValue, fieldPath, values); err != nil { - return err - } - } - return nil -} - -// PopulateFieldFromPath sets a value in a nested Protobuf structure. -func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error { - fieldPath := strings.Split(fieldPathString, ".") - return populateFieldValueFromPath(msg.ProtoReflect(), fieldPath, []string{value}) -} - -func normalizeFieldPath(msgValue protoreflect.Message, fieldPath []string) []string { - newFieldPath := make([]string, 0, len(fieldPath)) - for i, fieldName := range fieldPath { - fields := msgValue.Descriptor().Fields() - fieldDesc := fields.ByTextName(fieldName) - if fieldDesc == nil { - fieldDesc = fields.ByJSONName(fieldName) - } - if fieldDesc == nil { - // return initial field path values if no matching message field was found - return fieldPath - } - - newFieldPath = append(newFieldPath, string(fieldDesc.Name())) - - // If this is the last element, we're done - if i == len(fieldPath)-1 { - break - } - - // Only singular message fields are allowed - if fieldDesc.Message() == nil || fieldDesc.Cardinality() == protoreflect.Repeated { - return fieldPath - } - - // Get the nested message - msgValue = msgValue.Get(fieldDesc).Message() - } - - return newFieldPath -} - -func populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []string, values []string) error { - if len(fieldPath) < 1 { - return errors.New("no field path") - } - if len(values) < 1 { - return errors.New("no value provided") - } - - var fieldDescriptor protoreflect.FieldDescriptor - for i, fieldName := range fieldPath { - fields := msgValue.Descriptor().Fields() - - // Get field by name - fieldDescriptor = fields.ByName(protoreflect.Name(fieldName)) - if fieldDescriptor == nil { - fieldDescriptor = fields.ByJSONName(fieldName) - if fieldDescriptor == nil { - // We're not returning an error here because this could just be - // an extra query parameter that isn't part of the request. - grpclog.Infof("field not found in %q: %q", msgValue.Descriptor().FullName(), strings.Join(fieldPath, ".")) - return nil - } - } - - // Check if oneof already set - if of := fieldDescriptor.ContainingOneof(); of != nil && !of.IsSynthetic() { - if f := msgValue.WhichOneof(of); f != nil { - if fieldDescriptor.Message() == nil || fieldDescriptor.FullName() != f.FullName() { - return fmt.Errorf("field already set for oneof %q", of.FullName().Name()) - } - } - } - - // If this is the last element, we're done - if i == len(fieldPath)-1 { - break - } - - // Only singular message fields are allowed - if fieldDescriptor.Message() == nil || fieldDescriptor.Cardinality() == protoreflect.Repeated { - return fmt.Errorf("invalid path: %q is not a message", fieldName) - } - - // Get the nested message - msgValue = msgValue.Mutable(fieldDescriptor).Message() - } - - switch { - case fieldDescriptor.IsList(): - return populateRepeatedField(fieldDescriptor, msgValue.Mutable(fieldDescriptor).List(), values) - case fieldDescriptor.IsMap(): - return populateMapField(fieldDescriptor, msgValue.Mutable(fieldDescriptor).Map(), values) - } - - if len(values) > 1 { - return fmt.Errorf("too many values for field %q: %s", fieldDescriptor.FullName().Name(), strings.Join(values, ", ")) - } - - return populateField(fieldDescriptor, msgValue, values[0]) -} - -func populateField(fieldDescriptor protoreflect.FieldDescriptor, msgValue protoreflect.Message, value string) error { - v, err := parseField(fieldDescriptor, value) - if err != nil { - return fmt.Errorf("parsing field %q: %w", fieldDescriptor.FullName().Name(), err) - } - - msgValue.Set(fieldDescriptor, v) - return nil -} - -func populateRepeatedField(fieldDescriptor protoreflect.FieldDescriptor, list protoreflect.List, values []string) error { - for _, value := range values { - v, err := parseField(fieldDescriptor, value) - if err != nil { - return fmt.Errorf("parsing list %q: %w", fieldDescriptor.FullName().Name(), err) - } - list.Append(v) - } - - return nil -} - -func populateMapField(fieldDescriptor protoreflect.FieldDescriptor, mp protoreflect.Map, values []string) error { - if len(values) != 2 { - return fmt.Errorf("more than one value provided for key %q in map %q", values[0], fieldDescriptor.FullName()) - } - - key, err := parseField(fieldDescriptor.MapKey(), values[0]) - if err != nil { - return fmt.Errorf("parsing map key %q: %w", fieldDescriptor.FullName().Name(), err) - } - - value, err := parseField(fieldDescriptor.MapValue(), values[1]) - if err != nil { - return fmt.Errorf("parsing map value %q: %w", fieldDescriptor.FullName().Name(), err) - } - - mp.Set(key.MapKey(), value) - - return nil -} - -func parseField(fieldDescriptor protoreflect.FieldDescriptor, value string) (protoreflect.Value, error) { - switch fieldDescriptor.Kind() { - case protoreflect.BoolKind: - v, err := strconv.ParseBool(value) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfBool(v), nil - case protoreflect.EnumKind: - enum, err := protoregistry.GlobalTypes.FindEnumByName(fieldDescriptor.Enum().FullName()) - if err != nil { - if errors.Is(err, protoregistry.NotFound) { - return protoreflect.Value{}, fmt.Errorf("enum %q is not registered", fieldDescriptor.Enum().FullName()) - } - return protoreflect.Value{}, fmt.Errorf("failed to look up enum: %w", err) - } - // Look for enum by name - v := enum.Descriptor().Values().ByName(protoreflect.Name(value)) - if v == nil { - i, err := strconv.Atoi(value) - if err != nil { - return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value) - } - // Look for enum by number - if v = enum.Descriptor().Values().ByNumber(protoreflect.EnumNumber(i)); v == nil { - return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value) - } - } - return protoreflect.ValueOfEnum(v.Number()), nil - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - v, err := strconv.ParseInt(value, 10, 32) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfInt32(int32(v)), nil - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - v, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfInt64(v), nil - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - v, err := strconv.ParseUint(value, 10, 32) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfUint32(uint32(v)), nil - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - v, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfUint64(v), nil - case protoreflect.FloatKind: - v, err := strconv.ParseFloat(value, 32) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfFloat32(float32(v)), nil - case protoreflect.DoubleKind: - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfFloat64(v), nil - case protoreflect.StringKind: - return protoreflect.ValueOfString(value), nil - case protoreflect.BytesKind: - v, err := Bytes(value) - if err != nil { - return protoreflect.Value{}, err - } - return protoreflect.ValueOfBytes(v), nil - case protoreflect.MessageKind, protoreflect.GroupKind: - return parseMessage(fieldDescriptor.Message(), value) - default: - panic(fmt.Sprintf("unknown field kind: %v", fieldDescriptor.Kind())) - } -} - -func parseMessage(msgDescriptor protoreflect.MessageDescriptor, value string) (protoreflect.Value, error) { - var msg proto.Message - switch msgDescriptor.FullName() { - case "google.protobuf.Timestamp": - t, err := time.Parse(time.RFC3339Nano, value) - if err != nil { - return protoreflect.Value{}, err - } - timestamp := timestamppb.New(t) - if ok := timestamp.IsValid(); !ok { - return protoreflect.Value{}, fmt.Errorf("%s before 0001-01-01", value) - } - msg = timestamp - case "google.protobuf.Duration": - d, err := time.ParseDuration(value) - if err != nil { - return protoreflect.Value{}, err - } - msg = durationpb.New(d) - case "google.protobuf.DoubleValue": - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Double(v) - case "google.protobuf.FloatValue": - v, err := strconv.ParseFloat(value, 32) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Float(float32(v)) - case "google.protobuf.Int64Value": - v, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Int64(v) - case "google.protobuf.Int32Value": - v, err := strconv.ParseInt(value, 10, 32) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Int32(int32(v)) - case "google.protobuf.UInt64Value": - v, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.UInt64(v) - case "google.protobuf.UInt32Value": - v, err := strconv.ParseUint(value, 10, 32) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.UInt32(uint32(v)) - case "google.protobuf.BoolValue": - v, err := strconv.ParseBool(value) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Bool(v) - case "google.protobuf.StringValue": - msg = wrapperspb.String(value) - case "google.protobuf.BytesValue": - v, err := Bytes(value) - if err != nil { - return protoreflect.Value{}, err - } - msg = wrapperspb.Bytes(v) - case "google.protobuf.FieldMask": - fm := &field_mask.FieldMask{} - fm.Paths = append(fm.Paths, strings.Split(value, ",")...) - msg = fm - case "google.protobuf.Value": - var v structpb.Value - if err := protojson.Unmarshal([]byte(value), &v); err != nil { - return protoreflect.Value{}, err - } - msg = &v - case "google.protobuf.Struct": - var v structpb.Struct - if err := protojson.Unmarshal([]byte(value), &v); err != nil { - return protoreflect.Value{}, err - } - msg = &v - default: - return protoreflect.Value{}, fmt.Errorf("unsupported message type: %q", string(msgDescriptor.FullName())) - } - - return protoreflect.ValueOfMessage(msg.ProtoReflect()), nil -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel deleted file mode 100644 index b89409465..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "utilities", - srcs = [ - "doc.go", - "pattern.go", - "readerfactory.go", - "string_array_flag.go", - "trie.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/utilities", -) - -go_test( - name = "utilities_test", - size = "small", - srcs = [ - "string_array_flag_test.go", - "trie_test.go", - ], - deps = [":utilities"], -) - -alias( - name = "go_default_library", - actual = ":utilities", - visibility = ["//visibility:public"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/doc.go deleted file mode 100644 index cf79a4d58..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package utilities provides members for internal use in grpc-gateway. -package utilities diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/pattern.go deleted file mode 100644 index 38ca39cc5..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/pattern.go +++ /dev/null @@ -1,22 +0,0 @@ -package utilities - -// OpCode is an opcode of compiled path patterns. -type OpCode int - -// These constants are the valid values of OpCode. -const ( - // OpNop does nothing - OpNop = OpCode(iota) - // OpPush pushes a component to stack - OpPush - // OpLitPush pushes a component to stack if it matches to the literal - OpLitPush - // OpPushM concatenates the remaining components and pushes it to stack - OpPushM - // OpConcatN pops N items from stack, concatenates them and pushes it back to stack - OpConcatN - // OpCapture pops an item and binds it to the variable - OpCapture - // OpEnd is the least positive invalid opcode. - OpEnd -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/readerfactory.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/readerfactory.go deleted file mode 100644 index 01d26edae..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/readerfactory.go +++ /dev/null @@ -1,19 +0,0 @@ -package utilities - -import ( - "bytes" - "io" -) - -// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins -// at the start of the stream -func IOReaderFactory(r io.Reader) (func() io.Reader, error) { - b, err := io.ReadAll(r) - if err != nil { - return nil, err - } - - return func() io.Reader { - return bytes.NewReader(b) - }, nil -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/string_array_flag.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/string_array_flag.go deleted file mode 100644 index 66aa5f2dc..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/string_array_flag.go +++ /dev/null @@ -1,33 +0,0 @@ -package utilities - -import ( - "flag" - "strings" -) - -// flagInterface is a cut down interface to `flag` -type flagInterface interface { - Var(value flag.Value, name string, usage string) -} - -// StringArrayFlag defines a flag with the specified name and usage string. -// The return value is the address of a `StringArrayFlags` variable that stores the repeated values of the flag. -func StringArrayFlag(f flagInterface, name string, usage string) *StringArrayFlags { - value := &StringArrayFlags{} - f.Var(value, name, usage) - return value -} - -// StringArrayFlags is a wrapper of `[]string` to provider an interface for `flag.Var` -type StringArrayFlags []string - -// String returns a string representation of `StringArrayFlags` -func (i *StringArrayFlags) String() string { - return strings.Join(*i, ",") -} - -// Set appends a value to `StringArrayFlags` -func (i *StringArrayFlags) Set(value string) error { - *i = append(*i, value) - return nil -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/trie.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/trie.go deleted file mode 100644 index dd99b0ed2..000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/trie.go +++ /dev/null @@ -1,174 +0,0 @@ -package utilities - -import ( - "sort" -) - -// DoubleArray is a Double Array implementation of trie on sequences of strings. -type DoubleArray struct { - // Encoding keeps an encoding from string to int - Encoding map[string]int - // Base is the base array of Double Array - Base []int - // Check is the check array of Double Array - Check []int -} - -// NewDoubleArray builds a DoubleArray from a set of sequences of strings. -func NewDoubleArray(seqs [][]string) *DoubleArray { - da := &DoubleArray{Encoding: make(map[string]int)} - if len(seqs) == 0 { - return da - } - - encoded := registerTokens(da, seqs) - sort.Sort(byLex(encoded)) - - root := node{row: -1, col: -1, left: 0, right: len(encoded)} - addSeqs(da, encoded, 0, root) - - for i := len(da.Base); i > 0; i-- { - if da.Check[i-1] != 0 { - da.Base = da.Base[:i] - da.Check = da.Check[:i] - break - } - } - return da -} - -func registerTokens(da *DoubleArray, seqs [][]string) [][]int { - var result [][]int - for _, seq := range seqs { - encoded := make([]int, 0, len(seq)) - for _, token := range seq { - if _, ok := da.Encoding[token]; !ok { - da.Encoding[token] = len(da.Encoding) - } - encoded = append(encoded, da.Encoding[token]) - } - result = append(result, encoded) - } - for i := range result { - result[i] = append(result[i], len(da.Encoding)) - } - return result -} - -type node struct { - row, col int - left, right int -} - -func (n node) value(seqs [][]int) int { - return seqs[n.row][n.col] -} - -func (n node) children(seqs [][]int) []*node { - var result []*node - lastVal := int(-1) - last := new(node) - for i := n.left; i < n.right; i++ { - if lastVal == seqs[i][n.col+1] { - continue - } - last.right = i - last = &node{ - row: i, - col: n.col + 1, - left: i, - } - result = append(result, last) - } - last.right = n.right - return result -} - -func addSeqs(da *DoubleArray, seqs [][]int, pos int, n node) { - ensureSize(da, pos) - - children := n.children(seqs) - var i int - for i = 1; ; i++ { - ok := func() bool { - for _, child := range children { - code := child.value(seqs) - j := i + code - ensureSize(da, j) - if da.Check[j] != 0 { - return false - } - } - return true - }() - if ok { - break - } - } - da.Base[pos] = i - for _, child := range children { - code := child.value(seqs) - j := i + code - da.Check[j] = pos + 1 - } - terminator := len(da.Encoding) - for _, child := range children { - code := child.value(seqs) - if code == terminator { - continue - } - j := i + code - addSeqs(da, seqs, j, *child) - } -} - -func ensureSize(da *DoubleArray, i int) { - for i >= len(da.Base) { - da.Base = append(da.Base, make([]int, len(da.Base)+1)...) - da.Check = append(da.Check, make([]int, len(da.Check)+1)...) - } -} - -type byLex [][]int - -func (l byLex) Len() int { return len(l) } -func (l byLex) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l byLex) Less(i, j int) bool { - si := l[i] - sj := l[j] - var k int - for k = 0; k < len(si) && k < len(sj); k++ { - if si[k] < sj[k] { - return true - } - if si[k] > sj[k] { - return false - } - } - return k < len(sj) -} - -// HasCommonPrefix determines if any sequence in the DoubleArray is a prefix of the given sequence. -func (da *DoubleArray) HasCommonPrefix(seq []string) bool { - if len(da.Base) == 0 { - return false - } - - var i int - for _, t := range seq { - code, ok := da.Encoding[t] - if !ok { - break - } - j := da.Base[i] + code - if len(da.Check) <= j || da.Check[j] != i+1 { - break - } - i = j - } - j := da.Base[i] + len(da.Encoding) - if len(da.Check) <= j || da.Check[j] != i+1 { - return false - } - return true -} diff --git a/vendor/github.com/josharian/intern/README.md b/vendor/github.com/josharian/intern/README.md deleted file mode 100644 index ffc44b219..000000000 --- a/vendor/github.com/josharian/intern/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Docs: https://godoc.org/github.com/josharian/intern - -See also [Go issue 5160](https://golang.org/issue/5160). - -License: MIT diff --git a/vendor/github.com/josharian/intern/intern.go b/vendor/github.com/josharian/intern/intern.go deleted file mode 100644 index 7acb1fe90..000000000 --- a/vendor/github.com/josharian/intern/intern.go +++ /dev/null @@ -1,44 +0,0 @@ -// Package intern interns strings. -// Interning is best effort only. -// Interned strings may be removed automatically -// at any time without notification. -// All functions may be called concurrently -// with themselves and each other. -package intern - -import "sync" - -var ( - pool sync.Pool = sync.Pool{ - New: func() interface{} { - return make(map[string]string) - }, - } -) - -// String returns s, interned. -func String(s string) string { - m := pool.Get().(map[string]string) - c, ok := m[s] - if ok { - pool.Put(m) - return c - } - m[s] = s - pool.Put(m) - return s -} - -// Bytes returns b converted to a string, interned. -func Bytes(b []byte) string { - m := pool.Get().(map[string]string) - c, ok := m[string(b)] - if ok { - pool.Put(m) - return c - } - s := string(b) - m[s] = s - pool.Put(m) - return s -} diff --git a/vendor/github.com/josharian/intern/license.md b/vendor/github.com/josharian/intern/license.md deleted file mode 100644 index 353d3055f..000000000 --- a/vendor/github.com/josharian/intern/license.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Josh Bleecher Snyder - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/mailru/easyjson/LICENSE b/vendor/github.com/mailru/easyjson/LICENSE deleted file mode 100644 index fbff658f7..000000000 --- a/vendor/github.com/mailru/easyjson/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2016 Mail.Ru Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/mailru/easyjson/buffer/pool.go b/vendor/github.com/mailru/easyjson/buffer/pool.go deleted file mode 100644 index 598a54af9..000000000 --- a/vendor/github.com/mailru/easyjson/buffer/pool.go +++ /dev/null @@ -1,278 +0,0 @@ -// Package buffer implements a buffer for serialization, consisting of a chain of []byte-s to -// reduce copying and to allow reuse of individual chunks. -package buffer - -import ( - "io" - "net" - "sync" -) - -// PoolConfig contains configuration for the allocation and reuse strategy. -type PoolConfig struct { - StartSize int // Minimum chunk size that is allocated. - PooledSize int // Minimum chunk size that is reused, reusing chunks too small will result in overhead. - MaxSize int // Maximum chunk size that will be allocated. -} - -var config = PoolConfig{ - StartSize: 128, - PooledSize: 512, - MaxSize: 32768, -} - -// Reuse pool: chunk size -> pool. -var buffers = map[int]*sync.Pool{} - -func initBuffers() { - for l := config.PooledSize; l <= config.MaxSize; l *= 2 { - buffers[l] = new(sync.Pool) - } -} - -func init() { - initBuffers() -} - -// Init sets up a non-default pooling and allocation strategy. Should be run before serialization is done. -func Init(cfg PoolConfig) { - config = cfg - initBuffers() -} - -// putBuf puts a chunk to reuse pool if it can be reused. -func putBuf(buf []byte) { - size := cap(buf) - if size < config.PooledSize { - return - } - if c := buffers[size]; c != nil { - c.Put(buf[:0]) - } -} - -// getBuf gets a chunk from reuse pool or creates a new one if reuse failed. -func getBuf(size int) []byte { - if size >= config.PooledSize { - if c := buffers[size]; c != nil { - v := c.Get() - if v != nil { - return v.([]byte) - } - } - } - return make([]byte, 0, size) -} - -// Buffer is a buffer optimized for serialization without extra copying. -type Buffer struct { - - // Buf is the current chunk that can be used for serialization. - Buf []byte - - toPool []byte - bufs [][]byte -} - -// EnsureSpace makes sure that the current chunk contains at least s free bytes, -// possibly creating a new chunk. -func (b *Buffer) EnsureSpace(s int) { - if cap(b.Buf)-len(b.Buf) < s { - b.ensureSpaceSlow(s) - } -} - -func (b *Buffer) ensureSpaceSlow(s int) { - l := len(b.Buf) - if l > 0 { - if cap(b.toPool) != cap(b.Buf) { - // Chunk was reallocated, toPool can be pooled. - putBuf(b.toPool) - } - if cap(b.bufs) == 0 { - b.bufs = make([][]byte, 0, 8) - } - b.bufs = append(b.bufs, b.Buf) - l = cap(b.toPool) * 2 - } else { - l = config.StartSize - } - - if l > config.MaxSize { - l = config.MaxSize - } - b.Buf = getBuf(l) - b.toPool = b.Buf -} - -// AppendByte appends a single byte to buffer. -func (b *Buffer) AppendByte(data byte) { - b.EnsureSpace(1) - b.Buf = append(b.Buf, data) -} - -// AppendBytes appends a byte slice to buffer. -func (b *Buffer) AppendBytes(data []byte) { - if len(data) <= cap(b.Buf)-len(b.Buf) { - b.Buf = append(b.Buf, data...) // fast path - } else { - b.appendBytesSlow(data) - } -} - -func (b *Buffer) appendBytesSlow(data []byte) { - for len(data) > 0 { - b.EnsureSpace(1) - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// AppendString appends a string to buffer. -func (b *Buffer) AppendString(data string) { - if len(data) <= cap(b.Buf)-len(b.Buf) { - b.Buf = append(b.Buf, data...) // fast path - } else { - b.appendStringSlow(data) - } -} - -func (b *Buffer) appendStringSlow(data string) { - for len(data) > 0 { - b.EnsureSpace(1) - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// Size computes the size of a buffer by adding sizes of every chunk. -func (b *Buffer) Size() int { - size := len(b.Buf) - for _, buf := range b.bufs { - size += len(buf) - } - return size -} - -// DumpTo outputs the contents of a buffer to a writer and resets the buffer. -func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { - bufs := net.Buffers(b.bufs) - if len(b.Buf) > 0 { - bufs = append(bufs, b.Buf) - } - n, err := bufs.WriteTo(w) - - for _, buf := range b.bufs { - putBuf(buf) - } - putBuf(b.toPool) - - b.bufs = nil - b.Buf = nil - b.toPool = nil - - return int(n), err -} - -// BuildBytes creates a single byte slice with all the contents of the buffer. Data is -// copied if it does not fit in a single chunk. You can optionally provide one byte -// slice as argument that it will try to reuse. -func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { - if len(b.bufs) == 0 { - ret := b.Buf - b.toPool = nil - b.Buf = nil - return ret - } - - var ret []byte - size := b.Size() - - // If we got a buffer as argument and it is big enough, reuse it. - if len(reuse) == 1 && cap(reuse[0]) >= size { - ret = reuse[0][:0] - } else { - ret = make([]byte, 0, size) - } - for _, buf := range b.bufs { - ret = append(ret, buf...) - putBuf(buf) - } - - ret = append(ret, b.Buf...) - putBuf(b.toPool) - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} - -type readCloser struct { - offset int - bufs [][]byte -} - -func (r *readCloser) Read(p []byte) (n int, err error) { - for _, buf := range r.bufs { - // Copy as much as we can. - x := copy(p[n:], buf[r.offset:]) - n += x // Increment how much we filled. - - // Did we empty the whole buffer? - if r.offset+x == len(buf) { - // On to the next buffer. - r.offset = 0 - r.bufs = r.bufs[1:] - - // We can release this buffer. - putBuf(buf) - } else { - r.offset += x - } - - if n == len(p) { - break - } - } - // No buffers left or nothing read? - if len(r.bufs) == 0 { - err = io.EOF - } - return -} - -func (r *readCloser) Close() error { - // Release all remaining buffers. - for _, buf := range r.bufs { - putBuf(buf) - } - // In case Close gets called multiple times. - r.bufs = nil - - return nil -} - -// ReadCloser creates an io.ReadCloser with all the contents of the buffer. -func (b *Buffer) ReadCloser() io.ReadCloser { - ret := &readCloser{0, append(b.bufs, b.Buf)} - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go deleted file mode 100644 index e68108f86..000000000 --- a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go +++ /dev/null @@ -1,21 +0,0 @@ -// This file will only be included to the build if neither -// easyjson_nounsafe nor appengine build tag is set. See README notes -// for more details. - -//+build !easyjson_nounsafe -//+build !appengine - -package jlexer - -import ( - "unsafe" -) - -// bytesToStr creates a string pointing at the slice to avoid copying. -// -// Warning: the string returned by the function should be used with care, as the whole input data -// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data -// may be garbage-collected even when the string exists. -func bytesToStr(data []byte) string { - return *(*string)(unsafe.Pointer(&data)) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go deleted file mode 100644 index 864d1be67..000000000 --- a/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go +++ /dev/null @@ -1,13 +0,0 @@ -// This file is included to the build if any of the buildtags below -// are defined. Refer to README notes for more details. - -//+build easyjson_nounsafe appengine - -package jlexer - -// bytesToStr creates a string normally from []byte -// -// Note that this method is roughly 1.5x slower than using the 'unsafe' method. -func bytesToStr(data []byte) string { - return string(data) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/error.go b/vendor/github.com/mailru/easyjson/jlexer/error.go deleted file mode 100644 index e90ec40d0..000000000 --- a/vendor/github.com/mailru/easyjson/jlexer/error.go +++ /dev/null @@ -1,15 +0,0 @@ -package jlexer - -import "fmt" - -// LexerError implements the error interface and represents all possible errors that can be -// generated during parsing the JSON data. -type LexerError struct { - Reason string - Offset int - Data string -} - -func (l *LexerError) Error() string { - return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go deleted file mode 100644 index a27705b12..000000000 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ /dev/null @@ -1,1257 +0,0 @@ -// Package jlexer contains a JSON lexer implementation. -// -// It is expected that it is mostly used with generated parser code, so the interface is tuned -// for a parser that knows what kind of data is expected. -package jlexer - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "strconv" - "unicode" - "unicode/utf16" - "unicode/utf8" - - "github.com/josharian/intern" -) - -// TokenKind determines type of a token. -type TokenKind byte - -const ( - TokenUndef TokenKind = iota // No token. - TokenDelim // Delimiter: one of '{', '}', '[' or ']'. - TokenString // A string literal, e.g. "abc\u1234" - TokenNumber // Number literal, e.g. 1.5e5 - TokenBool // Boolean literal: true or false. - TokenNull // null keyword. -) - -// token describes a single token: type, position in the input and value. -type token struct { - kind TokenKind // Type of a token. - - boolValue bool // Value if a boolean literal token. - byteValueCloned bool // true if byteValue was allocated and does not refer to original json body - byteValue []byte // Raw value of a token. - delimValue byte -} - -// Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. -type Lexer struct { - Data []byte // Input data given to the lexer. - - start int // Start of the current token. - pos int // Current unscanned position in the input stream. - token token // Last scanned token, if token.kind != TokenUndef. - - firstElement bool // Whether current element is the first in array or an object. - wantSep byte // A comma or a colon character, which need to occur before a token. - - UseMultipleErrors bool // If we want to use multiple errors. - fatalError error // Fatal error occurred during lexing. It is usually a syntax error. - multipleErrors []*LexerError // Semantic errors occurred during lexing. Marshalling will be continued after finding this errors. -} - -// FetchToken scans the input for the next token. -func (r *Lexer) FetchToken() { - r.token.kind = TokenUndef - r.start = r.pos - - // Check if r.Data has r.pos element - // If it doesn't, it mean corrupted input data - if len(r.Data) < r.pos { - r.errParse("Unexpected end of data") - return - } - // Determine the type of a token by skipping whitespace and reading the - // first character. - for _, c := range r.Data[r.pos:] { - switch c { - case ':', ',': - if r.wantSep == c { - r.pos++ - r.start++ - r.wantSep = 0 - } else { - r.errSyntax() - } - - case ' ', '\t', '\r', '\n': - r.pos++ - r.start++ - - case '"': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = TokenString - r.fetchString() - return - - case '{', '[': - if r.wantSep != 0 { - r.errSyntax() - } - r.firstElement = true - r.token.kind = TokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '}', ']': - if !r.firstElement && (r.wantSep != ',') { - r.errSyntax() - } - r.wantSep = 0 - r.token.kind = TokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-': - if r.wantSep != 0 { - r.errSyntax() - } - r.token.kind = TokenNumber - r.fetchNumber() - return - - case 'n': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = TokenNull - r.fetchNull() - return - - case 't': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = TokenBool - r.token.boolValue = true - r.fetchTrue() - return - - case 'f': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = TokenBool - r.token.boolValue = false - r.fetchFalse() - return - - default: - r.errSyntax() - return - } - } - r.fatalError = io.EOF - return -} - -// isTokenEnd returns true if the char can follow a non-delimiter token -func isTokenEnd(c byte) bool { - return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '[' || c == ']' || c == '{' || c == '}' || c == ',' || c == ':' -} - -// fetchNull fetches and checks remaining bytes of null keyword. -func (r *Lexer) fetchNull() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'u' || - r.Data[r.pos-2] != 'l' || - r.Data[r.pos-1] != 'l' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchTrue fetches and checks remaining bytes of true keyword. -func (r *Lexer) fetchTrue() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'r' || - r.Data[r.pos-2] != 'u' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchFalse fetches and checks remaining bytes of false keyword. -func (r *Lexer) fetchFalse() { - r.pos += 5 - if r.pos > len(r.Data) || - r.Data[r.pos-4] != 'a' || - r.Data[r.pos-3] != 'l' || - r.Data[r.pos-2] != 's' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 5 - r.errSyntax() - } -} - -// fetchNumber scans a number literal token. -func (r *Lexer) fetchNumber() { - hasE := false - afterE := false - hasDot := false - - r.pos++ - for i, c := range r.Data[r.pos:] { - switch { - case c >= '0' && c <= '9': - afterE = false - case c == '.' && !hasDot: - hasDot = true - case (c == 'e' || c == 'E') && !hasE: - hasE = true - hasDot = true - afterE = true - case (c == '+' || c == '-') && afterE: - afterE = false - default: - r.pos += i - if !isTokenEnd(c) { - r.errSyntax() - } else { - r.token.byteValue = r.Data[r.start:r.pos] - } - return - } - } - - r.pos = len(r.Data) - r.token.byteValue = r.Data[r.start:] -} - -// findStringLen tries to scan into the string literal for ending quote char to determine required size. -// The size will be exact if no escapes are present and may be inexact if there are escaped chars. -func findStringLen(data []byte) (isValid bool, length int) { - for { - idx := bytes.IndexByte(data, '"') - if idx == -1 { - return false, len(data) - } - if idx == 0 || (idx > 0 && data[idx-1] != '\\') { - return true, length + idx - } - - // count \\\\\\\ sequences. even number of slashes means quote is not really escaped - cnt := 1 - for idx-cnt-1 >= 0 && data[idx-cnt-1] == '\\' { - cnt++ - } - if cnt%2 == 0 { - return true, length + idx - } - - length += idx + 1 - data = data[idx+1:] - } -} - -// unescapeStringToken performs unescaping of string token. -// if no escaping is needed, original string is returned, otherwise - a new one allocated -func (r *Lexer) unescapeStringToken() (err error) { - data := r.token.byteValue - var unescapedData []byte - - for { - i := bytes.IndexByte(data, '\\') - if i == -1 { - break - } - - escapedRune, escapedBytes, err := decodeEscape(data[i:]) - if err != nil { - r.errParse(err.Error()) - return err - } - - if unescapedData == nil { - unescapedData = make([]byte, 0, len(r.token.byteValue)) - } - - var d [4]byte - s := utf8.EncodeRune(d[:], escapedRune) - unescapedData = append(unescapedData, data[:i]...) - unescapedData = append(unescapedData, d[:s]...) - - data = data[i+escapedBytes:] - } - - if unescapedData != nil { - r.token.byteValue = append(unescapedData, data...) - r.token.byteValueCloned = true - } - return -} - -// getu4 decodes \uXXXX from the beginning of s, returning the hex value, -// or it returns -1. -func getu4(s []byte) rune { - if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { - return -1 - } - var val rune - for i := 2; i < len(s) && i < 6; i++ { - var v byte - c := s[i] - switch c { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - v = c - '0' - case 'a', 'b', 'c', 'd', 'e', 'f': - v = c - 'a' + 10 - case 'A', 'B', 'C', 'D', 'E', 'F': - v = c - 'A' + 10 - default: - return -1 - } - - val <<= 4 - val |= rune(v) - } - return val -} - -// decodeEscape processes a single escape sequence and returns number of bytes processed. -func decodeEscape(data []byte) (decoded rune, bytesProcessed int, err error) { - if len(data) < 2 { - return 0, 0, errors.New("incorrect escape symbol \\ at the end of token") - } - - c := data[1] - switch c { - case '"', '/', '\\': - return rune(c), 2, nil - case 'b': - return '\b', 2, nil - case 'f': - return '\f', 2, nil - case 'n': - return '\n', 2, nil - case 'r': - return '\r', 2, nil - case 't': - return '\t', 2, nil - case 'u': - rr := getu4(data) - if rr < 0 { - return 0, 0, errors.New("incorrectly escaped \\uXXXX sequence") - } - - read := 6 - if utf16.IsSurrogate(rr) { - rr1 := getu4(data[read:]) - if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { - read += 6 - rr = dec - } else { - rr = unicode.ReplacementChar - } - } - return rr, read, nil - } - - return 0, 0, errors.New("incorrectly escaped bytes") -} - -// fetchString scans a string literal token. -func (r *Lexer) fetchString() { - r.pos++ - data := r.Data[r.pos:] - - isValid, length := findStringLen(data) - if !isValid { - r.pos += length - r.errParse("unterminated string literal") - return - } - r.token.byteValue = data[:length] - r.pos += length + 1 // skip closing '"' as well -} - -// scanToken scans the next token if no token is currently available in the lexer. -func (r *Lexer) scanToken() { - if r.token.kind != TokenUndef || r.fatalError != nil { - return - } - - r.FetchToken() -} - -// consume resets the current token to allow scanning the next one. -func (r *Lexer) consume() { - r.token.kind = TokenUndef - r.token.byteValueCloned = false - r.token.delimValue = 0 -} - -// Ok returns true if no error (including io.EOF) was encountered during scanning. -func (r *Lexer) Ok() bool { - return r.fatalError == nil -} - -const maxErrorContextLen = 13 - -func (r *Lexer) errParse(what string) { - if r.fatalError == nil { - var str string - if len(r.Data)-r.pos <= maxErrorContextLen { - str = string(r.Data) - } else { - str = string(r.Data[r.pos:r.pos+maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: what, - Offset: r.pos, - Data: str, - } - } -} - -func (r *Lexer) errSyntax() { - r.errParse("syntax error") -} - -func (r *Lexer) errInvalidToken(expected string) { - if r.fatalError != nil { - return - } - if r.UseMultipleErrors { - r.pos = r.start - r.consume() - r.SkipRecursive() - switch expected { - case "[": - r.token.delimValue = ']' - r.token.kind = TokenDelim - case "{": - r.token.delimValue = '}' - r.token.kind = TokenDelim - } - r.addNonfatalError(&LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - }) - return - } - - var str string - if len(r.token.byteValue) <= maxErrorContextLen { - str = string(r.token.byteValue) - } else { - str = string(r.token.byteValue[:maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.pos, - Data: str, - } -} - -func (r *Lexer) GetPos() int { - return r.pos -} - -// Delim consumes a token and verifies that it is the given delimiter. -func (r *Lexer) Delim(c byte) { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() || r.token.delimValue != c { - r.consume() // errInvalidToken can change token if UseMultipleErrors is enabled. - r.errInvalidToken(string([]byte{c})) - } else { - r.consume() - } -} - -// IsDelim returns true if there was no scanning error and next token is the given delimiter. -func (r *Lexer) IsDelim(c byte) bool { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - return !r.Ok() || r.token.delimValue == c -} - -// Null verifies that the next token is null and consumes it. -func (r *Lexer) Null() { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenNull { - r.errInvalidToken("null") - } - r.consume() -} - -// IsNull returns true if the next token is a null keyword. -func (r *Lexer) IsNull() bool { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - return r.Ok() && r.token.kind == TokenNull -} - -// Skip skips a single token. -func (r *Lexer) Skip() { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - r.consume() -} - -// SkipRecursive skips next array or object completely, or just skips a single token if not -// an array/object. -// -// Note: no syntax validation is performed on the skipped data. -func (r *Lexer) SkipRecursive() { - r.scanToken() - var start, end byte - startPos := r.start - - switch r.token.delimValue { - case '{': - start, end = '{', '}' - case '[': - start, end = '[', ']' - default: - r.consume() - return - } - - r.consume() - - level := 1 - inQuotes := false - wasEscape := false - - for i, c := range r.Data[r.pos:] { - switch { - case c == start && !inQuotes: - level++ - case c == end && !inQuotes: - level-- - if level == 0 { - r.pos += i + 1 - if !json.Valid(r.Data[startPos:r.pos]) { - r.pos = len(r.Data) - r.fatalError = &LexerError{ - Reason: "skipped array/object json value is invalid", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - } - } - return - } - case c == '\\' && inQuotes: - wasEscape = !wasEscape - continue - case c == '"' && inQuotes: - inQuotes = wasEscape - case c == '"': - inQuotes = true - } - wasEscape = false - } - r.pos = len(r.Data) - r.fatalError = &LexerError{ - Reason: "EOF reached while skipping array/object or token", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - } -} - -// Raw fetches the next item recursively as a data slice -func (r *Lexer) Raw() []byte { - r.SkipRecursive() - if !r.Ok() { - return nil - } - return r.Data[r.start:r.pos] -} - -// IsStart returns whether the lexer is positioned at the start -// of an input string. -func (r *Lexer) IsStart() bool { - return r.pos == 0 -} - -// Consumed reads all remaining bytes from the input, publishing an error if -// there is anything but whitespace remaining. -func (r *Lexer) Consumed() { - if r.pos > len(r.Data) || !r.Ok() { - return - } - - for _, c := range r.Data[r.pos:] { - if c != ' ' && c != '\t' && c != '\r' && c != '\n' { - r.AddError(&LexerError{ - Reason: "invalid character '" + string(c) + "' after top-level value", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - }) - return - } - - r.pos++ - r.start++ - } -} - -func (r *Lexer) unsafeString(skipUnescape bool) (string, []byte) { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenString { - r.errInvalidToken("string") - return "", nil - } - if !skipUnescape { - if err := r.unescapeStringToken(); err != nil { - r.errInvalidToken("string") - return "", nil - } - } - - bytes := r.token.byteValue - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret, bytes -} - -// UnsafeString returns the string value if the token is a string literal. -// -// Warning: returned string may point to the input buffer, so the string should not outlive -// the input buffer. Intended pattern of usage is as an argument to a switch statement. -func (r *Lexer) UnsafeString() string { - ret, _ := r.unsafeString(false) - return ret -} - -// UnsafeBytes returns the byte slice if the token is a string literal. -func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString(false) - return ret -} - -// UnsafeFieldName returns current member name string token -func (r *Lexer) UnsafeFieldName(skipUnescape bool) string { - ret, _ := r.unsafeString(skipUnescape) - return ret -} - -// String reads a string literal. -func (r *Lexer) String() string { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenString { - r.errInvalidToken("string") - return "" - } - if err := r.unescapeStringToken(); err != nil { - r.errInvalidToken("string") - return "" - } - var ret string - if r.token.byteValueCloned { - ret = bytesToStr(r.token.byteValue) - } else { - ret = string(r.token.byteValue) - } - r.consume() - return ret -} - -// StringIntern reads a string literal, and performs string interning on it. -func (r *Lexer) StringIntern() string { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenString { - r.errInvalidToken("string") - return "" - } - if err := r.unescapeStringToken(); err != nil { - r.errInvalidToken("string") - return "" - } - ret := intern.Bytes(r.token.byteValue) - r.consume() - return ret -} - -// Bytes reads a string literal and base64 decodes it into a byte slice. -func (r *Lexer) Bytes() []byte { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenString { - r.errInvalidToken("string") - return nil - } - if err := r.unescapeStringToken(); err != nil { - r.errInvalidToken("string") - return nil - } - ret := make([]byte, base64.StdEncoding.DecodedLen(len(r.token.byteValue))) - n, err := base64.StdEncoding.Decode(ret, r.token.byteValue) - if err != nil { - r.fatalError = &LexerError{ - Reason: err.Error(), - } - return nil - } - - r.consume() - return ret[:n] -} - -// Bool reads a true or false boolean keyword. -func (r *Lexer) Bool() bool { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenBool { - r.errInvalidToken("bool") - return false - } - ret := r.token.boolValue - r.consume() - return ret -} - -func (r *Lexer) number() string { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != TokenNumber { - r.errInvalidToken("number") - return "" - } - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret -} - -func (r *Lexer) Uint8() uint8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16() uint16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32() uint32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64() uint64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Uint() uint { - return uint(r.Uint64()) -} - -func (r *Lexer) Int8() int8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int8(n) -} - -func (r *Lexer) Int16() int16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int16(n) -} - -func (r *Lexer) Int32() int32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int32(n) -} - -func (r *Lexer) Int64() int64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Int() int { - return int(r.Int64()) -} - -func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) UintStr() uint { - return uint(r.Uint64Str()) -} - -func (r *Lexer) UintptrStr() uintptr { - return uintptr(r.Uint64Str()) -} - -func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int8(n) -} - -func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int16(n) -} - -func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int32(n) -} - -func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) IntStr() int { - return int(r.Int64Str()) -} - -func (r *Lexer) Float32() float32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return float32(n) -} - -func (r *Lexer) Float32Str() float32 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return float32(n) -} - -func (r *Lexer) Float64() float64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Float64Str() float64 { - s, b := r.unsafeString(false) - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) Error() error { - return r.fatalError -} - -func (r *Lexer) AddError(e error) { - if r.fatalError == nil { - r.fatalError = e - } -} - -func (r *Lexer) AddNonFatalError(e error) { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - Reason: e.Error(), - }) -} - -func (r *Lexer) addNonfatalError(err *LexerError) { - if r.UseMultipleErrors { - // We don't want to add errors with the same offset. - if len(r.multipleErrors) != 0 && r.multipleErrors[len(r.multipleErrors)-1].Offset == err.Offset { - return - } - r.multipleErrors = append(r.multipleErrors, err) - return - } - r.fatalError = err -} - -func (r *Lexer) GetNonFatalErrors() []*LexerError { - return r.multipleErrors -} - -// JsonNumber fetches and json.Number from 'encoding/json' package. -// Both int, float or string, contains them are valid values -func (r *Lexer) JsonNumber() json.Number { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() { - r.errInvalidToken("json.Number") - return json.Number("") - } - - switch r.token.kind { - case TokenString: - return json.Number(r.String()) - case TokenNumber: - return json.Number(r.Raw()) - case TokenNull: - r.Null() - return json.Number("") - default: - r.errSyntax() - return json.Number("") - } -} - -// Interface fetches an interface{} analogous to the 'encoding/json' package. -func (r *Lexer) Interface() interface{} { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() { - return nil - } - switch r.token.kind { - case TokenString: - return r.String() - case TokenNumber: - return r.Float64() - case TokenBool: - return r.Bool() - case TokenNull: - r.Null() - return nil - } - - if r.token.delimValue == '{' { - r.consume() - - ret := map[string]interface{}{} - for !r.IsDelim('}') { - key := r.String() - r.WantColon() - ret[key] = r.Interface() - r.WantComma() - } - r.Delim('}') - - if r.Ok() { - return ret - } else { - return nil - } - } else if r.token.delimValue == '[' { - r.consume() - - ret := []interface{}{} - for !r.IsDelim(']') { - ret = append(ret, r.Interface()) - r.WantComma() - } - r.Delim(']') - - if r.Ok() { - return ret - } else { - return nil - } - } - r.errSyntax() - return nil -} - -// WantComma requires a comma to be present before fetching next token. -func (r *Lexer) WantComma() { - r.wantSep = ',' - r.firstElement = false -} - -// WantColon requires a colon to be present before fetching next token. -func (r *Lexer) WantColon() { - r.wantSep = ':' - r.firstElement = false -} - -// CurrentToken returns current token kind if there were no errors and TokenUndef otherwise -func (r *Lexer) CurrentToken() TokenKind { - if r.token.kind == TokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() { - return TokenUndef - } - - return r.token.kind -} diff --git a/vendor/github.com/mailru/easyjson/jwriter/writer.go b/vendor/github.com/mailru/easyjson/jwriter/writer.go deleted file mode 100644 index 34b0ade46..000000000 --- a/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ /dev/null @@ -1,417 +0,0 @@ -// Package jwriter contains a JSON writer. -package jwriter - -import ( - "io" - "strconv" - "unicode/utf8" - - "github.com/mailru/easyjson/buffer" -) - -// Flags describe various encoding options. The behavior may be actually implemented in the encoder, but -// Flags field in Writer is used to set and pass them around. -type Flags int - -const ( - NilMapAsEmpty Flags = 1 << iota // Encode nil map as '{}' rather than 'null'. - NilSliceAsEmpty // Encode nil slice as '[]' rather than 'null'. -) - -// Writer is a JSON writer. -type Writer struct { - Flags Flags - - Error error - Buffer buffer.Buffer - NoEscapeHTML bool -} - -// Size returns the size of the data that was written out. -func (w *Writer) Size() int { - return w.Buffer.Size() -} - -// DumpTo outputs the data to given io.Writer, resetting the buffer. -func (w *Writer) DumpTo(out io.Writer) (written int, err error) { - return w.Buffer.DumpTo(out) -} - -// BuildBytes returns writer data as a single byte slice. You can optionally provide one byte slice -// as argument that it will try to reuse. -func (w *Writer) BuildBytes(reuse ...[]byte) ([]byte, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.BuildBytes(reuse...), nil -} - -// ReadCloser returns an io.ReadCloser that can be used to read the data. -// ReadCloser also resets the buffer. -func (w *Writer) ReadCloser() (io.ReadCloser, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.ReadCloser(), nil -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawByte(c byte) { - w.Buffer.AppendByte(c) -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawString(s string) { - w.Buffer.AppendString(s) -} - -// RawBytesString appends string from bytes to the buffer. -func (w *Writer) RawBytesString(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - default: - w.String(string(data)) - } -} - -// Raw appends raw binary data to the buffer or sets the error if it is given. Useful for -// calling with results of MarshalJSON-like functions. -func (w *Writer) Raw(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.Buffer.AppendBytes(data) - default: - w.RawString("null") - } -} - -// RawText encloses raw binary data in quotes and appends in to the buffer. -// Useful for calling with results of MarshalText-like functions. -func (w *Writer) RawText(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.String(string(data)) - default: - w.RawString("null") - } -} - -// Base64Bytes appends data to the buffer after base64 encoding it -func (w *Writer) Base64Bytes(data []byte) { - if data == nil { - w.Buffer.AppendString("null") - return - } - w.Buffer.AppendByte('"') - w.base64(data) - w.Buffer.AppendByte('"') -} - -func (w *Writer) Uint8(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint16(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint32(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint64(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Int8(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int16(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int32(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int64(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Uint8Str(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint16Str(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint32Str(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintStr(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint64Str(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintptrStr(n uintptr) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int8Str(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int16Str(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int32Str(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) IntStr(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int64Str(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Float32(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) -} - -func (w *Writer) Float32Str(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Float64(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, n, 'g', -1, 64) -} - -func (w *Writer) Float64Str(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 64) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Bool(v bool) { - w.Buffer.EnsureSpace(5) - if v { - w.Buffer.Buf = append(w.Buffer.Buf, "true"...) - } else { - w.Buffer.Buf = append(w.Buffer.Buf, "false"...) - } -} - -const chars = "0123456789abcdef" - -func getTable(falseValues ...int) [128]bool { - table := [128]bool{} - - for i := 0; i < 128; i++ { - table[i] = true - } - - for _, v := range falseValues { - table[v] = false - } - - return table -} - -var ( - htmlEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '&', '<', '>', '\\') - htmlNoEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '\\') -) - -func (w *Writer) String(s string) { - w.Buffer.AppendByte('"') - - // Portions of the string that contain no escapes are appended as - // byte slices. - - p := 0 // last non-escape symbol - - escapeTable := &htmlEscapeTable - if w.NoEscapeHTML { - escapeTable = &htmlNoEscapeTable - } - - for i := 0; i < len(s); { - c := s[i] - - if c < utf8.RuneSelf { - if escapeTable[c] { - // single-width character, no escaping is required - i++ - continue - } - - w.Buffer.AppendString(s[p:i]) - switch c { - case '\t': - w.Buffer.AppendString(`\t`) - case '\r': - w.Buffer.AppendString(`\r`) - case '\n': - w.Buffer.AppendString(`\n`) - case '\\': - w.Buffer.AppendString(`\\`) - case '"': - w.Buffer.AppendString(`\"`) - default: - w.Buffer.AppendString(`\u00`) - w.Buffer.AppendByte(chars[c>>4]) - w.Buffer.AppendByte(chars[c&0xf]) - } - - i++ - p = i - continue - } - - // broken utf - runeValue, runeWidth := utf8.DecodeRuneInString(s[i:]) - if runeValue == utf8.RuneError && runeWidth == 1 { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\ufffd`) - i++ - p = i - continue - } - - // jsonp stuff - tab separator and line separator - if runeValue == '\u2028' || runeValue == '\u2029' { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\u202`) - w.Buffer.AppendByte(chars[runeValue&0xf]) - i += runeWidth - p = i - continue - } - i += runeWidth - } - w.Buffer.AppendString(s[p:]) - w.Buffer.AppendByte('"') -} - -const encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -const padChar = '=' - -func (w *Writer) base64(in []byte) { - - if len(in) == 0 { - return - } - - w.Buffer.EnsureSpace(((len(in)-1)/3 + 1) * 4) - - si := 0 - n := (len(in) / 3) * 3 - - for si < n { - // Convert 3x 8bit source bytes into 4 bytes - val := uint(in[si+0])<<16 | uint(in[si+1])<<8 | uint(in[si+2]) - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F], encode[val>>6&0x3F], encode[val&0x3F]) - - si += 3 - } - - remain := len(in) - si - if remain == 0 { - return - } - - // Add the remaining small block - val := uint(in[si+0]) << 16 - if remain == 2 { - val |= uint(in[si+1]) << 8 - } - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F]) - - switch remain { - case 2: - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>6&0x3F], byte(padChar)) - case 1: - w.Buffer.Buf = append(w.Buffer.Buf, byte(padChar), byte(padChar)) - } -} diff --git a/vendor/github.com/moby/spdystream/CONTRIBUTING.md b/vendor/github.com/moby/spdystream/CONTRIBUTING.md deleted file mode 100644 index d4eddcc53..000000000 --- a/vendor/github.com/moby/spdystream/CONTRIBUTING.md +++ /dev/null @@ -1,13 +0,0 @@ -# Contributing to SpdyStream - -Want to hack on spdystream? Awesome! Here are instructions to get you -started. - -SpdyStream is a part of the [Docker](https://docker.io) project, and follows -the same rules and principles. If you're already familiar with the way -Docker does things, you'll feel right at home. - -Otherwise, go read -[Docker's contributions guidelines](https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md). - -Happy hacking! diff --git a/vendor/github.com/moby/spdystream/MAINTAINERS b/vendor/github.com/moby/spdystream/MAINTAINERS deleted file mode 100644 index 26e5ec828..000000000 --- a/vendor/github.com/moby/spdystream/MAINTAINERS +++ /dev/null @@ -1,40 +0,0 @@ -# Spdystream maintainers file -# -# This file describes who runs the moby/spdystream project and how. -# This is a living document - if you see something out of date or missing, speak up! -# -# It is structured to be consumable by both humans and programs. -# To extract its contents programmatically, use any TOML-compliant parser. -# -# This file is compiled into the MAINTAINERS file in docker/opensource. -# -[Org] - [Org."Core maintainers"] - people = [ - "adisky", - "dims", - "dmcgowan", - ] - -[people] - -# A reference list of all people associated with the project. -# All other sections should refer to people by their canonical key -# in the people section. - - # ADD YOURSELF HERE IN ALPHABETICAL ORDER - - [people.adisky] - Name = "Aditi Sharma" - Email = "adi.sky17@gmail.com" - GitHub = "adisky" - - [people.dims] - Name = "Davanum Srinivas" - Email = "davanum@gmail.com" - GitHub = "dims" - - [people.dmcgowan] - Name = "Derek McGowan" - Email = "derek@mcg.dev" - GitHub = "dmcgowan" diff --git a/vendor/github.com/moby/spdystream/NOTICE b/vendor/github.com/moby/spdystream/NOTICE deleted file mode 100644 index b9b11c9ab..000000000 --- a/vendor/github.com/moby/spdystream/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -SpdyStream -Copyright 2014-2021 Docker Inc. - -This product includes software developed at -Docker Inc. (https://www.docker.com/). diff --git a/vendor/github.com/moby/spdystream/README.md b/vendor/github.com/moby/spdystream/README.md deleted file mode 100644 index b84e98343..000000000 --- a/vendor/github.com/moby/spdystream/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# SpdyStream - -A multiplexed stream library using spdy - -## Usage - -Client example (connecting to mirroring server without auth) - -```go -package main - -import ( - "fmt" - "github.com/moby/spdystream" - "net" - "net/http" -) - -func main() { - conn, err := net.Dial("tcp", "localhost:8080") - if err != nil { - panic(err) - } - spdyConn, err := spdystream.NewConnection(conn, false) - if err != nil { - panic(err) - } - go spdyConn.Serve(spdystream.NoOpStreamHandler) - stream, err := spdyConn.CreateStream(http.Header{}, nil, false) - if err != nil { - panic(err) - } - - stream.Wait() - - fmt.Fprint(stream, "Writing to stream") - - buf := make([]byte, 25) - stream.Read(buf) - fmt.Println(string(buf)) - - stream.Close() -} -``` - -Server example (mirroring server without auth) - -```go -package main - -import ( - "github.com/moby/spdystream" - "net" -) - -func main() { - listener, err := net.Listen("tcp", "localhost:8080") - if err != nil { - panic(err) - } - for { - conn, err := listener.Accept() - if err != nil { - panic(err) - } - spdyConn, err := spdystream.NewConnection(conn, true) - if err != nil { - panic(err) - } - go spdyConn.Serve(spdystream.MirrorStreamHandler) - } -} -``` - -## Copyright and license - -Copyright 2013-2021 Docker, inc. Released under the [Apache 2.0 license](LICENSE). diff --git a/vendor/github.com/moby/spdystream/connection.go b/vendor/github.com/moby/spdystream/connection.go deleted file mode 100644 index 1394d0ad4..000000000 --- a/vendor/github.com/moby/spdystream/connection.go +++ /dev/null @@ -1,991 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package spdystream - -import ( - "errors" - "fmt" - "io" - "net" - "net/http" - "sync" - "time" - - "github.com/moby/spdystream/spdy" -) - -var ( - ErrInvalidStreamId = errors.New("Invalid stream id") - ErrTimeout = errors.New("Timeout occurred") - ErrReset = errors.New("Stream reset") - ErrWriteClosedStream = errors.New("Write on closed stream") -) - -const ( - FRAME_WORKERS = 5 - QUEUE_SIZE = 50 -) - -type StreamHandler func(stream *Stream) - -type AuthHandler func(header http.Header, slot uint8, parent uint32) bool - -type idleAwareFramer struct { - f *spdy.Framer - conn *Connection - writeLock sync.Mutex - resetChan chan struct{} - setTimeoutLock sync.Mutex - setTimeoutChan chan time.Duration - timeout time.Duration -} - -func newIdleAwareFramer(framer *spdy.Framer) *idleAwareFramer { - iaf := &idleAwareFramer{ - f: framer, - resetChan: make(chan struct{}, 2), - // setTimeoutChan needs to be buffered to avoid deadlocks when calling setIdleTimeout at about - // the same time the connection is being closed - setTimeoutChan: make(chan time.Duration, 1), - } - return iaf -} - -func (i *idleAwareFramer) monitor() { - var ( - timer *time.Timer - expired <-chan time.Time - resetChan = i.resetChan - setTimeoutChan = i.setTimeoutChan - ) -Loop: - for { - select { - case timeout := <-i.setTimeoutChan: - i.timeout = timeout - if timeout == 0 { - if timer != nil { - timer.Stop() - } - } else { - if timer == nil { - timer = time.NewTimer(timeout) - expired = timer.C - } else { - timer.Reset(timeout) - } - } - case <-resetChan: - if timer != nil && i.timeout > 0 { - timer.Reset(i.timeout) - } - case <-expired: - i.conn.streamCond.L.Lock() - streams := i.conn.streams - i.conn.streams = make(map[spdy.StreamId]*Stream) - i.conn.streamCond.Broadcast() - i.conn.streamCond.L.Unlock() - go func() { - for _, stream := range streams { - stream.resetStream() - } - i.conn.Close() - }() - case <-i.conn.closeChan: - if timer != nil { - timer.Stop() - } - - // Start a goroutine to drain resetChan. This is needed because we've seen - // some unit tests with large numbers of goroutines get into a situation - // where resetChan fills up, at least 1 call to Write() is still trying to - // send to resetChan, the connection gets closed, and this case statement - // attempts to grab the write lock that Write() already has, causing a - // deadlock. - // - // See https://github.com/moby/spdystream/issues/49 for more details. - go func() { - for range resetChan { - } - }() - - go func() { - for range setTimeoutChan { - } - }() - - i.writeLock.Lock() - close(resetChan) - i.resetChan = nil - i.writeLock.Unlock() - - i.setTimeoutLock.Lock() - close(i.setTimeoutChan) - i.setTimeoutChan = nil - i.setTimeoutLock.Unlock() - - break Loop - } - } - - // Drain resetChan - for range resetChan { - } -} - -func (i *idleAwareFramer) WriteFrame(frame spdy.Frame) error { - i.writeLock.Lock() - defer i.writeLock.Unlock() - if i.resetChan == nil { - return io.EOF - } - err := i.f.WriteFrame(frame) - if err != nil { - return err - } - - i.resetChan <- struct{}{} - - return nil -} - -func (i *idleAwareFramer) ReadFrame() (spdy.Frame, error) { - frame, err := i.f.ReadFrame() - if err != nil { - return nil, err - } - - // resetChan should never be closed since it is only closed - // when the connection has closed its closeChan. This closure - // only occurs after all Reads have finished - // TODO (dmcgowan): refactor relationship into connection - i.resetChan <- struct{}{} - - return frame, nil -} - -func (i *idleAwareFramer) setIdleTimeout(timeout time.Duration) { - i.setTimeoutLock.Lock() - defer i.setTimeoutLock.Unlock() - - if i.setTimeoutChan == nil { - return - } - - i.setTimeoutChan <- timeout -} - -type Connection struct { - conn net.Conn - framer *idleAwareFramer - - closeChan chan bool - goneAway bool - lastStreamChan chan<- *Stream - goAwayTimeout time.Duration - closeTimeout time.Duration - - streamLock *sync.RWMutex - streamCond *sync.Cond - streams map[spdy.StreamId]*Stream - - nextIdLock sync.Mutex - receiveIdLock sync.Mutex - nextStreamId spdy.StreamId - receivedStreamId spdy.StreamId - - // pingLock protects pingChans and pingId - pingLock sync.Mutex - pingId uint32 - pingChans map[uint32]chan error - - shutdownLock sync.Mutex - shutdownChan chan error - hasShutdown bool - - // for testing https://github.com/moby/spdystream/pull/56 - dataFrameHandler func(*spdy.DataFrame) error -} - -// NewConnection creates a new spdy connection from an existing -// network connection. -func NewConnection(conn net.Conn, server bool) (*Connection, error) { - framer, framerErr := spdy.NewFramer(conn, conn) - if framerErr != nil { - return nil, framerErr - } - idleAwareFramer := newIdleAwareFramer(framer) - var sid spdy.StreamId - var rid spdy.StreamId - var pid uint32 - if server { - sid = 2 - rid = 1 - pid = 2 - } else { - sid = 1 - rid = 2 - pid = 1 - } - - streamLock := new(sync.RWMutex) - streamCond := sync.NewCond(streamLock) - - session := &Connection{ - conn: conn, - framer: idleAwareFramer, - - closeChan: make(chan bool), - goAwayTimeout: time.Duration(0), - closeTimeout: time.Duration(0), - - streamLock: streamLock, - streamCond: streamCond, - streams: make(map[spdy.StreamId]*Stream), - nextStreamId: sid, - receivedStreamId: rid, - - pingId: pid, - pingChans: make(map[uint32]chan error), - - shutdownChan: make(chan error), - } - session.dataFrameHandler = session.handleDataFrame - idleAwareFramer.conn = session - go idleAwareFramer.monitor() - - return session, nil -} - -// Ping sends a ping frame across the connection and -// returns the response time -func (s *Connection) Ping() (time.Duration, error) { - pid := s.pingId - s.pingLock.Lock() - if s.pingId > 0x7ffffffe { - s.pingId = s.pingId - 0x7ffffffe - } else { - s.pingId = s.pingId + 2 - } - pingChan := make(chan error) - s.pingChans[pid] = pingChan - s.pingLock.Unlock() - defer func() { - s.pingLock.Lock() - delete(s.pingChans, pid) - s.pingLock.Unlock() - }() - - frame := &spdy.PingFrame{Id: pid} - startTime := time.Now() - writeErr := s.framer.WriteFrame(frame) - if writeErr != nil { - return time.Duration(0), writeErr - } - select { - case <-s.closeChan: - return time.Duration(0), errors.New("connection closed") - case err, ok := <-pingChan: - if ok && err != nil { - return time.Duration(0), err - } - break - } - return time.Since(startTime), nil -} - -// Serve handles frames sent from the server, including reply frames -// which are needed to fully initiate connections. Both clients and servers -// should call Serve in a separate goroutine before creating streams. -func (s *Connection) Serve(newHandler StreamHandler) { - // use a WaitGroup to wait for all frames to be drained after receiving - // go-away. - var wg sync.WaitGroup - - // Parition queues to ensure stream frames are handled - // by the same worker, ensuring order is maintained - frameQueues := make([]*PriorityFrameQueue, FRAME_WORKERS) - for i := 0; i < FRAME_WORKERS; i++ { - frameQueues[i] = NewPriorityFrameQueue(QUEUE_SIZE) - - // Ensure frame queue is drained when connection is closed - go func(frameQueue *PriorityFrameQueue) { - <-s.closeChan - frameQueue.Drain() - }(frameQueues[i]) - - wg.Add(1) - go func(frameQueue *PriorityFrameQueue) { - // let the WaitGroup know this worker is done - defer wg.Done() - - s.frameHandler(frameQueue, newHandler) - }(frameQueues[i]) - } - - var ( - partitionRoundRobin int - goAwayFrame *spdy.GoAwayFrame - ) -Loop: - for { - readFrame, err := s.framer.ReadFrame() - if err != nil { - if err != io.EOF { - debugMessage("frame read error: %s", err) - } else { - debugMessage("(%p) EOF received", s) - } - break - } - var priority uint8 - var partition int - switch frame := readFrame.(type) { - case *spdy.SynStreamFrame: - if s.checkStreamFrame(frame) { - priority = frame.Priority - partition = int(frame.StreamId % FRAME_WORKERS) - debugMessage("(%p) Add stream frame: %d ", s, frame.StreamId) - s.addStreamFrame(frame) - } else { - debugMessage("(%p) Rejected stream frame: %d ", s, frame.StreamId) - continue - } - case *spdy.SynReplyFrame: - priority = s.getStreamPriority(frame.StreamId) - partition = int(frame.StreamId % FRAME_WORKERS) - case *spdy.DataFrame: - priority = s.getStreamPriority(frame.StreamId) - partition = int(frame.StreamId % FRAME_WORKERS) - case *spdy.RstStreamFrame: - priority = s.getStreamPriority(frame.StreamId) - partition = int(frame.StreamId % FRAME_WORKERS) - case *spdy.HeadersFrame: - priority = s.getStreamPriority(frame.StreamId) - partition = int(frame.StreamId % FRAME_WORKERS) - case *spdy.PingFrame: - priority = 0 - partition = partitionRoundRobin - partitionRoundRobin = (partitionRoundRobin + 1) % FRAME_WORKERS - case *spdy.GoAwayFrame: - // hold on to the go away frame and exit the loop - goAwayFrame = frame - break Loop - default: - priority = 7 - partition = partitionRoundRobin - partitionRoundRobin = (partitionRoundRobin + 1) % FRAME_WORKERS - } - frameQueues[partition].Push(readFrame, priority) - } - close(s.closeChan) - - // wait for all frame handler workers to indicate they've drained their queues - // before handling the go away frame - wg.Wait() - - if goAwayFrame != nil { - s.handleGoAwayFrame(goAwayFrame) - } - - // now it's safe to close remote channels and empty s.streams - s.streamCond.L.Lock() - // notify streams that they're now closed, which will - // unblock any stream Read() calls - for _, stream := range s.streams { - stream.closeRemoteChannels() - } - s.streams = make(map[spdy.StreamId]*Stream) - s.streamCond.Broadcast() - s.streamCond.L.Unlock() -} - -func (s *Connection) frameHandler(frameQueue *PriorityFrameQueue, newHandler StreamHandler) { - for { - popFrame := frameQueue.Pop() - if popFrame == nil { - return - } - - var frameErr error - switch frame := popFrame.(type) { - case *spdy.SynStreamFrame: - frameErr = s.handleStreamFrame(frame, newHandler) - case *spdy.SynReplyFrame: - frameErr = s.handleReplyFrame(frame) - case *spdy.DataFrame: - frameErr = s.dataFrameHandler(frame) - case *spdy.RstStreamFrame: - frameErr = s.handleResetFrame(frame) - case *spdy.HeadersFrame: - frameErr = s.handleHeaderFrame(frame) - case *spdy.PingFrame: - frameErr = s.handlePingFrame(frame) - case *spdy.GoAwayFrame: - frameErr = s.handleGoAwayFrame(frame) - default: - frameErr = fmt.Errorf("unhandled frame type: %T", frame) - } - - if frameErr != nil { - debugMessage("frame handling error: %s", frameErr) - } - } -} - -func (s *Connection) getStreamPriority(streamId spdy.StreamId) uint8 { - stream, streamOk := s.getStream(streamId) - if !streamOk { - return 7 - } - return stream.priority -} - -func (s *Connection) addStreamFrame(frame *spdy.SynStreamFrame) { - var parent *Stream - if frame.AssociatedToStreamId != spdy.StreamId(0) { - parent, _ = s.getStream(frame.AssociatedToStreamId) - } - - stream := &Stream{ - streamId: frame.StreamId, - parent: parent, - conn: s, - startChan: make(chan error), - headers: frame.Headers, - finished: (frame.CFHeader.Flags & spdy.ControlFlagUnidirectional) != 0x00, - replyCond: sync.NewCond(new(sync.Mutex)), - dataChan: make(chan []byte), - headerChan: make(chan http.Header), - closeChan: make(chan bool), - priority: frame.Priority, - } - if frame.CFHeader.Flags&spdy.ControlFlagFin != 0x00 { - stream.closeRemoteChannels() - } - - s.addStream(stream) -} - -// checkStreamFrame checks to see if a stream frame is allowed. -// If the stream is invalid, then a reset frame with protocol error -// will be returned. -func (s *Connection) checkStreamFrame(frame *spdy.SynStreamFrame) bool { - s.receiveIdLock.Lock() - defer s.receiveIdLock.Unlock() - if s.goneAway { - return false - } - validationErr := s.validateStreamId(frame.StreamId) - if validationErr != nil { - go func() { - resetErr := s.sendResetFrame(spdy.ProtocolError, frame.StreamId) - if resetErr != nil { - debugMessage("reset error: %s", resetErr) - } - }() - return false - } - return true -} - -func (s *Connection) handleStreamFrame(frame *spdy.SynStreamFrame, newHandler StreamHandler) error { - stream, ok := s.getStream(frame.StreamId) - if !ok { - return fmt.Errorf("Missing stream: %d", frame.StreamId) - } - - newHandler(stream) - - return nil -} - -func (s *Connection) handleReplyFrame(frame *spdy.SynReplyFrame) error { - debugMessage("(%p) Reply frame received for %d", s, frame.StreamId) - stream, streamOk := s.getStream(frame.StreamId) - if !streamOk { - debugMessage("Reply frame gone away for %d", frame.StreamId) - // Stream has already gone away - return nil - } - if stream.replied { - // Stream has already received reply - return nil - } - stream.replied = true - - // TODO Check for error - if (frame.CFHeader.Flags & spdy.ControlFlagFin) != 0x00 { - s.remoteStreamFinish(stream) - } - - close(stream.startChan) - - return nil -} - -func (s *Connection) handleResetFrame(frame *spdy.RstStreamFrame) error { - stream, streamOk := s.getStream(frame.StreamId) - if !streamOk { - // Stream has already been removed - return nil - } - s.removeStream(stream) - stream.closeRemoteChannels() - - if !stream.replied { - stream.replied = true - stream.startChan <- ErrReset - close(stream.startChan) - } - - stream.finishLock.Lock() - stream.finished = true - stream.finishLock.Unlock() - - return nil -} - -func (s *Connection) handleHeaderFrame(frame *spdy.HeadersFrame) error { - stream, streamOk := s.getStream(frame.StreamId) - if !streamOk { - // Stream has already gone away - return nil - } - if !stream.replied { - // No reply received...Protocol error? - return nil - } - - // TODO limit headers while not blocking (use buffered chan or goroutine?) - select { - case <-stream.closeChan: - return nil - case stream.headerChan <- frame.Headers: - } - - if (frame.CFHeader.Flags & spdy.ControlFlagFin) != 0x00 { - s.remoteStreamFinish(stream) - } - - return nil -} - -func (s *Connection) handleDataFrame(frame *spdy.DataFrame) error { - debugMessage("(%p) Data frame received for %d", s, frame.StreamId) - stream, streamOk := s.getStream(frame.StreamId) - if !streamOk { - debugMessage("(%p) Data frame gone away for %d", s, frame.StreamId) - // Stream has already gone away - return nil - } - if !stream.replied { - debugMessage("(%p) Data frame not replied %d", s, frame.StreamId) - // No reply received...Protocol error? - return nil - } - - debugMessage("(%p) (%d) Data frame handling", stream, stream.streamId) - if len(frame.Data) > 0 { - stream.dataLock.RLock() - select { - case <-stream.closeChan: - debugMessage("(%p) (%d) Data frame not sent (stream shut down)", stream, stream.streamId) - case stream.dataChan <- frame.Data: - debugMessage("(%p) (%d) Data frame sent", stream, stream.streamId) - } - stream.dataLock.RUnlock() - } - if (frame.Flags & spdy.DataFlagFin) != 0x00 { - s.remoteStreamFinish(stream) - } - return nil -} - -func (s *Connection) handlePingFrame(frame *spdy.PingFrame) error { - s.pingLock.Lock() - pingId := s.pingId - pingChan, pingOk := s.pingChans[frame.Id] - s.pingLock.Unlock() - - if pingId&0x01 != frame.Id&0x01 { - return s.framer.WriteFrame(frame) - } - if pingOk { - close(pingChan) - } - return nil -} - -func (s *Connection) handleGoAwayFrame(frame *spdy.GoAwayFrame) error { - debugMessage("(%p) Go away received", s) - s.receiveIdLock.Lock() - if s.goneAway { - s.receiveIdLock.Unlock() - return nil - } - s.goneAway = true - s.receiveIdLock.Unlock() - - if s.lastStreamChan != nil { - stream, _ := s.getStream(frame.LastGoodStreamId) - go func() { - s.lastStreamChan <- stream - }() - } - - // Do not block frame handler waiting for closure - go s.shutdown(s.goAwayTimeout) - - return nil -} - -func (s *Connection) remoteStreamFinish(stream *Stream) { - stream.closeRemoteChannels() - - stream.finishLock.Lock() - if stream.finished { - // Stream is fully closed, cleanup - s.removeStream(stream) - } - stream.finishLock.Unlock() -} - -// CreateStream creates a new spdy stream using the parameters for -// creating the stream frame. The stream frame will be sent upon -// calling this function, however this function does not wait for -// the reply frame. If waiting for the reply is desired, use -// the stream Wait or WaitTimeout function on the stream returned -// by this function. -func (s *Connection) CreateStream(headers http.Header, parent *Stream, fin bool) (*Stream, error) { - // MUST synchronize stream creation (all the way to writing the frame) - // as stream IDs **MUST** increase monotonically. - s.nextIdLock.Lock() - defer s.nextIdLock.Unlock() - - streamId := s.getNextStreamId() - if streamId == 0 { - return nil, fmt.Errorf("Unable to get new stream id") - } - - stream := &Stream{ - streamId: streamId, - parent: parent, - conn: s, - startChan: make(chan error), - headers: headers, - dataChan: make(chan []byte), - headerChan: make(chan http.Header), - closeChan: make(chan bool), - } - - debugMessage("(%p) (%p) Create stream", s, stream) - - s.addStream(stream) - - return stream, s.sendStream(stream, fin) -} - -func (s *Connection) shutdown(closeTimeout time.Duration) { - // TODO Ensure this isn't called multiple times - s.shutdownLock.Lock() - if s.hasShutdown { - s.shutdownLock.Unlock() - return - } - s.hasShutdown = true - s.shutdownLock.Unlock() - - var timeout <-chan time.Time - if closeTimeout > time.Duration(0) { - timer := time.NewTimer(closeTimeout) - defer timer.Stop() - timeout = timer.C - } - streamsClosed := make(chan bool) - - go func() { - s.streamCond.L.Lock() - for len(s.streams) > 0 { - debugMessage("Streams opened: %d, %#v", len(s.streams), s.streams) - s.streamCond.Wait() - } - s.streamCond.L.Unlock() - close(streamsClosed) - }() - - var err error - select { - case <-streamsClosed: - // No active streams, close should be safe - err = s.conn.Close() - case <-timeout: - // Force ungraceful close - err = s.conn.Close() - // Wait for cleanup to clear active streams - <-streamsClosed - } - - if err != nil { - // default to 1 second - duration := time.Second - // if a closeTimeout was given, use that, clipped to 1s-10m - if closeTimeout > time.Second { - duration = closeTimeout - } - if duration > 10*time.Minute { - duration = 10 * time.Minute - } - timer := time.NewTimer(duration) - defer timer.Stop() - select { - case s.shutdownChan <- err: - // error was handled - case <-timer.C: - debugMessage("Unhandled close error after %s: %s", duration, err) - } - } - close(s.shutdownChan) -} - -// Closes spdy connection by sending GoAway frame and initiating shutdown -func (s *Connection) Close() error { - s.receiveIdLock.Lock() - if s.goneAway { - s.receiveIdLock.Unlock() - return nil - } - s.goneAway = true - s.receiveIdLock.Unlock() - - var lastStreamId spdy.StreamId - if s.receivedStreamId > 2 { - lastStreamId = s.receivedStreamId - 2 - } - - goAwayFrame := &spdy.GoAwayFrame{ - LastGoodStreamId: lastStreamId, - Status: spdy.GoAwayOK, - } - - err := s.framer.WriteFrame(goAwayFrame) - go s.shutdown(s.closeTimeout) - if err != nil { - return err - } - - return nil -} - -// CloseWait closes the connection and waits for shutdown -// to finish. Note the underlying network Connection -// is not closed until the end of shutdown. -func (s *Connection) CloseWait() error { - closeErr := s.Close() - if closeErr != nil { - return closeErr - } - shutdownErr, ok := <-s.shutdownChan - if ok { - return shutdownErr - } - return nil -} - -// Wait waits for the connection to finish shutdown or for -// the wait timeout duration to expire. This needs to be -// called either after Close has been called or the GOAWAYFRAME -// has been received. If the wait timeout is 0, this function -// will block until shutdown finishes. If wait is never called -// and a shutdown error occurs, that error will be logged as an -// unhandled error. -func (s *Connection) Wait(waitTimeout time.Duration) error { - var timeout <-chan time.Time - if waitTimeout > time.Duration(0) { - timer := time.NewTimer(waitTimeout) - defer timer.Stop() - timeout = timer.C - } - - select { - case err, ok := <-s.shutdownChan: - if ok { - return err - } - case <-timeout: - return ErrTimeout - } - return nil -} - -// NotifyClose registers a channel to be called when the remote -// peer inidicates connection closure. The last stream to be -// received by the remote will be sent on the channel. The notify -// timeout will determine the duration between go away received -// and the connection being closed. -func (s *Connection) NotifyClose(c chan<- *Stream, timeout time.Duration) { - s.goAwayTimeout = timeout - s.lastStreamChan = c -} - -// SetCloseTimeout sets the amount of time close will wait for -// streams to finish before terminating the underlying network -// connection. Setting the timeout to 0 will cause close to -// wait forever, which is the default. -func (s *Connection) SetCloseTimeout(timeout time.Duration) { - s.closeTimeout = timeout -} - -// SetIdleTimeout sets the amount of time the connection may sit idle before -// it is forcefully terminated. -func (s *Connection) SetIdleTimeout(timeout time.Duration) { - s.framer.setIdleTimeout(timeout) -} - -func (s *Connection) sendHeaders(headers http.Header, stream *Stream, fin bool) error { - var flags spdy.ControlFlags - if fin { - flags = spdy.ControlFlagFin - } - - headerFrame := &spdy.HeadersFrame{ - StreamId: stream.streamId, - Headers: headers, - CFHeader: spdy.ControlFrameHeader{Flags: flags}, - } - - return s.framer.WriteFrame(headerFrame) -} - -func (s *Connection) sendReply(headers http.Header, stream *Stream, fin bool) error { - var flags spdy.ControlFlags - if fin { - flags = spdy.ControlFlagFin - } - - replyFrame := &spdy.SynReplyFrame{ - StreamId: stream.streamId, - Headers: headers, - CFHeader: spdy.ControlFrameHeader{Flags: flags}, - } - - return s.framer.WriteFrame(replyFrame) -} - -func (s *Connection) sendResetFrame(status spdy.RstStreamStatus, streamId spdy.StreamId) error { - resetFrame := &spdy.RstStreamFrame{ - StreamId: streamId, - Status: status, - } - - return s.framer.WriteFrame(resetFrame) -} - -func (s *Connection) sendReset(status spdy.RstStreamStatus, stream *Stream) error { - return s.sendResetFrame(status, stream.streamId) -} - -func (s *Connection) sendStream(stream *Stream, fin bool) error { - var flags spdy.ControlFlags - if fin { - flags = spdy.ControlFlagFin - stream.finished = true - } - - var parentId spdy.StreamId - if stream.parent != nil { - parentId = stream.parent.streamId - } - - streamFrame := &spdy.SynStreamFrame{ - StreamId: spdy.StreamId(stream.streamId), - AssociatedToStreamId: spdy.StreamId(parentId), - Headers: stream.headers, - CFHeader: spdy.ControlFrameHeader{Flags: flags}, - } - - return s.framer.WriteFrame(streamFrame) -} - -// getNextStreamId returns the next sequential id -// every call should produce a unique value or an error -func (s *Connection) getNextStreamId() spdy.StreamId { - sid := s.nextStreamId - if sid > 0x7fffffff { - return 0 - } - s.nextStreamId = s.nextStreamId + 2 - return sid -} - -// PeekNextStreamId returns the next sequential id and keeps the next id untouched -func (s *Connection) PeekNextStreamId() spdy.StreamId { - sid := s.nextStreamId - return sid -} - -func (s *Connection) validateStreamId(rid spdy.StreamId) error { - if rid > 0x7fffffff || rid < s.receivedStreamId { - return ErrInvalidStreamId - } - s.receivedStreamId = rid + 2 - return nil -} - -func (s *Connection) addStream(stream *Stream) { - s.streamCond.L.Lock() - s.streams[stream.streamId] = stream - debugMessage("(%p) (%p) Stream added, broadcasting: %d", s, stream, stream.streamId) - s.streamCond.Broadcast() - s.streamCond.L.Unlock() -} - -func (s *Connection) removeStream(stream *Stream) { - s.streamCond.L.Lock() - delete(s.streams, stream.streamId) - debugMessage("(%p) (%p) Stream removed, broadcasting: %d", s, stream, stream.streamId) - s.streamCond.Broadcast() - s.streamCond.L.Unlock() -} - -func (s *Connection) getStream(streamId spdy.StreamId) (stream *Stream, ok bool) { - s.streamLock.RLock() - stream, ok = s.streams[streamId] - s.streamLock.RUnlock() - return -} - -// FindStream looks up the given stream id and either waits for the -// stream to be found or returns nil if the stream id is no longer -// valid. -func (s *Connection) FindStream(streamId uint32) *Stream { - var stream *Stream - var ok bool - s.streamCond.L.Lock() - stream, ok = s.streams[spdy.StreamId(streamId)] - debugMessage("(%p) Found stream %d? %t", s, spdy.StreamId(streamId), ok) - for !ok && streamId >= uint32(s.receivedStreamId) { - s.streamCond.Wait() - stream, ok = s.streams[spdy.StreamId(streamId)] - } - s.streamCond.L.Unlock() - return stream -} - -func (s *Connection) CloseChan() <-chan bool { - return s.closeChan -} diff --git a/vendor/github.com/moby/spdystream/handlers.go b/vendor/github.com/moby/spdystream/handlers.go deleted file mode 100644 index d68f61f81..000000000 --- a/vendor/github.com/moby/spdystream/handlers.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package spdystream - -import ( - "io" - "net/http" -) - -// MirrorStreamHandler mirrors all streams. -func MirrorStreamHandler(stream *Stream) { - replyErr := stream.SendReply(http.Header{}, false) - if replyErr != nil { - return - } - - go func() { - io.Copy(stream, stream) - stream.Close() - }() - go func() { - for { - header, receiveErr := stream.ReceiveHeader() - if receiveErr != nil { - return - } - sendErr := stream.SendHeader(header, false) - if sendErr != nil { - return - } - } - }() -} - -// NoopStreamHandler does nothing when stream connects. -func NoOpStreamHandler(stream *Stream) { - stream.SendReply(http.Header{}, false) -} diff --git a/vendor/github.com/moby/spdystream/priority.go b/vendor/github.com/moby/spdystream/priority.go deleted file mode 100644 index d8eb3516c..000000000 --- a/vendor/github.com/moby/spdystream/priority.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package spdystream - -import ( - "container/heap" - "sync" - - "github.com/moby/spdystream/spdy" -) - -type prioritizedFrame struct { - frame spdy.Frame - priority uint8 - insertId uint64 -} - -type frameQueue []*prioritizedFrame - -func (fq frameQueue) Len() int { - return len(fq) -} - -func (fq frameQueue) Less(i, j int) bool { - if fq[i].priority == fq[j].priority { - return fq[i].insertId < fq[j].insertId - } - return fq[i].priority < fq[j].priority -} - -func (fq frameQueue) Swap(i, j int) { - fq[i], fq[j] = fq[j], fq[i] -} - -func (fq *frameQueue) Push(x interface{}) { - *fq = append(*fq, x.(*prioritizedFrame)) -} - -func (fq *frameQueue) Pop() interface{} { - old := *fq - n := len(old) - *fq = old[0 : n-1] - return old[n-1] -} - -type PriorityFrameQueue struct { - queue *frameQueue - c *sync.Cond - size int - nextInsertId uint64 - drain bool -} - -func NewPriorityFrameQueue(size int) *PriorityFrameQueue { - queue := make(frameQueue, 0, size) - heap.Init(&queue) - - return &PriorityFrameQueue{ - queue: &queue, - size: size, - c: sync.NewCond(&sync.Mutex{}), - } -} - -func (q *PriorityFrameQueue) Push(frame spdy.Frame, priority uint8) { - q.c.L.Lock() - defer q.c.L.Unlock() - for q.queue.Len() >= q.size { - q.c.Wait() - } - pFrame := &prioritizedFrame{ - frame: frame, - priority: priority, - insertId: q.nextInsertId, - } - q.nextInsertId = q.nextInsertId + 1 - heap.Push(q.queue, pFrame) - q.c.Signal() -} - -func (q *PriorityFrameQueue) Pop() spdy.Frame { - q.c.L.Lock() - defer q.c.L.Unlock() - for q.queue.Len() == 0 { - if q.drain { - return nil - } - q.c.Wait() - } - frame := heap.Pop(q.queue).(*prioritizedFrame).frame - q.c.Signal() - return frame -} - -func (q *PriorityFrameQueue) Drain() { - q.c.L.Lock() - defer q.c.L.Unlock() - q.drain = true - q.c.Broadcast() -} diff --git a/vendor/github.com/moby/spdystream/spdy/dictionary.go b/vendor/github.com/moby/spdystream/spdy/dictionary.go deleted file mode 100644 index 392232f17..000000000 --- a/vendor/github.com/moby/spdystream/spdy/dictionary.go +++ /dev/null @@ -1,203 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package spdy - -// headerDictionary is the dictionary sent to the zlib compressor/decompressor. -var headerDictionary = []byte{ - 0x00, 0x00, 0x00, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x00, 0x00, 0x00, 0x04, 0x68, - 0x65, 0x61, 0x64, 0x00, 0x00, 0x00, 0x04, 0x70, - 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x03, 0x70, - 0x75, 0x74, 0x00, 0x00, 0x00, 0x06, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x00, 0x00, 0x00, 0x05, - 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x00, 0x00, - 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x00, - 0x00, 0x00, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x70, - 0x74, 0x2d, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, - 0x74, 0x00, 0x00, 0x00, 0x0f, 0x61, 0x63, 0x63, - 0x65, 0x70, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x0f, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x6c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, - 0x00, 0x00, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x70, - 0x74, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x00, 0x00, 0x00, 0x03, 0x61, 0x67, 0x65, 0x00, - 0x00, 0x00, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x00, 0x00, 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2d, 0x62, 0x61, 0x73, 0x65, - 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, - 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x00, 0x00, 0x00, 0x0e, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, - 0x00, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2d, 0x6d, 0x64, 0x35, 0x00, 0x00, 0x00, - 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, - 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00, - 0x00, 0x04, 0x64, 0x61, 0x74, 0x65, 0x00, 0x00, - 0x00, 0x04, 0x65, 0x74, 0x61, 0x67, 0x00, 0x00, - 0x00, 0x06, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, - 0x00, 0x00, 0x00, 0x07, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x73, 0x00, 0x00, 0x00, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x00, 0x00, 0x00, 0x04, 0x68, - 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x08, 0x69, - 0x66, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, - 0x00, 0x00, 0x11, 0x69, 0x66, 0x2d, 0x6d, 0x6f, - 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x73, - 0x69, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x0d, - 0x69, 0x66, 0x2d, 0x6e, 0x6f, 0x6e, 0x65, 0x2d, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, 0x00, 0x00, - 0x08, 0x69, 0x66, 0x2d, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x00, 0x00, 0x00, 0x13, 0x69, 0x66, 0x2d, - 0x75, 0x6e, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x2d, 0x73, 0x69, 0x6e, 0x63, 0x65, - 0x00, 0x00, 0x00, 0x0d, 0x6c, 0x61, 0x73, 0x74, - 0x2d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x00, 0x00, 0x00, 0x08, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, - 0x0c, 0x6d, 0x61, 0x78, 0x2d, 0x66, 0x6f, 0x72, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x00, 0x00, 0x00, - 0x06, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x00, - 0x00, 0x00, 0x12, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, 0x00, - 0x13, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, 0x00, - 0x07, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, - 0x00, 0x00, 0x00, 0x0b, 0x72, 0x65, 0x74, 0x72, - 0x79, 0x2d, 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, - 0x00, 0x00, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x00, 0x00, 0x00, 0x02, 0x74, 0x65, 0x00, - 0x00, 0x00, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, - 0x65, 0x72, 0x00, 0x00, 0x00, 0x11, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x65, - 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x00, - 0x00, 0x00, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x73, - 0x65, 0x72, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x00, 0x00, 0x00, 0x04, 0x76, 0x61, 0x72, 0x79, - 0x00, 0x00, 0x00, 0x03, 0x76, 0x69, 0x61, 0x00, - 0x00, 0x00, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, - 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, 0x77, 0x77, - 0x77, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, - 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, - 0x00, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x00, 0x00, 0x00, 0x03, 0x67, 0x65, 0x74, 0x00, - 0x00, 0x00, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x00, 0x00, 0x00, 0x06, 0x32, 0x30, 0x30, - 0x20, 0x4f, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x00, - 0x00, 0x08, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, - 0x2e, 0x31, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, - 0x6c, 0x00, 0x00, 0x00, 0x06, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x00, 0x00, 0x00, 0x0a, 0x73, - 0x65, 0x74, 0x2d, 0x63, 0x6f, 0x6f, 0x6b, 0x69, - 0x65, 0x00, 0x00, 0x00, 0x0a, 0x6b, 0x65, 0x65, - 0x70, 0x2d, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x00, - 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x32, - 0x30, 0x31, 0x32, 0x30, 0x32, 0x32, 0x30, 0x35, - 0x32, 0x30, 0x36, 0x33, 0x30, 0x30, 0x33, 0x30, - 0x32, 0x33, 0x30, 0x33, 0x33, 0x30, 0x34, 0x33, - 0x30, 0x35, 0x33, 0x30, 0x36, 0x33, 0x30, 0x37, - 0x34, 0x30, 0x32, 0x34, 0x30, 0x35, 0x34, 0x30, - 0x36, 0x34, 0x30, 0x37, 0x34, 0x30, 0x38, 0x34, - 0x30, 0x39, 0x34, 0x31, 0x30, 0x34, 0x31, 0x31, - 0x34, 0x31, 0x32, 0x34, 0x31, 0x33, 0x34, 0x31, - 0x34, 0x34, 0x31, 0x35, 0x34, 0x31, 0x36, 0x34, - 0x31, 0x37, 0x35, 0x30, 0x32, 0x35, 0x30, 0x34, - 0x35, 0x30, 0x35, 0x32, 0x30, 0x33, 0x20, 0x4e, - 0x6f, 0x6e, 0x2d, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x61, 0x74, 0x69, 0x76, 0x65, - 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x30, 0x34, 0x20, - 0x4e, 0x6f, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x33, 0x30, 0x31, 0x20, 0x4d, 0x6f, - 0x76, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x6d, - 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x34, - 0x30, 0x30, 0x20, 0x42, 0x61, 0x64, 0x20, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x34, 0x30, - 0x31, 0x20, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x34, 0x30, - 0x33, 0x20, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x6e, 0x34, 0x30, 0x34, 0x20, 0x4e, - 0x6f, 0x74, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, - 0x35, 0x30, 0x30, 0x20, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x20, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x35, 0x30, 0x31, 0x20, 0x4e, 0x6f, 0x74, - 0x20, 0x49, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x65, 0x64, 0x35, 0x30, 0x33, 0x20, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, - 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, - 0x62, 0x6c, 0x65, 0x4a, 0x61, 0x6e, 0x20, 0x46, - 0x65, 0x62, 0x20, 0x4d, 0x61, 0x72, 0x20, 0x41, - 0x70, 0x72, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x4a, - 0x75, 0x6e, 0x20, 0x4a, 0x75, 0x6c, 0x20, 0x41, - 0x75, 0x67, 0x20, 0x53, 0x65, 0x70, 0x74, 0x20, - 0x4f, 0x63, 0x74, 0x20, 0x4e, 0x6f, 0x76, 0x20, - 0x44, 0x65, 0x63, 0x20, 0x30, 0x30, 0x3a, 0x30, - 0x30, 0x3a, 0x30, 0x30, 0x20, 0x4d, 0x6f, 0x6e, - 0x2c, 0x20, 0x54, 0x75, 0x65, 0x2c, 0x20, 0x57, - 0x65, 0x64, 0x2c, 0x20, 0x54, 0x68, 0x75, 0x2c, - 0x20, 0x46, 0x72, 0x69, 0x2c, 0x20, 0x53, 0x61, - 0x74, 0x2c, 0x20, 0x53, 0x75, 0x6e, 0x2c, 0x20, - 0x47, 0x4d, 0x54, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x65, 0x64, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, - 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x2c, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x67, - 0x2c, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, - 0x69, 0x66, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, - 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, - 0x68, 0x74, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, - 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, - 0x61, 0x69, 0x6e, 0x2c, 0x74, 0x65, 0x78, 0x74, - 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2c, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, - 0x3d, 0x67, 0x7a, 0x69, 0x70, 0x2c, 0x64, 0x65, - 0x66, 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x64, - 0x63, 0x68, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, - 0x74, 0x3d, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x63, - 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x69, - 0x73, 0x6f, 0x2d, 0x38, 0x38, 0x35, 0x39, 0x2d, - 0x31, 0x2c, 0x75, 0x74, 0x66, 0x2d, 0x2c, 0x2a, - 0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e, -} diff --git a/vendor/github.com/moby/spdystream/spdy/read.go b/vendor/github.com/moby/spdystream/spdy/read.go deleted file mode 100644 index 75ea045b8..000000000 --- a/vendor/github.com/moby/spdystream/spdy/read.go +++ /dev/null @@ -1,364 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package spdy - -import ( - "compress/zlib" - "encoding/binary" - "io" - "net/http" - "strings" -) - -func (frame *SynStreamFrame) read(h ControlFrameHeader, f *Framer) error { - return f.readSynStreamFrame(h, frame) -} - -func (frame *SynReplyFrame) read(h ControlFrameHeader, f *Framer) error { - return f.readSynReplyFrame(h, frame) -} - -func (frame *RstStreamFrame) read(h ControlFrameHeader, f *Framer) error { - frame.CFHeader = h - if err := binary.Read(f.r, binary.BigEndian, &frame.StreamId); err != nil { - return err - } - if err := binary.Read(f.r, binary.BigEndian, &frame.Status); err != nil { - return err - } - if frame.Status == 0 { - return &Error{InvalidControlFrame, frame.StreamId} - } - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - return nil -} - -func (frame *SettingsFrame) read(h ControlFrameHeader, f *Framer) error { - frame.CFHeader = h - var numSettings uint32 - if err := binary.Read(f.r, binary.BigEndian, &numSettings); err != nil { - return err - } - frame.FlagIdValues = make([]SettingsFlagIdValue, numSettings) - for i := uint32(0); i < numSettings; i++ { - if err := binary.Read(f.r, binary.BigEndian, &frame.FlagIdValues[i].Id); err != nil { - return err - } - frame.FlagIdValues[i].Flag = SettingsFlag((frame.FlagIdValues[i].Id & 0xff000000) >> 24) - frame.FlagIdValues[i].Id &= 0xffffff - if err := binary.Read(f.r, binary.BigEndian, &frame.FlagIdValues[i].Value); err != nil { - return err - } - } - return nil -} - -func (frame *PingFrame) read(h ControlFrameHeader, f *Framer) error { - frame.CFHeader = h - if err := binary.Read(f.r, binary.BigEndian, &frame.Id); err != nil { - return err - } - if frame.Id == 0 { - return &Error{ZeroStreamId, 0} - } - if frame.CFHeader.Flags != 0 { - return &Error{InvalidControlFrame, StreamId(frame.Id)} - } - return nil -} - -func (frame *GoAwayFrame) read(h ControlFrameHeader, f *Framer) error { - frame.CFHeader = h - if err := binary.Read(f.r, binary.BigEndian, &frame.LastGoodStreamId); err != nil { - return err - } - if frame.CFHeader.Flags != 0 { - return &Error{InvalidControlFrame, frame.LastGoodStreamId} - } - if frame.CFHeader.length != 8 { - return &Error{InvalidControlFrame, frame.LastGoodStreamId} - } - if err := binary.Read(f.r, binary.BigEndian, &frame.Status); err != nil { - return err - } - return nil -} - -func (frame *HeadersFrame) read(h ControlFrameHeader, f *Framer) error { - return f.readHeadersFrame(h, frame) -} - -func (frame *WindowUpdateFrame) read(h ControlFrameHeader, f *Framer) error { - frame.CFHeader = h - if err := binary.Read(f.r, binary.BigEndian, &frame.StreamId); err != nil { - return err - } - if frame.CFHeader.Flags != 0 { - return &Error{InvalidControlFrame, frame.StreamId} - } - if frame.CFHeader.length != 8 { - return &Error{InvalidControlFrame, frame.StreamId} - } - if err := binary.Read(f.r, binary.BigEndian, &frame.DeltaWindowSize); err != nil { - return err - } - return nil -} - -func newControlFrame(frameType ControlFrameType) (controlFrame, error) { - ctor, ok := cframeCtor[frameType] - if !ok { - return nil, &Error{Err: InvalidControlFrame} - } - return ctor(), nil -} - -var cframeCtor = map[ControlFrameType]func() controlFrame{ - TypeSynStream: func() controlFrame { return new(SynStreamFrame) }, - TypeSynReply: func() controlFrame { return new(SynReplyFrame) }, - TypeRstStream: func() controlFrame { return new(RstStreamFrame) }, - TypeSettings: func() controlFrame { return new(SettingsFrame) }, - TypePing: func() controlFrame { return new(PingFrame) }, - TypeGoAway: func() controlFrame { return new(GoAwayFrame) }, - TypeHeaders: func() controlFrame { return new(HeadersFrame) }, - TypeWindowUpdate: func() controlFrame { return new(WindowUpdateFrame) }, -} - -func (f *Framer) uncorkHeaderDecompressor(payloadSize int64) error { - if f.headerDecompressor != nil { - f.headerReader.N = payloadSize - return nil - } - f.headerReader = io.LimitedReader{R: f.r, N: payloadSize} - decompressor, err := zlib.NewReaderDict(&f.headerReader, []byte(headerDictionary)) - if err != nil { - return err - } - f.headerDecompressor = decompressor - return nil -} - -// ReadFrame reads SPDY encoded data and returns a decompressed Frame. -func (f *Framer) ReadFrame() (Frame, error) { - var firstWord uint32 - if err := binary.Read(f.r, binary.BigEndian, &firstWord); err != nil { - return nil, err - } - if firstWord&0x80000000 != 0 { - frameType := ControlFrameType(firstWord & 0xffff) - version := uint16(firstWord >> 16 & 0x7fff) - return f.parseControlFrame(version, frameType) - } - return f.parseDataFrame(StreamId(firstWord & 0x7fffffff)) -} - -func (f *Framer) parseControlFrame(version uint16, frameType ControlFrameType) (Frame, error) { - var length uint32 - if err := binary.Read(f.r, binary.BigEndian, &length); err != nil { - return nil, err - } - flags := ControlFlags((length & 0xff000000) >> 24) - length &= 0xffffff - header := ControlFrameHeader{version, frameType, flags, length} - cframe, err := newControlFrame(frameType) - if err != nil { - return nil, err - } - if err = cframe.read(header, f); err != nil { - return nil, err - } - return cframe, nil -} - -func parseHeaderValueBlock(r io.Reader, streamId StreamId) (http.Header, error) { - var numHeaders uint32 - if err := binary.Read(r, binary.BigEndian, &numHeaders); err != nil { - return nil, err - } - var e error - h := make(http.Header, int(numHeaders)) - for i := 0; i < int(numHeaders); i++ { - var length uint32 - if err := binary.Read(r, binary.BigEndian, &length); err != nil { - return nil, err - } - nameBytes := make([]byte, length) - if _, err := io.ReadFull(r, nameBytes); err != nil { - return nil, err - } - name := string(nameBytes) - if name != strings.ToLower(name) { - e = &Error{UnlowercasedHeaderName, streamId} - name = strings.ToLower(name) - } - if h[name] != nil { - e = &Error{DuplicateHeaders, streamId} - } - if err := binary.Read(r, binary.BigEndian, &length); err != nil { - return nil, err - } - value := make([]byte, length) - if _, err := io.ReadFull(r, value); err != nil { - return nil, err - } - valueList := strings.Split(string(value), headerValueSeparator) - for _, v := range valueList { - h.Add(name, v) - } - } - if e != nil { - return h, e - } - return h, nil -} - -func (f *Framer) readSynStreamFrame(h ControlFrameHeader, frame *SynStreamFrame) error { - frame.CFHeader = h - var err error - if err = binary.Read(f.r, binary.BigEndian, &frame.StreamId); err != nil { - return err - } - if err = binary.Read(f.r, binary.BigEndian, &frame.AssociatedToStreamId); err != nil { - return err - } - if err = binary.Read(f.r, binary.BigEndian, &frame.Priority); err != nil { - return err - } - frame.Priority >>= 5 - if err = binary.Read(f.r, binary.BigEndian, &frame.Slot); err != nil { - return err - } - reader := f.r - if !f.headerCompressionDisabled { - err := f.uncorkHeaderDecompressor(int64(h.length - 10)) - if err != nil { - return err - } - reader = f.headerDecompressor - } - frame.Headers, err = parseHeaderValueBlock(reader, frame.StreamId) - if !f.headerCompressionDisabled && (err == io.EOF && f.headerReader.N == 0 || f.headerReader.N != 0) { - err = &Error{WrongCompressedPayloadSize, 0} - } - if err != nil { - return err - } - for h := range frame.Headers { - if invalidReqHeaders[h] { - return &Error{InvalidHeaderPresent, frame.StreamId} - } - } - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - return nil -} - -func (f *Framer) readSynReplyFrame(h ControlFrameHeader, frame *SynReplyFrame) error { - frame.CFHeader = h - var err error - if err = binary.Read(f.r, binary.BigEndian, &frame.StreamId); err != nil { - return err - } - reader := f.r - if !f.headerCompressionDisabled { - err := f.uncorkHeaderDecompressor(int64(h.length - 4)) - if err != nil { - return err - } - reader = f.headerDecompressor - } - frame.Headers, err = parseHeaderValueBlock(reader, frame.StreamId) - if !f.headerCompressionDisabled && (err == io.EOF && f.headerReader.N == 0 || f.headerReader.N != 0) { - err = &Error{WrongCompressedPayloadSize, 0} - } - if err != nil { - return err - } - for h := range frame.Headers { - if invalidRespHeaders[h] { - return &Error{InvalidHeaderPresent, frame.StreamId} - } - } - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - return nil -} - -func (f *Framer) readHeadersFrame(h ControlFrameHeader, frame *HeadersFrame) error { - frame.CFHeader = h - var err error - if err = binary.Read(f.r, binary.BigEndian, &frame.StreamId); err != nil { - return err - } - reader := f.r - if !f.headerCompressionDisabled { - err := f.uncorkHeaderDecompressor(int64(h.length - 4)) - if err != nil { - return err - } - reader = f.headerDecompressor - } - frame.Headers, err = parseHeaderValueBlock(reader, frame.StreamId) - if !f.headerCompressionDisabled && (err == io.EOF && f.headerReader.N == 0 || f.headerReader.N != 0) { - err = &Error{WrongCompressedPayloadSize, 0} - } - if err != nil { - return err - } - var invalidHeaders map[string]bool - if frame.StreamId%2 == 0 { - invalidHeaders = invalidReqHeaders - } else { - invalidHeaders = invalidRespHeaders - } - for h := range frame.Headers { - if invalidHeaders[h] { - return &Error{InvalidHeaderPresent, frame.StreamId} - } - } - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - return nil -} - -func (f *Framer) parseDataFrame(streamId StreamId) (*DataFrame, error) { - var length uint32 - if err := binary.Read(f.r, binary.BigEndian, &length); err != nil { - return nil, err - } - var frame DataFrame - frame.StreamId = streamId - frame.Flags = DataFlags(length >> 24) - length &= 0xffffff - frame.Data = make([]byte, length) - if _, err := io.ReadFull(f.r, frame.Data); err != nil { - return nil, err - } - if frame.StreamId == 0 { - return nil, &Error{ZeroStreamId, 0} - } - return &frame, nil -} diff --git a/vendor/github.com/moby/spdystream/spdy/types.go b/vendor/github.com/moby/spdystream/spdy/types.go deleted file mode 100644 index a254a43ab..000000000 --- a/vendor/github.com/moby/spdystream/spdy/types.go +++ /dev/null @@ -1,291 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package spdy implements the SPDY protocol (currently SPDY/3), described in -// http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3. -package spdy - -import ( - "bytes" - "compress/zlib" - "io" - "net/http" -) - -// Version is the protocol version number that this package implements. -const Version = 3 - -// ControlFrameType stores the type field in a control frame header. -type ControlFrameType uint16 - -const ( - TypeSynStream ControlFrameType = 0x0001 - TypeSynReply ControlFrameType = 0x0002 - TypeRstStream ControlFrameType = 0x0003 - TypeSettings ControlFrameType = 0x0004 - TypePing ControlFrameType = 0x0006 - TypeGoAway ControlFrameType = 0x0007 - TypeHeaders ControlFrameType = 0x0008 - TypeWindowUpdate ControlFrameType = 0x0009 -) - -// ControlFlags are the flags that can be set on a control frame. -type ControlFlags uint8 - -const ( - ControlFlagFin ControlFlags = 0x01 - ControlFlagUnidirectional ControlFlags = 0x02 - ControlFlagSettingsClearSettings ControlFlags = 0x01 -) - -// DataFlags are the flags that can be set on a data frame. -type DataFlags uint8 - -const ( - DataFlagFin DataFlags = 0x01 -) - -// MaxDataLength is the maximum number of bytes that can be stored in one frame. -const MaxDataLength = 1<<24 - 1 - -// headerValueSepator separates multiple header values. -const headerValueSeparator = "\x00" - -// Frame is a single SPDY frame in its unpacked in-memory representation. Use -// Framer to read and write it. -type Frame interface { - write(f *Framer) error -} - -// ControlFrameHeader contains all the fields in a control frame header, -// in its unpacked in-memory representation. -type ControlFrameHeader struct { - // Note, high bit is the "Control" bit. - version uint16 // spdy version number - frameType ControlFrameType - Flags ControlFlags - length uint32 // length of data field -} - -type controlFrame interface { - Frame - read(h ControlFrameHeader, f *Framer) error -} - -// StreamId represents a 31-bit value identifying the stream. -type StreamId uint32 - -// SynStreamFrame is the unpacked, in-memory representation of a SYN_STREAM -// frame. -type SynStreamFrame struct { - CFHeader ControlFrameHeader - StreamId StreamId - AssociatedToStreamId StreamId // stream id for a stream which this stream is associated to - Priority uint8 // priority of this frame (3-bit) - Slot uint8 // index in the server's credential vector of the client certificate - Headers http.Header -} - -// SynReplyFrame is the unpacked, in-memory representation of a SYN_REPLY frame. -type SynReplyFrame struct { - CFHeader ControlFrameHeader - StreamId StreamId - Headers http.Header -} - -// RstStreamStatus represents the status that led to a RST_STREAM. -type RstStreamStatus uint32 - -const ( - ProtocolError RstStreamStatus = iota + 1 - InvalidStream - RefusedStream - UnsupportedVersion - Cancel - InternalError - FlowControlError - StreamInUse - StreamAlreadyClosed - InvalidCredentials - FrameTooLarge -) - -// RstStreamFrame is the unpacked, in-memory representation of a RST_STREAM -// frame. -type RstStreamFrame struct { - CFHeader ControlFrameHeader - StreamId StreamId - Status RstStreamStatus -} - -// SettingsFlag represents a flag in a SETTINGS frame. -type SettingsFlag uint8 - -const ( - FlagSettingsPersistValue SettingsFlag = 0x1 - FlagSettingsPersisted SettingsFlag = 0x2 -) - -// SettingsFlag represents the id of an id/value pair in a SETTINGS frame. -type SettingsId uint32 - -const ( - SettingsUploadBandwidth SettingsId = iota + 1 - SettingsDownloadBandwidth - SettingsRoundTripTime - SettingsMaxConcurrentStreams - SettingsCurrentCwnd - SettingsDownloadRetransRate - SettingsInitialWindowSize - SettingsClientCretificateVectorSize -) - -// SettingsFlagIdValue is the unpacked, in-memory representation of the -// combined flag/id/value for a setting in a SETTINGS frame. -type SettingsFlagIdValue struct { - Flag SettingsFlag - Id SettingsId - Value uint32 -} - -// SettingsFrame is the unpacked, in-memory representation of a SPDY -// SETTINGS frame. -type SettingsFrame struct { - CFHeader ControlFrameHeader - FlagIdValues []SettingsFlagIdValue -} - -// PingFrame is the unpacked, in-memory representation of a PING frame. -type PingFrame struct { - CFHeader ControlFrameHeader - Id uint32 // unique id for this ping, from server is even, from client is odd. -} - -// GoAwayStatus represents the status in a GoAwayFrame. -type GoAwayStatus uint32 - -const ( - GoAwayOK GoAwayStatus = iota - GoAwayProtocolError - GoAwayInternalError -) - -// GoAwayFrame is the unpacked, in-memory representation of a GOAWAY frame. -type GoAwayFrame struct { - CFHeader ControlFrameHeader - LastGoodStreamId StreamId // last stream id which was accepted by sender - Status GoAwayStatus -} - -// HeadersFrame is the unpacked, in-memory representation of a HEADERS frame. -type HeadersFrame struct { - CFHeader ControlFrameHeader - StreamId StreamId - Headers http.Header -} - -// WindowUpdateFrame is the unpacked, in-memory representation of a -// WINDOW_UPDATE frame. -type WindowUpdateFrame struct { - CFHeader ControlFrameHeader - StreamId StreamId - DeltaWindowSize uint32 // additional number of bytes to existing window size -} - -// TODO: Implement credential frame and related methods. - -// DataFrame is the unpacked, in-memory representation of a DATA frame. -type DataFrame struct { - // Note, high bit is the "Control" bit. Should be 0 for data frames. - StreamId StreamId - Flags DataFlags - Data []byte // payload data of this frame -} - -// A SPDY specific error. -type ErrorCode string - -const ( - UnlowercasedHeaderName ErrorCode = "header was not lowercased" - DuplicateHeaders ErrorCode = "multiple headers with same name" - WrongCompressedPayloadSize ErrorCode = "compressed payload size was incorrect" - UnknownFrameType ErrorCode = "unknown frame type" - InvalidControlFrame ErrorCode = "invalid control frame" - InvalidDataFrame ErrorCode = "invalid data frame" - InvalidHeaderPresent ErrorCode = "frame contained invalid header" - ZeroStreamId ErrorCode = "stream id zero is disallowed" -) - -// Error contains both the type of error and additional values. StreamId is 0 -// if Error is not associated with a stream. -type Error struct { - Err ErrorCode - StreamId StreamId -} - -func (e *Error) Error() string { - return string(e.Err) -} - -var invalidReqHeaders = map[string]bool{ - "Connection": true, - "Host": true, - "Keep-Alive": true, - "Proxy-Connection": true, - "Transfer-Encoding": true, -} - -var invalidRespHeaders = map[string]bool{ - "Connection": true, - "Keep-Alive": true, - "Proxy-Connection": true, - "Transfer-Encoding": true, -} - -// Framer handles serializing/deserializing SPDY frames, including compressing/ -// decompressing payloads. -type Framer struct { - headerCompressionDisabled bool - w io.Writer - headerBuf *bytes.Buffer - headerCompressor *zlib.Writer - r io.Reader - headerReader io.LimitedReader - headerDecompressor io.ReadCloser -} - -// NewFramer allocates a new Framer for a given SPDY connection, represented by -// a io.Writer and io.Reader. Note that Framer will read and write individual fields -// from/to the Reader and Writer, so the caller should pass in an appropriately -// buffered implementation to optimize performance. -func NewFramer(w io.Writer, r io.Reader) (*Framer, error) { - compressBuf := new(bytes.Buffer) - compressor, err := zlib.NewWriterLevelDict(compressBuf, zlib.BestCompression, []byte(headerDictionary)) - if err != nil { - return nil, err - } - framer := &Framer{ - w: w, - headerBuf: compressBuf, - headerCompressor: compressor, - r: r, - } - return framer, nil -} diff --git a/vendor/github.com/moby/spdystream/spdy/write.go b/vendor/github.com/moby/spdystream/spdy/write.go deleted file mode 100644 index ab6d91f3b..000000000 --- a/vendor/github.com/moby/spdystream/spdy/write.go +++ /dev/null @@ -1,334 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package spdy - -import ( - "encoding/binary" - "io" - "net/http" - "strings" -) - -func (frame *SynStreamFrame) write(f *Framer) error { - return f.writeSynStreamFrame(frame) -} - -func (frame *SynReplyFrame) write(f *Framer) error { - return f.writeSynReplyFrame(frame) -} - -func (frame *RstStreamFrame) write(f *Framer) (err error) { - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeRstStream - frame.CFHeader.Flags = 0 - frame.CFHeader.length = 8 - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return - } - if frame.Status == 0 { - return &Error{InvalidControlFrame, frame.StreamId} - } - if err = binary.Write(f.w, binary.BigEndian, frame.Status); err != nil { - return - } - return -} - -func (frame *SettingsFrame) write(f *Framer) (err error) { - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeSettings - frame.CFHeader.length = uint32(len(frame.FlagIdValues)*8 + 4) - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, uint32(len(frame.FlagIdValues))); err != nil { - return - } - for _, flagIdValue := range frame.FlagIdValues { - flagId := uint32(flagIdValue.Flag)<<24 | uint32(flagIdValue.Id) - if err = binary.Write(f.w, binary.BigEndian, flagId); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, flagIdValue.Value); err != nil { - return - } - } - return -} - -func (frame *PingFrame) write(f *Framer) (err error) { - if frame.Id == 0 { - return &Error{ZeroStreamId, 0} - } - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypePing - frame.CFHeader.Flags = 0 - frame.CFHeader.length = 4 - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.Id); err != nil { - return - } - return -} - -func (frame *GoAwayFrame) write(f *Framer) (err error) { - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeGoAway - frame.CFHeader.Flags = 0 - frame.CFHeader.length = 8 - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.LastGoodStreamId); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.Status); err != nil { - return - } - return nil -} - -func (frame *HeadersFrame) write(f *Framer) error { - return f.writeHeadersFrame(frame) -} - -func (frame *WindowUpdateFrame) write(f *Framer) (err error) { - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeWindowUpdate - frame.CFHeader.Flags = 0 - frame.CFHeader.length = 8 - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.DeltaWindowSize); err != nil { - return - } - return nil -} - -func (frame *DataFrame) write(f *Framer) error { - return f.writeDataFrame(frame) -} - -// WriteFrame writes a frame. -func (f *Framer) WriteFrame(frame Frame) error { - return frame.write(f) -} - -func writeControlFrameHeader(w io.Writer, h ControlFrameHeader) error { - if err := binary.Write(w, binary.BigEndian, 0x8000|h.version); err != nil { - return err - } - if err := binary.Write(w, binary.BigEndian, h.frameType); err != nil { - return err - } - flagsAndLength := uint32(h.Flags)<<24 | h.length - if err := binary.Write(w, binary.BigEndian, flagsAndLength); err != nil { - return err - } - return nil -} - -func writeHeaderValueBlock(w io.Writer, h http.Header) (n int, err error) { - n = 0 - if err = binary.Write(w, binary.BigEndian, uint32(len(h))); err != nil { - return - } - n += 2 - for name, values := range h { - if err = binary.Write(w, binary.BigEndian, uint32(len(name))); err != nil { - return - } - n += 2 - name = strings.ToLower(name) - if _, err = io.WriteString(w, name); err != nil { - return - } - n += len(name) - v := strings.Join(values, headerValueSeparator) - if err = binary.Write(w, binary.BigEndian, uint32(len(v))); err != nil { - return - } - n += 2 - if _, err = io.WriteString(w, v); err != nil { - return - } - n += len(v) - } - return -} - -func (f *Framer) writeSynStreamFrame(frame *SynStreamFrame) (err error) { - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - // Marshal the headers. - var writer io.Writer = f.headerBuf - if !f.headerCompressionDisabled { - writer = f.headerCompressor - } - if _, err = writeHeaderValueBlock(writer, frame.Headers); err != nil { - return - } - if !f.headerCompressionDisabled { - f.headerCompressor.Flush() - } - - // Set ControlFrameHeader. - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeSynStream - frame.CFHeader.length = uint32(len(f.headerBuf.Bytes()) + 10) - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return err - } - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return err - } - if err = binary.Write(f.w, binary.BigEndian, frame.AssociatedToStreamId); err != nil { - return err - } - if err = binary.Write(f.w, binary.BigEndian, frame.Priority<<5); err != nil { - return err - } - if err = binary.Write(f.w, binary.BigEndian, frame.Slot); err != nil { - return err - } - if _, err = f.w.Write(f.headerBuf.Bytes()); err != nil { - return err - } - f.headerBuf.Reset() - return nil -} - -func (f *Framer) writeSynReplyFrame(frame *SynReplyFrame) (err error) { - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - // Marshal the headers. - var writer io.Writer = f.headerBuf - if !f.headerCompressionDisabled { - writer = f.headerCompressor - } - if _, err = writeHeaderValueBlock(writer, frame.Headers); err != nil { - return - } - if !f.headerCompressionDisabled { - f.headerCompressor.Flush() - } - - // Set ControlFrameHeader. - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeSynReply - frame.CFHeader.length = uint32(len(f.headerBuf.Bytes()) + 4) - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return - } - if _, err = f.w.Write(f.headerBuf.Bytes()); err != nil { - return - } - f.headerBuf.Reset() - return -} - -func (f *Framer) writeHeadersFrame(frame *HeadersFrame) (err error) { - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - // Marshal the headers. - var writer io.Writer = f.headerBuf - if !f.headerCompressionDisabled { - writer = f.headerCompressor - } - if _, err = writeHeaderValueBlock(writer, frame.Headers); err != nil { - return - } - if !f.headerCompressionDisabled { - f.headerCompressor.Flush() - } - - // Set ControlFrameHeader. - frame.CFHeader.version = Version - frame.CFHeader.frameType = TypeHeaders - frame.CFHeader.length = uint32(len(f.headerBuf.Bytes()) + 4) - - // Serialize frame to Writer. - if err = writeControlFrameHeader(f.w, frame.CFHeader); err != nil { - return - } - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return - } - if _, err = f.w.Write(f.headerBuf.Bytes()); err != nil { - return - } - f.headerBuf.Reset() - return -} - -func (f *Framer) writeDataFrame(frame *DataFrame) (err error) { - if frame.StreamId == 0 { - return &Error{ZeroStreamId, 0} - } - if frame.StreamId&0x80000000 != 0 || len(frame.Data) > MaxDataLength { - return &Error{InvalidDataFrame, frame.StreamId} - } - - // Serialize frame to Writer. - if err = binary.Write(f.w, binary.BigEndian, frame.StreamId); err != nil { - return - } - flagsAndLength := uint32(frame.Flags)<<24 | uint32(len(frame.Data)) - if err = binary.Write(f.w, binary.BigEndian, flagsAndLength); err != nil { - return - } - if _, err = f.w.Write(frame.Data); err != nil { - return - } - return nil -} diff --git a/vendor/github.com/moby/spdystream/stream.go b/vendor/github.com/moby/spdystream/stream.go deleted file mode 100644 index 171c1e9e3..000000000 --- a/vendor/github.com/moby/spdystream/stream.go +++ /dev/null @@ -1,345 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package spdystream - -import ( - "errors" - "fmt" - "io" - "net" - "net/http" - "sync" - "time" - - "github.com/moby/spdystream/spdy" -) - -var ( - ErrUnreadPartialData = errors.New("unread partial data") -) - -type Stream struct { - streamId spdy.StreamId - parent *Stream - conn *Connection - startChan chan error - - dataLock sync.RWMutex - dataChan chan []byte - unread []byte - - priority uint8 - headers http.Header - headerChan chan http.Header - finishLock sync.Mutex - finished bool - replyCond *sync.Cond - replied bool - closeLock sync.Mutex - closeChan chan bool -} - -// WriteData writes data to stream, sending a dataframe per call -func (s *Stream) WriteData(data []byte, fin bool) error { - s.waitWriteReply() - var flags spdy.DataFlags - - if fin { - flags = spdy.DataFlagFin - s.finishLock.Lock() - if s.finished { - s.finishLock.Unlock() - return ErrWriteClosedStream - } - s.finished = true - s.finishLock.Unlock() - } - - dataFrame := &spdy.DataFrame{ - StreamId: s.streamId, - Flags: flags, - Data: data, - } - - debugMessage("(%p) (%d) Writing data frame", s, s.streamId) - return s.conn.framer.WriteFrame(dataFrame) -} - -// Write writes bytes to a stream, calling write data for each call. -func (s *Stream) Write(data []byte) (n int, err error) { - err = s.WriteData(data, false) - if err == nil { - n = len(data) - } - return -} - -// Read reads bytes from a stream, a single read will never get more -// than what is sent on a single data frame, but a multiple calls to -// read may get data from the same data frame. -func (s *Stream) Read(p []byte) (n int, err error) { - if s.unread == nil { - select { - case <-s.closeChan: - return 0, io.EOF - case read, ok := <-s.dataChan: - if !ok { - return 0, io.EOF - } - s.unread = read - } - } - n = copy(p, s.unread) - if n < len(s.unread) { - s.unread = s.unread[n:] - } else { - s.unread = nil - } - return -} - -// ReadData reads an entire data frame and returns the byte array -// from the data frame. If there is unread data from the result -// of a Read call, this function will return an ErrUnreadPartialData. -func (s *Stream) ReadData() ([]byte, error) { - debugMessage("(%p) Reading data from %d", s, s.streamId) - if s.unread != nil { - return nil, ErrUnreadPartialData - } - select { - case <-s.closeChan: - return nil, io.EOF - case read, ok := <-s.dataChan: - if !ok { - return nil, io.EOF - } - return read, nil - } -} - -func (s *Stream) waitWriteReply() { - if s.replyCond != nil { - s.replyCond.L.Lock() - for !s.replied { - s.replyCond.Wait() - } - s.replyCond.L.Unlock() - } -} - -// Wait waits for the stream to receive a reply. -func (s *Stream) Wait() error { - return s.WaitTimeout(time.Duration(0)) -} - -// WaitTimeout waits for the stream to receive a reply or for timeout. -// When the timeout is reached, ErrTimeout will be returned. -func (s *Stream) WaitTimeout(timeout time.Duration) error { - var timeoutChan <-chan time.Time - if timeout > time.Duration(0) { - timeoutChan = time.After(timeout) - } - - select { - case err := <-s.startChan: - if err != nil { - return err - } - break - case <-timeoutChan: - return ErrTimeout - } - return nil -} - -// Close closes the stream by sending an empty data frame with the -// finish flag set, indicating this side is finished with the stream. -func (s *Stream) Close() error { - select { - case <-s.closeChan: - // Stream is now fully closed - s.conn.removeStream(s) - default: - break - } - return s.WriteData([]byte{}, true) -} - -// Reset sends a reset frame, putting the stream into the fully closed state. -func (s *Stream) Reset() error { - s.conn.removeStream(s) - return s.resetStream() -} - -func (s *Stream) resetStream() error { - // Always call closeRemoteChannels, even if s.finished is already true. - // This makes it so that stream.Close() followed by stream.Reset() allows - // stream.Read() to unblock. - s.closeRemoteChannels() - - s.finishLock.Lock() - if s.finished { - s.finishLock.Unlock() - return nil - } - s.finished = true - s.finishLock.Unlock() - - resetFrame := &spdy.RstStreamFrame{ - StreamId: s.streamId, - Status: spdy.Cancel, - } - return s.conn.framer.WriteFrame(resetFrame) -} - -// CreateSubStream creates a stream using the current as the parent -func (s *Stream) CreateSubStream(headers http.Header, fin bool) (*Stream, error) { - return s.conn.CreateStream(headers, s, fin) -} - -// SetPriority sets the stream priority, does not affect the -// remote priority of this stream after Open has been called. -// Valid values are 0 through 7, 0 being the highest priority -// and 7 the lowest. -func (s *Stream) SetPriority(priority uint8) { - s.priority = priority -} - -// SendHeader sends a header frame across the stream -func (s *Stream) SendHeader(headers http.Header, fin bool) error { - return s.conn.sendHeaders(headers, s, fin) -} - -// SendReply sends a reply on a stream, only valid to be called once -// when handling a new stream -func (s *Stream) SendReply(headers http.Header, fin bool) error { - if s.replyCond == nil { - return errors.New("cannot reply on initiated stream") - } - s.replyCond.L.Lock() - defer s.replyCond.L.Unlock() - if s.replied { - return nil - } - - err := s.conn.sendReply(headers, s, fin) - if err != nil { - return err - } - - s.replied = true - s.replyCond.Broadcast() - return nil -} - -// Refuse sends a reset frame with the status refuse, only -// valid to be called once when handling a new stream. This -// may be used to indicate that a stream is not allowed -// when http status codes are not being used. -func (s *Stream) Refuse() error { - if s.replied { - return nil - } - s.replied = true - return s.conn.sendReset(spdy.RefusedStream, s) -} - -// Cancel sends a reset frame with the status canceled. This -// can be used at any time by the creator of the Stream to -// indicate the stream is no longer needed. -func (s *Stream) Cancel() error { - return s.conn.sendReset(spdy.Cancel, s) -} - -// ReceiveHeader receives a header sent on the other side -// of the stream. This function will block until a header -// is received or stream is closed. -func (s *Stream) ReceiveHeader() (http.Header, error) { - select { - case <-s.closeChan: - break - case header, ok := <-s.headerChan: - if !ok { - return nil, fmt.Errorf("header chan closed") - } - return header, nil - } - return nil, fmt.Errorf("stream closed") -} - -// Parent returns the parent stream -func (s *Stream) Parent() *Stream { - return s.parent -} - -// Headers returns the headers used to create the stream -func (s *Stream) Headers() http.Header { - return s.headers -} - -// String returns the string version of stream using the -// streamId to uniquely identify the stream -func (s *Stream) String() string { - return fmt.Sprintf("stream:%d", s.streamId) -} - -// Identifier returns a 32 bit identifier for the stream -func (s *Stream) Identifier() uint32 { - return uint32(s.streamId) -} - -// IsFinished returns whether the stream has finished -// sending data -func (s *Stream) IsFinished() bool { - s.finishLock.Lock() - defer s.finishLock.Unlock() - return s.finished -} - -// Implement net.Conn interface - -func (s *Stream) LocalAddr() net.Addr { - return s.conn.conn.LocalAddr() -} - -func (s *Stream) RemoteAddr() net.Addr { - return s.conn.conn.RemoteAddr() -} - -// TODO set per stream values instead of connection-wide - -func (s *Stream) SetDeadline(t time.Time) error { - return s.conn.conn.SetDeadline(t) -} - -func (s *Stream) SetReadDeadline(t time.Time) error { - return s.conn.conn.SetReadDeadline(t) -} - -func (s *Stream) SetWriteDeadline(t time.Time) error { - return s.conn.conn.SetWriteDeadline(t) -} - -func (s *Stream) closeRemoteChannels() { - s.closeLock.Lock() - defer s.closeLock.Unlock() - select { - case <-s.closeChan: - default: - close(s.closeChan) - } -} diff --git a/vendor/github.com/moby/spdystream/utils.go b/vendor/github.com/moby/spdystream/utils.go deleted file mode 100644 index e9f7fffd6..000000000 --- a/vendor/github.com/moby/spdystream/utils.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2014-2021 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package spdystream - -import ( - "log" - "os" -) - -var ( - DEBUG = os.Getenv("DEBUG") -) - -func debugMessage(fmt string, args ...interface{}) { - if DEBUG != "" { - log.Printf(fmt, args...) - } -} diff --git a/vendor/github.com/mxk/go-flowrate/LICENSE b/vendor/github.com/mxk/go-flowrate/LICENSE deleted file mode 100644 index e9f9f628b..000000000 --- a/vendor/github.com/mxk/go-flowrate/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2014 The Go-FlowRate Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of the go-flowrate project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go b/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go deleted file mode 100644 index 1b727721e..000000000 --- a/vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go +++ /dev/null @@ -1,267 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -// Package flowrate provides the tools for monitoring and limiting the flow rate -// of an arbitrary data stream. -package flowrate - -import ( - "math" - "sync" - "time" -) - -// Monitor monitors and limits the transfer rate of a data stream. -type Monitor struct { - mu sync.Mutex // Mutex guarding access to all internal fields - active bool // Flag indicating an active transfer - start time.Duration // Transfer start time (clock() value) - bytes int64 // Total number of bytes transferred - samples int64 // Total number of samples taken - - rSample float64 // Most recent transfer rate sample (bytes per second) - rEMA float64 // Exponential moving average of rSample - rPeak float64 // Peak transfer rate (max of all rSamples) - rWindow float64 // rEMA window (seconds) - - sBytes int64 // Number of bytes transferred since sLast - sLast time.Duration // Most recent sample time (stop time when inactive) - sRate time.Duration // Sampling rate - - tBytes int64 // Number of bytes expected in the current transfer - tLast time.Duration // Time of the most recent transfer of at least 1 byte -} - -// New creates a new flow control monitor. Instantaneous transfer rate is -// measured and updated for each sampleRate interval. windowSize determines the -// weight of each sample in the exponential moving average (EMA) calculation. -// The exact formulas are: -// -// sampleTime = currentTime - prevSampleTime -// sampleRate = byteCount / sampleTime -// weight = 1 - exp(-sampleTime/windowSize) -// newRate = weight*sampleRate + (1-weight)*oldRate -// -// The default values for sampleRate and windowSize (if <= 0) are 100ms and 1s, -// respectively. -func New(sampleRate, windowSize time.Duration) *Monitor { - if sampleRate = clockRound(sampleRate); sampleRate <= 0 { - sampleRate = 5 * clockRate - } - if windowSize <= 0 { - windowSize = 1 * time.Second - } - now := clock() - return &Monitor{ - active: true, - start: now, - rWindow: windowSize.Seconds(), - sLast: now, - sRate: sampleRate, - tLast: now, - } -} - -// Update records the transfer of n bytes and returns n. It should be called -// after each Read/Write operation, even if n is 0. -func (m *Monitor) Update(n int) int { - m.mu.Lock() - m.update(n) - m.mu.Unlock() - return n -} - -// IO is a convenience method intended to wrap io.Reader and io.Writer method -// execution. It calls m.Update(n) and then returns (n, err) unmodified. -func (m *Monitor) IO(n int, err error) (int, error) { - return m.Update(n), err -} - -// Done marks the transfer as finished and prevents any further updates or -// limiting. Instantaneous and current transfer rates drop to 0. Update, IO, and -// Limit methods become NOOPs. It returns the total number of bytes transferred. -func (m *Monitor) Done() int64 { - m.mu.Lock() - if now := m.update(0); m.sBytes > 0 { - m.reset(now) - } - m.active = false - m.tLast = 0 - n := m.bytes - m.mu.Unlock() - return n -} - -// timeRemLimit is the maximum Status.TimeRem value. -const timeRemLimit = 999*time.Hour + 59*time.Minute + 59*time.Second - -// Status represents the current Monitor status. All transfer rates are in bytes -// per second rounded to the nearest byte. -type Status struct { - Active bool // Flag indicating an active transfer - Start time.Time // Transfer start time - Duration time.Duration // Time period covered by the statistics - Idle time.Duration // Time since the last transfer of at least 1 byte - Bytes int64 // Total number of bytes transferred - Samples int64 // Total number of samples taken - InstRate int64 // Instantaneous transfer rate - CurRate int64 // Current transfer rate (EMA of InstRate) - AvgRate int64 // Average transfer rate (Bytes / Duration) - PeakRate int64 // Maximum instantaneous transfer rate - BytesRem int64 // Number of bytes remaining in the transfer - TimeRem time.Duration // Estimated time to completion - Progress Percent // Overall transfer progress -} - -// Status returns current transfer status information. The returned value -// becomes static after a call to Done. -func (m *Monitor) Status() Status { - m.mu.Lock() - now := m.update(0) - s := Status{ - Active: m.active, - Start: clockToTime(m.start), - Duration: m.sLast - m.start, - Idle: now - m.tLast, - Bytes: m.bytes, - Samples: m.samples, - PeakRate: round(m.rPeak), - BytesRem: m.tBytes - m.bytes, - Progress: percentOf(float64(m.bytes), float64(m.tBytes)), - } - if s.BytesRem < 0 { - s.BytesRem = 0 - } - if s.Duration > 0 { - rAvg := float64(s.Bytes) / s.Duration.Seconds() - s.AvgRate = round(rAvg) - if s.Active { - s.InstRate = round(m.rSample) - s.CurRate = round(m.rEMA) - if s.BytesRem > 0 { - if tRate := 0.8*m.rEMA + 0.2*rAvg; tRate > 0 { - ns := float64(s.BytesRem) / tRate * 1e9 - if ns > float64(timeRemLimit) { - ns = float64(timeRemLimit) - } - s.TimeRem = clockRound(time.Duration(ns)) - } - } - } - } - m.mu.Unlock() - return s -} - -// Limit restricts the instantaneous (per-sample) data flow to rate bytes per -// second. It returns the maximum number of bytes (0 <= n <= want) that may be -// transferred immediately without exceeding the limit. If block == true, the -// call blocks until n > 0. want is returned unmodified if want < 1, rate < 1, -// or the transfer is inactive (after a call to Done). -// -// At least one byte is always allowed to be transferred in any given sampling -// period. Thus, if the sampling rate is 100ms, the lowest achievable flow rate -// is 10 bytes per second. -// -// For usage examples, see the implementation of Reader and Writer in io.go. -func (m *Monitor) Limit(want int, rate int64, block bool) (n int) { - if want < 1 || rate < 1 { - return want - } - m.mu.Lock() - - // Determine the maximum number of bytes that can be sent in one sample - limit := round(float64(rate) * m.sRate.Seconds()) - if limit <= 0 { - limit = 1 - } - - // If block == true, wait until m.sBytes < limit - if now := m.update(0); block { - for m.sBytes >= limit && m.active { - now = m.waitNextSample(now) - } - } - - // Make limit <= want (unlimited if the transfer is no longer active) - if limit -= m.sBytes; limit > int64(want) || !m.active { - limit = int64(want) - } - m.mu.Unlock() - - if limit < 0 { - limit = 0 - } - return int(limit) -} - -// SetTransferSize specifies the total size of the data transfer, which allows -// the Monitor to calculate the overall progress and time to completion. -func (m *Monitor) SetTransferSize(bytes int64) { - if bytes < 0 { - bytes = 0 - } - m.mu.Lock() - m.tBytes = bytes - m.mu.Unlock() -} - -// update accumulates the transferred byte count for the current sample until -// clock() - m.sLast >= m.sRate. The monitor status is updated once the current -// sample is done. -func (m *Monitor) update(n int) (now time.Duration) { - if !m.active { - return - } - if now = clock(); n > 0 { - m.tLast = now - } - m.sBytes += int64(n) - if sTime := now - m.sLast; sTime >= m.sRate { - t := sTime.Seconds() - if m.rSample = float64(m.sBytes) / t; m.rSample > m.rPeak { - m.rPeak = m.rSample - } - - // Exponential moving average using a method similar to *nix load - // average calculation. Longer sampling periods carry greater weight. - if m.samples > 0 { - w := math.Exp(-t / m.rWindow) - m.rEMA = m.rSample + w*(m.rEMA-m.rSample) - } else { - m.rEMA = m.rSample - } - m.reset(now) - } - return -} - -// reset clears the current sample state in preparation for the next sample. -func (m *Monitor) reset(sampleTime time.Duration) { - m.bytes += m.sBytes - m.samples++ - m.sBytes = 0 - m.sLast = sampleTime -} - -// waitNextSample sleeps for the remainder of the current sample. The lock is -// released and reacquired during the actual sleep period, so it's possible for -// the transfer to be inactive when this method returns. -func (m *Monitor) waitNextSample(now time.Duration) time.Duration { - const minWait = 5 * time.Millisecond - current := m.sLast - - // sleep until the last sample time changes (ideally, just one iteration) - for m.sLast == current && m.active { - d := current + m.sRate - now - m.mu.Unlock() - if d < minWait { - d = minWait - } - time.Sleep(d) - m.mu.Lock() - now = m.update(0) - } - return now -} diff --git a/vendor/github.com/mxk/go-flowrate/flowrate/io.go b/vendor/github.com/mxk/go-flowrate/flowrate/io.go deleted file mode 100644 index fbe090972..000000000 --- a/vendor/github.com/mxk/go-flowrate/flowrate/io.go +++ /dev/null @@ -1,133 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -package flowrate - -import ( - "errors" - "io" -) - -// ErrLimit is returned by the Writer when a non-blocking write is short due to -// the transfer rate limit. -var ErrLimit = errors.New("flowrate: flow rate limit exceeded") - -// Limiter is implemented by the Reader and Writer to provide a consistent -// interface for monitoring and controlling data transfer. -type Limiter interface { - Done() int64 - Status() Status - SetTransferSize(bytes int64) - SetLimit(new int64) (old int64) - SetBlocking(new bool) (old bool) -} - -// Reader implements io.ReadCloser with a restriction on the rate of data -// transfer. -type Reader struct { - io.Reader // Data source - *Monitor // Flow control monitor - - limit int64 // Rate limit in bytes per second (unlimited when <= 0) - block bool // What to do when no new bytes can be read due to the limit -} - -// NewReader restricts all Read operations on r to limit bytes per second. -func NewReader(r io.Reader, limit int64) *Reader { - return &Reader{r, New(0, 0), limit, true} -} - -// Read reads up to len(p) bytes into p without exceeding the current transfer -// rate limit. It returns (0, nil) immediately if r is non-blocking and no new -// bytes can be read at this time. -func (r *Reader) Read(p []byte) (n int, err error) { - p = p[:r.Limit(len(p), r.limit, r.block)] - if len(p) > 0 { - n, err = r.IO(r.Reader.Read(p)) - } - return -} - -// SetLimit changes the transfer rate limit to new bytes per second and returns -// the previous setting. -func (r *Reader) SetLimit(new int64) (old int64) { - old, r.limit = r.limit, new - return -} - -// SetBlocking changes the blocking behavior and returns the previous setting. A -// Read call on a non-blocking reader returns immediately if no additional bytes -// may be read at this time due to the rate limit. -func (r *Reader) SetBlocking(new bool) (old bool) { - old, r.block = r.block, new - return -} - -// Close closes the underlying reader if it implements the io.Closer interface. -func (r *Reader) Close() error { - defer r.Done() - if c, ok := r.Reader.(io.Closer); ok { - return c.Close() - } - return nil -} - -// Writer implements io.WriteCloser with a restriction on the rate of data -// transfer. -type Writer struct { - io.Writer // Data destination - *Monitor // Flow control monitor - - limit int64 // Rate limit in bytes per second (unlimited when <= 0) - block bool // What to do when no new bytes can be written due to the limit -} - -// NewWriter restricts all Write operations on w to limit bytes per second. The -// transfer rate and the default blocking behavior (true) can be changed -// directly on the returned *Writer. -func NewWriter(w io.Writer, limit int64) *Writer { - return &Writer{w, New(0, 0), limit, true} -} - -// Write writes len(p) bytes from p to the underlying data stream without -// exceeding the current transfer rate limit. It returns (n, ErrLimit) if w is -// non-blocking and no additional bytes can be written at this time. -func (w *Writer) Write(p []byte) (n int, err error) { - var c int - for len(p) > 0 && err == nil { - s := p[:w.Limit(len(p), w.limit, w.block)] - if len(s) > 0 { - c, err = w.IO(w.Writer.Write(s)) - } else { - return n, ErrLimit - } - p = p[c:] - n += c - } - return -} - -// SetLimit changes the transfer rate limit to new bytes per second and returns -// the previous setting. -func (w *Writer) SetLimit(new int64) (old int64) { - old, w.limit = w.limit, new - return -} - -// SetBlocking changes the blocking behavior and returns the previous setting. A -// Write call on a non-blocking writer returns as soon as no additional bytes -// may be written at this time due to the rate limit. -func (w *Writer) SetBlocking(new bool) (old bool) { - old, w.block = w.block, new - return -} - -// Close closes the underlying writer if it implements the io.Closer interface. -func (w *Writer) Close() error { - defer w.Done() - if c, ok := w.Writer.(io.Closer); ok { - return c.Close() - } - return nil -} diff --git a/vendor/github.com/mxk/go-flowrate/flowrate/util.go b/vendor/github.com/mxk/go-flowrate/flowrate/util.go deleted file mode 100644 index 4caac583f..000000000 --- a/vendor/github.com/mxk/go-flowrate/flowrate/util.go +++ /dev/null @@ -1,67 +0,0 @@ -// -// Written by Maxim Khitrov (November 2012) -// - -package flowrate - -import ( - "math" - "strconv" - "time" -) - -// clockRate is the resolution and precision of clock(). -const clockRate = 20 * time.Millisecond - -// czero is the process start time rounded down to the nearest clockRate -// increment. -var czero = time.Duration(time.Now().UnixNano()) / clockRate * clockRate - -// clock returns a low resolution timestamp relative to the process start time. -func clock() time.Duration { - return time.Duration(time.Now().UnixNano())/clockRate*clockRate - czero -} - -// clockToTime converts a clock() timestamp to an absolute time.Time value. -func clockToTime(c time.Duration) time.Time { - return time.Unix(0, int64(czero+c)) -} - -// clockRound returns d rounded to the nearest clockRate increment. -func clockRound(d time.Duration) time.Duration { - return (d + clockRate>>1) / clockRate * clockRate -} - -// round returns x rounded to the nearest int64 (non-negative values only). -func round(x float64) int64 { - if _, frac := math.Modf(x); frac >= 0.5 { - return int64(math.Ceil(x)) - } - return int64(math.Floor(x)) -} - -// Percent represents a percentage in increments of 1/1000th of a percent. -type Percent uint32 - -// percentOf calculates what percent of the total is x. -func percentOf(x, total float64) Percent { - if x < 0 || total <= 0 { - return 0 - } else if p := round(x / total * 1e5); p <= math.MaxUint32 { - return Percent(p) - } - return Percent(math.MaxUint32) -} - -func (p Percent) Float() float64 { - return float64(p) * 1e-3 -} - -func (p Percent) String() string { - var buf [12]byte - b := strconv.AppendUint(buf[:0], uint64(p)/1000, 10) - n := len(b) - b = strconv.AppendUint(b, 1000+uint64(p)%1000, 10) - b[n] = '.' - return string(append(b, '%')) -} diff --git a/vendor/github.com/onsi/ginkgo/v2/OWNERS b/vendor/github.com/onsi/ginkgo/v2/OWNERS deleted file mode 100644 index 2d1f6c71e..000000000 --- a/vendor/github.com/onsi/ginkgo/v2/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: -approvers: - - bertinatto - - stbenjam diff --git a/vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go b/vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go deleted file mode 100644 index bf60ceb52..000000000 --- a/vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go +++ /dev/null @@ -1,33 +0,0 @@ -package ginkgo - -import ( - "io" - - "github.com/onsi/ginkgo/v2/internal" - "github.com/onsi/ginkgo/v2/internal/global" - "github.com/onsi/ginkgo/v2/types" -) - -func AppendSpecText(test *internal.Spec, text string) { - test.AppendText(text) -} - -func GetSuite() *internal.Suite { - return global.Suite -} - -func GetFailer() *internal.Failer { - return global.Failer -} - -func NewWriter(w io.Writer) *internal.Writer { - return internal.NewWriter(w) -} - -func GetWriter() *internal.Writer { - return GinkgoWriter.(*internal.Writer) -} - -func SetReporterConfig(r types.ReporterConfig) { - reporterConfig = r -} diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go index 319278ded..e0f1431d5 100644 --- a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go +++ b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go @@ -9,24 +9,6 @@ import ( "golang.org/x/sys/unix" ) -// dupStdout creates a clone of stdout's file descriptor that can be used -// to write to the original terminal even after stdout has been redirected. -// Returns nil if the clone cannot be created. -func dupStdout() *os.File { - stdoutCloneFD, err := unix.Dup(1) - if err != nil { - return nil - } - - // Set FD_CLOEXEC to prevent leaking into child processes - flags, err := unix.FcntlInt(uintptr(stdoutCloneFD), unix.F_GETFD, 0) - if err == nil { - unix.FcntlInt(uintptr(stdoutCloneFD), unix.F_SETFD, flags|unix.FD_CLOEXEC) - } - - return os.NewFile(uintptr(stdoutCloneFD), "stdout-clone-for-forwarding") -} - func NewOutputInterceptor() OutputInterceptor { return &genericOutputInterceptor{ interceptedContent: make(chan string), diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go index 3cffcb534..4c374935b 100644 --- a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go +++ b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go @@ -2,13 +2,6 @@ package internal -import "os" - -// dupStdout returns nil on WASM since output interception is not supported. -func dupStdout() *os.File { - return nil -} - func NewOutputInterceptor() OutputInterceptor { return &NoopOutputInterceptor{} } diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go index 710cbe04a..30c2851a8 100644 --- a/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go +++ b/vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go @@ -2,15 +2,6 @@ package internal -import "os" - -// dupStdout returns the current os.Stdout. On Windows, the output interceptor -// uses osGlobalReassigning which only changes the Go variable, so capturing -// the current os.Stdout before interception starts is sufficient. -func dupStdout() *os.File { - return os.Stdout -} - func NewOutputInterceptor() OutputInterceptor { return NewOSGlobalReassigningOutputInterceptor() } diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go b/vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go deleted file mode 100644 index 2d0bcc914..000000000 --- a/vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go +++ /dev/null @@ -1,22 +0,0 @@ -package internal - -import ( - "github.com/onsi/ginkgo/v2/types" -) - -func (s Spec) CodeLocations() []types.CodeLocation { - return s.Nodes.CodeLocations() -} - -func (s Spec) AppendText(text string) { - s.Nodes[len(s.Nodes)-1].Text += text -} - -func (s Spec) Labels() []string { - var labels []string - for _, n := range s.Nodes { - labels = append(labels, n.Labels...) - } - - return labels -} diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/suite.go b/vendor/github.com/onsi/ginkgo/v2/internal/suite.go index 204446e82..ef76cd099 100644 --- a/vendor/github.com/onsi/ginkgo/v2/internal/suite.go +++ b/vendor/github.com/onsi/ginkgo/v2/internal/suite.go @@ -68,8 +68,6 @@ type Suite struct { selectiveLock *sync.Mutex client parallel_support.Client - - annotateFn AnnotateFunc } func NewSuite() *Suite { @@ -116,11 +114,6 @@ func (suite *Suite) Run(description string, suiteLabels Labels, suiteSemVerConst } ApplyNestedFocusPolicyToTree(suite.tree) specs := GenerateSpecsFromTreeRoot(suite.tree) - if suite.annotateFn != nil { - for _, spec := range specs { - suite.annotateFn(spec.Text(), spec) - } - } specs, hasProgrammaticFocus := ApplyFocusToSpecs(specs, description, suiteLabels, suiteSemVerConstraints, suiteConfig) specs = ComputeAroundNodes(specs) diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go b/vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go deleted file mode 100644 index 000036544..000000000 --- a/vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go +++ /dev/null @@ -1,142 +0,0 @@ -package internal - -import ( - "io" - "os" - "strings" - "time" - - "github.com/onsi/ginkgo/v2/internal/interrupt_handler" - "github.com/onsi/ginkgo/v2/reporters" - "github.com/onsi/ginkgo/v2/types" -) - -// ForwardingOutputInterceptor wraps a real OutputInterceptor but forwards -// captured output to stdout in real-time. This allows stdout/stderr to be -// captured in test results while still showing output during test execution. -type ForwardingOutputInterceptor struct { - interceptor OutputInterceptor - stdoutClone *os.File -} - -// NewForwardingOutputInterceptor creates an output interceptor that captures -// stdout/stderr while also forwarding it to a clone of stdout in real-time. -// The stdout clone is created using dupStdout() (platform-specific) before -// the interceptor redirects output, ensuring output is always forwarded to -// the original terminal. -func NewForwardingOutputInterceptor() *ForwardingOutputInterceptor { - // Create a clone of stdout BEFORE the interceptor can redirect it. - // This ensures we always have a handle to the original terminal for - // forwarding output. The dupStdout() function is platform-specific. - stdoutClone := dupStdout() - if stdoutClone == nil { - // If we can't dup stdout, fall back to NoopOutputInterceptor behavior - return &ForwardingOutputInterceptor{ - interceptor: NoopOutputInterceptor{}, - stdoutClone: nil, - } - } - - return &ForwardingOutputInterceptor{ - interceptor: NewOutputInterceptor(), - stdoutClone: stdoutClone, - } -} - -func (f *ForwardingOutputInterceptor) StartInterceptingOutput() { - if f.stdoutClone != nil { - f.interceptor.StartInterceptingOutputAndForwardTo(f.stdoutClone) - } else { - f.interceptor.StartInterceptingOutput() - } -} - -func (f *ForwardingOutputInterceptor) StartInterceptingOutputAndForwardTo(w io.Writer) { - f.interceptor.StartInterceptingOutputAndForwardTo(w) -} - -func (f *ForwardingOutputInterceptor) StopInterceptingAndReturnOutput() string { - return f.interceptor.StopInterceptingAndReturnOutput() -} - -func (f *ForwardingOutputInterceptor) PauseIntercepting() { - f.interceptor.PauseIntercepting() -} - -func (f *ForwardingOutputInterceptor) ResumeIntercepting() { - f.interceptor.ResumeIntercepting() -} - -func (f *ForwardingOutputInterceptor) Shutdown() { - f.interceptor.Shutdown() - if f.stdoutClone != nil { - f.stdoutClone.Close() - f.stdoutClone = nil - } -} - -type AnnotateFunc func(testName string, test types.TestSpec) - -func (suite *Suite) SetAnnotateFn(fn AnnotateFunc) { - suite.annotateFn = fn -} - -func (suite *Suite) GetReport() types.Report { - return suite.report -} - -func (suite *Suite) WalkTests(fn AnnotateFunc) { - if suite.phase != PhaseBuildTree { - panic("cannot run before building the tree = call suite.BuildTree() first") - } - ApplyNestedFocusPolicyToTree(suite.tree) - specs := GenerateSpecsFromTreeRoot(suite.tree) - for _, spec := range specs { - fn(spec.Text(), spec) - } -} - -func (suite *Suite) InPhaseBuildTree() bool { - return suite.phase == PhaseBuildTree -} - -func (suite *Suite) ClearBeforeAndAfterSuiteNodes() { - // Don't build the tree multiple times, it results in multiple initing of tests - if !suite.InPhaseBuildTree() { - suite.BuildTree() - } - newNodes := Nodes{} - for _, node := range suite.suiteNodes { - if node.NodeType == types.NodeTypeBeforeSuite || node.NodeType == types.NodeTypeAfterSuite || node.NodeType == types.NodeTypeSynchronizedBeforeSuite || node.NodeType == types.NodeTypeSynchronizedAfterSuite { - continue - } - newNodes = append(newNodes, node) - } - suite.suiteNodes = newNodes -} - -func (suite *Suite) RunSpec(spec types.TestSpec, suiteLabels Labels, suiteDescription, suitePath string, failer *Failer, writer WriterInterface, suiteConfig types.SuiteConfig, reporterConfig types.ReporterConfig) (bool, bool) { - if suite.phase != PhaseBuildTree { - panic("cannot run before building the tree = call suite.BuildTree() first") - } - - suite.phase = PhaseRun - suite.client = nil - suite.failer = failer - suite.reporter = reporters.NewDefaultReporter(reporterConfig, writer) - suite.writer = writer - if strings.ToLower(suiteConfig.OutputInterceptorMode) == "none" { - suite.outputInterceptor = NoopOutputInterceptor{} - } else { - suite.outputInterceptor = NewForwardingOutputInterceptor() - } - if suite.config.Timeout > 0 { - suite.deadline = time.Now().Add(suiteConfig.Timeout) - } - suite.interruptHandler = interrupt_handler.NewInterruptHandler(nil) - suite.config = suiteConfig - - success := suite.runSpecs(suiteDescription, suiteLabels, SemVerConstraints{}, suitePath, false, []Spec{spec.(Spec)}) - - return success, false -} diff --git a/vendor/github.com/onsi/ginkgo/v2/types/types_patch.go b/vendor/github.com/onsi/ginkgo/v2/types/types_patch.go deleted file mode 100644 index 02d319bba..000000000 --- a/vendor/github.com/onsi/ginkgo/v2/types/types_patch.go +++ /dev/null @@ -1,8 +0,0 @@ -package types - -type TestSpec interface { - CodeLocations() []CodeLocation - Text() string - AppendText(text string) - Labels() []string -} diff --git a/vendor/github.com/onsi/gomega/gcustom/make_matcher.go b/vendor/github.com/onsi/gomega/gcustom/make_matcher.go deleted file mode 100644 index ca556ceb0..000000000 --- a/vendor/github.com/onsi/gomega/gcustom/make_matcher.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -package gcustom provides a simple mechanism for creating custom Gomega matchers -*/ -package gcustom - -import ( - "fmt" - "reflect" - "strings" - "text/template" - - "github.com/onsi/gomega/format" -) - -var interfaceType = reflect.TypeOf((*any)(nil)).Elem() -var errInterface = reflect.TypeOf((*error)(nil)).Elem() - -var defaultTemplate = template.Must(ParseTemplate("{{if .Failure}}Custom matcher failed for:{{else}}Custom matcher succeeded (but was expected to fail) for:{{end}}\n{{.FormattedActual}}")) - -func formatObject(object any, indent ...uint) string { - indentation := uint(0) - if len(indent) > 0 { - indentation = indent[0] - } - return format.Object(object, indentation) -} - -/* -ParseTemplate allows you to precompile templates for MakeMatcher's custom matchers. - -Use ParseTemplate if you are concerned about performance and would like to avoid repeatedly parsing failure message templates. The data made available to the template is documented in the WithTemplate() method of CustomGomegaMatcher. - -Once parsed you can pass the template in either as an argument to MakeMatcher(matchFunc,